Sha256: d8c6691bbf751d0a40d72ebc4beecbc9fa53d6879e89e217a27f11299e470adb

Contents?: true

Size: 481 Bytes

Versions: 3

Compression:

Stored size: 481 Bytes

Contents

### Wisper Stubbing
# This is a proposal for integration as part of wisper core
# for testing: https://github.com/krisleech/wisper/issues/1
class TestWisperPublisher
  include Wisper::Publisher
  def initialize(*args); end
end

def stub_wisper_publisher(clazz, called_method, event_to_publish, *published_event_args)
  stub_const(clazz, Class.new(TestWisperPublisher) do
    define_method(called_method) do
      publish(event_to_publish, *published_event_args)
    end
  end)
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
wisper-1.2.1 lib/wisper/rspec/stub_wisper_publisher.rb
wisper-1.2.0 lib/wisper/rspec/stub_wisper_publisher.rb
wisper-1.1.0 lib/wisper/rspec/stub_wisper_publisher.rb