Skip to content

Commit 1d55153

Browse files
committed
fix type3x
1 parent 89675b1 commit 1d55153

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lib/puppet/parser/functions/type.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module Puppet::Parser::Functions
1111
unless Puppet::Parser::Functions.autoloader.loaded?(:type3x)
1212
Puppet::Parser::Functions.autoloader.load(:type3x)
1313
end
14-
function_type3x(args + [false])
14+
function_type3x(args)
1515
end
1616
end
1717

lib/puppet/parser/functions/type3x.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ module Puppet::Parser::Functions
1515
* boolean
1616
DOC
1717
) do |args|
18-
raise(Puppet::ParseError, "type3x(): Wrong number of arguments given (#{args.size} for 1)") if args.empty?
18+
raise(Puppet::ParseError, "type3x(): Wrong number of arguments given (#{args.size} for 1)") unless args.size == 1
1919

2020
value = args[0]
2121

2222
klass = value.class
2323

24-
unless [TrueClass, FalseClass, Array, Integer, Integer, Float, Hash, String].include?(klass)
24+
unless [TrueClass, FalseClass, Array, Bignum, Fixnum, Float, Hash, String].include?(klass) # rubocop:disable Lint/UnifiedInteger
2525
raise(Puppet::ParseError, 'type3x(): Unknown type')
2626
end
2727

spec/acceptance/type3x_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
end
1919

2020
describe 'failure' do
21-
pp_fail = <<-EOS
21+
pp_fail = <<-MANIFEST
2222
type3x('one','two')
23-
EOS
23+
MANIFEST
2424
it 'handles improper number of arguments' do
2525
expect(apply_manifest(pp_fail, :expect_failures => true).stderr).to match(%r{Wrong number of arguments})
2626
end

0 commit comments

Comments
 (0)