Class: Surrogate::RSpec::WithFilter::RSpecMatchAsserter
- Inherits:
-
Object
- Object
- Surrogate::RSpec::WithFilter::RSpecMatchAsserter
- Defined in:
- lib/surrogate/rspec/with_filter.rb
Instance Attribute Summary collapse
-
#actual_invocation ⇒ Object
Returns the value of attribute actual_invocation.
-
#expected_invocation ⇒ Object
Returns the value of attribute expected_invocation.
Instance Method Summary collapse
- #approximate_2_11? ⇒ Boolean
- #approximate_3_0_0_rc? ⇒ Boolean
-
#initialize(actual_invocation, expected_invocation) ⇒ RSpecMatchAsserter
constructor
A new instance of RSpecMatchAsserter.
- #match? ⇒ Boolean
- #matcher_class ⇒ Object
Constructor Details
#initialize(actual_invocation, expected_invocation) ⇒ RSpecMatchAsserter
Returns a new instance of RSpecMatchAsserter.
10 11 12 |
# File 'lib/surrogate/rspec/with_filter.rb', line 10 def initialize(actual_invocation, expected_invocation) self.actual_invocation, self.expected_invocation = actual_invocation, expected_invocation end |
Instance Attribute Details
#actual_invocation ⇒ Object
Returns the value of attribute actual_invocation.
8 9 10 |
# File 'lib/surrogate/rspec/with_filter.rb', line 8 def actual_invocation @actual_invocation end |
#expected_invocation ⇒ Object
Returns the value of attribute expected_invocation.
8 9 10 |
# File 'lib/surrogate/rspec/with_filter.rb', line 8 def expected_invocation @expected_invocation end |
Instance Method Details
#approximate_2_11? ⇒ Boolean
23 24 25 |
# File 'lib/surrogate/rspec/with_filter.rb', line 23 def approximate_2_11? Gem::Requirement.create('~> 2.11').satisfied_by? Gem::Version.new(::RSpec::Mocks::Version::STRING) end |
#approximate_3_0_0_rc? ⇒ Boolean
27 28 29 |
# File 'lib/surrogate/rspec/with_filter.rb', line 27 def approximate_3_0_0_rc? Gem::Requirement.create('~> 3.0.0.rc').satisfied_by? Gem::Version.new(::RSpec::Mocks::Version::STRING) end |
#match? ⇒ Boolean
14 15 16 17 |
# File 'lib/surrogate/rspec/with_filter.rb', line 14 def match? rspec_arg_expectation = matcher_class.new *expected_invocation.args rspec_arg_expectation.args_match? *actual_invocation.args end |
#matcher_class ⇒ Object
19 20 21 |
# File 'lib/surrogate/rspec/with_filter.rb', line 19 def matcher_class ::RSpec::Mocks::ArgumentListMatcher end |