Sha256: e10ea475c2b337cead352e9c4bcc86a7fcbb3417b6caa8abfc7941bae5704213

Contents?: true

Size: 644 Bytes

Versions: 7

Compression:

Stored size: 644 Bytes

Contents

require 'spec_helper'

module Weeter
  module Plugins
    describe NotificationPlugin do
      describe "#publish_tweet" do
        it "delegates to the configured plugin" do
          client_app_config = Hashie::Mash.new(:notification_plugin => :http)
          tweet_item = TweetItem.new({})

          mock_plugin = double(Notification::Http)
          expect(Notification::Http).to receive(:new).and_return(mock_plugin)

          expect(mock_plugin).to receive(:publish_tweet).with(tweet_item)

          plugin = NotificationPlugin.new(client_app_config)
          plugin.publish_tweet(tweet_item)
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
weeter-0.19.4 spec/weeter/plugins/notification_plugin_spec.rb
weeter-0.19.3 spec/weeter/plugins/notification_plugin_spec.rb
weeter-0.19.2 spec/weeter/plugins/notification_plugin_spec.rb
weeter-0.19.1 spec/weeter/plugins/notification_plugin_spec.rb
weeter-0.19.0 spec/weeter/plugins/notification_plugin_spec.rb
weeter-0.18.0 spec/weeter/plugins/notification_plugin_spec.rb
weeter-0.17.0 spec/weeter/plugins/notification_plugin_spec.rb