Convert os/mac/blacklist test to spec.

This commit is contained in:
Markus Reiter 2017-02-21 06:09:09 +01:00
parent bd0a1314c8
commit 15d6810641
2 changed files with 11 additions and 19 deletions

View File

@ -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

View File

@ -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