-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
abc591e
commit b909990
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -258,6 +258,36 @@ def setup_completion(link:) | |
end | ||
end | ||
|
||
describe "#custom_remote?" do | ||
subject(:tap) { described_class.new("Homebrew", "services") } | ||
let(:remote) { nil } | ||
|
||
before do | ||
tap.path.mkpath | ||
system "git", "-C", tap.path, "init" | ||
system "git", "-C", tap.path, "remote", "add", "origin", remote if remote | ||
end | ||
|
||
context "if no remote is available" do | ||
it "returns true" do | ||
expect(tap.remote).to be nil | ||
expect(tap.custom_remote?).to be true | ||
end | ||
end | ||
|
||
context "when using the default remote" do | ||
let(:remote) { "https://github.com/Homebrew/homebrew-services" } | ||
|
||
its(:custom_remote?) { is_expected.to be false } | ||
end | ||
|
||
context "when using a non-default remote" do | ||
let(:remote) { "[email protected]:Homebrew/homebrew-services" } | ||
|
||
its(:custom_remote?) { is_expected.to be true } | ||
end | ||
end | ||
|
||
specify "Git variant" do | ||
touch path/"README" | ||
setup_git_repo | ||
|