Move formula equality tests out of test_bucket
This commit is contained in:
parent
136aa4c6f4
commit
eadb0f60a8
@ -152,16 +152,4 @@ class BeerTasting < Test::Unit::TestCase
|
||||
assert_equal 'foo-0.1', foo1.stem
|
||||
assert_version_equal '0.1', foo1.version
|
||||
end
|
||||
|
||||
def test_formula_equality
|
||||
f = Class.new(Formula) do
|
||||
url 'http://example.com/test-0.1.tgz'
|
||||
end.new('test')
|
||||
g = Struct.new(:name).new('test')
|
||||
|
||||
assert f == f
|
||||
assert f == g
|
||||
assert f.eql? f
|
||||
assert !f.eql?(g)
|
||||
end
|
||||
end
|
||||
|
||||
@ -30,6 +30,26 @@ class FormulaTests < Test::Unit::TestCase
|
||||
assert f.installed?
|
||||
end
|
||||
|
||||
def test_equality
|
||||
x = TestBall.new
|
||||
y = TestBall.new
|
||||
assert x == y
|
||||
assert y == x
|
||||
assert x.eql?(y)
|
||||
assert y.eql?(x)
|
||||
assert x.hash == y.hash
|
||||
end
|
||||
|
||||
def test_inequality
|
||||
x = TestBall.new("foo")
|
||||
y = TestBall.new("bar")
|
||||
assert x != y
|
||||
assert y != x
|
||||
assert x.hash != y.hash
|
||||
assert !x.eql?(y)
|
||||
assert !y.eql?(x)
|
||||
end
|
||||
|
||||
def test_class_naming
|
||||
assert_equal 'ShellFm', Formula.class_s('shell.fm')
|
||||
assert_equal 'Fooxx', Formula.class_s('foo++')
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
require 'formula'
|
||||
|
||||
class TestBall < Formula
|
||||
def initialize(*)
|
||||
def initialize(name="test_ball")
|
||||
@homepage = 'http://example.com/'
|
||||
self.class.instance_eval do
|
||||
@stable ||= SoftwareSpec.new
|
||||
@stable.url "file:///#{TEST_FOLDER}/tarballs/testball-0.1.tbz"
|
||||
@stable.sha1 "482e737739d946b7c8cbaf127d9ee9c148b999f5"
|
||||
end
|
||||
super "testball"
|
||||
super
|
||||
end
|
||||
def install
|
||||
prefix.install "bin"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user