diff options
Diffstat (limited to 'Library/Homebrew/test/test_info.rb')
| -rw-r--r-- | Library/Homebrew/test/test_info.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_info.rb b/Library/Homebrew/test/test_info.rb new file mode 100644 index 000000000..35f9183e1 --- /dev/null +++ b/Library/Homebrew/test/test_info.rb @@ -0,0 +1,29 @@ +require "testing_env" +require "cmd/info" +require "formula" +require "helper/integration_command_test_case" + +class IntegrationCommandTestInfo < IntegrationCommandTestCase + def test_info + setup_test_formula "testball" + + assert_match "testball: stable 0.1", + cmd("info", "testball") + end +end + +class InfoCommandTests < Homebrew::TestCase + def test_github_remote_path + remote = "https://github.com/Homebrew/homebrew-core" + assert_equal "https://github.com/Homebrew/homebrew-core/blob/master/Formula/git.rb", + Homebrew.github_remote_path(remote, "Formula/git.rb") + assert_equal "https://github.com/Homebrew/homebrew-core/blob/master/Formula/git.rb", + Homebrew.github_remote_path("#{remote}.git", "Formula/git.rb") + + assert_equal "https://github.com/user/repo/blob/master/foo.rb", + Homebrew.github_remote_path("git@github.com:user/repo", "foo.rb") + + assert_equal "https://mywebsite.com/foo/bar.rb", + Homebrew.github_remote_path("https://mywebsite.com", "foo/bar.rb") + end +end |
