summaryrefslogtreecommitdiffstats
path: root/spec/unit/node
diff options
context:
space:
mode:
authorMarkus Roberts <Markus@reality.com>2010-07-09 18:12:17 -0700
committerMarkus Roberts <Markus@reality.com>2010-07-09 18:12:17 -0700
commit3180b9d9b2c844dade1d361326600f7001ec66dd (patch)
tree98fe7c5ac7eb942aac9c39f019a17b0b3f5a57f4 /spec/unit/node
parent543225970225de5697734bfaf0a6eee996802c04 (diff)
downloadpuppet-3180b9d9b2c844dade1d361326600f7001ec66dd.tar.gz
puppet-3180b9d9b2c844dade1d361326600f7001ec66dd.tar.xz
puppet-3180b9d9b2c844dade1d361326600f7001ec66dd.zip
Code smell: Two space indentation
Replaced 106806 occurances of ^( +)(.*$) with The ruby community almost universally (i.e. everyone but Luke, Markus, and the other eleven people who learned ruby in the 1900s) uses two-space indentation. 3 Examples: The code: end # Tell getopt which arguments are valid def test_get_getopt_args element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args") becomes: end # Tell getopt which arguments are valid def test_get_getopt_args element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args") The code: assert_equal(str, val) assert_instance_of(Float, result) end # Now test it with a passed object becomes: assert_equal(str, val) assert_instance_of(Float, result) end # Now test it with a passed object The code: end assert_nothing_raised do klass[:Yay] = "boo" klass["Cool"] = :yayness end becomes: end assert_nothing_raised do klass[:Yay] = "boo" klass["Cool"] = :yayness end
Diffstat (limited to 'spec/unit/node')
-rwxr-xr-xspec/unit/node/environment_spec.rb358
-rwxr-xr-xspec/unit/node/facts_spec.rb164
2 files changed, 261 insertions, 261 deletions
diff --git a/spec/unit/node/environment_spec.rb b/spec/unit/node/environment_spec.rb
index 29a4f0cf1..b400865a2 100755
--- a/spec/unit/node/environment_spec.rb
+++ b/spec/unit/node/environment_spec.rb
@@ -6,243 +6,243 @@ require 'puppet/node/environment'
require 'puppet/util/execution'
describe Puppet::Node::Environment do
- after do
- Puppet::Node::Environment.clear
- end
+ after 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 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
+ it "should use the filetimeout for the ttl for the modulepath" do
+ Puppet::Node::Environment.attr_ttl(:modulepath).should == Integer(Puppet[:filetimeout])
+ end
- it "should use the filetimeout for the ttl for the module list" do
- Puppet::Node::Environment.attr_ttl(:modules).should == Integer(Puppet[:filetimeout])
- end
+ it "should use the filetimeout for the ttl for the module list" 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 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
- 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
+ end
- it "should treat environment instances as singletons" do
- Puppet::Node::Environment.new("one").should equal(Puppet::Node::Environment.new("one"))
- end
+ it "should treat environment instances as singletons" do
+ 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::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::Node::Environment.new(:one).should equal(Puppet::Node::Environment.new("one"))
+ end
+
+ it "should return its name when converted to a string" 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
- it "should return its name when converted to a string" do
- Puppet::Node::Environment.new(:one).to_s.should == "one"
+ describe "when managing known resource types" do
+ before do
+ @env = Puppet::Node::Environment.new("dev")
+ @collection = Puppet::Resource::TypeCollection.new(@env)
+ @collection.stubs(:perform_initial_import)
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)
+ it "should create a resource type collection if none exists" do
+ Puppet::Resource::TypeCollection.expects(:new).with(@env).returns @collection
+ @env.known_resource_types.should equal(@collection)
end
- describe "when managing known resource types" do
- before do
- @env = Puppet::Node::Environment.new("dev")
- @collection = Puppet::Resource::TypeCollection.new(@env)
- @collection.stubs(:perform_initial_import)
- end
+ it "should reuse any existing resource type collection" do
+ @env.known_resource_types.should equal(@env.known_resource_types)
+ end
- it "should create a resource type collection if none exists" do
- Puppet::Resource::TypeCollection.expects(:new).with(@env).returns @collection
- @env.known_resource_types.should equal(@collection)
- end
+ it "should perform the initial import when creating a new collection" do
+ @collection.expects(:perform_initial_import)
+ Puppet::Resource::TypeCollection.expects(:new).returns @collection
- it "should reuse any existing resource type collection" do
- @env.known_resource_types.should equal(@env.known_resource_types)
- end
+ @env.known_resource_types
+ end
- it "should perform the initial import when creating a new collection" do
- @collection.expects(:perform_initial_import)
- Puppet::Resource::TypeCollection.expects(:new).returns @collection
+ it "should create and return a new collection rather than returning a stale collection" do
+ @env.known_resource_types.expects(:stale?).returns true
- @env.known_resource_types
- end
+ Puppet::Resource::TypeCollection.expects(:new).returns @collection
- it "should create and return a new collection rather than returning a stale collection" do
- @env.known_resource_types.expects(:stale?).returns true
+ @env.known_resource_types.should equal(@collection)
+ end
+ end
- Puppet::Resource::TypeCollection.expects(:new).returns @collection
+ [:modulepath, :manifestdir].each do |setting|
+ it "should validate the #{setting} directories" do
+ path = %w{/one /two}.join(File::PATH_SEPARATOR)
- @env.known_resource_types.should equal(@collection)
- end
- end
+ env = Puppet::Node::Environment.new("testing")
+ env.stubs(:[]).with(setting).returns path
- [:modulepath, :manifestdir].each do |setting|
- it "should validate the #{setting} directories" do
- path = %w{/one /two}.join(File::PATH_SEPARATOR)
+ env.expects(:validate_dirs).with(%w{/one /two})
- env = Puppet::Node::Environment.new("testing")
- env.stubs(:[]).with(setting).returns path
+ env.send(setting)
+ end
- env.expects(:validate_dirs).with(%w{/one /two})
+ it "should return the validated dirs for #{setting}" do
+ path = %w{/one /two}.join(File::PATH_SEPARATOR)
- env.send(setting)
- end
+ env = Puppet::Node::Environment.new("testing")
+ env.stubs(:[]).with(setting).returns path
+ env.stubs(:validate_dirs).returns %w{/one /two}
- it "should return the validated dirs for #{setting}" do
- path = %w{/one /two}.join(File::PATH_SEPARATOR)
+ env.send(setting).should == %w{/one /two}
+ end
+ end
- env = Puppet::Node::Environment.new("testing")
- env.stubs(:[]).with(setting).returns path
- env.stubs(:validate_dirs).returns %w{/one /two}
+ it "should prefix the value of the 'PUPPETLIB' environment variable to the module path if present" do
+ Puppet::Util::Execution.withenv("PUPPETLIB" => %w{/l1 /l2}.join(File::PATH_SEPARATOR)) do
+ env = Puppet::Node::Environment.new("testing")
+ module_path = %w{/one /two}.join(File::PATH_SEPARATOR)
+ env.expects(:validate_dirs).with(%w{/l1 /l2 /one /two}).returns %w{/l1 /l2 /one /two}
+ env.expects(:[]).with(:modulepath).returns module_path
- env.send(setting).should == %w{/one /two}
- end
+ env.modulepath.should == %w{/l1 /l2 /one /two}
end
+ end
+
+ describe "when validating modulepath or manifestdir directories" do
+ it "should not return non-directories" do
+ env = Puppet::Node::Environment.new("testing")
- it "should prefix the value of the 'PUPPETLIB' environment variable to the module path if present" do
- Puppet::Util::Execution.withenv("PUPPETLIB" => %w{/l1 /l2}.join(File::PATH_SEPARATOR)) do
- env = Puppet::Node::Environment.new("testing")
- module_path = %w{/one /two}.join(File::PATH_SEPARATOR)
- env.expects(:validate_dirs).with(%w{/l1 /l2 /one /two}).returns %w{/l1 /l2 /one /two}
- env.expects(:[]).with(:modulepath).returns module_path
+ FileTest.expects(:directory?).with("/one").returns true
+ FileTest.expects(:directory?).with("/two").returns false
- env.modulepath.should == %w{/l1 /l2 /one /two}
- end
+ env.validate_dirs(%w{/one /two}).should == %w{/one}
end
- describe "when validating modulepath or manifestdir directories" do
- it "should not return non-directories" do
- env = Puppet::Node::Environment.new("testing")
+ it "should use the current working directory to fully-qualify unqualified paths" do
+ FileTest.stubs(:directory?).returns true
+ env = Puppet::Node::Environment.new("testing")
- FileTest.expects(:directory?).with("/one").returns true
- FileTest.expects(:directory?).with("/two").returns false
+ two = File.join(Dir.getwd, "two")
+ env.validate_dirs(%w{/one two}).should == ["/one", two]
+ end
+ end
- env.validate_dirs(%w{/one /two}).should == %w{/one}
- end
+ describe "when modeling a specific environment" do
+ it "should have a method for returning the environment name" do
+ Puppet::Node::Environment.new("testing").name.should == :testing
+ end
- it "should use the current working directory to fully-qualify unqualified paths" do
- FileTest.stubs(:directory?).returns true
- env = Puppet::Node::Environment.new("testing")
+ it "should provide an array-like accessor method for returning any environment-specific setting" do
+ env = Puppet::Node::Environment.new("testing")
+ env.should respond_to(:[])
+ end
- two = File.join(Dir.getwd, "two")
- env.validate_dirs(%w{/one two}).should == ["/one", two]
- end
+ it "should ask the Puppet settings instance for the setting qualified with the environment name" do
+ Puppet.settings.expects(:value).with("myvar", :testing).returns("myval")
+ env = Puppet::Node::Environment.new("testing")
+ env["myvar"].should == "myval"
end
- describe "when modeling a specific environment" do
- it "should have a method for returning the environment name" do
- Puppet::Node::Environment.new("testing").name.should == :testing
- end
+ it "should be able to return an individual module that exists in its module path" do
+ env = Puppet::Node::Environment.new("testing")
- it "should provide an array-like accessor method for returning any environment-specific setting" do
- env = Puppet::Node::Environment.new("testing")
- env.should respond_to(:[])
- end
+ mod = mock 'module'
+ Puppet::Module.expects(:new).with("one", env).returns mod
+ mod.expects(:exist?).returns true
- it "should ask the Puppet settings instance for the setting qualified with the environment name" do
- Puppet.settings.expects(:value).with("myvar", :testing).returns("myval")
- env = Puppet::Node::Environment.new("testing")
- env["myvar"].should == "myval"
- end
+ env.module("one").should equal(mod)
+ end
- it "should be able to return an individual module that exists in its module path" do
- env = Puppet::Node::Environment.new("testing")
+ it "should return nil if asked for a module that does not exist in its path" do
+ env = Puppet::Node::Environment.new("testing")
- mod = mock 'module'
- Puppet::Module.expects(:new).with("one", env).returns mod
- mod.expects(:exist?).returns true
+ mod = mock 'module'
+ Puppet::Module.expects(:new).with("one", env).returns mod
+ mod.expects(:exist?).returns false
- env.module("one").should equal(mod)
- end
+ env.module("one").should be_nil
+ end
- it "should return nil if asked for a module that does not exist in its path" do
- env = Puppet::Node::Environment.new("testing")
+ it "should be able to return its modules" do
+ Puppet::Node::Environment.new("testing").should respond_to(:modules)
+ end
- mod = mock 'module'
- Puppet::Module.expects(:new).with("one", env).returns mod
- mod.expects(:exist?).returns false
+ describe ".modules" do
+ it "should return a module named for every directory in each module path" do
+ env = Puppet::Node::Environment.new("testing")
+ env.expects(:modulepath).at_least_once.returns %w{/a /b}
+ Dir.expects(:entries).with("/a").returns %w{foo bar}
+ Dir.expects(:entries).with("/b").returns %w{bee baz}
- env.module("one").should be_nil
- end
+ env.modules.collect{|mod| mod.name}.sort.should == %w{foo bar bee baz}.sort
+ end
- it "should be able to return its modules" do
- Puppet::Node::Environment.new("testing").should respond_to(:modules)
- end
+ it "should remove duplicates" do
+ env = Puppet::Node::Environment.new("testing")
+ env.expects(:modulepath).returns( %w{/a /b} ).at_least_once
+ Dir.expects(:entries).with("/a").returns %w{foo}
+ Dir.expects(:entries).with("/b").returns %w{foo}
- describe ".modules" do
- it "should return a module named for every directory in each module path" do
- env = Puppet::Node::Environment.new("testing")
- env.expects(:modulepath).at_least_once.returns %w{/a /b}
- Dir.expects(:entries).with("/a").returns %w{foo bar}
- Dir.expects(:entries).with("/b").returns %w{bee baz}
+ env.modules.collect{|mod| mod.name}.sort.should == %w{foo}
+ end
- env.modules.collect{|mod| mod.name}.sort.should == %w{foo bar bee baz}.sort
- end
+ it "should ignore invalid modules" do
+ env = Puppet::Node::Environment.new("testing")
+ env.stubs(:modulepath).returns %w{/a}
+ Dir.expects(:entries).with("/a").returns %w{foo bar}
- it "should remove duplicates" do
- env = Puppet::Node::Environment.new("testing")
- env.expects(:modulepath).returns( %w{/a /b} ).at_least_once
- Dir.expects(:entries).with("/a").returns %w{foo}
- Dir.expects(:entries).with("/b").returns %w{foo}
+ Puppet::Module.expects(:new).with { |name, env| name == "foo" }.returns mock("foomod", :name => "foo")
+ Puppet::Module.expects(:new).with { |name, env| name == "bar" }.raises( Puppet::Module::InvalidName, "name is invalid" )
- env.modules.collect{|mod| mod.name}.sort.should == %w{foo}
- end
+ env.modules.collect{|mod| mod.name}.sort.should == %w{foo}
+ end
- it "should ignore invalid modules" do
- env = Puppet::Node::Environment.new("testing")
- env.stubs(:modulepath).returns %w{/a}
- Dir.expects(:entries).with("/a").returns %w{foo bar}
+ it "should create modules with the correct environment" do
+ env = Puppet::Node::Environment.new("testing")
+ env.expects(:modulepath).at_least_once.returns %w{/a}
+ Dir.expects(:entries).with("/a").returns %w{foo}
- Puppet::Module.expects(:new).with { |name, env| name == "foo" }.returns mock("foomod", :name => "foo")
- Puppet::Module.expects(:new).with { |name, env| name == "bar" }.raises( Puppet::Module::InvalidName, "name is invalid" )
+ env.modules.each {|mod| mod.environment.should == env }
+ end
- env.modules.collect{|mod| mod.name}.sort.should == %w{foo}
- end
+ it "should cache the module list" do
+ env = Puppet::Node::Environment.new("testing")
+ env.expects(:modulepath).at_least_once.returns %w{/a}
+ Dir.expects(:entries).once.with("/a").returns %w{foo}
- it "should create modules with the correct environment" do
- env = Puppet::Node::Environment.new("testing")
- env.expects(:modulepath).at_least_once.returns %w{/a}
- Dir.expects(:entries).with("/a").returns %w{foo}
+ env.modules
+ env.modules
+ end
+ end
+ end
- env.modules.each {|mod| mod.environment.should == env }
- end
+ describe Puppet::Node::Environment::Helper do
+ before do
+ @helper = Object.new
+ @helper.extend(Puppet::Node::Environment::Helper)
+ end
- it "should cache the module list" do
- env = Puppet::Node::Environment.new("testing")
- env.expects(:modulepath).at_least_once.returns %w{/a}
- Dir.expects(:entries).once.with("/a").returns %w{foo}
+ it "should be able to set and retrieve the environment" do
+ @helper.environment = :foo
+ @helper.environment.name.should == :foo
+ end
- env.modules
- env.modules
- end
- end
+ it "should accept an environment directly" do
+ env = Puppet::Node::Environment.new :foo
+ @helper.environment = env
+ @helper.environment.name.should == :foo
end
- describe Puppet::Node::Environment::Helper do
- before do
- @helper = Object.new
- @helper.extend(Puppet::Node::Environment::Helper)
- end
-
- it "should be able to set and retrieve the environment" do
- @helper.environment = :foo
- @helper.environment.name.should == :foo
- end
-
- it "should accept an environment directly" do
- env = Puppet::Node::Environment.new :foo
- @helper.environment = env
- @helper.environment.name.should == :foo
- end
-
- it "should accept an environment as a string" do
- env = Puppet::Node::Environment.new "foo"
- @helper.environment = env
- @helper.environment.name.should == :foo
- end
+ it "should accept an environment as a string" do
+ env = Puppet::Node::Environment.new "foo"
+ @helper.environment = env
+ @helper.environment.name.should == :foo
end
+ end
end
diff --git a/spec/unit/node/facts_spec.rb b/spec/unit/node/facts_spec.rb
index d276de28d..a2f4ab9f0 100755
--- a/spec/unit/node/facts_spec.rb
+++ b/spec/unit/node/facts_spec.rb
@@ -5,98 +5,98 @@ require File.dirname(__FILE__) + '/../../spec_helper'
require 'puppet/node/facts'
describe Puppet::Node::Facts, "when indirecting" do
+ before do
+ @facts = Puppet::Node::Facts.new("me")
+ end
+
+ it "should be able to convert all fact values to strings" do
+ @facts.values["one"] = 1
+ @facts.stringify
+ @facts.values["one"].should == "1"
+ end
+
+ it "should add the node's certificate name as the 'clientcert' fact when adding local facts" do
+ @facts.add_local_facts
+ @facts.values["clientcert"].should == Puppet.settings[:certname]
+ end
+
+ it "should add the Puppet version as a 'clientversion' fact when adding local facts" do
+ @facts.add_local_facts
+ @facts.values["clientversion"].should == Puppet.version.to_s
+ end
+
+ it "should add the current environment as a fact if one is not set when adding local facts" do
+ @facts.add_local_facts
+ @facts.values["environment"].should == Puppet[:environment]
+ end
+
+ it "should not replace any existing environment fact when adding local facts" do
+ @facts.values["environment"] = "foo"
+ @facts.add_local_facts
+ @facts.values["environment"].should == "foo"
+ end
+
+ it "should be able to downcase fact values" do
+ Puppet.settings.stubs(:value).returns "eh"
+ Puppet.settings.expects(:value).with(:downcasefacts).returns true
+
+ @facts.values["one"] = "Two"
+
+ @facts.downcase_if_necessary
+ @facts.values["one"].should == "two"
+ end
+
+ it "should only try to downcase strings" do
+ Puppet.settings.stubs(:value).returns "eh"
+ Puppet.settings.expects(:value).with(:downcasefacts).returns true
+
+ @facts.values["now"] = Time.now
+
+ @facts.downcase_if_necessary
+ @facts.values["now"].should be_instance_of(Time)
+ end
+
+ it "should not downcase facts if not configured to do so" do
+ Puppet.settings.stubs(:value).returns "eh"
+ Puppet.settings.expects(:value).with(:downcasefacts).returns false
+
+ @facts.values["one"] = "Two"
+ @facts.downcase_if_necessary
+ @facts.values["one"].should == "Two"
+ end
+
+ describe "when indirecting" do
before do
- @facts = Puppet::Node::Facts.new("me")
- end
-
- it "should be able to convert all fact values to strings" do
- @facts.values["one"] = 1
- @facts.stringify
- @facts.values["one"].should == "1"
- end
-
- it "should add the node's certificate name as the 'clientcert' fact when adding local facts" do
- @facts.add_local_facts
- @facts.values["clientcert"].should == Puppet.settings[:certname]
- end
-
- it "should add the Puppet version as a 'clientversion' fact when adding local facts" do
- @facts.add_local_facts
- @facts.values["clientversion"].should == Puppet.version.to_s
- end
-
- it "should add the current environment as a fact if one is not set when adding local facts" do
- @facts.add_local_facts
- @facts.values["environment"].should == Puppet[:environment]
- end
-
- it "should not replace any existing environment fact when adding local facts" do
- @facts.values["environment"] = "foo"
- @facts.add_local_facts
- @facts.values["environment"].should == "foo"
- end
-
- it "should be able to downcase fact values" do
- Puppet.settings.stubs(:value).returns "eh"
- Puppet.settings.expects(:value).with(:downcasefacts).returns true
+ @indirection = stub 'indirection', :request => mock('request'), :name => :facts
- @facts.values["one"] = "Two"
+ # 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.downcase_if_necessary
- @facts.values["one"].should == "two"
+ @facts = Puppet::Node::Facts.new("me", "one" => "two")
end
- it "should only try to downcase strings" do
- Puppet.settings.stubs(:value).returns "eh"
- Puppet.settings.expects(:value).with(:downcasefacts).returns true
-
- @facts.values["now"] = Time.now
-
- @facts.downcase_if_necessary
- @facts.values["now"].should be_instance_of(Time)
+ it "should redirect to the specified fact store for retrieval" do
+ Puppet::Node::Facts.stubs(:indirection).returns(@indirection)
+ @indirection.expects(:find)
+ Puppet::Node::Facts.find(:my_facts)
end
- it "should not downcase facts if not configured to do so" do
- Puppet.settings.stubs(:value).returns "eh"
- Puppet.settings.expects(:value).with(:downcasefacts).returns false
-
- @facts.values["one"] = "Two"
- @facts.downcase_if_necessary
- @facts.values["one"].should == "Two"
+ it "should redirect to the specified fact store for storage" do
+ Puppet::Node::Facts.stubs(:indirection).returns(@indirection)
+ @indirection.expects(:save)
+ @facts.save
end
- describe "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
-
- it "should redirect to the specified fact store for retrieval" do
- Puppet::Node::Facts.stubs(:indirection).returns(@indirection)
- @indirection.expects(:find)
- Puppet::Node::Facts.find(:my_facts)
- end
-
- it "should redirect to the specified fact store for storage" do
- Puppet::Node::Facts.stubs(:indirection).returns(@indirection)
- @indirection.expects(:save)
- @facts.save
- end
-
- it "should default to the 'facter' terminus" do
- Puppet::Node::Facts.indirection.terminus_class.should == :facter
- end
+ it "should default to the 'facter' terminus" do
+ Puppet::Node::Facts.indirection.terminus_class.should == :facter
end
+ end
- describe "when storing and retrieving" do
- it "should add metadata to the facts" do
- facts = Puppet::Node::Facts.new("me", "one" => "two", "three" => "four")
- facts.values[:_timestamp].should be_instance_of(Time)
- end
+ describe "when storing and retrieving" do
+ it "should add metadata to the facts" do
+ facts = Puppet::Node::Facts.new("me", "one" => "two", "three" => "four")
+ facts.values[:_timestamp].should be_instance_of(Time)
end
+ end
end