tests: cmd/edit & cmd/info tests added
This commit is contained in:
parent
861910b85f
commit
36c734b392
19
Library/Homebrew/test/test_cmd_info.rb
Normal file
19
Library/Homebrew/test/test_cmd_info.rb
Normal file
@ -0,0 +1,19 @@
|
||||
require "testing_env"
|
||||
require "cmd/info"
|
||||
require "formula"
|
||||
|
||||
class InfoCommandTests < Homebrew::TestCase
|
||||
def test_github_remote_path
|
||||
remote = "https://github.com/Homebrew/homebrew"
|
||||
assert_equal "https://github.com/Homebrew/homebrew/blob/master/Formula/git.rb",
|
||||
Homebrew.github_remote_path(remote, "Formula/git.rb")
|
||||
assert_equal "https://github.com/Homebrew/homebrew/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
|
||||
@ -287,6 +287,20 @@ class IntegrationCommandTests < Homebrew::TestCase
|
||||
def test_sh
|
||||
assert_match "Your shell has been configured",
|
||||
cmd("sh", {"SHELL" => "/usr/bin/true"})
|
||||
|
||||
def test_info
|
||||
formula_file = CoreFormulaRepository.new.formula_dir/"testball.rb"
|
||||
content = <<-EOS.undent
|
||||
class Testball < Formula
|
||||
url "https://example.com/testball-0.1.tar.gz"
|
||||
end
|
||||
EOS
|
||||
formula_file.write content
|
||||
|
||||
assert_match "testball: stable 0.1",
|
||||
cmd("info", "testball")
|
||||
ensure
|
||||
formula_file.unlink
|
||||
end
|
||||
|
||||
def test_custom_command
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user