spec/cucumber/chef/config_spec.rb in cucumber-chef-2.1.0.rc.2 vs spec/cucumber/chef/config_spec.rb in cucumber-chef-2.1.0.rc.3

- old
+ new

@@ -44,12 +44,12 @@ it "Cucumber::Chef::Config[:mode] defaults to :user" do Cucumber::Chef::Config[:mode].should == :user end - it "Cucumber::Chef::Config[:provider] defaults to :aws" do - Cucumber::Chef::Config[:provider].should == :aws + it "Cucumber::Chef::Config.provider defaults to :vagrant" do + Cucumber::Chef::Config.provider.should == :vagrant end context "Cucumber::Chef::Config[:aws] default values" do it "Cucumber::Chef::Config[:aws][:aws_security_group] defaults to 'cucumber-chef'" do @@ -110,14 +110,14 @@ ################################################################################ describe "when configuration is valid" do it "should allow changing providers" do - Cucumber::Chef::Config[:provider] = :aws + Cucumber::Chef::Config.provider = :aws expect{ Cucumber::Chef::Config.verify_keys }.to_not raise_error(Cucumber::Chef::ConfigError) - Cucumber::Chef::Config[:provider] = :vagrant + Cucumber::Chef::Config.provider = :vagrant expect{ Cucumber::Chef::Config.verify_keys }.to_not raise_error(Cucumber::Chef::ConfigError) end it "should allow changing modes" do Cucumber::Chef::Config[:mode] = :test @@ -129,11 +129,11 @@ # this explodes in CI because we won't have our secret values set context "when provider is aws" do it "should verify the configuration" do user = ENV['OPSCODE_USER'] || ENV['USER'] - Cucumber::Chef::Config[:provider] = :aws + Cucumber::Chef::Config.provider = :aws Cucumber::Chef::Config[:aws][:aws_access_key_id] = ENV['AWS_ACCESS_KEY_ID'] Cucumber::Chef::Config[:aws][:aws_secret_access_key] = ENV['AWS_SECRET_ACCESS_KEY'] Cucumber::Chef::Config[:aws][:aws_ssh_key_id] = ENV['AWS_SSH_KEY_ID'] || user Cucumber::Chef::Config[:aws][:identity_file] = "#{ENV['HOME']}/.chef/#{user}.pem" Cucumber::Chef::Config[:aws][:region] = "us-west-2" @@ -147,28 +147,28 @@ ################################################################################ describe "when configuration is invalid" do it "should complain about missing configuration keys" do - Cucumber::Chef::Config[:provider] = nil + Cucumber::Chef::Config.provider = nil expect{ Cucumber::Chef::Config.verify_keys }.to raise_error(Cucumber::Chef::ConfigError) Cucumber::Chef::Config[:mode] = nil expect{ Cucumber::Chef::Config.verify_keys }.to raise_error(Cucumber::Chef::ConfigError) end it "should complain about invalid configuration key values" do - Cucumber::Chef::Config[:provider] = :awss + Cucumber::Chef::Config.provider = :awss expect{ Cucumber::Chef::Config.verify_keys }.to raise_error(Cucumber::Chef::ConfigError) Cucumber::Chef::Config[:mode] = :userr expect{ Cucumber::Chef::Config.verify_keys }.to raise_error(Cucumber::Chef::ConfigError) end describe "when provider is aws" do it "should complain about missing provider configuration keys" do - Cucumber::Chef::Config[:provider] = :aws + Cucumber::Chef::Config.provider = :aws expect{ Cucumber::Chef::Config.verify_provider_keys }.to raise_error(Cucumber::Chef::ConfigError) end end