Class: Cheffish::RSpec::Matchers::PartiallyMatch
- Inherits:
-
Object
- Object
- Cheffish::RSpec::Matchers::PartiallyMatch
- Includes:
- RSpec::Matchers::Composable
- Defined in:
- lib/cheffish/rspec/matchers/partially_match.rb
Instance Method Summary collapse
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
-
#initialize(example, expected) ⇒ PartiallyMatch
constructor
A new instance of PartiallyMatch.
- #matches?(actual) ⇒ Boolean
Constructor Details
#initialize(example, expected) ⇒ PartiallyMatch
Returns a new instance of PartiallyMatch.
7 8 9 10 |
# File 'lib/cheffish/rspec/matchers/partially_match.rb', line 7 def initialize(example, expected) @example = example @expected = expected end |
Instance Method Details
#failure_message ⇒ Object
17 18 19 |
# File 'lib/cheffish/rspec/matchers/partially_match.rb', line 17 def "expected #{@actual} to match #{@expected}" end |
#failure_message_when_negated ⇒ Object
21 22 23 |
# File 'lib/cheffish/rspec/matchers/partially_match.rb', line 21 def "expected #{@actual} not to match #{@expected}" end |
#matches?(actual) ⇒ Boolean
12 13 14 15 |
# File 'lib/cheffish/rspec/matchers/partially_match.rb', line 12 def matches?(actual) @actual = actual partially_matches_values(@expected, actual) end |