summaryrefslogtreecommitdiffstats
path: root/spec/integration/facter_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/integration/facter_spec.rb')
-rwxr-xr-xspec/integration/facter_spec.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/integration/facter_spec.rb b/spec/integration/facter_spec.rb
new file mode 100755
index 0000000..8351de1
--- /dev/null
+++ b/spec/integration/facter_spec.rb
@@ -0,0 +1,27 @@
+#!/usr/bin/env ruby
+
+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+
+describe Facter do
+ before do
+ Facter.reset
+ end
+
+ after do
+ Facter.reset
+ end
+
+ it "should create a new collection if one does not exist" do
+ Facter.reset
+ coll = mock('coll')
+ Facter::Util::Collection.stubs(:new).returns coll
+ Facter.collection.should equal(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