summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-11-19 23:27:07 -0600
committerLuke Kanies <luke@madstop.com>2007-11-19 23:27:07 -0600
commit53008e567fd64f391e0b45652b2f4ac1551ccf47 (patch)
treea67926faf1e9599af2c60fde3c005b2f7118925d /spec/unit
parent9e5fc76eb77a9b90afb384d34a8e5bf63f79af6e (diff)
downloadpuppet-53008e567fd64f391e0b45652b2f4ac1551ccf47.tar.gz
puppet-53008e567fd64f391e0b45652b2f4ac1551ccf47.tar.xz
puppet-53008e567fd64f391e0b45652b2f4ac1551ccf47.zip
The Puppet settings instance now validates environments when
you set an environment.
Diffstat (limited to 'spec/unit')
-rwxr-xr-xspec/unit/node/environment.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/unit/node/environment.rb b/spec/unit/node/environment.rb
index cccff7b97..69d7acb47 100755
--- a/spec/unit/node/environment.rb
+++ b/spec/unit/node/environment.rb
@@ -29,6 +29,11 @@ describe Puppet::Node::Environment do
Puppet::Node::Environment.valid?(:one).should be_true
end
+ it "should be used to determine when an environment setting is valid" do
+ Puppet.settings.expects(:value).with(:environments).returns("one,two")
+ proc { Puppet.settings[:environment] = :three }.should raise_error(ArgumentError)
+ end
+
it "should use the default environment if no name is provided while initializing an environment" do
Puppet.settings.expects(:value).with(:environments).returns("one,two")
Puppet.settings.expects(:value).with(:environment).returns("one")