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

Merge pull request #2081 from reitermarkus/spec-os_mac_blacklist

Convert `os/mac/blacklist` test to spec.
parents ed7290ab 15d68106
No related branches found
No related tags found
No related merge requests found
require "blacklist"
RSpec::Matchers.define :be_blacklisted do
match do |actual|
blacklisted?(actual)
end
end
describe "Blacklist" do
matcher(:be_blacklisted) { match(&method(:blacklisted?)) }
context "rubygems" do
%w[gem rubygem rubygems].each do |s|
subject { s }
......@@ -103,9 +99,17 @@ describe "Blacklist" do
it { is_expected.to be_blacklisted }
end
context "haskell_platform" do
context "haskell-platform" do
subject { "haskell-platform" }
it { is_expected.to be_blacklisted }
end
context "xcode", :needs_macos do
%w[xcode Xcode].each do |s|
subject { s }
it { is_expected.to be_blacklisted }
end
end
end
require "testing_env"
require "blacklist"
class OSMacBlacklistTests < Homebrew::TestCase
def assert_blacklisted(s)
assert blacklisted?(s), "'#{s}' should be blacklisted"
end
def test_xcode
%w[xcode Xcode].each { |s| assert_blacklisted s }
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