Sha256: f6129876187721e370d0faba4ac4f77833037dc6c0e76f4b342da05e699dea2d

Contents?: true

Size: 470 Bytes

Versions: 1

Compression:

Stored size: 470 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
  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

1 entries across 1 versions & 1 rubygems

Version Path
wisper-1.0.1 lib/wisper/rspec/stub_wisper_publisher.rb