From 19664c01154e401c85e2256edf6bfef2af24548c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Mon, 10 Jan 2011 04:17:25 +0100 Subject: [PATCH] use `assert_forwarded` where we test unchanged arguments --- test/hub_test.rb | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/test/hub_test.rb b/test/hub_test.rb index fc9ae8bcb..69fb2a4f7 100644 --- a/test/hub_test.rb +++ b/test/hub_test.rb @@ -95,27 +95,19 @@ def test_your_public_clone_fails_without_config end def test_private_clone_left_alone - input = "clone git@github.com:rtomayko/ronn.git" - command = "git clone git@github.com:rtomayko/ronn.git" - assert_command input, command + assert_forwarded "clone git@github.com:rtomayko/ronn.git" end def test_public_clone_left_alone - input = "clone git://github.com/rtomayko/ronn.git" - command = "git clone git://github.com/rtomayko/ronn.git" - assert_command input, command + assert_forwarded "clone git://github.com/rtomayko/ronn.git" end def test_normal_public_clone_with_path - input = "clone git://github.com/rtomayko/ronn.git ronn-dev" - command = "git clone git://github.com/rtomayko/ronn.git ronn-dev" - assert_command input, command + assert_forwarded "clone git://github.com/rtomayko/ronn.git ronn-dev" end def test_normal_clone_from_path - input = "clone ./test" - command = "git clone ./test" - assert_command input, command + assert_forwarded "clone ./test" end def test_remote_origin @@ -137,21 +129,15 @@ def test_public_remote_origin_as_normal end def test_remote_from_rel_path - input = "remote add origin ./path" - command = "git remote add origin ./path" - assert_command input, command + assert_forwarded "remote add origin ./path" end def test_remote_from_abs_path - input = "remote add origin /path" - command = "git remote add origin /path" - assert_command input, command + assert_forwarded "remote add origin /path" end def test_private_remote_origin_as_normal - input = "remote add origin git@github.com:defunkt/resque.git" - command = "git remote add origin git@github.com:defunkt/resque.git" - assert_command input, command + assert_forwarded "remote add origin git@github.com:defunkt/resque.git" end def test_public_submodule @@ -233,7 +219,7 @@ def test_named_private_remote_with_repo end def test_fetch_existing_remote - assert_command "fetch mislav", "git fetch mislav" + assert_forwarded "fetch mislav" end def test_fetch_new_remote @@ -688,7 +674,7 @@ def test_no_browser end def test_context_method_doesnt_hijack_git_command - assert_command 'remotes', 'git remotes' + assert_forwarded 'remotes' end def test_not_choking_on_ruby_methods