summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2018-03-07 02:54:06 +0900
committerShinya Maeda <shinya@gitlab.com>2018-03-07 02:54:06 +0900
commit0b49e8e646e114d213c15e9fc3e360e644fcd5b3 (patch)
tree2ce98c2e4fd2856c2578095079213391cfe0ef71
parentb8ce910ff491d890670c1e00bb0a752d00659227 (diff)
downloadgitlab-ce-0b49e8e646e114d213c15e9fc3e360e644fcd5b3.tar.gz
Fix false positive spec of using digest instead of hexdigest
-rw-r--r--spec/lib/gitlab/ci/trace_spec.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/lib/gitlab/ci/trace_spec.rb b/spec/lib/gitlab/ci/trace_spec.rb
index a514747b940..448c6fb57dd 100644
--- a/spec/lib/gitlab/ci/trace_spec.rb
+++ b/spec/lib/gitlab/ci/trace_spec.rb
@@ -413,7 +413,7 @@ describe Gitlab::Ci::Trace do
expect(build.job_artifacts_trace.file.filename).to eq('job.log')
expect(File.exist?(src_path)).to be_falsy
expect(src_checksum)
- .to eq(Digest::SHA256.file(build.job_artifacts_trace.file.path).digest)
+ .to eq(Digest::SHA256.file(build.job_artifacts_trace.file.path).hexdigest)
expect(build.job_artifacts_trace.file_sha256).to eq(src_checksum)
end
end
@@ -439,7 +439,7 @@ describe Gitlab::Ci::Trace do
expect(build.job_artifacts_trace.file.filename).to eq('job.log')
expect(build.old_trace).to be_nil
expect(src_checksum)
- .to eq(Digest::SHA256.file(build.job_artifacts_trace.file.path).digest)
+ .to eq(Digest::SHA256.file(build.job_artifacts_trace.file.path).hexdigest)
expect(build.job_artifacts_trace.file_sha256).to eq(src_checksum)
end
end
@@ -459,7 +459,7 @@ describe Gitlab::Ci::Trace do
context 'when trace file stored in default path' do
let!(:build) { create(:ci_build, :success, :trace_live) }
let!(:src_path) { trace.read { |s| return s.path } }
- let!(:src_checksum) { Digest::SHA256.file(src_path).digest }
+ let!(:src_checksum) { Digest::SHA256.file(src_path).hexdigest }
it_behaves_like 'archive trace file'
@@ -485,7 +485,7 @@ describe Gitlab::Ci::Trace do
context 'when trace is stored in database' do
let(:build) { create(:ci_build, :success) }
let(:trace_content) { 'Sample trace' }
- let!(:src_checksum) { Digest::SHA256.digest(trace_content) }
+ let!(:src_checksum) { Digest::SHA256.hexdigest(trace_content) }
before do
build.update_column(:trace, trace_content)