blob: f42d61ba9bfab581f531b9337aa30256b9229a6d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
require "formula_support"
describe KegOnlyReason do
describe "#to_s" do
it "returns the reason provided" do
r = KegOnlyReason.new :provided_by_osx, "test"
expect(r.to_s).to eq("test")
end
it "returns a default message when no reason is provided" do
r = KegOnlyReason.new :provided_by_macos, ""
expect(r.to_s).to match(/^macOS already provides/)
end
end
end
describe BottleDisableReason do
specify ":unneeded" do
bottle_disable_reason = BottleDisableReason.new :unneeded, nil
expect(bottle_disable_reason).to be_unneeded
expect(bottle_disable_reason.to_s).to eq("This formula doesn't require compiling.")
end
specify ":disabled" do
bottle_disable_reason = BottleDisableReason.new :disable, "reason"
expect(bottle_disable_reason).not_to be_unneeded
expect(bottle_disable_reason.to_s).to eq("reason")
end
end
|