Skip to content
Snippets Groups Projects
Commit bc928222 authored by Markus Reiter's avatar Markus Reiter Committed by GitHub
Browse files

Merge pull request #2188 from reitermarkus/spec-info

Convert `cmd/info` test to spec.
parents 714b23f0 4501f695
No related branches found
No related tags found
No related merge requests found
require "cmd/info"
describe "brew info", :integration_test do
it "prints information about a given Formula" do
setup_test_formula "testball"
......@@ -8,3 +10,21 @@ describe "brew info", :integration_test do
.and be_a_success
end
end
describe Homebrew do
let(:remote) { "https://github.com/Homebrew/homebrew-core" }
specify "::github_remote_path" do
expect(subject.github_remote_path(remote, "Formula/git.rb"))
.to eq("https://github.com/Homebrew/homebrew-core/blob/master/Formula/git.rb")
expect(subject.github_remote_path("#{remote}.git", "Formula/git.rb"))
.to eq("https://github.com/Homebrew/homebrew-core/blob/master/Formula/git.rb")
expect(subject.github_remote_path("git@github.com:user/repo", "foo.rb"))
.to eq("https://github.com/user/repo/blob/master/foo.rb")
expect(subject.github_remote_path("https://mywebsite.com", "foo/bar.rb"))
.to eq("https://mywebsite.com/foo/bar.rb")
end
end
require "testing_env"
require "cmd/info"
require "formula"
require "testing_env"
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment