Skip to content

Commit 47a9d2d

Browse files
author
Kevin Paulisse
committed
Fixnum -> integer for fact overrides
1 parent d08dea3 commit 47a9d2d

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lib/octocatalog-diff/api/v1/override.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ def convert_to_data_type(datatype, value)
7272
return value if datatype == 'string'
7373
return parse_json(value) if datatype == 'json'
7474
return nil if datatype == 'nil'
75-
if datatype == 'fixnum'
75+
if datatype == 'fixnum' || datatype == 'integer'
7676
return Regexp.last_match(1).to_i if value =~ /^(-?\d+)$/
77-
raise ArgumentError, "Illegal fixnum '#{value}'"
77+
raise ArgumentError, "Illegal integer '#{value}'"
7878
end
7979
if datatype == 'float'
8080
return Regexp.last_match(1).to_f if value =~ /^(-?\d*\.\d+)$/

spec/octocatalog-diff/integration/fact_override_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,24 +134,24 @@
134134
pending 'catalog-diff failed' unless @result[:exitcode] == 2 && @diffs.size == 1
135135
file = @diffs[0][2].split(/\n/)
136136
expect(file).to include('my_boolean: TrueClass true')
137-
expect(file).to include('my_integer: Fixnum 42')
137+
expect(file).to include('my_integer: Integer 42')
138138
expect(file).to include('my_float: Float 3.14159')
139-
expect(file).to include('my_floating_integer: Fixnum -100')
139+
expect(file).to include('my_floating_integer: Integer -100')
140140
expect(file).to include('my_json: String "{\\"hello\\":\\"world\\"}"')
141141
expect(file).to include('my_boolean_string: FalseClass false')
142-
expect(file).to include('my_integer_string: Fixnum 42')
142+
expect(file).to include('my_integer_string: Integer 42')
143143
expect(file).to include('my_float_string: Float 3.14159')
144144
expect(file).to include('real_boolean: FalseClass false')
145145
expect(file).to include('real_float: Float 3.14159')
146-
expect(file).to include('real_integer: Fixnum 42')
146+
expect(file).to include('real_integer: Integer 42')
147147
expect(file).to include('real_string: String "chicken"')
148148
end
149149

150150
it 'should show the specified data types in the new catalog' do
151151
pending 'catalog-diff failed' unless @result[:exitcode] == 2 && @diffs.size == 1
152152
file = @diffs[0][3].split(/\n/)
153153
expect(file).to include('my_boolean: TrueClass true')
154-
expect(file).to include('my_integer: Fixnum 42')
154+
expect(file).to include('my_integer: Integer 42')
155155
expect(file).to include('my_float: Float 3.14159')
156156
expect(file).to include('my_floating_integer: Float -100.0')
157157
expect(file).to include('my_json: Hash {"hello"=>"world"}')
@@ -160,7 +160,7 @@
160160
expect(file).to include('my_float_string: String "3.14159"')
161161
expect(file).to include('real_boolean: FalseClass false')
162162
expect(file).to include('real_float: Float 3.14159')
163-
expect(file).to include('real_integer: Fixnum 42')
163+
expect(file).to include('real_integer: Integer 42')
164164
expect(file).to include('real_string: String "chicken"')
165165
end
166166
end

0 commit comments

Comments
 (0)