5 require File.dirname(__FILE__) + "/../../../../../plugins/mcollective/data/agent_data.rb"
10 describe "#query_data" do
13 @ddl.stubs(:meta).returns({:timeout => 1})
14 DDL.stubs(:new).returns(@ddl)
15 @plugin = Agent_data.new
18 it "should fail for unknown agents" do
19 expect { @plugin.query_data("rspec") }.to raise_error("No agent called rspec found")
22 it "should retrieve the correct agent and data" do
24 agent.stubs(:meta).returns({:license => "license",
25 :timeout => "timeout",
26 :description => "description",
28 :version => "version",
31 PluginManager.stubs(:[]).with("rspec_agent").returns(agent)
32 PluginManager.expects(:include?).with("rspec_agent").returns(true)
34 @plugin.query_data("rspec")
36 [:license, :timeout, :description, :url, :version, :author].each do |item|
37 @plugin.result[item].should == item.to_s