diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-01-09 14:41:43 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-01-14 12:48:15 +0100 |
commit | 61fb47a43202332fe9ac57847996da929ba42d3f (patch) | |
tree | 95b0838eebafd9ea6c382efbfd78eaa0f3b4d6f7 /spec/lib/gitlab/ci/build/artifacts/metadata_spec.rb | |
parent | 387b27813d1d496c015f4f174812b4761c32648d (diff) | |
download | gitlab-ce-61fb47a43202332fe9ac57847996da929ba42d3f.tar.gz |
Simplify implementation of build artifacts browser (refactoring)
Diffstat (limited to 'spec/lib/gitlab/ci/build/artifacts/metadata_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/build/artifacts/metadata_spec.rb | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/spec/lib/gitlab/ci/build/artifacts/metadata_spec.rb b/spec/lib/gitlab/ci/build/artifacts/metadata_spec.rb index 0c8a41cfab7..36c4851126c 100644 --- a/spec/lib/gitlab/ci/build/artifacts/metadata_spec.rb +++ b/spec/lib/gitlab/ci/build/artifacts/metadata_spec.rb @@ -10,13 +10,8 @@ describe Gitlab::Ci::Build::Artifacts::Metadata do end context 'metadata file exists' do - describe '#exists?' do - subject { metadata.exists? } - it { is_expected.to be true } - end - - describe '#match! ./' do - subject { metadata('./').match! } + describe '#match! empty string' do + subject { metadata('').match! } it 'matches correct paths' do expect(subject.first).to contain_exactly 'ci_artifacts.txt', @@ -55,9 +50,9 @@ describe Gitlab::Ci::Build::Artifacts::Metadata do end end - describe '#to_string_path' do - subject { metadata('').to_string_path } - it { is_expected.to be_an_instance_of(Gitlab::StringPath) } + describe '#to_path' do + subject { metadata('').to_path } + it { is_expected.to be_an_instance_of(Gitlab::Ci::Build::Artifacts::Metdata::Path) } end describe '#full_version' do @@ -79,14 +74,9 @@ describe Gitlab::Ci::Build::Artifacts::Metadata do context 'metadata file does not exist' do let(:metadata_file_path) { '' } - describe '#exists?' do - subject { metadata.exists? } - it { is_expected.to be false } - end - describe '#match!' do it 'raises error' do - expect { metadata.match! }.to raise_error(StandardError, /Metadata file not found/) + expect { metadata.match! }.to raise_error(Errno::ENOENT) end end end |