8 class Facts::Testfacts<Facts::Base; end
10 PluginManager.delete("facts_plugin")
11 PluginManager << {:type => "facts_plugin", :class => "MCollective::Facts::Testfacts"}
14 describe "#has_fact?" do
15 it "should correctly report fact presense" do
16 Facts::Testfacts.any_instance.stubs("load_facts_from_source").returns({"foo" => "bar"})
18 Facts.has_fact?("foo", "foo").should == false
19 Facts.has_fact?("foo", "bar").should == true
23 describe "#get_fact" do
24 it "should return the correct fact" do
25 Facts::Testfacts.any_instance.stubs("load_facts_from_source").returns({"foo" => "bar"})
27 Facts.get_fact("foo").should == "bar"
32 it "should return the correct fact" do
33 Facts::Testfacts.any_instance.stubs("load_facts_from_source").returns({"foo" => "bar"})
35 Facts["foo"].should == "bar"