Sha256: 62c7e5729d9da8378b479f280340642924ae18b14b3a7fba7a8a0081326b11e0

Contents?: true

Size: 713 Bytes

Versions: 3

Compression:

Stored size: 713 Bytes

Contents

require File.expand_path('../test_helper', __FILE__)

module Propono
  class SubscriberTest < Minitest::Test

    def test_subscribe_by_queue_calls_queue_subscriber
      subscriber = QueueSubscriber.new("topic")
      QueueSubscriber.expects(:new).with("topic").returns(subscriber)
      QueueSubscriber.any_instance.expects(:subscribe)
      Subscriber.subscribe_by_queue("topic")
    end

    def test_subscribe_by_post_calls_post_subscribe
      subscriber = PostSubscriber.new("topic", 'endpoint')
      PostSubscriber.expects(:new).with("topic", 'endpoint').returns(subscriber)
      PostSubscriber.any_instance.expects(:subscribe)
      Subscriber.subscribe_by_post("topic", "endpoint")
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
propono-0.3.0 test/subscriber_test.rb
propono-0.2.0 test/subscriber_test.rb
propono-0.1.0 test/subscriber_test.rb