Skip to content
This repository has been archived by the owner on Dec 18, 2019. It is now read-only.

Commit

Permalink
more brevity
Browse files Browse the repository at this point in the history
  • Loading branch information
jgoulah committed Apr 12, 2016
1 parent 66ea6a2 commit e04890d
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions test/unit/git_test.rb
Expand Up @@ -8,25 +8,19 @@ class HelpersTest < Test::Unit::TestCase

def test_git_url_https
GitHelpers.expects(:which_github_host).returns("www.testmagic.com")
GitHelpers.expects(:git_info_for_stack).returns({:stack => {:repository => 'drills', :user => 'construction'}})
GitHelpers.expects(:git_info_for_stack).returns({:stack => {:repository => 'drills', :user => 'construction'}})
GitHelpers.expects(:git_info_for_stack).returns({:stack => {:repository => 'drills', :user => 'construction'}})
GitHelpers.expects(:git_info_for_stack).returns({:stack => {:repository => 'drills', :user => 'construction'}}).at_least_once
assert_equal('https://www.testmagic.com/construction/drills.git', GitHelpers.git_url(:stack, 'https', false))
end

def test_git_url_default
GitHelpers.expects(:which_github_host).returns("www.testmagic.com")
GitHelpers.expects(:git_info_for_stack).returns({:stack => {:repository => 'drills', :user => 'construction'}})
GitHelpers.expects(:git_info_for_stack).returns({:stack => {:repository => 'drills', :user => 'construction'}})
GitHelpers.expects(:git_info_for_stack).returns({:stack => {:repository => 'drills', :user => 'construction'}})
GitHelpers.expects(:git_info_for_stack).returns({:stack => {:repository => 'drills', :user => 'construction'}}).at_least_once
assert_equal('git://www.testmagic.com/construction/drills', GitHelpers.git_url(:stack))
end

def test_git_url_read_write
GitHelpers.expects(:which_github_host).returns("www.testmagic.com")
GitHelpers.expects(:git_info_for_stack).returns({:stack => {:repository => 'drills', :user => 'construction'}})
GitHelpers.expects(:git_info_for_stack).returns({:stack => {:repository => 'drills', :user => 'construction'}})
GitHelpers.expects(:git_info_for_stack).returns({:stack => {:repository => 'drills', :user => 'construction'}})
GitHelpers.expects(:git_info_for_stack).returns({:stack => {:repository => 'drills', :user => 'construction'}}).at_least_once
assert_equal('git@www.testmagic.com:construction/drills', GitHelpers.git_url(:stack, "git", true))
end

Expand Down

0 comments on commit e04890d

Please sign in to comment.