-
-
Notifications
You must be signed in to change notification settings - Fork 763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
webrat's have_selector does not give deprecation warning in rspec 2.99 but fails in rspec 3 #2085
Comments
Thanks for reporting this. It looks like we just forgot to add a deprecation to 2.99 for this :(. Specifically, this is what happened from what I can tell:
So we just flat-out missed the deprecation on this one. Sorry about that! @cupakromer, do you want to work up a PR for 2.99 that adds a deprecation for this? To fix it, you can essentially bring back what the deleted file was doing in 2.x: begin
require 'webrat'
rescue LoadError
end
RSpec.configure do |c|
if defined?(Webrat)
c.include Webrat::Matchers, :type => :request
c.include Webrat::Matchers, :type => :controller
c.include Webrat::Matchers, :type => :view
c.include Webrat::Matchers, :type => :helper
c.include Webrat::Matchers, :type => :mailer
c.include Webrat::Methods, :type => :request
c.include Webrat::Methods, :type => :controller
module RequestInstanceMethods
def last_response
@response
end
end
c.include RequestInstanceMethods, :type => :request
c.before :type => :controller do
Webrat.configure {|w| w.mode = :rails}
end
c.before :type => :request do
Webrat.configure {|w| w.mode = :rack}
end
end
end You may not need all of that but for full backwards compatility with what was happening in 2.x it's all needed. |
thanks. by the way awesome job with the whole 2.99, transpec, 3.x upgrade path. it handles so many cases. |
As time passes, the value of fixing this becomes lower than the effort required. Perhaps we've already crossed the threshold were this should be closed unfixed? |
Agree. Closing. |
if i understand the info in http://rspec.info/upgrading-from-rspec-2/ correctly, an rspec 3 failure with no corresponding 2.99 deprecation warning is considered a bug.
details:
using webrat 0.7.3 with
expect(some_string).to have_selector 'blahblah'
, ran fine with no deprecation warning in 2.99upgraded to rspec 3 and it started trying to call has_selector? on the string and gave an error
worked around the issue by putting a declaration in spec_helper
def have_selector(name, attributes = {}, &block)
Webrat::Matchers::HaveSelector.new(name, attributes, &block)
end
The text was updated successfully, but these errors were encountered: