Running tests in test_array.rb Array#new it creates an empty array via language syntactical sugar: . **skipping** creates an empty array explicitly it creates an array of an explicit size: . it creates calls to_int on the size argument: .. it creates an instance of a subclassed array type: . it creates and initializes an array: .. it creates and initializes an array using a block: . Array#<=> **skipping** <=> should call <=> left to right and return first non-0 result it <=> should be 0 if the arrays are equal: .. it <=> should be -1 if the array is shorter than the other array: .. it <=> should be +1 if the array is longer than the other array: .. it <=> should call to_ary on its argument: . Array#assoc **skipping** (assoc) should return the first contained array the first element of which is obj **skipping** (assoc) should call == on argument Array#fetch it (fetch) should return the element at index: . it (fetch) should raise if there is no element at index: it (fetch) with default should return default if there is no element at index: ... **skipping** (fetch) with block should return the value of block if there is no element at index **skipping** (fetch) default block takes precedence over its default argument it (fetch) should call to_int on its argument: . Array#include? it (include?) should return true if object is present, false otherwise: .. **skipping** (include?) calls == on elements from left to right until success Array#index it (index) returns the index of the first element == object: . it (index) returns 0 if first element == object: . it (index) returns size-1 if only last element == to object: . it (index) returns nil if no element == to object: . Array#indexes and Array#indices are DEPRECATED synonyms for values_at it returns a new array containing the elements indexed by its parameters: warning: Array#indexes is deprecated; use Array#values_at .warning: Array#indexes is deprecated; use Array#values_at . it works with negative offset indices: warning: Array#indexes is deprecated; use Array#values_at .warning: Array#indexes is deprecated; use Array#values_at . it returns nil for elements that are beyond the indices of the array: warning: Array#indexes is deprecated; use Array#values_at . **skipping** (indexes) and (indices) with integer indices are DEPRECATED synonyms for values_at **skipping** (indexes) and (indices) can be given ranges which are returned as nested arrays (DEPRECATED) Array#rassoc it (rassoc) should return the first contained array whose second element is == object: .... **skipping** (rassoc) should call == on argument Array#rindex **skipping** (rindex) returns the first index backwards from the end where element == to object it (rindex) returns size-1 if last element == object: . it (rindex) returns 0 if only first element == object: . it (rindex) returns nil if no element == object: . Array#empty? it tests for an empty array: .. Array#to_a and Array#to_ary it to_a returns self: .. **skipping** to_a on array subclasses shouldn't return subclass instance it to_ary returns self: . Array#nitems it counts the number of non-nil items: ..... Array#length and Array#size it retrieves the length/size of empty and non-empty arrays: .... Array#==(other) it compares two arrays: .... Array#[idx] it reads elements in array using integer indices: ........ it reads elements in array using offset, length parameters: . it uses slice method to read elements in array (just an alias for []): .... it returns element at index via slice: ............ it returns elements beginning at start when using slice with start, length: ....................................... it should return elements from array using slice and ranges: ................................................................................. it should not expand array when slice called with indices outside of array: .......... it (at) should return the element at index: ... **skipping** (at) should call to_int on its argument it (first) should return the first element: .. it (first) should return nil if self is empty: . it (first) with count should return the first count elements: . it (first) with count == 0 should return an empty array: . it (first) with count == 1 should return an array containing the first element: . it (first) should raise ArgumentError when count is negative: it (first) should return the entire array when count > length: . **skipping** (first) should call to_int on count it (last) should return last element: . it (last) returns nil if self is empty: . it (last) returns the last count elements: . it (last) returns an empty array when count == 0: . it (last) raises ArgumentError when count is negative: it (last) returns the entire array when count > length: . it (values_at) with indices should return an array of elements at the indexes: .. **skipping** values_at should call to_int on its indices it (values_at) with ranges should return an array of elements in the ranges: .. **skipping** values_at with ranges should call to_int on arguments of ranges **skipping** values_at on array subclasses shouldn't return subclass instance generating arrays **skipping** & should create an array with elements common to both arrays (intersection) **skipping** & should create an array with no duplicates **skipping** & should call to_ary on its argument **skipping** & should act as if using eql? **skipping** & with array subclasses shouldn't return subclass instance it | should return an array of elements that appear in either array (union) without duplicates: . **skipping** | should call to_ary on its argument **skipping** | should act as if using eql? **skipping** | with array subclasses shouldn't return subclass instance it appends elements to an array using << method: ...... it << should push the object onto the end of the array: . Array#*(count) it generates count copies of an array: .. it (*) should concatenate n copies of the array: ... it * with a negative int should raise an ArgumentError: it * should call to_int on its argument: . **skipping** * on array subclass should return subclass instance Array#*(string) it should be equivalent to self.join(str): . it should call to_str on its argument: . it should call to_str on its argument before to_int: . Array#+(array) it (+) should concatenate arrays: . it (+) should concatenate two arrays: .... **skipping** (+) should call to_ary on its argument Array#compact it (compact) should return a copy of array with all nil elements removed: . **skipping** (compact) on array subclasses should return subclass instance Array#flatten it flatten should return a one-dimensional flattening recursively: . **skipping** flatten shouldn't call flatten on elements it flatten should complain about recursive arrays: **skipping** flatten on array subclasses should return subclass instance Array#reverse it (reverse) creates a reversed array: .. Array#sort **skipping** (sort) should return a new array from sorting elements using <=> on the pivot **skipping** (sort) raises an ArgumentError if the comparison cannot be completed **skipping** sort may take a block which is used to determine the order of objects a and b described as -1, 0 or +1 **skipping** sort on array subclasses should return subclass instance Array#uniq it uniq should return an array with no duplicates: .. **skipping** uniq on array subclasses should return subclass instance Array#uniq! it uniq! modifies the array in place: . it uniq! should return self: . it uniq! should return nil if no changes are made to the array: . converting arrays it converts an array to string: .. it converts an array containing nil elements to a string: . it converts an array to a string using a separator between elements: ... **skipping** (join) should return a string formed by concatenating each element.to_s separated by separator without trailing separator it join's separator defaults to $, (which defaults to empty): .. **skipping** join should call to_str on its separator argument it (to_s) is equivalent to #joining without a separator string: .. modifying arrays it modifies elements in array using []=: ... it should modify single elements / optionally expand array when []= called with index: ......... it should raise if []= called with start and negative length: it []= with start, length should set elements: ......................................... it crazy crap: ......... it []= with negative index beyond array should raise: . it (compact!) should remove all nil elements: .. it (compact!) should return nil if there are no nil elements to remove: . it concat should append the elements in the other array: ... it concat shouldn't loop endlessly when argument is self: . it concat should call to_ary on its argument: . **skipping** (delete) removes elements that are #== to object it (delete) should return object or nil if no elements match object: .... **skipping** (delete) may be given a block that is executed if no element matches object it (delete) may be given a block that is executed if no element matches object: . Array#delete_at it (delete_at) should remove the element at the specified index: .. it (delete_at) should return the removed element at the specified index: .. it (delete_at) should return nil if the index is out of range: . it (delete_at) should call to_int on its argument: . Array#flatten! it (flatten!) should modify array to produce a one-dimensional flattening recursively: .. it (flatten!) should return nil if no modifications took place: . it (flatten!) should complain about recursive arrays: Array#insert it (insert) with non-negative index should insert objects before the element at index: .......... it (insert) with index -1 should append objects to the end: . it (insert) with negative index should insert objects after the element at index: ...... it (insert) with negative index beyond array should raise: it (insert) without objects should do nothing: .... **skipping** (insert) should call to_int on position argument Array#clear it (clear) removes all elements from an array: .. Array#collect! it modifies elements in an array using collect!: . Array#replace it (replace) should replace the elements with elements from other array: ..... **skipping** (replace) should call to_ary on its argument Array#replace! it (reverse!) will reverse an array in-place: .. Array#sort! it (sort!) should sort array in place using <=>: . **skipping** sort! should sort array in place using block value Array#pop it (pop) should remove and return the last element of the array: ........ it (pop) should return nil if there are no more elements: . Array#push it (push) should append the arguments to the array: ... it (push) should append elements onto an array: ... Array#shift it (shift) should remove and return the first element: .......... it (shift) should return nil when the array is empty: . Array#slice! it (slice!) with index should remove and return the element at index: ................ it (slice!) with start, length should remove and return length elements beginning at start: ............ **skipping** (slice!) should call to_int on start and length arguments it (slice!) with range should remove and return elements in range: .......... **skipping** (slice!) with range should call to_int on range arguments **skipping** (slice!) with indices outside of array should (not?) expand array Array#unshift it should prepend object to the original array: ..... **skipping** Array#each **skipping** Array#each_index Tests failed == 0 Running tests in test_new.rbRunning tests in test_class.rb inspecting class attributes it reads the name of a class: Running tests in test_objects.rb inspect object attributes it asserts object identity for built-in types: ... it tests for well-known object_id values: ........ it tests for nil objects: ... it converts well-known object to strings: ...Running tests in test_range.rb range creation it creates an inclusive range object from integer literals: .... it creates an inclusive range object from integer expressions: .... it creates an exclusive range object from integer literals: .... it creates an exclusive range object from integer expressions: .... inspecting range objects it tests for range equality in inclusive and exclusive ranges: ......Running tests in test_string.rb String behavior in string expressions **skipping** calls to_s on the result of an expression String#<=>(other_string) **skipping** compares individual characters based on their ascii value it returns -1 when self is less than other: . it returns 0 when self is equal to other: . it returns 1 when self is greater than other: . it considers string that comes lexicographically first to be less if strings have same size: .. it doesn't consider shorter string to be less if longer string starts with shorter one: .. it compares shorter string with corresponding number of first chars of longer string: .. **skipping** ignores subclass differences String#<=>(obj) it returns nil if its argument does not respond to to_str: ... **skipping** returns nil if its argument does not respond to <=> **skipping** compares its argument and self by calling <=> on obj and turning the result around String#[idx] it returns the character code of the character at fixnum: .. it returns nil if idx is outside of self: .... it calls to_int on idx: .. String#[idx, length] it returns the substring starting at idx and the given length: ................................. it returns nil if the offset falls outside of self: .......... it returns nil if the length is negative: .. it converts non-integer numbers to integers: ... it calls to_int on idx and length: ... **skipping** returns subclass instances String#[range] it returns the substring given by the offsets of the range: .............. it returns nil if the beginning of the range falls outside of self: ......... it returns an empty string if the number of characters returned from the range (end - begin + ?1) is < 0: .............. **skipping** returns subclass instances **skipping** calls to_int on range arguments **skipping** String#[regexp] **skipping** String#[regexp, idx] **skipping** String#[other_string] String#[idx] = char it sets the code of the character at idx to char modulo 256: .......... it raises an IndexError without changing self if idx is outside of self: .. String#[idx] = other_str it replaces the char at idx with other_str: .. it raises an IndexError without changing self if idx is outside of self: .. **skipping** raises a TypeError when self is frozen it calls to_int on idx: .. **skipping** tries to convert other_str to a String using to_str **skipping** raises a TypeError if other_str can't be converted to a String String#[idx, chars_to_overwrite] = other_str it starts at idx and overwrites chars_to_overwrite characters before inserting the rest of other_str: .. it counts negative idx values from end of the string: .. it overwrites and deletes characters if chars_to_overwrite is less than the length of other_str: .. it deletes characters if other_str is an empty string: . it deletes characters up to the maximum length of the existing string: .. it appends other_str to the end of the string if idx == the length of the string: . it ignores the length parameter if idx == the length of the string and just appends other_str to the end of the string: . it throws an IndexError if |idx| is greater than the length of the string: it throws an IndexError if chars_to_overwrite < 0: it throws a TypeError if other_str is a type other than String: String#[range] = other_str it overwrites characters defined by range with other_str when range size and other_str size are equal: .. it overwrites the first character defined by a single character range if other_str is a single character: .. String#*count it returns a new string containing count copies of self: ... **skipping** tries to convert the given argument to an integer using to_int String#capitalize it returns a copy of self with the first character converted to uppercase and the remainder to lowercase: ... it is locale insensitive (only upcases a-z and only downcases A-Z): ... String#capitalize! it capitalizes self in place: .. it returns nil when no changes are made: ... **skipping** raises a TypeError when self is frozen String#downcase it returns a copy of self with all uppercase letters downcased: .. it is locale insensitive (only replacing A-Z): . String#downcase! it modifies self in place: .. it returns nil if no modifications were made: .. **skipping** raises a TypeError when self is frozen String#dump **skipping** produces a version of self with all nonprinting charaters replaced by \nnn notation it ignores the $KCODE setting: .. String#empty? it returns true if the string has a length of zero: ... String#include?(other) it returns true if self contains other: .. it tries to convert other to string using to_str: . it raises a TypeError if other can't be converted to string: String#include?(fixnum) it returns true if self contains the given char: .. String#index(fixnum [, offset]) it returns the index of the first occurence of the given character: . it starts the search at the given offset: . it returns nil if no occurence is found: .. String#index(substring [, offset]) it returns the index of the first occurence of the given substring: .. it starts the search at the given offset: . it returns nil if no occurence is found: .. it raises a TypeError if no string was given: String#insert(index, other) it inserts other before the character at the given index: ... it modifies self in place: .. it inserts after the given character on an negative count: .. it raises an IndexError if the index is out of string: it converts other to a string using to_str: . it raises a TypeError if other can't be converted to string: **skipping** raises a TypeError if self is frozen String#succ it increments alphanumeric characters: ... it performs carry operations on alphanumeric characters: ...... it inserts a new character if it runs out of alphanumeric characters to apply a carry to: ... it skips over non alphanumeric characters when looking for next character to apply a carry to: .. it increments the byte-based value of the char by one for non alphanumeric characters: .... it inserts a new character if it runs out of non alphanumeric characters to apply a carry to: .. String#succ! it behaves identically to String#succ except for the fact that it does things in-place: .... string creation it creates a string using language syntax: .. **skipping** creates a string using String.new it (*) creates a repeated string: ...... it (+) creates a concatenated string: . it (<<) appends strings: .. String#each_byte **skipping** raises a LocalJumpError if no block given it passes each byte in self to the given block: . it respects the fact that the string can change length during iteration: .. String#<<(string) it concatenates the given argument to self and returns self: .. it converts the given argument to a String using to_str: . it raises a TypeError if the given argument can't be converted to a String: **skipping** raises a TypeError when self is frozen **skipping** works when given a subclass instance String#<<(fixnum) it converts the given Fixnum to a char before concatenating: .. it raises a TypeError when the given Fixnum is not between 0 and 255: it doesn't call to_int on its argument: **skipping** raises a TypeError when self is frozen Tests failed == 0 Running tests in test_block_given.rbRunning tests in test_break.rbRunning tests in test_closure.rbRunning tests in test_create_invoke.rbRunning tests in test_next.rbRunning tests in test_redo.rbRunning tests in test_retry.rbRunning tests in test_return.rbRunning tests in test_yield.rbRunning tests in test_access_ctrl.rbshould have thrown Running tests in test_change_self.rbRunning tests in test_const.rbshould have thrown Running tests in test_find_method.rbleft: 20, right: 30 Running tests in test_methods.rbRunning tests in test_new.rbRunning tests in test_self.rbleft: #, right: main Running tests in test_singleton.rbRunning tests in test_top_level.rbshould have thrown Running tests in test_variables.rbRunning tests in test_virtual_attr.rbRunning tests in test_else.rbRunning tests in test_ensure.rbRunning tests in test_lifetime.rbRunning tests in test_match.rbRunning tests in test_nested.rbRunning tests in test_raise_nothing.rbRunning tests in test_raise_string.rbRunning tests in test_raise_thing.rbRunning tests in test_rescue_many.rbRunning tests in test_rescue_modifier.rbRunning tests in test_rescue_nothing.rbRunning tests in test_rescue_sequence.rbRunning tests in test_rescue_unusual.rbRunning tests in test_retry.rbRunning tests in test_return.rbRunning tests in test_assignment.rbRunning tests in test_boolean_expr.rbRunning tests in test_break_in_loop.rbRunning tests in test_for_loop.rbRunning tests in test_nested_assignment.rbRunning tests in test_next_in_loop.rbRunning tests in test_parallel_assignment.rbRunning tests in test_range_as_bool.rbRunning tests in test_redo_in_loop.rbRunning tests in test_retry_in_loop.rbRunning tests in test_while_until.rbRunning tests in test_coverage.rbRunning tests in test_defaultvalue.rbRunning tests in test_mixed_arg.rbRunning tests in test_normal_arg.rbnil Running tests in test_pass_args.rbRunning tests in test_recursive.rbRunning tests in test_return_value.rbRunning tests in test_var_arg.rbRunning tests in test_local_in_module.rbRunning tests in test_module_action.rbnil Running tests in test_module_path.rbRunning tests in test_require_bad_module.rbnil Running tests in test_require_cascade.rbRunning tests in test_require_itself.rbRunning tests in test_require_three_modules.rbRunning tests in simple_test.rb