diff options
author | Elvin Efendi <elvin.efendiyev@gmail.com> | 2016-06-02 23:41:42 +0200 |
---|---|---|
committer | Elvin Efendi <elvin.efendiyev@gmail.com> | 2016-06-02 23:41:42 +0200 |
commit | 369bf7c96cfcf342c55f7a57170bd00c352154e3 (patch) | |
tree | 5755db4b505f1070771adf7316a3d96f1296b3af /spec | |
parent | 7000d42b8634396b518568939bb1f6ac9e49e4d3 (diff) |
cleaner spec
Diffstat (limited to 'spec')
-rw-r--r-- | spec/cli_spec.rb | 14 |
1 files changed, 7 insertions, 7 deletions
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 |