added spec for on_receive body with :emit => false

This commit is contained in:
Colin Surprenant 2012-07-10 15:20:24 -04:00
parent b1ea5ad05e
commit 81962dc276
1 changed files with 14 additions and 0 deletions

View File

@ -90,6 +90,20 @@ describe RedStorm::SimpleBolt do
RedStorm::SimpleBolt.send(:anchor?).should be_false
end
it "should execute body with :emit => false" do
class Bolt1 < RedStorm::SimpleBolt
on_receive :emit => false do |tuple|
test(tuple)
end
end
Bolt1.receive_options.should == DEFAULT_RECEIVE_OPTIONS.merge(:emit => false)
Bolt1.send(:emit?).should be_false
bolt = Bolt1.new
bolt.should_receive(:test).with("tuple").once
bolt.execute("tuple")
end
describe "with block argument" do
it "should parse without options" do