issue #25 - add specs for spout activate/deactivate and per component configuration
This commit is contained in:
parent
f7f8be36ae
commit
bc1b6a7455
|
@ -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
|
|
@ -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
|
Loading…
Reference in New Issue