aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/info_test.rb
blob: f71044bf02f6da53f23374b78f5df6b05d53de36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
require "testing_env"
require "cmd/info"
require "formula"
require "testing_env"

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