Permalink
Browse files

check in some testcases for environment thingis

  • Loading branch information...
1 parent e2248f8 commit a15e1916751fdd4600527b922fcd1ad93d2d923f @gnufied committed Aug 15, 2008
Showing with 36 additions and 0 deletions.
  1. +17 −0 test/client/backgroundrb.yml
  2. +19 −0 test/client/test_bdrb_config.rb
@@ -0,0 +1,17 @@
+---
+:backgroundrb:
+ :ip: 0.0.0.0
+ :port: 11008
+ :log: foreground
+ :environment: production
+ :result_storage: memcache
+
+:memcache: "localhost:11211"
+
+# :client: "0.0.0.0:11006,0.0.0.0:11008"
+
+:schedules:
+ :wow_worker:
+ :foo:
+ :trigger_args: */60 * * * * * *
+
@@ -0,0 +1,19 @@
+require File.join(File.dirname(__FILE__) + "/../bdrb_test_helper")
+require File.join(File.dirname(__FILE__) + "/../bdrb_client_test_helper")
+
+context "For BackgrounDRb config" do
+ conf_file = File.join(File.dirname(__FILE__),"backgroundrb.yml")
+ specify "should setup correct environment from cmd options" do
+ BackgrounDRb::Config.parse_cmd_options(["-e", "production"])
+ BackgrounDRb::Config.read_config(conf_file)
+ ENV["RAILS_ENV"].should == "production"
+ RAILS_ENV.should == "production"
+ end
+
+ specify "should setup correct environment from conf file" do
+ BackgrounDRb::Config.parse_cmd_options([])
+ BackgrounDRb::Config.read_config(conf_file)
+ ENV["RAILS_ENV"].should == "production"
+ RAILS_ENV.should == "production"
+ end
+end

0 comments on commit a15e191

Please sign in to comment.