You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TL;DR: I'm trying to test something using Slop with RSpec, and RSpec injects a matches? method, which leads to it trying to access the Matches?Option constant, which is invalid and thus raises an exception instead of performing the normal default behavior.
I believe changing Slop.option_defined? to the following would fix it:
defself.option_defined?(name)const_defined?(string_to_option(name.to_s))rescueNameError# If a NameError is raised, it wasn't a valid constant name,# and thus couldn't have been defined.falseend
TL;DR: I'm trying to test something using Slop with RSpec, and RSpec injects a
matches?
method, which leads to it trying to access theMatches?Option
constant, which is invalid and thus raises an exception instead of performing the normal default behavior.Given:
I get the following error: https://travis-ci.org/how-is/how_is/jobs/153859371#L228
This happens because of
const_defined?(string_to_open(name.to_s))
in slop.rb, line 33.I'll look into building a testcase.
The text was updated successfully, but these errors were encountered: