summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rwxr-xr-xspec/integration/parser/compiler_spec.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/integration/parser/compiler_spec.rb b/spec/integration/parser/compiler_spec.rb
index 266347c60..ffff4d845 100755
--- a/spec/integration/parser/compiler_spec.rb
+++ b/spec/integration/parser/compiler_spec.rb
@@ -81,7 +81,7 @@ describe Puppet::Parser::Compiler do
Puppet::Parser::Compiler.compile(node).version.should == 2
end
- it "should not allow classes inside conditional constructs" do
+ it "should not allow classes inside evaluated conditional constructs" do
Puppet[:code] = <<-PP
if true {
class foo {
@@ -91,4 +91,15 @@ describe Puppet::Parser::Compiler do
lambda { Puppet::Parser::Compiler.compile(Puppet::Node.new("mynode")) }.should raise_error(Puppet::Error)
end
+
+ it "should not allow classes inside unevaluated conditional constructs" do
+ Puppet[:code] = <<-PP
+ if false {
+ class foo {
+ }
+ }
+ PP
+
+ lambda { Puppet::Parser::Compiler.compile(Puppet::Node.new("mynode")) }.should raise_error(Puppet::Error)
+ end
end