brew/Library/Homebrew/test/caveats_test.rb
Alyssa Ross 70a381a00f tests: enforce super in lifecycle hooks
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.
2017-01-21 11:34:52 +00:00

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