class Wisper::RSpec::EventRecorder

Attributes

broadcast_events[R]

Public Class Methods

new() click to toggle source
# File lib/wisper/rspec/matchers.rb, line 10
def initialize
  @broadcast_events = []
end

Public Instance Methods

broadcast?(event_name, *args) click to toggle source
# File lib/wisper/rspec/matchers.rb, line 26
def broadcast?(event_name, *args)
  expected_args = args.size > 0 ? args : [any_args]
  @broadcast_events.any? do |event_params|
    matcher = ::RSpec::Mocks::ArgumentListMatcher.new(event_name.to_s, *expected_args)
    matcher.args_match?(*event_params)
  end
end
method_missing(method_name, *args, &block) click to toggle source
# File lib/wisper/rspec/matchers.rb, line 22
def method_missing(method_name, *args, &block)
  @broadcast_events << [method_name.to_s, *args]
end
respond_to?(method_name) click to toggle source
# File lib/wisper/rspec/matchers.rb, line 14
def respond_to?(method_name)
  true
end
respond_to_missing?(*) click to toggle source
# File lib/wisper/rspec/matchers.rb, line 18
def respond_to_missing?(*)
  true
end