Skip to content

Commit d0dd011

Browse files
committed
overcome Bug #13087 in ruby 2.4 (arguments lost when executing instance_exec with symbol.to_proc)
1 parent 01411bd commit d0dd011

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

spec/image_optim/option_definition_spec.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@
6868
end
6969

7070
context 'when proc given' do
71-
subject{ described_class.new('abc', :def, 'desc', &:inspect) }
71+
subject do
72+
# not using &:inspect due to ruby Bug #13087
73+
# to_s is just to calm rubocop
74+
described_class.new('abc', :def, 'desc'){ |o| o.inspect.to_s }
75+
end
7276

7377
context 'when option not provided' do
7478
it 'returns default passed through proc' do

0 commit comments

Comments
 (0)