diff options
author | Jacob Helwig <jacob@puppetlabs.com> | 2011-04-19 11:11:34 -0700 |
---|---|---|
committer | Jacob Helwig <jacob@puppetlabs.com> | 2011-04-19 11:11:34 -0700 |
commit | 72cd6fb383335a62d2d1ab656cdff39c34de0f19 (patch) | |
tree | 65f9b57d8dc4fbcfda5eaedbae0f9938b70d30e1 /spec/unit/parser/compiler_spec.rb | |
parent | 16d1f784cd00f8b3c3381caede44159c309487d7 (diff) | |
parent | 656eff821bec534a23e3e81e86ddbe3fc28f10ed (diff) | |
download | puppet-72cd6fb383335a62d2d1ab656cdff39c34de0f19.tar.gz puppet-72cd6fb383335a62d2d1ab656cdff39c34de0f19.tar.xz puppet-72cd6fb383335a62d2d1ab656cdff39c34de0f19.zip |
Merge branch 'tickets/2.6.x/4655-parameterized-classes-default-stages' into 2.6.next
* tickets/2.6.x/4655-parameterized-classes-default-stages:
(#4655) Allow stage to be set using a default class parameter
Updated CHANGELOG for 2.6.8rc1
Diffstat (limited to 'spec/unit/parser/compiler_spec.rb')
-rwxr-xr-x | spec/unit/parser/compiler_spec.rb | 54 |
1 files changed, 8 insertions, 46 deletions
diff --git a/spec/unit/parser/compiler_spec.rb b/spec/unit/parser/compiler_spec.rb index 261cfdec1..4cab3cb65 100755 --- a/spec/unit/parser/compiler_spec.rb +++ b/spec/unit/parser/compiler_spec.rb @@ -33,6 +33,14 @@ class CompilerTestResource def evaluate end + + def file + "/fake/file/goes/here" + end + + def line + "42" + end end describe Puppet::Parser::Compiler do @@ -418,52 +426,6 @@ describe Puppet::Parser::Compiler do @compiler.catalog.should be_edge(@scope.resource, resource) end - it "should add an edge to any specified stage for class resources" do - other_stage = resource(:stage, "other") - @compiler.add_resource(@scope, other_stage) - resource = resource(:class, "foo") - resource[:stage] = 'other' - - @compiler.add_resource(@scope, resource) - - @compiler.catalog.edge?(other_stage, resource).should be_true - end - - it "should fail if a non-class resource attempts to set a stage" do - other_stage = resource(:stage, "other") - @compiler.add_resource(@scope, other_stage) - resource = resource(:file, "foo") - resource[:stage] = 'other' - - lambda { @compiler.add_resource(@scope, resource) }.should raise_error(ArgumentError) - end - - it "should fail if an unknown stage is specified" do - resource = resource(:class, "foo") - resource[:stage] = 'other' - - lambda { @compiler.add_resource(@scope, resource) }.should raise_error(ArgumentError) - end - - it "should add edges from the class resources to the parent's stage if no stage is specified" do - main = @compiler.catalog.resource(:stage, :main) - foo_stage = resource(:stage, :foo_stage) - @compiler.add_resource(@scope, foo_stage) - resource = resource(:class, "foo") - @scope.stubs(:resource).returns(:stage => :foo_stage) - @compiler.add_resource(@scope, resource) - - @compiler.catalog.should be_edge(foo_stage, resource) - end - - it "should add edges from top-level class resources to the main stage if no stage is specified" do - main = @compiler.catalog.resource(:stage, :main) - resource = resource(:class, "foo") - @compiler.add_resource(@scope, resource) - - @compiler.catalog.should be_edge(main, resource) - end - it "should not add non-class resources that don't specify a stage to the 'main' stage" do main = @compiler.catalog.resource(:stage, :main) resource = resource(:file, "foo") |