Skip to content

Commit

Permalink
Add test for --debug option (#139)
Browse files Browse the repository at this point in the history
gets coverage of `lib/aptly_command.rb` to 100%! 😄
  • Loading branch information
msabramo authored and sepulworld committed Jul 26, 2016
1 parent 11c391c commit 064b058
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/aptly_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def initialize(config, options = nil)
end
end

self.class.debug_output $stdout if @config[:debug] == true
self.class.debug_output @config[:debug] ? $stdout : nil
end
end
end
8 changes: 8 additions & 0 deletions test/test_aptly_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ def password(_prompt)
cmd.config[:debug].must_equal nil
end

it 'handles the "debug" option' do
options = Options.new
options.debug = true
config = AptlyCli::AptlyLoad.new.configure_with(nil)
cmd = AptlyCli::AptlyCommand.new(config, options)
cmd.config[:debug].must_equal true
end

it 'can process an option with \'${PROMPT}\' in it' do
options = Options.new
options.username = '${PROMPT}'
Expand Down

0 comments on commit 064b058

Please sign in to comment.