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
I have a generator that inherits from NamedBase and defines a --sqlclass_option.
I invoke it with run_generator["foo", "--sql bar"] but inside the generator options[:bar] is nil. I looked at the implementation of run_generator and generator and saw that it's using Thor to parse the options. I verified that Thor::Options.splt works as expected on the array I'm passing to run_generator... and yet, still the option in nil in the generatornd it seems that indeed args and opts are getting set correctly. And yet, the option is still nil in my tests.
Compounding the problem (and limiting my normal debug tools) is that it seems pry does not work inside the generator. It works in my non-generator spec and even works when I run the generator from the command line, outside of my tests. But in my generator specs, pry opens but no statements return anything. I can call methods, non-existent methods, pry method -- none of them do anything.
The generator runs as expected when I try it from the command line so the problem is indeed limited to the specs.
The text was updated successfully, but these errors were encountered:
I have a generator that inherits from NamedBase and defines a
--sql
class_option
.I invoke it with
run_generator["foo", "--sql bar"]
but inside the generatoroptions[:bar]
isnil
. I looked at the implementation ofrun_generator
andgenerator
and saw that it's using Thor to parse the options. I verified thatThor::Options.splt
works as expected on the array I'm passing torun_generator
... and yet, still the option in nil in the generatornd it seems that indeedargs
andopts
are getting set correctly. And yet, the option is still nil in my tests.Compounding the problem (and limiting my normal debug tools) is that it seems
pry
does not work inside the generator. It works in my non-generator spec and even works when I run the generator from the command line, outside of my tests. But in my generator specs, pry opens but no statements return anything. I can call methods, non-existent methods, pry method -- none of them do anything.The generator runs as expected when I try it from the command line so the problem is indeed limited to the specs.
The text was updated successfully, but these errors were encountered: