summaryrefslogtreecommitdiffstats
path: root/spec/unit/node
diff options
context:
space:
mode:
authorLuke Kanies <luke@reductivelabs.com>2010-01-27 10:19:09 -0800
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commit744295d1058e640b778bdac39202c97adbc59c9f (patch)
treed565a88142156338e90dcf24acf71840585f4362 /spec/unit/node
parent4f907c66ab3ee973323ef8a14bc5192bcc78967b (diff)
Allowing Environment.new to take an environment
This can happen because we're almost always converting to environment instances from strings. Shouldn't happen often, but it's easier to be more failure-tolerant. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
Diffstat (limited to 'spec/unit/node')
-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 ac542d01b..d0db2504c 100755
--- a/spec/unit/node/environment.rb
+++ b/spec/unit/node/environment.rb
@@ -43,6 +43,11 @@ describe Puppet::Node::Environment do
Puppet::Node::Environment.new(:one).to_s.should == "one"
end
+ it "should just return any provided environment if an environment is provided as the name" do
+ one = Puppet::Node::Environment.new(:one)
+ Puppet::Node::Environment.new(one).should equal(one)
+ end
+
describe "when managing known resource types" do
before do
@env = Puppet::Node::Environment.new("dev")