debian-mirror-gitlab/qa/spec/scenario/bootable_spec.rb

34 lines
1,005 B
Ruby
Raw Normal View History

2019-07-31 22:56:46 +05:30
# frozen_string_literal: true
2021-01-03 14:25:43 +05:30
RSpec.describe QA::Scenario::Bootable do
2018-03-17 18:26:18 +05:30
subject do
Class.new(QA::Scenario::Template)
.include(described_class)
end
2019-07-07 11:18:12 +05:30
before do
allow(subject).to receive(:options).and_return([])
allow(QA::Runtime::Scenario).to receive(:attributes).and_return({})
end
2018-03-17 18:26:18 +05:30
it 'makes it possible to define the scenario attribute' do
subject.class_eval do
attribute :something, '--something SOMETHING', 'Some attribute'
attribute :another, '--another ANOTHER', 'Some other attribute'
end
2019-07-07 11:18:12 +05:30
# If we run just this test from the command line it fails unless
# we include the command line args that we use to select this test.
2018-03-17 18:26:18 +05:30
expect(subject).to receive(:perform)
2019-07-07 11:18:12 +05:30
.with({ something: 'test', another: 'other' })
2018-03-17 18:26:18 +05:30
subject.launch!(%w[--another other --something test])
end
it 'does not require attributes to be defined' do
expect(subject).to receive(:perform).with('some', 'argv')
subject.launch!(%w[some argv])
end
end