brew/Library/Homebrew/test/dependable_spec.rb

33 lines
625 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2017-02-27 11:55:14 +01:00
require "dependable"
describe Dependable do
2017-05-09 23:00:51 +02:00
alias_matcher :be_a_build_dependency, :be_build
subject(:dependable) do
Class.new do
2023-01-22 17:03:27 -08:00
include Dependable
def initialize
@tags = ["foo", "bar", :build]
end
end.new
end
2017-02-27 11:55:14 +01:00
specify "#options" do
expect(dependable.options.as_flags.sort).to eq(%w[--foo --bar].sort)
2017-02-27 11:55:14 +01:00
end
specify "#build?" do
expect(dependable).to be_a_build_dependency
2017-02-27 11:55:14 +01:00
end
specify "#optional?" do
expect(dependable).not_to be_optional
2017-02-27 11:55:14 +01:00
end
specify "#recommended?" do
expect(dependable).not_to be_recommended
2017-02-27 11:55:14 +01:00
end
end