Skip to content

Commit b2ffcca

Browse files
committed
! Fix a failed test case in 3.4 due to error message format diff in ruby 3.4
1 parent 8329024 commit b2ffcca

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

spec/ruby_version_specific/contracts_spec_2.1.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ def complicated(a, b = true, *c, d, e:, f:2, **g, &h)
5656
@o.complicated("a", true, :b, :c, 2.0, e: (1..5), f: nil, g: :d) do |x|
5757
x
5858
end
59-
end.to raise_error(ContractError, /Expected: \(KeywordArgs\[{:e=>Range, :f=>Optional\[Num\], :g=>Symbol}\]\)/)
59+
end.to raise_error(
60+
ContractError,
61+
# 3.3- vs 3.4+ error message format
62+
/(Expected: \(KeywordArgs\[{:e=>Range, :f=>Optional\[Num\], :g=>Symbol}\]\)|Expected: \(KeywordArgs\[{e: Range, f: Optional\[Num\], g: Symbol}\]\))/,
63+
)
6064
end
6165
end
6266
end

0 commit comments

Comments
 (0)