Skip to content

Commit f5768a1

Browse files
author
Kevin Paulisse
committed
More fixnums / integer fixes
1 parent 8010ee4 commit f5768a1

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lib/octocatalog-diff/catalog-diff/display/text.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ def self.left_pad(spaces, text = '')
447447
def self.stringify_for_diffy(obj)
448448
return JSON.pretty_generate(obj) if [Hash, Array].include?(obj.class)
449449
return '""' if obj.is_a?(String) && obj == ''
450-
return obj if [String, Integer, Float].include?(obj.class)
450+
return obj if [String, Fixnum, Integer, Float].include?(obj.class)
451451
"#{obj.class}: #{obj.inspect}"
452452
end
453453

spec/octocatalog-diff/integration/fact_override_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
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: Integer 42')
137+
expect(file).to include('my_integer: Fixnum 42')
138138
expect(file).to include('my_float: Float 3.14159')
139139
expect(file).to include('my_floating_integer: Integer -100')
140140
expect(file).to include('my_json: String "{\\"hello\\":\\"world\\"}"')
@@ -151,7 +151,7 @@
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: Integer 42')
154+
expect(file).to include('my_integer: Fixnum 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: Integer 42')
163+
expect(file).to include('real_integer: Fixnum 42')
164164
expect(file).to include('real_string: String "chicken"')
165165
end
166166
end

spec/octocatalog-diff/tests/catalog-diff/display/text_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@
958958
expect(result).to eq('hello')
959959
end
960960

961-
it 'should return the object directly if it is a fixnum' do
961+
it 'should return the object directly if it is an integer' do
962962
result = OctocatalogDiff::CatalogDiff::Display::Text.stringify_for_diffy(42)
963963
expect(result).to eq(42)
964964
end

0 commit comments

Comments
 (0)