Commit 874c6ba7 authored by Dylan Griffith's avatar Dylan Griffith

Add test to show behaviour of when script is defined in both files being merged

parent bb2e2db8
......@@ -196,6 +196,33 @@ describe EE::Gitlab::Ci::Config do
}
})
end
context 'when the script key is in both' do
let(:gitlab_ci_yml) do
<<~HEREDOC
include:
- #{remote_location}
job1:
script:
- echo 'hello from main file'
variables:
VARIABLE_DEFINED_IN_MAIN_FILE: 'some value'
HEREDOC
end
it 'uses the script from the gitlab_ci.yml' do
WebMock.stub_request(:get, remote_location).to_return(body: remote_file_content)
expect(config.to_hash).to eq({
job1: {
script: ["echo 'hello from main file'"],
variables: {
VARIABLE_DEFINED_IN_MAIN_FILE: 'some value'
}
}
})
end
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment