avoid hardcoding usage of class under test
Hardcoding makes it more difficult to refactor common test code for reuse later on.
This commit is contained in:
parent
34cf2f112c
commit
233681f73a
@ -38,7 +38,7 @@ describe Pacemaker::Resource::Clone do
|
||||
end
|
||||
|
||||
it "should return a short definition string" do
|
||||
clone = Pacemaker::Resource::Clone.new('foo')
|
||||
clone = pacemaker_object_class.new('foo')
|
||||
clone.definition = \
|
||||
%!clone clone1 primitive1 meta globally-unique="true"!
|
||||
clone.parse_definition
|
||||
@ -51,7 +51,7 @@ EOF
|
||||
|
||||
describe "#parse_definition" do
|
||||
before(:each) do
|
||||
@parsed = Pacemaker::Resource::Clone.new(fixture.name)
|
||||
@parsed = pacemaker_object_class.new(fixture.name)
|
||||
@parsed.definition = fixture_definition
|
||||
@parsed.parse_definition
|
||||
end
|
||||
|
@ -38,7 +38,7 @@ describe Pacemaker::Resource::Group do
|
||||
end
|
||||
|
||||
it "should return a short definition string" do
|
||||
group = Pacemaker::Resource::Group.new('foo')
|
||||
group = pacemaker_object_class.new('foo')
|
||||
group.definition = \
|
||||
%!group foo member1 member2 meta target-role="Started"!
|
||||
group.parse_definition
|
||||
@ -51,7 +51,7 @@ EOF
|
||||
|
||||
describe "#parse_definition" do
|
||||
before(:each) do
|
||||
@parsed = Pacemaker::Resource::Group.new(fixture.name)
|
||||
@parsed = pacemaker_object_class.new(fixture.name)
|
||||
@parsed.definition = fixture_definition
|
||||
@parsed.parse_definition
|
||||
end
|
||||
|
@ -38,7 +38,7 @@ describe Pacemaker::Resource::MasterSlave do
|
||||
end
|
||||
|
||||
it "should return a short definition string" do
|
||||
ms = Pacemaker::Resource::MasterSlave.new('foo')
|
||||
ms = pacemaker_object_class.new('foo')
|
||||
ms.definition = \
|
||||
%!ms ms1 primitive1 meta globally-unique="true"!
|
||||
ms.parse_definition
|
||||
@ -51,7 +51,7 @@ EOF
|
||||
|
||||
describe "#parse_definition" do
|
||||
before(:each) do
|
||||
@parsed = Pacemaker::Resource::MasterSlave.new(fixture.name)
|
||||
@parsed = pacemaker_object_class.new(fixture.name)
|
||||
@parsed.definition = fixture_definition
|
||||
@parsed.parse_definition
|
||||
end
|
||||
|
@ -78,7 +78,7 @@ describe Pacemaker::Resource::Primitive do
|
||||
end
|
||||
|
||||
it "should return a short definition string" do
|
||||
primitive = Pacemaker::Resource::Primitive.new('foo')
|
||||
primitive = pacemaker_object_class.new('foo')
|
||||
primitive.definition = \
|
||||
%!primitive foo ocf:heartbeat:IPaddr2 params foo="bar"!
|
||||
primitive.parse_definition
|
||||
@ -91,7 +91,7 @@ EOF
|
||||
|
||||
describe "#quoted_definition_string" do
|
||||
it "should return the quoted definition string" do
|
||||
primitive = Pacemaker::Resource::Primitive.new('foo')
|
||||
primitive = pacemaker_object_class.new('foo')
|
||||
primitive.definition = <<'EOF'.chomp
|
||||
primitive foo ocf:openstack:keystone \
|
||||
params bar="baz\\qux" bar2="baz'qux"
|
||||
@ -106,7 +106,7 @@ EOF
|
||||
|
||||
describe "#parse_definition" do
|
||||
before(:each) do
|
||||
@parsed = Pacemaker::Resource::Primitive.new(fixture.name)
|
||||
@parsed = pacemaker_object_class.new(fixture.name)
|
||||
@parsed.definition = fixture_definition
|
||||
@parsed.parse_definition
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user