Bug report
When attempting to implement #658 (repeatable flags), our test suite would break, since flags marked repeatable would persist, even beyond the boundaries of test methods (e.g. testB would contain parsed options from testA). Initially I thought this was an error in Thor, but on closer inspection, it appears to be an issue in the design of our CLI commands.
Our CLI commands all follow a similar invocation design:
def command
rescue_and_exit do
KLASS.from_options(options)
end
I propose changing KLASS.from_options(options) to KLASS.new(options). This gives us finer-grained control over the scope of these CLI invocations.
Expected behavior: [What you expected to happen]
krane_deploy("-f foo bar") -> 'filenames = ['foo', 'bar']
krane_deploy() -> "filenames = []
Actual behavior: [What actually happened]
krane_deploy("-f foo bar") -> 'filenames = ['foo', 'bar']
krane_deploy() -> "filenames = ['foo', 'bar']
Version(s) affected:
version 1 and up are affected, though currently we don't do anything that causes this behaviour to make problems for us.
Steps to Reproduce
set repeatable: true to any CLI arg and run the test suite
Bug report
When attempting to implement #658 (repeatable flags), our test suite would break, since flags marked repeatable would persist, even beyond the boundaries of test methods (e.g.
testBwould contain parsed options fromtestA). Initially I thought this was an error in Thor, but on closer inspection, it appears to be an issue in the design of our CLI commands.Our CLI commands all follow a similar invocation design:
I propose changing
KLASS.from_options(options)toKLASS.new(options). This gives us finer-grained control over the scope of these CLI invocations.Expected behavior: [What you expected to happen]
Actual behavior: [What actually happened]
krane_deploy("-f foo bar") -> 'filenames = ['foo', 'bar']
krane_deploy() -> "filenames = ['foo', 'bar']
Version(s) affected:
version 1 and up are affected, though currently we don't do anything that causes this behaviour to make problems for us.
Steps to Reproduce
set
repeatable: trueto any CLI arg and run the test suite