From c816ad70b60f68b4d63a729c6b0a44088ccb1c51 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 7 Apr 2013 18:40:40 -0500 Subject: [PATCH] Simplify tests --- Library/Homebrew/test/test_formula.rb | 10 +--------- Library/Homebrew/test/test_formula_install.rb | 8 +++----- Library/Homebrew/test/testball.rb | 2 -- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/Library/Homebrew/test/test_formula.rb b/Library/Homebrew/test/test_formula.rb index 9de2b2eda5..e4b207e70c 100644 --- a/Library/Homebrew/test/test_formula.rb +++ b/Library/Homebrew/test/test_formula.rb @@ -31,15 +31,7 @@ class FormulaTests < Test::Unit::TestCase def test_cant_override_brew assert_raises(RuntimeError) do - eval <<-EOS - class TestBallOverrideBrew < Formula - def initialize - super "foo" - end - def brew - end - end - EOS + Class.new(Formula) { def brew; end } end end diff --git a/Library/Homebrew/test/test_formula_install.rb b/Library/Homebrew/test/test_formula_install.rb index b63c1f9eef..ea1584ec65 100644 --- a/Library/Homebrew/test/test_formula_install.rb +++ b/Library/Homebrew/test/test_formula_install.rb @@ -19,11 +19,9 @@ end class ConfigureTests < Test::Unit::TestCase def test_detect_failed_configure f = ConfigureFails.new - begin - shutup { f.brew { f.install } } - rescue BuildError => e - assert e.was_running_configure? - end + shutup { f.brew { f.install } } + rescue BuildError => e + assert e.was_running_configure? end end diff --git a/Library/Homebrew/test/testball.rb b/Library/Homebrew/test/testball.rb index 32f307f10b..2bc93731f4 100644 --- a/Library/Homebrew/test/testball.rb +++ b/Library/Homebrew/test/testball.rb @@ -1,7 +1,6 @@ require 'formula' class TestBall < Formula - # name parameter required for some Formula::factory def initialize name=nil @homepage = 'http://example.com/' @stable ||= SoftwareSpec.new @@ -31,7 +30,6 @@ class TestBallWithMirror < Formula end class ConfigureFails < Formula - # name parameter required for some Formula::factory url "file:///#{TEST_FOLDER}/tarballs/configure_fails.tar.gz" version '1.0.0' sha1 'b36c65e5de86efef1b3a7e9cf78a98c186b400b3'