Module: RSpec::Rails::TestUnitAssertionAdapter::ClassMethods
- Defined in:
- lib/rspec/rails/adapters.rb
Instance Method Summary collapse
-
#assertion_method_names ⇒ Object
private
Returns the names of assertion methods that we want to expose to examples without exposing non-assertion methods in Test::Unit or Minitest.
- #define_assertion_delegators ⇒ Object private
Instance Method Details
#assertion_method_names ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the names of assertion methods that we want to expose to examples without exposing non-assertion methods in Test::Unit or Minitest.
42 43 44 45 |
# File 'lib/rspec/rails/adapters.rb', line 42 def assertion_method_names Test::Unit::Assertions.public_instance_methods.select{|m| m.to_s =~ /^(assert|flunk)/} + [:build_message] end |
#define_assertion_delegators ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
48 49 50 51 52 53 54 55 56 |
# File 'lib/rspec/rails/adapters.rb', line 48 def define_assertion_delegators assertion_method_names.each do |m| class_eval <<-CODE def #{m}(*args, &block) assertion_delegator.send :#{m}, *args, &block end CODE end end |