diff options
author | Luke Kanies <luke@madstop.com> | 2009-01-22 16:29:33 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2009-02-06 18:08:40 -0600 |
commit | 6b4e5f49a8d1d062aefae31a923cff9e3f0d31ba (patch) | |
tree | 502eedde0d608d6c1fcb8014a2ede6ce4ea5b188 | |
parent | 54faf7825bbffc5a4ca252389305dd23ae8d2d84 (diff) | |
download | puppet-6b4e5f49a8d1d062aefae31a923cff9e3f0d31ba.tar.gz puppet-6b4e5f49a8d1d062aefae31a923cff9e3f0d31ba.tar.xz puppet-6b4e5f49a8d1d062aefae31a923cff9e3f0d31ba.zip |
Reformatting tests for facts
Signed-off-by: Luke Kanies <luke@madstop.com>
-rwxr-xr-x | spec/unit/node/facts.rb | 62 |
1 files changed, 32 insertions, 30 deletions
diff --git a/spec/unit/node/facts.rb b/spec/unit/node/facts.rb index f12e20404..118713b17 100755 --- a/spec/unit/node/facts.rb +++ b/spec/unit/node/facts.rb @@ -4,37 +4,39 @@ require File.dirname(__FILE__) + '/../../spec_helper' require 'puppet/node/facts' -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") +describe Puppet::Node::Facts, "when indirecting" do + 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 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 -end - -describe Puppet::Node::Facts, " 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) + 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 |