Skip to content

Commit b840a93

Browse files
committed
fix type3x
1 parent 5b8b860 commit b840a93

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
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
EOS
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)") if args.empty? || 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/functions/type_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require 'spec_helper'
22

3-
describe 'type' do
3+
describe 'type' do
44
it 'exists' do
55
expect(Puppet::Parser::Functions.function('type')).to eq('function_type')
66
end

0 commit comments

Comments
 (0)