spec/neobundle/command_line_spec.rb in neobundle-0.1.0 vs spec/neobundle/command_line_spec.rb in neobundle-0.2.0
- old
+ new
@@ -29,26 +29,28 @@
describe 'help or version' do
before { $stderr = $stdout = StringIO.new }
after { $stderr = STDERR; $stdout = STDOUT }
- ['', 'help', '--help', '-h', '--version'].each do |args|
+ ['', 'help', '--help', '-h', '--version', '-h'].each do |args|
describe '"%s"' % args do
let(:args){args}
it { expect{subject}.to raise_error(SystemExit) }
end
end
end
describe 'options' do
- let(:args){'--vim=path1 --vimrc=path3 install --vimrc=path4 --vim=path2'}
+ let(:args){'--vim=path1 --bundlefile=path3 --verbose=1 install -V 2 -f path4 -c path2'}
+
it do
is_expected.to eq(
command: :install,
config: {
vim: 'path2',
- vimrc: 'path4'
+ bundlefile: 'path4',
+ verbose: 2,
}
)
end
end
@@ -85,16 +87,16 @@
it {expect(subject[0]).to eq(0) }
end
context 'when the `NeoBundle::Error` was thrown' do
let(:exception){raise NeoBundle::VimscriptError, 'VimscriptError message'}
- it { expect(subject[0]).to eq(2) }
+ it { expect(subject[0]).to eq(1) }
it { expect(subject[1]).to eq('VimscriptError message') }
context 'when the `NeoBundle::Error` was thrown' do
let(:exception){raise NeoBundle::OperationAlreadyCompletedError, 'OperationAlreadyCompletedError'}
- it { expect(subject[0]).to eq(4) }
+ it { expect(subject[0]).to eq(2) }
it { expect(subject[1]).to eq('') }
end
end
context 'when the `SystemExit` was thrown' do
@@ -103,10 +105,10 @@
it { expect(subject[1]).to eq('abort message') }
end
context 'when the unknown exception was thrown' do
let(:exception){raise StandardError, 'StandardError message'}
- it { expect(subject[0]).to eq(255) }
+ it { expect(subject[0]).to eq(1) }
it { expect(subject[1]).to match(/^#<StandardError: StandardError message>/) }
end
end
end
end