move Pacemaker::CIBObject.from_name test to libraries/primitive_spec
This commit is contained in:
@@ -68,13 +68,6 @@ describe Pacemaker::CIBObject do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "::from_name" do
|
|
||||||
it "should instantiate a Pacemaker::Resource::Primitive" do
|
|
||||||
obj = Pacemaker::CIBObject.from_name(cib_object.name)
|
|
||||||
expect(obj.is_a? Pacemaker::Resource::Primitive).to be_true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context "CIB object with unregistered type" do
|
context "CIB object with unregistered type" do
|
||||||
|
@@ -8,6 +8,16 @@ describe Pacemaker::Resource::Primitive do
|
|||||||
Mixlib::ShellOut.any_instance.stub(:run_command)
|
Mixlib::ShellOut.any_instance.stub(:run_command)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "should be instantiated via Pacemaker::CIBObject.from_name" do
|
||||||
|
Mixlib::ShellOut.any_instance.stub(:error!)
|
||||||
|
expect_any_instance_of(Mixlib::ShellOut) \
|
||||||
|
.to receive(:stdout) \
|
||||||
|
.and_return(@primitive.definition_string)
|
||||||
|
|
||||||
|
obj = Pacemaker::CIBObject.from_name(@primitive.name)
|
||||||
|
expect(obj.is_a? Pacemaker::Resource::Primitive).to be_true
|
||||||
|
end
|
||||||
|
|
||||||
it "should barf if the loaded definition's type is not primitive" do
|
it "should barf if the loaded definition's type is not primitive" do
|
||||||
Mixlib::ShellOut.any_instance.stub(:error!)
|
Mixlib::ShellOut.any_instance.stub(:error!)
|
||||||
expect_any_instance_of(Mixlib::ShellOut) \
|
expect_any_instance_of(Mixlib::ShellOut) \
|
||||||
|
Reference in New Issue
Block a user