diff options
| author | ytti <saku@ytti.fi> | 2016-02-18 00:27:28 +0200 | 
|---|---|---|
| committer | ytti <saku@ytti.fi> | 2016-02-18 00:27:28 +0200 | 
| commit | 2e7dd813f8659e9418b65983b661b48a1aaf832e (patch) | |
| tree | 1ddc79cae0edc894eed94b3d2ffd49aac9272975 /spec | |
| parent | 8bb72c7f7a0051472ad4b09401023d2e0b39f111 (diff) | |
| parent | e732e7cc29a035b34657316530f94627ba24f816 (diff) | |
Merge pull request #318 from danilopopeye/show-version
show version option
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/cli_spec.rb | 24 | 
1 files changed, 24 insertions, 0 deletions
| diff --git a/spec/cli_spec.rb b/spec/cli_spec.rb new file mode 100644 index 0000000..783d9c8 --- /dev/null +++ b/spec/cli_spec.rb @@ -0,0 +1,24 @@ +require 'spec_helper' +require 'oxidized/cli' + +describe Oxidized::CLI do +  let(:asetus) { mock() } + +  after  { ARGV.replace @original } +  before { @original = ARGV } + +  %w[-v --version].each do |option| +    describe option do +      before { ARGV.replace [option] } + +      it 'prints the version and exits' do +        Oxidized::Config.expects(:load).returns(asetus) +        Kernel.expects(:exit) + +        proc { +          Oxidized::CLI.new +        }.must_output "#{Oxidized::VERSION}\n" +      end +    end +  end +end | 
