Skip to content

Commit

Permalink
Add some more specs for core/array from rubyspec
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Sep 22, 2013
1 parent c438747 commit 050f0b3
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 143 deletions.
35 changes: 35 additions & 0 deletions spec/filters/bugs/array.rb
Expand Up @@ -71,6 +71,14 @@
fails "Array#eql? returns false immediately when sizes of the arrays differ"
fails "Array#eql? returns true if corresponding elements are #eql?"

fails "Array#== returns true if corresponding elements are #=="
fails "Array#== returns false if any corresponding elements are not #=="
fails "Array#== compares with an equivalent Array-like object using #to_ary"
fails "Array#== does not call #to_ary on Array subclasses"
fails "Array#== does not call #to_ary on its argument"
fails "Array#== handles well recursive arrays"
fails "Array#== returns false immediately when sizes of the arrays differ"

fails "Array#fetch tries to convert the passed argument to an Integer using #to_int"
fails "Array#fetch raises a TypeError when the passed argument can't be coerced to Integer"

Expand All @@ -93,6 +101,22 @@
fails "Array#flatten! tries to convert passed Objects to Integers using #to_int"
fails "Array#flatten! should not check modification by size"

fails "Array#initialize with (size, object=nil) sets the array to the values returned by the block before break is executed"
fails "Array#initialize with (size, object=nil) returns the value passed to break"
fails "Array#initialize with (size, object=nil) uses the block value instead of using the default value"
fails "Array#initialize with (size, object=nil) yields the index of the element and sets the element to the value of the block"
fails "Array#initialize with (size, object=nil) raises a TypeError if the size argument is not an Integer type"
fails "Array#initialize with (size, object=nil) calls #to_int to convert the size argument to an Integer when object is not given"
fails "Array#initialize with (size, object=nil) calls #to_int to convert the size argument to an Integer when object is given"
fails "Array#initialize with (size, object=nil) raises an ArgumentError if size is too large"
fails "Array#initialize with (size, object=nil) sets the array to size and fills with the object"
fails "Array#initialize with (array) does not call #to_ary on instances of Array or subclasses of Array"
fails "Array#initialize with (array) calls #to_ary to convert the value to an array"
fails "Array#initialize raises a RuntimeError on frozen arrays"
fails "Array#initialize preserves the object's identity even when changing its value"
fails "Array#initialize is called on subclasses"
fails "Array#initialize is private"

fails "Array#insert tries to convert the passed position argument to an Integer using #to_int"

fails "Array#& properly handles recursive arrays"
Expand Down Expand Up @@ -123,6 +147,14 @@
fails "Array#* raises a TypeError if the argument can neither be converted to a string nor an integer"
fails "Array#* tires to convert the passed argument to an Integer using #to_int"
fails "Array#* tries to convert the passed argument to a String using #to_str"
fails "Array#* with a string with an untrusted separator untrusts the result if the array has two or more elements"
fails "Array#* with a string with an untrusted separator does not untrust the result if the array has only one element"
fails "Array#* with a string with an untrusted separator does not untrust the result if the array is empty"
fails "Array#* with a string with a tainted separator taints the result if the array has two or more elements"
fails "Array#* with a string with a tainted separator does not taint the result if the array has only one element"
fails "Array#* with a string with a tainted separator does not taint the result if the array is empty"
fails "Array#* with a string uses the same separator with nested arrays"
fails "Array#* with a string returns a string formed by concatenating each element.to_str separated by separator"

fails "Array.new with (size, object=nil) raises an ArgumentError if size is too large"
fails "Array.new with (array) calls #to_ary to convert the value to an array"
Expand Down Expand Up @@ -180,6 +212,9 @@

fails "Array#to_a does not return subclass instance on Array subclasses"

fails "Array#transpose raises a TypeError if the passed Argument does not respond to #to_ary"
fails "Array#transpose tries to convert the passed argument to an Array using #to_ary"

fails "Array.try_convert does not rescue exceptions raised by #to_ary"
fails "Array.try_convert sends #to_ary to the argument and raises TypeError if it's not a kind of Array"
fails "Array.try_convert sends #to_ary to the argument and returns the result if it's a kind of Array"
Expand Down
143 changes: 0 additions & 143 deletions spec/rubyspec/core/array/multiply_spec.rb

This file was deleted.

4 changes: 4 additions & 0 deletions spec/rubyspecs
Expand Up @@ -23,19 +23,22 @@ core/array/each_index_spec
core/array/each_spec
core/array/empty_spec
core/array/eql_spec
core/array/equal_value_spec
core/array/fetch_spec
core/array/first_spec
core/array/flatten_spec
core/array/frozen_spec
core/array/include_spec
core/array/index_spec
core/array/initialize_spec
core/array/insert_spec
core/array/intersection_spec
core/array/keep_if_spec
core/array/last_spec
core/array/length_spec
core/array/map_spec
core/array/minus_spec
core/array/multiply_spec
core/array/new_spec
core/array/nitems_spec
core/array/plus_spec
Expand All @@ -56,6 +59,7 @@ core/array/take_spec
core/array/take_while_spec
core/array/to_a_spec
core/array/to_ary_spec
core/array/transpose_spec
core/array/try_convert_spec
core/array/uniq_spec
core/array/unshift_spec
Expand Down

0 comments on commit 050f0b3

Please sign in to comment.