diff options
author | Patrick Bajao <ebajao@gitlab.com> | 2019-07-05 14:03:47 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2019-07-05 14:03:47 +0300 |
commit | 6ef6693e3767d480362ce528dd0beff159c895ff (patch) | |
tree | d2f55dee037e7258ce8eec829bca4bb77f34a745 /spec/lib/gitlab/diff/position_spec.rb | |
parent | a1edc5a5cb3e740b0c215c54ce282535b143a9db (diff) |
Refactor PositionTracer to support different types
This is to prepare for supporing image type position tracing
Diffstat (limited to 'spec/lib/gitlab/diff/position_spec.rb')
-rw-r--r-- | spec/lib/gitlab/diff/position_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/lib/gitlab/diff/position_spec.rb b/spec/lib/gitlab/diff/position_spec.rb index aea02d21048..b755cd1aff0 100644 --- a/spec/lib/gitlab/diff/position_spec.rb +++ b/spec/lib/gitlab/diff/position_spec.rb @@ -610,4 +610,17 @@ describe Gitlab::Diff::Position do it_behaves_like "diff position json" end end + + describe "#file_hash" do + subject do + described_class.new( + old_path: "image.jpg", + new_path: "image.jpg" + ) + end + + it "returns SHA1 representation of the file_path" do + expect(subject.file_hash).to eq(Digest::SHA1.hexdigest(subject.file_path)) + end + end end |