Skip to content

Commit

Permalink
made the Heroku and GitHub helper methods return information about
Browse files Browse the repository at this point in the history
what has been setup (URL, and Git URL)
  • Loading branch information
ejdraper committed Jul 12, 2009
1 parent fffba9e commit d4a05d9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions lib/appsta/github.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def github
git(:remote => "add origin git@github.com:#{github_username}/#{name}.git")
# Push the code up to GitHub
git(:push => "origin master")
# Return the information for the GitHub repo
"http://github.com/#{github_username}/#{name} - git@github.com:#{github_username}/#{name}.git"
end
end
end
2 changes: 2 additions & 0 deletions lib/appsta/heroku.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ def heroku(environment = :production)
git(:remote => "add #{environment} git@heroku.com:#{name}.git")
# Push the code up to Heroku for the initial deploy
git(:push => "#{environment} master")
# Return the Heroku information for this app
"http://#{name}.heroku.com - git@heroku.com:#{name}.git"
end
end
end
2 changes: 1 addition & 1 deletion test/test_github.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class TestGitHub < Test::Unit::TestCase
end

should "not fail" do
assert true, RunGitHub.new.github
assert_equal "http://github.com/github_username/appsta - git@github.com:github_username/appsta.git", RunGitHub.new.github
end
end

Expand Down
4 changes: 2 additions & 2 deletions test/test_heroku.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class TestHeroku < Test::Unit::TestCase
should "not fail and should ask for Heroku credentials first time around" do
RunHeroku.any_instance.expects(:ask).with("Heroku Username:").returns("heroku_username")
RunHeroku.any_instance.expects(:ask).with("Heroku Password:").returns("heroku_password")
assert true, RunHeroku.new.heroku
assert_equal "http://appsta.heroku.com - git@heroku.com:appsta.git", RunHeroku.new.heroku
end
end

Expand All @@ -29,7 +29,7 @@ class TestHeroku < Test::Unit::TestCase
end

should "not fail and should not ask for Heroku credentials second time around" do
assert true, RunHeroku.new.heroku(:test)
assert_equal "http://appsta-test.heroku.com - git@heroku.com:appsta-test.git", RunHeroku.new.heroku(:test)
end
end

Expand Down

0 comments on commit d4a05d9

Please sign in to comment.