Skip to content

Commit

Permalink
Update test to avoide being dependent on git configuration
Browse files Browse the repository at this point in the history
The previous test implementation was dependent on the git configuration:
	renames = copies

It could then pass on a computer with that config but not passe on
a different developpeur computer who could have a different git configuration.

That new implementation is testing the same behaviour but at a lower
level and is not dependent on the git configuration anymore.
  • Loading branch information
etienneCharignon committed Nov 28, 2014
1 parent 9f8a90c commit 508c255
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ rvm:
before_install:
- sudo apt-get update
- sudo apt-get install libicu-dev
- git config --global --add diff.renames copies
2 changes: 1 addition & 1 deletion test/test_latest_changes_view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ def app
assert !body.include?('0ed8cbe'), "/latest_changes should not include more than latest_changes_count commits"
assert body.include?('<a href="Data-Two.csv/874f597a5659b4c3b153674ea04e406ff393975e">Data-Two.csv</a>'), "/latest_changes include links to modified files in #{body}"
assert body.include?('<a href="Hobbit/874f597a5659b4c3b153674ea04e406ff393975e">Hobbit.md</a>'), "/latest_changes should include links to modified pages in #{body}"
assert body.include?('<a href="My-Precious/60f12f4254f58801b9ee7db7bca5fa8aeefaa56b">My-&lt;b&gt;Precious.md =&gt; My-Precious.md</a>'), "/latest_changes should indicate renaming action in #{body}"
end

test "extract destination file name in case of path renaming" do
view = Precious::Views::LatestChanges.new
assert_equal "newname.md", view.extract_renamed_path_destination("oldname.md => newname.md")
assert_equal "newDirectoryName/fileName.md", view.extract_renamed_path_destination("{oldDirectoryName => newDirectoryName}/fileName.md")
end

Expand Down

0 comments on commit 508c255

Please sign in to comment.