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') 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