mirror of
https://github.com/mistydemeo/tigerbrew.git
synced 2026-12-02 13:39:47 -05:00
Make Test::Unit assertions available in formula tests
Closes #18753. Closes #20358.
This commit is contained in:
1 parent
9ce35c2c18
commit
455916b1c7
3 files changed
+7
-1
No files matched your search
@@ -100,7 +100,7 @@ class Git < Formula
|
||||
|
||||
test do
|
||||
HOMEBREW_REPOSITORY.cd do
|
||||
`#{bin}/git ls-files -- bin`.chomp == 'bin/brew'
|
||||
assert_equal 'bin/brew', `#{bin}/git ls-files -- bin`.strip
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -2,6 +2,7 @@ require 'extend/ENV'
|
||||
require 'hardware'
|
||||
require 'keg'
|
||||
require 'timeout'
|
||||
require 'test/unit/assertions'
|
||||
|
||||
module Homebrew extend self
|
||||
TEST_TIMEOUT_SECONDS = 5*60
|
||||
@@ -31,6 +32,9 @@ module Homebrew extend self
|
||||
Timeout::timeout TEST_TIMEOUT_SECONDS do
|
||||
raise if f.test == false
|
||||
end
|
||||
rescue Test::Unit::AssertionFailedError => e
|
||||
ofail "#{f.name}: failed"
|
||||
puts e.message
|
||||
rescue Exception
|
||||
ofail "#{f.name}: failed"
|
||||
end
|
||||
|
||||
@@ -562,6 +562,8 @@ class Formula
|
||||
end
|
||||
|
||||
def test
|
||||
require 'test/unit/assertions'
|
||||
extend(Test::Unit::Assertions)
|
||||
ret = nil
|
||||
mktemp do
|
||||
@testpath = Pathname.pwd
|
||||
|
||||
Reference in new issue
Block a user