From 27e3ab781cf32cad3ae68825b9de3d362df7fd11 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 6 Apr 2014 15:52:04 -0500 Subject: [PATCH] Clean up test classes --- Library/Homebrew/test/test_formula.rb | 1 - Library/Homebrew/test/test_formula_install.rb | 8 ++------ Library/Homebrew/test/test_formula_validation.rb | 2 +- Library/Homebrew/test/testball.rb | 3 +-- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Library/Homebrew/test/test_formula.rb b/Library/Homebrew/test/test_formula.rb index 910726e581..429e71c73b 100644 --- a/Library/Homebrew/test/test_formula.rb +++ b/Library/Homebrew/test/test_formula.rb @@ -201,7 +201,6 @@ class FormulaTests < Test::Unit::TestCase class #{Formulary.class_s(name)} < Formula url 'foo-1.0' def initialize(*args) - @homepage = 'http://example.com/' super end end diff --git a/Library/Homebrew/test/test_formula_install.rb b/Library/Homebrew/test/test_formula_install.rb index 967f2e6cc3..b3184fe8cd 100644 --- a/Library/Homebrew/test/test_formula_install.rb +++ b/Library/Homebrew/test/test_formula_install.rb @@ -5,12 +5,10 @@ require 'keg' class TestScriptFileFormula < ScriptFileFormula - url "file:///#{Pathname.new(ABS__FILE__).realpath}" + url "file:///#{__FILE__}" version "1" - def initialize - @name='test-script-formula' - @homepage = 'http://example.com/' + def initialize(name="test_script_formula", path=nil) super end end @@ -58,11 +56,9 @@ class InstallTests < Test::Unit::TestCase def test_a_basic_install f=TestBall.new - assert_equal Formula.path(f.name), f.path assert !f.installed? temporary_install f do - assert_match Regexp.new("^#{HOMEBREW_CELLAR}/"), f.prefix.to_s # Test that things made it into the Keg assert f.bin.directory? diff --git a/Library/Homebrew/test/test_formula_validation.rb b/Library/Homebrew/test/test_formula_validation.rb index 8adff7f295..b9a0e9c5d8 100644 --- a/Library/Homebrew/test/test_formula_validation.rb +++ b/Library/Homebrew/test/test_formula_validation.rb @@ -49,7 +49,7 @@ class FormulaValidationTests < Test::Unit::TestCase def test_validates_when_initialize_overridden assert_invalid :name do formula do - def initialize; end + def initialize(*); end end.brew {} end end diff --git a/Library/Homebrew/test/testball.rb b/Library/Homebrew/test/testball.rb index 75e381873c..645585cb1c 100644 --- a/Library/Homebrew/test/testball.rb +++ b/Library/Homebrew/test/testball.rb @@ -1,8 +1,7 @@ require 'formula' class TestBall < Formula - def initialize(name="test_ball") - @homepage = 'http://example.com/' + def initialize(name="test_ball", path=nil) self.class.instance_eval do stable.url "file:///#{TEST_FOLDER}/tarballs/testball-0.1.tbz" stable.sha1 "482e737739d946b7c8cbaf127d9ee9c148b999f5"