spec/arborist/event_spec.rb in arborist-0.0.1.pre20160128152542 vs spec/arborist/event_spec.rb in arborist-0.0.1.pre20160606141735
- old
+ new
@@ -24,19 +24,19 @@
describe "subscription support" do
it "matches a subscription with only an event type if the type is the same" do
- sub = Arborist::Subscription.new( :publisher, 'test.event' )
+ sub = Arborist::Subscription.new( 'test.event' ) {}
event = described_class.create( TestEvent, [] )
expect( event ).to match( sub )
end
it "always matches a subscription with a nil event type" do
- sub = Arborist::Subscription.new( :publisher )
+ sub = Arborist::Subscription.new {}
event = described_class.create( TestEvent, [] )
expect( event ).to match( sub )
end
@@ -47,10 +47,10 @@
it "can represent itself as a Hash" do
payload = { 'status' => ['up', 'down'] }
ev = TestEvent.create( TestEvent, payload )
- result = ev.to_hash
+ result = ev.to_h
expect( result ).to include( 'type', 'data' )
expect( result['type'] ).to eq( 'test.event' )
expect( result['data'] ).to eq( payload )