2020-10-10 14:16:11 +02:00
|
|
|
# typed: false
|
2019-04-19 15:38:03 +09:00
|
|
|
# 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
|
|
|
|
|
2023-01-22 17:03:27 -08:00
|
|
|
subject(:dependable) {
|
|
|
|
Class.new {
|
|
|
|
include Dependable
|
|
|
|
def initialize
|
|
|
|
@tags = ["foo", "bar", :build]
|
|
|
|
end
|
|
|
|
}.new
|
|
|
|
}
|
2017-02-27 11:55:14 +01:00
|
|
|
|
|
|
|
specify "#options" do
|
2021-01-31 13:14:23 -05:00
|
|
|
expect(dependable.options.as_flags.sort).to eq(%w[--foo --bar].sort)
|
2017-02-27 11:55:14 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
specify "#build?" do
|
2021-01-31 13:14:23 -05:00
|
|
|
expect(dependable).to be_a_build_dependency
|
2017-02-27 11:55:14 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
specify "#optional?" do
|
2021-01-31 13:14:23 -05:00
|
|
|
expect(dependable).not_to be_optional
|
2017-02-27 11:55:14 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
specify "#recommended?" do
|
2021-01-31 13:14:23 -05:00
|
|
|
expect(dependable).not_to be_recommended
|
2017-02-27 11:55:14 +01:00
|
|
|
end
|
|
|
|
end
|