Skip to content

Commit 3f44686

Browse files
author
Jeff McCune
committed
Merge branch 'fix/2.1.x/spec_failures' into 2.1.x
* fix/2.1.x/spec_failures: (Maint) Fix mis-use of rvalue functions as statements Add .rspec file to repo root
2 parents a033450 + 4492913 commit 3f44686

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

.rspec

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
--color
2+
--format
3+
progress
4+
--backtrace

spec/unit/puppet/parser/functions/getvar_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ def get_scope
2323
describe 'when calling getvar from puppet' do
2424

2525
it "should not compile when no arguments are passed" do
26-
Puppet[:code] = 'getvar()'
26+
Puppet[:code] = '$rval = getvar()'
2727
get_scope
2828
expect { @scope.compiler.compile }.should raise_error(Puppet::ParseError, /wrong number of arguments/)
2929
end
3030
it "should not compile when too many arguments are passed" do
31-
Puppet[:code] = 'getvar("foo::bar", "baz")'
31+
Puppet[:code] = '$rval = getvar("foo::bar", "baz")'
3232
get_scope
3333
expect { @scope.compiler.compile }.should raise_error(Puppet::ParseError, /wrong number of arguments/)
3434
end

spec/unit/puppet/parser/functions/has_key_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222

2323
describe 'when calling has_key from puppet' do
2424
it "should not compile when no arguments are passed" do
25-
Puppet[:code] = 'has_key()'
25+
Puppet[:code] = '$rval = has_key()'
2626
expect { compiler.compile }.should raise_error(Puppet::ParseError, /wrong number of arguments/)
2727
end
2828
it "should not compile when 1 argument is passed" do
29-
Puppet[:code] = "has_key('foo')"
29+
Puppet[:code] = "$rval = has_key('foo')"
3030
expect { compiler.compile }.should raise_error(Puppet::ParseError, /wrong number of arguments/)
3131
end
3232
it "should require the first value to be a Hash" do
33-
Puppet[:code] = "has_key('foo', 'bar')"
33+
Puppet[:code] = "$rval = has_key('foo', 'bar')"
3434
expect { compiler.compile }.should raise_error(Puppet::ParseError, /expects the first argument to be a hash/)
3535
end
3636
end

spec/unit/puppet/parser/functions/merge_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222

2323
describe 'when calling merge from puppet' do
2424
it "should not compile when no arguments are passed" do
25-
Puppet[:code] = 'merge()'
25+
Puppet[:code] = '$rval = merge()'
2626
expect { compiler.compile }.should raise_error(Puppet::ParseError, /wrong number of arguments/)
2727
end
2828
it "should not compile when 1 argument is passed" do
29-
Puppet[:code] = "$my_hash={'one' => 1}\nmerge($my_hash)"
29+
Puppet[:code] = "$my_hash={'one' => 1}\n$rval = merge($my_hash)"
3030
expect { compiler.compile }.should raise_error(Puppet::ParseError, /wrong number of arguments/)
3131
end
3232
end

0 commit comments

Comments
 (0)