mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@83063a3
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1e658d45e1
commit
3fa5bd38af
494 changed files with 4133 additions and 3109 deletions
|
@ -37,6 +37,6 @@ end
|
|||
|
||||
ruby_version_is "2.5" do
|
||||
describe "Array#append" do
|
||||
it_behaves_like(:array_push, :append)
|
||||
it_behaves_like :array_push, :append
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,9 +3,9 @@ require File.expand_path('../fixtures/classes', __FILE__)
|
|||
require File.expand_path('../shared/collect', __FILE__)
|
||||
|
||||
describe "Array#collect" do
|
||||
it_behaves_like(:array_collect, :collect)
|
||||
it_behaves_like :array_collect, :collect
|
||||
end
|
||||
|
||||
describe "Array#collect!" do
|
||||
it_behaves_like(:array_collect_b, :collect!)
|
||||
it_behaves_like :array_collect_b, :collect!
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ require File.expand_path('../fixtures/classes', __FILE__)
|
|||
require File.expand_path('../shared/slice', __FILE__)
|
||||
|
||||
describe "Array#[]" do
|
||||
it_behaves_like(:array_slice, :[])
|
||||
it_behaves_like :array_slice, :[]
|
||||
end
|
||||
|
||||
describe "Array.[]" do
|
||||
|
|
|
@ -350,11 +350,13 @@ describe "Array#[]= with [m..n]" do
|
|||
it "returns non-array value if non-array value assigned" do
|
||||
a = [1, 2, 3, 4, 5]
|
||||
(a[2..4] = 10).should == 10
|
||||
(a.[]=(2..4, 10)).should == 10
|
||||
end
|
||||
|
||||
it "returns array if array assigned" do
|
||||
a = [1, 2, 3, 4, 5]
|
||||
(a[2..4] = [7, 8]).should == [7, 8]
|
||||
(a.[]=(2..4, [7, 8])).should == [7, 8]
|
||||
end
|
||||
|
||||
it "just sets the section defined by range to nil even if the rhs is nil" do
|
||||
|
@ -394,15 +396,32 @@ describe "Array#[]= with [m..n]" do
|
|||
a.should == [1, 2, 3, 8, 4, 5]
|
||||
end
|
||||
|
||||
it "accepts Range subclasses" do
|
||||
a = [1, 2, 3, 4]
|
||||
range_incl = ArraySpecs::MyRange.new(1, 2)
|
||||
range_excl = ArraySpecs::MyRange.new(-3, -1, true)
|
||||
describe "Range subclasses" do
|
||||
before :each do
|
||||
@range_incl = ArraySpecs::MyRange.new(1, 2)
|
||||
@range_excl = ArraySpecs::MyRange.new(-3, -1, true)
|
||||
end
|
||||
|
||||
a[range_incl] = ["a", "b"]
|
||||
a.should == [1, "a", "b", 4]
|
||||
a[range_excl] = ["A", "B"]
|
||||
a.should == [1, "A", "B", 4]
|
||||
it "accepts Range subclasses" do
|
||||
a = [1, 2, 3, 4]
|
||||
|
||||
a[@range_incl] = ["a", "b"]
|
||||
a.should == [1, "a", "b", 4]
|
||||
a[@range_excl] = ["A", "B"]
|
||||
a.should == [1, "A", "B", 4]
|
||||
end
|
||||
|
||||
it "returns non-array value if non-array value assigned" do
|
||||
a = [1, 2, 3, 4, 5]
|
||||
(a[@range_incl] = 10).should == 10
|
||||
(a.[]=(@range_incl, 10)).should == 10
|
||||
end
|
||||
|
||||
it "returns array if array assigned" do
|
||||
a = [1, 2, 3, 4, 5]
|
||||
(a[@range_incl] = [7, 8]).should == [7, 8]
|
||||
a.[]=(@range_incl, [7, 8]).should == [7, 8]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -2,5 +2,5 @@ require File.expand_path('../../../spec_helper', __FILE__)
|
|||
require File.expand_path('../shared/index', __FILE__)
|
||||
|
||||
describe "Array#index" do
|
||||
it_behaves_like(:array_index, :index)
|
||||
it_behaves_like :array_index, :index
|
||||
end
|
||||
|
|
|
@ -3,5 +3,5 @@ require File.expand_path('../fixtures/classes', __FILE__)
|
|||
require File.expand_path('../shared/length', __FILE__)
|
||||
|
||||
describe "Array#length" do
|
||||
it_behaves_like(:array_length, :length)
|
||||
it_behaves_like :array_length, :length
|
||||
end
|
||||
|
|
|
@ -3,9 +3,9 @@ require File.expand_path('../fixtures/classes', __FILE__)
|
|||
require File.expand_path('../shared/collect', __FILE__)
|
||||
|
||||
describe "Array#map" do
|
||||
it_behaves_like(:array_collect, :map)
|
||||
it_behaves_like :array_collect, :map
|
||||
end
|
||||
|
||||
describe "Array#map!" do
|
||||
it_behaves_like(:array_collect_b, :map!)
|
||||
it_behaves_like :array_collect_b, :map!
|
||||
end
|
||||
|
|
|
@ -4,6 +4,6 @@ require File.expand_path('../shared/unshift', __FILE__)
|
|||
|
||||
ruby_version_is "2.5" do
|
||||
describe "Array#prepend" do
|
||||
it_behaves_like(:array_unshift, :prepend)
|
||||
it_behaves_like :array_unshift, :prepend
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,5 +3,5 @@ require File.expand_path('../fixtures/classes', __FILE__)
|
|||
require File.expand_path('../shared/push', __FILE__)
|
||||
|
||||
describe "Array#push" do
|
||||
it_behaves_like(:array_push, :push)
|
||||
it_behaves_like :array_push, :push
|
||||
end
|
||||
|
|
|
@ -3,5 +3,5 @@ require File.expand_path('../fixtures/classes', __FILE__)
|
|||
require File.expand_path('../shared/replace', __FILE__)
|
||||
|
||||
describe "Array#replace" do
|
||||
it_behaves_like(:array_replace, :replace)
|
||||
it_behaves_like :array_replace, :replace
|
||||
end
|
||||
|
|
|
@ -3,5 +3,5 @@ require File.expand_path('../fixtures/classes', __FILE__)
|
|||
require File.expand_path('../shared/length', __FILE__)
|
||||
|
||||
describe "Array#size" do
|
||||
it_behaves_like(:array_length, :size)
|
||||
it_behaves_like :array_length, :size
|
||||
end
|
||||
|
|
|
@ -156,5 +156,5 @@ describe "Array#slice!" do
|
|||
end
|
||||
|
||||
describe "Array#slice" do
|
||||
it_behaves_like(:array_slice, :slice)
|
||||
it_behaves_like :array_slice, :slice
|
||||
end
|
||||
|
|
|
@ -3,5 +3,5 @@ require File.expand_path('../fixtures/classes', __FILE__)
|
|||
require File.expand_path('../shared/unshift', __FILE__)
|
||||
|
||||
describe "Array#unshift" do
|
||||
it_behaves_like(:array_unshift, :unshift)
|
||||
it_behaves_like :array_unshift, :unshift
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue