|
41 | 41 | -> { ArraySpecs.frozen_array.concat([]) }.should raise_error(FrozenError) |
42 | 42 | end |
43 | 43 |
|
44 | | - ruby_version_is ''...'2.7' do |
45 | | - it "keeps tainted status" do |
46 | | - ary = [1, 2] |
47 | | - ary.taint |
48 | | - ary.concat([3]) |
49 | | - ary.tainted?.should be_true |
50 | | - ary.concat([]) |
51 | | - ary.tainted?.should be_true |
52 | | - end |
53 | | - |
54 | | - it "is not infected by the other" do |
55 | | - ary = [1,2] |
56 | | - other = [3]; other.taint |
57 | | - ary.tainted?.should be_false |
58 | | - ary.concat(other) |
59 | | - ary.tainted?.should be_false |
60 | | - end |
61 | | - |
62 | | - it "keeps the tainted status of elements" do |
63 | | - ary = [ Object.new, Object.new, Object.new ] |
64 | | - ary.each {|x| x.taint } |
65 | | - |
66 | | - ary.concat([ Object.new ]) |
67 | | - ary[0].tainted?.should be_true |
68 | | - ary[1].tainted?.should be_true |
69 | | - ary[2].tainted?.should be_true |
70 | | - ary[3].tainted?.should be_false |
71 | | - end |
72 | | - |
73 | | - it "keeps untrusted status" do |
74 | | - ary = [1, 2] |
75 | | - ary.untrust |
76 | | - ary.concat([3]) |
77 | | - ary.untrusted?.should be_true |
78 | | - ary.concat([]) |
79 | | - ary.untrusted?.should be_true |
80 | | - end |
81 | | - |
82 | | - it "is not infected untrustedness by the other" do |
83 | | - ary = [1,2] |
84 | | - other = [3]; other.untrust |
85 | | - ary.untrusted?.should be_false |
86 | | - ary.concat(other) |
87 | | - ary.untrusted?.should be_false |
88 | | - end |
89 | | - |
90 | | - it "keeps the untrusted status of elements" do |
91 | | - ary = [ Object.new, Object.new, Object.new ] |
92 | | - ary.each {|x| x.untrust } |
93 | | - |
94 | | - ary.concat([ Object.new ]) |
95 | | - ary[0].untrusted?.should be_true |
96 | | - ary[1].untrusted?.should be_true |
97 | | - ary[2].untrusted?.should be_true |
98 | | - ary[3].untrusted?.should be_false |
99 | | - end |
100 | | - end |
101 | | - |
102 | 44 | it "appends elements to an Array with enough capacity that has been shifted" do |
103 | 45 | ary = [1, 2, 3, 4, 5] |
104 | 46 | 2.times { ary.shift } |
|
0 commit comments