Class: Stenotype::Test::Matchers::EventEmitted
- Inherits:
-
Object
- Object
- Stenotype::Test::Matchers::EventEmitted
- Defined in:
- lib/stenotype/test/matchers.rb
Instance Attribute Summary collapse
-
#expected_event_name ⇒ Object
readonly
Returns the value of attribute expected_event_name.
-
#matching_events ⇒ Object
readonly
Returns the value of attribute matching_events.
Instance Method Summary collapse
- #failure_message ⇒ Object
-
#initialize(matching_events, expected_event_name) ⇒ EventEmitted
constructor
A new instance of EventEmitted.
- #matches? ⇒ Boolean
Constructor Details
#initialize(matching_events, expected_event_name) ⇒ EventEmitted
Returns a new instance of EventEmitted.
66 67 68 69 |
# File 'lib/stenotype/test/matchers.rb', line 66 def initialize(matching_events, expected_event_name) @matching_events = matching_events @expected_event_name = expected_event_name end |
Instance Attribute Details
#expected_event_name ⇒ Object (readonly)
Returns the value of attribute expected_event_name.
64 65 66 |
# File 'lib/stenotype/test/matchers.rb', line 64 def expected_event_name @expected_event_name end |
#matching_events ⇒ Object (readonly)
Returns the value of attribute matching_events.
64 65 66 |
# File 'lib/stenotype/test/matchers.rb', line 64 def matching_events @matching_events end |
Instance Method Details
#failure_message ⇒ Object
75 76 77 |
# File 'lib/stenotype/test/matchers.rb', line 75 def "expected to see a '#{expected_event_name}' event but got nothing" end |
#matches? ⇒ Boolean
71 72 73 |
# File 'lib/stenotype/test/matchers.rb', line 71 def matches? matching_events.any? end |