Skip to content

Commit

Permalink
Fixes cli debug logging (#166)
Browse files Browse the repository at this point in the history
Fixes cli debug logging and stops calling codeclimate from spec_helper
since the usage is outdated
  • Loading branch information
nickjanus authored and askreet committed Nov 9, 2016
1 parent cf75358 commit 3d72d6f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/moonshot/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def parser
o.banner = "Usage: moonshot #{self.class.usage}"

o.on('-v', '--[no-]verbose', 'Show debug logging') do |v|
Moonshot.config.interactive_logger.debug = true if v
Moonshot.config.interactive_logger = InteractiveLogger.new(debug: true) if v
end

o.on('-nNAME', '--environment=NAME', 'Which environment to operate on.') do |v|
Expand Down
2 changes: 2 additions & 0 deletions lib/moonshot/commands/console.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'pry'

module Moonshot
module Commands
class Console < Moonshot::Command
Expand Down
10 changes: 10 additions & 0 deletions spec/moonshot/command_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
describe Moonshot::Command do
describe '#parser' do
subject { described_class.new.parser }

it 'should parse the verbose option' do
allow(described_class).to receive(:usage)
subject.parse('-v')
end
end
end
12 changes: 12 additions & 0 deletions spec/moonshot/commands/console_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
describe Moonshot::Commands::Console do
describe '#execute' do
it 'should start a pry session' do
expect(Aws::EC2::Client).to receive(:new)
expect(Aws::IAM::Client).to receive(:new)
expect(Aws::AutoScaling::Client).to receive(:new)
expect(Aws::CloudFormation::Client).to receive(:new)
expect(Pry).to receive(:start)
subject.execute
end
end
end
3 changes: 0 additions & 3 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
require 'codeclimate-test-reporter'
CodeClimate::TestReporter.start

if ENV['COVERAGE']
require 'simplecov'

Expand Down

0 comments on commit 3d72d6f

Please sign in to comment.