aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Reiter2017-02-21 20:07:19 +0100
committerGitHub2017-02-21 20:07:19 +0100
commit01f8a69bdfbb9d7d1eff55268fdee538b529b616 (patch)
tree6aa0135f4cc73ff7231d720bda83074f75caf527
parented7290abb4b5a6820c30cd10b141a7713d932fd6 (diff)
parent15d681064173f06c5ca9de665d90cc9f036c6613 (diff)
downloadbrew-01f8a69bdfbb9d7d1eff55268fdee538b529b616.tar.bz2
Merge pull request #2081 from reitermarkus/spec-os_mac_blacklist
Convert `os/mac/blacklist` test to spec.
-rw-r--r--Library/Homebrew/test/blacklist_spec.rb18
-rw-r--r--Library/Homebrew/test/os/mac/blacklist_test.rb12
2 files changed, 11 insertions, 19 deletions
diff --git a/Library/Homebrew/test/blacklist_spec.rb b/Library/Homebrew/test/blacklist_spec.rb
index 89d254893..01882167d 100644
--- a/Library/Homebrew/test/blacklist_spec.rb
+++ b/Library/Homebrew/test/blacklist_spec.rb
@@ -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
diff --git a/Library/Homebrew/test/os/mac/blacklist_test.rb b/Library/Homebrew/test/os/mac/blacklist_test.rb
deleted file mode 100644
index 26dd84ed9..000000000
--- a/Library/Homebrew/test/os/mac/blacklist_test.rb
+++ /dev/null
@@ -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