issue #25 - add specs for spout activate/deactivate and per component configuration

This commit is contained in:
Colin Surprenant 2013-05-09 15:11:49 -04:00
parent f7f8be36ae
commit bc1b6a7455
2 changed files with 43 additions and 0 deletions

View File

@ -313,6 +313,18 @@ describe RedStorm::SimpleBolt do
end
end
describe "configure statement" do
it "should parse configuration block" do
class Bolt1 < RedStorm::SimpleBolt
configure {trigger}
end
bolt = Bolt1.new
bolt.should_receive(:trigger)
bolt.instance_exec(&Bolt1.configure_block)
end
end
# log specs are mostly the same ats in the spout specs. if these are modified, sync with spout
describe "log statement" do
@ -677,5 +689,14 @@ describe RedStorm::SimpleBolt do
end
end
describe "get_component_configuration" do
it "should return Backtype::Config object" do
class Bolt1 < RedStorm::SimpleBolt; end
bolt = Bolt1.new
bolt.get_component_configuration.should be_instance_of(Backtype::Config)
end
end
end
end

View File

@ -391,6 +391,19 @@ describe RedStorm::SimpleSpout do
end
end
describe "configure statement" do
it "should parse configuration block" do
class Spout1 < RedStorm::SimpleSpout
configure {trigger}
end
spout = Spout1.new
spout.should_receive(:trigger)
spout.instance_exec(&Spout1.configure_block)
end
end
# log specs are mostly the same ats in the bolt specs. if these are modified, sync with bolt
describe "log statement" do
@ -843,5 +856,14 @@ describe RedStorm::SimpleSpout do
spout.fail("test")
end
end
describe "get_component_configuration" do
it "should return Backtype::Config object" do
class Spout1 < RedStorm::SimpleSpout; end
spout = Spout1.new
spout.get_component_configuration.should be_instance_of(Backtype::Config)
end
end
end
end