Skip to content

Commit

Permalink
use assert_forwarded where we test unchanged arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Jan 10, 2011
1 parent e7c68ce commit 19664c0
Showing 1 changed file with 9 additions and 23 deletions.
32 changes: 9 additions & 23 deletions test/hub_test.rb
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 19664c0

Please sign in to comment.