Skip to content

Commit

Permalink
Use rubyspec for some more core/array specs
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Sep 21, 2013
1 parent f6fb2f1 commit 628394a
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 360 deletions.
33 changes: 33 additions & 0 deletions spec/filters/bugs/array.rb
Expand Up @@ -2,6 +2,9 @@
fails "Array includes Enumerable"
fails "Array#at raises a TypeError when the passed argument can't be coerced to Integer"

fails "Array#clone copies frozen status from the original"
fails "Array#clone copies singleton methods"

fails "Array#combination generates from a defensive copy, ignoring mutations"
fails "Array#combination yields a partition consisting of only singletons"
fails "Array#combination yields [] when length is 0"
Expand All @@ -12,6 +15,25 @@
fails "Array#combination returns self when a block is given"
fails "Array#combination returns an enumerator when no block is provided"

fails "Array#<=> calls <=> left to right and return first non-0 result"
fails "Array#<=> returns -1 if the arrays have same length and a pair of corresponding elements returns -1 for <=>"
fails "Array#<=> returns +1 if the arrays have same length and a pair of corresponding elements returns +1 for <=>"
fails "Array#<=> properly handles recursive arrays"
fails "Array#<=> tries to convert the passed argument to an Array using #to_ary"
fails "Array#<=> does not call #to_ary on Array subclasses"
fails "Array#<=> returns nil when the argument is not array-like"

fails "Array#concat tries to convert the passed argument to an Array using #to_ary"
fails "Array#concat does not call #to_ary on Array subclasses"
fails "Array#concat raises a RuntimeError when Array is frozen and modification occurs"
fails "Array#concat raises a RuntimeError when Array is frozen and no modification occurs"
fails "Array#concat keeps tainted status"
fails "Array#concat is not infected by the other"
fails "Array#concat keeps the tainted status of elements"
fails "Array#concat keeps untrusted status"
fails "Array#concat is not infected untrustedness by the other"
fails "Array#concat keeps the untrusted status of elements"

fails "Array#count returns the number of element for which the block evaluates to true"

fails "Array#delete_at tries to convert the passed argument to an Integer using #to_int"
Expand Down Expand Up @@ -95,6 +117,11 @@
fails "Array#* tries to convert the passed argument to a String using #to_str"

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"
fails "Array.new with (array) does not call #to_ary on instances of Array or subclasses of Array"
fails "Array.new with (size, object=nil) calls #to_int to convert the size argument to an Integer when object is given"
fails "Array.new with (size, object=nil) calls #to_int to convert the size argument to an Integer when object is not given"
fails "Array.new with (size, object=nil) raises a TypeError if the size argument is not an Integer type"

fails "Array#+ tries to convert the passed argument to an Array using #to_ary"

Expand Down Expand Up @@ -124,6 +151,12 @@
fails "Array#shuffle attempts coercion via #to_hash"
fails "Array#shuffle is not destructive"
fails "Array#shuffle returns the same values, in a usually different order"
fails "Array#shuffle calls #rand on the Object passed by the :random key in the arguments Hash"
fails "Array#shuffle ignores an Object passed for the RNG if it does not define #rand"
fails "Array#shuffle accepts a Float for the value returned by #rand"
fails "Array#shuffle calls #to_int on the Object returned by #rand"
fails "Array#shuffle raises a RangeError if the value is less than zero"
fails "Array#shuffle raises a RangeError if the value is equal to one"

fails "Array#shuffle! returns the same values, in a usually different order"

Expand Down
15 changes: 0 additions & 15 deletions spec/rubyspec/core/array/clone_spec.rb

This file was deleted.

16 changes: 0 additions & 16 deletions spec/rubyspec/core/array/comparison_spec.rb

This file was deleted.

19 changes: 0 additions & 19 deletions spec/rubyspec/core/array/concat_spec.rb

This file was deleted.

15 changes: 0 additions & 15 deletions spec/rubyspec/core/array/dup_spec.rb

This file was deleted.

32 changes: 0 additions & 32 deletions spec/rubyspec/core/array/max_spec.rb

This file was deleted.

32 changes: 0 additions & 32 deletions spec/rubyspec/core/array/min_spec.rb

This file was deleted.

137 changes: 0 additions & 137 deletions spec/rubyspec/core/array/new_spec.rb

This file was deleted.

7 changes: 0 additions & 7 deletions spec/rubyspec/core/array/replace_spec.rb

This file was deleted.

0 comments on commit 628394a

Please sign in to comment.