Fix test formula name so it matches the filename
This commit is contained in:
parent
d1617e86d0
commit
cc92f491c8
@ -4,9 +4,9 @@ require 'cmd/cleanup'
|
|||||||
|
|
||||||
class CleanupTests < Homebrew::TestCase
|
class CleanupTests < Homebrew::TestCase
|
||||||
def test_cleanup
|
def test_cleanup
|
||||||
f1 = Class.new(TestBall) { version '0.1' }.new
|
f1 = Class.new(Testball) { version "0.1" }.new
|
||||||
f2 = Class.new(TestBall) { version '0.2' }.new
|
f2 = Class.new(Testball) { version "0.2" }.new
|
||||||
f3 = Class.new(TestBall) { version '0.3' }.new
|
f3 = Class.new(Testball) { version "0.3" }.new
|
||||||
|
|
||||||
shutup do
|
shutup do
|
||||||
f1.brew { f1.install }
|
f1.brew { f1.install }
|
||||||
|
|||||||
@ -15,18 +15,18 @@ class FormulaTests < Homebrew::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_prefix
|
def test_prefix
|
||||||
f = TestBall.new
|
f = Testball.new
|
||||||
assert_equal HOMEBREW_CELLAR/f.name/'0.1', f.prefix
|
assert_equal HOMEBREW_CELLAR/f.name/'0.1', f.prefix
|
||||||
assert_kind_of Pathname, f.prefix
|
assert_kind_of Pathname, f.prefix
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_revised_prefix
|
def test_revised_prefix
|
||||||
f = Class.new(TestBall) { revision 1 }.new
|
f = Class.new(Testball) { revision 1 }.new
|
||||||
assert_equal HOMEBREW_CELLAR/f.name/'0.1_1', f.prefix
|
assert_equal HOMEBREW_CELLAR/f.name/'0.1_1', f.prefix
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_installed?
|
def test_installed?
|
||||||
f = TestBall.new
|
f = Testball.new
|
||||||
f.stubs(:installed_prefix).returns(stub(:directory? => false))
|
f.stubs(:installed_prefix).returns(stub(:directory? => false))
|
||||||
refute_predicate f, :installed?
|
refute_predicate f, :installed?
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ class FormulaTests < Homebrew::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_installed_prefix
|
def test_installed_prefix
|
||||||
f = TestBall.new
|
f = Testball.new
|
||||||
assert_equal f.prefix, f.installed_prefix
|
assert_equal f.prefix, f.installed_prefix
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -116,27 +116,27 @@ class FormulaTests < Homebrew::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_equality
|
def test_equality
|
||||||
x = TestBall.new
|
x = Testball.new
|
||||||
y = TestBall.new
|
y = Testball.new
|
||||||
assert_equal x, y
|
assert_equal x, y
|
||||||
assert_eql x, y
|
assert_eql x, y
|
||||||
assert_equal 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")
|
||||||
refute_equal x, y
|
refute_equal x, y
|
||||||
refute_eql x, y
|
refute_eql x, y
|
||||||
refute_equal x.hash, y.hash
|
refute_equal x.hash, y.hash
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_comparison_with_non_formula_objects_does_not_raise
|
def test_comparison_with_non_formula_objects_does_not_raise
|
||||||
refute_equal TestBall.new, Object.new
|
refute_equal Testball.new, Object.new
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_sort_operator
|
def test_sort_operator
|
||||||
assert_nil TestBall.new <=> Object.new
|
assert_nil Testball.new <=> Object.new
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_class_naming
|
def test_class_naming
|
||||||
|
|||||||
@ -27,7 +27,7 @@ class InstallTests < Homebrew::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_a_basic_install
|
def test_a_basic_install
|
||||||
f = TestBall.new
|
f = Testball.new
|
||||||
|
|
||||||
refute_predicate f, :installed?
|
refute_predicate f, :installed?
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,4 @@
|
|||||||
require 'formula'
|
class Testball < Formula
|
||||||
|
|
||||||
class TestBall < Formula
|
|
||||||
def initialize(name="test_ball", path=Pathname.new(__FILE__).expand_path, spec=:stable)
|
def initialize(name="test_ball", path=Pathname.new(__FILE__).expand_path, spec=:stable)
|
||||||
self.class.instance_eval do
|
self.class.instance_eval do
|
||||||
stable.url "file://#{TEST_DIRECTORY}/tarballs/testball-0.1.tbz"
|
stable.url "file://#{TEST_DIRECTORY}/tarballs/testball-0.1.tbz"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user