diff options
Diffstat (limited to 'spec/lib/gitlab/ci/build/artifacts/metadata/entry_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/build/artifacts/metadata/entry_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/build/artifacts/metadata/entry_spec.rb b/spec/lib/gitlab/ci/build/artifacts/metadata/entry_spec.rb index 24d17eb0fb3..73c3cad88bc 100644 --- a/spec/lib/gitlab/ci/build/artifacts/metadata/entry_spec.rb +++ b/spec/lib/gitlab/ci/build/artifacts/metadata/entry_spec.rb @@ -34,27 +34,32 @@ describe Gitlab::Ci::Build::Artifacts::Metadata::Entry do describe '#basename' do subject { |example| path(example).basename } + it { is_expected.to eq 'absolute_path' } end end describe 'path/dir_1/', path: 'path/dir_1/' do subject { |example| path(example) } + it { is_expected.to have_parent } it { is_expected.to be_directory } describe '#basename' do subject { |example| path(example).basename } + it { is_expected.to eq 'dir_1/' } end describe '#name' do subject { |example| path(example).name } + it { is_expected.to eq 'dir_1' } end describe '#parent' do subject { |example| path(example).parent } + it { is_expected.to eq entry('path/') } end @@ -102,21 +107,25 @@ describe Gitlab::Ci::Build::Artifacts::Metadata::Entry do describe '#nodes' do subject { |example| path(example).nodes } + it { is_expected.to eq 2 } end describe '#exists?' do subject { |example| path(example).exists? } + it { is_expected.to be true } end describe '#empty?' do subject { |example| path(example).empty? } + it { is_expected.to be false } end describe '#total_size' do subject { |example| path(example).total_size } + it { is_expected.to eq(30) } end end @@ -124,10 +133,12 @@ describe Gitlab::Ci::Build::Artifacts::Metadata::Entry do describe 'empty path', path: '' do subject { |example| path(example) } + it { is_expected.not_to have_parent } describe '#children' do subject { |example| path(example).children } + it { expect(subject.count).to eq 3 } end end @@ -135,6 +146,7 @@ describe Gitlab::Ci::Build::Artifacts::Metadata::Entry do describe 'path/dir_1/subdir/subfile', path: 'path/dir_1/subdir/subfile' do describe '#nodes' do subject { |example| path(example).nodes } + it { is_expected.to eq 4 } end @@ -153,11 +165,13 @@ describe Gitlab::Ci::Build::Artifacts::Metadata::Entry do describe 'non-existent/', path: 'non-existent/' do describe '#empty?' do subject { |example| path(example).empty? } + it { is_expected.to be true } end describe '#exists?' do subject { |example| path(example).exists? } + it { is_expected.to be false } end end @@ -165,6 +179,7 @@ describe Gitlab::Ci::Build::Artifacts::Metadata::Entry do describe 'another_directory/', path: 'another_directory/' do describe '#empty?' do subject { |example| path(example).empty? } + it { is_expected.to be true } end end |