-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the object 'options' provided by Commander doesn't have methods to te… #137
Conversation
@@ -39,14 +39,12 @@ def password(_prompt) | |||
options.port = 9000 | |||
options.username = 'me' | |||
options.password = 'secret' | |||
options.debug = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to revisit this. If we have this set the rake test
output will include the debugging output (pretty noisy)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe default it to false?
IIRC, I added the Though maybe we can do this if by default we set options.debug = false in |
config = AptlyCli::AptlyLoad.new.configure_with(nil) | ||
cmd = AptlyCli::AptlyCommand.new(config, options) | ||
cmd.config[:server].must_equal 'my-server' | ||
cmd.config[:port].must_equal 9000 | ||
cmd.config[:username].must_equal 'me' | ||
cmd.config[:password].must_equal 'secret' | ||
cmd.config[:debug].must_equal true | ||
cmd.config[:debug].must_equal nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected.
Ok, I'm going to merge this since the options provided via command line are broken and this fixes it. Unless you have any objections? I still want to better understand the object respond_to issue as it seems it should have worked fine. |
Yeah go for it since it fixes broken options. We can always reexamine later. |
Weird that we didn't notice that the options were broken. I wonder if we should add higher level tests that invoke commands - those kind of tests should've detected that options weren't working I think. In Python, I've used a module called scripttest on occasion to do this sort of testing. Not sure what folks do in Ruby for this sort of thing. |
Yeah, I think higher level command checks makes good sense. At least to On Sat, Jul 23, 2016, 3:12 PM Marc Abramowitz notifications@github.com
|
Functional tests shouldn't be too difficult since you already have the Docker image for the aptly API server. |
Right, I have used serverspec http://serverspec.org in the past and it probably will work well here. |
#134
I believe this is the route to take. @msabramo let me know what you think. The
options
object that Commander creates doesn't have methods to test responses usingrespond_to?