This repository has been archived by the owner on May 12, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Get rid of BROKEN_DIFF constant * Diff.between raises exception in case of timeout now * Add tests to Compare * Cache diff result for Compare Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
- Loading branch information
1 parent
3a5b33d
commit e704561
Showing
5 changed files
with
67 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
require "spec_helper" | ||
|
||
describe Gitlab::Git::Compare do | ||
let(:repository) { Gitlab::Git::Repository.new(TEST_REPO_PATH) } | ||
let(:compare) { Gitlab::Git::Compare.new(repository, | ||
"3a4b4fb4cde7809f033822a171b9feae19d41fff", | ||
"8470d70da67355c9c009e4401746b1d5410af2e3") } | ||
|
||
describe :commits do | ||
subject do | ||
compare.commits.map(&:id) | ||
end | ||
|
||
it { should have(3).elements } | ||
it { should include("f0f14c8eaba69ebddd766498a9d0b0e79becd633") } | ||
it { should_not include("bcf03b5de6c33f3869ef70d68cf06e679d1d7f9a") } | ||
end | ||
|
||
describe :diffs do | ||
subject do | ||
compare.diffs.map(&:new_path) | ||
end | ||
|
||
it { should have(19).elements } | ||
it { should include('app/assets/javascripts/application.js') } | ||
it { should_not include('Gemfile') } | ||
it { compare.timeout.should be_false } | ||
it { compare.empty_diff?.should be_false } | ||
end | ||
end |