
This will allow us to have global setup and teardown for tests. For example, we can automatically clear caches after each test, to avoid annoying intermittent failures like #1879 and #1886.
31 lines
422 B
Ruby
31 lines
422 B
Ruby
require "testing_env"
|
|
require "formula"
|
|
require "caveats"
|
|
|
|
class CaveatsTests < Homebrew::TestCase
|
|
def setup
|
|
super
|
|
@f = formula { url "foo-1.0" }
|
|
@c = Caveats.new @f
|
|
end
|
|
|
|
def test_f
|
|
assert_equal @f, @c.f
|
|
end
|
|
|
|
def test_empty?
|
|
assert @c.empty?
|
|
|
|
f = formula do
|
|
url "foo-1.0"
|
|
|
|
def caveats
|
|
"something"
|
|
end
|
|
end
|
|
c = Caveats.new f
|
|
|
|
refute c.empty?
|
|
end
|
|
end
|