lib/rspec/rails/adapters.rb in rspec-rails-2.99.0 vs lib/rspec/rails/adapters.rb in rspec-rails-3.0.0.beta1
- old
+ new
@@ -1,23 +1,16 @@
require 'delegate'
-require 'active_support'
require 'active_support/concern'
module RSpec
module Rails
if ::Rails::VERSION::STRING >= '4.1.0'
gem 'minitest'
require 'minitest/assertions'
Assertions = Minitest::Assertions
else
- begin
- require 'test/unit/assertions'
- rescue LoadError
- # work around for Rubinius not having a std std-lib
- require 'rubysl-test-unit' if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
- require 'test/unit/assertions'
- end
+ require 'test/unit/assertions'
Assertions = Test::Unit::Assertions
end
# @api private
class AssertionDelegator < Module
@@ -106,23 +99,23 @@
#
# Wraps `setup` calls from within Rails' testing framework in `before`
# hooks.
def setup(*methods)
methods.each do |method|
- if method.to_s =~ /^setup_(with_controller|fixtures|controller_request_and_response)$/
- prepend_before { __send__ method }
+ if method.to_s =~ /^setup_(fixtures|controller_request_and_response)$/
+ prepend_before { send method }
else
- before { __send__ method }
+ before { send method }
end
end
end
# @api private
#
# Wraps `teardown` calls from within Rails' testing framework in
# `after` hooks.
def teardown(*methods)
- methods.each { |method| after { __send__ method } }
+ methods.each { |method| after { send method } }
end
end
# @api private
def method_name