diff options
Diffstat (limited to 'spec/unit/facter.rb')
-rwxr-xr-x | spec/unit/facter.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/unit/facter.rb b/spec/unit/facter.rb index 9f7b4cf..20f9ed1 100755 --- a/spec/unit/facter.rb +++ b/spec/unit/facter.rb @@ -135,6 +135,14 @@ describe Facter do Facter.should respond_to(:debugging?) end + it "should have a method to query timing mode" do + Facter.should respond_to(:timing?) + end + + it "should have a method to show timing information" do + Facter.should respond_to(:show_time) + end + it "should have a method to warn" do Facter.should respond_to(:warn) end @@ -204,6 +212,25 @@ describe Facter do end end + describe "when setting timing mode" do + it "should have timing enabled using 1" do + Facter.timing(1) + Facter.should be_timing + end + it "should have timing enabled using true" do + Facter.timing(true) + Facter.should be_timing + end + it "should have timing disabled using 0" do + Facter.timing(0) + Facter.should_not be_timing + end + it "should have timing disabled using false" do + Facter.timing(false) + Facter.should_not be_timing + end + end + describe "when registering directories to search" do after { Facter.instance_variable_set("@search_path", []) } |