From 508c255d0f43eda78fb98256a37a76bfffb5f188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Charignon?= Date: Fri, 28 Nov 2014 09:01:14 +0100 Subject: [PATCH] Update test to avoide being dependent on git configuration 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. --- .travis.yml | 1 - test/test_latest_changes_view.rb | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index d37f5efc..ff17fd05 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,4 +6,3 @@ rvm: before_install: - sudo apt-get update - sudo apt-get install libicu-dev - - git config --global --add diff.renames copies diff --git a/test/test_latest_changes_view.rb b/test/test_latest_changes_view.rb index 1af3ee53..4883b223 100644 --- a/test/test_latest_changes_view.rb +++ b/test/test_latest_changes_view.rb @@ -24,11 +24,11 @@ context "Precious::Views::LatestChanges" do assert !body.include?('0ed8cbe'), "/latest_changes should not include more than latest_changes_count commits" assert body.include?('Data-Two.csv'), "/latest_changes include links to modified files in #{body}" assert body.include?('Hobbit.md'), "/latest_changes should include links to modified pages in #{body}" - assert body.include?('My-<b>Precious.md => My-Precious.md'), "/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