Remove default values from formula constructor parameters
Closes Homebrew/homebrew#30017.
This commit is contained in:
parent
84cd9cc28f
commit
801cdd9045
@ -26,8 +26,7 @@ class Formula
|
||||
|
||||
attr_accessor :local_bottle_path
|
||||
|
||||
# Homebrew determines the name
|
||||
def initialize name='__UNKNOWN__', path=self.class.path(name)
|
||||
def initialize(name, path)
|
||||
@name = name
|
||||
@path = path
|
||||
@homepage = self.class.homepage
|
||||
|
@ -4,18 +4,15 @@ require 'test/testball'
|
||||
class FormulaTests < Test::Unit::TestCase
|
||||
include VersionAssertions
|
||||
|
||||
def test_formula_path_initialization
|
||||
name = "formula_name"
|
||||
def test_formula_instantiation
|
||||
klass = Class.new(Formula) { url "http://example.com/foo-1.0.tar.gz" }
|
||||
name = "formula_name"
|
||||
path = Formula.path(name)
|
||||
|
||||
f = klass.new(name)
|
||||
assert_equal Formula.path(name), f.path
|
||||
|
||||
f = klass.new(name, path = Object.new)
|
||||
f = klass.new(name, path)
|
||||
assert_equal name, f.name
|
||||
assert_equal path, f.path
|
||||
|
||||
f = klass.new(name, nil)
|
||||
assert_nil f.path
|
||||
assert_raises(ArgumentError) { klass.new }
|
||||
end
|
||||
|
||||
def test_prefix
|
||||
|
Loading…
x
Reference in New Issue
Block a user