diff options
author | Danilo Sousa <dsgoncalves@uoldiveo.com> | 2016-02-17 14:45:54 -0200 |
---|---|---|
committer | Danilo Sousa <dsgoncalves@uoldiveo.com> | 2016-02-17 15:55:42 -0200 |
commit | e732e7cc29a035b34657316530f94627ba24f816 (patch) | |
tree | 93dd155c81a20bea35138cb17335a10ad1d9a2f4 /spec | |
parent | f4f97914195129c7c75d034ac22ca132e2a3ad17 (diff) |
create `-v` and `--version` options
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 |