0
require File.join(File.dirname(__FILE__) + "/bdrb_test_helper")
0
+context "Master proxy for reloadable workers" do
0
+ BackgrounDRb::Config::RAILS_ENV = "production"
0
+ CONFIG_FILE = {:schedules=>
0
+ :foo_worker => { :barbar => {:trigger_args=>"*/10 * * * * *", :data =>"Hello World" }},
0
+ :bar_worker => { :do_job => {:trigger_args=>"*/10 * * * * *", :data =>"Hello World" }}
0
+ :backgroundrb=> {:log=>"foreground", :lazy_load=>true, :debug_log=>false, :environment=>"production", :port=>11006, :ip=>"localhost"}
0
+ Packet::Reactor.stubs(:run)
0
+ @master_proxy = BackgrounDRb::MasterProxy.new
0
+ specify "should load schedule of workers which are reloadable" do
0
+ @master_proxy.find_reloadable_worker
0
+ @master_proxy.reloadable_workers.should.not.be []
0
+ @master_proxy.reloadable_workers.should == [BarWorker]
0
+ @master_proxy.worker_triggers.should.not.be {}
0
+ assert @master_proxy.worker_triggers.keys.include?(:bar_worker)
0
+ assert @master_proxy.worker_triggers[:bar_worker].keys.include?(:do_job)
0
+ @master_proxy.worker_triggers[:bar_worker][:do_job].should.not.be { }
0
+ specify "load schedule should load schedule of worker specified" do
0
+ @master_proxy.load_reloadable_schedule(BarWorker).should.not.be { }
0
+ specify "should invoke worker methods which are ready to run" do
0
+ specify "should not run worker methods which are not ready to run" do
0
context "Master Worker in general should" do
0
specify "read data according to binary protocol and recreate objects" do
0
@@ -49,41 +87,3 @@ context "Master Worker in general should" do
0
-context "Master proxy for reloadable workers" do
0
- BackgrounDRb::Config::RAILS_ENV = "production"
0
- CONFIG_FILE = {:schedules=>
0
- :foo_worker => { :barbar => {:trigger_args=>"*/10 * * * * *", :data =>"Hello World" }},
0
- :bar_worker => { :do_job => {:trigger_args=>"*/10 * * * * *", :data =>"Hello World" }}
0
- :backgroundrb=> {:log=>"foreground", :lazy_load=>true, :debug_log=>false, :environment=>"production", :port=>11006, :ip=>"localhost"}
0
- Packet::Reactor.stubs(:run)
0
- @master_proxy = BackgrounDRb::MasterProxy.new
0
- specify "should load schedule of workers which are reloadable" do
0
- @master_proxy.find_reloadable_worker
0
- @master_proxy.reloadable_workers.should.not.be []
0
- @master_proxy.reloadable_workers.should == [BarWorker]
0
- @master_proxy.worker_triggers.should.not.be {}
0
- assert @master_proxy.worker_triggers.keys.include?(:bar_worker)
0
- assert @master_proxy.worker_triggers[:bar_worker].keys.include?(:do_job)
0
- @master_proxy.worker_triggers[:bar_worker][:do_job].should.not.be { }
0
- specify "load schedule should load schedule of worker specified" do
0
- @master_proxy.load_reloadable_schedule(BarWorker).should.not.be { }
0
- specify "should invoke worker methods which are ready to run" do
0
- specify "should not run worker methods which are not ready to run" do
Comments
No one has commented yet.