Fixing a test broken by previous refactoring

Signed-off-by: Luke Kanies <luke@madstop.com>
This commit is contained in:
Luke Kanies 2008-11-07 16:59:13 -06:00
Родитель 45c6382e99
Коммит eed37f7133
1 изменённых файлов: 4 добавлений и 7 удалений

Просмотреть файл

@ -218,14 +218,11 @@ describe Puppet::Parser::Compiler do
end
it "should fail to add resources that conflict with existing resources" do
type = stub 'faketype', :isomorphic? => true, :name => "mytype"
Puppet::Type.stubs(:type).with("mytype").returns(type)
file1 = Puppet::Type.type(:file).create :path => "/foo"
file2 = Puppet::Type.type(:file).create :path => "/foo"
resource1 = stub "iso1conflict", :ref => "Mytype[yay]", :type => "mytype", :file => "eh", :line => 0
resource2 = stub "iso2conflict", :ref => "Mytype[yay]", :type => "mytype", :file => "eh", :line => 0
@compiler.add_resource(@scope, resource1)
lambda { @compiler.add_resource(@scope, resource2) }.should raise_error(ArgumentError)
@compiler.add_resource(@scope, file1)
lambda { @compiler.add_resource(@scope, file2) }.should raise_error(Puppet::Node::Catalog::DuplicateResourceError)
end
it "should have a method for looking up resources" do