spec/lib/optparse_spec.rb in hieracles-0.2.0 vs spec/lib/optparse_spec.rb in hieracles-0.2.1
- old
+ new
@@ -4,26 +4,26 @@
describe '.initialize' do
context 'with proper arguments' do
let(:array) { ['arg1', 'arg2', '-c', 'path/to/config-file', '-f', 'thatformat'] }
let(:expected_payload) { ['arg1', 'arg2'] }
let(:expected_options) do
- { config: 'path/to/config-file', format: 'thatformat' }
+ { }
end
subject { Hieracles::Optparse.new array }
it "populates payload" do
expect(subject.payload).to eq expected_payload
end
- it 'populates options' do
+ it 'populates no options' do
expect(subject.options).to eq expected_options
end
end
context 'with proper arguments in random order' do
let(:array) { ['-c', 'path/to/config-file', 'arg1', 'arg2', '-f', 'thatformat'] }
let(:expected_payload) { ['arg1', 'arg2'] }
let(:expected_options) do
- { config: 'path/to/config-file', format: 'thatformat' }
+ { }
end
subject { Hieracles::Optparse.new array }
it "populates payload" do
expect(subject.payload).to eq expected_payload
end
@@ -34,11 +34,11 @@
context 'with funnily ordered arguments' do
let(:array) { ['arg1', '-u', 'path/to/config-file', 'arg2', '-f', 'thatformat'] }
let(:expected_payload) { ['arg1', 'arg2'] }
let(:expected_options) do
- { format: 'thatformat' }
+ { }
end
subject { Hieracles::Optparse.new array }
it "populates payload" do
expect(subject.payload).to eq expected_payload
end
@@ -49,11 +49,11 @@
context 'with arguments in alternative syntax' do
let(:array) { ['arg1', 'arg2', '-config', 'path/to/config-file', '--format', 'thatformat'] }
let(:expected_payload) { ['arg1', 'arg2'] }
let(:expected_options) do
- { config: 'path/to/config-file', format: 'thatformat' }
+ { }
end
subject { Hieracles::Optparse.new array }
it "populates payload" do
expect(subject.payload).to eq expected_payload
end
@@ -63,12 +63,12 @@
end
context 'with arguments containing boolean element' do
let(:array) { ['arg1', 'arg2', '-i', '-format', 'thatformat'] }
- let(:expected_payload) { ['arg1', 'arg2'] }
+ let(:expected_payload) { ['arg1', 'arg2', 'thatformat'] }
let(:expected_options) do
- { format: 'thatformat', interactive: true }
+ { }
end
subject { Hieracles::Optparse.new array }
it "populates payload" do
expect(subject.payload).to eq expected_payload
end