From 369bf7c96cfcf342c55f7a57170bd00c352154e3 Mon Sep 17 00:00:00 2001 From: Elvin Efendi Date: Thu, 2 Jun 2016 23:41:42 +0200 Subject: cleaner spec --- lib/oxidized/input/.telnet.rb.swp | Bin 0 -> 16384 bytes lib/oxidized/worker.rb | 2 +- spec/cli_spec.rb | 14 +++++++------- 3 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 lib/oxidized/input/.telnet.rb.swp diff --git a/lib/oxidized/input/.telnet.rb.swp b/lib/oxidized/input/.telnet.rb.swp new file mode 100644 index 0000000..dc6503d Binary files /dev/null and b/lib/oxidized/input/.telnet.rb.swp differ diff --git a/lib/oxidized/worker.rb b/lib/oxidized/worker.rb index 7aec42a..1952d01 100644 --- a/lib/oxidized/worker.rb +++ b/lib/oxidized/worker.rb @@ -28,7 +28,7 @@ module Oxidized @jobs.push Job.new node Oxidized.logger.debug "lib/oxidized/worker.rb: Added #{node.name} to the job queue" end - Oxidized.logger.debug "lib/oxidized/worker.rb: #{@jobs.size} jobs running in parallel" + Oxidized.logger.debug("lib/oxidized/worker.rb: #{@jobs.size} jobs running in parallel") unless @jobs.empty? end def process job diff --git a/spec/cli_spec.rb b/spec/cli_spec.rb index b248766..f3e7cb4 100644 --- a/spec/cli_spec.rb +++ b/spec/cli_spec.rb @@ -2,21 +2,21 @@ require 'spec_helper' require 'oxidized/cli' describe Oxidized::CLI do - let(:asetus) { mock() } - + before do + @original = ARGV + @asetus = Asetus.new + end after { ARGV.replace @original } - before { @original = ARGV } %w[-v --version].each do |option| describe option do - before { ARGV.push(option) } + before { ARGV.replace([option]) } it 'prints the version and exits' do + Asetus.expects(:new).returns(@asetus) Kernel.expects(:exit) - proc { - Oxidized::CLI.new - }.must_output "#{Oxidized::VERSION}\n" + assert_output("#{Oxidized::VERSION}\n") { Oxidized::CLI.new } end end end -- cgit v1.2.1