diff options
| author | Luke Kanies <luke@madstop.com> | 2008-05-14 00:24:24 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-05-14 00:24:24 -0500 |
| commit | bfc4996e2cd22d3bae5c3955366c63fdd5277cf8 (patch) | |
| tree | 6aaecd80a1d1600c824ac7e27ebc471ebd02b5b2 /spec/integration | |
| parent | e3c1fdab9e52e05c8983123879c8ed98743fc8f8 (diff) | |
Moving Facter's container behaviour into a separate class.
There's now no @@facts instance variable; instead, there's
a collection, and it's responsible for keeping references
to all of the facts.
All of the old interface methods just delegate to the collection.
Diffstat (limited to 'spec/integration')
| -rwxr-xr-x | spec/integration/facter.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/integration/facter.rb b/spec/integration/facter.rb new file mode 100755 index 0000000..b503c9d --- /dev/null +++ b/spec/integration/facter.rb @@ -0,0 +1,23 @@ +#!/usr/bin/env ruby + +require File.dirname(__FILE__) + '/../spec_helper' + +describe Facter do + before do + Facter.reset + Facter.loadfacts + end + + it "should create a new collection if one does not exist" do + Facter.reset + Facter::Collection.expects(:new).returns "coll" + Facter.collection.should == "coll" + Facter.reset + end + + it "should remove the collection when reset" do + old = Facter.collection + Facter.reset + Facter.collection.should_not equal(old) + end +end |
