Skip to content
Snippets Groups Projects
Commit ac2cafe1 authored by Markus Reiter's avatar Markus Reiter
Browse files

Convert Caveats test to spec.

parent 2401de49
No related branches found
No related tags found
No related merge requests found
require "formula"
require "caveats"
describe Caveats do
subject { described_class.new(f) }
let(:f) { formula { url "foo-1.0" } }
specify "#f" do
expect(subject.f).to eq(f)
end
describe "#empty?" do
it "returns true if the Formula has no caveats" do
expect(subject).to be_empty
end
it "returns false if the Formula has caveats" do
f = formula do
url "foo-1.0"
def caveats
"something"
end
end
expect(described_class.new(f)).not_to be_empty
end
end
end
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment