Skip to content

Commit

Permalink
Updated CI specs to RubySpec cdce2bd0.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Ford committed Jan 6, 2010
1 parent 3412412 commit 09e533b
Show file tree
Hide file tree
Showing 182 changed files with 590 additions and 443 deletions.
2 changes: 1 addition & 1 deletion spec/ruby/core/argf/rewind_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

# This fails on all versions as reported in bug #1693. If it's deemed not to
# be a bug, this guard can be removed
ruby_bug "#1693", "1.8.7.174" do
ruby_bug "#1693", "1.8.7.248" do
it "resets ARGF.lineno to 0" do
argv [@file2_name] do
ARGF.lineno = 0
Expand Down
2 changes: 1 addition & 1 deletion spec/ruby/core/array/compact_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
end

it "returns subclass instance for Array subclasses" do
ArraySpecs::MyArray[1, 2, 3, nil].compact.class.should == ArraySpecs::MyArray
ArraySpecs::MyArray[1, 2, 3, nil].compact.should be_kind_of(ArraySpecs::MyArray)
end

it "keeps tainted status even if all elements are removed" do
Expand Down
4 changes: 2 additions & 2 deletions spec/ruby/core/array/constructor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Array.[](5, true, nil, 'a', "Ruby", obj).should == [5, true, nil, "a", "Ruby", obj]

a = ArraySpecs::MyArray.[](5, true, nil, 'a', "Ruby", obj)
a.class.should == ArraySpecs::MyArray
a.should be_kind_of(ArraySpecs::MyArray)
a.inspect.should == [5, true, nil, "a", "Ruby", obj].inspect
end
end
Expand All @@ -18,7 +18,7 @@
Array[5, true, nil, 'a', "Ruby", obj].should == Array.[](5, true, nil, "a", "Ruby", obj)

a = ArraySpecs::MyArray[5, true, nil, 'a', "Ruby", obj]
a.class.should == ArraySpecs::MyArray
a.should be_kind_of(ArraySpecs::MyArray)
a.inspect.should == [5, true, nil, "a", "Ruby", obj].inspect
end
end
2 changes: 1 addition & 1 deletion spec/ruby/core/array/element_reference_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@

it "returns an instance of the subtype when called on an Array subclass" do
ArraySub = Class.new Array
ArraySub[1,2].class.should == ArraySub
ArraySub[1,2].should be_kind_of(ArraySub)
end
end
10 changes: 5 additions & 5 deletions spec/ruby/core/array/first_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@
end

it "does not return subclass instance when passed count on Array subclasses" do
ArraySpecs::MyArray[].first(0).class.should == Array
ArraySpecs::MyArray[].first(2).class.should == Array
ArraySpecs::MyArray[1, 2, 3].first(0).class.should == Array
ArraySpecs::MyArray[1, 2, 3].first(1).class.should == Array
ArraySpecs::MyArray[1, 2, 3].first(2).class.should == Array
ArraySpecs::MyArray[].first(0).should be_kind_of(Array)
ArraySpecs::MyArray[].first(2).should be_kind_of(Array)
ArraySpecs::MyArray[1, 2, 3].first(0).should be_kind_of(Array)
ArraySpecs::MyArray[1, 2, 3].first(1).should be_kind_of(Array)
ArraySpecs::MyArray[1, 2, 3].first(2).should be_kind_of(Array)
end

it "is not destructive" do
Expand Down
10 changes: 5 additions & 5 deletions spec/ruby/core/array/flatten_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@
end

it "returns subclass instance for Array subclasses" do
ArraySpecs::MyArray[].flatten.class.should == ArraySpecs::MyArray
ArraySpecs::MyArray[1, 2, 3].flatten.class.should == ArraySpecs::MyArray
ArraySpecs::MyArray[1, [2], 3].flatten.class.should == ArraySpecs::MyArray
[ArraySpecs::MyArray[1, 2, 3]].flatten.class.should == Array
ArraySpecs::MyArray[].flatten.should be_kind_of(ArraySpecs::MyArray)
ArraySpecs::MyArray[1, 2, 3].flatten.should be_kind_of(ArraySpecs::MyArray)
ArraySpecs::MyArray[1, [2], 3].flatten.should be_kind_of(ArraySpecs::MyArray)
[ArraySpecs::MyArray[1, 2, 3]].flatten.should be_kind_of(Array)
end

it "is not destructive" do
Expand Down Expand Up @@ -180,7 +180,7 @@

ary = [ArraySpecs::MyArray[1, 2, 3]]
ary.flatten!
ary.class.should == Array
ary.should be_kind_of(Array)
ary.should == [1, 2, 3]
end

Expand Down
2 changes: 1 addition & 1 deletion spec/ruby/core/array/hash_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

[[], [1, 2, 3]].each do |ary|
ary.hash.should == ary.dup.hash
ary.hash.class.should == Fixnum
ary.hash.should be_kind_of(Fixnum)
end
end

Expand Down
6 changes: 3 additions & 3 deletions spec/ruby/core/array/intersection_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ def obj2.eql? a; false; end
end

it "does return subclass instances for Array subclasses" do
(ArraySpecs::MyArray[1, 2, 3] & []).class.should == Array
(ArraySpecs::MyArray[1, 2, 3] & ArraySpecs::MyArray[1, 2, 3]).class.should == Array
([] & ArraySpecs::MyArray[1, 2, 3]).class.should == Array
(ArraySpecs::MyArray[1, 2, 3] & []).should be_kind_of(Array)
(ArraySpecs::MyArray[1, 2, 3] & ArraySpecs::MyArray[1, 2, 3]).should be_kind_of(Array)
([] & ArraySpecs::MyArray[1, 2, 3]).should be_kind_of(Array)
end

it "does not call to_ary on array subclasses" do
Expand Down
10 changes: 5 additions & 5 deletions spec/ruby/core/array/last_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@
end

it "does not return subclass instance on Array subclasses" do
ArraySpecs::MyArray[].last(0).class.should == Array
ArraySpecs::MyArray[].last(2).class.should == Array
ArraySpecs::MyArray[1, 2, 3].last(0).class.should == Array
ArraySpecs::MyArray[1, 2, 3].last(1).class.should == Array
ArraySpecs::MyArray[1, 2, 3].last(2).class.should == Array
ArraySpecs::MyArray[].last(0).should be_kind_of(Array)
ArraySpecs::MyArray[].last(2).should be_kind_of(Array)
ArraySpecs::MyArray[1, 2, 3].last(0).should be_kind_of(Array)
ArraySpecs::MyArray[1, 2, 3].last(1).should be_kind_of(Array)
ArraySpecs::MyArray[1, 2, 3].last(2).should be_kind_of(Array)
end

it "is not destructive" do
Expand Down
6 changes: 3 additions & 3 deletions spec/ruby/core/array/minus_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
end

it "does not return subclass instance for Array subclasses" do
(ArraySpecs::MyArray[1, 2, 3] - []).class.should == Array
(ArraySpecs::MyArray[1, 2, 3] - ArraySpecs::MyArray[]).class.should == Array
([1, 2, 3] - ArraySpecs::MyArray[]).class.should == Array
(ArraySpecs::MyArray[1, 2, 3] - []).should be_kind_of(Array)
(ArraySpecs::MyArray[1, 2, 3] - ArraySpecs::MyArray[]).should be_kind_of(Array)
([1, 2, 3] - ArraySpecs::MyArray[]).should be_kind_of(Array)
end

it "does not call to_ary on array subclasses" do
Expand Down
6 changes: 3 additions & 3 deletions spec/ruby/core/array/multiply_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ def obj.to_str() "2" end
end

it "returns subclass instance with Array subclasses" do
(ArraySpecs::MyArray[1, 2, 3] * 0).class.should == ArraySpecs::MyArray
(ArraySpecs::MyArray[1, 2, 3] * 1).class.should == ArraySpecs::MyArray
(ArraySpecs::MyArray[1, 2, 3] * 2).class.should == ArraySpecs::MyArray
(ArraySpecs::MyArray[1, 2, 3] * 0).should be_kind_of(ArraySpecs::MyArray)
(ArraySpecs::MyArray[1, 2, 3] * 1).should be_kind_of(ArraySpecs::MyArray)
(ArraySpecs::MyArray[1, 2, 3] * 2).should be_kind_of(ArraySpecs::MyArray)
end

ruby_version_is '' ... '1.8' do
Expand Down
4 changes: 2 additions & 2 deletions spec/ruby/core/array/new_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

describe "Array.new" do
it "returns an instance of Array" do
Array.new.class.should == Array
Array.new.should be_kind_of(Array)
end

it "returns an instance of a subclass" do
ArraySpecs::MyArray.new.class.should == ArraySpecs::MyArray
ArraySpecs::MyArray.new.should be_kind_of(ArraySpecs::MyArray)
end

it "raise an ArgumentError if passed 3 or more arguments" do
Expand Down
6 changes: 3 additions & 3 deletions spec/ruby/core/array/partition_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@

it "does not return subclass instances on Array subclasses" do
result = ArraySpecs::MyArray[1, 2, 3].partition { |x| x % 2 == 0 }
result.class.should == Array
result[0].class.should == Array
result[1].class.should == Array
result.should be_kind_of(Array)
result[0].should be_kind_of(Array)
result[1].should be_kind_of(Array)
end
end
6 changes: 3 additions & 3 deletions spec/ruby/core/array/plus_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
end

it "does return subclass instances with Array subclasses" do
(ArraySpecs::MyArray[1, 2, 3] + []).class.should == Array
(ArraySpecs::MyArray[1, 2, 3] + ArraySpecs::MyArray[]).class.should == Array
([1, 2, 3] + ArraySpecs::MyArray[]).class.should == Array
(ArraySpecs::MyArray[1, 2, 3] + []).should be_kind_of(Array)
(ArraySpecs::MyArray[1, 2, 3] + ArraySpecs::MyArray[]).should be_kind_of(Array)
([1, 2, 3] + ArraySpecs::MyArray[]).should be_kind_of(Array)
end

it "does not call to_ary on array subclasses" do
Expand Down
2 changes: 1 addition & 1 deletion spec/ruby/core/array/pop_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
end

it "does not return subclass instances with Array subclass" do
ArraySpecs::MyArray[1, 2, 3].pop(2).class.should == Array
ArraySpecs::MyArray[1, 2, 3].pop(2).should be_kind_of(Array)
end

it "returns an untainted array even if the array is tainted" do
Expand Down
4 changes: 2 additions & 2 deletions spec/ruby/core/array/reject_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@

not_compliant_on :rubinius, :ironruby do
it "returns subclass instance on Array subclasses" do
ArraySpecs::MyArray[1, 2, 3].reject { |x| x % 2 == 0 }.class.should == ArraySpecs::MyArray
ArraySpecs::MyArray[1, 2, 3].reject { |x| x % 2 == 0 }.should be_kind_of(ArraySpecs::MyArray)
end
end

deviates_on :rubinius, :ironruby do
it "does not return subclass instance on Array subclasses" do
ArraySpecs::MyArray[1, 2, 3].reject { |x| x % 2 == 0 }.class.should == Array
ArraySpecs::MyArray[1, 2, 3].reject { |x| x % 2 == 0 }.should be_kind_of(Array)
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/ruby/core/array/reverse_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
end

it "returns subclass instance on Array subclasses" do
ArraySpecs::MyArray[1, 2, 3].reverse.class.should == ArraySpecs::MyArray
ArraySpecs::MyArray[1, 2, 3].reverse.should be_kind_of(ArraySpecs::MyArray)
end

it "properly handles recursive arrays" do
Expand Down
2 changes: 1 addition & 1 deletion spec/ruby/core/array/sample_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
end

it "does not return subclass instances with Array subclass" do
ArraySpecs::MyArray[1, 2, 3].sample(2).class.should == Array
ArraySpecs::MyArray[1, 2, 3].sample(2).should be_kind_of(Array)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/ruby/core/array/select_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
end

it "does not return subclass instance on Array subclasses" do
ArraySpecs::MyArray[1, 2, 3].select { true }.class.should == Array
ArraySpecs::MyArray[1, 2, 3].select { true }.should be_kind_of(Array)
end

it "properly handles recursive arrays" do
Expand Down
4 changes: 2 additions & 2 deletions spec/ruby/core/array/shared/clone.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe :array_clone, :shared => true do
it "returns an Array or a subclass instance" do
[].send(@method).class.should == Array
ArraySpecs::MyArray[1, 2].send(@method).class.should == ArraySpecs::MyArray
[].send(@method).should be_kind_of(Array)
ArraySpecs::MyArray[1, 2].send(@method).should be_kind_of(ArraySpecs::MyArray)
end

it "produces a shallow copy where the references are directly copied" do
Expand Down
2 changes: 1 addition & 1 deletion spec/ruby/core/array/shared/collect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
end

it "does not return subclass instance" do
ArraySpecs::MyArray[1, 2, 3].send(@method) { |x| x + 1 }.class.should == Array
ArraySpecs::MyArray[1, 2, 3].send(@method) { |x| x + 1 }.should be_kind_of(Array)
end

it "does not change self" do
Expand Down
6 changes: 3 additions & 3 deletions spec/ruby/core/array/shared/slice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,9 @@ def to.to_int() -2 end

it "returns a subclass instance when called on a subclass of Array" do
ary = ArraySpecs::MyArray[1, 2, 3]
ary.send(@method, 0, 0).class.should == ArraySpecs::MyArray
ary.send(@method, 0, 2).class.should == ArraySpecs::MyArray
ary.send(@method, 0..10).class.should == ArraySpecs::MyArray
ary.send(@method, 0, 0).should be_kind_of(ArraySpecs::MyArray)
ary.send(@method, 0, 2).should be_kind_of(ArraySpecs::MyArray)
ary.send(@method, 0..10).should be_kind_of(ArraySpecs::MyArray)
end

not_compliant_on :rubinius do
Expand Down
2 changes: 1 addition & 1 deletion spec/ruby/core/array/shift_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
end

it "does not return subclass instances with Array subclass" do
ArraySpecs::MyArray[1, 2, 3].shift(2).class.should == Array
ArraySpecs::MyArray[1, 2, 3].shift(2).should be_kind_of(Array)
end

it "returns an untainted array even if the array is tainted" do
Expand Down
6 changes: 3 additions & 3 deletions spec/ruby/core/array/sort_by_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
it "completes when supplied a block that always returns the same result" do
a = [2, 3, 5, 1, 4]
a.sort_by!{ 1 }
a.class.should == Array
a.should be_kind_of(Array)
a.sort_by!{ 0 }
a.class.should == Array
a.should be_kind_of(Array)
a.sort_by!{ -1 }
a.class.should == Array
a.should be_kind_of(Array)
end

ruby_version_is '' ... '1.9' do
Expand Down
22 changes: 11 additions & 11 deletions spec/ruby/core/array/sort_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,26 +75,26 @@
a = Array.new(25)
(0...25).each {|i| a[i] = ArraySpecs::UFOSceptic.new }

a.sort { -1 }.class.should == Array
a.sort { -1 }.should be_kind_of(Array)
end

it "does not call #<=> on elements when invoked with a block even if Array is large (Rubinius #412)" do
a = Array.new(1500)
(0...1500).each {|i| a[i] = ArraySpecs::UFOSceptic.new }

a.sort { -1 }.class.should == Array
a.sort { -1 }.should be_kind_of(Array)
end

it "completes when supplied a block that always returns the same result" do
a = [2, 3, 5, 1, 4]
a.sort { 1 }.class.should == Array
a.sort { 0 }.class.should == Array
a.sort { -1 }.class.should == Array
a.sort { 1 }.should be_kind_of(Array)
a.sort { 0 }.should be_kind_of(Array)
a.sort { -1 }.should be_kind_of(Array)
end

it "returns subclass instance on Array subclasses" do
ary = ArraySpecs::MyArray[1, 2, 3]
ary.sort.class.should == ArraySpecs::MyArray
ary.sort.should be_kind_of(ArraySpecs::MyArray)
end

it "does not freezes self during being sorted" do
Expand Down Expand Up @@ -169,21 +169,21 @@
a = Array.new(25)
(0...25).each {|i| a[i] = ArraySpecs::UFOSceptic.new }

a.sort! { -1 }.class.should == Array
a.sort! { -1 }.should be_kind_of(Array)
end

it "does not call #<=> on elements when invoked with a block even if Array is large (Rubinius #412)" do
a = Array.new(1500)
(0...1500).each {|i| a[i] = ArraySpecs::UFOSceptic.new }

a.sort! { -1 }.class.should == Array
a.sort! { -1 }.should be_kind_of(Array)
end

it "completes when supplied a block that always returns the same result" do
a = [2, 3, 5, 1, 4]
a.sort!{ 1 }.class.should == Array
a.sort!{ 0 }.class.should == Array
a.sort!{ -1 }.class.should == Array
a.sort!{ 1 }.should be_kind_of(Array)
a.sort!{ 0 }.should be_kind_of(Array)
a.sort!{ -1 }.should be_kind_of(Array)
end

ruby_version_is '' ... '1.9' do
Expand Down
2 changes: 1 addition & 1 deletion spec/ruby/core/array/to_a_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
it "does not return subclass instance on Array subclasses" do
e = ArraySpecs::MyArray.new
e << 1
e.to_a.class.should == Array
e.to_a.should be_kind_of(Array)
e.to_a.should == [1]
end

Expand Down
6 changes: 3 additions & 3 deletions spec/ruby/core/array/transpose_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@

it "does not return subclass instance on Array subclasses" do
result = ArraySpecs::MyArray[ArraySpecs::MyArray[1, 2, 3], ArraySpecs::MyArray[4, 5, 6]].transpose
result.class.should == Array
result[0].class.should == Array
result[1].class.should == Array
result.should be_kind_of(Array)
result[0].should be_kind_of(Array)
result[1].should be_kind_of(Array)
end
end
6 changes: 3 additions & 3 deletions spec/ruby/core/array/union_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def obj2.eql? a; false; end
end

it "does not return subclass instances for Array subclasses" do
(ArraySpecs::MyArray[1, 2, 3] | []).class.should == Array
(ArraySpecs::MyArray[1, 2, 3] | ArraySpecs::MyArray[1, 2, 3]).class.should == Array
([] | ArraySpecs::MyArray[1, 2, 3]).class.should == Array
(ArraySpecs::MyArray[1, 2, 3] | []).should be_kind_of(Array)
(ArraySpecs::MyArray[1, 2, 3] | ArraySpecs::MyArray[1, 2, 3]).should be_kind_of(Array)
([] | ArraySpecs::MyArray[1, 2, 3]).should be_kind_of(Array)
end

it "does not call to_ary on array subclasses" do
Expand Down
2 changes: 1 addition & 1 deletion spec/ruby/core/array/uniq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def self.eql?(o) taint; o.taint; true; end
end

it "returns subclass instance on Array subclasses" do
ArraySpecs::MyArray[1, 2, 3].uniq.class.should == ArraySpecs::MyArray
ArraySpecs::MyArray[1, 2, 3].uniq.should be_kind_of(ArraySpecs::MyArray)
end
end

Expand Down
Loading

0 comments on commit 09e533b

Please sign in to comment.