Skip to content
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

Rails 4 and 4.1 adapters #42

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion lib/wrong/adapters/rspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,20 @@

if RSpec.const_defined? :Rails
require 'rails/version'
if Rails::VERSION::MAJOR == 3
case Rails::VERSION::STRING
when /^4\.[12]/
# RSpec 2 plus Rails 4.1/4.2
module RSpec::Rails::MinitestAssertionAdapter::ClassMethods
def define_assertion_delegators_with_removed
define_assertion_delegators_without_removed
class_eval do
remove_method :assert
end
end
alias_method_chain :define_assertion_delegators, :removed
end

when /^4\.0/, /^3\./
# RSpec 2 plus Rails 3
module RSpec::Rails::TestUnitAssertionAdapter
included do
Expand All @@ -16,6 +29,8 @@ module RSpec::Rails::TestUnitAssertionAdapter
end
end
end
else
raise "Wrong's RSpec adapter can't be applied to your Rails version #{Rails::VERSION::STRING}"
end
end

Expand Down