Class: Wisper::RSpec::EventRecorder
- Inherits:
-
Object
- Object
- Wisper::RSpec::EventRecorder
show all
- Defined in:
- lib/wisper/rspec/matchers.rb
Instance Method Summary
collapse
Constructor Details
Returns a new instance of EventRecorder.
6
7
8
|
# File 'lib/wisper/rspec/matchers.rb', line 6
def initialize
@broadcast_events = []
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
14
15
16
|
# File 'lib/wisper/rspec/matchers.rb', line 14
def method_missing(method_name, *args, &block)
@broadcast_events << [method_name.to_s, *args]
end
|
Instance Method Details
#broadcast?(event_name, *args) ⇒ Boolean
18
19
20
21
22
23
24
|
# File 'lib/wisper/rspec/matchers.rb', line 18
def broadcast?(event_name, *args)
if args.size > 0
@broadcast_events.include?([event_name.to_s, *args])
else
@broadcast_events.map(&:first).include?(event_name.to_s)
end
end
|
#respond_to?(method_name) ⇒ Boolean
10
11
12
|
# File 'lib/wisper/rspec/matchers.rb', line 10
def respond_to?(method_name)
true
end
|