spec/cli_spec.rb in redis_failover-0.8.3 vs spec/cli_spec.rb in redis_failover-0.8.4

- old
+ new

@@ -33,8 +33,19 @@ '-p redis_pass', '--max-failures', '1']) opts[:max_failures].should == 1 end + + it 'properly parses the config file' do + opts = CLI.parse(['-C', "#{File.dirname(__FILE__)}/support/config/single_environment.yml"]) + opts[:zkservers].should == 'zk01:2181,zk02:2181,zk03:2181' + + opts = CLI.parse(['-C', "#{File.dirname(__FILE__)}/support/config/multiple_environments.yml", '-E', 'development']) + opts[:zkservers].should == 'localhost:2181' + + opts = CLI.parse(['-C', "#{File.dirname(__FILE__)}/support/config/multiple_environments.yml", '-E', 'staging']) + opts[:zkservers].should == 'zk01:2181,zk02:2181,zk03:2181' + end end end end