summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluke <luke@1f5c1d6a-bddf-0310-8f58-fc49e503516a>2005-11-16 17:29:21 +0000
committerluke <luke@1f5c1d6a-bddf-0310-8f58-fc49e503516a>2005-11-16 17:29:21 +0000
commit8cb9662660927f0ba55c18be91aa764174fdb61b (patch)
tree2fe901de41e8b38a31885505edf4274f0ae32199
parent7cec936bf10ea2f0c2f56c00839043ad9369d99b (diff)
downloadfacter-8cb9662660927f0ba55c18be91aa764174fdb61b.tar.gz
facter-8cb9662660927f0ba55c18be91aa764174fdb61b.tar.xz
facter-8cb9662660927f0ba55c18be91aa764174fdb61b.zip
updating INSTALL with patch from ian
git-svn-id: http://reductivelabs.com/svn/facter/trunk@60 1f5c1d6a-bddf-0310-8f58-fc49e503516a
-rw-r--r--INSTALL9
-rw-r--r--lib/facter.rb5
-rw-r--r--tests/tc_simple.rb21
3 files changed, 33 insertions, 2 deletions
diff --git a/INSTALL b/INSTALL
index de89f69..c972664 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,2 +1,7 @@
-Unforantely, no install.rb yet. Hopefully soon. Just copy the libs into
-your main ruby library directory. Or something.
+Run 'ruby install.rb' or use one of the distributed gem files at
+http://reductivelabs.com/downloads/gems .
+
+install.rb should successfully install; let me know if it doesn't.
+
+Otherwise, you can just set RUBYLIB to contain its lib directory, or copy
+the libs into your main ruby library directory.
diff --git a/lib/facter.rb b/lib/facter.rb
index e537ca4..9e03892 100644
--- a/lib/facter.rb
+++ b/lib/facter.rb
@@ -753,6 +753,11 @@ class Facter
obj.tag("operatingsystem","=","Darwin")
obj.code = "echo 'ps -auxwww'"
}
+
+ Facter["id"].add { |obj|
+ obj.tag("operatingsystem","=","Linux")
+ obj.code = "whoami"
+ }
end
Facter.load
diff --git a/tests/tc_simple.rb b/tests/tc_simple.rb
index cda2557..af2c82d 100644
--- a/tests/tc_simple.rb
+++ b/tests/tc_simple.rb
@@ -20,6 +20,10 @@ class TestFacter < Test::Unit::TestCase
def teardown
# clear out the list of facts, so we start fresh for every test
Facter.reset
+
+ if ! @oldhandles.empty?
+ $stdin, $stdout, $stderr = @oldhandles
+ end
end
def test_version
@@ -265,4 +269,21 @@ class TestFacter < Test::Unit::TestCase
assert(value)
}
end
+
+ def test_withnoouts
+ @oldhandles = []
+ @oldhandles << $stdin.dup
+ $stdin.reopen "/dev/null"
+ @oldhandles << $stdout.dup
+ $stdout.reopen "/dev/null", "a"
+ @oldhandles << $stderr.dup
+ $stderr.reopen $stdout
+
+ assert_nothing_raised {
+ Facter.each { |name,fact|
+ list[name] = fact
+ }
+ }
+ $stdin, $stdout, $stderr = @oldhandles
+ end
end