Clean up some test assertions
This commit is contained in:
parent
212181bbc6
commit
3c9523516b
@ -17,14 +17,14 @@ class BottleHookTests < Test::Unit::TestCase
|
|||||||
Homebrew::Hooks::Bottles.setup_formula_has_bottle do |f|
|
Homebrew::Hooks::Bottles.setup_formula_has_bottle do |f|
|
||||||
f.some_random_method
|
f.some_random_method
|
||||||
end
|
end
|
||||||
assert_equal true, @fi.pour_bottle?
|
assert @fi.pour_bottle?
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_has_no_bottle
|
def test_has_no_bottle
|
||||||
Homebrew::Hooks::Bottles.setup_formula_has_bottle do |f|
|
Homebrew::Hooks::Bottles.setup_formula_has_bottle do |f|
|
||||||
!f.some_random_method
|
!f.some_random_method
|
||||||
end
|
end
|
||||||
assert_equal false, @fi.pour_bottle?
|
assert !@fi.pour_bottle?
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_pour_formula_bottle
|
def test_pour_formula_bottle
|
||||||
|
|||||||
@ -126,19 +126,19 @@ class FormulaTests < Test::Unit::TestCase
|
|||||||
def test_equality
|
def test_equality
|
||||||
x = TestBall.new
|
x = TestBall.new
|
||||||
y = TestBall.new
|
y = TestBall.new
|
||||||
assert x == y
|
assert_equal x, y
|
||||||
assert y == x
|
assert_equal y, x
|
||||||
assert x.eql?(y)
|
assert x.eql?(y)
|
||||||
assert y.eql?(x)
|
assert y.eql?(x)
|
||||||
assert x.hash == y.hash
|
assert_equal x.hash, y.hash
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_inequality
|
def test_inequality
|
||||||
x = TestBall.new("foo")
|
x = TestBall.new("foo")
|
||||||
y = TestBall.new("bar")
|
y = TestBall.new("bar")
|
||||||
assert x != y
|
assert_not_equal x, y
|
||||||
assert y != x
|
assert_not_equal y, x
|
||||||
assert x.hash != y.hash
|
assert_not_equal x.hash, y.hash
|
||||||
assert !x.eql?(y)
|
assert !x.eql?(y)
|
||||||
assert !y.eql?(x)
|
assert !y.eql?(x)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -15,7 +15,7 @@ class LanguageModuleDependencyTests < Test::Unit::TestCase
|
|||||||
def test_unique_deps_are_not_eql
|
def test_unique_deps_are_not_eql
|
||||||
x = LanguageModuleDependency.new(:node, "less")
|
x = LanguageModuleDependency.new(:node, "less")
|
||||||
y = LanguageModuleDependency.new(:node, "coffee-script")
|
y = LanguageModuleDependency.new(:node, "coffee-script")
|
||||||
assert x.hash != y.hash
|
assert_not_equal x.hash, y.hash
|
||||||
assert !x.eql?(y)
|
assert !x.eql?(y)
|
||||||
assert !y.eql?(x)
|
assert !y.eql?(x)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class MachOPathnameTests < Test::Unit::TestCase
|
|||||||
assert pn.dylib?
|
assert pn.dylib?
|
||||||
assert !pn.mach_o_executable?
|
assert !pn.mach_o_executable?
|
||||||
assert !pn.text_executable?
|
assert !pn.text_executable?
|
||||||
assert pn.arch == :universal
|
assert_equal :universal, pn.arch
|
||||||
assert_match(/Mach-O (64-bit )?dynamically linked shared library/, file(pn))
|
assert_match(/Mach-O (64-bit )?dynamically linked shared library/, file(pn))
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ class MachOPathnameTests < Test::Unit::TestCase
|
|||||||
assert !pn.mach_o_executable?
|
assert !pn.mach_o_executable?
|
||||||
assert !pn.text_executable?
|
assert !pn.text_executable?
|
||||||
assert !pn.mach_o_bundle?
|
assert !pn.mach_o_bundle?
|
||||||
assert pn.arch == :dunno
|
assert_equal :dunno, pn.arch
|
||||||
assert_no_match(/Mach-O (64-bit )?dynamically linked shared library/, file(pn))
|
assert_no_match(/Mach-O (64-bit )?dynamically linked shared library/, file(pn))
|
||||||
assert_no_match(/Mach-O [^ ]* ?executable/, file(pn))
|
assert_no_match(/Mach-O [^ ]* ?executable/, file(pn))
|
||||||
end
|
end
|
||||||
@ -187,7 +187,7 @@ class TextExecutableTests < Test::Unit::TestCase
|
|||||||
assert !pn.mach_o_executable?
|
assert !pn.mach_o_executable?
|
||||||
assert pn.text_executable?
|
assert pn.text_executable?
|
||||||
assert_equal [], pn.archs
|
assert_equal [], pn.archs
|
||||||
assert pn.arch == :dunno
|
assert_equal :dunno, pn.arch
|
||||||
assert_match(/text executable/, file(pn))
|
assert_match(/text executable/, file(pn))
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -203,7 +203,7 @@ class TextExecutableTests < Test::Unit::TestCase
|
|||||||
assert !pn.mach_o_executable?
|
assert !pn.mach_o_executable?
|
||||||
assert pn.text_executable?
|
assert pn.text_executable?
|
||||||
assert_equal [], pn.archs
|
assert_equal [], pn.archs
|
||||||
assert pn.arch == :dunno
|
assert_equal :dunno, pn.arch
|
||||||
assert_match(/text executable/, file(pn))
|
assert_match(/text executable/, file(pn))
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -219,7 +219,7 @@ class TextExecutableTests < Test::Unit::TestCase
|
|||||||
assert !pn.mach_o_executable?
|
assert !pn.mach_o_executable?
|
||||||
assert !pn.text_executable?
|
assert !pn.text_executable?
|
||||||
assert_equal [], pn.archs
|
assert_equal [], pn.archs
|
||||||
assert pn.arch == :dunno
|
assert_equal :dunno, pn.arch
|
||||||
assert_no_match(/text executable/, file(pn))
|
assert_no_match(/text executable/, file(pn))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -8,7 +8,7 @@ class StringTest < Test::Unit::TestCase
|
|||||||
....my friend over
|
....my friend over
|
||||||
there
|
there
|
||||||
EOS
|
EOS
|
||||||
assert undented == "hi\nmy friend over\nthere\n"
|
assert_equal "hi\nmy friend over\nthere\n", undented
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_undent_not_indented
|
def test_undent_not_indented
|
||||||
@ -16,6 +16,6 @@ class StringTest < Test::Unit::TestCase
|
|||||||
hi
|
hi
|
||||||
I'm not indented
|
I'm not indented
|
||||||
EOS
|
EOS
|
||||||
assert undented == "hi\nI'm not indented\n"
|
assert_equal "hi\nI'm not indented\n", undented
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -8,13 +8,13 @@ class X11DependencyTests < Test::Unit::TestCase
|
|||||||
y = X11Dependency.new
|
y = X11Dependency.new
|
||||||
assert x.eql?(y)
|
assert x.eql?(y)
|
||||||
assert y.eql?(x)
|
assert y.eql?(x)
|
||||||
assert x.hash == y.hash
|
assert_equal x.hash, y.hash
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_not_eql_when_hashes_differ
|
def test_not_eql_when_hashes_differ
|
||||||
x = X11Dependency.new("foo")
|
x = X11Dependency.new("foo")
|
||||||
y = X11Dependency.new
|
y = X11Dependency.new
|
||||||
assert x.hash != y.hash
|
assert_not_equal x.hash, y.hash
|
||||||
assert !x.eql?(y)
|
assert !x.eql?(y)
|
||||||
assert !y.eql?(x)
|
assert !y.eql?(x)
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user