From 81962dc2762b8fad15b4a277086c6b7f1242d6ff Mon Sep 17 00:00:00 2001 From: Colin Surprenant Date: Tue, 10 Jul 2012 15:20:24 -0400 Subject: [PATCH] added spec for on_receive body with :emit => false --- spec/red_storm/simple_bolt_spec.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/spec/red_storm/simple_bolt_spec.rb b/spec/red_storm/simple_bolt_spec.rb index 7439491..ad9bcdf 100644 --- a/spec/red_storm/simple_bolt_spec.rb +++ b/spec/red_storm/simple_bolt_spec.rb @@ -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