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.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/spec/ruby/language/array_spec.rb b/spec/ruby/language/array_spec.rb
index c3ed8c14c5..2583cffbf7 100644
--- a/spec/ruby/language/array_spec.rb
+++ b/spec/ruby/language/array_spec.rb
@@ -1,5 +1,5 @@
-require File.expand_path('../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/array', __FILE__)
+require_relative '../spec_helper'
+require_relative 'fixtures/array'
describe "Array literals" do
it "[] should return a new array populated with the given elements" do
@@ -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