summaryrefslogtreecommitdiffstats
path: root/spec/unit/node
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-10-17 09:01:04 -0500
committerLuke Kanies <luke@madstop.com>2008-10-17 09:01:04 -0500
commit8aee40de69e6fe8d67ab58a2e223443b15820584 (patch)
tree89e230df3b43302a542f2cb6869f63e2fb93f6d8 /spec/unit/node
parent1b517d2fb048603bd1743a662bde74e8ae4b13dc (diff)
parenta74ec60d33dee1c592ec858faeccc23d7a7b79f3 (diff)
downloadpuppet-8aee40de69e6fe8d67ab58a2e223443b15820584.tar.gz
puppet-8aee40de69e6fe8d67ab58a2e223443b15820584.tar.xz
puppet-8aee40de69e6fe8d67ab58a2e223443b15820584.zip
Merge branch '0.24.x' Removed the 'after' blocks that call Type.clear,
since that method is deprecated. Conflicts: CHANGELOG bin/puppetca lib/puppet/file_serving/fileset.rb lib/puppet/network/xmlrpc/client.rb lib/puppet/type/file/selcontext.rb spec/unit/file_serving/metadata.rb spec/unit/type/file.rb
Diffstat (limited to 'spec/unit/node')
-rwxr-xr-xspec/unit/node/environment.rb52
1 files changed, 0 insertions, 52 deletions
diff --git a/spec/unit/node/environment.rb b/spec/unit/node/environment.rb
index 8433a9877..872c70912 100755
--- a/spec/unit/node/environment.rb
+++ b/spec/unit/node/environment.rb
@@ -5,73 +5,21 @@ require File.dirname(__FILE__) + '/../../spec_helper'
require 'puppet/node/environment'
describe Puppet::Node::Environment do
- it "should provide a list of valid environments" do
- Puppet::Node::Environment.valid.should be_instance_of(Array)
- end
-
- it "should determine its list of valid environments from splitting the :environments setting on commas" do
- Puppet.settings.stubs(:value).with(:environments).returns("one,two")
- Puppet::Node::Environment.valid.collect { |e| e.to_s }.sort.should == %w{one two}.sort
- end
-
- it "should not use an environment when determining the list of valid environments" do
- Puppet.settings.expects(:value).with(:environments).returns("one,two")
- Puppet::Node::Environment.valid
- end
-
- it "should provide a means of identifying invalid environments" do
- Puppet.settings.expects(:value).with(:environments).returns("one,two")
- Puppet::Node::Environment.valid?(:three).should be_false
- end
-
- it "should provide a means of identifying valid environments" do
- Puppet.settings.expects(:value).with(:environments).returns("one,two")
- 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")
Puppet::Node::Environment.new().name.should == :one
end
it "should treat environment instances as singletons" do
- Puppet.settings.stubs(:value).with(:environments).returns("one")
Puppet::Node::Environment.new("one").should equal(Puppet::Node::Environment.new("one"))
end
it "should treat an environment specified as names or strings as equivalent" do
- Puppet.settings.stubs(:value).with(:environments).returns("one")
Puppet::Node::Environment.new(:one).should equal(Puppet::Node::Environment.new("one"))
end
-
- it "should fail if an invalid environment instance is asked for" do
- Puppet.settings.stubs(:value).with(:environments).returns("one,two")
- proc { Puppet::Node::Environment.new("three") }.should raise_error(ArgumentError)
- end
-
- it "should consider environments that are empty strings invalid" do
- Puppet::Node::Environment.valid?("").should be_false
- end
-
- it "should fail if a no-longer-valid environment instance is asked for" do
- Puppet.settings.expects(:value).with(:environments).returns("one")
- Puppet::Node::Environment.new("one")
- Puppet.settings.expects(:value).with(:environments).returns("two")
- proc { Puppet::Node::Environment.new("one") }.should raise_error(ArgumentError)
- end
end
describe Puppet::Node::Environment, " when modeling a specific environment" do
- before do
- Puppet.settings.expects(:value).with(:environments).returns("testing")
- end
-
it "should have a method for returning the environment name" do
Puppet::Node::Environment.new("testing").name.should == :testing
end