From 7000d42b8634396b518568939bb1f6ac9e49e4d3 Mon Sep 17 00:00:00 2001 From: Elvin Efendi Date: Thu, 2 Jun 2016 22:34:19 +0200 Subject: fix specs --- spec/cli_spec.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'spec/cli_spec.rb') diff --git a/spec/cli_spec.rb b/spec/cli_spec.rb index 0a6c91b..b248766 100644 --- a/spec/cli_spec.rb +++ b/spec/cli_spec.rb @@ -9,11 +9,9 @@ describe Oxidized::CLI do %w[-v --version].each do |option| describe option do - before { ARGV.replace [option] } + before { ARGV.push(option) } it 'prints the version and exits' do - Oxidized::Config.expects(:load) - Oxidized.expects(:setup_logger) Kernel.expects(:exit) proc { -- cgit v1.2.1 From 369bf7c96cfcf342c55f7a57170bd00c352154e3 Mon Sep 17 00:00:00 2001 From: Elvin Efendi Date: Thu, 2 Jun 2016 23:41:42 +0200 Subject: cleaner spec --- spec/cli_spec.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'spec/cli_spec.rb') 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 From 64bdbeb673a8ab7155478ee5e0d1d58c1631a9d3 Mon Sep 17 00:00:00 2001 From: Elvin Efendi Date: Thu, 2 Jun 2016 23:51:08 +0200 Subject: fix cli spec --- spec/cli_spec.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'spec/cli_spec.rb') diff --git a/spec/cli_spec.rb b/spec/cli_spec.rb index f3e7cb4..eb9872e 100644 --- a/spec/cli_spec.rb +++ b/spec/cli_spec.rb @@ -2,10 +2,7 @@ require 'spec_helper' require 'oxidized/cli' describe Oxidized::CLI do - before do - @original = ARGV - @asetus = Asetus.new - end + before { @original = ARGV } after { ARGV.replace @original } %w[-v --version].each do |option| @@ -13,7 +10,9 @@ describe Oxidized::CLI do before { ARGV.replace([option]) } it 'prints the version and exits' do - Asetus.expects(:new).returns(@asetus) + Oxidized::Config.expects(:load) + Oxidized.expects(:setup_logger) + File.expects(:expand_path) Kernel.expects(:exit) assert_output("#{Oxidized::VERSION}\n") { Oxidized::CLI.new } -- cgit v1.2.1