aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/cask/dsl/stanza_proxy_spec.rb
diff options
context:
space:
mode:
authorMarkus Reiter2017-03-05 06:31:36 +0100
committerMarkus Reiter2017-03-05 23:08:14 +0100
commit9fc6c7b2be300ff35dc52d80f4dc38d36d52ddc2 (patch)
tree43e99a683329471c1dc965dcc92daccb57df7e8d /Library/Homebrew/test/cask/dsl/stanza_proxy_spec.rb
parent67ec76d1492fbb03959a782a85c4fb985d6a5884 (diff)
downloadbrew-9fc6c7b2be300ff35dc52d80f4dc38d36d52ddc2.tar.bz2
Move Cask specs into `brew tests`.
Diffstat (limited to 'Library/Homebrew/test/cask/dsl/stanza_proxy_spec.rb')
-rw-r--r--Library/Homebrew/test/cask/dsl/stanza_proxy_spec.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/Library/Homebrew/test/cask/dsl/stanza_proxy_spec.rb b/Library/Homebrew/test/cask/dsl/stanza_proxy_spec.rb
new file mode 100644
index 000000000..2bb7ae633
--- /dev/null
+++ b/Library/Homebrew/test/cask/dsl/stanza_proxy_spec.rb
@@ -0,0 +1,32 @@
+describe Hbc::DSL::StanzaProxy do
+ let(:stanza_proxy) {
+ described_class.new(Array) { [:foo, :bar, :cake] }
+ }
+
+ subject { stanza_proxy }
+ it { is_expected.to be_a_proxy }
+ it { is_expected.to respond_to(:pop) }
+ its(:pop) { is_expected.to eq(:cake) }
+ its(:type) { is_expected.to eq(Array) }
+ its(:to_s) { is_expected.to eq("[:foo, :bar, :cake]") }
+
+ describe "when initialized" do
+ let(:initializing) {
+ proc { |b| described_class.new(Array, &b) }
+ }
+
+ it "does not evaluate the block" do
+ expect(&initializing).not_to yield_control
+ end
+ end
+
+ describe "when receiving a message" do
+ let(:receiving_a_message) {
+ proc { |b| described_class.new(Array, &b).to_s }
+ }
+
+ it "evaluates the block" do
+ expect(&receiving_a_message).to yield_with_no_args
+ end
+ end
+end