Sha256: 6e043c8255acb715d6471cba7a59c1ccc349a53485bc7853c2521b065ca7c3fa
Contents?: true
Size: 1.08 KB
Versions: 12
Compression:
Stored size: 1.08 KB
Contents
require "spec_helper" describe Shamu::Events::Support do describe "#event_channel" do { "Users::UsersService" => "users", "Users::ProfileService" => "users/profile", "Users::Profiles::ProfilesService" => "users/profiles", "Service" => "", "Users::Service" => "users" }.each do |name, channel| it "is #{ channel } for #{ name }" do klass = Class.new( Shamu::Services::Service ) do include Shamu::Events::Support public :event_channel end allow( klass ).to receive( :name ).and_return name expect( klass.new.event_channel ).to eq channel end end end describe "event!" do hunt( :events_service, Shamu::Events::EventsService ) let( :klass ) do Class.new( Shamu::Services::Service ) do include Shamu::Events::Support public :event! end end let( :service ) { scorpion.new klass } it "publishes message to events_service" do expect( events_service ).to receive( :publish ) service.event! Shamu::Events::Message.new end end end
Version data entries
12 entries across 12 versions & 1 rubygems