Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 5a04bb1

Browse files
author
Sergei Trofimovich
committed
object_formatter_spec.rb: fix tests on ia64
The error is caused by formatter: ``` class UninspectableObjectInspector < BaseInspector OBJECT_ID_FORMAT = '%#016x' ... ``` '%#016x' produces 16 bytes most of the time (including leading "0x"). Unless original address is more than 7 bytes. ia64 architecture happens to use highest bytes extensively: ``` $ cat /proc/self/maps 00000000-00004000 r--p 00000000 00:00 0 2000000000000000-2000000000044000 r-xp 00000000 68:04 5205554 /lib/ld-2.24.so 2000000000044000-200000000004c000 rw-p 00000000 00:00 0 ``` Nope 16-byte addresses. That makes tests fail as: ``` Failures: 1) RSpec::Support::ObjectFormatter.format with an object that does not respond to #inspect such as BasicObject produces an output emulating MRI's #inspect-like output generated by C impleme ntation Failure/Error: expect(output).to match(/\A#<BasicObject:0x[0-9a-f]{14}>\z/) expected "#<BasicObject:0x6000000001466b10>" to match /\A#<BasicObject:0x[0-9a-f]{14}>\z/ Diff: @@ -1,2 +1,2 @@ -/\A#<BasicObject:0x[0-9a-f]{14}>\z/ +"#<BasicObject:0x6000000001466b10>" # ./spec/rspec/support/object_formatter_spec.rb:200:in `block (3 levels) in <module:Support>' Finished in 1.53 seconds (files took 0.75756 seconds to load) 475 examples, 1 failure, 2 pending ``` Signed-off-by: Sergei Trofimovich <[email protected]>
1 parent abc4124 commit 5a04bb1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spec/rspec/support/object_formatter_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def self.to_s
197197
end
198198
else
199199
it "produces an output emulating MRI's #inspect-like output generated by C implementation" do
200-
expect(output).to match(/\A#<BasicObject:0x[0-9a-f]{14}>\z/)
200+
expect(output).to match(/\A#<BasicObject:0x[0-9a-f]{14,16}>\z/)
201201
end
202202
end
203203
end

0 commit comments

Comments
 (0)