Fix test formula name so it matches the filename

This commit is contained in:
Jack Nagel 2015-04-15 21:28:23 -04:00
parent d1617e86d0
commit cc92f491c8
4 changed files with 15 additions and 17 deletions

View File

@ -4,9 +4,9 @@ require 'cmd/cleanup'
class CleanupTests < Homebrew::TestCase
def test_cleanup
f1 = Class.new(TestBall) { version '0.1' }.new
f2 = Class.new(TestBall) { version '0.2' }.new
f3 = Class.new(TestBall) { version '0.3' }.new
f1 = Class.new(Testball) { version "0.1" }.new
f2 = Class.new(Testball) { version "0.2" }.new
f3 = Class.new(Testball) { version "0.3" }.new
shutup do
f1.brew { f1.install }

View File

@ -15,18 +15,18 @@ class FormulaTests < Homebrew::TestCase
end
def test_prefix
f = TestBall.new
f = Testball.new
assert_equal HOMEBREW_CELLAR/f.name/'0.1', f.prefix
assert_kind_of Pathname, f.prefix
end
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
end
def test_installed?
f = TestBall.new
f = Testball.new
f.stubs(:installed_prefix).returns(stub(:directory? => false))
refute_predicate f, :installed?
@ -42,7 +42,7 @@ class FormulaTests < Homebrew::TestCase
end
def test_installed_prefix
f = TestBall.new
f = Testball.new
assert_equal f.prefix, f.installed_prefix
end
@ -116,27 +116,27 @@ class FormulaTests < Homebrew::TestCase
end
def test_equality
x = TestBall.new
y = TestBall.new
x = Testball.new
y = Testball.new
assert_equal x, y
assert_eql x, y
assert_equal x.hash, y.hash
end
def test_inequality
x = TestBall.new("foo")
y = TestBall.new("bar")
x = Testball.new("foo")
y = Testball.new("bar")
refute_equal x, y
refute_eql x, y
refute_equal x.hash, y.hash
end
def test_comparison_with_non_formula_objects_does_not_raise
refute_equal TestBall.new, Object.new
refute_equal Testball.new, Object.new
end
def test_sort_operator
assert_nil TestBall.new <=> Object.new
assert_nil Testball.new <=> Object.new
end
def test_class_naming

View File

@ -27,7 +27,7 @@ class InstallTests < Homebrew::TestCase
end
def test_a_basic_install
f = TestBall.new
f = Testball.new
refute_predicate f, :installed?

View File

@ -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)
self.class.instance_eval do
stable.url "file://#{TEST_DIRECTORY}/tarballs/testball-0.1.tbz"