test_tap: restore private remote test

Only test it if HOMEBREW_GITHUB_API_TOKEN is set.
This commit is contained in:
Xu Cheng 2016-01-11 22:07:04 +08:00
parent 86cc780ea2
commit 9810c2a412

View File

@ -5,7 +5,6 @@ class TapTest < Homebrew::TestCase
@path = Tap::TAP_DIRECTORY/"homebrew/homebrew-foo"
@path.mkpath
@tap = Tap.new("Homebrew", "foo")
@tap.stubs(:private?).returns(true) if ENV["HOMEBREW_NO_GITHUB_API"]
end
def setup_tap_files
@ -116,6 +115,11 @@ class TapTest < Homebrew::TestCase
refute_predicate version_tap, :private?
end
def test_private_remote
skip "HOMEBREW_GITHUB_API_TOKEN is required" unless ENV["HOMEBREW_GITHUB_API_TOKEN"]
assert_predicate @tap, :private?
end
def test_install_tap_already_tapped_error
assert_raises(TapAlreadyTappedError) { @tap.install }
end