Here, with broken_find.rb
required, specification.rb
raises an error saying stub
is an Array.
/Users/okuramasafumi/.rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/specification.rb:1065:in
find_active_stub_by_path': undefined method this' for #<Array:0x00007fc3e18ff960> (NoMethodError)
The error disappears with working_find.rb
required.
The only difference is whether ifnone.call if ifnone
exists or not.
However, in specification.rb
uses find
method without ifnone
argument. This means ifnone
is nil
.
So, why adding ifnone.call if ifnone
to broken_find.rb
actually fixes the problem?