aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Vandenberg2010-03-02 22:54:12 -0800
committerAdam Vandenberg2010-04-06 08:27:11 -0700
commit9c4623c42786d1814d7ed4d2379823bbaf821da0 (patch)
tree1b975098cf4fb631d06eef17c819329f882b924d
parent13f63b18a8447b15cd59bd32b0cd8705f165d20b (diff)
downloadhomebrew-9c4623c42786d1814d7ed4d2379823bbaf821da0.tar.bz2
Move TestBall definition to separate file.
-rw-r--r--Library/Homebrew/test/test_checksums.rb16
-rw-r--r--Library/Homebrew/test/test_formula_install.rb15
-rw-r--r--Library/Homebrew/test/test_patching.rb13
-rw-r--r--Library/Homebrew/test/testball.rb14
4 files changed, 17 insertions, 41 deletions
diff --git a/Library/Homebrew/test/test_checksums.rb b/Library/Homebrew/test/test_checksums.rb
index a9208e7f6..67b115c87 100644
--- a/Library/Homebrew/test/test_checksums.rb
+++ b/Library/Homebrew/test/test_checksums.rb
@@ -3,24 +3,10 @@ require 'testing_env'
require 'extend/ARGV' # needs to be after test/unit to avoid conflict with OptionsParser
ARGV.extend(HomebrewArgvExtension)
-require 'formula'
+require 'test/testball'
require 'utils'
-class TestBall <Formula
- # name parameter required for some Formula::factory
- def initialize name=nil
- @url="file:///#{TEST_FOLDER}/testball-0.1.tbz"
- @homepage = 'http://example.com/'
- super "testball"
- end
- def install
- prefix.install "bin"
- prefix.install "libexec"
- end
-end
-
-
class ChecksumTests < Test::Unit::TestCase
def good_checksum f
assert_nothing_raised { nostdout { f.new.brew {} } }
diff --git a/Library/Homebrew/test/test_formula_install.rb b/Library/Homebrew/test/test_formula_install.rb
index fcf5fec54..eb2dcb491 100644
--- a/Library/Homebrew/test/test_formula_install.rb
+++ b/Library/Homebrew/test/test_formula_install.rb
@@ -4,24 +4,11 @@ require 'extend/ARGV' # needs to be after test/unit to avoid conflict with Optio
ARGV.extend(HomebrewArgvExtension)
require 'formula'
+require 'test/testball'
require 'keg'
require 'utils'
-class TestBall <Formula
- # name parameter required for some Formula::factory
- def initialize name=nil
- @url="file:///#{TEST_FOLDER}/testball-0.1.tbz"
- @homepage = 'http://example.com/'
- super "testball"
- end
- def install
- prefix.install "bin"
- prefix.install "libexec"
- end
-end
-
-
class TestScriptFileFormula <ScriptFileFormula
url "file:///#{Pathname.new(ABS__FILE__).realpath}"
version "1"
diff --git a/Library/Homebrew/test/test_patching.rb b/Library/Homebrew/test/test_patching.rb
index df4825711..ea8d159a6 100644
--- a/Library/Homebrew/test/test_patching.rb
+++ b/Library/Homebrew/test/test_patching.rb
@@ -3,21 +3,10 @@ require 'testing_env'
require 'extend/ARGV' # needs to be after test/unit to avoid conflict with OptionsParser
ARGV.extend(HomebrewArgvExtension)
-require 'formula'
+require 'test/testball'
require 'utils'
-class TestBall <Formula
- def initialize name
- @url="file:///#{TEST_FOLDER}/testball-0.1.tbz"
- @homepage = 'http://example.com/'
- @md5='71aa838a9e4050d1876a295a9e62cbe6'
- super name
- end
- def install ; end
-end
-
-
class DefaultPatchBall <TestBall
def patches
# Default is p1
diff --git a/Library/Homebrew/test/testball.rb b/Library/Homebrew/test/testball.rb
new file mode 100644
index 000000000..6393342e5
--- /dev/null
+++ b/Library/Homebrew/test/testball.rb
@@ -0,0 +1,14 @@
+require 'formula'
+
+class TestBall <Formula
+ # name parameter required for some Formula::factory
+ def initialize name=nil
+ @url="file:///#{TEST_FOLDER}/testball-0.1.tbz"
+ @homepage = 'http://example.com/'
+ super "testball"
+ end
+ def install
+ prefix.install "bin"
+ prefix.install "libexec"
+ end
+end