aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMarkus Reiter2017-02-26 01:12:14 +0100
committerGitHub2017-02-26 01:12:14 +0100
commitbc928222496f6fbfb83e3050eb8dfbf514f18f7f (patch)
tree2a2730d64ae477998df70f29dd2136476c1a9bfb /Library
parent714b23f002690c0692d45287c7019e274fea2ef4 (diff)
parent4501f69592c13b72b6d0c1dd8c0eeec0c40244ed (diff)
downloadbrew-bc928222496f6fbfb83e3050eb8dfbf514f18f7f.tar.bz2
Merge pull request #2188 from reitermarkus/spec-info
Convert `cmd/info` test to spec.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/test/cmd/info_spec.rb20
-rw-r--r--Library/Homebrew/test/info_test.rb20
2 files changed, 20 insertions, 20 deletions
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
diff --git a/Library/Homebrew/test/info_test.rb b/Library/Homebrew/test/info_test.rb
deleted file mode 100644
index d8a0f7904..000000000
--- a/Library/Homebrew/test/info_test.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-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