aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2014-06-11 13:03:06 -0500
committerJack Nagel2014-06-18 20:34:10 -0500
commit99b24dff4c2020170cc7c9086e2c33a3d07519c7 (patch)
tree27361507a739c63306784394b8bf528e36d00311
parent07535c52e7a314a880933e489ea80fd3ccc43af2 (diff)
downloadhomebrew-99b24dff4c2020170cc7c9086e2c33a3d07519c7.tar.bz2
Use assert_includes
-rw-r--r--Library/Homebrew/test/test_build_options.rb22
-rw-r--r--Library/Homebrew/test/test_dependency_collector.rb2
-rw-r--r--Library/Homebrew/test/test_hardware.rb4
-rw-r--r--Library/Homebrew/test/test_language_module_dependency.rb2
-rw-r--r--Library/Homebrew/test/test_options.rb12
-rw-r--r--Library/Homebrew/test/test_patching.rb4
6 files changed, 23 insertions, 23 deletions
diff --git a/Library/Homebrew/test/test_build_options.rb b/Library/Homebrew/test/test_build_options.rb
index 4ef8f318a..b9c535f3e 100644
--- a/Library/Homebrew/test/test_build_options.rb
+++ b/Library/Homebrew/test/test_build_options.rb
@@ -22,9 +22,9 @@ class BuildOptionsTests < Homebrew::TestCase
end
def test_include
- assert @build.include?("with-foo")
- assert !@build.include?("with-qux")
- assert !@build.include?("--with-foo")
+ assert_includes @build, "with-foo"
+ refute_includes @build, "with-qux"
+ refute_includes @build, "--with-foo"
end
def test_with_without
@@ -35,23 +35,23 @@ class BuildOptionsTests < Homebrew::TestCase
end
def test_used_options
- assert @build.used_options.include?("--with-foo")
- assert @build.used_options.include?("--with-bar")
+ assert_includes @build.used_options, "--with-foo"
+ assert_includes @build.used_options, "--with-bar"
end
def test_unused_options
- assert @build.unused_options.include?("--without-baz")
+ assert_includes @build.unused_options, "--without-baz"
end
def test_implicit_options
# --without-baz is not explicitly specified on the command line (i.e. args)
# therefore --with-baz should be implicitly assumed:
- assert @build.implicit_options.include?("--with-baz")
+ assert_includes @build.implicit_options, "--with-baz"
# But all these should not be in the implict_options:
- assert !@build.implicit_options.include?("--without-baz")
- assert !@build.implicit_options.include?("--with-bar")
- assert !@build.implicit_options.include?("--without-bar")
- assert !@build.implicit_options.include?("--with-qux")
+ refute_includes @build.implicit_options, "--without-baz"
+ refute_includes @build.implicit_options, "--with-bar"
+ refute_includes @build.implicit_options, "--without-bar"
+ refute_includes @build.implicit_options, "--with-qux"
end
def test_opposite_of
diff --git a/Library/Homebrew/test/test_dependency_collector.rb b/Library/Homebrew/test/test_dependency_collector.rb
index a166e46da..109dcadf8 100644
--- a/Library/Homebrew/test/test_dependency_collector.rb
+++ b/Library/Homebrew/test/test_dependency_collector.rb
@@ -34,7 +34,7 @@ class DependencyCollectorTests < Homebrew::TestCase
def test_dependency_tags
assert_predicate Dependency.new('foo', [:build]), :build?
assert_predicate Dependency.new('foo', [:build, :optional]), :optional?
- assert Dependency.new('foo', [:universal]).options.include? '--universal'
+ assert_includes Dependency.new('foo', [:universal]).options, "--universal"
assert_empty Dependency.new('foo').tags
end
diff --git a/Library/Homebrew/test/test_hardware.rb b/Library/Homebrew/test/test_hardware.rb
index 6b05bde30..9f77349d1 100644
--- a/Library/Homebrew/test/test_hardware.rb
+++ b/Library/Homebrew/test/test_hardware.rb
@@ -3,11 +3,11 @@ require 'hardware'
class HardwareTests < Homebrew::TestCase
def test_hardware_cpu_type
- assert [:intel, :ppc].include?(Hardware::CPU.type)
+ assert_includes [:intel, :ppc], Hardware::CPU.type
end
def test_hardware_intel_family
families = [:core, :core2, :penryn, :nehalem, :arrandale, :sandybridge, :ivybridge, :haswell]
- assert families.include?(Hardware::CPU.family)
+ assert_includes families, Hardware::CPU.family
end if Hardware::CPU.intel?
end
diff --git a/Library/Homebrew/test/test_language_module_dependency.rb b/Library/Homebrew/test/test_language_module_dependency.rb
index d6f67ff31..eb61ea5a0 100644
--- a/Library/Homebrew/test/test_language_module_dependency.rb
+++ b/Library/Homebrew/test/test_language_module_dependency.rb
@@ -22,7 +22,7 @@ class LanguageModuleDependencyTests < Homebrew::TestCase
mod_name = "foo"
import_name = "bar"
l = LanguageModuleDependency.new(:python, mod_name, import_name)
- assert l.message.include?(mod_name)
+ assert_includes l.message, mod_name
assert l.the_test.one? { |c| c.include?(import_name) }
end
diff --git a/Library/Homebrew/test/test_options.rb b/Library/Homebrew/test/test_options.rb
index 96d1ecf05..39a0d7524 100644
--- a/Library/Homebrew/test/test_options.rb
+++ b/Library/Homebrew/test/test_options.rb
@@ -50,7 +50,7 @@ class OptionsTests < Homebrew::TestCase
def test_no_duplicate_options
@options << Option.new("foo")
@options << Option.new("foo")
- assert @options.include? "--foo"
+ assert_includes @options, "--foo"
assert_equal 1, @options.count
end
@@ -65,9 +65,9 @@ class OptionsTests < Homebrew::TestCase
def test_include
@options << Option.new("foo")
- assert @options.include? "--foo"
- assert @options.include? "foo"
- assert @options.include? Option.new("foo")
+ assert_includes @options, "--foo"
+ assert_includes @options, "foo"
+ assert_includes @options, Option.new("foo")
end
def test_union_returns_options
@@ -102,7 +102,7 @@ class OptionsTests < Homebrew::TestCase
def test_concat_array
option = Option.new("foo")
@options.concat([option])
- assert @options.include?(option)
+ assert_includes @options, option
assert_equal [option], @options.to_a
end
@@ -111,7 +111,7 @@ class OptionsTests < Homebrew::TestCase
opts = Options.new
opts << option
@options.concat(opts)
- assert @options.include?(option)
+ assert_includes @options, option
assert_equal [option], @options.to_a
end
diff --git a/Library/Homebrew/test/test_patching.rb b/Library/Homebrew/test/test_patching.rb
index cb70e5e4d..9d187c400 100644
--- a/Library/Homebrew/test/test_patching.rb
+++ b/Library/Homebrew/test/test_patching.rb
@@ -16,8 +16,8 @@ class PatchingTests < Homebrew::TestCase
def assert_patched(path)
s = File.read(path)
- assert !s.include?("NOOP"), "File was unpatched."
- assert s.include?("ABCD"), "File was not patched as expected."
+ refute_includes s, "NOOP", "#{path} was not patched as expected"
+ assert_includes s, "ABCD", "#{path} was not patched as expected"
end
def test_single_patch