summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
authorRick Bradley <rick@rickbradley.com>2008-02-18 14:13:54 -0600
committerRick Bradley <rick@rickbradley.com>2008-02-18 14:13:54 -0600
commitf702096aba4366d21f7b1457cace652ab6235f8b (patch)
tree03f4356a4560e92624ee08f0001abaa661d52717 /spec/unit
parent516e5b62cbb5ed2fbbadcd211d3e843f0f049db8 (diff)
downloadpuppet-f702096aba4366d21f7b1457cace652ab6235f8b.tar.gz
puppet-f702096aba4366d21f7b1457cace652ab6235f8b.tar.xz
puppet-f702096aba4366d21f7b1457cace652ab6235f8b.zip
converting facter indirector specs from setup/teardown to before/after
Diffstat (limited to 'spec/unit')
-rwxr-xr-xspec/unit/indirector/facts/facter.rb55
1 files changed, 26 insertions, 29 deletions
diff --git a/spec/unit/indirector/facts/facter.rb b/spec/unit/indirector/facts/facter.rb
index 1fad4c859..0974a60ec 100755
--- a/spec/unit/indirector/facts/facter.rb
+++ b/spec/unit/indirector/facts/facter.rb
@@ -31,49 +31,46 @@ describe Puppet::Node::Facts::Facter do
end
end
-module TestingCodeFacts
- def setup
+describe Puppet::Node::Facts::Facter do
+ before :each do
@facter = Puppet::Node::Facts::Facter.new
Facter.stubs(:to_hash).returns({})
@name = "me"
@facts = @facter.find(@name)
end
-end
-describe Puppet::Node::Facts::Facter, " when finding facts" do
- include TestingCodeFacts
+ describe Puppet::Node::Facts::Facter, " when finding facts" do
- it "should return a Facts instance" do
- @facts.should be_instance_of(Puppet::Node::Facts)
- end
+ it "should return a Facts instance" do
+ @facts.should be_instance_of(Puppet::Node::Facts)
+ end
- it "should return a Facts instance with the provided key as the name" do
- @facts.name.should == @name
- end
+ it "should return a Facts instance with the provided key as the name" do
+ @facts.name.should == @name
+ end
- it "should return the Facter facts as the values in the Facts instance" do
- Facter.expects(:to_hash).returns("one" => "two")
- facts = @facter.find(@name)
- facts.values["one"].should == "two"
+ it "should return the Facter facts as the values in the Facts instance" do
+ Facter.expects(:to_hash).returns("one" => "two")
+ facts = @facter.find(@name)
+ facts.values["one"].should == "two"
+ end
end
-end
-describe Puppet::Node::Facts::Facter, " when saving facts" do
- include TestingCodeFacts
+ describe Puppet::Node::Facts::Facter, " when saving facts" do
- it "should fail" do
- proc { @facter.save(@facts) }.should raise_error(Puppet::DevError)
+ it "should fail" do
+ proc { @facter.save(@facts) }.should raise_error(Puppet::DevError)
+ end
end
-end
-describe Puppet::Node::Facts::Facter, " when destroying facts" do
- include TestingCodeFacts
+ describe Puppet::Node::Facts::Facter, " when destroying facts" do
- it "should fail" do
- proc { @facter.destroy(@facts) }.should raise_error(Puppet::DevError)
+ it "should fail" do
+ proc { @facter.destroy(@facts) }.should raise_error(Puppet::DevError)
+ end
end
-end
-describe Puppet::Node::Facts::Facter, " when loading facts from the factpath" do
- it "should load every fact in each factpath directory"
-end
+ describe Puppet::Node::Facts::Facter, " when loading facts from the factpath" do
+ it "should load every fact in each factpath directory"
+ end
+end \ No newline at end of file