From 4501f69592c13b72b6d0c1dd8c0eeec0c40244ed Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sat, 25 Feb 2017 19:49:46 +0100 Subject: Convert `cmd/info` test to spec. --- Library/Homebrew/test/cmd/info_spec.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'Library/Homebrew/test/cmd') diff --git a/Library/Homebrew/test/cmd/info_spec.rb b/Library/Homebrew/test/cmd/info_spec.rb index d33035972..8deef3d23 100644 --- a/Library/Homebrew/test/cmd/info_spec.rb +++ b/Library/Homebrew/test/cmd/info_spec.rb @@ -1,3 +1,5 @@ +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 -- cgit v1.2.3