spec/arborist/observer_spec.rb in arborist-0.0.1.pre20160606141735 vs spec/arborist/observer_spec.rb in arborist-0.0.1.pre20160829140603
- old
+ new
@@ -43,27 +43,27 @@
end
it "can specify an action to run when a subscribed event is received" do
observer = described_class.new( "testing observer" ) do
- action do |uuid, event|
- puts( uuid )
+ action do |event|
+ # no-op
end
end
expect( observer.actions ).to be_an( Array )
expect( observer.actions.length ).to eq( 1 )
end
it "can specify more than one action to run when a subscribed event is received" do
observer = described_class.new( "testing observer" ) do
- action do |uuid, event|
- puts( uuid )
+ action do |event|
+ # no-op
end
- action do |uuid, event|
- $stderr.puts( uuid )
+ action do |event|
+ # no-op
end
end
expect( observer.actions ).to be_an( Array )
expect( observer.actions.length ).to eq( 2 )
@@ -72,11 +72,11 @@
it "can specify a summary action" do
observer = described_class.new( "testing observer" ) do
summarize( every: 5 ) do |events|
- puts( events.size )
+ # no-op
end
end
expect( observer.actions ).to be_an( Array )
expect( observer.actions.length ).to eq( 1 )
@@ -85,14 +85,14 @@
it "can specify a mix of regular and summary actions" do
observer = described_class.new( "testing observer" ) do
summarize( every: 5 ) do |events|
- puts( events.size )
+ # no-op
end
- action do |uuid, event|
- $stderr.puts( uuid )
+ action do |event|
+ # no-op
end
end
expect( observer.actions ).to be_an( Array )
expect( observer.actions.length ).to eq( 2 )
@@ -102,14 +102,14 @@
it "passes events it is given to handle to its actions" do
observer = described_class.new( "testing observer" ) do
summarize( every: 5 ) do |events|
- puts( events.size )
+ # no-op
end
- action do |uuid, event|
- $stderr.puts( uuid )
+ action do |event|
+ # no-op
end
end
event = {}
expect( observer.actions.first ).to receive( :handle_event ).with( event )
@@ -124,11 +124,11 @@
observer = described_class.new( "testing observer" ) do
summarize( every: 5 ) do |events|
summarize_called = true
end
- action do |uuid, event|
- $stderr.puts( uuid )
+ action do |event|
+ # no-op
end
end
results = observer.timers