summaryrefslogtreecommitdiff
path: root/spec/ruby/language/array_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/language/array_spec.rb')
-rw-r--r--spec/ruby/language/array_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/ruby/language/array_spec.rb b/spec/ruby/language/array_spec.rb
index 2198d7a28b..2583cffbf7 100644
--- a/spec/ruby/language/array_spec.rb
+++ b/spec/ruby/language/array_spec.rb
@@ -36,6 +36,13 @@ describe "Array literals" do
[1, *nil, 3].should == [1, 3]
[*nil, *nil, *nil].should == []
end
+
+ it "evaluates each argument exactly once" do
+ se = ArraySpec::SideEffect.new
+ se.array_result(true)
+ se.array_result(false)
+ se.call_count.should == 4
+ end
end
describe "Bareword array literal" do