summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/ci/build/artifacts/metadata_spec.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-01-20 21:48:22 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2016-01-20 21:55:13 +0100
commit9b0f57781e8c71eb0e627a63078fedcedfe62bbb (patch)
treec9e9708a8740e1f215a7ba08d97736bc29162c27 /spec/lib/gitlab/ci/build/artifacts/metadata_spec.rb
parent425f8d6f572a3ae47c971a48bfefc9907c7bda55 (diff)
downloadgitlab-ce-ci/recursive-artifacts-entries.tar.gz
Add method that calculates total size for artifacts subfolderci/recursive-artifacts-entries
Diffstat (limited to 'spec/lib/gitlab/ci/build/artifacts/metadata_spec.rb')
-rw-r--r--spec/lib/gitlab/ci/build/artifacts/metadata_spec.rb17
1 files changed, 15 insertions, 2 deletions
diff --git a/spec/lib/gitlab/ci/build/artifacts/metadata_spec.rb b/spec/lib/gitlab/ci/build/artifacts/metadata_spec.rb
index 828eedfa7b0..eea01f91879 100644
--- a/spec/lib/gitlab/ci/build/artifacts/metadata_spec.rb
+++ b/spec/lib/gitlab/ci/build/artifacts/metadata_spec.rb
@@ -1,8 +1,8 @@
require 'spec_helper'
describe Gitlab::Ci::Build::Artifacts::Metadata do
- def metadata(path = '')
- described_class.new(metadata_file_path, path)
+ def metadata(path = '', **opts)
+ described_class.new(metadata_file_path, path, **opts)
end
let(:metadata_file_path) do
@@ -51,6 +51,19 @@ describe Gitlab::Ci::Build::Artifacts::Metadata do
end
end
+ describe '#find_entries! recursively for other_artifacts_0.1.2/' do
+ subject { metadata('other_artifacts_0.1.2/', recursive: true).find_entries! }
+
+ it 'matches correct paths' do
+ expect(subject.keys).
+ to contain_exactly 'other_artifacts_0.1.2/',
+ 'other_artifacts_0.1.2/doc_sample.txt',
+ 'other_artifacts_0.1.2/another-subdirectory/',
+ 'other_artifacts_0.1.2/another-subdirectory/empty_directory/',
+ 'other_artifacts_0.1.2/another-subdirectory/banana_sample.gif'
+ end
+ end
+
describe '#to_entry' do
subject { metadata('').to_entry }
it { is_expected.to be_an_instance_of(Gitlab::Ci::Build::Artifacts::Metadata::Entry) }