summaryrefslogtreecommitdiffstats
path: root/spec/unit/node
diff options
context:
space:
mode:
authorNick Lewis <nick@puppetlabs.com>2011-07-21 20:21:41 -0700
committerNick Lewis <nick@puppetlabs.com>2011-07-21 20:21:41 -0700
commitc5d70ed11f8f964523ca049d6c3d504de3840c1a (patch)
tree6f1872676315dde67aa865d5d177e18bdcf6e4a3 /spec/unit/node
parent9c78759af57967d64eceeeb704a6673b81a76f30 (diff)
parentd198fedf65e472b384666fc9ae3bef487852068a (diff)
Merge branch 'remove-cacher'
Diffstat (limited to 'spec/unit/node')
-rwxr-xr-xspec/unit/node/environment_spec.rb34
-rwxr-xr-xspec/unit/node/facts_spec.rb4
2 files changed, 8 insertions, 30 deletions
diff --git a/spec/unit/node/environment_spec.rb b/spec/unit/node/environment_spec.rb
index 144e82e0c..f3772749a 100755
--- a/spec/unit/node/environment_spec.rb
+++ b/spec/unit/node/environment_spec.rb
@@ -1,6 +1,8 @@
#!/usr/bin/env rspec
require 'spec_helper'
+require 'tmpdir'
+
require 'puppet/node/environment'
require 'puppet/util/execution'
@@ -10,10 +12,6 @@ describe Puppet::Node::Environment do
Puppet::Node::Environment.clear
end
- it "should include the Cacher module" do
- Puppet::Node::Environment.ancestors.should be_include(Puppet::Util::Cacher)
- end
-
it "should use the filetimeout for the ttl for the modulepath" do
Puppet::Node::Environment.attr_ttl(:modulepath).should == Integer(Puppet[:filetimeout])
end
@@ -22,10 +20,6 @@ describe Puppet::Node::Environment do
Puppet::Node::Environment.attr_ttl(:modules).should == Integer(Puppet[:filetimeout])
end
- it "should use the filetimeout for the ttl for the manifestdir" do
- Puppet::Node::Environment.attr_ttl(:manifestdir).should == Integer(Puppet[:filetimeout])
- end
-
it "should use the default environment if no name is provided while initializing an environment" do
Puppet.settings.expects(:value).with(:environment).returns("one")
Puppet::Node::Environment.new.name.should == :one
@@ -109,27 +103,15 @@ describe Puppet::Node::Environment do
end
end
- [:modulepath, :manifestdir].each do |setting|
- it "should validate the #{setting} directories" do
- path = %w{/one /two}.join(File::PATH_SEPARATOR)
-
- env = Puppet::Node::Environment.new("testing")
- env.stubs(:[]).with(setting).returns path
-
- env.expects(:validate_dirs).with(%w{/one /two})
-
- env.send(setting)
- end
+ it "should validate the modulepath directories" do
+ real_file = Dir.mktmpdir
+ path = %W[/one /two #{real_file}].join(File::PATH_SEPARATOR)
- it "should return the validated dirs for #{setting}" do
- path = %w{/one /two}.join(File::PATH_SEPARATOR)
+ Puppet[:modulepath] = path
- env = Puppet::Node::Environment.new("testing")
- env.stubs(:[]).with(setting).returns path
- env.stubs(:validate_dirs).returns %w{/one /two}
+ env = Puppet::Node::Environment.new("testing")
- env.send(setting).should == %w{/one /two}
- end
+ env.modulepath.should == [real_file]
end
it "should prefix the value of the 'PUPPETLIB' environment variable to the module path if present" do
diff --git a/spec/unit/node/facts_spec.rb b/spec/unit/node/facts_spec.rb
index 6d2b0a7ac..b3a0f92dd 100755
--- a/spec/unit/node/facts_spec.rb
+++ b/spec/unit/node/facts_spec.rb
@@ -68,10 +68,6 @@ describe Puppet::Node::Facts, "when indirecting" do
before do
@indirection = stub 'indirection', :request => mock('request'), :name => :facts
- # We have to clear the cache so that the facts ask for our indirection stub,
- # instead of anything that might be cached.
- Puppet::Util::Cacher.expire
-
@facts = Puppet::Node::Facts.new("me", "one" => "two")
end