diff options
author | Andrew Newdigate <andrew@gitlab.com> | 2017-11-01 14:41:17 +0000 |
---|---|---|
committer | Andrew Newdigate <andrew@gitlab.com> | 2017-11-01 14:41:17 +0000 |
commit | 3cd29ffe53fa38ce1b77d2c4e0d806edd340d120 (patch) | |
tree | 81a2548e1d268d9695571ddccbf68f070f018f68 /qa/spec/scenario/entrypoint_spec.rb | |
parent | a5f586c0361b371f6bfc24a6de219cf6a178d85e (diff) | |
parent | 5c1459ef0f1fa4f091ccb735aba9fd918f53105d (diff) | |
download | gitlab-ce-an/gitaly-timeouts.tar.gz |
Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into an/gitaly-timeoutsan/gitaly-timeouts
# Conflicts:
# app/models/application_setting.rb
# db/schema.rb
Diffstat (limited to 'qa/spec/scenario/entrypoint_spec.rb')
-rw-r--r-- | qa/spec/scenario/entrypoint_spec.rb | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/qa/spec/scenario/entrypoint_spec.rb b/qa/spec/scenario/entrypoint_spec.rb new file mode 100644 index 00000000000..3fd068b641c --- /dev/null +++ b/qa/spec/scenario/entrypoint_spec.rb @@ -0,0 +1,46 @@ +describe QA::Scenario::Entrypoint do + subject do + Class.new(QA::Scenario::Entrypoint) do + tags :rspec + end + end + + context '#perform' do + let(:config) { spy('Specs::Config') } + let(:release) { spy('Runtime::Release') } + let(:runner) { spy('Specs::Runner') } + + before do + allow(config).to receive(:perform) { |&block| block.call config } + allow(runner).to receive(:perform) { |&block| block.call runner } + + stub_const('QA::Specs::Config', config) + stub_const('QA::Runtime::Release', release) + stub_const('QA::Specs::Runner', runner) + end + + it 'should set address' do + subject.perform("hello") + + expect(config).to have_received(:address=).with("hello") + end + + context 'no paths' do + it 'should call runner with default arguments' do + subject.perform("test") + + expect(runner).to have_received(:rspec) + .with(hash_including(files: 'qa/specs/features')) + end + end + + context 'specifying paths' do + it 'should call runner with paths' do + subject.perform('test', 'path1', 'path2') + + expect(runner).to have_received(:rspec) + .with(hash_including(files: %w(path1 path2))) + end + end + end +end |