aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/dependable_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/test/dependable_spec.rb')
-rw-r--r--Library/Homebrew/test/dependable_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/Library/Homebrew/test/dependable_spec.rb b/Library/Homebrew/test/dependable_spec.rb
new file mode 100644
index 000000000..b646b7634
--- /dev/null
+++ b/Library/Homebrew/test/dependable_spec.rb
@@ -0,0 +1,24 @@
+require "dependable"
+
+RSpec::Matchers.alias_matcher :be_a_build_dependency, :be_build
+
+describe Dependable do
+ subject { double(tags: tags).extend(described_class) }
+ let(:tags) { ["foo", "bar", :build] }
+
+ specify "#options" do
+ expect(subject.options.as_flags.sort).to eq(%w[--foo --bar].sort)
+ end
+
+ specify "#build?" do
+ expect(subject).to be_a_build_dependency
+ end
+
+ specify "#optional?" do
+ expect(subject).not_to be_optional
+ end
+
+ specify "#recommended?" do
+ expect(subject).not_to be_recommended
+ end
+end