diff options
| author | Markus Reiter | 2017-02-11 17:33:27 +0100 |
|---|---|---|
| committer | Markus Reiter | 2017-02-11 17:33:27 +0100 |
| commit | 7be5a6a3d2cdb68870a37bdaa2d0c5cdec20c70b (patch) | |
| tree | 46af83f81f85494fbe13a44126fb96ba99881ed5 /Library | |
| parent | f531e63949683a7bf33ec96014901e3c6d5eaf61 (diff) | |
| download | brew-7be5a6a3d2cdb68870a37bdaa2d0c5cdec20c70b.tar.bz2 | |
Convert Blacklist test to spec.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/test/blacklist_spec.rb | 111 | ||||
| -rw-r--r-- | Library/Homebrew/test/blacklist_test.rb | 68 |
2 files changed, 111 insertions, 68 deletions
diff --git a/Library/Homebrew/test/blacklist_spec.rb b/Library/Homebrew/test/blacklist_spec.rb new file mode 100644 index 000000000..89d254893 --- /dev/null +++ b/Library/Homebrew/test/blacklist_spec.rb @@ -0,0 +1,111 @@ +require "blacklist" + +RSpec::Matchers.define :be_blacklisted do + match do |actual| + blacklisted?(actual) + end +end + +describe "Blacklist" do + context "rubygems" do + %w[gem rubygem rubygems].each do |s| + subject { s } + + it { is_expected.to be_blacklisted } + end + end + + context "latex" do + %w[latex tex tex-live texlive TexLive].each do |s| + subject { s } + + it { is_expected.to be_blacklisted } + end + end + + context "pip" do + subject { "pip" } + + it { is_expected.to be_blacklisted } + end + + context "pil" do + subject { "pil" } + + it { is_expected.to be_blacklisted } + end + + context "macruby" do + subject { "MacRuby" } + + it { is_expected.to be_blacklisted } + end + + context "lzma" do + %w[lzma liblzma].each do |s| + subject { s } + + it { is_expected.to be_blacklisted } + end + end + + context "gtest" do + %w[gtest googletest google-test].each do |s| + subject { s } + + it { is_expected.to be_blacklisted } + end + end + + context "gmock" do + %w[gmock googlemock google-mock].each do |s| + subject { s } + + it { is_expected.to be_blacklisted } + end + end + + context "sshpass" do + subject { "sshpass" } + + it { is_expected.to be_blacklisted } + end + + context "gsutil" do + subject { "gsutil" } + + it { is_expected.to be_blacklisted } + end + + context "clojure" do + subject { "clojure" } + + it { is_expected.to be_blacklisted } + end + + context "osmium" do + %w[osmium Osmium].each do |s| + subject { s } + + it { is_expected.to be_blacklisted } + end + end + + context "gfortran" do + subject { "gfortran" } + + it { is_expected.to be_blacklisted } + end + + context "play" do + subject { "play" } + + it { is_expected.to be_blacklisted } + end + + context "haskell_platform" do + subject { "haskell-platform" } + + it { is_expected.to be_blacklisted } + end +end diff --git a/Library/Homebrew/test/blacklist_test.rb b/Library/Homebrew/test/blacklist_test.rb deleted file mode 100644 index 585a35484..000000000 --- a/Library/Homebrew/test/blacklist_test.rb +++ /dev/null @@ -1,68 +0,0 @@ -require "testing_env" -require "blacklist" - -class BlacklistTests < Homebrew::TestCase - def assert_blacklisted(s) - assert blacklisted?(s), "'#{s}' should be blacklisted" - end - - def test_rubygems - %w[gem rubygem rubygems].each { |s| assert_blacklisted s } - end - - def test_latex - %w[latex tex tex-live texlive TexLive].each { |s| assert_blacklisted s } - end - - def test_pip - assert_blacklisted "pip" - end - - def test_pil - assert_blacklisted "pil" - end - - def test_macruby - assert_blacklisted "MacRuby" - end - - def test_lzma - %w[lzma liblzma].each { |s| assert_blacklisted s } - end - - def test_gtest - %w[gtest googletest google-test].each { |s| assert_blacklisted s } - end - - def test_gmock - %w[gmock googlemock google-mock].each { |s| assert_blacklisted s } - end - - def test_sshpass - assert_blacklisted "sshpass" - end - - def test_gsutil - assert_blacklisted "gsutil" - end - - def test_clojure - assert_blacklisted "clojure" - end - - def test_osmium - %w[osmium Osmium].each { |s| assert_blacklisted s } - end - - def test_gfortran - assert_blacklisted "gfortran" - end - - def test_play - assert_blacklisted "play" - end - - def test_haskell_platform - assert_blacklisted "haskell-platform" - end -end |
