Convert os/mac/blacklist
test to spec.
This commit is contained in:
parent
bd0a1314c8
commit
15d6810641
@ -1,12 +1,8 @@
|
|||||||
require "blacklist"
|
require "blacklist"
|
||||||
|
|
||||||
RSpec::Matchers.define :be_blacklisted do
|
|
||||||
match do |actual|
|
|
||||||
blacklisted?(actual)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe "Blacklist" do
|
describe "Blacklist" do
|
||||||
|
matcher(:be_blacklisted) { match(&method(:blacklisted?)) }
|
||||||
|
|
||||||
context "rubygems" do
|
context "rubygems" do
|
||||||
%w[gem rubygem rubygems].each do |s|
|
%w[gem rubygem rubygems].each do |s|
|
||||||
subject { s }
|
subject { s }
|
||||||
@ -103,9 +99,17 @@ describe "Blacklist" do
|
|||||||
it { is_expected.to be_blacklisted }
|
it { is_expected.to be_blacklisted }
|
||||||
end
|
end
|
||||||
|
|
||||||
context "haskell_platform" do
|
context "haskell-platform" do
|
||||||
subject { "haskell-platform" }
|
subject { "haskell-platform" }
|
||||||
|
|
||||||
it { is_expected.to be_blacklisted }
|
it { is_expected.to be_blacklisted }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "xcode", :needs_macos do
|
||||||
|
%w[xcode Xcode].each do |s|
|
||||||
|
subject { s }
|
||||||
|
|
||||||
|
it { is_expected.to be_blacklisted }
|
||||||
|
end
|
||||||
|
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
|
|
Loading…
x
Reference in New Issue
Block a user