move Pacemaker::CIBObject.from_name test to libraries/primitive_spec
This commit is contained in:
parent
4df1f5c40f
commit
d4b8b6432d
@ -68,13 +68,6 @@ describe Pacemaker::CIBObject do
|
||||
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
|
||||
|
||||
context "CIB object with unregistered type" do
|
||||
|
@ -8,6 +8,16 @@ describe Pacemaker::Resource::Primitive do
|
||||
Mixlib::ShellOut.any_instance.stub(:run_command)
|
||||
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
|
||||
Mixlib::ShellOut.any_instance.stub(:error!)
|
||||
expect_any_instance_of(Mixlib::ShellOut) \
|
||||
|
Loading…
x
Reference in New Issue
Block a user