diff options
| author | Jack Nagel | 2013-05-25 17:19:18 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-05-25 17:19:18 -0500 |
| commit | ae57857ac513a40863ff7c9693943e38d3b6a1ef (patch) | |
| tree | f35e7690f1465792ca096cfda63bae6537a62089 | |
| parent | 55c3634a12f9b44edcca2f5c372d82b65d956ed5 (diff) | |
| download | homebrew-ae57857ac513a40863ff7c9693943e38d3b6a1ef.tar.bz2 | |
tests: extract common formula helper
| -rw-r--r-- | Library/Homebrew/test/test_formula_spec_selection.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_formula_validation.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/testing_env.rb | 6 |
3 files changed, 6 insertions, 8 deletions
diff --git a/Library/Homebrew/test/test_formula_spec_selection.rb b/Library/Homebrew/test/test_formula_spec_selection.rb index b16192ac3..a04ccb424 100644 --- a/Library/Homebrew/test/test_formula_spec_selection.rb +++ b/Library/Homebrew/test/test_formula_spec_selection.rb @@ -2,10 +2,6 @@ require 'testing_env' require 'formula' class FormulaSpecSelectionTests < Test::Unit::TestCase - def formula(*args, &block) - @_f = Class.new(Formula, &block).new(*args) - end - def assert_spec_selected(spec) assert_equal @_f.send(spec), @_f.active_spec end diff --git a/Library/Homebrew/test/test_formula_validation.rb b/Library/Homebrew/test/test_formula_validation.rb index e2c5ec140..c01d2fc9e 100644 --- a/Library/Homebrew/test/test_formula_validation.rb +++ b/Library/Homebrew/test/test_formula_validation.rb @@ -2,10 +2,6 @@ require 'testing_env' require 'formula' class FormulaValidationTests < Test::Unit::TestCase - def formula(*args, &block) - Class.new(Formula, &block).new(*args) - end - def assert_invalid(attr, &block) e = assert_raises(FormulaValidationError, &block) assert_equal attr, e.attr diff --git a/Library/Homebrew/test/testing_env.rb b/Library/Homebrew/test/testing_env.rb index 8e3c92a32..817346bef 100644 --- a/Library/Homebrew/test/testing_env.rb +++ b/Library/Homebrew/test/testing_env.rb @@ -106,3 +106,9 @@ module Test::Unit::Assertions assert(obj.empty?, msg) end if RUBY_VERSION.to_f <= 1.8 end + +class Test::Unit::TestCase + def formula(*args, &block) + @_f = Class.new(Formula, &block).new(*args) + end +end |
