mirror of
https://github.com/gosticks/brew.git
synced 2026-10-06 15:36:59 +00:00
Merge pull request #2081 from reitermarkus/spec-os_mac_blacklist
Convert `os/mac/blacklist` test to spec.
This commit is contained in:
@@ -1,12 +1,8 @@
|
||||
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
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
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
|
||||
Reference in New Issue
Block a user