2019-04-11 12:02:24 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-09-25 03:09:30 +00:00
|
|
|
RSpec.describe QA::Runtime::Release do
|
2017-03-09 11:18:55 +00:00
|
|
|
context 'when release version has extension strategy' do
|
2017-03-13 12:54:33 +00:00
|
|
|
let(:strategy) { spy('strategy') }
|
2017-03-09 11:18:55 +00:00
|
|
|
|
|
|
|
before do
|
2017-03-13 12:54:33 +00:00
|
|
|
stub_const('QA::CE::Strategy', strategy)
|
|
|
|
stub_const('QA::EE::Strategy', strategy)
|
2017-03-09 11:18:55 +00:00
|
|
|
end
|
|
|
|
|
2017-03-13 12:54:33 +00:00
|
|
|
describe '#version' do
|
|
|
|
it 'return either CE or EE version' do
|
|
|
|
expect(subject.version).to eq(:CE).or eq(:EE)
|
2017-03-09 11:18:55 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe '#strategy' do
|
|
|
|
it 'return the strategy constant' do
|
2017-03-13 12:54:33 +00:00
|
|
|
expect(subject.strategy).to eq strategy
|
2017-03-09 11:18:55 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'delegated class methods' do
|
|
|
|
it 'delegates all calls to strategy class' do
|
|
|
|
described_class.some_method(1, 2)
|
|
|
|
|
|
|
|
expect(strategy).to have_received(:some_method)
|
|
|
|
.with(1, 2)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|