Port `hub push` tests to cukes

This commit is contained in:
Mislav Marohnić 2014-07-25 20:38:12 -07:00
Родитель a81e271d07
Коммит ba8456b57c
2 изменённых файлов: 24 добавлений и 28 удалений

24
features/push.feature Normal file
Просмотреть файл

@ -0,0 +1,24 @@
Feature: hub push
Background:
Given I am in "git://github.com/mislav/coral.git" git repo
Scenario: Normal push
When I successfully run `hub push`
Then the git command should be unchanged
Scenario: Push current branch to multiple remotes
Given I am on the "cool-feature" branch
When I successfully run `hub push origin,staging`
Then "git push origin cool-feature" should be run
Then "git push staging cool-feature" should be run
Scenario: Push explicit branch to multiple remotes
When I successfully run `hub push origin,staging,qa cool-feature`
Then "git push origin cool-feature" should be run
Then "git push staging cool-feature" should be run
Then "git push qa cool-feature" should be run
Scenario: Push multiple refs to multiple remotes
When I successfully run `hub push origin,staging master new-feature`
Then "git push origin master new-feature" should be run
Then "git push staging master new-feature" should be run

Просмотреть файл

@ -161,34 +161,6 @@ class HubTest < Minitest::Test
"cherry-pick xoebus@a319d88"
end
def test_push_untouched
assert_forwarded "push"
end
def test_push_two
assert_commands "git push origin cool-feature", "git push staging cool-feature",
"push origin,staging cool-feature"
end
def test_push_current_branch
stub_branch('refs/heads/cool-feature')
assert_commands "git push origin cool-feature", "git push staging cool-feature",
"push origin,staging"
end
def test_push_more
assert_commands "git push origin cool-feature",
"git push staging cool-feature",
"git push qa cool-feature",
"push origin,staging,qa cool-feature"
end
def test_push_multiple_refs
assert_commands "git push origin master new-feature",
"git push staging master new-feature",
"push origin,staging master new-feature"
end
def test_pullrequest_from_branch_tracking_local
stub_config_value 'push.default', 'upstream'
stub_branch('refs/heads/feature')