diff options
Diffstat (limited to 'spec/ruby/core/array/flatten_spec.rb')
| -rw-r--r-- | spec/ruby/core/array/flatten_spec.rb | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/spec/ruby/core/array/flatten_spec.rb b/spec/ruby/core/array/flatten_spec.rb index e7cd114b9b..8c97000c79 100644 --- a/spec/ruby/core/array/flatten_spec.rb +++ b/spec/ruby/core/array/flatten_spec.rb @@ -75,11 +75,11 @@ describe "Array#flatten" do [[obj]].flatten(1) end - it "returns subclass instance for Array subclasses" do - ArraySpecs::MyArray[].flatten.should be_an_instance_of(ArraySpecs::MyArray) - ArraySpecs::MyArray[1, 2, 3].flatten.should be_an_instance_of(ArraySpecs::MyArray) - ArraySpecs::MyArray[1, [2], 3].flatten.should be_an_instance_of(ArraySpecs::MyArray) - ArraySpecs::MyArray[1, [2, 3], 4].flatten.should == ArraySpecs::MyArray[1, 2, 3, 4] + it "returns Array instance for Array subclasses" do + ArraySpecs::MyArray[].flatten.should be_an_instance_of(Array) + ArraySpecs::MyArray[1, 2, 3].flatten.should be_an_instance_of(Array) + ArraySpecs::MyArray[1, [2], 3].flatten.should be_an_instance_of(Array) + ArraySpecs::MyArray[1, [2, 3], 4].flatten.should == [1, 2, 3, 4] [ArraySpecs::MyArray[1, 2, 3]].flatten.should be_an_instance_of(Array) end @@ -135,16 +135,6 @@ describe "Array#flatten" do end end - ruby_version_is ''...'2.7' do - it "returns a tainted array if self is tainted" do - [].taint.flatten.tainted?.should be_true - end - - it "returns an untrusted array if self is untrusted" do - [].untrust.flatten.untrusted?.should be_true - end - end - it "performs respond_to? and method_missing-aware checks when coercing elements to array" do bo = BasicObject.new [bo].flatten.should == [bo] |
