Skip to content

Commit

Permalink
Follow stopped echo nil in latest irb
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Jul 8, 2024
1 parent 6d5929c commit 6d60adc
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions test/test_irb_power_assert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,13 @@ def test_typical_example
out, err = execute_lines(%q{pa "0".class == "3".to_i.times.map {|i| i + 1 }.class})

assert_equal('', err)
assert_equal(expected + "=> nil\n", out)
# TODO: Remove this version guard after dropping to support irb 1.13.x
# https://github.com/ruby/irb/pull/972
if Gem::Version.new(IRB::VERSION) >= '1.14'
assert_equal(expected, out)
else
assert_equal(expected + "=> nil\n", out)
end
end

def test_usage
Expand Down Expand Up @@ -115,7 +121,13 @@ def test_usage
out, err = execute_lines(%q{pa 42.abs})

assert_equal('', err)
assert_equal(expected + "=> nil\n", out)
# TODO: Remove this version guard after dropping to support irb 1.13.x
# https://github.com/ruby/irb/pull/972
if Gem::Version.new(IRB::VERSION) >= '1.14'
assert_equal(expected, out)
else
assert_equal(expected + "=> nil\n", out)
end
end

def test_help
Expand Down

0 comments on commit 6d60adc

Please sign in to comment.