Skip to content

Commit

Permalink
Modify tests for Ruby 3..0 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
mblumtritt committed May 12, 2024
1 parent 1a5c31e commit b6e85e2
Showing 1 changed file with 36 additions and 14 deletions.
50 changes: 36 additions & 14 deletions spec/lib/im-lost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,22 @@ def fwd(...) = add(...)
expect(output).to eq "> TestSample#insp(**{})\n"
end

it 'handles argument forwarding' do
sample.fwd(40, 2)
expect(output).to eq <<~OUTPUT
> TestSample#fwd(*, **, &)
> TestSample#add(40, 2)
OUTPUT
if RUBY_VERSION < '3.1.0'
it 'handles argument forwarding' do
sample.fwd(40, 2)
expect(output).to eq <<~OUTPUT
> TestSample#fwd(*, &)
> TestSample#add(40, 2)
OUTPUT
end
else
it 'handles argument forwarding' do
sample.fwd(40, 2)
expect(output).to eq <<~OUTPUT
> TestSample#fwd(*, **, &)
> TestSample#add(40, 2)
OUTPUT
end
end

it 'can trace an object in a block only' do
Expand Down Expand Up @@ -168,14 +178,26 @@ def fwd(...) = add(...)
expect(output).to eq "< TestSample#insp(**{})\n = \"{}\"\n"
end

it 'handles argument forwarding' do
sample.fwd(40, 2)
expect(output).to eq <<~OUTPUT
< TestSample#add(40, 2)
= 42
< TestSample#fwd(*, **, &)
= 42
OUTPUT
if RUBY_VERSION < '3.1.0'
it 'handles argument forwarding' do
sample.fwd(40, 2)
expect(output).to eq <<~OUTPUT
< TestSample#add(40, 2)
= 42
< TestSample#fwd(*, &)
= 42
OUTPUT
end
else
it 'handles argument forwarding' do
sample.fwd(40, 2)
expect(output).to eq <<~OUTPUT
< TestSample#add(40, 2)
= 42
< TestSample#fwd(*, **, &)
= 42
OUTPUT
end
end

it 'can trace an object`s call results in a block only' do
Expand Down

0 comments on commit b6e85e2

Please sign in to comment.