Clean up test classes
This commit is contained in:
parent
90574a6a4b
commit
27e3ab781c
@ -201,7 +201,6 @@ class FormulaTests < Test::Unit::TestCase
|
|||||||
class #{Formulary.class_s(name)} < Formula
|
class #{Formulary.class_s(name)} < Formula
|
||||||
url 'foo-1.0'
|
url 'foo-1.0'
|
||||||
def initialize(*args)
|
def initialize(*args)
|
||||||
@homepage = 'http://example.com/'
|
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -5,12 +5,10 @@ require 'keg'
|
|||||||
|
|
||||||
|
|
||||||
class TestScriptFileFormula < ScriptFileFormula
|
class TestScriptFileFormula < ScriptFileFormula
|
||||||
url "file:///#{Pathname.new(ABS__FILE__).realpath}"
|
url "file:///#{__FILE__}"
|
||||||
version "1"
|
version "1"
|
||||||
|
|
||||||
def initialize
|
def initialize(name="test_script_formula", path=nil)
|
||||||
@name='test-script-formula'
|
|
||||||
@homepage = 'http://example.com/'
|
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -58,11 +56,9 @@ class InstallTests < Test::Unit::TestCase
|
|||||||
def test_a_basic_install
|
def test_a_basic_install
|
||||||
f=TestBall.new
|
f=TestBall.new
|
||||||
|
|
||||||
assert_equal Formula.path(f.name), f.path
|
|
||||||
assert !f.installed?
|
assert !f.installed?
|
||||||
|
|
||||||
temporary_install f do
|
temporary_install f do
|
||||||
assert_match Regexp.new("^#{HOMEBREW_CELLAR}/"), f.prefix.to_s
|
|
||||||
|
|
||||||
# Test that things made it into the Keg
|
# Test that things made it into the Keg
|
||||||
assert f.bin.directory?
|
assert f.bin.directory?
|
||||||
|
|||||||
@ -49,7 +49,7 @@ class FormulaValidationTests < Test::Unit::TestCase
|
|||||||
def test_validates_when_initialize_overridden
|
def test_validates_when_initialize_overridden
|
||||||
assert_invalid :name do
|
assert_invalid :name do
|
||||||
formula do
|
formula do
|
||||||
def initialize; end
|
def initialize(*); end
|
||||||
end.brew {}
|
end.brew {}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
require 'formula'
|
require 'formula'
|
||||||
|
|
||||||
class TestBall < Formula
|
class TestBall < Formula
|
||||||
def initialize(name="test_ball")
|
def initialize(name="test_ball", path=nil)
|
||||||
@homepage = 'http://example.com/'
|
|
||||||
self.class.instance_eval do
|
self.class.instance_eval do
|
||||||
stable.url "file:///#{TEST_FOLDER}/tarballs/testball-0.1.tbz"
|
stable.url "file:///#{TEST_FOLDER}/tarballs/testball-0.1.tbz"
|
||||||
stable.sha1 "482e737739d946b7c8cbaf127d9ee9c148b999f5"
|
stable.sha1 "482e737739d946b7c8cbaf127d9ee9c148b999f5"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user