Class: Stenotype::Test::Matchers::DiffSizeMatchesExpectation
- Inherits:
-
Object
- Object
- Stenotype::Test::Matchers::DiffSizeMatchesExpectation
- Defined in:
- lib/stenotype/test/matchers.rb
Instance Attribute Summary collapse
-
#expected_count ⇒ Object
readonly
Returns the value of attribute expected_count.
-
#matching_events ⇒ Object
readonly
Returns the value of attribute matching_events.
Instance Method Summary collapse
- #failure_message ⇒ Object
-
#initialize(matching_events, expected_count) ⇒ DiffSizeMatchesExpectation
constructor
A new instance of DiffSizeMatchesExpectation.
- #matches? ⇒ Boolean
Constructor Details
#initialize(matching_events, expected_count) ⇒ DiffSizeMatchesExpectation
Returns a new instance of DiffSizeMatchesExpectation.
12 13 14 15 |
# File 'lib/stenotype/test/matchers.rb', line 12 def initialize(matching_events, expected_count) @matching_events = matching_events @expected_count = expected_count end |
Instance Attribute Details
#expected_count ⇒ Object (readonly)
Returns the value of attribute expected_count.
10 11 12 |
# File 'lib/stenotype/test/matchers.rb', line 10 def expected_count @expected_count end |
#matching_events ⇒ Object (readonly)
Returns the value of attribute matching_events.
10 11 12 |
# File 'lib/stenotype/test/matchers.rb', line 10 def matching_events @matching_events end |
Instance Method Details
#failure_message ⇒ Object
17 18 19 |
# File 'lib/stenotype/test/matchers.rb', line 17 def "expected to see #{expected_count} event(s) but got #{matching_events.count} event(s)." end |
#matches? ⇒ Boolean
21 22 23 |
# File 'lib/stenotype/test/matchers.rb', line 21 def matches? matching_events.count == expected_count end |