brew/Library/Homebrew/test/os/linux/formula_spec.rb
Mike McQuaid 0c1b556196
uses_from_macos: remove before/after.
We're not actually using this anywhere and it makes the code
more complicated.

Relatedly, this PR fixes the issue where
`uses_from_macos "python@2" => :build` was valid on macOS but not
on Linux.
2019-12-19 14:36:33 +00:00

24 lines
493 B
Ruby

# frozen_string_literal: true
require "formula"
describe Formula do
describe "#uses_from_macos" do
before do
allow(OS).to receive(:mac?).and_return(false)
end
it "acts like #depends_on" do
f = formula "foo" do
url "foo-1.0"
uses_from_macos("foo")
end
expect(f.class.stable.deps.first.name).to eq("foo")
expect(f.class.devel.deps.first.name).to eq("foo")
expect(f.class.head.deps.first.name).to eq("foo")
end
end
end