[macruby-changes] [875] MacRuby/branches/experimental

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 11 15:46:47 PDT 2009


Revision: 875
          http://trac.macosforge.org/projects/ruby/changeset/875
Author:   eloy.de.enige at gmail.com
Date:     2009-03-11 15:46:43 -0700 (Wed, 11 Mar 2009)
Log Message:
-----------
Imported first frozen set of the rubyspec 9fcd252b92f5b2130db17a924e7338f2a9773ec1. See http://github.com/rubyspec/rubyspec/tree/master

Added Paths:
-----------
    MacRuby/branches/experimental/spec/
    MacRuby/branches/experimental/spec/frozen/
    MacRuby/branches/experimental/spec/frozen/CHANGES.before-2008-05-10
    MacRuby/branches/experimental/spec/frozen/LICENSE
    MacRuby/branches/experimental/spec/frozen/command_line/
    MacRuby/branches/experimental/spec/frozen/command_line/dash_d_spec.rb
    MacRuby/branches/experimental/spec/frozen/command_line/dash_e_spec.rb
    MacRuby/branches/experimental/spec/frozen/command_line/dash_r_spec.rb
    MacRuby/branches/experimental/spec/frozen/command_line/dash_upper_i_spec.rb
    MacRuby/branches/experimental/spec/frozen/command_line/dash_upper_w_spec.rb
    MacRuby/branches/experimental/spec/frozen/command_line/dash_v_spec.rb
    MacRuby/branches/experimental/spec/frozen/command_line/dash_w_spec.rb
    MacRuby/branches/experimental/spec/frozen/command_line/fixtures/
    MacRuby/branches/experimental/spec/frozen/command_line/fixtures/debug.rb
    MacRuby/branches/experimental/spec/frozen/command_line/fixtures/loadpath.rb
    MacRuby/branches/experimental/spec/frozen/command_line/fixtures/require.rb
    MacRuby/branches/experimental/spec/frozen/command_line/fixtures/test_file.rb
    MacRuby/branches/experimental/spec/frozen/command_line/fixtures/verbose.rb
    MacRuby/branches/experimental/spec/frozen/command_line/shared/
    MacRuby/branches/experimental/spec/frozen/command_line/shared/verbose.rb
    MacRuby/branches/experimental/spec/frozen/core/
    MacRuby/branches/experimental/spec/frozen/core/argf/
    MacRuby/branches/experimental/spec/frozen/core/argf/argf_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/binmode_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/bytes_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/chars_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/close_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/closed_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/each_byte_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/each_char_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/each_line_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/each_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/eof_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/file_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/filename_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/fileno_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/fixtures/
    MacRuby/branches/experimental/spec/frozen/core/argf/fixtures/bin_file.txt
    MacRuby/branches/experimental/spec/frozen/core/argf/fixtures/file1.txt
    MacRuby/branches/experimental/spec/frozen/core/argf/fixtures/file2.txt
    MacRuby/branches/experimental/spec/frozen/core/argf/fixtures/stdin.txt
    MacRuby/branches/experimental/spec/frozen/core/argf/getc_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/gets_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/lineno_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/path_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/pos_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/read_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/readchar_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/readline_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/readlines_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/rewind_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/seek_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/shared/
    MacRuby/branches/experimental/spec/frozen/core/argf/shared/each_byte.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/shared/each_char.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/shared/each_line.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/shared/eof.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/shared/filename.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/shared/fileno.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/shared/getc.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/shared/gets.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/shared/pos.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/shared/readlines.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/skip_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/tell_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/to_a_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/to_i_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/to_io_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/argf/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/
    MacRuby/branches/experimental/spec/frozen/core/array/allocate_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/append_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/array_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/assoc_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/at_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/clear_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/clone_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/collect_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/compact_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/comparison_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/concat_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/constructor_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/delete_at_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/delete_if_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/delete_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/dup_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/each_index_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/each_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/element_reference_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/element_set_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/empty_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/eql_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/equal_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/fetch_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/fill_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/first_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/fixtures/
    MacRuby/branches/experimental/spec/frozen/core/array/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/core/array/flatten_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/frozen_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/hash_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/include_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/index_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/indexes_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/indices_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/initialize_copy_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/insert_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/intersection_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/join_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/last_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/length_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/map_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/minus_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/multiply_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/nitems_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/pack_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/partition_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/plus_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/pop_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/push_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/rassoc_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/reject_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/replace_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/reverse_each_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/reverse_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/rindex_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/select_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/shared/
    MacRuby/branches/experimental/spec/frozen/core/array/shared/clone.rb
    MacRuby/branches/experimental/spec/frozen/core/array/shared/collect.rb
    MacRuby/branches/experimental/spec/frozen/core/array/shared/indexes.rb
    MacRuby/branches/experimental/spec/frozen/core/array/shared/join.rb
    MacRuby/branches/experimental/spec/frozen/core/array/shared/length.rb
    MacRuby/branches/experimental/spec/frozen/core/array/shared/replace.rb
    MacRuby/branches/experimental/spec/frozen/core/array/shared/slice.rb
    MacRuby/branches/experimental/spec/frozen/core/array/shift_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/size_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/slice_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/sort_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/to_a_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/to_ary_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/transpose_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/union_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/uniq_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/unshift_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/values_at_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/array/zip_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/basicobject/
    MacRuby/branches/experimental/spec/frozen/core/basicobject/basic_object_class_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/basicobject/basic_object_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/basicobject/basic_object_subclass_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/basicobject/metaclass_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/basicobject/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/basicobject/remove_method_missing.rb
    MacRuby/branches/experimental/spec/frozen/core/basicobject/shared/
    MacRuby/branches/experimental/spec/frozen/core/basicobject/shared/behavior.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/
    MacRuby/branches/experimental/spec/frozen/core/bignum/abs_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/bit_and_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/bit_or_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/bit_xor_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/coerce_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/comparison_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/complement_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/div_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/divide_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/divmod_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/element_reference_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/eql_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/equal_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/exponent_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/gt_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/gte_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/hash_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/left_shift_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/lt_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/lte_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/minus_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/modulo_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/multiply_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/plus_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/quo_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/remainder_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/right_shift_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/shared/
    MacRuby/branches/experimental/spec/frozen/core/bignum/shared/divide.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/shared/modulo.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/size_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/to_f_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/bignum/uminus_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/binding/
    MacRuby/branches/experimental/spec/frozen/core/binding/clone_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/binding/dup_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/binding/fixtures/
    MacRuby/branches/experimental/spec/frozen/core/binding/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/core/binding/shared/
    MacRuby/branches/experimental/spec/frozen/core/binding/shared/clone.rb
    MacRuby/branches/experimental/spec/frozen/core/class/
    MacRuby/branches/experimental/spec/frozen/core/class/allocate_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/class/fixtures/
    MacRuby/branches/experimental/spec/frozen/core/class/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/core/class/inherited_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/class/initialize_copy_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/class/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/class/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/class/superclass_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/comparable/
    MacRuby/branches/experimental/spec/frozen/core/comparable/between_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/comparable/equal_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/comparable/fixtures/
    MacRuby/branches/experimental/spec/frozen/core/comparable/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/core/comparable/gt_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/comparable/gte_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/comparable/lt_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/comparable/lte_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/continuation/
    MacRuby/branches/experimental/spec/frozen/core/continuation/call_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/continuation/continuation_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/continuation/element_reference_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/
    MacRuby/branches/experimental/spec/frozen/core/dir/chdir_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/chroot_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/close_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/delete_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/dir_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/each_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/element_reference_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/entries_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/fixtures/
    MacRuby/branches/experimental/spec/frozen/core/dir/fixtures/common.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/foreach_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/getwd_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/glob_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/mkdir_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/open_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/path_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/pos_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/pwd_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/read_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/rewind_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/rmdir_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/seek_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/shared/
    MacRuby/branches/experimental/spec/frozen/core/dir/shared/closed.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/shared/delete.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/shared/glob.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/shared/open.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/shared/pos.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/shared/pwd.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/tell_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/dir/unlink_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/
    MacRuby/branches/experimental/spec/frozen/core/enumerable/all_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/any_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/collect_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/detect_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/each_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/each_with_index_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/entries_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/find_all_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/find_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/fixtures/
    MacRuby/branches/experimental/spec/frozen/core/enumerable/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/grep_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/include_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/inject_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/map_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/max_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/member_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/min_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/partition_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/reject_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/select_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/shared/
    MacRuby/branches/experimental/spec/frozen/core/enumerable/shared/collect.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/shared/entries.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/shared/find.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/shared/find_all.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/shared/include.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/sort_by_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/sort_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/to_a_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/enumerable/zip_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/
    MacRuby/branches/experimental/spec/frozen/core/env/clear_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/delete_if_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/delete_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/each_key_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/each_pair_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/each_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/each_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/element_reference_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/element_set_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/empty_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/fetch_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/has_key_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/has_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/include_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/index_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/indexes_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/indices_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/invert_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/key_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/keys_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/length_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/member_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/rehash_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/reject_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/replace_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/select_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/shared/
    MacRuby/branches/experimental/spec/frozen/core/env/shared/each.rb
    MacRuby/branches/experimental/spec/frozen/core/env/shared/include.rb
    MacRuby/branches/experimental/spec/frozen/core/env/shared/length.rb
    MacRuby/branches/experimental/spec/frozen/core/env/shared/store.rb
    MacRuby/branches/experimental/spec/frozen/core/env/shared/value.rb
    MacRuby/branches/experimental/spec/frozen/core/env/shift_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/size_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/store_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/to_a_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/to_hash_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/update_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/value_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/values_at_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/env/values_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/exception/
    MacRuby/branches/experimental/spec/frozen/core/exception/arguments_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/exception/backtrace_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/exception/case_compare_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/exception/errno_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/exception/exception_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/exception/exit_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/exception/fixtures/
    MacRuby/branches/experimental/spec/frozen/core/exception/fixtures/common.rb
    MacRuby/branches/experimental/spec/frozen/core/exception/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/exception/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/exception/io_error_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/exception/message_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/exception/name_error_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/exception/name_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/exception/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/exception/no_method_error_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/exception/range_error_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/exception/script_error_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/exception/set_backtrace_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/exception/shared/
    MacRuby/branches/experimental/spec/frozen/core/exception/shared/new.rb
    MacRuby/branches/experimental/spec/frozen/core/exception/standard_error_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/exception/system_call_error_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/exception/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/exception/to_str_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/false/
    MacRuby/branches/experimental/spec/frozen/core/false/and_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/false/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/false/or_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/false/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/false/xor_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/
    MacRuby/branches/experimental/spec/frozen/core/file/atime_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/basename_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/blockdev_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/chardev_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/chmod_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/chown_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/constants/
    MacRuby/branches/experimental/spec/frozen/core/file/constants/constants_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/constants_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/ctime_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/delete_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/directory_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/dirname_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/executable_real_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/executable_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/exist_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/exists_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/expand_path_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/extname_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/file_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/fixtures/
    MacRuby/branches/experimental/spec/frozen/core/file/fixtures/do_not_remove
    MacRuby/branches/experimental/spec/frozen/core/file/fixtures/file_types.rb
    MacRuby/branches/experimental/spec/frozen/core/file/flock_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/fnmatch_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/ftype_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/grpowned_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/identical_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/join_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/lchmod_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/lchown_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/link_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/lstat_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/mtime_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/open_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/owned_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/path_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/pipe_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/readable_real_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/readable_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/readlink_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/rename_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/setgid_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/setuid_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/shared/
    MacRuby/branches/experimental/spec/frozen/core/file/shared/fnmatch.rb
    MacRuby/branches/experimental/spec/frozen/core/file/shared/stat.rb
    MacRuby/branches/experimental/spec/frozen/core/file/shared/unlink.rb
    MacRuby/branches/experimental/spec/frozen/core/file/size_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/socket_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/split_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/
    MacRuby/branches/experimental/spec/frozen/core/file/stat/atime_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/blksize_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/blockdev_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/blocks_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/chardev_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/comparison_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/ctime_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/dev_major_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/dev_minor_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/dev_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/directory_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/executable_real_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/executable_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/file_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/fixtures/
    MacRuby/branches/experimental/spec/frozen/core/file/stat/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/ftype_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/gid_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/grpowned_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/ino_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/mode_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/mtime_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/nlink_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/owned_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/pipe_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/rdev_major_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/rdev_minor_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/rdev_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/readable_real_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/readable_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/setgid_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/setuid_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/size_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/socket_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/sticky_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/symlink_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/uid_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/writable_real_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/writable_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat/zero_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/stat_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/sticky_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/symlink_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/truncate_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/umask_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/unlink_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/utime_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/writable_real_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/writable_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/file/zero_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/filetest/
    MacRuby/branches/experimental/spec/frozen/core/filetest/blockdev_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/filetest/chardev_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/filetest/directory_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/filetest/executable_real_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/filetest/executable_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/filetest/exist_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/filetest/exists_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/filetest/file_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/filetest/grpowned_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/filetest/identical_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/filetest/owned_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/filetest/pipe_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/filetest/readable_real_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/filetest/readable_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/filetest/setgid_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/filetest/setuid_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/filetest/size_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/filetest/socket_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/filetest/sticky_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/filetest/symlink_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/filetest/writable_real_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/filetest/writable_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/filetest/zero_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/
    MacRuby/branches/experimental/spec/frozen/core/fixnum/abs_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/bit_and_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/bit_or_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/bit_xor_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/coerce_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/comparison_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/complement_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/div_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/divide_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/divmod_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/element_reference_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/equal_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/exponent_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/gt_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/gte_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/hash_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/id2name_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/induced_from_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/left_shift_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/lt_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/lte_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/minus_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/modulo_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/multiply_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/plus_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/quo_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/right_shift_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/shared/
    MacRuby/branches/experimental/spec/frozen/core/fixnum/shared/modulo.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/size_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/to_f_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/to_sym_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/uminus_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/fixnum/zero_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/
    MacRuby/branches/experimental/spec/frozen/core/float/abs_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/ceil_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/coerce_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/comparison_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/constants_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/divide_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/divmod_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/eql_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/equal_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/exponent_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/finite_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/floor_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/gt_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/gte_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/hash_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/induced_from_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/infinite_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/lt_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/lte_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/minus_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/modulo_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/multiply_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/nan_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/plus_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/round_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/shared/
    MacRuby/branches/experimental/spec/frozen/core/float/shared/modulo.rb
    MacRuby/branches/experimental/spec/frozen/core/float/shared/to_i.rb
    MacRuby/branches/experimental/spec/frozen/core/float/to_f_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/to_i_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/to_int_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/truncate_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/uminus_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/uplus_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/float/zero_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/gc/
    MacRuby/branches/experimental/spec/frozen/core/gc/disable_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/gc/enable_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/gc/garbage_collect_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/gc/start_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/
    MacRuby/branches/experimental/spec/frozen/core/hash/allocate_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/clear_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/clone_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/default_proc_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/default_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/delete_if_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/delete_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/each_key_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/each_pair_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/each_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/each_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/element_reference_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/element_set_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/empty_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/equal_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/fetch_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/fixtures/
    MacRuby/branches/experimental/spec/frozen/core/hash/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/has_key_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/has_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/hash_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/include_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/index_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/indexes_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/indices_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/initialize_copy_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/invert_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/key_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/keys_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/length_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/member_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/merge_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/rehash_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/reject_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/replace_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/select_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/shared/
    MacRuby/branches/experimental/spec/frozen/core/hash/shared/iteration.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/shared/key.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/shared/length.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/shared/replace.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/shared/store.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/shared/update.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/shared/value.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/shift_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/size_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/sort_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/store_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/to_a_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/to_hash_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/update_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/value_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/values_at_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/hash/values_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/integer/
    MacRuby/branches/experimental/spec/frozen/core/integer/ceil_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/integer/chr_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/integer/downto_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/integer/even_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/integer/floor_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/integer/induced_from_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/integer/integer_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/integer/next_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/integer/odd_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/integer/ord_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/integer/pred_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/integer/round_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/integer/shared/
    MacRuby/branches/experimental/spec/frozen/core/integer/shared/next.rb
    MacRuby/branches/experimental/spec/frozen/core/integer/shared/to_i.rb
    MacRuby/branches/experimental/spec/frozen/core/integer/succ_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/integer/times_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/integer/to_i_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/integer/to_int_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/integer/truncate_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/integer/upto_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/
    MacRuby/branches/experimental/spec/frozen/core/io/binmode_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/close_read_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/close_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/close_write_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/closed_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/constants_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/data/
    MacRuby/branches/experimental/spec/frozen/core/io/data/data_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/data/fixtures/
    MacRuby/branches/experimental/spec/frozen/core/io/data/fixtures/data1.rb
    MacRuby/branches/experimental/spec/frozen/core/io/data/fixtures/data2.rb
    MacRuby/branches/experimental/spec/frozen/core/io/data/flock_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/dup_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/each_byte_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/each_line_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/each_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/eof_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/fcntl_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/fileno_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/fixtures/
    MacRuby/branches/experimental/spec/frozen/core/io/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/core/io/fixtures/gets.txt
    MacRuby/branches/experimental/spec/frozen/core/io/fixtures/numbered_lines.txt
    MacRuby/branches/experimental/spec/frozen/core/io/fixtures/one_byte.txt
    MacRuby/branches/experimental/spec/frozen/core/io/fixtures/paragraphs.txt
    MacRuby/branches/experimental/spec/frozen/core/io/fixtures/readlines.txt
    MacRuby/branches/experimental/spec/frozen/core/io/flush_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/for_fd_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/foreach_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/fsync_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/getc_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/gets_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/initialize_copy_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/io_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/ioctl_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/isatty_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/lineno_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/open_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/output_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/pid_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/pipe_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/popen_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/pos_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/print_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/printf_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/putc_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/puts_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/read_nonblock_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/read_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/readchar_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/readline_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/readlines_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/readpartial_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/reopen_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/rewind_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/seek_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/select_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/shared/
    MacRuby/branches/experimental/spec/frozen/core/io/shared/each.rb
    MacRuby/branches/experimental/spec/frozen/core/io/shared/new.rb
    MacRuby/branches/experimental/spec/frozen/core/io/shared/pos.rb
    MacRuby/branches/experimental/spec/frozen/core/io/shared/tty.rb
    MacRuby/branches/experimental/spec/frozen/core/io/shared/write.rb
    MacRuby/branches/experimental/spec/frozen/core/io/stat_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/sync_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/sysopen_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/sysread_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/sysseek_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/syswrite_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/tell_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/to_i_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/to_io_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/tty_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/ungetc_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/write_nonblock_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/io/write_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/
    MacRuby/branches/experimental/spec/frozen/core/kernel/Array_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/Float_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/Integer_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/String_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/__id___spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/__send___spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/abort_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/at_exit_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/autoload_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/backtick_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/binding_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/block_given_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/callcc_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/caller_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/case_compare_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/catch_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/chomp_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/chop_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/class_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/clone_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/display_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/dup_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/eql_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/equal_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/equal_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/eval_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/exec_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/exit_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/extend_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/fail_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/
    MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/.gitignore
    MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/autoload_b.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/autoload_c.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/caller_fixture1.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/caller_fixture2.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/check_expansion.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/test.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/fork_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/format_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/freeze_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/frozen_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/getc_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/gets_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/global_variables_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/gsub_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/hash_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/id_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/initialize_copy_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/instance_eval_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/instance_of_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/instance_variable_defined_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/instance_variable_get_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/instance_variable_set_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/instance_variables_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/is_a_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/iterator_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/kind_of_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/lambda_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/load_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/local_variables_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/loop_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/match_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/method_missing_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/method_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/methods_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/nil_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/object_id_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/open_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/p_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/print_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/printf_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/private_methods_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/proc_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/protected_methods_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/public_methods_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/putc_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/puts_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/raise_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/rand_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/readline_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/readlines_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/remove_instance_variable_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/require_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/respond_to_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/scan_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/select_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/send_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/set_trace_func_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/shared/
    MacRuby/branches/experimental/spec/frozen/core/kernel/shared/lambda.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/shared/object_id.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/singleton_method_added_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/singleton_method_removed_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/singleton_method_undefined_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/singleton_methods_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/sleep_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/split_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/sprintf_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/srand_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/sub_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/syscall_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/system_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/taint_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/tainted_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/test_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/throw_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/to_a_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/trace_var_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/trap_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/trust_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/type_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/untaint_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/untrace_var_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/untrust_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/untrusted_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/kernel/warn_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/marshal/
    MacRuby/branches/experimental/spec/frozen/core/marshal/dump_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/marshal/fixtures/
    MacRuby/branches/experimental/spec/frozen/core/marshal/fixtures/marshal_data.rb
    MacRuby/branches/experimental/spec/frozen/core/marshal/load_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/marshal/restore_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/matchdata/
    MacRuby/branches/experimental/spec/frozen/core/matchdata/begin_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/matchdata/captures_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/matchdata/element_reference_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/matchdata/end_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/matchdata/initialize_copy_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/matchdata/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/matchdata/length_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/matchdata/offset_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/matchdata/post_match_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/matchdata/pre_match_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/matchdata/select_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/matchdata/shared/
    MacRuby/branches/experimental/spec/frozen/core/matchdata/shared/length.rb
    MacRuby/branches/experimental/spec/frozen/core/matchdata/size_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/matchdata/string_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/matchdata/to_a_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/matchdata/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/matchdata/values_at_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/math/
    MacRuby/branches/experimental/spec/frozen/core/math/acos_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/math/acosh_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/math/asin_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/math/asinh_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/math/atan2_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/math/atan_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/math/atanh_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/math/constants_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/math/cos_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/math/cosh_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/math/erf_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/math/erfc_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/math/exp_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/math/fixtures/
    MacRuby/branches/experimental/spec/frozen/core/math/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/core/math/frexp_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/math/hypot_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/math/ldexp_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/math/log10_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/math/log2_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/math/log_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/math/sin_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/math/sinh_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/math/sqrt_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/math/tan_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/math/tanh_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/method/
    MacRuby/branches/experimental/spec/frozen/core/method/arity_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/method/call_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/method/clone_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/method/element_reference_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/method/equal_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/method/fixtures/
    MacRuby/branches/experimental/spec/frozen/core/method/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/core/method/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/method/shared/
    MacRuby/branches/experimental/spec/frozen/core/method/shared/call.rb
    MacRuby/branches/experimental/spec/frozen/core/method/shared/to_s.rb
    MacRuby/branches/experimental/spec/frozen/core/method/to_proc_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/method/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/method/unbind_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/
    MacRuby/branches/experimental/spec/frozen/core/module/alias_method_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/allocate_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/ancestors_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/append_features_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/attr_accessor_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/attr_reader_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/attr_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/attr_writer_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/autoload_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/case_compare_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/class_eval_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/class_variable_defined_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/class_variable_get_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/class_variable_set_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/class_variables_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/comparison_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/const_defined_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/const_get_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/const_missing_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/const_set_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/constants_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/define_method_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/eql_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/equal_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/equal_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/extend_object_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/extended_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/fixtures/
    MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload.rb
    MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_c.rb
    MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_d.rb
    MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_e.rb
    MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_f.rb
    MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_g.rb
    MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_h.rb
    MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_i.rb
    MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_j.rb
    MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_k.rb
    MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_lm.rb
    MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_n.rb
    MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_o.rb
    MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_t.rb
    MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_v.rb
    MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_w.rb
    MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_x.rb
    MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_z.rb
    MacRuby/branches/experimental/spec/frozen/core/module/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/core/module/freeze_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/gt_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/gte_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/include_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/included_modules_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/included_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/initialize_copy_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/instance_method_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/instance_methods_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/lt_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/lte_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/method_added_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/method_defined_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/method_removed_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/method_undefined_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/module_eval_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/module_function_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/name_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/nesting_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/private_class_method_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/private_instance_methods_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/private_method_defined_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/private_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/protected_instance_methods_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/protected_method_defined_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/protected_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/public_class_method_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/public_instance_methods_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/public_method_defined_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/public_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/remove_class_variable_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/remove_const_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/remove_method_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/shared/
    MacRuby/branches/experimental/spec/frozen/core/module/shared/class_eval.rb
    MacRuby/branches/experimental/spec/frozen/core/module/shared/equal_value.rb
    MacRuby/branches/experimental/spec/frozen/core/module/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/module/undef_method_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/nil/
    MacRuby/branches/experimental/spec/frozen/core/nil/and_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/nil/dup_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/nil/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/nil/nil_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/nil/or_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/nil/to_a_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/nil/to_f_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/nil/to_i_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/nil/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/nil/xor_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/numeric/
    MacRuby/branches/experimental/spec/frozen/core/numeric/abs_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/numeric/ceil_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/numeric/coerce_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/numeric/comparison_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/numeric/div_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/numeric/divmod_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/numeric/eql_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/numeric/fixtures/
    MacRuby/branches/experimental/spec/frozen/core/numeric/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/core/numeric/floor_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/numeric/initialize_copy_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/numeric/integer_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/numeric/modulo_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/numeric/nonzero_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/numeric/quo_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/numeric/remainder_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/numeric/round_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/numeric/singleton_method_added_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/numeric/step_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/numeric/to_int_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/numeric/truncate_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/numeric/uminus_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/numeric/uplus_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/numeric/zero_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/object/
    MacRuby/branches/experimental/spec/frozen/core/object/clone_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/object/dup_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/object/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/object/instance_of_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/object/is_a_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/object/kind_of_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/object/match_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/object/metaclass_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/object/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/object/shared/
    MacRuby/branches/experimental/spec/frozen/core/object/shared/dup_clone.rb
    MacRuby/branches/experimental/spec/frozen/core/object/shared/kind_of.rb
    MacRuby/branches/experimental/spec/frozen/core/objectspace/
    MacRuby/branches/experimental/spec/frozen/core/objectspace/_id2ref_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/objectspace/add_finalizer_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/objectspace/call_finalizer_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/objectspace/define_finalizer_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/objectspace/each_object_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/objectspace/finalizers_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/objectspace/fixtures.rb
    MacRuby/branches/experimental/spec/frozen/core/objectspace/garbage_collect_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/objectspace/remove_finalizer_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/objectspace/undefine_finalizer_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/precision/
    MacRuby/branches/experimental/spec/frozen/core/precision/included_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/precision/prec_f_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/precision/prec_i_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/precision/prec_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/proc/
    MacRuby/branches/experimental/spec/frozen/core/proc/arity_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/proc/binding_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/proc/block_pass_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/proc/call_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/proc/clone_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/proc/dup_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/proc/element_reference_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/proc/equal_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/proc/fixtures/
    MacRuby/branches/experimental/spec/frozen/core/proc/fixtures/procs.rb
    MacRuby/branches/experimental/spec/frozen/core/proc/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/proc/shared/
    MacRuby/branches/experimental/spec/frozen/core/proc/shared/call.rb
    MacRuby/branches/experimental/spec/frozen/core/proc/shared/dup.rb
    MacRuby/branches/experimental/spec/frozen/core/proc/to_proc_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/proc/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/
    MacRuby/branches/experimental/spec/frozen/core/process/abort_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/constants_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/detach_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/egid_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/euid_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/exit_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/fork_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/getpgid_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/getpgrp_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/getpriority_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/getrlimit_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/gid_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/groups_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/initgroups_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/kill_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/maxgroups_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/pid_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/ppid_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/setpgid_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/setpgrp_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/setpriority_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/setrlimit_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/setsid_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/times_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/uid_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/wait2_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/wait_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/waitall_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/waitpid2_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/process/waitpid_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/range/
    MacRuby/branches/experimental/spec/frozen/core/range/begin_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/range/case_compare_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/range/each_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/range/end_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/range/eql_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/range/equal_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/range/exclude_end_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/range/first_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/range/hash_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/range/include_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/range/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/range/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/range/last_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/range/member_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/range/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/range/shared/
    MacRuby/branches/experimental/spec/frozen/core/range/shared/begin.rb
    MacRuby/branches/experimental/spec/frozen/core/range/shared/end.rb
    MacRuby/branches/experimental/spec/frozen/core/range/shared/equal_value.rb
    MacRuby/branches/experimental/spec/frozen/core/range/shared/include.rb
    MacRuby/branches/experimental/spec/frozen/core/range/step_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/range/to_a_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/range/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/regexp/
    MacRuby/branches/experimental/spec/frozen/core/regexp/case_compare_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/regexp/casefold_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/regexp/compile_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/regexp/eql_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/regexp/equal_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/regexp/escape_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/regexp/hash_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/regexp/initialize_copy_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/regexp/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/regexp/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/regexp/kcode_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/regexp/last_match_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/regexp/match_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/regexp/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/regexp/options_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/regexp/quote_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/regexp/shared/
    MacRuby/branches/experimental/spec/frozen/core/regexp/shared/equal_value.rb
    MacRuby/branches/experimental/spec/frozen/core/regexp/shared/match.rb
    MacRuby/branches/experimental/spec/frozen/core/regexp/shared/new.rb
    MacRuby/branches/experimental/spec/frozen/core/regexp/shared/quote.rb
    MacRuby/branches/experimental/spec/frozen/core/regexp/source_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/regexp/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/regexp/union_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/signal/
    MacRuby/branches/experimental/spec/frozen/core/signal/list_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/signal/trap_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/
    MacRuby/branches/experimental/spec/frozen/core/string/allocate_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/append_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/capitalize_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/casecmp_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/center_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/chomp_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/chop_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/comparison_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/concat_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/count_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/crypt_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/delete_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/downcase_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/dump_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/each_byte_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/each_char_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/each_line_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/each_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/element_reference_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/element_set_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/empty_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/entries_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/eql_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/equal_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/fixtures/
    MacRuby/branches/experimental/spec/frozen/core/string/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/core/string/gsub_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/hash_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/hex_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/include_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/index_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/insert_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/intern_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/length_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/ljust_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/lstrip_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/match_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/modulo_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/multiply_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/next_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/oct_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/plus_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/replace_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/reverse_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/rindex_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/rjust_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/rstrip_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/scan_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/shared/
    MacRuby/branches/experimental/spec/frozen/core/string/shared/concat.rb
    MacRuby/branches/experimental/spec/frozen/core/string/shared/each.rb
    MacRuby/branches/experimental/spec/frozen/core/string/shared/equal_value.rb
    MacRuby/branches/experimental/spec/frozen/core/string/shared/length.rb
    MacRuby/branches/experimental/spec/frozen/core/string/shared/slice.rb
    MacRuby/branches/experimental/spec/frozen/core/string/shared/succ.rb
    MacRuby/branches/experimental/spec/frozen/core/string/shared/to_a.rb
    MacRuby/branches/experimental/spec/frozen/core/string/shared/to_s.rb
    MacRuby/branches/experimental/spec/frozen/core/string/shared/to_sym.rb
    MacRuby/branches/experimental/spec/frozen/core/string/size_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/slice_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/split_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/squeeze_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/strip_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/sub_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/succ_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/sum_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/swapcase_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/to_a_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/to_f_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/to_i_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/to_str_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/to_sym_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/tr_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/tr_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/unpack_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/upcase_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/string/upto_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/struct/
    MacRuby/branches/experimental/spec/frozen/core/struct/each_pair_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/struct/each_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/struct/element_reference_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/struct/element_set_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/struct/eql_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/struct/equal_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/struct/fixtures/
    MacRuby/branches/experimental/spec/frozen/core/struct/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/core/struct/hash_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/struct/initialize_copy_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/struct/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/struct/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/struct/length_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/struct/members_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/struct/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/struct/select_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/struct/shared/
    MacRuby/branches/experimental/spec/frozen/core/struct/shared/equal_value.rb
    MacRuby/branches/experimental/spec/frozen/core/struct/size_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/struct/struct_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/struct/to_a_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/struct/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/struct/values_at_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/struct/values_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/symbol/
    MacRuby/branches/experimental/spec/frozen/core/symbol/all_symbols_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/symbol/case_compare_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/symbol/equal_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/symbol/id2name_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/symbol/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/symbol/shared/
    MacRuby/branches/experimental/spec/frozen/core/symbol/shared/id2name.rb
    MacRuby/branches/experimental/spec/frozen/core/symbol/to_i_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/symbol/to_int_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/symbol/to_proc_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/symbol/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/symbol/to_sym_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/systemexit/
    MacRuby/branches/experimental/spec/frozen/core/systemexit/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/
    MacRuby/branches/experimental/spec/frozen/core/thread/abort_on_exception_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/alive_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/critical_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/current_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/element_reference_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/element_set_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/exit_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/fixtures/
    MacRuby/branches/experimental/spec/frozen/core/thread/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/fork_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/group_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/join_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/key_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/keys_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/kill_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/list_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/main_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/pass_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/priority_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/raise_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/run_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/safe_level_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/shared/
    MacRuby/branches/experimental/spec/frozen/core/thread/shared/exit.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/shared/wakeup.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/start_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/status_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/stop_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/terminate_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/value_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/thread/wakeup_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/threadgroup/
    MacRuby/branches/experimental/spec/frozen/core/threadgroup/add_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/threadgroup/enclose_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/threadgroup/enclosed_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/threadgroup/fixtures/
    MacRuby/branches/experimental/spec/frozen/core/threadgroup/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/core/threadgroup/list_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/
    MacRuby/branches/experimental/spec/frozen/core/time/_dump_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/_load_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/asctime_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/at_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/comparison_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/ctime_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/day_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/dst_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/dup_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/eql_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/fixtures/
    MacRuby/branches/experimental/spec/frozen/core/time/fixtures/methods.rb
    MacRuby/branches/experimental/spec/frozen/core/time/getgm_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/getlocal_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/getutc_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/gm_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/gmt_offset_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/gmt_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/gmtime_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/gmtoff_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/hash_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/hour_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/initialize_copy_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/isdst_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/local_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/localtime_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/mday_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/min_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/minus_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/mktime_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/mon_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/month_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/now_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/plus_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/sec_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/shared/
    MacRuby/branches/experimental/spec/frozen/core/time/shared/asctime.rb
    MacRuby/branches/experimental/spec/frozen/core/time/shared/day.rb
    MacRuby/branches/experimental/spec/frozen/core/time/shared/getgm.rb
    MacRuby/branches/experimental/spec/frozen/core/time/shared/gm.rb
    MacRuby/branches/experimental/spec/frozen/core/time/shared/gmt_offset.rb
    MacRuby/branches/experimental/spec/frozen/core/time/shared/gmtime.rb
    MacRuby/branches/experimental/spec/frozen/core/time/shared/isdst.rb
    MacRuby/branches/experimental/spec/frozen/core/time/shared/local.rb
    MacRuby/branches/experimental/spec/frozen/core/time/shared/month.rb
    MacRuby/branches/experimental/spec/frozen/core/time/shared/time_params.rb
    MacRuby/branches/experimental/spec/frozen/core/time/shared/to_i.rb
    MacRuby/branches/experimental/spec/frozen/core/time/strftime_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/succ_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/times_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/to_a_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/to_f_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/to_i_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/tv_sec_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/tv_usec_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/usec_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/utc_offset_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/utc_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/wday_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/yday_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/year_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/time/zone_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/true/
    MacRuby/branches/experimental/spec/frozen/core/true/and_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/true/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/true/or_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/true/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/true/xor_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/unboundmethod/
    MacRuby/branches/experimental/spec/frozen/core/unboundmethod/arity_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/unboundmethod/bind_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/unboundmethod/clone_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/unboundmethod/equal_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/unboundmethod/fixtures/
    MacRuby/branches/experimental/spec/frozen/core/unboundmethod/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/core/unboundmethod/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/unboundmethod/shared/
    MacRuby/branches/experimental/spec/frozen/core/unboundmethod/shared/to_s.rb
    MacRuby/branches/experimental/spec/frozen/core/unboundmethod/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/
    MacRuby/branches/experimental/spec/frozen/fixtures/class.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/class_variables.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/constants.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/load/
    MacRuby/branches/experimental/spec/frozen/fixtures/load/.gitignore
    MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec
    MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec.rooby
    MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_1.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_10.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_2.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_3.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_4.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_5.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_6.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_7.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_8.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_9.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_wrap.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_wrap2.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_wrap_2.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/matrix.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/require/
    MacRuby/branches/experimental/spec/frozen/fixtures/require/.gitignore
    MacRuby/branches/experimental/spec/frozen/fixtures/require/masked_require_spec_2.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/require/masked_require_spec_3.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec
    MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec.rooby
    MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec.rooby.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_1.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_10.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_2.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_3.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_4.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_6.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_7.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_8.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_9.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_raises.rb
    MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_recursive.rb
    MacRuby/branches/experimental/spec/frozen/language/
    MacRuby/branches/experimental/spec/frozen/language/README
    MacRuby/branches/experimental/spec/frozen/language/alias_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/and_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/array_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/block_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/break_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/case_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/catch_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/class_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/class_variable_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/constants_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/def_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/defined_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/eigenclass_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/else_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/encoding_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/ensure_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/execution_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/file_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/fixtures/
    MacRuby/branches/experimental/spec/frozen/language/fixtures/array.rb
    MacRuby/branches/experimental/spec/frozen/language/fixtures/block.rb
    MacRuby/branches/experimental/spec/frozen/language/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/language/fixtures/ensure.rb
    MacRuby/branches/experimental/spec/frozen/language/fixtures/predefined.rb
    MacRuby/branches/experimental/spec/frozen/language/fixtures/private.rb
    MacRuby/branches/experimental/spec/frozen/language/fixtures/super.rb
    MacRuby/branches/experimental/spec/frozen/language/fixtures/variables.rb
    MacRuby/branches/experimental/spec/frozen/language/fixtures/yield.rb
    MacRuby/branches/experimental/spec/frozen/language/for_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/hash_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/if_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/line_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/loop_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/magic_comment_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/metaclass_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/method_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/module_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/next_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/not_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/numbers_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/or_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/order_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/precedence_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/predefined_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/private_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/redo_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/regexp_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/rescue_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/retry_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/return_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/string_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/super_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/symbol_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/throw_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/undef_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/unless_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/until_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/variables_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/versions/
    MacRuby/branches/experimental/spec/frozen/language/versions/array_1.8.rb
    MacRuby/branches/experimental/spec/frozen/language/versions/array_1.9.rb
    MacRuby/branches/experimental/spec/frozen/language/versions/method_1.8.rb
    MacRuby/branches/experimental/spec/frozen/language/versions/method_1.9.rb
    MacRuby/branches/experimental/spec/frozen/language/versions/regexp_1.9.rb
    MacRuby/branches/experimental/spec/frozen/language/while_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/yield_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/
    MacRuby/branches/experimental/spec/frozen/library/abbrev/
    MacRuby/branches/experimental/spec/frozen/library/abbrev/abbrev_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/base64/
    MacRuby/branches/experimental/spec/frozen/library/base64/b64encode_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/base64/decode64_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/base64/decode_b_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/base64/encode64_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/abs_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/add_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/case_compare_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/ceil_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/coerce_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/comparison_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/div_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/divide_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/divmod_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/double_fig_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/eql_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/equal_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/exponent_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/finite_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/fix_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/fixtures/
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/floor_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/frac_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/gt_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/gte_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/induced_from_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/infinite_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/limit_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/lt_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/lte_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/minus_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/mode_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/modulo_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/mult_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/multiply_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/nan_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/nonzero_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/plus_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/power_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/precs_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/quo_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/remainder_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/shared/
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/shared/eql.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/shared/modulo.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/shared/mult.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/shared/power.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/shared/quo.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/shared/to_int.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/sign_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/split_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/sqrt_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/sub_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/to_f_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/to_i_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/to_int_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/truncate_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/uminus_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/uplus_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/ver_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/bigdecimal/zero_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/
    MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/
    MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/domain_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/expires_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/name_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/parse_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/path_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/secure_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/value_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/escapeElement_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/escapeHTML_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/escape_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/header_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/html3/
    MacRuby/branches/experimental/spec/frozen/library/cgi/html3/doctype_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/html3/element_init_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/html4/
    MacRuby/branches/experimental/spec/frozen/library/cgi/html4/doctype_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/html4/element_init_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/html4fr/
    MacRuby/branches/experimental/spec/frozen/library/cgi/html4fr/doctype_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/html4fr/element_init_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/html4tr/
    MacRuby/branches/experimental/spec/frozen/library/cgi/html4tr/doctype_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/html4tr/element_init_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/
    MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/a_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/base_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/blockquote_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/caption_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/checkbox_group_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/checkbox_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/file_field_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/fixtures/
    MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/fixtures/common.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/form_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/hidden_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/html_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/image_button_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/img_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/multipart_form_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/password_field_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/popup_menu_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/radio_button_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/radio_group_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/reset_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/scrolling_list_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/shared/
    MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/shared/popup_menu.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/submit_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/text_field_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/textarea_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/out_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/parse_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/pretty_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/print_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/accept_charset_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/accept_encoding_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/accept_language_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/accept_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/auth_type_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/cache_control_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/content_length_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/content_type_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/cookies_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/element_reference_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/from_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/gateway_interface_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/has_key_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/host_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/include_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/key_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/keys_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/multipart_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/negotiate_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/params_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/path_info_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/path_translated_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/pragma_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/query_string_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/raw_cookie2_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/raw_cookie_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/referer_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/remote_addr_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/remote_host_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/remote_ident_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/remote_user_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/request_method_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/script_name_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/server_name_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/server_port_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/server_protocol_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/server_software_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/shared/
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/shared/has_key.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/user_agent_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/element_reference_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/first_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/last_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/set_params_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/shared/
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/shared/first.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/shared/to_a.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/to_a_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/to_ary_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/rfc1123_date_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/tagmaker/
    MacRuby/branches/experimental/spec/frozen/library/cgi/tagmaker/nOE_element_def_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/tagmaker/nO_element_def_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/tagmaker/nn_element_def_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/unescapeElement_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/unescapeHTML_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/cgi/unescape_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/
    MacRuby/branches/experimental/spec/frozen/library/complex/Complex_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/abs2_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/abs_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/angle_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/arg_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/coerce_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/comparison_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/conj_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/conjugate_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/denominator_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/divide_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/equal_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/exponent_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/generic_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/hash_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/imag_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/image_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/
    MacRuby/branches/experimental/spec/frozen/library/complex/math/acos_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/acosh_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/asin_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/asinh_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/atan2_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/atan_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/atanh_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/cos_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/cosh_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/exp_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/fixtures/
    MacRuby/branches/experimental/spec/frozen/library/complex/math/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/log10_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/log_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/
    MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/acos.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/acosh.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/asin.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/asinh.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/atan.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/atan2.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/atanh.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/cos.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/cosh.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/exp.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/log.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/log10.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/sin.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/sinh.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/sqrt.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/tan.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/tanh.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/sin_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/sinh_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/sqrt_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/tan_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/math/tanh_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/minus_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/modulo_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/multiply_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/numerator_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/numeric/
    MacRuby/branches/experimental/spec/frozen/library/complex/numeric/angle_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/numeric/arg_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/numeric/conj_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/numeric/conjugate_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/numeric/im_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/numeric/imag_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/numeric/image_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/numeric/polar_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/numeric/real_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/numeric/shared/
    MacRuby/branches/experimental/spec/frozen/library/complex/numeric/shared/arg.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/numeric/shared/conjugate.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/numeric/shared/image.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/plus_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/polar_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/real_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/shared/
    MacRuby/branches/experimental/spec/frozen/library/complex/shared/arg.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/shared/conjugate.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/shared/image.rb
    MacRuby/branches/experimental/spec/frozen/library/complex/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/conditionvariable/
    MacRuby/branches/experimental/spec/frozen/library/conditionvariable/broadcast_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/conditionvariable/signal_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/conditionvariable/wait_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/
    MacRuby/branches/experimental/spec/frozen/library/csv/basicwriter/
    MacRuby/branches/experimental/spec/frozen/library/csv/basicwriter/close_on_terminate_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/basicwriter/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/basicwriter/terminate_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/cell/
    MacRuby/branches/experimental/spec/frozen/library/csv/cell/data_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/cell/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/fixtures/
    MacRuby/branches/experimental/spec/frozen/library/csv/fixtures/one_line.csv
    MacRuby/branches/experimental/spec/frozen/library/csv/foreach_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/generate_line_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/generate_row_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/generate_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/iobuf/
    MacRuby/branches/experimental/spec/frozen/library/csv/iobuf/close_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/iobuf/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/iobuf/read_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/iobuf/terminate_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/ioreader/
    MacRuby/branches/experimental/spec/frozen/library/csv/ioreader/close_on_terminate_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/ioreader/get_row_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/ioreader/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/ioreader/terminate_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/open_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/parse_line_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/parse_row_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/parse_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/read_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/reader/
    MacRuby/branches/experimental/spec/frozen/library/csv/reader/close_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/reader/create_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/reader/each_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/reader/get_row_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/reader/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/reader/parse_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/reader/shift_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/reader/terminate_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/readlines_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/
    MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/add_buf_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/buf_size_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/drop_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/element_reference_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/get_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/idx_is_eos_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/is_eos_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/read_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/rel_buf_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/terminate_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/stringreader/
    MacRuby/branches/experimental/spec/frozen/library/csv/stringreader/get_row_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/stringreader/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/writer/
    MacRuby/branches/experimental/spec/frozen/library/csv/writer/add_row_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/writer/append_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/writer/close_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/writer/create_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/writer/generate_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/writer/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/csv/writer/terminate_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/date/
    MacRuby/branches/experimental/spec/frozen/library/date/accessor_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/date/add_month_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/date/add_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/date/boat_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/date/civil_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/date/commercial_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/date/constants_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/date/conversions_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/date/downto_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/date/eql_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/date/gregorian_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/date/hash_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/date/infinity_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/date/julian_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/date/minus_month_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/date/minus_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/date/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/date/neww_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/date/ordinal_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/date/parse_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/date/relationship_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/date/shared/
    MacRuby/branches/experimental/spec/frozen/library/date/shared/civil.rb
    MacRuby/branches/experimental/spec/frozen/library/date/shared/commercial.rb
    MacRuby/branches/experimental/spec/frozen/library/date/shared/parse.rb
    MacRuby/branches/experimental/spec/frozen/library/date/shared/parse_eu.rb
    MacRuby/branches/experimental/spec/frozen/library/date/shared/parse_us.rb
    MacRuby/branches/experimental/spec/frozen/library/date/step_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/date/strftime_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/date/strptime_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/date/upto_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/
    MacRuby/branches/experimental/spec/frozen/library/digest/md5/
    MacRuby/branches/experimental/spec/frozen/library/digest/md5/append_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/md5/block_length_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/md5/digest_bang_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/md5/digest_length_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/md5/digest_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/md5/equal_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/md5/hexdigest_bang_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/md5/hexdigest_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/md5/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/md5/length_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/md5/reset_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/md5/shared/
    MacRuby/branches/experimental/spec/frozen/library/digest/md5/shared/constants.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/md5/shared/length.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/md5/shared/sample.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/md5/shared/update.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/md5/size_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/md5/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/md5/update_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha1/
    MacRuby/branches/experimental/spec/frozen/library/digest/sha1/digest_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha1/shared/
    MacRuby/branches/experimental/spec/frozen/library/digest/sha1/shared/constants.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha256/
    MacRuby/branches/experimental/spec/frozen/library/digest/sha256/append_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha256/block_length_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha256/digest_bang_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha256/digest_length_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha256/digest_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha256/equal_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha256/hexdigest_bang_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha256/hexdigest_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha256/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha256/length_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha256/reset_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha256/shared/
    MacRuby/branches/experimental/spec/frozen/library/digest/sha256/shared/constants.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha256/shared/length.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha256/shared/update.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha256/size_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha256/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha256/update_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha384/
    MacRuby/branches/experimental/spec/frozen/library/digest/sha384/append_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha384/block_length_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha384/digest_bang_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha384/digest_length_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha384/digest_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha384/equal_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha384/hexdigest_bang_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha384/hexdigest_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha384/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha384/length_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha384/reset_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha384/shared/
    MacRuby/branches/experimental/spec/frozen/library/digest/sha384/shared/constants.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha384/shared/length.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha384/shared/update.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha384/size_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha384/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha384/update_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha512/
    MacRuby/branches/experimental/spec/frozen/library/digest/sha512/append_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha512/block_length_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha512/digest_bang_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha512/digest_length_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha512/digest_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha512/equal_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha512/hexdigest_bang_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha512/hexdigest_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha512/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha512/length_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha512/reset_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha512/shared/
    MacRuby/branches/experimental/spec/frozen/library/digest/sha512/shared/constants.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha512/shared/length.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha512/shared/update.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha512/size_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha512/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/digest/sha512/update_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/
    MacRuby/branches/experimental/spec/frozen/library/drb/config_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/current_server_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/
    MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/__drbref_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/__drburi_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/_dump_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/_load_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/eql_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/equal_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/hash_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/method_missing_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/new_with_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/new_with_uri_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/prepare_backtrace_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/pretty_print_cycle_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/pretty_print_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/respond_to_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/with_friend_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/fetch_server_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/fixtures/
    MacRuby/branches/experimental/spec/frozen/library/drb/fixtures/test_server.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/front_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/here_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/install_acl_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/install_id_conv_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/primary_server_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/regist_server_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/remove_server_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/start_service_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/stop_service_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/thread_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/to_id_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/to_obj_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/drb/uri_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/enumerator/
    MacRuby/branches/experimental/spec/frozen/library/enumerator/each_cons_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/enumerator/each_slice_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/enumerator/enum_cons_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/enumerator/enum_slice_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/enumerator/enum_with_index_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/enumerator/fixtures/
    MacRuby/branches/experimental/spec/frozen/library/enumerator/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/library/enumerator/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/erb/
    MacRuby/branches/experimental/spec/frozen/library/erb/def_class_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/erb/def_method_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/erb/def_module_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/erb/defmethod/
    MacRuby/branches/experimental/spec/frozen/library/erb/defmethod/def_erb_method_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/erb/filename_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/erb/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/erb/result_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/erb/run_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/erb/src_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/erb/util/
    MacRuby/branches/experimental/spec/frozen/library/erb/util/h_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/erb/util/html_escape_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/erb/util/shared/
    MacRuby/branches/experimental/spec/frozen/library/erb/util/shared/html_escape.rb
    MacRuby/branches/experimental/spec/frozen/library/erb/util/shared/url_encode.rb
    MacRuby/branches/experimental/spec/frozen/library/erb/util/u_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/erb/util/url_encode_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/etc/
    MacRuby/branches/experimental/spec/frozen/library/etc/endgrent_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/etc/endpwent_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/etc/getgrent_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/etc/getgrgid_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/etc/getgrnam_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/etc/getlogin_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/etc/getpwent_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/etc/getpwnam_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/etc/getpwuid_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/etc/group_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/etc/passwd_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/etc/setgrent_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/etc/setpwent_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/etc/shared/
    MacRuby/branches/experimental/spec/frozen/library/etc/shared/windows.rb
    MacRuby/branches/experimental/spec/frozen/library/ftools/
    MacRuby/branches/experimental/spec/frozen/library/ftools/catname_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/ftools/chmod_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/ftools/compare_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/ftools/copy_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/ftools/install_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/ftools/makedirs_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/ftools/move_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/ftools/safe_unlink_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/ftools/syscopy_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/generator/
    MacRuby/branches/experimental/spec/frozen/library/generator/each_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/generator/fixtures/
    MacRuby/branches/experimental/spec/frozen/library/generator/fixtures/common.rb
    MacRuby/branches/experimental/spec/frozen/library/generator/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/generator/next_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/generator/rewind_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/getoptlong/
    MacRuby/branches/experimental/spec/frozen/library/getoptlong/each_option_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/getoptlong/each_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/getoptlong/error_message_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/getoptlong/get_option_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/getoptlong/get_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/getoptlong/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/getoptlong/ordering_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/getoptlong/set_options_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/getoptlong/shared/
    MacRuby/branches/experimental/spec/frozen/library/getoptlong/shared/each.rb
    MacRuby/branches/experimental/spec/frozen/library/getoptlong/shared/get.rb
    MacRuby/branches/experimental/spec/frozen/library/getoptlong/terminate_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/getoptlong/terminated_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/iconv/
    MacRuby/branches/experimental/spec/frozen/library/iconv/charset_map_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/iconv/close_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/iconv/conv_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/iconv/failure/
    MacRuby/branches/experimental/spec/frozen/library/iconv/failure/failed_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/iconv/failure/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/iconv/failure/success_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/iconv/failure_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/iconv/fixtures/
    MacRuby/branches/experimental/spec/frozen/library/iconv/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/library/iconv/iconv_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/iconv/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/iconv/open_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/iconv/shared/
    MacRuby/branches/experimental/spec/frozen/library/iconv/shared/initialize_exceptions.rb
    MacRuby/branches/experimental/spec/frozen/library/iconv/shared/new.rb
    MacRuby/branches/experimental/spec/frozen/library/ipaddr/
    MacRuby/branches/experimental/spec/frozen/library/ipaddr/hton_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/ipaddr/ipv4_conversion_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/ipaddr/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/ipaddr/operator_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/ipaddr/reverse_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/ipaddr/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/logger/
    MacRuby/branches/experimental/spec/frozen/library/logger/application/
    MacRuby/branches/experimental/spec/frozen/library/logger/application/level_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/logger/application/log_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/logger/application/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/logger/application/set_log_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/logger/application/start_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/logger/device/
    MacRuby/branches/experimental/spec/frozen/library/logger/device/close_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/logger/device/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/logger/device/write_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/logger/fixtures/
    MacRuby/branches/experimental/spec/frozen/library/logger/fixtures/common.rb
    MacRuby/branches/experimental/spec/frozen/library/logger/logger/
    MacRuby/branches/experimental/spec/frozen/library/logger/logger/add_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/logger/logger/close_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/logger/logger/datetime_format_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/logger/logger/debug_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/logger/logger/error_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/logger/logger/fatal_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/logger/logger/info_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/logger/logger/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/logger/logger/unknown_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/logger/logger/warn_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/logger/severity_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/mathn/
    MacRuby/branches/experimental/spec/frozen/library/mathn/integer/
    MacRuby/branches/experimental/spec/frozen/library/mathn/integer/from_prime_division_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/mathn/integer/gcd2_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/mathn/integer/prime_division_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/mathn/math/
    MacRuby/branches/experimental/spec/frozen/library/mathn/math/fixtures/
    MacRuby/branches/experimental/spec/frozen/library/mathn/math/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/library/mathn/math/rsqrt_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/mathn/math/shared/
    MacRuby/branches/experimental/spec/frozen/library/mathn/math/shared/rsqrt.rb
    MacRuby/branches/experimental/spec/frozen/library/mathn/math/shared/sqrt.rb
    MacRuby/branches/experimental/spec/frozen/library/mathn/math/sqrt_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/mathn/prime/
    MacRuby/branches/experimental/spec/frozen/library/mathn/prime/each_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/mathn/prime/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/mathn/prime/next_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/mathn/rational/
    MacRuby/branches/experimental/spec/frozen/library/mathn/rational/exponent_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/mathn/rational/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/mathn/rational/power2_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/
    MacRuby/branches/experimental/spec/frozen/library/matrix/Fail_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/I_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/Raise_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/clone_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/coerce_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/collect_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/column_size_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/column_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/column_vector_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/column_vectors_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/columns_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/compare_by_row_vectors_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/det_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/determinant_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/diagonal_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/divide_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/element_reference_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/eql_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/equal_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/exponent_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/hash_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/identity_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/included_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/init_rows_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/inv_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/inverse_from_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/inverse_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/map_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/minor_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/minus_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/multiply_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/plus_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/rank_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/regular_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/row_size_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/row_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/row_vector_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/row_vectors_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/rows_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/
    MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/Fail_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/Raise_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/divide_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/exponent_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/included_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/minus_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/multiply_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/plus_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/scalar_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/shared/
    MacRuby/branches/experimental/spec/frozen/library/matrix/shared/collect.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/shared/identity.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/shared/transpose.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/singular_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/square_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/t_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/to_a_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/tr_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/trace_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/transpose_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/unit_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/vector/
    MacRuby/branches/experimental/spec/frozen/library/matrix/vector/eql_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/matrix/zero_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/mutex/
    MacRuby/branches/experimental/spec/frozen/library/mutex/lock_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/mutex/locked_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/mutex/synchronize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/mutex/try_lock_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/mutex/unlock_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/
    MacRuby/branches/experimental/spec/frozen/library/net/FTPError_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/FTPPermError_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/FTPProtoError_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/FTPReplyError_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/FTPTempError_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/abort_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/acct_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/binary_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/chdir_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/close_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/closed_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/connect_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/debug_mode_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/delete_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/dir_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/fixtures/
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/fixtures/putbinaryfile
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/fixtures/puttextfile
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/fixtures/server.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/get_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/getbinaryfile_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/getdir_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/gettextfile_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/help_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/last_response_code_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/last_response_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/lastresp_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/list_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/login_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/ls_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/mdtm_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/mkdir_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/mtime_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/nlst_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/noop_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/open_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/passive_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/put_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/putbinaryfile_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/puttextfile_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/pwd_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/quit_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/rename_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/resume_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/retrbinary_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/retrlines_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/return_code_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/rmdir_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/sendcmd_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/set_socket_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/getbinaryfile.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/gettextfile.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/last_response_code.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/list.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/putbinaryfile.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/puttextfile.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/pwd.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/site_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/size_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/status_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/storbinary_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/storlines_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/system_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/voidcmd_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/ftp/welcome_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/
    MacRuby/branches/experimental/spec/frozen/library/net/http/HTTPBadResponse_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/HTTPError_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/HTTPFatalError_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/HTTPHeaderSyntaxError_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/HTTPRetriableError_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/HTTPServerException_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/Proxy_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/active_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/address_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/close_on_empty_response_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/copy_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/default_port_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/delete_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/finish_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/fixtures/
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/fixtures/http_server.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/get2_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/get_print_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/get_response_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/get_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/head2_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/head_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/http_default_port_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/https_default_port_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/is_version_1_1_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/is_version_1_2_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/lock_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/mkcol_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/move_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/newobj_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/open_timeout_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/options_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/port_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/post2_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/post_form_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/post_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/propfind_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/proppatch_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/proxy_address_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/proxy_class_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/proxy_pass_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/proxy_port_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/proxy_user_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/put2_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/put_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/read_timeout_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/request_get_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/request_head_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/request_post_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/request_put_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/request_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/request_types_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/send_request_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/set_debug_output_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/request_get.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/request_head.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/request_post.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/request_put.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/started.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/version_1_1.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/version_1_2.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/socket_type_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/start_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/started_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/trace_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/unlock_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/use_ssl_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/version_1_1_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/http/version_1_2_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpexceptions/
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpexceptions/fixtures/
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpexceptions/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpexceptions/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpexceptions/response_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/body_exist_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/body_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/body_stream_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/exec_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/method_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/path_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/request_body_permitted_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/response_body_permitted_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/set_body_internal_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/add_field_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/basic_auth_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/canonical_each_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/chunked_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/content_length_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/content_range_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/content_type_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/delete_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_capitalized_name_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_capitalized_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_header_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_key_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_name_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/element_reference_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/element_set_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/fetch_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/fixtures/
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/form_data_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/get_fields_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/initialize_http_header_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/key_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/length_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/main_type_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/proxy_basic_auth_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/range_length_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/range_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/set_content_type_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/set_form_data_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/set_range_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/each_capitalized.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/each_header.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/each_name.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/set_content_type.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/set_form_data.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/set_range.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/size.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/size_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/sub_type_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/to_hash_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/type_params_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httprequest/
    MacRuby/branches/experimental/spec/frozen/library/net/http/httprequest/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/body_permitted_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/body_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/code_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/code_type_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/entity_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/error_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/error_type_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/exception_type_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/header_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/http_version_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/message_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/msg_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/read_body_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/read_header_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/read_new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/reading_body_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/response_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/shared/
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/shared/body.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/to_ary_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/value_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/telnet/
    MacRuby/branches/experimental/spec/frozen/library/net/telnet/binmode_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/telnet/cmd_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/telnet/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/telnet/login_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/telnet/preprocess_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/telnet/print_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/telnet/puts_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/telnet/sock_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/telnet/telnetmode_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/telnet/waitfor_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/net/telnet/write_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/observer/
    MacRuby/branches/experimental/spec/frozen/library/observer/add_observer_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/observer/count_observers_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/observer/delete_observer_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/observer/delete_observers_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/observer/fixtures/
    MacRuby/branches/experimental/spec/frozen/library/observer/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/library/observer/notify_observers_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/openssl/
    MacRuby/branches/experimental/spec/frozen/library/openssl/cipher_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/openssl/hmac/
    MacRuby/branches/experimental/spec/frozen/library/openssl/hmac/digest_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/openssl/hmac/hexdigest_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/openssl/random/
    MacRuby/branches/experimental/spec/frozen/library/openssl/random/pseudo_bytes_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/openssl/random/random_bytes_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/openssl/random/shared/
    MacRuby/branches/experimental/spec/frozen/library/openssl/random/shared/random_bytes.rb
    MacRuby/branches/experimental/spec/frozen/library/openssl/shared/
    MacRuby/branches/experimental/spec/frozen/library/openssl/shared/constants.rb
    MacRuby/branches/experimental/spec/frozen/library/openstruct/
    MacRuby/branches/experimental/spec/frozen/library/openstruct/delete_field_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/openstruct/equal_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/openstruct/fixtures/
    MacRuby/branches/experimental/spec/frozen/library/openstruct/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/library/openstruct/frozen_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/openstruct/initialize_copy_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/openstruct/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/openstruct/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/openstruct/marshal_dump_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/openstruct/marshal_load_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/openstruct/method_missing_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/openstruct/new_ostruct_member_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/openstruct/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/openstruct/shared/
    MacRuby/branches/experimental/spec/frozen/library/openstruct/shared/inspect.rb
    MacRuby/branches/experimental/spec/frozen/library/openstruct/table_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/openstruct/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/parsedate/
    MacRuby/branches/experimental/spec/frozen/library/parsedate/parsedate.rb
    MacRuby/branches/experimental/spec/frozen/library/pathname/
    MacRuby/branches/experimental/spec/frozen/library/pathname/absolute_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/pathname/equal_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/pathname/hash_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/pathname/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/pathname/parent_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/pathname/relative_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/pathname/root_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/pathname/sub_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/ping/
    MacRuby/branches/experimental/spec/frozen/library/ping/pingecho_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/prime/
    MacRuby/branches/experimental/spec/frozen/library/prime/each_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/prime/instance_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/prime/int_from_prime_division_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/prime/integer/
    MacRuby/branches/experimental/spec/frozen/library/prime/integer/each_prime_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/prime/integer/from_prime_division_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/prime/integer/prime_division_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/prime/integer/prime_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/prime/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/prime/next_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/prime/prime_division_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/prime/prime_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/prime/shared/
    MacRuby/branches/experimental/spec/frozen/library/prime/shared/each.rb
    MacRuby/branches/experimental/spec/frozen/library/prime/shared/next.rb
    MacRuby/branches/experimental/spec/frozen/library/prime/succ_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/queue/
    MacRuby/branches/experimental/spec/frozen/library/queue/append_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/queue/clear_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/queue/deq_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/queue/empty_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/queue/enq_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/queue/length_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/queue/num_waiting_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/queue/pop_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/queue/push_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/queue/shared/
    MacRuby/branches/experimental/spec/frozen/library/queue/shared/deque.rb
    MacRuby/branches/experimental/spec/frozen/library/queue/shared/enque.rb
    MacRuby/branches/experimental/spec/frozen/library/queue/shared/length.rb
    MacRuby/branches/experimental/spec/frozen/library/queue/shift_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/queue/size_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rational/
    MacRuby/branches/experimental/spec/frozen/library/rational/Rational_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rational/abs_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rational/coerce_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rational/comparison_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rational/denominator_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rational/divide_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rational/divmod_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rational/equal_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rational/exponent_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rational/hash_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rational/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rational/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rational/minus_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rational/modulo_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rational/multiply_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rational/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rational/numerator_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rational/plus_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rational/reduce_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rational/to_f_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rational/to_i_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rational/to_r_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rational/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/readline/
    MacRuby/branches/experimental/spec/frozen/library/readline/basic_quote_characters_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/readline/basic_word_break_characters_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/readline/completer_quote_characters_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/readline/completer_word_break_characters_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/readline/completion_append_character_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/readline/completion_case_fold_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/readline/completion_proc_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/readline/constants_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/readline/emacs_editing_mode_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/readline/filename_quote_characters_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/readline/history/
    MacRuby/branches/experimental/spec/frozen/library/readline/history/append_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/readline/history/delete_at_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/readline/history/each_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/readline/history/element_reference_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/readline/history/element_set_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/readline/history/empty_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/readline/history/history_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/readline/history/length_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/readline/history/pop_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/readline/history/push_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/readline/history/shared/
    MacRuby/branches/experimental/spec/frozen/library/readline/history/shared/size.rb
    MacRuby/branches/experimental/spec/frozen/library/readline/history/shift_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/readline/history/size_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/readline/history/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/readline/readline_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/readline/vi_editing_mode_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/resolv/
    MacRuby/branches/experimental/spec/frozen/library/resolv/get_address_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/resolv/get_addresses_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/resolv/get_name_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/resolv/get_names_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/
    MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/
    MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/clone_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/element_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/equal_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/hash_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/namespace_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/node_type_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/prefix_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/remove_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/to_string_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/value_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/write_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/xpath_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/
    MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/add_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/append_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/delete_all_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/delete_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/each_attribute_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/each_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/element_reference_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/element_set_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/get_attribute_ns_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/get_attribute_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/length_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/namespaces_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/prefixes_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/shared/
    MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/shared/add.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/shared/length.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/size_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/to_a_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/cdata/
    MacRuby/branches/experimental/spec/frozen/library/rexml/cdata/clone_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/cdata/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/cdata/shared/
    MacRuby/branches/experimental/spec/frozen/library/rexml/cdata/shared/to_s.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/cdata/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/cdata/value_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/document/
    MacRuby/branches/experimental/spec/frozen/library/rexml/document/add_element_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/document/add_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/document/clone_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/document/doctype_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/document/encoding_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/document/expanded_name_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/document/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/document/node_type_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/document/root_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/document/stand_alone_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/document/version_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/document/write_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/document/xml_decl_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/add_attribute_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/add_attributes_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/add_element_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/add_namespace_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/add_text_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/attribute_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/attributes_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/cdatas_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/clone_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/comments_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/delete_attribute_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/delete_element_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/delete_namespace_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/document_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/each_element_with_attribute_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/each_element_with_text_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/get_text_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/has_attributes_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/has_elements_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/has_text_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/instructions_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/namespace_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/namespaces_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/next_element_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/node_type_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/prefixes_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/previous_element_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/raw_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/root_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/text_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/texts_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/element/whitespace_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/node/
    MacRuby/branches/experimental/spec/frozen/library/rexml/node/each_recursive_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/node/find_first_recursive_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/node/index_in_parent_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/node/next_sibling_node_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/node/parent_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/node/previous_sibling_node_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/shared/
    MacRuby/branches/experimental/spec/frozen/library/rexml/shared/each_element.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/shared/elements_to_a.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/text/
    MacRuby/branches/experimental/spec/frozen/library/rexml/text/append_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/text/clone_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/text/comparison_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/text/empty_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/text/indent_text_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/text/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/text/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/text/node_type_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/text/normalize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/text/read_with_substitution_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/text/to_s_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/text/unnormalize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/text/value_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/text/wrap_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/rexml/text/write_with_substitution_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/scanf/
    MacRuby/branches/experimental/spec/frozen/library/scanf/io/
    MacRuby/branches/experimental/spec/frozen/library/scanf/io/block_scanf_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/scanf/io/fixtures/
    MacRuby/branches/experimental/spec/frozen/library/scanf/io/fixtures/date.txt
    MacRuby/branches/experimental/spec/frozen/library/scanf/io/fixtures/helloworld.txt
    MacRuby/branches/experimental/spec/frozen/library/scanf/io/scanf_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/scanf/io/shared/
    MacRuby/branches/experimental/spec/frozen/library/scanf/io/shared/block_scanf.rb
    MacRuby/branches/experimental/spec/frozen/library/scanf/string/
    MacRuby/branches/experimental/spec/frozen/library/scanf/string/block_scanf_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/scanf/string/scanf_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/scanf/string/shared/
    MacRuby/branches/experimental/spec/frozen/library/scanf/string/shared/block_scanf.rb
    MacRuby/branches/experimental/spec/frozen/library/securerandom/
    MacRuby/branches/experimental/spec/frozen/library/securerandom/base64_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/securerandom/hex_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/securerandom/random_bytes_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/securerandom/random_number_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/
    MacRuby/branches/experimental/spec/frozen/library/set/add_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/append_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/classify_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/clear_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/collect_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/constructor_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/delete_if_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/delete_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/difference_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/divide_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/each_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/empty_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/enumerable/
    MacRuby/branches/experimental/spec/frozen/library/set/enumerable/to_set_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/eql_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/equal_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/exclusion_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/flatten_merge_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/flatten_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/hash_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/include_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/initialize_copy_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/intersection_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/length_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/map_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/member_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/merge_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/minus_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/plus_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/pretty_print_cycle_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/pretty_print_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/proper_subset_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/proper_superset_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/reject_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/replace_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/shared/
    MacRuby/branches/experimental/spec/frozen/library/set/shared/add.rb
    MacRuby/branches/experimental/spec/frozen/library/set/shared/collect.rb
    MacRuby/branches/experimental/spec/frozen/library/set/shared/difference.rb
    MacRuby/branches/experimental/spec/frozen/library/set/shared/include.rb
    MacRuby/branches/experimental/spec/frozen/library/set/shared/intersection.rb
    MacRuby/branches/experimental/spec/frozen/library/set/shared/length.rb
    MacRuby/branches/experimental/spec/frozen/library/set/shared/union.rb
    MacRuby/branches/experimental/spec/frozen/library/set/size_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/add_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/append_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/classify_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/clear_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/collect_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/constructor_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/delete_if_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/delete_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/difference_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/divide_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/each_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/empty_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/eql_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/equal_value_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/exclusion_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/flatten_merge_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/flatten_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/hash_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/include_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/initialize_copy_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/intersection_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/length_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/map_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/member_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/merge_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/minus_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/plus_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/pretty_print_cycle_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/pretty_print_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/proper_subset_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/proper_superset_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/reject_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/replace_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/add.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/collect.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/difference.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/include.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/intersection.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/length.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/union.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/size_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/subset_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/subtract_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/superset_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/to_a_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/sortedset/union_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/subset_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/subtract_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/superset_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/to_a_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/set/union_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/shellwords/
    MacRuby/branches/experimental/spec/frozen/library/shellwords/shellwords_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/singleton/
    MacRuby/branches/experimental/spec/frozen/library/singleton/allocate_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/singleton/clone_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/singleton/dump_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/singleton/dup_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/singleton/fixtures/
    MacRuby/branches/experimental/spec/frozen/library/singleton/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/library/singleton/instance_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/singleton/instantiate_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/singleton/load_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/singleton/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/
    MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/
    MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/close_read_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/close_write_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/do_not_reverse_lookup_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/for_fd_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/getpeername_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/getsockname_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/getsockopt_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/recv_nonblock_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/recv_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/send_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/setsockopt_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/shutdown_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/constants/
    MacRuby/branches/experimental/spec/frozen/library/socket/constants/constants_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/fixtures/
    MacRuby/branches/experimental/spec/frozen/library/socket/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/ipsocket/
    MacRuby/branches/experimental/spec/frozen/library/socket/ipsocket/addr_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/ipsocket/getaddress_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/ipsocket/peeraddr_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/ipsocket/recvfrom_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/shared/
    MacRuby/branches/experimental/spec/frozen/library/socket/shared/pack_sockaddr.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/shared/recv_nonblock.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/shared/socketpair.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/socket/
    MacRuby/branches/experimental/spec/frozen/library/socket/socket/accept_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/socket/bind_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/socket/connect_nonblock_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/socket/connect_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/socket/for_fd_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/socket/getaddrinfo_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/socket/gethostbyaddr_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/socket/gethostbyname_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/socket/gethostname_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/socket/getnameinfo_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/socket/getservbyname_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/socket/listen_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/socket/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/socket/pack_sockaddr_in_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/socket/pack_sockaddr_un_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/socket/pair_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/socket/recvfrom_nonblock_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/socket/recvfrom_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/socket/sockaddr_in_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/socket/sockaddr_un_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/socket/socket_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/socket/socketpair_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/socket/sysaccept_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/socket/unpack_sockaddr_in_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/socket/unpack_sockaddr_un_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/
    MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/accept_nonblock_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/accept_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/listen_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/output_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/readpartial_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/sysaccept_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/tcpsocket/
    MacRuby/branches/experimental/spec/frozen/library/socket/tcpsocket/gethostbyname_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/tcpsocket/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/tcpsocket/open_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/tcpsocket/shared/
    MacRuby/branches/experimental/spec/frozen/library/socket/tcpsocket/shared/new.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/udpsocket/
    MacRuby/branches/experimental/spec/frozen/library/socket/udpsocket/bind_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/udpsocket/connect_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/udpsocket/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/udpsocket/open_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/udpsocket/recvfrom_nonblock_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/udpsocket/send_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/unixserver/
    MacRuby/branches/experimental/spec/frozen/library/socket/unixserver/accept_nonblock_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/unixserver/accept_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/unixserver/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/unixserver/open_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/unixserver/shared/
    MacRuby/branches/experimental/spec/frozen/library/socket/unixserver/shared/new.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/
    MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/addr_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/open_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/pair_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/path_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/peeraddr_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/recvfrom_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/shared/
    MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/shared/new.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/
    MacRuby/branches/experimental/spec/frozen/library/stringio/append_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/binmode_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/bytes_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/chars_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/close_read_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/close_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/close_write_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/closed_read_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/closed_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/closed_write_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/each_byte_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/each_char_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/each_line_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/each_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/eof_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/fcntl_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/fileno_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/fixtures/
    MacRuby/branches/experimental/spec/frozen/library/stringio/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/flush_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/fsync_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/getbyte_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/getc_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/gets_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/initialize_copy_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/isatty_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/length_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/lineno_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/lines_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/open_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/path_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/pid_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/pos_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/print_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/printf_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/putc_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/puts_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/read_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/readbyte_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/readchar_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/readline_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/readlines_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/reopen_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/rewind_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/seek_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/shared/
    MacRuby/branches/experimental/spec/frozen/library/stringio/shared/each.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/shared/each_byte.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/shared/each_char.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/shared/eof.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/shared/getc.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/shared/isatty.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/shared/length.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/shared/read.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/shared/readchar.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/shared/tell.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/shared/write.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/size_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/string_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/stringio_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/sync_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/sysread_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/syswrite_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/tell_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/truncate_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/tty_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/ungetc_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringio/write_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/append_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/beginning_of_line_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/bol_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/check_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/check_until_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/clear_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/concat_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/dup_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/element_reference_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/empty_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/eos_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/exist_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/get_byte_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/getbyte_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/getch_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/initialize_copy_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/match_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/matched_size_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/matched_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/matchedsize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/must_C_version_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/peek_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/peep_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/pointer_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/pos_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/post_match_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/pre_match_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/reset_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/rest_size_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/rest_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/restsize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/scan_full_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/scan_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/scan_until_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/search_full_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/bol.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/concat.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/eos.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/get_byte.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/matched_size.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/peek.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/pos.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/rest_size.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/terminate.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/skip_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/skip_until_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/string_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/terminate_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/stringscanner/unscan_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/syslog/
    MacRuby/branches/experimental/spec/frozen/library/syslog/alert_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/syslog/close_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/syslog/constants_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/syslog/crit_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/syslog/debug_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/syslog/emerg_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/syslog/err_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/syslog/facility_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/syslog/ident_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/syslog/info_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/syslog/inspect_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/syslog/instance_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/syslog/log_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/syslog/mask_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/syslog/notice_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/syslog/open_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/syslog/opened_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/syslog/options_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/syslog/reopen_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/syslog/shared/
    MacRuby/branches/experimental/spec/frozen/library/syslog/shared/log.rb
    MacRuby/branches/experimental/spec/frozen/library/syslog/shared/reopen.rb
    MacRuby/branches/experimental/spec/frozen/library/syslog/warning_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/tempfile/
    MacRuby/branches/experimental/spec/frozen/library/tempfile/_close_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/tempfile/callback_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/tempfile/close_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/tempfile/delete_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/tempfile/initialize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/tempfile/length_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/tempfile/open_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/tempfile/path_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/tempfile/shared/
    MacRuby/branches/experimental/spec/frozen/library/tempfile/shared/length.rb
    MacRuby/branches/experimental/spec/frozen/library/tempfile/shared/unlink.rb
    MacRuby/branches/experimental/spec/frozen/library/tempfile/size_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/tempfile/unlink_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/time/
    MacRuby/branches/experimental/spec/frozen/library/time/httpdate_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/time/iso8601_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/time/rfc2822_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/time/rfc822_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/time/shared/
    MacRuby/branches/experimental/spec/frozen/library/time/shared/rfc2822.rb
    MacRuby/branches/experimental/spec/frozen/library/time/shared/xmlschema.rb
    MacRuby/branches/experimental/spec/frozen/library/time/xmlschema_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/timeout/
    MacRuby/branches/experimental/spec/frozen/library/timeout/timeout_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/tmpdir/
    MacRuby/branches/experimental/spec/frozen/library/tmpdir/dir/
    MacRuby/branches/experimental/spec/frozen/library/tmpdir/dir/mktmpdir_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/tmpdir/dir/tmpdir_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/uri/
    MacRuby/branches/experimental/spec/frozen/library/uri/equality_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/uri/extract_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/uri/fixtures/
    MacRuby/branches/experimental/spec/frozen/library/uri/fixtures/classes.rb
    MacRuby/branches/experimental/spec/frozen/library/uri/http/
    MacRuby/branches/experimental/spec/frozen/library/uri/http/request_uri_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/uri/join_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/uri/mailto/
    MacRuby/branches/experimental/spec/frozen/library/uri/mailto/build_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/uri/normalize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/uri/parse_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/uri/plus_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/uri/regexp_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/uri/route_to.rb
    MacRuby/branches/experimental/spec/frozen/library/uri/select_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/uri/set_component_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/uri/uri_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/
    MacRuby/branches/experimental/spec/frozen/library/yaml/add_builtin_type_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/add_domain_type_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/add_private_type_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/add_ruby_type_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/detect_implicit_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/dump_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/dump_stream_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/each_document_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/each_node_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/emitter_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/fixtures/
    MacRuby/branches/experimental/spec/frozen/library/yaml/fixtures/common.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/fixtures/example_class.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/fixtures/strings.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/fixtures/test_yaml.yml
    MacRuby/branches/experimental/spec/frozen/library/yaml/generic_parser_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/load_documents_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/load_file_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/load_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/load_stream_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/object_maker_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/parse_documents_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/parse_file_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/parse_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/parser_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/quick_emit_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/read_type_class_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/shared/
    MacRuby/branches/experimental/spec/frozen/library/yaml/shared/each_document.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/tag_class_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/tagged_classes_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/tagurize_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/to_yaml_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/transfer_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/yaml/try_implicit_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/
    MacRuby/branches/experimental/spec/frozen/library/zlib/adler32_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/crc32_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/crc_table_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/
    MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/append_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/deflate_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/flush_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/initialize_copy_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/params_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/set_dictionary_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/close_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/closed_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/comment_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/crc_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/finish_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/level_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/mtime_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/orig_name_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/os_code_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/sync_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/to_io_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/wrap_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/each_byte_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/each_line_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/each_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/eof_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/getc_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/gets_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/lineno_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/open_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/pos_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/read_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/readchar_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/readline_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/readlines_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/rewind_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/tell_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/ungetc_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/unused_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/append_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/comment_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/flush_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/mtime_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/open_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/orig_name_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/pos_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/print_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/printf_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/putc_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/puts_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/tell_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/write_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/inflate/
    MacRuby/branches/experimental/spec/frozen/library/zlib/inflate/append_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/inflate/inflate_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/inflate/new_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/inflate/set_dictionary_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/inflate/sync_point_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/inflate/sync_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/zlib_version_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/
    MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/adler_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/avail_in_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/avail_out_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/close_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/closed_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/data_type_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/end_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/ended_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/finish_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/finished_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/flush_next_in_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/flush_next_out_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/reset_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/stream_end_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/total_in_spec.rb
    MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/total_out_spec.rb
    MacRuby/branches/experimental/spec/frozen/nbproject/
    MacRuby/branches/experimental/spec/frozen/nbproject/project.properties
    MacRuby/branches/experimental/spec/frozen/nbproject/project.xml
    MacRuby/branches/experimental/spec/frozen/ruby.1.8.mspec
    MacRuby/branches/experimental/spec/frozen/ruby.1.9.mspec
    MacRuby/branches/experimental/spec/frozen/shared/
    MacRuby/branches/experimental/spec/frozen/shared/file/
    MacRuby/branches/experimental/spec/frozen/shared/file/blockdev.rb
    MacRuby/branches/experimental/spec/frozen/shared/file/chardev.rb
    MacRuby/branches/experimental/spec/frozen/shared/file/directory.rb
    MacRuby/branches/experimental/spec/frozen/shared/file/executable.rb
    MacRuby/branches/experimental/spec/frozen/shared/file/executable_real.rb
    MacRuby/branches/experimental/spec/frozen/shared/file/exist.rb
    MacRuby/branches/experimental/spec/frozen/shared/file/file.rb
    MacRuby/branches/experimental/spec/frozen/shared/file/grpowned.rb
    MacRuby/branches/experimental/spec/frozen/shared/file/identical.rb
    MacRuby/branches/experimental/spec/frozen/shared/file/owned.rb
    MacRuby/branches/experimental/spec/frozen/shared/file/pipe.rb
    MacRuby/branches/experimental/spec/frozen/shared/file/readable.rb
    MacRuby/branches/experimental/spec/frozen/shared/file/readable_real.rb
    MacRuby/branches/experimental/spec/frozen/shared/file/setgid.rb
    MacRuby/branches/experimental/spec/frozen/shared/file/setuid.rb
    MacRuby/branches/experimental/spec/frozen/shared/file/size.rb
    MacRuby/branches/experimental/spec/frozen/shared/file/socket.rb
    MacRuby/branches/experimental/spec/frozen/shared/file/sticky.rb
    MacRuby/branches/experimental/spec/frozen/shared/file/symlink.rb
    MacRuby/branches/experimental/spec/frozen/shared/file/writable.rb
    MacRuby/branches/experimental/spec/frozen/shared/file/writable_real.rb
    MacRuby/branches/experimental/spec/frozen/shared/file/zero.rb
    MacRuby/branches/experimental/spec/frozen/shared/kernel/
    MacRuby/branches/experimental/spec/frozen/shared/kernel/raise.rb
    MacRuby/branches/experimental/spec/frozen/spec_helper.rb
    MacRuby/branches/experimental/spec/frozen/tags/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/closed_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/each_byte_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/each_line_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/each_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/eof_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/file_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/filename_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/fileno_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/getc_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/gets_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/lineno_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/path_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/pos_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/read_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/readchar_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/readline_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/readlines_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/rewind_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/seek_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/skip_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/tell_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/to_a_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/to_i_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/to_io_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/to_s_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/frozen_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/pack_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/push_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/reject_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/reverse_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/shift_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/slice_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/to_s_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/uniq_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/unshift_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/bit_and_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/bit_or_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/bit_xor_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/divmod_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/modulo_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/quo_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/remainder_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/class/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/class/inherited_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/class/new_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/class/superclass_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/comparable/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/comparable/equal_value_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/dir/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/dir/pwd_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/enumerable/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/enumerable/inject_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/enumerable/zip_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/env/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/env/select_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/exception/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/exception/standard_error_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/file/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/file/expand_path_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/file/join_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/file/new_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/file/open_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/div_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/divmod_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/id2name_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/induced_from_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/modulo_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/quo_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/to_sym_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/float/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/float/divmod_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/float/induced_from_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/float/modulo_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/clear_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/default_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/delete_if_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/delete_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/each_pair_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/element_set_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/indexes_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/indices_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/initialize_copy_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/initialize_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/merge_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/rehash_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/reject_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/replace_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/shift_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/store_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/to_a_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/to_s_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/update_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/integer/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/integer/induced_from_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/binmode_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/each_line_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/each_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/eof_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/for_fd_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/foreach_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/getc_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/gets_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/inspect_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/new_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/open_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/print_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/putc_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/puts_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/read_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/readchar_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/readlines_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/reopen_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/sysread_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/ungetc_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/callcc_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/caller_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/catch_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/chomp_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/chop_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/eval_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/extend_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/freeze_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/getc_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/global_variables_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/gsub_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/instance_eval_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/instance_variable_get_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/instance_variable_set_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/load_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/local_variables_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/loop_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/method_missing_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/methods_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/p_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/private_methods_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/proc_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/protected_methods_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/public_methods_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/puts_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/require_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/scan_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/singleton_method_added_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/singleton_method_removed_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/singleton_method_undefined_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/singleton_methods_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/split_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/sprintf_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/sub_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/system_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/throw_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/to_a_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/warn_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/marshal/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/marshal/dump_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/marshal/load_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/matchdata/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/matchdata/select_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/acos_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/acosh_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/asin_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/asinh_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/atan2_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/atan_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/atanh_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/cos_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/cosh_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/erf_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/erfc_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/exp_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/frexp_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/hypot_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/ldexp_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/log10_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/log_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/sin_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/sinh_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/sqrt_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/tan_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/tanh_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/method/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/method/clone_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/attr_writer_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/autoload_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/class_eval_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/class_variable_defined_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/class_variable_get_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/class_variable_set_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/class_variables_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/const_defined_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/const_missing_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/define_method_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/freeze_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/include_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/instance_methods_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/module_eval_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/name_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/private_method_defined_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/protected_instance_methods_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/protected_method_defined_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/public_instance_methods_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/public_method_defined_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/numeric/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/numeric/quo_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/object/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/object/match_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/precision/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/precision/included_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/precision/prec_f_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/precision/prec_i_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/precision/prec_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/proc/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/proc/arity_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/proc/call_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/proc/element_reference_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/proc/new_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/proc/to_s_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/regexp/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/regexp/compile_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/regexp/inspect_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/regexp/kcode_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/regexp/new_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/append_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/chomp_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/chop_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/concat_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/delete_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/each_line_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/each_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/element_set_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/entries_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/gsub_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/include_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/index_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/initialize_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/insert_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/intern_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/ljust_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/lstrip_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/modulo_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/next_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/replace_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/reverse_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/rindex_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/rjust_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/rstrip_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/scan_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/slice_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/squeeze_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/strip_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/sub_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/succ_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/to_a_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/to_i_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/to_sym_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/tr_s_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/tr_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/unpack_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/upto_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/struct/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/struct/inspect_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/struct/members_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/struct/new_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/symbol/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/symbol/inspect_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/symbol/to_i_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/symbol/to_int_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/element_reference_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/element_set_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/inspect_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/key_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/raise_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/stop_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/terminate_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/at_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/comparison_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/gm_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/hash_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/local_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/mktime_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/utc_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/language/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/language/alias_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/language/catch_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/language/class_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/language/constants_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/language/defined_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/language/metaclass_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/language/module_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/language/numbers_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/language/precedence_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/language/private_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/language/return_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/language/symbol_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/language/throw_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/language/undef_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/language/variables_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/base64/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/base64/b64encode_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/base64/decode_b_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/ceil_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/div_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/divmod_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/exponent_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/floor_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/induced_from_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/infinite_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/inspect_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/mode_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/modulo_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/new_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/nonzero_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/power_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/to_i_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/to_int_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/truncate_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/zero_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html3/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html3/doctype_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html3/element_init_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html4/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html4/doctype_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html4/element_init_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html4fr/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html4fr/doctype_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html4fr/element_init_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html4tr/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html4tr/doctype_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html4tr/element_init_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/a_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/base_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/blockquote_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/caption_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/checkbox_group_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/checkbox_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/file_field_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/form_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/hidden_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/html_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/image_button_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/img_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/multipart_form_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/password_field_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/radio_button_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/radio_group_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/reset_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/submit_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/text_field_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/textarea_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/initialize_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/out_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/element_reference_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/params_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/value/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/value/element_reference_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/value/first_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/value/last_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/value/set_params_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/value/to_a_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/value/to_ary_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/tagmaker/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/tagmaker/nOE_element_def_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/tagmaker/nO_element_def_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/tagmaker/nn_element_def_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/unescape_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/Complex_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/coerce_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/comparison_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/divide_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/exponent_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/inspect_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/acos_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/acosh_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/asin_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/asinh_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/atan2_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/atan_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/atanh_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/cos_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/cosh_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/exp_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/log10_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/log_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/sin_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/sinh_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/sqrt_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/tan_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/tanh_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/modulo_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/new_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/numeric/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/numeric/image_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/to_s_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/conditionvariable/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/conditionvariable/broadcast_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/conditionvariable/signal_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/conditionvariable/wait_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/csv/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/csv/generate_line_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/csv/generate_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/csv/parse_line_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/csv/parse_row_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/csv/reader/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/csv/reader/parse_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/civil_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/commercial_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/conversions_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/julian_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/neww_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/ordinal_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/parse_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/enumerator/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/enumerator/enum_cons_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/enumerator/enum_slice_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/enumerator/enum_with_index_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/enumerator/new_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/etc/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/etc/getpwuid_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/each_option_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/each_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/get_option_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/get_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/set_options_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/terminate_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/terminated_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/iconv/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/iconv/close_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/iconv/conv_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/iconv/iconv_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/mathn/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/mathn/integer/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/mathn/integer/gcd2_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/mathn/rational/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/mathn/rational/exponent_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/mathn/rational/inspect_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/mathn/rational/power2_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/matrix/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/matrix/divide_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/matrix/initialize_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/binary_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/connect_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/getbinaryfile_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/gettextfile_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/initialize_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/login_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/nlst_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/putbinaryfile_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/puttextfile_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/retrbinary_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/return_code_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/size_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/storbinary_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/http/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/http/get_print_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/http/initialize_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/http/post_form_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/http/set_debug_output_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpgenericrequest/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpgenericrequest/exec_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/body_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/entity_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/inspect_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/read_body_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/read_new_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/reading_body_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/to_ary_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/observer/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/observer/count_observers_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/openstruct/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/openstruct/table_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/queue/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/queue/num_waiting_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/Rational_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/coerce_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/divmod_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/equal_value_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/exponent_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/initialize_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/inspect_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/new_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/reduce_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/to_r_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rexml/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rexml/text/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rexml/text/indent_text_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rexml/text/new_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/difference_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/exclusion_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/flatten_merge_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/initialize_copy_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/initialize_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/intersection_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/merge_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/minus_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/plus_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/difference_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/exclusion_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/flatten_merge_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/initialize_copy_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/initialize_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/intersection_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/merge_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/minus_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/plus_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/union_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/union_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/singleton/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/singleton/instantiate_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/socket/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/socket/basicsocket/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/socket/basicsocket/getsockopt_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/socket/constants/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/socket/constants/constants_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/socket/socket/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/socket/socket/for_fd_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/socket/socket/pair_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/each_line_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/each_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/gets_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/initialize_copy_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/initialize_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/open_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/print_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/putc_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/read_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/readline_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/readlines_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/reopen_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/sysread_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/ungetc_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringscanner/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringscanner/getch_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringscanner/initialize_copy_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringscanner/initialize_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/syslog/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/syslog/constants_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/tempfile/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/tempfile/_close_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/tempfile/close_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/yaml/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/yaml/load_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/yaml/to_yaml_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/zlib/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/zlib/gzipwriter/
    MacRuby/branches/experimental/spec/frozen/tags/1.9/library/zlib/gzipwriter/write_tags.txt
    MacRuby/branches/experimental/spec/frozen/version.rb

Added: MacRuby/branches/experimental/spec/frozen/CHANGES.before-2008-05-10
===================================================================
--- MacRuby/branches/experimental/spec/frozen/CHANGES.before-2008-05-10	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/CHANGES.before-2008-05-10	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17796 @@
+ Changelog
+===========
+
+This file contains the entire revision history of the specs from
+December 2006 onwards, when the spec project got started more or
+less officially by converting the remaining Test::Unit style tests
+in Rubinius to the spec style. The history is not preserved in the
+git repository history itself, so this data is here for reference.
+All the commit hashes are from the Rubinius repository.
+
+It still misses quite a few of the earlier, disparate specs and
+tests because up to that point the organisation was much looser
+and gathering an exhaustive accounting of the entire history of
+TDD/BDD would be time-consuming, particularly with the few full
+directory moves in there and such. All of the data is preserved
+in the Rubinius repository if someone is interested in that bit
+of history.
+
+Be aware that the history contains some Rubinius-specific specs
+by necessity. If you find any commits listed that were _solely_
+for Rubinius, feel free to strip them out.
+
+Thanks to everyone committing up to this point--over 2600 commits
+in just this incomplete version. Keep it up.
+
+
+
+ Revision History
+------------------
+
+
+commit 2b24a1e84c350810817885eeb6532f43c698a95c
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Fri May 9 16:45:07 2008 -0700
+
+    Fixed up pack for base64 and uuencode to be MUCH MUCH cleaner and 2x faster
+
+commit 022bc5dbfafcf1f9fd5e25820104718bd4d45661
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri May 9 23:51:47 2008 +0200
+
+    Share common specs for BigDecimal's #mult and #*.
+
+commit 414e7eedce9d0cea982e24f1031c407daccc648b
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri May 9 23:19:38 2008 +0200
+
+    New rubyspecs for BigDecimal#mult
+
+    * Verifies that proper signs are calculated when
+      zero is involved.
+
+commit 6883d7d0c67f7be84e7ea1703912452eaecaac6c
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri May 9 22:54:49 2008 +0200
+
+    New rubyspec for Module#new with block.
+
+commit f8bd3e34014a7351470685676b6b168abd787794
+Author: Phil Hagelberg <technomancy at gmail.com>
+Date:   Fri May 9 12:53:00 2008 -0700
+
+    Added specs for OpenSSL::HMAC.hexdigest and .digest
+
+commit 686c28493d42b9c798aa791823395d1000423225
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri May 9 20:20:13 2008 +0200
+
+    Some more rubyspecs for BigDecimal's #floor and #ceil.
+
+commit aba022a6620ec8d3a09067e9677f0f9c5d8078ee
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri May 9 17:51:35 2008 +0200
+
+    New rubyspecs for BigDecimal's #floor and #ceil.
+
+commit e4d844ba5851a798b7acb684cf68fdcef353d13c
+Author: Brian Ford <bford at engineyard.com>
+Date:   Thu May 8 22:13:58 2008 -0700
+
+    Excluded stdlib specs from default CI run. Added spec/full.mspec.
+
+commit 6a133574617cb435ad1684f208430112ff6839f6
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Thu May 8 16:19:50 2008 -0700
+
+    String#unpack overhaul. NO extra methods littered through Fixnum/Integer/String. NO procs. More readable, but still messy.
+
+commit 11dd3ae2c4e0dd81304e85ba662db41196f1ce4c
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed May 7 23:59:31 2008 -0700
+
+    Fixed constant type clash for ModuleSpecs modules.
+
+commit 4e702d10b32fdba62cdeae476b8217019839c3b0
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed May 7 21:42:11 2008 -0700
+
+    Some specs for Kernel#__add_method__ and Module.__add_method__.
+
+commit 819649f24f59819be185b0562b94f9089f8c000c
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed May 7 14:48:01 2008 -0700
+
+    Added spec for Kernel#eval with binding from method defined by #eval.
+
+commit d73b17b88b6084fdf7cab764b0fbdd3b3882dd81
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed May 7 10:06:26 2008 -0700
+
+    Use literals in Bignum#to_f specs (alternate fix for #535).
+
+commit ee211770eb8792b3f58f78ff60eec6d5289caa20
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Wed May 7 02:38:00 2008 -0700
+
+    Added specs for big uncovered areas, still not 100%
+
+commit 7ce9bc2d7edc64f6886c3d34836bc0394414ed66
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Tue May 6 03:56:19 2008 -0700
+
+    Fixed typo
+
+commit af3407251ee0f287ec80232c354153af169636e4
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Tue May 6 22:01:23 2008 +1000
+
+    Fix bug in Debugger::Output.wrap
+
+commit d9322306ea70f2b847b0f806bdb13ea02f2d6b4d
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Mon May 5 13:09:32 2008 -0400
+
+    Fix some bugs in BigDecimal#/. More may yet lurk.
+
+commit 2f3a4cc14433858b13caa932c8a50c31e024c7e8
+Author: Federico Builes <federico.builes at gmail.com>
+Date:   Mon May 5 12:04:26 2008 -0500
+
+    Adding more specs for REXML::Element
+
+    * Covers REXML::Element#{add_attribute, add_attributes, add_namespace, add_text, clone, comments}
+
+commit 7db8c2b563ea474cf2db5fa14bb2a6345c8c469f
+Author: Federico Builes <federico.builes at gmail.com>
+Date:   Mon May 5 10:54:00 2008 -0500
+
+    One more case for YAML.load specs
+
+commit 098decdf510b05f82ff9a6cc6769cf478a3236ab
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Sun May 4 22:29:35 2008 -0400
+
+    Define BigDecimal#ver.
+
+commit f6f1fe6a667570e4c1521649b964dca1352d1c32
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Sun May 4 22:12:08 2008 -0400
+
+    BigDecimal#new: Make space between '-' and 'Infinity' unparsable, as per spec.
+
+commit 503aae7cdbb208da8f25080762e17f0866845c4d
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Mon May 5 06:19:40 2008 -0400
+
+    Method call parsing spec from Jim Kingdon with minor addition.
+
+    * Moved the SyntaxError producing code into an #eval because the file
+      cannot be compiled to run otherwise.
+
+commit 398d5de0a0ffaf746e39e5f6a6ded02483fd1842
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Mon May 5 02:26:39 2008 -0400
+
+    Spec for :match node, implicit Regexp matches against $_.
+
+    * Compiler and Language specs.
+
+commit 206cea31c6a93fe434948dcb79321e2c119edf21
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Sat May 3 11:40:17 2008 -0400
+
+    Implement BigDecimal#power and #**, fix some bugs in #mult.
+
+commit a197099d9be6e48ad32480ae323302c83146147b
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat May 3 02:18:35 2008 -0400
+
+    Fixed a logic and syntax error in BigDecimal#mult specs.
+
+    * Removed some parentheses too.
+
+commit 081afd58a29ccd5025b806f53e9d7679b9296a7f
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Sat May 3 02:25:45 2008 -0400
+
+    Make sure subclasses that implement their own Hash#default work (Merb)
+
+commit 203ca288175416fadb110b2aa9cdf8cfbf13215d
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Sat May 3 01:49:35 2008 -0400
+
+    Specs and implementation for module include order (fixes abstract.rb)
+
+commit c788a9f2d9c4561a2837bbf78f68a6885d626917
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri May 2 18:14:32 2008 -0400
+
+    Implement BigDecimal#*, as well as #mult without precision support.
+
+commit 57d78528ff4cf249d906785ffbfdde1fda4aa3cc
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri May 2 17:36:15 2008 -0400
+
+    Implement BigDecimal#/ and #quo. Not perfect; still relies on #/.
+
+commit c42cc2cacc347d8284650c7046d4dadf94d7d4a5
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri May 2 16:13:07 2008 -0400
+
+    Fix a typo in specs.
+
+commit ae179b410665da18628f249e6796f1e07ab83763
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri May 2 16:10:43 2008 -0400
+
+    Get BigDecimal#floor basically working.
+    * The failing specs depend on #/, which isn't implemented yet.
+
+commit f8221117d174b91affe406c8089ed25e887232b3
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri May 2 16:06:32 2008 -0400
+
+    Fix bugs in BigDecimal#add and #+. This also affects #sub, #-, and #ceil.
+
+commit cdd196daf7643e846b7f3582b1e441b883e02aba
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri May 2 15:41:29 2008 -0400
+
+    More specs to fix bugs in BigDecimal#add and #+.
+
+commit c1c52a2a531b570fa1025d99e464d93c570cf59e
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri May 2 15:22:33 2008 -0400
+
+    Write another spec for BigDecimal#ceil.
+
+commit 71b65cdbfa5aae461fc52c997df9fca3bee9c8d5
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri May 2 14:47:34 2008 -0400
+
+    Write tests for a bug in BigDecimal#add and #+ where 0 + 1 = 0.1.
+
+commit 55988ef53879c1c489c570b3f37717365c7f8e2b
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Sat May 3 01:04:11 2008 -0400
+
+    Fix use of alias keyword inside instance_eval
+
+commit d4011595a0077e91665f85410d458c57367cf50b
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri May 2 20:38:15 2008 +0200
+
+    Added news specs for BigDecimal#mult.
+
+commit b6771644d35b6b8f3c87f7f4461bcaba99cd976f
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri May 2 19:41:09 2008 +0200
+
+    More BigDecimal#divmod rubyspecs.
+
+    MRI-specific bug is hidden behind ruby-bug guard.
+
+commit 854a011324ce717cfd47ddec6389a9e9abb0db18
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri May 2 18:45:29 2008 +0200
+
+    New BigDecimal#divmod specs.
+
+commit b9806e0efb2a8e51d70f6d51733df7bed88152d9
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri May 2 16:45:10 2008 +0200
+
+    A couple of test cases for BigDecimal's #quo, #div, #/.
+
+commit 3cf6c1e03001ba1dda966e3392b665f5b08a1b9d
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri May 2 15:03:37 2008 +0200
+
+    More tests for BigDecimal#floor.
+
+commit b70023978562af89cf4349e14e9443adb37ecbbe
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Thu May 1 21:15:29 2008 -0400
+
+    Improved a spec description for String#index.
+
+    * The description looks exactly like we had the wrong implementation
+      relying on % 256 and someone wrote a spec to make sure that did not
+      happen. However, the description was more or less meaningless to
+      what was actually being specced.
+
+commit 6e6aa411ff4c7a837d5d4adb9ab893719cf9e122
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Thu May 1 10:48:20 2008 -0700
+
+    Fix a number of things to pass all def specs
+
+    This is the result of ping-pong between Evan and Wilson. It refactors
+    out enclosing_class from being used, and instead information is always
+    pulled directly from the StaticScope object. This lets us inject proper
+    scoping changes in ruby.
+
+commit 2db27aef88e2ca7752beba846d172ede276275e0
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Thu May 1 19:03:50 2008 +0200
+
+    Implemented Socket.unpack_sockaddr_un
+
+commit d515221698e02b52ed4661113d659744fbfae36f
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Thu May 1 18:18:32 2008 +0200
+
+    Forgot to update spec tags for TCPSocket.gethostbyname
+
+commit bf839a99c3a5b773b6b96c6d5a1fcc5056511e7a
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Thu May 1 14:03:30 2008 +0200
+
+    Implement File#mtime specs
+
+commit b8c713e6b972b464788c740b4283a5b4226c123c
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Thu May 1 13:55:36 2008 +0200
+
+    Implemented File.lchmod and initial specs
+
+commit 059c926d7280c2e7c9f8bf710c5aef70cde3e777
+Author: Adam Wiggins <adam at heroku.com>
+Date:   Sun Apr 27 15:03:31 2008 -0700
+
+    IO.popen read/write pipes
+
+    Signed-off-by: Dirkjan Bussink <d.bussink at gmail.com>
+
+commit d9a050aa45efd00a40395b7ac7ac069f4be1fd1c
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Thu May 1 16:25:18 2008 +1000
+
+    Spec fixes for Tuple#to_a
+
+commit 0b610359fbfe8137fdba95d90b659238168d6788
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Wed Apr 30 17:45:51 2008 -0400
+
+    Update spectags.
+
+commit 024ebfdf3fa9c54b8a81134edb52fe10b09e4b91
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Apr 30 22:56:44 2008 +0200
+
+    Added BigDecimal#divmod excludes.
+
+commit e12d21a90760df723c0f48265cb49a9c4463db7c
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Apr 30 20:51:06 2008 +0200
+
+    More tests for BigDecimal#divmod.
+
+commit 68cfef604f9b5411ca9e0349883bac4f59541f0d
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Wed Apr 30 16:47:31 2008 -0400
+
+    Make BigDecimal#finite? handle NaN correctly, and refactor accordingly.
+
+commit 5066bcb8881241caf6d13be625b32633bda6567e
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Wed Apr 30 15:01:12 2008 -0400
+
+    Make BigDecimal#<= and #>= pass Vladimir's new specs.
+
+commit 49601aff01c394fe2168f5f221a987be63a9ebc7
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Apr 30 20:20:18 2008 +0200
+
+    Various improvements to BigDecimal rubyspecs.
+
+    * Corrected comparison specs (properly add arrays there)
+    * New reminder specs
+    * New modulo and % specs
+    * Tagged rbx failures
+
+commit dd1700b747ba26b27eff0b249623aca559db06e1
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Apr 30 17:48:20 2008 +0200
+
+    More test cases for BigDecimal#modulo and #%.
+
+commit 8eb9dc1b0aee3587f4da8b9cbe306fd431159d79
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Apr 30 16:57:16 2008 +0200
+
+    New specs for BigDecimal#modulo and #%.
+
+commit 4a846f807fe2c4c12d8719bc5c9ccb4ab696aff9
+Author: Federico Builes <federico.builes at gmail.com>
+Date:   Tue Apr 29 15:29:34 2008 -0500
+
+    Fixes REXML::Element#namespaces specs
+
+    * Use sort on the arrays to make sure the specs pass on JRuby too.
+
+commit 823683a864072ef6a81e808dbf792dee45d29c52
+Author: Federico Builes <federico.builes at gmail.com>
+Date:   Tue Apr 29 14:54:08 2008 -0500
+
+    Adds more specs for REXML.
+
+    * Specs for REXML#{inspect, namespace, namespaces, prefixes, text and text=}.
+
+commit a11a10760ce92ee373e04a5445234521a27874cc
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Mon Apr 28 17:55:55 2008 -0400
+
+    Committing so we can bisect.
+
+commit df94214b1d132b02e3dd5b166d1c7c5cd5d50a21
+Author: Drew Olson <olsonas at gmail.com>
+Date:   Mon Apr 28 19:21:07 2008 -0700
+
+    Added spec for Array#remove_outer_arrays
+
+commit ec4ece9c06b42c257b4ffce2cf319f0ad23f65e8
+Author: Drew Olson <olsonas at gmail.com>
+Date:   Sun Apr 27 20:15:47 2008 -0500
+
+    Added more edge cases for recursive arrays to spec for File#join
+    * an empty array containing an empty array which contains a recursive array should return
+      '[...]' when File#join is called on it.
+
+commit 698a5d291cf63e56e9a3508a8850c77fa2c23430
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Mon Apr 28 16:17:05 2008 -0400
+
+    Implement BigDecimal#=== as alias of #eql?.
+
+commit 18f515e735eecc519be55a6e3253db7135a137ad
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Mon Apr 28 16:09:43 2008 -0400
+
+    Implement BigDecimal#sub.
+
+commit b331faa567dc1d98163c6447897221877cf756eb
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Mon Apr 28 16:04:06 2008 -0400
+
+    Implement BigDecimal#add.
+
+commit f3f94c9b53045ddde335981897e2f6087dab7ef2
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Mon Apr 28 12:01:41 2008 -0500
+
+    hack to fix DRb.start_service spec to at least test start_service
+
+commit 4c8d6d90c69615386e26c71633e242f4e1f19342
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Mon Apr 28 11:56:47 2008 -0500
+
+    spec for DRb.stop_service to see if it clears the socket correctly
+
+commit 03cb539f42f0b558fa29911c1dfc71ec5f2b183f
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Mon Apr 28 11:20:17 2008 -0500
+
+    Revert "Revert "Made DRb spec depend partially on PID so multiple runs don't clash.""
+
+    Apparently this is a supposed fix for concurrent spec runs, not for the spec failure
+
+    This reverts commit 08695d9a6940ab74f6eb8965e449a417002a42a6.
+
+commit 2172e2ac20b69a97c2ad66551b3620a43bfda700
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Mon Apr 28 02:14:18 2008 -0400
+
+    Make BigDecimal#exponent return Bignums as necessary, not just Fixnums.
+
+commit dc93d06163e80cdf89a67532654a850828119287
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Mon Apr 28 01:23:19 2008 -0400
+
+    Correct implementation of BigDecimal#+ and #-. There's still a lot of repetition to be factored out, but this algorithm is more correct than the last try.
+
+commit 1da58bb7f0afbba4f8412e06983304dc7d887ac9
+Author: Luis Lavena <luislavena at gmail.com>
+Date:   Thu Apr 24 16:37:59 2008 -0300
+
+    Corrected small typo on File#join specs under Windows.
+
+commit b287619579ad11535722a2374b6f849d88fe9931
+Author: Drew Olson <olsonas at gmail.com>
+Date:   Thu Apr 24 14:24:10 2008 -0700
+
+    Spec for File#join now describes correct behavior for arrays with recursive sub-arrays.
+
+commit 5830380895c0bec16c6af39d0f29d8d70268028d
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Sun Apr 27 14:53:47 2008 -0500
+
+    DRb.start_service spec fails because of a timing bug in DRb
+
+    See http://jira.codehaus.org/browse/JRUBY-2347
+
+commit 08695d9a6940ab74f6eb8965e449a417002a42a6
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Sun Apr 27 14:51:16 2008 -0500
+
+    Revert "Made DRb spec depend partially on PID so multiple runs don't clash."
+
+    The spec is designed for sane behavior, if Rubinius or the
+    implementation of DRb is causing problems then they should be
+    fixed, not the spec in this case.  Fixing the spec will only
+    hide the bug.
+
+    See http://jira.codehaus.org/browse/JRUBY-2347 for more commentary on the problem.
+
+    This reverts commit f89bd8c6c425c9d9bcc3e589b8d3b05ce3ccbced.
+
+commit 94ba0884c8e7f398b6fe8d6736834f62f6a49815
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Sun Apr 27 21:23:47 2008 +0200
+
+    More checks for BigDecimal#abs specs.
+
+commit 80932d25ca95e2e8c803d244a7636e3004525ade
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Sun Apr 27 21:10:26 2008 +0200
+
+    More test cases for BigDecimal#finite? specs.
+
+commit 4b541ed23ccac65f6f4b2ef8aad56e9aa7a69e12
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Sun Apr 27 21:04:08 2008 +0200
+
+    Added testcase for BigDecimal#infinite? for NaN.
+
+commit 4a1f39426fc60ae7c2ed0470259fa0752a46d030
+Author: Adam Wiggins <adam at heroku.com>
+Date:   Sat Apr 26 22:57:09 2008 -0700
+
+    IO#write returns 0 when writing a blank string, to match behavior of MRI
+
+    Signed-off-by: Dirkjan Bussink <d.bussink at gmail.com>
+
+commit 56c0088f9b075769933c8c87e3c2d256cff3a3e8
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Sun Apr 27 00:28:47 2008 -0400
+
+    Typo.
+
+commit c11410654b9046cdb58dba1d116f58ce74f4c263
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Sun Apr 27 00:24:32 2008 -0400
+
+    Finish implementing #@- and #infinite?. Update spectags, of course
+
+commit dc9f427ecb9d55559d800af70f9c1a3f2f2123b5
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Sun Apr 27 00:07:31 2008 -0400
+
+    Amplify a comment.
+
+commit b9776b953ae67f2088e44b640145af464a1cf942
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Sun Apr 27 00:02:48 2008 -0400
+
+    Get BigDecimal#+ working. I hate this algorithm, but it works without running out of memory.
+    * Update spec tags.
+
+commit b87ff5c22891f19ad0b956e7e02cc3a3d1adcc93
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Sat Apr 26 14:27:00 2008 -0400
+
+    Implement BigDecimal#coerce.
+    * Update spectags.
+    * Rewrite one spec so it doesn't depend on BigDecimal#-, which is not yet implemented.
+
+commit f89bd8c6c425c9d9bcc3e589b8d3b05ce3ccbced
+Author: Brian Ford <bford at engineyard.com>
+Date:   Sat Apr 26 15:52:49 2008 -0700
+
+    Made DRb spec depend partially on PID so multiple runs don't clash.
+
+commit 3c49a1d16f20726c4ee2d7eb5f5c671537aa59d5
+Author: Brian Ford <bford at engineyard.com>
+Date:   Sat Apr 26 15:13:47 2008 -0700
+
+    Added wordsize guard for BigDecimal#exponent spec.
+
+commit 3aac5f6d64f4cbbca70ecf01b7ed9be596fa5b76
+Author: Brian Ford <bford at engineyard.com>
+Date:   Sat Apr 26 15:09:40 2008 -0700
+
+    Updated spec_helper and renamed CaptureOutput to IOStub.
+
+commit 94322a6a95770a030d28925cc7213a38c5687ea1
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Sat Apr 26 23:16:59 2008 +0200
+
+    A bit more test cases for BigDecimal#- at .
+
+commit 9919c5e3be59562532c967b479c959cf6270046e
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Sat Apr 26 21:01:44 2008 +0200
+
+    New specs for BigDecimal#uminus.
+
+commit c3e74531f1ca1e70671f529671c0fa474968dc87
+Author: Marius Nuennerich <marius at nuenneri.ch>
+Date:   Sat Apr 26 13:08:04 2008 +0200
+
+    FreeBSD seems to work like the rest, not darwin
+
+    Tested on FreeBSD/i386 7-STABLE
+
+commit c06a091b285f388f09b11037975921662759eea2
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Sat Apr 26 12:14:33 2008 -0400
+
+    Implement BigDecimal#exponent, update spectags. Looks like parts of #** have accidentally stopped failing too. :)
+
+commit e5b753b7e659b29f5ed4aa57018f922111b238f5
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Sat Apr 26 11:53:55 2008 -0400
+
+    Specify return type of BigDecimal#ceil as BigDecimal, as per library documentation.
+
+commit 0ca3b9ceb6ef5ca1898250b89f75c0194b5da481
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Sat Apr 26 11:50:24 2008 -0400
+
+    Fix BigDecimal#inspect output, update spectags.
+
+commit ca99aa062afe9106ec614e2d8969d3491803c9a2
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Sat Apr 26 11:48:00 2008 -0400
+
+    Specify return type of BigDecimal#ceil as BigDecimal, as per library documentation.
+
+commit 587a5cdbbfa4cccdbfe98339ca999f1d63bd66cf
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Sat Apr 26 15:02:33 2008 +0200
+
+    Corrected one Array#hash test case.
+
+    Now Array#hash pass MRI 1.8.6, 1.8.7, 1.9 and JRuby.
+
+commit f86bdb98b8b9f5ea878c5d142f3a694e5278db77
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Sat Apr 26 14:19:14 2008 +0200
+
+    Quarantined couple of specs that fail on *ALL* implmenetations.
+
+    Probably, we need a better way to do that, but quarantine
+    is a quick and simple way, easily detectable later on.
+
+commit 7ca928211180c66b9879afbc382c376a7649e1b0
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Sat Apr 26 00:51:39 2008 -0400
+
+    Implement BigDecimal#to_f, update tags. Will this need more work?
+
+commit 69dec41f6b5b532c5de7f46e97f97c9e102305c7
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Sat Apr 26 00:44:40 2008 -0400
+
+    Implement BigDecimal#truncate.
+    * Update spec tags.
+    * Reorganize variables slightly to remove duplication.
+
+commit c823e62c3a6776b62f65c34b16bdca5748d1add9
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Sat Apr 26 00:36:43 2008 -0400
+
+    Implement BigDecimal#truncate.
+    * Update spec tags.
+    * Reorganize variables slightly to remove duplication.
+
+commit 3f4e5dc78de5bf3e81ae1ce7a0d14852a32aeade
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Sat Apr 26 00:16:38 2008 -0400
+
+    Rewrite spec description to bring it in line with what the spec actually does. :)
+
+commit 15d87e8a983d08d99fc3ec6bfbb7f36ed0cd4c4e
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri Apr 25 18:09:33 2008 -0400
+
+    Implement BigDecimal#to_i, update spec tags.
+
+commit 59873b144ea836e2f9bbef7d5186a1287155e76a
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Fri Apr 25 20:46:17 2008 -0400
+
+    Specs for autoload path normalization
+
+commit 71fe2d45d147fe2c41937ae5ef6dbb8814f491c4
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Fri Apr 25 17:05:17 2008 -0400
+
+    Use a separate class in Singleton 'new' specs to avoid contamination
+
+commit 2dc8f9eb9c6db014bd6cc132d987fdb4612816f8
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Fri Apr 25 16:45:28 2008 -0400
+
+    Handle more nightmare Autoload edge cases by hooking into Kernel#require
+
+commit 5c1a375a15adbe20a9bf3d1b95e1f2d30feaa90e
+Author: Michael Fellinger <m.fellinger at gmail.com>
+Date:   Sat Apr 26 04:26:52 2008 +0900
+
+    Spec for Module#autoload when the load path has already been required
+
+    Signed-off-by: Wilson Bilkovich <wilson at supremetyrant.com>
+
+commit ee47a0cc0da787599479fc8dd085b7481b591176
+Author: Charles Oliver Nutter <charles.nutter at sun.com>
+Date:   Fri Apr 25 15:41:19 2008 -0500
+
+    Enabled another $_ spec and added a proc dispatch scoping test to $~ and $_
+
+commit eabc4609758dc99727c77493c58f187782ea957f
+Author: Charles Oliver Nutter <charles.nutter at sun.com>
+Date:   Fri Apr 25 15:32:03 2008 -0500
+
+    Added some basic specs for $_: implicit assign, explicit assign, scoping
+
+commit 61194dec429a9f288791156639f058e45a4e72e9
+Author: Charles Oliver Nutter <charles.nutter at sun.com>
+Date:   Fri Apr 25 14:49:53 2008 -0500
+
+    Add some specs for $~ scoping and assignment.
+
+commit 4c5cec4f6e10864c68b140e71cc2559e7a7d636b
+Author: Brian Ford <bford at engineyard.com>
+Date:   Thu Apr 24 18:28:08 2008 -0700
+
+    Added incomplete tags for CSV spec stubs.
+
+commit 6e231caef62e678413e86317881aaab200d0802e
+Author: Brian Ford <bford at engineyard.com>
+Date:   Thu Apr 24 18:15:06 2008 -0700
+
+    Reprocessed library CSV specs with new mkspec.
+
+commit 4cdc61a76cce73b52f05f53f820838cc7e3c2823
+Author: Michael Fellinger <m.fellinger at gmail.com>
+Date:   Fri Apr 25 08:46:32 2008 +0900
+
+    Updating specs for the module #included calling #extend issue.
+
+    Signed-off-by: Brian Ford <bford at engineyard.com>
+
+commit 40e775bf036aa59e69268708f8c78b8a56e0f9ce
+Author: Brian Ford <bford at engineyard.com>
+Date:   Thu Apr 24 17:10:55 2008 -0700
+
+    Moved #bignum_value helper to MSpec.
+
+commit 9b52edbb14ff2fc18faa429daf4ceaff5b87db11
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Thu Apr 24 14:37:53 2008 -0400
+
+    Implement BigDecimal#fix, make #frac trap for a few common cases without running out of memory for big numbers.
+
+    * Update spec tags.
+
+commit 6a604c0a9863073cfd7540ff755e7ca035a7dff5
+Author: Marius Nuennerich <marius at nuenneri.ch>
+Date:   Thu Apr 24 19:32:14 2008 +0200
+
+    Don't run Process.setpriority spec on FreeBSD
+
+commit 0ab639af500d947c5b5feb1d8f00f5fbc97a0edc
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Thu Apr 24 13:37:23 2008 +0200
+
+    Adjusted IO specs to supply blocks for each-like methods.
+
+    See [ruby-core:16557] for more details.
+
+commit a7b603a9ce6bfb570785e803bdb89ae36bb6253d
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Thu Apr 24 13:14:40 2008 +0200
+
+    Fixed IO, Process, Regexp specs ('should' was missing).
+
+commit 26de6c05c050d0dbcb073c407abda47f964bfd29
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Thu Apr 24 12:50:46 2008 +0200
+
+    Fixed File specs ('should' is misspelled)
+
+commit 99a2b23d8fb42cb377cb3fb9ab2569c555aec8bf
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Thu Apr 24 12:47:57 2008 +0200
+
+    Fixed Array specs ('should' was missing).
+
+commit 67b301a03fd6f7f0fa38ce106ab05825f2cbb15c
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Thu Apr 24 12:43:39 2008 +0200
+
+    Fixed specs ('should' was missing), some new test cases for BigDecimal.
+
+commit aecbea57de7ee1b50bd4b06871dd08e762a6ccb8
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Thu Apr 24 12:35:54 2008 +0200
+
+    More test cases for BigDecimal#nan?
+
+commit 7aaf8fa137b8961ca122eb92e7447936ad7a44cc
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Thu Apr 24 12:26:20 2008 +0200
+
+    More test cases for BigDecimal#zero?
+
+commit 58ecee694f191aa05e7867544cf8d63129558447
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Thu Apr 24 12:19:11 2008 +0200
+
+    A bit more test cases for BigDecimas#-.
+
+commit e946dd03d590e29a1d344e7579d5ff047df4a76b
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Thu Apr 24 12:17:16 2008 +0200
+
+    New and updated specs for BigDecimal#-.
+
+commit 01d82db424b4e447b98e5f2eb3e162b991dece8a
+Author: Brian Ford <bford at engineyard.com>
+Date:   Thu Apr 24 01:25:20 2008 -0700
+
+    Tag for new private setter method spec.
+
+commit c0ee2e133a4e5fc179b96329ffd3934dd9263c2b
+Merge: 374ab81... e9826b9...
+Author: Tony Arcieri <tony at medioh.com>
+Date:   Thu Apr 24 02:19:00 2008 -0600
+
+    Merge branch 'master' of git at git.rubini.us:code
+
+commit 374ab81e2c01ea5ac48cda2004ae92a989d7f3d7
+Author: Tony Arcieri <tony at medioh.com>
+Date:   Thu Apr 24 02:18:26 2008 -0600
+
+    Specs for calling a private setter method on self
+
+    * Not presently working under rbx, works under MRI
+    * I don't entirely know the process for this, but this is expected to break
+
+commit 39505393f330b5f622788f1d98ea8ff3781499c7
+Author: Luis Lavena <luislavena at gmail.com>
+Date:   Thu Apr 24 04:04:32 2008 -0300
+
+    Fixes Dir fixtures and specs for Windows.
+
+    Usage of special characters *, ?, | and : is not allowed under Windows
+    * and ? represent wildcards, | is pipe tunelling and : is drive letter
+    separator.
+
+    Files or Directories cannot contain slashes (\/), wildcards, double-
+    quotes, pipe tunelling or stream redirectors (<>).
+
+commit 2ecc076e488ed1a519fc5b6876c68a3d91d55c87
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Apr 23 22:55:44 2008 -0700
+
+    Update tags for newly passing File.join specs.
+
+commit ff3756e179920b84d5a55fc7bbc2688706df044f
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Thu Apr 24 01:09:17 2008 -0400
+
+    Add specs for nested method definitions and other complex scenarios
+
+commit 24785f7c28cde09ce0400e5d80f832ae11cddefa
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Wed Apr 23 20:56:55 2008 -0400
+
+    Spec for using ||= to initialize a class variable
+
+commit 98b0c44057cb827107cae0f0174b5e81ac2064fd
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Wed Apr 23 19:49:21 2008 -0400
+
+    Rewrite descriptions of language/def specs
+
+commit 598c287cc36179644a1bbf2a303a56fc85bb1b12
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Apr 23 12:39:04 2008 -0700
+
+    Replaced use of :mswin with :windows in platform_is[_not] guards.
+
+commit 01fe417f27ad43495327a522ece2f02769064df7
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Apr 23 21:30:34 2008 +0200
+
+    Added excludes for BigDecimal#div specs.
+
+commit 46f022d49c394b027491295e7fd5cb305af33404
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Apr 23 21:27:42 2008 +0200
+
+    More specs for BigDecimal#div
+
+commit 72433091c6a845c5f550b27111748e29fb5eac09
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Apr 23 10:56:57 2008 -0700
+
+    Added #tmp helper to MSpec for returning a temp file name.
+
+commit f4e975e5255fb36bb8e9be7d310850135ce3515f
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Wed Apr 23 10:54:42 2008 -0400
+
+    Implement BigDecimal#frac, update spec tags.
+
+commit b60deba2368a1212d6acd3e49481ba9495de7f2f
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Wed Apr 23 10:49:39 2008 -0400
+
+    Correct a spec error.
+
+commit e19cf9401c029f90e117b1c17083c928b0d1c9ca
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Wed Apr 23 10:24:50 2008 -0400
+
+    Implement BigDecimal#-@, update spec tags.
+
+commit c3fc05389c75aca3150038814b324266501fdb8f
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Apr 23 16:12:24 2008 +0200
+
+    A bit more test cases for BigDecimal#sqrt.
+
+commit b2a220f86887bfe6030a34bc8cd1b748c88cc2b8
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Wed Apr 23 01:43:16 2008 -0400
+
+    Get BigDecimal#to_s working according to spec.
+
+    * Implement #to_s.
+    * Update spec tags.
+
+commit 82638601be12e410413047779f01840d6d0db3d8
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Wed Apr 23 09:56:48 2008 +1000
+
+    Refactor Debugger to remove dependencies on Debugger::Interface
+
+    Also:
+     - Add List#inspect to show number of items in list
+     - Fix decode output to show original instructions in place of
+       yield_debugger
+     - Improve regex used to match method names to handle more
+       operators
+
+commit 41c64f2825d347fbe2ef9edc33dd8f1e84773251
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Tue Apr 22 18:12:06 2008 -0400
+
+    Spec and implementation for NilClass#dup
+
+commit d3e313ed38a847e29225ba814a956d0929ea6460
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Tue Apr 22 22:03:47 2008 +0200
+
+    New and updated specs for Bigdecimal's #abs and #sqrt.
+
+commit 2013e106181879b886f2e1cb78e81f52cd284666
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Tue Apr 22 15:52:10 2008 -0400
+
+    Re-implement Module#autoload and autoload?. Now passing all autoload specs.
+
+commit 9156271e2b12138e2b2b712a76f0110f20a757b7
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Tue Apr 22 15:34:43 2008 -0400
+
+    Add (failing) spec for toplevel autoloaded constant access
+
+commit 8eb5451f88a37dc247e42913c1d72d072a9b02ef
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Tue Apr 22 19:06:00 2008 +0200
+
+    One more test case, for BigDecimal#sqrt with nil.
+
+commit e7894fb78cf92b53e9bdc6dcf023d8dd2d66b2ed
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Tue Apr 22 18:52:24 2008 +0200
+
+    More detailed specs for BigDecimal#sqrt and fixes for old ones.
+
+commit 527a4b663c487cd9222ee2e6917e330ff9a130a1
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Tue Apr 22 12:38:53 2008 -0400
+
+    Rename ambiguously-worded autoload spec
+
+commit 3e6f16c41569dbba291bc3cececf137fc8952ee2
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Tue Apr 22 12:31:17 2008 -0400
+
+    Change to a significand-and-exponent implementation.
+
+    * Update spec tags.
+
+commit f1b2bf51042ca563ca74a9cf83db0e46a1bfabce
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Tue Apr 22 09:54:53 2008 -0400
+
+    Fix BigDecimal#zero, update spec tags. Also make #precs deal correctly with lowercase exponents.
+
+commit d0171de114e777f07a3e62972663475dd7747b05
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Tue Apr 22 09:24:06 2008 -0400
+
+    Implement BigDecimal#precs.
+
+    * Get #precs working. This will be less tortured once I implement a significand-and-exponent format.
+    * Update spec tags.
+
+commit e1fc7c6dc4c02c1763947c34d05f894661a84525
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Tue Apr 22 01:30:10 2008 -0400
+
+    Continue implementing bits of #inspect and updating spec tags.
+
+commit e4371f120c9c5c3c88a26d5f24f0d3ab888c954f
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Tue Apr 22 01:24:14 2008 -0400
+
+    Implement BigDecimal#==/eql? and the beginnings of #inspect.
+
+    * Find a way of implementing the equality test that satisfies the specs.
+    * Don't be so baroque in parsing strings in constructor.
+    * Update spec tags.
+    * Fix regression in abs_spec.
+    * Start implementing #inspect. Not really ready for prime time yet.
+
+commit 0494c1c35582381345194c76f7384eb9044797fc
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Tue Apr 22 00:41:03 2008 -0400
+
+    Start implementing BigDecimal#sign and #zero?.
+
+    * Clean up specs for #sign.
+    * Write some initial code to get these working. Not all there yet.
+
+commit 3c071b5f921898d87437803a500535b639d465ef
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Mon Apr 21 23:43:10 2008 -0400
+
+    Get BigDecimal#abs working.
+
+    * Implement the function.
+    * Improve the spec.
+
+commit 054582f3b89d757f033cd5f09cbf90fa08ad81d6
+Author: MenTaLguY <mental at rydia.net>
+Date:   Mon Apr 21 22:32:42 2008 -0400
+
+    fix linked actors spec (sort of)
+
+commit d7a7d0c4d0d83d7e69216c96a249c4091fe75323
+Author: MenTaLguY <mental at rydia.net>
+Date:   Mon Apr 21 22:28:29 2008 -0400
+
+    fix up registration spec
+
+commit 645784c3d39f776f583874e7c9244ff3de64cfe7
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Mon Apr 21 19:56:51 2008 -0400
+
+    Update tags on failing specs.
+
+commit 960faf5382d90db376ff14bb836463f1860a4b62
+Merge: 2e2150f... 046ba62...
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Mon Apr 21 18:46:45 2008 -0400
+
+    Merge branch 'master' of git at git.rubini.us:code
+
+commit 046ba622836321f487f241c145a3bdf0968f0a67
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Mon Apr 21 18:44:50 2008 -0400
+
+    Specs for failing Module#autoload case (replicates a scenario from Merb)
+
+commit 18a2a26fa511d4943a724e27ce09e5855a257e90
+Merge: 1f5f4b5... 991c6e6...
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Mon Apr 21 14:15:07 2008 -0400
+
+    Merge branch 'master' of git://git.rubini.us/code
+
+    Conflicts:
+
+    	lib/bigdecimal.rb
+    	spec/ruby/1.8/library/matrix/diagonal_spec.rb
+    	spec/ruby/1.8/library/matrix/element_reference_spec.rb
+    	spec/ruby/1.8/library/matrix/shared/identity.rb
+    	spec/ruby/1.8/library/matrix/shared/transpose.rb
+
+commit edd397c82a924e406eabbcd7e84243d94f8e8067
+Author: Federico Builes <federico.builes at gmail.com>
+Date:   Sun Apr 20 18:11:23 2008 -0500
+
+    Adds MinGW to the IO#popen spec guard
+
+commit 10df9f89189637b2c5a54b01a88eca6c9fbb4601
+Author: Adam Wiggins <adam at heroku.com>
+Date:   Sun Apr 20 14:53:41 2008 -0700
+
+    IO.popen specs for reading and writing to pipes
+
+commit 3f70eceb3b9415a14f602c5b96121a459dca1e67
+Author: Brian Ford <bford at engineyard.com>
+Date:   Sat Apr 19 22:32:28 2008 -0700
+
+    Fix silly typo in Numeric#quo specs.
+
+commit 6101a4992ddc15c0140f4d7702cf88d2d3a2ac53
+Author: Brian Ford <bford at engineyard.com>
+Date:   Sat Apr 19 22:23:14 2008 -0700
+
+    Guard affected specs with conflicts_with :Rational.
+
+commit 354445f4d20ec66f207d65d1ccceb681bba7fff0
+Author: Federico Builes <federico.builes at gmail.com>
+Date:   Sat Apr 19 14:23:14 2008 -0500
+
+    Clarifying some of the Matrix specs
+
+    * Fixes two errors introduced by 28700c5cf7
+
+commit 2f5ca541fc08f0c033bc6541c72962228ea607de
+Author: Eero Saynatkari <projects at kittensoft.org>
+Date:   Sat Apr 19 15:07:49 2008 -0400
+
+    Compiler specs' TestGenerator relies on broken #=== semantics, comply.
+
+commit 37cc9d4d6eb3442814ecc51845f025f464da64f7
+Author: Eero Saynatkari <projects at kittensoft.org>
+Date:   Sat Apr 19 15:05:30 2008 -0400
+
+    Specs for default #=== and its relationship with #== and #equal?
+
+    * Rubinius deviates to not check object id directly.
+
+commit 28700c5cf7630be59877122e6470c42622b7365a
+Author: Federico Builes <federico.builes at gmail.com>
+Date:   Sat Apr 19 13:53:33 2008 -0500
+
+    Additional specs for Matrix
+
+    * Some of the constructors in Matrix keep referencing the original arguments after creation, these specs cover those cases.
+
+commit 12b0bc93e5a6b328ad0968c03c47af71f671aae2
+Author: Federico Builes <federico.builes at gmail.com>
+Date:   Sat Apr 19 13:06:04 2008 -0500
+
+    Replace object_id for equal? in Matrix specs
+
+commit ae377f0e56b8f31356935b3ac0800f561b2d1b2c
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Sat Apr 19 14:49:34 2008 +0200
+
+    Fix File::Stat#uid specs
+
+commit 2e01a86a3977fe87f4f0734e50598b41f66f29d7
+Author: MenTaLguY <mental at rydia.net>
+Date:   Sat Apr 19 03:24:32 2008 -0400
+
+    Gutted and reworked Actor, following Erlang more closely.
+
+commit de40303e17e2de1e7980564b43ee162c5080afa6
+Author: Federico Builes <federico.builes at gmail.com>
+Date:   Sat Apr 19 01:05:43 2008 -0500
+
+    Fixes Matrix#clone specs for MRI
+
+    * Makes sure the values (not the references) of the original rows are copied.
+
+commit 2b3a44158ae93ab5883da22e5f36df92485f3ad4
+Author: Federico Builes <federico.builes at gmail.com>
+Date:   Fri Apr 18 22:47:15 2008 -0500
+
+    Fixes a few things inside the Matrix specs.
+
+    * Removes some of the "needs to be reviewed for completeness" messages.
+    * Changes some of the descriptions
+
+commit 3be265a93a75b6a0267b1770f8cad671c4244671
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri Apr 18 12:26:29 2008 -0400
+
+    Matrix.unit, one more alias for .identity.
+
+    Signed-off-by: Federico Builes <federico.builes at gmail.com>
+
+commit 57aa8ba9a1dbdf62e9cf644bbde4603b841ffc76
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri Apr 18 12:25:55 2008 -0400
+
+    Name spec correctly.
+
+    Signed-off-by: Federico Builes <federico.builes at gmail.com>
+
+commit 3390dc4c6725d996eeb0c2e4ec73949bc0be2290
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri Apr 18 12:23:54 2008 -0400
+
+    Specs for Matrix.scalar and .identity/I.
+
+    Signed-off-by: Federico Builes <federico.builes at gmail.com>
+
+commit 958ca1faa1dc60ce591b4b2f768f22ac7f6cb56f
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri Apr 18 12:22:09 2008 -0400
+
+    Move the "needs to be reviewed" indicator to the right place.
+
+    Signed-off-by: Federico Builes <federico.builes at gmail.com>
+
+commit bf3eab630654eaaca9256850d258343e3024989e
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri Apr 18 12:03:45 2008 -0400
+
+    Use size functions instead of constants.
+
+    Signed-off-by: Federico Builes <federico.builes at gmail.com>
+
+commit 3981c931e7f4fde730d51614d40e44b9209347f9
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri Apr 18 11:58:22 2008 -0400
+
+    Specs for Matrix#clone and #transpose (alias #t).
+
+    Signed-off-by: Federico Builes <federico.builes at gmail.com>
+
+commit 72e1ea8900a638c796de9e715c5dffcf4ac90546
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri Apr 18 01:27:06 2008 -0400
+
+    Basic specs for Matrix.zero.
+
+    Signed-off-by: Federico Builes <federico.builes at gmail.com>
+
+commit f5d294ad941c477060e9b5d2329790db7e1e5700
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri Apr 18 01:20:27 2008 -0400
+
+    Move before block to a clearer place.
+
+    Signed-off-by: Federico Builes <federico.builes at gmail.com>
+
+commit b6bc5b224ade56ab96f3585b6b1c25e6dd5e1ad5
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri Apr 18 01:19:27 2008 -0400
+
+    Write specs for Matrix.diagonal.
+
+    Signed-off-by: Federico Builes <federico.builes at gmail.com>
+
+commit b4d056baa33a2181ab64c065ad1eb4adebcfaddf
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri Apr 18 01:11:11 2008 -0400
+
+    Some initial specs for Matrix#[] and Matrix.[].
+
+    These are in the same file because of coding conventions, but they probably should not be since .[] is a constructor and has very little in common conceptually with #[], which is a subscript operator.
+
+    Signed-off-by: Federico Builes <federico.builes at gmail.com>
+
+commit 5476d836577c0fbdbda097762862cf153ffb5e07
+Author: Brian Ford <bford at engineyard.com>
+Date:   Fri Apr 18 18:35:34 2008 -0700
+
+    Some method profiles of data provided by John Lam.
+
+    Run these as follows:
+
+      bin/mspec -w rails.yaml spec/ruby
+
+    We'll be adding our own trace script, but for now, these
+    are snapshots of methods used by Rails loading a simple
+    "hello world" controller. The rails.yaml file is core
+    methods. The core.yaml file is generated by NameMap from
+    mspec/bin/name_map.rb.
+
+commit 24c71675cc63c86832ef8bc55d2f0167dff53073
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri Apr 18 17:24:08 2008 -0400
+
+    First stab at BigDecimal.
+
+    * A skeleton of a somewhat naïve implementation of BigDecimal.
+    * Updated spec tags.
+
+commit 1f5f4b59400b8b11df83b274efc8ce98186220ef
+Merge: 9d21b0e... 968a0ec...
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri Apr 18 17:28:02 2008 -0400
+
+    Merge branch 'bigdecimal'
+
+commit 9d21b0e890a9394658689af2bdee7e449cd2200b
+Merge: c3f3507... 1a08506...
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri Apr 18 17:25:09 2008 -0400
+
+    Merge branch 'master' of git://git.rubini.us/code
+
+commit 968a0ecda8477b33ceab2e7d0c7e7d084a105bdb
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri Apr 18 17:24:08 2008 -0400
+
+    First stab at BigDecimal.
+
+    * A skeleton of a somewhat naïve implementation of BigDecimal.
+    * Updated spec tags.
+
+commit 1f410d918a59b9b49e87a407cc8fba4bbf342a79
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Fri Apr 18 22:34:53 2008 +0200
+
+    Fix a bunch of specs and minor issues in File::Stat
+
+    Specs for File::Stat#<=>, File::Stat#ino, File::Stat#inspect,
+    File::Stat#mode, File#Stat.initialize and some minor bugfixes
+    such as the fact that File::Stat needs to include Comparable
+    (like MRI).
+
+commit d6f2c6995941762878f4b777a39b0c23ea654605
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Thu Apr 17 22:30:36 2008 +0200
+
+    Remove specs for non-existent File::Stat#initialize_copy
+
+commit c3f350716a35cb869b3ea0289c0e404d07b8819f
+Merge: 810afff... b861102...
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri Apr 18 16:18:34 2008 -0400
+
+    Merge branch 'master' of git://git.rubini.us/code
+
+commit 72101783ec6e66a4f9ac3f9c90f7e8f5b67058ec
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Tue Apr 8 17:05:26 2008 -0700
+
+    Reworked masgn specs to evaluate L2R and assign L2R. excluded.
+
+commit 4e4bec628b21938617bdfa5a2ef17aedf02c112c
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Tue Apr 8 15:17:00 2008 -0700
+
+    trailing whitespace is killing me... evan\! fix your editor\!
+
+commit 810afffa2e549048947c07b30d77be255db42d73
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri Apr 18 12:26:29 2008 -0400
+
+    Matrix.unit, one more alias for .identity.
+
+commit 2c84f77535d677a42bee93759c77f79c2cdd4d93
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri Apr 18 12:25:55 2008 -0400
+
+    Name spec correctly.
+
+commit 762f5ee0f7ba4234847c695c92e3ed27dd05e134
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri Apr 18 12:23:54 2008 -0400
+
+    Specs for Matrix.scalar and .identity/I.
+
+commit b68295e0046a2eb1fb911ea891d6e0a29174ea30
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri Apr 18 12:22:09 2008 -0400
+
+    Move the "needs to be reviewed" indicator to the right place.
+
+commit 4b6e1097feafe2247e59d6004a36bb0987734138
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri Apr 18 12:03:45 2008 -0400
+
+    Use size functions instead of constants.
+
+commit 2086f0c1f1f899f2e41307a5434a5bb6446e20a2
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri Apr 18 11:58:22 2008 -0400
+
+    Specs for Matrix#clone and #transpose (alias #t).
+
+commit 2939c55b2e9f38b5115b98429de97bc4fff6f165
+Merge: a47f2b8... 42d3212...
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri Apr 18 02:09:07 2008 -0400
+
+    Merge branch 'master' of git://github.com/evanphx/rubinius
+
+commit a47f2b852ca309a68b687157a6cd973716328887
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri Apr 18 01:27:06 2008 -0400
+
+    Basic specs for Matrix.zero.
+
+commit aa3b2eeef70cb8967ef6c92ee24a226c2d1202c1
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri Apr 18 01:20:27 2008 -0400
+
+    Move before block to a clearer place.
+
+commit ca6ac1e59ddb268b388975a2fb5b11e6026e65c8
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri Apr 18 01:19:27 2008 -0400
+
+    Write specs for Matrix.diagonal.
+
+commit b24216d8b0ecfba6888f909415e2523eaed2aeb2
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Fri Apr 18 01:11:11 2008 -0400
+
+    Some initial specs for Matrix#[] and Matrix.[].
+
+    These are in the same file because of coding conventions, but they probably should not be since .[] is a constructor and has very little in common conceptually with #[], which is a subscript operator.
+
+commit 9313f29ed952f604e0d124ced38ee930b5780b27
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Thu Apr 17 22:35:43 2008 -0400
+
+    New spec tags for Complex#%.
+
+commit 08f316de96c94b7d4865d77873327deddeabb664
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Thu Apr 17 22:32:08 2008 -0400
+
+    More specs for Complex.
+
+    * Specs for <=>, conj/conjugate, to_s.
+
+commit 973c304cc16fa6b78dba31de11b151da2daae762
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Thu Apr 17 22:09:20 2008 -0400
+
+    More specs for Complex
+    * Complex#abs, abs2, angle, arg, and %. Not sure that % is correctly specified.
+
+commit e32b26694277065fe28f138dca837b8c0509c735
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Thu Apr 17 21:17:26 2008 -0400
+
+    More specs for Complex.
+
+    * Write specs for * and /.
+    * Rewrite + and - to use alternate constructor syntax.
+
+    Signed-off-by: Marnen Laibow-Koser <marnen at marnen.org>
+
+commit 0cbf88a6c61e477f4b9a7758a9fab1258efbf30f
+Author: Marnen Laibow-Koser <marnen at marnen.org>
+Date:   Thu Apr 17 20:46:04 2008 -0400
+
+    Write some specs for Complex.
+
+    * Basic specs for Complex.new, Complex.new!, Complex#+, and Complex#-.
+
+    Signed-off-by: Marnen Laibow-Koser <marnen at marnen.org>
+
+commit 71909e78b8d77f7e48d306e30f51fbc21b5fbefb
+Author: Brian Ford <bford at engineyard.com>
+Date:   Thu Apr 17 15:26:53 2008 -0700
+
+    Reorganize and fix Matrix specs.
+
+commit 5a9325457696dfba3c410c0adcbdec706ecda3bf
+Author: Brian Ford <bford at engineyard.com>
+Date:   Thu Apr 17 12:49:45 2008 -0700
+
+    Added spec templates and incomplete tags for CGI.
+
+commit d62de6b4096a9b3bd3fda197b70d6e603596e865
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Thu Apr 17 21:12:08 2008 +0200
+
+    More detailed speecs for BigDecimal#new
+
+commit ebd6fb8f879f94ff51b74cb4e76080fad7b66cb5
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Thu Apr 17 19:55:31 2008 +0200
+
+    More detailed specs for BigDecimal's <, <=, >, >=, <=>.
+
+commit 8caef40cbe873dc2825bc0ba1e66f983b8219cca
+Author: MenTaLguY <mental at rydia.net>
+Date:   Thu Apr 17 01:16:25 2008 -0400
+
+    add tag object argument to send_in_*
+
+commit 0596b1aca45a85de5f3d727632585da924fd3eb0
+Author: Matthias Reitinger <m.reitinger at mytum.de>
+Date:   Sat Apr 12 10:11:13 2008 +0200
+
+    New specs for BigDecimal.new.
+
+    Signed-off-by: Marius Nuennerich <marius at nuenneri.ch>
+
+commit 5c176e50fe962de1095a75221b4d63e75acc505f
+Author: Benjamin Stiglitz <ben at tanjero.com>
+Date:   Wed Apr 16 11:32:18 2008 -0700
+
+    Cleaned up Numeric#div spec
+
+    The spec names are no longer quite as atrocious; the spec output is now fairly
+    readable. The different Integer-Float quotient permutations are now correctly
+    specified as well.
+
+    Signed-off-by: Brian Ford <bford at engineyard.com>
+
+commit e1406b19c51bfca5f6936d143087043316c68c13
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Tue Apr 15 20:07:48 2008 -0400
+
+    Specs for Kernel#p behaviour.
+
+    * Args vs. no args.
+    * Record separator is not taken into account.
+
+commit 30c717e1736b65a852df501f71e320599fc17786
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Tue Apr 15 21:32:13 2008 +0200
+
+    Fix typo in File.grpowned? spec
+
+commit 1bc17a0b4c8f19b84ffdd0b17ec24243a1df6092
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Tue Apr 15 21:31:02 2008 +0200
+
+    Fix File.grpowned? and it's spec
+
+commit f49cf4d0319b5772ede7bcddd763c691d5253b18
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Tue Apr 15 20:44:18 2008 +0200
+
+    Update tags for implemented File.grpowned? specs
+
+commit ea19fb07cb7b789165aec5da0f571345b96f1f0f
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Tue Apr 15 20:41:02 2008 +0200
+
+    Spec File::Stat#grpowned? and implement File.grpowned?
+
+commit c411b15b9f94fec21b02a9208cbae4b42452431d
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Tue Apr 15 20:19:24 2008 +0200
+
+    Properly rename File::Stat#dev_major and File::Stat#dev_minor specs
+
+commit 26ba3ad30cd726b058cd76f23dc7a79555be724e
+Author: Charles Oliver Nutter <charles.nutter at sun.com>
+Date:   Tue Apr 15 10:25:44 2008 -0700
+
+    Quarantine the cvar-related instance_eval spec for now; it's not clean.
+
+commit d72c609ce4567d7a7fdfd2ee4713ac07033c81db
+Author: Marius Nuennerich <marius at nuenneri.ch>
+Date:   Mon Apr 14 20:13:38 2008 +0200
+
+    Use EnvSpecs where possible
+
+commit 8ccdf2d612f15515837095e2e4a570861024294c
+Author: Marius Nuennerich <marius at nuenneri.ch>
+Date:   Mon Apr 14 17:42:36 2008 +0200
+
+    Use EnvSpecs module for platform dependent stuff
+
+commit 130e4bdb1d9fa9512dfe45d4ff4d718096683cdb
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Mon Apr 14 19:45:24 2008 +0200
+
+    Fix specs for a bunch of File::Stat methods and implement File::Stat#<=>
+
+    Created specs for atime, blksize, blocks, ctime, mtime and <=>
+
+commit e5aa89ff13128afb9b43ad77678792aeae4d48ea
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Sat Apr 12 17:54:57 2008 +0200
+
+    Remove tag for fixed File#lstat
+
+commit 21cd4a10833ef3bdda1593423faccb334de16536
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Sat Apr 12 17:52:33 2008 +0200
+
+    Remove unneccary spec placeholders for File#stat / File#lstat
+
+    The shared spec already tests this behavior. With the new added spec
+    for the difference between the two, File.stat / File.lstat is pretty
+    well covered for now.
+
+commit eacb4f8a4d0ba606458a5756ddd6f2ce723a3dfa
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Sat Apr 12 17:45:55 2008 +0200
+
+    Specced different behavior between File.stat and File.lstat
+
+commit 4ae163810074effc068babf538f004e9ff117156
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Mon Apr 14 16:49:04 2008 +1000
+
+    Refactor Debugger interface into a CmdLineInterface class
+
+commit e61241498f6ca63b7d5e50e94a70456bc40e929b
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Mon Apr 14 14:17:03 2008 +1000
+
+    Breakpoint clean-up
+
+commit ae738f21979edf727437438b992629dd0b59a42e
+Author: MenTaLguY <mental at rydia.net>
+Date:   Sun Apr 13 16:14:34 2008 -0400
+
+    elminate Mailbox#clear; difficult to implement with sane semanitics
+
+commit 76385484049e47f53b840ddf3c0dfe9e365ca8cf
+Author: Federico Builes <federico.builes at gmail.com>
+Date:   Sat Apr 12 16:39:19 2008 -0500
+
+    More specs for REXML::Element
+
+commit 00547bc562c359ddac13d04a5c955ee25171bcb4
+Author: Matthias Reitinger <m.reitinger at mytum.de>
+Date:   Sat Apr 12 11:15:12 2008 +0200
+
+    Fixed incorrect check for object equality in BigDecimal#nonzero? spec
+
+    One should not use == to check if the method returns self, but equal?
+
+    Signed-off-by: Federico Builes <federico.builes at gmail.com>
+
+commit e8403792167c86f120ce7bdcd1e2c7ce1bc31fea
+Author: Matthias Reitinger <m.reitinger at mytum.de>
+Date:   Sat Apr 12 11:31:25 2008 +0200
+
+    Eliminated use of to_s to check for NaN in BigDecimal specs
+
+    Changed "to_s.should == 'NaN'" to "nan?.should == true"
+
+    Signed-off-by: Federico Builes <federico.builes at gmail.com>
+
+commit 5883dd78ad92031c920bb9ee2b703702969a5854
+Author: Charles Oliver Nutter <charles.nutter at sun.com>
+Date:   Sat Apr 12 09:42:11 2008 -0500
+
+    A few more instance_eval specs, for non-immediate numerics and cvars.
+
+commit e8fd8e696d5487fa698a9a8b1bab2fb54b420133
+Author: Charles Oliver Nutter <charles.nutter at sun.com>
+Date:   Sat Apr 12 08:28:41 2008 -0500
+
+    Added instance_eval spec for defining methods under immediates.
+
+commit c23b365a95862cd438e6228929a3a4e935d60de9
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Apr 11 22:09:06 2008 +0200
+
+    New rubypsecs for BigDecimal#fix and #frac.
+
+commit 6b6b63ebedb61466b4f04f510bf859574efec7d9
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Apr 11 20:07:07 2008 +0200
+
+    New rubyspecs for Bigdecimal#floor and #ceil.
+
+commit 75e9118aea32baaeec82efedb5106c63bb0eef44
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Apr 11 17:50:36 2008 +0200
+
+    Corrected Bigdecimal specs since they were missing "should" statements. :)
+
+    Also, added some more cases.
+
+commit 18fafb2e1f653887fdd3cdef693448d9b2bea29e
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Apr 11 17:21:02 2008 +0200
+
+    New rubyspecs for BigDecimal's #power, #** and #exponent.
+
+commit 35e32daa38c7df385aac99f7b709a4038141faaa
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Apr 11 13:41:13 2008 +0200
+
+    New and updated rubyspecs for BigDecimal#precs.
+
+commit e0172d4eee7a775ab53562477997855ed66615a7
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Apr 11 12:31:22 2008 +0200
+
+    More rubyspecs for BigDecimal#split and some corrections for older ones.
+
+commit 37d312770700da5eb124fdce7a7b1687c2d9b839
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Fri Apr 11 13:55:00 2008 +1000
+
+    Get breakpoint handling working properly
+
+commit 498b95a720e98b70b56af9dfd2c1ba20c0bf89c3
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Wed Apr 9 17:23:56 2008 +1000
+
+    Make ISeq#decode return symbols rather than objects by default
+
+commit b8bda0546cdb9ac04ae629f13ccfce5f474e6f2c
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Mon Mar 17 14:33:45 2008 +1100
+
+    Ensure breakpoint original instruction is correct
+
+    When multiple breakpoints are set at the same location,
+    only the first breakpoint sees the original instruction.
+    This commit ensures the BreakpointTracker detects such
+    situations, and updates the breakpoint to set the correct
+    oringinal instruction to use.
+
+commit 2700924f23e0283a059583f9e92188b1c3c4f220
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Thu Mar 13 17:20:49 2008 +1100
+
+    Reorganize Breakpoint class hierarchy
+
+    Refactor Breakpoint class hierarchy in preparation for
+    adding PersistentBreakpoint and BreakpointRestorer classes.
+
+commit bfa69d930c38897df18b656d7b86f0b549bed57f
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Apr 11 03:01:37 2008 +0200
+
+    Some more test cases for BigDecimas#finite? and #nonzero?.
+
+commit 71a4b0a51ea4da0c41d7b096aa7b88deb8d0d049
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Apr 11 02:42:33 2008 +0200
+
+    A bit more rubyspecs for BigDecimal#sub and #to_s.
+
+commit 8ff9ae455c6c7f4b38f3b4dcbdc6c677759f13e2
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Apr 11 01:35:16 2008 +0200
+
+    New rubyspecs for BigDecimal#truncate.
+
+commit f0a5c13f218d1e2187dfff09bd27cbd6dde544ca
+Author: Brian Ford <bford at engineyard.com>
+Date:   Thu Apr 10 15:09:55 2008 -0700
+
+    Converted VMActor specs to dir/files. Added incomplete tags.
+
+commit df74b0fd98597b51d4c1d51ae09706d51e1a5d3c
+Author: Brian Ford <bford at engineyard.com>
+Date:   Thu Apr 10 15:01:08 2008 -0700
+
+    Converted Mailbox specs to dir/files. Added incomplete tags.
+
+commit 29d223d8bfcc36edc16db58d50f8186905df773a
+Author: Brian Ford <bford at engineyard.com>
+Date:   Thu Apr 10 14:49:52 2008 -0700
+
+    Converted Actor specs to dir/files. Added incomplete tags.
+
+commit 08ab8db440cfdaa7e06b19a0d88750678d4fccbf
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Thu Apr 10 22:09:39 2008 +0200
+
+    New rubyspecs for bigdecimal, and excludes.
+
+commit b76a9e964899348d667181d288c5d4ec0e422c9f
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Thu Apr 10 19:33:03 2008 +0200
+
+    One rubyspec for the class definition: def nil:Foo; end
+
+commit c526f5744ece40e312340556991ee54e4504ebcd
+Author: Brian Ford <bford at engineyard.com>
+Date:   Thu Apr 10 00:53:06 2008 -0700
+
+    Processed Rational, Complex, Matrix with mkspec.
+
+commit 3de6f530c42bdca8c9b1202e60d0d14850024d15
+Author: Brian Ford <bford at engineyard.com>
+Date:   Thu Apr 10 00:27:40 2008 -0700
+
+    Processed IO with mkspec. Added incomplete tags.
+
+commit faaf8bdb8893f71234d7e2fab07aa11d6c556384
+Author: Brian Ford <bford at engineyard.com>
+Date:   Thu Apr 10 00:17:35 2008 -0700
+
+    Clean up especially bad whitespace in File specs.
+
+commit fedda8f6865c6cdb07c7599606204f0700042574
+Author: Brian Ford <bford at engineyard.com>
+Date:   Thu Apr 10 00:09:56 2008 -0700
+
+    Processed File specs with mkspec. Added incomplete tags.
+
+commit 09f6f1b5138b7ca1d276a8c68ee6bf1cba7691b7
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Apr 9 23:42:40 2008 -0700
+
+    Processed Kernel specs with mkspec. Added incomplete tags.
+
+commit e3ca2e3e077c0e026b96e1e68808b95d44233cf5
+Merge: cf0c855... 4d0d1f6...
+Author: Thomas Lachmann <thomas_lachmann at gmx.de>
+Date:   Thu Apr 10 02:48:31 2008 +0200
+
+    Merge branch 'master' into bigdecimal_specs
+
+commit cf0c8552f31cfd856822c8aa43a5d9d265481ac0
+Author: Thomas Lachmann <thomas_lachmann at gmx.de>
+Date:   Thu Apr 10 02:40:22 2008 +0200
+
+    Next bunch of specs for Bigdecimal.
+
+commit 4d0d1f6b98ac2dafa487ece31512443a07bbc928
+Author: Marius Nuennerich <marius at nuenneri.ch>
+Date:   Wed Apr 9 23:42:10 2008 +0200
+
+    Fix ENV specs
+
+     * Try to avoid `env`
+
+commit dfcc69ea8bd78e9e463defdef3b4529a5af40bb5
+Merge: 75e6ccd... 6a50f0d...
+Author: Marius Nuennerich <marius at nuenneri.ch>
+Date:   Wed Apr 9 22:26:26 2008 +0200
+
+    Merge branch 'master' of git://git.rubini.us/code
+
+commit 75e6ccd48bce9e0e939a0ff1d484f14a029969f9
+Author: Marius Nuennerich <marius at nuenneri.ch>
+Date:   Wed Apr 9 22:26:11 2008 +0200
+
+    Fixes for ENV
+
+     * Add specs
+     * Add some missing methods to ENV
+
+commit 6a50f0d2f5146901fe96fe86802df155c9266a21
+Author: Thomas Lachmann <thomas_lachmann at gmx.de>
+Date:   Wed Apr 9 21:11:05 2008 +0200
+
+    Fixed failures for BigDecimal#specs.
+
+commit 09bc62e39a8b92c25aeb6287f9fbf4e9cd2b9a6f
+Author: Thomas Lachmann <thomas_lachmann at gmx.de>
+Date:   Wed Apr 9 19:55:45 2008 +0200
+
+    Bunch of specs for BigDecimal.
+
+commit c281add79d621f6327740109895c624dd25a2e1b
+Author: Federico Builes <federico.builes at gmail.com>
+Date:   Wed Apr 9 09:13:29 2008 -0500
+
+    Cleaning up UPSocket#send specs
+
+    * Got rid of the weird exception catching
+    * DRY things up a bit with before :each
+
+commit 8ebefe3c0a61b7aab8ac3d0ae9768c35b657cdb6
+Author: Federico Builes <federico.builes at gmail.com>
+Date:   Wed Apr 9 09:11:43 2008 -0500
+
+    Adding spec helpers to REXML specs
+
+commit e3064084efbbac1147d477435010d933ce101413
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Tue Apr 8 22:20:43 2008 -0400
+
+    Amended spec wording for Singleton._load slightly. Updated exclude.
+
+commit 23e621625b95e0db82bd406a5eb8fa7324e41a6e
+Author: Chris Shea <chris at tie-rack.org>
+Date:   Tue Apr 8 15:49:11 2008 -0600
+
+    Create spec for Marshal.load of Singleton instance
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit eec07baa07d591059c64f32c0ddef169cfcccaef
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Tue Apr 8 20:20:02 2008 -0500
+
+    Thread#wakeup deadlock for MRI marked as ruby_bug
+
+commit dbb744d9692c2432d7aebecac17365125efe9087
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Tue Apr 8 20:02:08 2008 -0500
+
+    spec for wakeup which causes MRI to deadlock when it shouldn't
+
+commit 208a7df6ec2d3c8f550a7ac24db849e593cdc9f3
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Tue Apr 8 17:58:15 2008 -0500
+
+    specs for Thread::list
+
+commit f6f307e75e49cdf597b0b3755ab214c6fc1950dd
+Author: Thomas Lachmann <thomas_lachmann at gmx.de>
+Date:   Wed Apr 9 00:54:34 2008 +0200
+
+    specs for BigDecimal.new and BigDecimal#zero? (plus tag files).
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit 5b1f2043f70b0088f1c32be79eeaa8179c2210a6
+Author: Jeff Rose <jeff at rosejn.net>
+Date:   Wed Apr 9 00:44:27 2008 +0200
+
+    Specs for Actor linking and registration, and Mailbox timeouts.
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit 4eea149d3d503c121fb7c65115e374838fff8c8a
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Tue Apr 8 14:55:18 2008 -0700
+
+    Added extra Array subclass dup spec
+
+commit 783a884931b718b8fa65dd9768fbebd8a0d1ac0c
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Tue Apr 8 14:18:45 2008 -0700
+
+    minor cleanup
+
+commit 0e047cc97aa6a5acd7193bdde1139f6a89f108b8
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Tue Apr 8 14:18:27 2008 -0700
+
+    minor cleanup
+
+commit f4797827393e0d9d0e5df5aa5184ecebb066d766
+Author: Matthias Reitinger <m.reitinger at mytum.de>
+Date:   Tue Apr 8 17:08:32 2008 +0200
+
+    Extended Symbol#inspect spec and reworked Symbol#inspect to fulfill them
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit b3c3a5f60177f9c52725b6cacf019412d2c747ea
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Tue Apr 8 17:29:58 2008 -0400
+
+    Excludes for BigDecimal specs.
+
+commit b7cd3c38d146a7833ef1d426ea8acd4ee4cb09bf
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Tue Apr 8 17:13:48 2008 -0400
+
+    Switched #requires around to have access to #pretty_inspect.
+
+commit aba428095e09ead8ed66895b175e5f3673c4310e
+Author: Thomas Lachmann <thomas_lachmann at gmx.de>
+Date:   Tue Apr 8 17:45:13 2008 +0200
+
+    Spec for BigDecimal#to_f.
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit 20a5789f9dc4e6d30dffb594476b354e4aeee201
+Author: Thomas Lachmann <thomas_lachmann at gmx.de>
+Date:   Tue Apr 8 17:21:39 2008 +0200
+
+    Spec for BigDecimal#finite?
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit 896609e7ae8ee12c72e4e3ce86897c1f8b98f3fb
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Tue Apr 8 02:03:22 2008 -0700
+
+    overlooked 2 specs
+
+commit 77774ed4300d5245c58dbcc686cd72dc48f08a1f
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Tue Apr 8 02:00:24 2008 -0700
+
+    Added a bunch of specs to String#to_f
+
+commit 1b91113c3e8fb46a0d355cae9000ee4c82f95ac3
+Author: Federico Builes <federico.builes at gmail.com>
+Date:   Mon Apr 7 21:46:17 2008 -0500
+
+    More specs for REXML
+
+commit 2460839e3fbe2967b9df70db3de33b2a102b9a44
+Author: Brian Ford <bford at engineyard.com>
+Date:   Mon Apr 7 12:19:40 2008 -0700
+
+    Reworked how MSpec handles config files. Use 'set :sym, value' now.
+
+commit 67d3869e9b3fef6d47727206d02814da410e02fc
+Author: Jeff <rosejn at warp.(none)>
+Date:   Mon Apr 7 15:04:09 2008 +0200
+
+    Adding specs for Mailbox and Actor, and renaming the VMActor describe to match the standard scheme.
+
+    Signed-off-by: Charles Comstock <dgtized at gmail.com>
+
+commit 7391c1fbc02966165de03724c42fc1d5243ac99f
+Author: Marius Nuennerich <marius at nuenneri.ch>
+Date:   Sun Apr 6 22:29:22 2008 +0200
+
+    repair UDPSocket spec
+
+    Signed-off-by: Dirkjan Bussink <d.bussink at gmail.com>
+
+commit 5a205207faad0a85271bfcb459390793702c4143
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Apr 5 04:54:21 2008 -0400
+
+    Partially revert "Add spec files for cgi.rb."
+
+    This partially reverts commit e2714f2fd2d8825ac8af761a5a4545e4d0731735.
+
+    Conflicts, left these files:
+
+    	spec/ruby/1.8/library/cgi/escapeHTML_spec.rb
+    	spec/ruby/1.8/library/cgi/escape_spec.rb
+    	spec/ruby/1.8/library/cgi/rfc1123_date_spec.rb
+    	spec/ruby/1.8/library/cgi/unescapeHTML_spec.rb
+    	spec/ruby/1.8/library/cgi/unescape_spec.rb
+
+commit 22f3042377731cb6ff963b9e322b24014b286895
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Apr 5 03:18:15 2008 -0400
+
+    Added excludes for the CGI specs.
+
+commit 7b9f5a213c971636b663e992fcb8578888d27f52
+Author: makoto kuwata <kwa at kuwata-lab.com>
+Date:   Sat Apr 5 13:03:59 2008 +0900
+
+    Add spec file for CGI::rfc1123_date().
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit 31edbd64bba7f352930ac04d51b63e72553796a9
+Author: makoto kuwata <kwa at kuwata-lab.com>
+Date:   Sat Apr 5 13:03:14 2008 +0900
+
+    Add spec files for CGI::escapeHTML() and CGI::unescapeHTML().
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit fc321869d73f58dcfbb55ba374646c1568528004
+Author: makoto kuwata <kwa at kuwata-lab.com>
+Date:   Sat Apr 5 13:01:33 2008 +0900
+
+    Add spec files for CGI::escape() and CGI::unescape().
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit e2714f2fd2d8825ac8af761a5a4545e4d0731735
+Author: makoto kuwata <kwa at kuwata-lab.com>
+Date:   Sat Apr 5 12:44:57 2008 +0900
+
+    Add spec files for cgi.rb.
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit 2a1d0ad7e51ba52a918111d53be6a641c41a0445
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Fri Apr 4 22:21:47 2008 -0400
+
+    Improved the *rest argument count spec a bit.
+
+commit e8053e4bb108cf877ac8fdafc104eb34bad671f0
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Fri Apr 4 20:38:23 2008 -0400
+
+    Specs for unlimited argument count for *rest defns.
+
+commit 03e092e45015f8115f806e11460121c560e60b4b
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Fri Apr 4 17:54:25 2008 -0700
+
+    Converted symbol spec to be generative, allowing easier pattern detection
+
+commit bbda617127a8ac319a58fa190d43b3a0d960d309
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Fri Apr 4 14:07:50 2008 -0500
+
+    updated File#inspect tags
+
+commit 38eb679d6b6c5aef8bccb2139e681c926b3290c7
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Fri Apr 4 06:00:37 2008 -0400
+
+    Specs for ~/ expansion in #require, #load. It has broken at some point.
+
+commit 2d600c01205fbb7ccd98e7f7a88ebcbd0e1d1d43
+Author: Paul Thornthwaite <tokengeek at gmail.com>
+Date:   Fri Apr 4 08:43:42 2008 +0100
+
+    Updated specs for Set library
+
+    * Added specs for Set#subset and Set#proper_subset
+    * Added specs covering empty sets and comparisons
+    * Corrected spec string to include ? on superset method names
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit 3a547c2b82434c64b72967ebd917fc063ff1317d
+Author: Brian Ford <bford at engineyard.com>
+Date:   Thu Apr 3 23:16:18 2008 -0700
+
+    Fixed GetoptLong specs to not depend on value of ARGV.
+
+commit 5dd9b0ecdddfd990d6387a0a7c70173ea0cededa
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Apr 2 23:27:04 2008 -0700
+
+    Add config file for and rework MSpec runners.
+
+commit 773a13ed9005628e48ed146180041caa035f4072
+Author: David Yip <yipdw at member.fsf.org>
+Date:   Thu Apr 3 03:18:48 2008 -0400
+
+    Added spec: full contents of StringIO stream should be accessible after rewind.
+
+    Spec tested against Ruby 1.8.6p111 and Ruby 1.8.6p114 on OS X 10.4.11.
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit ba2ca41cb29ac08c94231a2383940464e6fd1c9d
+Author: Federico Builes <federico.builes at gmail.com>
+Date:   Thu Apr 3 08:45:49 2008 -0500
+
+    Updated tags for REXML specs
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit 09c080bf33092b9d147d1b0a5de920fce8527fdc
+Author: Federico Builes <federico.builes at gmail.com>
+Date:   Thu Apr 3 08:45:26 2008 -0500
+
+    Fixes whitespace in REXML::Element specs
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit 3a997bc18f589b91b4cd518448644171f3054abf
+Author: Federico Builes <federico.builes at gmail.com>
+Date:   Thu Apr 3 08:29:23 2008 -0500
+
+    More specs for REXML::Element
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit d250939060a4a91a6fee59bd4bfa4e86eb271373
+Author: Paul Thornthwaite <tokengeek at gmail.com>
+Date:   Thu Apr 3 14:36:42 2008 +0100
+
+    Specs for Set#superset and Set#proper_superset added
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit 01399738d5ad0136ef205b8501b12012c7e42230
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Thu Apr 3 18:09:20 2008 -0400
+
+    Removed excludes for Object#kind_of?, #is_a?.
+
+commit 0e7d1c6e02e5617bb251366e0d60760edb29377e
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Thu Apr 3 20:04:34 2008 +0200
+
+    Fixed copy-paste error in Object#is_a? specs.
+
+    Adjusted the Object#is_a? exclude.
+
+commit 4a9cb7cc0c734b4280c3a65906c85e1c1e2f4990
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Thu Apr 3 19:02:05 2008 +0200
+
+    Add specs for #kind_of? / #is_a? behaviour that are failing in Rubinius.
+
+commit e88fdb6cbd9fa829a81e6c7664e88f6956ddae64
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Thu Apr 3 07:18:56 2008 -0400
+
+    Spec to check `A = 12; class A; end` raises TypeError. Works as is.
+
+commit 3c0db09626333405bdcb72e62ddb8fb2ea176ff5
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Thu Apr 3 06:44:32 2008 -0400
+
+    Spec for const lookup: `A = 12; class A::B; end` should raise TypeError.
+
+    * Currently crashes due to a lookup problem.
+    * VVSiz discovered and reported.
+
+commit edda5994c293e4d26b4a741e90e0ab61513e8dec
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Wed Apr 2 16:39:09 2008 +1100
+
+    Do not strip leading spaces in debugger output
+
+commit eecc2bca5045921368378abfccafcf70339441f9
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Apr 2 21:34:52 2008 +0200
+
+    Enabled File#truncate testcase for JRuby.
+
+commit 4d555cf50dfe6a8e9cb2f24a6a636a9df3f03768
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Apr 2 20:03:02 2008 +0200
+
+    Added test case to File.open rubyspecs.
+
+    Courtesy of David Yip.
+
+commit 42f0b52cd9fbac4a39fc1e5c2a241462bee5bf3b
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Apr 2 01:11:38 2008 -0700
+
+    Use kind_of instruction since #kind_of? is not available at all times.
+
+commit 9ee52514eee820b9af7c9e6d2eaaca8d2bca363b
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Tue Apr 1 17:16:47 2008 -0500
+
+    IO#reopen should return self
+
+commit f1481283091fcbe662fd01d409f5a2d2d7e3aa59
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Tue Apr 1 18:57:06 2008 -0500
+
+    added primitive io_close_ng and tagged IO#close spec failures
+
+commit 3861e75e01af9319e2af879e2644fc8509947903
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Tue Apr 1 16:07:27 2008 -0500
+
+    IO#close should return nil and refactored TCPServer.accept specs
+
+commit d6dfbd3b0bab57453e67991c3320744b08346979
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Tue Apr 1 15:04:18 2008 -0500
+
+    DRb specs now attempt to check if server is up/down prior to each call to start_server
+
+    note that there is something wrong with the way stop_server works in rubinius as it appears that the TCPServer is still binding the port.  Spec is tagged to deal with this but technically it's probably a bug in TCPServer
+
+commit 4119fe8baab45be6b1d1370b8a9537e710b1a60a
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Tue Apr 1 12:40:47 2008 -0400
+
+    Sanity changes to #load specs to bring them up to date.
+
+    * Please change the specs if you change the implementation, sheesh.
+
+commit 3b58cb35abeba31f7ac72e3ab37b2630949406a7
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Tue Apr 1 10:59:58 2008 -0400
+
+    Spec for forced recompiling through second parameter of Kernel#load.
+
+commit 5d7a73ae15a4c40e31486a60cbb66f3de1ac4697
+Author: David Whittington <djwhitt at gmail.com>
+Date:   Wed Apr 2 02:57:35 2008 +0000
+
+    Add tags for failing private keyword specs
+
+commit 1b2f118be7ff9b6adfea736ecbbb8f3fd8dd0f49
+Author: David Whittington <djwhitt at gmail.com>
+Date:   Wed Apr 2 02:53:43 2008 +0000
+
+    Added a couple evil private keyword tests
+
+commit f58c67e33a99f751c3520ab65c96e28a91c45900
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Tue Apr 1 09:59:22 2008 -0400
+
+    Conditional compilation. Rubinius.compile_if($DEBUG) { p somevariable }.
+
+    * Hacky and probably fragile but it seems to work. Whenever the gvar
+      given as condition evaluates to false, the entire block is omitted
+      from the produced bytecode. If it evaluates to true, then the extra
+      block itself is stripped and only the block contents remain.
+    * Do NOT use indiscriminately until we have played around with it for
+      a bit to avoid problems.
+    * Manipulates the sexp, not the AST to avoid worrying about locals
+      and scopes and whatnot.
+    * Enabled by default; for example -d will work out of the box (you
+      do need to have the file recompiled obviously.)
+
+commit 4f78ee2b0bebb9170a483927af9c7520ca67f912
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Tue Apr 1 09:58:53 2008 -0400
+
+    Specs to verify conditional compilation in the compiler.
+
+commit 8dfece35e3bc83e14e92bfee9ea0ebabb795da70
+Author: Brian Ford <bford at engineyard.com>
+Date:   Tue Apr 1 01:07:14 2008 -0700
+
+    Fix up language symbol specs.
+
+commit 29cc22f2c1f7ce2ce15a7f339d1159cf93510daa
+Author: Brian Ford <bford at engineyard.com>
+Date:   Tue Apr 1 00:40:34 2008 -0700
+
+    Constant lookup only searches class or module (#457).
+
+commit 538611f2aa06a1cf1c3958583bd6a8487deee994
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Mon Mar 31 18:03:41 2008 -0400
+
+    Spec for empty loop body.
+
+commit fd0d1079671d7664de3a6a836c5e5624d487a4e1
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Mon Mar 31 23:47:40 2008 +0200
+
+    Spec for constant lookup on non Module or Class objects
+
+    This exposes the bug also described in ticket \#457
+
+commit 3b7cf550c70db2dd53cb58ef3efd2651ee352134
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Mar 31 21:53:40 2008 +0200
+
+    Added a couple of Dir.glob/Dir[] rubyspecs.
+    (Courtesy of Roland Swingler)
+
+commit bbfa77a8517390bdc807f41bfe6d101791980d8f
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Mar 31 19:04:09 2008 +0200
+
+    Fixed DRb rubyspecs (proper spec name,  removed invalid file, better cleanup).
+
+commit d8a4fb0b16dc4c722cf148ff83bcad05fbb4af1e
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Mar 31 14:29:54 2008 +0200
+
+    Make sure Marshall#load rubyspec closes the file.
+
+commit 4082a7663eaef50000be46d909c22fbb97a1a3e8
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Mar 31 13:57:35 2008 +0200
+
+    Reverted new Range#step rubyspecs, since they fail on MRI and JRuby.
+
+    Partial revert "Fixes for Range#step."
+    This (PARTIALLY) reverts commit a6b06a67207c40ffa9ccf191c051fdf2fa0f5359.
+
+    The specs are reverted since they fail on:
+    MRI 1.8.6 pl  36 (Ubuntu default)
+    MRI 1.8.6 pl 114 (Current compatibility target)
+    MRI 1.8.6 from 1_8 branch
+    MRI 1.9 from Ruby trunk
+    JRuby 1.1 from trunk
+
+    The specs expect that to_f is invoked, but MRI and JRuby don't behave
+    that way. Furthermore, Float is not a special case. There are other
+    cases, like Rational. Take a look into MRI code, there is no special
+    handling for Float.
+
+    Please, test your spec updates at least against the current
+    compatibility target (MRI 1.8.6 patchlevel 114) to avoid problems.
+
+commit 6d9680ecaaa2a9aadd35699c8064bf6481acc107
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Mar 31 13:23:20 2008 +0200
+
+    Added new rubyspecs for IndexError out of String#[]=
+
+commit c8a52bb7cf191bb35efc89c560bdeced4241f015
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Mon Mar 31 04:38:49 2008 -0400
+
+    Split Regexp#=~, #match specs; they behave differently on match.
+
+    * #=~ Returns index, #match returns MatchData.
+    * Grammar fixes.
+
+commit 6c2727e928991cdf9f809cb5941c3afedb5171ff
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Mon Mar 31 04:07:17 2008 -0400
+
+    Fix Regexp#match, #=~ spec to actually be shared. Exposes #454.
+
+commit e258a2bccafffba57ab86d1c1a104839bda424da
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Mon Mar 31 03:30:48 2008 -0400
+
+    Spec to verify IO behaviour with an altered BufferSize from Le Huy.
+
+    * Moved spec to spec/core/io/ and simply used the first one.
+    * This problem seems to have been largely corrected.
+
+commit 7a39be8bea055464838ff24c70e170a91f8df68c
+Author: Ben Burkert <ben at benburkert.com>
+Date:   Sat Mar 29 19:39:11 2008 -0500
+
+    Added spec for Module#define_method
+
+    Methods defined by define_method with a proc should have the
+    same scope for local variables as the proc.
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit 12c639d90ff3d14f8010ca7c782612bd7c1777ab
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Mar 29 23:58:13 2008 -0400
+
+    Tony Arcieri's specs for inter-VM Actors.
+
+    * VMActor implements the Actor interface to work in Rubinius' Multi-VM
+      context: VMActors can reside on any VM instance.
+
+commit a0d0884aa3c9e7a6fa949cbde1cdf2392bc4ff23
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Mar 29 15:59:42 2008 -0400
+
+    Module#attach_foreign allows using a symbol to give the function name.
+
+    * Specs for the same.
+
+commit a5f397f38d6c9eafcac163c2cf678d5c55a6b79b
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Fri Mar 28 23:40:04 2008 -0400
+
+    Specs for FFI in general and Module#attach_foreign in particular.
+
+    * Very basic specs to verify that FFI in fact works correctly.
+    * We need to define what the behaviour should be in the case of e.g. an
+      incorrect function signature. Currently it may or may not cause SEGVs
+      depending on the exact usage. Remainder specs are in but quarantined.
+
+commit 3dc5c635b56bc599a718a94f990976b67ab52b6c
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Wed Mar 26 02:01:12 2008 -0400
+
+    Specs for Module#attach_foreign.
+
+    * The method is a replacement for #attach_function but allows
+      giving the library name as well to access external libs.
+    * This acts a higher-level interface to FFI.create_function. The
+      "real" FFI specs will be written for that method instead.
+
+commit 677412353409ba4e5d67f19a3d095c62d009c88f
+Author: Brian Ford <bford at engineyard.com>
+Date:   Fri Mar 28 18:04:40 2008 -0700
+
+    Added CType#isctrl, #toprint. Rework String#inspect, #dump.
+
+commit 87ba991b9b488b808ebf729b9e41765df76cc602
+Author: Brian Ford <bford at engineyard.com>
+Date:   Fri Mar 28 15:09:11 2008 -0700
+
+    Reworked String#each and #sum. Added String#modified? and specs.
+
+commit 204d8ce1a792a61882e549953b5b878139ac9cda
+Author: Hongli Lai <hongli at plan99.net>
+Date:   Fri Mar 28 23:32:18 2008 +0100
+
+    Spec: Marshal raises EOFError on loading an empty file
+
+    Signed-off-by: Michael S. Klishin <michael at novemberain.com>
+
+commit f6e698f96ce9e2a8c8abe856322add02931df8b7
+Author: Michael S. Klishin <michael at novemberain.com>
+Date:   Sat Mar 29 02:20:23 2008 +0200
+
+    Tag new spec for ensure as failing
+
+commit ef7e4436389a0f4346b3a3bc5c275b653f46d6bb
+Author: Hongli Lai <hongli at plan99.net>
+Date:   Fri Mar 28 23:22:44 2008 +0100
+
+    Add spec for exception handling inside ensure block.
+
+    Signed-off-by: Michael S. Klishin <michael at novemberain.com>
+
+commit f54c91f6cb7498fe44b1b05a1372d9f6ed3ea1ee
+Author: Stuart Halloway <stu at thinkrelevance.com>
+Date:   Fri Mar 28 10:11:05 2008 -0400
+
+    Fixes Pathname#absolute? and #relative?.
+
+    * specs now pass
+    * underlying cause was corner case in File#basename
+    * new passing spec for corner case
+
+    Signed-off-by: Charles Comstock <dgtized at gmail.com>
+
+commit 0d4606d53d8fc0bcb2370bd648546abffd402673
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Fri Mar 28 16:45:47 2008 -0500
+
+    fixed CSV::Reader.parse spec to use local fixtures
+
+commit 35a15c6c85ebb6eabaec16e03aa88399061844e9
+Author: Alister Lee <rubinius at dev.shortepic.com>
+Date:   Sat Mar 8 18:11:24 2008 +1100
+
+    Beginning of specs for CVS::Reader.parse
+
+    Signed-off-by: Charles Comstock <dgtized at gmail.com>
+
+commit d4161a379eab621e338a8c82f088b834756082e9
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Fri Mar 28 16:39:50 2008 -0500
+
+    removed csv/reader/parse_spec to commit alister lee's spec
+
+commit 534806c10a95435873efcb0d215732d7da4f2fd6
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Fri Mar 28 16:38:03 2008 -0500
+
+    mkspec generated specs for csv.rb
+
+commit a6b06a67207c40ffa9ccf191c051fdf2fa0f5359
+Author: Stuart Halloway <stu at thinkrelevance.com>
+Date:   Fri Mar 28 06:09:34 2008 -0400
+
+    Fixes for Range#step.
+
+    * previously failing specs pass
+    * new spec added to cover float/int difference
+
+    Signed-off-by: Michael S. Klishin <michael at novemberain.com>
+
+commit 6886ec5851783c5364ff5bc464ee94071fc8535e
+Author: Michael S. Klishin <michael at novemberain.com>
+Date:   Fri Mar 28 00:06:56 2008 +0200
+
+    Update stdlib and specs for REXML from 1.8.6 patchlevel 114 (see details!)
+
+     * Update stdlib/rexml to use REXML from Ruby 1.8.6 p114.
+     * REXML in p114 is screwed up: call sites were not updated
+       after REXML::Formatters::Transient#initialize arity
+       change. Ruby 1.8.x branch in SVN though has
+       completely different REXML layout and organization
+       (rev. 15833) so there's no way to fix it until we know
+       where REXML changes are headed in 1.8.x branch.
+     * Update REXML spec and tags for it.
+
+commit 3145a74a85d72f6ef8a93384a74d96a589bfb5eb
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Mar 26 22:27:41 2008 -0700
+
+    Rework and cleanup of various String methods.
+
+    Also, ensure that when Strings are converted through FFI
+    and passed to C functions, the char array is explicitly
+    terminated with \0.
+
+commit 9ba3e515b49729e0cb80181af9e28e3ce4c70e97
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Mar 26 18:40:57 2008 -0700
+
+    Shuffle some String methods. Add specs for and rework String#substring.
+
+commit 990d47b84bc6301be2a8bcbaccbae65ef697c417
+Author: Brian Ford <bford at engineyard.com>
+Date:   Tue Mar 25 16:22:45 2008 -0700
+
+    Added String#compare_substring. Reworked String#chop! and #chomp!.
+
+    Also, to ensure that ByteArray instances that are accessible in
+    Ruby are properly handled by C functions, changed string_equal_p
+    to use strncmp instead of strcmp.
+
+commit f47c446daa136e6f31f5c590dd535ba22e89a0b2
+Author: Brian Ford <bford at engineyard.com>
+Date:   Tue Mar 25 11:36:16 2008 -0700
+
+    Fix errors in String#count_table spec descriptions.
+
+commit 9425d0de9a7883c14de6ae9ae5db05ab92141ab9
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Wed Mar 26 22:38:48 2008 +0100
+
+    Guarded two failing specs on OpenBSD that also fail on MRI
+
+    MRI on OpenBSD also suffers from the 0.0 / -0.0 issue (the
+    GCC version on that platform too). The child reaping spec
+    also fails on both MRI and Rubinius
+
+commit 288a6e2ca3675a1e60bfd6b8b328c2a4d513c12f
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Wed Mar 26 22:15:16 2008 +0100
+
+    Fix Socket specs for more strict BSD behavior
+
+commit 63513d23f16ca7919b8605e016a3a941b79c0834
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Tue Mar 25 17:20:53 2008 -0700
+
+    oops! extra exclude
+
+commit a36a4bf8cde95c99282e07f46438430588288736
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Tue Mar 25 17:20:19 2008 -0700
+
+    really minor changes
+
+commit e9b759812deaf97e7fe5846c116d53f69b63e244
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Tue Mar 25 17:19:41 2008 -0700
+
+    Added the sucky parser spec--not passed yet
+
+commit 90eb74998e132373e6b96e3c66bfa909854e3ef0
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Tue Mar 18 17:41:50 2008 -0700
+
+    Added spec for 'a [ 42 ]'
+
+commit 2d34643c75b53b832e89d2473d501ab1c8a5df02
+Author: David Whittington <djwhitt at gmail.com>
+Date:   Wed Mar 26 08:01:20 2008 +0000
+
+    Tagged Generator specs as unstable due to memory consumption
+
+    Each spec consumes > 60MB of memory. After looking at the specs there is no way
+    they should be consuming that much memory.
+
+commit 52d81e0593dbca8abfecefe2e9c3d2ab504cfe0b
+Author: Brian Ford <bford at engineyard.com>
+Date:   Tue Mar 25 10:43:17 2008 -0700
+
+    Added String#copy_from primitive. Reworked String justify methods.
+
+commit 1aabda50ea82974b96a7032a0ea13865b2332b5d
+Author: Brian Ford <bford at engineyard.com>
+Date:   Mon Mar 24 21:57:02 2008 -0700
+
+    Added Tuple.template and reworked String#tr and friends.
+
+commit bc7d9ccb8b8ca77d8479f325ea314fc09bc34907
+Author: Brian Ford <bford at engineyard.com>
+Date:   Fri Mar 21 00:51:10 2008 -0700
+
+    Rework methods that behave like String#count.
+
+commit 1e5ac9a6818c972882e080aeb723a105108e0c57
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Mar 19 21:25:07 2008 -0700
+
+    Rewrite of String#casecmp, approx 2x faster.
+
+commit c39f2cb708169d35c2fbeb969ee3323c704f0566
+Author: Matt Palmer <mpalmer at engineyard.com>
+Date:   Tue Mar 25 21:09:37 2008 +1100
+
+    Some specs for the timeout library
+
+commit cb69bdadeb10cf6b4b2c71a095562f8d8371d76d
+Author: Federico Builes <federico.builes at gmail.com>
+Date:   Mon Mar 24 17:55:23 2008 -0500
+
+    Small fix for Socket.getaddrinfo spec
+
+    Signed-off-by: Michael S. Klishin <michael at novemberain.com>
+
+commit 5c3a61edef3c456b8296e65f8e06026347339a36
+Author: Federico Builes <federico.builes at gmail.com>
+Date:   Mon Mar 24 17:06:36 2008 -0500
+
+    Fix for the socket's issue
+
+    Signed-off-by: Michael S. Klishin <michael at novemberain.com>
+
+commit f3fd9ac4eebd0bc2a0a06bbe06921463d03177eb
+Author: Federico Builes <federico.builes at gmail.com>
+Date:   Mon Mar 24 14:10:46 2008 -0500
+
+    Fixes specs for Socket and adds a gethostname spec
+
+    * Changes hardcoded "localhost"s to Socket#gethostname calls.
+    * Adds a simple spec for Socket#gethostname
+
+    Signed-off-by: Michael S. Klishin <michael at novemberain.com>
+
+commit 7131328bc02057b16071a933fe98f331b27e00bb
+Author: Michael S. Klishin <michael at novemberain.com>
+Date:   Tue Mar 25 00:24:01 2008 +0200
+
+    Applied slightly modified patch by Federico Builes:
+
+     * Add REXML::Document and REXML::Attribute specs
+
+commit cb464295e5accb00e783f7f9e2a0b10c64ad6579
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Sun Mar 23 12:06:07 2008 +0100
+
+    Added new Range#step rubyspecs.
+
+    Excludes for rbx also updated.
+
+commit 7d181716ac3b92d8a31a20ec30daee455d36fc58
+Author: Charles Oliver Nutter <charles.nutter at sun.com>
+Date:   Sat Mar 22 14:51:30 2008 -0500
+
+    Added order-of-evaluation spec and tags for rubinius failures.
+
+commit 5caf94ce6deb5e28c9a3de02e60a9b86cbdaf7ec
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Fri Mar 21 12:37:02 2008 -0500
+
+    tagged new specs for pathname
+
+commit 62f88983ee3fa1b09d8f7df56e35cbfdac6d2a06
+Author: Martin Stannard <mstannard at gmail.com>
+Date:   Fri Mar 21 12:10:23 2008 +1100
+
+    added some specs for pathname library
+
+    there are failures in absolute and relative specs
+
+    Signed-off-by: Charles Comstock <dgtized at gmail.com>
+
+commit 655f61650bb299f38c9fd978594baa483fc0d0cc
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Tue Mar 18 16:22:24 2008 -0700
+
+    Reduced parser todos from 113 to 89
+
+commit f97b2fc2ee3310e81871200125bbd7e33c2636bf
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Tue Mar 18 13:51:31 2008 -0700
+
+    Moved sexp_expectations.rb to fixtures subdir
+
+commit 0a185e5ac48954cf4addae0c8f09dcb5be259f8e
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Mon Mar 17 17:55:50 2008 -0700
+
+    Added f'd up note about the spec failing
+
+commit 978f043e1ed3a2b7cb7d4129e0002be485b0a78c
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Tue Mar 18 21:17:32 2008 +0100
+
+    Fix Process.groups spec
+
+    Process.groups can return an array with the same gid multiple
+    times on certain platforms (at least on FreeBSD and OpenBSD).
+
+commit 8812658dde5e317dfebd0ea3c159ad0a1b98e8e8
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Tue Mar 18 21:02:00 2008 +0100
+
+    Update spec tags for ERB
+
+commit 47216560d4a980cbaac2855e0c5ee302e0754bf8
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Tue Mar 18 20:53:16 2008 +0100
+
+    Update spec tags for IO
+
+commit 7d34f4053023d99c3be4964bfebb3a1c74cd40c9
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Tue Mar 18 20:32:39 2008 +0100
+
+    Update spec tags for File
+
+commit 8a66bc6f5e378f49febb80fba37723a7de0d2475
+Author: Brian Ford <bford at engineyard.com>
+Date:   Mon Mar 17 15:46:51 2008 -0700
+
+    Added specs for File.[l]chown/#chown, code for File.lchown.
+
+commit 960872ae163a5615f513c58d727a7fd93664673e
+Author: Glenn Davy <glenn at thor.local>
+Date:   Mon Mar 10 10:00:40 2008 +1100
+
+    Make File.fnmatch respect case when using square brackets
+
+commit 0e32f8e224543a3c152b0351540eaa36fdfcdb06
+Author: Brian Ford <bford at engineyard.com>
+Date:   Mon Mar 17 11:04:27 2008 -0700
+
+    Added exclude for failing spec added in b635fcf0.
+
+commit 62687753b239984acba4f0e80899ca75a8a08cfe
+Author: Brian Ford <bford at engineyard.com>
+Date:   Mon Mar 17 10:56:31 2008 -0700
+
+    Fixes and specs for Module class_variables methods.
+
+commit b635fcf041707fe55a26b7709aef8dc1b2509161
+Author: Charles Oliver Nutter <charles.nutter at sun.com>
+Date:   Mon Mar 17 12:52:13 2008 -0500
+
+    Add a simple Module#private spec.
+
+commit 2aa98e1df50bba768b57018f6e90c56fe39206f4
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Mar 17 13:28:17 2008 +0100
+
+    Make sure no processes left hanging after IO#close specs.
+
+commit 8f332dde4460c03c378f1d1ecc1fbae54557d8ee
+Author: Matt Palmer <mpalmer at engineyard.com>
+Date:   Mon Mar 17 16:44:24 2008 +1100
+
+    Raise an Errno exception if a write fails
+
+commit 55c830063115e4455eeda3f8de639a7f7e0624f5
+Author: Matt Palmer <mpalmer at engineyard.com>
+Date:   Mon Mar 17 16:42:16 2008 +1100
+
+    Raise IOError if we attempt to write to a readonly file
+
+commit ad64c0ea7598b8a4c62ba2dd435f70c976186a50
+Author: David Whittington <djwhitt at gmail.com>
+Date:   Sun Mar 16 04:24:54 2008 +0000
+
+    Modified file type specs to search for sockets in /var/run instead of /var
+
+    Doing a find on /var could take quite a while + might do nasty things like do
+    finds on backup files etc. Running a find on /var/run should be faster and
+    safer.
+
+commit ff5e9d3b9d7f3e484211b66fff96e665ed13614b
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Mar 12 17:44:55 2008 +0100
+
+    Revert "Added simple spec for range splatting".
+
+    This reverts commit 9b3988436a21f61c86168a7566d472c4dfa22162.
+
+    The spec uses '=' instead of '==', and it verifies something
+    that is not true for MRI (1.8, 1.9) or JRuby.
+
+commit 004662e54477269a98475f84724972b82885d9cb
+Author: Brian Ford <bford at engineyard.com>
+Date:   Sat Mar 15 01:09:43 2008 -0700
+
+    Exclude failing UNIXServer.new spec.
+
+commit 13340924519f607d9c48da04c3f3ab41a1de3e86
+Author: Brian Ford <bford at engineyard.com>
+Date:   Fri Mar 14 18:14:06 2008 -0700
+
+    Tagged unstable Process.kill specs that cause hangup on linux.
+
+commit c4a4dc19a26db058594c8056933cdab42d4f26fd
+Author: Matt Palmer <mpalmer at engineyard.com>
+Date:   Fri Mar 14 21:13:31 2008 +1100
+
+    Fix up IO#write spec so it works cross-platform
+
+    It looks like the Linux implementation of IO#write and IO#read are a bit
+    different from the OS X version, because the spec worked on OS X.
+    Presumably this tiny change won't cause any conniptions.
+
+commit 33890d9a77d5a34c15263f84b9b415ffc084815a
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Fri Mar 14 14:42:11 2008 +0800
+
+    Remove fail tags from passing ruby/1.8/core specs
+
+commit 4bdd3df099fe627d158f4c6d35e5a7df0a891e86
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Fri Mar 14 12:58:40 2008 +1100
+
+    Fix bug where stepping by line would sometimes skip a line
+
+commit 260190092afbcfadd1a6e1d6db1674ecf021b686
+Author: Matt Palmer <mpalmer at hezmatt.org>
+Date:   Sat Mar 8 19:26:41 2008 +1100
+
+    Put in an explicit IO.new test for single-argument
+
+    Assuming that your UDPSocket tests passing will prove that IO.new takes
+    one argument might have been, in retrospect, a little retarded.
+
+commit 58216e07f0728415762fe5fbe98e1e984dfea31b
+Author: Matt Palmer <mpalmer at hezmatt.org>
+Date:   Sat Mar 8 18:45:17 2008 +1100
+
+    Mark changing failures in the CI test suite
+
+    Fix up so that the CI doesn't fail as a result of my previous changes to the
+    UDPSocket specs.
+
+commit 36f91c5da132f309fbf6d047fd74ebd8aa7cbf22
+Author: Matt Palmer <mpalmer at hezmatt.org>
+Date:   Sat Mar 8 17:26:49 2008 +1100
+
+    Rearrange the UDPSocket test cases for better separation
+
+    * open_specs now only contains a spec that calls UDPSocket.open;
+    * send_specs now has separate tests for ad-hoc and connection-oriented
+      sends.
+
+commit b40c1cf434bd0879f672ec1dc471f1e1dfaccc1c
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Thu Mar 13 17:07:50 2008 -0700
+
+    Add (failing) Symbol#to_yaml spec based on ticket 322
+
+commit c0bcb0151379fe9858d0fafd2ef56cf1b08daff3
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Thu Mar 13 16:23:37 2008 -0700
+
+    Apply ticket 351 and resolve ticket 350 (RbYAML bugs)
+
+commit a8d6e8cddfd8bc2dccaa93b25adfb31b39b96dba
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Thu Mar 13 16:25:55 2008 -0700
+
+    Removed all should_not raise_error from shared/time_params.rb
+
+commit 01f09f4e5697c4a775ac321a71d3b777196d9001
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Thu Mar 13 15:47:37 2008 -0700
+
+    cleaned up spec with new raise_error block form
+
+commit e965fc735311915dd43c47cc4853e163376cc6be
+Author: Lachie Cox <lachie at smartbomb.com.au>
+Date:   Sat Mar 8 17:14:37 2008 +1100
+
+    enhanced syntax error to give same message as MRI
+
+commit 868b38152ca99189fce85542a9068c0d01ee4a41
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Thu Mar 13 15:07:33 2008 -0700
+
+    Added exclude for last patch applied
+
+commit 9b3988436a21f61c86168a7566d472c4dfa22162
+Author: Patrick Hurley <phurley at gmail.com>
+Date:   Mon Mar 3 14:04:14 2008 -0500
+
+    Added simple spec for range splatting
+
+commit 3c7a017e173945d3f9b18d566bb1c3d6d04e97e4
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Thu Mar 13 17:18:39 2008 -0500
+
+    fixed tags for new constant specs
+
+commit a966436b7be78bc063e32bc16496f5cabbb0a152
+Author: Matt Palmer <mpalmer at hezmatt.org>
+Date:   Sat Mar 8 14:56:58 2008 +1100
+
+    Make sure modules included in Object are found
+
+    Add a spec to make sure that constants from modules included in Object are
+    found.  Evan is committing the fix for this separately.
+
+    Signed-off-by: Charles Comstock <dgtized at gmail.com>
+
+commit 4e0ddd3e701f68b592cb69972f7d587b90392913
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Thu Mar 13 15:05:54 2008 -0700
+
+    Correct a 'defined?' spec added by ticket 388
+
+commit 407095d8ffbf0563fa46e5d4ed6a08423eddb2ad
+Author: Martin Stannard <mstannard at gmail.com>
+Date:   Sat Mar 8 15:47:59 2008 +1100
+
+    Added tests where defined? method should return string descriptions of objects
+
+commit f366309a8fff28552d7d27101d8b3d7b4352e235
+Author: Gianluigi Spagnuolo <glgspg at gmail.com>
+Date:   Fri Feb 29 10:42:42 2008 +0100
+
+    Fixed Array set element problem
+
+commit 42c22bf542edc8c8379587507fd9e35ba25b190c
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Thu Mar 13 17:00:31 2008 -0500
+
+    updated tags for new read specs
+
+commit 45c43a7ab3310a41b0b3367f4762a1bb55b02405
+Author: Ben Askins <benj at supernova.local>
+Date:   Sun Mar 9 11:41:49 2008 +1100
+
+    Fix typo in file/open_spec.rb
+
+    Signed-off-by: Charles Comstock <dgtized at gmail.com>
+
+commit a221ea56325fe082154a629094abb27d40919a39
+Author: Alister Lee <rubinius at dev.shortepic.com>
+Date:   Sun Mar 9 15:27:34 2008 +1100
+
+    Specs to expose defect in eof treatment in IO.read
+
+    Signed-off-by: Charles Comstock <dgtized at gmail.com>
+
+commit 4967adb3d49252aae75b6b57159fb5879ac75db1
+Author: Myles Byrne <myles at ducknewmedia.com.au>
+Date:   Sat Mar 8 12:14:20 2008 +1100
+
+    Check existence of ArgumentError
+
+commit 45e46234da288052e639bb5c9c122874fd4d4e1c
+Author: Brian Ford <bford at engineyard.com>
+Date:   Thu Mar 13 10:28:54 2008 -0700
+
+    Fix File[Test].size? and specs for it.
+
+commit d467bf21c4037784a21ba964b24c28fc80b34736
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Thu Mar 13 17:36:56 2008 +0800
+
+    Fix IO::foreach when separator is nil
+
+commit 70615e1c15692b8a8149e1616c802db9eb5bad11
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Thu Mar 13 17:32:40 2008 +0800
+
+    Fix IO#flush to raise IOError on closed stream. Remove empty tag files.
+
+commit 9c9e7f422c98bf6add6c9a426ae25e3a6dbced85
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Thu Mar 13 17:29:31 2008 +0800
+
+    Fix IO#fcntl to raise IOError on closed stream
+
+commit 215d600002948efb949422c0163aa9bbe5790507
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Thu Mar 13 17:27:43 2008 +0800
+
+    Fix IO#dup to raise IOError on closed stream
+
+commit 879ee8124a2ad8ce83bcd9c51b2d6df0baecb40d
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Thu Mar 13 16:29:03 2008 +0800
+
+    Fix a bunch more IOError when closed stream
+
+commit 487d9561992eb03c3d12de5128772cd194b37b8b
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Thu Mar 13 16:26:33 2008 +0800
+
+    Implement IO#read_nonblock
+
+commit 15c58fa2c47d2dc61b3dac436ab3b56a727b7dc5
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Thu Mar 13 15:46:22 2008 +0800
+
+    Fix remaining IO.read specs
+
+    * Passing nil to length treats it as no length limit
+    * Passing nil to offset treats it as 0
+
+commit 9daee4f9c3b62db34b07d74171d1017fa823533c
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Thu Mar 13 15:32:13 2008 +0800
+
+    Fix IO#sync to raise IOError on closed stream
+
+commit 2ac848c09e055b3eacc8bb18f713d56715484063
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Thu Mar 13 15:24:36 2008 +0800
+
+    Fix IO#sync to raise IOError on closed stream
+
+commit 36aa8577603f1d8ca76344fc3e889bb7c991bfe9
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Thu Mar 13 14:51:13 2008 +0800
+
+    Fix IO#sysseek to raise IOError on closed stream
+
+commit 3307f5a4db121c2097b450278bc3cf19550f267b
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Thu Mar 13 14:48:30 2008 +0800
+
+    Fix IO#pos and #IO#tell to raise IOError, move their specs to shared
+
+commit 72890065371f3e1d1cde43618a3da04c900749aa
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Thu Mar 13 14:39:21 2008 +0800
+
+    Implement IO#to_io
+
+commit 4977bd1f22278e19ba69203c2545ad97c297ae23
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Thu Mar 13 14:33:03 2008 +0800
+
+    Remove IO#isatty tag file also, since they are sharing the same specs
+
+commit 5dd3115465852ddb03b7100b21739f9d38f0ee58
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Thu Mar 13 14:29:13 2008 +0800
+
+    Fix IO#tty? should raise IOError on closed stream
+
+commit 063f56b4c402180c2c989a15b75fe7a15d4c5c61
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Thu Mar 13 13:55:55 2008 +0800
+
+    Make IO#syswrite use the shared IO#write specs
+
+commit 22de413f6cccb3eb100fd29da90c2ded84ea19f3
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Thu Mar 13 12:08:50 2008 +0800
+
+    Update IO#write_nonblock's tag
+
+commit 25a5ac7e9123512e87e6460f1fa5ecbcfc7349b5
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Thu Mar 13 12:07:22 2008 +0800
+
+    Pull out 2 differences between IO#write and IO#write_nonblock specs
+
+commit a40dbd0f36f0237bc27c905c399aba1e62bbfa70
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Thu Mar 13 11:39:03 2008 +0800
+
+    Alias IO#write_nonblock IO#write and make IO#write specs shared
+
+commit 1c8eb4bc04405753dd607af1f5d231df01fd2536
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Thu Mar 13 11:06:09 2008 +0800
+
+    Make the mock return a string to prevent a coercion error
+
+commit a85b2105c826a7d39dc45c90cad37faf75baac86
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Thu Mar 13 10:39:00 2008 +0800
+
+    Fix IO#write should raise IOError on closed stream
+
+commit e8c8af1aa888dc3e5600cad64f03c09aebaf6d22
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Thu Mar 13 10:34:08 2008 +0800
+
+    Fix IO#to_i should raise IOError on closed stream
+
+commit 49d48c381b7ed0f2576c2c5bff3ac8825a0dd49e
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Wed Mar 12 17:56:26 2008 -0700
+
+    Fix the insanity
+
+commit 646136d0f75b165a3a62266791556d3f4f03c835
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Wed Mar 12 17:04:30 2008 -0700
+
+    Finally got compiler specs passing
+
+commit 052bbcbe4f51b322ae44dc387320f9b4964d74cd
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Wed Mar 12 16:23:58 2008 -0700
+
+    Correctly set Syslog mask in Syslog::open and add crappy spec for it
+
+commit dbabc5bda94a2bd77b2cb777666d286155c75ee0
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Wed Mar 12 14:55:08 2008 -0700
+
+    Correct Syslog specs and modify syslog.rb to pass them
+
+commit 5b8bee08f2a19d6f25df98183a24745ed33ed519
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Wed Mar 12 14:54:38 2008 -0700
+
+    Modify Kernel#load specs so that they pass on 1.8.6-p111
+
+commit b96974693cee75772b09052f8ec7110a000c2429
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Wed Mar 12 14:00:42 2008 -0700
+
+    Fixed specs for wilson's compiler encloser changes
+
+commit 2a21597719bea1ea7db27a552ea6dfb6865963d7
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Wed Mar 12 14:00:06 2008 -0700
+
+    half work on pretty_inspect
+
+commit 6e398ca491b67a6c468798fd92a9764f70bc68a8
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Wed Mar 12 15:18:02 2008 +0800
+
+    Share String#to_a a specs with String#entries
+
+commit 2ff775cbcf2ade4315fbdbb37fa78ee84a1e645a
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Wed Mar 12 11:59:26 2008 +0800
+
+    Add String#to_a specs
+
+commit 4f1204bac224ad28375f06e5fb77156367895156
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Tue Mar 11 19:53:32 2008 -0700
+
+    Spec and implement Array#pack 'v' option
+
+commit 91d51783f44c3a9b1adfe03b7b9fa35476494ce1
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Wed Mar 12 12:45:56 2008 +1100
+
+    Debugger::Output#wrap should handle width of 0
+
+commit 51c316464ad44cadad7ecd997ce45e8392695f4c
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Tue Mar 11 15:26:52 2008 -0700
+
+    Implement support for :postexe nodes (END { some_code })
+
+commit 569dd9f10d5194c22335ce58a678d1f9c73f91d0
+Author: oleg dashevskii <be9 at be9.ru>
+Date:   Wed Mar 12 03:54:39 2008 +0600
+
+    Import matrix lib with specs (#389 and #400)
+
+    Original patches by Chris Lloyd and matta.
+
+commit 6beb50b7cc2dd3a0f57f3dee45767bb363082159
+Author: Brian Ford <bford at engineyard.com>
+Date:   Tue Mar 11 13:20:07 2008 -0700
+
+    More Integer#times specs.
+
+commit 746d89d6d55c82f26be08f182301926efd62d362
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Mon Mar 10 15:39:26 2008 -0700
+
+    Correctly set the enclosing class for evaled code.
+
+commit 218cc7fbdd1b5d1c52248e65817752b8a50821ad
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Mar 10 04:46:00 2008 +0100
+
+    Added JRuby speciifc guard to singleton rubyspecs (JRUBY-2239).
+
+commit 25e3f23e78f2b17e02d2c0a058925f8a0ec0d790
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Mon Mar 10 11:25:38 2008 +0100
+
+    Be sure not to close the socket before the Errno.handle call
+
+    Also a small fix for a spec that fails on OpenBSD
+
+commit 9e7fdf3b0040971f7b8402b9cf5422efaedb2f4f
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Mon Mar 10 09:54:16 2008 +0100
+
+    Fix TCPSocket#new spec, BSD systems make a distinction between IPv6/IPv4 localhost
+
+commit e5512b2a7725a67471eba086b107b0f4b1f136b2
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Mon Mar 10 08:35:50 2008 +0100
+
+    Fix for failing unpack_sockaddr_in spec on Linux
+
+commit b9eab2266e5d1f073b6f876710dc9e848fe25b0c
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Sun Mar 9 23:37:05 2008 +0100
+
+    Remove spec tag for now fixed Hash.allocate
+
+commit b6ba9a757b0531791424df38bce6587a53db6002
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Sun Mar 9 23:12:16 2008 +0100
+
+    Remove tag for now correct Fixnum#[] spec
+
+commit 6785c2b44da90d95ef77e98cba42a953828b622f
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Sun Mar 9 23:11:37 2008 +0100
+
+    Fix Fixnum#[] specs
+
+commit 0aa09ce9b7269d54cdef583a2eaf0cb57c32f773
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Sun Mar 9 23:05:21 2008 +0100
+
+    Removed tags for working Socket specs
+
+commit 18b27b0ebdc3713962771ca75c1321cabee08d61
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Sun Mar 9 22:48:45 2008 +0100
+
+    Untag now working IPAddr specs
+
+commit f4c0d08bec8fb2db7d130363b0609de7b7720d7e
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Sun Mar 9 19:56:25 2008 +0100
+
+    Slow IPAddr specs are now fast
+
+commit ff71385a67b2853130e63f9942bcea6ac69d591f
+Author: Eero <ruerue at yawn.kittensoft.org>
+Date:   Sun Mar 9 10:35:27 2008 -0400
+
+    Specs for #412. Array#sort and #sort block form calls #<=> on elements.
+
+    * Block form should not expect anything of the elements, all is
+      done through the return value of the block.
+
+commit e6edd1bb4bc52053bdb834d52e31fa185f2a2d62
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Sun Mar 9 14:51:00 2008 +0100
+
+    Updated tags for IPAddr because of fixed bit operations
+
+commit 4f59fa9bd187822cd836aa046bb8fd40e4412c30
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Sun Mar 9 14:49:02 2008 +0100
+
+    Fix Fixnum and Bignum shift operations to match MRI
+
+    Added behavior for the edge cases, but took a different
+    approach than the LH tickets. I don't think we should
+    change coercion functions for this.
+
+commit ad8c630662dcb611cd955db08a6f4d53d1dc0dfd
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Sun Mar 9 13:43:38 2008 +0100
+
+    Fix Bignum#& and specs for Fixnum AND, OR and XOR
+
+commit 2529acd5e1cc8e61bd995e00834ee1f6941b1d9d
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Sun Mar 9 14:18:04 2008 +1100
+
+    Fix require_spec and load_spec.
+
+commit 57c7ded8e4d9567aa3c392e8a8262389387ebbfb
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Sun Mar 9 12:25:40 2008 +1100
+
+    Don't spec .rba require behavior in spec/ruby/1.8.
+
+commit ac630b23da01dcc3a1de1bfa06bac4d301a5031b
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Sat Mar 8 17:23:34 2008 -0800
+
+    Better fix for calling to_proc on BlockPass nodes
+
+commit c17b32d44be8452cd867a8212a0fd8bb49c94821
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Sat Mar 8 16:34:02 2008 -0800
+
+    Tag failing Method spec for CI
+
+commit c5d4a3b8f84b7558a5dfedb699a1a3ee4d61f118
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Sat Mar 8 16:26:58 2008 -0800
+
+    Call Proc.__from_block__ on block_pass arguments
+
+commit a63f457821e67d138d9cf1c5ac8b0760cb25bfc2
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Sun Mar 9 10:42:51 2008 +1100
+
+    Remove support for zip rba files, libzip.  rake clean required.
+
+commit 142222e41bddd2138d82f349f73dbc0fe2cf3fc2
+Author: Charles Nutter <headius at wlan100.headius.com>
+Date:   Sat Mar 8 16:23:37 2008 -0600
+
+    Adding a spec for Method#to_proc proc used in define_method.
+
+commit b748efa9904baf0be26aa5b7297fc8ba76e46a74
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Sat Mar 8 13:09:44 2008 -0800
+
+    Fix Module#method_defined? and friends for accessors
+
+commit 9b9d8216014c95eb7b4a925e93d0db8e9f5fd308
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Sat Mar 8 10:46:18 2008 +0100
+
+    Adedd a couple of GzipReader#rewind specs.
+
+commit 4612812bde4a2fccbaa72ea54ef76c7d964d216b
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Sat Mar 8 15:49:57 2008 +0100
+
+    Fix the Array#pack specs, network order is the same everywhere
+
+commit a720bba1619deb4358b453f58913d30a1a311b07
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Sat Mar 8 15:27:47 2008 +0100
+
+    Fix Sprintf for positive non decimal notation
+
+    This fix combined with the pack/unpack implementation for
+    type n also fix some IPAddr specs.
+
+commit caef838aca82665d4c2f691e4873e339a9c7238d
+Author: Lachie Cox <lachie at smartbomb.com.au>
+Date:   Sat Mar 8 12:47:19 2008 +1100
+
+    updated Array#pack specs to work on big endian machines
+
+    Signed-off-by: Dirkjan Bussink <d.bussink at gmail.com>
+
+commit e3763469a224b4b3668bc1ddef2d982245787646
+Author: Lachie Cox <lachie at smartbomb.com.au>
+Date:   Sat Mar 8 12:42:36 2008 +1100
+
+    Added implementation of pack schemes for "n" and added handling of multiple items for "i","s" and "l"
+
+    Signed-off-by: Dirkjan Bussink <d.bussink at gmail.com>
+
+commit 41b26c49f5a16377af2c677eb702d665dd062a56
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Sat Mar 8 15:35:10 2008 +1100
+
+    Fix IO#pos EOF spec.  Pair: Lincoln, Evan.
+
+commit 1e039fb5c9bcff987769c8644ec47c30aa250952
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Sat Mar 8 14:53:01 2008 +1100
+
+    Fix Zlib::GzipWriter#finish.  Pair: Lincoln.
+
+commit 8551da47a01ef24eaf31fac55253fb05fe81cfcd
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Sat Mar 8 14:21:08 2008 +1100
+
+    Add Zlib::GzipReader #eof?, #pos, #read w/length
+
+commit a4dba8317311cc3a51231895b2eaea09daaa61be
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Sat Mar 8 10:41:33 2008 +1100
+
+    Ensure #pos clears internal eof flag
+
+commit 407e1a4191da6ecd59c1347198a60be2556e043b
+Author: Brian Ford <bford at engineyard.com>
+Date:   Fri Mar 7 17:04:09 2008 -0800
+
+    Tweaks to LookupTable. Converted Errno::Mapping to use LT.
+
+commit eb937c8f1041884e412e3d074387ca9f14bb03ef
+Author: Brian Ford <bford at engineyard.com>
+Date:   Fri Mar 7 13:48:45 2008 -0800
+
+    Fixed LookupTable#delete. Added LookupTable#entries, #dup.
+
+commit d7d9bfd01180cf2c4fc74d2709f71fc7dd59f2f6
+Author: Brian Ford <bford at engineyard.com>
+Date:   Fri Mar 7 15:03:14 2008 -0800
+
+    Bandaid fix for failing #autoload specs.
+
+    These need to be properly scoped. However, changing
+    :A to ModuleSpec:A causes a sigbus.
+
+commit aea5cc446cd2c1b0cbd29e606b21b6d5959eb5ee
+Author: Caleb Tennis <ctennis at engineyard.com>
+Date:   Fri Mar 7 16:18:19 2008 -0500
+
+    Add rb_gv_get and rb_gv_set, plus specs.
+
+    Add rb_set_safe_level, rb_secure, and rb_safe_level methods, and specs.
+
+commit cd0b8969487af84a4f40466714dab2d5a1efc224
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Thu Mar 6 17:11:20 2008 -0800
+
+    excluded
+
+commit e40f2bb09d8e3137de2856cb1e9c9438945603dc
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Thu Mar 6 17:11:00 2008 -0800
+
+    More specs to test out const scoping with eval
+
+commit 3926add9039d1af4a60b633ef8805d471f28e02f
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Thu Mar 6 17:01:21 2008 -0800
+
+    Further clarified StringIO#getc specs.
+    They weren't really testing what they were doing.
+    Fixed StringIO#getc. now properly pushes single chars and sets @pos so it can be mixed with puts/write as needed
+
+commit d2d3750c4960d4a6f2a5d2b16b8bae3d598fbe36
+Author: Caleb Tennis <caleb at tarknology.com>
+Date:   Thu Mar 6 19:16:24 2008 -0500
+
+    Add rb_define_global_function to subtend, with tests
+
+commit 4ab5cc17b70b6569cf9311142d4b278dedfd0a64
+Author: Brian Ford <bford at engineyard.com>
+Date:   Thu Mar 6 09:53:20 2008 -0800
+
+    Added LookupTable and specs.
+
+commit 1ca8a272137ed7020cb977bf51dd2b7164ccbd7e
+Author: Charles Nutter <headius at wlan100.headius.com>
+Date:   Wed Mar 5 17:28:40 2008 -0600
+
+    TCPServer.new coerces non-integer port to string and uses getservbyname logic.
+
+commit f0c03880972c19d1a12367dc51ed77f69d9ce8ca
+Author: Charles Nutter <headius at wlan100.headius.com>
+Date:   Wed Mar 5 16:44:33 2008 -0600
+
+    Add a couple specs for killing/raising in a thread blocked on accept.
+
+commit 9f80ef157851671727653f46225b99af5d1a259e
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Tue Mar 4 21:26:33 2008 +0100
+
+    Proper spec for %u with negative bignums and comments on MRI behavior.
+
+commit 3f9c36081c9b62bcde40206e64afdc2ac088bee8
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Tue Mar 4 19:09:56 2008 +0100
+
+    Update tags for fixed File#chmod specs
+
+commit 735e818c38f8cefe0cd90514dac5282845a67dd4
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Tue Mar 4 15:13:23 2008 +0100
+
+    Improve testing of coercion in File#chmod specs
+
+commit 77a717f5962b2965ad9146e16cb36bedac891c80
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Mar 3 18:16:04 2008 +0100
+
+    Adjusted syslog specs to better handle impls that don't provide syslog.
+
+    For example, JRuby does not provide syslog (yet).
+
+commit 605bdc53e9dd4fb95dae6557d9ee6f9e2b8ceb80
+Author: David Whittington <djwhitt at gmail.com>
+Date:   Mon Mar 3 08:44:33 2008 +0000
+
+    Modified Bignum threshold specs to take into account platform wordsize
+
+commit 0af27d11d7dd68cfe49985dc4588933cc41f4fc8
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Sun Mar 2 16:40:15 2008 -0500
+
+    Tag headius's new to_proc spec as failing
+
+commit b1caeeac673451a960917bb699a20e74cf488432
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Sun Mar 2 13:30:35 2008 +0100
+
+    Adjusted Kernel#catch test a bit, to make it more generic.
+
+commit 60f9544ade9d6e71fe3e423ab82cc87838478032
+Author: Charles Nutter <headius at wlan100.headius.com>
+Date:   Sun Mar 2 04:36:53 2008 -0600
+
+    Add a spec for #363, & not coercing using to_proc.
+
+commit 70aa320f7f5bc75ed95362b0fb6d724e64224a88
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Sat Mar 1 17:17:55 2008 -0500
+
+    Tweak new Marshal spec to pass on MatzRuby
+
+commit 35476e1bde23de26c01df409b750e91ef981fefc
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Sat Mar 1 17:11:53 2008 -0500
+
+    Tag new failing Marshal spec
+
+commit d9f83819f1ed2505740ae0737199fecab29809bb
+Author: Jared Luxenberg <jared at jaredlux.com>
+Date:   Sat Mar 1 16:20:18 2008 -0500
+
+    Added specs for marshalling subclasses of Hash with init parameters
+
+    Test that Marshal.dump gives correct output for such an object (passes)
+    Test that Marshal.load is able to deal such an object (fails)
+
+commit 6039a3bd457c5d3dc99f5935999da574d17f1e5d
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Sat Mar 1 16:20:08 2008 -0500
+
+    Tweak Process.setrlimit spec for odd Linux platforms
+
+commit 25cfa6a96315ee203d06381ee3ddb76b60023360
+Author: Chuck Remes <cremes.devlist at mac.com>
+Date:   Sat Mar 1 10:24:55 2008 -0600
+
+    Fixes a race condition on OSX when "find"-ing character devices
+
+    - on OSX the spec fixture would return /dev/fd/0 as a character
+      device when run from the command line. This always succeeded.
+      When run as a subprocess (like from cron or rubuildius'
+      IO#popen) then OSX uses /dev/fd/0 and /dev/fd/2 for capturing
+      stdin, stdout, stderr and others in that environment. While
+      the fixture would "find" /dev/fd/2 as a character device, by
+      the time the assertion tested it the underlying OS would change
+      it to another device type causing the assertion to fail. This
+      is just bad luck. We now grab the #last device found rather
+      than the first.
+
+commit b6e95321df023ac989c4e5bb926ec55493260bc9
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Feb 29 16:04:10 2008 +0100
+
+    New rubyspecs for IO#ungetc.
+
+commit 9bd2f0740c71d426cfa3c3636c2451762f640c14
+Author: Brian Ford <bford at engineyard.com>
+Date:   Thu Feb 28 21:59:35 2008 -0800
+
+    Specs for Hash.allocate. Fix awaits replacing Hash with LookupTable in core.
+
+commit c1d979639bfc19072351211815ffd5c8da772dcd
+Author: Brian Ford <bford at engineyard.com>
+Date:   Thu Feb 28 21:56:33 2008 -0800
+
+    Specs and fixes for Module.allocate.
+
+commit 904fd6136f00bab5fec62e8e702a0508dec44bac
+Author: Brian Ford <bford at engineyard.com>
+Date:   Thu Feb 28 19:45:39 2008 -0800
+
+    Specs and fixes for Array.allocate.
+
+commit 776a24f0d14bbb5127c804cf0579960335c1a049
+Author: Brian Ford <bford at engineyard.com>
+Date:   Thu Feb 28 19:35:55 2008 -0800
+
+    Specs for String.allocate and fixes to make them pass.
+
+commit fa35211f357ff1b9660a318c12b86ca156c5f26d
+Author: Ari Brown <ari at aribrown.com>
+Date:   Thu Feb 28 20:27:55 2008 -0500
+
+    Moved stdlib/syslog.rb to lib/syslog.rb . it works!
+
+    * everything runs! yay!
+
+commit 8f103a6f9d7a168e37d1063e40bee960d64fc609
+Author: Ari Brown <ari at aribrown.com>
+Date:   Thu Feb 28 19:42:11 2008 -0500
+
+    Added specs and the constant module for stdlib/syslog.rb
+
+    * added some specs for that which is testable
+    * fixed the constant module so the constants are defined
+    * fixed 'undefined method' problem in #write (private)
+
+commit 0c89dc90fdcb7933169e23462197d59f9627f510
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Thu Feb 28 14:31:05 2008 -0800
+
+    Added basic throw/catch specs. Fixed raised NameError to contain the name
+
+commit c8f4db4270984b60a087dd423c9e0da3e3760622
+Author: Phil Hagelberg <phil at hagelb.org>
+Date:   Thu Feb 28 14:11:30 2008 -0800
+
+    tag failing proc spec
+
+commit a1591319696385191f3301516d2f8265cd8fedcb
+Merge: f167f8f... 3f1acce...
+Author: Phil Hagelberg <phil at hagelb.org>
+Date:   Thu Feb 28 13:43:52 2008 -0800
+
+    Merge branch 'master' of git at git.rubini.us:code
+
+commit f167f8f6f7f3a1b8804a5452643236a23c0ce4c4
+Author: Phil Hagelberg <phil at hagelb.org>
+Date:   Thu Feb 28 13:43:40 2008 -0800
+
+    failing spec for returning from procs
+
+commit 3f1acce781c0dcf43698441036a085a0cef02d29
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Thu Feb 28 16:14:55 2008 -0500
+
+    Basic support for UNIXSocket and UNIXServer
+    Fix some 'Errno' typos in socket.rb
+
+commit afbf38613364436630933753d99ee94c03b85074
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Thu Feb 28 21:34:10 2008 +0100
+
+    Added specs for File.fnmatch with case-sensitive brackets.
+
+commit 28323bda3d1f3295371b6ea99ed8ba6ee15661bb
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Thu Feb 28 20:47:51 2008 +0100
+
+    Added specs for File.fnmatch with '**/' patterns.
+
+commit 893ff4729d024198d5b423cc4426153f49cb5ebe
+Author: Brian Ford <bford at engineyard.com>
+Date:   Thu Feb 28 11:30:49 2008 -0800
+
+    Fixed lookup of class variables defined in metaclasses.
+
+commit dee531b18d96199d608d8e2e8e27f54ef500a716
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Feb 27 21:47:13 2008 -0800
+
+    Additional Symbol#inspect specs. Another try at making them pass.
+
+commit 3bfb705b709ab35593684a68b35fb0ee8e1e01d7
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Feb 27 21:46:37 2008 -0800
+
+    Silence 'woot' echo on ubuntu from #system specs.
+
+commit 7fb76f2c4a9fb0c5695a38b90150ea6f50097237
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Wed Feb 27 18:05:48 2008 -0800
+
+    Fixed Symbol#inspect from over quoting
+
+commit 4ac32e4c9d0ff55aad50a00944f1a64931cfd1c6
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Wed Feb 27 17:18:09 2008 -0800
+
+    Added some pretty rude specs for Kernel#system and got them to pass.
+    Fixed a wierd problem with system/exec not cleaning up the fork process right
+
+commit 73be3b88af1ac96a6d4afabddd2871cfc4691eec
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Feb 27 15:36:17 2008 -0800
+
+    Fix String to properly initialize backing store when subclassed.
+
+commit 5ab2f9e594b7e66a04028e60f3517488e345f508
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Feb 27 15:04:09 2008 -0800
+
+    Scope classes used in String specs.
+
+commit e45d58100850443fedada905f654bae3f4144790
+Author: Charles Nutter <headius at wlan100.headius.com>
+Date:   Wed Feb 27 17:04:58 2008 -0600
+
+    Add /devices to find commands; Solaris uses /devices instead of /dev.
+
+commit 1403477197873d613cfb93d644f78b4067d180d3
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Feb 27 20:21:48 2008 +0100
+
+    Adjusted Env spec, to be able to run it on Solaris.
+
+    grep is replaced by egrep, since older greps don't
+    take -e parameter (like on Solaris).
+
+commit b239a3b615d341f982a7a4a3a1b1200d95f79684
+Author: Adam Shelly <adam.shelly at gmail.com>
+Date:   Wed Feb 27 04:09:24 2008 -0500
+
+    Amending specs for Array#pack('U')
+
+    * rbx is now passing most specs
+    * failing specs are due to String#unpack.
+
+    Signed-off-by: Brian Ford <bford at engineyard.com>
+
+commit 328c40e0f24601e739f404ab252652deca477513
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Feb 27 02:46:21 2008 -0800
+
+    Fixed Array instantiation to work with subclasses.
+
+commit 96c4ea885fbd075765b9d234de2754df3c857b07
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Wed Feb 27 09:26:25 2008 +1100
+
+    Move Debugger::Output specs to match new location of class
+
+commit c59f16f34f47860b200c6de4a2c1144c566de3dd
+Author: Brian Ford <bford at engineyard.com>
+Date:   Tue Feb 26 10:23:14 2008 -0800
+
+    Exclude new failing Array specs.
+
+commit 27248a45f079fd5a8cdb9ee71d008d135dcbe63d
+Author: Charles Nutter <headius at wlan100.headius.com>
+Date:   Tue Feb 26 00:10:29 2008 -0600
+
+    Add additional Array tests from BFTS.
+
+commit a0e156f4c5bc12bf39950afeb58a6962b37efaa7
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Tue Feb 26 16:53:01 2008 +1100
+
+    Fix Debugger help output formatting to use wrapping
+
+commit fa5304d42c72a07b09cece99cb22c90f6b399a51
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Tue Feb 26 13:22:31 2008 +1100
+
+    Add wrapping to debugger column output
+
+commit 1a5d830b41eef37bb78168c959dd5b2f0757fde4
+Author: Brian Ford <bford at engineyard.com>
+Date:   Mon Feb 25 18:58:11 2008 -0800
+
+    Conform Bignum#div, #divmod to weird MRI maths.
+
+commit eb5c6e367990bfdd193bcdf3055009f3e3e1aeaf
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Tue Feb 26 13:23:29 2008 +1100
+
+    Fix Debugger specs to pass on ci
+
+commit a2feff6782a052a9b71da90e9d4e1b2d991cc598
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Mon Feb 25 18:53:24 2008 -0500
+
+    Patch by Jos Backus (josb) - Closes ticket 364 (FreeBSD warnings)
+
+commit cee08883cc3de2e41a88b506f7d7f8d40697eaa2
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Mon Feb 25 13:20:21 2008 -0800
+
+    Fixed autotest churn by removing empty.txt and moving to /tmp
+
+commit f26bb0c4e3b8435a853a9f4843173748d98075fd
+Author: Brian Ford <bford at engineyard.com>
+Date:   Mon Feb 25 11:25:10 2008 -0800
+
+    Add the rest of spec/* directories to CI process.
+
+commit 29f36833e79de6115c27d744adf158e1b3ba42f0
+Author: Brian Ford <bford at engineyard.com>
+Date:   Mon Feb 25 00:29:45 2008 -0800
+
+    Excludes for spec/kernel, spec/debugger to run with CI.
+
+commit 12bbdf70af31d5168c2df0a9b53651f94b36899d
+Author: Brian Ford <bford at engineyard.com>
+Date:   Mon Feb 25 00:22:13 2008 -0800
+
+    Excludes for subtend specs so they will run with CI.
+
+commit 0cbc2b1f20d8aee7ea74eb14e1f9cf242f8b47d5
+Author: Brian Ford <bford at engineyard.com>
+Date:   Sun Feb 24 23:57:56 2008 -0800
+
+    Remove specs for removed Compression::ZLib.
+
+commit 1b4fbc76c2eb84e5cb45562f54ac105784f9e134
+Author: Brian Ford <bford at engineyard.com>
+Date:   Sun Feb 24 23:49:57 2008 -0800
+
+    Conform Ar specs.
+
+commit f8e62002711c3cfd8024faca497775f7253a326a
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Mon Feb 25 05:24:54 2008 +0100
+
+    Add a second case for truncating IO buffers that specifies too-small size.
+
+commit 9f3e25289cc52cd3f3fb240de1ad82a16a8b135c
+Author: Nikolai Lugovoi <meadow.nnick at gmail.com>
+Date:   Tue Feb 12 23:19:27 2008 +0200
+
+    Fixes for String#to_sub_replacement:
+
+    * removed String#replace_slashes
+    * using plain byte-by-byte scan instead of regexps to detect and handle backslash escapes
+    * better handle unknown escapes and cases like '\\\1'
+    * updated specs for String#sub
+
+    Signed-off-by: Brian Ford <bford at engineyard.com>
+
+commit d87df0b7634ae37f85fc8f2795e4c8c425614b11
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Mon Feb 25 02:57:27 2008 +0100
+
+    Add a spec for Enumerable#inject with a *arg; JRUBY-2162 exposed it.
+
+commit f04fcabf8c064dfcbf3b118bdc83289da169a30c
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Sun Feb 24 21:24:51 2008 +0100
+
+    truncate behaves different on OpenBSD, changed specs according to MRI behavior
+
+commit b74a2f45b32a02469d61d4ace04912ec25f19543
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Sun Feb 24 20:18:02 2008 +0100
+
+    Looks like Darwin does provide Process::RLIMIT_AS
+
+commit 7113973abff64eeb1304b15be46f07d301d84f3f
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Sun Feb 24 18:25:55 2008 +0100
+
+    OpenBSD doesn't provide Process::RLIMIT_AS, so this spec should be excluded
+
+commit 49b72719bf5c732f4aa2ad0d70e5a224556fb471
+Author: oleg dashevskii <be9 at be9.ru>
+Date:   Sun Feb 24 11:04:07 2008 +0600
+
+    Spec for method taking lambda and block.
+
+    * should raise SyntaxError
+    * passes on MRI
+    * fails on rubinius
+
+    Signed-off-by: oleg dashevskii <be9 at be9.ru>
+
+commit 60bbc8506d70571249972dbf124df520f0a4a476
+Author: Chuck Remes <cremes.devlist at mac.com>
+Date:   Sat Feb 23 10:23:09 2008 -0600
+
+    Fix unpack_spec expectation for little-endian byte ordering
+
+    Signed-off-by: Dirkjan Bussink <d.bussink at gmail.com>
+
+commit 17e45cee97057684e6c24608f97de48c28947384
+Author: Chuck Remes <cremes.devlist at mac.com>
+Date:   Sat Feb 23 09:44:37 2008 -0600
+
+    Fix unpack to use native host byte order for formats /ILQS/
+
+    - unpack_spec had a bad expectation on little-endian platforms
+    - unpack_spec got some updated description strings to correctly identify
+      the host byte ordering expected in the spec
+    - kernel/core/string.rb now unpacks formats /ILQS/ in the platform's native byte
+      ordering
+
+    Signed-off-by: Dirkjan Bussink <d.bussink at gmail.com>
+
+commit 1540cb7caa0f200ed6d318971fb7302cd089e27d
+Author: Chuck Remes <cremes.devlist at mac.com>
+Date:   Sat Feb 23 08:10:00 2008 -0600
+
+    Add some missing endian guards to the unpack_spec
+
+    - in my haste, forgot one set of guards around some specs
+
+    Signed-off-by: Dirkjan Bussink <d.bussink at gmail.com>
+
+commit 8488676fc0dac5db5d01dd92e061476226d58bd1
+Author: Chuck Remes <cremes.devlist at mac.com>
+Date:   Sat Feb 23 00:19:33 2008 -0600
+
+    Fix several Array#pack and String#unpack bugs related to byte ordering (endiannes)
+
+    - added a small utility method endian? to the kernel module; determines host byte
+      ordering by taking a symbol (:big, :little) and comparing it to Rubinius::ENDIAN
+    - modified Array#pack to check for the native byte ordering for /ils/i formats
+    - modified String#unpack to use native byte ordering for /DdFfIiLlQqSs/ formats
+    - modified String#extract_number to do special processing for big-endian platforms
+      and for formats using native byte ordering on a big-endian platform
+    - added little_endian and big_endian guards around several String#unpack specs;
+      now passes running against MRI and rbx
+
+    Signed-off-by: Dirkjan Bussink <d.bussink at gmail.com>
+
+commit f8146d29bfdf67349f3f9c0c7105ce595981255f
+Author: Gianluigi Spagnuolo <glgspg at gmail.com>
+Date:   Sat Feb 23 12:44:25 2008 +0100
+
+    Added some test to Regexp.quote to manage tab and white space
+
+    Signed-off-by: Dirkjan Bussink <d.bussink at gmail.com>
+
+commit 714efa8574687e1fd31f904a4f35cce8056719f5
+Author: Brian Ford <bford at engineyard.com>
+Date:   Sat Feb 23 00:01:38 2008 -0800
+
+    Fixed Digest specs to pass with RSpec.
+
+commit a0fe2f7fa080729b77b32ffe21be5705a162ed71
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Fri Feb 22 22:26:52 2008 -0800
+
+    Remove ffi_decode_sockaddr, replace with existing ruby code.
+
+commit b2baf0911e4a88ba2f6c4cb8e3e31d2a3aa1c6bf
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Fri Feb 22 17:06:18 2008 -0800
+
+    Move Ar to kernel/core.
+
+commit 01baf002a8c7bd6e249b9477c1f78e6b99a67bf6
+Author: Philipp Bruschweiler <blei42 at gmail.com>
+Date:   Wed Jan 16 00:11:12 2008 +0100
+
+    added specs for SHA256/384/512
+
+    these specs were as well shamelessly copied from the md5 specs.
+    they work, but every sha* class has a folder for itsself, that's a
+    lot of duplicatd code. maybe someone with more experience in
+    writing specs should have a look at this.
+
+    Signed-off-by: Dirkjan Bussink <d.bussink at gmail.com>
+
+commit 924224fcf655da90148ebd8234033a71e1b23090
+Author: Caleb Tennis <ctennis at engineyard.com>
+Date:   Fri Feb 22 17:13:14 2008 -0500
+
+    Catch no block given in rb_yield, raise LocalJumpError
+
+    As well, define that as an exception for subtend
+
+    Update spec
+
+commit 3748843421832df5b842a677ddd2e55fbefb0b5f
+Author: Caleb Tennis <ctennis at engineyard.com>
+Date:   Fri Feb 22 17:04:33 2008 -0500
+
+    Update rb_yield spec
+
+commit f60ca442b1466f29432995700457e8b34f4ff294
+Author: Caleb Tennis <ctennis at engineyard.com>
+Date:   Fri Feb 22 17:00:36 2008 -0500
+
+    Fix rb_yield call
+
+commit a75afc4595fd20d7853ff65afe015de88b265b93
+Author: Caleb Tennis <ctennis at engineyard.com>
+Date:   Fri Feb 22 16:48:17 2008 -0500
+
+    Add blocks to subtend methods, as they should be able to access them like any other method.
+
+    Also, update the spec
+
+commit d9911f8b00243f3c95759612dde35edf6edaa678
+Author: Caleb Tennis <ctennis at engineyard.com>
+Date:   Thu Jan 31 13:54:24 2008 -0500
+
+    Add block specs and rb_block_given_p
+
+commit b6c806f0d8213c4751c69638174f60b80f9ba303
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Fri Feb 22 15:31:58 2008 -0500
+
+    Failing spec and exclude for left-to-right masgn evaluation order
+
+commit 8f9e3c9e5e7dfc535e8fe6b10b945587586651ec
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Fri Feb 22 13:59:44 2008 +0100
+
+    Fix Socket#getservbyname, not every platform defines http/udp
+
+commit f29ff3bcaf0bf83d2924d08ea5f6c0bbb5df9948
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Thu Feb 21 16:47:02 2008 -0800
+
+    Allow Ar to create archives
+
+commit e50ec6470dfc905198065a98b65b33a99da60e15
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Thu Feb 21 20:20:41 2008 -0500
+
+    Some compiler specs for 'defined?' handling
+
+commit ba5a0d87182d83000205e1202f5c473568a50489
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Fri Feb 22 01:08:51 2008 +0100
+
+    Fixed #332 and cleaned up Time a bit. Thanks to gls
+
+commit edf1e0d530ebb39a1b46d0fa518b9ca85db544da
+Author: Evan Phoenix <ephoenix at engineyard.com>
+Date:   Thu Feb 21 02:01:21 2008 -0800
+
+    Fix the last usage of block return (ie, internal long return).
+
+    * LongReturnException is now used whenever a block requests that
+      it's home context should return.
+
+commit 83ed7161701202d48490e7f38b568bc504f9690f
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Feb 20 23:59:47 2008 -0800
+
+    Added little/big_endian guards to Array#pack and String#unpack specs.
+
+commit 65b4ed86002371f2b56759aadc61e61c1cbbdba4
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Feb 20 22:49:19 2008 -0800
+
+    Exclude Socket#unpack_sockaddr_in spec. See tag comment.
+
+commit 9fbda05c4dffb964a9f10e26d62240fbd52200a0
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Feb 20 22:48:31 2008 -0800
+
+    Exclude super slow IPAddr specs.
+
+commit 3d39fb35dcd3c28fa626aeb96057b927c6bfe7c9
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Feb 20 18:54:50 2008 -0800
+
+    Redo expectation in Socket#getaddrinfo spec.
+
+commit 69576ede38d9bf09d1afd0120726ca756a0aa7cf
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Feb 20 18:31:27 2008 -0800
+
+    Account for variable length array in Socket#getaddrinfo.
+
+commit f396bd718572d9402d0d7eeb8da02474914396a8
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Feb 20 17:59:29 2008 -0800
+
+    Use File.delete in YAML specs instead of rm.
+
+commit 7698ec3855ce572f1e10962596804b82f3cd6534
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Thu Feb 14 10:07:48 2008 +1100
+
+    Hook-up new StepBreakpoint to new debugger step commands
+
+    * The commands step and stepi have now been added to the
+      debugger, and step into called methods.
+    * The commands next, nexti and out have been converted
+      to use the new StepBreakpoint. The legacy versions
+      remain, but have been renamed as ln, lni, and lo; these
+      will be removed once the new commands have proven stable.
+    * Replaced VM method cache command with VM send site command
+      to show details of SendSites in the current method.
+
+commit f192d65ec5eb31b4a807b9c3eb7360b84739d9f2
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Thu Jan 31 16:43:19 2008 +1100
+
+    Initial implementation of StepBreakpoint
+
+    StepBreakpoint class moves step logic out of the Debugger
+    and into breakpoint, where it more logically belongs.
+
+commit fd0ff43d2d384e221ff8de611843f3406d192657
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Feb 20 17:04:46 2008 -0800
+
+    Fixed YAML spec to pass MRI. Added fails tag for rbx.
+
+commit d69834a5217ddc6667b495fbe7d4dd8ad413ba88
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Wed Feb 20 15:42:25 2008 -0500
+
+    Fix dead code in TCPSocket.new specs
+
+commit 4644222e63046783933ca9b2e4514e3ff21fbb57
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Feb 20 12:31:14 2008 -0800
+
+    Add missing tag file for method_spec.
+
+commit 230d5d506f4203bcd3922880fae506fa480e6308
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Feb 20 12:17:13 2008 -0800
+
+    Fix typo in socket specs.
+
+commit a5d49537832a9cc33b07cade265af0834f123533
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Feb 20 12:09:11 2008 -0800
+
+    Move specs for calling methods to language/method_spec.rb.
+
+commit ead32a1f2820a4e2fcc906a8e7f3603490ba901c
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Feb 20 11:53:45 2008 -0800
+
+    Use bignum_value where a Bignum is intended in the specs.
+
+commit 1021345337bca1f928879713cb84a76b9c7935a1
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Feb 20 10:21:42 2008 -0800
+
+    Removed unused require 'stringio' from io/syswrite specs.
+
+commit cfd51af482321b4d672d69569de185f582a21831
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Feb 20 09:00:36 2008 -0800
+
+    Symbols as Fixnums is long deprecated. We don't spec it.
+
+commit a8bd2a1aba97653625a9b568d1a7112b5fce45f6
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Feb 20 00:15:54 2008 -0800
+
+    RbYAML is not in Ruby standard lib. Move specs for it to spec/library/rbyaml.
+
+commit 56b454af2ded18d0459bc974efa666ccf3b8de0f
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Feb 20 00:10:24 2008 -0800
+
+    Restrict specs in spec/ruby/1.8 to current stable 1.8 version.
+
+commit 22e01d1914db92d159ee15d3cf73c9d6e9d0a24b
+Author: Brian Ford <bford at engineyard.com>
+Date:   Tue Feb 19 23:20:27 2008 -0800
+
+    Fix Dir#pos=/#seek specs. We shouldn't spec undefined platform behavior.
+
+commit d522af83d0cfcdf39932afff7ba7d75d77dd0453
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Feb 20 11:51:44 2008 +0100
+
+    New IO.read specs.
+
+commit 77fdbe404e31f44e1c302eb99a7ff129523183ce
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Tue Feb 19 16:14:43 2008 -0800
+
+    Add library to read/write ar(5) files
+
+commit d7702f979732de90358dc35d795c6ac621f815bc
+Author: Matthijs Langenberg <mlangenberg at gmail.com>
+Date:   Mon Feb 18 18:04:27 2008 +0100
+
+    writen some examples for Base64 module
+
+    Signed-off-by: Dirkjan Bussink <d.bussink at gmail.com>
+
+commit 33b189478c05bd687ac8b062cd5307a3290d8931
+Author: Brian Ford <bford at engineyard.com>
+Date:   Tue Feb 19 00:27:51 2008 -0800
+
+    Convert platform guard :size option to :wordsize.
+
+commit cbcdb8346a2c75ba65910b486cee718cd3aa5175
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Feb 18 23:07:41 2008 -0800
+
+    Exclude TCPSocket.new for now, hangs on ubuntu gutsy.
+
+commit ec990b6ebcd35cbf9dc192852f37e184c3e4079b
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Tue Feb 19 15:55:25 2008 +1100
+
+    Re-enable debug on context change
+
+    The cpu_yield_debugger_check was not being performed as
+    a result of changes to method dispatch related to the
+    implementation of SendSite.
+
+commit aa585b7e637e2fd873602ee6725256429f413582
+Author: Brian Ford <bford at engineyard.com>
+Date:   Mon Feb 18 18:59:18 2008 -0800
+
+    Removed :version guarded specs that are not current stable.
+
+commit 431af5920a0a02dfca927961a2d6457ae5f050e2
+Author: Brian Ford <bford at engineyard.com>
+Date:   Mon Feb 18 17:40:56 2008 -0800
+
+    Added new tags files for excludes.
+
+commit 10dd37903533cac9a6f77ead70f3aa9ee1dc9098
+Author: Brian Ford <bford at engineyard.com>
+Date:   Mon Feb 18 16:38:58 2008 -0800
+
+    Removed deprecated $deferr from getoptlong.rb. Moved to /lib.
+
+    Small fixes to other library specs to get them running under CI.
+
+commit ee2dabf771a5e6d8d70c47fa49b1298d2d002c8c
+Author: Brian Ford <bford at engineyard.com>
+Date:   Mon Feb 18 00:42:54 2008 -0800
+
+    Use the spec guards properly.
+
+commit 91d6c64be8827768ba2e39b80a4eb81b9affc122
+Author: Brian Ford <bford at engineyard.com>
+Date:   Sun Feb 17 22:40:21 2008 -0800
+
+    Deprecate #setup, #teardown in specs; use #before, #after.
+
+commit 6ba49012504c08973e1fb2fd1b9fce75c351d148
+Author: Brian Ford <bford at engineyard.com>
+Date:   Sun Feb 17 22:00:56 2008 -0800
+
+    The #fails_on guard has been removed. Use #ruby_bug or tagged excludes.
+
+commit e24231f5c62c0b73768c7503f50b53e8ffc345d1
+Author: Brian Ford <bford at engineyard.com>
+Date:   Sun Feb 17 21:08:01 2008 -0800
+
+    Renamed *_excludes.txt to *_tags.txt for specs.
+
+commit a1c707b517e13115692173bc2048309e74c00915
+Author: Brian Ford <bford at engineyard.com>
+Date:   Sun Feb 17 20:45:14 2008 -0800
+
+    Hand merge recent excludes changes to spec/tags directory.
+
+commit 838bee7e99bb1179c9a3a7782dcab9c2b904e72e
+Author: Brian Ford <bford at engineyard.com>
+Date:   Sun Feb 17 00:17:51 2008 -0800
+
+    Moved excludes from spec/data to spec/tags. Added "fails" tags.
+
+commit 8ad91b03788d89ccd12fbcf19c06c9ef4f0cfee8
+Author: Brian Ford <bford at engineyard.com>
+Date:   Mon Feb 4 19:19:00 2008 -0800
+
+    Misc fixes to get MSpec running specs.
+
+commit a683dd75786ab6c6a255c9bac399dc6be7aaa4b5
+Author: Tyler McMullen <tbmcmullen at gmail.com>
+Date:   Sat Feb 16 23:39:38 2008 -0500
+
+    Add support for H and h to Array#pack.
+
+    * Updated array/pack_spec with specs for H and h, separately
+    * Updated Array#pack to handle both with a single block of code
+
+    Signed-off-by: Brian Ford <bford at engineyard.com>
+
+commit b1d3ba9d10f6a9ea87d8cb9be21d0d432e973117
+Author: oleg dashevskii <be9 at be9.ru>
+Date:   Mon Feb 18 01:18:24 2008 +0600
+
+    Update specs for calling methods.
+
+    Nasty binding stuff (first noted in #293) got specced and put into excludes.
+
+commit 02225daa5cef4fa3f48cac73d4bf0f9d02f3ebe0
+Author: oleg dashevskii <be9 at be9.ru>
+Date:   Sun Feb 17 23:20:08 2008 +0600
+
+    Cross-breed and update for, while & until language specs. Little fix for hash spec.
+
+    The compiler drops out on "for @@var in 1..3", so this is commented out.
+    Variable scope stuff arrived into excludes.
+
+commit f43383a150131278d30535196e8da4e60dff97b1
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Sun Feb 17 13:10:55 2008 +0100
+
+    New specs for RangeExceptions out of Fixnum and Array methods.
+
+commit 7d1c744d9c1ae50376be406a28e383a04ca6b4fc
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Sat Feb 16 13:49:11 2008 +0100
+
+    Corrected copy-paste error in recent fixnum specs.
+
+commit 08982321472008f7645212289d2624d19053ed7e
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Fri Feb 15 21:18:53 2008 -0800
+
+    Fix IO#read for large files and small parts of files.
+
+    Fix IO#read with buffer.
+
+    Fix IO#eof? when buffer reaches eof.
+
+commit 1d07588d61b3835a6165c5de1f731277812cff79
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Fri Feb 15 19:11:42 2008 -0800
+
+    Add missing spec for IO#eof? and fix.
+
+commit e0a6c8e179e48b423b6eb142b27460cd86d0223b
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Fri Feb 15 17:50:47 2008 -0800
+
+    (Last change was ok).  Force check for data so #eof? works
+
+commit d7e67c257c213f9e25b3123ce85576feb71a0089
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Fri Feb 15 17:28:48 2008 -0800
+
+    Revert "Force a check for more data on the IO for IO#eof?"
+
+    This reverts commit 3d4427e802756678608bf9840ba6f26fc81cf7fe.
+
+commit 4c1182c184bb6c2c97c5fc8ce83f242fe5f5144b
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Fri Feb 15 17:26:08 2008 -0800
+
+    Force a check for more data on the IO for IO#eof?
+
+commit 94466db3347889850feb25dd7c83883df21bac92
+Author: Brian Ford <bford at engineyard.com>
+Date:   Fri Feb 15 14:13:29 2008 -0800
+
+    Added Float examples to Bignum bitwise operator specs.
+
+commit 3a668451d3bcc46b162a69ce1f8ec5d6a98b2d22
+Author: Brian Ford <bford at engineyard.com>
+Date:   Fri Feb 15 13:44:24 2008 -0800
+
+    Added bignum_value helper. Added specs for Fixnum bitwise operators.
+
+commit 217eb67a4c2f0bf1222628abfecfadbede5fb3b8
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Fri Feb 15 21:09:43 2008 +0100
+
+    Fix process specs for FreeBSD
+
+commit f25e0e130110ebbef0b5bc0c28c9b08db6c73a1f
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Fri Feb 15 13:18:40 2008 +0100
+
+    Removed now working exclude for Array#sort
+
+commit 56af7be26dcc9b7270de6d96e73e09a4f17cc710
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Thu Feb 14 20:48:37 2008 -0500
+
+    Improved Array#sort, #sort! specs.
+
+commit 714ea4b5245172cc6d5c815ef7399d1a991dd83f
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Wed Feb 13 10:30:22 2008 -0500
+
+    Improved Array#sort specs a bit.
+
+commit 8944e873848c610182405c2de466e41e6260573d
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Wed Feb 13 02:34:37 2008 -0500
+
+    Tuple#swap specs.
+
+commit 24199f731dba40b72af6d121121dec9f085f890d
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Thu Feb 14 20:03:16 2008 +0100
+
+    New rubyspecs for IO#reopen.
+
+commit 4f70320e5b7089c74b3899216763cd37d8854230
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Thu Feb 14 17:27:32 2008 +0100
+
+    Removed JRuby-specific guards. Please don't use guards to hide bugs.
+
+    Guards to be used only when it is agreed that the JRuby behavior
+    is intentionally differs from MRI. For plain bugs, guards should
+    not be used. Instead, we maintain spec exclusions in JRuby repository.
+
+commit 0198a11b3bdf60983846a6c722dfa11d1b9f57bb
+Merge: ef3393e... 1f1e32e...
+Author: Mutwin Kraus <mutwin.kraus at blogage.de>
+Date:   Thu Feb 14 15:57:57 2008 +0100
+
+    Merge branch 'mutle_file_specs_refactoring'
+
+commit 1f1e32e5e1fd12fb323e2a74a7f5caae96aa867b
+Author: Mutwin Kraus <mutwin.kraus at blogage.de>
+Date:   Thu Feb 14 15:18:14 2008 +0100
+
+    Specs for File#chown #flock and #truncate now pass on JRuby
+
+commit 3a8e601d5205e050f83179376d2be3e922e80c20
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Thu Feb 14 17:25:02 2008 +1100
+
+    Fix context specs to wait for debug listener thread
+
+commit 608d7a99e75d293d6f9786cee940c0dd23156be3
+Author: Mutwin Kraus <mutwin.kraus at blogage.de>
+Date:   Thu Feb 14 12:59:32 2008 +0100
+
+    Adding guards to only run File#chown and File.chown specs as root.
+
+commit b3a1069cf6c18b844b9eced32b7bcdb91ad7c558
+Author: Brian Ford <bford at engineyard.com>
+Date:   Thu Feb 14 01:31:47 2008 -0800
+
+    Rework Bignum#==. Change Numeric#== to conform to MRI.
+
+commit 4eb58ebc45b2ee79f01d75fdb3e9104c73ad66e2
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Wed Feb 13 23:56:37 2008 -0800
+
+    Common implementation for Zlib::Inflate and Zlib::Deflate.
+
+commit 1804fdacce5c195a90befe502706d1f1e066e886
+Author: Brian Ford <bford at engineyard.com>
+Date:   Wed Feb 13 19:31:20 2008 -0800
+
+    Port of JRuby's File.fnmatch to Ruby (yeah, like writing Java in Ruby).
+
+commit 1a78da8438535ee8ed231359bdb15ff3624c6b37
+Author: Mutwin Kraus <mutwin.kraus at blogage.de>
+Date:   Thu Feb 14 01:27:52 2008 +0100
+
+    Adding File#truncate improvements from #325 and #326
+
+commit 5b62acbdcf0aab2e89be5ac3e12859ae36cd6950
+Author: Mutwin Kraus <mutwin.kraus at blogage.de>
+Date:   Thu Feb 14 00:47:53 2008 +0100
+
+    Adding File#truncate with specs
+
+commit 1a2b3dde4f67abe0936e7ec6fb749e5bb8fda7d2
+Author: Mutwin Kraus <mutwin.kraus at blogage.de>
+Date:   Thu Feb 14 00:36:32 2008 +0100
+
+    Adding File#chown with specs
+
+commit e132cd6f11285f0e106a5d2a292e23c8375fa1ee
+Author: Mutwin Kraus <mutwin.kraus at blogage.de>
+Date:   Thu Feb 14 00:12:31 2008 +0100
+
+    Renamed File#flock spec to properly reflect an instance method
+
+commit 00cd22ccdf2b70fa53693000d4a5bb803c7d6df6
+Author: Mutwin Kraus <mutwin.kraus at blogage.de>
+Date:   Thu Feb 14 00:07:05 2008 +0100
+
+    Adding File::flock with specs
+
+commit 3c9b3e4e4272889dd26ec9ddb25f7aaf88c6c380
+Author: Mutwin Kraus <mutwin.kraus at blogage.de>
+Date:   Wed Feb 13 23:25:30 2008 +0100
+
+    Adding File::chown with specs
+
+    * The spec works fine on OS X, but was not tested anywhere else
+
+commit c894a6c46b4a3d0b9010020c394d3ba366bf145e
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Wed Feb 13 11:59:38 2008 +0100
+
+    Module#undef_method should accept string parameter, not only symbols by Nikolai Lugovoi (#321)
+
+commit c968d5c29cc3126c789cf5bb2005bd9637e85312
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Wed Feb 13 11:52:10 2008 +0100
+
+    Update excludes for File#truncate
+
+commit 408e69864546aea061e006073bb452b8db8c4610
+Author: Ragnar Dahlén <r.dahlen at gmail.com>
+Date:   Wed Feb 13 11:15:31 2008 +0100
+
+    Implement File.truncate, passes specs.
+
+    * Adds truncate, ftruncate (not used yet) to posix.rb
+
+    Only tested on Mac OS X 10.5.1.
+
+    Signed-off-by: Dirkjan Bussink <d.bussink at gmail.com>
+
+commit 5c75721d5a78e25a77e9f068bf4c95e729604959
+Author: oleg dashevskii <be9 at be9.ru>
+Date:   Wed Feb 13 11:26:34 2008 +0600
+
+    Remove tests that have been superseded by precedence_spec.
+
+commit 83a372674786a0be51a206cadcae644d72a1e8d2
+Author: oleg dashevskii <be9 at be9.ru>
+Date:   Wed Feb 13 11:05:34 2008 +0600
+
+    Made a real precedence_spec.
+
+    One test still commented out till the bug with flip2 is fixed.
+
+commit c3988a4a906594c050e058add8aa6996870dc115
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Wed Feb 13 02:10:49 2008 +0100
+
+    Remove excludes for File#stats specs
+
+commit 1624b463d0f70a27b6772d90626c94b6eed4e5c4
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Tue Feb 12 18:25:05 2008 -0500
+
+    Add specs for pass subclasses of Module to 'include'
+
+commit 64b0fb4131276feda0d0ab13301824b20f8d7f8e
+Author: oleg dashevskii <be9 at be9.ru>
+Date:   Wed Feb 13 00:49:37 2008 +0600
+
+    Make Dir.chdir spec work when /home is symlinked to /usr/home.
+
+commit 8cbf6312df160f30e284a4537039f808a42543fe
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Tue Feb 12 12:30:19 2008 -0500
+
+    Add failing Array#sort spec and matching exclude
+
+commit 9bef807b3b469b8790edbe96f1442394d528cb5a
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Tue Feb 12 12:09:11 2008 -0500
+
+    Move Time#<=> specs around until the descriptions make sense
+
+commit 60fbbc62cb04b2fddcd406f01f906482fbc84370
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Tue Feb 12 05:33:49 2008 +0100
+
+    Mark JRuby as not deviating from MRI on unboundmethod specs.
+
+commit 4e6d8f7e3326f937a6916ed11984172670a71094
+Author: Yehuda Katz <ephoenix at engineyard.com>
+Date:   Mon Feb 11 23:26:31 2008 -0800
+
+    Zlib.adler32
+
+commit 2f2d10e1aa57bae79f7fcda5e5a30b2a2ef3e37c
+Author: Yehuda Katz <ephoenix at engineyard.com>
+Date:   Mon Feb 11 23:12:40 2008 -0800
+
+    Zlib.crc_table
+
+commit 49b9e4b624074d151e89f078c4080a0a7584abaa
+Author: Yehuda Katz <ephoenix at engineyard.com>
+Date:   Mon Feb 11 22:56:52 2008 -0800
+
+    Zlib#crc32
+
+commit 7cb2ebfa008afc96135912ceefdbd81b1cd7e478
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Mon Feb 11 17:36:32 2008 -0800
+
+    Fix class variables for RDoc.
+
+commit 571d837bbeff221daacebc79c1ccab7de15c77f2
+Author: Brian Ford <bford at engineyard.com>
+Date:   Mon Feb 11 08:54:36 2008 -0800
+
+    Exclude [r]dev_(major|minor) specs. We need some autoconf facilities.
+
+commit fb2bc81d50bf504e3997d009e3c13f841b859803
+Merge: 55a52f1... 9b58a59...
+Author: Jonas Pfenniger <zimbatm at oree.ch>
+Date:   Mon Feb 11 16:19:02 2008 +0100
+
+    Merge branch 'master' of git at git.rubini.us:code
+
+commit 55a52f18133fc9f92eef64838008a83dfaab3ffc
+Author: Jonas Pfenniger <zimbatm at oree.ch>
+Date:   Mon Feb 11 16:18:37 2008 +0100
+
+    Removed Math.asinh excludes.
+
+    It wasn't working on OS X. Evan fixed the culprit FFI over the weekend.
+
+commit 9b58a59ca21c6622d246e629410230bfbe8cd4ce
+Author: makoto kuwata <kwa at kuwata-lab.com>
+Date:   Mon Feb 11 21:24:05 2008 +0900
+
+    Modified to address differences of SyntaxError class between MRI and Rubinius in 'erb/filename_spec.rb'
+
+    Signed-off-by: Dirkjan Bussink <d.bussink at gmail.com>
+
+commit d1c4280b70b82d6cd541251e3d7e1a3091fb304f
+Author: makoto kuwata <kwa at kuwata-lab.com>
+Date:   Mon Feb 11 20:19:12 2008 +0900
+
+    Add 'erb/util/shared/url_encode.rb' which is missed file
+
+    Signed-off-by: Dirkjan Bussink <d.bussink at gmail.com>
+
+commit b4b1114ac7dffabd672d462b5857a7e1957e8f07
+Author: makoto kuwata <kwa at kuwata-lab.com>
+Date:   Mon Feb 11 19:10:58 2008 +0900
+
+    Add spec files for erb.rb
+
+    Signed-off-by: Dirkjan Bussink <d.bussink at gmail.com>
+
+commit dfdf90968e78f14e0755b5f3279ec878034dbdb5
+Author: Yehuda Katz <ephoenix at engineyard.com>
+Date:   Mon Feb 11 00:09:23 2008 -0800
+
+    Added singleton specs (and reorganized stale one):
+    * Singleton#_dump
+    * Singleton._load
+    * Singleton#instance
+    * Singleton.instantiate?
+    * Singleton.new and Singleton.allocate
+    * Singleton#dup and Singleton#clone
+
+commit 54c4a4cab187be4328d6a810bae4bc4bd01ca1d8
+Author: Brian Ford <bford at engineyard.com>
+Date:   Sun Feb 10 20:19:30 2008 -0800
+
+    Additional specs for File::Stat#rdev, #rdev_major, #rdev_minor.
+
+commit 6b2f05af4758c488b3e2e3b19ee9d2e872817932
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Sun Feb 10 23:00:41 2008 -0500
+
+    Rubinius now passes all 'super' specs
+
+commit 5be84fce241c67bd8439bccbe54cec575b0ea93a
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Sun Feb 10 22:53:11 2008 -0500
+
+    Failing spec for 'super' behavior
+
+commit 975d51e80d3df437eaa8ddd3c3384a5766255b12
+Author: Brian Ford <bford at engineyard.com>
+Date:   Sat Feb 9 15:18:37 2008 -0800
+
+    Exclude Process constants spec until LFS is fixed on 32bit linux.
+
+commit 236def62bcfa3dca75a6eebf378a68235c4613ed
+Author: Yehuda Katz <ephoenix at engineyard.com>
+Date:   Sat Feb 9 17:04:59 2008 -0500
+
+    Fixes exclude
+
+commit 26bedb481b45e77434b487c6395903c6110ef99e
+Author: Yehuda Katz <ephoenix at engineyard.com>
+Date:   Sat Feb 9 16:01:58 2008 -0500
+
+    Moved bad variables spec out
+
+commit 87efbf9036e5c524e1b40481c89107538d574ba8
+Author: Brian Ford <bford at engineyard.com>
+Date:   Sat Feb 9 11:26:30 2008 -0800
+
+    Revert all File::Stat stuff. We'll fix Dir first.
+
+commit 1f5bc0f98a23fc90b9bd00048af1551df8e534f7
+Author: Brian Ford <bford at engineyard.com>
+Date:   Sat Feb 9 00:39:20 2008 -0800
+
+    Reduced File::Stat.stat primitive further. Details follow.
+
+    * Added ffi_major and ffi_minor to calculate the major, minor
+      parts of st_dev and st_rdev.
+    * Added (temporary) new primitive basic_stat to change the
+      return type from a tuple to a single MemoryPointer instance.
+    * Added simple specs for rdev, rdev_major, rdev_minor, nlink.
+
+commit e478731a2fc558c62cecbe327c5b35882d90b53d
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Feb 8 16:45:05 2008 +0100
+
+    One more rubyspec for File#open.
+
+commit 5f6ac709500cb64df110a44d31e0c0b89dd68aec
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Feb 8 16:39:47 2008 +0100
+
+    New rubyspecs for File#umask.
+
+commit fddaa684bd7e8c403ff96179ca71a5837f609b63
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Feb 8 16:30:20 2008 +0100
+
+    New File#chmod rubyspecs.
+
+commit ed20c3f9f36f343a37e2ac05ea91d84b54c87bc8
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Fri Feb 8 12:00:57 2008 -0500
+
+    Correctly guard Bignum specs for CI
+
+commit 36e9749984d6e4412c26d348afa8c501cf043ecf
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Feb 8 13:09:37 2008 +0100
+
+    Some more specs for File#new and File#open, and permissions.
+
+commit 29376695550c5608f466d63d49de76a6ee163e37
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Feb 8 12:10:27 2008 +0100
+
+    New specs for IO#new and IO#open, invoked with permissions parameter..
+
+commit 8cf27fcd86f88b75716b65dc1d94b721c01c3af9
+Author: oleg dashevskii <be9 at be9.ru>
+Date:   Fri Feb 1 21:03:08 2008 +0600
+
+    Heredocs and more stuff added to string_spec.
+
+commit 2cccd38a081c0303f8fa567058e4c26fa354abc5
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Fri Feb 8 12:51:53 2008 +0100
+
+    Add exclude for currently failing for_spec
+
+commit 031bb1b565a3446ab995ea55e6ae8890573ba6c0
+Author: oleg dashevskii <be9 at be9.ru>
+Date:   Fri Feb 1 20:23:56 2008 +0600
+
+    Added more tests to for expression spec.
+
+commit 73e40331c6b4c1c1b6e41ae312299f6815e089c2
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Thu Feb 7 19:12:46 2008 -0500
+
+    Add a failing spec for Array#join and then fix it
+
+commit fa49548fe704252c352a1bc4833b5da20262061a
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Thu Feb 7 23:12:03 2008 +0100
+
+    Fix last two Failing Time specs for Time#+ and Time#-
+
+commit e4e51c6aa39e5a5a61b0df919ba02b88d4878f43
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Thu Feb 7 22:35:57 2008 +0100
+
+    Fix Time.at so it also works with floats
+
+commit f5505522fd0396c3864fce155681ac577bf2e7e6
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Thu Feb 7 17:10:48 2008 +0100
+
+    Fix Time#<=> for objects other than Time
+
+commit e8ab7b5eb30da84262a9395e20ac420e83674edf
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Wed Feb 6 13:59:18 2008 -0800
+
+    Only call Class#inherited once
+
+commit dc9ff28ae919292287f5562b8c105ff6310c5920
+Author: Phil Hagelberg <phil at hagelb.org>
+Date:   Wed Feb 6 15:00:59 2008 -0800
+
+    Kernel#eval should be a module function
+
+    Added a spec as well
+
+commit 7dd83410a2159fd65f951689a8a1297baded4fa6
+Merge: 698ffa4... 339fed9...
+Author: Mutwin Kraus <mutwin.kraus at blogage.de>
+Date:   Wed Feb 6 22:54:12 2008 +0100
+
+    Merge branch 'master' of git at git.rubini.us:code
+
+commit 698ffa4e04fee58da5c3f2191372c4e4f2bc070d
+Author: Mutwin Kraus <mutwin.kraus at blogage.de>
+Date:   Wed Feb 6 22:51:54 2008 +0100
+
+    Adding missing specs for ftools
+
+    * specs for chmod, compare, copy, install, makedirs, move and safe_unlink
+
+commit 339fed9821b75de056febc406b32fe52ff9354a9
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Wed Feb 6 22:00:46 2008 +0100
+
+    Forgot to remove spec excludes...
+
+commit 7ecca7222823a82252ed09b17eefafe6fec9f12e
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Wed Feb 6 21:46:19 2008 +0100
+
+    Fix last two failing Dir#glob specs
+
+commit fec39f27d287ca74becbecc120de8533e346b864
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Feb 6 18:13:13 2008 +0100
+
+    A few more corner cases fo IO#lineno specs.
+
+commit 3691d3f9a202abb22e11024e41b868d531a549be
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Feb 6 18:02:50 2008 +0100
+
+    New rubyspecs for IO#lineno.
+
+commit a5b0f9aa15c9372f74816e77073926780a9cc219
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Feb 6 15:58:26 2008 +0100
+
+    Improved IO#foreach specs.
+
+commit 91ea9f304c75592e7454411ef21391a0e34da5e5
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Feb 6 15:03:02 2008 +0100
+
+    New rubyspecs for IO#gets and IO#foreach.
+
+commit 9c494786fbf400bb295e1f19d142e2c903c21e54
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Feb 6 13:37:43 2008 +0100
+
+    New rubyspecs for IO#foreach.
+
+commit cdbbeba8f3351fe43f44d732348f380599ad5719
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Feb 6 10:40:13 2008 +0100
+
+    New rubyspecs for IO's sysread and read with buffer argument.
+
+commit e1cb4410b7e0a0ba2fd580784334bdfd05ba4b8a
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Feb 6 10:15:29 2008 +0100
+
+    Excluded rbx failure after spec rename.
+
+commit 1fde018b9378b55f6d51cb85bd65813b5cef5493
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Wed Feb 6 02:50:44 2008 -0600
+
+    Tidy up an apparent copy/paste mistake in IO#syswrite spec
+
+commit 1aa624e625dafaeebd70eac11819f02ecf570f8e
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Feb 6 00:19:39 2008 +0100
+
+    New IO specs for writing non-string data.
+
+commit f94a0cffd5fd0e186a9403d97800b55f8c44bdd1
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Tue Feb 5 15:13:47 2008 -0800
+
+    Regenerate zlib stubs.
+
+commit 52ce0e702170676ce02dcc288305097d58834cf8
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Tue Feb 5 13:34:47 2008 -0800
+
+    Add Zlib spec stubs
+
+commit b24ad594837b974a3ae3b207d63ce5cdc956a1a0
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Tue Feb 5 21:45:09 2008 +0100
+
+    Added some boundary test cases for Float.
+
+commit 1a8c9966fa148fc3e912f8aecd42c8c00ca4f89c
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Tue Feb 5 22:46:18 2008 +0100
+
+    Removed problematic Marshal spec because 2**40 is a Bignum on some archs and a Fixnum on others
+
+commit 6ad8a0a25f20fd137bcb7fcb83bc88440a2a2069
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Tue Feb 5 17:03:56 2008 +0100
+
+    Eliminated file descriptors leakage out of IO tests.
+
+    These things make runs unpredictable, causing all kinds
+    of troubles (non-deterministic failures, fluctating
+    number of tests).
+
+commit 95ac3cb9900c52e4819b37166c71840d4bb4e3d9
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Tue Feb 5 14:50:31 2008 +0100
+
+    New rubyspecs for File.open with block.
+
+    Also, IO.open specs improved to handle closing better.
+
+commit 66f636c346a63853ae37a06f1c3e8b5083370892
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Tue Feb 5 13:22:34 2008 +0100
+
+    New tests for IO.open, and additional cases for IO's inspect and stat.
+
+commit dfb941da0f7503bce58dc88a85ccfd201615e13b
+Author: Brian Ford <bford at engineyard.com>
+Date:   Tue Feb 5 01:57:20 2008 -0800
+
+    Ezra's patch for Regexp#inspect, #309.
+
+commit c5f9381ee74ed2d9c91cca1dd2ce9719b6f51bd8
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Tue Feb 5 10:07:57 2008 +0100
+
+    Corrected IO test to not interfere with Kernel#puts tests.
+
+commit 751293c1ea14de1b1d2757bf5d60b082cc771e7a
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Mon Feb 4 17:43:06 2008 -0800
+
+    removed empty excludes
+
+commit 206399aee9ae7845d76c0726702c424b9fc44e80
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Mon Feb 4 17:39:45 2008 -0800
+
+    StringIO#seek now raises if passed bignum offset - should be platform specific, but this'll do for now
+
+commit b00f04ec0fcd8f8edf9943abb5999f1cca9e9e9e
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Mon Feb 4 17:06:34 2008 -0800
+
+    Knocked off the last of the method excludes.
+    Tightened up the spec for #to_s
+
+commit 3d4f87741135343a2e8ec6032fa3a69529cfbf69
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Mon Feb 4 16:51:37 2008 -0800
+
+    Fix Hash#key? to work with objects that have the same #hash.
+
+commit f814a15639f6e6ecd47ab99ad9e37e93fd6bc165
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Mon Feb 4 15:17:08 2008 -0800
+
+    Fix Marshal format version check
+
+commit 6d9e0afb5600416e5d66d5123abcfa5dd6c40903
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Mon Feb 4 14:24:48 2008 -0800
+
+    removed tmpfiles from dir/fixtures and moved them to tmp where they belong
+
+commit 4e18d1cf49573b1fa3f484686352734aa39457d0
+Author: Ruben Nine <ruben at leftbee.net>
+Date:   Mon Feb 4 02:32:26 2008 +0100
+
+    Added support for tag:yaml.org,2002:sym to RbYAML library.
+
+    Signed-off-by: Jonas Pfenniger <zimbatm at oree.ch>
+
+commit 220ed05f204f4b8fe7f1f303fae9a18988f8879b
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Mon Feb 4 17:16:44 2008 -0500
+
+    Use an example number that is actually a Bignum everywhere in compiler Bignum spec
+
+commit db3f20c8ec905641de887bbd1ed581aa78f73471
+Merge: e33350e... 6e3dad3...
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Mon Feb 4 16:50:14 2008 -0500
+
+    Merge branch 'wilson64'
+
+commit 6e3dad3e5b2e982f96e991e9df2d46de5bf4ee1f
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Mon Feb 4 16:49:09 2008 -0500
+
+    Use the correct Fixnum#size spec on 64bit platforms
+
+commit e33350eddc3441b2ebe06336500e6445406285d1
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Feb 4 22:12:14 2008 +0100
+
+    Moved one IO#inspect spec to File#inspect specs.
+
+    Since the behavior is File-specific.
+
+commit 1586e3a2c5d12f5438adddb8c84bc90c3defee82
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Feb 4 20:57:09 2008 +0100
+
+    Add more IO specs. God, make it stop!
+
+commit e64f3b02423acb783ba8a62996847b0393e7f3ee
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Feb 4 20:33:57 2008 +0100
+
+    And more IO specs.
+
+commit 3d584f0ee2cf988720bb5985c20b3bec6c2e143f
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Feb 4 20:08:26 2008 +0100
+
+    Next batch of IO methods specs with closed streams.
+
+commit 6e22a99350195cfa7a40d6049d6d72a9ae7e1168
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Feb 4 19:47:06 2008 +0100
+
+    And yet more specs for IO methods with closed streams.
+
+commit 12e8d881b90cbd60bc792693e799923fdb1041b0
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Feb 4 19:20:39 2008 +0100
+
+    More rubysecs for IO methods invoked on closed streams.
+
+    Plus some refactoring to move repetitive code to the fixture.
+
+    NOTE: two specs marked as fails_on :rubinius due to fact
+    that they crash rubinius.
+
+commit 3ae3cafcb10725953c8e595641af277f36c88677
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Feb 4 18:39:34 2008 +0100
+
+    New rubyspecs for IO#to_io.
+
+commit 4980bb83f53845e88cd0d1a3b0823fdbf0c0a001
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Feb 4 18:09:36 2008 +0100
+
+    New rubyspecs for IO#ungetc.
+
+    Unfortunately, MRI doesn't follow some of its own
+    specified behaviors...
+
+commit f27fe4f3e4ccb298dcaa5014dac69d3148ee169e
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Feb 4 17:18:08 2008 +0100
+
+    Added rubyspecs for IO's putc, puts, printf, print and closed streams.
+
+commit a1d7b67942aed8d1b185476dee6f2d99403ed227
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Feb 4 17:07:00 2008 +0100
+
+    Added rubyspecs for IO#pid.
+
+commit cfa1ef21ce862a05ae352a4fe49a3ac4c04b9bed
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Feb 4 16:36:21 2008 +0100
+
+    Added new rubyspecs for IO#sync and IO#sync=.
+
+commit b4f6c33c17e57fa44322124af088a97d475905e2
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Feb 4 16:20:50 2008 +0100
+
+    New exclusions for rbx.
+
+commit 60309280c48b2bd1f1d8a5ea018f401e75b7dac1
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Feb 4 16:17:27 2008 +0100
+
+    Added new tests for IO's pos, pos=, rewind, seek on closed streams.
+
+commit 40414ad1b39222494ff2a79a0091890a60b7adf1
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Feb 4 14:26:13 2008 +0100
+
+    One more test for IO#eof?.
+
+commit 29db340f24c043b240fec6722c323fa1567ce855
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Feb 4 14:19:46 2008 +0100
+
+    Added new rubyspecs for IO#getc and IO#getchar.
+
+commit 0e0a987782fc7834ba95a2e8e2c8ab6cd8dcea81
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Feb 4 13:54:59 2008 +0100
+
+    More rubyspecs for IO#eof?.
+
+commit f7d1139e4eace4a86f0c0512bf9269964442628d
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Sun Feb 3 15:55:10 2008 +0100
+
+    Fix Date#strptime specs
+
+commit ac4600fcb42928aeba508371aea2f76510e70d5c
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Sun Feb 3 13:26:52 2008 +0100
+
+    Fixed Time specs for non Rubinius platforms
+
+commit a5081ca646e99ec94fedfabf03b7eb0a8d37afc3
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Sat Feb 2 23:53:52 2008 +0100
+
+    Fixed Time specs for 64 bit archs
+
+commit 26eef47571b921fe6b3228033119e5969c4100db
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Feb 2 13:30:16 2008 -0500
+
+    Updated IO excludes.
+
+commit 8edd73d9915f72ee70b661b23e8b42f8b985fa9c
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Sat Feb 2 10:45:23 2008 -0600
+
+    Repair IO#sysseek spec to not write to fixture file; uses a tmpfile now.
+
+commit bf6348c935c816a981672e9c26a40354cf0d722c
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Sat Feb 2 02:35:42 2008 -0600
+
+    Additional IO#sysseek spec for the warning after buffered writes
+
+commit 5241316a1c74e6580fb91940a9f061047e89cdbf
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Sat Feb 2 02:32:36 2008 -0600
+
+    Modify IO#seek specs for IO#sysseek, adding appropriate error tests
+
+commit 7f124cbf66b96fdcdaec73917e86eedfb4a9ddf8
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Fri Feb 1 18:05:15 2008 -0800
+
+    Refactored Marshal#dump specs and merged with fixtures/marshal_data.rb
+
+commit 3766b3ed41ffba71ecb1bef8079027bffe518e2a
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Fri Feb 1 16:54:32 2008 -0800
+
+    Refactored specs for Marshal#load
+
+commit e134d5bf8e247f4a231bfbfc1c3251b262f219e4
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Fri Feb 1 15:36:06 2008 -0800
+
+    Update excludes for recent failures
+
+commit 8ded8b443f55b47a1c30b59cfb0d96d8752d5fa9
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Fri Feb 1 15:11:37 2008 -0800
+
+    Process.group spec is missing a suplemental group on OS X
+
+commit 4b7de6ff839b220115dd29f34b5a9f46cb8f5bef
+Author: Evan Phoenix <ephoenix at engineyard.com>
+Date:   Thu Jan 31 17:16:13 2008 -0800
+
+    Add proper primitive failures, fix empty symbol.
+
+commit dc55c88beee6a3a3a7fd352c1e374ecf84863459
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Feb 1 16:17:00 2008 +0100
+
+    Fixed 2 Date#strptime specs that otherwise would pass only in January.
+
+commit 86c372d0fb50aeb6235ed1595d18a876e09330db
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Feb 1 15:32:40 2008 +0100
+
+    Few specs for Time#<=> with non-Time arguments.
+
+commit 765ef93acd294922dc22a986213a5842ce3e67a7
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Feb 1 14:09:01 2008 +0100
+
+    Added more specs to Time#+ and Time#-.
+
+commit af76adac2182e46e34e68d29b3cd8614edd27d50
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Feb 1 13:38:20 2008 +0100
+
+    Added more test cases for Array#join on recursive arrays.
+
+commit bb15b72393b34d3d10bb644fb1d6ce47b6dc0826
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Feb 1 13:15:24 2008 +0100
+
+    Added more test cases for File::join with recursive arrays.
+
+commit 7041b2aef1e574dfe220a70da5210c683074f8ae
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Fri Feb 1 03:18:31 2008 -0800
+
+    Describe an unambiguous method.
+
+commit 84edf54799e0ccd09276a5cda3fccf544f971c48
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Fri Feb 1 03:07:48 2008 -0800
+
+    Use fixed Marshal data for all specs and fix many broken or useless specs.
+
+    Clean up spec naming and definition.
+
+    Use descriptive names for test classes.
+
+commit e0c3aa074c9525450a7a667ec2cc843ff3560e65
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Thu Jan 31 23:29:57 2008 -0500
+
+    Hash.new patch from Phil Hagelberg + MethodTable workaround.
+
+    * The Hash.new patch splits a separate #setup method so that subclasses
+      can override #initialize without problems.
+    * Because it is part of the core code, MethodTable needs to explicitly
+      call #setup in its #initialize.
+
+commit a32f16d9288c5c0822cc6962ce3caed5e1bac5d0
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Thu Jan 31 15:35:08 2008 -0500
+
+    Updated Module excludes.
+
+commit df731f327c4d47373ba6f2fe2f79d5d9acbf398e
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Thu Jan 31 15:30:11 2008 -0500
+
+    More Module#module_function specs in #eval and #module_eval.
+
+    * #module_eval separates the two scopes but #eval does not.
+
+commit 6358e5893c52042c10c355173d1ad8441a00bcfa
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Thu Jan 31 15:13:49 2008 -0500
+
+    Better Module#module_function specs.
+
+commit 1646bb6e99a6b4190641046ae730ea1be9c8be2a
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Thu Jan 31 13:59:20 2008 -0500
+
+    Various whitespace removal in preparation to fix #module_function.
+
+commit 108601d85d2c41d05f9c00945664d9980e0e46c3
+Author: Evan Phoenix <ephoenix at engineyard.com>
+Date:   Thu Jan 31 13:39:53 2008 -0800
+
+    Add meta_send_call instruction, speeds up calling blocks
+
+commit 50f9c50820b4305877af1c7fd7597c5dc94c623c
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Thu Jan 31 12:20:11 2008 -0500
+
+    Added LC_ALL=C for all other platforms for Time specs too.
+
+    * If it breaks, report and we will figure out something else.
+
+commit 26059c1570c5ad2a64a796e2678ff2d9ace23e58
+Author: Pierre Yager <pierre at levosgien.net>
+Date:   Tue Jan 29 22:48:22 2008 +0100
+
+    Fix for bin/ci spec failure on localised linux
+
+    * Force system date to be executed against "C" locale
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit e5ce9e7c29a34f685f7d3f8a9f855db28aece460
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Thu Jan 31 11:32:56 2008 -0500
+
+    Removed trailing whitespace for Time and some Time specs.
+
+commit 3546f721ac86efa318b3802a2f498d41aa830c9f
+Author: Caleb Tennis <ctennis at engineyard.com>
+Date:   Thu Jan 31 10:53:53 2008 -0500
+
+    Subtend: Add rb_define_private_method, rb_define_protected_method, rb_define_module_method, etc.
+
+commit 7553cb993a0c7e60c2212800b0ecc033ffc0b206
+Author: Caleb Tennis <ctennis at engineyard.com>
+Date:   Thu Jan 31 10:39:08 2008 -0500
+
+    Add rb_class2name in subtend
+
+commit 4570b7c5d837025d765a6a2909d5536c466b9dcb
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Thu Jan 31 02:26:09 2008 -0800
+
+    quick addition of 2 exclusions
+
+commit 53c76326e76869a87ad0fc67adbd3aef9059ee35
+Author: Ryan Davis <rdavis at engineyard.com>
+Date:   Thu Jan 31 02:15:15 2008 -0800
+
+    Parser spec updates
+
+commit 8fb2eb68858a1ee1dafb06b833f43d6da817756f
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Wed Jan 30 19:29:25 2008 -0500
+
+    Slightly more permissive TCPServer.new spec for hostname string.
+
+commit 2a60dbbf011e806ae51c30ab2cb2b8e7b9b633a5
+Author: Mutwin Kraus <mutwin.kraus at blogage.de>
+Date:   Wed Jan 23 18:41:12 2008 +0100
+
+    Fixing TCPSocket#new for localhost (with specs for both IPv4 and IPv6)
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit f485a6818a754c8110feafa9f6dced42a99187d0
+Author: Jacob Maine <jacob.maine at gmail.com>
+Date:   Tue Jan 29 21:13:28 2008 -0500
+
+    Making Enumerable#inject only accept one paramter
+
+    Uses 'Undefined' idiom, which fixes spec, and cleans up code (thanks
+    for the pointer Eero)
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit ebfa5a0bf9f8e3efe61c0d34fe63a8cd74b7ddf8
+Author: Jacob Maine <jacob.maine at gmail.com>
+Date:   Tue Jan 29 20:52:16 2008 -0500
+
+    spec to verify inject accepts one argument, at the most
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit b131b80df72a9ceaa9e920b7f78434f301135a6f
+Author: Jacob Maine <jacob.maine at gmail.com>
+Date:   Wed Jan 30 00:33:03 2008 -0500
+
+    Adding Enumerable#count spec, including a few failing specs.
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit 82b63bc0f5b79735a8021b6c5c69786dc76fa7f6
+Author: Alexandre Perrin <alexandre.perrin at epfl.ch>
+Date:   Tue Jan 29 15:59:22 2008 +0100
+
+    udpdated language/string_spec.rb
+
+    * added spec for class/global variable with the \# simple interpolation
+    * added spec for ends of a \# simple interpolation
+    * added more delimiter character with the percent String construction
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit c58110bde52d64b30cf36ba3cb342357f3654812
+Author: Evan Phoenix <ephoenix at engineyard.com>
+Date:   Wed Jan 30 17:19:26 2008 -0800
+
+    Fix break. It now uses LRE to properly return to callsite and appear like
+    it returned.
+
+commit 45109c222502de955d705f810333d8e7b331c953
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Thu Jan 31 00:42:12 2008 +0100
+
+    Added Date#strptime specs
+
+commit fe60e6a022d9e64bb568ccd47494f07a99382c58
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Wed Jan 30 11:36:46 2008 -0500
+
+    Updated excludes for Marshal. Looks like Fixnum/Bignum issues.
+
+commit 209dde412310edc384be7d4a86bdfb0444f3b3bf
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Wed Jan 30 01:45:27 2008 -0500
+
+    Updated IO/File excludes.
+
+commit 91031e51e49a1a3ddb9f74da31e2ed65c48e1ef5
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Wed Jan 30 01:43:11 2008 -0500
+
+    IO.new and IO#close use stream API.
+
+    * IO.new uses fdopen() to open the given fd which also checks the mode
+      string for us. The returned FILE* is stored as a MemoryPointer in
+      @fptr.
+    * IO#close checks for presence of @fptr and if found, uses fflush() and
+      fclose() to release the handle instead of going the normal route.
+
+commit f4d64553a2a53c77235ef9acc3353ac455514057
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Wed Jan 30 01:20:32 2008 -0500
+
+    Made probably broken File.open spec compliant_on :ruby.
+
+    * File.open should not take three args. File.new does.
+
+commit dc496f35502b4642137d3f0f74571c8245a6ae56
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Wed Jan 30 01:19:29 2008 -0500
+
+    Slight IO.new spec tweaks.
+
+commit a9d9288315e88cffd59ec1b27e3c3209ceb1a3a9
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Tue Jan 29 20:32:44 2008 -0500
+
+    Combined IO.new and IO.open specs for the shared parts.
+
+commit effa81cce1d42f7c1bc2e275cb75bd9069e934b8
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Tue Jan 29 19:14:51 2008 -0500
+
+    Changed specs to use the two-argument IO.new.
+
+commit 1394b360fe70966e25809a349b400a69262060ca
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Tue Jan 29 14:56:47 2008 -0500
+
+    Rewrote IO.new specs (still a bit sparse.)
+
+commit 94d50eb3e60971ffeff28bffa0beaff405c581bd
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Jan 30 21:47:35 2008 +0100
+
+    File#utime specs to use be_close rather than ==.
+
+    On some platforms, direct comparison just doesn't work,
+    producing non-deterministic test failures.
+
+commit 0f5574c28ff08c96326298b98b4ea50108168044
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Wed Jan 30 13:13:25 2008 +1100
+
+    Remove race in debug_context_change specs
+
+commit 00a62c3476dd0717f5c4caece453914e1392de9d
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Tue Jan 29 14:39:06 2008 -0800
+
+    Remove bogus Marshal specs for Fixnum/Bignum changeover
+
+commit db1b140db0fbecf70f8adda983e010ef2bbe94c4
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Tue Jan 29 22:58:18 2008 +0100
+
+    Finished first version of Date specs. All public methods are specced
+
+commit 8ee52fd8dfd3ef6048c63b30d8aea71da944abb2
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Tue Jan 29 17:21:57 2008 +0100
+
+    Follow rbx lead, and allow deviation in UnboundMethod#== for JRuby.
+
+commit f670bcb9e086ac9cc73b6ef6083966b296268f04
+Author: Caleb Tennis <ctennis at engineyard.com>
+Date:   Tue Jan 29 09:46:50 2008 -0500
+
+    Fix typo
+
+commit 4e990269fd42aabd48cdc29b4288c78984d0e5cf
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Tue Jan 29 02:44:20 2008 -0800
+
+    Add File::join recursive Array spec.
+
+commit 4d947218e949e19515a9e89af99d4823048f3bb2
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Tue Jan 29 02:41:54 2008 -0800
+
+    Fix File::join spec name, duplication
+
+commit a38e10ddc19ebd59f8775a01f3e899c5348ba23f
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Tue Jan 29 02:40:37 2008 -0800
+
+    Make File::join remove extra / appropriately.
+
+commit 074251c03093ba40c0fc3558d512a77844ac45aa
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Tue Jan 29 00:53:23 2008 -0800
+
+    Make File::join specs more clear, remove whitespace
+
+commit f968bbe15a27d8ac6716d103119d41c4eef37696
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Mon Jan 28 18:07:24 2008 -0800
+
+    Use const_lookup in Marshal, fix #marshal_load.
+
+commit 7e00b857f56879564c1bf27f2e694f3c0783a4bb
+Author: Eric Hodel <ehodel at engineyard.com>
+Date:   Mon Jan 28 17:23:26 2008 -0800
+
+    Support nested modules in Marshal
+
+commit 5c6e2af3d9ace07ca8387c5aecaa5c1d85e8d81f
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Mon Jan 28 20:22:40 2008 -0500
+
+    Added specs for rest of the filetypes to File::Stat#ftype specs.
+
+commit 221a077bef5e9007b548993eaf16c86137c6b0b3
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Mon Jan 28 20:08:12 2008 -0500
+
+    Added support to spec file type against sockets too.
+
+commit 9cb4791db10bc79f8c30a86f17e6c099dabeea80
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Mon Jan 28 19:52:07 2008 -0500
+
+    Moved File and File::Stat-related fixtures to fixtures.
+
+    * Module FileSpecs defines methods that yield filenames corresponding
+      to specific file types so they can be easily tested.
+
+commit c28c85602d3ab6770ed567a64b744baa15795511
+Author: Ben Hughes <ben at pixelmachine.org>
+Date:   Sat Jan 19 16:10:36 2008 -0500
+
+    Added spec for File::Stat#dev, dev_major, and dev_minor
+
+    * Check that the result values are Integers for each operation
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit 86ce52e32a35cb11564d0d5f306f4eea6d6b714d
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Tue Jan 22 15:21:38 2008 +1100
+
+    Added yield_debugger on context change
+
+    Added capability to set a flag in the VM that causes a
+    yield to the debugger to occur immediately following a
+    change in the active context. This provides a foundation
+    for step in logic for the debugger, which need only set
+    a flag on a task and have a breakpoint triggered at
+    whatever receiver is activated following a send.
+
+commit 3904ff2fbb209b8c2d476bb3f4a4ea4825a16f6e
+Author: Brian Ford <bford at engineyard.com>
+Date:   Mon Jan 28 17:58:35 2008 -0800
+
+    Fixes for mSpec to coexist with autotest.
+
+commit 45f2d6de4b025acfa2429d88c729a3eb58a79528
+Author: Ryan Davis <ryand-ruby at zenspider.com>
+Date:   Mon Jan 28 17:08:45 2008 -0800
+
+    Added more brains to .autotest. Removed bad files that it pointed out
+
+commit 70eaa7feffcfd552c51b67a651cdf6063c9b549a
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Mon Jan 28 15:57:24 2008 -0800
+
+    Add File::Stat#dev.
+
+commit 020f4bec691ba658fab0f1ff24fa5df5a6f1921f
+Author: Ryan Davis <ryand-ruby at zenspider.com>
+Date:   Mon Jan 28 16:13:11 2008 -0800
+
+    Added enough process spec exclusions to drop the HUP issues
+
+commit 76b393566f2a89001952dbf1ec46dd52a5750448
+Author: Ryan Davis <ryand-ruby at zenspider.com>
+Date:   Sat Jan 26 10:58:42 2008 -0800
+
+    Fixed autotest support (needs latest version of zentest).
+    Minor clean up on bin/ci and kernel/core/module.rb.
+    Hacked mspec/matchers/base.rb to output with pretty print.
+    Fixed mspec's runner to output time BEFORE failures. Fixes unit_diff.
+    Updated Parser excludes.
+    Deleted a bunch of excludes.
+    Updated spec/parser/sexp_expectations.rb with latest ParseTreeTestCase.
+    Started adding a rewriter to make maintaining sexp_expectations easier.
+
+commit d147f6f0a87e30e240750d8c660bc89f8c84a472
+Author: Jeremy Roach <jero_rub at yahoo.com>
+Date:   Mon Jan 28 18:20:38 2008 -0600
+
+    update CI excludes
+
+commit 159f17a228fa6a42cea79b9e3663e1f2b9dea9e4
+Author: Jeremy Roach <jero_rub at yahoo.com>
+Date:   Mon Jan 28 18:07:56 2008 -0600
+
+    add Marshal specs
+
+commit 72e739590b6bbe571607df674e2f4106c64c8042
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Mon Jan 28 15:15:26 2008 -0800
+
+    Fix String#gsub when matching '^'.
+
+commit fc8c2c5584305b3e0b2a74ba8250a0b7072a372f
+Author: Ben Hughes <ben at pixelmachine.org>
+Date:   Sat Jan 19 16:20:55 2008 -0500
+
+    Added specs for File::Stat#ftype. #264.
+
+    * Tests "file" and "directory"
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit 2f9872b66d4dffc82e0a97e617fb9de18105f668
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 27 19:56:06 2008 -0500
+
+    Better living through mocks. String#+ spec cleanup & correction.
+
+    * String#+ in fact raises a TypeError when given ANY non-#to_str
+      object.
+    * Simplified spec code.
+
+commit f5a0f1e0e401db8f28727cdd8be99228c9c6aee3
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 27 19:37:08 2008 -0500
+
+    Removed trailing whitespace in String.
+
+commit 03c1c270236786b66930063669b95ac7cbf17f10
+Author: Matthew Draper <matthew at trebex.net>
+Date:   Thu Jan 10 22:40:35 2008 +1030
+
+    String#+(65) throws a TypeError, unlike String#<<(65).
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit a17ede3e9c85c1bd2e06efa7381c1e5dbab47f80
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 27 19:10:33 2008 -0500
+
+    Minimal IO#open specs, IO#sysseek. Merged from Chen Yufei's patch.
+
+    * Merged patch by hand, most of it was already implemented separately
+      too.
+
+commit 30116d672d950687646c1668eac4d9f5b10f4df7
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 27 18:53:19 2008 -0500
+
+    IO#readline EOFError spec modified from Chen Yufei's patch.
+
+    * Patch was out-of-date, applied by hand.
+
+commit 1b81e68249741d53b38857440bba897987d00e43
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 27 17:44:30 2008 -0500
+
+    Separated and excluded NUL byte stripping for String#lstrip specs.
+
+    * Rubinius does strip leading NULs, MRI does not.
+
+commit 55f50888f22288b0fa45298d873dd265d7340aec
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 27 16:52:51 2008 -0500
+
+    Updated various excludes.
+
+commit b085f63d66519f93b59e3851b7e6796877e97107
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 27 16:47:24 2008 -0500
+
+    Documented Method, deleted unnecessary Method#module spec.
+
+commit f71f5c91e8ceab59d59614fe885dfeff096d7655
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 27 15:41:26 2008 -0500
+
+    More precise specs for Method and UnboundMethod #to_s / #inspect.
+
+    * Checks presence of own class, method name, name of the Module where
+      the method is defined and name of the Module where the method was
+      extracted from.
+
+commit 400b522d27515698e0a35b2507a4a8825ec9bf8f
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 27 15:22:46 2008 -0500
+
+    Rewrote Method#unbind specs, touch-up for Module#instance_method spec.
+
+commit 57bddb7b38dbb762b2469c51eb961e01f03c8518
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 27 14:50:38 2008 -0500
+
+    Updated UnboundMethod#== spec for Rubinius/MRI difference on Modules.
+
+    * Rubinius' UnboundMethod#== is true for methods from included Modules also.
+
+commit 8503c92f914d72e72eeeaede225f52242a1afad9
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 27 14:25:29 2008 -0500
+
+    Rewrote and added Module#instance_method specs.
+
+commit 8541f4cf83f8b776276e81ca41eb0f7b595e4fb7
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 27 13:43:36 2008 -0500
+
+    Improved/added UnboundMethod#bind specs.
+
+    * Removed unnecessarily specific error message check. Exception type
+      is plenty.
+    * Specified correct behaviour only in terms of Method since a Method
+      is returned and anything after that is not #bind's responsibility.
+    * Rubinius allows binding to any object that is kind_of? with respect
+      to the Module that the method is *defined* in. MRI requires that it
+      can only apply to objects of the same Module that the method was
+      extracted from.
+
+commit fc7073c85b5e201265e24a82c19bd6413681f6e1
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 27 13:02:24 2008 -0500
+
+    Removed trailing whitespace in UnboundMethod#bind specs.
+
+commit bde0cacff5f061accab7feb8a27b2417456f2f95
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 27 12:38:39 2008 -0500
+
+    Specced Rubinius to deviate in UnboundMethod#==.
+
+    * MRI requires that both UMs were extracted from the exact same
+      Module. Subclasses etc. are not OK even if the UMs both refer to
+      the original in the parent. This is somewhat nonsensical and
+      harder to implement so Rubinius allows it.
+
+commit e7ba146d3d0ef0aed1d297d157008661458723eb
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 27 12:16:07 2008 -0500
+
+    Much more comprehensive and precise UnboundMethod#== specs, documented.
+
+    * #== has some stupid behaviour but this is what we get.
+    * Explanation of criteria in the method doc.
+
+commit 43f2226c8882900a472f0a5347fa549936e8f000
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 27 09:37:51 2008 -0500
+
+    UnboundMethod String representation specs improved.
+
+    * Specs require that the returned String contains this object's class
+      and the [Module]#[method_name] it was extracted from.
+    * The spec specifies nothing else about the format or order etc.
+
+commit 67e3b5993d92776e0c9535549e8ffdb172225d52
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 27 09:11:19 2008 -0500
+
+    Trimmed whitespace for kernel/core/method.rb for patching.
+
+commit c61c5185589cf5a86b58b2e8c8b8d7a26cdc25ec
+Author: Scott Taylor <scott at railsnewbie.com>
+Date:   Mon Jan 14 00:23:27 2008 -0500
+
+    fixing the specs for UnboundMethod#inspect
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit 48bcca32329d48a20d5a6f2dd19598ea7b4167ce
+Author: Scott Taylor <scott at railsnewbie.com>
+Date:   Mon Jan 14 00:16:24 2008 -0500
+
+    UnboundMethod#==, plus an extra spec
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit 232015fed94b59adf627a7712da0d5d4d44c87d0
+Author: Scott Taylor <scott at railsnewbie.com>
+Date:   Mon Jan 14 00:03:32 2008 -0500
+
+    UnboundMethod#bind
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit fcd0139307fd48f78f122457af1af43a543343ce
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 27 12:11:34 2008 -0500
+
+    Updated excludes for IO#write.
+
+commit eed253158fe0cc20b91f6c8dcc06f6a671092d84
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Sat Jan 26 14:36:33 2008 -0800
+
+    IO#write calls #to_s on it's argument
+
+commit bb5ff251bcc4baceac25a3a1fa64797b94551145
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 27 03:22:02 2008 -0500
+
+    Updated #attr_writer spec that was picking up a stray method.
+
+commit fa985a57f6cf802d6a83a6d02a31dd7fd33ebd36
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 27 01:20:27 2008 -0500
+
+    Module#const_get can now access top-level constants for Modules also.
+
+    * Modules explicitly check Object last, Classes already do it since
+      they all inherit from Object.
+    * Added some more specs too.
+
+commit fbc1cfb2d461891ee478802f44de3736959905a7
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 27 00:47:52 2008 -0500
+
+    Renamed the Module field 'parent' to 'encloser.' Some docs.
+
+    * When dealing with Modules and Classes, 'parent' is an ambiguous term.
+      In typical OO literature, 'parent' means the superclass which is not
+      the case here. Two separate sections of code already showedsome
+      uncertainty about the intent of this field.
+    * Added a few bits of documentation to Module.
+
+commit 92903e92564857350061d83f8eb3b54886986ac3
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 27 00:36:10 2008 -0500
+
+    Updated Module excludes.
+
+commit a705e687ce0d55e7ea184e1a3e67ba8d9d7c610c
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 27 00:24:20 2008 -0500
+
+    Improved Module#const_get specs for better coverage.
+
+commit bca6aef9b81166f9c5f4aeaafc673a54710d4d35
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Jan 26 19:57:33 2008 -0500
+
+    Corrected semantics of spec statements for Module#const_get.
+
+    * Specs were correct but the description was inaccurate.
+    * Prettified just a little.
+
+commit f699c18b68dee73086afb92d15b61745319a5321
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Jan 26 19:55:40 2008 -0500
+
+    Module#const_get specs for top-level constants by Le Huy.
+
+commit f3831a0693ea90271843bcc5910516e5a40ed3c1
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Jan 26 19:15:27 2008 -0500
+
+    Module whitespace cleanup before patching.
+
+commit e3cbe8136351f055bd99f10646d4f77515078430
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Sun Jan 27 00:51:55 2008 -0600
+
+    A few basic IO#write specs for file IO
+
+commit fd05adfedf70d795d8d91f650d5b76b05104dd7a
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Jan 26 18:54:35 2008 -0500
+
+    Specs for Enumerable#max_by (Rubinius extension.)
+
+commit 560b6460745c7821b9479b356c032a10daaa61ec
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Jan 26 18:53:52 2008 -0500
+
+    Specs for Enumerable#min_by (Rubinius extension.)
+
+commit 6ab0bc901bdc60bde1e251f72f0028dfb736a2dd
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Jan 26 14:25:41 2008 -0500
+
+    Updated excludes for Enumerable.
+
+commit 2e09eedb31e15c791e491e97bc2af1977a629c2b
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Jan 26 14:20:19 2008 -0500
+
+    Fixed Enumerable#max and #min nil problems using Undefined.
+
+commit d8e6ebf604fdcc228e9158336250dd29c6d35932
+Author: Jacob Maine <jacob.maine at gmail.com>
+Date:   Sat Jan 26 13:22:33 2008 -0500
+
+    Failing spec for finding max when Enumerable contains nil
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit 313ee6badb177c101e39e122c5b5d6ff4d73d93d
+Author: Jacob Maine <jacob.maine at gmail.com>
+Date:   Sat Jan 26 13:01:06 2008 -0500
+
+    Failing spec for sorting a list that contains nils
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit 467e8a60e0e25003894013e68f6d48e7bd6a22fc
+Author: Jacob Maine <jacob.maine at gmail.com>
+Date:   Sat Jan 26 12:01:15 2008 -0500
+
+    adding failing spec for sorting enumerables that contain nils
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit 8719a4ad46d7643c6e54aab3dffedb6831bde5f3
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Jan 26 13:42:11 2008 -0500
+
+    Whitespace cleanup before applying Enumerable patches.
+
+commit 015a0d023e8c649160800ddb8a269aa789266d51
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Jan 26 13:31:00 2008 -0500
+
+    Added/changed the Dir open specs after previous simplification.
+
+commit 6735df441af2489d47674b0cc500dab37dd4319e
+Author: Jonathan Younger <jonathan at daikini.com>
+Date:   Thu Jan 24 17:09:49 2008 -0700
+
+    Simplify Dir#open spec dependencies.
+
+    The "takes a block which yields the Dir instance and closes it after"
+    expectation was failing because it depended on File.for_fd working
+    properly with closed file descriptors which it does not.
+
+    This revision removes the dependency on File.for_fd as well as
+    IO.sysopen (which is not yet implemented in jruby) such that
+    the spec now passes on ruby, rbx and jruby.
+
+    Signed-off-by: Eero Saynatkari <rubinius at projects.kittensoft.org>
+
+commit 27834ebec570c78011eaaf37998272d46ab9d118
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Sat Jan 26 21:51:13 2008 +0100
+
+    Added Date#strftime specs and fixed some constants
+
+commit 767e58ec38af7c3bc78dd98541fb8235616e9691
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Sat Jan 26 21:45:23 2008 +0100
+
+    Add spec for Rational#round, works because of added Numeric#round
+
+commit 2497d3b7b9d6112356204dc429c3c368e1a65573
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Jan 26 12:31:45 2008 -0800
+
+    Templates for Rational specs.
+
+commit 5d63550a13cad4acbae3ae67e9ee9f672cbe5e61
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Sat Jan 26 00:47:35 2008 -0800
+
+    Revert back old date.rb, but use newer date/format.rb, with some fixes
+
+commit ecd3ee8a0a528f516283558585b86e729bd388ec
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Jan 25 21:47:38 2008 +0100
+
+    Updated not_compliant_on --> not_supported_on, where appropriate.
+
+commit 78ca098893d6231f74386eeadf0c30787f3dd2e6
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Fri Jan 25 12:18:43 2008 -0800
+
+    A couple of easy fixes, fix Time to handle 2 digit dates, pull in trunk date
+
+commit fe8433cda8ca49835e2581f35bbf0d31025e84c1
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Jan 25 18:42:31 2008 +0100
+
+    Better detection of AF_INET6 support in socket specs.
+
+commit 1834801229bf8b2c0abfea4c18448ed105691682
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Jan 25 18:16:56 2008 +0100
+
+    Added a guard for undefined AF_UNIX in Socket specs.
+
+commit 3af242cc180675272ee24d588f3328bc11342048
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Jan 25 14:32:04 2008 +0100
+
+    New specs for IO#seek, IO#pos=, StringIO#seek and non-fixnum args.
+
+    Rubinius fails all of them.
+
+commit 0ef7d55ebb5108bd5cf2f951236c8fade3999dfb
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Jan 25 13:42:08 2008 +0100
+
+    New specs for String#unpack with 'Q/q' patterns.
+
+commit 907081db80262a1403f659433934ef707c2ddee0
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Jan 25 12:35:07 2008 +0100
+
+    Adjusted socket specs, so they pass on MacOS (MRI/JRuby).
+
+commit 9cca76acbe066da357692a19d5af1c8f5e4601c9
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Thu Jan 24 17:31:38 2008 -0800
+
+    Fix race in compiler version number, fix regex spec
+
+commit be18fcc2e0ee16f861f1e2bff0636c3288bce8d6
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Thu Jan 24 15:10:00 2008 -0800
+
+    Be more flexible with set_priority (OSs are a bitch)
+
+commit 845336d81df42b5d1f93123ef148b78c2b220d25
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Thu Jan 24 13:46:08 2008 -0800
+
+    Kernel flesh out, passes all but 1 spec now
+
+commit ab87e7641336dfb07f0ad99cc2881ec59a25053a
+Author: Jonas Pfenniger <zimbatm at oree.ch>
+Date:   Thu Jan 24 12:36:50 2008 +0100
+
+    Changed __const_set__ to handle corner cases.
+
+    * Kernel#__const_set__ is now the catch-all. It triggers on things like :
+    M = 3
+    M::M = 3
+    * MAIN#__const_set__ is forwarded to Object
+    * Module#__const_set__: logic has been moved here, it is no more and alias
+    of Module#const_set because it needs to trigger a warning on re-assignment.
+
+commit 13dbdf62e802028cb61f9375196712f0b789ff37
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Thu Jan 24 21:30:02 2008 +0100
+
+    Added some SystemCallError specs.
+
+    And exclusions for rubinius too.
+
+commit 75e2aac1d4b031fa36c8967549452436521b5eea
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Wed Jan 23 19:41:30 2008 -0800
+
+    Rework Class.new and Module.new to initialize without VM help
+
+commit 2551e57644d091d44e5e2fa715a017a557a0b18c
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Wed Jan 23 19:03:51 2008 -0800
+
+    Userland now uses __const_set__ for 'A = 3' syntax
+
+commit 400c5ceaf677aa2cd05a451c22144613ad7bdbe9
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Wed Jan 23 14:32:26 2008 -0800
+
+    Introduce kernel/user land. Adds use of Module#__add_method__
+
+commit 9ee17f227ebe572b09d44b3b0d703b9f95717751
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Wed Jan 23 14:50:25 2008 -0800
+
+    Fix Hash#clone
+
+commit bf4875d337017736bd94781c1bf4cd7500fae5f5
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Wed Jan 23 22:55:02 2008 +0100
+
+    Implemented Enumerable#inject fix
+
+commit 0bd07f50ba75910ab579e3356dae93bc32b695bd
+Author: Jacob Maine <jacob.maine at gmail.com>
+Date:   Wed Jan 23 15:46:06 2008 -0500
+
+    Enumerable#inject(nil) should yield nil as the first 'memo'
+
+    * Currently yields the first element of the enumerable instead
+
+commit 319f937284e60acc156c6b7f91e56d460e65ac94
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Jan 23 18:12:56 2008 +0100
+
+    Excluded the IO#new spec.
+
+commit 04da4120d939603d4a64aab71bbf94ca202e04b2
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Jan 23 18:11:45 2008 +0100
+
+    Added IO#new spec (block should be ignored, warning printed)
+
+commit 5617c3eb81a3f1d8f9a581695fe7897fadee500a
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Jan 23 17:50:48 2008 +0100
+
+    Excluded failures after IO specs additions.
+
+commit 107a072689bc9b97842f049f4fab2860ab79237d
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Jan 23 17:48:34 2008 +0100
+
+    Added specs for IO#open/popen, File#open with close inside block.
+
+commit bc3393a9041f8116d53bedfa6b604ec6dce3fd19
+Author: Jonas Pfenniger <zimbatm at oree.ch>
+Date:   Wed Jan 23 14:25:13 2008 +0100
+
+    Revert "Added Module#name memoization spec". dbussink told me this behavior
+    is not wished.
+
+    This reverts commit ff411600202a59d00ffaca2c51330599c6b84966.
+
+commit 73e7d61d756cb7a06ea18b7f92c49bbebb06cc3f
+Merge: ff41160... 1dab607...
+Author: Jonas Pfenniger <zimbatm at oree.ch>
+Date:   Wed Jan 23 13:57:28 2008 +0100
+
+    Merge branch 'master' of git at git.rubini.us:code
+
+commit ff411600202a59d00ffaca2c51330599c6b84966
+Author: Jonas Pfenniger <zimbatm at oree.ch>
+Date:   Wed Jan 23 13:55:36 2008 +0100
+
+    Added Module#name memoization spec
+
+commit 1dab607a79b79b370eda4776daf07a262451aea0
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Jan 23 13:28:29 2008 +0100
+
+    Added IO#close specs.
+
+commit c78091236495f4a16aa874de97cce3ec485c1f5b
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Jan 23 12:54:25 2008 +0100
+
+    Added IO#close_write and IO#close_read specs.
+
+    And all of them fail in rubinius. (not implemented)
+    And most of them fail in JRuby. (recent bugs)
+    They pass just fine on MRI 1.8.6 (p111 and latest)
+
+commit dc39943a4595855d64f23f9155a4e9cf658c39a3
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Wed Jan 23 10:37:45 2008 +0100
+
+    Small refactor of regexp_new
+
+commit 132ac4986a648dbf1354216145e5715a727a735b
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Wed Jan 23 00:14:34 2008 -0500
+
+    Type.coerce_to no longer falls prey to identity fraudsters.
+
+    * Type.obj_kind_of? directly uses the internal kind_of instruction
+      so that overridden #kind_of? does not get in the way.
+    * Type.coerce_to uses Type.obj_kind_of? for its checks so that
+      Core can safely use it without worrying about breakage due to
+      overridden #kind_of?.
+    * Specs for both and a little documentation.
+
+commit 192882902154c9a68554337ccd1b8f3ee9aedd9e
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Wed Jan 23 00:42:24 2008 -0800
+
+    Remove Symbol#to_i and Symbol#to_int. Farewell bastard children.
+
+commit f854667ff62528fe541c8cf67b9a1b291598d654
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Wed Jan 23 00:35:29 2008 -0800
+
+    Removed Fixnum#to_sym and Fixnum#id2name, as well as fixed specs
+
+commit eb6cbc3604c81cc093edb1c182be1e456b05bef6
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Wed Jan 23 16:30:22 2008 +1100
+
+    Added specs for context iseq manipulation
+
+    Added specs to test MethodContext#reload_method and
+
+commit fd5fb764ee21b354b75b84f34906663874a24639
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Tue Jan 22 22:28:02 2008 -0600
+
+    spec for DRb method call using a block
+
+commit a928762b48f7dc84bba0d43125063e9d8d54f183
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Tue Jan 22 19:15:10 2008 -0800
+
+    Better test of #instance_method.
+
+commit c055a5981bf4ecfd2efc0df74adb071056ff83b9
+Author: Ryan Davis <ryand-ruby at zenspider.com>
+Date:   Tue Jan 22 15:40:59 2008 -0800
+
+    removed remove_method_excludes.txt
+
+commit 08cb27454e7ae73e79bb432887dba917feaa1f92
+Author: Ryan Davis <ryand-ruby at zenspider.com>
+Date:   Tue Jan 22 15:36:36 2008 -0800
+
+    Clarified undef/remove specs a bit.
+    Fixed remove_method to raise NameError if you're not acting on local method.
+    Removed some fails_on calls to make specs pass... gonna remove them all soon.
+
+commit 62d93ac7916ff0d56a5b40ae1b9b501f10081638
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Tue Jan 22 15:35:05 2008 -0800
+
+    Fix up sysread and syswrite, disable testing for warnings on rubinius
+
+commit a482b17c4bfe9f40474839ba0cce2a37d8524c62
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Tue Jan 22 15:13:19 2008 -0800
+
+    Remove stale binding excludes
+
+commit f45030d33a9e1fe3c6bc111401a893e5649239f7
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Tue Jan 22 15:03:37 2008 -0800
+
+    Update Proc excludes
+
+commit 7f932fbdf5fa4e16df10d7731313d458ca21966c
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Tue Jan 22 14:55:50 2008 -0800
+
+    Add Proc#==
+
+commit 811cbe8ef876ef452051a9b07b3c95dbf57a7d9f
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Tue Jan 22 23:41:55 2008 +0100
+
+    Removed debugging stdout from one spec.
+
+commit 2bf52de43bb90721d921f6d29504a8f098ed09b5
+Author: Ryan Davis <ryand-ruby at zenspider.com>
+Date:   Tue Jan 22 14:11:17 2008 -0800
+
+    Removed a lot of passing specs from the excludes
+
+commit b0e5a9ba6577c301f2737682d745128e268ebdab
+Author: Ryan Davis <ryand-ruby at zenspider.com>
+Date:   Tue Jan 22 14:02:38 2008 -0800
+
+    Fixed Symbol::all_symbols
+
+commit 68ae0b5acd647b9ebd73e53638b728cfaee6b6e0
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Tue Jan 22 22:09:45 2008 +0100
+
+    Revert "Completed MRI's Module#name spec with corner case."
+
+    This reverts commit 970ede321d31ec75dd578866c683defe768fa356.
+
+    This spec seems like an implementation detail rather than
+    a specified behavior. It was agreed on IRC to revert it,
+    and that rbx won't support it.
+
+commit cc0e45cab2167e0fbc1d29308a5dcb4e7e077319
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Tue Jan 22 22:06:28 2008 +0100
+
+    Revert "Module#name memoization work."
+
+    This reverts commit 7cd9fce4908aaeea9a35e273a3f15ed7ee7aa783.
+
+commit 996f9f4e5fc05f1b3aa618db3e1a4947730780b7
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Tue Jan 22 12:23:39 2008 -0800
+
+    Fix LongReturnException to be terminated in the correct place
+
+commit f453121dd2f3b4d9506a3f1c1e61d24e46bc9083
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Tue Jan 22 20:53:45 2008 +0100
+
+    Corrected Module#instance_method failing spec. It was failing on all impls.
+
+commit c1d59239ddea95e73e2edd3a97ed6e1113a35d3c
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Tue Jan 22 19:58:32 2008 +0100
+
+    Corrected Module#instance_method spec, it was failing on MRI/1.8/1.9/JRuby.
+
+commit ef5f4489caac2ad4bad94783a780aa40a054481c
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Tue Jan 22 19:30:48 2008 +0100
+
+    Corrected String#to_f spec.
+
+commit 7cd9fce4908aaeea9a35e273a3f15ed7ee7aa783
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Sun Jan 20 22:00:34 2008 -0600
+
+    Module#name memoization work.
+
+    * Module#name is now memoized on access if @name is set
+    * Full module path is lazily calculcated on memoization
+    * Module#const_set(Ruby) and module_const_set(C) only set @name and @parent.
+    * The following methods unifily use module_const_set:
+      * cpu_const_set
+      * cpu_open_class
+      * cpu_open_module
+      * module_setup_name
+    * Module#calculate_name reworked, hack removed
+
+commit 7b4ef1344812faa76018ab41cc7fba97a3af8448
+Author: Jeremy Roach <jero_rub at yahoo.com>
+Date:   Tue Jan 22 02:47:49 2008 -0600
+
+    implement more of Marshal.load
+
+    Float, obj._load, obj.marshal_load, IO.read, proc arg
+
+commit 41f07f0253a8fba205dbb0402e5d5e88c115d76c
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Tue Jan 22 16:32:01 2008 +1100
+
+    Fix Task#get_stack_value to not raise exception from primitive
+
+commit 14c811adaba3e8cfc5104d70e67c2e89c18cac4d
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jan 21 19:28:18 2008 -0800
+
+    Exclude Kernel#require is private spec when running with RSpec.
+
+commit 05a180e0051a0409c685d326a41e882545faaa53
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jan 21 19:26:41 2008 -0800
+
+    Explicitly run /bin/sh to get around limited /bin/pwd on linux.
+
+commit c09b3da391995a0e9006055ce19e838d3f180947
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jan 21 19:09:07 2008 -0800
+
+    Protect String#% specs from segfaulting on linux (ubuntu gutsy).
+
+commit d36b3f65f92b08ae078812788482387077d03380
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jan 21 17:55:03 2008 -0800
+
+    Removed use of `pwd -P` as at least ubuntu bin/pwd doesn't support it.
+
+commit 6d7a8292fb9a68a0dcfbd3f29f595e0ecf5902ae
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jan 21 17:54:11 2008 -0800
+
+    Unexclude Kernel#callcc specs as Evan's recent commits seems to fix it.
+
+commit eb04d409575772a85510770bd0db4f36490de6aa
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Mon Jan 21 13:28:06 2008 +0100
+
+    Fix Regexp error handling
+
+commit 93e50808eb7355c404a7f5295923083c8cf63549
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Sun Jan 20 22:00:34 2008 -0600
+
+    Quarantining IO#dup spec "sharing" example due to platform differences.
+
+commit ae9e2829becc495892c7ddce5eae67514f268120
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Mon Jan 21 10:26:56 2008 +0800
+
+    Update Module instance_method_specs excludes after revert put it back in
+
+commit df6c82f97987c233eab0534740054e2d0f0f2f2c
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Mon Jan 21 10:25:00 2008 +0800
+
+    Revert "Update CI excludes for Module"
+
+    This reverts commit 8aa00146f2eee9576094daa76c6f158b0deaf2e2.
+
+    * Fails when run with other specs
+
+commit 6f5245d4c20bf009bc120967f4a93d24faae66ba
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Mon Jan 21 10:23:15 2008 +0800
+
+    Revert "Update CI excludes for Symbol.all_symbols spec"
+
+    This reverts commit cb27e31b2a757ad108842bfa579eb9170d6cf244.
+
+    * Returns an F if run with other specs in ./bin/ci
+
+commit ec9677e593247ed8dfcbfc680151d04ac97936e3
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Mon Jan 21 10:11:35 2008 +0800
+
+    Fix Module instance_method_spec to match the inspect with a regexp
+
+commit 7e3474a16ec20094630e865594405ea7f1658c58
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Mon Jan 21 10:08:06 2008 +0800
+
+    Module#instance_method raises TypeError/ArgumentError on invalid arg
+
+    * Fixed spec to expect TypeError when passed nil
+    * Fixed spec to expect ArgumentError when passed non-symbol/string
+
+commit 8aa00146f2eee9576094daa76c6f158b0deaf2e2
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Mon Jan 21 09:41:37 2008 +0800
+
+    Update CI excludes for Module
+
+commit 9158b959d30babdceafc416650c1ba3234e5029a
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Mon Jan 21 09:10:06 2008 +0800
+
+    Add alias for Proc.to_s from Proc.inspect
+
+commit cb27e31b2a757ad108842bfa579eb9170d6cf244
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Mon Jan 21 09:09:40 2008 +0800
+
+    Update CI excludes for Symbol.all_symbols spec
+
+commit 7f16f313c907de0e22762d97fbba24e70c3259a3
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Mon Jan 21 08:46:36 2008 +0800
+
+    Raise TypeError/ArgumentError for invalid Thread key
+
+    * Raise TypeError is key is nil
+    * Raise ArgumentError is key is not Symbol or String
+    * Correct the description of Thread's element_set_spec to use #[]=
+
+commit 0b849f884beae9d11327e315da5c79fe789b8391
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Sun Jan 20 23:05:33 2008 +0100
+
+    Added rubyspecs for Zlib.crc32.
+
+commit 67b52b6fb92b9e9a037e584474cff2dc97ce0163
+Merge: e6d8a61... 6f08d5e...
+Author: Jonas Pfenniger <zimbatm at oree.ch>
+Date:   Sun Jan 20 22:30:52 2008 +0100
+
+    Merge branch 'master' of git at git.rubini.us:code
+
+commit e6d8a61771b76198c0784677bb0a8fc97b1988bc
+Author: Jonas Pfenniger <zimbatm at oree.ch>
+Date:   Sun Jan 20 22:30:29 2008 +0100
+
+    Fixed Struct#[] and Struct#[]= with negative indexes.
+
+    * Added corresponding specs
+    * Fixed kernel/core/struct.rb code
+
+    Example:
+
+      s = Struct.new(:x, :y)
+      x1 = s.new(:a, :b)
+      x1[-4] #=> should raise IndexError: offset -2 too small for struct
+
+commit 6f08d5e21473d0f2adff66a32acd46ddd8945fa0
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Jan 20 12:47:11 2008 -0800
+
+    Added spec for Kernel.format.
+
+commit 6ab2691b455ac07643d98dc58f8a0f45487ab20d
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Jan 20 11:52:56 2008 -0800
+
+    Added sane handling of non-reals for #format %e, %E.
+
+commit 1caab1ce237a52d78a402a5f0a7ce1d3ed9ac6b7
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Sun Jan 20 18:55:27 2008 +0100
+
+    Add spec for singleton_methods and fix for Fixnum
+
+commit d7c46a0a1660f1d53e03a97571f3ec7b2431d0e4
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Sun Jan 20 12:29:10 2008 +0100
+
+    Added failing spec for Regexp#new that could cause a segfailt. Needs error handling as stated in shotgut/lib/regexp.c:122
+
+commit d15c6605b7fb7db337d87ac1bd15f9a1371caa42
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Jan 19 19:28:00 2008 -0800
+
+    Added language spec for return within a block.
+
+commit 3b516c028c4c9e064fbe839f0f9402a135eb90b0
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Jan 19 17:27:13 2008 -0800
+
+    Added spec for class vars set from Kernel#instance_eval based on #267.
+
+commit 970ede321d31ec75dd578866c683defe768fa356
+Author: Jonas Pfenniger <zimbatm at oree.ch>
+Date:   Sun Jan 20 00:44:04 2008 +0100
+
+    Completed MRI's Module#name spec with corner case.
+
+    It looks like Module#name is memoized in MRI
+
+commit caf440ac6a8037a2c223834c0ca4c5decd8e68ab
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Sat Jan 19 22:48:31 2008 +0100
+
+    Revert "Wrapped one spec to prevent JRuby crash."
+
+    This reverts commit 9f266e3c785c7e3edbb6a30271f32debe6c14164.
+    JRuby issue is resolved.
+
+commit 9673e2c1c5a1142af52a0d82d8981bdd9e236c27
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Jan 19 12:46:12 2008 -0800
+
+    Changed IO#syswrite to use should complain matcher.
+
+commit 8522186df7050782c4911f40aef381106e5e8c5b
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Jan 19 12:29:12 2008 -0800
+
+    Added mSpec lambda { .. }.should complain matcher for warnings.
+
+commit 9f266e3c785c7e3edbb6a30271f32debe6c14164
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Sat Jan 19 21:24:13 2008 +0100
+
+    Wrapped one spec to prevent JRuby crash.
+
+commit 54d1989997561271553ba72bd99f59ef2deb7c72
+Author: Jonas Pfenniger <zimbatm at oree.ch>
+Date:   Sat Jan 19 19:13:06 2008 +0100
+
+    Fixed "X::X = 3". It would return a tuple instead of 3.
+
+    * changed shotgun's const_set instruction to push the variable on the stack.
+    * added corresponding specs under `language'
+    * found a new problem but added it to excludes
+
+commit d25ec129902789bc7d636ff5ccda8ff858ae38d3
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Jan 19 10:21:19 2008 -0800
+
+    Added spec/README. Reformatted mspec/README. Removed old sprintf spec.
+
+commit 5eb06e3010707de1e273c23b3f0addf2ceaa824d
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Jan 19 09:37:29 2008 -0800
+
+    Removed unused Sprintf, rename YSprintf to Sprintf.
+
+commit c144abc12230175a2a503c4426804ed19c8559e7
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Sat Jan 19 16:21:08 2008 +0100
+
+    File::Stat time functions should return Time objects and added stat and lstat instance methods on File
+
+commit 177ef99db435a59e942566f7904167fc5e849d8d
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Sat Jan 19 22:24:16 2008 +0800
+
+    Fix ThreadGroup's add spec
+
+    * Fix is by initializing a new ThreadGroup on Thread setup
+
+commit 3fad84ec370eda1cab596adf5589e43240dfc381
+Author: Jonas Pfenniger <zimbatm at oree.ch>
+Date:   Sat Jan 19 12:16:55 2008 +0100
+
+    Removed empty *excludes.txt for better searchability
+
+    `find -name "*excludes.txt" -size 0 -exec git rm {} \;`
+
+commit 9a2b1e6232f36c7a1508085b4606e25fbcf3cb4a
+Author: Jonathan Younger <jonathan at daikini.com>
+Date:   Fri Jan 18 23:19:16 2008 -0700
+
+    Additional String#% platform specific formatting failure fixes
+
+commit aa32d6fcbed79b9e2afedc00f429ea78f5c540d3
+Author: Jonathan Younger <jonathan at daikini.com>
+Date:   Fri Jan 18 22:12:23 2008 -0700
+
+    Fix String#% platform specific formatting failure
+
+    Darwin and FreeBSD return a different string format than other platforms,
+    so a different expectation is needed to match the appropriate format.
+
+commit c64dfd449dc89ec0016f14afd7f85522dbaa4148
+Author: Jonathan Younger <jonathan at daikini.com>
+Date:   Fri Jan 18 21:05:44 2008 -0700
+
+    Moved String#% specs to ruby/1.8 and fixed to work with rbx and MRI
+
+commit e5e7f44983f1dbbc79726776b56a9cc7cb910e9f
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Jan 18 19:53:50 2008 -0800
+
+    Updated IO excludes.
+
+commit b8b549dbc1aaf63e15717c3902d4485c97f845f7
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Fri Jan 18 21:40:01 2008 -0600
+
+    Add regexp matching for output matcher and enable warning specs for syswrite.
+
+commit 004bd58b597034cbe734d9b7da318135a689190f
+Author: Jeremy Roach <jero_rub at yahoo.com>
+Date:   Fri Jan 18 21:06:38 2008 -0600
+
+    implement some of Marshal.load
+
+commit 2c52db8022f060866d839992aaa6bff0f61963cf
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Sat Jan 19 11:21:55 2008 +0800
+
+    Fix UnboundMethod#bind
+
+commit a5680db20cf998f0db292e3b9aa69ed74fb19b10
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Fri Jan 18 17:49:44 2008 +0800
+
+    Implement UnboundMethod#==
+
+commit a1de7b0f405830f6bfe8000c051f4445135d8f63
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Fri Jan 18 20:54:11 2008 -0600
+
+    Added some specs for sysread/syswrite on a file and p flushing to File.
+
+commit e7bc994d96398519ca205e87dec8e775bb0e67c6
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Sat Jan 19 01:31:46 2008 +0100
+
+    Fixed File#utime segfault
+
+commit 9887c6135e9353c3094dcf3c76d8e788b98f2bed
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Jan 18 22:00:10 2008 +0100
+
+    Added Time#strftime specs for '%U' and '%W' patterns.
+
+commit 0338fb5adb325e58d1ce61bccc9310fc7284e235
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Jan 18 20:35:23 2008 +0100
+
+    Added two testcases for String#% rubyspecs ('x', 'X').
+
+    There was a bug in JRuby's sprintf, which wasn't
+    detected by rubyspecs.
+
+commit 97db9fb72d6205227d61d92ed3153331b2328f97
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Jan 18 10:50:00 2008 -0800
+
+    File#utime spec. Some cleanup of File#open specs.
+
+commit 10647cf8abfd0ea7a87d39978a22f68fdfa9fbd6
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Jan 18 17:08:04 2008 +0100
+
+    Wrapped 3 IO spec tests into fails_on :jruby.
+
+    Because these tests just break the spec run completely.
+
+commit cf6195eeabe382c4267e295ab786acedaed89050
+Author: Jonathan Younger <jonathan at daikini.com>
+Date:   Thu Jan 17 21:55:48 2008 -0700
+
+    Fix specs that use `pwd` to use -P option so that symlinks are resolved
+
+commit 1b79705fb965ecd6fc897b6bf14c605d8325dabe
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Fri Jan 18 15:57:46 2008 +0100
+
+    Added IPAddr specs by manveru. Closes #262
+
+commit f05b96b33970e3f08da5c8992f7c6cb710649f42
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Fri Jan 18 02:23:15 2008 -0800
+
+    Fix spec for IPv6 environments
+
+commit 2007019ebad7974d7a54e6d599320675548313f0
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Fri Jan 18 17:39:09 2008 +0800
+
+    Fix UnboundMethod#inspect to use regexp
+
+    * Also aliased UnboundMethod#to_s to UnboundMethod#inspect
+
+commit c47b473b99b59074673adb7e8d50a250e34436e7
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Fri Jan 18 17:37:29 2008 +0800
+
+    Use a regexp to match the inspect output instead of deviating on rbx
+
+commit 8dc2a2b3115a49a15ed931301b1999560ee27db5
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Fri Jan 18 01:05:14 2008 -0800
+
+    Fix up specs and finalize LongReturnException
+
+commit 7c30ca7337b56a4194eb58952f74662e222b7707
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Thu Jan 17 23:23:27 2008 -0800
+
+    Add support for return in a block obeying ensure properly
+
+commit c06fc665c6bf5898163f2854b93d62b8b314216e
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Jan 17 21:20:42 2008 -0800
+
+    Changed Exception#backtrace to return an MRI compatible one.
+
+    * Exception#awesome_backtrace returns an Rubinius Backtrace
+      instance, as Exception#backtrace used to.
+    * Added templates for Backtrace specs.
+    * UnHACKed lib/test/unit to use the #backtrace as expected.
+
+commit a29f35c5a45776f10132c3ce0ef058b1e98a4f75
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Thu Jan 17 20:18:04 2008 -0500
+
+    Guard failing Process.setpriority spec, add an exclude to CI
+
+commit 333d5c6920c01366c8b2887ecc7e33f775210c00
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Jan 17 16:50:31 2008 -0800
+
+    Specs and fixes for Class.inherited.
+
+commit ac90d87a69c19c441b854660105d21ed771989f0
+Author: Ryan Davis <ryand-ruby at zenspider.com>
+Date:   Thu Jan 17 16:37:31 2008 -0800
+
+    One more step into the foray of bootstrap madness... removed useless 0 from lasgn nodes. needs full clean
+
+commit 0dbabefd081be4890d0d789a9c3ec122b9196cf8
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Jan 17 12:00:55 2008 -0800
+
+    Fixes to enable RSpec 1.1.2 to run the spec/ruby specs.
+
+commit 9bd611ff5c5b411518c2f4ce5d3cd4b93f4bcebe
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Thu Jan 17 08:25:24 2008 -0500
+
+    IO#puts, #isatty fixes from Dan Lucraft, slightly modified.
+
+    * The #puts spec exposed an issue with String#suffix? which Ifixed in
+      fa9a6c which means IO#puts did not need to be changed.
+    * #puts spec uses output_to_fd.
+
+commit 3f519a98bbc3a66d59884add5fcd98d5ca095149
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Thu Jan 17 08:02:51 2008 -0500
+
+    String#suffix? specs and correct behaviour.
+
+    * The suffix can be the entire string, there is no need for it to
+      just be a substring always.
+
+commit ca6fa9cd760b06827f4f953ff28e8baed357f447
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Thu Jan 17 12:48:20 2008 +0100
+
+    Additional Date specs
+
+commit 8541022ffc918879142ecb3707e977050f774ece
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Jan 17 00:47:04 2008 -0800
+
+    Added ?d, ?e, ?f to Kernel#test.
+
+commit e6f36980c2c94414e5c051b35d9ce403c492f1a2
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Thu Jan 17 02:18:25 2008 -0600
+
+    Fix my oops; missing 'do' for the fails_on
+
+commit 44483d8e414f107b3202cc69b8cdfbbe1222ee33
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Thu Jan 17 02:07:57 2008 -0600
+
+    Add a fails_on guard to IO#printf spec for JRuby; output dies otherwise
+
+commit 53a36c934ec44fad7e6d18424cb13b37496cf720
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Jan 16 18:39:34 2008 -0800
+
+    Updates to compiler and core to protect Fixnum#/.
+
+    * Added compiler plugin SafeMathOperators.
+    * Added very simplistic way to pass flags to the compiler.
+    * Added -frbx-safe-math flag
+    * Changed core Fixnum, Float, Bignum, and Numeric methods
+      to use #divide rather than #/. Aliased #/ to #divide.
+    * Updated Rakefile to send flag when compiling core.
+
+commit feb260b904d87487428b558f7b7e9ac0170c160c
+Author: Ryan T Mulligan <ryan at ryantm.com>
+Date:   Wed Jan 16 22:47:02 2008 -0600
+
+    very minimal SHA1 specs
+
+commit 511732d932d2fe934968c78b89cefa46e699b996
+Author: Ryan Davis <ryand-ruby at zenspider.com>
+Date:   Wed Jan 16 16:30:40 2008 -0800
+
+    Moved old spec excludes to new location and deleted all old
+
+commit cae6bba077190e158ceee7b8991daf16fd8c55d1
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Wed Jan 16 13:36:19 2008 +0100
+
+    Added more Date specs
+
+commit 75d49657f31091d37dfdba1fc5487164db861802
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Wed Jan 16 15:58:42 2008 -0600
+
+    more specs for TcpServer and TcpSocket
+
+commit b1d45cb0fdc573bfe5995456d846c11747d48b90
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Wed Jan 16 13:31:33 2008 -0800
+
+    Implement ObjectSpace.define_finalizer, using WeakRef.
+
+commit 4e8a0d264dc7d5a4866a1a1b83238bebb47e4ab6
+Author: Jonas Pfenniger <zimbatm at oree.ch>
+Date:   Wed Jan 16 21:51:52 2008 +0100
+
+    Removed platform-specific specs in spec/ruby/1.8/core/signal/list_spec.rb
+
+    There is not direct way to know if a signal exists or not, since it all
+    depends on <signal.h>. In practice, there is no real risk for rubinius
+    to miss a signal.
+
+commit 32537f8d3378154f7f52c278cd56a7d4159a3446
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Jan 16 12:41:54 2008 -0800
+
+    Added IO#printf, fixed Kernel#printf to use IO's.
+
+commit e7bccb3f38f6ace3cb25a9f227ab5f6b1d2be346
+Author: Jonas Pfenniger <zimbatm at oree.ch>
+Date:   Wed Jan 16 21:19:48 2008 +0100
+
+    Signal.list spec now passes. bin/ci removed list_excludes.txt
+
+commit b3a6461af30f2c144b4ee65e8539c51291e0156b
+Author: Jonas Pfenniger <zimbatm at oree.ch>
+Date:   Wed Jan 16 20:03:15 2008 +0100
+
+    kernel/core/signal is no more platform dependent
+
+    * Now publishing platform.conf with rbx.platform.signal.* (only using the ones
+     defined in MRI's "signal.c")
+    * Signal::Names is now published with those values on @after_loaded@
+    * New method: Signal.list => Signal::Names
+    * Added EXIT=>0 and CLD=CHLD exceptions (see "signal.c" in MRI)
+    * Updated the corresponding specs for more details (on FIXME, please help !)
+
+commit bdbd712a5953f011f8d6f1142d50a452e1607f65
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Wed Jan 16 13:42:01 2008 -0600
+
+    updated Continuation excludes -- Kernel#callcc specs still bleedover
+
+commit 22d32d3461660ee7cd29760163b622fc94b6ea5b
+Author: Jeremy Roach <jero_rub at yahoo.com>
+Date:   Wed Jan 16 01:55:21 2008 -0600
+
+    apply Marshal.dump patch by Justin Bradford. #252
+
+commit 513de8ab67ab9c017285a48108ccceb185ebaf24
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Wed Jan 16 16:44:34 2008 +1100
+
+    Bunch of Debugger fixes
+
+    * Debugger now has proper quit behaviour, which causes
+      the debugger to remove all breakpoints, clear the debug
+      channel, and resume the debuggee.
+    * Fix singleton(-ish) semantics of Debugger; essentially,
+      only a single Debugger instance can be instantiated at
+      one time.
+    * Added a bunch of specs for the above
+    * Changed Rubinius::VM.set_debug_channel to accessor
+      style Rubinius::VM.debug_channel.
+
+commit 2174009b215ce2f0445fc8df4711e7e6c64b0332
+Author: Jeremy Roach <jero_rub at yahoo.com>
+Date:   Tue Jan 15 21:59:30 2008 -0600
+
+    add Marshal.load specs
+
+commit ec002dd0f0daddedaa5241c4f8f6d85fad0e9768
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Wed Jan 16 09:47:28 2008 +1100
+
+    Move VM under Rubinius namespace
+
+commit 983c54400542a03535accf2705ae227ae58970dc
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Tue Jan 15 15:24:10 2008 -0600
+
+    Added spec for File.new coercing filename using to_str.
+
+commit ff6a081de28711b0d8c1136e6e4272baf769043c
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Tue Jan 15 14:29:43 2008 -0600
+
+    since DRbObject is within DRb it should be a subdirectory but mkspec generated the wrong path to helper
+
+commit a48cbbd3f5da3c971a215423b3e27b058de04196
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Tue Jan 15 21:15:09 2008 +0100
+
+    Add more Date specs
+
+commit 9de289f1bbae86b12bc383e7e535de404f8aaa5f
+Author: Caleb Tennis <caleb at tarknology.com>
+Date:   Tue Jan 15 14:58:31 2008 -0500
+
+    Add a servent class to StructGenerator for Socket.getservbyname
+
+    Also, add Socket.htons and Socket.ntohs for byte order encoding
+
+    And complete Socket.getservbyname along with specs.
+
+commit d9e37ff3c0f975a418fafbc7163ee1a9717dd92b
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Wed Jan 16 03:31:05 2008 +0800
+
+    Fix Proc#[] calling the wrong #call method
+
+    * Re-aliasing in Proc::Function because aiases don't follow subclass
+    methods
+
+commit 2273c919e80ab7186e3139941dc4d73a292bcd2d
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Tue Jan 15 19:30:23 2008 +0100
+
+    Add add and minus specs for Date
+
+commit 1325e22c11c48c366d9f0387823de5941b59df66
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Tue Jan 15 16:35:23 2008 +0100
+
+    First specs for Date object
+
+commit a3b76d162e58e75b4523151bb6911c840db8319f
+Author: Caleb Tennis <caleb at tarknology.com>
+Date:   Tue Jan 15 12:58:14 2008 -0500
+
+    Implement Socket#pair (and Socket#socketpair) with corresponding spec.
+
+commit 836f1cf828ab62606a6b0e2f7313228b7482dcbe
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Tue Jan 15 11:47:11 2008 -0600
+
+    generate spec files for DRbObject
+
+commit ef99f25be36f6ccd33b297bed14c1175847f1ecc
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Tue Jan 15 11:31:08 2008 -0600
+
+    generated spec files for DRb with a basic spec for DRb.start_service
+
+commit 9637cf1e77efd1a3b53e6c4d82a7c7afe8509621
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Tue Jan 15 18:48:09 2008 +0100
+
+    Eliminate stdout from IO#dup spec runs.
+
+    At least, under JRuby it was printing things like:
+    "No such file or directory".
+
+commit 30a2fce2a4fd7e840586ce8ae390ecb632c8bee0
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Tue Jan 15 23:00:32 2008 +0800
+
+    Implemented Dir#pos which fixes #pos, #pos=, #seek, and #rewind specs
+
+commit 013ab2e88ecd8d887c6a0009e7f8d2add4849143
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Tue Jan 15 22:52:26 2008 +0800
+
+    Revert "Updated CI excludes"
+
+    This reverts commit 15d1c7674496a99bf1d5ec42420864b22bf1569a.
+
+commit 15d1c7674496a99bf1d5ec42420864b22bf1569a
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Tue Jan 15 21:50:55 2008 +0800
+
+    Updated CI excludes
+
+commit 18470055d83a43c3371609aaac4471767adb3b1b
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Tue Jan 15 04:32:54 2008 -0800
+
+    Make TCPSocket.new work.  Use socket library names for familiarity.
+
+    Make inheritance hierarchy of sockets better match MRI.
+
+    Add syscall names to Errno.handle checks.
+
+    Spec less of the socket library.
+
+commit bd34303986a068b40cce1366c85ea288fc24a3f5
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Mon Jan 14 23:55:38 2008 -0500
+
+    Regexp subclasses work now. Documented Regexp.new.
+
+commit 343acee55519fc97a35a9d50e8bdcfd679d432b7
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Mon Jan 14 23:49:47 2008 -0500
+
+    More Regexp.new specs.
+
+    * Subclass initialization verification.
+    * Multibyte options are case-insensitive.
+
+commit 758a468ffafdeea78016dbbce78f21e19f6735f6
+Author: Ryan Davis <ryand-ruby at zenspider.com>
+Date:   Mon Jan 14 18:22:32 2008 -0800
+
+    Fixed require modifying LOADED_FEATURES even if require raises an exception
+
+commit 5c8ff74b64f7ec6bd4c413b0e0e93334dff009ca
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Mon Jan 14 21:57:19 2008 -0500
+
+    Fixed Regexp#kcode specs.
+
+commit 34867cc1f1f3b7ac3145fb926491c0dc44629312
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Mon Jan 14 22:41:58 2008 -0800
+
+    Add Socket::getaddrinfo.  Raise SocketError appropriately.
+
+commit e2009a38a8e1ef0dff6394b92a677f3120280f72
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Mon Jan 14 22:39:55 2008 -0800
+
+    Remove platform-specific code, remove spec of socket library behavior.
+
+commit 5afa1c34808c68c17bc02f5f76c42d64efdd7dd2
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Tue Jan 15 00:32:14 2008 -0600
+
+    Modified retry-in-rescue example to test nested blocks and be clearer.
+
+commit 17fd0cb781ec90d268668c5678e1135eb5f6e323
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jan 14 22:28:46 2008 -0800
+
+    Added Module#autload?.
+
+commit 96ca83312d1b5a1e38e25f94504f6f69a137b96d
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jan 14 21:50:37 2008 -0800
+
+    Updated CI excludes for language.
+
+commit ef4f49de672d40f43f53dadff1aa8fdbcafe1d45
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Mon Jan 14 21:37:23 2008 -0800
+
+    Fix specs for dregx change, fix regexp for specs
+
+commit 5cd2ef2a173394910249d93d8ef433d220f2d9a9
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Tue Jan 15 16:32:15 2008 +1100
+
+    Fix breakpoint specs
+
+    The breakpoint specs were interfering with one another,
+    due to the fact that each was modifying the bytecode for
+    a fixture class that is compiled only once.
+
+    Workaround this by saving off the bytecode and resetting
+    before each test.
+
+commit 29bf88b07f87182d94fcf7c550724efc07067239
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jan 14 20:00:27 2008 -0800
+
+    File spec/data/critical.txt is empty! Congrats to everyone!
+
+commit 8082760cc2215742464a9846295ec4a8a0c49244
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jan 14 19:37:33 2008 -0800
+
+    Removed Module methods from critical excludes.
+
+commit d075c115087c001d0d35562aeeea21efadc5e3b6
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jan 14 18:53:46 2008 -0800
+
+    Added not_compliant_on :rbx for class variable specs that use Fixnums.
+
+commit 23f1b523da2478f2ad962f0045dca3e7034f9b56
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jan 14 18:16:46 2008 -0800
+
+    Multiple fixes for #class_variable_get/set. Updated CI excludes.
+
+commit dbc5675058aa426dbfbbf7489d5393819edb16f8
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Mon Jan 14 16:42:27 2008 -0800
+
+    Fix attrasgn usage to pass specs
+
+commit 3e250999d6f1a7fdaf2bb5cd169a1024e2ab5ddc
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jan 14 16:07:08 2008 -0800
+
+    Removed leftover excludes for compiler[12].
+
+commit a2b8b5511e79b47fa7777e716ee16511fdec3fd4
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Mon Jan 14 16:47:21 2008 -0600
+
+    Remove the goofy Hash#delete spec and replace with two others.
+
+    The old version of this example depended on individual hash buckets having a
+    specific ordering, which overreaches a bit. The new version, while a little
+    cumbersome, should work correctly regardless of hash implementation or hash
+    and bucket ordering.
+
+    I also moved out a few lines that were unrelated to this example into a
+    separate one.
+
+commit 67d858885f1841e9c9aa295150da3c472949198d
+Author: Gregor Schmidt <ruby at schmidtwisser.de>
+Date:   Mon Jan 14 14:57:53 2008 +0100
+
+    Passes Module#extended specs by added extended method to module and adding a call to it in Object#extend
+
+    Signed-off-by: Brian Ford <brixen at gmail.com>
+
+commit 302ba965def902ccc5d3e97ed6bd5841f09d8f00
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jan 14 14:14:08 2008 -0800
+
+    Philipp Brüschweiler's patch for String#%, #242.
+
+commit abaf2efa9e467bb7b5ef3b53b8490f1e056a832e
+Author: Caleb Tennis <caleb at tarknology.com>
+Date:   Mon Jan 14 16:59:23 2008 -0500
+
+    Another round of socket specs, and add a Rake StructGenerator to find sockaddr_un if it's available
+
+commit f5d0e435023a80bcc4c101a8d3ab9fc056a14c80
+Author: Caleb Tennis <caleb at tarknology.com>
+Date:   Mon Jan 14 15:52:47 2008 -0500
+
+    More socket specs
+
+commit 7bbc927a9d8a6f9202025be62a3db861ced3216f
+Author: Caleb Tennis <caleb at tarknology.com>
+Date:   Mon Jan 14 14:58:34 2008 -0500
+
+    More socket functions and specs.
+
+    Namely, this implements a Socket::SockAddr_In class that is a FFI::Struct around the
+    sockaddr_in C struct.  This gives us a better ability to inspect what's going on in the
+    struct from the Ruby side of things.
+
+commit f351c6d3d8831705f0398abdae240abba9252a75
+Author: Caleb Tennis <caleb at tarknology.com>
+Date:   Mon Jan 14 11:09:04 2008 -0500
+
+    More socket specs update
+
+commit cb8ce936394cafa00f77008083bccf9cded59f28
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Mon Jan 14 14:39:41 2008 -0500
+
+    Split process/constant expectations into Linux and BSD sections
+
+commit 0964d53edd80367611f63cd6eb4b294ec898cc8d
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Mon Jan 14 10:04:53 2008 -0500
+
+    Revert IO#dup spec to unmask errors, removed FileUtils dependency.
+
+    * Any errors occurring in specs should generally be raised normally
+      so that any potential problem or spec deficiency is exposed.
+
+commit 04f542e928c5fa0df460d8f11b4d87e008fa343f
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Mon Jan 14 13:36:49 2008 -0500
+
+    Update Process::Constants to fetch values from RUBY_CONFIG
+    Update process/constants_spec so that it passes on MRI as well
+
+commit 0ad02b57fd040196d11662bd1ab9b259dc2ce6d2
+Author: Jeremy Roach <jero_rub at yahoo.com>
+Date:   Mon Jan 14 12:23:20 2008 -0600
+
+    squash Marshal.dump bugs
+
+    * fix order of evaluation problem
+    * put more objects in links and symlinks hashes
+
+commit ed98b9a14459b011f97fee5c781410c4d413ed9a
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Jan 14 17:36:00 2008 +0100
+
+    Updated Arry#pack specs to guard for always big-endian JRuby.
+
+commit 550f07dc7551573a975183209ba8904fdbd62607
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Jan 14 15:57:04 2008 +0100
+
+    More robust cleanup in IO#dup specs.
+
+    Without it, mspec against JRuby was reporting EIGHT
+    failures, while only 5 tests are actually exist.
+
+commit 1ea4f82183190c4c87da48c381f1db417c7403ac
+Author: Caleb Tennis <caleb at tarknology.com>
+Date:   Mon Jan 14 09:26:36 2008 -0500
+
+    Updated some socket specs
+
+commit e20ab7ea377cd39209011b44204d2688b53611c5
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Mon Jan 14 02:23:26 2008 -0500
+
+    Fixed Regexp.new kcode setting, improved Regexp specs.
+
+    * Regexp kcode can be upper- or lowercase.
+    * More robust Regexp#options and #inspect specs.
+    * Updated Regexp excludes.
+
+commit cc71f359aa65101d2c00cfbb0c396b7cdc697ef2
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Mon Jan 14 01:25:21 2008 -0800
+
+    Improve bytecode performance a tiny bit, fix Kernel#`
+
+commit c561368c03c605de41746fac2ce5a6386fcf4f54
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Mon Jan 14 03:17:15 2008 -0600
+
+    Quarantine a suspicious TCPSocket.new speck failing on MRI on OS X.
+
+commit 71a9cf2afbbe6903b8d652b3ee201957e0b0c633
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 13 22:58:16 2008 -0500
+
+    Finished IO#print specs.
+
+commit ff75b95a690051736f49a9a113d21027f7f03e92
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 13 22:44:21 2008 -0500
+
+    IO#dup and specs.
+
+commit 02f1c03f4df3327ce1ddd20e2249a5e9830627a0
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Jan 13 23:11:48 2008 -0800
+
+    Justin Bradford's patch for Float failure, #237.
+
+commit e43c148954ad609c438e5a4f14811c0349239374
+Author: Matthew Draper <matthew at trebex.net>
+Date:   Fri Jan 11 21:35:57 2008 +1030
+
+    Kernel#Integer is very fussy about the strings it accepts.
+
+    Signed-off-by: Brian Ford <brixen at gmail.com>
+
+commit adad84f7a26bf40809366f2f7b6acfc61dcfefc2
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Mon Jan 14 00:31:12 2008 -0600
+
+    Class.inherited gets invoked regardless of visibility
+
+commit c746fad52e9503d04c3cf65de979b0a5a9f9e495
+Author: Matthew Draper <matthew at trebex.net>
+Date:   Mon Jan 14 10:25:58 2008 +1030
+
+    Many of Kernel's methods should be module_functions.
+
+    Signed-off-by: Brian Ford <brixen at gmail.com>
+
+commit 0b8a4bfefaed3179f96721fdde35e32ed8ff7263
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Jan 13 21:43:45 2008 -0800
+
+    Update CI excludes for Regexp. Remove empty CI exclude files.
+
+commit 89a87edbc61a877621c6f43266000aff32e92ae7
+Author: Warren Seen <warren at warrenseen.com>
+Date:   Mon Jan 14 07:12:13 2008 +1100
+
+    Fixes visibility of methods passed to Module#module_function
+
+    * Make instance methods versions of functions passed to Module#module_function private
+    * Correctly identify visibility in error message raised in Module#set_visibility
+    * Added specs for module_function
+
+    Signed-off-by: Brian Ford <brixen at gmail.com>
+
+commit 25d6fa558f88732d1aa28c68b0eb7c9910366243
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 13 20:42:52 2008 -0500
+
+    Updated Regexp excludes.
+
+commit 69e200276898f1c9208be527bdc64c318c56f86e
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 13 20:24:42 2008 -0500
+
+    Shared spec for Object#dup and Object#clone.
+
+commit 8a6fe609224c126bcf86987edd3f0690fc9e45ff
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Jan 13 18:19:56 2008 -0500
+
+    VM calls private hook methods now. Object#dup and #clone specs.
+
+    * Object#dup and #clone have rudimentary specs which also partially
+      confirm the private hook fix through #initialize_copy.
+
+commit 84773b6ba63ea6f715dcc4e99e0a8a2e2b739152
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Fri Jan 11 10:46:15 2008 -0500
+
+    Specs for Regexp.{new,compile}, updated excludes for same.
+
+commit 6c1603723bba7d58203aa9b03bbf92b4900e53d1
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Jan 13 18:49:40 2008 -0800
+
+    Numerous fixes for File::Stat.
+
+    * Implemented readable(_real)?, writable(_real)?, executable(_real)?.
+    * Implemented a number of helper methods like rowned?, rgrpowned?,
+      superuser?, rsuperuser?. Made these private.
+    * Implemented owned?, grpowned?.
+
+commit d1b05e0bf98a3cdfda8a3d2398e78035a49c0c66
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Mon Jan 14 12:25:41 2008 +1100
+
+    Deprecate meta_send_stack* opcodes
+
+    The code path for these opcodes is almost identical to
+    send_stack, and no measurable performance improvement
+    comes from using them.
+
+commit 154fe5e1faad94f371c51a979240a6d7f5cd8909
+Author: Caleb Tennis <caleb at tarknology.com>
+Date:   Sun Jan 13 20:07:12 2008 -0500
+
+    Implement BasicSocket#setsocketopt for String optvals, and add a spec for it.
+
+commit c21636d6b2502db344049e7dc62d42ff8c18b040
+Author: Caleb Tennis <caleb at tarknology.com>
+Date:   Sun Jan 13 19:34:50 2008 -0500
+
+    Add specs for BasicSocket#getsockopt
+
+commit 1584f41148b8d8967df4c3ee6376b59919cb7db3
+Author: Caleb Tennis <caleb at tarknology.com>
+Date:   Sun Jan 13 19:24:58 2008 -0500
+
+    Add Array.pack for i, s and l arguments.
+
+commit 7131e187e19bf0889f8ece802495865f7b3f1e5c
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Sat Jan 12 13:55:20 2008 -0800
+
+    Cleanup String#split, add edge case check
+
+commit 4ff46602c8a54a61697bb8d9eaa9ae89e56f7abe
+Merge: 1c95721... 908ccff...
+Author: Caleb Tennis <caleb at tarknology.com>
+Date:   Sun Jan 13 14:49:48 2008 -0500
+
+    Merge branch 'socketspecs'
+
+commit 908ccff0a854038372dad0780e1de35727e2d657
+Author: Caleb Tennis <caleb at tarknology.com>
+Date:   Sun Jan 13 14:49:17 2008 -0500
+
+    Some TCPSocket spec mods
+
+commit 1c95721bd873c4b30c187bfa7673cd7e3568a0fb
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Jan 13 10:20:43 2008 -0800
+
+    Fixed File::Stat specs to output method name correctly with -f s.
+
+commit acb7505d41aa789157e50962253e686827a702d5
+Author: Jeremy Roach <jero_rub at yahoo.com>
+Date:   Sun Jan 13 12:07:06 2008 -0600
+
+    update CI excludes
+
+commit c8db419ae06e9642b346e1bcae99367f3b72845f
+Author: Jeremy Roach <jero_rub at yahoo.com>
+Date:   Sun Jan 13 11:55:50 2008 -0600
+
+    squash bug in Marshal.dump
+
+    symbols need a separate links hash
+
+commit eb953ae2c3fdeac4ae13b5461246b9f51b0f39cc
+Author: Caleb Tennis <caleb at tarknology.com>
+Date:   Sun Jan 13 09:40:39 2008 -0500
+
+    Make the spec text more verbose
+
+commit db013bc06cef2dea4b77a215d4437e2172b391b6
+Author: Caleb Tennis <caleb at tarknology.com>
+Date:   Sun Jan 13 09:04:08 2008 -0500
+
+    Commit an updated spec that shows the failure on rbx and passes MRI,
+    w.r.t. opening a module and aliasing a private module function from that
+    module.
+
+commit 759a9f8bd70ead9b5d2fc67b3872e3bf3bd34001
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Jan 13 01:45:07 2008 -0800
+
+    Updated CI excludes for File::Stat.
+
+commit 107feb74eaf01c09d8c5bd14ac29e53900a5ed26
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Jan 13 00:38:00 2008 -0800
+
+    Modified File, File::Stat, FileTest specs.
+
+    * Added templates for File::Stat specs.
+    * Added shared specs for some File::Stat methods.
+    * Altered toplevel File shared specs to take the name
+      of the constant to enable File::Stat to use a fixture
+      proxy but still have the correct name show with -f s.
+    * Split out specs for missing files because File.[l]stat
+      behaves differently than e.g. File.file?.
+
+commit e1a13f7ecfe7f2d18fd6ac20dd8c63cbd6d11855
+Author: Jeremy Roach <jero_rub at yahoo.com>
+Date:   Sun Jan 13 02:26:09 2008 -0600
+
+    implement more of Marshal.dump
+
+    obj.marshal_dump, IO.write, depth limit, exceptions
+
+commit bc070232eab1bfa5d294897487339d259a406e74
+Author: Jeremy Roach <jero_rub at yahoo.com>
+Date:   Sat Jan 12 15:16:21 2008 -0600
+
+    implement more of Marshal.dump
+
+    Float, obj._dump
+
+commit ad7a67ed5a3a1399773dda74c4688e9b00c8f9aa
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Sun Jan 13 01:46:36 2008 +0800
+
+    Update CI excludes for Process.initgroups
+
+    * It was affected earlier by the Enumerable lambda/Proc-arity issue
+
+commit 7b7a1e3e4712f35688823543b7a7c3c25405ef77
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Sun Jan 13 01:40:22 2008 +0800
+
+    Fix implicit block in Enumerable not passing the arg check in Proc#call
+
+    * Changed instances of lambda to Proc.new and arity once again
+    returned the correct value. Will investigate, but until then, this
+    passes.
+
+commit d9c21aaa18044bd54ed3b1f6ec5daacf9bd250fa
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Sun Jan 13 01:02:00 2008 +0800
+
+    WIP Fix block argument checking
+
+    * Passes all the proc/lambda call specs
+    * However, specs for methods that add implicit blocks like
+    Enumerable#all fail because their arity is somehow 0 - excluded for now
+
+commit 3d400bc8a91a793f49dcf5655dc28e6141d999d0
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Sat Jan 12 20:03:26 2008 +0800
+
+    Update CI excludes and add Module#class_variable_get to critical.txt
+
+commit 6bf7b8616837649ddd2c1435a54c86ed30910985
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Sat Jan 12 19:27:12 2008 +0800
+
+    Move custom classes for NoMethodError specs into fixtures
+
+commit 10cc61bb816ae67a7fad5b135f66d263d7ee07b1
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Sat Jan 12 19:20:27 2008 +0800
+
+    Swap the protected/private method calls around in the NoMethodError spec
+
+commit 6b2e66d3f9222b52cdae42b57206363ad47949e2
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Sat Jan 12 11:51:28 2008 +0100
+
+    Corrected Module#alias_method spec.
+
+    Now it should pass on both MRI and JRuby.
+
+commit 67f74a936655b72c689d09c77d9fbe9d7194a0a0
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Sat Jan 12 17:50:22 2008 +0800
+
+    Fix proc/lambda/Proc.new arity
+
+commit 03440114d5e3f07111cdcae3657258cae4c803e7
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Fri Jan 11 13:24:26 2008 +0800
+
+    Fix Kernel.Integer parsing of invalid String
+
+commit 598598c10c66de38b52a8092cdd2fa99604eda6e
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Sat Jan 12 00:21:22 2008 -0800
+
+    Clean up expectations to use a common list.
+
+    Update excludes for other things using shared glob specs.
+
+commit 55aa5a1f10655618e45d0ec84502cc13c982227e
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Fri Jan 11 23:31:45 2008 -0800
+
+    Specs for File.fnmatch handling of Regexp specials.
+
+commit 7c0dc7edfcdf4948047ba051b0cbed7ba761f1dc
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Fri Jan 11 21:57:10 2008 -0800
+
+    Dir.glob support for {}.
+
+commit 9a097fe5634c1109919d1e120b1276827371c332
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Fri Jan 11 19:42:31 2008 -0800
+
+    Exclude {} specs for WIP Dir.glob
+
+commit ccdc6f5ae5fabbd0d2c32072811e2ecf7cca8987
+Author: Caleb Tennis <caleb at tarknology.com>
+Date:   Fri Jan 11 21:40:04 2008 -0500
+
+    In MRI, you can alias private module methods.  Not so here.  This spec catches it.
+
+commit 8b402d1e32dc283124375374532024f6cfe7020d
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Jan 11 17:35:21 2008 -0800
+
+    Added toplevel shared specs. Converted File, FileTest specs.
+
+    * spec/ruby/1.8/shared is the directory for sharing
+      specs across multiple classes.
+    * Added methods for FileTest
+
+commit c6aea2e10d7a4d0ee14175d5b79894e1e11699b1
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Jan 11 15:59:34 2008 -0800
+
+    Converted File/FileTest#exist(s)? to toplevel shared specs.
+
+commit 06a5d8a3d5874303a71e4e9b939b44c204041edf
+Author: Caleb Tennis <caleb at tarknology.com>
+Date:   Fri Jan 11 17:39:39 2008 -0500
+
+    Fix failing specs in udpsocket/open_spec.rb
+
+commit 530e40005d09140fdb55608890f0994f3a48d8be
+Author: Caleb Tennis <caleb at tarknology.com>
+Date:   Fri Jan 11 13:11:58 2008 -0500
+
+    Observer specs
+
+    Signed-off-by: Brian Ford <brixen at gmail.com>
+
+commit 0907a20d2bad2207be8e937c403c49634f3a23b6
+Author: Caleb Tennis <caleb at tarknology.com>
+Date:   Fri Jan 11 12:24:44 2008 -0500
+
+    Add observer to lib and base-spec file
+
+    Signed-off-by: Brian Ford <brixen at gmail.com>
+
+commit ec0ff1dfa1ee9de38d35537bec5071f6bb31cf7f
+Author: Jeremy Roach <jero_rub at yahoo.com>
+Date:   Fri Jan 11 13:11:02 2008 -0600
+
+    implement more of Marshal.dump
+
+    Array, Hash, links
+
+commit 640e81394ad2385b535b08b535a4fca06a5f3eec
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Jan 11 10:24:54 2008 -0800
+
+    Added CI exclude for failing MD5#== spec.
+
+commit 3c238cc9f4b32f63bc681bd64a507fc2ff49b017
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Jan 11 10:00:50 2008 -0800
+
+    Converted Socket specs to use subdirs for subclasses.
+
+commit 2b98950eaa33b532fcef079b0997f9793228c608
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Fri Jan 11 09:23:23 2008 -0500
+
+    Specs and implementation for IO#print. Closes #222.
+
+    * IO#print without arguments spec excluded due to a lack of a lower
+      level output matcher. To be added shortly.
+
+commit d65c8c6899cf8e4a1fa56486cf417451e0c7fce6
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Fri Jan 11 19:19:56 2008 +0100
+
+    Fix String#* spec.
+
+commit 481e075bfeb9f8fb3bd4db645129a463307de09e
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Jan 11 17:41:07 2008 +0100
+
+    Improved digest/md5 specs a bit, some new test cases.
+
+commit 67f48236da3d114638310ab37bcc706719bf7fcd
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Fri Jan 11 11:59:06 2008 +0800
+
+    Updated Method's specs as Method#inspect and #to_s deviates on Rubinius
+
+commit 76846154773a87bc8d99c97e91250abda22f6378
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Thu Jan 10 19:24:57 2008 -0800
+
+    A bunch of fixes found while working on Socket
+
+commit f69613740662d3ba4f85573c6c860a5987b29765
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Fri Jan 11 00:17:14 2008 +0100
+
+    Fixed Time object for throwing errors where appropriate
+
+commit 9396386f700646d0c55b9a7a75bc399dfe055d2c
+Merge: baae72c... 4d2e53e...
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Thu Jan 10 22:39:24 2008 +0100
+
+    Merge branch 'master' of git at git.rubini.us:code
+
+commit baae72cc47c9c1f41c3478732b7bbfdfe514024a
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Thu Jan 10 22:39:11 2008 +0100
+
+    Fixed Time#xmlschema conversion
+
+commit 4d2e53e7376080e42b84dca486debcf4f153f32f
+Author: Jeremy Roach <jero_rub at yahoo.com>
+Date:   Thu Jan 10 15:17:00 2008 -0600
+
+    implement more of Marshal.dump
+
+    negative Fixnum, Bignum, Regexp, Struct
+
+commit abdbcd70bba99149b7391effa48452971407b4d2
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Jan 10 13:18:52 2008 -0800
+
+    Annotate Rubinius spec as non compliant.
+
+commit 2a2b3a016bfd70eb8cd14b6a043d59f119e0ad7c
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Thu Jan 10 21:52:18 2008 +0100
+
+    Re-added divmod specs for Ruby/JRuby, with comments.
+
+commit 2f079e416e4389b091c8c9b5522d49c6f356c6c9
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Jan 10 12:29:39 2008 -0800
+
+    Updated Bignum#divmod specs.
+
+commit 7a5c79415f2e6555bf2c69e416f6d3189f2e0c3e
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Jan 10 10:46:05 2008 -0800
+
+    Simplify wording of VM.coerce_to_array specs.
+
+commit abc1237a0c96ecd77baee6ecbcf71a7bba338139
+Author: Ryan T Mulligan <ryan at ryantm.com>
+Date:   Thu Jan 10 12:35:23 2008 -0600
+
+    md5 is now fully 1.8.6 MRI compatible
+
+    * MD5 digest specs
+    * Specs pass on MRI and RBX
+    * Platform::POSIX.memcpy hooked
+
+commit 9f991bd850c51cd624169b51768c2215d4b56edb
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Fri Jan 11 01:35:15 2008 +0800
+
+    Method#bind raises TypeError when binding a method from a non-descendant
+
+commit fc029ab13ded7eeb1ba838b99f00e2f14e232d65
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Fri Jan 11 00:12:44 2008 +0800
+
+    Implement that Precision.induced_from raises TypeError in certain cases
+
+    * For case when mixer class doesn't define it's own induced_from method
+    * Update CI exclude for precision
+
+commit 35d1a7bc3694bdcc327dd5ac89ca0f261e0bd705
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Thu Jan 10 16:57:38 2008 +0100
+
+    Added one more Bignum#divmod testcase, known to fail on some implementations.
+
+    In fact, this test case fails on Rubinius and JRuby.
+
+commit 955676613f5e38cf029998e2712013e4575dd03e
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Thu Jan 10 16:12:37 2008 +0100
+
+    Changed spec failing on MRI
+
+commit f7b4f3fe02833081cc7f40c0feebbef0e5012f10
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Thu Jan 10 15:58:23 2008 +0100
+
+    Fixed Float#divmod
+
+commit aff6e1fc1a16eb9e7b7e207ebc2234154d891a92
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Thu Jan 10 22:53:25 2008 +0800
+
+    Converted VM specs
+
+commit 969c0d8e0dbf43caa3999976cf259c623ff05ff1
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Thu Jan 10 22:50:17 2008 +0800
+
+    Convert Options specs
+
+commit cc7c9dcb6697dea991342328a9b00fa01740e809
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Thu Jan 10 22:28:42 2008 +0800
+
+    Replace example blocks using 'specify' with 'it'
+
+commit 7a5fa30a71072346abda17cdb79c2aa3b3922239
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Thu Jan 10 15:27:49 2008 +0100
+
+    Fixed Bignum#quo
+
+commit f2aafe4a352fd884d217b0361d2e7e617f58ebd5
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Thu Jan 10 20:38:45 2008 +0800
+
+    Converted Generator specs and generated new CI exclude files for it
+
+commit edb7e341d9b3ab1c3bdc08bc57ec55d6bf8ace8b
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Thu Jan 10 19:33:53 2008 +0800
+
+    Remove generator_spec.rb because of spec conversion
+
+commit bb4de530c5980f0205875bdb5548e40a22ef6a62
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Jan 10 01:45:47 2008 -0800
+
+    Updated CI excludes for library because of spec conversions.
+
+commit 61a66f69fe3a94d9ad5568ee2dd846cfc0b5211a
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Jan 10 01:45:17 2008 -0800
+
+    Converted Socket specs.
+
+commit 167e05039eeeeb959f7aab1f3611268170037296
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Jan 10 00:59:20 2008 -0800
+
+    Converted YAML specs and added template files for other methods.
+
+commit 027f568f79222cdee492f088edf8a2f14250635a
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Jan 10 00:47:35 2008 -0800
+
+    Converted ostruct specs and added template files for other methods.
+
+commit e964c9342ade9341518bc46cf998703a2c16aa2b
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Jan 10 00:39:49 2008 -0800
+
+    Converted ftools specs.
+
+commit 6263280187c81b0ee27893eae90f9d6a8a511b65
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Jan 10 00:26:40 2008 -0800
+
+    Converted Etc specs.
+
+commit 7b94284063222eef42b9b7ad0d1c820adabe210d
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Thu Jan 10 00:39:01 2008 -0800
+
+    Fix a few more Kernel bugs
+
+commit 1c58ee51f388da0490a7815c9a1787d21e151aab
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Jan 10 00:08:15 2008 -0800
+
+    Fixed path for mock dirs in Dir specs.
+
+commit 320f7e7d3503d53216733f9b6eb75c387155ae5f
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Jan 9 22:44:37 2008 -0800
+
+    Converted StringIO and Singleton specs.
+
+commit 5a94a7c3b73103c99a337a089f9cf2c7e601d2bc
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Jan 9 21:50:14 2008 -0800
+
+    Converted stdlib Singleton specs.
+
+commit 12864a2057d1b6f5fa392f34d1fa3e8873a8c566
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Mon Dec 24 23:06:12 2007 +1100
+
+    Initial commit of Rubinius Debugger
+
+    * Created Debugger class for debugging Ruby code in Rubinius
+    * Added Kernel#debugger convenience method to set a breakpoint
+      and activate the debugger at the point at which the
+      debugger statement is encountered.
+    * Implemented the following debug commands:
+      - h: get a listing of commands
+      - b: list breakpoints
+      - b <Method>: set a breakpoint at the start of the method
+      - n: Step to the next line
+      - ni: step to the next VM instruction
+      - c: continue execution until the next breakpoint
+      - l: list source code around the current breakpoint
+      - d: decode VM bytecode around the current breakpoint
+      - v: display local variables and their values
+      - vs: display the contents of the VM stack
+      - Anything else is evaluated as a Ruby expression in the
+        context of the current breakpoint (so you can, e.g. change
+        the value of locals before resuming, etc)
+
+commit 01a189cc3e52e8bcc6f22bcc5713e765bba84160
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Wed Jan 9 10:29:27 2008 -0500
+
+    Object#is_a?, #kind_of? and #instance_of? specs.
+
+    * Removed obsolete kernel specs for same.
+
+commit ab9645614bbbd0bca63c215819c12cc85a1507b1
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Jan 9 21:35:39 2008 -0800
+
+    Converted specs for stdlib Time.
+
+commit 733b069f11c7136175036154a45b924cf89cc8ff
+Author: Jeremy Roach <jero_rub at yahoo.com>
+Date:   Wed Jan 9 20:01:09 2008 -0600
+
+    update CI excludes
+
+commit 01e98dee4c24838ca518610443e43473ffdcf43c
+Author: Ryan Davis <ryand-ruby at zenspider.com>
+Date:   Wed Jan 9 16:42:07 2008 -0800
+
+    Fixed block args for |*a|
+
+commit dc9c1d05dd5e0e828a77acc09220f5894a9aa453
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Jan 9 16:04:11 2008 -0800
+
+    Fixed Enumerator spec style. Updated YAML excludes.
+
+commit 0363685a97df83feb0d07f40a7a5c4d7a78e2a27
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Wed Jan 9 14:55:53 2008 -0800
+
+    Spec for String#sub bug.
+
+commit 23052eb5f993c959fdb2b327895df08e0a344edb
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Tue Jan 8 23:47:27 2008 -0800
+
+    Implement { } matching for Dir.glob
+
+commit c90b2531d183e4534268d4699634828f29e803cb
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Tue Jan 8 23:44:35 2008 -0800
+
+    Spec File::Stat#blksize.
+
+commit 62d2a1809936a304c0cf0b94fd28f5b83932f58f
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Tue Jan 8 22:47:37 2008 -0800
+
+    Implement Dir.glob '{a,b}'
+
+commit d9430ad1a3e582e830a994a83d6f99e017bfbe4d
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Tue Jan 8 20:56:37 2008 -0800
+
+    Fix module X::Y; end; X::Y.name
+
+commit 1baa9468e0d89777fdb6f23e78e8ab510a19d534
+Author: Jeremy Roach <jero_rub at yahoo.com>
+Date:   Wed Jan 9 16:16:35 2008 -0600
+
+    incomplete Marshal.dump
+
+    an evil ivar_as_index is added to Object to hold
+    the names of modules that extend the object
+
+commit 85e98490fe45446e03801840d4628149f8977098
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Wed Jan 9 12:26:19 2008 -0800
+
+    Move compiler2 => compiler, and Compiler2 => Compiler
+
+commit 5aa5cc66e2b0196728c80eb394ec3b2dfccd77ae
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Wed Jan 9 10:30:42 2008 -0500
+
+    Centralised specs for Object#=~.
+
+commit e1fe9f57c942460338a18e38f66fbf6feb69b4bc
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Jan 9 13:23:59 2008 +0100
+
+    Added few edge cases to Numeric#eql? tests.
+
+commit b8dfd675fad5e82ebfd50c737beb9a9b919a9c8b
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Wed Jan 9 15:52:18 2008 +0800
+
+    Remove excludes for String#slice with the fixed send in place
+
+commit d7f69f17ac30f6b3161851e8df6a1e0a7694219d
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Tue Jan 8 22:42:43 2008 -0800
+
+    A couple more fixups
+
+commit 055d7545c7046102cd92b7054992b1b47f711c4a
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Tue Jan 8 22:31:50 2008 -0800
+
+    A boatload of fixes done while getting flexmock and rake running
+
+commit fd7c266e52c25d151214512cc801901813630d7a
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Wed Jan 9 11:49:02 2008 +0800
+
+    Removed last array exclude due to fix in 02e6e28
+
+commit 690626f43f7b4ce888de081033eaadfba543acff
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Jan 8 18:58:50 2008 -0800
+
+    Removed subtend specs from CI run. Increase File#mtime tolerance.
+
+commit dec4f25a47a9a962b77a97dea47985fe17421e5f
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Wed Jan 9 13:39:51 2008 +1100
+
+    Specs for stack usage
+
+commit d699f6605db86e6f6bc61d0f3a79fc1535816c70
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Wed Jan 9 10:38:06 2008 +0800
+
+    Add spec to illustrate Numeric#divmod bug in MRI and rubinius (excluded)
+
+commit 8a55f3047dc0fd502bb632dc9f5bdb9668b180fe
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Jan 8 18:32:18 2008 -0800
+
+    Subtend CI exclude to (hopefully) fix the build server runs.
+
+commit 33bde75b57a88baa850edccea382e1130ed586da
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Jan 8 17:19:30 2008 -0800
+
+    Added spec/compiler2 to CI. Added CI excludes for compiler2.
+
+commit 6964fc5644fddeef2238591674786f035d9db842
+Author: Ryan Davis <ryand-ruby at zenspider.com>
+Date:   Tue Jan 8 17:19:20 2008 -0800
+
+    Fixed up against evan's changes. ping
+
+commit 9423d1e8e9ed91fb9f0934b939899c753972cee1
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Tue Jan 8 20:11:54 2008 -0500
+
+    Fix warnings encountered when running compiler2 specs under MRI
+
+commit d71ad87c14a4378ad2f01c49d90304c29be548f3
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Tue Jan 8 17:02:02 2008 -0800
+
+    Fix a block_arg bytecode generation case
+
+commit 57199b5b468c0009512a479e13bbcf086d0d9526
+Author: Ryan Davis <ryand-ruby at zenspider.com>
+Date:   Tue Jan 8 16:16:07 2008 -0800
+
+    Added new combo bytecode/runtime tests for block args
+
+commit 8a88699af73d272a61332e11d022bd629aa0460d
+Author: Ryan Davis <ryand-ruby at zenspider.com>
+Date:   Tue Jan 8 16:15:24 2008 -0800
+
+    Improved inspect output for compiler spec objects. Added convencience methods for testing iter bytecode generation.
+
+commit 0dd9cd298cf735dc13cc2a2410ad6b5195790c11
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Jan 8 13:19:21 2008 -0800
+
+    Added subtend specs to CI. Updated subtend excludes.
+
+commit c07a5273844b32fe39090bb16d0e4ad59ecb0564
+Author: Dirkjan Bussink <d.bussink at gmail.com>
+Date:   Tue Jan 8 21:28:48 2008 +0100
+
+    Fixed given_spec? because of changed block_given? behavior
+
+commit 0f9a8dfee9dd1c7af1f8ba69497c8dd85539760a
+Author: Nitay <nitay at powerset.com>
+Date:   Tue Jan 8 11:49:41 2008 -0800
+
+    Fix setpgid spec using pipes to avoid race condition
+
+commit 09feb8677c529d04969e63d1ff4e3746037611cf
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Jan 8 10:00:06 2008 -0800
+
+    CI excludes for ruby/1.8/library.
+
+commit cda3d86fa44f1d62fe503e54f42c5c5df361b8f9
+Author: Benjamin Andresen <bandresen at gmail.com>
+Date:   Tue Jan 8 08:22:49 2008 +0100
+
+    Added explicit umask to File permission spec so it won't fail on
+    non-standard umasks.
+
+commit 6df303e29d7fd04f4a1a0af379f4947854dd4635
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Mon Jan 7 23:20:22 2008 -0500
+
+    Method#== and specs from Scott Taylor, slightly tweaked. Closes #137.
+
+commit 9b86b12be687bb29e25d0292786351d89a698adc
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jan 7 19:45:24 2008 -0800
+
+    Added CI exclude for Array#pack.
+
+commit 17a746b0aa2c89aa9e61b8965d125e962748c20d
+Author: Jeremy Roach <jero_rub at yahoo.com>
+Date:   Mon Jan 7 21:07:25 2008 -0600
+
+    adds Marshal.dump and Float#to_s specs
+
+commit d5c19db2778e0cc3cbee5bf994b511448cb6bd78
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Mon Jan 7 15:31:11 2008 -0800
+
+    Fix IO#pos=
+
+commit 21f44f03f0aa44b2f172f89ad27797c943dc618b
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Jan 7 22:03:28 2008 +0100
+
+    Remove non-needed std output from Array#pack test.
+
+commit 9ec20509ad6533876bbbc984052e6b7e05d2ea55
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Jan 7 21:50:46 2008 +0100
+
+    Added Array#pack tests with empty array.
+
+commit 35170103bdba14d824780a41112f12034cb5c79e
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Jan 7 21:13:47 2008 +0100
+
+    Added Array#pack tests with 'w' pattern.
+
+commit 71b00e03ce2c6424fd262d737feb991835605da2
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Jan 7 20:46:58 2008 +0100
+
+    Added Array#pack('U') test with negative values.
+
+commit 7be0813127635ea54909179c9553c5052c4a3d90
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Mon Jan 7 18:00:03 2008 +0800
+
+    Add specs for Array.[]
+
+commit 0b762336e8c6040cbbe794cece64c56bfa46c296
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Sun Jan 6 23:35:35 2008 -0800
+
+    Fix breakages, comment out at_exit spec (need a better way to test)
+
+commit 8896e459f1bffb7ae2da2f2aa708419e6316cb4b
+Author: Matijs van Zuijlen <Matijs.van.Zuijlen at xs4all.nl>
+Date:   Mon Jan 7 14:03:03 2008 +0900
+
+    Spec to demo failure of cases like "yield 1, *[1, 2]"
+
+commit 79da85bb1b1d63e617251b3a3ea6b0657c1e8ddb
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Mon Jan 7 13:04:22 2008 +1100
+
+    Modified CompiledMethod#decode to use #local_names
+
+    * CompiledMethod#decode now leverages new #local_names
+      method to return the names of locals accessed via
+      push_local/set_local etc.
+    * Removed excludes, as all decode specs now pass
+
+commit 89c1026cecbb9fcd09a62139e2d28b24b5658c25
+Author: David Whittington <djwhitt at gmail.com>
+Date:   Mon Jan 7 01:37:10 2008 +0000
+
+    Added args to NoMethodError raised by Object.method_missing
+
+commit 0e4a02f0e2fede5d785b15a6b34c582c6ba586f1
+Author: Ryan Davis <ryand-ruby at zenspider.com>
+Date:   Sun Jan 6 12:43:14 2008 -0800
+
+    Removed redundant Bignum#to_s. Moved private radix_to_s to bottom. Cleaned up to_s spec a bit
+
+commit 48446c40a759d60b7465d82b40f2911d0f7e444b
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Sun Jan 6 13:45:22 2008 -0600
+
+    Add some additional Math.asinh specs from JRuby.
+
+commit 7c81ca307cd01d3752a08487bc3742c8452d61c4
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Mon Jan 7 00:41:10 2008 +0800
+
+    Add failing specs for Time.{local|mktime|utc|gm}
+
+commit 35816e118b327a150a2d26638f289633f5e51f16
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Sun Jan 6 17:56:23 2008 +0800
+
+    Add spec for Time.local to handle string arguments (excluded for now)
+
+commit f9f36f5bb99ddb62e15cb9a9ddd98414e3df93e2
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Sat Jan 5 23:44:33 2008 -0800
+
+    Allow Regexp to match nil.
+
+commit e650c39627b81498fc97c51725f2ac1277870e15
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Sat Jan 5 23:38:52 2008 -0800
+
+    Add some IO#read specs
+
+commit 20257ecce0d3161fae7ac78454f2b8672f2c1de3
+Merge: bc576b8... e549cc5...
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Sun Jan 6 14:45:13 2008 +0800
+
+    Merge branch 'master' of git at git.rubini.us:code
+
+commit bc576b8e26fdb43d050df4fe3ad5ed974ec85057
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Sun Jan 6 14:44:44 2008 +0800
+
+    Fix handling of string-like second parameter to Time.local
+
+commit e549cc53a4905f21082a97cd6bcb279ace6d9eae
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Sat Jan 5 22:31:42 2008 -0800
+
+    Don't shift more bytes than available in the Buffer.
+
+commit 71285a2a9a8d0d3e71c678872ff2a146d5b2dc16
+Author: Chris Shoemaker <chris.shoemaker at cox.net>
+Date:   Sat Jan 5 22:53:51 2008 -0500
+
+    Fixup the Process specs for setpgrp, getpgrp, setpgid, and getpgid.
+
+    They no longer may unwarranted assumptions about the relationship
+    between a progress group ids and process ids.
+
+commit 7b57b3ac6df612f81d60d3a31b030ba054b357a6
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Jan 5 13:22:51 2008 -0800
+
+    Patch from Brandon Mitchell for #195, Float#to_s bug.
+
+commit 70ddfd43fd727122f56e8bdfcf3febd1ac1b5479
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Fri Jan 4 01:01:11 2008 +0800
+
+    Fix for Time#yday spec when Time.at might return yday+1 depending on tz
+
+    * Wrapped Time.at in a with_timezone("UTC") for consistent results
+
+    Signed-off-by: Brian Ford <brixen at gmail.com>
+
+commit 7d4396e4e69fb7b046efdaaf87d1090a02c883a0
+Author: Kamal Fariz Mahyuddin <kamal.fariz at gmail.com>
+Date:   Fri Jan 4 02:26:38 2008 +0800
+
+    Fixed Array#fill behavior when passed index and negative count
+
+    * Added additional spec when negative count is acceptable
+    * raise ArgumentError when negative count absolute value exceeds index
+
+    Signed-off-by: Brian Ford <brixen at gmail.com>
+
+commit 8af2b55313eb55082df6a71cd3e6bd865f2901fc
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Sat Jan 5 13:33:26 2008 -0600
+
+    Save mtime during file creation to make mtime spec more reliable.
+
+commit 7043933af0475370462984c8d2df2b9301e58cfa
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Jan 5 00:45:01 2008 -0800
+
+    Updated CI excludes after spec description changes.
+
+commit 3d7650100ba1756a4d67be8044e31498ea96d88e
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Jan 4 21:13:28 2008 -0800
+
+    Multitudinous style cleanups in spec description strings.
+
+commit d54ed8791a74661adb87c938e92e037ece924c90
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Sat Jan 5 00:29:22 2008 -0800
+
+    A real, working eval and friends.
+
+    * Implements binding, eval, etc.
+    * Passes all eval and instance_eval specs currently
+
+commit 02ad19ab4132bf5d3ae35c2e11fa1a963d1f1805
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Fri Jan 4 00:25:39 2008 -0800
+
+    Fix a few more String specs, fix Integer()
+
+commit d67cfbcf4e7d35641de555ac1edd61b51780def8
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Fri Jan 4 19:16:43 2008 -0800
+
+    Make class variables work with inheritance.
+
+    Move class_variable* to Module.
+
+commit d79836e04d72796b723cdaab228871c87abe064a
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Fri Jan 4 16:26:21 2008 -0800
+
+    Replace Struct with a Struct that can be subclassed
+
+commit 8efb042a9c160af9e9c177ca14aed220dedcc26f
+Author: Ryan Davis <ryand-ruby at zenspider.com>
+Date:   Fri Jan 4 15:41:43 2008 -0800
+
+    Finished |*args| spec. Fixed MethodDescription and TestGenerator inspect methods
+
+commit 76cc487434f6cd9d60356560f1bbc3fba000397c
+Author: Ryan Davis <ryand-ruby at zenspider.com>
+Date:   Thu Jan 3 16:54:56 2008 -0800
+
+    Fuck you git. Adds a broken spec to compiler2/masgn for splatted goalpost arg
+
+commit dd2697b602a732e3e00c131f54f9cc557ae0cbe3
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Fri Jan 4 15:40:50 2008 -0800
+
+    Failing spec for case when with an empty body
+
+commit 22dcedebd484f655bba51399e38e83c5a14d4053
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Jan 4 18:31:48 2008 +0100
+
+    Added Time#local specs with string-like second arg.
+
+commit 43ff733a3097fff44ba8a12334f20a1bf77a965f
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Thu Jan 3 23:54:34 2008 +1100
+
+    CompiledMethod#decode now uses local variable names (if avail)
+
+    * CompiledMethod#decode now looks in the bonus tuple for the names
+      of stack and slot local variables
+    * Moved compiledmethod specs to spec/core/compiledmethod
+
+    Note: Compiler2 appears not to be setting the bonus tuple, so code
+    compiled under it cannot decode local names at present.
+
+commit 06006ec2a053ae49b243fa0aa98fc71c2ea7a524
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Jan 4 01:24:49 2008 -0800
+
+    Updated CI excludes.
+
+commit dff2e75df3c371522b6a3ba4495d269bf793fe97
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Jan 4 01:01:24 2008 -0800
+
+    Updated CI excludes for Bignum.
+
+commit 569fa3b9fc81410ce9fe6568427f0a0bc65b7036
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Jan 3 19:26:22 2008 -0800
+
+    Updated CI excludes for String, Regexp.
+
+commit 7aedec383850eacad5db8248bfcea7615a3d1793
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Thu Jan 3 17:48:32 2008 -0800
+
+    Fix up setrlimit/getrlimit on darwin
+
+commit d9aea8bba7276b53ca7c18b8625531be389d2cdc
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Thu Jan 3 16:40:09 2008 -0800
+
+    Refactor $~ out as a global, into Regexp.last_match directly
+
+    * Uses MethodContext to store $~ now, so it's method local.
+
+commit c19dde305fd751c14a1b4dc798557e0b63c08c8d
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Thu Jan 3 16:25:54 2008 -0800
+
+    Clean up compiler2 specs
+
+    * For is still broken, needs more love
+
+commit d02603a7e225d3b48ecf7899ea74768880aba7ec
+Author: Gregor Schmidt <ruby at schmidtwisser.de>
+Date:   Wed Dec 12 16:56:11 2007 +0100
+
+    Add default implementation of Module#method_added
+
+commit 7ba5d1478106e4e0f5fcf21c66029df2f38d7e2f
+Author: Chris Shoemaker <chris.shoemaker at cox.net>
+Date:   Sun Dec 30 17:55:21 2007 -0500
+
+    Unquarantine Process.kill specs.
+
+commit d68b380bdd2e0a0ec3bd968ffabd02f6e30a3aa1
+Author: Chris Shoemaker <chris.shoemaker at cox.net>
+Date:   Tue Jan 1 22:14:59 2008 -0500
+
+    Improve kill, wait, detach, and setpriority specs for Process.
+
+    Restore any previously installed signal handler after the spec has run.
+
+    User IO.read(1) instead of IO.getc since rubinius has it implemented.
+
+    Fix a failing Process.detach spec uncovered by the raise_error fix.
+
+commit da7329d094b6ff437d37e6a1fcaf93883ac9172f
+Author: Chris Shoemaker <chris.shoemaker at cox.net>
+Date:   Mon Dec 31 16:23:24 2007 -0500
+
+    Add specs for Process.setrlimit, Process.getrlimit, and Process.setsid.
+
+commit 42bef2feb46434b0ea67bc3f93d941d587c2d9c9
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Jan 3 12:46:57 2008 -0800
+
+    Updated Process spec excludes.
+
+commit ca98172b8a923cce1691b0fcc5d2418417d82662
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Jan 3 10:07:55 2008 -0800
+
+    Update CI excludes for IO from Evan's fixes.
+
+commit cde20d6c32156e4fc06859f1e84414f81f5af69e
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Wed Jan 2 23:40:59 2008 -0500
+
+    Fixed #require specs.
+
+commit 06d99a2ac4be06b50848056b381c91531293a49e
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Thu Jan 3 01:12:29 2008 -0800
+
+    Add read buffering to IO, passes 100% of IO specs
+
+commit 86170283715371b5a87c0518f89c2b882a49bc93
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Thu Jan 3 01:21:52 2008 -0600
+
+    Fix off-by-one on a few signal values. Doh!
+
+commit c7a64b10410308cec83077a66cda5859b326f296
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Thu Jan 3 01:13:27 2008 -0600
+
+    Modify Signal.list spec to not depend on hash ordering.
+
+commit f2980d9584c08d873cf1646c281d083946bcbc6c
+Author: Nitay <nitay at powerset.com>
+Date:   Wed Jan 2 14:36:56 2008 -0800
+
+    Module#autoload:
+      * raises a NameError when an invalid constant name is given
+      * raises an ArgumentError when an empty filename is given
+      * does not autoload when the specified constant was already set
+      * registers the given filename to be loaded the first time that the Module
+        with the given name is accessed
+
+commit e68bd05defe5ab749110af507c86769c9a036b25
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Wed Jan 2 19:04:48 2008 -0600
+
+    Removing 'Range#initialize can't be called twice' spec.
+
+    Evan agreed that these specs aren't useful, and I don't believe they're
+    within the bounds of reasonable language specification since they're
+    going around visibility and testing behaviors no sane programmer would
+    ever be able to see.
+
+commit 1870720bac174feb627654f08c1749e1666c2acc
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Wed Jan 2 18:54:33 2008 -0600
+
+    Fix inspect spec to guarantee the target thread is actually sleeping.
+
+    A reminder for folks adding Thread specs: You *CAN NOT* know that a target
+    thread is sleeping unless you are polling for status == 'sleep'. No amount
+    of channel, lock, or state variable tricks will get around that. Please
+    use polling if you want to guarantee a target thread is asleep.
+
+commit df3057a541862bbd1c5c72b8626bb591bb5ae6fd
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Wed Jan 2 16:39:37 2008 -0800
+
+    Refactor Module#undef_method spec to #respond_to? and #instance_methods.
+
+    Now only method dispatch is tested for #undef_method.  #respond_to? and
+
+commit d2ecd4119a152370210ccb6c2a816c9dccb9fe90
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Wed Jan 2 16:00:09 2008 -0800
+
+    Fix Rails indenting and whitespace
+
+commit f5b8afee4931bd09b0ce9fb88fc959c2ea0a1743
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Wed Jan 2 15:30:41 2008 -0800
+
+    Fix Module#undef_method and Module#instance_methods
+
+commit 82bf31562361a21f85a90d5628a40ff50280c555
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Wed Jan 2 14:10:35 2008 -0800
+
+    Rebuild excludes for #eof?
+
+commit b2aa0d56b04d7da5d333ba1449acda7c0b64c0c4
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Wed Jan 2 14:09:21 2008 -0800
+
+    Add IO#eof? spec.
+
+commit addeb47d834d1ce60f8146f747defacf1682e6c4
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Jan 2 22:31:30 2008 +0100
+
+    Removed JRuby spec excludes.
+
+    The JRuby excludes will reside in JRuby repository.
+
+commit 3239661ed5c38b37c966588341a043d6cdd9445b
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Jan 2 21:28:11 2008 +0100
+
+    Corrected String#modulo tests after clarifications from ruby-core.
+
+commit a0f3ba6632f8486e8f07a21a8e4720d8727ba4d2
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Jan 2 11:28:42 2008 -0800
+
+    Fix require_spec_recursive on Ubuntu.
+
+commit 857c39564df2d8da480f549fff46ec3ab880066e
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Jan 2 00:48:53 2008 -0800
+
+    A couple fixes. Updated CI excludes for last couple failures.
+
+commit 58c48ed05b493c71ee445062f27d47909e18b395
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Jan 1 23:49:14 2008 -0800
+
+    Updated CI excludes.
+
+commit 426f5a15eaac05ed1e900433837de0b9d0246c8d
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Jan 1 22:43:47 2008 -0800
+
+    Moved CI excludes files from .spec dirs to spec/data/*.
+
+commit a1d6211f3185f23cbc2c929f0352feca05fd079c
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Jan 1 22:03:43 2008 -0800
+
+    Moved ruby specs to spec/ruby/1.8/...
+
+commit af55eefd29c8acaf462efe03d2e0b3d95195cb21
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Jan 1 21:44:35 2008 -0800
+
+    Updates for bin/ci and bin/mspec.
+
+    * Removed -2 switch from both because compiler 2 is default.
+    * Added CI_EXCLUDES_DIR and -E switch to bin/ci to allow for
+      specifying the exclude directories. The default is '.spec'
+      in each directory containing spec files. Use a path starting
+      with a '/' to create the exclude directories relative to
+      that path, otherwise the exclude directories are created
+      relative to the directories containing the spec files.
+    * Moved spec/excludes.txt to spec/data/critical.txt
+
+commit 0e6645eb74f1f63b84f674dbcdfa991153a3ccd0
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Wed Jan 2 12:10:39 2008 +1100
+
+    Couple of Breakpoint changes
+
+    * Raise ArgumentError if no block given (spec for this
+      existed, but was masked by RaiseErrorMatcher bug)
+    * Added line property to Breakpoint
+
+commit 36a7acddfe74ab25895d13dd775741b042ba3b0c
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Tue Jan 1 23:10:13 2008 +1100
+
+    Reorganise breakpoint specs to new dir layout
+
+commit 8aa6712dd9e5e870194f77ff74dc8cf11c273805
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Fri Dec 21 16:15:19 2007 +1100
+
+    Refactored BreakpointTracker in preparation for debugger
+
+    * Moved code from debugger.rb to breakpoint.rb
+    * Refactored code extensively to support debugger
+    * Added breakpoint specs
+
+commit d16e905a67d64f67d7a24ce113f39b4b059c4139
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Dec 31 17:51:59 2007 -0800
+
+    Removed the rubinius dir from specs. It was redundant.
+
+commit 85ed07b6d739f013892a6cbcae5d0bb2c19f6e80
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Dec 29 15:45:31 2007 -0800
+
+    Split Ruby specs proper from Rubinius specs.
+
+commit b8e1466dc1b814bfb2022c1e4319d5ba63f5d762
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Dec 29 15:02:55 2007 -0800
+
+    Updated guards in specs.
+
+    * Changed guard names to new, more descriptive names.
+    * Removed all #extended_on guards for Rubinius-only specs.
+
+commit 5773ebe9e6f78abec9bfb03f144b5c7a86a27c7e
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Dec 29 00:50:56 2007 -0800
+
+    Changed Float constants specs to compare against precise values.
+
+commit 71874fcdc9eaf45a5adecf57d7609831a2a8e6c2
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Sat Dec 29 17:26:06 2007 -0600
+
+    Fix dump_spec to expect 1 or more write calls, rather than exactly 1.
+
+commit d4bfb39910aa4adf2c0c4e2dee214487bac34093
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Sat Dec 29 14:51:38 2007 -0600
+
+    Add a spec for procs being block-passed and some peculiarities therein.
+
+commit 1b0333479bf6da2c76c8d3c1e1640dc156086d9f
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Dec 28 08:24:30 2007 +0100
+
+    Improved ObjectSpace#each_object spec test.
+
+    Previously, the test was failing from time to time,
+    depending on Garbage Collector behavior.
+
+commit 3d7e628acc6699f9652383317bd416d8c75329d5
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Fri Dec 28 05:27:24 2007 +0100
+
+    Updated Time specs to use new :os guard.
+
+    The Time specs use this :os guard to properly detect
+    which external program with proper parameters to invoke.
+
+commit 7662638e9afa631f0581fc1c2b2b422b1b926f98
+Author: Jeremy Roach <jero_rub at yahoo.com>
+Date:   Sat Dec 29 03:06:51 2007 -0600
+
+    adds Marshal.dump specs
+
+    for nil, true, false, String, Symbol, Fixnum, Bignum
+
+commit 93431a28d687372b95f1a1420a3bd1f24e660117
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Sat Dec 29 00:15:44 2007 -0600
+
+    Guard Continuation specs to not run on JRuby (JRuby does not, will not support continuations)
+
+commit ccf745b9eafe068de6f888de24387bc0a0e68859
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Sat Dec 29 00:08:04 2007 -0600
+
+    Fix for Fixnum size spec to guard "java" platform with 8 byte size
+
+commit 6f448f0dd72b5df2cc69e28db3d5593f897a9dbd
+Author: MenTaLguY <mental at rydia.net>
+Date:   Sat Dec 29 00:58:58 2007 -0500
+
+    a more modest spec for Thread.pass
+
+commit b32c2d95d044a4979ab92b5881e32fc8b169d931
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Fri Dec 28 23:51:10 2007 -0600
+
+    Adjust Float MAX spec tolerance to work on both JRuby and MRI, since there's a few powers of precision difference.
+
+commit af7bb00beeb359fd6183def039b9a1fcd0ce7c48
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Fri Dec 28 23:39:15 2007 -0600
+
+    Expand Float divmod array equality comparisons to use be_close with a default tolerance.
+
+commit dbdf373751bce2c8a334315c8c5ed21458614c70
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Fri Dec 28 23:34:09 2007 -0600
+
+    Add a tolerance to the Float induced spec around the same scale as the value under test.
+
+commit a713d277e6a8148d4c53b66a3a8fa3aedbd6a108
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Fri Dec 28 23:31:25 2007 -0600
+
+    Modify Float multiply spec to be_close with a TOLERANCE multiplied by a similar scale as the value under test.
+
+commit b82d8af43356de31d16b1c36296d9e819ce70d46
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Fri Dec 28 23:13:38 2007 -0600
+
+    Fix Module class_variables spec to sort the variables before checking if they are all there.
+
+commit 1e60a25b57273dd6fd7e21b0a443da1f5c0be9e5
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Fri Dec 28 19:44:51 2007 -0600
+
+    Mark Process#fork specs as not_compliant_on jruby.
+
+commit 021a6ff317ed826a46ca2168f4ee9c7540a27214
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Fri Dec 28 19:19:14 2007 -0600
+
+    Remove fail and "failure" guard around the require/extension spec, since an unimplemented spec isn't necessarily a failure of any kind.
+
+commit 520c423860ef6553dae34eefd85188ab9b4773f6
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Fri Dec 28 19:12:52 2007 -0600
+
+    Modify previous compliance change to callcc spec to use not_compliant_on instead.
+
+commit ab85bfff2f9fea8e28f9518311aacccd30f380dd
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Fri Dec 28 17:56:42 2007 -0600
+
+    Remove compliance guards on identical spec's link/unlink, since they don't blow up now and JRuby supports them.
+
+commit e79c8af0ad6fb7ddf094b6ba4747932145f9b89b
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Fri Dec 28 15:19:24 2007 -0600
+
+    Removing "fail" and "failure" wrapper from unimplemented "loads extension files" spec; an empty or unimplemented spec is not a failing spec.
+
+commit 0f6b7387bcc8df946ec8d7504cc3935b6d0f9c58
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Fri Dec 28 15:06:07 2007 -0600
+
+    Add compliance to callcc specs, so JRuby doesn't run them (since it never will)
+
+commit ed43292ce58468e31b771eb4926a39dff8d70793
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Fri Dec 28 14:48:45 2007 -0600
+
+    Make umask spec work with different host process starting umasks, clean up literals to be easier to read through.
+
+commit 7e9f96741739e544c547f2898e8b5183dec87323
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Fri Dec 28 14:43:02 2007 -0600
+
+    Fix goofed-up paths in requires for rubinius-specific Integer spec
+
+commit d54fb1e7c3f586a6d8ac200d6de839ebe6cb4c46
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Fri Dec 28 14:40:50 2007 -0600
+
+    Move rubinius-specific spec from core/kernel/Integer_spec to rubinius/core/kernel/Integer_spec.
+
+commit eb561025707736ebe196eab3b4ff2bd1c98f45a4
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Dec 27 23:51:42 2007 -0800
+
+    Fixed language/block specs to guard ruby18 feature.
+
+commit 5659d057d756effe3acba1037d0ad6d638d930dd
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Dec 27 22:58:17 2007 -0800
+
+    Changed Bignum specs to use value suitable for all implementations.
+
+commit 2646b1a17f898f05233622c9251c3c36632e82a7
+Author: Jeremy Roach <jero_rub at yahoo.com>
+Date:   Thu Dec 27 23:43:42 2007 -0600
+
+    implements m directive for String#unpack
+
+    moves a couple misplaced methods from Numeric to Integer
+
+commit 496d6761d7377081ff76b263a51bb39d0e30d80a
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Dec 26 18:07:45 2007 +0100
+
+    Marked one Rubinius-specific Kernel spec test as such.
+
+    Kernel#compile is not official part of Ruby.
+
+commit 50e35293bd3a117874203a75d214c3435170e5d3
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Dec 26 17:43:03 2007 +0100
+
+    Corrected String#pack with 'DEFG' pattern test.
+
+    Now, numeric comparison of values is used, with precision,
+    not literal string comparison.
+
+commit 0ef00fe14a04ef240fcca17d15271f92f2a44525
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Dec 26 16:00:20 2007 +0100
+
+    Added String#inspect test case with malformed UTF-8 string.
+
+commit 5bbde0cda03ea782090586a9afdb620663633456
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Thu Dec 27 13:30:34 2007 -0600
+
+    switched ThreadGroup specs to use Channels
+
+commit e3abd8b834b9f923d94ae381e81977feb4a4f6f8
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Thu Dec 27 13:22:20 2007 -0600
+
+    added Thread#stop? and fixed Thread#status + specs for Thread#status
+
+commit f8835353bc8be47760f70811616991463e4e681e
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Dec 26 09:18:24 2007 +0100
+
+    "Unexcluded" one Struct spec test for JRuby.
+
+commit 8a1b127cb33e43b916b0ccd820c6e16680cd4030
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Dec 26 09:12:23 2007 +0100
+
+    "Unexcluded" 6 Hash tests for JRuby.
+
+commit ae4ce805fb7611ea6de12b01b2500f501b54bd6a
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Wed Dec 26 09:01:35 2007 +0100
+
+    "Unexcluded" 27 Array tests for JRuby.
+
+commit c84540f96d7e265732a204ed72b3873545624444
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Dec 27 00:08:06 2007 -0800
+
+    Fixed Set#delete? spec to actually call delete?.
+
+commit e137c3279f511b49442ce2cea1b1832c1a0c6ab0
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Dec 27 00:00:56 2007 -0800
+
+    Added some specs for Set.
+
+commit 8054ed86a93a72ad4629d6f52455892d620138b0
+Author: Nitay <nitay at powerset.com>
+Date:   Tue Dec 25 17:30:56 2007 -0800
+
+    require should prevent recursive includes infinite loop
+
+commit 23fb497a7ba2a853cbdc5e8a38b091df284a377e
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Dec 26 16:50:22 2007 -0800
+
+    Updated status output options for bin/ci and bin/mspec.
+
+    * Made dotted the default output format for bin/ci.
+    * Added -m MARKER option to ci and mspec.
+    * Added "Started" output as requested by autotest folks.
+
+commit 036b073753763afe86330d3f7fa0f61d755ac991
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Wed Dec 26 10:41:01 2007 -0500
+
+    Moved class fixture back to spec/fixtures/.
+
+commit 91d46b86a86270bb3174909a2d5cbc343ea138c7
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Tue Dec 25 19:20:18 2007 -0500
+
+    Added specs for $~, $&, $`, $', $+ and $1..N.
+
+commit c434614505511b8816548efcf4a4cf56d77220f4
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Tue Dec 25 19:19:11 2007 -0500
+
+    Improved language-level class specs, moved fixture.
+
+    * Class fixture copied to spec/language/fixtures/.
+    * Disabled unnecessary class instance variable check and added
+      new ones.
+
+commit 0a49f3485fe7e26cc7d7d5bc3cb800ddf9fd6231
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Tue Dec 25 19:13:22 2007 -0500
+
+    Changed strange_block_args_subspec.rb to block_args_subspec_strange.rb
+
+    * Name change to improve alphabetical sorting.
+
+commit 2ac50215dd32fd7ad2f2c20c7ae06ed73dc9f856
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Tue Dec 25 13:32:06 2007 +0100
+
+    Added tests for Array#pack with "U" pattern.
+
+    Note: The tests are exclided for Rubinius.
+
+commit 4c0993fa90010322bb823a9799a8b3ccdd585e2e
+Author: Jeremy Roach <jero_rub at yahoo.com>
+Date:   Wed Dec 26 04:07:02 2007 -0600
+
+    return excluded spec
+
+commit 0a69d9cd5a7d3a0be9411fa00c4eeebe5d270a0c
+Author: Jeremy Roach <jero_rub at yahoo.com>
+Date:   Wed Dec 26 03:55:43 2007 -0600
+
+    implements @AM directives for String#unpack
+
+    squashes bug in a regexp where an alternation of things
+    between begin and end assertions wasn't wrapped in group delimiters
+
+commit ddda4d49f5535577c147d2154ecdae7cb4e32e24
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Dec 26 01:16:13 2007 -0800
+
+    Moved Kernel#load/#require fixtures to spec/fixtures.
+
+commit 0438e9e61c5958c5daf691b025e34bc79e7b2573
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Dec 26 01:06:12 2007 -0800
+
+    Reorganized specs to group all Rubinius specs under spec/rubinius.
+
+commit a4c3e286e44ee3df88395b9b5f44d5804154ed2b
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Dec 25 19:32:55 2007 -0800
+
+    Updated CI excludes.
+
+commit 8535481571712cf8c35f437c42ec53dcbfd44bc0
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Dec 25 15:52:53 2007 -0800
+
+    Enhanced guard for detecting :ruby, :ruby18, :ruby19 engines.
+
+    Changed dir specs to create the fixture directories with every
+    run to prevent pollution of the directories from causing spurious
+    errors.
+
+    Added spec/core/dir/fixtures/mock to .gitignore.
+
+commit a6b07ec37da7a59f34f45dfc84a66729b12f63b7
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Dec 24 16:25:16 2007 -0800
+
+    Removed Dir specs mock directories from version control.
+
+commit b0e4addbf7c6505c760e143e5fac0dab0109d8ac
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Tue Dec 25 13:17:28 2007 -0500
+
+    Updated CI excludes for Dir.
+
+commit 80a9c6c2e2e5cd2acdcb6492c4a06fef258bb49e
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Tue Dec 25 13:17:09 2007 -0500
+
+    Moved Rubinius-specific parts of #load/#require specs to extensions.
+
+commit 85f6b6e24518868f39ff39a5014a41a233237671
+Author: Jeremy Roach <jero_rub at yahoo.com>
+Date:   Tue Dec 25 02:53:45 2007 -0600
+
+    implements U directive for String#unpack
+
+    uses only one of the exception messages every time
+
+commit b414c94db1fa1af8e6cd3382c34fc6de5ed3bd1e
+Author: Kevin Clark <kevin.clark at gmail.com>
+Date:   Mon Dec 24 16:42:22 2007 -0800
+
+    Merge identical specs
+
+commit e0f28c224a2348dbf7c005694971a86f8e6162e1
+Author: Kevin Clark <kevin.clark at gmail.com>
+Date:   Mon Dec 24 15:59:24 2007 -0800
+
+    Kernel.Integer() shouldn't pass a base to String#to_inum
+
+commit eb93da7c578599469fe209f7b1d30f0f77d148f5
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Sun Dec 23 16:43:33 2007 +0100
+
+    Wrapped one String#crypt case into compliant block for JRuby.
+
+    "hello".crypt("\x00\x00") is not really defined,
+    and heavily platform dependent.
+
+commit 7594c89cf2f017cb1fffad16bac6fcc7c9629422
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Sun Dec 23 10:53:30 2007 +0100
+
+    Added JRuby wrapper for String#% test.
+
+    Allow "%e" % (0.0/0) in JRuby to return "NaN", and not "nan".
+    I think, returning "NaN" is a proper behavior, and
+    it seems that MRI 1.9 is also following it.
+
+commit eaf9e328e81f9c1d4e80737a96d0eea6b511fabb
+Author: Jeremy Roach <jero_rub at yahoo.com>
+Date:   Mon Dec 24 06:55:30 2007 -0600
+
+    implements BbHhIiLlSs directives for String#unpack
+
+commit 701945421d6a656f8b0b183052c4535a895e2afd
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Dec 24 00:44:26 2007 -0800
+
+    Converted specs to use the new #platform guard syntax.
+
+commit 238fbbc2331a1926f3d3f447d8433b046e7d34ac
+Author: Tom Mornini <tmornini at engineyard.com>
+Date:   Sun Dec 23 15:43:26 2007 -0800
+
+    Clean up language on now understood and fixed alias_method e2mmap spec.
+    Fixing the alias_method problem has now uncovered something in const_set,
+    so I've included a very vague test (require 'e2mmap') to document the
+    problem until it's better understood.
+
+commit 69149b261ac13cc1a2b7c80c7b103d397fd96b9b
+Author: Tom Mornini <tmornini at engineyard.com>
+Date:   Sun Dec 23 14:13:22 2007 -0800
+
+    Add spec for alias usage that breaks e2mmap.rb
+
+commit 71d9a4144811b2c9c74edc55f348637c57b0cb84
+Author: Jeremy Roach <jero_rub at yahoo.com>
+Date:   Sun Dec 23 05:25:37 2007 -0600
+
+    implements aDdEeFfGgXx directives for String#unpack
+
+commit bebafb1383a5126c959c33a1336f3a2e4b6993f6
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Dec 22 18:16:14 2007 -0500
+
+    Saner specs for stream-style Dir access. Passes 1.8.6-p111.
+
+    * Dir#read, #tell, #pos, #pos=, #seek and #rewind which are a part
+      of the stream interface to Dir no longer rely on platform-specific
+      position values, instead opting to just ensure they work as expected.
+
+commit a2e4c318a3406c9532404611f14d2790695c0a7a
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Dec 22 16:29:00 2007 -0500
+
+    Enabled Time#at spec to work with BSD `date`.
+
+commit 0e983f2e948ab997834dbc703e9eeb11d86a7022
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Dec 22 16:17:14 2007 -0500
+
+    String#to_i spec to check for correctly parsing 0x-1 and the like.
+
+    * This was fixed in 1.8.6-p111.
+
+commit 5e635a46f4733bcc2071b52ea076584614fe5655
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Dec 22 15:52:03 2007 -0500
+
+    Fixed various String spec issues and added a few. Passes 1.8.6-p111.
+
+    * String#% with o for octal numbers is still broken but that seems
+      to be due to MRI's sprintf.c.
+
+commit 780f22bde03e280f5af2509bef260585341f4e0b
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Dec 22 15:48:55 2007 -0500
+
+    Fixed incorrect use of #should raise_error.
+
+commit 0b239b4f66c20ad5690e429639c4bf11a809ab58
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Dec 22 12:22:20 2007 -0500
+
+    Hash specs fixed. Pass under 1.8.6-p111.
+
+    * Changed to use HashSpecs#frozen_hash and #empty_frozen_hash
+      for clarity and being less error-prone.
+    * Fixed various typos causing problems.
+
+commit 9a2450e5c51333474cf012c3a1364e95384af9e0
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Dec 22 12:20:48 2007 -0500
+
+    Kernel.caller specs revised. Pass 1.8.6-p111.
+
+    * Fuzzier matching of the data in the call stack.
+    * Fixed specs for omitting frames.
+
+commit 692f4e8a652e273096c0f77ffe571318c59d2b12
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Dec 22 10:59:19 2007 -0500
+
+    File.ftype specs pass on 1.8.6.
+
+    * Use `find` to locate specific file types instead of relying on
+      predefined paths being correct.
+    * Re-enabled character devices.
+    * FreeBSD does not implement block devices.
+
+commit f1251ebc602311ec305a4b1b35a765ee45b9c164
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Dec 22 10:11:07 2007 -0500
+
+    Bignum#div returns an Integer if evenly divided.
+
+commit b62e1b7a21df1d7736767530f216148b8a93e38a
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Dec 22 09:52:33 2007 -0500
+
+    Fixed Array spec failures under 1.8.6-p111.
+
+    * Array#fill raises if given a negative count.
+    * Array#initialize will always raise if frozen.
+
+commit e3d6a3df6c1dfc37731ff4de5de32dc996bb61bb
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Dec 22 09:37:46 2007 -0500
+
+    Silence warnings from removing *.rbc in #load and #require specs.
+
+commit a11171e853b3efb94b4cba03786ea851d81411c6
+Author: Jeremy Roach <jero_rub at yahoo.com>
+Date:   Sat Dec 22 07:39:40 2007 -0600
+
+    implements CcQqVv directives for String#unpack
+
+commit eea90994f2a1b76ed11b29e05a16c9c299d59235
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Dec 22 00:23:29 2007 -0500
+
+    Added __FILE__ specs to #load.
+
+commit 0e04ca49ebdba35a7a293b6de82d9d67c6ff4ac5
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Fri Dec 21 22:59:50 2007 -0500
+
+    Correct __FILE__ information from #load and #require.
+
+commit 51c2543fe032b680a6c8f8cf8121196070c61c66
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Dec 21 23:51:37 2007 -0800
+
+    Replaced use of @path1 with equivalent nil in File#fnmatch.
+
+commit b9f979393456dc3c93250e3a50b54b489a25c5d1
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Dec 21 23:29:51 2007 -0800
+
+    Added -w to bin/mspec to emit warnings. Fixed warning in mSpec.
+
+commit 16ce249216f490b9f7921aa69932f9e8bd60ca0e
+Author: Jeremy Roach <jero_rub at yahoo.com>
+Date:   Fri Dec 21 22:50:40 2007 -0800
+
+    Implements N, n, and Z directives for String#unpack.
+
+    Signed-off-by: Brian Ford <brixen at gmail.com>
+
+commit e1d292e28fe409c087f314bb139371a1f248850d
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Thu Dec 20 15:04:12 2007 +0100
+
+    Fixed race condition in ThreadGroup#add specs.
+
+commit 469527ddf33484a4a77f3d73c611e9a393bd48ad
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Fri Dec 21 12:02:50 2007 +1100
+
+    Added CompiledMethod#decode specs
+
+    * Added UnboundMethod#compiled_method accessor
+    * Improved robustness of ISeq decode when dealing with junk at
+      the end of an iseq
+
+commit 08c2f5c29a2debed90ae1fff817c30e269913609
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Thu Dec 20 23:45:53 2007 -0500
+
+    Re-enabled purging .rbc files in require_spec and fixed the masked problem.
+
+commit dd4f3c52e79d01e826918e49fa626d7358f87901
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Thu Dec 20 22:53:48 2007 -0800
+
+    Clean up a couple of failures seen in ci. spec/core passes.
+
+commit a5667632ae8d112c0271e00cbba53a274075cd1a
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Dec 20 22:49:05 2007 -0800
+
+    Removed legacy, unused spec/reports/base.txt.
+
+commit 853e100b6f7fff24e4aaa40ed30c6add523f8df2
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Thu Dec 20 17:49:36 2007 -0800
+
+    Fix a bunch of String specs (thanks random8r)
+
+    * Note: rubinius now has the same behavior as MRI for Nan,
+      Infinity and -Infinity when using String#to_f
+
+commit b220f4921fd799ac28c60132ca08cf16df6f713e
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Thu Dec 20 15:37:25 2007 -0600
+
+    fixed require specs to work correctly on any run including first
+
+commit 56ac483e3559e1d4913e4c36c9a8f007523fdab0
+Author: Hunter Kelly <retnuh at gmail.com>
+Date:   Thu Dec 20 19:36:21 2007 +0000
+
+    Fix typo in spec/core/regexp/union_spec.rb
+
+commit 634300eed40ef0ded16ab7cac7865dd783486c2d
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Thu Dec 20 03:46:59 2007 -0600
+
+    Add 'sleep' checks to threadgroup spec to avoid the same race conditions seen in kernel/sleep_spec.
+
+commit 72b7123c9b3d1d266f4ce035b4e99dd0c2dbd88d
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Wed Dec 19 22:46:17 2007 -0500
+
+    New compliant (moreso, anyway) #load and #require.
+
+    * Improved #load and #require.
+    * Specs for the above.
+    * File.to_sexp and String#to_sexp allow empty input. They are
+      processed as a file containing 'nil'.
+    * Archive#get_object_fuzzy allows no extension or .rb instead
+      of .rbc only.
+
+commit fe633062095096fe00599cbb89aa4370ab5ccb3e
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Wed Dec 19 23:03:08 2007 -0800
+
+    Fix Kernel#puts
+
+commit 364ca08cbbb1848b549d99deb11e2449ad99334a
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Dec 19 23:10:17 2007 -0800
+
+    Updated CI excludes.
+
+commit 5f1c381560a8d4d594749d42b5b2feeec341d4e5
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Wed Dec 19 22:24:10 2007 -0800
+
+    Fix Kernel#open
+
+commit 3b3ed6304deab01cb448665c5f4b17d813f04e65
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Wed Dec 19 21:43:58 2007 -0800
+
+    Cleanup more method specs, all pass on rubinius now
+
+commit 76bbbf275f4e835444f684b2e688b292f20c1ffe
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Wed Dec 19 18:08:09 2007 -0800
+
+    Implement protected methods
+
+    * Added a bit more verbose specs to methods_spec.rb, to show
+      specific cases.
+
+commit dce06b35481bb1951c587d36f63abaae069d0ae4
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Tue Dec 18 22:28:30 2007 +0100
+
+    Wrapped one String#unpack test case into compliant block.
+
+    The test case is platform-specific, and not suitable for, say, JRuby.
+
+commit bb4945ea7b9253150f753508e92633b6e355194a
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Tue Dec 18 21:30:24 2007 +0100
+
+    Added new String#unpack test to exclude file for CI.
+
+commit 1bd8beb8e0b335f1de309d6320312a1b64af1e4d
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Tue Dec 18 19:51:47 2007 +0100
+
+    Added more tests for String#unpack with Z/Z* patterns.
+
+    These patterns are known to be tricky, and their
+    handling was changed during Ruby's life.
+    See [ruby-talk:98364].
+
+commit d26edc2269a77667dbefcfb1ea6212d8ada9ef97
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Wed Dec 19 01:25:27 2007 -0800
+
+    Fix a bunch of Task GC problems, better memory management.
+
+    * Use ALLOC* macros instead of malloc/calloc directly
+    * Also, simple fix for Time
+    * A Kernel#loop implementation
+
+commit 4143b92e6112241ff2facd64047491ce579bf0e9
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Dec 19 00:43:32 2007 -0800
+
+    Finished converting Object.new to mock() in specs.
+
+commit 9cae61f827d2eeca0a744e551551efd6bc85a2ae
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Dec 19 00:02:46 2007 -0800
+
+    Spec #it blocks must be inside #describe blocks for RSpec.
+
+commit 7df00ef6d2471d0b37829e0a4d1ef45edf782a44
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Dec 18 23:28:43 2007 -0800
+
+    More conversion of Object.new to mock() in specs.
+
+commit 12463512d0ad48fae3a1843d9d409649551dd13b
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Dec 17 22:53:38 2007 +0100
+
+    Corrected String#* test to pick large enough Bignum, even on x64.
+
+commit 79cbff2c9a0cb15e9e5767f94242fa4360a0c4a0
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Dec 17 16:43:16 2007 +0100
+
+    Removed race condition from Kernel.sleep spec.
+
+    This problem caused JRuby spec runs to hang.
+
+commit 3032e60e10dd1ae61ffb40b351f4f6731395602b
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Dec 17 15:43:42 2007 +0100
+
+    Enabled one Hash#rehash test case for JRuby
+
+commit 1808106191856f4f82b948abc5c7e708a747d059
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Dec 17 15:40:49 2007 +0100
+
+    Issue #153: Hash#rehash test enforces unspecified impl detail
+
+    Wrapped the test so that it won't run with JRuby.
+
+commit efbf30477ea289911d9cafbde89ecbe2c8c65089
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Dec 17 15:25:23 2007 +0100
+
+    Corrected :mri --> :ruby
+
+commit 60a3ede3c64b62fb26905ed1c236c0e241b64515
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Dec 17 15:23:42 2007 +0100
+
+    Issue #182: String#to_f spec corrections for NaN, Infinity
+
+    JRuby AND Rubinius treat "Infinity".to_f, "-Infinity".to_f ,
+    "NaN".to_f differently than MRI.
+
+    MRI returns 0.0 in all those cases, but JRuby and Rubinius probably
+    do something more meaningful, they return Infinity, -Infinity and Nan
+    respectively.
+
+    It was agreed that JRuby's and Rubinius' behavior is a feature rather
+    than a bug, and worth preserving and checking for.
+
+commit 521a82d8c325a33b3409423d61b589c7b8681870
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Dec 17 15:14:28 2007 +0100
+
+    Refactored commonly used generators into fixtures.
+
+    Thus reducing copy-paste.
+
+commit 86820a339c74e3ca8fc9515e5fdf31ad42780201
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Dec 17 14:12:43 2007 +0100
+
+    Initial version of Generator specs.
+
+commit 91353183ace65d8e751db14a829e8f24d043710c
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Tue Dec 18 03:18:19 2007 -0600
+
+    updated excludes for Kernel#sleep and Thread
+
+commit 6de193c0819f74717eb2e9eff8480f0d801b0e41
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Dec 18 01:01:31 2007 -0800
+
+    Replaced Object.new with mock() where appropriate.
+
+commit 1217fa030ff26712e9718ebecfe351830c543d7e
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Tue Dec 18 02:16:10 2007 -0600
+
+    fixed redo in loop by save/restore condmod around loop context in compiler1
+
+commit df757142c774becfc2cbc4b38e43e31056acbae2
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Tue Dec 18 02:00:27 2007 -0600
+
+    spec for using redo,next, and break in one loop
+
+commit 7169fd31b7c22750241212c242bc8aacdafe632f
+Author: Vladimir Sizikov <vsizikov at gmail.com>
+Date:   Mon Dec 17 13:08:09 2007 +0100
+
+    String#sub specs wrapped to correct JRuby test failures.
+
+    JRuby reports Ruby version to be 1.8.5, but in this
+    particular case it behaves like Ruby 1.8.6
+
+    Differences between Ruby 1.8.5 and Ruby 1.8.6:
+    different error raised.
+
+commit 04e228e131d06cd764d69375ddfdf44e4fec2b38
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Tue Dec 18 01:27:00 2007 -0600
+
+    spec for Thread.pass and updated :mri to :ruby
+
+commit 11348e25ba30199e3beb05f8c38c18820fbefc3f
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Tue Dec 18 01:11:38 2007 -0600
+
+    Some minor fixes in Thread specs
+
+commit 5cb3bcbf8f1d2a2237200ca0a9a9c6408d478ad6
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Tue Dec 18 01:11:05 2007 -0600
+
+    spec and basic functionality for Thread.stop
+
+commit 3301fbb3ec43b5252c0aa6d45eb2f0e21581ff0a
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Tue Dec 18 01:09:49 2007 -0600
+
+    Thread.sleep doesn't even exist in rubinius
+
+commit bd964f579f84a39097ecee1271664d672b6553a7
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Dec 17 21:40:16 2007 -0800
+
+    Replaced :mri with :ruby for spec guards.
+
+commit d21810882621356c35dcd101daca5ee5549f6607
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Tue Dec 18 00:42:32 2007 -0600
+
+    Threads should report there status of sleep, aborting, and run
+
+commit 85a6476a236bd1e65d42ca03846c662a10842f37
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Tue Dec 18 00:41:09 2007 -0600
+
+    Thread#status should return nil if Thread terminates with an exception
+
+commit ecb4455a75f4af2ae0059ca4960c2282b4ec632a
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Mon Dec 17 23:50:24 2007 -0600
+
+    specs for Thread#{key?,keys} and added key type checks for Thread#{[],[]=}
+
+commit c1a5d7e52b33ba6686441c61652bcc41ae0547f8
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Mon Dec 17 22:15:37 2007 -0600
+
+    specs for Thread#[]
+
+commit c2c7f0adc6ebbad925adb2471b6064b67528b420
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Mon Dec 17 21:47:52 2007 -0600
+
+    ensure LocalThread#current != Thread.current
+
+commit d05dac276f36326e143aa75bb43e4ab07bd8ddc9
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Mon Dec 17 21:28:44 2007 -0800
+
+    Fix a bunch more Kernel specs
+
+commit 4ddd0e144b4e4f64c51fc8d64952826d92a5e83f
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Mon Dec 17 19:45:26 2007 -0800
+
+    Fix Thread.abort_on_exception and Thread#inspect
+
+commit a12ad6fbc2589a7864a7c784386fb6ce7dae1db1
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Mon Dec 17 21:29:49 2007 -0600
+
+    Kernel#sleep and Thread#join specs now use locks to maintain automaticity instead of while th.status == 'run' loops
+    added a Channel fixture to Kernel to support the use of locks in Kernel#sleep specs
+
+commit 72e3fb453c266e514b817daa66bf6033f1d19e40
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Mon Dec 17 19:01:18 2007 -0800
+
+    Fix callcc specs, revert all locals back to using the locals tuple
+
+    * compiler1 now does what compiler2 is going to do, ie, only use the
+      locals tuple to store locals. Storing them on the stack has proved
+      to be a pain, and wont be used further.
+
+commit 6e35be2ddef8d055e064462c88a8b3f33eb4fe0f
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Mon Dec 17 18:37:16 2007 -0800
+
+    Faster Class#new, initialize can be private
+
+    * Class#new now uses a bunch of inline assembly to be able
+      to call a private initialize
+    * Clean up Module#name a little
+    * Made machine's rbt a little more robust
+
+commit 47a5bbf34ef8a60a18c1c8c6130d493a299ff852
+Author: Hunter Kelly <retnuh at gmail.com>
+Date:   Tue Dec 18 01:10:33 2007 +0000
+
+    Make sure files opened with "w" are truncated.
+
+commit 0fdc8c9b7d05cc2e96908b280ac144de0d04f646
+Author: Hunter Kelly <retnuh at gmail.com>
+Date:   Tue Dec 18 00:16:27 2007 +0000
+
+    Fix excludes for spec/core/stuct/{new,struct}_spec.rb
+
+commit 5b1252e6b2d8f8d70343b06f3520114de2040524
+Author: Hunter Kelly <retnuh at gmail.com>
+Date:   Sat Dec 15 17:31:25 2007 +0000
+
+    Minor fix to struct_spec to include fixture.
+
+commit 4fd0356ab9e9bb5c2a805b1f863b3177458966fe
+Author: Hunter Kelly <retnuh at gmail.com>
+Date:   Sat Dec 15 16:29:49 2007 +0000
+
+    Add case to spec/core/class/new_spec for names of nested classes.
+
+    * Updated spec
+    * Add some comments where this may be fixed
+
+commit 86736d564f34a2f97f7c7bedcab09c2472861b01
+Author: Hunter Kelly <retnuh at gmail.com>
+Date:   Sat Dec 15 16:16:26 2007 +0000
+
+    Fixes for struct class names.
+
+    * Tighten up specs to show what class names should be.
+    * Fixes #inspect
+    * (Partially) solves the larger issue of an anon class getting a name when
+      assigned to a constant - works now when Module.const_set is called.
+
+commit ad0d5ff2396baf43c8b2e37a3132765a074b241d
+Author: Hunter Kelly <retnuh at gmail.com>
+Date:   Fri Dec 14 02:33:23 2007 +0000
+
+    Fixes related to Struct.new
+
+    * Fix to method_table to correctly handle DelegatedMethods
+    * Changed spec/core/stuct/new_spec.rb to allow :rbx to call
+      to_sym on objects passed to Struct.new to get the symbol
+      value.
+
+commit 18f10dc700fe24f3bd230063bc7c1e8a82e8348f
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Dec 17 08:58:22 2007 -0800
+
+    Updated spec excludes to run with bin/ci under the new mspec.
+
+commit 678fb90c5c8aa96e10a9f95f520312f12f8fa3f2
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Dec 15 22:43:44 2007 -0800
+
+    Changed true/false/nil specs to not use def in describe block.
+
+commit 9e132474aafb6a0f0c968c2e085b09bfc07e1a0d
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Dec 15 18:49:31 2007 -0800
+
+    Fixes to run the specs under RSpec and mSpec.
+
+commit cd3ecf52645b94921db92393e6e4d295d12bba88
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Dec 15 00:59:11 2007 -0800
+
+    Misc fixes to mspec. bin/mspec -t r spec finally runs!
+
+commit f3b3f70bb47b04e7a67c1dbc3ae38711857b5184
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Dec 13 22:46:54 2007 -0800
+
+    Multitudinous miscellaneous fixups for mspec and mmock.
+
+commit 55ab5b2ee42e4fabcfd8c51d6fac304cdfec31c7
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Dec 10 01:01:58 2007 -0800
+
+    Various fixes to mspec to run Rubinius specs.
+
+commit 86c0f131608b4ad7cba93eabd172a48e5b60ca0f
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Dec 7 15:34:06 2007 -0800
+
+    Added runner guards to omit specs that will always fail under RSpec.
+
+commit 75706dbfabbe359b6410f0d3743f0ea682146ac1
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Dec 7 14:03:46 2007 -0800
+
+    Added #runner guards to mspec.
+
+commit 3da390988031bf0066a849934ee758475ebbfa04
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Dec 7 02:38:13 2007 -0800
+
+    More fixes to run the specs under RSpec.
+
+commit 2b0f4e408b733dcd9089a19d78cd8e4cce20b99c
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Dec 6 18:40:33 2007 -0800
+
+    Yet more spec cleanup to run under RSpec.
+
+commit 1e4171d4682f55776e01e42f564714548c1d9bd9
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Dec 6 02:16:42 2007 -0800
+
+    More changes to run specs under RSpec.
+
+commit db020d30374e419792f76077757784008953c0a6
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Dec 5 02:01:30 2007 -0800
+
+    Various changes to get the specs running under RSpec.
+
+commit 968c2daa5345a0cddb8d3d5bd2b6bf2eeb0c1d6f
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Dec 4 23:51:52 2007 -0800
+
+    Convert remaining mocks to RSpec syntax.
+
+commit e5dc3ac814d1cda923131257dfbc9a30bf501b62
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Dec 4 23:28:17 2007 -0800
+
+    Convert remaining 'should_raise' to 'should raise_error'.
+
+commit a7be230ac71ece2bb8dcece72d629bcd0ce6a5e0
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Dec 4 18:29:26 2007 -0800
+
+    Converted specs from mini_mock to RSpec mock syntax.
+
+commit 4136e2fef4a81eb6e9e14070ff5301638f9acf14
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Dec 4 02:25:31 2007 -0800
+
+    Integrated mini mock with mspec. Updated spec_helper for main specs.
+
+commit d71c0c7412af01d6295d8caab43a80d0221ea16d
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Dec 4 01:49:17 2007 -0800
+
+    Added #shared and #it_behaves_like to mspec.
+
+commit da61adc0a079c858385773b12d683e2f5e2cc0e8
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Dec 4 00:43:15 2007 -0800
+
+    Converted 'should_be_ancestor_of' to 'should be_ancestor_of'.
+
+commit 5ed0096aac58fef09fc766d808aea74356aacfa8
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Dec 3 17:57:56 2007 -0800
+
+    Replaced dev_null with CaptureOutput.
+
+commit 62282bd5cb5c555e6447dcf2d6d0da355913fe8b
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Dec 3 17:30:01 2007 -0800
+
+    Replaced 'should_include' with 'should include'.
+
+commit f990a7c58a7eee6dbbb3c50df7682942048b959f
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Dec 3 17:21:50 2007 -0800
+
+    Replaced 'should_be_close' to 'should be_close'.
+
+commit c53601c56bd222dfacf03f134132869eb71c5146
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Dec 3 17:10:41 2007 -0800
+
+    Finished converting should_raise to raise_error.
+
+commit 165dd99535b0829d2e2364fac24375068969c6ab
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Dec 2 23:22:54 2007 -0800
+
+    Convert should_raise to should raise_error for RSpec compatibility.
+
+commit c9ff50a4b4be25614cc0ac2ea5540cfe87a939d3
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Nov 28 23:30:44 2007 -0800
+
+    Moved mspec out of spec dir.
+
+commit e9a40a77b6fa7d08969ea195aabbb930b665fe02
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Nov 28 23:25:59 2007 -0800
+
+    MSpec base formatter and specs.
+
+commit 2fc3ac3f8efbaf0861cadfd59bcdf926d2196284
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Nov 28 20:32:42 2007 -0800
+
+    Port fix to ruby engine detection from mainline.
+
+commit 9a52e660536b4723bf24e2717fec757a1bdfa49f
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Nov 28 01:35:52 2007 -0800
+
+    Match RUBY_NAME against /^ruby/ to pick up e.g. ruby1.8.
+
+commit 85536b98862f6abec310bfad03be17652ee65944
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Nov 28 01:01:46 2007 -0800
+
+    Implemented mspec matchers.
+
+commit c953335397c6c8b9d7b27a3d240fde3b3518cb48
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Nov 27 01:35:07 2007 -0800
+
+    The rest of the mspec big picture.
+
+commit 2f598f193eb1b10065c8e1a8d5c2aaa89c689072
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Nov 27 00:39:59 2007 -0800
+
+    Added base operator matchers and specs.
+
+commit 0cc0b5a97661970d4cbb5e46406e7ee06421e637
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Nov 26 21:03:33 2007 -0800
+
+    Migrated mspec and ci runners to mspec dir.
+
+    Created stubs in bin/ci and bin/mspec that call the respective
+    scripts in spec/mspec/scripts.
+
+commit b98d65eaa90d966fc2f7b8f8387266e241c202de
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Nov 25 01:03:26 2007 -0800
+
+    Added specs and guards for mspec.
+
+commit 7bb316d1291c9d0a16904d4a3ee60094a713f215
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Nov 24 21:40:46 2007 -0800
+
+    Prevent MSpec's #should(_not) from overriding RSpec's.
+
+commit c446988257a2104d72abd4a362dc21ca6183aab0
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Nov 20 22:47:25 2007 -0800
+
+    Defines #should and #should_not for mspec.
+
+    Specs for #should and #should_not.
+    Adds example for using mspec "base" layer.
+
+commit 1aecf8e828dfd3d86f43d8c9c927e7c0ccb16b68
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Nov 12 00:40:04 2007 -0800
+
+    The mini rspec big picture.
+
+commit f2979b03f29e7ac810b81f9087ea53923de5a35c
+Author: Charles Lowe <aquasync at gmail.com>
+Date:   Mon Dec 17 15:18:24 2007 +0100
+
+    Added missing error checks to Dir.chdir block form.
+
+commit 028fee4e6d48514cae53f87c143bb68501bf58e9
+Author: Chris Shoemaker <chris.shoemaker at cox.net>
+Date:   Wed Dec 12 20:01:35 2007 -0500
+
+    Add further specification of size changes during Hash#delete.
+
+    This was actually failing a while ago but now passes after recent
+    changes.
+
+commit f757f4359c86f778ac8e5931b8915511fd03506d
+Author: Chris Shoemaker <chris.shoemaker at cox.net>
+Date:   Wed Dec 12 19:59:28 2007 -0500
+
+    Tighten another spec in core/hash/equal_value_spec.rb
+
+    Hash#== compares keys with matching hash codes via eql?
+
+    This spec was using hash keys where key.eql?(key) was false.
+
+    That's pretty pathological, but there's probably some real
+    non-conformance with MRI here.  MRI can test for object identity
+    without calling eql? so a key is still found even if it doesn't
+    eql? itself.
+
+    That's not really related to the behavior this spec is specifying,
+    though.  So, this patch just uses a less pathological implementation
+    of eql?
+
+commit 3f73ddf6bec5c704ceb5ed43481971860293353d
+Author: Chris Shoemaker <chris.shoemaker at cox.net>
+Date:   Wed Dec 12 19:49:49 2007 -0500
+
+    Tighten spec in core/hash/equal_value_spec.rb
+
+    "Hash does not compare keys with different hash codes via eql?" was
+    failing because it detected that eql? was called on a key.  However,
+    eql? was not being used to compare keys with different hash codes
+    from the two hashes.  Instead, eql? is used to compare a key to itself
+    during hash element reference, in order to distinguish between two keys
+    with equal hash codes that aren't eql?.
+
+    The tightened spec only fails if the keys are compared eql? to each other.
+
+commit e355e98a32f34619628a17f5052750da6881cda9
+Author: Chris Shoemaker <chris.shoemaker at cox.net>
+Date:   Wed Dec 12 12:26:15 2007 -0500
+
+    Add specs for hash stability of various Numeric subclasses.
+
+commit 0d774c99254b2c5992a17ecb2a5a12dcd2cad05e
+Author: Chris Shoemaker <chris.shoemaker at cox.net>
+Date:   Tue Dec 11 20:37:45 2007 -0500
+
+    Add a Hash#store spec for storing unequal keys w/ same hash.
+
+commit edfff4981285007ecac132f565243150a8a8bd7e
+Author: Curtis Schofield <123 at noself.net>
+Date:   Tue Nov 27 19:02:45 2007 -0800
+
+    Specs created for Process#gid and Process#uid
+
+    * both are using the unix system command 'id'
+
+commit 4e269d01238537cc45f4c347b12053616007d94d
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Sun Dec 16 23:46:50 2007 +0100
+
+    Excluded evil Thread specs.
+
+    This makes bin/ci usable (pass) again on my system, where it was horribly
+    broken before.
+
+commit b32c46ba95f2ecdaf646a030b96ee9b3737929a0
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Sun Dec 16 23:37:26 2007 +0100
+
+    Excluded failing Kernel#eval specs.
+
+commit 0c56f3a1f84dd94d1f9685af9e9d6e0efd0cfabf
+Author: Hunter Kelly <retnuh at gmail.com>
+Date:   Sun Dec 16 20:24:54 2007 +0000
+
+    Tighten up specs for what should happen when array shrinks during iteration.
+
+commit bfa8c532605c9e3b3d7f853516de9aae596c611d
+Author: Hunter Kelly <retnuh at gmail.com>
+Date:   Sun Dec 16 19:11:25 2007 +0000
+
+    Added specs for Array#each when the array is changed during iteration.
+
+    Ditto for Array#each_index.
+
+commit b3aa2af4a3467b4eeb8765010286c12bd5adfbf9
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Sat Dec 15 22:53:35 2007 +0100
+
+    Sanitized Object#id spec.
+
+commit cce5b7004a774041d78c3b2e55af8063335a9512
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Fri Dec 14 19:02:57 2007 -0800
+
+    Fix sleep spec, implement Thread sleep status and death detection
+
+commit c2475838be23ae287075b7e9ea832013f1db77c4
+Merge: 30f20cf... d061b86...
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Fri Dec 14 10:56:53 2007 +0100
+
+    Merge branch 'master' of git at git.rubini.us:code
+
+commit 30f20cfbd67487c426827406890fdb06fac8045c
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Fri Dec 14 10:56:17 2007 +0100
+
+    Fix race conditions in Kernel#sleep spec by ensuring target thread is actually sleeping before continuing.
+
+commit d061b864f636210e40982d961b0aa5afc24543d0
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Thu Dec 13 23:04:27 2007 -0800
+
+    Fix require specs to not require checked in .rbc or .rba files
+
+commit 41831976d25a4d5a8e26673199276098cc45b4d3
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Thu Dec 13 22:40:43 2007 -0800
+
+    Fixed Thread#run, added corruption detection to rbc files
+
+    * Thread#run was confusing the Thread scheduler, cause things the VM
+      to quit running.
+    * Added corruption detection to .rbc files in the form of a SHA1
+      hash placed in the .rbc, just after the header.
+
+commit 77f0f29060d5ba3f33dc45029525acb715eb61c2
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Fri Dec 14 15:10:59 2007 +1100
+
+    Compiler2 fix for attrasgn in masgn
+
+    An attrasgn node contained within an masgn does not include
+    the assigned value in the attrasgn sexp. This was leading
+    to the argument count to []= to be understated by 1.
+
+commit faaa1932fe05ee4d506b768f8d9d884af5345547
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Wed Dec 12 19:59:11 2007 -0600
+
+    fix non-determinism from Thread.sleep by removing blocking sleep
+    add check for duration of 0 or 0.0 to instant return and added more specs
+
+commit e98b2d1f9788c1813bef2d920779c95effbd3d9f
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Tue Dec 11 17:27:43 2007 -0600
+
+    spec and fix to allow floating point timeouts to Thread#join
+
+commit 801cb5ef58a6debfd348a33f864737cbce7c3d77
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Tue Dec 11 17:26:58 2007 -0600
+
+    added noncompliant spec showing that sleep(nil) is allowed in rubinius
+
+commit 84d280810c840d6699b5c9ad094964fe779235df
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Tue Dec 11 16:30:41 2007 -0600
+
+    fixed Thread#sleep to allows floats, and switched Thread::sleep, Kernel::sleep to use Thread#sleep on current thread
+
+commit 3d10a8a10741786ba76a4cc1083934f908d52ec2
+Author: Kevin Clark <kevin.clark at gmail.com>
+Date:   Mon Dec 10 17:13:34 2007 -0800
+
+    Allow Thread.new to take arguments
+
+commit 4f5258b938a7aacf31e73b5fe6312e3c927d9cf8
+Author: Kevin Clark <kevin.clark at gmail.com>
+Date:   Mon Dec 10 00:21:20 2007 -0800
+
+    Fix rb_define_alloc_func
+
+commit 7ab0f524de5a6b796ec1000402392cb138150eed
+Author: Kevin Clark <kevin.clark at gmail.com>
+Date:   Fri Dec 7 15:06:45 2007 -0800
+
+    Initial ThreadGroup implementation
+
+commit 53fff95e300b1b26ed16f12c13684eadf8235d7a
+Author: Kevin Clark <kevin.clark at gmail.com>
+Date:   Fri Dec 7 01:30:55 2007 -0800
+
+    Add rb_str_substr
+
+commit ec82de9f67e271718b874c0d777765da696bef88
+Author: Kevin Clark <kevin.clark at gmail.com>
+Date:   Sat Dec 8 15:26:17 2007 -0800
+
+    Add wrapped struct spec
+
+commit 65998d601aae601b3b43878f534362136a01ff17
+Author: Brian Takita & Nathan Sobo <brian.takita at gmail.com>
+Date:   Fri Dec 7 17:18:24 2007 -0800
+
+    Added specs for Module#undef_method.
+
+commit 97f8c9c32b9400ae42d0dc80aa7e17b22864fce9
+Author: Brian Takita & Nathan Sobo <brian.takita at gmail.com>
+Date:   Fri Dec 7 16:13:02 2007 -0800
+
+    Moved Object#to_a to Kernel#to_a. Added VM.coerce_to_array.
+
+    VM.coerce_to_array will be used for splatting any object.
+
+commit 865ce7d771a101bc8c2c9ae3a82cbc3f37450c4b
+Author: Brian Takita <brian.takita at gmail.com>
+Date:   Fri Dec 7 12:47:08 2007 -0800
+
+    Merge branch 'array'; commit 'nathan/array' into array
+
+commit b4541a90f84c898e3cd9851ac4b207d559078a59
+Author: Nathan Sobo <nathansobo at gmail.com>
+Date:   Thu Dec 6 23:33:10 2007 -0800
+
+    Updated language/array_spec.rb for more detail on splat operator.
+
+commit 577b2f1c395dc49165842c405fb47bbb7591158a
+Author: Nathan Sobo <nathansobo at gmail.com>
+Date:   Thu Dec 6 18:30:16 2007 -0800
+
+    Fixed :many_if for compiler 1.
+
+    Before it was translating many_ifs to a flat array of if statements instead
+    of nesting them. Also, multiple boolean expressions in the case were not
+    expanded to a boolean disjunction.
+
+    Signed-off-by: Brian Ford <brixen at gmail.com>
+
+commit 1d555fa07aaed8e59e728cb0013daa10b3b17b25
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Thu Dec 6 21:24:44 2007 -0500
+
+    Add some JRuby-inspired eval specs
+
+commit 3131fb81eef380d163d028f5587475bbf170befb
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Thu Dec 6 12:19:49 2007 -0800
+
+    Fix minor constant lookup issue and add timing to mspec
+
+commit 26897cd85c693cac10229d7467436717552088c0
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Thu Dec 6 11:42:36 2007 -0800
+
+    Fix another constant lookup bug
+
+commit 06a3f07999aeb4f7379ea40205451d326d1ba596
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Thu Dec 6 16:37:15 2007 +0100
+
+    Updated CI excludes for IO#each and IO#each_line.
+
+commit b495ab1019e9ee136e9d099faa51cba03c48e947
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Thu Dec 6 16:01:31 2007 +0100
+
+    Extended argument checking in IO.read.
+
+    We're now checking that offset isn't negative either. This is done
+    before the length argument is checked, mirroring MRI's behaviour.
+    Also fixed a typo in the length check.
+
+commit 4fa2fbb6b6c27ced5d6cf902e63e3989c2d29b64
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Thu Dec 6 14:56:41 2007 +0100
+
+    File.truncate raises Errno::ENOENT if the given file doesn't exist.
+
+commit cb7a0a7315e57f1adff0976bcd6b0c4a1a94d8c5
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Thu Dec 6 14:15:55 2007 +0100
+
+    Added support for the length and offset arguments to IO.read.
+
+commit 9fe8f2bd73e28d28b7a9249e629ab7681321e4d5
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Thu Dec 6 14:07:21 2007 +0100
+
+    IO.read only accepts file names and uses File to open and read them.
+
+commit 7ab1d9f3434e3f3b021de2f4087f2502e229c7a0
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Thu Dec 6 14:00:19 2007 +0100
+
+    IO.new(nil) raises TypeError now.
+
+commit 227f6b4bf45b55eb659d41507d38fe5071ef7424
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Thu Dec 6 13:24:31 2007 +0100
+
+    Fixed a typo in File.writable?.
+
+commit 645f30882c9dd39d13f49e45f2f32c43ebe25182
+Author: Kevin Clark <kevin.clark at gmail.com>
+Date:   Thu Dec 6 03:51:11 2007 -0800
+
+    Update Dir excludes
+
+commit e60ee517013d44c2ec6faf147f7dbd685fa520c2
+Author: Kevin Clark <kevin.clark at gmail.com>
+Date:   Thu Dec 6 00:40:17 2007 -0800
+
+    Fix flag checking in Dir.glob
+
+    Also clean ".", ".." skipping
+
+commit fa681ad7a3c1d0e1b4fb0702c2fc63cd80ec9377
+Author: Kevin Clark <kevin.clark at gmail.com>
+Date:   Wed Dec 5 18:08:41 2007 -0800
+
+    File.fnmatch? should accept escaped wildcards
+
+    Also fixes more Dir.glob specs
+
+commit e6b8ce23729606bf6fa748ea63c0e0a59b48a476
+Author: Kevin Clark <kevin.clark at gmail.com>
+Date:   Wed Dec 5 15:35:32 2007 -0800
+
+    Don't unescape leading period in File.fnmatch?
+
+commit 1cf054a08b0aeea7c348ff26c71ccaf22c02ce70
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Thu Dec 6 02:36:54 2007 -0500
+
+    Rename Array#pretty_inspect to avoid conflict with pp
+    Hardcore bikeshed action on the way TestGenerators are inspected
+    Change describe.rb to call the renamed pretty_inspect
+
+commit 519d1226027623274766641a256e2a9753257266
+Author: Nitay <nitay at powerset.com>
+Date:   Wed Dec 5 16:07:25 2007 -0800
+
+    Fix Constant = Class.new setting of name
+
+    Signed-off-by: Kevin Clark <kevin.clark at gmail.com>
+
+commit 568c57ca57d4a9183e492024e17aa1352902d1d2
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Wed Dec 5 20:31:43 2007 -0500
+
+    Clean up mspec output to prepare for unit_diff support
+    Use pretty_inspect to display compiler2 TestGenerator output
+
+commit e250521194380f4c942fd6d53664b746ca63e3e3
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Wed Dec 5 17:27:27 2007 -0800
+
+    Fix constants spec to scope the fixtures
+
+commit 7010073617a4fa95ea5491284fef97a083d9d4f3
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Wed Dec 5 14:42:27 2007 -0800
+
+    Vastly simplify and fix constant lookup
+
+    * New constant lookup specs to test behavior
+    * Added StaticScope object and field on CompiledMethod which stores
+      a StaticScope instance which indicates the lexical scope of the CM.
+
+commit 163e56646a817301201af843b45c973da058688c
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Wed Dec 5 23:00:16 2007 +0100
+
+    The spec for Dir#rewind doesn't pass on Rubinius.
+
+    It's not platform specific, but we don't have a working Dir#pos yet
+    and the Dir#rewind spec relies on it.
+
+commit 3afe61bd78aa9e850f081b83ca2c478ae297bda1
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Dec 5 13:51:05 2007 -0800
+
+    Changed mini_rspec to show failures unless being run by autotest.
+
+    Added dir_entry.rb to .gitignore.
+
+commit 0c661894b54615ee4915d61569e072ffdfa8826d
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Wed Dec 5 09:17:24 2007 -0500
+
+    Much-improved tiny option parser lib/options.rb.
+
+    * The Options API is much more user-friendly now,
+      size is still about 100 LoC
+    * Specs for the API.
+
+commit 092e0081c26eeda2ca6561eb19123b468965c84a
+Author: Ryan Davis <ryand-ruby at zenspider.com>
+Date:   Wed Dec 5 01:40:31 2007 -0800
+
+    Added support for autotest.
+    Requires a new release of ZenTest to actually work.
+    I'm tired, I'll do that tomorrow
+
+commit 9e3e41d71d1bab8104ae17ff34aaa2311be3b0b1
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Tue Dec 4 22:59:49 2007 -0800
+
+    Commit miss for require specs
+
+commit d1a6f0805b739930e54406188e32ac1e0f30a74b
+Author: Eric Hodel <drbrain at segment7.net>
+Date:   Tue Dec 4 22:24:49 2007 -0800
+
+    Add specs for Kernel#require, never add .rbc files to $LOADED_FEATURES
+
+commit a60e3bf901b62fbbbef59acb2c6c9f164be1fbbc
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Wed Dec 5 14:10:15 2007 +1100
+
+    Cleanup case spec, update excludes
+
+    * converted case specs to not use should
+    * separated out case specs with target expressions from those without
+    * updated excludes for two failing specs under compiler1
+
+commit f0de77911ff0b4532a47fb9803685e8d968d51ec
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Tue Dec 4 09:42:49 2007 +1100
+
+    Fixes for compiler2 when_spec failures
+
+    * Added compiler2 spec for when without an arg
+    * Added spec for when without arg with an else to
+      spec/language/case_spec.rb
+    * Implemented many_if sexp compilation
+
+commit c9c67738ecae341441098993923838a15b64d166
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Tue Dec 4 20:42:27 2007 +0100
+
+    Test Etc.getgrnam() with "daemon" instead of "root".
+
+    The "root" group seems to be a Linux-ism.
+
+commit 1fd6d97e8eb20ce9908cc0abd09b7c5555ff5720
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Tue Dec 4 19:31:24 2007 +0100
+
+    Post-move fix for the Options spec.
+
+commit ead52428d99549b6b53b8897d969e80072395ef6
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Tue Dec 4 19:12:28 2007 +0100
+
+    Moved codearchive.rb, options.rb and readline.rb from kernel/core to lib.
+
+commit 0e4568bcc23011957cc250de2a93031648281b21
+Merge: 78fba04... fbc5ad5...
+Author: Charles Nutter <headius at wlan100.headius.com>
+Date:   Tue Dec 4 00:50:46 2007 -0600
+
+    Merge branch 'master' of git at git.rubini.us:code
+
+commit 78fba04c31e9d97c32862e9e104e3917dcff9137
+Author: Charles Nutter <headius at wlan100.headius.com>
+Date:   Tue Dec 4 00:39:05 2007 -0600
+
+    Making socket spec more reliable by using nonblocking accept for TCPServer and adding a "ready" flag for UDPServer.
+
+commit 7e925ea53239207f5dd9ac5daddda8e0f1f3b687
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Sun Dec 2 23:33:29 2007 +0100
+
+    Implemented Etc.
+
+commit 450778cf5f416f6b9531664d4fff2c159c93cbe7
+Author: Victor Hugo Borja <vic.borja at gmail.com>
+Date:   Sun Dec 2 01:39:28 2007 -0600
+
+    Shared spec for class_eval.
+
+    - removed method-arguments from describe string
+      This was causing bin/completeness to report 0 examples for Module#class_eval/module_eval
+    - examples checking for TypeErrors test the exception is raised, but don't check
+      the exact message as it is not part of the interface.
+
+commit cd0d11c7eb23d881f1dd73701bd3edc12c5bd744
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Dec 1 15:28:41 2007 -0800
+
+    Updated CI excludes for Dir.[].
+
+commit e41e501bcf686937fbd3b8cfc86f325d7e06184d
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Dec 1 10:54:35 2007 -0800
+
+    CI spec excludes updates.
+
+    * Fixed rake pristine task to whitelist Kernel#require fixtures.
+    * Updated CI excludes for Dir.glob and Dir.[].
+
+commit 8f362a0350238366565a373f1feb9594efe03407
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Sat Dec 1 18:50:55 2007 +0100
+
+    Make sure we delete the directories we're creating in the mock dir.
+
+commit dfc1b1cd32f47b48dd358ca50226d614425ef8b2
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Sat Dec 1 18:08:27 2007 +0100
+
+    Dir.chdir now always resets the working directory when called with a block.
+
+commit 02f41a92bbafd1a555344e1082970e090cd1f9a5
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Fri Nov 30 23:41:29 2007 +0100
+
+    Call StringValue on require's and load's argument.
+
+commit 601fd404ba04f383ee286be015edb7e8c58574d5
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Fri Nov 30 14:27:44 2007 -0800
+
+    Refactor Kernel#require
+
+    * Refactor a bunch of Kernel#require into Compile#require_feature
+    * VM.load_library now detects if the extension is already there
+      and doesn't readd it
+    * Added specs for #require
+
+commit 9b903cb7c5c6a3bfbaa3a7a91dc7bad830af7294
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Fri Nov 30 10:56:02 2007 +1100
+
+    Compiler2 fix for anonymous masgn, e.g. * = 1,2
+
+commit 08bc0a2f14494a30d5956d5bdcca9eb37c921780
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Fri Nov 30 00:16:07 2007 +0100
+
+    Made check_argcount work with methods that don't take any arguments.
+
+commit 96108240fead7d764f3ec37d5eb20294f3a9dd97
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Thu Nov 29 21:45:32 2007 +0100
+
+    Updated the CI excludes for Method#call.
+
+commit 61805ab7fac6ae9855baa05b42aebe66c3a2b3d3
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Thu Nov 29 21:44:49 2007 +0100
+
+    Made Method#[] an alias for Method#call.
+
+commit 219d34dedf6ff0ed083cb5f1e8b6a5c437ad366c
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Thu Nov 29 21:22:05 2007 +0100
+
+    Enabled the Kernel#method_missing specs.
+
+    They pass now that they specs aren't confused by the Dir spec helper
+    methods anymore.
+
+commit de5320efe8095e612e235bea7053084bb61d300d
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Thu Nov 29 21:17:58 2007 +0100
+
+    Moved the Dir spec helper methods in their own module.
+
+commit 1ae47b5c091c209597bec7475935bbcff34b50b5
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Nov 28 23:45:09 2007 -0800
+
+    Applied patch from #151.
+
+commit adb5b139afa452869464fe53b710d7cb8b93131b
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Nov 28 20:29:38 2007 -0800
+
+    Better fix for guards to distinguish ruby, ruby1.x from ruby1.9.
+
+commit e53f72172e395c7766dcecadd2ffd6c7caf303e7
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Nov 28 20:15:27 2007 -0800
+
+    Patches (or modified patches) from #157-162.
+
+commit b07eeee79ea5a0c0160c34aec2d690f1b46f7380
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Wed Nov 28 14:43:41 2007 +0100
+
+    Fixed Bignum#modulo and Bignum#remainder.
+
+commit 85b05b5103aaeb5d946e0f691f77af2dafa6f30a
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Wed Nov 28 01:00:07 2007 +0100
+
+    Unified the File.unlink and File.delete specs.
+
+commit 2ec59a82f279a4ba6b5b781c90a7714aba767ed9
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Tue Nov 27 23:30:43 2007 +0100
+
+    Be more specific wrt the expected exception.
+
+commit 54236949e9b974d4c4dcf95b63318c844c62aca4
+Author: Victor Hugo Borja <vic.borja at gmail.com>
+Date:   Tue Nov 27 19:58:50 2007 -0600
+
+    Module#<=> is working, Updated CI excludes for Module specs.
+
+commit 55c7529f4c8b02eff7e0b594f33b28750877fca2
+Author: Victor Hugo Borja <vic.borja at gmail.com>
+Date:   Tue Nov 27 14:53:02 2007 -0600
+
+    Specs for Module#private/public/protected
+
+commit 5b693fae3464abb6a5aa05d8236bd8f4610c89d4
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Tue Nov 27 19:36:06 2007 +0100
+
+    We cannot use File.exists? to check whether a symlink exists.
+
+    Use File.symlink? instead.
+
+commit e7eb6a8e1e1310c08220db0ed7979ec4c721fccb
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Tue Nov 27 19:34:48 2007 +0100
+
+    Moved the after(:each) block before the specs, so the block is actually run.
+
+commit 4c284abb32029029ab7002147ef544493c7070f6
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Tue Nov 27 19:00:30 2007 +0100
+
+    Added a missing Errno.handle to File.readlink.
+
+commit f163ca7c5e4a03d698a881853d1e0fab8a5be1a4
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Tue Nov 27 18:42:08 2007 +0100
+
+    readlink() only works with symbolic links.
+
+    This makes the spec pass on MRI.
+
+commit ca1cb21b5f694b3850a838f88d3ac5ded7de3e1f
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Tue Nov 27 18:40:43 2007 +0100
+
+    Naming convention fixes.
+
+commit cbf351cb59152a5528f6c6105cee96c67f7f6fcd
+Merge: f70d531... 5452983...
+Author: Marcus Crafter <crafterm at redartisan.com>
+Date:   Mon Nov 26 19:48:21 2007 +1100
+
+    Merge branch 'master' of git at git.rubini.us:code
+
+commit f70d5314fcc75ef2e32fbd484de58bd5f7ed6cbc
+Author: Marcus Crafter <crafterm at redartisan.com>
+Date:   Sat Nov 24 17:29:29 2007 +1100
+
+    Implemented File::symlink and spec.
+
+    Kudos to the Melbourne Railscamp :)
+
+commit c4a6a804185c18a182206afc1b8d5209d208077e
+Author: Marcus Crafter <crafterm at redartisan.com>
+Date:   Sat Nov 24 01:08:41 2007 +1100
+
+    Removed trailing whitespace.
+
+commit 9b9820e512f56b2c23c760887251d72c187aa297
+Author: Marcus Crafter <crafterm at redartisan.com>
+Date:   Sat Nov 24 00:50:11 2007 +1100
+
+    "Added File::readlink spec"
+
+commit 2dd272afe315dae0ad0b9bd49b6dfa9e98e50b1c
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Fri Nov 23 17:11:54 2007 +1100
+
+    Spec-ed implementation differences on masgn RHS eval order
+
+    Rubinius is (for now) deliberately non-compliant wrt eval
+    order of RHS expressions in an masgn.
+    * MRI, JRuby eval left-to-right
+    * Rubinius evals right-to-left
+
+commit 361a1adcee182cf069352effd0949064b621bddc
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Fri Nov 23 16:16:08 2007 +1100
+
+    Additional parallel assignment specs - use of to_ary
+
+    * Added spec for when to_ary should be called on the RHS of an masgn
+    * Added additional example of a complex masgn (from JRuby tests)
+
+commit 97cb3f5758f102cf8a07262c4c9bef4b22ca88b7
+Author: Victor Hugo Borja <vic.borja at gmail.com>
+Date:   Thu Nov 22 22:04:51 2007 -0600
+
+    Added specs for metaclasses of true/false/nil on metaclass_spec as suggested by rue.
+
+commit d4f9eb7cd5fb17e3e8ce52db39e95a96362d3ad0
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Nov 22 13:05:10 2007 -0800
+
+    Fixed wording of Rubinius extension Bignum domain specs.
+
+commit 50e1f80ef54d25aaa69d52a3d422547593836ac6
+Author: Jeremy Durham <jeremydurham at gmail.com>
+Date:   Thu Nov 22 17:18:54 2007 -0500
+
+    Added excludes for Kernel#open and Thread#abort_on_exception
+
+    * Excludes Kernel#open raise specs
+    * Excludes Thread#abort_on_exception specs
+
+commit 25607d4d884b4597bc69560e9390cd9dc1f4e44d
+Author: Victor Hugo Borja <vic.borja at gmail.com>
+Date:   Thu Nov 22 13:47:50 2007 -0600
+
+    Specs for Module#alias_method
+
+commit c207618ad4113501aa5df4adb5d5aa3a60f5b9ff
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Thu Nov 22 10:59:34 2007 -0800
+
+    Use RUBY_ENGINE first, then pull in rbconfig
+
+commit ed5a46e13b35d6ad48cce1d3eed96c2f78ace049
+Author: Jeremy Durham <jeremydurham at gmail.com>
+Date:   Thu Nov 22 11:42:36 2007 -0500
+
+    Added basic specs for abort_on_exception
+
+    * Added specs for Thread#abort_on_exception ($DEBUG on and off)
+    * Added specs for Thread#abort_on_exception=
+
+commit 05ecef9162ba2c4a0da90c966a20a4f45c353d93
+Author: Jeremy Durham <jeremydurham at gmail.com>
+Date:   Thu Nov 22 08:39:53 2007 -0500
+
+    Added specs for when parameters are missing or invalid parameters are given
+
+commit 25d2c940d561dcac2c06df747762a229dddfbed1
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Thu Nov 22 15:33:17 2007 +1100
+
+    Another parallel assignment spec - rhs should evaluate l->r
+
+commit 8e4f8de446b842c13ad45a8e0e2c3c1ebf30bddb
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Nov 21 17:42:17 2007 -0800
+
+    Stop-gap prevention for Kernel#callcc hanging CI specs.
+
+commit a9d7163e4d9e8d4fb79c9769691b232676a44bd8
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Wed Nov 21 15:50:39 2007 -0600
+
+    remove compliant(MRI) from callcc specs
+
+commit 812e922c8e7cda728d6b7f32933b75eb009eef11
+Merge: 2e221b9... f24bb1f...
+Author: Nathan Witmer <nwitmer at gmail.com>
+Date:   Wed Nov 21 12:32:18 2007 -0700
+
+    Merge branch 'callcc_spec'
+
+commit f24bb1ffdf941df78098da262a62e881653b1a99
+Author: Nathan Witmer <nwitmer at gmail.com>
+Date:   Wed Nov 21 12:31:28 2007 -0700
+
+    Added scope-related callcc specs, compliant(:ruby) only.
+
+commit 2e221b9f1d7ffa41431e5bd51fdd36434e7f838f
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Wed Nov 21 14:41:43 2007 +0100
+
+    Spec and fix some more String#slice bugs when given nil, also use Undefined.
+
+commit db338d9d8705fd668a5639d483ff47908aa014ca
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Tue Nov 6 16:53:13 2007 +0100
+
+    Fix String#rindex when given nil as offset.
+
+commit 6eab3b692a50c1a37cc39c21d743de1488402f64
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Nov 21 00:00:24 2007 -0800
+
+    Added MRI stdlib Fcntl to lib/ext with build script.
+
+    Added lib/fcntl to load extension. This may need a better solution.
+    Added INT2FIX to subtend.
+
+commit 5268c0b29c1fb07a911fe601e30b21ffe04f7e81
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Wed Nov 21 17:02:14 2007 +1100
+
+    Additional specs for parallel assignment
+
+    MRI allows parallel assignment to:
+    - assign via object.method=
+    - assign via []=
+    - use a lhs arg as an arg to another lhs assignment
+
+    All three scenarios currently fail in Rubinius, apparently due to
+    miscalculating the number of args to an assignment method under
+    parallel assignment.
+
+commit 462f68b95a70c24e41cad5a40969c4651c7de181
+Author: Jeremy Durham <jeremydurham at gmail.com>
+Date:   Tue Nov 20 02:12:44 2007 -0500
+
+    Added specs for Kernel#open when block is given
+
+commit ab9e40600fd2522d4abce86f7b8bdc632f6e9018
+Author: Jeremy Durham <jeremydurham at gmail.com>
+Date:   Mon Nov 19 23:42:55 2007 -0500
+
+    Added very basic specs for Kernel#open
+
+commit b47efc9f9872ecca68a06f6864f39617e06762b0
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Nov 19 00:24:15 2007 -0800
+
+    Updated CI excludes. Runs clean on Leopard.
+
+commit 3ff04e52bc9cb03439567ddb9b3b63b3034b30c3
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Mon Nov 19 00:03:58 2007 -0600
+
+    more specs for Kernel.callcc, ensures callcc return value semantics
+
+commit 06d5312c51b09faef87d2deb53f3c472eaa94100
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Sun Nov 18 17:49:44 2007 -0600
+
+    basic callcc behavioral specs
+
+commit 53433f0e9ddba2eac876f7a1fb0f9d292ee37286
+Author: Nathan Witmer <nwitmer at gmail.com>
+Date:   Fri Nov 16 16:51:18 2007 -0700
+
+    Added Kernel#callcc spec and fix for LocalJumpError with no block given
+
+commit d324779b8b5c8dd84438c08ec4f2b2574282f93e
+Author: Victor Hugo Borja <vic.borja at gmail.com>
+Date:   Fri Nov 16 15:17:21 2007 -0600
+
+    Added Module.nesting
+
+    Some specs are failing on rubinius because the parent
+    field is not being properly set.
+
+commit cff726c9dc3631b2e0ddc3e12bd3af532f7e1ef4
+Author: Victor Hugo Borja <vic.borja at gmail.com>
+Date:   Fri Nov 16 14:49:38 2007 -0600
+
+    Added spec for calling Module.nesting on root level
+
+commit 05adb6070889d7021a1e53ab82b855c3554d4f5c
+Author: Victor Hugo Borja <vic.borja at gmail.com>
+Date:   Fri Nov 16 14:45:23 2007 -0600
+
+    Fixed specs for Module#constants
+
+commit 1f1c857e1d8c37213a91daaad3fc3bfcbf2bef61
+Author: Victor Hugo Borja <vic.borja at gmail.com>
+Date:   Fri Nov 16 14:43:55 2007 -0600
+
+    Fixed spec description for calling Module.nesting from methods.
+
+commit 242c947c6e4d007685e8aa0c44ac505c7dab4239
+Author: Victor Hugo Borja <vic.borja at gmail.com>
+Date:   Fri Nov 16 14:38:32 2007 -0600
+
+    More specs for Module.nesting
+
+commit 3560fd7ef0d5a65a9cb055d87fa7103ed3bdb029
+Author: Victor Hugo Borja <vic.borja at gmail.com>
+Date:   Fri Nov 16 10:24:45 2007 -0600
+
+    private keyword specs reflecting problem described on ticket #133
+
+commit fd31e1e592237832bd5e605f604d15385df0615a
+Author: Victor Hugo Borja <vic.borja at gmail.com>
+Date:   Fri Nov 16 04:15:27 2007 -0600
+
+    specs for Kernel#block_given? by Francisco Laguna
+
+commit 87ebce4cf2430198578decdb4c7dc1003db37f8e
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Thu Nov 15 22:07:39 2007 -0800
+
+    Ticket #121 by Jeremy Durham -- File modes
+
+commit 4a67e0ade233aaaa3a2ff17161b298872f8a5f83
+Author: Victor Hugo Borja <vic.borja at gmail.com>
+Date:   Thu Nov 15 14:20:19 2007 -0600
+
+    Splitted enumerable_spec.rb into a file per method.
+
+    Added some specs by Francisco Laguna.
+
+commit 0b933650330f57e7db1bf8574d0b7eecf0635996
+Author: Bryan Helmkamp <bryan at brynary.com>
+Date:   Tue Nov 13 11:34:20 2007 -0500
+
+    Added specs for File.mtime.
+
+commit 42a7de27c1a6082fee7b9baaf05b9394ffe90ddd
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Mon Nov 12 19:57:38 2007 +0100
+
+    Updated CI excludes for File#atime and File.new.
+
+commit 3d106d6a9b8ce0b34e7b6f9426da51b83fe5f676
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Mon Nov 12 19:54:43 2007 +0100
+
+    Added File#path.
+
+commit 247da25a0120d468fe9f189a6235962f9658b65e
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Mon Nov 12 19:23:09 2007 +0100
+
+    File now deals with numeric modes and accepts a permission argument, too.
+
+commit 087deaed0dcf4ae2c8dc713eeccfed9a0ebabe6f
+Merge: 4355e96... 1c9d213...
+Author: Kevin Clark <kevin.clark at gmail.com>
+Date:   Sun Nov 11 23:15:01 2007 -0800
+
+    Merge branch 'master' of git at git.rubini.us:code
+
+commit 4355e96b05de4d4d086dfa86b8fe19bdcecfbe82
+Author: Kevin Clark <kevin.clark at gmail.com>
+Date:   Sun Nov 11 23:14:16 2007 -0800
+
+    -a
+
+commit 7e975d1aca38a3bfe07fda431aeaba376bce19c1
+Author: Kevin Clark <kevin.clark at gmail.com>
+Date:   Sun Nov 11 23:09:47 2007 -0800
+
+    Get rid of irrelevant specs
+
+commit 1c9d2133fc294964ce08e9a7020083c379f74ca0
+Author: David Waite <david at alkaline-solutions.com>
+Date:   Sun Nov 11 23:46:08 2007 -0700
+
+    Remove temp directories within mkdir spec on exception.
+
+commit 2110fc75dc6a7ab521249f259bc6fdc78d565b11
+Author: Kevin Clark <kevin.clark at gmail.com>
+Date:   Sun Nov 11 22:36:08 2007 -0800
+
+    Update CI Excludes
+
+    * Expected failure of "raise an Exception if it has
+      the wrong number of argments" due to dispatcher bug
+
+commit 0f2a183a46ba085d9c99ed4767cd18c0482e6d45
+Author: Kevin Clark <kevin.clark at gmail.com>
+Date:   Sun Nov 11 22:14:07 2007 -0800
+
+    Implement File#atime
+
+commit 671b340f340ab6b8d9c13b27d52a782ce3268b2a
+Author: Kevin Clark <kevin.clark at gmail.com>
+Date:   Sun Nov 11 21:24:34 2007 -0800
+
+    Update CI excludes
+
+commit f7ba96f6b41de9a3696a03e9efe25c8b037a4f07
+Author: Kevin Clark <kevin.clark at gmail.com>
+Date:   Sat Nov 10 11:24:12 2007 -0800
+
+    Adds spec for File.open
+
+    * In resonse to Lighthouse Ticket #102
+      "File.open should throw Errno::EACCES opening non-permitted file"
+    * Passes MRI, doesn't yet pass RBX
+
+commit 719329b3f5179766e23a27e427cd0c0846c85ffa
+Author: Marcus Crafter <crafterm at redartisan.com>
+Date:   Mon Nov 12 10:38:42 2007 +1100
+
+    Added IO#to_i implementation and spec.
+
+commit cc100fc08be101ecdf0daba1966977fb8e39fa6e
+Author: Marcus Crafter <crafterm at redartisan.com>
+Date:   Mon Nov 12 10:30:25 2007 +1100
+
+    Added IO#fileno implementation and spec.
+
+commit d036f5c16a4836d638be83108be35df532d9221a
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Sun Nov 11 23:17:12 2007 +0100
+
+    Made SystemStackError subclass of StandardError.
+
+commit bf1c3dc3e463aeaf4e0cee1cbd46b15e7693a395
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Sun Nov 11 20:36:25 2007 +0100
+
+    Removed an old Method#arity spec exclude.
+
+commit 72c3495f3513e54c2488292bcdaca9208b6f0339
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Nov 11 10:44:53 2007 -0800
+
+    Removed transient dirs from Dir specs.
+
+commit 11f0ed51b4bfb3bea2b544a82b3158fd3daf2ad8
+Author: Victor Hugo Borja <vic.borja at gmail.com>
+Date:   Fri Nov 2 03:02:28 2007 -0600
+
+    Specs for Module#remove_const
+
+    Signed-off-by: Brian Ford <brixen at gmail.com>
+
+commit e8158f14f0f02e3b0cdcb4182e1277928324cc0c
+Author: Nathan Witmer <nwitmer at gmail.com>
+Date:   Sun Nov 11 08:19:10 2007 -0700
+
+    Fixes for UDPSocket spec
+
+    * Renamed the description to match what was actually being tested
+    * Uncommented the code and wrapped it in an "it" block, to prevent
+      conflicts/hangs with bin/completeness runs.
+
+    Signed-off-by: Brian Ford <brixen at gmail.com>
+
+commit 9b973a98d2ebddacd50f0fcb58903bb53bdff3f5
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Sun Nov 11 13:30:22 2007 +0100
+
+    Ticket #98: Dir includes Enumerable now.
+
+commit 8d957f186cd4d2c5e6b236de4a0878d38b464848
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Sun Nov 11 13:26:00 2007 +0100
+
+    Implemented Module#included_modules.
+
+commit 0021b24ba490fe01f96ef17957328feeedfc4c29
+Author: Nathan Witmer <nwitmer at gmail.com>
+Date:   Thu Nov 8 21:42:41 2007 -0700
+
+    Commented out code in UDPSocket spec so bin/completeness doesn't hang
+
+    Signed-off-by: Brian Ford <brixen at gmail.com>
+
+commit 56687aed201fb864587807cca893268a9f1e2050
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Nov 11 00:10:14 2007 -0800
+
+    Method fixture for yield specs.
+
+commit 421aa58f9135807487864adcdcac79f7b6da33c1
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Nov 11 00:08:35 2007 -0800
+
+    Specs for yield keyword based on patch in #114.
+
+commit 5ba0b2030c55474f9d8a096d309678ca24a4699b
+Author: Jeremy Durham <jeremydurham at gmail.com>
+Date:   Sun Nov 11 01:35:08 2007 +0100
+
+    Ticket #105: Implemented Bignum#eql?.
+
+commit 47356fe39033f8571559a4fef933681fda871efd
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Sun Nov 11 01:14:26 2007 +0100
+
+    Made specs for Kernel#respond_to? and Kernel#method pass.
+
+    KernelSpecs::Foo#baz is defined in another spec, so these two specs
+    may not rely on #baz being undefined. This is a horrible workaround
+    for the problem that multiple specs make use of the same module and modify
+    it freely.
+
+commit 68b4fc7c0192f537fe9727927ac35c440dbdc03a
+Author: Akshay Rawat <akshay.rawat at gmail.com>
+Date:   Thu Nov 8 18:21:03 2007 +0530
+
+    Updated CI excludes.
+
+commit a1eee3814a5d054cd00e26b40c063d41880bf6c7
+Author: Chris Pettitt <cpettitt at gmail.com>
+Date:   Sat Nov 10 14:10:47 2007 -0800
+
+    Refactor IO.gets spec to have less duplication.
+
+commit 56497d27bdb3a82d549f89b9fc9fcf0709f99b3e
+Author: Chris Pettitt <cpettitt at gmail.com>
+Date:   Sat Nov 10 14:07:21 2007 -0800
+
+    New spec: IO.gets('') should advance the file position to the next non $/ character.
+
+commit 95158f5a4141d5d3e2893304e49bfeb62cc7b226
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Nov 10 13:35:03 2007 -0800
+
+    Added rescue to prevent meltdown until rbx begin/rescue/ensure is fixed.
+
+commit a39155cb029ca3c1e5e5d69e0e269c685c040f6e
+Author: Chen Yufei <cyfdecyf at gmail.com>
+Date:   Sat Nov 10 12:24:38 2007 +0000
+
+    Fixed IO#gets when separator is empty.
+
+commit f9c31ce1d2a68c15def98aad6c6ff35eb56cd523
+Author: Kevin Clark <kevin.clark at gmail.com>
+Date:   Fri Nov 9 20:24:40 2007 -0800
+
+    Clean up Enumerable#include? specs
+
+commit f017fad69be5d4034a4c5437acf77ec4749b0d75
+Author: Kevin Clark <kevin.clark at gmail.com>
+Date:   Sun Nov 4 20:54:06 2007 -0500
+
+    Clean up Enumerable#(collect, entries, find, find_all) specs
+
+commit 81550f082396b4455c3681ae966be1371be0a5db
+Author: Kevin Clark <kevin.clark at gmail.com>
+Date:   Sun Nov 4 13:18:52 2007 -0500
+
+    Update excludes
+
+commit d5fd2ee893ea608c7e19cb674a4da7b9f49542e6
+Author: Kevin Clark <kevin.clark at gmail.com>
+Date:   Sun Nov 4 12:16:58 2007 -0500
+
+    Cleanup/rewrite Enumerable#find tests for sanity and clarity
+
+commit 39f21aa76f6ddc45be79e4e4e978b4c1c2beed71
+Merge: 17d2e4c... c1b9f74...
+Author: Kevin Clark <kevin.clark at gmail.com>
+Date:   Fri Nov 9 20:25:13 2007 -0800
+
+    Merge branch 'master' of http://git.rubini.us/code
+
+commit c1b9f74f88be963e72de763da9130f46869d89fb
+Author: Chris Pettitt <cpettitt at gmail.com>
+Date:   Fri Nov 9 12:36:04 2007 -0800
+
+    Fix some failing specs for IO#each and IO#each_line.
+
+    Also refactor some common code into a helper method.
+
+commit 74af37b849507e504503359a08245effaad7634a
+Author: Chris Pettitt <cpettitt at gmail.com>
+Date:   Fri Nov 9 10:58:33 2007 -0800
+
+    New specs for IO#each and IO#each_line
+
+    This change adds some new specs for IO#each and IO#each_line factored into
+    a shared .rb, because one is the alias of the other. Added failing specs to
+    excludes.
+
+commit d162a396b566846445328d6c42d3d5f10fcf7ee6
+Author: Matt Pelletier <matt at eastmedia.com>
+Date:   Fri Nov 9 02:32:25 2007 -0500
+
+    Add and refactor patches from Andrea OK regarding #send
+
+commit 63f0ed010e65549597f6bddb0686ba04157ca478
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Nov 7 09:52:25 2007 -0800
+
+    Fixed Method#call spec failing from renamed fixture method name.
+
+commit 1ef46468d7808c52b07388130069cb2e7854bff8
+Author: Matt Pelletier <matt at eastmedia.com>
+Date:   Wed Nov 7 04:48:39 2007 -0500
+
+    * Update CompiledMethod#arity to be accurate for cases of required and/or optional arguments, with or without blocks
+     * CompiledMethod#arity is still inaccurate when splat argument is present (the presence of splat overrides #required)
+     * Add specs for more thorough coverage of various argument use cases
+     * Includes known Rubinius-failing specs for splat-related arity
+
+commit b7726f26dae95936aa1c3fdf2c52dd18ef7413cf
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Nov 5 17:48:51 2007 -0800
+
+    Updated CI excludes for fixes to public|private_class_method.
+
+commit eb18f898e3ae8e5a1bf3b01291a12516c6a22301
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Nov 5 17:18:22 2007 -0800
+
+    Added Module#protected_method_defined?. Updated CI excludes.
+
+commit aa8904cdbd8b4851be4f05cec3000b04cfc9f6c1
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Nov 5 17:14:12 2007 -0800
+
+    Added Module#private_method_defined?.
+
+    Fixed specs for Module#public_method_defined? and
+    private_method_defined?. Updated CI excludes.
+
+commit 063b61759ee86f5def2422d16f1eb854c8b9eb76
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Nov 5 13:39:21 2007 -0800
+
+    Updated CI excludes for StringIO.
+
+commit 3c79f871379d2d4b5431138033f723efbf4a795d
+Author: Dr Nic <drnicwilliams at gmail.com>
+Date:   Sun Nov 4 16:45:30 2007 -0500
+
+    Extended StringIO spec "flattens a nested array before writing it" to ensure deeper test scenario
+
+    Signed-off-by: Brian Ford <brixen at gmail.com>
+
+commit 916d617a60cf83ac26c3090310236193f5842ff6
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Nov 5 13:11:54 2007 -0800
+
+    Updated CI excludes for String#scan.
+
+commit fee1d904197c369c561ae3b11aaf582f1b87d1b0
+Author: Matt Pelletier <matt at eastmedia.com>
+Date:   Sat Nov 3 16:06:16 2007 -0400
+
+    Fix test of String#scan. Do not force matches into array using splat.
+
+    Signed-off-by: Brian Ford <brixen at gmail.com>
+
+commit cc9182cfcde60a63bf566f73c6004b7e46347e77
+Author: Daniel Lucraft <dan at fluentradical.com>
+Date:   Thu Nov 1 17:01:03 2007 +0000
+
+    Added File.rename
+
+    Signed-off-by: Brian Ford <brixen at gmail.com>
+
+commit fc2b7aa65ab338d8ff543552659046c93659c3ce
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Nov 5 12:06:13 2007 -0800
+
+    Commit rework of Carl Drinkwater's patch from #72.
+
+commit 7f6564b96762d7b3deb9f021789182f5c664a766
+Author: Chris Pettitt <cpettitt at gmail.com>
+Date:   Sun Nov 4 10:38:04 2007 -0800
+
+    Fixes for two IO#gets spec failures.
+
+    This patch fixes the following two IO#gets spec failures:
+
+        IO#gets assigns the returned line to $_
+        IO#gets returns the entire content if the separator is nil
+
+    Signed-off-by: Brian Ford <brixen at gmail.com>
+
+commit 705e8e05496167b1af3a1e3ff3446d325ca54e07
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Nov 5 02:10:56 2007 -0800
+
+    Added Module#public_method_defined?.
+
+    Updated CI specs for #public_method_defined?.
+    Small fix to find_method_in_hierarchy to symbolize arg.
+    Updated some spec wording and removed spec'ing exception string.
+
+commit 17d2e4c6ae0c40376fe121786a362c8bc8ce951c
+Merge: 2b77ee8... c07472c...
+Author: Kevin Clark <kevin.clark at gmail.com>
+Date:   Sun Nov 4 20:58:42 2007 -0500
+
+    Merge branch 'master' of http://git.rubini.us/code
+
+commit bd6c27f4724bdc461a7036e6373a0ad23060020a
+Author: Trotter Cashion <cashion at gmail.com>
+Date:   Sat Nov 3 15:57:21 2007 -0400
+
+    Added operator precedence specs for '&&' and 'and'.
+
+commit 2b77ee8b74373a3251973d96c931422909605e29
+Merge: 30d7618... 76aa72e...
+Author: Kevin Clark <kevin.clark at gmail.com>
+Date:   Sun Nov 4 13:43:23 2007 -0500
+
+    Merge branch 'master' of http://git.rubini.us/code
+
+commit 2c90ce28cc73e08d9fb74b5c7e815807314ba269
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Nov 4 07:18:09 2007 -0800
+
+    Updated CI excludes from 85d63b676e.
+
+commit 85d63b676e463a2bec9a322bc8eeffd2daee433b
+Author: Chen Yufei <cyfdecyf at gmail.com>
+Date:   Sat Nov 3 23:39:23 2007 +0000
+
+    Added specs for IO#gets
+
+commit be5b9595f2077080c0c1179ab9689352d8faea3a
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Nov 4 00:31:12 2007 -0700
+
+    Updated CI excludes.
+
+commit d46ad4b63d4a5f77609b0880b7f24e8e27404805
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Nov 4 00:11:52 2007 -0700
+
+    Updated CI excludes.
+
+commit 1f307223c673c6744f8b85fc3e707a3419b1a0e8
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Nov 4 00:06:48 2007 -0700
+
+    Guarded #freeze specs for MRI and JRuby.
+
+commit ca50fd7d979c36f8af306e0e1474aac5408dd66d
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Nov 3 23:22:31 2007 -0700
+
+    Guarded specs for #frozen? for MRI and JRuby.
+
+commit 16b36030a796b877809d5d6ea556266c4b4a6413
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Nov 3 20:53:26 2007 -0700
+
+    Removed NULL characters from language/precedence.
+
+    Enhanced rescue output when loading spec files.
+
+commit 10510ece16ebb5e0ba921e0be631a4740f3e4453
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Sat Nov 3 23:09:30 2007 -0400
+
+    Fix a method_missing cache error.
+
+commit b313c5632b039c03a448ae3b1046701c8b3243a2
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Nov 3 14:10:29 2007 -0700
+
+    Changed shared spec behavior to be compatible with RSpec.
+
+commit 7b825b89e96b3c8e38f9b8bcc8edf2bc6ec6ff22
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Nov 3 14:09:47 2007 -0700
+
+    Fixed language/class specs.
+
+commit 30d76181b0b3a9c5ac99c9d0e22a6a451346eff4
+Author: Kevin Clark <kevin.clark at gmail.com>
+Date:   Sat Nov 3 16:47:49 2007 -0400
+
+    Fix Dir#each/Dir#entries/Dir.foreach specs. They weren't updated for fixtures
+
+commit f44a8cceb9a186a7127276db2207dfc79957ee8d
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Nov 3 13:06:35 2007 -0700
+
+    Guard File.(un)link for jruby.
+
+commit 1ec2c3a99ca562c8944aac1f4a60f8e0af0aaf17
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Sat Nov 3 18:20:48 2007 +0100
+
+    Properly resize the array in Array#<<.
+
+commit 8dec9918d8a6233ec2cde29d54687a5d950dc8df
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Sat Nov 3 17:13:57 2007 +0100
+
+    Fixed Array#unshift for the case when @start > 0 && @start < values.size.
+
+    Also extended the Array#unshift specs to cover this case.
+
+commit 50b90918cd5a9a05e475690703c7867b443d191b
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Fri Nov 2 13:47:53 2007 -0500
+
+    added IO::foreach, fixed gets to use string separator, and fixed IO::readlines to use File.open
+
+commit 3efc01e110473d003ffb0a1376ec179f30e600de
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Fri Nov 2 13:30:44 2007 -0500
+
+    specs for IO::foreach and specs to test IO::readlines,IO.readlines with string separator
+
+commit fad18610b4416dfcfaf35db5029e880dff7e9820
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Mon Oct 29 14:10:11 2007 -0500
+
+    basic exec implementation and a single basic spec (not sure how test test exec)
+
+commit 730fc3ed9afc54612d14093148fb8583c9e39fe3
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Fri Nov 2 21:41:25 2007 +0100
+
+    Return mkdir()'s return value from Dir.mkdir.
+
+commit f5766696e701a069f908b3b5d5cfbccfee15ef1f
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Fri Nov 2 20:46:11 2007 +0100
+
+    Implemented Dir.foreach.
+
+commit c696f1edc50c58b87270811c0c9aa0e49b356fe7
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Fri Nov 2 20:38:36 2007 +0100
+
+    Implemented Dir.entries.
+
+commit e8e6188b252172690c1b584e528e3c71035897cd
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Fri Nov 2 18:16:13 2007 +0100
+
+    Raise an error if the opendir() call in Dir#initialize fails.
+
+commit 024309b560c6c69f6f331c614df1da221be7054c
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Fri Nov 2 16:15:19 2007 +0100
+
+    The Array#[]= spec seems to work now, so enable it.
+
+commit 76f118e62a0784326f5edf1c0fe46f6b6e682eee
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Fri Nov 2 14:28:49 2007 +0100
+
+    Made Math.ldexp only accept integers as the second argument.
+
+commit 22bd7369efd1f738835e9c0a6a4624a26dae02d1
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Fri Nov 2 13:30:50 2007 +0100
+
+    Implemented some missing File::Stat methods.
+
+commit d6dc42d9085fed5f8bf482d7f84dd9c5fbd4423c
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Nov 1 12:24:53 2007 -0700
+
+    Fixed specs failing MRI for File.stat and File.basename.
+
+commit 46f4de189e987f3071ede57f2bb1f7c892d67bd4
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Thu Nov 1 17:30:47 2007 +0100
+
+    Fixed ticket #83: Array#push doesn't die anymore after calling Array#shift.
+
+commit 8debed24e957e48b10d60885d9a43083aab4d923
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Thu Nov 1 11:14:22 2007 +0100
+
+    In the Numeric#coerce spec, coercing strings to numerics should work.
+
+    We can remove the TypeError checks from this spec, since those
+    are included in the specs for the Numeric operators.
+
+commit 28cf656fb25ce38453acb2efdcf2e9ac16bb4460
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Nov 1 01:33:31 2007 -0700
+
+    Removed Hash#fetch definition from fetch spec.
+
+    Fixed spelling of Hash#find_unambiguous.
+    Updated CI excludes.
+
+commit a6a69b469d94d0912ccbf123fdb9f53cbaf32830
+Author: Akshay Rawat <akshay.rawat at gmail.com>
+Date:   Tue Oct 30 21:47:51 2007 +0530
+
+    In the Time#isdst spec, don't depend on the system's current time zone.
+
+commit 1be129f98e0d548a023cc32f5ab763361e2a9c6b
+Author: Daniel Lucraft <dan at fluentradical.com>
+Date:   Wed Oct 31 21:05:04 2007 +0000
+
+    Fixed String#split to not return non-matching captures anymore.
+
+commit 5f7f798ef26fc8ee1e83c5e392c1fb2e60e31382
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Wed Oct 31 21:54:56 2007 +0100
+
+    In the Numeric#coerce spec, don't try to coerce strings to numerics.
+
+commit e26b7645af27d5bfc250c2c11f7e72349750f5c7
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Wed Oct 31 10:52:13 2007 +0100
+
+    Added a failing spec for Ticket #83.
+
+commit 9144f0c55eb5f40409bec514f08f89bdba61f800
+Author: Daniel Lucraft <dan at fluentradical.com>
+Date:   Wed Oct 31 13:57:54 2007 +0100
+
+    Fixed math/constants_spec.rb.
+
+commit 4b521cacb667ca5245954bc03ebfec67c0ac235c
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Wed Oct 31 23:26:45 2007 +1100
+
+    Modified spec to reflect expected differences in masgn retval behavior
+    between rbx (true) and MRI (array of rhs vals).
+
+commit 1f6c50f5c77566e66cb0b842733b7f4f4b24e937
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Tue Oct 30 18:13:47 2007 +0100
+
+    Use a fixed timezone for the Time#strftime spec.
+
+commit 60a25e997def085f3ae29773ce70ddc5b7c38d46
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Oct 30 00:47:38 2007 -0700
+
+    Fixed Kernel#raise to not output if $VERBOSE == nil.
+
+    Guard Marshal.dump specs to eliminate error output until
+    a proper Marshal is implemented.
+
+commit e446f2e329a6dfaacb45b5b86ba43ebd9ec606a3
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Oct 29 23:17:49 2007 -0700
+
+    Added IO::SEEK_SET, SEEK_CUR, SEEK_END with FFI.
+
+    Fixed IO#close to raise IOError if already closed.
+
+commit fcb1ac4d076c07065878c2e65bf7bb44ddef400c
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Oct 29 22:37:23 2007 -0700
+
+    Specs for IO#seek and IO::SEEK_SET, SEEK_CUR, SEEK_END.
+
+commit a3570f6702dabd303fcd10d4cfc0e753cff69bb5
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Mon Oct 29 22:33:34 2007 +0100
+
+    Make Module.new actually work.
+
+commit 9709fa96b91afe5140f76726f1f7d4b89f8a6d54
+Author: Brian Donovan <brian.donovan at gmail.com>
+Date:   Mon Oct 29 11:30:32 2007 -0700
+
+    Ticket #75: Fixed Enumerable#sort_by.
+
+    We must not call the comparison proc when the object and pivot are
+    identical.
+
+commit 52e97da6bbcd28ec4349abcf25b089648d085652
+Author: Akshay Rawat <akshay.rawat at gmail.com>
+Date:   Tue Oct 30 02:18:56 2007 +0530
+
+    Enabled Math specs that were fixed by Ticket #59.
+
+commit 0f98800d4ab1db526304f1d26597ca3880c811da
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Mon Oct 29 19:29:16 2007 +0100
+
+    Ticket #59: Kernel#send now calls private methods, too.
+
+commit 754e48c223c3464c7d048452585c07b8d0b3d8c7
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Oct 29 00:11:41 2007 -0700
+
+    Specs for IO#rewind.
+
+commit 0bfd6bcca8fb287899fadeae81dd7c00b05d07e9
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Sun Oct 28 23:40:37 2007 +0100
+
+    Module#public_instance_methods now handles attribute accessor methods.
+
+commit 0a22b36b9bc50a34f1da1d0e994f1a6689195652
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Sun Oct 28 23:26:17 2007 +0100
+
+    Added a failing spec for Enumerable#sort_by.
+
+commit 006534b173a186c25c228b653d5ac9d81b20f57e
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sun Oct 28 21:51:40 2007 +0100
+
+    Update Module spec excludes.
+
+commit 496df827eeeb600858fa8c7b26482aa3f653fee1
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sun Oct 28 21:50:47 2007 +0100
+
+    Make Module#ancestors specs pass.
+
+commit 18185cde2b47374c304e2528a084ea1f7b5178d2
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Sun Oct 28 19:46:22 2007 +0100
+
+    Added a failing spec for building an array that includes a splatted array.
+
+commit f120a470a5e07a7e53b1e006173942d58956e86b
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sun Oct 28 19:33:10 2007 +0100
+
+    Extended Kernel#` specs.
+
+commit 7e184c5bbc7be16cc8f7be01713543f222edd267
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sun Oct 28 19:00:52 2007 +0100
+
+    Removed Exception message dependencies and extended Kernel.String specs.
+
+commit 2853dc58209b3b8d122cee66c7d83e967d0879de
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Sun Oct 28 23:01:54 2007 +1100
+
+    Fix for multi-arg operator assign through [], e.g. x[0,3] += 5
+
+commit 91b88710ddc1e8553e51c404cee4039f4d6abf24
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sun Oct 28 13:05:08 2007 +0100
+
+    Fixed File.ftype specs.
+
+commit 448fdc2def3a9ab249dadf9335568ca30b76f70e
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Oct 28 00:36:11 2007 -0700
+
+    Updated compiler specs.
+
+commit 0fb510c14ee8787b5965d5665e50da92a988faa6
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Oct 28 00:32:41 2007 -0700
+
+    Fixed Bignum#coerce specs.
+
+commit 5e52a259b91e81fe5497f44107dee6ffd613b3be
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Oct 28 00:22:40 2007 -0700
+
+    Fixed wording on Rubinius Bignum#coerce extension specs.
+
+commit 19e0259ca51691afe341b1217ab92862b307fe17
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Oct 28 00:15:18 2007 -0700
+
+    Revert "Remove invalid and failing Bignum#coerce spec."
+
+    This reverts commit 2371b920ca3f956213ab9e406a3b5d2afab4f18e.
+
+commit 4986ec283ee5aa9e392065c74d64952d36554b91
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Oct 27 23:50:05 2007 -0700
+
+    Updated CI excludes for Array#pack.
+
+commit 5472f30201d7cddd4465adb246fa32927fe03d91
+Author: Alan Hurdle <alan.hurdle at gmail.com>
+Date:   Sat Oct 27 18:38:30 2007 +1000
+
+    Bunch of fixes to Array#pack to pass the current set of pack specs
+
+commit 20210a617a3f31c5dc0eda9fa371c49200c11f67
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sun Oct 28 02:30:02 2007 +0100
+
+    Updated spec excludes for Module specs.
+
+commit 712e3cc6a5d8a69834449e1039dfae3e07fcdcc2
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sun Oct 28 02:18:00 2007 +0100
+
+    Removed the dependency on some Exception messages.
+
+commit 2371b920ca3f956213ab9e406a3b5d2afab4f18e
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sat Oct 27 16:15:33 2007 +0200
+
+    Remove invalid and failing Bignum#coerce spec.
+
+commit e1e62e7749d47c838d6b7cd1e95863c0c90d3de0
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Sat Oct 27 20:59:49 2007 +0200
+
+    Fixnum#div now always rounds towards negative infinity.
+
+commit 9a4ccbe8381db5b6280c9d1dfcf6fa21a4838c4e
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sat Oct 27 15:09:57 2007 +0200
+
+    Updated Spec excludes for Bignum and Fixnum specs.
+
+commit 889c939a668b9b1a4fd8f5a0cfd8bad85c3a5977
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sat Oct 27 14:24:27 2007 +0200
+
+    Fix Integer#[] when given a Bignum.
+
+commit 45d97332f4ec5a174884024c954ceeb6eb852f5f
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sat Oct 27 13:46:51 2007 +0200
+
+    Partial fix for #68: Fix Hash#fetch to correctly handle yielding with a default value passed.
+
+commit a785ea28f39c71a98007a7fafc23985dd21b596f
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Sat Oct 27 13:39:42 2007 +0200
+
+    Updated CI excludes for recent Hash fixes.
+
+commit 6dd909fede466ed813ec7c5d207c5deeb69c9eb7
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sat Oct 27 11:33:22 2007 +0200
+
+    Fix for #67: Enumerable#sort should not depend on #size.
+
+commit 720489aa52bfabd492c307330204772b5eba6755
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Oct 26 00:21:37 2007 -0700
+
+    Updated CI excludes for spec/language.
+
+commit 41e8a07252b2df9c1e858922195a72f9a40c882c
+Author: Akshay Rawat <akshay.rawat at gmail.com>
+Date:   Fri Oct 26 02:37:18 2007 +0530
+
+    private keyword should mark a Module method private
+
+commit a201e631cbaabcc5964cfa3eb28a9fa8be1bf347
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Oct 26 00:11:01 2007 -0700
+
+    Added spec/language into CI specs.
+
+    Updated CI excludes for spec/language.
+
+commit 833fe76de0c0b900ef5255b2abecd19943404c0c
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Oct 25 23:53:35 2007 -0700
+
+    Updated compiler specs and CI excludes.
+
+commit f31e5af358d2b5c3ff4afd3819b3a3e571427f8e
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Oct 25 23:28:13 2007 -0700
+
+    Migrated Adam Gardiner's compiler patch 236d213de8 to stable.
+
+    Updated CI excludes for language/variables specs.
+
+commit bd9e47b1b7624df5e2ae0f31a7fd53c787ecc7e4
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Oct 25 22:50:22 2007 -0700
+
+    Fixed language/variables spec to use fixture class.
+
+    Added CI exclude file for language/variables specs.
+
+commit 688f03ac452f698105812c28c29dcc7162b7037c
+Author: Adam Gardiner <adam.b.gardiner at gmail.com>
+Date:   Thu Oct 25 22:43:20 2007 +1000
+
+    Added specs for operator assignment, i.e. +=, *=, ||= etc
+
+commit 982dfee01bedb55e8dbf62d279bc4a375e58ec50
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Thu Oct 25 16:53:45 2007 +0200
+
+    Don't hardcode the result of Hash#to_a in the Hash#shift spec.
+
+commit 4bf7c8d2d387c002004da5df9f9c2a06fb65e61e
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Oct 25 01:42:32 2007 -0700
+
+    Commit tilman's language block spec additions with some modifications.
+
+commit ff8f6f5b5f5285b0fcf361d84523bf21320074b2
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Wed Oct 24 20:20:12 2007 +0200
+
+    Extended the Hash#[] spec with a test case for ticket #65.
+
+commit dc61b1e771c70e54f98859da3dd31a4ea61384e1
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Oct 24 07:11:07 2007 -0700
+
+    Specs after(:each) MUST come before it blocks.
+
+    Updated CI excludes for IO.read specs.
+
+commit 06539bad037e0ef7368ea5cbb5780fce7bbea443
+Author: Marcus Crafter <crafterm at redartisan.com>
+Date:   Wed Oct 24 21:26:49 2007 +1000
+
+    Initial IO::read specs.
+
+commit a2f26d7a7b1997510edff1792eaec6507ba38208
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Tue Oct 23 19:30:46 2007 +0200
+
+    Implemented Numeric#remainder.
+
+commit 2bc5fcee6be4db3e0e0c46aa7c1b8ef5a5c57957
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Tue Oct 23 19:10:54 2007 +0200
+
+    Fixed Bignum#modulo(0.0).
+
+commit 68965dc12ea369f6db64c208cb2ce123c1398bb8
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Tue Oct 23 10:20:04 2007 +0200
+
+    Extended the Numeric#nonzero? spec a bit.
+
+commit 290ddde29d6c64e9c81f69780b7b0c967b2b4901
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Tue Oct 23 10:15:57 2007 +0200
+
+    Added Numeric#nonzero? and killed bad Fixnum#nonzero? in bootstrap.
+
+    This fixes the Numeric#nonzero? specs.
+
+commit e9a1b257fc95c181e46c679d301a324134a725d4
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Tue Oct 23 16:07:58 2007 +0200
+
+    Enabled the Numeric#step spec now that it works fine.
+
+commit f4016db94eee2ec93a2cc487181c9ec2fa0d59d0
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Wed Oct 17 13:51:04 2007 -0700
+
+    A number of fixes found while debugging test/unit and optparse
+
+commit 7c7920c3e7727c3514b493ba299a52c5e5cde8f6
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Mon Oct 22 18:12:42 2007 -0500
+
+    Numeric#step is capable of floats and passes all tests
+
+commit ebc6ec5be0239bba544c55ff77fdc88903f4bb28
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Mon Oct 22 20:56:33 2007 +0200
+
+    Made the Symbol#inspect spec pass.
+
+commit f0db8c3d1bb5dc444fc72ed5ca222f4cf5df8b35
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sun Oct 21 14:00:30 2007 +0200
+
+    Fixed a bug in process_op_asgn1 and added a simple spec for it.
+
+commit 4fbce6e8a6ab8fbb6b69944677678611db68bcf2
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sat Oct 20 20:03:50 2007 +0200
+
+    Fixed a failure in String#sub specs
+
+commit ca0332f9edb9e01ae216dee90674fb6f9809951c
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Sat Oct 20 22:33:42 2007 +0200
+
+    Fixed the Bignum#size spec for Rubinius' implementation.
+
+commit ae9c2ac3fe9dc59a027af7571d6d3083bcccb490
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sat Oct 20 14:14:49 2007 +0200
+
+    Don't rely on #respond_to? calls.
+
+commit 94938622aaf74e1f068c3b7ec8bfeccf763792ba
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Fri Oct 19 20:56:50 2007 +0200
+
+    Extended the private spec.
+
+commit bf000a15edcfdd30c43ae6563b5766617f245a60
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Oct 19 00:49:16 2007 -0700
+
+    Updated CI excludes.
+
+commit ad146fc7ae22bfc26a536a40cf8dc4c0338cf25c
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Thu Oct 18 19:45:27 2007 +0200
+
+    Added a spec for the 'private' keyword.
+
+commit f15b5a8c818932d0ab5bea46f48a326e468b3511
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Thu Oct 18 19:44:54 2007 +0200
+
+    Added Object#should_not_include.
+
+commit 80fdbd626d8ff99dc7ba4cf23a05d44ad98bd0cb
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Thu Oct 18 09:31:51 2007 -0700
+
+    Updates Hash so:
+    * No longer freezes keys
+    * Specs reflect the lack of freezing
+    * shift spec doesn't fail purely because to_a is broken
+
+commit 197f36b6626b61203709704db869324a539764d5
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Wed Oct 17 20:11:50 2007 -0500
+
+    moved File::expand_path to platform and made several fixes + new specs
+
+commit 7e8506fd510ab4e6f07e6d36456fdfef6e5b080a
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Wed Oct 17 21:07:44 2007 +0200
+
+    Make sure that File.dirname doesn't modify its argument.
+
+commit 271bc31ba814e68fb414ebf29cf9648f57fe4cb6
+Author: David Altenburg <david at gensym.org>
+Date:   Wed Oct 17 00:39:59 2007 -0500
+
+    Added to fork spec: check that fork returns a nil pid for the child process
+
+commit 5d45341c55400a51d8cae3128bba265e7d441fab
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Wed Oct 17 05:19:49 2007 -0500
+
+    moved File.basename to platform, added specs, and fixed specs for all but a disputable behavior
+
+commit ae7afd794881a4dedadf876f61369e5e88da695b
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Wed Oct 17 04:47:24 2007 -0500
+
+    added platform/file.rb and fixed File.dirname for all and updated specs
+
+commit 71bf9b1c9cd7fb81692186d21b133fde43e8a6b7
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Wed Oct 17 03:44:33 2007 -0500
+
+    spec to check if break exits all types of yields and loops correctly
+
+commit 3a546b40271d35bf7c60bb56a68ca49089ac9a34
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Wed Oct 17 03:01:40 2007 -0500
+
+    clarified include_spec
+
+commit 40d8ed96fa689daf31039e71f91ed5520a821aa2
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Wed Oct 17 02:38:46 2007 -0500
+
+    specs Module#include and Class#include that check to see if constants, public_methods and instance_methods are imported correctly
+
+commit ff462080a58aaa61759830e18f3a5757a883980d
+Merge: 5a2c858... 5cf41ab...
+Author: Jon Guymon <gnarg at kiryo.(none)>
+Date:   Wed Oct 17 01:55:33 2007 -0400
+
+    Merge branch 'puts_specs'
+
+commit 5cf41abaff9dc04cdba5fe50492d4ebfdde2a274
+Author: Jon Guymon <gnarg at kiryo.(none)>
+Date:   Wed Oct 17 01:55:01 2007 -0400
+
+    normalized specs for IO#puts StringIO#puts and Kernel#puts
+
+commit 5a2c858086c1b02a54864ff82c12d4bf3a559535
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Wed Oct 17 00:43:24 2007 -0500
+
+    fixed posix File.join and added edge cases to specs
+
+commit e7972b8617b8b0ef2a19a1f7ddedd4d93ab80f5c
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Oct 16 21:17:21 2007 -0700
+
+    Commit gnarg's loop specs (#49).
+
+commit 3fcdd60b4c9fc20081987bb13aab37b9419939a3
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Tue Oct 16 19:46:36 2007 +0200
+
+    Make this spec usable by loading pathname.
+
+commit 276b6cc5620a5a3629d56b04ade7c397a48c2488
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Oct 16 00:53:11 2007 -0700
+
+    Exclude metaclass instances from Module#ancestors list.
+
+commit e108e7f3f8a6ef7cf2acf4bb7e7a6609900a3ebc
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Oct 16 00:06:54 2007 -0700
+
+    Updated CI excludes.
+
+    Updated compiler specs to match recent changes.
+    Added compiled core/string.rb from changes in edeffe90517.
+
+commit 1a1410f394b3de23b63560f2a5c1312cc6451d2e
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Mon Oct 15 19:49:40 2007 -0500
+
+    spec for __FILE__ added
+
+commit e158c3130f033a1029ae26888b8e7e541f2b388a
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Mon Oct 15 19:46:58 2007 -0500
+
+    spec for __LINE__ added
+
+commit d09ad9e6b28c91f5d00db5d0b369c4932eabbe2b
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Mon Oct 15 18:45:48 2007 -0500
+
+    spec for throw/catch inside of ensure reverted and clarified
+
+commit 0e5336f1572fc1ad766cff61d8843410d28df9db
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Mon Oct 15 18:33:27 2007 -0500
+
+    spec super refactored into fixtures and expanded to test all methods on each class
+
+commit b998ec8e682c3a0f2160066bb84f40b68f748407
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Mon Oct 15 16:26:58 2007 -0700
+
+    Implement undef and Module#undef_method
+
+commit fed8486110930cabce64e0421638a867740e4d21
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Mon Oct 15 15:54:44 2007 -0700
+
+    A bunch more language spec cleanups.
+
+commit 66086cb333432a29d4c4ce4fec6a01c0ac88c5a5
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Fri Oct 12 19:33:59 2007 -0700
+
+    Bunch of compiler fixes to pass more language specs
+
+commit 680e0ca4cafb20fa053f0dd5cd72915da9fbc86f
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Mon Oct 15 17:36:09 2007 -0500
+
+    specs for super involving inheritence, modules and metaclasses
+
+commit 167febd232f5cf4696cf8e81a96d1c9d80744e36
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Oct 15 15:32:48 2007 -0700
+
+    Update CI excludes on OS X.
+
+commit 948e2573800859931e8c61e72069c21e9a50193b
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Oct 15 14:23:02 2007 -0700
+
+    Update compiler specs to match recent changes.
+
+commit a015bac050e1080548bd947c5f59b344175a809d
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Mon Oct 15 23:51:01 2007 +0200
+
+    Enabled the remaining Bignum#& spec.
+
+commit 0b37b2946772ea41fe7b14c762be7fdbaa4a6f8d
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Mon Oct 15 18:20:56 2007 +0200
+
+    Updated Spec excludes for Bignum.
+
+commit ae613272bcf0c260ad3da00ffd14d4a76422ac46
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Mon Oct 15 08:30:11 2007 +0200
+
+    Added the beginnings of a File.stat spec.
+
+commit 81147d2eadb0397c2bcc1b9dd620bb55b6e0e53d
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Oct 14 11:33:21 2007 -0700
+
+    Fixed Float#to_s for numbers of the form "\d+.0".
+
+commit 2f9ba53190ca19ca425126d1319f47b3bbce12f6
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sun Oct 14 18:57:04 2007 +0200
+
+    Updated Bignum excludes.
+
+commit 0c81822cf703da13f6a8783cc6cd4ad453d2ff74
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sun Oct 14 18:05:45 2007 +0200
+
+    Add some OpenStruct specs.
+
+commit add2a900029530cb35b6463525313f432b7f36f4
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sun Oct 14 17:29:38 2007 +0200
+
+    Extended some more Bignum specs.
+
+commit 45cf3a275d390d4ae1d995eca89e10ba82d2288f
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sun Oct 14 17:29:01 2007 +0200
+
+    Extended the Fixnum#to_s specs a bit.
+
+commit d8a42cdd57967ee07cccfa5f3f814d97353c48c9
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Sat Oct 13 23:16:37 2007 +0200
+
+    Fixed the bug that broke 'case' blocks with a single 'when' statement.
+
+    Acked-by: Wilson Bilkovich <wilson at supremetyrant.com>
+
+commit 5624627fd61378fce65aebf2ffacc39c45ac5ee6
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Sat Oct 13 23:48:32 2007 +0200
+
+    Ticket #37: Fixed Bignum#& segfaults when the argument isn't a bignum.
+
+commit 2081e5f53ba80cb9aa2ee272d4e543db1d4e732e
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sat Oct 13 23:43:08 2007 +0200
+
+    Modify and extend Bignum specs a bit.
+
+commit 7917f4f8a538a3251e3cb17d55e4cf2a523af8d5
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sat Oct 13 23:42:44 2007 +0200
+
+    Modify the fixnum specs a bit.
+
+    Remove dependencies on Exception messages.
+
+commit 171f25c25865da618c2e2a9a7b221abda613efa4
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sat Oct 13 02:02:12 2007 +0200
+
+    Extended Fixnum#<=> specs a bit.
+
+commit f708429a161c52dd713b4239527247c57fa158af
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Sat Oct 13 23:30:37 2007 +0200
+
+    Guard bin/ci from running the new Bignum#& specs, which segfault (on OS X at least).
+
+commit 19f40e0ae1b60c037d0c38537a0924ad5726902a
+Author: Ben Curren <ben at esomnie.com>
+Date:   Sat Oct 13 13:46:35 2007 -0700
+
+    Refactored const_name_to_sym to share logic with Class#attr.
+
+commit ee9daad614fa746a3fe2fc1b9123c65dbb0814c7
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Oct 13 11:52:08 2007 -0700
+
+    Identify which ruby platform and version before changing this spec!
+
+    Revert "Fix spec to expect correct result."
+
+    This reverts commit 8268469c563943cba6c1afce5d84defbc35f1789.
+
+commit 14a7781944491e5a1c3f5c664adcac4e1c383f2f
+Author: Tilman Sauerbeck <tilman at code-monkey.de>
+Date:   Sat Oct 13 17:15:24 2007 +0200
+
+    Added a failing spec for 'case' with only one 'when' statement.
+
+commit 8268469c563943cba6c1afce5d84defbc35f1789
+Author: Tom Mornini <tmornini at engineyard.com>
+Date:   Sat Oct 13 03:22:47 2007 -0700
+
+    Fix spec to expect correct result.
+
+commit 671f93c69e74976c3f5886c7fe8eb32402ccd338
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Fri Oct 12 19:06:07 2007 -0500
+
+    specs exiting threads using return, raise, and throw
+
+commit 119154a3ea5ecee20e77726b38fb58ee4b536d48
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Fri Oct 12 18:59:47 2007 -0500
+
+    spec to ensure throw exits from correct nesting and can return a value
+
+commit f36f68f075b34b5436257aba1ae41c14c04adcae
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sat Oct 13 01:54:42 2007 +0200
+
+    Method#[] specs should include the fixture classes.
+
+commit 22d32a24eb799307e42af55b04752c74ff500080
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sat Oct 13 01:40:01 2007 +0200
+
+    Extend Bignum#coerce, Bignum#&, Bignum#| and Bignum#^ specs.
+
+commit e1f682e27d2486d65297cf2121c354a99954a56e
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sat Oct 13 01:38:55 2007 +0200
+
+    Removed a dependency on an exception message in Fixnum#coerce specs.
+
+commit 9754ed5e74eeb6d62f0015f3615d077aa2e58a6f
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Fri Oct 12 21:41:56 2007 +0200
+
+    Fixed File.chmod and File#chmod specs on win32.
+
+commit 5ad3a4b7035bdade48586191c6e26cde1e74976c
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Sat Oct 13 01:37:46 2007 +0200
+
+    Remove wrong spec from Bignum#divmod.
+    Update CI excludes.
+
+commit b068c8634b56cd9129f9fc7c309bfa81869209c8
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Fri Oct 12 18:21:52 2007 -0500
+
+    specs for behavior of throw/catch and how they interact with ensure
+
+commit 45d4a8be8f20b2b70d32d0fdd340feb8897a1ad7
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Sat Oct 13 01:21:21 2007 +0200
+
+    Add (skeletal) Process::Status.
+    Set $? in Kernel#system and Kernel#`.
+
+commit ef1499962a16a7ce85bffe9e61863d2806caf6ec
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Fri Oct 12 23:52:16 2007 +0200
+
+    Regenerate core/dir.rbc and CI excludes for Dir.
+
+commit b999f31ded2a7eccb856d95653a2826a3a190204
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Fri Oct 12 23:02:39 2007 +0200
+
+    Fix typo in Dir.mkdir.
+
+commit de235630aa08df803be0420084b0a61ee35f5448
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Oct 12 13:56:13 2007 -0700
+
+    Added dev_null spec helper for capturing or silencing $stderr, etc.
+
+    Fixed failing specs on OS X MRI 1.8.5.
+
+commit 01e27ea5fa0e0f0d170cd88f128adfbb2a2703bd
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Fri Oct 12 22:01:43 2007 +0200
+
+    Add spec for backticks and their setting of $?.
+
+commit f7b18c19e47c15f3ab05f8fa548eff034206b0d8
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Oct 12 13:21:03 2007 -0700
+
+    Added guards to make specs pass on ubuntu feisty MRI 1.8.5.
+
+    Fixed rspec_helper should_include to take multiple args.
+
+commit b2d25d4a502dca79ea98f60d937be7dbd8f496d2
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Fri Oct 12 14:19:55 2007 -0500
+
+    spec for retry/redo to control order of an enumeration
+
+commit eec535a19dc2b20156349720dc3bb526c9fa4f1e
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Fri Oct 12 18:53:33 2007 +0200
+
+    Revert "Fix Kernel#`: set $? to the subprocesses exit status.  Add a spec to check that."
+
+    This reverts commit 40da2d5c68196c3c9002c4ca75ead0fefc520bef.
+
+commit 40da2d5c68196c3c9002c4ca75ead0fefc520bef
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Fri Oct 12 18:43:44 2007 +0200
+
+    Fix Kernel#`: set $? to the subprocesses exit status.  Add a spec to check that.
+
+commit 5da57253750e854bd9baf5378684222a895e7fd9
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Fri Oct 12 16:24:18 2007 +0200
+
+    Shield "strange block args" spec from being run by mspec.
+
+commit 2a8f7d7dd6b0f7f800320f84d16d5d089357e085
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Fri Oct 12 14:48:42 2007 +0200
+
+    Fix block specs for MRI.
+
+commit ade6c39f6199198e0015558698bc7d0333f7bcd0
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Fri Oct 12 12:07:49 2007 +0200
+
+    Fix Array#delete specs.
+
+commit 825af45d5effb6909bb0832f92621b96e51dc380
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Oct 12 01:15:23 2007 -0700
+
+    Updated CI excludes.
+
+commit e1bfb47d3560929512cbdf5c27f56c92435ce29f
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Oct 12 00:40:53 2007 -0700
+
+    Removed printing summary at exit in mini_rspec.
+
+    Set $VERBOSE=nil when running the specs.
+    Fixed specs failing MRI.
+
+commit 1f1a041d8bcfaeb8dd3cb17f7d31b21281e690a2
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Oct 11 18:26:14 2007 -0700
+
+    Moved shared specs to shared directories.
+
+    Rewrote Module#method_missing specs.
+
+commit f9177eb198003b495f485a13910808fe603030ad
+Author: Ben Curren <ben at esomnie.com>
+Date:   Thu Oct 11 20:54:22 2007 -0700
+
+    Added a failing test for setting and getting constants on an instance of a module.
+
+commit d9cbad87fd4d578e4f637627fa03cab312882a36
+Author: Ben Curren <ben at esomnie.com>
+Date:   Thu Oct 11 20:51:27 2007 -0700
+
+    Updated the excludes for module tests.
+
+commit 938f034bad41f4fe3391b941e536bce9e1be0af6
+Author: Ben Curren <ben at esomnie.com>
+Date:   Thu Oct 11 20:49:57 2007 -0700
+
+    Updated const_set_spec to not create a new instance of Module for testing purposes.
+
+commit 550caaf78723b00f95c5f8f38215b15a0940698a
+Author: Ben Curren <ben at esomnie.com>
+Date:   Thu Oct 11 18:21:01 2007 -0700
+
+    Updated the excludes for the tests that are now passing.
+
+commit 82c51fc652e215f0dc421099329c03a37af8e8f8
+Author: Ben Curren <ben at esomnie.com>
+Date:   Thu Oct 11 17:56:48 2007 -0700
+
+    Updated const_set and refactored the valid_const_name? further.
+
+commit c6323c74d0ee7b554d2cfbff3bd8d85ea910e0c9
+Author: Ben Curren <ben at esomnie.com>
+Date:   Thu Oct 11 12:01:27 2007 -0700
+
+    Added logic to remove Object and empty from a recursive string for const_get and const_defined?
+
+commit c108d2a623f5041f46b6efa32d0b331f4f91d669
+Author: Ben Curren <ben at esomnie.com>
+Date:   Thu Oct 11 11:58:04 2007 -0700
+
+    Added back the recursive case for const_get and const_defined?
+
+commit b976f184d8ade3b5d32d3e7ec11027c21c2bce2a
+Author: Ben Curren <ben at esomnie.com>
+Date:   Thu Oct 11 11:33:41 2007 -0700
+
+    Refactored const_defined to use const_get.
+
+commit 82c5c14b948cedbf3bed5f7996634b0238e4de55
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Thu Oct 11 17:38:05 2007 -0700
+
+    Bunch of compiler fixes, almost have test/unit and optparse running.
+
+    * Adds support for /ao#{name}/o (aka dregx_once)
+    * Invalid redo's raise an exception at runtime instead of compile time
+    * defined?(a.foo) works
+    * Lots of work on getting the block arg semantics right, including a new
+      instruction, passed_blockarg which is used to detect at runtime how
+      many block args were passed in.
+    * bug in 'yield 1, 2' versus 'yield [1, 2]' fixed
+    * A little better error reporting on compile errors
+    * Fixed Class#<, added #>, #<=, and #>=
+    * Fixed Hash.new
+    * Fixed nested case problem
+
+commit 1369b104a3f966dd4d279362afdc6ccb72f06de3
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Thu Oct 11 22:47:16 2007 +0200
+
+    Fix String#eql? specs.
+
+commit b190009707c120edb257a9ad92697145092c5612
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Thu Oct 11 10:57:10 2007 -0700
+
+    Shield parse errors in block args properly
+
+commit 0509ecbd6aeb973061866c5e04c590f975174b41
+Author: Ben Curren <ben at esomnie.com>
+Date:   Thu Oct 11 10:21:08 2007 -0700
+
+    Updated tests to test FixNum being passed to const_defined?
+
+commit 80116298779dc5afd3294cd83d758d76d0dcdf50
+Author: Ben Curren <ben at esomnie.com>
+Date:   Thu Oct 11 10:16:46 2007 -0700
+
+    Added error checking to const_defined?
+
+commit eed3ae097b1dae17e45cdb959b75d1fa7cf21c1b
+Author: Ben Curren <ben at esomnie.com>
+Date:   Thu Oct 11 09:25:53 2007 -0700
+
+    Convert paramter to_str if it responds to the method.
+
+commit 348df85a082eee56c301bce594d6c522050e34dd
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Wed Oct 10 18:49:34 2007 -0500
+
+    specs for language/retry and updated redo to show differences between them
+
+commit e924e2bb206317e8f5375c979f5e4e1046fccca9
+Author: Tom Mornini <tmornini at engineyard.com>
+Date:   Wed Oct 10 00:55:47 2007 -0700
+
+    Add Class#attr, refactor Class#attr_reader, Class#attr_writer and
+    Class#attr_accessor, pass all specs for Class#attr_*, fix a couple of issues
+    with said specs.
+
+commit 21b0bdc67c6a8cc4ad4b9d3942a2608fb45da31d
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Oct 9 15:10:04 2007 -0700
+
+    Commit #198, patch from Will for Module#(private|public)_class_method.
+
+commit 2cf5f0b4683d0a65181c1450d0714c4e165db1cd
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Tue Oct 9 21:00:13 2007 +0200
+
+    Moved shared specs.
+
+    Moved shared specs into the 'shared'-subdirectory so specs don't depend on each other anymore. Added some more shared specs.
+
+commit e558fab61ce9f7c5211d005aff2c5e8fc1b39931
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Tue Oct 9 19:53:46 2007 +0200
+
+    Fixed a failing Array#each spec. Closes #14.
+
+commit 0d77eefd718c826e02376edc8643364eb511773d
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Tue Oct 9 19:09:17 2007 +0200
+
+    Removed remaining dependencies on Exception messages in Fixnum specs.
+
+commit dd4063ba46eb313a57957d76dce3608dd8e5c161
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Tue Oct 9 18:58:01 2007 +0200
+
+    Fixed String#crypt spec.
+
+commit d5a2bb2b000fae7391e512c5bcab054ce967de3b
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Oct 9 09:35:51 2007 -0700
+
+    Updated CI excludes after applying Akshay's Precision specs patch.
+
+commit 10cd5764bbf51f1defa6815f8b07fcdce0de8875
+Author: Akshay Rawat <akshay.rawat at gmail.com>
+Date:   Thu Oct 4 21:48:15 2007 +0530
+
+    Specs for the module Precision
+
+commit 2e711c30e4e9ce50d9c20ab14a3b99ea47be32e9
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Tue Oct 9 13:56:45 2007 +0200
+
+    Make IO#puts specs pass in MRI.
+
+commit 13dc28c47c3211f01663d002847badb50277f277
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Tue Oct 9 13:44:51 2007 +0200
+
+    Silence warnings when running Hash specs in MRI.
+
+commit 52f903938f4eacf4465f7a36cacb25aa662aa559
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Tue Oct 9 13:44:02 2007 +0200
+
+    Turn Hash#values_at into a shared spec.
+
+commit 1e02ced5a68f16b8a65809136d954c68c9fdc590
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Tue Oct 9 12:59:58 2007 +0200
+
+    Add a few more specs for Struct#new.
+    Regenerate CI excludes for Struct.
+
+commit 94ea8c1f25761384796e9499e0b4b3faeba9da66
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Tue Oct 9 12:48:03 2007 +0200
+
+    Silence warnings when running Struct specs in MRI.
+
+commit 5ea6b219a8465cfad86dae9ae12d6a8d85812532
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Tue Oct 9 12:42:58 2007 +0200
+
+    Apply patch from ticker #23 by Jon Guymon (gnarg).
+    Make Struct specs not depend on method argument evaluation order.
+
+commit 8cbf7b94300e6ebcc0ee3cbe0de8123ef3563e96
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Oct 8 22:08:29 2007 -0700
+
+    Fixed that including a module includes the whole chain.
+
+    Fixed that Module#include only allows modules.
+    Simplified some module fixtures.
+    Updated CI specs for module.
+
+commit 4e7e2768d50392831a4d26f236d4cff733418225
+Author: Ben Curren <ben at esomnie.com>
+Date:   Mon Oct 8 11:54:51 2007 -0700
+
+    Added puts spec for io and updated IO implementation to match MRI's. Updated Kernal#puts to delegate to $stdout.puts.
+
+commit edc724086e84725995ed1720d4fa7a781fd9c3c6
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Oct 8 09:24:40 2007 -0700
+
+    Updated CI excludes for Module#define_method.
+
+commit a53ddb723a10d692223f05a49679e17f403fa128
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Mon Oct 8 01:05:04 2007 +0200
+
+    Fixed some Fixnum specs to not depend on error messages.
+
+commit d6bc4b47f3f395980c92f323cf029da1ccdba709
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sun Oct 7 23:42:12 2007 +0200
+
+    Added another failing spec for Module#define_method.
+
+commit 49435e31289f593a118377b3513ec9e7cdfea06b
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sun Oct 7 23:37:19 2007 +0200
+
+    Added failing specs for Module#define_method when given an UnboundMethod.
+
+commit 821c0114777fb2a77f1c85f216ee54e4c5340943
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Sun Oct 7 22:29:47 2007 +0200
+
+    Apply patch from ticket #15 by Jon Guymon (gnarg).
+    Add Struct#eql?.
+    Rebuild core/struct.rbc.
+    Add more struct specs.
+    Update CI excludes for Struct.
+
+commit 1f14c3510d4563930d11155f36717c0fb851c678
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sun Oct 7 18:13:33 2007 +0200
+
+    Added some GetoptLong Specs.
+
+commit f9c8c00649212b924561300abbd0cb037c1d278d
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Oct 6 23:00:05 2007 -0700
+
+    Update CI excludes for File#executable.
+
+commit 6d4427d07fc474e2404cdd2b6f3b925d99d90e67
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Oct 6 22:50:45 2007 -0700
+
+    Updated spec/excludes.txt from 72 items to 17.
+
+    Added -V | --verbose flag to bin/mspec.
+    Updated CI excludes.
+
+commit d4f5e44a8e2f8e682b779f45d12d060e83eb9fc7
+Merge: a035e9d... 42abc5e...
+Author: Jason Yates <jaywhy at gmail.com>
+Date:   Sat Oct 6 15:18:45 2007 -0400
+
+    Merge branch 'master' of git at git.rubini.us:code
+
+commit a035e9d3d204cf7e5ddb2fec72ca471ff33c3b9b
+Author: Jason Yates <jaywhy at gmail.com>
+Date:   Sat Oct 6 15:13:28 2007 -0400
+
+    fix a bug in the File.executable? spec
+
+commit 3c23c945aaf143aa8706b1cd2956908a71940e26
+Author: Jason Yates <jaywhy at gmail.com>
+Date:   Sat Oct 6 15:09:55 2007 -0400
+
+    fix bug in File.executable? spec
+
+commit 94e59065bf921ae167a6b04edfef40de336978a1
+Author: Jason Yates <jaywhy at gmail.com>
+Date:   Sat Oct 6 15:03:14 2007 -0400
+
+    Revert "Revert "Add a few more Proc#call specs.  And CI excludes.""
+
+    This reverts commit 7658362c3882c6be2ef67f6b57d6c6796ff5de98.
+
+commit 42abc5ed6e1ced2fa86e9dc9379c6bed4da4537e
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Oct 6 11:40:49 2007 -0700
+
+    Updated CI excludes for Kernel specs.
+
+commit 7658362c3882c6be2ef67f6b57d6c6796ff5de98
+Author: Jason Yates <jaywhy at gmail.com>
+Date:   Sat Oct 6 14:29:28 2007 -0400
+
+    Revert "Add a few more Proc#call specs.  And CI excludes."
+
+    This reverts commit 567659dee34014d037d4797bf0c171597e0ac05d.
+
+commit 567659dee34014d037d4797bf0c171597e0ac05d
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Sat Oct 6 16:23:54 2007 +0200
+
+    Add a few more Proc#call specs.  And CI excludes.
+
+commit d8e737b09f8ed984e57b4fbbd5c016a7643aa67d
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Sat Oct 6 15:56:33 2007 +0200
+
+    Fix Array#slice specs.  Regenerate CI excludes.
+
+commit c79eeb620296a1802e6d194463063555638911bf
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Sat Oct 6 14:34:05 2007 +0200
+
+    Fix Array specs that depended on respond_to? being called on coercion.
+    Regenerate CI excludes for core/array.
+
+commit 8a60522fd8237fdfa36ef5518c9642216c66f8d6
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Sat Oct 6 14:08:22 2007 +0200
+
+    Guard Array specs for #freeze.  Fix MRI Array specs for #freeze.
+    Regenerate CI excludes.
+
+commit eaaab65c54c3b81397441169761774ef95867297
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Sat Oct 6 12:47:55 2007 +0200
+
+    Add specs for Proc#call.  Regenerate CI excludes.
+    (Most of these seem to be from e6cf8978.)
+
+commit 19bcb0f6ec1b2247985823492f0c25f0aa5d94ab
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Sat Oct 6 12:09:29 2007 +0200
+
+    Slightly amend the core/hash specs.
+    Regenerate CI excludes.
+
+commit 6d1afe325098a73757980bb208fb2c8c64bd016b
+Merge: ac9365e... 0d22ef5...
+Author: Jason Yates <jaywhy at gmail.com>
+Date:   Sat Oct 6 01:13:59 2007 -0400
+
+    Merge branch 'master' of git at git.rubini.us:code
+
+commit ac9365e384263b6f062353f2afab3e33d8f84f3e
+Author: Jason Yates <jaywhy at gmail.com>
+Date:   Sat Oct 6 01:13:23 2007 -0400
+
+    added spec for OpenStruct
+
+commit e6cf8978a6dd441d5d4793c48438fab4150ca750
+Author: Jason Yates <jaywhy at gmail.com>
+Date:   Sat Oct 6 00:14:01 2007 -0400
+
+    added several tests to Proc
+    added tests for Kernel#lambda and Kernel#proc
+
+commit 7b69ae066cab2252375d1ad19c6f17b365c47c32
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Oct 5 18:51:11 2007 -0700
+
+    Updated CI excludes for Array.
+
+commit f216e89033d10f3500798561282e48aa0e5b5537
+Author: Jason Yates <jaywhy at gmail.com>
+Date:   Fri Oct 5 20:45:41 2007 -0400
+
+    really simple spec for the Singleton class.
+
+commit d682b176237a988afa7ebdb3460d64ea41fab919
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sat Oct 6 01:54:31 2007 +0200
+
+    Applied esomnies
+
+commit b3018362c0cad86a5a026eb39b5f6ea4a8af1192
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Sat Oct 6 01:24:05 2007 +0200
+
+    Guard Hash specs for #freeze.
+
+commit a185f463adbab1d6f82126dde9abe88a29e83283
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Sat Oct 6 01:15:23 2007 +0200
+
+    Fix workarounds in core/hash specs.
+
+commit d796eb3d8a5d9a070b105f1fe0e9f46be5bfaaee
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Fri Oct 5 17:09:48 2007 -0500
+
+    specs for UDPSocket client/server
+
+commit 46a9c1a0d0610865b659c289293b444f0b3d6ae9
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Oct 5 15:32:56 2007 -0700
+
+    Fixed bin/ci to not load spec/excludes.txt for every file.
+
+    Fixed bin/mkspec to not overwrite an existing spec file.
+    Updated Fixnum CI excludes.
+
+commit 1099f49c06de5621aff36216179f46c308e60a38
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Oct 5 14:40:24 2007 -0700
+
+    Added basic IO#readlines spec and implementation.
+
+commit edc438039ee503c7b9d1fb83b04bd9bc1664cda5
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Sat Oct 6 00:09:41 2007 +0200
+
+    Regenerate core/hash.rbc, core/hash CI excludes.
+
+commit 2ad7d015a316620a488ed1cdeb45fe696b9d410a
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Fri Oct 5 23:56:59 2007 +0200
+
+    Extend core/hash specs to check for LocalJumpErrors.
+
+commit 42d961f0ab8a7e23a822b41ca82aaed5a48da2bf
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Fri Oct 5 23:21:20 2007 +0200
+
+    Refactor and fix Hash#inspect.
+
+commit b51402d8724478b85789d19857a2a48442470fcb
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Oct 5 11:29:08 2007 -0700
+
+    Fixed bin/mkspec to not create the spec file stub if the file exists.
+
+commit efe79de398db491ce97666a3f4f3b38265c1ab95
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Oct 5 10:55:52 2007 -0700
+
+    Updated CI specs. Guarded String specs for #freeze.
+
+commit 8647951df433d427be31bec060edf5b7efb46e46
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Fri Oct 5 17:04:25 2007 +0200
+
+    Replaced all occurrences of Object#coerce_to with Type.coerce_to and removed Object#coerce_to.
+
+commit 778e11d2df647cf91a712bb30df34152c71dbc3f
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Fri Oct 5 11:42:40 2007 +0200
+
+    Don't work around rbx bugs in Hash specs.
+
+commit 4b42923eb2cdebe43f9e9dd80fff98d9ded26e4b
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Fri Oct 5 11:29:33 2007 +0200
+
+    Fix Hash specs to pass in MRI again. (Doh!)
+
+commit 8a4f0b1c0d95b7a87ed99583797cf7d3710fb15a
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Oct 5 02:24:30 2007 -0700
+
+    Updated CI excludes for Hash.
+
+commit cecbf342546f37f4923728e8381e7fafcb039633
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Oct 5 02:22:41 2007 -0700
+
+    Changed bin/ci to run in a single process. Updated CI excludes.
+
+commit ba0f4ef5405665c84af4410d70be5ef911a93195
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Thu Oct 4 22:58:50 2007 -0700
+
+    Adds the intern spec from Ticket #8
+
+commit 0721f6ea40f51202ec9d2d421061be92e05a18b9
+Author: Jason Yates <jaywhy at gmail.com>
+Date:   Thu Oct 4 22:39:00 2007 -0400
+
+    Commit #207 Xavier Shay Enhanced specs for Hash
+    fixed Binding#dup spec
+
+commit ce4a1866ef65e041fbed224c3f694ca534d0a0d1
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Thu Oct 4 18:24:21 2007 -0700
+
+    makes String#delete faster
+
+commit 7ec0eeadf554150159f0a04468b16de8f06c2e8a
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Fri Oct 5 00:32:25 2007 +0200
+
+    Whoops, two more frozen TypeErrors I forgot.
+
+commit 78a3de42bf0e6f1478b2aac903c25143fd56195a
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Thu Oct 4 23:17:42 2007 +0200
+
+    Regenerate CI excludes and core/hash.rbc after revert.
+
+commit beaa5d022b19cb70213d4fe14e10d7f1a5f90a3a
+Merge: c7ea881... 8cb4b0b...
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Thu Oct 4 16:12:41 2007 -0500
+
+    Merge branch 'spec_block_parameters'
+
+commit 8cb4b0b2c3c766618a523a0ef9a83106761ee2f8
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Thu Oct 4 16:11:15 2007 -0500
+
+    specs for setting variables in block parameters
+
+commit c7ea8812f74184e6ee33bb236766f32fface2f95
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Thu Oct 4 22:57:09 2007 +0200
+
+    Regenerate CI excludes for spec/core/hash.  New hash.rbc.
+
+commit 939e8c533fb70586f8c7c6f3506d6be13f492d78
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Thu Oct 4 22:11:18 2007 +0200
+
+    Fix Hash specs: don't depend on coercion to call respond_to?
+
+commit 422e45f210ec9dc2438ae3b11544823bb6ffdd50
+Author: Jason Yates <jaywhy at gmail.com>
+Date:   Thu Oct 4 16:21:27 2007 -0400
+
+    added specs for FileTest#exists? and FileTest#exist?
+
+commit e43466b52184a042bd38d33273acf7afa4580a96
+Author: Jason Yates <jaywhy at gmail.com>
+Date:   Thu Oct 4 16:12:58 2007 -0400
+
+    added spec for File.exists?
+
+commit 9f69c8193d92752a2be7c21d23dfe90fb9765f11
+Author: Jason Yates <jaywhy at gmail.com>
+Date:   Thu Oct 4 16:03:33 2007 -0400
+
+    fixed grammar error in Method#clone
+
+commit 9321aacf703eaec6d6bc26cce83ed7475cb27d46
+Author: Jason Yates <jaywhy at gmail.com>
+Date:   Thu Oct 4 16:00:31 2007 -0400
+
+    added several specs for Module
+
+commit a282c1c4c137e1bdeae34f2f9cd58bc73f257809
+Author: Jason Yates <jaywhy at gmail.com>
+Date:   Thu Oct 4 14:19:07 2007 -0400
+
+    added specs for Kernel#binding and Binding
+
+commit 3e92b4528dbf47b80a25232979554f7e4309460a
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Oct 4 10:45:10 2007 -0700
+
+    Fixed ffi_sprintf_[fd]. Updated String spec CI excludes.
+
+commit 9e9a292a8a4befeb8a928d476119b02ac0df976e
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Thu Oct 4 18:53:47 2007 +0200
+
+    Alias Object#object_id to Object#__id__
+    Regenerate CI excludes for spec/core/kernel
+
+commit 8790e93c6d231baf7da07f11d02b91a38d28375e
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Wed Oct 3 18:23:42 2007 -0700
+
+    Superclass checking and loop {} fix.
+
+commit 718ae6f28223e94b8ca0f3af7ce321c81a597804
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Thu Oct 4 15:05:59 2007 +0200
+
+    Slightly extend Object#kind_of? specs.
+
+commit 7fa087a7058fe8872bb9743abd6dd472cd2119d7
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Thu Oct 4 08:43:55 2007 +0200
+
+    Fixed some String#slice specs.
+
+commit b9be176a9e64669f2a787c9bdebc1ba30e344d97
+Author: Paul Meserve <pmeserve at gmail.com>
+Date:   Thu Oct 4 01:37:56 2007 -0400
+
+    adding String#each_char
+
+commit c1b17108a78a4dc5d3e224158f8f9d76232003e6
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Wed Oct 3 17:42:06 2007 -0500
+
+    basic specs for Kernel#sleep
+
+commit 1fe895518bdccb93991f85a92f53876ed3d4df13
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Wed Oct 3 14:16:14 2007 -0500
+
+    added spec for Kernel.local_variables
+
+commit 00417283b36dcb58da82c6fc2e9be7580de945b0
+Author: Charles Comstock <dgtized at gmail.com>
+Date:   Wed Oct 3 14:15:25 2007 -0500
+
+    added specs for Kernel#global_variables
+
+commit 5b944520099f129462c3b03fa6ee7d1bb0636fc0
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Wed Oct 3 14:07:09 2007 +0200
+
+    Fix String#index specs.
+
+commit c9cdef77c7fa8dda92c91cee5a47624b9c9dc9e8
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Wed Oct 3 14:05:34 2007 +0200
+
+    Fix String#hex specs
+
+commit 4625a7afe509545f782cd4631632b4d7a58011aa
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Tue Oct 2 23:53:20 2007 -0700
+
+    String#% works with a few exceptions:
+
+    * %u doesn't work (it's aliased to %d for now, as in 1.9)
+    * There's a weird glitch in Float(10_1_0.5_5_5) that I can't track down
+
+commit 54ab6f559093e66f78cfa30db8aa6587061552d6
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Wed Oct 3 02:05:41 2007 +0200
+
+    Extend Kernel#kind_of? specs.
+    Regenerate CI excludes.
+
+commit 4583be7e7ed76e5843dcb396f8bae735f341de73
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Wed Oct 3 02:03:58 2007 +0200
+
+    Remove superfluous whitespace from Object#kind_of? specs.
+
+commit 5c237626469f4b0f4d227916752dd2e03510fcf9
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Wed Oct 3 01:50:33 2007 +0200
+
+    Remove superfluous comment from Object#kind_of? specs.
+
+commit 7a2c673d04b0d0506e89073ff231104e21c3304c
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Wed Oct 3 01:47:56 2007 +0200
+
+    Simplify Kernel#freeze specs.
+    Move Object#extend vs. frozen? spec to extend_spec.
+    Rebuild CI excludes for Object#extend specs.
+
+commit 3f6a27603b0b1f91ce32b9ff2a5fe3222fa7220b
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Oct 2 17:03:37 2007 -0700
+
+    Commit Charles Comstock's language return specs.
+
+commit ad4e7affcbaae4f0e967c97da485313168595a5e
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Wed Oct 3 01:36:27 2007 +0200
+
+    Fix Kernel#caller.
+    New core/kernel.rbc.
+    Regenerate CI excludes for Kernel#caller.
+
+commit 73b2ef1c889c940d22da6ad6bb8882eef66592fa
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Wed Oct 3 01:34:10 2007 +0200
+
+    Add spec for checking the default argument value for Kernel#caller.
+
+commit 180ecd6a7fa1d32e1932a322b1f8f82efd558e7f
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Wed Oct 3 01:32:29 2007 +0200
+
+    Add spec for checking that Kernel#caller returns nil.
+
+commit 9ad0c1428df70c9fd9e0081651e3b60cf5773267
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Wed Oct 3 01:30:46 2007 +0200
+
+    Add spec for checking the argument handling of Kernel#caller.
+
+commit 7a9483b823115b3122a4e42b21dfcb5b0f369a54
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Wed Oct 3 01:23:17 2007 +0200
+
+    Refactor the tedious part of the Kernel#caller specs.
+
+commit e204755859e4dc147217816ab3bf587db3d51dd6
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Wed Oct 3 01:22:26 2007 +0200
+
+    Cleanup description of Kernel#caller specs.
+
+commit dadbbb7930b62a4a6e47c8c32a4d9f26fcea38b4
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Tue Oct 2 23:52:49 2007 +0200
+
+    Regenerate CI excludes for spec/core/kernel.  Again.  Because I fixed the typos.
+
+commit 4a3587da37fd27effb30356fdd2e496f8c898be7
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Tue Oct 2 23:45:33 2007 +0200
+
+    Fix CI specs to pass in MRI 1.8.6.
+
+commit a46f5085f3c2a4849fe709044e447e5d6dacda4f
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Tue Oct 2 23:27:51 2007 +0200
+
+    Fix typos in spec/core/kernel specs.
+
+commit cb3d5867ec91a59a2a75136eb5210a10540b0ce0
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Tue Oct 2 23:27:23 2007 +0200
+
+    Regenerate spec/core/kernel excludes.
+
+commit 22e6fe0ef8dbf13aa01124447e09c9dc96f63fe3
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Tue Oct 2 23:26:51 2007 +0200
+
+    Fix Kernel#Array spec: don't depend on the exception message.
+
+commit 7b79130f38925cb48712be617cef5a80c71f0ba4
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Oct 2 14:29:42 2007 -0700
+
+    Commit #5 (LH) Charles Comstock Process.wait2 spec.
+
+commit 859c119a48909030f29a2085fbe0a80ed96d2408
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Tue Oct 2 20:57:31 2007 +0200
+
+    Fix Float#to_i and add a spec to catch the old misbehaviour.
+
+commit f2b5b2304588b4fb0efd9818c79a4b9774b2c850
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Tue Oct 2 19:07:49 2007 +0200
+
+    Fix some String#scan specs.
+
+commit 8e0ce11df329181efa440cbd55f29848e12188bf
+Author: Kevin Clark <kevin.clark at gmail.com>
+Date:   Tue Oct 2 00:39:15 2007 -0700
+
+    Add error handling for Dir.mkdir/rmdir
+
+    Add aliases for Dir.delete/unlink
+
+commit 20e66dd965bfceb29e4939090a0fd543d05392a3
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Oct 2 00:21:49 2007 -0700
+
+    Commit #206 Jason Yates' UnboundMethod specs.
+
+commit 00d7d22b7d106c6aac5d9664cb444e14811171b0
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Mon Oct 1 17:57:29 2007 -0700
+
+    First pass at actually getting my modulo impl working
+
+commit c90766a09c7e1fe7a2261f8b09d9caa8eaf2214e
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Mon Oct 1 21:21:34 2007 +0200
+
+    Fix the String#crypt spec.
+
+commit a0f6f8e51a6f7a65230f8f2ea53587ccb09f9270
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Mon Oct 1 20:18:29 2007 +0200
+
+    Changed the String#to_f specs a bit.
+
+commit 21d43e565bb55a31b45dc9fabbefface156ec516
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Mon Oct 1 16:13:28 2007 -0400
+
+    Add failing Array#pack spec for use case taken from Mongrel
+
+commit b1d70b4a847fc1c8df3eb4a219c4318420121e82
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Oct 1 09:04:03 2007 -0700
+
+    Commit #205 Jason Yates' Method specs.
+
+commit de7e0f0183d072f101e0781635fc2fdb1af1b851
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Mon Oct 1 00:11:12 2007 +0200
+
+    Fix compiler specs to expect sret when appropriate.
+    Rewrite compiler specs for multiple assignments.
+    Regenerate CI excludes for compiler specs.
+
+commit 1d1e704306fca4453d600259e87175dcdc9de314
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Sun Sep 30 23:27:12 2007 +0200
+
+    Add edge cases for File#extname specs.
+
+commit 108d757e6c24447b89fa785b2bf091b72d29933d
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Sun Sep 30 22:34:15 2007 +0200
+
+    Regenerate CI excludes for Dir specs.
+
+commit 20c6c3cd9b5d59b9782b702ac6afeb828e895d5f
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Sun Sep 30 21:49:52 2007 +0200
+
+    Make Dir specs pass in MRI.
+
+commit dcd172338bce5b70cb367db3c1e6f4653c05f9e8
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Sun Sep 30 21:10:36 2007 +0200
+
+    Fix case comparison with Symbols.
+
+commit 2a45cd71d1eb90a7c11ff62d81371df9479b0d43
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Sun Sep 30 13:28:32 2007 +0200
+
+    Add specs for String#tr! and String#tr_s!.
+    Cleanup specs for String#tr! and String#tr_s!.
+    Regenerate CI excludes for String#tr! and String#tr_s!.
+
+commit 6418bd672c8ea031d8ac2364c8a98bb631e53deb
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Sun Sep 30 13:26:19 2007 +0200
+
+    Add specs for multiple asignments with splats vs. Array#dup.
+
+commit 10b04881d286acab9dc97147750743e03ee4509f
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Sun Sep 30 13:25:14 2007 +0200
+
+    Fix Class.new to raise TypeError when the superclass is not a class.
+
+commit 0b9debba0672305f8551f5d5f35cdd3aaf16c1f1
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Sun Sep 30 13:20:49 2007 +0200
+
+    Add specs for the names of classes generated with Class.new.
+
+commit e15cef6eb851318838351a4d8717b708bb09d31d
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Sun Sep 30 13:15:43 2007 +0200
+
+    Remove debugging output from spec/core/dir/chdir_spec.rb
+
+commit f3251ba0e8ade79f157bc02dca550481488bf888
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Sun Sep 30 13:15:17 2007 +0200
+
+    Remove debugging output from spec/core/extensions/rubinius/options_spec.rb
+
+commit 5d4d2abaf02aef6caa7e532208da5e5f57bc6373
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Sun Sep 30 20:54:14 2007 -0400
+
+    Working Socket implementation and specs. Still needs readpartial to support Mongrel.
+
+commit b514e53f589d509c287516d8dd985f96e66d9a1c
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Sat Sep 29 15:44:06 2007 -0400
+
+    Working IPSocket#peername implementation
+
+commit 965ed2d88527ae8aa4ac962e8ca84180f61e6345
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Mon Sep 24 02:34:26 2007 -0400
+
+    Yet another interim socket commit
+
+commit ecd54e981a1098c4b3abf14587212e7d1d9049a6
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Thu Sep 20 16:29:21 2007 -0400
+
+    Another interim Socket commit
+
+commit 351bbdf08f190e24328328df7b3f995b8dc27a9f
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Wed Sep 19 22:17:52 2007 -0400
+
+    Interim commit of Socket work so I can generate a patch
+
+commit 65a73cdfea95c5991f2044bee150e53643216ad3
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Wed Sep 26 13:15:45 2007 +0200
+
+    Added some Marshal#load and Marshal#dump specs.
+
+commit 89e1b91c606dfe18581c3ed3923340b952471d8e
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Wed Sep 26 13:15:19 2007 +0200
+
+    Extended Specs for Kernel.Float and Kernel.Array
+
+commit 5d46933362b8c54cb5d0370bbf61e063459de514
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Wed Sep 26 13:14:41 2007 +0200
+
+    Added specs for Symbol.all_symbols.
+
+commit b3324808584d7b4ee6af58d98eeb7c2162c31208
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Sep 27 10:57:46 2007 -0700
+
+    Commit #180, Jason Barton's specs for Module#undef_method, #remove_method.
+
+commit 2e1219fc03d9cb673074ee34b1f8af4bdffe9c0e
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Thu Sep 27 18:49:26 2007 +0200
+
+    Fix Kernel.Integer by making use of String#to_inum. Add some more Kernel.Integer specs.
+
+commit b0d4747cab49f4a17e9899392171087d7b67f687
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Thu Sep 27 18:23:42 2007 +0200
+
+    Fixed String#to_i. Added String#to_inum. Extended String#to_i specs.
+
+commit 2799c392b3f5383e9e74745ceb9cf7a52f82918b
+Author: Paul Meserve <pmeserve at gmail.com>
+Date:   Thu Sep 27 01:20:00 2007 -0400
+
+    fix for Struct#new and a small struct spec changes
+
+    (also re-ran bin/ci on struct specs - most of the changes were from previous commits though)
+
+commit 30d9bf1f6ef9dcff067d427d6226bbce985f5e69
+Author: Paul Meserve <pmeserve at gmail.com>
+Date:   Wed Sep 26 19:08:37 2007 -0400
+
+    raise proper error when passing non-block args to Enumerable#all?
+
+commit 1ef1e0ef65ef3c86558da3d313dee5cada6dd4c5
+Author: Paul Meserve <pmeserve at gmail.com>
+Date:   Wed Sep 26 17:25:17 2007 -0400
+
+    adding alias for Float#quo to fix a couple number specs, and some modifications to Enumerable#min/#max, along with a couple new spec assertions. fixes failing specs and implementation should be a lot closer to MRI
+
+commit 547dd89791d92f061afcaef7184f054affae871d
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Sep 26 09:46:50 2007 -0700
+
+    Fixed placement of after(:each) block in numerous File specs.
+
+commit fa3dcbfdd623a7a7cdb15bc29b38ae47bb4056d5
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Tue Sep 25 20:25:36 2007 +0200
+
+    Added specs for UnboundMethod#arity
+
+commit 33783408b8ce1bdfcd205fd02bc3848119a632cc
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Tue Sep 25 18:00:10 2007 +0200
+
+    Added specs for Class.
+
+commit 0edea3c3a7dda5c453c527b2cef3ffba1eef1396
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Tue Sep 25 17:25:40 2007 +0200
+
+    Created some specs for Proc.
+
+commit 62c92f1c3aef6c2ff7ab8cbcd49eefb236d5caed
+Merge: b79d04d... 2d9c698...
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Sep 26 01:09:42 2007 -0700
+
+    Merge branch 'dir'
+
+commit 2d9c69848f4ca34685b95b07e17d1b5fe1ec2391
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Sep 26 01:09:28 2007 -0700
+
+    Updated CI spec excludes for Array, Dir, Fixnum, Enumerable, Hash.
+
+commit b79d04db673d9b7b5cc47f2918bccf1b0400bdbd
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Sep 26 00:56:01 2007 -0700
+
+    Commit crayz's patch from #195, #196, #197.
+
+commit ec960578671a327469d9545d6ced827736ceafa0
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Sep 25 19:40:54 2007 -0700
+
+    Fixed Dir specs failing MRI after conversion.
+
+commit 00b398352ed0f4cbcd326d56b7f8a4469056ee0d
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Sep 25 00:54:06 2007 -0700
+
+    Many cleanups of Dir specs.
+
+    Added Dir specs fixture directories and files.
+
+commit b75cfa7c0a9871dc34b8b315ca2311e65000b2f3
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Sep 23 00:41:36 2007 -0700
+
+    Converted Dir.glob specs.
+
+commit 3d8ea2a55e67cc6cfb85d2f4f7845a45984f6504
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Tue Sep 25 21:52:54 2007 +0200
+
+    Fix a few Struct specs.  Failures are down to 15.
+
+commit a477ff678e9f5f39d3d2b94e559c77b34f0c56c5
+Author: Martin Kuehl <martin.kuehl at gmail.com>
+Date:   Tue Sep 25 20:51:38 2007 +0200
+
+    Fix compiler warnings in Subtend spec extensions.
+
+commit db3e1be4e25b7e8cc463443d050afe9a5acaa7de
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Mon Sep 24 22:31:03 2007 +0200
+
+    Extended Fixnum specs.
+
+commit d136b779736af52d1eac08a40814ab4a47de93b3
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Sun Sep 23 17:47:30 2007 -0700
+
+    Array#each explosion spec
+
+commit 8a24a71ff13aac465f7f4a14587981c3c23dc800
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sun Sep 23 20:06:04 2007 +0200
+
+    Extended Comparable specs.
+
+commit ea9ba046ddfe91601d4453972a6d6f8fce96c392
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sun Sep 23 12:17:17 2007 +0200
+
+    Fix Numeric#divmod and Fixnum#divmod.
+
+commit 1c5ecb9d2e9066c66b9f0625d65cc4cefaee1f83
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sun Sep 23 12:00:16 2007 +0200
+
+    Fix Float#to_i for infinite, negative values. Fix Numeric#/ and Numeric#div. Add Numeric#do_coerce.
+
+commit 2d67d024e11e887eb07622963bfc36b0ec377746
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Sat Sep 22 20:08:38 2007 -0700
+
+    Added Onig 5 and got rindex working with it
+
+commit adc26eb525447010e28fc884eaa54b9d2228f4d6
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sun Sep 23 01:35:11 2007 +0200
+
+    Fix Kernel.Float specs
+
+commit 9a2ecf258fee3bda410776b3d3b77366590d64fe
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sat Sep 22 23:18:46 2007 +0200
+
+    Extended more Fixnum specs. Removed the spec/fixnum/induced_from_spec.rb.
+
+commit 53b0042824bb1b1c523d790cb3645aec6b789abe
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sat Sep 22 22:35:53 2007 +0200
+
+    Extended many Fixnum specs.
+
+commit 8661cdb78cd2c4afa0fb231aa9cc959e338e097e
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sat Sep 22 22:35:11 2007 +0200
+
+    Extended nil#to_s spec.
+
+commit 4008d8b39032ffa5667e95fb445ff816b1428330
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sat Sep 22 14:25:27 2007 +0200
+
+    Added some more specs and fixed some bugs in Range#initialize, Range#step and Range#each.
+
+commit 254e3d57dc6e859616ca7e0c44058d4b73211f68
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sat Sep 22 11:31:02 2007 +0200
+
+    Some updates to Range specs.
+
+commit b87e28bfc06e81fe5c4c3d6e285947f635f79f61
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Sep 21 20:12:18 2007 -0700
+
+    Commit wycats Regexp.regexp_match_region primitive.
+
+commit eaa56811836b4b5ed09a5e26d00f26eb004f2853
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Sep 21 18:44:25 2007 -0700
+
+    Added StringValue to some File methods.
+
+    Upated File CI spec excludes.
+
+commit 83f7b6020dbc881fbd6bd13da6ebb049d6080c2c
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Sep 21 17:54:53 2007 -0700
+
+    Upated spec excludes for Float, Fixnum, and Math.
+
+commit af0b0c8da8357fcae7437f6cdfd7797f03ffd73b
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Thu Sep 20 22:10:54 2007 -0700
+
+    Fixed a number of string-related issues:
+
+    String#inspect respects $KCODE
+    String#inspect returns tainted subclass
+    String#dump is no longer a copy of inspect, and does not respect $KCODE
+    String#match tries to call #to_str if it can before throwing an error
+
+commit 9409ace6d3e97946d10f9f7fcefa69ebcae43c47
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Thu Sep 20 16:55:11 2007 -0700
+
+    String#index works
+
+    Tweaked spec because [[x,y], [x,y]].each{|x,y| ... } wasn't working
+
+commit 6a72e4c4defef170f53a31c930c112022934dbc4
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Thu Sep 20 15:22:28 2007 -0400
+
+    Correct StringIO#reopen specs and implementation. Submitted patch for 1.8.x stable.
+
+commit 2b10dd99c2de4f97b5faa45060eba929d02052c4
+Author: Marcus Crafter <crafterm at redartisan.com>
+Date:   Wed Sep 19 22:20:33 2007 +0200
+
+    Implemented File.identical?
+
+commit 2c3c1fc7bd2f6365b28262cae46872eb0925c2e7
+Author: Marcus Crafter <crafterm at redartisan.com>
+Date:   Wed Sep 19 21:48:13 2007 +0200
+
+    Implemented File.link.
+
+    Kudos to the Frankfurt Rails User Group! :)
+
+commit 0330b22006e39b5b173c78800f412831296de59a
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Thu Sep 20 01:32:43 2007 -0700
+
+    String#gsub works correctly
+
+    There was a weird segfault issue which I tracked down to a use of gsub inside of gsub.
+    I got things working by extracting that functionality into a mini-gsub for just that
+    use case, but we should fix it.
+
+commit 6c825ce63ca0eb7d6f882a767ee0e6a597219883
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Wed Sep 19 22:14:31 2007 -0400
+
+    Discover and fix an edge case in StringIO
+
+commit 6bd7adcfa115f11829a7efe8f526fabbb56d5c4c
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Sep 18 19:00:20 2007 -0700
+
+    File.fnmatch(?) now passes all existing specs.
+
+commit f626f4199b88ca09a2ba75127270c0bec2ec2c86
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Mon Sep 17 15:04:44 2007 -0700
+
+    Adds a new match_all primitive
+
+    * will be used as the base of regex-related String functions
+    * is called match_all instead of scan because it's more primitive than Ruby's scan
+
+commit 0b42d4d2610ec36a4ae5e21c37d5b587f2b9dcf8
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Mon Sep 17 02:06:50 2007 -0400
+
+    Avoid using $/ in IO#puts and StringIO#puts
+    Additional StringIO specs and fixes for failures
+
+commit 75969031a57bea50e4a6450bbc9ae9e5adf76fa7
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Sep 16 18:26:29 2007 -0700
+
+    Replaced File.fnmatch FFI version with custom version.
+
+    The custom version is needed to be as compliant as possible
+    with MRI on different platforms.
+
+    Lots of fixups to File.fnmatch specs.
+
+commit 18d098062cb1b996a571a946740eea7c52421e12
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Mon Sep 17 01:11:45 2007 -0400
+
+    Some failing sprintf specs and then the fixes for said failures
+
+commit 84f94ab41d72012e4ec3d0d236b183fd8a51fbe0
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Mon Sep 17 00:53:30 2007 -0400
+
+    Additional StringIO specs and fixes for the failures that arose
+
+commit 9b44df55c682f239f036d46efe45edc2190a7345
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Sun Sep 16 12:55:27 2007 -0400
+
+    Add StringIO spec for $/ global handling
+
+commit dfcba62eb69f88d373359c75c3fa7fe827e24c69
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Sun Sep 16 00:43:41 2007 -0700
+
+    Fixes string/equal_spec to pass
+
+commit 5026350a166b94fc5fffff70dae510fa2abf2094
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Sun Sep 16 00:20:52 2007 -0700
+
+    String#slice works
+
+commit a4f3aa09d3aeb8d2b0a640ca9f659a5945692e04
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Sep 15 13:49:42 2007 -0700
+
+    Added ability to read/write to pointer to int or double in FFI.
+
+    * Fixed Math.frexp to use pointer to int to return exponent.
+    * Completed Math specs.
+
+commit 1a88ca4def8d7aa566a4254eebee3236a1359fc8
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Fri Sep 14 20:57:01 2007 -0400
+
+    mini_rspec.expectation_messages.yak_shave!
+
+commit 64f53c8b40b3a80b41a2c27b4ac7255b7aad5f4d
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Fri Sep 14 02:18:16 2007 -0400
+
+    Hopefully full StringIO coverage now
+
+commit 7cf9fe62bc9a5a00ae69ed3cac82e50012f3bb69
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Fri Sep 14 00:54:33 2007 -0400
+
+    Yet more StringIO specs
+
+commit 92da0550bd32db984fbb54f105b9701867d4faf9
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Fri Sep 14 00:38:55 2007 -0400
+
+    More StringIO specs
+
+commit 29826669197f44850d323910c7e60897e1ef7796
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Fri Sep 14 00:23:45 2007 -0400
+
+    Beginnings of StringIO specs
+
+commit 0c19e3557125dd366ddd119a34451715bfe5e7a1
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Wed Sep 12 18:11:49 2007 -0700
+
+    Fixed object allocation bug and Bignum spec
+
+commit e42a1b960f530a987527d8795a98b2de18fea824
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Thu Sep 13 19:19:03 2007 -0400
+
+    Re-implement Module#define_method. Passes existing specs.
+
+commit a8b1a148e5fbfeb3c91558fd6caccc95006a5617
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Thu Sep 13 03:55:15 2007 -0500
+
+    Adding a non-compiling spec to case_spec and updating core.rba that didn't seem to get updated correctly.
+
+commit bbd682ba2e12ba5907fe2edf2f14f11fb110cac8
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Thu Sep 13 04:04:33 2007 -0400
+
+    Fix anonymous 'rest' arguments
+    Suppress stray STDOUT traffic from 'defined?'
+
+commit 8f11498019eb49a4dd8bf52c4361432ebb1175d5
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Sep 12 22:21:30 2007 -0700
+
+    Updated CI process.
+
+    * Changed bin/ci to generate an exclude file per file put
+    in .spec directory.
+    * Generated CI spec excludes files.
+    * Updated .gitignore to not exclude .spec directory.
+    * Moved the critical excludes file to spec/excludes.txt
+
+commit b736263ff325efabb907f300c1c69a2e63bd5620
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Sep 12 22:21:30 2007 -0700
+
+    Updated CI process.
+
+    * Changed bin/ci to generate an exclude file per file put
+    in .spec directory.
+    * Generated CI spec excludes files.
+    * Updated .gitignore to not exclude .spec directory.
+    * Moved the critical excludes file to spec/excludes.txt
+
+commit 58ff9428a2a20e93e3682f834e32f754ed2c47d4
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Sep 12 18:39:48 2007 -0700
+
+    Fixed specs failing MRI.
+
+commit f54b1dffb9372e5cb1c71d93c67f2407fce0a1d0
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Sep 12 17:17:46 2007 -0700
+
+    Fixes to specs failing MRI for hash, float, fixnum, file, enumerable.
+
+commit e1d359eec451a69deb67ffdedd09b86d00774cc2
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Sep 12 14:34:50 2007 -0700
+
+    Fixes to Hash specs based on Ruby version differences.
+
+commit ee5eec5d32bb42fbf549068905ddebe215fbcf70
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Sep 12 08:53:47 2007 -0700
+
+    Fixed failing specs in kernel, module, numeric, string.
+
+commit 4f0af824f132428762f1e06409ca16c1022867bc
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Sep 12 06:24:16 2007 -0700
+
+    Added #platform and #version guards for specs.
+
+commit 355c602704cd402a1d7cbadc9b4d8fae0b34f1f4
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Sep 11 00:35:03 2007 -0700
+
+    Misc changes to specs to cleanup after the breakup.
+
+commit 85336c6a83736b01d63b645baf0e7e18bb5ce569
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Sep 10 23:21:24 2007 -0700
+
+    Converted exception, kernel, struct, object specs.
+
+commit e10bc8cbbaa26123724dad9f97f44d82e8cbf600
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Sep 10 21:48:15 2007 -0700
+
+    Converted string and numeric specs.
+
+commit 8ec64d24811a7951756c840c98a66a7c7d2ae7c8
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Sep 10 18:35:18 2007 -0700
+
+    Converted array and module specs.
+
+commit 2849f4a41b3fbda6c626d934bbf3d7476ea31848
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Sep 10 15:22:36 2007 -0700
+
+    Converted enumerable, file, hash, process, regexp, thread.
+
+    Fixed bin/mkspec to remove '=' from string for file name.
+
+commit ffa5328aa8ed7ea079c0cc8b4228ababa5919cf6
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Sep 10 13:16:14 2007 -0700
+
+    Converted time and bignum specs.
+
+commit 7798952047471d28a8e12a796092c4df7ae002f2
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Sep 10 01:21:38 2007 -0700
+
+    Converted range, math, matchdata, integer, float, fixnum, comparable, io.
+
+commit 423d85f4a7eb4b40d2eea83a462f5c38c4a6aee3
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Sep 9 23:43:14 2007 -0700
+
+    Added dir and files for ENV. Converted true, false, nil, symbol, process.
+
+    Added .spec to .gitignore.
+
+commit 8274bdcd0c747c21806065feb743e7794231f48f
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Sep 9 22:40:37 2007 -0700
+
+    Converted kernel specs.
+
+commit bc1917d630d7938b62a866c3825dfa08e5ec99e1
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Sep 9 21:57:03 2007 -0700
+
+    Initial create of spec/core subdirectories and files.
+
+    Updated bin/mkspec to exclude Exception subclasses and
+    OptionParser (which is in Object.constants because of
+    the script requiring it). Also normalize TrueClass etc.
+    to directory 'true'.
+
+commit b941eceb681c57d23d35f952b11b2a2d3a1ea4dd
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Thu Sep 13 01:00:22 2007 -0400
+
+    Add a minimal spec for the 'undef' keyword
+
+commit 3af389594f3828763a85d8eef65f773b183e1b46
+Author: Charles Nutter <headius at charles-nutters-computer.local>
+Date:   Wed Sep 12 19:33:36 2007 -0500
+
+    Adding a bunch of default argument specs to language/def_spec.
+
+commit 6b4936e834a2814602be54f01e08dcdc1f9433b5
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sun Sep 9 16:58:35 2007 +0200
+
+    Another fix for multiple mock expectations on the same method.
+
+commit f686ff256289263eb473249dd734cf2214c41cc2
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Sun Sep 9 16:13:53 2007 +0200
+
+    Mocks now support multiple expectations of the same method with different arguments.
+
+commit 860e0d08adc8cdee9ac4d9ff3bd0e30d5d3aaa49
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Sep 8 02:36:19 2007 -0700
+
+    Added to critical-excludes and ci-excludes. bin/ci -f s -C runs to completion.
+
+    rake build:core compiled string.rb, so checking in core.rba.
+
+commit c9c79c910a57e5628d1743f3b440c0066875500e
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Sep 7 23:24:44 2007 -0700
+
+    Added Math methods using FFI.
+
+    Added Kernel.coerce_to and rewrote Float(), Integer(),
+    Array(), and String() with it. Float() needs to be fixed
+    to raise on strings like rb_cstr_to_dbl does.
+
+    Fixed -C options for bin/ci and bin/mspec.
+
+commit b8d8b8c8475fde1ce3519e29788a34780dffae8c
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Fri Sep 7 19:40:02 2007 -0700
+
+    Fixes String#<<
+
+    * Added taint if other has taint
+    * Fixed 10 spec failures
+
+commit b0b85547ab9dd16ba88a75c64a91c3ae0d079b27
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Fri Sep 7 15:36:44 2007 -0700
+
+    Added bus error to critical-excludes
+
+commit ed13a10112d0a262a48c8e5db7d1eaaa3e076e55
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Fri Sep 7 15:19:51 2007 -0700
+
+    String specs work in 1.8.6 MRI
+
+commit 6fc507c96e990139c311900c73c7e31447879071
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Sep 7 12:03:09 2007 -0700
+
+    Changed VERSION and RUBY_VERSION to shadow MRI (currently 1.8.6).
+
+    Added RBX_VERSION (currently 0.8.0). Updated loader -v to display
+    RBX_VERSION and RUBY_VERSION and truncated BUILDREV.
+
+    Enabled before|after(:all) for mini_rspec.
+
+commit 8ce602f80b35f5859c58730968a9a7053a87bd59
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Fri Sep 7 11:16:16 2007 -0400
+
+    Array#uniq, #uniq! simplified. 72 failures.
+
+commit 38f271a1b7d49074d8db9285553756fb75ffe78b
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Fri Sep 7 11:23:36 2007 -0700
+
+    define_attr added to subtend
+
+commit 843706d585334c30943c8bbdd3ef6ca22297d42d
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Fri Sep 7 10:48:51 2007 -0700
+
+    Added rb_cstr2inum to subtend
+
+commit 97a22e2144b623a62780995333d65986c98c4ba2
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Fri Sep 7 10:42:30 2007 -0700
+
+    Added rb_const_defined to subtend
+
+    It also seems that my fixture for require didn't make it in; adding that as well
+
+commit 0ac9ec2b0f381bf2fb3a36cd0b6f30748771e818
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Fri Sep 7 10:21:28 2007 -0700
+
+    Added check_*_type to subtend
+
+    * check_array_type
+    * check_string_type
+    * check_convert_type
+
+commit b2bf1c44fa7c2663e6fc0b27127aa4f5e38e073f
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Fri Sep 7 09:45:03 2007 -0700
+
+    Added rb_attr_get to subtend
+
+commit 81605662ab8acc5a50536f1fc613e7d24e142df1
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Fri Sep 7 00:27:38 2007 -0700
+
+    int2inum added to subtend as well as INT2NUM
+
+commit e80084e6b245173c17403891c65d86db1e6b3022
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Fri Sep 7 00:02:06 2007 -0700
+
+    rb_str_split added to subtend
+
+commit 90f1fa95825caa8b21e147248d1a7d999579b937
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Thu Sep 6 23:51:56 2007 -0700
+
+    rb_require in subtend added
+
+commit 5bb87f516b2a26f77a864a15636331102d6d8499
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Thu Sep 6 22:58:29 2007 -0700
+
+    rb_to_id added
+
+commit e0532b3fb62089da7b7362ec2232997878a1221d
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Thu Sep 6 22:31:30 2007 -0700
+
+    Added specs
+
+commit 75f7a1d2b37067f55099dd117e8fcd905baa748d
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Thu Sep 6 21:59:12 2007 -0700
+
+    string subtend fixes
+
+    * rb_str_cmp added
+    * rb_str_cat fixed with working spec
+
+commit f058cea3e5291c349f5b2b1cfbdad4d734240f95
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Thu Sep 6 21:34:52 2007 -0700
+
+    added rb_define_const
+
+commit ec7ca7f45ef32794afb919851e4bfd5e8d7aa46d
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Thu Sep 6 21:03:44 2007 -0700
+
+    rb_include_module added
+
+commit 5b3471544508e973ba6afbd16daf47f5796f8b30
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Thu Sep 6 20:41:09 2007 -0700
+
+    float_new added and some functions missing in ruby.h added
+
+commit cd2af0bae996a4addfe23baa0558125a8a5523e7
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Thu Sep 6 17:09:06 2007 -0700
+
+    Fixed subtend. Added diagram of the context chain.
+
+    NMCs (NativeMethodContext) now use the proper context stack.
+    The stack maintenance was all screwed up when calling in and out of
+    native methods, which was the source of a few problems.
+
+commit da5f9e6f942c11d906760e952debae4d05b3d872
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Sep 4 22:26:48 2007 -0700
+
+    Added load-order dependency generation to rake build:(core|platform) task.
+
+    Added 'depends on:' declarations to kernel/platform and kernel/core files.
+
+    Updated ci-excludes.txt to reflect recent spec checkins.
+
+commit 7b1ca6f305e33b34a99e8c9e049843a76cceeca7
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Sun Sep 2 21:29:49 2007 -0400
+
+    Add more 'alias' specs. Show singleton methods in 'public_methods' output.
+
+commit 5c0b5fcb2a0c9f47a04e6a5d5027484224d0a942
+Merge: 4896039... 01c2126...
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Sun Sep 2 18:58:53 2007 -0400
+
+    Merge branch 'master' of git at git.rubini.us:code
+
+commit 48960394ab7f36ccd1b18609677b40721c30d7a2
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Sun Sep 2 18:57:29 2007 -0400
+
+    Add some 'alias' specs that fail on rbx and pass on MRI
+
+commit 01c2126b705327d99aa183d51dc014169e8b4e07
+Merge: 04602c6... b6d92ec...
+Author: Florian Gross <flgr at ccan.de>
+Date:   Sun Sep 2 19:45:25 2007 +0200
+
+    Merge branch 'master' of git at git.rubini.us:code
+
+    Conflicts:
+
+    	spec/core/string_spec.rb
+
+commit 04602c6756a9199b64e7d909c01dc995b25fa8a7
+Author: Florian Gross <flgr at ccan.de>
+Date:   Sun Sep 2 19:32:47 2007 +0200
+
+    * New specs for String#tr_s(!) and upcase(!)
+    * Improved specs for String#capitalize!, downcase(!) and swapcase
+
+commit c94f83b20f7b11dc48c523c84de59b9ac6f76cce
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Fri Aug 31 23:15:07 2007 -0400
+
+    Array#reverse_each, #rindex fixed and cleaned. 80 failures.
+
+commit f531f812f87283b950c62648e3cf08a7400c2779
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Fri Aug 31 22:03:05 2007 -0400
+
+    Array#replace fixed, specs. 88 failures. * Disabled specs for #initialize_copy which is private.
+
+commit 1656b8a04a40bc5a43adec88ffd1480d9da6ba28
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Fri Aug 31 11:50:56 2007 -0400
+
+    Array#reject, #reject!, specs fixed and cleaned * Added spec to check #reject returning Array and corrected implementation.
+
+commit e1c499c6feafc19788addd098a6da052904cb09c
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Fri Aug 31 11:25:45 2007 -0400
+
+    Fixed logic in Array#rassoc, specs. 91 failures.
+
+commit da79b116d3fdc5fd4cd04f5ad1ad44b2c269ad77
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Fri Aug 31 10:38:39 2007 -0400
+
+    Array#push checks frozenness, specs. 92 failures.
+
+commit 290aa6fe561453821f59be3fa92695d0b0d77c04
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Fri Aug 31 10:26:25 2007 -0400
+
+    Uncommented most of Array#pack specs. * float -> int conversions still hang both C and c and are therefore disabled.
+
+commit 885f2522244c1792f45260194aba085028d5c919
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Fri Aug 31 09:59:30 2007 -0400
+
+    Fixed logic errors in Array#assoc, Array#include? * Both, contrary to docs, compare elem == obj, not the other way around.
+
+commit d825038a409f4d931e80736e2de49ff0752857a9
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Aug 31 00:12:06 2007 -0700
+
+    bin/ci supports options for separately running spec files
+
+    Use bin/ci -s to separately process each spec file. Use
+    bin/ci -m to run all the spec files in a single VM process.
+    -s is the default for --create, but -m is the default for
+    everything else.
+
+    Updated ci-excludes.txt and critical-excludes.txt.
+
+commit 7dfe5cb7936051685a2c79effb6295b9aa179810
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Aug 30 23:44:28 2007 -0700
+
+    Updated ci-excludes.txt to only exclude failing specs.
+
+commit fb09f0a7a6969adffd8d99bf869eb50c91eef097
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Thu Aug 30 20:31:20 2007 -0400
+
+    Fix object and array specs that failed under MRI
+
+commit 6fb73244537b61a20538c1f3d5a060a40a358be5
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Thu Aug 30 17:08:12 2007 -0700
+
+    Fixed two typos in the subtend string specs
+
+commit 00256f41d4e3ebfcdafdc25e27bfbf4bc7d3de3f
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Thu Aug 30 11:19:09 2007 -0400
+
+    Array#last fixed. 48 failures.
+
+commit 887d41c64c6bdff693f6ecd8d3078f8453669648
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Thu Aug 30 11:02:27 2007 -0400
+
+    Array#insert, specs corrected. 49 failures.
+      * Fixed Array#insert
+      * Re-complianced frozenness specs for Array#inspect.
+
+commit 1bc536e1128bc76b1c9efae593340f67bdcb5fb5
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Thu Aug 30 10:42:05 2007 -0400
+
+    Array#indexes correct implementation. 51 failures.
+      * Array#indexes and #indices is now correct although
+        both methods are deprecated in favour of #values_at.
+
+commit 5de09c707b1ce43bf689e8ded9ea19784e77a49e
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Thu Aug 30 10:09:27 2007 -0400
+
+    Array#include? implemented. 53 failures.
+      * Replaced use of Enumerable#include?
+      * Re-complianced to a simpler Array#include? spec to
+        avoid implementation-dependedness.
+
+commit 14ca6c2533764eea508b24b0ec89475a7aae5e94
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Thu Aug 30 09:32:40 2007 -0400
+
+    Array#hash spec compliance change. 54 failures.
+      * Disabled an Array#hash spec for Rubinius because it
+        relies too much on implementation details.
+
+commit fc4f392fa7fba88b36bfdec61db3acaa1f1fadc2
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Thu Aug 30 00:42:03 2007 -0400
+
+    Array#flatten, #flatten!. Improved Array specs. 384 ex, 55 failures.
+      * Array#flatten, #flatten! implementation improved, they
+        also work recursively now.
+      * Re-enabled Array#flatten, #flatten! specs and the
+        recursive test for Array#inspect.
+
+commit efeaa622994e9868b9324247b0ff1fd5743792ac
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Wed Aug 29 23:29:36 2007 -0700
+
+    A series of rb_str functions in subtend, plus fixes to some of the tests earlier committed
+
+commit e4f5281148799ed716065c489d384a42d208290d
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Wed Aug 29 19:16:26 2007 -0700
+
+    rb_str_append() added
+
+commit a05c376478f7407da4e0aa2a6a7e3de98176a63b
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Wed Aug 29 13:25:17 2007 -0700
+
+    Updated subtend array functions
+
+    * rb_ary_reverse() added
+    * tests added for rb_ary_join() and rb_ary_reverse()
+
+commit 779fb97c35b78b9749cbb118fcb555096957e4c6
+Merge: 2793a99... e17987e...
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Wed Aug 29 12:40:33 2007 -0700
+
+    Merge branch 'master' of git at git.rubini.us:code
+
+commit 2793a9917f8f5cc2f0fc14ba605cec499532e680
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Wed Aug 29 12:40:21 2007 -0700
+
+    Slightly improved rb_ary_pop() test
+
+commit c196c60b6cd32c85b18bdab31ee000cf097309b5
+Author: Me <rue at meow.kittensoft.org>
+Date:   Tue Aug 28 23:49:46 2007 -0400
+
+    Array#fill fixed, cleaned up. 375 examples, 59 failures.
+
+commit 7736413f262357479c2f3354a73533fd89b3c9a6
+Author: Yehuda Katz <wycats at gmail.com>
+Date:   Tue Aug 28 17:54:28 2007 -0700
+
+    added rb_ary_join() to subtend
+
+    Trying to get tests working but it's hard to see if I'm correct without the ability to run them.
+    I'll take care of making sure there are passing tests as soon as I can.
+
+commit 0effcaf3e948d80ae3ad17b33f0483313d85cdbe
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Tue Aug 28 00:24:41 2007 -0400
+
+    Array#fetch, specs, slightly cleaned array.rb. 62 failures.
+      * Array#fetch uses to_int.
+      * Specs for Array#fetch check for correct block var.
+      * Removed extra comments from array.rb.
+      * Removed old implementations from array.rb.
+
+commit 51737d35c24f853a23e14f7a227138d4d0f6b457
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Aug 27 21:46:30 2007 -0700
+
+    Added failing File specs to ci-excludes
+
+commit a195970e2b2d34fa4388e6a72e91ada13b4b0d32
+Author: Marcus Crafter <crafterm at redartisan.com>
+Date:   Tue Aug 28 09:20:33 2007 +1000
+
+    Ensure exists? is prefixed by File.
+
+commit 804b6f3358c1bb73492beaa0e978d4df8dbac138
+Author: Marcus Crafter <crafterm at redartisan.com>
+Date:   Tue Aug 28 00:18:41 2007 +1000
+
+    Minor refactoring work on file spec.
+
+    Removed duplicated constant tests.
+
+commit ef18eaaaa1a79b964667900b19f3f10e1b67032b
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Aug 27 14:25:06 2007 -0700
+
+    Updates to enable bin/ci to run to completion.
+
+    Changed mini_rspec to not use File.open with a block to work
+    around IO#read failing to catch EOFError.
+
+    Commented out object_spec.rb specs that need to be completely redone.
+
+    Updated spec/reports exclude files to enable bin/ci to work.
+
+commit 505617b26829d5f489c4488ed934a6dc720f64f0
+Author: Florian Gross <flgr at ccan.de>
+Date:   Sun Aug 26 22:53:42 2007 +0200
+
+    A few new specs for String#sum, #to_i, #to_s, #to_str, #tr and #tr!
+
+commit a6a24a97dce2a4072a6ea17e48259b76f0c3681a
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Aug 26 02:52:55 2007 -0400
+
+    Array#delete, Array#delete_at, Array#delete_if. 63 failures.
+      * Fixed the three delete* methods, they still need clean-up
+      * The specs reflect difference in frozen handling for rbx and r18
+
+commit 063f8c25d45e0934bca236ecb8af36dcb517187f
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Aug 26 02:26:15 2007 -0400
+
+    Array#concat fixed. 69 failures.
+      * Array#concat checks frozenness and cleaned up
+      * Improved specs for #concat
+
+commit a9f3593593948cf72d94712765d05bfcc27f2e78
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sun Aug 26 01:53:05 2007 -0400
+
+    Array#dup, Array#compact, Array#compact!. 71 failing.
+      * Array#dup properly returns subclass
+      * Array#compact(!) improved to pass specs
+
+commit 7be3bc12ea2e5432e442cb44103b4b1c6d981163
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Aug 25 23:57:38 2007 -0400
+
+    Array#clear, Array#frozen?. 372 examples, 73 failures. * Array#frozen? checks for sorting freezes * Array#clear fails on frozen Arrays
+
+commit 5c958242fe25f8a18cd8d315f81fb3db80dc7a40
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Aug 25 17:19:23 2007 -0400
+
+    Array#==, Array#assoc improvements. 75 failures
+      * Cleaned up Array#==
+      * Array#assoc processes correctly
+
+commit f82f8a300ee394f9f1038cc84de1cf6b132d7ef5
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Aug 25 16:24:22 2007 -0400
+
+    Array#* improved. 371 specs, 81 failures
+      * Array#* processes to_int and to_ary correctly and forwards
+        to #join when needed.
+
+commit 91e16f06d5b5b16f1fa7ffc1d3673d7f1c681587
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Aug 25 15:54:12 2007 -0400
+
+    Array#join can process recursive Arrays.
+      * Rubinius cannot create recursive Arrays so this is somewhat moot.
+
+commit 2d7427bb638f1af6d7437beed4beafde5274dbdf
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Aug 25 13:46:45 2007 -0400
+
+    Array#|, better Array#&. 371 examples, 86 failures.
+      * Array#& explicitly uses #eql? semantics
+      * Cleaned up Array#|, uses to_ary
+
+commit 2b8707466f763662d52efaeab71b4789b132bb40
+Merge: c61b1e5... 76be87f...
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Aug 25 12:41:06 2007 -0400
+
+    Merge branch 'array'
+
+commit 76be87f74d352d79425e9c46d3df55678257fda9
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Aug 25 12:28:32 2007 -0400
+
+    Array#<< improvements. 371 examples, 89 failures.
+      * Specced and fixed resizing bug in Array#<<
+
+commit c61b1e54cc11c297b9e9a9eca70cb6a354ed21d9
+Merge: 3618a8b... c6cc98f...
+Author: Pedro Del Gallego Vida <pedro at la-vaca-roja.(none)>
+Date:   Sat Aug 25 18:16:45 2007 +0200
+
+    Merge branch 'master' of git at git.rubini.us:code
+
+commit 3618a8bc588588ef8fb0dcc4753bc42606b86c13
+Author: Pedro Del Gallego Vida <pedro at la-vaca-roja.(none)>
+Date:   Sat Aug 25 18:16:05 2007 +0200
+
+    Update object specs
+    Update the object_spec.rb file
+    * add more specs
+    * refactor using it_behave_like
+
+commit 294e5aacda8a74a9d8f57d05bb433f2fadcd08f1
+Author: Eero Saynatkari <rubinius at projects.kittensoft.org>
+Date:   Sat Aug 25 12:07:06 2007 -0400
+
+    Array#[], modified parts of array_spec. 369 examples, 90 failures.
+      * Array#[] passes its specs
+      * Disabled some parts of array_spec while fixing Array. These
+        will be re-enabled as soon as possible.
+
+commit 1369465aefcd1d50ddd268ba9af968c62137e2b2
+Author: Pedro Del Gallego Vida <pedro at la-vaca-roja.(none)>
+Date:   Fri Aug 24 11:14:20 2007 +0200
+
+    Array#new correct implementation
+
+commit e321427a52878ef9d9c7c04aa7c3c4f1e3a6c940
+Merge: bff7c05... 69c0407...
+Author: Pedro Del Gallego Vida <pedro at la-vaca-roja.(none)>
+Date:   Fri Aug 24 11:14:20 2007 +0200
+
+    Merge branch 'master' of git at git.rubini.us:code
+
+commit 07c7f93a64fc37f3cf94a0a2c272468d015a7fb3
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Aug 23 21:18:13 2007 -0700
+
+    Converted Regexp specs to new describe style.
+
+    Fixed String specs to be compatible with bin/completeness.
+    Fixed bin/completeness to use dotted reporter instead of CI
+    reporter since the latter no longer outputs summary info.
+
+commit 6776e1478fa7e78a0944a1ee59c55c3839f51ea4
+Author: Marcus Crafter <crafterm at redartisan.com>
+Date:   Fri Aug 24 13:14:47 2007 +1000
+
+    Added implementation of File.split and updated specs.
+
+commit 4053b9076b4b996f544095a75317453967723faa
+Author: Marcus Crafter <crafterm at redartisan.com>
+Date:   Wed Aug 22 21:58:13 2007 +1000
+
+    Added spec for mocking methods on a class
+
+commit 54cae1196db08f6a734c35079db8df62e491f300
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Thu Aug 23 17:38:40 2007 -0700
+
+    Added more IO stuff and platform methods.
+
+    I'm still a little unhappy with the input buffer situation.
+    (ie, there is none.)
+
+    Adds IO#sysread and IO#syswrite as well as a bunch of POSIX stuff.
+
+commit 12a755004c0a8a0319212965da61385738166f98
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Tue Aug 21 12:44:48 2007 -0700
+
+    Beginnings of ftools spec, fix backtrace generation.
+
+    Backtraces were failing to be properly built if the sender was a Block.
+
+commit bff7c05ce12c79ef111422ecf4525f1a65e7a5f0
+Author: Pedro Del Gallego Vida <pedro at la-vaca-roja.(none)>
+Date:   Fri Aug 24 01:15:41 2007 +0200
+
+    More specs dor enumerable
+        * add inject, min, grep, find, detect, find_all, select
+
+commit ed9a8fefcc384bb6548a7f66bbafb97192ec8fd3
+Merge: 4ef0b9f... 8dd800e...
+Author: Arthur Schreiber <schreiber.arthur at gmail.com>
+Date:   Thu Aug 23 11:01:25 2007 +0200
+
+    Merge branch 'specs'
+
+commit 8dd800e8189f616dc54390c0ebf96c331de41230
+Author: schreiber.arthur at gmail.com <arthur at arthur-desktop.(none)>
+Date:   Thu Aug 23 10:45:56 2007 +0200
+
+    * Some more Module Specs.
+
+commit 0f414f56f9050d86011df75e7fd23428fe378996
+Author: schreiber.arthur at gmail.com <arthur at arthur-desktop.(none)>
+Date:   Thu Aug 23 10:44:59 2007 +0200
+
+    * Added :count => :any option to mock expectations
+
+commit 4ef0b9feddfebfd1b6177fce6e3a1a4077f4f098
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Aug 22 23:10:22 2007 -0700
+
+    Updated exclusion list for CI specs.
+    Updated rake spec:ci task.
+    Changed ci spec run action to execute all specs in one process.
+    Added guard on file specs to prevent compilation exception.
+
+commit c3b61b239fa6a02327e5651513986d998d826eaf
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Aug 22 21:48:08 2007 -0700
+
+    Updated CI spec process to exclude specs failing on compilation.
+
+    Added critical failures to enable running especially spec/core.
+    Added failure guards to struct specs.
+
+commit f339a284c66357bc52749e5fe9c0d59bbbdc7ade
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Aug 20 22:31:56 2007 -0700
+
+    Fleshed out bin/ci constructs for running specs.
+
+commit 4f750d59adfff6c1751372c0d2853778dc7ae16d
+Author: Pedro Del Gallego Vida <pedro at la-vaca-roja.(none)>
+Date:   Tue Aug 21 22:40:33 2007 +0200
+
+     * more enumerable specs
+     * refactor to it_behaves_like
+
+commit 3c79d5cf67b40b945602d5c5fa77589e0d7bae2c
+Author: Pedro Del Gallego Vida <pedro at la-vaca-roja.(none)>
+Date:   Tue Aug 21 20:52:16 2007 +0200
+
+     update file_spec.rb
+
+commit b2a64089bffe5afb9148a665ecb6e70c3bc62b67
+Merge: 6865b97... 1b6a8a1...
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Aug 19 16:22:53 2007 -0700
+
+    merge 1b6a8a157
+
+commit bf54767922eb8d494c683ed8d57c6ffb5164fc29
+Merge: 6c6032e... 37d71c9...
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Aug 19 15:24:21 2007 -0700
+
+    merge from e83bcd022
+
+commit 05db33909c319231ac375812025ea2378710a299
+Author: Marcus Crafter <crafterm at redartisan.com>
+Date:   Sun Aug 19 21:26:15 2007 +1000
+
+    Add conditional when deleting a file in after(:each) block to prevent an exception if the file is missing.
+
+commit 138ab001175987cd38aff092a850e515745f9292
+Author: Marcus Crafter <crafterm at redartisan.com>
+Date:   Sun Aug 19 21:18:22 2007 +1000
+
+    Converted remaining context/specify spec's into describe/it, and followed class/method naming convention.
+
+commit 749b883d0260326573c581cc63eab67e1a4bc590
+Author: Marcus Crafter <crafterm at redartisan.com>
+Date:   Sun Aug 19 20:23:11 2007 +1000
+
+    Added implementation of exists? blockdev? chardev? zero? size size? writable_real? executable_real? readable_real? unlink delete and chmod using ffi where needed. Specs for most of these methods existed already, added specs for those that weren't. Fixed a few typos.
+
+commit ddcb14f9f2311ec843a1f1f8d2b3fa868384ff0d
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Aug 18 23:19:32 2007 -0700
+
+    more misc changes to get ci specs working
+    added alias for File.exists? and File.exist?
+    added Dir.getcwd
+    added empty File.delete
+
+commit afb252fd6170ed051e97f1911e5f1200414ebf98
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Aug 18 22:20:10 2007 -0700
+
+    updated compiler specs.
+
+commit d0e6b658d9065b0fbc9180cd5d19139834f64f59
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Aug 18 21:04:18 2007 -0700
+
+    changes to support better CI specs
+    hat mini_rspec will take a filename as an exclude/include argument and read the actual excludes/includes from the file.
+    added that mspec will take -o FILE to use an alternate to STDOUT for the spec reporter output.
+    updated spec tasks. misc spec changes.
+    added naive implementation of IO#each.
+
+commit 541bcb521a8ee589c7d28c095ad7ee1489af42db
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Fri Aug 17 19:30:05 2007 -0700
+
+    Complete reorganization of bootstrap. Addition of kernel/platform. FFI fixed.
+
+    New restrictions for meta-programming in core bodies (not in methods).
+    kernel/platform is now where platform specific code, mainly related to FFI, lives.
+    A bunch of FFI bugs have been fixed and it should be working much better now.
+
+    FFI Note: you may now only specify :state as your first argument, and you must
+    leave it off when you call the method (rather than passing nil like before).
+
+commit af245dfbc80ff942de62408e70db7499a798fb0a
+Author: schreiber.arthur at gmail.com <arthur at arthur-desktop.(none)>
+Date:   Tue Aug 14 01:30:09 2007 +0200
+
+    Forgot to add the autoloaded file for Module#autoload
+
+commit b946940f463028de067ef2e082c96fe431c94b0a
+Author: schreiber.arthur at gmail.com <arthur at arthur-desktop.(none)>
+Date:   Tue Aug 14 01:09:10 2007 +0200
+
+    Updated Module Specs
+
+commit 6cd6aa53a5d20c78941442f7e367ef8c7aee17c2
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Aug 10 00:14:09 2007 +0000
+
+    converted array specs with a few edits.
+
+commit c075f7f70da2a029c69f3fff1f9caec419db64d5
+Author: Arthur <arthur at unknown>
+Date:   Wed Aug 8 12:47:18 2007 +0000
+
+    fix a small typo
+
+commit c7262df9ee1c2544890b001574c8cb0f8ae26a75
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Aug 8 01:24:25 2007 +0000
+
+    converted exception specs. added #should_be_ancestor_of. use ExpectationNotMetError in mini_rspec like rspec does.
+
+commit f591e18978b73c508505db73f274f4bd69c372c5
+Author: Arthur <arthur at unknown>
+Date:   Tue Aug 7 08:36:15 2007 +0000
+
+     * String#to_str specs should actually use String#to_str
+
+commit 80f69571c5378d6bbb2e7a118ada00db66226797
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Aug 7 06:47:53 2007 +0000
+
+    converted range specs.
+
+commit aca62d253a6b2df891ca4ec4b177ea95b621d636
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Aug 7 03:52:46 2007 +0000
+
+    fixed mini_rspec -e option, allows multiples. converted hash specs.
+
+commit 928c9a392102fa7b7945f332480a7477ec203467
+Author: Florian Gross <florgro at gmail.com>
+Date:   Mon Aug 6 22:04:16 2007 +0000
+
+    New specs for String#swapcase(!), to_f, to_i, to_str, to_sym
+
+commit 6d0a6b0051a55af32743d9d98d6425489a622ebe
+Author: Pedro Del Gallego <pedro.delgallego at gmail.com>
+Date:   Mon Aug 6 21:58:55 2007 +0000
+
+    * more specs for File.open. Specs for File.truncate
+
+commit 8b19b683a8593b4dd5024841d8023df827a44875
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Aug 5 23:39:36 2007 +0000
+
+    fixed completeness to not over match methods. converted comparable specs.
+
+commit c6f4d90df72b103884fa5470a433f5513d2c524d
+Author: Pedro Del Gallego <pedro.delgallego at gmail.com>
+Date:   Sun Aug 5 22:52:17 2007 +0000
+
+    * more specs for File.open. Some of them are plataform dependent
+
+commit 38bfff9d014b90409e272ddf041dc63f53d48f5d
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Aug 5 22:45:31 2007 +0000
+
+    converted bignum specs. misc cleanup.
+
+commit 14890b68c447731417ce53ca2e4310175e39b440
+Author: Florian Gross <florgro at gmail.com>
+Date:   Sun Aug 5 22:00:04 2007 +0000
+
+    Small spec fix
+
+commit b6c3cfca5cf1b2cb85dc216180ad21a6bf653a10
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Aug 5 17:20:32 2007 +0000
+
+    converted time specs. according to completeness, need to spec 9 more methods.
+
+commit 8829cf7e94ec0434f642fafa7dbf117a860045b9
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Aug 5 07:53:47 2007 +0000
+
+    more converted specs.
+
+commit 5bf174780e893b7ee9b82b6ca3964db7cad84e30
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Aug 5 07:08:08 2007 +0000
+
+    converted fixnum specs to describe per method.
+
+commit 88023701a88c1113e4874c193d26c6bf21fad383
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Aug 4 22:19:18 2007 +0000
+
+    misc noise cleanup in specs. use bin/completeness to find missing specs rather than warns.
+
+commit 3d960a021cb9ac2bdc2a204f94b4f024f3ef60a4
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Aug 4 22:06:12 2007 +0000
+
+    fixed completeness to pass correct spec example string for class methods. changed float specs to describe per method.
+
+commit 8a7abb5996e5bdf8b9d6c5884e0e0d8ae73d060e
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Aug 4 20:10:38 2007 +0000
+
+    beginning of a completeness reporter. use 'bin/completeness -t ruby' to report on the completeness of the specs against MRI. use 'bin/completeness' to report on the completeness of rbx relative to MRI. use -t target for other implementations. updated some specs to the 'describe Class#method' style.
+
+commit 463f13be4462e22bc3f4491a475658624c5832ab
+Author: Pedro Del Gallego <pedro.delgallego at gmail.com>
+Date:   Sat Aug 4 17:09:25 2007 +0000
+
+    * fix some bugs in bignum_spec
+    * changed the File::Foo.shouid == bar assert to defined?(File::Foo).should == "constant". The specific value dependence on OS.
+
+commit 989d72394f1e175b058f55ccf3e60f09a2c76401
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Aug 4 04:15:01 2007 +0000
+
+    fixed mini_rspec specdox reporter to not output describe message until examples are executed. fixed specdox and dotted reporter to distinguish between errors and failures.
+
+commit f98fe7f211e5784a35e99643fb52c9350b20d7ae
+Author: Florian Gross <florgro at gmail.com>
+Date:   Sat Aug 4 01:40:52 2007 +0000
+
+    More compatibility and a few small fixes
+
+commit c78ba9f96d7d4d229d6b1b1b11cf314fb5a0271d
+Author: Florian Gross <florgro at gmail.com>
+Date:   Sat Aug 4 00:40:42 2007 +0000
+
+    Compatibility for USE_RSPEC=1, sanity, some clean-up
+
+commit 761d05b5cbd92339f9d02e65d005a65c5155618e
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Fri Aug 3 21:49:26 2007 +0000
+
+    * Compiler and Normalizer fixes for method definitions without bodies
+
+commit ad7abe4d61171f9650d08b277d45c7f680f37950
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Aug 3 17:07:19 2007 +0000
+
+    fixed mini_rspec shared behavior to be compatible with rspec.
+
+commit 1e1ccb902d11547e9f67db82c31a5898e6227d67
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Aug 3 16:39:07 2007 +0000
+
+    added an implementation of shared behavior for mini_rspec. altered Array#[] and Array#slice specs to use shared behavior.
+
+commit 7697b2ae3db6ed1d8697010a7e0f52f8e3587c8a
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Aug 2 20:41:43 2007 +0000
+
+    added SpecRunner class to mini_rspec to properly encapsulate behavior. added --example option to specify a regexp to match examples to execute.
+
+commit b80bb3d295d3648988b15a29553189f219d8ac0a
+Author: Pedro Del Gallego <pedro.delgallego at gmail.com>
+Date:   Thu Aug 2 15:56:07 2007 +0000
+
+    * added specs for file_spec
+
+commit c277fd3de82678f055693422af19c3f45ffc2a88
+Author: Florian Gross <florgro at gmail.com>
+Date:   Thu Aug 2 00:46:27 2007 +0000
+
+    mspec: Add -x option for excluding specs by RE
+
+commit aa53967c694ed7621aa1a8a8b542d067d9e58925
+Author: Florian Gross <florgro at gmail.com>
+Date:   Thu Aug 2 00:05:53 2007 +0000
+
+    New specs for String#succ(!)
+
+commit eafa5b0fd43168b4ae649b145f9528f7deae3aa7
+Author: Florian Gross <florgro at gmail.com>
+Date:   Wed Aug 1 22:59:38 2007 +0000
+
+    New specs for String#sub(!)
+
+commit 3406e64032251a2a9849da3f6c27d872dd339175
+Author: Florian Gross <florgro at gmail.com>
+Date:   Wed Aug 1 22:17:18 2007 +0000
+
+    New specs for String#squeeze(!) and String#strip(!)
+
+commit fa4d66576528725085ef47cca27c5c85c55b3150
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Aug 1 21:08:26 2007 +0000
+
+    added Object#(public|private|protected)_methods and Module#(public|private|protected)_instance_methods. added Tuple#first, last.
+
+commit 4ca071ba4a48aa984308e0ba9448718a6e214d7a
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Jul 31 20:56:37 2007 +0000
+
+    Some Object#methods et al specs.
+
+commit 67be404ac0714ec01c1c92c77465915d90fd794b
+Author: Florian Gross <florgro at gmail.com>
+Date:   Tue Jul 31 18:41:54 2007 +0000
+
+    Renamed variables_spec.rb to assignment_spec.rb
+
+commit c0187db3e51297dfffabebe9acb6d6321bd04578
+Author: Florian Gross <florgro at gmail.com>
+Date:   Tue Jul 31 18:22:41 2007 +0000
+
+    New specs for String#split
+
+commit 06cb5ab7c39866c99bb8d9a5fbb678f2f8a19cf2
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Jul 22 06:47:54 2007 +0000
+
+    Removed the .rbc files from externals dir and set svn:ignore. Added Tuple specs, fixed a couple small problems with Tuple. Modified mspec to pass -I, -r to the target; added -n RUBY_NAME to affect which specs are run. Added hashi dir as an experiment to implement a bootstrap that could be run on e.g. MRI or JRuby to allow the core libs to be run and tested against the specs.
+
+commit 567d4f710bc232fc9223972e22a7d92e4abe940d
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Tue Jul 17 17:49:53 2007 +0000
+
+    Stack allocated lvars, GC fixes, compiler changes, oh my!
+
+    This is a biggy (too big in fact). It started as a change to allow
+    arguments to be accessed directly from the stack, and turned into a
+    monster.
+
+    Arguments and some lvars can now be accessed directly from the stack,
+    making them cheaper to create and use. This turned out to expose
+    a large number of bugs in the VM related to stack access, as well
+    as some in the GC.
+
+    The big GC change here is that the mark/sweep GC is actually run now,
+    as opposed to before when it would just allocated more and more memory
+    (the source of memory issues I suspect).
+
+commit 564ac024e14a790f4a3d257ddf1d9fa0cb93ee3b
+Author: Florian Gross <florgro at gmail.com>
+Date:   Tue Jul 17 00:20:52 2007 +0000
+
+    $~ specs all over the place;
+    Revised % format string specs (match MRI trunk);
+    Revised hex and oct specs (match MRI trunk);
+    Merged slice together with [];
+    New specs for scan and slice!
+
+commit 2389eb4b36d86732dbb621be1cad3edca0e36aa5
+Author: Pedro Del Gallego <pedro.delgallego at gmail.com>
+Date:   Mon Jul 16 09:26:20 2007 +0000
+
+    * added specs for file_spec
+
+commit a6453b6184353633d14c271533c2e2af7a6c4b12
+Author: Florian Gross <florgro at gmail.com>
+Date:   Sun Jul 15 17:53:58 2007 +0000
+
+    A few specs for char numbers outside of 0..255;
+    A few specs for modifying strings while iterating;
+    New specs for hex, index, initialize(_copy), ljust, lstrip(!), match, next(!), oct, replace, reverse(!), rindex, rjust, rstrip(!);
+    Small additions, fixes & refactoring
+
+commit 217dd5dae127c146559dd1512edac23a94565ae9
+Author: Florian Gross <florgro at gmail.com>
+Date:   Sat Jul 14 23:52:52 2007 +0000
+
+    Taintedness specs all over the place;
+    String subclass specs for String#%;
+    Range subclass specs for access methods;
+    str[idx, count] = str specs (contributed by John Lam);
+    New cases for capitalize(!) / center / gsub(!);
+    Refactoring
+
+commit b8b0c3dd380335260c3870934ca51dce736ce15d
+Author: Florian Gross <florgro at gmail.com>
+Date:   Sat Jul 14 23:39:38 2007 +0000
+
+    Added custom range subclass cases for access methods
+
+commit 558552ec549fd605bed2c8f5c384e8c944e780a2
+Author: Pedro Del Gallego <pedro.delgallego at gmail.com>
+Date:   Fri Jul 13 14:40:15 2007 +0000
+
+    * added cases for file_spec
+
+commit 5218708c630bd8a631522a00aa6cba4e91cbec54
+Author: Pedro Del Gallego <pedro.delgallego at gmail.com>
+Date:   Fri Jul 13 13:36:53 2007 +0000
+
+    * added cases for file_spec
+    * refactoring numeric_spec.rb
+
+commit 3e9dbc15a81950e55a15a7fcca0ab04a5fd5353f
+Author: Florian Gross <florgro at gmail.com>
+Date:   Wed Jul 11 22:09:49 2007 +0000
+
+    Add specs for to_* calls having correct semantics with method_missing() and respond_to?();
+    Small clean up
+
+commit 23961f46af6f74d2d6b9019972e451a5ae12b728
+Author: Florian Gross <florgro at gmail.com>
+Date:   Wed Jul 11 22:00:26 2007 +0000
+
+    Add specs for to_* calls having correct semantics with method_missing() and respond_to?();
+    Removed a few duplicate specs (probably resulting from a mismerge)
+
+commit 639c64ca0965ff79401989ca7dbde862815f13fb
+Author: Florian Gross <florgro at gmail.com>
+Date:   Wed Jul 11 21:09:33 2007 +0000
+
+    Add specs for to_* calls having correct semantics with method_missing() and respond_to?();
+    Fixed String#%'s %E/e/f/G/g and %b/d/i/o/u/X/x specs to verify Kernel#Float / Kernel#Integer semantics instead of to_f / to_i ones
+
+commit e97879670bbc8425810a3c83f15a523066899a89
+Author: Arthur <arthur at unknown>
+Date:   Tue Jul 10 20:04:48 2007 +0000
+
+     * fix a typo
+
+commit 1e8890613a215c61ef90629b8b6023ac4612c499
+Author: Arthur <arthur at unknown>
+Date:   Tue Jul 10 20:03:44 2007 +0000
+
+     * Update Symbol Specs to the new format.
+     * make Symbol#to_int show a warning as in MRI.
+
+commit 1262f24460463628c7cc4e275b7c814048937b57
+Author: Florian Gross <florgro at gmail.com>
+Date:   Tue Jul 10 18:28:06 2007 +0000
+
+    New specs for gsub() without block
+
+commit 0ba87f6edc183385551e4cf8c05212fadaf36427
+Author: Florian Gross <florgro at gmail.com>
+Date:   Tue Jul 10 16:48:46 2007 +0000
+
+    New specs for capitalize, chomp, concat, crypt, eql?;
+    Added missing methods chop, chop!, count;
+    Small improvements and refactoring
+
+commit 226942caef6bd217a13dc235a89c5ccf4a18f98b
+Author: Florian Gross <florgro at gmail.com>
+Date:   Mon Jul 9 21:29:19 2007 +0000
+
+    Strings specs for letters c through e
+
+commit e41c027537f1e4f8ea4b8b5b6fe90df9a21e3aff
+Author: Pedro Del Gallego <pedro.delgallego at gmail.com>
+Date:   Fri Jul 6 17:13:39 2007 +0000
+
+    * added 62 cases for file_spec
+    * remove a bug from obejct#method_missing_spec that break the specs
+
+commit 06d2fd71b847e139a39ab3b7a132ab041a8d4c1e
+Author: Pedro Del Gallego <pedro.delgallego at gmail.com>
+Date:   Wed Jul 4 16:05:21 2007 +0000
+
+    * add 84 cases to the numeric_spec.rb
+
+commit b8d334f575322c65932279346bba61caead61555
+Author: Pedro Del Gallego <pedro.delgallego at gmail.com>
+Date:   Wed Jul 4 10:28:27 2007 +0000
+
+    * 14 cases for Object.method_missing
+    * Add File#atime, File.atime, File#ctime, File.ctime, File.delete, File.executable?, File.executable?
+
+commit f2276130c4bf1894ffb6efb451203dcbfe9322bb
+Author: Charles Nutter <charles.nutter at sun.com>
+Date:   Wed Jul 4 08:48:57 2007 +0000
+
+    Added a spec for Process::times...it's not great, but it's something.
+
+commit f71bb57b3fc69c35d34abdb9959e27efb71bbdff
+Author: Charles Nutter <charles.nutter at sun.com>
+Date:   Wed Jul 4 06:14:06 2007 +0000
+
+    Fixes for #150; handle Time - Time correctly, don't assume it's a number of seconds.
+
+commit 895f1abdc0bfcdb213f97067704b1bb87a7e6d17
+Author: Florian Gross <florgro at gmail.com>
+Date:   Tue Jul 3 17:01:27 2007 +0000
+
+    New specs for casecmp
+
+commit 2aa7cb37925cd92c3b23d4a33a6d7bc7c2b66737
+Author: Florian Gross <florgro at gmail.com>
+Date:   Tue Jul 3 14:07:56 2007 +0000
+
+    New #[] and #[]=, capitalize and casecmp specs;
+    Converted "should work" messages to "works" using a few regular expressions -- I'm still going through the file so bad replacements (if any) will be fixed
+
+commit 719ff3b8959d93d7da8165d6e5b44989afde92d7
+Author: Pedro Del Gallego <pedro.delgallego at gmail.com>
+Date:   Tue Jul 3 00:33:59 2007 +0000
+
+    * new NoMethodErro_spec.rb
+
+commit 5363324044fdc1457cfbf1b738dd931d3255b191
+Author: Florian Gross <florgro at gmail.com>
+Date:   Mon Jul 2 23:58:09 2007 +0000
+
+    Some more new specs
+
+commit fa1b3694e366bf087a8d1ac107257c38ce447251
+Author: Pedro Del Gallego <pedro.delgallego at gmail.com>
+Date:   Mon Jul 2 20:29:20 2007 +0000
+
+    * Add to_s with a base spec
+    * Change foo.aMethod.to_s.should == "bar" with foo.aMethod.should_be_close(bar,TOLERANCE) because floats representation are plataform/implementation dependents, but not changed aBignum.to_s.should = ...
+
+commit 2a5c93afd4ddfef7c30de17c531f49849e9bb957
+Author: Pedro Del Gallego <pedro.delgallego at gmail.com>
+Date:   Mon Jul 2 00:10:06 2007 +0000
+
+    * Add Float::Constant specs
+    * Change foo.aMethod.to_s.should == "bar" with foo.aMethod.should_be_close(bar,TOLERANCE) because floats representation are plataform/implementation dependents
+
+commit 7d3dcc24cb72d6548cf44d8519691f4cd7344801
+Author: Florian Gross <florgro at gmail.com>
+Date:   Sun Jul 1 21:00:37 2007 +0000
+
+    Heavily extended and refactored String#% specs;
+    some cleanup
+
+commit 79ce6628df39d20d03efcd715ea42ba70ae9f03e
+Author: Florian Gross <florgro at gmail.com>
+Date:   Sun Jul 1 20:59:38 2007 +0000
+
+    Add support for MRI as :mri for failure() and similar methods
+
+commit 7e43cd858c0380aaf17dd7bacd8a24cef96bb309
+Author: Florian Gross <florgro at gmail.com>
+Date:   Sun Jul 1 17:11:08 2007 +0000
+
+    rindex terror specs
+
+commit e5b7cf88092cf59357124e3d8f35bc19f8ee589a
+Author: Florian Gross <florgro at gmail.com>
+Date:   Sun Jul 1 01:14:09 2007 +0000
+
+    Added a few new format specs (Most of these should probably be moved to Kernel::format later)
+
+commit a533693824608a03ab6a66882b607fecab3a3a75
+Author: Florian Gross <florgro at gmail.com>
+Date:   Sat Jun 30 00:29:29 2007 +0000
+
+    A few more specs, clean up and compatibility with MRI 1.9 head
+
+commit b9e8936562ec23db63879f9c127dadeadd8adf2e
+Author: Florian Gross <florgro at gmail.com>
+Date:   Fri Jun 29 02:41:40 2007 +0000
+
+    New specs for [], default(), delete(), shift(), yield argument count semantics and modifying hashes while iterating over them;
+    Also removed some warnings and cleaned up the code a bit
+
+commit 72d1b106c1de4b00b9af184eb890e950854a9c77
+Author: Florian Gross <florgro at gmail.com>
+Date:   Fri Jun 29 02:37:55 2007 +0000
+
+    Adding spec for join passing along separator argument for nested arrays
+
+commit 6e2848b7143cd0ae47a7b9ac632a567df7fd30fc
+Author: Florian Gross <florgro at gmail.com>
+Date:   Fri Jun 29 02:35:09 2007 +0000
+
+    Adding message argument for should_raise()
+
+commit 31591886dde4bfd9b4e9de34c26960e45566b7ee
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Jun 27 05:15:15 2007 +0000
+
+    Commiting (#147) math specs by pedro (modified for style, structure, and legibility).
+
+commit c7d623ee836363d0f3d443ba1c676ef0f86e34f7
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Jun 26 04:06:49 2007 +0000
+
+    enhanced spec:ci to take a target on the command line, invoke like: SPEC_TARGET=jruby rake spec:ci. removed deprecated #only and #except from spec_helper.
+
+commit c13a588cb7e37c20ce7e8a9430d854cc51be7b00
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jun 25 08:28:10 2007 +0000
+
+    misc cleanups to specs to eliminate interaction effects.
+
+commit 280296208bd699cb574c662f92b585519a739c6b
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jun 25 02:42:07 2007 +0000
+
+    removed extension dir and added README for subtend specs.
+
+commit 7ce8d4addc77ea9da0daf3ea3dc1fc7b00030b29
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jun 25 02:30:15 2007 +0000
+
+    reorganized subtend specs. stragglers from spec/language reorg.
+
+commit d499ebfd98d8fb9bd50c0f7a46b3587aa1f28c8a
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Jun 24 19:44:12 2007 +0000
+
+    significant reorganization of spec/language, added files that correspond to the desired layout of this section. there remains to be done a large amount of cleanup for existing language specs, and especially spec description strings.
+
+commit bc0d0965bb5a6b3966884b63edd37218359aa46d
+Author: Tilman <tilman at unknown>
+Date:   Sun Jun 24 14:52:15 2007 +0000
+
+    Extended specs for File.join.
+
+commit a4e189f31a8c256821564041c4dbce2a832ba78e
+Author: Tilman <tilman at unknown>
+Date:   Sun Jun 24 13:00:33 2007 +0000
+
+    Fixed a typo.
+
+commit ecaf1abafeb69994b05463742ca4220797f62ad3
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Fri Jun 22 23:25:13 2007 +0000
+
+    * Array specs by Josh Susser (hasmanyjosh)
+
+commit 1c8987b6195d356126ebc3cc9c21e473be915240
+Author: Arthur <arthur at unknown>
+Date:   Fri Jun 22 21:22:30 2007 +0000
+
+     * Heavily extended String specs
+
+commit 663e2cbe0c026aa7e792b6aab682301570ccd766
+Author: Tilman <tilman at unknown>
+Date:   Fri Jun 22 08:59:42 2007 +0000
+
+    Added specs for Time#dup.
+
+commit f9dd8149bd7d794e8686053e8dca010ea71eacba
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Jun 21 06:47:57 2007 +0000
+
+    added methods #compliant, #noncompliant, #extension, #failure. Please read the comments for them in spec_helper.rb. #only, #except are deprecated but have not yet been removed.
+
+commit 389b3cef5176b0244f78294a3c820cc84797e0df
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Jun 21 05:22:36 2007 +0000
+
+    added -f i (immediate) reporter for mini_rspec.
+
+commit d113f855e32d09abaa74bb0ccafa4a65ffce66b1
+Author: Florian Gross <florgro at gmail.com>
+Date:   Wed Jun 20 21:59:27 2007 +0000
+
+    A few more hash order consistency specs
+
+commit 8df2a605937c29b0ca4e89fae37b725e7244fbee
+Author: Florian Gross <florgro at gmail.com>
+Date:   Wed Jun 20 21:24:01 2007 +0000
+
+    Small spec improvements all over the place
+
+commit 5c2472584637b6f5accaaf2450d4c23904b0bbd7
+Author: Florian Gross <florgro at gmail.com>
+Date:   Tue Jun 19 23:06:33 2007 +0000
+
+    Small tweaks to let us run specs against Ruby 1.9
+
+commit 18b06659146f00f0ecf72846c445b03268305328
+Author: Florian Gross <florgro at gmail.com>
+Date:   Tue Jun 19 15:56:02 2007 +0000
+
+    More specs, including frozen hash ones
+
+commit 3cc17a6c7d4c4e4d13b67da4e2bd8937160916f0
+Author: Florian Gross <florgro at gmail.com>
+Date:   Tue Jun 19 15:02:21 2007 +0000
+
+    Specs for methods involving to_hash and more
+
+commit a33e72ba27dc7c80fb7c3947d4fe86521b8987e0
+Author: Florian Gross <florgro at gmail.com>
+Date:   Tue Jun 19 13:35:14 2007 +0000
+
+    New specs for each, each_key, each_pair, each_value, fetch, has_value?, index, initialize_copy, inspect, invert, key?, keys, length, merge, merge!, rehash, to_a and value?
+
+commit f5ec55b0233fd6b7825b04afc6157caac0c529ce
+Author: Florian Gross <florgro at gmail.com>
+Date:   Tue Jun 19 13:18:33 2007 +0000
+
+    Using except(:rbx) for "inspect should handle recursive arrays" instead of commenting it out
+
+commit 7fec6cb5534d22dbfa4dd245cf3b0c0776b3b465
+Author: Florian Gross <florgro at gmail.com>
+Date:   Tue Jun 19 00:56:35 2007 +0000
+
+    New specs for Hash.new, #==, #[], #[]=, #clear, #default=, #delete and #empty?
+
+commit e3085af8e97177f8b7e4ff1c2aad2f306a4f474d
+Author: Florian Gross <florgro at gmail.com>
+Date:   Tue Jun 19 00:53:43 2007 +0000
+
+    Specs for how Array#uniq should use eql?() and hash()
+
+commit 01799e95c71453e8dff9730dd283bf76989e75e5
+Author: Florian Gross <florgro at gmail.com>
+Date:   Mon Jun 18 11:22:47 2007 +0000
+
+    Adding new specs from rue plus more. The diff is a bit chaotic, but everything should be OK.
+
+commit 890deed76153d05c6874b46ec29c474eb4e36e41
+Author: Florian Gross <florgro at gmail.com>
+Date:   Mon Jun 18 11:12:04 2007 +0000
+
+    Moving only() to general spec helpers, adding expect()
+
+commit bf89af6c3b632b88e3cc74bead42f21561da58a7
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jun 18 07:19:15 2007 +0000
+
+    (Jason Toy) added some specs for File (with some modifications) (#130).
+
+commit a7a6d8e336f8d331c60e973fb8f9e0aac1fb61ac
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jun 18 05:20:29 2007 +0000
+
+    (Jason Toy) initial specs for YAML (#123).
+
+commit 4c2f70040050e35da28a8684296f913a3dd4a198
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jun 18 05:14:41 2007 +0000
+
+    (nitay) patch for Bignum#size (#120).
+
+commit b1e57c9c718acfc7f1e61ae1fb60f10b918f8e5c
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jun 18 01:40:29 2007 +0000
+
+    Range specs and code from Ryan Mulligan (#141).
+
+commit 9fa70f392bf83c55d67e682c36d9ebd247cff62c
+Author: Florian Gross <florgro at gmail.com>
+Date:   Sun Jun 17 22:02:48 2007 +0000
+
+    New specs from Ryan Mulligan (#140)
+
+commit 64c970bddeb754115ed193d2f786c797ea90dab3
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Jun 17 20:08:40 2007 +0000
+
+    reorganized specs to put implementation-specific extensions in a subdirectory within the logical division of the specs into core, library, language.
+
+commit 8d437f0f63d4d3f9eea6e4436a28f437e6e76053
+Author: Florian Gross <florgro at gmail.com>
+Date:   Sun Jun 17 19:39:37 2007 +0000
+
+    Initial work on hash specs -- a few new cases and a bit of reorganization
+
+commit d8222049004ba0d6ec51db0c962b5200bb180aec
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Jun 17 03:53:45 2007 +0000
+
+    (yipstar) module specs for undef_method, define_method, remove_method. all pass MRI.
+
+commit 0162cfe6a443ded5d6c8e01a866f5a8d1fbce901
+Author: Florian Gross <florgro at gmail.com>
+Date:   Sat Jun 16 23:11:31 2007 +0000
+
+    Added specs for * / join / to_s with recursive arrays
+
+commit 0744e57d7860b9f6eefcc8e14962d7ee777d2ec4
+Author: Florian Gross <florgro at gmail.com>
+Date:   Sat Jun 16 22:05:32 2007 +0000
+
+    A few more specs for array sub classes with to_ary [ruby-core:11472]
+
+commit 07e0df5111c8ceeda83e50ef434948ee17e92aae
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Jun 16 19:09:19 2007 +0000
+
+    commented out specs that cause the VM to seriously misbehave allocating memory without bound or causing SIGBUS. currently 434 examples, 130 failures at r1357 on MBP.
+
+commit 2abc6e6dc5df662e8f0587636bd1cf3573e39f28
+Author: Tilman <tilman at unknown>
+Date:   Sat Jun 16 16:41:07 2007 +0000
+
+    Don't use timezone names that aren't portable.
+    Instead, specify timezones by their standard name and the offset from GMT.
+    This makes the specs pass on FreeBSD w/ MRI.
+
+commit d4106115c2ca9a4678b7060b6ac0091d66312624
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Jun 16 08:20:29 2007 +0000
+
+    a first, big step to making the entire set of specs more agnostic about the ruby implementation/engine by, paradoxically, qualifying certain specs to only run under certain ruby engines. removed incompatible and rubinius directories. folded in specs where appropriate and moved spec files (e.g. bytearray, tuple, compression) into the appropriate directories. the spec/parser and spec/compiler dividing line is not clearly defined given the range of types of implementations and perhaps should be merged.
+
+commit 3de0340e693e20b5e32c643f1f4dae7e1943e077
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Jun 16 07:07:41 2007 +0000
+
+    migrated more tests from shotgun-tests to specs.
+
+commit 369813306643d98c277841c1e9b400f6b60d3316
+Author: Florian Gross <florgro at gmail.com>
+Date:   Fri Jun 15 22:43:05 2007 +0000
+
+    Add spec for elements returning odd stuff on <=>
+
+commit d70ab64def5ebdcb0e1946618b06e810270eb2aa
+Author: Florian Gross <florgro at gmail.com>
+Date:   Fri Jun 15 22:17:03 2007 +0000
+
+    New specs for frozen arrays
+
+commit fda7128521254d2db2668fec55ef7ce9337ecf1a
+Author: Florian Gross <florgro at gmail.com>
+Date:   Fri Jun 15 21:55:30 2007 +0000
+
+    More specs, mostly for array subclasses
+
+commit 2d57166d2ef2ff63f333b7ee0c196f5c4e10b8cf
+Author: Florian Gross <florgro at gmail.com>
+Date:   Fri Jun 15 16:56:25 2007 +0000
+
+    More than five bazillion new specs including a ton for the very evil []= method (letters i through s)
+
+commit b905a952af41a96f72499750c4635b1352b237ba
+Author: Florian Gross <florgro at gmail.com>
+Date:   Thu Jun 14 23:06:33 2007 +0000
+
+    A few more specs.
+
+commit e17aa3690f7dcd2dab346bf7def0dd26b38072f1
+Author: Florian Gross <florgro at gmail.com>
+Date:   Thu Jun 14 22:16:54 2007 +0000
+
+    A bunch of new specs. Includes highly exotic corner cases.
+
+commit 7845d8928d138353ad03bd496d1800c03e82b538
+Author: Florian Gross <florgro at gmail.com>
+Date:   Thu Jun 14 20:52:23 2007 +0000
+
+    Fix cleanup to work with symbolic method names like ==
+
+commit c677ac036baa847cef3de6a34b2b56c9fd09213c
+Author: Florian Gross <florgro at gmail.com>
+Date:   Thu Jun 14 18:04:43 2007 +0000
+
+    Fixed the test for DATA to match MRI (it's only supposed to be defined when the main file contains __END__);
+    Added test for TOPLEVEL_BINDING
+
+commit 27b2767cd21b5a69ee10a2a629a68de64fd8ae5a
+Author: Florian Gross <florgro at gmail.com>
+Date:   Thu Jun 14 18:03:26 2007 +0000
+
+    Introducing RUBY_NAME so we can spawn a new Ruby for things that can't be tested otherwise
+
+commit 4c4a96f51b4c06dd6896f996ae0e87a68152a3bc
+Author: Tilman <tilman at unknown>
+Date:   Thu Jun 14 15:15:56 2007 +0000
+
+    Don't call Time.now multiple times when comparing their values.
+
+commit cde774be8b188f5870b1ee387b5e5fffd9948163
+Author: Tilman <tilman at unknown>
+Date:   Thu Jun 14 15:00:17 2007 +0000
+
+    Fixed a typo.
+
+commit 6e51eee65c310255183d81d97a98be313ca68afc
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jun 11 04:07:03 2007 +0000
+
+    put guards on imcompatible specs to prevent ruby, jruby from running them. work around for Dir ** globbing being broken.
+
+commit 03dfae6b896a6b67ac6066e94284d992833afac5
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jun 11 02:00:25 2007 +0000
+
+    Added rake task spec:ci. added svn:executable for bin/mspec. enhanced readability of system command in mspec. added globbing across directories to mspec command.
+
+commit 96425667fbff044333c13c5a88c3b8cad156504f
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Jun 10 21:45:52 2007 +0000
+
+    modified mini_rspec to include proper reporters. converted mspec to use ruby to generate a command line to run specs. mspec usage should be similar to spec: mspec spec/core spec/language/class_spec.rb will execute any spec/core/*_spec.rb plus spec/language/class_spec.rb and output a single summary of exceptions, examples, failures.
+
+commit 1075f2cf34a81c00a1b06d2474c78300ae013161
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Sun Jun 10 06:59:40 2007 +0000
+
+    Cleaned up MatchData, added support for accessing named groups.
+
+commit c678d79f125d67328e267001e5fe353f5ef38a2c
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Sat Jun 9 04:20:51 2007 +0000
+
+    * =~ for regexps to mini_rspec by dean (Ticket #136)
+    * Kernel.caller spec relocation for reliability
+
+commit 00eec364dbf3cef03915a68a359ed06b7e501553
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Jun 8 07:10:56 2007 +0000
+
+    reintegrated String specs. all specs in core follow the convention that there is one file named <class>_spec.
+
+commit 9f9817bbb9fea5cc02eb280f01eb50e45ea03118
+Author: Arthur <arthur at unknown>
+Date:   Thu Jun 7 23:49:47 2007 +0000
+
+     * String#replace, String#chop! and String#chop behave now as in MRI.
+     * Specs
+
+commit 129e492fcacf937473bb1c602176b48a352f8572
+Author: Arthur <arthur at unknown>
+Date:   Thu Jun 7 23:39:00 2007 +0000
+
+     * Fix String#<=> when the given object is not a String.
+     * Fix String#to_sym for invalid symbols.
+     * String#to_i raises an error when invalid radix is given.
+     * More specs.
+
+commit 8d7a9e21874d9e44c63d17dd8f6832b942805707
+Author: Arthur <arthur at unknown>
+Date:   Thu Jun 7 23:31:25 2007 +0000
+
+     * Make String#capitalize!, String#downcase! and String#upcase! check for the 'frozenness' of self
+     * Specs
+
+commit 10087a0c92217d1fbadfede9fdb0099c7eb195e6
+Author: Arthur <arthur at unknown>
+Date:   Thu Jun 7 23:25:08 2007 +0000
+
+    * Spec for String#==
+
+commit e51ca54f6f4e9e3dabd48895fa2cb746fb0d3c17
+Author: Arthur <arthur at unknown>
+Date:   Thu Jun 7 23:23:23 2007 +0000
+
+     * Fix String#=~ to work as in MRI.
+     * Specs
+
+commit d2c7d6e6bb624c23e994888b6a235022486e0c69
+Author: Arthur <arthur at unknown>
+Date:   Thu Jun 7 23:16:35 2007 +0000
+
+     * Alias String#size to String#length.
+     * String#<< now correctly checks and converts (where applicable) arguments.
+     * String#<< raises an error if used on frozen string.
+     * Added extended specs for String#<<.
+
+commit c389493556e3394cce846698aa4fc6a67a5f4b40
+Author: Tilman <tilman at unknown>
+Date:   Thu Jun 7 18:14:02 2007 +0000
+
+    Time#zone_offset and #zone_utc? are also in stdlib already.
+
+commit 7dcd86dca123edaec7edec2853cba2af27ca6d52
+Author: Tilman <tilman at unknown>
+Date:   Thu Jun 7 18:07:59 2007 +0000
+
+    Moved the specs for Time methods that should be in stdlib rather than in core to spec/lib/time_spec.rb
+
+commit 953dfdfdea395ead465a9e19339d94f8b8c7d684
+Author: Hapk <hapk at unknown>
+Date:   Thu Jun 7 17:36:20 2007 +0000
+
+    Added more specs for Array#pack: covering %#bB.
+
+commit 7aa84bc102ad6943aed46cbb357f233ac4b6d3f9
+Author: Florian Gross <florgro at gmail.com>
+Date:   Thu Jun 7 16:47:03 2007 +0000
+
+    Make next with arg match MRI; Fixed typos and a copy&paste error
+
+commit 40c354444d6d7a2fd3aeb940c3bdcf6fd2a28940
+Author: Florian Gross <florgro at gmail.com>
+Date:   Thu Jun 7 16:43:17 2007 +0000
+
+    Fixed to run on MRI (uses Object.const_get now)
+
+commit 95dd0ca698d0b1f79a11f4a556c171bea33ba176
+Author: Florian Gross <florgro at gmail.com>
+Date:   Thu Jun 7 12:52:40 2007 +0000
+
+    Make behaviour match MRI, fixed copy&paste errors, did some refactoring
+
+commit 191d4e80406a6e4ffd08594ddeada47fb3219bf0
+Author: Florian Gross <florgro at gmail.com>
+Date:   Thu Jun 7 01:41:08 2007 +0000
+
+    Fix chaos introduced in rev 1283
+
+commit e0f5184493607f7d9c216146207dc298893a744c
+Author: Florian Gross <florgro at gmail.com>
+Date:   Thu Jun 7 01:28:55 2007 +0000
+
+    Fix Dir.chdir test on OS X (/tmp is symlinked to /private/tmp)
+
+commit a32062d6099556a93afee61f0b0000a28675fbb6
+Author: Tilman <tilman at unknown>
+Date:   Wed Jun 6 21:44:00 2007 +0000
+
+    Deleted old specs.
+
+commit de7b3ecaa61c4d3514c8a3534805e9c8d0d1bb2f
+Author: Tilman <tilman at unknown>
+Date:   Wed Jun 6 21:09:48 2007 +0000
+
+    Made the Time#to_a spec pass with any time zone, too. MRI passes all the specs for me now.
+
+commit ac1e295da36f23184e583f5e62a4909959550dbd
+Author: Tilman <tilman at unknown>
+Date:   Wed Jun 6 21:06:32 2007 +0000
+
+    Fixed specs for Time#localtime, #gmtime and friends.
+
+commit 064a5967f5550cf4a2e10885ab2c9f22afa59da2
+Author: Tilman <tilman at unknown>
+Date:   Wed Jun 6 20:56:41 2007 +0000
+
+    Fixed a few more Time specs. Instead of the imaginary time zone "PDT"
+    I'm now using Asia/Kuwait for some specs, because those lucky people
+    don't have DST, which means we don't have to flip the spec expectations
+    every 6 months.
+
+commit 8f6b6a5a5f8e62631a58061b6cdeeaff5654aeb0
+Author: Florian Gross <florgro at gmail.com>
+Date:   Wed Jun 6 20:41:32 2007 +0000
+
+    module_function specs matched to MRI (module_function makes the instance methods private)
+
+commit 8cc656b95cb71ea476e787ce635df889090f8050
+Author: Tilman <tilman at unknown>
+Date:   Wed Jun 6 20:41:02 2007 +0000
+
+    Fixed the Time#year spec. Using CET, too, since specc'ing using 1969 just feels wrong.
+
+commit ed7be9eaa73b8b1d85964f5c8fdfc250e2e8f62f
+Author: Tilman <tilman at unknown>
+Date:   Wed Jun 6 20:38:43 2007 +0000
+
+    Oops, fixed a stupid error in r1281.
+
+commit e81d716092e0c6a8b52775ca2b9e0d44c4e3ef7f
+Author: Florian Gross <florgro at gmail.com>
+Date:   Wed Jun 6 20:35:42 2007 +0000
+
+    Divmod matched to MRI (Special casing darwin on MRI because it doesn't raise FloatDomainError exceptions in some cases)
+
+commit fc5f461c47b7212f05f8699110e313aeab46d46d
+Author: Tilman <tilman at unknown>
+Date:   Wed Jun 6 20:35:34 2007 +0000
+
+    Fixed the Time#hour, #min and #day specs.
+
+commit 6847a1e49ff4ad4dfe7c6e9e4d7352f92d72b4cd
+Author: Tilman <tilman at unknown>
+Date:   Wed Jun 6 20:26:26 2007 +0000
+
+    Don't call Time#seconds as MRI doesn't have it and it doesn't seem to be needed anyway.
+
+commit b9a6ccc89d46ffa910c9bdc0fece9d013440872d
+Author: Tilman <tilman at unknown>
+Date:   Wed Jun 6 20:14:15 2007 +0000
+
+    Time#asctime needs to use %e to print the day of the month.
+
+commit 7311fdf31481ba7a4373d5b007efb62c1f84c389
+Author: Tilman <tilman at unknown>
+Date:   Wed Jun 6 20:03:30 2007 +0000
+
+    Hardcode output for Time.gm(...).inspect. This makes utctime superfluous for now.
+
+commit 229e7eefe7944df92ab2f84e553992fc0c868dbd
+Author: Tilman <tilman at unknown>
+Date:   Wed Jun 6 19:19:38 2007 +0000
+
+    Fixed two more Time specs.
+
+commit 7f490d752ed97bfb9b830d24f4e2c2f44107c141
+Author: Tilman <tilman at unknown>
+Date:   Wed Jun 6 18:41:47 2007 +0000
+
+    Make sure that with_timezone resets .
+
+commit 9c8d25c4d072510215407209fa52a06b85e95d35
+Author: Tilman <tilman at unknown>
+Date:   Wed Jun 6 15:57:32 2007 +0000
+
+    Made the wday spec work with any timezone.
+
+commit 4882f8a676d5234339296d6a4489f3a7134cf5fd
+Author: Tilman <tilman at unknown>
+Date:   Tue Jun 5 20:08:22 2007 +0000
+
+    Fixed a typo.
+
+commit fb63faa2165cafdc7907f173344638609f884833
+Author: Tilman <tilman at unknown>
+Date:   Tue Jun 5 20:03:06 2007 +0000
+
+    Make sure that a GMT Time object returns true from gmt?
+
+commit deae4911588b555264f529e765dc5baf7a2c6e69
+Author: Tilman <tilman at unknown>
+Date:   Tue Jun 5 20:00:45 2007 +0000
+
+    Use with_timezone for the gmtoff specs.
+
+commit 625dd8e366f846cf15165e323a719199627ae422
+Author: Tilman <tilman at unknown>
+Date:   Tue Jun 5 19:47:29 2007 +0000
+
+    Added a helper method to temporarily override the TZ env var and fixed one of the specs by using it.
+
+commit b359eb74d41749919c6177ec2af6b5b516308bd8
+Author: Tilman <tilman at unknown>
+Date:   Tue Jun 5 19:33:01 2007 +0000
+
+    Provided 'date' calls for coreutils' date program.
+    Checking for coreutils using RUBY_PLATFORM isn't the right way,
+    but it will do for now.
+
+commit b19c3c8d886885adc08ac69469792b14e47ba265
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Mon Jun 4 23:42:20 2007 +0000
+
+    * Improved Array#sort with additional spec by wycats (ticket #135)
+
+commit 8513e72a5af7596c8782ee45dff39607489dbf12
+Author: Tilman <tilman at unknown>
+Date:   Mon Jun 4 16:39:53 2007 +0000
+
+    Ticket #132: Implemented ENV in core and removed read-only ENV from shotgun.
+
+commit 03d75a78855213f6267fb8f80f9c71d0a031641f
+Author: Mojombo <mojombo at unknown>
+Date:   Sun Jun 3 20:49:41 2007 +0000
+
+    Implemented most of Time, updated time specs accordingly
+
+commit 36975b1b79abbd38de68223cdc8ecbca9ba0feee
+Author: Bremac <bremac at unknown>
+Date:   Sun Jun 3 16:20:59 2007 +0000
+
+    Add Functions::abort, Functions::printf, and Functions::sprintf, and minimal specs. Closes ticket 87.
+
+commit 9d25d95a4aa3fd22d3f3a340427d40410488a770
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Sun Jun 3 12:41:49 2007 +0000
+
+    * Lots of new assignment specs by crafterm (Marcus Crafter) (Ticket #133)
+    * MatchData#inspect and #to_s now indicate it is an MD object
+    * -dc notes which file/method is being compiled
+
+commit ec0fb5beed68155c9e1ff67185cc2c8e4e474c04
+Author: Arthur <arthur at unknown>
+Date:   Fri Jun 1 22:23:39 2007 +0000
+
+     * Fix String#[] and add some edge cases to the specs
+
+commit 068b48538ec574558ab787d59b14ebd2925f1126
+Author: Tilman <tilman at unknown>
+Date:   Fri Jun 1 18:12:10 2007 +0000
+
+    Renamed module 'B' to something more meaningful to avoid name clashes.
+
+commit eb3de8af03d070b03216daa4fc0c2216d9d3e2a2
+Author: Arthur <arthur at unknown>
+Date:   Fri Jun 1 18:09:52 2007 +0000
+
+     * Extend String#slice! specs
+
+commit db4775403d57ea29165165b9cbf0110739d91e2a
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Fri Jun 1 02:26:30 2007 +0000
+
+    * Ticket #128 - Patch by Marcus Crafter to enhance assignment specs
+
+commit 6098aa16357ce4261feb51bdf083c02442b1f074
+Author: Tilman <tilman at unknown>
+Date:   Thu May 31 19:05:45 2007 +0000
+
+    Implemented rb_obj_alloc() and friends in subtend.
+    The spec for rb_class_new_instance() is still failing because of strange
+    subtend behavior.
+
+commit ae2c3cb4502ba9475111eeef10b2b70780a1b9f4
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Thu May 31 13:54:24 2007 +0000
+
+    * Fixed shotgun compile failure (possibly r1204)
+    * Various casts to avoid warnings
+
+commit d317d336412d0c1778d4c015dfe96287c44e1bd9
+Author: Hapk <hapk at unknown>
+Date:   Thu May 31 11:12:02 2007 +0000
+
+    Added specs for "break", "next" and "redo" keywords.
+
+commit a33f801f8f142d997a553e41cde9f5b10d75ee65
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Thu May 31 04:23:33 2007 +0000
+
+    * Kernel.caller spec by jtoy (Ticket #112)
+      (kernel_spec is badly broken still)
+
+commit ce15eb69e721820e75b0f7aeae6488701cbe9555
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Thu May 31 03:55:27 2007 +0000
+
+    * Fixed String#dump spec expectation (Ticket #105)
+    * Moved RUBY_ENGINE to rubinius-specific variables_spec (Ticket #109)
+
+commit 7d2c575164dfbbd436d7c6ff400c088a68b29fa8
+Author: Hapk <hapk at unknown>
+Date:   Thu May 31 00:42:50 2007 +0000
+
+    Added "if" specs for variable scoping.
+
+commit ceb4430f9c713f409f2567a0aa324f19afb09b79
+Author: Hapk <hapk at unknown>
+Date:   Thu May 31 00:35:49 2007 +0000
+
+    Added specs for while / until condition/block evaluation order.
+    Added specs for next and redo statements.
+
+commit 4adeecf9333236800396bd77f928fb902e785692
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Wed May 30 22:17:04 2007 +0000
+
+    * Fixes to RSpec cleanliness of specs, most patches by zimbatm.
+      (Tickets #97 #98 #100 #103, partially #99)
+
+commit bbb0714b6ae60adb0af7445ed56544ceec3bc890
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Wed May 30 21:41:03 2007 +0000
+
+    * Array specs are RSpec/MRI-clean and pass (Ticket #95)
+    * Fix to should_raise for MRI by zimbatm
+
+commit d627ab36d3839745e057d9f5de781269ba7b154a
+Author: Hapk <hapk at unknown>
+Date:   Wed May 30 21:15:39 2007 +0000
+
+    Added specs for 'while' and 'until' statements.
+
+commit 8a2177c7f23181909c5dcb51dd6df1e5b930fdbe
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Wed May 30 20:32:13 2007 +0000
+
+    * Enhanced hatefulness of 'for' specs
+
+commit 9f64f2a1c584420fcabfc73a7c464aa3b1ba2e90
+Author: Hapk <hapk at unknown>
+Date:   Wed May 30 19:46:57 2007 +0000
+
+    Added specs for postfix "if" form.
+
+commit 9dd8a846adf356d75ceac566612f35d1d30840bf
+Author: Hapk <hapk at unknown>
+Date:   Wed May 30 19:34:50 2007 +0000
+
+    Moved loop specs from spec/language/expressions into spec/core/kernel_spec.rb.
+    Added more specs for Kernel#loop.
+
+commit ddf2e3169c3a8b587f9abfb0ddf196635aec5186
+Author: Hapk <hapk at unknown>
+Date:   Wed May 30 18:57:38 2007 +0000
+
+    Removed obsolete "elsif" statement spec.
+
+commit 3b6dca92ea810aa7866a2c7aa0b8812e72b6630e
+Author: Hapk <hapk at unknown>
+Date:   Wed May 30 18:56:00 2007 +0000
+
+    Updated specs for "if" statement to cover more cases.
+
+commit 678f609bfe826538ec16e75f7362bcb3f50c8d6d
+Author: Arthur <arthur at unknown>
+Date:   Wed May 30 17:09:09 2007 +0000
+
+     * Extend Specs for expressions
+     * Break the Specs up
+
+commit df60cc21e4213ac8344b5ed91e802d8cbbfa47a0
+Author: Tilman <tilman at unknown>
+Date:   Wed May 30 17:00:17 2007 +0000
+
+    Implemented rb_ary_store() in subtend. The last spec still fails, but we'll fix that later.
+
+commit 8e0fea820c1683913625dfe95c7d3210d4548814
+Author: Arthur <arthur at unknown>
+Date:   Wed May 30 10:09:55 2007 +0000
+
+     * Extend Specs for Class Definitions (nested class definitions, class definitions that extend objects, Multiple Definitions of the same class).
+     * Lots of them are failing in rbx.
+
+commit ce16f2b568ea89cb5f13660d3175165b105e4233
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Wed May 30 01:18:39 2007 +0000
+
+    * OK, that should really be in 'rubinius', not 'incompatible'
+
+commit 888b777539baa116eedc14191ac85d57aec54349
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Wed May 30 01:15:37 2007 +0000
+
+    * 'Options' is a Rubinius-only class, and should therefore be in 'incompatible'. Closes ticket #102
+
+commit 46a58344fa2f03fb4154b78f34239a815b2d9944
+Author: Bremac <bremac at unknown>
+Date:   Tue May 29 23:52:52 2007 +0000
+
+    Fix typos in specc'ing module_function, and make that spec play nicer with MRI.
+
+commit e0cedb691f76af4554bfc7522a7668ff861492f0
+Author: Bremac <bremac at unknown>
+Date:   Tue May 29 20:49:42 2007 +0000
+
+    More complete raise implementation and specs: Handle instantiation.
+
+commit 9f3a3bfe9d2610dd7e9e752c86a1b8aba47f7fdf
+Author: Hapk <hapk at unknown>
+Date:   Tue May 29 20:39:07 2007 +0000
+
+    Added 'case' spec for case with empty 'else' body.
+
+commit 8f888bd3d0a01afc945c45c0502a0b97f3227c48
+Author: Arthur <arthur at unknown>
+Date:   Tue May 29 20:34:18 2007 +0000
+
+    Extend Class specs. Some specs failing in rbx.
+
+commit f52d9faadc1eac31e7b92c1edb1cf45ca1d42c89
+Author: Tilman <tilman at unknown>
+Date:   Tue May 29 20:29:53 2007 +0000
+
+    Implemented rb_str_new2() in subtend.
+
+commit d4d5e3d1eb8e5ee44acff6697a29a37b9eca25b2
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Tue May 29 20:00:51 2007 +0000
+
+    * Patch by HaPK - Add specs for 'case', and enhance specs for 'for'
+
+commit f3e736731e852dacbf90e8e3e33d840384909354
+Author: Tilman <tilman at unknown>
+Date:   Tue May 29 18:56:41 2007 +0000
+
+    Actually exercise rb_ary_unshift() in the spec.
+
+commit 69d756ae17fce1fb53be5e7a1b5b7169b69c4aa2
+Author: Tilman <tilman at unknown>
+Date:   Tue May 29 18:55:32 2007 +0000
+
+    Implemented rb_ary_shift() in subtend.
+
+commit 9f84a5ecddae6c0daf1fd7e46815275c7d7429db
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Tue May 29 18:50:41 2007 +0000
+
+    * Fix to Array#to_a for subclasses
+
+commit 2bbc87fc1b5261b57927a02f75915829b398b478
+Author: Tilman <tilman at unknown>
+Date:   Tue May 29 18:50:33 2007 +0000
+
+    Implemented rb_ary_unshift() in subtend.
+
+commit 4e69b95ad7991a57fd3f9b7cbf350cb5b13c6a5c
+Author: Tilman <tilman at unknown>
+Date:   Tue May 29 18:46:53 2007 +0000
+
+    Implemented rb_ary_dup() in subtend.
+
+commit 122a9cfbe79e872146116c8e045a243fffd333e6
+Author: Tilman <tilman at unknown>
+Date:   Tue May 29 18:31:48 2007 +0000
+
+    Marked SubtendArray method functions as static.
+
+commit 0e3319c07aa1d536343343fbbe1004c4cdce2df0
+Author: Tilman <tilman at unknown>
+Date:   Tue May 29 18:28:05 2007 +0000
+
+    Implemented rb_ary_clear() in subtend.
+
+commit 621f0082fca85140791e2c40aabc8ad3fe3318a6
+Author: Tilman <tilman at unknown>
+Date:   Tue May 29 17:58:31 2007 +0000
+
+    Implemented rb_ary_entry() in subtend.
+
+commit 9c7d05c0bb19e65f57fc6aab778785e2a727c4a4
+Author: Tilman <tilman at unknown>
+Date:   Tue May 29 17:42:40 2007 +0000
+
+    Ticket #91: Made spec/subtend/rake_helper.rb more portable.
+
+commit 5dba201079bdf8da63364ea760342f3cef85df74
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Tue May 29 15:56:01 2007 +0000
+
+    * Add specs for Array#pack, patch by HaPK
+
+commit 2d71e18c6f08144d4fb402904a9226a8500343bd
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Tue May 29 15:28:45 2007 +0000
+
+    * Better fix to method argument scoping, to support: def foo(a, b=a.length)
+
+commit f9deebb38b80cdea3dff44d7461404e5f501f566
+Author: Defunkt <defunkt at unknown>
+Date:   Tue May 29 09:59:00 2007 +0000
+
+    * Add spec for Struct subclasses.  Closes ticket #110
+    * Add failing specs for Class.new.  Closes tickets #89 and #94
+
+commit 3be02f950f32a288fac1cd5cff0ae014057c96fb
+Author: Defunkt <defunkt at unknown>
+Date:   Tue May 29 09:12:00 2007 +0000
+
+    * Add should_include convenience method to make rspec more compatible with mspec.  Closes ticket #106
+
+commit 68e716e1874e7dd4186c7eef2aea5e25157a44fd
+Author: Vagabond <vagabond at unknown>
+Date:   Tue May 29 03:46:33 2007 +0000
+
+    * Add HaPk's fix to Numeric#== to handle failed coersion with corresponding specs
+    * Removed duplicate definition of Numeric#==
+
+commit a63e6fcb08e34c625957d8d23bbe602964863c5b
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Tue May 29 02:59:43 2007 +0000
+
+    * Add Kernel#eval. Probably lacks some crazy MRI semantics at the moment
+    * Method definitions should properly create a clean scope for locals
+    * Support wacky default arguments, such as blah = lambda {|z| z.foo(another_arg) }
+    * Optional label prefixes in assembly output, for easier debugging
+
+commit f1295ac58d2b601f539efe0e660dfed9d043d1d7
+Author: Vagabond <vagabond at unknown>
+Date:   Tue May 29 01:39:46 2007 +0000
+
+    Change Time specs to use ENV['TZ'] instead of `date` in hopes of being more portable
+
+commit 404faeca93c007f3eb9b3df52c2bde7673565113
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Mon May 28 19:20:27 2007 +0000
+
+    * Fix some mistakes in method_spec that caused it not to pass under MRI
+
+commit d336078c02e1306acb4b2664a427b63e93b02788
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Sun May 27 06:03:25 2007 +0000
+
+    * Fix local scoping to allow for method definitions on local variables
+    * Pass all the horrible method definition specs
+
+commit 7759a0f91f794d05a32d48dd2e67d05c0b1dace7
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Sun May 27 05:03:53 2007 +0000
+
+    * Rename Thread.yield to Thread.pass
+    * Implementation of 'module_function' by bremac, with minor tweaks
+
+commit 55f30c5e59d16ebbf045be93a7d406fed9a4dcbd
+Author: Vagabond <vagabond at unknown>
+Date:   Sun May 27 00:34:44 2007 +0000
+
+    Added defunkt's implementation of Module#const_set and const_get and associated specs (Ticket #72)
+
+commit 9cebe0c56fda41b83ab14d39275e327daf0bdcc9
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Sun May 27 00:31:47 2007 +0000
+
+    * Fixes to mini_mock by bremac (Tickets #85 and #86)
+
+commit f33756f22597bd280e453d5c7ad97685fa284579
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Sun May 27 00:24:51 2007 +0000
+
+    * Fix typos in splat_spec (Ticket #77) by tilman
+
+commit ea13a828e5fc19694fc24da25b2224a75462a88c
+Author: Vagabond <vagabond at unknown>
+Date:   Sun May 27 00:11:58 2007 +0000
+
+    Add Chris Wanstrath's (defunkt) Struct patches. Tested working against MRI.
+
+commit 3ca0ddcc2c39fec74f10b75df2af5c1581b9eaa3
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Sat May 26 23:56:26 2007 +0000
+
+    * Array fixes. Only spec failure remaining is #pack
+
+commit 4d91aa707a47189398455eb1c40b341dc3766ccf
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Sat May 26 20:05:13 2007 +0000
+
+    * Array fixes to pass specs (including HaPK's code).
+      All remaining failing Array specs except #pack are
+      not Array bugs. Test this heavily.
+
+commit 6793b34a54ab8e24e8a66a8af026a34315ac9f5b
+Author: Vagabond <vagabond at unknown>
+Date:   Sat May 26 07:34:12 2007 +0000
+
+    Add cdcarter's Enumerator implementation and specs translated from his test/unit tests
+
+commit fd10c39192825aeef68c8843c2813cf50b8137f2
+Author: Vagabond <vagabond at unknown>
+Date:   Fri May 25 20:12:22 2007 +0000
+
+    Some fixes to rand with associated specs
+
+commit 60d37d28b715854f5186598c90101824665ce715
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Fri May 25 19:43:11 2007 +0000
+
+    * Properly normalize default method arguments, to support: def(x, y=puts('hi'))
+    * Fix 'for' loops so that they use 'create_block' in the proper way
+    * Move all 'for' processing out of compiler.rb
+
+commit 3c04a44e8ff9e84f48fbd2d3afabb886494b5a98
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Fri May 25 06:35:48 2007 +0000
+
+    * Patch by HaPK - Fixes String#dump / inspect / upto
+
+commit 9e2442110ec33ff9ca4875407b227f2cf79a606a
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Fri May 25 05:36:31 2007 +0000
+
+    * Use a random pivot point for better worst-case Array#sort performance
+    * Add 'rake pristine' task to kill all .rbc files
+    * More tricky specs for splats and multiple-assignments
+
+commit 7bea77d8d3e8f190dba4f34fead888551fd07730
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Thu May 24 23:50:06 2007 +0000
+
+    * HaPK's patch to String#<=>, along with its specs
+
+commit 0e6007e7eb9eee5e3ab1acdf55da00f4ab8c4be0
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Thu May 24 23:29:49 2007 +0000
+
+    * Add spec for masgn semantics
+    * Fix numerous multiple assignment bugs
+
+commit 6d68d22efd7d2dba75c77cf957edb28dca6df6ef
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Thu May 24 07:05:00 2007 +0000
+
+    * New Array#sort implementation, fixes several Array and Hash specs
+    * Add a warning comment to bytearray.rb about some incorrect <=> behavior
+    * Prevent unimplemented Array specs from crashing the spec run
+
+commit 0ca089c7354ec96103cb637f861751ca7df01136
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Thu May 24 01:15:40 2007 +0000
+
+    * Support all kinda crazy splat syntax
+    * Updated some compiler specs, though some TODOs remain
+    * Added a comment above unshift_tuple, since it really shifts
+
+commit bbe0b73b07a393f94724964941d2fdd717a2d72e
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Wed May 23 19:58:10 2007 +0000
+
+    * Add compiler support for: yield(*args)
+    * Update some compiler specs to match recent fixes
+
+commit 32a7082205d3d214ad43a477286270a96076b140
+Author: Kev <kev at unknown>
+Date:   Wed May 23 17:32:06 2007 +0000
+
+    Make spec titles consistent (describing C api behavior)
+
+commit 699c66f8c8304522fbb3589356fe2bcd298277c8
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Wed May 23 06:56:25 2007 +0000
+
+    * Use yield instead of &prc.call when initializing a thread.
+    * Fixes VM crash / closes ticket #68
+    * TODO - Why the HELL does this fix it?
+
+commit f8b6e1ff9e19e786b08fee30988eb874eae748b5
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Wed May 23 03:18:26 2007 +0000
+
+    * Implement Thread.main
+    * Prevent Object#inspect from crashing the VM when the inspected object has itself as one of its instance variables
+
+commit f24f573608ee5569b29754a017769db0f866cf4c
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Tue May 22 22:35:14 2007 +0000
+
+    * Implement 'class_variables' method
+    * instance_variables and class_variables now accept an optional argument, causing them to return symbols instead of strings
+    * Support defined?(@@class_var)
+    * Support defined?(a_vcall)
+    * Fix false-positives in defined_spec.rb
+
+commit da540b51c47b2349b0ab8d4ca0bd11124138f9ce
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Tue May 22 20:52:30 2007 +0000
+
+    * Add compiler support for begin/rescue/else/end syntax
+    * Default rescue clause should be StandardError, not RuntimeError
+    * Add specs for 'else' and empty begin sections
+    * All Exception specs now pass
+
+commit 82abf73fd99ec45f7cb6d98d19b219a61af59a61
+Author: Vagabond <vagabond at unknown>
+Date:   Tue May 22 18:39:59 2007 +0000
+
+    * Fix Object#instance_eval to bring it into line with the specs and MRI
+    * Fix Object#instance_variable_validate to not accept fixnums as instance variable names
+    * Add another Object#send spec that tests exception raising for missing singleton method names
+
+commit 3b624f3f49c0433289224baf656b3d7be78cecd8
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Tue May 22 08:15:48 2007 +0000
+
+    Fix the block arg scoping problem, also add a missing file from the compiler specs.
+
+commit 59af7028c060c8e3f9b9c107fb750a71dd37a1d6
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Tue May 22 07:14:54 2007 +0000
+
+    A bunch of yummy-ness. Local variables now conform to the 'standard' behavior, ie they're allocated at different depths inside blocks (this is the yarv/jruby behavior).
+
+    Cleaned up a couple of subtend things.
+
+commit f8ed63efac6fa661dd39db2c207b66c34d132546
+Author: Vagabond <vagabond at unknown>
+Date:   Tue May 22 03:28:17 2007 +0000
+
+    Add specs for Object #method, #respond_to? and #__send__. These currently fail with singleton methods on rubinius.
+
+commit 0d6e6b7109014c97d8f8be136166b3279d5a1108
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Tue May 22 02:06:19 2007 +0000
+
+    * Handle 'call' nodes containing newlines, e.g. x = [5,6,7,8];p Hash[*x]
+    * This is probably the wrong implementation, but it does work
+
+commit 518f7d34112e536d726cecfb2473c7b3db9ec33e
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Tue May 22 00:52:01 2007 +0000
+
+    * Fix mini_mock's cleanup process
+    * Add the ParseTree sexp test cases as specs. Currently in serious need of auditing
+
+commit 17ad76c162ff0cfe9662c20d418f455581389b42
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Mon May 21 21:50:13 2007 +0000
+
+    Add a failing spec
+
+commit 1744773b7f57c766c75d188b04e55540d45e19d0
+Author: Vagabond <vagabond at unknown>
+Date:   Mon May 21 20:22:04 2007 +0000
+
+    Do some env trickery to make Kernel#at_exit testable
+    Improve implementation and specs for Kernel#warn
+
+commit 45733aa44e8daee9e8c5e552ac9312f21163fe39
+Author: Vagabond <vagabond at unknown>
+Date:   Mon May 21 20:16:18 2007 +0000
+
+    Convert time specs to compare against output of the date command
+    Change Time#inspect to use %z (GMT offset) instead of %Z (timezone)
+
+commit e58ef35a05d2a565befeaf3600bc00f21203a84c
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Mon May 21 20:12:34 2007 +0000
+
+    Add spec for breakage caused by 1089.
+
+commit a5d54efe9a45f3acc1cdb0183a8c13ce6ed5e327
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Mon May 21 04:57:41 2007 +0000
+
+    * Options implements a minimal lightweight option parser
+
+commit b28b77af82d99a7a3ec5a78f6ab8b4e138ac577b
+Author: Kev <kev at unknown>
+Date:   Mon May 21 03:54:33 2007 +0000
+
+    Add missing hash spec
+
+commit 81496352bdc2b6b27e293b7542908c6be54b9b6b
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon May 21 02:08:57 2007 +0000
+
+    added specs from ticket #38 (David Anderson), but not patch because implementation was invalid (e.g. [].first(0) => [] not nil) and superceded by recent patches. fixed Array#[i,0] => [] exposed by the added specs.
+
+commit 4ed6afc81262a4197f1ddc646ada94277cd9abe6
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon May 21 01:07:36 2007 +0000
+
+    HaPK's patch to Array#[] with specs. Knocks 14 failures down to 6. Ticket #60.
+
+commit b267aee1c10b6092d954c72d5776f4eafc109e51
+Author: Kev <kev at unknown>
+Date:   Sun May 20 21:09:49 2007 +0000
+
+    rb_raise, rb_const_get, exception definitions. Wooooo exceptions from C
+
+commit 37793ed650e6ce7352a7547cf4bc68f2ceb2f0b4
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Sat May 19 08:42:23 2007 +0000
+
+    * Added nastier multiple-assignment-with-splat specs
+
+commit 39c9817fa1932f9fe708a8ba78f43cb39e7cb68b
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat May 19 08:30:06 2007 +0000
+
+    twifkak's Kernel.fail patch with slightly modified specs.
+
+commit 264a42e8c11d08afa895b415453d59e1e1efe2e1
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Sat May 19 08:01:47 2007 +0000
+
+    * Remove a misleading comment in exception_spec
+    * Pre-compile bin/*.rb after a make install
+
+commit 7608e585e02283677275aaf5e5283e397ed2d671
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri May 18 23:57:09 2007 +0000
+
+    Vagabond's Kernel.warn.
+
+commit 9a41c5a21bbc822ff9ff758eb2962ba80e2d454b
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Fri May 18 18:52:36 2007 +0000
+
+    * Re-enable tr and unpack String specs
+    * Change 'Nan' to 'nan' in Sprintf to match MRI
+
+commit fdc7032c6e4823727312cc7e5c33386cf9d91429
+Author: Mental <mental at unknown>
+Date:   Fri May 18 06:01:20 2007 +0000
+
+    add spec for ensure result elision
+
+commit 37438dc826624c3fee3afc1d30a9f661bbb1ab8d
+Author: Mental <mental at unknown>
+Date:   Fri May 18 05:45:28 2007 +0000
+
+    basic thread spec
+
+commit d89b7728d148ba8c1ddd74323aa8f9e3dae79691
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Fri May 18 02:37:55 2007 +0000
+
+    * Fix 'should_raise' in mspec and rspec helpers
+    * Added some new Module specs, and fixed existing failures
+
+commit f63e0cf797158a239f65714918debf7a6c1bb687
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Thu May 17 04:12:58 2007 +0000
+
+    * First draft of a mock lib for mini_rspec
+
+commit c7fd82a8b4b84088de45463dbc25ae7eea5aabe2
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Wed May 16 22:38:27 2007 +0000
+
+    * at_exit handlers should run in reverse order of registration
+
+commit 2fb5c6e46f1682d927be8a9e116a609c75ec8be5
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Wed May 16 22:14:21 2007 +0000
+
+    * Fix Kernel.Array(). All core/kernel specs pass now
+    * Add Kernel#at_exit specs
+    * Fix Kernel#`
+    * Move AtExit handler array from Ruby namespace to Rubinius
+    * It's spelled 'occurred', not 'occured'
+
+commit 3d1605a3ca731b05b5c03ebd8a6edcf386612930
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed May 16 06:04:16 2007 +0000
+
+    added incompatible specs for #instance_methods returning symbols.
+
+commit 8ba8409ae0ab94a33cd082f02a81d4d1eab35b59
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Wed May 16 04:27:22 2007 +0000
+
+    * Patch by shadowfiend - Enhance Module specs and implement Module#instance_methods
+    * Make sure instance_methods always returns symbols, not strings
+
+commit 1e9b0066d712d4507260be02cf2bf116b2519af2
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Wed May 16 03:24:35 2007 +0000
+
+    * MethodTable 'is a' Hash, and does not need its own fields in the bootstrap. Fixes 'Object.methods.keys'
+
+commit 8c57dd0e26cb5468c1b0150c5d9c5d80ae6f2de2
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon May 14 06:18:42 2007 +0000
+
+    fixed class specs to pass on MRI. put rbx-specific integer specs in spec/rubinius.
+
+commit 8b43acd25a14f540447a9f958f7671822f836817
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon May 14 05:59:06 2007 +0000
+
+    moved rbx-specific proc specs to a new home. made core proc_specs pass MRI.
+
+commit 4feb384d0a02b272bd1a3581dd4070ef475b25af
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon May 14 02:59:22 2007 +0000
+
+    added RUBY_ENGINE == 'rbx' to global constants and exposed Rubinius::<const> on Object like MRI. converted sprintf specs.
+
+commit 34ad791d5f60177de7992a24f07992bb0d6c8b09
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Mon May 14 02:25:06 2007 +0000
+
+    * Disabled Lightning's dissembler on amd64
+    * Split specrunner into bin/mspec and a wrapper
+
+commit 8796b1f00501813c62676266508a6f89a82ec48e
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun May 13 22:47:28 2007 +0000
+
+    minor reorganization, cleanup of spec dir.
+
+commit 9be73815e2037dcc5347c2ef9876e76316efc504
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun May 13 22:06:54 2007 +0000
+
+    specrunner outputs summary with 'examples'. converted language/literals, keywords, straggler method_spec.
+
+commit 647fe38ce5f132b7944cca8550233249d8b3c113
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun May 13 21:21:04 2007 +0000
+
+    converted language, parser, library specs.
+
+commit d9e8f1fd3bc70231c89a1bdc17a9af5a46fce819
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun May 13 08:28:21 2007 +0000
+
+    converted incompatible specs.
+
+commit 9a07bb52c526ce8883c53d437077d78510b0ac73
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun May 13 08:09:34 2007 +0000
+
+    added Object#coerce_string that should act like 1.8.x StringValue function. added String#crypt and a couple other String things.
+
+commit 2bae9b5e3baa33da21c1335e84c2eab062eac3a4
+Author: Kev <kev at unknown>
+Date:   Sun May 13 06:21:06 2007 +0000
+
+    add rb_hash_delete
+
+commit 0ca1a5baa94b5984b0812365a408688420168d24
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Sun May 13 05:31:24 2007 +0000
+
+    Imported GNU Lightning. subtend's rb_define_method_ now generates stub's to pop the args and call the function. Next step, add type conversion to call functions that don't take handles.
+
+commit 141e795d5042cb4ea398c9b8eaa9cd7045f5625e
+Author: Kev <kev at unknown>
+Date:   Sun May 13 05:15:33 2007 +0000
+
+    Add rb_hash_aset
+
+commit 0988a253d8e23b400a738ad74637e8b3655eae8c
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat May 12 19:40:35 2007 +0000
+
+    new .rba's with rue's changes. converted spec/shotgun specs. added specs for Tuple. added aliases size, length for Tuple#fields.
+
+commit abd44484b4b2a28a4c7f0bf7acdf12ff30123729
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Sat May 12 19:32:06 2007 +0000
+
+    * Fixed class variables, should work everywhere now
+    * Specs for cvar behaviour
+
+commit 8ec7dac58577cea314ff0fcd976219b23591bc4d
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat May 12 07:40:42 2007 +0000
+
+    reimplemented Object#instance_variable_get|set and #instance_variables. now works with immediate values, and classes with no __ivars__.
+
+commit 30c4dd441243277ec5b814ad9b4d4697e87641d0
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri May 11 07:56:14 2007 +0000
+
+    added primitives for instance_variable_get|set so that methods operate identically on objects that do not have an __ivars__ field (e.g. Array, String). this needs more work because an exception occurs when attempting to set|get instance vars on an immediate value.
+
+commit 998a0ab62542f36f9e36bdd497116349421951ce
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Wed May 9 23:07:35 2007 +0000
+
+    * Converted rest of spec/core/
+    * mini_rspec/specrunner improvements
+
+commit 0cac71dd1e4dbb728bd3401e73fda5b3fbe95e38
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed May 9 08:18:59 2007 +0000
+
+    updated expectations to be the actual compiler output. these specs should be carefully reviewed.
+
+commit 8d551887fd1fabc7700f9f0a432b728829dcef96
+Author: Kev <kev at unknown>
+Date:   Wed May 9 07:42:15 2007 +0000
+
+    Pull out bundle that got caught in the commit
+
+commit 736916decc6d9bfd7096079a0118f41a168d735d
+Author: Kev <kev at unknown>
+Date:   Wed May 9 07:41:42 2007 +0000
+
+    Add hash specs, and impl of rb_hash_new
+
+commit 2352f0a526be0f277f2e5d60f18acddc216045c1
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed May 9 07:06:45 2007 +0000
+
+    converted test/bytecode/test_compiler to specs.
+
+commit 1f1d30f9ca690214a61f299a4bb408c2d28ef004
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Wed May 9 06:08:41 2007 +0000
+
+    * Converted MatchData specs
+    * Default warnings for empty spec files
+    * Improved specrunner
+
+commit 04c03e648ca83de2c2aee37f9aef9079d0493bd7
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Tue May 8 06:24:48 2007 +0000
+
+    * Converted Integer and Kernel specs
+
+commit a202ef1dfb21cebf3ee33376775d86b9dc89269d
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue May 8 05:45:33 2007 +0000
+
+    added before, after methods to mini_rspec. started adding compiler specs as conversion from test/bytecode/test_compiler. removed all host/target junk. thanks. bye.
+
+commit 692da2d89089bc94c95915c90da756480a057dc1
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue May 8 03:36:51 2007 +0000
+
+    converted object specs. these really blow up rubinius.
+
+commit 714f5df86f583158d73eda366e2f2527156c3b8e
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Mon May 7 17:29:56 2007 +0000
+
+    The first compiler spec, testing the masgn assembly. Some are commented out because they don't yet work.
+
+commit 8ccfe13ca0eca4ceae6a201905a64666a75dd6ba
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Mon May 7 05:52:41 2007 +0000
+
+    * Converted and reviewed Hash specs
+    * specrunner reports specifications and failures
+
+commit aa32b8e94de5c1ccd49a9d6ddca5836d6303c460
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun May 6 06:50:52 2007 +0000
+
+    finished converting fixnum specs.
+
+commit 7c55264dc15ed2b8a1b341a5d605701c6626ad34
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Sat May 5 06:22:37 2007 +0000
+
+    * Converted Enumerable specs
+
+commit 1c660edd87fa91d8c244289b00eb9252d5654c3d
+Author: Evan Phoenix <evan at fallingsnow.net>
+Date:   Fri May 4 23:45:08 2007 +0000
+
+    Fix array_append as well as the logic to call the extension function so the arguments are correct.
+
+commit 6b9c27b8f8d12be443d37635e17b23b7f0d76388
+Author: Kev <kev at unknown>
+Date:   Fri May 4 07:54:10 2007 +0000
+
+    Complete rspec coverage of subtend string compat to date.
+
+commit 32db2e9a157cee24ae883b7b8fd563d98fc2dce5
+Author: Kev <kev at unknown>
+Date:   Fri May 4 07:11:21 2007 +0000
+
+    Add loading of C extensions via require.
+    Stop grammar.c from generating every fricking time
+    Cleanup formatting on subtend
+    Add proper minispec tests for subtend
+    Remove old subtend test extension
+
+commit 851fbe6e587596fd074b4c99e42c43865118ae00
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri May 4 06:58:35 2007 +0000
+
+    converted (but not to the new new style) fixnum specs. fixed mini_rspec to rescue backtrace.show on MRI.
+
+commit 3e8deacb57ef80684281b1329778bc52681a8601
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri May 4 06:22:53 2007 +0000
+
+    converted module specs. added incompatible spec for const_defined?(Some::Class). made mini_rspec print backtrace on error.
+
+commit 3c1cc4ff4f6bf4fa28f65d9909a74f77f6524aa8
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri May 4 05:45:50 2007 +0000
+
+    converted math and exception. added two helper methods: should_be_close, should_include. I think spec_translator should handle converting these to 0.9.x syntax as soon as rspec runs.
+
+commit 28e3cdba63f2853b9e9a084f27ad764437830799
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu May 3 15:26:39 2007 +0000
+
+    converted float specs. added ignore for *.rbc on externals/rspec-0.9.1.
+
+commit 69ea5db15fb0562d8a4114d4e8ec54f2e19ad8fd
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu May 3 06:40:17 2007 +0000
+
+    converted range, nil, regexp specs. added ignore *.rbc on rspec dirs.
+
+commit 6cc364770406e4e04ef7baf2fdaab7425a7f5a6c
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Thu May 3 03:27:04 2007 +0000
+
+    * Converted Dir specs
+
+commit 5e39be7f97d5cd131b0cf564746d881245030f7d
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu May 3 03:04:24 2007 +0000
+
+    okay, rue insists that we use describe ... it now. (see spec_translator with rspec 0.9.1).
+
+commit 99f05b9d6572600ed0bf6a732048c1c4a2d2bb0b
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu May 3 03:00:06 2007 +0000
+
+    converted bignum specs. 100% pass on MRI.
+
+commit f9e4df4bdb721eb32c4ac7e5abd4a646daaf20d2
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu May 3 00:06:19 2007 +0000
+
+    fixed mini_rspec aliases for specify, etc. to work around exception: No method 'alias_method' on an instance of Object. (NoMethodError)
+
+commit 89d3ca0681816afd389907cbb52f7e0372dbecef
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Wed May 2 07:13:56 2007 +0000
+
+    * Converted spec/core/ binding, class and continuation
+
+commit 086f889a9bae2e40dd6a8b1ffa80113070f3ad46
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Wed May 2 04:22:12 2007 +0000
+
+    * bin/specrunner is a small bash kludge for running mini_rspec over
+      a directory (recursively) or a single file
+    * Rakefile allows diffing a current spec run against a base run to
+      easily see all changes among the thousands of specs as well as
+      storing a base run
+    * specrunner produces decent output for the minimal spec output
+      from mini_rspec
+
+commit ba89b2c015d2754b6470b324a013f018d8202cfe
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Tue May 1 22:57:22 2007 +0000
+
+    * Converted spec/core/array_spec.rb to mini_rspec
+    * Reviewed and fixed some specs for Array
+    * Spec-style output to mini_rspec (manual comment/uncomment to switch)
+    * should_raise for slightly more natural exception verification
+
+commit 0330bcc23fa1609db291cd382cb13fc168ec5bf3
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Tue May 1 22:44:40 2007 +0000
+
+    * Implement correct behavior for String#split when called with a zero-width Regexp
+
+commit c8e806e2dafd237fa8117ead21553a195900613e
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue May 1 02:29:35 2007 +0000
+
+    converted symbol_spec. 100% pass.
+
+commit 76e31065df70ebc5790fdb604f1b07d28ffaa81c
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue May 1 02:19:33 2007 +0000
+
+    commented out specs that cause rubinius to hang. String#delete and #tr (and methods that are implemented in terms of these).
+
+commit 2ae8aea13161a71c3fb4ca8e0486acd55c897579
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue May 1 01:17:14 2007 +0000
+
+    converted core/string_spec to regular syntax. added mspec_helper.
+
+commit ff84053991295b259ca8b1c17adff95f5d471961
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Apr 30 22:31:26 2007 +0000
+
+    converted false_spec. added svn:ignore *.rbc on all spec dirs.
+
+commit 3fc864ba235c56118e1db66dbf9537d6ff8c0c5f
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Apr 30 22:00:12 2007 +0000
+
+    Let the breakage begin. Converting all specs to use mini_rspec with 100% compatible syntax with rspec proper. usage: 'USE_RSPEC=1 spec spec/core/false_spec.rb' for any specs that use example {} method. spec spec/core/true_spec.rb OR ./shotgun/rubinius spec/core/true_spec.rb for converted specs.
+
+commit 4c6c7f406d0e5504a72c52b1ae5339a9dba36865
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Apr 29 17:28:11 2007 +0000
+
+    added setup method and print to STDERR and STDOUT to support a shell script runner.
+
+commit 958a0e9b1a066cf2d825b960b66788b05c928f36
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Apr 29 08:26:09 2007 +0000
+
+    mini rspec implementation. example {} method is dead.
+
+commit a323b3d424f226322cf20e65e87f8a4e962ed497
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Apr 29 03:23:17 2007 +0000
+
+    Added Array#first, Array#last that take numeric args to core. Added a bunch of failing specs for Array#[]. #first and #last are implemented using #[] so several of the specs for those fail, but the implementation of #first and #last was tested in MRI.
+
+commit 3897c943069582b1e5d1649a097bd77c0c895e0a
+Author: Hurdlea <hurdlea at unknown>
+Date:   Thu Mar 29 13:51:13 2007 +0000
+
+    * Support for Floats in Sprintf
+      - Sprintf is still missing support for unsigned twos complement
+    * String#% now implemented
+    * Fixed a minor issue in the Rakefile
+
+commit 5ed87ff88793f8d44cfe34b443eb032d27dc2a4c
+Author: Hurdlea <hurdlea at unknown>
+Date:   Thu Mar 15 05:08:34 2007 +0000
+
+    * Added Sprintf core module and classes for string % and Kernel
+      - Still needs some work with floats and requires a couple of
+        primitives to achieve this.
+    * Fixed a small issue with String#Index(Fixnum, offset)
+
+commit 982c09b15710429fc97d8d43d9f24a3a0badb6d5
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Mar 10 22:35:18 2007 +0000
+
+    Fixed array spec for #sort which improperly depended on the accidental order in which two elements of the array were being compared.
+
+commit 32fe004da7f35e9b7dcc96f8e57e1acb37164748
+Author: Hornbeck <hornbeck at unknown>
+Date:   Sat Mar 10 06:38:23 2007 +0000
+
+    Two tests in the ObjectSpace spec.  It was bare and needed love.
+
+commit e1530bb1999118bf88037dccc27d78f54bdbe5e4
+Author: Tlockney <tlockney at unknown>
+Date:   Sat Mar 3 23:28:27 2007 +0000
+
+    updated all rspec exceptions. exception specs all pass in MRI. still a few rubinius exception spec issues
+
+commit 2c278533cbfe0efc7076d2c947323640be5f207a
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Mar 3 21:29:55 2007 +0000
+
+    Committing tlockney's additions to core/exception_spec.rb. These pass on MRI but illustrate areas to fix on rubinius.
+
+commit fd8993c0996e4524440a6572c45dad4ab112fb2f
+Author: Hornbeck <hornbeck at unknown>
+Date:   Fri Feb 23 15:58:33 2007 +0000
+
+    committing Aki Reijonen's Hash patches for hash.rb and the hash_spec.rb.  Also included is Thomas Lockney's exception_spec.rb patches.
+
+commit 08e6d924b8c0175242c1c40322ed3e45855a86c2
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Feb 18 07:48:46 2007 +0000
+
+    Altered Object#instance_variable_[get|set] rearranging flow control. Added specs for instance_variable_[get|set] for Array, IO, String.
+
+commit 2a2385413c03f21dfc038e110f46a7a3bd2fc9c7
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Feb 18 06:05:47 2007 +0000
+
+    Increased time out value when running rspec error report. Minor changes to text in class specs.
+
+commit bd0d7fcf72546a0a3a5a6a59b1a6f2aadd8e4262
+Author: Mae <mae at unknown>
+Date:   Sun Feb 18 03:53:00 2007 +0000
+
+    Integer#bits for future refactoring of shift
+    * added Integer#bits which calculates minimum bit storage required for (signed int) form of the Integer
+    * spec'd it too
+
+commit 4e6b39d5e69c04d92ceac76ce5a5bd792fb65f39
+Author: Mae <mae at unknown>
+Date:   Sun Feb 18 02:55:55 2007 +0000
+
+    Object#extend-a-gogo
+    *Fixed Small bug in rubinius_target where failures wouldn't be reported
+    *Implemented Object#extend and changed math.rb to use it accordingly
+
+commit 5472c10579cef38f9f28c904710246509633a040
+Author: Mae <mae at unknown>
+Date:   Sun Feb 18 01:21:11 2007 +0000
+
+    A great Time patch from John Hornbeck <hornbeck at gmail.com>:
+
+    A more complete Time diff.  This includes many of the instance methods for Time and a new primitive for usec.  This diff also includes some failing specs as I went ahead and added the specs for the rest of the class methods.  Also included is the constants for Time.
+
+    Keep the good work coming John!
+
+commit 83ab11e0ab6679b1c9eefc5095d3f20af9a61661
+Author: Mae <mae at unknown>
+Date:   Sat Feb 17 23:26:33 2007 +0000
+
+    Patch from Aki Reijonen <aki.reijonen at gmail.com> without the Float.induced_from part
+
+    Summary of the changes:
+
+    ** Added methods **
+
+    Numeric#integer?
+    Numeric#div
+
+    Integer#to_int
+    Integer#round
+    Integer#truncate
+    Integer#next
+    Integer#succ
+    Integer#integer?
+
+    String#slice!
+
+    Object#to_a
+
+    Kernel#Array
+    Kernel#String
+
+    ** Fixed methods **
+    Float.induced_from
+    - Now return the passed object if it's an Float insted of calling #to_f
+
+    ** Removed methods **
+    Fixnum#div was broken, the end result should be converted to Integer,
+    not the number passed as a argument. (superceded by Numeric#div)
+
+    --
+    Aki Reijonen
+
+commit 243a4e9ba46149b8ba39c7238f8ff3d5f267689e
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Feb 17 06:17:44 2007 +0000
+
+    Ditched all the instance vars in array specs since we've got locals now.
+
+commit be5363e22e04b8baf26cb4abd8a8a67e7dd3cc0c
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Wed Feb 14 01:05:49 2007 +0000
+
+    Fixed * varargs to work in method definitions. Currently still
+    does not work as the single named parameter (foo(*a)). This
+    means that lib/bytecode/encoder.rb now compiles under Shotgun.
+
+commit 3bb810688e848c90d5c20929c630f36a32796d2d
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Feb 13 18:42:09 2007 +0000
+
+    Added Object#instance_variable_set and specs.
+
+commit 54392c99dc3db5b58c85799416cc528c60b12533
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Feb 13 18:25:24 2007 +0000
+
+    Added Object#instance_variable_get and specs. Uncommented Math module constants specs.
+
+commit 84267901502ca1e8e8b13afa0e3a16e0cdc8e493
+Author: Mae <mae at unknown>
+Date:   Sun Feb 11 10:30:13 2007 +0000
+
+    * Primitive Specs
+    - Added spec for bignum_div (and fixed a problem where it would always fail)
+    - Fixed primitive_spec_helper (because it broke the old specs last time)
+    - Removed magic method chaining because it sucks
+    - DISCLAIMER: primitive specs atm just test functional things, _NOT_ stateful side-effects
+    - We can do this properly once rubinius can run rspec
+
+    * SIRB
+    - Made it so that => wouldn't get printed before the command prompt if you typed "exit"
+    - Made Kernel#p, Kernel#puts, Kernel#print return nil (like MRI)
+    - added #!shotgun/rubinius to top of sirb and symlinked it to bin/sirb.rb as well (for convenience)
+
+    * Removed unused local from __loader
+
+commit efce7d8a56748ab1831a34d21b8c92ff8b2eb977
+Author: Mae <mae at unknown>
+Date:   Sun Feb 11 07:25:51 2007 +0000
+
+    Moved math to math_spec; added object_spec for primitives; made primitives_spec_helper maybe too smart? -- they chain methods on to the remote target
+
+commit 087a5e5a6e89e4a53a39e025ffe08d21e96b8f6e
+Author: Mae <mae at unknown>
+Date:   Sun Feb 11 05:51:30 2007 +0000
+
+    * Made rubinius_target and example much more helpful
+    - backtraces are shown on failure now
+    - you can do this: example { 1 + nil }.should_raise(TypeError) and it works :) (with bt and all)
+    - injected some extra code in example snippets so try(exc) syntax still works
+    - Float, Nil, True, False specs all pass 100 %
+    - made rubinius_target make use of @src (used in bignum)
+
+    * Made Kernel.Float() and Kernel.Integer() behave appropriately like MRI _with_ the exception of Float() also checking for to_i method
+    - Integer(nil) => 0 and Float(nil) => 0.0
+    - lots of spec coverage
+
+    * Numeric#coerce was slightly tweaked to use new Float() and Integer() behavior
+    - Specifically complains about other being nil (so 1 == nil doesn't work)
+
+    * Made Float.induced_from() more anal retentive (only accepts core Fixnum, Bignum, Float types like mri)
+    - specs cover it
+
+    * Fixed infinite loop on Bignum#& and moved & out of Numeric into Integer (Float doesn't have &)
+
+commit eadf1ead754d3dbfaf703c205f6f5e8f4dc5c430
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Feb 11 03:00:25 2007 +0000
+
+    Put object flags values into a single include file. Added Object#taint, tainted?, freeze, frozen?. Neither of these states actually effect execution yet. Fixed up Object specs.
+
+commit 38e7f757e67b4ec985835e0e93ba4d32bbee5ca4
+Author: Mae <mae at unknown>
+Date:   Sat Feb 10 23:57:37 2007 +0000
+
+    - Created specs for math_sqrt primitive (and created spec/primitives/math_spec.rb)
+    - Tweaked primitives_spec_helper to properly transport NaN's to testing environment
+    - Removed non-needed self parameter from math_sqrt c function
+
+commit a4267a136d7f0bf7f92421fcebd8011600a1d92e
+Author: Mae <mae at unknown>
+Date:   Sat Feb 10 22:29:46 2007 +0000
+
+    Float.induced_from love
+    - made Float.induced_from work for any to_f item (controversial whether this should be done in Kernel.Float() or not)
+    - apparently this fixed some float failures
+    - made Float.induced_from safer because it now complains if to_f returns a non-float
+    - wrote specs for new induced_from behavior
+    - try (spec_helper) needs to be investigated, manual running of the premises of 'Float divmod should raise FloatDomainError if other is zero' show this to be a spec that _should_ pass
+
+commit 65a4e8abfc7f690456e4f44e7e4cc38911288516
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Feb 10 18:54:15 2007 +0000
+
+    Added spec files for the rest of the core classes documented in Pickaxe book. Add simple class hierarchy specs for exception classes.
+
+commit c7a2f68c36dd95f51af88e8fa62b24b71d68578a
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Feb 10 17:29:46 2007 +0000
+
+    Commit of scoopr's Math module beginnings. Thanks scoopr.
+
+commit b1e8d150460f2ae9ea2e5ef87d0df3b705c1d0d6
+Author: Mae <mae at unknown>
+Date:   Fri Feb 9 08:54:25 2007 +0000
+
+    Bignum primitive specs
+    - Added spec and changed to metaprogramming style for primitives: bignum_add, bignum_compare, bignum_equal, bignum_and, bignum_divmod
+    - fixed bug that bignum_divmod spec found where bignum_divmod would always fail on divide by zero GUARD
+
+commit 0487a39ec9995af8eb5a8dff5ec64492261852e7
+Author: Mae <mae at unknown>
+Date:   Fri Feb 9 07:48:56 2007 +0000
+
+    Primitive Spec Sexiness
+    - Added spec and changed to metaprogramming style for primitive fixnum_to_f
+    - Made usage of run_primitive(:add, 1, 5) more sexy i.e. 1.prim.add(5)
+    - converted fixnum spes to use sexiness
+
+commit 95fa48f29eaa7e3f10ccd63d385fb3f582f57eea
+Author: Hurdlea <hurdlea at unknown>
+Date:   Fri Feb 9 01:36:14 2007 +0000
+
+    * Added String#delete, delete!, tr, tr!, tr_s, tr_s!
+      - String#count and squeeze to follow ...
+    * String#<< now accepts Fixnums
+
+commit 017bdc57602e2e5d55705de070c07edba46a347f
+Author: Mae <mae at unknown>
+Date:   Thu Feb 8 09:23:55 2007 +0000
+
+    - removed noop from primitives (it does nothing)
+    - removed noop primitive spec
+    - changed CPU::Primitives.name_to_index to offset by +1 (to leave room for special 0 value)
+    - still having same closed parens issue with spec:primitives:
+        syntax error, unexpected $end, expecting ')' (SyntaxError)
+
+commit 18a3347bb32d8ac5269438376f0100ecce2c9e73
+Author: Mae <mae at unknown>
+Date:   Thu Feb 8 08:20:14 2007 +0000
+
+    - made shotgun/lib/primitives.rb have less dependencies
+    - fixed bug where if a false was popped of the stack it wouldn't be recognized as an argument in primitives_spec_helper (nil will only do this now)
+    - fixed regression in primitives_spec_helper where the proper code wasn't showed when shotgun crashes
+    - noop_spec works again
+
+commit 16b08e446b69344da1edbc1f793e0161deac8e6c
+Author: Mae <mae at unknown>
+Date:   Wed Feb 7 23:59:14 2007 +0000
+
+    More Primitive Goodness, Conform to unified rspec standards
+    - Added specs and changed to new metaprogramming style for the following primitives: fixnum_and, fixnum_or, fixnum_xor, fixnum_invert, fixnum_neg
+
+commit cb2ac85b45a41a63100cac673919ad8db1f93f43
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Wed Feb 7 23:16:35 2007 +0000
+
+    Basic specs for Symbol literals.
+
+commit 3ab7aced51f3a63c8f76706a2f159d0d5753dc64
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Feb 7 20:35:27 2007 +0000
+
+    Changed Fixnum primitives specs to be in a single file, spec/primitives/fixnum_spec.rb. Added back the alternative example of writing specs for others to evaluate or use. Updated the wiki specs page to lay down the law on spec files. Kindly follow it.
+
+commit cf16d691990f43f5bf8807bbef2ba1876892be57
+Author: Mae <mae at unknown>
+Date:   Wed Feb 7 18:27:15 2007 +0000
+
+    Autotest, C warnings cleanup, and some primitive_spec usage cleanup
+    - Added Autotest Facilities for primitive bin/autotest/primitives
+    - need to gem install zentest to use this (and some diff gem i can't remember)
+    - Removed ugly require statement from cpu/primitives it was causing annoying ruby errors
+    - Added missing prototypes to cpu.h and regexp.h (primitives.gen was complaining)
+    - Localized bt and bt_size variable declarations to where they would be included by the preprocessor to make more warnings go away
+    - Added newlines to the end of numeric.c, numeric.h, float.c
+    - Used one of brixens suggestions (injection of primitive spec helper automatically)
+    - Removed extraneous primitive helper inclusion in each spec
+
+commit f4bbce9d761d27e1381b95a4ff6076e85577074d
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Feb 7 16:56:21 2007 +0000
+
+    This shows an example to 'fix' mae's rubyesquely-challenged (bluntly, ugly) primitive specs. Also, there should be one spec file for a group of related contexts. In this case, the group is the class Fixnum. So, mae, fixnum_spec.rb, NOT fixnum_xxx_spec.rb. Sorry. Cry tyrany, weep and gnash thy teeth, howl in protest, but please fix it. This is non-negotiable. Thank you and good work on the primitive specs. :)
+
+commit e5f6215824a40beb0ca678575596bd06afa8dd3a
+Author: Mae <mae at unknown>
+Date:   Wed Feb 7 09:54:54 2007 +0000
+
+    - Added specs for primitives: add, sub, fixnum_mul, fixnum_size, fixnum_div, fixnum_modulo, fixnum_divmod, fixnum_to_s
+    - Updated primitives to new metaprogramming style: sub, fixnum_mul, fixnum_size, fixnum_div, fixnum_modulo, fixnum_divmod, fixnum_to_s
+    - Changed wording in a couple primitive spec files to be more explicit
+    - Made reporting by primitive_spec_helper more helpful when shotgun crashes from injected code
+
+commit 3032c6bd869a04c1517508850f94119975c36e54
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Feb 7 02:26:47 2007 +0000
+
+    Fixed up String#to_i a bit; added a bunch more specs for it.
+
+commit d8a24ffa8d9983a85b0f03784a89bfa667af1615
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Wed Feb 7 01:46:30 2007 +0000
+
+    Added very basic set of specs for assignment and multiple assignment semantics.
+
+commit edb7c82523b36b26e24437de42fd2638eef1653f
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Feb 6 19:02:46 2007 +0000
+
+    Added specs for and methods CType#isalnum, isdigit.
+
+commit e84ba1b12c51331d00bdd06684dcff96ea229322
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Feb 6 17:30:55 2007 +0000
+
+    Added spec/shotgun/bytearray_spec.rb. Added spec for ByteArray#[], []=. Modified various string methods to use BA#[], []= instead of get_byte, set_byte.
+
+commit be9589cc47cbf35edd94ca22407de4b1527a3fdb
+Author: Mae <mae at unknown>
+Date:   Tue Feb 6 11:26:31 2007 +0000
+
+    Tweaks to primitive metaprogramming and addition of noop spec
+    - Added types 'qnil' 'qtrue' 'qfalse' to be used in primitive metaprogramming
+    - Added spec for noop primitive
+    - Added run_asm method to primitives_spec_helper for those tricky tests
+    - Converted noop primitive to new metaprogramming style
+
+commit e31f1af903dd8dd31427e34a718b30f5c63af8df
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Feb 6 10:33:00 2007 +0000
+
+    Some fixes to String#to_i and additions to specs. Added String#oct and hex.
+
+commit 2a157827bd72b6c7ce8a025928cdd9d7f2f8d00f
+Author: Mae <mae at unknown>
+Date:   Tue Feb 6 10:18:16 2007 +0000
+
+    moved equal and compare to use new primitive technique
+    - also updated equal_spec to ask for ArgumentError instead
+    - uploaded new rba *glares at brixen*
+
+commit 771d0fede3086ce58d225ac4001ea0934f3bb0e3
+Author: Mae <mae at unknown>
+Date:   Tue Feb 6 09:33:03 2007 +0000
+
+    ARITY macro raises ArgumentError directly from the primtive now and made specs pass
+    - Made ARITY macro raise an argument error exception instead of just ambiguously failing
+    - Made _ret return TRUE on arity failure (exception directly raised)
+    - Moved GUARD and POP macros to shotgun/lib/cpu_primitives.c where they belong (localized)
+    - Removed side-effect printf in cpu_raise_arg_error since stack trace is fine now
+    - Tweaked primitives_spec_helper should_raise to work for all exceptions
+    - Made specs for equal/compare pass again (expect ArgumentError instead of PrimitiveFailure)
+    - New compiler.rba (update these ppl!)
+
+commit e89190c8fdc4a71c7b8cd9c8b873a63b9d1888c5
+Author: Hurdlea <hurdlea at unknown>
+Date:   Tue Feb 6 07:51:08 2007 +0000
+
+    * Finished String#[]= for string index
+    * found odd bug with spec where string[1,2]="foo" is not interpreted correctly
+      changed methods to use send(:[]=, ... and the tests pass
+
+commit c6e1bb68e930a537bd51d77afd37cdc8b5d62d31
+Author: Hurdlea <hurdlea at unknown>
+Date:   Tue Feb 6 07:18:15 2007 +0000
+
+    * Added String#[]= slice functionality
+
+commit e405d4f5f32fd8192c435b3488f394b2635c7db7
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Feb 6 06:37:31 2007 +0000
+
+    Added String#chomp[(bang)].
+
+commit ff48a6c333f34c1b1882c260db7145facce3d71f
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Feb 6 06:00:56 2007 +0000
+
+    Added String#replace_if that calls replace if self != other else returns nil; Added upcase, downcase.
+
+commit f46d747eba82c215fa07b067a30f2a2e8868d284
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Feb 6 05:31:13 2007 +0000
+
+    Implemented String#reverse directly rather than with String#<<. Modified some string specs for [lr]strip but forgot to commit them earlier.
+
+commit d3b0e71e810a985f3b8f2e5f5c7d5c4619f151f9
+Author: Hurdlea <hurdlea at unknown>
+Date:   Tue Feb 6 03:00:28 2007 +0000
+
+    * Added NilClass specs to detect NilClass coercion
+
+commit c570ca475cabeb3fcfcca26d4c57b8e57f6606b4
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Feb 6 02:01:19 2007 +0000
+
+    Added module CType mixin for Integer to provide isspace, isupper and friends. Added specs for CType in spec/shotgun. Implemented String#capitalize[(bang)]. Moved ByteArray into it's own file. Updated various string specs and commented out temporarily index spec.
+
+commit 4694d1511e880e43dfccb3e3f5309f0920395ba0
+Author: Hurdlea <hurdlea at unknown>
+Date:   Tue Feb 6 00:22:17 2007 +0000
+
+    * Fixed operation of Regexp#=~
+    * Updated Regexp spec for =~
+    * String#== now works correcly for duck typed objects
+
+commit 8e42aa9c789fcc9bc475d460e7158f2adcc8ab64
+Author: Mae <mae at unknown>
+Date:   Mon Feb 5 22:46:21 2007 +0000
+
+    Added arity checking for primitives
+    -for use in primitives: #define ARITY(length) GUARD( (length) == num_args )
+    -for instance if i have a primitive that takes one argument (self + arg) i put ARITY(1) at the top
+    -changed specs with regard to arity accordingly
+    -made block_given conform to the "self rule for primitives" by padding Qtrue where self would be
+    -fixed block_given? to pass the right arity (0) in the compiler
+    -specs for compare and equal pass now
+    -added primitives_spec_helper (forgot last time)
+
+    NOTE: Binary .rbc compatibility is broken now since there are arity checks done on block_given?
+    -the rba's i uploaded should be fine but if they arent...
+    do find -type f | grep .rbc | grep -v .svn | xargs rm
+    then rake build:rubinius
+
+commit 2d5c9bc3170bf959390627def10c0208088b48ee
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Feb 5 22:39:08 2007 +0000
+
+    Added Integer#isspace and spec in spec/incompatible. Added spec/incompatible/string_spec to describe behavior of stripping runs of whitespace and nulls from end of a string. Added or modified String#lstrip, lstrip(bang), strip, strip(bang), rstrip, rstrip(bang).
+
+commit d4b07b06ca85543423a308f12b82ae4671bdd0c2
+Author: Mae <mae at unknown>
+Date:   Mon Feb 5 21:01:59 2007 +0000
+
+    -split out common primitive testing functionality to primitives_spec_helper.rb
+    -added spec for primitive "equal"
+    -again primitive specs are rake spec:primitives
+
+commit c1a7896f24e018df13af7f0d3d60db9f461130a5
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Feb 5 20:58:21 2007 +0000
+
+    Added that Module#include passes off to append_features. Added Module#include that takes multiple args later in the bootstrap sequence. Added specs for include and append_features.
+
+commit d407ecab13722599b75fecc20bdebd86c9f76fa6
+Author: Mae <mae at unknown>
+Date:   Mon Feb 5 20:48:02 2007 +0000
+
+    Misc Changes to Tweak primitive specs
+    -Added spec to test arity restrictions of compare
+    -Fixed bug where should_raise for primitives was not catching the error condition
+    -Changed wording of some specs to be english rather than engrish :)
+
+commit f68ad63065002d4a3c9a0742770da4a112780aa7
+Author: Mae <mae at unknown>
+Date:   Mon Feb 5 20:02:24 2007 +0000
+
+    - Remove printf from cpu_raise_primitive_failure so that the screen doesn't get littered
+    - Created PrimitiveSpecHelper and a "primitives" spec subdirectory
+    - Added rake task spec:primitives
+    - Added compare_spec as an example
+    - New rba's
+
+commit f997d3791099912001d09a427f24252182ba1d6c
+Author: Hurdlea <hurdlea at unknown>
+Date:   Sat Feb 3 08:10:48 2007 +0000
+
+    * Added MatchData#values_at
+    * Fixed implementation of MatchData#select
+    * Updated specs for MatchData#values_at, select
+
+commit 4f8301aeb3a5a296a64b887b0f164ca02be2a71f
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Feb 2 17:00:10 2007 +0000
+
+    Added specs for and empty module methods private, protected, public as a first approximation to allow code that uses them to not choke. Added String#match.
+
+commit 15c3678ddcc365891fd92cc9cd33eb22308916e8
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Feb 2 10:43:58 2007 +0000
+
+    Committing Adam Ritter's patch to recognize 'for i in ...' expression, and associated spec. Uncommented line in float_spec.
+
+commit 370d7a955bf6e41c4ea7cf0f9217128ae7a72fd4
+Author: Hurdlea <hurdlea at unknown>
+Date:   Fri Feb 2 07:06:22 2007 +0000
+
+    * Added MatchData#inspect, select, to_a, size, to_s
+    * MatchData#[] is now more compliant - behaves more like Array#[]
+    * Added Regexp#hash
+    * Added Regexp#hash spec
+
+commit b496d50c0ebf7d5c523efe2ef5383dd8043aa3f0
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Fri Feb 2 00:36:37 2007 +0000
+
+    Added specs for Dir and modified rubinius_target to allow
+    specs to change directories safely.
+
+commit 6ddf4051f3a6be7076e947bf3eccbc5dd9a7803f
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Feb 1 19:11:14 2007 +0000
+
+    Fixed Float#divmod, returning 0 guard on primitive, raising FloatDomainError rather than ZeroDivisionError. Fixed Float#% when other is zero. Spec try helper doesn't yet work with rubinius_target
+
+commit 679f3fbe54960a690f4e41e1403fdc8f50c0f346
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Feb 1 18:36:44 2007 +0000
+
+    Added more zero division behavior specs.
+
+commit b4d739a7cb68d6f82d657b69aee00923e0bfdbb4
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Feb 1 18:12:02 2007 +0000
+
+    oops, damn keystrokes. Previous commit msg should just include Fixnum. This change points out a problem that I'm not sure about: 1.quo(0) => Infinity in irb and run from a file, but in the spec I get zero division error. wth?
+
+commit 4e24fe43a7d6c55a53880a1c347e836f12937ed4
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Feb 1 18:03:13 2007 +0000
+
+    Added more specs around zero division behavior for Float and Fixnum.
+
+commit b8f412ee2bf3701acd211372d28ec596d6858ac8
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Feb 1 18:01:44 2007 +0000
+
+    Added more specs around zero division behavior for Float and Fixnum.
+
+commit 17a17e3008422bab9e91f8464d1ce2823c13ce78
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Feb 1 17:51:47 2007 +0000
+
+    Added try spec helper method for spec'ing things that raise exceptions. Added more Float specs that describe division by 0 behavior.
+
+commit 2c2bfc3663a34fbf4fd70a5787236ec8b9a87024
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Feb 1 17:22:39 2007 +0000
+
+    Added spec for Float#% when other is zero to show current implementation is broken.
+
+commit d1ddd71d5bd45df0c16651ecad2db3c1b75d90f8
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Feb 1 17:06:56 2007 +0000
+
+    Reverted mae's breakage to Float. seriously mae: you did NOT run the float specs and you did NOT write new specs for the behavior you were changing so you did NOT understand what you were doing. As a good CS student, you can negate the above to know what you SHOULD do. ;) Please, WRITE and RUN your specs.
+
+commit b2e08a170d1ab222d67d8767fa880a5e21c5bf74
+Author: Mae <mae at unknown>
+Date:   Thu Feb 1 10:53:48 2007 +0000
+
+    know when to shoot your baby in the crib -- cleanup outdated unused code
+
+commit aac75dd658c96cf930852d86dbc79b66830bace5
+Author: Eero Saynatkari <eero at kittensoft.org>
+Date:   Thu Feb 1 09:12:03 2007 +0000
+
+    Improved specs for Hash.[].
+
+commit 40f637f2685e969f097fbbb2ffa3f0173e6f9866
+Author: Mae <mae at unknown>
+Date:   Thu Feb 1 02:44:14 2007 +0000
+
+    Fixed my pure ruby Numeric#floor and Numeric#ceil methods
+    - Please smash your c primitive brix BWAHAHA
+    - Also implemented eql? for float and now all 32 float specs pass
+    - Added some edge cases for ceil/float that were not previously covered in specs
+
+commit 5cc6f6b6068e945c6f5896370ee20567e57122e7
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Jan 31 11:24:23 2007 +0000
+
+    Added Float#round. We now have 32 of 32 float specs passing. Please confirm on your platform.
+
+commit 9b902a80a008120a86ae18d4abff04d42efefc8f
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Jan 31 06:22:10 2007 +0000
+
+    Folded in coerce specs.
+
+commit 09e61132d5b9e9b08d27f2f51db9580808bb370e
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Jan 31 03:22:23 2007 +0000
+
+    Created spec/incompatible for specs that show where Rubinius is incompatible with other implementations. Added bignum_spec and fixnum_spec to incompatible dir. Under MRI, Bignum.coerce(Fixnum) => [Bignum, Bignum] whereas Fixnum.coerce(Bignum) => [Float, Float]. Since Bignum should be a seamless extension of Fixnum, this behavior in MRI seems less than consistent. Under Rubinius, mixed Fixnum and Bignum promote to Bignum uniformly, and this makes much more sense. There are other places where Rubinius implementation may deviate from MRI, so spec/incompatible is for describing those behaviors. Updated coerce specs.
+
+commit cb52bb9633d0e323d2f7d6c90879fb7decfea7d7
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Jan 30 10:44:46 2007 +0000
+
+    Added Numeric#coerce primitive. Reimplemented a number of primitves and methods on Fixnum, Float, Bignum to use Numeric#coerce rather than implementing knowledge of one another all over the place. Folded in mae's coerce specs. There is currently a (desirable IMHO) incompatibility in Numeric#coerce in that Bignum.coerce(Fixnum) == Fixnum.coerce(Bignum). There are a lot of other methods that need to be reimplemented using Numeric#coerce. Also, bignum_compare needs to be implemented (just returns 0 atm).
+
+commit e1aa382f2d596a73ef20dfde4184af7a721724e9
+Author: Mae <mae at unknown>
+Date:   Tue Jan 30 00:26:11 2007 +0000
+
+    added specs for coercion of Fixnum, Bignum, and Float
+
+commit bd292d64a511eba51ea1569870bcf0fa365c903d
+Author: Cabo <cabo at unknown>
+Date:   Sun Jan 28 21:05:10 2007 +0000
+
+    include yesterday's failed cases
+
+commit 7cac7f32e5c80e78aa75dfed7f4822e65d1ab4df
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Jan 28 08:08:12 2007 +0000
+
+    committing rue's continuation specs. doomo arigatoo.
+
+commit f542b93031f8982daa13777d2eada81068e96ad5
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Jan 28 07:03:46 2007 +0000
+
+    committing rue's class specs. thanks rue!
+
+commit 319b6f194d3c699a75de8da2ba3b53b8a4feffb1
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Jan 28 04:49:01 2007 +0000
+
+    Commiting rue's binding specs.
+
+commit d8326b1321cc09c0aa64f441d2a81df6735603fd
+Author: Cabo <cabo at unknown>
+Date:   Sat Jan 27 00:02:33 2007 +0000
+
+    remove superfluous p from "& should create an array with no
+    duplicates" (which now passes)
+
+commit 7d3baf10a79c1500e660fe5566ba8f3107d5a826
+Author: Hurdlea <hurdlea at unknown>
+Date:   Thu Jan 25 05:43:50 2007 +0000
+
+    * Added MatchData specs
+
+commit 2d9966c9c30e541c18ac77ca646a1af41daf702e
+Author: Hurdlea <hurdlea at unknown>
+Date:   Thu Jan 25 05:42:44 2007 +0000
+
+    * Added Match2 and correct Match3 in compiler.rb
+    * Added alias String#to_str
+    * Tweaked a few regexep specs for string return types
+    * Fixed MatchData#length so it uses Tuple#fields to get the no. items
+
+commit 0d9f9e21c2a268e0710c963c745f07d494e2ab1f
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Jan 24 21:43:17 2007 +0000
+
+    Commiting zimbatm's update to exception_spec.
+
+commit 037d8b29872f1c4a81108a0713afd78cbdf9b484
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Jan 20 04:03:20 2007 +0000
+
+    a few more tweaks to get string specs to execute with rcompile and shotgun.
+
+commit cfe7a6b4c87ac3ffccaeb7e70b9e6c386054e052
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Jan 20 03:49:01 2007 +0000
+
+    added parser dir under spec. added parser/symbol_spec.rb to capture parsing a complex symbol like :' for one or two', which rcompile and shotgun choke on at the moment. removed this from core/string_spec because it crashes shotgun and makes it impossible to run all the specs.
+
+commit d39040ab1563f063192a3835723cfbae7bf147cb
+Author: Cabo <cabo at unknown>
+Date:   Fri Jan 19 23:45:52 2007 +0000
+
+    lib/kernel.rbc is no longer a required (or wanted) command line argument
+
+commit 4774788e0ae9b24b3ff0b769aede0ba2de3f00b1
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Jan 19 21:05:10 2007 +0000
+
+    added correct guard on Array#first to return nil when array is empty. added specs for #first and #last to describe this behavior. Thanks to cabo for finding this.
+
+commit baf1453678c9906c65b2f7c82bdb0e179e22d1b8
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Jan 19 02:49:02 2007 +0000
+
+    added some minor changes to structure and wording of language/expression_spec. removed array and defined spec from language directory since they were added to language/literals directory. renamed several spec files to follow naming conventions.
+
+commit 7a24923ab9b79b226b6d8831e834ab509d5d2b76
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Jan 19 01:27:10 2007 +0000
+
+    committing zimbatm's patch to language specs. super nice and thank you. please give zimbatm a commit bit!
+
+commit 9cd8c779a88f48604733afbe4357b7101a487669
+Author: Vic <vic at unknown>
+Date:   Thu Jan 18 22:20:34 2007 +0000
+
+    Added Proc.given, the analog of MethodContext.current
+    Proc.given obtains the proc given to the current MethodContext.
+    Later will be able to get a Proc from a given Binding.
+
+    Original author: Victor Hugo Borja <vic at rubyforge.org>
+    Date: 2007-01-18 16:16:06+00:00
+
+commit 50c42413d33951397a46edb55ca910a2e8fb87e6
+Author: Vic <vic at unknown>
+Date:   Thu Jan 18 21:34:29 2007 +0000
+
+    No output is available for specs if the returning value is a Numeric or Symbol
+    When the :example execution on shotgun evaluates to a Numeric or Symbol, no method
+    :stdout is added, because these object do not have singleton-classes on MRI.
+    If you really need both, stdout and a Numeric/Symbol, your evaluation may lead to
+    an array containing that Numeric/Symbol.
+
+    Also saved MRI from getting eval errors in cases like the following:
+
+      example do
+         class A; end
+         A.new
+      end
+
+    This leads to the following being evaled by MRI: [ #<A:0xb7a69c8c> , stdout]
+    which causes an error because of #<A:0xb7a69c8c> being invalid ruby syntax.
+    This patch fixes this situation by converting #<A:0xb7a69c8c> into "#<A:0xb7a69c8c>"
+
+    Original author: Victor Hugo Borja <vic at rubyforge.org>
+    Date: 2007-01-18 15:23:55+00:00
+
+commit ec5bea103b4b96ecde54668e47ab9e10ac8ec4ee
+Author: Hurdlea <hurdlea at unknown>
+Date:   Thu Jan 18 21:04:22 2007 +0000
+
+    * Added bitwsie operators to Fixnum & | ^ << >> ~
+    * Split the fixnum specs into coerced and non-coerced tests
+    * Added primitives to support fixnum bitwise ops
+    * Fixed a bounds tests in Interger#chr
+
+commit 238d7e0611e9198c28a5e0ebe684bc7f1f03bf0f
+Author: Vic <vic at unknown>
+Date:   Thu Jan 18 20:11:58 2007 +0000
+
+    [rAdded specs for the new STDOUT support] Empty log message
+
+    Original author: Victor Hugo Borja <vic at rubyforge.org>
+    Date: 2007-01-18 13:44:19+00:00
+
+commit 859b26f38749f160a706ed9dbb8f2a80886e94ef
+Author: Vic <vic at unknown>
+Date:   Thu Jan 18 19:37:03 2007 +0000
+
+    Allow to specs to test what is written to STDOUT
+
+    also added String#unindent on spec_helper to help make output heredocs more readable.
+
+    You can access both the evaluation result and the stdout produced, ej:
+
+       context "Rubinius target" do
+
+         specify "should allow to get the resulting STDOUT" do
+          example do
+            puts "hola"
+            puts "space is significant in this heredoc"
+            puts "unindent removes the first blanks found on the first line"
+            puts "on each of these lines"
+            puts "adios"
+          end.stdout.should == <<-OUT.unindent
+            hola
+            space is significant in this heredoc
+            unindent removes the first blanks found on the first line
+            on each of these lines
+            adios
+          OUT
+         end
+
+         specify "should allow to get the lines written to STDOUT" do
+          example do
+            puts "hello"
+          end.stdout_lines.length == 1
+
+          example do
+            print "bye"
+          end.stdout_lines.first.should == "bye"
+         end
+
+         specify "should allow to access the evaluation result along with STDOUT" do
+          result = example do
+            puts "ok"
+            Object.new.class
+          end
+          result.should == Object
+          result.stdout_lines.should == ["ok\n"]
+        end
+
+       end
+
+commit e17069925d139c93acec00161a7111e6c78d54bb
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Jan 18 08:44:33 2007 +0000
+
+    converted shotgun-test/test_sexp to spec/shotgun/sexp_spec. thanks to Victor Borja's recent additions to rubinius_target, it was a breeze.
+
+commit 46e9a259bc2212dee1fa7efa8ead468e63970731
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Jan 17 08:02:35 2007 +0000
+
+    filled in the rest of the documented String instance methods except #pack.
+
+commit dfd08d6536ea497cf86d06ca503206d54b19479d
+Author: Cabo <cabo at unknown>
+Date:   Tue Jan 16 10:24:18 2007 +0000
+
+    A bit more array fun (and lots of FIXMEs)
+
+commit b1e50e43d8d79a5dbd82345134ecd4bdffc6d182
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Jan 16 08:46:48 2007 +0000
+
+    and yet a few more string specs. these will asymptotically approach done.
+
+commit 4048d3dfa90a6de54ea2ed0aec2ec6adafb50b0c
+Author: Cabo <cabo at unknown>
+Date:   Tue Jan 16 07:02:50 2007 +0000
+
+    I want to see what 'Shotgun has crashed' means, beautiful backtrace and all
+
+commit 0387baa914cb35c589c7872f7f98cf9f8ee10711
+Author: Cabo <cabo at unknown>
+Date:   Tue Jan 16 02:19:45 2007 +0000
+
+    Fix Array#slice! bug workarounds
+
+commit c6b110b47667c5d6750492177492434f4c0446f8
+Author: Cabo <cabo at unknown>
+Date:   Tue Jan 16 01:33:18 2007 +0000
+
+    add shift spec and fix String#strip so it works
+
+commit 19bcc086b7674f12e01f879a6ca83f3289feb770
+Author: Cabo <cabo at unknown>
+Date:   Tue Jan 16 00:06:03 2007 +0000
+
+    Integer#chr should return a new string (spec)
+
+commit 5aa81499711ad5e57f5dfc03417f23705eb79b44
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jan 15 23:48:16 2007 +0000
+
+    a few more string specs.
+
+commit 8cd873e183c62b8929305ea54b9a437ca22ddb28
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jan 15 22:42:24 2007 +0000
+
+    committing Victor's define_method patch.
+
+commit cd04f4c570cd95fb869f025c4dac6e9342e2ba2a
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jan 15 22:02:23 2007 +0000
+
+    committing Victor Hugo Borja's instance_eval patch.
+
+commit a481142988d585bb8fa54e0186f5c9cf88ada8d9
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jan 15 20:13:03 2007 +0000
+
+    added a code method to mri_target and jruby_target to parallel the behavior of the code method for rubinius_target. now core/proc_spec.rb is passing with mri target.
+
+commit a4c621e8319349eda766f73ed9ca55f2a9323ac2
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jan 15 19:08:22 2007 +0000
+
+    checked in nicksieger's patch to spec_helper that enables specs to run on jruby, woohoo!
+
+commit 6b02aac6107b01258f85f9d15a77b498ad15e5b0
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jan 15 18:06:23 2007 +0000
+
+    checking in cabo's changes to target specs for jruby and rubinius. modified rubinius_target specs that compared paths to use should_match because a hash is used to generate part of the path.
+
+commit 6aa175d3367d76152476888ff1c52479530c56a2
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jan 15 17:57:25 2007 +0000
+
+    committing cabo's changes to remove heredocs from a number of specs. It is still possible to pass code as a source string to the example method. Use this if the block method is causing rubinius to choke on the ruby2ruby generated source. soon, soon, we'll have rspec running (I hope\!).
+
+commit 6679194f8e6afdbbb71f5213508bb81f12fdb2e7
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Jan 14 17:28:06 2007 +0000
+
+    incorporated nicksieger's changes to mri_target removing needless requires. added jruby_target.rb and spec to parallel mri_target.rb.
+
+commit f573b9c16efccb92eec98d923831deafc7a3c809
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Jan 14 08:10:24 2007 +0000
+
+    converted mri_target to use eval, yield to execute specs. converted some specs to new style. addressed issues with hash specs that implicitly relied on hash ordering, fixed numerous issues that result from loss of floating-point precision by using #inspect where necessary (more of these issues may arise in the specs on different platforms). added spec templates for documented String instance methods (many of which need to be filled in).
+
+commit 917cd03e5bee749d18d8d0c257381bca2362abbd
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Jan 14 00:11:17 2007 +0000
+
+    checking in Alan Hurdles patch to allow running specific files, e.g. COMPILER=rcompile rake spec:core:array .
+
+commit 508eaacf9aaf67465a78ac53284ba6f06c3bcb3d
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Jan 13 21:09:51 2007 +0000
+
+    added integer specs. these should be platform independent but other platforms may have some trouble with spec for 'chr' ;)
+
+commit 21463a87bac2121fa61c1c99927cdb039c724d89
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Jan 13 20:37:37 2007 +0000
+
+    implemented the rest of the hash specs, this should cover the documented class, instance methods.
+
+commit 3656a95a1829b0be1a8b0d968e0a9e433ef9c847
+Author: Frederick <frederick at unknown>
+Date:   Sat Jan 13 13:14:41 2007 +0000
+
+    Implements Fixnum#size
+
+commit ca38e49022f6bdf41b0e98409d3fec3528e59bfd
+Author: Frederick <frederick at unknown>
+Date:   Sat Jan 13 12:54:30 2007 +0000
+
+    shotgun/string_spec.rb now follow new spec conventions
+
+commit 1b684385fe970f11a526e280d15c3f147a826886
+Author: Frederick <frederick at unknown>
+Date:   Sat Jan 13 12:42:38 2007 +0000
+
+    language/expression_spec.rb and language/exception_spec.rb now use new spec style
+
+commit f62c2539a1eef27b356e4d809d76c4f9ddecd2a5
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Jan 13 08:14:12 2007 +0000
+
+    new style specs for hash. numerous of these need to be implemented but there should be templates for all the documented class and instance methods.
+
+commit 28083a6e6dc89502d1c76e2a16f0003a589f01e0
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Jan 13 08:12:37 2007 +0000
+
+    one more, bignum.
+
+commit 076aab00b795ff777c5ac11955130f12f69e1377
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Jan 13 08:07:30 2007 +0000
+
+    new style specs for float, fixnum, symbol, string, object, file, module, regexp, range.
+
+commit 0161ab3527e91674eed4eeaad029eee654325155
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Jan 13 07:39:26 2007 +0000
+
+    true, false, nil, enumerable specs are new style.
+
+commit bb11cce41a472606312eb0a62948c4a339f23dd9
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Jan 13 07:27:05 2007 +0000
+
+    converted existing class and comparable specs to new style.
+
+commit 595b83a75044772136b83eaf84402ed73eb79da5
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Jan 13 07:08:14 2007 +0000
+
+    ladies and gentlemen, a huge round of applause and gratitude to headius for inspiration and help getting specs in a form that will easily run on MRI, JRuby, and Rubinius. Checking in the modified spec/core/array_spec.rb. The rest to follow. The mri_target is still using the sub-process method, but that should be superfluous now.
+
+commit ae75e76915432757be3c9a7126c2ee8c6656652c
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Jan 12 08:13:29 2007 +0000
+
+    added a bunch more specs for array. two still need to be filled out. I think that covers all the documented class and instance methods.
+
+commit 8daf38e0f99eed3e42d654086a98e673d9855bef
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Jan 12 01:14:35 2007 +0000
+
+    checking in more of cabo's changes to kernel/core/array.rb and array specs.
+
+commit 0a349583aba629748d5e85de0ede6f38730512f1
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Jan 12 00:57:22 2007 +0000
+
+    checking in cabo's changes to array and array spec.
+
+commit 052512fea9b74e532ef6b68612c81061ad84e4f2
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Jan 11 05:16:47 2007 +0000
+
+    finished Bignum specs for documented instance methods.
+
+commit 7f4786c85b2e0e95abc2728492ed1a7424d01dbe
+Author: Frederick <frederick at unknown>
+Date:   Wed Jan 10 23:44:34 2007 +0000
+
+    Added File.mtime, File.atime, File.ctime
+    Avoid reusing old .rbc is .rb is newer
+    Remove useless CHECK_PTR
+
+commit 70458d6446f0858570571a64b5294c0bb4ac358f
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Jan 10 17:40:36 2007 +0000
+
+    moved exception and expression specs to spec/language. added stub for time_spec in spec/library. updated a string spec that was failing. added specs for all (I think) float and fixnum instance methods. added specs for bignum, but about half need examples.
+
+commit ffe4a7a48dcc116f73b89b9a046d4430ed51975a
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Jan 9 18:07:31 2007 +0000
+
+    removed duplicate bk task from Rakefile. removed shotgun-tests/test-array.rb as all tests have corresponding specs in spec/core. added beginning of specs for bignum separated into spec/core for stuff that should be indendent of mri or rubinius, and spec/shotgun for implementation specific.
+
+commit 946d0b42293ea081666e71e13c4b77d5b5dba886
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Jan 7 05:38:33 2007 +0000
+
+    checking in Alan Hurdles patches to regexp, string, and spec_string.
+
+commit 5f035040c4b3ce842fff4b39d1ca657c97deb7a4
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Jan 7 03:03:31 2007 +0000
+
+    updated mri and rubinius target impl specs. added environment option for running rubinius target using obsolete.rcompile, e.g.: COMPILER=rcompile spec spec/core/symbol_spec -f s. If you don't use the COMPILER env var, rubinius target will use shotgun to compile.
+
+commit 6ea911ae5740508cdbd8feb5cddba5b8bf7fe1c3
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Jan 7 02:32:35 2007 +0000
+
+    changed some Hash specs to use instance vars rather than local vars because some versions of Ruby2Ruby output borked sexp for block local vars. E.g. use @h rather than h.
+
+commit 256fe9a8cada7ed512556e1701a5264670c6c28f
+Author: Mae <mae at unknown>
+Date:   Sat Jan 6 07:55:32 2007 +0000
+
+    made regression spec for buggy behavior of [1,2,3][2..-1]
+
+commit 0ffe8a3e6cd92bc5cd872cc22919885ea80366a0
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Jan 5 20:05:03 2007 +0000
+
+    added spec for String#reverse! to Laurent Julliard's spec for String#reverse and his implementation of both methods.
+
+commit 170737d2c77a4b2de862380cb87f7705560cca64
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Fri Jan 5 18:24:32 2007 +0000
+
+    * Much better implementation of Hash#key?
+    * Added working support for default Hash values and procs
+    * Added hash_get_undef for situations where nil and undefined hash values need to be differentiated
+
+commit 332378a8900f09009626cb7c4dbf0c8740a657c7
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Jan 5 07:31:56 2007 +0000
+
+    added specs for aliases of Hash#key?
+
+commit 27c3b2aeaa3208a7e0218f051f623b93e2e635d8
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Jan 5 07:28:29 2007 +0000
+
+    added spec for Hash#key?
+
+commit 2e88d941bc1b1ea506396a915e3c3c4e3dfd1601
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Jan 5 06:35:09 2007 +0000
+
+    updated and simplified float and fixnum specs.
+
+commit e4a5b6d8529d60e62875004bb60f33c6452ccf98
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Fri Jan 5 06:28:04 2007 +0000
+
+    * defined?() now handles: defined?(Kernel.puts) flavors of arguments.
+
+commit 27660379c09e561590cf1bc48a9459e29fc00e9c
+Author: Mae <mae at unknown>
+Date:   Fri Jan 5 06:10:11 2007 +0000
+
+    Added spec for cvar declaration in class bodies
+
+commit a9b7b9f7db02ba78514eb869c2c52d4e5067f8d2
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Jan 4 08:08:59 2007 +0000
+
+    added class def source code to specs.
+
+commit cdfa499ee238671c655800a81b51611704383500
+Author: Mae <mae at unknown>
+Date:   Thu Jan 4 07:54:20 2007 +0000
+
+    fixed typo in spec still 7 failing specs *GLARES AT DEFILER*
+
+commit 03be9ca7da61363f8f0a02ee951bbafaf297c31b
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Jan 4 07:43:58 2007 +0000
+
+    added specs for Module#const_defined?.
+
+commit c511d4c7a75001f2597b13f9fc2e910d2dd4d9a2
+Author: Mae <mae at unknown>
+Date:   Thu Jan 4 06:54:07 2007 +0000
+
+    changed defined spec to be more dumb and just figure out whether its a true/false evaluation
+
+commit 4d9135f9694e4b692faf6a4c7b8dcd59f79f5069
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Jan 4 06:38:57 2007 +0000
+
+    added library spec (beginning) for enumerator. trivial update for comparable specs. added specs for enumerable.
+
+commit 3de6e339526b1402f8995a5acc38fde707ec0695
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Jan 4 00:34:50 2007 +0000
+
+    added specs for comparable methods.
+
+commit ea25c6b17533c280e640dc97e3fec1207fb4be7b
+Author: Mae <mae at unknown>
+Date:   Wed Jan 3 17:47:09 2007 +0000
+
+    almost done with defined? spec -- still need 'yield' and 'zsuper' test cases
+    from project dir: SPEC_TARGET=mri spec spec/language/defined_spec.rb
+    change SPEC_TARGET to rubinius to test on rubinius
+
+commit b795f6c2dc98952e7fa7231cded9156ade962b18
+Author: Mae <mae at unknown>
+Date:   Wed Jan 3 17:25:31 2007 +0000
+
+    added incomplete specs for defined? behavior -- more work to be done
+
+commit 25e30e4668f1ef814bfb1182e032449263651590
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Jan 3 17:17:03 2007 +0000
+
+    small fix to mri_target to generate reasonable cache soure name. added a couple specs.
+
+commit 3b5bc977ea2a4a3ad42ff83bcab2966459c262c0
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Jan 3 08:51:18 2007 +0000
+
+    added object_spec for methods provided by Object, even mixed in ones. added a few specs for basic class, module, exceptions.
+
+commit c4f4dd722658b2a09ae273092744b76e65ce05b2
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Jan 3 02:36:58 2007 +0000
+
+    renamed flow_control_spec to expression_spec as these are all covered under heading expressions in pickaxe. run expression spec with mri target and then rubinius target to see an interesting rubinius failure. updated an incorrect string splice spec.
+
+commit ef8aa2f74896944134f5a8884ccc723ca9b472c1
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Jan 2 01:40:16 2007 +0000
+
+    separated specs that are shotgun specific methods (e.g. String#prefix?) into spec/shotgun/... fixed wrong specs so that all pass under mri/mir configuration.
+
+commit 8661488b40b9fccccf356889834c6a9162c8bebf
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jan 1 22:37:41 2007 +0000
+
+    very quick n' dirty implementation of example et al to run specs under mri like under rubinius.
+
+commit 0ebfa43e222ca4794243d36f10c2e429e930f527
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jan 1 20:47:13 2007 +0000
+
+    added methods for TrueClass and FalseClass, updated specs for each.
+
+commit e9bb50ced8bf997535f0bc9c6deeeffb86c40879
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jan 1 20:29:37 2007 +0000
+
+    added specs for true, false, nil.
+
+commit c30b0e38b88c686c11c6f7442e027d685d405505
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jan 1 18:59:59 2007 +0000
+
+    added spec templates for true, false, nil, class, module, enumerable, comparable, flow_control, exception. added specs to various others.
+
+commit b26777261970c213506e444b90412543f39b3c59
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jan 1 18:58:37 2007 +0000
+
+    added that rubinius target example method takes a default argument to pass strings of code to allow for creating classes, since classes can't be defined in a method body and for now example puts the block code into a method using ruby2ruby.
+
+commit 560c5a1331c76bce07289f1e5950b816fe7c9c24
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Jan 1 01:17:44 2007 +0000
+
+    added more string specs.
+
+commit 807864c76b701f6f976f3f2935599ba875fcc10e
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Dec 31 23:13:16 2006 +0000
+
+    added more core specs (or templates for specs) to cover existing tests in shotgun-tests.
+
+commit 8f83b600b12722d46b9791b2e2c3a399618474a0
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Dec 31 21:23:07 2006 +0000
+
+    removed shotgun/primitives_spec as spec/shotgun should be for shotgun-specific code. created spec/core for ruby core classes. spec/library is now for ruby stdlib classes. added more array specs.
+
+commit 58cc3ce5bd8b84a151b1a6e2334845f268ab894a
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Dec 31 08:58:50 2006 +0000
+
+    added specs for class methods of Regexp. added alias Regexp.compile for Regexp.new.
+
+commit 0a5a31bc6ef539eeda3de951ab633f5152d58153
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Dec 31 02:01:34 2006 +0000
+
+    added specs for symbol methods. added aliases to symbol for to_i, to_int, and id2name.
+
+commit cdfa28e492b8edfa55b950b06ce05ebb04b64643
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Dec 30 17:27:18 2006 +0000
+
+    changed example method for rubinius_target to raise exception if compile fails. added specs for range.
+
+commit 5316e652084b8624828d0a9306f580bfc93184dc
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Dec 29 20:37:46 2006 +0000
+
+    added spec files in spec/library for basic types (according to pickaxe book). added specs for all the methods in Regexp. there are many failing specs for a variety of reasons, but the goal is to get a good overview of where work needs to be done. more specs to follow.
+
+commit 06cd5ad6da819f2894996e42f4da70321767c9c7
+Author: Mae <mae at unknown>
+Date:   Thu Dec 28 07:36:21 2006 +0000
+
+    Added Array expressions gleaned from spec/library/array_spec.rb as proof of concept for rapid compatibility testing
+    - A thought occurred to me that the scope for this type of testing might be limited severely to simple compatibility testing
+    - Its not very human understandable as a spec -- it just unravels incompatibilities given no hint as to why things are the way they are.
+    - It lets the ruby rval speak for itself
+    - Is this useful for rubinius?!
+
+commit 1c1fc9335aee4acbcd692c555b0ca194c5301013
+Author: Frederick <frederick at unknown>
+Date:   Wed Dec 27 22:46:43 2006 +0000
+
+    Fix a bug in the allocation of a string. The underlying storage (byte array) did not have the correct size, leading to a write in a non allocated memory area.
+    The rationale is that, the storage are should be able to store the string plus a terminal \0. As we're allocating per block of 4 bytes (a word) we need to get the nearest multiple of 4.
+    This patch adds a spec to highlight the bug, and a fix to .. well, fix it ;)
+
+commit cdfdc272b71bbfca23b4c17e5572ebd2b966615e
+Author: Mae <mae at unknown>
+Date:   Tue Dec 26 17:52:24 2006 +0000
+
+    Added my idea of a sanity check against MRI for compatibility purposes
+    - try it out!
+    - rake spec:compatibility
+    - example compatibility expressions go in spec/compatibility/expressions/*
+    - all the expression files are line-separated ruby expressions that return something basic and eval-able
+
+commit f9887648c7f239f8c862158b39f44b2410377204
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Dec 22 19:20:58 2006 +0000
+
+    added spec file for String methods.
+
+commit 8178e4478977c81940ac4bdcd8bea608be11708b
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Dec 22 17:14:46 2006 +0000
+
+    fixed that ruby2ruby was not generating correct ruby source when a local var was used in a block. changed local var to instance var and it works, converted primitives_spec to new block-style.
+
+commit 8a00080a1edb864af7573e8f9761f65fa1202d07
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Dec 22 06:58:28 2006 +0000
+
+    changed array_spec to not use local variables in blocks where possible because rubytoruby is not converting them to ruby source correctly. Array#uniq! fails at the moment. re-added that compile checks code-cache first so specs run faster.
+
+commit 4a199c559eebe73cd21d0997126b799f5d4e2be5
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Dec 22 06:00:21 2006 +0000
+
+    converted array_spec.rb to block-style specs, but they still depend on strings to be output. rewrote spec_helper based on nicksieger's example code. some specs are failing due to bugs converting to sexp and back to ruby source.
+
+commit 854bbc3617559a2ceac975d79a57ffa825a5cda6
+Author: Brian Ford <brixen at gmail.com>
+Date:   Fri Dec 22 03:34:18 2006 +0000
+
+    added spec/targets for specs for 'target' part of host/target spec runner configuration. added mri_target and rubinius_target and specs.
+
+commit db81559c9c914413d2064b4202ec8ce43e503af2
+Author: Brian Ford <brixen at gmail.com>
+Date:   Thu Dec 21 05:51:55 2006 +0000
+
+    added spec:targets task to run specs for target part of host/target spec configuration. added specs for mri_target and rubinius_target.
+
+commit a243a70bd17ec7e9839b69bb18e63d5d943b6095
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Dec 20 19:02:01 2006 +0000
+
+    updated primitives_spec to use example method.
+
+commit 9ce077283dd10c21377add499c5bcc4ea87cfe0f
+Author: Brian Ford <brixen at gmail.com>
+Date:   Wed Dec 20 17:11:00 2006 +0000
+
+    Changed method from rubinius to example for specs. This is in anticipation of having independent 'host' (system running rspec) and 'target' (system executing spec). Created parallel arrayb_spec that illustrates this with a mri/mri configuration. Also added spec_bhelper that is a *very rough* beginning for having mri/rubinius configuration using block-style specs.
+
+commit a8ad71a0da9e1a866521074743ea1dfcceb596cb
+Author: Wilson Bilkovich <wilson at supremetyrant.com>
+Date:   Wed Dec 20 15:39:36 2006 +0000
+
+    Applying 'array patch' from Jason Perkins (2006-12-20 8:30 EST)
+
+commit 82b3d880131e7080ebc6b4289b3954d89a988c13
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Dec 19 17:30:21 2006 +0000
+
+    added more specs to array_spec. most of these are failing, so there seems to be a lot of Array that needs implementing.
+
+commit c24f0e83b4d446afd541ffefbcb313f199b684ee
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Dec 19 08:24:00 2006 +0000
+
+    added specs for Array#* and <<, simplified other specs.
+
+commit 62b0737ce69768a8292bd3d9f13401ec8056f6eb
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Dec 19 07:46:39 2006 +0000
+
+    fixed messed up spec for &.
+
+commit 7635389b2abf5c492952a49eb8251d6fb34250c7
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Dec 19 07:40:01 2006 +0000
+
+    added spec for Array#&, which is currently unimplemented. updated spec_helper.
+
+commit 42b5e9fc47bcf6bcd403d25795c9bcf07bb5c007
+Author: Brian Ford <brixen at gmail.com>
+Date:   Tue Dec 19 06:13:15 2006 +0000
+
+    added spec tasks :only to run only spec, :language for high level language conformance spcs, :library for ruby stdlib implementation specs, and :shotgun for specs related to shotgun. rake spec will run all specs and tests. removed spec/spec_suite.rb because all specs can be run from rake. minor updates to spec_helper.
+
+commit da4c42890f4b8163b8d49de64bdb76c16b0e5d1f
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Dec 18 17:41:44 2006 +0000
+
+    added shotgun dir under spec for things that relate to shotgun implementation of VM, like the prmitives_spec, while reserving spec/library for general ruby implementation of the std lib.
+
+commit 925cbf9f84f78a48189f7030c205942d266a6f66
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Dec 18 09:45:25 2006 +0000
+
+    added Fixnum#% primitive implementation. changed array_spec to use Fixnum#%. fixed test_primitive test for Fixnum#%.
+
+commit 06e50e48a92e3fa7d1fc4d6b681872d08e5aeba3
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Dec 18 09:10:37 2006 +0000
+
+    Added Fixnum#% primitive test, spec, cpu/primitive, stub.
+
+commit e0fbcf29f46dde89f65d13c1b6d7601a470cf223
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Dec 18 07:54:02 2006 +0000
+
+    all ports of test_array test to array_spec are now passing.
+
+commit c2330c2ff65cfa964d954340fb0eb2507972efd5
+Author: Brian Ford <brixen at gmail.com>
+Date:   Mon Dec 18 07:39:55 2006 +0000
+
+    updated spec_helper to ensure code-cache dir exists. fixed several failing specs in array_spec by correcting expected value.
+
+commit 81cc03c6f7ce499da563543f00d273d3a9c3a184
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Dec 17 06:27:15 2006 +0000
+
+    Ported the rest of test_array.rb tests to specs. Several of these specs are not passing but ported them all to illustrate behavior of specs.
+
+commit b4cb073931f403119a5ed9b63a2c915612a9c46f
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sun Dec 17 04:42:55 2006 +0000
+
+    spec/spec_helper.rb rubinius method is a very naive port of shotgun-tests/helper.rb run_code method. spec/library/array_spec.rb is several ports of the tests in shotgun-tests/test_array.rb, which is testing /kernel/array.rb. In other words, you can now create specs that run under RSpec (which is running under MRI 1.8.x) that exercises the rubinius vm, shotgun, and the stdlib that is being written in ruby. Confused? Read the source, Luke. :)
+
+commit 1b37cd1ee800060fb215a52d2902c3f4b778a656
+Author: Brian Ford <brixen at gmail.com>
+Date:   Sat Dec 16 07:55:41 2006 +0000
+
+    Added spec dir with spec_suite.rb and spec_helper.rb provided by nullstyle.

Added: MacRuby/branches/experimental/spec/frozen/LICENSE
===================================================================
--- MacRuby/branches/experimental/spec/frozen/LICENSE	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/LICENSE	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+Copyright (c) 2008 Engine Yard, Inc. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.

Added: MacRuby/branches/experimental/spec/frozen/command_line/dash_d_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/command_line/dash_d_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/command_line/dash_d_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe "The -d command line option" do
+  it "sets $DEBUG to true" do
+    ruby_exe("fixtures/debug.rb", :options => "-d", :dir => File.dirname(__FILE__)).chomp.should == "true"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/command_line/dash_e_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/command_line/dash_e_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/command_line/dash_e_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe "The -e command line option" do
+  it "evaluates the given string" do
+    ruby_exe("puts 'foo'").chomp.should == "foo"
+  end
+
+  it "joins multiple strings with newlines" do
+    ruby_exe(nil, :args => %Q{-e "puts 'hello" -e "world'"}).chomp.should == "hello\nworld"
+  end
+
+  it "uses 'main' as self" do
+    ruby_exe("puts self").chomp.should == "main"
+  end
+
+  it "uses '-e' as file" do
+    ruby_exe("puts __FILE__").chomp.should == "-e"
+  end
+
+  #needs to test return => LocalJumpError
+end

Added: MacRuby/branches/experimental/spec/frozen/command_line/dash_r_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/command_line/dash_r_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/command_line/dash_r_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe "The -r command line option" do
+  it "requires the specified file" do
+    ruby_exe("fixtures/require.rb", :options => "-r fixtures/test_file", :dir => File.dirname(__FILE__)).chomp.should include("fixtures/test_file.rb")
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/command_line/dash_upper_i_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/command_line/dash_upper_i_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/command_line/dash_upper_i_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe "The -I command line option" do
+  it "adds the path to the load path ($:)" do
+    ruby_exe("fixtures/loadpath.rb", :options => "-I fixtures", :dir => File.dirname(__FILE__)).chomp.should include("fixtures")
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/command_line/dash_upper_w_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/command_line/dash_upper_w_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/command_line/dash_upper_w_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+require File.dirname(__FILE__) + '/shared/verbose'
+
+describe "The -W command line option" do
+  it "with 0 sets $VERBOSE to nil" do
+    ruby_exe("fixtures/verbose.rb", :options => "-W0", :dir => File.dirname(__FILE__)).chomp.should == "nil"
+  end
+
+  it "with 1 sets $VERBOSE to false" do
+    ruby_exe("fixtures/verbose.rb", :options => "-W1", :dir => File.dirname(__FILE__)).chomp.should == "false"
+  end
+end
+
+describe "The -W command line option with 2" do
+  it_behaves_like "sets $VERBOSE to true", "-W2"
+end

Added: MacRuby/branches/experimental/spec/frozen/command_line/dash_v_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/command_line/dash_v_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/command_line/dash_v_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe "The -v command line option" do
+  it_behaves_like "sets $VERBOSE to true", "-v"
+end

Added: MacRuby/branches/experimental/spec/frozen/command_line/dash_w_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/command_line/dash_w_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/command_line/dash_w_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe "The -w command line option" do
+  it_behaves_like "sets $VERBOSE to true", "-w"
+end

Added: MacRuby/branches/experimental/spec/frozen/command_line/fixtures/debug.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/command_line/fixtures/debug.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/command_line/fixtures/debug.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+puts $DEBUG

Added: MacRuby/branches/experimental/spec/frozen/command_line/fixtures/loadpath.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/command_line/fixtures/loadpath.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/command_line/fixtures/loadpath.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+puts $:

Added: MacRuby/branches/experimental/spec/frozen/command_line/fixtures/require.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/command_line/fixtures/require.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/command_line/fixtures/require.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+puts $"

Added: MacRuby/branches/experimental/spec/frozen/command_line/fixtures/test_file.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/command_line/fixtures/test_file.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/command_line/fixtures/test_file.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+"test file"

Added: MacRuby/branches/experimental/spec/frozen/command_line/fixtures/verbose.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/command_line/fixtures/verbose.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/command_line/fixtures/verbose.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+puts $VERBOSE

Added: MacRuby/branches/experimental/spec/frozen/command_line/shared/verbose.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/command_line/shared/verbose.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/command_line/shared/verbose.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+describe "sets $VERBOSE to true", :shared => true do
+  it "sets $VERBOSE to true" do
+    ruby_exe("fixtures/verbose.rb", :options => @method, :dir => "#{File.dirname(__FILE__)}\\..").chomp.match(/true$/).should_not == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/argf_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/argf_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/argf_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ARGF" do
+  it "is extended by the Enumerable module" do
+    ARGF.should be_kind_of(Enumerable)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/binmode_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/binmode_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/binmode_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,48 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ARGF.binmode" do
+  before :each do
+    @file1    = fixture __FILE__, "file1.txt"
+    @file2    = fixture __FILE__, "file2.txt"
+    @bin_file = fixture __FILE__, "bin_file.txt"
+  end
+
+  after :each do
+    ARGF.close
+  end
+
+  it "returns self" do
+    argv [@bin_file] do
+      ARGF.binmode.should equal(ARGF)
+    end
+  end
+
+  platform_is :windows do
+    it "puts reading into binmode" do
+      argv [@bin_file, @bin_file] do
+        ARGF.gets.should == "test\n"
+        ARGF.binmode
+        ARGF.gets.should == "test\r\n"
+      end
+    end
+    
+    it "puts alls subsequent stream reading through ARGF into binmode" do
+      argv [@bin_file, @bin_file, @bin_file, @bin_file] do
+        ARGF.gets.should == "test\n"
+        ARGF.binmode
+        ARGF.gets.should == "test\r\n"
+        ARGF.gets.should == "test\r\n"
+        ARGF.gets.should == "test\r\n"
+      end
+    end
+  end
+  
+  platform_is_not :windows do
+    # This does nothing on Unix but it should not raise any errors.
+    it "does not raise an error" do
+      argv [@bin_file] do
+        lambda { ARGF.binmode }.should_not raise_error
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/bytes_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/bytes_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/bytes_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/each_byte'
+
+ruby_version_is "1.8.7" do
+  describe "ARGF.bytes" do
+    it_behaves_like :argf_each_byte, :bytes
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/argf/chars_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/chars_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/chars_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/each_char'
+
+ruby_version_is "1.8.7" do
+  describe "ARGF.chars" do
+    it_behaves_like :argf_each_char, :chars
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/argf/close_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/close_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/close_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ARGF.close" do
+  before :each do
+    @file1_name = fixture __FILE__, "file1.txt"
+    @file2_name = fixture __FILE__, "file2.txt"
+  end
+
+  after :each do
+    ARGF.close
+  end
+
+  it "closes the current open stream" do
+    argv [@file1_name, @file2_name] do
+      io = ARGF.to_io
+      ARGF.close
+      io.closed?.should be_true
+    end
+  end
+  
+  it "returns self" do
+    argv [@file1_name, @file2_name] do
+      ARGF.close.should equal(ARGF)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/closed_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/closed_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/closed_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ARGF.closed?" do
+  before :each do
+    @file1_name = fixture __FILE__, "file1.txt"
+    @file2_name = fixture __FILE__, "file2.txt"
+  end
+
+  after :each do
+    ARGF.close
+  end
+
+  it "returns true if the current stream has been closed" do
+    argv [@file1_name, @file2_name] do
+      stream = ARGF.to_io
+      stream.close
+      
+      ARGF.closed?.should be_true
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/each_byte_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/each_byte_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/each_byte_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/each_byte'
+
+describe "ARGF.each_byte" do
+  it_behaves_like :argf_each_byte, :each_byte
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/each_char_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/each_char_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/each_char_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/each_char'
+
+ruby_version_is "1.8.7" do
+  describe "ARGF.each_char" do
+    it_behaves_like :argf_each_char, :each_char
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/argf/each_line_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/each_line_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/each_line_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/each_line'
+
+describe "ARGF.each_line" do
+  it_behaves_like :argf_each_line, :each_line
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/each_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/each_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/each_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/each_line'
+
+describe "ARGF.each" do
+  it_behaves_like :argf_each_line, :each
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/eof_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/eof_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/eof_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/eof'
+
+describe "ARGF.eof" do
+  it_behaves_like :argf_eof, :eof
+end
+
+describe "ARGF.eof?" do
+  it_behaves_like :argf_eof, :eof?
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/file_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/file_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/file_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ARGF.file" do
+  before :each do
+    @file1 = fixture __FILE__, "file1.txt"
+    @file2 = fixture __FILE__, "file2.txt"
+  end
+
+  after :each do
+    ARGF.close
+  end
+
+  # NOTE: this test assumes that fixtures files have two lines each
+  it "returns the current file object on each file" do
+    argv [@file1, @file2] do
+      result = []
+      # returns first current file even when not yet open
+      result << ARGF.file.path
+      result << ARGF.file.path while ARGF.gets
+      # returns last current file even when closed
+      result << ARGF.file.path
+      result.should == [@file1, @file1, @file1, @file2, @file2, @file2]
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/filename_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/filename_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/filename_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/filename'
+
+describe "ARGF.filename" do
+  it_behaves_like :argf_filename, :filename
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/fileno_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/fileno_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/fileno_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/fileno'
+
+describe "ARGF.fileno" do
+  it_behaves_like :argf_fileno, :fileno
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/fixtures/bin_file.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/fixtures/bin_file.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/fixtures/bin_file.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+test
+test

Added: MacRuby/branches/experimental/spec/frozen/core/argf/fixtures/file1.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/fixtures/file1.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/fixtures/file1.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+file1.1
+file1.2

Added: MacRuby/branches/experimental/spec/frozen/core/argf/fixtures/file2.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/fixtures/file2.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/fixtures/file2.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+line2.1
+line2.2

Added: MacRuby/branches/experimental/spec/frozen/core/argf/fixtures/stdin.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/fixtures/stdin.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/fixtures/stdin.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+stdin.1
+stdin.2

Added: MacRuby/branches/experimental/spec/frozen/core/argf/getc_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/getc_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/getc_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/getc'
+
+describe "ARGF.getc" do
+  it_behaves_like :argf_getc, :getc
+end
+
+describe "ARGF.getc" do
+  before :each do
+    @file1 = fixture __FILE__, "file1.txt"
+    @file2 = fixture __FILE__, "file2.txt"
+  end
+
+  after :each do
+    ARGF.close
+  end
+
+  it "returns nil when end of stream reached" do
+    argv [@file1, @file2] do
+      ARGF.read
+      ARGF.getc.should == nil
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/gets_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/gets_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/gets_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/gets'
+
+describe "ARGF.gets" do
+  it_behaves_like :argf_gets, :gets
+end
+
+describe "ARGF.gets" do
+  it_behaves_like :argf_gets_inplace_edit, :gets
+end
+
+describe "ARGF.gets" do
+  before :each do
+    @file1_name = fixture __FILE__, "file1.txt"
+    @file2_name = fixture __FILE__, "file2.txt"
+
+    @file1 = File.readlines @file1_name
+    @file2 = File.readlines @file2_name
+  end
+
+  after :each do
+    ARGF.close
+  end
+
+  it "returns nil when reaching end of files" do
+    argv [@file1_name, @file2_name] do
+      total = @file1.size + @file2.size
+      total.times { ARGF.gets }
+      ARGF.gets.should == nil
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/lineno_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/lineno_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/lineno_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,47 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ARGF.lineno" do
+  before :each do
+    @file1 = fixture __FILE__, "file1.txt"
+    @file2 = fixture __FILE__, "file2.txt"
+  end
+
+  after :each do
+    ARGF.close
+  end
+
+  # NOTE: this test assumes that fixtures files have two lines each
+  # TODO: break this into four specs
+  it "returns the current line number on each file" do
+    argv [@file1, @file2, @file1, @file2] do
+      ARGF.gets
+      ARGF.lineno.should == 1
+      ARGF.gets
+      ARGF.lineno.should == 2
+      ARGF.gets
+      ARGF.lineno.should == 3
+      ARGF.gets
+      ARGF.lineno.should == 4
+
+      ARGF.rewind
+      ARGF.lineno.should == 4
+      ARGF.gets
+      ARGF.lineno.should == 3
+
+      ARGF.lineno = 1000
+      $..should == 1000
+      ARGF.gets
+      $..should == 1001
+      ARGF.gets
+      $..should == 1002
+
+      $. = 2000
+      ARGF.gets
+      $..should == 2001
+      ARGF.gets
+      $..should == 2002
+      ARGF.read
+      $..should == 2002
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/path_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/path_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/path_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/filename'
+
+describe "ARGF.path" do
+  it_behaves_like :argf_filename, :path
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/pos_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/pos_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/pos_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,42 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/pos'
+
+describe "ARGF.pos" do
+  it_behaves_like :argf_pos, :pos
+end
+
+describe "ARGF.pos=" do
+  before :each do
+    @file1_name = fixture __FILE__, "file1.txt"
+    @file2_name = fixture __FILE__, "file2.txt"
+
+    @file1 = File.readlines @file1_name
+    @file2 = File.readlines @file2_name
+  end
+
+  after :each do
+    ARGF.close
+  end
+
+  # NOTE: this test assumes that fixtures files have two lines each
+  it "sets the correct position in files" do
+    argv [@file1_name, @file2_name] do
+      ARGF.pos = @file1.first.size
+      ARGF.gets.should == @file1.last
+      ARGF.pos = 0
+      ARGF.gets.should == @file1.first
+
+      # finish reading file1
+      ARGF.gets
+
+      ARGF.gets
+      ARGF.pos = 1
+      ARGF.gets.should == @file2.first[1..-1]
+
+      ARGF.pos = @file2.first.size + @file2.last.size - 1
+      ARGF.gets.should == @file2.last[-1,1]
+      ARGF.pos = 1000
+      ARGF.read.should == ""
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/read_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/read_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/read_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,106 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ARGF.read" do
+  before :each do
+    @file1_name = fixture __FILE__, "file1.txt"
+    @file2_name = fixture __FILE__, "file2.txt"
+    @stdin_name = fixture __FILE__, "stdin.txt"
+
+    @file1 = File.read @file1_name
+    @file2 = File.read @file2_name
+    @stdin = File.read @stdin_name
+  end
+
+  after :each do
+    ARGF.close
+  end
+
+  it "reads the contents of a file" do
+    argv [@file1_name] do
+      ARGF.read().should == @file1
+    end
+  end
+
+  it "treats first nil argument as no length limit" do
+    argv [@file1_name] do
+      ARGF.read(nil).should == @file1
+    end
+  end
+
+  it "treats second nil argument as no output buffer" do
+    argv [@file1_name] do
+      ARGF.read(nil, nil).should == @file1
+    end
+  end
+
+  it "treats second argument as an output buffer" do
+    argv [@file1_name] do
+      buffer = ""
+      ARGF.read(nil, buffer)
+      buffer.should == @file1
+    end
+  end
+
+  it "reads a number of bytes from the first file" do
+    argv [@file1_name] do
+      ARGF.read(5).should == @file1[0,5]
+    end
+  end
+
+  it "reads from a single file consecutively" do
+    argv [@file1_name] do
+      ARGF.read(1).should == @file1[0,1]
+      ARGF.read(2).should == @file1[1,2]
+      ARGF.read(3).should == @file1[3,3]
+    end
+  end
+
+  it "reads the contents of two files" do
+    argv [@file1_name, @file2_name] do
+      ARGF.read.should ==  @file1 + @file2
+    end
+  end
+
+  it "reads the contents of one file and some characters from the second" do
+    argv [@file1_name, @file2_name] do
+      len = @file1.size + (@file2.size / 2)
+      ARGF.read(len).should ==  (@file1 + @file2)[0,len]
+    end
+  end
+
+  it "reads across two files consecutively" do
+    argv [@file1_name, @file2_name] do
+      ARGF.read(@file1.size - 2).should == @file1[0..-3]
+      ARGF.read(2+5).should == @file1[-2..-1] + @file2[0,5]
+    end
+  end
+
+  it "reads the contents of stdin" do
+    stdin = ruby_exe("print ARGF.read", :args => "< #{@stdin_name}")
+    stdin.should == @stdin
+  end
+
+  it "reads a number of bytes from stdin" do
+    stdin = ruby_exe("print ARGF.read(10)", :args => "< #{@stdin_name}")
+    stdin.should == @stdin[0,10]
+  end
+
+  it "reads the contents of one file and stdin" do
+    stdin = ruby_exe("print ARGF.read", :args => "#{@file1_name} - < #{@stdin_name}")
+    stdin.should == @file1 + @stdin
+  end
+
+  it "reads the contents of the same file twice" do
+    argv [@file1_name, @file1_name] do
+      ARGF.read.should == @file1 + @file1
+    end
+  end
+
+  platform_is_not :windows do
+    it "reads the contents of a special device file" do
+      argv ['/dev/zero'] do
+        ARGF.read(100).should == "\000" * 100
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/readchar_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/readchar_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/readchar_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/getc'
+
+describe "ARGF.getc" do
+  it_behaves_like :argf_getc, :readchar
+end
+
+describe "ARGF.readchar" do
+  before :each do
+    @file1 = fixture __FILE__, "file1.txt"
+    @file2 = fixture __FILE__, "file2.txt"
+  end
+
+  after :each do
+    ARGF.close
+  end
+
+  it "raises EOFError when end of stream reached" do
+    argv [@file1, @file2] do
+      lambda { while c = ARGF.readchar; end }.should raise_error(EOFError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/readline_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/readline_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/readline_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/gets'
+
+describe "ARGF.readline" do
+  it_behaves_like :argf_gets, :readline
+end
+
+describe "ARGF.readline" do
+  it_behaves_like :argf_gets_inplace_edit, :readline
+end
+
+describe "ARGF.readline" do
+  before :each do
+    @file1 = fixture __FILE__, "file1.txt"
+    @file2 = fixture __FILE__, "file2.txt"
+  end
+
+  after :each do
+    ARGF.close
+  end
+
+  it "raises an EOFError when reaching end of files" do
+    argv [@file1, @file2] do
+      lambda { while line = ARGF.readline; end }.should raise_error(EOFError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/readlines_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/readlines_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/readlines_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/readlines'
+
+describe "ARGF.readlines" do
+  it_behaves_like :argf_readlines, :readlines
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/rewind_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/rewind_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/rewind_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,37 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ARGF.rewind" do
+  before :each do
+    @file1_name = fixture __FILE__, "file1.txt"
+    @file2_name = fixture __FILE__, "file2.txt"
+
+    @file1 = File.readlines @file1_name
+    @file2 = File.readlines @file2_name
+  end
+
+  after :each do
+    ARGF.close
+  end
+
+  # NOTE: this test assumes that fixtures files have two lines each
+  it "goes back to beginning of current file" do
+    argv [@file1_name, @file2_name] do
+      ARGF.gets;
+      ARGF.rewind;
+      ARGF.gets.should == @file1.first
+
+      ARGF.gets # finish reading file1
+
+      ARGF.gets
+      ARGF.rewind
+      ARGF.gets.should == @file2.first
+    end
+  end
+
+  it "raises an ArgumentError when end of stream reached" do
+    argv [@file1_name, @file2_name] do
+      ARGF.read
+      lambda { ARGF.rewind }.should raise_error(ArgumentError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/seek_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/seek_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/seek_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,59 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ARGF.seek" do
+  before :each do
+    @file1_name = fixture __FILE__, "file1.txt"
+    @file2_name = fixture __FILE__, "file2.txt"
+
+    @file1 = File.readlines @file1_name
+    @file2 = File.readlines @file2_name
+  end
+
+  after :each do
+    ARGF.close
+  end
+
+  it "sets the absolute position relative to beginning of file" do
+    argv [@file1_name, @file2_name] do
+      ARGF.seek 2
+      ARGF.gets.should == @file1.first[2..-1]
+      ARGF.seek @file1.first.size
+      ARGF.gets.should == @file1.last
+      ARGF.seek 0, IO::SEEK_END
+      ARGF.gets.should == @file2.first
+    end
+  end
+
+  it "sets the position relative to current position in file" do
+    argv [@file1_name, @file2_name] do
+      ARGF.seek 0, IO::SEEK_CUR
+      ARGF.gets.should == @file1.first
+      ARGF.seek - at file1.first.size+2, IO::SEEK_CUR
+      ARGF.gets.should == @file1.first[2..-1]
+      ARGF.seek 1, IO::SEEK_CUR
+      ARGF.gets.should == @file1.last[1..-1]
+      ARGF.seek 3, IO::SEEK_CUR
+      ARGF.gets.should == @file2.first
+      ARGF.seek @file1.last.size, IO::SEEK_CUR
+      ARGF.gets.should == nil
+    end
+  end
+
+  it "sets the absolute position relative to end of file" do
+    argv [@file1_name, @file2_name] do
+      ARGF.seek - at file1.first.size-@file1.last.size, IO::SEEK_END
+      ARGF.gets.should == @file1.first
+      ARGF.seek -6, IO::SEEK_END
+      ARGF.gets.should == @file1.last[-6..-1]
+      ARGF.seek -4, IO::SEEK_END
+      ARGF.gets.should == @file1.last[4..-1]
+      ARGF.gets.should == @file2.first
+      ARGF.seek -6, IO::SEEK_END
+      ARGF.gets.should == @file2.last[-6..-1]
+    end
+  end
+
+  it "takes at least one argument (offset)" do
+    lambda { ARGF.seek }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/shared/each_byte.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/shared/each_byte.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/shared/each_byte.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,49 @@
+describe :argf_each_byte, :shared => true do
+  before :each do
+    @file1_name = fixture __FILE__, "file1.txt"
+    @file2_name = fixture __FILE__, "file2.txt"
+
+    @bytes = []
+    File.read(@file1_name).each_byte { |b| @bytes << b }
+    File.read(@file2_name).each_byte { |b| @bytes << b }
+  end
+
+  after :each do
+    ARGF.close
+  end
+
+  it "yields each byte of all streams to the passed block" do
+    argv [@file1_name, @file2_name] do
+      bytes = []
+      ARGF.send(@method) { |b| bytes << b }
+      bytes.should == @bytes
+    end
+  end
+
+  it "returns self when passed a block" do
+    argv [@file1_name, @file2_name] do
+      ARGF.send(@method) {}.should equal(ARGF)
+    end
+  end
+
+  ruby_version_is "" ... "1.8.7" do
+    it "raises a LocalJumpError when passed no block" do
+      argv [@file1_name, @file2_name] do
+        lambda { ARGF.send(@method) }.should raise_error(LocalJumpError)
+      end
+    end
+  end
+
+  ruby_version_is "1.8.7" do
+    it "returns an Enumerable::Enumerator when passed no block" do
+      argv [@file1_name, @file2_name] do
+        enum = ARGF.send(@method)
+        enum.should be_an_instance_of(Enumerable::Enumerator)
+
+        bytes = []
+        enum.each { |b| bytes << b }
+        bytes.should == @bytes
+      end
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/argf/shared/each_char.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/shared/each_char.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/shared/each_char.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,39 @@
+describe :argf_each_char, :shared => true do
+  before :each do
+    @file1_name = fixture __FILE__, "file1.txt"
+    @file2_name = fixture __FILE__, "file2.txt"
+
+    @chars = []
+    File.read(@file1_name).each_char { |c| @chars << c }
+    File.read(@file2_name).each_char { |c| @chars << c }
+  end
+
+  after :each do
+    ARGF.close
+  end
+
+  it "yields each char of all streams to the passed block" do
+    argv [@file1_name, @file2_name] do
+      chars = []
+      ARGF.send(@method) { |c| chars << c }
+      chars.should == @chars
+    end
+  end
+
+  it "returns self when passed a block" do
+    argv [@file1_name, @file2_name] do
+      ARGF.send(@method) {}.should equal(ARGF)
+    end
+  end
+
+  it "returns an Enumerable::Enumerator when passed no block" do
+    argv [@file1_name, @file2_name] do
+      enum = ARGF.send(@method)
+      enum.should be_an_instance_of(Enumerable::Enumerator)
+
+      chars = []
+      enum.each { |c| chars << c }
+      chars.should == @chars
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/argf/shared/each_line.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/shared/each_line.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/shared/each_line.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+describe :argf_each_line, :shared => true do
+  before :each do
+    @file1_name = fixture __FILE__, "file1.txt"
+    @file2_name = fixture __FILE__, "file2.txt"
+
+    @lines  = File.readlines @file1_name
+    @lines += File.readlines @file2_name
+  end
+
+  after :each do
+    ARGF.close
+  end
+
+  it "reads each line of files" do
+    argv [@file1_name, @file2_name] do
+      lines = []
+      ARGF.send(@method) { |b| lines << b }
+      lines.should == @lines
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/shared/eof.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/shared/eof.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/shared/eof.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+describe :argf_eof, :shared => true do
+  before :each do
+    @file1 = fixture __FILE__, "file1.txt"
+    @file2 = fixture __FILE__, "file2.txt"
+  end
+
+  after :each do
+    ARGF.close
+  end
+
+  # NOTE: this test assumes that fixtures files have two lines each
+  it "returns true when reaching the end of a file" do
+    argv [@file1, @file2, @file1] do
+      result = []
+      while ARGF.gets
+        result << ARGF.send(@method)
+      end
+      result.should == [false, true, false, true, false, true]
+    end
+  end
+
+  it "raises IOError when called on a closed stream" do
+    argv [@file1] do
+      ARGF.read
+      lambda { ARGF.send(@method) }.should raise_error(IOError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/shared/filename.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/shared/filename.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/shared/filename.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,37 @@
+describe :argf_filename, :shared => true do
+  before :each do
+    @file1 = fixture __FILE__, "file1.txt"
+    @file2 = fixture __FILE__, "file2.txt"
+  end
+
+  after :each do
+    ARGF.close
+  end
+
+  # NOTE: this test assumes that fixtures files have two lines each
+  it "returns the current file name on each file" do
+    argv [@file1, @file2] do
+      result = []
+      # returns first current file even when not yet open
+      result << ARGF.send(@method)
+      result << ARGF.send(@method) while ARGF.gets
+      # returns last current file even when closed
+      result << ARGF.send(@method)
+
+      result.map! { |f| File.expand_path(f) }
+      result.should == [@file1, @file1, @file1, @file2, @file2, @file2]
+    end
+  end
+
+  # NOTE: this test assumes that fixtures files have two lines each
+  it "it sets the $FILENAME global variable with the current file name on each file" do
+    argv [@file1, @file2] do
+      result = []
+      result << $FILENAME while ARGF.gets
+      # returns last current file even when closed
+      result << $FILENAME
+      result.map! { |f| File.expand_path(f) }
+      result.should == [@file1, @file1, @file2, @file2, @file2]
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/shared/fileno.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/shared/fileno.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/shared/fileno.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+describe :argf_fileno, :shared => true do
+  before :each do
+    @file1 = fixture __FILE__, "file1.txt"
+    @file2 = fixture __FILE__, "file2.txt"
+  end
+
+  after :each do
+    ARGF.close
+  end
+
+  # NOTE: this test assumes that fixtures files have two lines each
+  it "returns the current file number on each file" do
+    argv [@file1, @file2] do
+      result = []
+      # returns first current file even when not yet open
+      result << ARGF.send(@method) while ARGF.gets
+      # returns last current file even when closed
+      result.map { |d| d.class }.should == [Fixnum, Fixnum, Fixnum, Fixnum]
+    end
+  end
+
+  it "raises an ArgumentError when called on a closed stream" do
+    argv [@file1] do
+      ARGF.read
+      lambda { ARGF.send(@method) }.should raise_error(ArgumentError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/shared/getc.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/shared/getc.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/shared/getc.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+describe :argf_getc, :shared => true do
+  before :each do
+    @file1 = fixture __FILE__, "file1.txt"
+    @file2 = fixture __FILE__, "file2.txt"
+
+    @chars  = File.read @file1
+    @chars += File.read @file2
+  end
+
+  after :each do
+    ARGF.close
+  end
+
+  it "reads each char of files" do
+    argv [@file1, @file2] do
+      chars = ""
+      @chars.size.times { chars << ARGF.send(@method) }
+      chars.should == @chars
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/shared/gets.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/shared/gets.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/shared/gets.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,104 @@
+describe :argf_gets, :shared => true do
+  before :each do
+    @file1_name = fixture __FILE__, "file1.txt"
+    @file2_name = fixture __FILE__, "file2.txt"
+    @stdin_name = fixture __FILE__, "stdin.txt"
+
+    @file1 = File.readlines @file1_name
+    @file2 = File.readlines @file2_name
+    @stdin = File.read @stdin_name
+  end
+
+  after :each do
+    ARGF.close
+  end
+
+  it "reads one line of a file" do
+    argv [@file1_name] do
+      ARGF.send(@method).should == @file1.first
+    end
+  end
+
+  it "reads all lines of a file" do
+    argv [@file1_name] do
+      lines = []
+      @file1.size.times { lines << ARGF.send(@method) }
+      lines.should == @file1
+    end
+  end
+
+  it "reads all lines of stdin" do
+    total = @stdin.count $/
+    stdin = ruby_exe(
+      "#{total}.times { print ARGF.send(#{@method.inspect}) }",
+      :args => "< #{@stdin_name}")
+    stdin.should == @stdin
+  end
+
+  it "reads all lines of two files" do
+    argv [@file1_name, @file2_name] do
+      total = @file1.size + @file2.size
+      lines = []
+      total.times { lines << ARGF.send(@method) }
+      lines.should == @file1 + @file2
+    end
+  end
+
+  it "sets $_ global variable with each line read" do
+    argv [@file1_name, @file2_name] do
+      total = @file1.size + @file2.size
+      total.times do
+        line = ARGF.send(@method)
+        $_.should == line
+      end
+    end
+  end
+end
+
+describe :argf_gets_inplace_edit, :shared => true do
+  before :each do
+    @file1_name = fixture __FILE__, "file1.txt"
+    @file2_name = fixture __FILE__, "file2.txt"
+
+    @tmp1_name  = tmp "file1.txt"
+    @tmp2_name  = tmp "file2.txt"
+
+    @tmp1_name_bak = @tmp1_name + ".bak"
+    @tmp2_name_bak = @tmp2_name + ".bak"
+
+    FileUtils.cp @file1_name, @tmp1_name
+    FileUtils.cp @file2_name, @tmp2_name
+
+    method = "ARGF.send(#{@method.inspect})"
+    @code = "begin while line = #{method} do puts 'x' end rescue EOFError; end"
+  end
+
+  after :each do
+    File.delete @tmp1_name if File.exists? @tmp1_name
+    File.delete @tmp2_name if File.exists? @tmp2_name
+
+    File.delete @tmp1_name_bak if File.exists? @tmp1_name_bak
+    File.delete @tmp2_name_bak if File.exists? @tmp2_name_bak
+  end
+
+  it "modifies the files when in place edit mode is on" do
+    ruby_exe(@code,
+             :options => "-i",
+             :args => "#{@tmp1_name} #{@tmp2_name}")
+
+    File.read(@tmp1_name).should == "x\nx\n"
+    File.read(@tmp2_name).should == "x\nx\n"
+  end
+
+  it "modifies and backups two files when in place edit mode is on" do
+    ruby_exe(@code,
+             :options => "-i.bak",
+             :args => "#{@tmp1_name} #{@tmp2_name}")
+
+    File.read(@tmp1_name).should == "x\nx\n"
+    File.read(@tmp2_name).should == "x\nx\n"
+
+    File.read(@tmp1_name_bak).should == "file1.1\nfile1.2\n"
+    File.read(@tmp2_name_bak).should == "line2.1\nline2.2\n"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/shared/pos.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/shared/pos.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/shared/pos.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+describe :argf_pos, :shared => true do
+  before :each do
+    @file1 = fixture __FILE__, "file1.txt"
+    @file2 = fixture __FILE__, "file2.txt"
+  end
+
+  after :each do
+    ARGF.close
+  end
+
+  it "gives the correct position for each read operation" do
+    argv [@file1, @file2] do
+      size1 = File.size(@file1)
+      size2 = File.size(@file2)
+
+      ARGF.read(2)
+      ARGF.send(@method).should == 2
+      ARGF.read(size1-2)
+      ARGF.send(@method).should == size1
+      ARGF.read(6)
+      ARGF.send(@method).should == 6
+      ARGF.rewind
+      ARGF.send(@method).should == 0
+      ARGF.read(size2)
+      ARGF.send(@method).should == size2
+    end
+  end
+
+  it "raises an ArgumentError when called on a closed stream" do
+    argv [@file1] do
+      ARGF.read
+      lambda { ARGF.send(@method) }.should raise_error(ArgumentError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/shared/readlines.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/shared/readlines.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/shared/readlines.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+describe :argf_readlines, :shared => true do
+  before :each do
+    @file1 = fixture __FILE__, "file1.txt"
+    @file2 = fixture __FILE__, "file2.txt"
+
+    @lines  = File.readlines(@file1)
+    @lines += File.readlines(@file2)
+  end
+
+  after :each do
+    ARGF.close
+  end
+
+  it "reads all lines of all files" do
+    argv [@file1, @file2] do
+      ARGF.send(@method).should == @lines
+    end
+  end
+
+  it "returns nil when end of stream reached" do
+    argv [@file1, @file2] do
+      ARGF.read
+      ARGF.send(@method).should == nil
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/skip_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/skip_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/skip_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,39 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ARGF.skip" do
+  before :each do
+    @file1_name = fixture __FILE__, "file1.txt"
+    @file2_name = fixture __FILE__, "file2.txt"
+
+    @file2 = File.readlines @file2_name
+  end
+
+  after :each do
+    ARGF.close
+  end
+
+  it "skips the current file" do
+    argv [@file1_name, @file2_name] do
+      ARGF.read(1)
+      ARGF.skip
+      ARGF.gets.should == @file2.first
+    end
+  end
+
+  it "has no effect when called twice in a row" do
+    argv [@file1_name, @file2_name] do
+      ARGF.read(1)
+      ARGF.skip
+      ARGF.skip
+      ARGF.gets.should == @file2.first
+    end
+  end
+
+  it "has no effect at end of stream" do
+    argv [@file1_name, @file2_name] do
+      ARGF.read
+      ARGF.skip
+      ARGF.gets.should == nil
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/tell_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/tell_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/tell_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/pos'
+
+describe "ARGF.tell" do
+  it_behaves_like :argf_pos, :tell
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/to_a_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/to_a_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/to_a_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/readlines'
+
+describe "ARGF.to_a" do
+  it_behaves_like :argf_readlines, :to_a
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/to_i_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/to_i_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/to_i_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/fileno'
+
+describe "ARGF.to_i" do
+  it_behaves_like :argf_fileno, :to_i
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/to_io_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/to_io_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/to_io_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ARGF.to_io" do
+  before :each do
+    @file1= fixture __FILE__, "file1.txt"
+    @file2= fixture __FILE__, "file2.txt"
+  end
+
+  after :each do
+    ARGF.close
+  end
+
+  # NOTE: this test assumes that fixtures files have two lines each
+  it "returns the IO of the current file" do
+    argv [@file1, @file2] do
+      result = []
+      4.times do
+        ARGF.gets
+        result << ARGF.to_io
+      end
+
+      result.each { |io| io.should be_kind_of(IO) }
+      result[0].should == result[1]
+      result[2].should == result[3]
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/argf/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/argf/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/argf/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ARGF.to_s" do
+  before :each do
+    @file1 = fixture __FILE__, "file1.txt"
+    @file2 = fixture __FILE__, "file2.txt"
+  end
+
+  after :each do
+    ARGF.close
+  end
+
+  it "returns 'ARGF'" do
+    argv [@file1, @file2] do
+      ARGF.to_s.should == "ARGF"
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/allocate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/allocate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/allocate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Array.allocate" do
+  it "returns an instance of Array" do
+    ary = Array.allocate
+    ary.should be_kind_of(Array)
+  end
+  
+  it "returns a fully-formed instance of Array" do
+    ary = Array.allocate
+    ary.size.should == 0
+    ary << 1
+    ary.should == [1]
+  end
+  
+  it "does not accept any arguments" do
+    lambda { Array.allocate(1) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/append_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/append_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/append_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,43 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#<<" do
+  it "pushes the object onto the end of the array" do
+    ([ 1, 2 ] << "c" << "d" << [ 3, 4 ]).should == [1, 2, "c", "d", [3, 4]]
+  end
+
+  it "returns self to allow chaining" do
+    a = []
+    b = a
+    (a << 1).should equal(b)
+    (a << 2 << 3).should equal(b)
+  end
+
+  it "correctly resizes the Array" do
+    a = []
+    a.size.should == 0
+    a << :foo
+    a.size.should == 1
+    a << :bar << :baz
+    a.size.should == 3
+
+    a = [1, 2, 3]
+    a.shift
+    a.shift
+    a.shift
+    a << :foo
+    a.should == [:foo]
+  end
+
+  ruby_version_is '' ... '1.9' do
+    it "raises a TypeError on a frozen array" do
+      lambda { ArraySpecs.frozen_array << 5 }.should raise_error(TypeError)
+    end
+  end
+
+  ruby_version_is '1.9' do
+    it "raises a RuntimeError on a frozen array" do
+      lambda { ArraySpecs.frozen_array << 5 }.should raise_error(RuntimeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/array_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/array_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/array_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Array" do
+  it "includes Enumerable" do
+    Array.ancestors.include?(Enumerable).should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/assoc_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/assoc_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/assoc_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,40 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#assoc" do
+  it "returns the first array whose 1st item is == obj or nil" do
+    s1 = ["colors", "red", "blue", "green"] 
+    s2 = [:letters, "a", "b", "c"]
+    s3 = [4]
+    s4 = ["colors", "cyan", "yellow", "magenda"]
+    s5 = [:letters, "a", "i", "u"]
+    s_nil = [nil, nil]
+    a = [s1, s2, s3, s4, s5, s_nil]
+    a.assoc(s1.first).should equal(s1)
+    a.assoc(s2.first).should equal(s2)
+    a.assoc(s3.first).should equal(s3)
+    a.assoc(s4.first).should equal(s1)
+    a.assoc(s5.first).should equal(s2)
+    a.assoc(s_nil.first).should equal(s_nil)
+    a.assoc(4).should equal(s3)
+    a.assoc("key not in array").should be_nil
+  end
+
+  it "calls == on first element of each array" do
+    key1 = 'it'
+    key2 = mock('key2')
+    items = [['not it', 1], [ArraySpecs::AssocKey.new, 2], ['na', 3]]
+
+    items.assoc(key1).should equal(items[1])
+    items.assoc(key2).should be_nil
+  end
+  
+  it "ignores any non-Array elements" do
+    [1, 2, 3].assoc(2).should be_nil
+    s1 = [4]
+    s2 = [5, 4, 3]
+    a = ["foo", [], s1, s2, nil, []] 
+    a.assoc(s1.first).should equal(s1)
+    a.assoc(s2.first).should equal(s2)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/at_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/at_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/at_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,56 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#at" do
+  it "returns the (n+1)'th element for the passed index n" do
+    a = [1, 2, 3, 4, 5, 6]
+    a.at(0).should == 1
+    a.at(1).should == 2
+    a.at(5).should == 6
+  end
+  
+  it "returns nil if the given index is greater than or equal to the array's length" do
+    a = [1, 2, 3, 4, 5, 6]
+    a.at(6).should == nil
+    a.at(7).should == nil
+  end
+
+  it "returns the (-n)'th elemet from the last, for the given negative index n" do
+    a = [1, 2, 3, 4, 5, 6]
+    a.at(-1).should == 6
+    a.at(-2).should == 5
+    a.at(-6).should == 1
+  end
+
+  it "returns nil if the given index is less than -len, where len is length of the array"  do
+    a = [1, 2, 3, 4, 5, 6]
+    a.at(-7).should == nil
+    a.at(-8).should == nil
+  end
+
+  it "does not extend the array unless the given index is out of range" do
+    a = [1, 2, 3, 4, 5, 6]
+    a.length.should == 6
+    a.at(100)
+    a.length.should == 6
+    a.at(-100)
+    a.length.should == 6
+  end
+
+  it "tries to convert the passed argument to an Integer using #to_int" do
+    a = ["a", "b", "c"]
+    a.at(0.5).should == "a"
+  
+    obj = mock('to_int')
+    obj.should_receive(:to_int).and_return(2)
+    a.at(obj).should == "c"
+  end
+  
+  it "raises a TypeError when the passed argument can't be coerced to Integer" do
+    lambda { [].at("cat") }.should raise_error(TypeError)
+  end
+
+  it "raises an ArgumentError when 2 or more arguments is passed" do
+    lambda { [:a, :b].at(0,1) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/clear_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/clear_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/clear_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,61 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#clear" do
+  it "removes all elements" do
+    a = [1, 2, 3, 4]
+    a.clear.should equal(a)
+    a.should == []
+  end
+
+  it "returns self" do
+    a = [1]
+    oid = a.object_id
+    a.clear.object_id.should == oid
+  end
+
+  it "leaves the Array empty" do
+    a = [1]
+    a.clear
+    a.empty?.should == true
+    a.size.should == 0
+  end
+
+  it "keeps tainted status" do
+    a = [1]
+    a.taint
+    a.tainted?.should be_true
+    a.clear
+    a.tainted?.should be_true
+  end
+  
+  it "does not accept any arguments" do
+    lambda { [1].clear(true) }.should raise_error(ArgumentError)
+  end
+
+  ruby_version_is '1.9' do
+    it "keeps untrusted status" do
+      a = [1]
+      a.untrust
+      a.untrusted?.should be_true
+      a.clear
+      a.untrusted?.should be_true
+    end
+  end
+
+  ruby_version_is '' ... '1.9' do
+    it "raises a TypeError on a frozen array" do
+      a = [1]
+      a.freeze
+      lambda { a.clear }.should raise_error(TypeError)
+    end
+  end
+
+  ruby_version_is '1.9' do
+    it "raises a RuntimeError on a frozen array" do
+      a = [1]
+      a.freeze
+      lambda { a.clear }.should raise_error(RuntimeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/clone_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/clone_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/clone_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/clone'
+
+describe "Array#clone" do
+  it_behaves_like :array_clone, :clone
+
+  it "copies frozen status from the original" do
+    a = [1, 2, 3, 4]
+    b = [1, 2, 3, 4]
+    a.freeze
+    aa = a.clone
+    bb = b.clone
+
+    aa.frozen?.should == true
+    bb.frozen?.should == false
+  end
+
+  it "copies singleton methods" do
+    a = [1, 2, 3, 4]
+    b = [1, 2, 3, 4]
+    def a.a_singleton_method; end
+    aa = a.clone
+    bb = b.clone
+
+    a.respond_to?(:a_singleton_method).should be_true
+    b.respond_to?(:a_singleton_method).should be_false
+    aa.respond_to?(:a_singleton_method).should be_true
+    bb.respond_to?(:a_singleton_method).should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/collect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/collect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/collect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/collect'
+
+describe "Array#collect" do
+  it_behaves_like(:array_collect, :collect)
+end
+
+describe "Array#collect!" do
+  it_behaves_like(:array_collect_b, :collect!)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/compact_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/compact_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/compact_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,89 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#compact" do
+  it "returns a copy of array with all nil elements removed" do
+    a = [1, 2, 4]
+    a.compact.should == [1, 2, 4]
+    a = [1, nil, 2, 4]
+    a.compact.should == [1, 2, 4]
+    a = [1, 2, 4, nil]
+    a.compact.should == [1, 2, 4]
+    a = [nil, 1, 2, 4]
+    a.compact.should == [1, 2, 4]
+  end
+
+  it "does not return self" do
+    a = [1, 2, 3]
+    a.compact.should_not equal(a)
+  end
+
+  it "returns subclass instance for Array subclasses" do
+    ArraySpecs::MyArray[1, 2, 3, nil].compact.class.should == ArraySpecs::MyArray
+  end
+
+  it "keeps tainted status even if all elements are removed" do
+    a = [nil, nil]
+    a.taint
+    a.compact.tainted?.should be_true
+  end
+
+  ruby_version_is '1.9' do
+    it "keeps untrusted status even if all elements are removed" do
+      a = [nil, nil]
+      a.untrust
+      a.compact.untrusted?.should be_true
+    end
+  end
+end
+
+describe "Array#compact!" do
+  it "removes all nil elements" do
+    a = ['a', nil, 'b', false, 'c']
+    a.compact!.should equal(a)
+    a.should == ["a", "b", false, "c"]
+    a = [nil, 'a', 'b', false, 'c']
+    a.compact!.should equal(a)
+    a.should == ["a", "b", false, "c"]
+    a = ['a', 'b', false, 'c', nil]
+    a.compact!.should equal(a)
+    a.should == ["a", "b", false, "c"]
+  end
+
+  it "returns self if some nil elements are removed" do
+    a = ['a', nil, 'b', false, 'c']
+    a.compact!.object_id.should == a.object_id
+  end
+
+  it "returns nil if there are no nil elements to remove" do
+    [1, 2, false, 3].compact!.should == nil
+  end
+
+  it "keeps tainted status even if all elements are removed" do
+    a = [nil, nil]
+    a.taint
+    a.compact!
+    a.tainted?.should be_true
+  end
+
+  ruby_version_is '1.9' do
+    it "keeps untrusted status even if all elements are removed" do
+      a = [nil, nil]
+      a.untrust
+      a.compact!
+      a.untrusted?.should be_true
+    end
+  end
+
+  ruby_version_is '' ... '1.9' do
+    it "raises a TypeError on a frozen array" do
+      lambda { ArraySpecs.frozen_array.compact! }.should raise_error(TypeError)
+    end
+  end
+
+  ruby_version_is '1.9' do
+    it "raises a RuntimeError on a frozen array" do
+      lambda { ArraySpecs.frozen_array.compact! }.should raise_error(RuntimeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/comparison_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/comparison_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/comparison_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,95 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#<=>" do
+  it "calls <=> left to right and return first non-0 result" do
+    [-1, +1, nil, "foobar"].each do |result|
+      lhs = Array.new(3) { mock("#{result}") }
+      rhs = Array.new(3) { mock("#{result}") }
+    
+      lhs[0].should_receive(:<=>).with(rhs[0]).and_return(0)
+      lhs[1].should_receive(:<=>).with(rhs[1]).and_return(result)
+      lhs[2].should_not_receive(:<=>)
+
+      (lhs <=> rhs).should == result
+    end
+  end
+  
+  it "returns 0 if the arrays are equal" do
+    ([] <=> []).should == 0
+    ([1, 2, 3, 4, 5, 6] <=> [1, 2, 3, 4, 5.0, 6.0]).should == 0
+  end
+  
+  it "returns -1 if the array is shorter than the other array" do
+    ([] <=> [1]).should == -1
+    ([1, 1] <=> [1, 1, 1]).should == -1
+  end
+
+  it "returns +1 if the array is longer than the other array" do
+    ([1] <=> []).should == +1
+    ([1, 1, 1] <=> [1, 1]).should == +1
+  end
+
+  it "returns -1 if the arrays have same length and a pair of corresponding elements returns -1 for <=>" do
+    eq_l = mock('an object equal to the other')
+    eq_r = mock('an object equal to the other')
+    eq_l.should_receive(:<=>).with(eq_r).any_number_of_times.and_return(0)
+
+    less = mock('less than the other')
+    greater = mock('greater then the other')
+    less.should_receive(:<=>).with(greater).any_number_of_times.and_return(-1)
+
+    rest = mock('an rest element of the arrays')
+    rest.should_receive(:<=>).with(rest).any_number_of_times.and_return(0)
+    lhs = [eq_l, eq_l, less, rest]
+    rhs = [eq_r, eq_r, greater, rest]
+
+    (lhs <=> rhs).should == -1
+  end
+
+  it "returns +1 if the arrays have same length and a pair of corresponding elements returns +1 for <=>" do
+    eq_l = mock('an object equal to the other')
+    eq_r = mock('an object equal to the other')
+    eq_l.should_receive(:<=>).with(eq_r).any_number_of_times.and_return(0)
+
+    greater = mock('greater then the other')
+    less = mock('less than the other')
+    greater.should_receive(:<=>).with(less).any_number_of_times.and_return(+1)
+
+    rest = mock('an rest element of the arrays')
+    rest.should_receive(:<=>).with(rest).any_number_of_times.and_return(0)
+    lhs = [eq_l, eq_l, greater, rest]
+    rhs = [eq_r, eq_r, less, rest]
+
+    (lhs <=> rhs).should == +1
+  end
+
+  ruby_bug "#", "1.8.6.277" do
+    it "properly handles recursive arrays" do
+      empty = ArraySpecs.empty_recursive_array
+      (empty <=> empty).should == 0
+      (empty <=> []).should == 1
+      ([] <=> empty).should == -1
+
+      (ArraySpecs.recursive_array <=> []).should == 1
+      ([] <=> ArraySpecs.recursive_array).should == -1
+
+      (ArraySpecs.recursive_array <=> ArraySpecs.empty_recursive_array).should == nil
+
+      array = ArraySpecs.recursive_array
+      (array <=> array).should == 0
+    end
+  end
+
+  it "tries to convert the passed argument to an Array using #to_ary" do
+    obj = mock('to_ary')
+    obj.stub!(:to_ary).and_return([1, 2, 3])
+    ([4, 5] <=> obj).should == ([4, 5] <=> obj.to_ary)
+  end
+
+  it "does not call #to_ary on Array subclasses" do
+    obj = ArraySpecs::ToAryArray[5, 6, 7]
+    obj.should_not_receive(:to_ary)
+    ([5, 6, 7] <=> obj).should == 0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/concat_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/concat_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/concat_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,108 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#concat" do
+  it "returns the array itself" do
+    ary = [1,2,3]
+    ary.concat([4,5,6]).equal?(ary).should be_true
+  end
+
+  it "appends the elements in the other array" do
+    ary = [1, 2, 3]
+    ary.concat([9, 10, 11]).should equal(ary)
+    ary.should == [1, 2, 3, 9, 10, 11]
+    ary.concat([])
+    ary.should == [1, 2, 3, 9, 10, 11]
+  end
+
+  it "does not loop endlessly when argument is self" do
+    ary = ["x", "y"]
+    ary.concat(ary).should == ["x", "y", "x", "y"]
+  end
+
+  it "tries to convert the passed argument to an Array using #to_ary" do
+    obj = mock('to_ary')
+    obj.should_receive(:to_ary).and_return(["x", "y"])
+    [4, 5, 6].concat(obj).should == [4, 5, 6, "x", "y"]
+  end
+
+  it "does not call #to_ary on Array subclasses" do
+    obj = ArraySpecs::ToAryArray[5, 6, 7]
+    obj.should_not_receive(:to_ary)
+    [].concat(obj).should == [5, 6, 7]
+  end
+
+  ruby_version_is '' ... '1.9' do
+    it "raises a TypeError when Array is frozen and modification occurs" do
+      lambda { ArraySpecs.frozen_array.concat [1] }.should raise_error(TypeError)
+    end
+  end
+
+  ruby_version_is '1.9' do
+    it "raises a RuntimeError when Array is frozen and modification occurs" do
+      lambda { ArraySpecs.frozen_array.concat [1] }.should raise_error(RuntimeError)
+    end
+  end
+
+  it "does not raise a TypeError when Array is frozen but no modification occurs" do
+    ArraySpecs.frozen_array.concat([]).should == [1, 2, 3]
+  end
+
+  it "keeps tainted status" do
+    ary = [1, 2]
+    ary.taint
+    ary.concat([3])
+    ary.tainted?.should be_true
+    ary.concat([])
+    ary.tainted?.should be_true
+  end
+
+  it "is not infected by the other" do
+    ary = [1,2]
+    other = [3]; other.taint
+    ary.tainted?.should be_false
+    ary.concat(other)
+    ary.tainted?.should be_false
+  end
+
+  it "keeps the tainted status of elements" do
+    ary = [ Object.new, Object.new, Object.new ]
+    ary.each {|x| x.taint }
+
+    ary.concat([ Object.new ])
+    ary[0].tainted?.should be_true
+    ary[1].tainted?.should be_true
+    ary[2].tainted?.should be_true
+    ary[3].tainted?.should be_false
+  end
+
+  ruby_version_is '1.9' do
+    it "keeps untrusted status" do
+      ary = [1, 2]
+      ary.untrust
+      ary.concat([3])
+      ary.untrusted?.should be_true
+      ary.concat([])
+      ary.untrusted?.should be_true
+    end
+
+    it "is not infected untrustedness by the other" do
+      ary = [1,2]
+      other = [3]; other.untrust
+      ary.untrusted?.should be_false
+      ary.concat(other)
+      ary.untrusted?.should be_false
+    end
+
+    it "keeps the untrusted status of elements" do
+      ary = [ Object.new, Object.new, Object.new ]
+      ary.each {|x| x.untrust }
+
+      ary.concat([ Object.new ])
+      ary[0].untrusted?.should be_true
+      ary[1].untrusted?.should be_true
+      ary[2].untrusted?.should be_true
+      ary[3].untrusted?.should be_false
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/constructor_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/constructor_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/constructor_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array.[]" do
+  it "returns a new array populated with the given elements" do
+    obj = Object.new
+    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.inspect.should == [5, true, nil, "a", "Ruby", obj].inspect
+  end
+end
+
+describe "Array[]" do
+  it "is a synonym for .[]" do
+    obj = Object.new
+    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.inspect.should == [5, true, nil, "a", "Ruby", obj].inspect
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/delete_at_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/delete_at_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/delete_at_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,71 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#delete_at" do
+  it "removes the element at the specified index" do
+    a = [1, 2, 3, 4]
+    a.delete_at(2)
+    a.should == [1, 2, 4]
+    a.delete_at(-1)
+    a.should == [1, 2]
+  end
+
+  it "returns the removed element at the specified index" do
+    a = [1, 2, 3, 4]
+    a.delete_at(2).should == 3
+    a.delete_at(-1).should == 4
+  end
+
+  it "returns nil and makes no modification if the index is out of range" do
+    a = [1, 2]
+    a.delete_at(3).should == nil
+    a.should == [1, 2]
+    a.delete_at(-3).should == nil
+    a.should == [1, 2]
+  end
+
+  it "tries to convert the passed argument to an Integer using #to_int" do
+    obj = mock('to_int')
+    obj.should_receive(:to_int).and_return(-1)
+    [1, 2].delete_at(obj).should == 2
+  end
+
+  it "accepts negative indices" do
+    a = [1, 2]
+    a.delete_at(-2).should == 1
+  end
+
+  ruby_version_is '' ... '1.9' do
+    it "raises a TypeError on a frozen array" do
+      lambda { [1,2,3].freeze.delete_at(0) }.should raise_error(TypeError)
+    end
+  end
+
+  ruby_version_is '1.9' do
+    it "raises a RuntimeError on a frozen array" do
+      lambda { [1,2,3].freeze.delete_at(0) }.should raise_error(RuntimeError)
+    end
+  end
+
+  it "keeps tainted status" do
+    ary = [1, 2]
+    ary.taint
+    ary.tainted?.should be_true
+    ary.delete_at(0)
+    ary.tainted?.should be_true
+    ary.delete_at(0) # now empty
+    ary.tainted?.should be_true
+  end
+
+  ruby_version_is '1.9' do
+    it "keeps untrusted status" do
+      ary = [1, 2]
+      ary.untrust
+      ary.untrusted?.should be_true
+      ary.delete_at(0)
+      ary.untrusted?.should be_true
+      ary.delete_at(0) # now empty
+      ary.untrusted?.should be_true
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/delete_if_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/delete_if_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/delete_if_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,72 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#delete_if" do
+  before do
+    @a = [ "a", "b", "c" ]
+  end
+
+  it "removes each element for which block returns true" do
+    @a = [ "a", "b", "c" ]
+    @a.delete_if { |x| x >= "b" }
+    @a.should == ["a"]
+  end
+
+  it "returns self" do
+    @a.delete_if{ true }.equal?(@a).should be_true
+  end
+
+  ruby_version_is "" ... "1.8.7" do
+    it "raises a LocalJumpError if no block given" do
+      lambda { @a.delete_if }.should raise_error(LocalJumpError)
+    end
+  end
+
+  ruby_version_is "1.8.7" ... "1.9" do
+    it "returns an Enumerable::Enumerator if no block given, and the enumerator can modify the original array" do
+      enum = @a.delete_if
+      enum.should be_kind_of(Enumerable::Enumerator)
+      @a.should_not be_empty
+      enum.each { true }
+      @a.should be_empty
+    end
+  end
+
+  ruby_version_is '1.9' do
+    it "returns an Enumerator if no block given, and the enumerator can modify the original array" do
+      enum = @a.delete_if
+      enum.should be_kind_of(Enumerator)
+      @a.should_not be_empty
+      enum.each { true }
+      @a.should be_empty
+    end
+  end
+
+  ruby_version_is '' ... '1.9' do
+    it "raises a TypeError on a frozen array" do
+      lambda { ArraySpecs.frozen_array.delete_if {} }.should raise_error(TypeError)
+    end
+  end
+
+  ruby_version_is '1.9' do
+    it "raises a RuntimeError on a frozen array" do
+      lambda { ArraySpecs.frozen_array.delete_if {} }.should raise_error(RuntimeError)
+    end
+  end
+
+  it "keeps tainted status" do
+    @a.taint
+    @a.tainted?.should be_true
+    @a.delete_if{ true }
+    @a.tainted?.should be_true
+  end
+
+  ruby_version_is '1.9' do
+    it "keeps untrusted status" do
+      @a.untrust
+      @a.untrusted?.should be_true
+      @a.delete_if{ true }
+      @a.untrusted?.should be_true
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/delete_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/delete_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/delete_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,70 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#delete" do
+  it "removes elements that are #== to object" do
+    x = mock('delete')
+    def x.==(other) 3 == other end
+
+    a = [1, 2, 3, x, 4, 3, 5, x]
+    a.delete mock('not contained')
+    a.should == [1, 2, 3, x, 4, 3, 5, x]
+
+    a.delete 3
+    a.should == [1, 2, 4, 5]
+  end
+
+  it "calculates equality correctly for reference values" do
+    a = ["foo", "bar", "foo", "quux", "foo"]
+    a.delete "foo"
+    a.should == ["bar","quux"]
+  end
+
+  it "returns object or nil if no elements match object" do
+    [1, 2, 4, 5].delete(1).should == 1
+    [1, 2, 4, 5].delete(3).should == nil
+  end
+
+  it "may be given a block that is executed if no element matches object" do
+    [1].delete(1) {:not_found}.should == 1
+    [].delete('a') {:not_found}.should == :not_found
+  end
+
+  ruby_version_is '' ... '1.9' do
+    it "raises a TypeError on a frozen array if a modification would take place" do
+      lambda { [1, 2, 3].freeze.delete(1) }.should raise_error(TypeError)
+    end
+  end
+
+  ruby_version_is '1.9' do
+    it "raises a RuntimeError on a frozen array if a modification would take place" do
+      lambda { [1, 2, 3].freeze.delete(1) }.should raise_error(RuntimeError)
+    end
+  end
+
+  it "returns false on a frozen array if a modification does not take place" do
+    [1, 2, 3].freeze.delete(0).should == nil
+  end
+
+  it "keeps tainted status" do
+    a = [1, 2]
+    a.taint
+    a.tainted?.should be_true
+    a.delete(2)
+    a.tainted?.should be_true
+    a.delete(1) # now empty
+    a.tainted?.should be_true
+  end
+
+  ruby_version_is '1.9' do
+    it "keeps untrusted status" do
+      a = [1, 2]
+      a.untrust
+      a.untrusted?.should be_true
+      a.delete(2)
+      a.untrusted?.should be_true
+      a.delete(1) # now empty
+      a.untrusted?.should be_true
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/dup_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/dup_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/dup_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/clone'
+
+describe "Array#dup" do
+  it_behaves_like :array_clone, :dup # FIX: no, clone and dup are not alike
+
+  it "does not copy frozen status from the original" do
+    a = [1, 2, 3, 4]
+    b = [1, 2, 3, 4]
+    a.freeze
+    aa = a.dup
+    bb = b.dup
+
+    aa.frozen?.should be_false
+    bb.frozen?.should be_false
+  end
+
+  it "does not copy singleton methods" do
+    a = [1, 2, 3, 4]
+    b = [1, 2, 3, 4]
+    def a.a_singleton_method; end
+    aa = a.dup
+    bb = b.dup
+
+    a.respond_to?(:a_singleton_method).should be_true
+    b.respond_to?(:a_singleton_method).should be_false
+    aa.respond_to?(:a_singleton_method).should be_false
+    bb.respond_to?(:a_singleton_method).should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/each_index_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/each_index_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/each_index_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,46 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#each_index" do
+  it "passes the index of each element to the block" do
+    a = []
+    x = ['a', 'b', 'c', 'd']
+    x.each_index { |i| a << i }.should equal(x)
+    a.should == [0, 1, 2, 3]
+  end
+
+  it "passes the index of each element to the block even if the array is changed during iteration" do
+    a = []
+    x = [10, 11, 12, 13,]
+    x.each_index {|i| a << i; x << x[i]+5 if (x[i]%2).zero? }.should equal(x)
+    a.should == [0, 1, 2, 3, 4, 5]
+  end
+
+  it "passes the index from 0..size even if size changes" do
+    a = []
+    x = [10, 11, 12, 13, 14]
+    x.each_index {|i| a << i; x.pop if (x[i]%2).zero? }.should equal(x)
+    a.should == [0, 1, 2]
+
+    a = []
+    x = [10, 11, 12, 13, 14]
+    x.each_index {|i| a << i; x.shift if (x[i]%2).zero? }.should equal(x)
+    a.should == [0, 1, 2]
+  end
+
+  ruby_version_is '' ... '1.8.7' do
+    it 'raises a LocalJumpError if no block given' do
+      lambda{ [1,2].each_index }.should raise_error(LocalJumpError)
+    end
+  end
+  ruby_version_is '1.8.7' ... '1.9' do
+    it 'returns an Enumerable::Enumerator if no block given' do
+      [1,2].each_index.should be_kind_of(Enumerable::Enumerator)
+    end
+  end
+  ruby_version_is '1.9' do
+    it 'returns an Enumerator if no block given' do
+      [1,2].each_index.should be_kind_of(Enumerator)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/each_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/each_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/each_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,60 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#each" do
+  it "yields each element to the block" do
+    a = []
+    x = [1, 2, 3]
+    x.each { |item| a << item }.should equal(x)
+    a.should == [1, 2, 3]
+  end
+
+  it "yields each element to the block even if the array is changed during iteration" do
+    a = [1, 2, 3, 4, 5]
+    b = []
+    a.each {|x| b << x; a << x+5 if (x%2).zero? }
+    b.should == [1, 2, 3, 4, 5, 7, 9]
+  end
+
+  it "yields only elements that are still in the array" do
+    a = [0, 1, 2, 3, 4]
+    b = []
+    a.each {|x| b << x; a.pop if (x%2).zero? }
+    b.should == [0, 1, 2]
+  end
+
+  it "yields elements based on an internal index" do
+    a = [0, 1, 2, 3, 4]
+    b = []
+    a.each {|x| b << x; a.shift if (x%2).zero? }
+    b.should == [0, 2, 4]
+  end
+
+  it "yields each element to a block that takes multiple arguments" do
+    a = [[1, 2], :a, [3, 4]]
+    b = []
+
+    a.each { |x, y| b << x }
+    b.should == [1, :a, 3]
+
+    b = []
+    a.each { |x, y| b << y }
+    b.should == [2, nil, 4]
+  end
+
+  ruby_version_is '' ... '1.8.7' do
+    it 'raises a LocalJumpError if no block given' do
+      lambda{ [1,2].each }.should raise_error(LocalJumpError)
+    end
+  end
+  ruby_version_is '1.8.7' ... '1.9' do
+    it 'returns an Enumerable::Enumerator if no block given' do
+      [1,2].each.should be_kind_of(Enumerable::Enumerator)
+    end
+  end
+  ruby_version_is '1.9' do
+    it 'returns an Enumerator if no block given' do
+      [1,2].each.should be_kind_of(Enumerator)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/element_reference_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/element_reference_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/element_reference_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,44 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/slice'
+
+describe "Array#[]" do
+  it_behaves_like(:array_slice, :[])
+end
+
+describe "Array.[]" do
+  it "[] should return a new array populated with the given elements" do
+    array = Array[1, 'a', nil]
+    array[0].should == 1
+    array[1].should == 'a'
+    array[2].should == nil
+  end
+
+  it "when applied to a literal nested array, unpacks its elements into the containing array" do
+    Array[1, 2, *[3, 4, 5]].should == [1, 2, 3, 4, 5]
+  end
+
+  it "when applied to a nested referenced array, unpacks its elements into the containing array" do
+    splatted_array = Array[3, 4, 5]
+    Array[1, 2, *splatted_array].should == [1, 2, 3, 4, 5]
+  end
+
+  ruby_version_is '1.9' do
+    it 'can unpack 2 or more nested referenced array' do
+      splatted_array = Array[3, 4, 5]
+      splatted_array2 = Array[6, 7, 8]
+      eval("Array[1, 2, *splatted_array, *splatted_array2]").should == [1, 2, 3, 4, 5, 6, 7, 8]
+    end
+
+    it 'constructs a nested Hash for tailing key-value pairs' do
+      eval(<<-EOS).should == [1, 2, { 3=> 4, 5 => 6 }]
+        Array[1, 2, 3 => 4, 5 => 6]
+      EOS
+    end
+  end
+  
+  it "returns an instance of the subtype when called on an Array subclass" do
+    ArraySub = Class.new Array
+    ArraySub[1,2].class.should == ArraySub
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/element_set_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/element_set_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/element_set_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,482 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#[]=" do
+  it "sets the value of the element at index" do
+    a = [1, 2, 3, 4]
+    a[2] = 5
+    a[-1] = 6
+    a[5] = 3
+    a.should == [1, 2, 5, 6, nil, 3]
+
+    a = []
+    a[4] = "e"
+    a.should == [nil, nil, nil, nil, "e"]
+    a[3] = "d"
+    a.should == [nil, nil, nil, "d", "e"]
+    a[0] = "a"
+    a.should == ["a", nil, nil, "d", "e"]
+    a[-3] = "C"
+    a.should == ["a", nil, "C", "d", "e"]
+    a[-1] = "E"
+    a.should == ["a", nil, "C", "d", "E"]
+    a[-5] = "A"
+    a.should == ["A", nil, "C", "d", "E"]
+    a[5] = "f"
+    a.should == ["A", nil, "C", "d", "E", "f"]
+    a[1] = []
+    a.should == ["A", [], "C", "d", "E", "f"]
+    a[-1] = nil
+    a.should == ["A", [], "C", "d", "E", nil]
+  end
+
+  it "sets the section defined by [start,length] to other" do
+    a = [1, 2, 3, 4, 5, 6]
+    a[0, 1] = 2
+    a[3, 2] = ['a', 'b', 'c', 'd']
+    a.should == [2, 2, 3, "a", "b", "c", "d", 6]
+  end
+  it "replaces the section defined by [start,length] with the given values" do
+    a = [1, 2, 3, 4, 5, 6]
+    a[3, 2] = 'a', 'b', 'c', 'd'
+    a.should == [1, 2, 3, "a", "b", "c", "d", 6]
+  end
+
+  ruby_version_is '' ... '1.9' do
+    it "removes the section defined by [start,length] when set to nil" do
+      a = ['a', 'b', 'c', 'd', 'e']
+      a[1, 3] = nil
+      a.should == ["a", "e"]
+    end
+  end
+  ruby_version_is '1.9' do
+    it "just sets the section defined by [start,length] to other even if other is nil" do
+      a = ['a', 'b', 'c', 'd', 'e']
+      a[1, 3] = nil
+      a.should == ["a", nil, "e"]
+    end
+  end
+  it "returns nil if the rhs is nil" do
+    a = [1, 2, 3]
+    (a[1, 3] = nil).should == nil
+    (a[1..3] = nil).should == nil
+  end
+
+  it "sets the section defined by range to other" do
+    a = [6, 5, 4, 3, 2, 1]
+    a[1...2] = 9
+    a[3..6] = [6, 6, 6]
+    a.should == [6, 9, 4, 6, 6, 6]
+  end
+
+  it "replaces the section defined by range with the given values" do
+    a = [6, 5, 4, 3, 2, 1]
+    a[3..6] = :a, :b, :c
+    a.should == [6, 5, 4, :a, :b, :c]
+  end
+
+  ruby_version_is '' ... '1.9' do
+    it "removes the section defined by range when set to nil" do
+      a = [1, 2, 3, 4, 5]
+      a[0..1] = nil
+      a.should == [3, 4, 5]
+    end
+    it "just sets the section defined by range to nil when the rhs is [nil]." do
+      a = [1, 2, 3, 4, 5]
+      a[0..1] = [nil]
+      a.should == [nil, 3, 4, 5]
+    end
+  end
+  ruby_version_is '1.9' do
+    it "just sets the section defined by range to other even if other is nil" do
+      a = [1, 2, 3, 4, 5]
+      a[0..1] = nil
+      a.should == [nil, 3, 4, 5]
+    end
+  end
+
+  it "calls to_int on its start and length arguments" do
+    obj = mock('to_int')
+    obj.stub!(:to_int).and_return(2)
+
+    a = [1, 2, 3, 4]
+    a[obj, 0] = [9]
+    a.should == [1, 2, 9, 3, 4]
+    a[obj, obj] = []
+    a.should == [1, 2, 4]
+    a[obj] = -1
+    a.should == [1, 2, -1]
+  end
+
+  it "sets elements in the range arguments when passed ranges" do
+    ary = [1, 2, 3]
+    rhs = [nil, [], ["x"], ["x", "y"]]
+    (0 .. ary.size + 2).each do |a|
+      (a .. ary.size + 3).each do |b|
+        rhs.each do |c|
+          ary1 = ary.dup
+          ary1[a .. b] = c
+          ary2 = ary.dup
+          ary2[a, 1 + b-a] = c
+          ary1.should == ary2
+
+          ary1 = ary.dup
+          ary1[a ... b] = c
+          ary2 = ary.dup
+          ary2[a, b-a] = c
+          ary1.should == ary2
+        end
+      end
+    end
+  end
+
+  it "inserts the given elements with [range] which the range is zero-width" do
+    ary = [1, 2, 3]
+    ary[1...1] = 0
+    ary.should == [1, 0, 2, 3]
+    ary[1...1] = [5]
+    ary.should == [1, 5, 0, 2, 3]
+    ary[1...1] = :a, :b, :c
+    ary.should == [1, :a, :b, :c, 5, 0, 2, 3]
+  end
+
+  it "inserts the given elements with [start, length] which length is zero" do
+    ary = [1, 2, 3]
+    ary[1, 0] = 0
+    ary.should == [1, 0, 2, 3]
+    ary[1, 0] = [5]
+    ary.should == [1, 5, 0, 2, 3]
+    ary[1, 0] = :a, :b, :c
+    ary.should == [1, :a, :b, :c, 5, 0, 2, 3]
+  end
+
+  # Now we only have to test cases where the start, length interface would
+  # have raise an exception because of negative size
+  it "inserts the given elements with [range] which the range has negative width" do
+    ary = [1, 2, 3]
+    ary[1..0] = 0
+    ary.should == [1, 0, 2, 3]
+    ary[1..0] = [4, 3]
+    ary.should == [1, 4, 3, 0, 2, 3]
+    ary[1..0] = :a, :b, :c
+    ary.should == [1, :a, :b, :c, 4, 3, 0, 2, 3]
+  end
+
+  ruby_version_is '' ... '1.9' do
+    it "does nothing if the section defined by range is zero-width and the rhs is nil" do
+      ary = [1, 2, 3]
+      ary[1...1] = nil
+      ary.should == [1, 2, 3]
+    end
+    it "does nothing if the section defined by range has negative width and the rhs is nil" do
+      ary = [1, 2, 3]
+      ary[1..0] = nil
+      ary.should == [1, 2, 3]
+    end
+  end
+  ruby_version_is '1.9' do
+    it "just inserts nil if the section defined by range is zero-width and the rhs is nil" do
+      ary = [1, 2, 3]
+      ary[1...1] = nil
+      ary.should == [1, nil, 2, 3]
+    end
+    it "just inserts nil if the section defined by range has negative width and the rhs is nil" do
+      ary = [1, 2, 3]
+      ary[1..0] = nil
+      ary.should == [1, nil, 2, 3]
+    end
+  end
+
+  it "does nothing if the section defined by range is zero-width and the rhs is an empty array" do
+    ary = [1, 2, 3]
+    ary[1...1] = []
+    ary.should == [1, 2, 3]
+  end
+  it "does nothing if the section defined by range has negative width and the rhs is an empty array" do
+    ary = [1, 2, 3, 4, 5]
+    ary[1...0] = []
+    ary.should == [1, 2, 3, 4, 5]
+    ary[-2..2] = []
+    ary.should == [1, 2, 3, 4, 5]
+  end
+
+  it "tries to convert Range elements to Integers using #to_int with [m..n] and [m...n]" do
+    from = mock('from')
+    to = mock('to')
+
+    # So we can construct a range out of them...
+    def from.<=>(o) 0 end
+    def to.<=>(o) 0 end
+
+    def from.to_int() 1 end
+    def to.to_int() -2 end
+
+    a = [1, 2, 3, 4]
+
+    a[from .. to] = ["a", "b", "c"]
+    a.should == [1, "a", "b", "c", 4]
+
+    a[to .. from] = ["x"]
+    a.should == [1, "a", "b", "x", "c", 4]
+    lambda { a["a" .. "b"] = []  }.should raise_error(TypeError)
+    lambda { a[from .. "b"] = [] }.should raise_error(TypeError)
+  end
+
+  it "raises an IndexError when passed indexes out of bounds" do
+    a = [1, 2, 3, 4]
+    lambda { a[-5] = ""      }.should raise_error(IndexError)
+    lambda { a[-5, -1] = ""  }.should raise_error(IndexError)
+    lambda { a[-5, 0] = ""   }.should raise_error(IndexError)
+    lambda { a[-5, 1] = ""   }.should raise_error(IndexError)
+    lambda { a[-5, 2] = ""   }.should raise_error(IndexError)
+    lambda { a[-5, 10] = ""  }.should raise_error(IndexError)
+
+    lambda { a[-5..-5] = ""  }.should raise_error(RangeError)
+    lambda { a[-5...-5] = "" }.should raise_error(RangeError)
+    lambda { a[-5..-4] = ""  }.should raise_error(RangeError)
+    lambda { a[-5...-4] = "" }.should raise_error(RangeError)
+    lambda { a[-5..10] = ""  }.should raise_error(RangeError)
+    lambda { a[-5...10] = "" }.should raise_error(RangeError)
+
+    # ok
+    a[0..-9] = [1]
+    a.should == [1, 1, 2, 3, 4]
+  end
+
+  it "calls to_ary on its rhs argument for multi-element sets" do
+    obj = mock('to_ary')
+    def obj.to_ary() [1, 2, 3] end
+    ary = [1, 2]
+    ary[0, 0] = obj
+    ary.should == [1, 2, 3, 1, 2]
+    ary[1, 10] = obj
+    ary.should == [1, 1, 2, 3]
+  end
+
+  it "does not call to_ary on rhs array subclasses for multi-element sets" do
+    ary = []
+    ary[0, 0] = ArraySpecs::ToAryArray[5, 6, 7]
+    ary.should == [5, 6, 7]
+  end
+
+  ruby_version_is '' ... '1.9' do
+    it "raises a TypeError on a frozen array" do
+      lambda { ArraySpecs.frozen_array[0, 0] = [] }.should raise_error(TypeError)
+    end
+  end
+
+  ruby_version_is '1.9' do
+    it "raises a RuntimeError on a frozen array" do
+      lambda { ArraySpecs.frozen_array[0, 0] = [] }.should raise_error(RuntimeError)
+    end
+  end
+end
+
+describe "Array#[]= with [index]" do
+  it "returns value assigned if idx is inside array" do
+    a = [1, 2, 3, 4, 5]
+    (a[3] = 6).should == 6
+  end
+
+  it "returns value assigned if idx is right beyond right array boundary" do
+    a = [1, 2, 3, 4, 5]
+    (a[5] = 6).should == 6
+  end
+
+  it "returns value assigned if idx far beyond right array boundary" do
+    a = [1, 2, 3, 4, 5]
+    (a[10] = 6).should == 6
+  end
+
+  it "sets the value of the element at index" do
+      a = [1, 2, 3, 4]
+      a[2] = 5
+      a[-1] = 6
+      a[5] = 3
+      a.should == [1, 2, 5, 6, nil, 3]
+    end
+
+  it "sets the value of the element if it is right beyond the array boundary" do
+    a = [1, 2, 3, 4]
+    a[4] = 8
+    a.should == [1, 2, 3, 4, 8]
+  end
+
+end
+
+describe "Array#[]= with [index, count]" do
+  it "returns non-array value if non-array value assigned" do
+    a = [1, 2, 3, 4, 5]
+    (a[2, 3] = 10).should == 10
+  end
+
+  it "returns array if array assigned" do
+    a = [1, 2, 3, 4, 5]
+    (a[2, 3] = [4, 5]).should == [4, 5]
+  end
+
+  ruby_version_is '' ... '1.9' do
+    it "removes the section defined by [start,length] when set to nil" do
+      a = ['a', 'b', 'c', 'd', 'e']
+      a[1, 3] = nil
+      a.should == ["a", "e"]
+    end
+  end
+  ruby_version_is '1.9' do
+    it "just sets the section defined by [start,length] to nil even if the rhs is nil" do
+      a = ['a', 'b', 'c', 'd', 'e']
+      a[1, 3] = nil
+      a.should == ["a", nil, "e"]
+    end
+  end
+
+  ruby_version_is '' ... '1.9' do
+    it "removes the section when set to nil if negative index within bounds and cnt > 0" do
+      a = ['a', 'b', 'c', 'd', 'e']
+      a[-3, 2] = nil
+      a.should == ["a", "b", "e"]
+    end
+  end
+
+  ruby_version_is '1.9' do
+    it "just sets the section defined by [start,length] to nil if negative index within bounds, cnt > 0 and the rhs is nil" do
+      a = ['a', 'b', 'c', 'd', 'e']
+      a[-3, 2] = nil
+      a.should == ["a", "b", nil, "e"]
+    end
+  end
+
+  it "replaces the section defined by [start,length] to other" do
+    a = [1, 2, 3, 4, 5, 6]
+    a[0, 1] = 2
+    a[3, 2] = ['a', 'b', 'c', 'd']
+    a.should == [2, 2, 3, "a", "b", "c", "d", 6]
+  end
+
+  it "replaces the section to other if idx < 0 and cnt > 0" do
+    a = [1, 2, 3, 4, 5, 6]
+    a[-3, 2] = ["x", "y", "z"]
+    a.should == [1, 2, 3, "x", "y", "z", 6]
+  end
+
+  it "replaces the section to other even if cnt spanning beyond the array boundary" do
+    a = [1, 2, 3, 4, 5]
+    a[-1, 3] = [7, 8]
+    a.should == [1, 2, 3, 4, 7, 8]
+  end
+
+  it "pads the Array with nils if the span is past the end" do
+    a = [1, 2, 3, 4, 5]
+    a[10, 1] = [1]
+    a.should == [1, 2, 3, 4, 5, nil, nil, nil, nil, nil, 1]
+
+    b = [1, 2, 3, 4, 5]
+    b[10, 0] = [1]
+    a.should == [1, 2, 3, 4, 5, nil, nil, nil, nil, nil, 1]
+  end
+
+  it "inserts other section in place defined by idx" do
+    a = [1, 2, 3, 4, 5]
+    a[3, 0] = [7, 8]
+    a.should == [1, 2, 3, 7, 8, 4, 5]
+
+    b = [1, 2, 3, 4, 5]
+    b[1, 0] = b
+    b.should == [1, 1, 2, 3, 4, 5, 2, 3, 4, 5]
+  end
+
+  it "raises an IndexError when passed start and negative length" do
+    a = [1, 2, 3, 4]
+    lambda { a[-2, -1] = "" }.should raise_error(IndexError)
+    lambda { a[0, -1] = ""  }.should raise_error(IndexError)
+    lambda { a[2, -1] = ""  }.should raise_error(IndexError)
+    lambda { a[4, -1] = ""  }.should raise_error(IndexError)
+    lambda { a[10, -1] = "" }.should raise_error(IndexError)
+    lambda { [1, 2, 3, 4,  5][2, -1] = [7, 8] }.should raise_error(IndexError)
+  end
+end
+
+describe "Array#[]= with [m..n]" do
+  it "returns non-array value if non-array value assigned" do
+    a = [1, 2, 3, 4, 5]
+    (a[2..4] = 10).should == 10
+  end
+
+  it "returns array if array assigned" do
+    a = [1, 2, 3, 4, 5]
+    (a[2..4] = [7, 8]).should == [7, 8]
+  end
+
+  ruby_version_is '' ... '1.9' do
+    it "removes the section defined by range when set to nil" do
+      a = [1, 2, 3, 4, 5]
+      a[0..1] = nil
+      a.should == [3, 4, 5]
+    end
+    it "removes the section when set to nil if m and n < 0" do
+      a = [1, 2, 3, 4, 5]
+      a[-3..-2] = nil
+      a.should == [1, 2, 5]
+    end
+  end
+
+  ruby_version_is '1.9' do
+    it "just sets the section defined by range to nil even if the rhs is nil" do
+      a = [1, 2, 3, 4, 5]
+      a[0..1] = nil
+      a.should == [nil, 3, 4, 5]
+    end
+    it "just sets the section defined by range to nil if m and n < 0 and the rhs is nil" do
+      a = [1, 2, 3, 4, 5]
+      a[-3..-2] = nil
+      a.should == [1, 2, nil, 5]
+    end
+  end
+
+  it "replaces the section defined by range" do
+      a = [6, 5, 4, 3, 2, 1]
+      a[1...2] = 9
+      a[3..6] = [6, 6, 6]
+      a.should == [6, 9, 4, 6, 6, 6]
+    end
+
+  it "replaces the section if m and n < 0" do
+    a = [1, 2, 3, 4, 5]
+    a[-3..-2] = [7, 8, 9]
+    a.should == [1, 2, 7, 8, 9, 5]
+  end
+
+  it "replaces the section if m < 0 and n > 0" do
+    a = [1, 2, 3, 4, 5]
+    a[-4..3] = [8]
+    a.should == [1, 8, 5]
+  end
+
+  it "inserts the other section at m if m > n" do
+    a = [1, 2, 3, 4, 5]
+    a[3..1] = [8]
+    a.should == [1, 2, 3, 8, 4, 5]
+  end
+
+  it "accepts Range subclasses" do
+    a = [1, 2, 3, 4]
+    range_incl = ArraySpecs::MyRange.new(1, 2)
+    range_excl = ArraySpecs::MyRange.new(-3, -1, true)
+
+    a[range_incl] = ["a", "b"]
+    a.should == [1, "a", "b", 4]
+    a[range_excl] = ["A", "B"]
+    a.should == [1, "A", "B", 4]
+  end
+end
+
+describe "Array#[] after a shift" do
+  it "works for insertion" do
+    a = [1,2]
+    a.shift
+    a.shift
+    a[0,0] = [3,4]
+    a.should == [3,4]
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/array/empty_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/empty_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/empty_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#empty?" do
+  it "returns true if the array has no elements" do
+    [].empty?.should == true
+    [1].empty?.should == false
+    [1, 2].empty?.should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/eql_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/eql_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/eql_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,73 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+# Do not use #should_receive(:eql?) mocks in these specs
+# because MSpec uses Hash for mocks and Hash calls #eql?.
+
+describe "Array#eql?" do
+  it "returns true if other is the same array" do
+    a = [1]
+    a.should eql(a)
+  end
+
+  it "returns true if corresponding elements are #eql?" do
+    [].should eql([])
+    [1, 2, 3, 4].should eql([1, 2, 3, 4])
+
+    obj = mock("eql? to anything")
+    def obj.eql?(o) true end
+    [obj].should eql([1])
+  end
+
+  it "returns false if other is shorter than self" do
+    [1, 2, 3, 4].should_not eql([1, 2, 3])
+  end
+
+  it "returns false if other is longer than self" do
+    [1, 2, 3, 4].should_not eql([1, 2, 3, 4, 5])
+  end
+
+  it "returns false if any corresponding elements are not #eql?" do
+    [1, 2, 3, 4].should_not eql([1, 2, 3, 4.0])
+
+    obj = mock('what is eql to any object')
+    def obj.eql?(o) false end
+
+    [1, 2, obj].should_not eql([1, 2, obj])
+  end
+
+  ruby_bug "#", "1.8.6.277" do
+    it "properly handles recursive arrays" do
+      empty = ArraySpecs.empty_recursive_array
+      empty2 = []; empty2 << empty2
+      empty.should eql(empty.dup)
+      empty.should_not eql(empty2)
+
+      array = ArraySpecs.recursive_array
+      array.should eql(array)
+      array.should eql(array.dup)
+
+      array.should_not eql(empty)
+      array.should_not eql([1, 2])
+    end
+  end
+
+  it "does not call #to_ary on its argument" do
+    obj = mock('to_ary')
+    obj.should_not_receive(:to_ary)
+
+    [1, 2, 3].should_not eql(obj)
+  end
+
+  it "does not call #to_ary on Array subclasses" do
+    ary = ArraySpecs::ToAryArray[5, 6, 7]
+    ary.should_not_receive(:to_ary)
+    [5, 6, 7].should eql(ary)
+  end
+
+  it "ignores array class differences" do
+    ArraySpecs::MyArray[1, 2, 3].should eql([1, 2, 3])
+    ArraySpecs::MyArray[1, 2, 3].should eql(ArraySpecs::MyArray[1, 2, 3])
+    [1, 2, 3].should eql(ArraySpecs::MyArray[1, 2, 3])
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/equal_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/equal_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/equal_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,91 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#==" do
+  it "return true if the other is self" do
+    a = [1, 2, 3]
+    a.should == a
+  end
+
+  it "returns true if corresponding elements are #==" do
+    [].should == []
+    ["a", "c", 7].should == ["a", "c", 7]
+
+    [1, 2, 3].should == [1.0, 2.0, 3.0]
+
+    obj = mock('5')
+    obj.should_receive(:==).and_return(true)
+    [obj].should == [5]
+  end
+
+  it "returns false if the other is shorter than self" do
+    a = [1, 2, 3]
+    b = [1, 2]
+    a.should_not == b
+  end
+
+  it "returns false if the other is longer than self" do
+    a = [1, 2, 3]
+    b = [1, 2, 3, 4]
+    a.should_not == b
+  end
+
+  it "returns false if any corresponding elements are not #==" do
+    a = ["a", "b", "c"]
+    b = ["a", "b", "not equal value"]
+    a.should_not == b
+
+    c = mock("c")
+    c.should_receive(:==).and_return(false)
+    ["a", "b", c].should_not == a
+  end
+
+  it "returns false immediately when sizes of the arrays differ" do
+    obj = mock('1')
+    obj.should_not_receive(:==)
+
+    [].should_not == [obj]
+    [obj].should_not == []
+  end
+
+  ruby_bug "#", "1.8.6.277" do
+    it "properly handles recursive arrays" do
+      empty = ArraySpecs.empty_recursive_array
+      empty2 = []; empty2 << empty2
+      (empty == empty.dup).should be_true
+      (empty == empty2).should be_false
+
+      array = ArraySpecs.recursive_array
+      (array == array).should be_true
+      (array == array.dup).should be_true
+      (array == empty).should be_false
+      (array == [1, 2]).should be_false
+    end
+  end
+
+  it "does not call #to_ary on its argument" do
+    obj = mock('to_ary')
+    obj.should_not_receive(:to_ary)
+
+    [1, 2, 3].should_not == obj
+  end
+
+  it "does not call #to_ary on Array subclasses" do
+    ary = ArraySpecs::ToAryArray[5, 6, 7]
+    ary.should_not_receive(:to_ary)
+    [5, 6, 7].should == ary
+  end
+
+  it "ignores array class differences" do
+    ArraySpecs::MyArray[1, 2, 3].should == [1, 2, 3]
+    ArraySpecs::MyArray[1, 2, 3].should == ArraySpecs::MyArray[1, 2, 3]
+    [1, 2, 3].should == ArraySpecs::MyArray[1, 2, 3]
+  end
+
+  it "does not call #== on its argument" do
+    bad_array = ArraySpecs::MyArray[1, 2, 3]
+    bad_array.should_not_receive(:==)
+
+    [1, 2, 3].should == bad_array
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/fetch_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/fetch_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/fetch_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,52 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#fetch" do
+  it "returns the element at the passed index" do
+    [1, 2, 3].fetch(1).should == 2
+    [nil].fetch(0).should == nil
+  end
+
+  it "counts negative indices backwards from end" do
+    [1, 2, 3, 4].fetch(-1).should == 4
+  end
+  
+  it "raises an IndexError if there is no element at index" do
+    lambda { [1, 2, 3].fetch(3) }.should raise_error(IndexError)
+    lambda { [1, 2, 3].fetch(-4) }.should raise_error(IndexError)
+    lambda { [].fetch(0) }.should raise_error(IndexError)
+  end
+  
+  it "returns default if there is no element at index if passed a default value" do
+    [1, 2, 3].fetch(5, :not_found).should == :not_found
+    [1, 2, 3].fetch(5, nil).should == nil
+    [1, 2, 3].fetch(-4, :not_found).should == :not_found
+    [nil].fetch(0, :not_found).should == nil
+  end
+
+  it "returns the value of block if there is no element at index if passed a block" do
+    [1, 2, 3].fetch(9) { |i| i * i }.should == 81
+    [1, 2, 3].fetch(-9) { |i| i * i }.should == 81
+  end
+
+  it "passes the original index argument object to the block, not the converted Integer" do
+    o = mock('5')
+    def o.to_int(); 5; end
+
+    [1, 2, 3].fetch(o) { |i| i }.should equal(o)
+  end
+
+  it "gives precedence to the default block over the default argument" do
+    [1, 2, 3].fetch(9, :foo) { |i| i * i }.should == 81
+  end
+
+  it "tries to convert the passed argument to an Integer using #to_int" do
+    obj = mock('to_int')
+    obj.should_receive(:to_int).and_return(2)
+    ["a", "b", "c"].fetch(obj).should == "c"
+  end
+
+  it "raises a TypeError when the passed argument can't be coerced to Integer" do
+    lambda { [].fetch("cat") }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/fill_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/fill_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/fill_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,338 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#fill" do
+  before(:all) do
+    @never_passed = lambda do |i|
+      raise ExpectationNotMetError, "the control path should not pass here"
+    end
+  end
+
+  it "returns self" do
+    ary = [1, 2, 3]
+    ary.fill(:a).should equal(ary)
+  end
+
+  it "is destructive" do
+    ary = [1, 2, 3]
+    ary.fill(:a)
+    ary.should == [:a, :a, :a]
+  end
+
+  it "does not replicate the filler" do
+    ary = [1, 2, 3, 4]
+    str = "x"
+    ary.fill(str).should == [str, str, str, str]
+    str << "y"
+    ary.should == [str, str, str, str]
+    ary[0].should equal(str)
+    ary[1].should equal(str)
+    ary[2].should equal(str)
+    ary[3].should equal(str)
+  end
+
+  it "replaces all elements in the array with the filler if not given a index nor a length" do
+    ary = ['a', 'b', 'c', 'duh']
+    ary.fill(8).should == [8, 8, 8, 8]
+
+    str = "x"
+    ary.fill(str).should == [str, str, str, str]
+  end
+
+  it "replaces all elements with the value of block (index given to block)" do
+    [nil, nil, nil, nil].fill { |i| i * 2 }.should == [0, 2, 4, 6]
+  end
+
+  ruby_version_is '' ... '1.9' do
+    it "raises a TypeError on a frozen array" do
+      lambda { ArraySpecs.frozen_array.fill('x') }.should raise_error(TypeError)
+    end
+  end
+
+  ruby_version_is '1.9' do
+    it "raises a RuntimeError on a frozen array" do
+      lambda { ArraySpecs.frozen_array.fill('x') }.should raise_error(RuntimeError)
+    end
+  end
+
+  it "raises an ArgumentError if 4 or more arguments are passed when no block given" do
+    lambda { [].fill('a') }.should_not raise_error(ArgumentError)
+
+    ruby_bug "#", "1.8.6.277" do
+      lambda { [].fill('a', 1) }.should_not raise_error(ArgumentError)
+    end
+
+    lambda { [].fill('a', 1, 2) }.should_not raise_error(ArgumentError)
+    lambda { [].fill('a', 1, 2, true) }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError if no argument passed and no block given" do
+    lambda { [].fill }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError if 3 or more arguments are passed when a block given" do
+    lambda { [].fill() {|i|} }.should_not raise_error(ArgumentError)
+
+    ruby_bug "#", "1.8.6.277" do
+      lambda { [].fill(1) {|i|} }.should_not raise_error(ArgumentError)
+    end
+
+    lambda { [].fill(1, 2) {|i|} }.should_not raise_error(ArgumentError)
+    lambda { [].fill(1, 2, true) {|i|} }.should raise_error(ArgumentError)
+  end
+end
+
+describe "Array#fill with (filler, index, length)" do
+  it "replaces length elements beginning with the index with the filler if given an index and a length" do
+    ary = [1, 2, 3, 4, 5, 6]
+    ary.fill('x', 2, 3).should == [1, 2, 'x', 'x', 'x', 6]
+  end
+
+  it "replaces length elements beginning with the index with the value of block" do
+    [true, false, true, false, true, false, true].fill(1, 4) { |i| i + 3 }.should == [true, 4, 5, 6, 7, false, true]
+  end
+
+  it "replaces all elements after the index if given an index and no length " do
+    ary = [1, 2, 3]
+    ary.fill('x', 1).should == [1, 'x', 'x']
+    ary.fill(1){|i| i*2}.should == [1, 2, 4]
+  end
+
+  it "replaces all elements after the index if given an index and nil as a length" do
+    a = [1, 2, 3]
+    a.fill('x', 1, nil).should == [1, 'x', 'x']
+    a.fill(1, nil){|i| i*2}.should == [1, 2, 4]
+  end
+
+  it "replaces the last (-n) elements if given an index n which is negative and no length" do
+    a = [1, 2, 3, 4, 5]
+    a.fill('x', -2).should == [1, 2, 3, 'x', 'x']
+    a.fill(-2){|i| i.to_s}.should == [1, 2, 3, '3', '4']
+  end
+
+  it "replaces the last (-n) elements if given an index n which is negative and nil as a length" do
+    a = [1, 2, 3, 4, 5]
+    a.fill('x', -2, nil).should == [1, 2, 3, 'x', 'x']
+    a.fill(-2, nil){|i| i.to_s}.should == [1, 2, 3, '3', '4']
+  end
+
+  it "makes no modifications if given an index greater than end and no length" do
+    [1, 2, 3, 4, 5].fill('a', 5).should == [1, 2, 3, 4, 5]
+    [1, 2, 3, 4, 5].fill(5, &@never_passed).should == [1, 2, 3, 4, 5]
+  end
+
+  it "makes no modifications if given an index greater than end and nil as a length" do
+    [1, 2, 3, 4, 5].fill('a', 5, nil).should == [1, 2, 3, 4, 5]
+    [1, 2, 3, 4, 5].fill(5, nil, &@never_passed).should == [1, 2, 3, 4, 5]
+  end
+
+  it "replaces length elements beginning with start index if given an index >= 0 and a length >= 0" do
+    [1, 2, 3, 4, 5].fill('a', 2, 0).should == [1, 2, 3, 4, 5]
+    [1, 2, 3, 4, 5].fill('a', 2, 2).should == [1, 2, "a", "a", 5]
+
+    [1, 2, 3, 4, 5].fill(2, 0, &@never_passed).should == [1, 2, 3, 4, 5]
+    [1, 2, 3, 4, 5].fill(2, 2){|i| i*2}.should == [1, 2, 4, 6, 5]
+  end
+
+  it "increases the Array size when necessary" do
+    a = [1, 2, 3]
+    a.size.should == 3
+    a.fill 'a', 0, 10
+    a.size.should == 10
+  end
+
+  it "pads between the last element and the index with nil if given an index which is greater than size of the array" do
+    [1, 2, 3, 4, 5].fill('a', 8, 5).should == [1, 2, 3, 4, 5, nil, nil, nil, 'a', 'a', 'a', 'a', 'a']
+    [1, 2, 3, 4, 5].fill(8, 5){|i| 'a'}.should == [1, 2, 3, 4, 5, nil, nil, nil, 'a', 'a', 'a', 'a', 'a']
+  end
+
+  it "replaces length elements beginning with the (-n)th if given an index n < 0 and a length > 0" do
+    [1, 2, 3, 4, 5].fill('a', -2, 2).should == [1, 2, 3, "a", "a"]
+    [1, 2, 3, 4, 5].fill('a', -2, 4).should == [1, 2, 3, "a", "a", "a", "a"]
+
+    [1, 2, 3, 4, 5].fill(-2, 2){|i| 'a'}.should == [1, 2, 3, "a", "a"]
+    [1, 2, 3, 4, 5].fill(-2, 4){|i| 'a'}.should == [1, 2, 3, "a", "a", "a", "a"]
+  end
+
+  it "starts at 0 if the negative index is before the start of the array" do
+    [1, 2, 3, 4, 5].fill('a', -25, 3).should == ['a', 'a', 'a', 4, 5]
+    [1, 2, 3, 4, 5].fill('a', -10, 10).should == %w|a a a a a a a a a a|
+
+    [1, 2, 3, 4, 5].fill(-25, 3){|i| 'a'}.should == ['a', 'a', 'a', 4, 5]
+    [1, 2, 3, 4, 5].fill(-10, 10){|i| 'a'}.should == %w|a a a a a a a a a a|
+  end
+
+  it "makes no modifications if the given length <= 0" do
+    [1, 2, 3, 4, 5].fill('a', 2, 0).should == [1, 2, 3, 4, 5]
+    [1, 2, 3, 4, 5].fill('a', -2, 0).should == [1, 2, 3, 4, 5]
+
+    ruby_bug "#", "1.8.6.277" do
+      [1, 2, 3, 4, 5].fill('a', 2, -2).should == [1, 2, 3, 4, 5]
+      [1, 2, 3, 4, 5].fill('a', -2, -2).should == [1, 2, 3, 4, 5]
+    end
+
+    [1, 2, 3, 4, 5].fill(2, 0, &@never_passed).should == [1, 2, 3, 4, 5]
+    [1, 2, 3, 4, 5].fill(-2, 0, &@never_passed).should == [1, 2, 3, 4, 5]
+
+    ruby_bug "#", "1.8.6.277" do
+      [1, 2, 3, 4, 5].fill(2, -2, &@never_passed).should == [1, 2, 3, 4, 5]
+      [1, 2, 3, 4, 5].fill(-2, -2, &@never_passed).should == [1, 2, 3, 4, 5]
+    end
+  end
+
+  ruby_bug "#", "1.8.6.277" do
+    # See: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/17481
+    it "does not raise an exception if the given length is negative and its absolute value does not exceed the index" do
+      lambda { [1, 2, 3, 4].fill('a', 3, -1)}.should_not raise_error(ArgumentError)
+      lambda { [1, 2, 3, 4].fill('a', 3, -2)}.should_not raise_error(ArgumentError)
+      lambda { [1, 2, 3, 4].fill('a', 3, -3)}.should_not raise_error(ArgumentError)
+
+      lambda { [1, 2, 3, 4].fill(3, -1, &@never_passed)}.should_not raise_error(ArgumentError)
+      lambda { [1, 2, 3, 4].fill(3, -2, &@never_passed)}.should_not raise_error(ArgumentError)
+      lambda { [1, 2, 3, 4].fill(3, -3, &@never_passed)}.should_not raise_error(ArgumentError)
+    end
+
+    it "does not raise an exception even if the given length is negative and its absolute value exceeds the index" do
+      lambda { [1, 2, 3, 4].fill('a', 3, -4)}.should_not raise_error(ArgumentError)
+      lambda { [1, 2, 3, 4].fill('a', 3, -5)}.should_not raise_error(ArgumentError)
+      lambda { [1, 2, 3, 4].fill('a', 3, -10000)}.should_not raise_error(ArgumentError)
+
+      lambda { [1, 2, 3, 4].fill(3, -4, &@never_passed)}.should_not raise_error(ArgumentError)
+      lambda { [1, 2, 3, 4].fill(3, -5, &@never_passed)}.should_not raise_error(ArgumentError)
+      lambda { [1, 2, 3, 4].fill(3, -10000, &@never_passed)}.should_not raise_error(ArgumentError)
+    end
+  end
+
+  it "tries to convert the second and third arguments to Integers using #to_int" do
+    obj = mock('to_int')
+    obj.should_receive(:to_int).and_return(2, 2)
+    filler = mock('filler')
+    filler.should_not_receive(:to_int)
+    [1, 2, 3, 4, 5].fill(filler, obj, obj).should == [1, 2, filler, filler, 5]
+  end
+
+  it "raises a TypeError if the index is not numeric" do
+    lambda { [].fill 'a', true }.should raise_error(TypeError)
+
+    obj = mock('nonnumeric')
+    lambda { [].fill('a', obj) }.should raise_error(TypeError)
+  end
+
+  platform_is :wordsize => 32 do
+    it "raises an ArgumentError or RangeError for too-large sizes" do
+      arr = [1, 2, 3]
+      lambda { arr.fill(10, 1, 2**31 - 1) }.should raise_error(ArgumentError)
+      lambda { arr.fill(10, 1, 2**31) }.should raise_error(RangeError)
+    end
+  end
+
+  platform_is :wordsize => 64 do
+    it "raises an ArgumentError or RangeError for too-large sizes" do
+      arr = [1, 2, 3]
+      lambda { arr.fill(10, 1, 2**63 - 1) }.should raise_error(ArgumentError)
+      lambda { arr.fill(10, 1, 2**63) }.should raise_error(RangeError)
+    end
+  end
+end
+
+describe "Array#fill with (filler, range)" do
+  it "replaces elements in range with object" do
+    [1, 2, 3, 4, 5, 6].fill(8, 0..3).should == [8, 8, 8, 8, 5, 6]
+    [1, 2, 3, 4, 5, 6].fill(8, 0...3).should == [8, 8, 8, 4, 5, 6]
+    [1, 2, 3, 4, 5, 6].fill('x', 4..6).should == [1, 2, 3, 4, 'x', 'x', 'x']
+    [1, 2, 3, 4, 5, 6].fill('x', 4...6).should == [1, 2, 3, 4, 'x', 'x']
+    [1, 2, 3, 4, 5, 6].fill('x', -2..-1).should == [1, 2, 3, 4, 'x', 'x']
+    [1, 2, 3, 4, 5, 6].fill('x', -2...-1).should == [1, 2, 3, 4, 'x', 6]
+    [1, 2, 3, 4, 5, 6].fill('x', -2...-2).should == [1, 2, 3, 4, 5, 6]
+    [1, 2, 3, 4, 5, 6].fill('x', -2..-2).should == [1, 2, 3, 4, 'x', 6]
+    [1, 2, 3, 4, 5, 6].fill('x', -2..0).should == [1, 2, 3, 4, 5, 6]
+    [1, 2, 3, 4, 5, 6].fill('x', 0...0).should == [1, 2, 3, 4, 5, 6]
+    [1, 2, 3, 4, 5, 6].fill('x', 1..1).should == [1, 'x', 3, 4, 5, 6]
+  end
+
+  it "replaces all elements in range with the value of block" do
+    [1, 1, 1, 1, 1, 1].fill(1..6) { |i| i + 1 }.should == [1, 2, 3, 4, 5, 6, 7]
+  end
+
+  it "increases the Array size when necessary" do
+    [1, 2, 3].fill('x', 1..6).should == [1, 'x', 'x', 'x', 'x', 'x', 'x']
+    [1, 2, 3].fill(1..6){|i| i+1}.should == [1, 2, 3, 4, 5, 6, 7]
+  end
+
+  it "raises a TypeError with range and length argument" do
+    lambda { [].fill('x', 0 .. 2, 5) }.should raise_error(TypeError)
+  end
+
+  it "replaces elements between the (-m)th to the last and the (n+1)th from the first if given an range m..n where m < 0 and n >= 0" do
+    [1, 2, 3, 4, 5, 6].fill('x', -4..4).should == [1, 2, 'x', 'x', 'x', 6]
+    [1, 2, 3, 4, 5, 6].fill('x', -4...4).should == [1, 2, 'x', 'x', 5, 6]
+
+    [1, 2, 3, 4, 5, 6].fill(-4..4){|i| (i+1).to_s}.should == [1, 2, '3', '4', '5', 6]
+    [1, 2, 3, 4, 5, 6].fill(-4...4){|i| (i+1).to_s}.should == [1, 2, '3', '4', 5, 6]
+  end
+
+  it "replaces elements between the (-m)th and (-n)th to the last if given an range m..n where m < 0 and n < 0" do
+    [1, 2, 3, 4, 5, 6].fill('x', -4..-2).should == [1, 2, 'x', 'x', 'x', 6]
+    [1, 2, 3, 4, 5, 6].fill('x', -4...-2).should == [1, 2, 'x', 'x', 5, 6]
+
+    [1, 2, 3, 4, 5, 6].fill(-4..-2){|i| (i+1).to_s}.should == [1, 2, '3', '4', '5', 6]
+    [1, 2, 3, 4, 5, 6].fill(-4...-2){|i| (i+1).to_s}.should == [1, 2, '3', '4', 5, 6]
+  end
+
+  it "replaces elements between the (m+1)th from the first and (-n)th to the last if given an range m..n where m >= 0 and n < 0" do
+    [1, 2, 3, 4, 5, 6].fill('x', 2..-2).should == [1, 2, 'x', 'x', 'x', 6]
+    [1, 2, 3, 4, 5, 6].fill('x', 2...-2).should == [1, 2, 'x', 'x', 5, 6]
+
+    [1, 2, 3, 4, 5, 6].fill(2..-2){|i| (i+1).to_s}.should == [1, 2, '3', '4', '5', 6]
+    [1, 2, 3, 4, 5, 6].fill(2...-2){|i| (i+1).to_s}.should == [1, 2, '3', '4', 5, 6]
+  end
+
+  it "makes no modifications if given an range which implies a section of zero width" do
+    [1, 2, 3, 4, 5, 6].fill('x', 2...2).should == [1, 2, 3, 4, 5, 6]
+    [1, 2, 3, 4, 5, 6].fill('x', -4...2).should == [1, 2, 3, 4, 5, 6]
+    [1, 2, 3, 4, 5, 6].fill('x', -4...-4).should == [1, 2, 3, 4, 5, 6]
+    [1, 2, 3, 4, 5, 6].fill('x', 2...-4).should == [1, 2, 3, 4, 5, 6]
+
+    [1, 2, 3, 4, 5, 6].fill(2...2, &@never_passed).should == [1, 2, 3, 4, 5, 6]
+    [1, 2, 3, 4, 5, 6].fill(-4...2, &@never_passed).should == [1, 2, 3, 4, 5, 6]
+    [1, 2, 3, 4, 5, 6].fill(-4...-4, &@never_passed).should == [1, 2, 3, 4, 5, 6]
+    [1, 2, 3, 4, 5, 6].fill(2...-4, &@never_passed).should == [1, 2, 3, 4, 5, 6]
+  end
+
+  it "makes no modifications if given an range which implies a section of negative width" do
+    [1, 2, 3, 4, 5, 6].fill('x', 2..1).should == [1, 2, 3, 4, 5, 6]
+    [1, 2, 3, 4, 5, 6].fill('x', -4..1).should == [1, 2, 3, 4, 5, 6]
+    [1, 2, 3, 4, 5, 6].fill('x', -2..-4).should == [1, 2, 3, 4, 5, 6]
+    [1, 2, 3, 4, 5, 6].fill('x', 2..-5).should == [1, 2, 3, 4, 5, 6]
+
+    [1, 2, 3, 4, 5, 6].fill(2..1, &@never_passed).should == [1, 2, 3, 4, 5, 6]
+    [1, 2, 3, 4, 5, 6].fill(-4..1, &@never_passed).should == [1, 2, 3, 4, 5, 6]
+    [1, 2, 3, 4, 5, 6].fill(-2..-4, &@never_passed).should == [1, 2, 3, 4, 5, 6]
+    [1, 2, 3, 4, 5, 6].fill(2..-5, &@never_passed).should == [1, 2, 3, 4, 5, 6]
+  end
+
+  it "raise an exception if some of the given range lies before the first of the array" do
+    lambda { [1, 2, 3].fill('x', -5..-3) }.should raise_error(RangeError)
+    lambda { [1, 2, 3].fill('x', -5...-3) }.should raise_error(RangeError)
+    lambda { [1, 2, 3].fill('x', -5..-4) }.should raise_error(RangeError)
+
+    lambda { [1, 2, 3].fill(-5..-3, &@never_passed) }.should raise_error(RangeError)
+    lambda { [1, 2, 3].fill(-5...-3, &@never_passed) }.should raise_error(RangeError)
+    lambda { [1, 2, 3].fill(-5..-4, &@never_passed) }.should raise_error(RangeError)
+  end
+
+  it "tries to convert the start and end of the passed range to Integers using #to_int" do
+    obj = mock('to_int')
+    def obj.<=>(rhs); rhs == self ? 0 : nil end
+    obj.should_receive(:to_int).twice.and_return(2)
+    filler = mock('filler')
+    filler.should_not_receive(:to_int)
+    [1, 2, 3, 4, 5].fill(filler, obj..obj).should == [1, 2, filler, 4, 5]
+  end
+
+  it "raises a TypeError if the start or end of the passed range is not numeric" do
+    obj = mock('nonnumeric')
+    def obj.<=>(rhs); rhs == self ? 0 : nil end
+    lambda { [].fill('a', obj..obj) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/first_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/first_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/first_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,89 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#first" do
+  it "returns the first element" do
+    %w{a b c}.first.should == 'a'
+    [nil].first.should == nil
+  end
+  
+  it "returns nil if self is empty" do
+    [].first.should == nil
+  end
+  
+  it "returns the first count elements if given a count" do
+    [true, false, true, nil, false].first(2).should == [true, false]
+  end
+
+  it "returns an empty array when passed count on an empty array" do
+    [].first(0).should == []
+    [].first(1).should == []
+    [].first(2).should == []
+  end
+  
+  it "returns an empty array when passed count == 0" do
+    [1, 2, 3, 4, 5].first(0).should == []
+  end
+  
+  it "returns an array containing the first element when passed count == 1" do
+    [1, 2, 3, 4, 5].first(1).should == [1]
+  end
+  
+  it "raises an ArgumentError when count is negative" do
+    lambda { [1, 2].first(-1) }.should raise_error(ArgumentError)
+  end
+  
+  it "returns the entire array when count > length" do
+    [1, 2, 3, 4, 5, 9].first(10).should == [1, 2, 3, 4, 5, 9]
+  end
+
+  it "returns an array which is independent to the original when passed count" do
+    ary = [1, 2, 3, 4, 5]
+    ary.first(0).replace([1,2])
+    ary.should == [1, 2, 3, 4, 5]
+    ary.first(1).replace([1,2])
+    ary.should == [1, 2, 3, 4, 5]
+    ary.first(6).replace([1,2])
+    ary.should == [1, 2, 3, 4, 5]
+  end
+
+  it "properly handles recursive arrays" do
+    empty = ArraySpecs.empty_recursive_array
+    empty.first.should equal(empty)
+
+    ary = ArraySpecs.head_recursive_array
+    ary.first.should equal(ary)
+  end
+
+  it "tries to convert the passed argument to an Integer using #to_int" do
+    obj = mock('to_int')
+    obj.should_receive(:to_int).and_return(2)
+    [1, 2, 3, 4, 5].first(obj).should == [1, 2]
+  end
+
+  it "raises a TypeError if the passed argument is not numeric" do
+    lambda { [1,2].first(nil) }.should raise_error(TypeError)
+    lambda { [1,2].first("a") }.should raise_error(TypeError)
+
+    obj = mock("nonnumeric")
+    lambda { [1,2].first(obj) }.should raise_error(TypeError)
+  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
+  end
+
+  it "is not destructive" do
+    a = [1, 2, 3]
+    a.first
+    a.should == [1, 2, 3]
+    a.first(2)
+    a.should == [1, 2, 3]
+    a.first(3)
+    a.should == [1, 2, 3]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,79 @@
+module ArraySpecs
+  not_compliant_on :rubinius do
+    def self.max_32bit_size
+      2**32/4
+    end
+
+    def self.max_64bit_size
+      2**64/8
+    end
+  end
+
+  deviates_on :rubinius do
+    def self.max_32bit_size
+      2**30-1
+    end
+
+    def self.max_64bit_size
+      2**62-1
+    end
+  end
+
+  def self.frozen_array
+    @frozen_array ||= [1,2,3]
+    @frozen_array.freeze
+    @frozen_array
+  end
+
+  def self.recursive_array
+    a = [1, 'two', 3.0]
+    5.times { a << a }
+    a
+  end
+
+  def self.head_recursive_array
+    a =  []
+    5.times { a << a }
+    a << 1 << 'two' << 3.0
+    a
+  end
+
+  def self.empty_recursive_array
+    a = []
+    a << a
+    a
+  end
+
+  class MyArray < Array; end
+
+  class Sexp < Array
+    def initialize(*args)
+      super(args)
+    end
+  end
+
+  # TODO: replace specs that use this with #should_not_receive(:to_ary)
+  # expectations on regular objects (e.g. Array instances).
+  class ToAryArray < Array
+    def to_ary() ["to_ary", "was", "called!"] end
+  end
+
+  class MyRange < Range; end
+
+  class AssocKey
+    def ==(other); other == 'it'; end
+  end
+
+  class D
+    def <=>(obj)
+      return 4 <=> obj unless obj.class == D
+      0
+    end
+  end
+
+  class SubArray < Array
+    def initialize(*args)
+      ScratchPad.record args
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/flatten_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/flatten_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/flatten_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,195 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#flatten" do
+  it "returns a one-dimensional flattening recursively" do
+    [[[1, [2, 3]],[2, 3, [4, [4, [5, 5]], [1, 2, 3]]], [4]], []].flatten.should == [1, 2, 3, 2, 3, 4, 4, 5, 5, 1, 2, 3, 4]
+  end
+
+  ruby_version_is "1.8.7" do
+    it "takes an optional argument that determines the level of recursion" do
+      [ 1, 2, [3, [4, 5] ] ].flatten(1).should == [1, 2, 3, [4, 5]]
+    end
+
+    it "returns self when the level of recursion is 0" do
+      a = [ 1, 2, [3, [4, 5] ] ]
+      a.flatten(0).should equal(a)
+    end
+
+    it "ignores negative levels" do
+      [ 1, 2, [ 3, 4, [5, 6] ] ].flatten(-1).should == [1, 2, 3, 4, 5, 6]
+      [ 1, 2, [ 3, 4, [5, 6] ] ].flatten(-10).should == [1, 2, 3, 4, 5, 6]
+    end
+
+    it "tries to convert passed Objects to Integers using #to_int" do
+      obj = mock("Converted to Integer")
+      obj.should_receive(:to_int).and_return(1)
+
+      [ 1, 2, [3, [4, 5] ] ].flatten(obj).should == [1, 2, 3, [4, 5]]
+    end
+
+    it "raises a TypeError when the passed Object can't be converted to an Integer" do
+      obj = mock("Not converted")
+      lambda { [ 1, 2, [3, [4, 5] ] ].flatten(obj) }.should raise_error(TypeError)
+    end
+  end
+
+  it "does not call flatten on elements" do
+    obj = mock('[1,2]')
+    obj.should_not_receive(:flatten)
+    [obj, obj].flatten.should == [obj, obj]
+
+    obj = [5, 4]
+    obj.should_not_receive(:flatten)
+    [obj, obj].flatten.should == [5, 4, 5, 4]
+  end
+
+  it "raises an ArgumentError on recursive arrays" do
+    x = []
+    x << x
+    lambda { x.flatten }.should raise_error(ArgumentError)
+
+    x = []
+    y = []
+    x << y
+    y << x
+    lambda { x.flatten }.should raise_error(ArgumentError)
+  end
+
+  it "flattens any element which responds to #to_ary, using the return value of said method" do
+    x = mock("[3,4]")
+    x.should_receive(:to_ary).at_least(:once).and_return([3, 4])
+    [1, 2, x, 5].flatten.should == [1, 2, 3, 4, 5]
+
+    y = mock("MyArray[]")
+    y.should_receive(:to_ary).at_least(:once).and_return(ArraySpecs::MyArray[])
+    [y].flatten.should == []
+
+    z = mock("[2,x,y,5]")
+    z.should_receive(:to_ary).and_return([2, x, y, 5])
+    [1, z, 6].flatten.should == [1, 2, 3, 4, 5, 6]
+  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
+  end
+
+  it "is not destructive" do
+    ary = [1, [2, 3]]
+    ary.flatten
+    ary.should == [1, [2, 3]]
+  end
+end
+
+describe "Array#flatten!" do
+  it "modifies array to produce a one-dimensional flattening recursively" do
+    a = [[[1, [2, 3]],[2, 3, [4, [4, [5, 5]], [1, 2, 3]]], [4]], []]
+    a.flatten!
+    a.should == [1, 2, 3, 2, 3, 4, 4, 5, 5, 1, 2, 3, 4]
+  end
+
+  it "returns self if made some modifications" do
+    a = [[[1, [2, 3]],[2, 3, [4, [4, [5, 5]], [1, 2, 3]]], [4]], []]
+    a.flatten!.should equal(a)
+  end
+
+  it "returns nil if no modifications took place" do
+    a = [1, 2, 3]
+    a.flatten!.should == nil
+    a = [1, [2, 3]]
+    a.flatten!.should_not == nil
+  end
+
+  ruby_version_is "1.8.7" do
+    it "takes an optional argument that determines the level of recursion" do
+      [ 1, 2, [3, [4, 5] ] ].flatten!(1).should == [1, 2, 3, [4, 5]]
+    end
+
+    # NOTE: This is inconsistent behaviour, it should return nil
+    it "returns self when the level of recursion is 0" do
+      a = [ 1, 2, [3, [4, 5] ] ]
+      a.flatten!(0).should equal(a)
+    end
+
+    it "ignores negative levels" do
+      [ 1, 2, [ 3, 4, [5, 6] ] ].flatten!(-1).should == [1, 2, 3, 4, 5, 6]
+      [ 1, 2, [ 3, 4, [5, 6] ] ].flatten!(-10).should == [1, 2, 3, 4, 5, 6]
+    end
+
+    it "tries to convert passed Objects to Integers using #to_int" do
+      obj = mock("Converted to Integer")
+      obj.should_receive(:to_int).and_return(1)
+
+      [ 1, 2, [3, [4, 5] ] ].flatten!(obj).should == [1, 2, 3, [4, 5]]
+    end
+
+    it "raises a TypeError when the passed Object can't be converted to an Integer" do
+      obj = mock("Not converted")
+      lambda { [ 1, 2, [3, [4, 5] ] ].flatten!(obj) }.should raise_error(TypeError)
+    end
+  end
+
+  it "does not call flatten! on elements" do
+    obj = mock('[1,2]')
+    obj.should_not_receive(:flatten!)
+    [obj, obj].flatten!.should == nil
+
+    obj = [5, 4]
+    obj.should_not_receive(:flatten!)
+    [obj, obj].flatten!.should == [5, 4, 5, 4]
+  end
+
+  it "raises an ArgumentError on recursive arrays" do
+    x = []
+    x << x
+    lambda { x.flatten! }.should raise_error(ArgumentError)
+
+    x = []
+    y = []
+    x << y
+    y << x
+    lambda { x.flatten! }.should raise_error(ArgumentError)
+  end
+
+  it "flattens any elements which responds to #to_ary, using the return value of said method" do
+    x = mock("[3,4]")
+    x.should_receive(:to_ary).at_least(:once).and_return([3, 4])
+    [1, 2, x, 5].flatten!.should == [1, 2, 3, 4, 5]
+
+    y = mock("MyArray[]")
+    y.should_receive(:to_ary).at_least(:once).and_return(ArraySpecs::MyArray[])
+    [y].flatten!.should == []
+
+    z = mock("[2,x,y,5]")
+    z.should_receive(:to_ary).and_return([2, x, y, 5])
+    [1, z, 6].flatten!.should == [1, 2, 3, 4, 5, 6]
+
+    ary = [ArraySpecs::MyArray[1, 2, 3]]
+    ary.flatten!
+    ary.class.should == Array
+    ary.should == [1, 2, 3]
+  end
+
+  ruby_version_is '' ... '1.9' do
+    it "raises a TypeError on frozen arrays when modification would take place" do
+      nested_ary = [1, 2, []]
+      nested_ary.freeze
+      lambda { nested_ary.flatten! }.should raise_error(TypeError)
+    end
+  end
+
+  ruby_version_is '1.9' do
+    it "raises a RuntimeError on frozen arrays when modification would take place" do
+      nested_ary = [1, 2, []]
+      nested_ary.freeze
+      lambda { nested_ary.flatten! }.should raise_error(RuntimeError)
+    end
+  end
+
+  it "does not raise on frozen arrays when no modification would take place" do
+    ArraySpecs.frozen_array.flatten!.should be_nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/frozen_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/frozen_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/frozen_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#frozen?" do
+  it "returns true if array is frozen" do
+    a = [1, 2, 3]
+    a.frozen?.should == false
+    a.freeze
+    a.frozen?.should == true
+  end
+
+  it "returns true if array is temporarily frozen while being sort!ed" do
+    a = [1, 2, 3]
+    a.sort! { |x,y| a.frozen?.should == true; x <=> y }
+  end
+
+  it "returns false for arrays being sorted (they aren't temporarily frozen)" do
+    a = [1, 2, 3]
+    a.sort { |x,y| a.frozen?.should == false; x <=> y }
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/hash_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/hash_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/hash_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,70 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#hash" do
+  it "returns the same fixnum for arrays with the same content" do
+    [].respond_to?(:hash).should == true
+
+    [[], [1, 2, 3]].each do |ary|
+      ary.hash.should == ary.dup.hash
+      ary.hash.class.should == Fixnum
+    end
+  end
+
+  ruby_bug "#", "1.8.6.277" do
+    it "properly handles recursive arrays" do
+      empty = ArraySpecs.empty_recursive_array
+      empty.hash.should be_kind_of(Integer)
+
+      array = ArraySpecs.recursive_array
+      array.hash.should be_kind_of(Integer)
+    end
+  end
+
+  #  Too much of an implementation detail? -rue
+  not_compliant_on :rubinius do
+    it "calls to_int on result of calling hash on each element" do
+      ary = Array.new(5) do
+        # Can't use should_receive here because it calls hash()
+        obj = mock('0')
+        def obj.hash()
+          def self.to_int() freeze; 0 end
+          return self
+        end
+        obj
+      end
+
+      ary.hash
+      ary.each { |obj| obj.frozen?.should == true }
+
+      hash = mock('1')
+      hash.should_receive(:to_int).and_return(1.hash)
+
+      obj = mock('@hash')
+      obj.instance_variable_set(:@hash, hash)
+      def obj.hash() @hash end
+
+      [obj].hash.should == [1].hash
+    end
+  end
+
+  it "ignores array class differences" do
+    ArraySpecs::MyArray[].hash.should == [].hash
+    ArraySpecs::MyArray[1, 2].hash.should == [1, 2].hash
+  end
+
+  it "returns same hash code for arrays with the same content" do
+    a = [1, 2, 3, 4]
+    a.fill 'a', 0..3
+    b = %w|a a a a|
+    a.hash.should == b.hash
+  end
+
+  it "returns the same value if arrays are #eql?" do
+    a = [1, 2, 3, 4]
+    a.fill 'a', 0..3
+    b = %w|a a a a|
+    a.hash.should == b.hash
+    a.should eql(b)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/include_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/include_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/include_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#include?" do
+  it "returns true if object is present, false otherwise" do
+    [1, 2, "a", "b"].include?("c").should == false
+    [1, 2, "a", "b"].include?("a").should == true
+  end
+
+  it "determines presence by using element == obj" do
+    o = mock('')
+  
+    [1, 2, "a", "b"].include?(o).should == false
+
+    def o.==(other); other == 'a'; end
+
+    [1, 2, o, "b"].include?('a').should == true
+
+    [1, 2.0, 3].include?(2).should == true
+  end
+
+  it "calls == on elements from left to right until success" do
+    key = "x"
+    one = mock('one')
+    two = mock('two')
+    three = mock('three')
+    one.should_receive(:==).any_number_of_times.and_return(false)
+    two.should_receive(:==).any_number_of_times.and_return(true)
+    three.should_not_receive(:==)
+    ary = [one, two, three]
+    ary.include?(key).should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/index_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/index_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/index_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#index" do
+  it "returns the index of the first element == to object" do
+    x = mock('3')
+    def x.==(obj) 3 == obj; end
+
+    [2, x, 3, 1, 3, 1].index(3).should == 1
+    [2, 3.0, 3, x, 1, 3, 1].index(x).should == 1
+  end
+
+  it "returns 0 if first element == to object" do
+    [2, 1, 3, 2, 5].index(2).should == 0
+  end
+
+  it "returns size-1 if only last element == to object" do
+    [2, 1, 3, 1, 5].index(5).should == 4
+  end
+
+  it "returns nil if no element == to object" do
+    [2, 1, 1, 1, 1].index(3).should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/indexes_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/indexes_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/indexes_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/indexes'
+
+ruby_version_is '' ... '1.9' do
+  describe "Array#indexes" do
+    it_behaves_like(:array_indexes, :indexes)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/indices_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/indices_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/indices_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/indexes'
+
+ruby_version_is '' ... '1.9' do
+  describe "Array#indices" do
+    it_behaves_like(:array_indexes, :indices)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/initialize_copy_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/initialize_copy_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/initialize_copy_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/replace'
+
+describe "Array#initialize_copy" do
+ it "is private" do
+   [].private_methods.map { |m| m.to_s }.include?("initialize_copy").should == true
+ end
+ 
+ it_behaves_like(:array_replace, :initialize_copy)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,175 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#initialize" do
+  before :each do
+    ScratchPad.clear
+  end
+
+  ruby_version_is "" ... "1.9" do
+    it "is private" do
+      [].private_methods.should include("initialize")
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "is private" do
+      [].private_methods.should include(:initialize)
+    end
+  end
+
+  it "is called on subclasses" do
+    b = ArraySpecs::SubArray.new :size_or_array, :obj
+
+    b.should == []
+    ScratchPad.recorded.should == [:size_or_array, :obj]
+  end
+
+  it "preserves the object's identity even when changing its value" do
+    a = [1, 2, 3]
+    a.send(:initialize).should equal(a)
+    a.should_not == [1, 2, 3]
+  end
+
+  it "raise an ArgumentError if passed 3 or more arguments" do
+    lambda do
+      [1, 2].send :initialize, 1, 'x', true
+    end.should raise_error(ArgumentError)
+    lambda do
+      [1, 2].send(:initialize, 1, 'x', true) {}
+    end.should raise_error(ArgumentError)
+  end
+
+  ruby_version_is '' ... '1.9' do
+    it "raises a TypeError on frozen arrays even if the array would not be modified" do
+      lambda do
+        ArraySpecs.frozen_array.send :initialize
+      end.should raise_error(TypeError)
+      lambda do
+        ArraySpecs.frozen_array.send :initialize, ArraySpecs.frozen_array
+      end.should raise_error(TypeError)
+    end
+  end
+
+  ruby_version_is '1.9' do
+    it "raises a RuntimeError on frozen arrays even if the array would not be modified" do
+      lambda do
+        ArraySpecs.frozen_array.send :initialize
+      end.should raise_error(RuntimeError)
+      lambda do
+        ArraySpecs.frozen_array.send :initialize, ArraySpecs.frozen_array
+      end.should raise_error(RuntimeError)
+    end
+  end
+end
+
+describe "Array#initialize with no arguments" do
+  it "makes the array empty" do
+    [1, 2, 3].send(:initialize).should be_empty
+  end
+
+  it "does not use the given block" do
+    lambda{ [1, 2, 3].send(:initialize) { raise } }.should_not raise_error
+  end
+end
+
+describe "Array#initialize with (array)" do
+  it "replaces self with the other array" do
+    b = [4, 5, 6]
+    [1, 2, 3].send(:initialize, b).should == b
+  end
+
+  it "does not use the given block" do
+    lambda{ [1, 2, 3].send(:initialize) { raise } }.should_not raise_error
+  end
+
+  it "calls #to_ary to convert the value to an array" do
+    a = mock("array")
+    a.should_receive(:to_ary).and_return([1, 2])
+    a.should_not_receive(:to_int)
+    [].send(:initialize, a).should == [1, 2]
+  end
+
+  it "does not call #to_ary on instances of Array or subclasses of Array" do
+    a = [1, 2]
+    a.should_not_receive(:to_ary)
+    [].send(:initialize, a).should == a
+  end
+
+  it "raises a TypeError if an Array type argument and a default object" do
+    lambda { [].send(:initialize, [1, 2], 1) }.should raise_error(TypeError)
+  end
+end
+
+describe "Array#initialize with (size, object=nil)" do
+  it "sets the array to size and fills with the object" do
+    a = []
+    obj = [3]
+    a.send(:initialize, 2, obj).should == [obj, obj]
+    a[0].should equal(obj)
+    a[1].should equal(obj)
+  end
+
+  it "sets the array to size and fills with nil when object is omitted" do
+    [].send(:initialize, 3).should == [nil, nil, nil]
+  end
+
+  it "raises an ArgumentError if size is negative" do
+    lambda { [].send(:initialize, -1, :a) }.should raise_error(ArgumentError)
+    lambda { [].send(:initialize, -1) }.should raise_error(ArgumentError)
+  end
+
+  platform_is :wordsize => 32 do
+    it "raises an ArgumentError if size is too large" do
+      max_size = ArraySpecs.max_32bit_size
+      lambda { [].send(:initialize, max_size + 1) }.should raise_error(ArgumentError)
+    end
+  end
+
+  platform_is :wordsize => 64 do
+    it "raises an ArgumentError if size is too large" do
+      max_size = ArraySpecs.max_64bit_size
+      lambda { [].send(:initialize, max_size + 1) }.should raise_error(ArgumentError)
+    end
+  end
+
+  it "calls #to_int to convert the size argument to an Integer when object is given" do
+    obj = mock('1')
+    obj.should_receive(:to_int).and_return(1)
+    [].send(:initialize, obj, :a).should == [:a]
+  end
+
+  it "calls #to_int to convert the size argument to an Integer when object is not given" do
+    obj = mock('1')
+    obj.should_receive(:to_int).and_return(1)
+    [].send(:initialize, obj).should == [nil]
+  end
+
+  it "raises a TypeError if the size argument is not an Integer type" do
+    obj = mock('nonnumeric')
+    obj.stub!(:to_ary).and_return([1, 2])
+    lambda{ [].send(:initialize, obj, :a) }.should raise_error(TypeError)
+  end
+
+  it "yields the index of the element and sets the element to the value of the block" do
+    [].send(:initialize, 3) { |i| i.to_s }.should == ['0', '1', '2']
+  end
+
+  it "uses the block value instead of using the default value" do
+    [].send(:initialize, 3, :obj) { |i| i.to_s }.should == ['0', '1', '2']
+  end
+
+  it "returns the value passed to break" do
+    [].send(:initialize, 3) { break :a }.should == :a
+  end
+
+  it "sets the array to the values returned by the block before break is executed" do
+    a = [1, 2, 3]
+    a.send(:initialize, 3) do |i|
+      break if i == 2
+      i.to_s
+    end
+
+    a.should == ['0', '1']
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/insert_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/insert_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/insert_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,85 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#insert" do
+  it "returns self" do
+    ary = []
+    ary.insert(0).should equal(ary)
+    ary.insert(0, :a).should equal(ary)
+  end
+
+  it "inserts objects before the element at index for non-negative index" do
+    ary = []
+    ary.insert(0, 3).should == [3]
+    ary.insert(0, 1, 2).should == [1, 2, 3]
+    ary.insert(0).should == [1, 2, 3]
+
+    # Let's just assume insert() always modifies the array from now on.
+    ary.insert(1, 'a').should == [1, 'a', 2, 3]
+    ary.insert(0, 'b').should == ['b', 1, 'a', 2, 3]
+    ary.insert(5, 'c').should == ['b', 1, 'a', 2, 3, 'c']
+    ary.insert(7, 'd').should == ['b', 1, 'a', 2, 3, 'c', nil, 'd']
+    ary.insert(10, 5, 4).should == ['b', 1, 'a', 2, 3, 'c', nil, 'd', nil, nil, 5, 4]
+  end
+
+  it "appends objects to the end of the array for index == -1" do
+    [1, 3, 3].insert(-1, 2, 'x', 0.5).should == [1, 3, 3, 2, 'x', 0.5]
+  end
+
+  it "inserts objects after the element at index with negative index" do
+    ary = []
+    ary.insert(-1, 3).should == [3]
+    ary.insert(-2, 2).should == [2, 3]
+    ary.insert(-3, 1).should == [1, 2, 3]
+    ary.insert(-2, -3).should == [1, 2, -3, 3]
+    ary.insert(-1, []).should == [1, 2, -3, 3, []]
+    ary.insert(-2, 'x', 'y').should == [1, 2, -3, 3, 'x', 'y', []]
+    ary = [1, 2, 3]
+  end
+
+  it "pads with nils if the index to be inserted to is past the end" do
+    [].insert(5, 5).should == [nil, nil, nil, nil, nil, 5]
+  end
+
+  it "can insert before the first element with a negative index" do
+    [1, 2, 3].insert(-4, -3).should == [-3, 1, 2, 3]
+  end
+
+  it "raises an IndexError if the negative index is out of bounds" do
+    lambda { [].insert(-2, 1)  }.should raise_error(IndexError)
+    lambda { [1].insert(-3, 2) }.should raise_error(IndexError)
+  end
+
+  it "does nothing of no object is passed" do
+    [].insert(0).should == []
+    [].insert(-1).should == []
+    [].insert(10).should == []
+    [].insert(-2).should == []
+  end
+
+  it "tries to convert the passed position argument to an Integer using #to_int" do
+    obj = mock('2')
+    obj.should_receive(:to_int).and_return(2)
+    [].insert(obj, 'x').should == [nil, nil, 'x']
+  end
+
+  it 'raises an ArgumentError if no argument passed' do
+    lambda { [].insert() }.should raise_error(ArgumentError)
+  end
+
+  ruby_version_is '' ... '1.9' do
+    it "raises a TypeError on frozen arrays if modification takes place" do
+      lambda { ArraySpecs.frozen_array.insert(0, 'x') }.should raise_error(TypeError)
+    end
+  end
+
+  ruby_version_is '1.9' do
+    it "raises a RuntimeError on frozen arrays if modification takes place" do
+      lambda { ArraySpecs.frozen_array.insert(0, 'x') }.should raise_error(RuntimeError)
+    end
+  end
+
+  it "does not raise on frozen arrays if no modification takes place" do
+    ArraySpecs.frozen_array.insert(0).should == [1, 2, 3]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#inspect" do
+  it "returns a string" do
+    [1, 2, 3].inspect.should be_kind_of(String)
+  end
+
+  it "calls inspect on its elements" do
+    items = Array.new(3) do |i|
+      obj = mock("#{i}")
+      obj.should_receive(:inspect).and_return("items[#{i}]")
+      obj
+    end
+    str = items.inspect
+    str.should include('items[0]')
+    str.should include('items[1]')
+    str.should include('items[2]')
+  end
+  
+  it "handles recursive arrays" do
+    x = [1, 2]
+    x << x << 4
+    lambda{ x.inspect }.should_not raise_error
+
+    x = [1, 2]
+    y = [3, 4]
+    x << y
+    y << x
+    lambda{ x.inspect }.should_not raise_error
+    lambda{ y.inspect }.should_not raise_error
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/intersection_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/intersection_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/intersection_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,73 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#&" do
+  it "creates an array with elements common to both arrays (intersection)" do
+    ([] & []).should == []
+    ([1, 2] & []).should == []
+    ([] & [1, 2]).should == []
+    ([ 1, 3, 5 ] & [ 1, 2, 3 ]).should == [1, 3]
+  end
+  
+  it "creates an array with no duplicates" do
+    ([ 1, 1, 3, 5 ] & [ 1, 2, 3 ]).uniq!.should == nil
+  end
+  
+  it "creates an array with elements in order they are first encountered" do
+    ([ 1, 2, 3, 2, 5 ] & [ 5, 2, 3, 4 ]).should == [2, 3, 5]
+  end
+
+  it "does not modify the original Array" do
+    a = [1, 1, 3, 5]
+    a & [1, 2, 3]
+    a.should == [1, 1, 3, 5]
+  end
+
+  ruby_bug "#", "1.8.6.277" do
+    it "properly handles recursive arrays" do
+      empty = ArraySpecs.empty_recursive_array
+      (empty & empty).should == empty
+
+      (ArraySpecs.recursive_array & []).should == []
+      ([] & ArraySpecs.recursive_array).should == []
+
+      (ArraySpecs.recursive_array & ArraySpecs.recursive_array).should == [1, 'two', 3.0]
+    end
+  end
+
+  it "tries to convert the passed argument to an Array using #to_ary" do
+    obj = mock('[1,2,3]')
+    obj.should_receive(:to_ary).and_return([1, 2, 3])
+    ([1, 2] & obj).should == ([1, 2])
+  end
+
+  it "determines equivalence between elements in the sense of eql?" do
+    ([5.0, 4.0] & [5, 4]).should == []
+    str = "x"
+    ([str] & [str.dup]).should == [str]
+    
+    obj1 = mock('1')
+    obj2 = mock('2')
+    def obj1.hash; 0; end
+    def obj2.hash; 0; end
+    def obj1.eql? a; true; end
+    def obj2.eql? a; true; end
+    
+    ([obj1] & [obj2]).should == [obj1]
+    
+    def obj1.eql? a; false; end
+    def obj2.eql? a; false; end
+    
+    ([obj1] & [obj2]).should == []
+  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
+  end
+
+  it "does not call to_ary on array subclasses" do
+    ([5, 6] & ArraySpecs::ToAryArray[1, 2, 5, 6]).should == [5, 6]
+  end  
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/join_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/join_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/join_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,38 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require  File.dirname(__FILE__) + '/shared/join'
+
+describe "Array#join" do
+  it_behaves_like :array_join, :join
+
+  it "does not separates elements when the passed separator is nil" do
+    [1, 2, 3].join(nil).should == '123'
+  end
+
+  it "uses $, as the default separator (which defaults to nil)" do
+    [1, 2, 3].join.should == '123'
+    begin
+      old, $, = $,, '-'
+      [1, 2, 3].join.should == '1-2-3'
+    ensure
+      $, = old
+    end
+  end
+
+  it "does not process the separator if the array is empty" do
+    a = []
+    sep = Object.new
+    a.join(sep).should == ""
+  end
+
+  it "calls #to_str to convert the separator to a String" do
+    sep = mock("separator")
+    sep.should_receive(:to_str).and_return(", ")
+    [1, 2].send(@method, sep).should == "1, 2"
+  end
+
+  it "raises a TypeError if the separator cannot be coerced to a String by calling #to_str" do
+    obj = mock("not a string")
+    lambda { [1, 2].send(@method, obj) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/last_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/last_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/last_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,87 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#last" do
+  it "returns the last element" do
+    [1, 1, 1, 1, 2].last.should == 2
+  end
+  
+  it "returns nil if self is empty" do
+    [].last.should == nil
+  end
+  
+  it "returns the last count elements if given a count" do
+    [1, 2, 3, 4, 5, 9].last(3).should == [4, 5, 9]
+  end
+
+  it "returns an empty array when passed a count on an empty array" do
+    [].last(0).should == []
+    [].last(1).should == []
+  end
+  
+  it "returns an empty array when count == 0" do
+    [1, 2, 3, 4, 5].last(0).should == []
+  end
+
+  it "returns an array containing the last element when passed count == 1" do
+    [1, 2, 3, 4, 5].last(1).should == [5]
+  end
+
+  it "raises an ArgumentError when count is negative" do
+    lambda { [1, 2].last(-1) }.should raise_error(ArgumentError)
+  end
+  
+  it "returns the entire array when count > length" do
+    [1, 2, 3, 4, 5, 9].last(10).should == [1, 2, 3, 4, 5, 9]
+  end
+
+  it "returns an array which is independent to the original when passed count" do
+    ary = [1, 2, 3, 4, 5]
+    ary.last(0).replace([1,2])
+    ary.should == [1, 2, 3, 4, 5]
+    ary.last(1).replace([1,2])
+    ary.should == [1, 2, 3, 4, 5]
+    ary.last(6).replace([1,2])
+    ary.should == [1, 2, 3, 4, 5]
+  end
+
+  it "properly handles recursive arrays" do
+    empty = ArraySpecs.empty_recursive_array
+    empty.last.should equal(empty)
+
+    array = ArraySpecs.recursive_array
+    array.last.should equal(array)
+  end
+
+  it "tries to convert the passed argument to an Integer usinig #to_int" do
+    obj = mock('to_int')
+    obj.should_receive(:to_int).and_return(2)
+    [1, 2, 3, 4, 5].last(obj).should == [4, 5]
+  end
+
+  it "raises a TypeError if the passed argument is not numeric" do
+    lambda { [1,2].last(nil) }.should raise_error(TypeError)
+    lambda { [1,2].last("a") }.should raise_error(TypeError)
+
+    obj = mock("nonnumeric")
+    lambda { [1,2].last(obj) }.should raise_error(TypeError)
+  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
+  end
+
+  it "is not destructive" do
+    a = [1, 2, 3]
+    a.last
+    a.should == [1, 2, 3]
+    a.last(2)
+    a.should == [1, 2, 3]
+    a.last(3)
+    a.should == [1, 2, 3]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/length'
+
+describe "Array#length" do
+  it_behaves_like(:array_length, :length)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/map_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/map_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/map_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/collect'
+
+describe "Array#map" do
+  it_behaves_like(:array_collect, :map)
+end
+
+describe "Array#map!" do
+  it_behaves_like(:array_collect_b, :map!)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/minus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/minus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/minus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,80 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#-" do
+  it "creates an array minus any items from other array" do
+    ([] - [ 1, 2, 4 ]).should == []
+    ([1, 2, 4] - []).should == [1, 2, 4]
+    ([ 1, 2, 3, 4, 5 ] - [ 1, 2, 4 ]).should == [3, 5]
+  end
+
+  it "removes multiple items on the lhs equal to one on the rhs" do
+    ([1, 1, 2, 2, 3, 3, 4, 5] - [1, 2, 4]).should == [3, 3, 5]
+  end
+
+  ruby_bug "#", "1.8.6.277" do
+    it "properly handles recursive arrays" do
+      empty = ArraySpecs.empty_recursive_array
+      (empty - empty).should == []
+
+      ([] - ArraySpecs.recursive_array).should == []
+
+      array = ArraySpecs.recursive_array
+      (array - array).should == []
+    end
+  end
+
+  it "tries to convert the passed arguments to Arrays using #to_ary" do
+    obj = mock('[2,3,3,4]')
+    obj.should_receive(:to_ary).and_return([2, 3, 3, 4])
+    ([1, 1, 2, 2, 3, 4] - obj).should == [1, 1]
+  end
+
+  it "raises a TypeError if the argument cannot be coerced to an Array by calling #to_ary" do
+    obj = mock('not an array')
+    lambda { [1, 2, 3] - obj }.should raise_error(TypeError)
+  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
+  end
+
+  it "does not call to_ary on array subclasses" do
+    ([5, 6, 7] - ArraySpecs::ToAryArray[7]).should == [5, 6]
+  end
+
+  # MRI follows hashing semantics here, so doesn't actually call eql?/hash for Fixnum/Symbol
+  it "acts as if using an  intermediate hash to collect values" do
+    ([5.0, 4.0] - [5, 4]).should == [5.0, 4.0]
+    str = "x"
+    ([str] - [str.dup]).should == []
+    
+    obj1 = mock('1')
+    obj2 = mock('2')
+    def obj1.hash; 0; end
+    def obj2.hash; 0; end
+    def obj1.eql? a; true; end
+    def obj2.eql? a; true; end
+    
+    ([obj1] - [obj2]).should == []
+    
+    def obj1.eql? a; false; end
+    def obj2.eql? a; false; end
+    
+    ([obj1] - [obj2]).should == [obj1]
+  end
+
+  it "is not destructive" do
+    a = [1, 2, 3]
+    a - []
+    a.should == [1, 2, 3]
+    a - [1]
+    a.should == [1, 2, 3]
+    a - [1,2,3]
+    a.should == [1, 2, 3]
+    a - [:a, :b, :c]
+    a.should == [1, 2, 3]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/multiply_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/multiply_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/multiply_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,130 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require  File.dirname(__FILE__) + '/shared/join'
+
+describe "Array#*" do
+  it "tries to convert the passed argument to a String using #to_str" do
+    obj = mock('separator')
+    obj.should_receive(:to_str).and_return('::')
+    ([1, 2, 3, 4] * obj).should == '1::2::3::4'
+  end
+
+  it "tires to convert the passed argument to an Integer using #to_int" do
+    obj = mock('count')
+    obj.should_receive(:to_int).and_return(2)
+    ([1, 2, 3, 4] * obj).should == [1, 2, 3, 4, 1, 2, 3, 4]
+  end
+
+  it "raises a TypeError if the argument can neither be converted to a string nor an integer" do
+    obj = mock('not a string or integer')
+    lambda{ [1,2] * obj }.should raise_error(TypeError)
+  end
+
+  it "converts the passed argument to a String rather than an Integer" do
+    obj = mock('2')
+    def obj.to_int() 2 end
+    def obj.to_str() "2" end
+    ([:a, :b, :c] * obj).should == "a2b2c"
+  end
+
+  it "raises a TypeError is the passed argument is nil" do
+    lambda{ [1,2] * nil }.should raise_error(TypeError)
+  end
+
+  it "raises an ArgumentError when passed 2 or more arguments" do
+    lambda{ [1,2].send(:*, 1, 2) }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError when passed no arguments" do
+    lambda{ [1,2].send(:*) }.should raise_error(ArgumentError)
+  end
+end
+
+describe "Array#* with an integer" do
+  it "concatenates n copies of the array when passed an integer" do
+    ([ 1, 2, 3 ] * 0).should == []
+    ([ 1, 2, 3 ] * 1).should == [1, 2, 3]
+    ([ 1, 2, 3 ] * 3).should == [1, 2, 3, 1, 2, 3, 1, 2, 3]
+    ([] * 10).should == []
+  end
+
+  it "does not return self even if the passed integer is 1" do
+    ary = [1, 2, 3]
+    (ary * 1).should_not equal(ary)
+  end
+  
+  it "properly handles recursive arrays" do
+    empty = ArraySpecs.empty_recursive_array
+    (empty * 0).should == []
+    (empty * 1).should == empty
+    (empty * 3).should == [empty, empty, empty]
+
+    array = ArraySpecs.recursive_array
+    (array * 0).should == []
+    (array * 1).should == array
+  end
+
+  it "raises an ArgumentError when passed a negative integer" do
+    lambda { [ 1, 2, 3 ] * -1 }.should raise_error(ArgumentError)
+    lambda { [] * -1 }.should raise_error(ArgumentError)
+  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
+  end
+
+  ruby_version_is '' ... '1.8' do
+    it "does not copy the taint status of the original array if the passed count is 0" do
+      ary = [1, 2, 3]
+      ary.taint
+      (ary * 0).tainted?.should == false
+    end
+  end
+  ruby_version_is '1.9' do
+    it "copies the taint status of the original array even if the passed count is 0" do
+      ary = [1, 2, 3]
+      ary.taint
+      (ary * 0).tainted?.should == true
+    end
+  end
+
+  it "copies the taint status of the original array even if the array is empty" do
+    ary = []
+    ary.taint
+    (ary * 3).tainted?.should == true
+  end
+
+  it "copies the taint status of the original array if the passed count is not 0" do
+    ary = [1, 2, 3]
+    ary.taint
+    (ary * 1).tainted?.should == true
+    (ary * 2).tainted?.should == true
+  end
+
+  ruby_version_is '1.9' do
+    it "copies the untrusted status of the original array even if the passed count is 0" do
+      ary = [1, 2, 3]
+      ary.untrust
+      (ary * 0).untrusted?.should == true
+    end
+
+    it "copies the untrusted status of the original array even if the array is empty" do
+      ary = []
+      ary.untrust
+      (ary * 3).untrusted?.should == true
+    end
+
+    it "copies the untrusted status of the original array if the passed count is not 0" do
+      ary = [1, 2, 3]
+      ary.untrust
+      (ary * 1).untrusted?.should == true
+      (ary * 2).untrusted?.should == true
+    end
+  end
+end
+
+describe "Array#* with a string" do
+  it_behaves_like :array_join, :*
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,127 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array.new" do
+  it "returns an instance of Array" do
+    Array.new.class.should == Array
+  end
+
+  it "returns an instance of a subclass" do
+    ArraySpecs::MyArray.new.class.should == ArraySpecs::MyArray
+  end
+
+  it "raise an ArgumentError if passed 3 or more arguments" do
+    lambda do
+      [1, 2].send :initialize, 1, 'x', true
+    end.should raise_error(ArgumentError)
+    lambda do
+      [1, 2].send(:initialize, 1, 'x', true) {}
+    end.should raise_error(ArgumentError)
+  end
+end
+
+describe "Array.new with no arguments" do
+  it "returns an empty array" do
+    Array.new.should be_empty
+  end
+
+  it "does not use the given block" do
+    lambda{ Array.new { raise } }.should_not raise_error
+  end
+end
+
+describe "Array.new with (array)" do
+  it "returns an array initialized to the other array" do
+    b = [4, 5, 6]
+    Array.new(b).should == b
+  end
+
+  it "does not use the given block" do
+    lambda{ Array.new([1, 2]) { raise } }.should_not raise_error
+  end
+
+  it "calls #to_ary to convert the value to an array" do
+    a = mock("array")
+    a.should_receive(:to_ary).and_return([1, 2])
+    a.should_not_receive(:to_int)
+    Array.new(a).should == [1, 2]
+  end
+
+  it "does not call #to_ary on instances of Array or subclasses of Array" do
+    a = [1, 2]
+    a.should_not_receive(:to_ary)
+    Array.new(a)
+  end
+
+  it "raises a TypeError if an Array type argument and a default object" do
+    lambda { Array.new([1, 2], 1) }.should raise_error(TypeError)
+  end
+end
+
+describe "Array.new with (size, object=nil)" do
+  it "returns an array of size filled with object" do
+    obj = [3]
+    a = Array.new(2, obj)
+    a.should == [obj, obj]
+    a[0].should equal(obj)
+    a[1].should equal(obj)
+  end
+
+  it "returns an array of size filled with nil when object is omitted" do
+    Array.new(3).should == [nil, nil, nil]
+  end
+
+  it "raises an ArgumentError if size is negative" do
+    lambda { Array.new(-1, :a) }.should raise_error(ArgumentError)
+    lambda { Array.new(-1) }.should raise_error(ArgumentError)
+  end
+
+  platform_is :wordsize => 32 do
+    it "raises an ArgumentError if size is too large" do
+      max_size = ArraySpecs.max_32bit_size
+      lambda { Array.new(max_size + 1) }.should raise_error(ArgumentError)
+    end
+  end
+
+  platform_is :wordsize => 64 do
+    it "raises an ArgumentError if size is too large" do
+      max_size = ArraySpecs.max_64bit_size
+      lambda { Array.new(max_size + 1) }.should raise_error(ArgumentError)
+    end
+  end
+
+  it "calls #to_int to convert the size argument to an Integer when object is given" do
+    obj = mock('1')
+    obj.should_receive(:to_int).and_return(1)
+    Array.new(obj, :a).should == [:a]
+  end
+
+  it "calls #to_int to convert the size argument to an Integer when object is not given" do
+    obj = mock('1')
+    obj.should_receive(:to_int).and_return(1)
+    Array.new(obj).should == [nil]
+  end
+
+  it "raises a TypeError if the size argument is not an Integer type" do
+    obj = mock('nonnumeric')
+    obj.stub!(:to_ary).and_return([1, 2])
+    lambda{ Array.new(obj, :a) }.should raise_error(TypeError)
+  end
+
+  it "yields the index of the element and sets the element to the value of the block" do
+    Array.new(3) { |i| i.to_s }.should == ['0', '1', '2']
+  end
+
+  it "uses the block value instead of using the default value" do
+    Array.new(3, :obj) { |i| i.to_s }.should == ['0', '1', '2']
+  end
+
+  it "returns the value passed to break" do
+    a = Array.new(3) do |i|
+      break if i == 2
+      i.to_s
+    end
+
+    a.should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/nitems_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/nitems_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/nitems_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+# Array#nitems was removed from Ruby 1.9.
+ruby_version_is '' ... '1.9' do
+  describe "Array#nitems" do
+    it "returns the number of non-nil elements" do
+      [nil].nitems.should == 0
+      [].nitems.should == 0    
+      [1, 2, 3, nil].nitems.should == 3
+      [1, 2, 3].nitems.should == 3
+      [1, nil, 2, 3, nil, nil, 4].nitems.should == 4
+      [1, nil, 2, false, 3, nil, nil, 4].nitems.should == 5
+    end
+
+    it "properly handles recursive arrays" do
+      empty = ArraySpecs.empty_recursive_array
+      empty.nitems.should == 1
+
+      array = ArraySpecs.recursive_array
+      array.nitems.should == 8
+
+      [nil, empty, array].nitems.should == 2
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/pack_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/pack_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/pack_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2544 @@
+# -*- coding: ISO-8859-1 -*-
+#             ~~~~~~~~~~  
+# Script encoding of this file should be neither ASCII-8BIT, US-ASCII nor UTF-8.
+# This makes it easier to verify that Strings are converted into correct encodings.
+
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+if ENV['MRI'] then
+  $: << 'kernel/core'
+  require 'pack'
+end
+
+ruby_version_is '' ... '1.9' do
+  def binary(str) str end
+  def utf8(str) str end
+end
+ruby_version_is '1.9' do
+  def binary(str) str.force_encoding(Encoding::ASCII_8BIT) end
+  def utf8(str) str.force_encoding(Encoding::UTF_8) end
+end
+
+
+# general behavior
+
+describe "Array#pack" do
+  it "returns a String" do
+    ["abc", "def"].pack("A*").should be_kind_of(String)
+  end
+
+  it "raises an ArgumentError with ('%')" do
+    lambda { [].pack("%") }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError on empty array" do
+    ['A', 'a', 'B', 'b', 'C', 'c', 'D', 'd',
+     'E', 'e', 'F', 'f', 'G', 'g', 'H', 'h',
+     'I', 'i', 'L', 'l', 'M', 'm', 'N', 'n',
+     'Q', 'q', 'U', 'u','w', 'Z'].each { |pat|
+       lambda { [].pack(pat) }.should raise_error(ArgumentError)
+     }
+  end
+
+  it "sequentially processes each pack format, which consumes element in the array, and finally concatenates their result" do
+    ["abc", 1, 2, 3, '01000001', 0x20].pack('Av2NB8c').should ==
+      binary("a\x01\x00\x02\x00\x00\x00\x00\x03A ")
+  end
+
+  it "just ignores unknown format" do
+    lambda{ [].pack("2") }.should_not raise_error
+    lambda{ [].pack("J") }.should_not raise_error
+    lambda{ [].pack("\xFF") }.should_not raise_error
+    ["abc", "def"].pack("A\x7EA").should == "ad"
+  end
+
+  it "ignores white spaces" do
+    ["abc", 1, 2, 3, '01000001', 0x20, 0x61].pack("A  \f   v2\tN\rB8\nc\vC").should ==
+      binary("a\x01\x00\x02\x00\x00\x00\x00\x03A a")
+  end
+
+  it "treats a white space as a separator of formats" do
+    ["abc", "def"].pack("A 3A").should == "ad"
+  end
+
+  it "skips everything till the end of line (LF) string with ('#')" do
+    ["abc", "def"].pack("A*#A10%").should == "abc"
+    ["abc", "def"].pack("A*#junk junk junk junk junk\nA10").should == "abcdef       "
+    ["abc", "def"].pack("A*#junk junk junk junk junk\rA10").should == "abc"
+  end
+
+  ruby_version_is '1.8.8' do
+    it "returns a tainted string when the format is tainted" do
+      ["abcd", 0x20].pack("A3C".taint).tainted?.should be_true
+    end
+
+    it "returns a tainted string when the format is tainted even if the given format is empty" do
+      ["abcd", 0x20].pack("".taint).tainted?.should be_true
+    end
+  end
+
+  it "returns a tainted string when a pack argument is tainted" do
+    ["abcd".taint, 0x20].pack("A3C").tainted?.should be_true
+  end
+
+  it "returns a not tainted string even if the array is tainted" do
+    ["abcd", 0x20].taint.pack("A3C").tainted?.should be_false
+  end
+
+  ruby_version_is '1.9' do
+    it "returns a untrusted string when the format is untrusted" do
+      ["abcd", 0x20].pack("A3C".untrust).untrusted?.should be_true
+    end
+
+    it "returns a untrusted string when the format is untrusted even if the given format is empty" do
+      ["abcd", 0x20].pack("".untrust).untrusted?.should be_true
+    end
+
+    it "returns a untrusted string when a pack argument is untrusted" do
+      ["abcd".untrust, 0x20].pack("A3C").untrusted?.should be_true
+    end
+
+    it "returns a trusted string even if the array is untrusted" do
+      ["abcd", 0x20].untrust.pack("A3C").untrusted?.should be_false
+    end
+
+    it "returns a string in encoding of common to the concatenated results" do
+      ["\u{3042 3044 3046 3048}", 0x2000B].pack("A*U").encoding.should == Encoding::UTF_8
+      ["abcde\xd1", "\xFF\xFe\x81\x82"].pack("A*u").encoding.should == Encoding::ISO_8859_1
+      ["abcde".encode(Encoding::US_ASCII), "\xFF\xFe\x81\x82"].pack("A*u").encoding.should == Encoding::US_ASCII
+      # under discussion [ruby-dev:37294]
+      #   ["\u{3042 3044 3046 3048}", 1].pack("A*N").encoding.should == Encoding::ASCII_8BIT
+    end
+  end
+
+  # Scenario taken from Mongrel's use of the SO_ACCEPTFILTER struct
+  it "reuses last array element as often as needed to complete the string" do
+    expected = "httpready" + ("\000" * 247)
+    ['httpready', nil].pack('a16a240').should == expected
+  end
+end
+
+describe "Array#pack with the empty format" do
+  it "returns an empty string" do
+    [1, 2, 3, true].pack("").should == ""
+  end
+
+  ruby_version_is '1.9' do
+    it "returns an ASCII-8BIT" do
+      [1, 2, 3, true].pack("").encoding.should == Encoding::ASCII_8BIT
+    end
+  end
+end
+
+# string to string formats
+
+describe "Array#pack with ASCII-string format", :shared => true do
+  before do
+    @format = @method
+    def self.format(count = nil)
+      "#{@format}#{count}"
+    end
+  end
+
+  it "returns a String" do
+    ["abc"].pack(format).should be_kind_of(String)
+  end
+
+  it "cuts string if its size greater than directive count" do
+    ['abcde'].pack(format(3)).should == 'abc'
+  end
+
+  it "considers count = 1 if count omited" do
+    ['abcde'].pack(format).should == 'a'
+  end
+
+  it "returns empty string if count = 0 with" do
+    ['abcde'].pack(format(0)).should == ''
+  end
+
+  it "returns the whole argument string with star parameter" do
+    ['abcdef'].pack(format('*')).should == 'abcdef'
+  end
+
+  it "comsumres only one array item per a format" do
+    ["abc", "def"].pack(format('*')).should == "abc"
+    ["abc", "def"].pack(format('*')+format('*')).should == "abcdef"
+  end
+
+  it "tries to convert the pack argument to a String using #to_str" do
+    obj = mock('to_str')
+    obj.should_receive(:to_str).and_return("abc")
+    [obj].pack(format).should == "a"
+  end
+
+  it "raises a TypeError if array item is not String with ('A<count>')" do
+    lambda { [123].pack(format(5)) }.should raise_error(TypeError)
+    lambda { [:hello].pack(format(5)) }.should raise_error(TypeError)
+    lambda { [mock('not string')].pack(format(5)) }.should raise_error(TypeError)
+  end
+
+  ruby_version_is '1.9' do
+    it "treats a multibyte character just as a byte sequence" do
+      s = "\u3042\u3044\u3046\u3048"
+      [s].pack(format('*')).bytes.to_a.should == s.bytes.to_a
+      [s].pack(format('3')).bytesize.should == 3
+
+      # example of dummy encoding
+      s = "\u3042".encode(Encoding::UTF_32BE)
+      [s].pack(format('*')).bytes.to_a.should == s.bytes.to_a
+
+      # example of stateful encoding
+      s = "\u3042".encode(Encoding::ISO_2022_JP)
+      [s].pack(format('*')).bytes.to_a.should == s.bytes.to_a
+    end
+
+    # This feature is under discussion - [ruby-dev:37278]
+    it "keeps encoding of source strings" do
+      # ISO-8859-1
+      ["abcd"].pack(format).encoding.should == "abcd".encoding
+      # UTF-8
+      ["\u3042"].pack(format).encoding.should == "\u3042".encoding
+      # example of dummy encoding
+      ["\u3042".encode(Encoding::UTF_32BE)].pack(format).encoding.should == Encoding::UTF_32BE
+      # example of stateful encoding
+      ["\u3042".encode(Encoding::ISO_2022_JP)].pack(format).encoding.should == Encoding::ISO_2022_JP
+    end
+
+    # This feature is under discussion - [ruby-dev:37278]
+    it "cuts byte sequence even if it breaks a multibyte character" do
+      ["\u3042"].pack(format).should == utf8("\xe3")
+      ["\u3042".encode(Encoding::UTF_32BE)].pack(format(2)).should == "\x00\x00".force_encoding(Encoding::UTF_32BE)
+      ["\u3042".encode(Encoding::ISO_2022_JP)].pack(format(4)).should == "\e$B$".force_encoding(Encoding::ISO_2022_JP)
+    end
+  end
+end
+
+describe "Array#pack with format 'A'" do
+  it_behaves_like "Array#pack with ASCII-string format", 'A'
+
+  it "returns space padded string" do
+    ['abcde'].pack('A7').should == 'abcde  '
+  end
+end
+
+describe "Array#pack with format 'a'" do
+  it_behaves_like "Array#pack with ASCII-string format", 'a'
+
+  it "returns null padded string with ('a<count>')" do
+    ['abcdef'].pack('a7').should == "abcdef\x0"
+  end
+end
+
+describe "Array#pack with format 'Z'" do
+  it_behaves_like "Array#pack with ASCII-string format", 'a'
+
+  it "returns null padded string with ('a<count>')" do
+    ['abcdef'].pack('a7').should == "abcdef\x0"
+  end
+end
+
+describe "Array#pack with format 'B'" do
+  it "returns packed bit-string descending order" do
+    ["011000010110001001100011"].pack('B24').should == binary('abc')
+  end
+
+  # [ruby-dev:37279]
+  it "accepts characters other than 0 or 1 for compatibility to perl" do
+    lambda{ ["abbbbccddefffgghiijjjkkl"].pack('B24') }.should_not raise_error
+  end
+  ruby_version_is '1.9' do
+    it "treats the pack argument as a byte sequence when its characters are other than 0 or 1" do
+      ["\u3042"*8].pack('B*').length.should == "\u3042".bytesize * 8 / 8
+    end
+  end
+
+  it "conversion edge case: all zeros" do
+    ["00000000"].pack('B8').should == binary("\000")
+  end
+
+  it "conversion edge case: all ones" do
+    ["11111111"].pack('B8').should == binary("\xFF")
+  end
+
+  it "conversion edge case: left one" do
+    ["10000000"].pack('B8').should == binary("\x80")
+  end
+
+  it "conversion edge case: right one" do
+    ["00000001"].pack('B8').should == binary("\x01")
+  end
+
+  it "conversion edge case: edge sequences not in first char" do
+    ["0000000010000000000000011111111100000000"].pack('B40').should == binary("\x00\x80\x01\xFF\x00")
+  end
+
+  it "uses zeros if count is not multiple of 8" do
+    ["00111111"].pack('B4').should == ["00110000"].pack('B8')
+  end
+
+  it "returns zero-char for each 2 of count that greater than string length" do
+    [""].pack('B6').should == binary("\x00\x00\x00")
+  end
+
+  it "returns extra zero char if count is odd and greater than string length" do
+    [""].pack('B7').should == binary("\x00\x00\x00\x00")
+  end
+
+  it "starts new char if string is ended before char's 8 bits" do
+    ["0011"].pack('B8').should == binary("0\x00\x00")
+  end
+
+  it "considers count = 1 if no explicit count it given" do
+    ["10000000"].pack('B').should == ["10000000"].pack('B1')
+    ["01000000"].pack('B').should == ["01000000"].pack('B1')
+  end
+
+  it "returns empty string if count = 0" do
+    ["10101010"].pack('B0').should == binary("")
+  end
+
+  it "uses argument string length as count if count = *" do
+    ["00111111010"].pack('B*').should == ["00111111010"].pack('B11')
+  end
+
+  it "consumes only one array item per a format" do
+    ["0011", "1111"].pack('B*').should == ["0011"].pack('B4')
+    ["0011", "1011"].pack('B*B*').should == ["0011"].pack('B4') + ["1011"].pack('B4')
+  end
+
+  it "raises a TypeError if corresponding array item is not String" do
+    lambda { [123].pack('B8') }.should raise_error(TypeError)
+    lambda { [:data].pack('B8') }.should raise_error(TypeError)
+    lambda { [mock('not string')].pack('B8') }.should raise_error(TypeError)
+  end
+
+  ruby_version_is '1.9' do
+    it "returns an ASCII-8BIT string" do
+      ["01000001"].pack("B").encoding.should == Encoding::ASCII_8BIT # ASCII "A"
+      ["11111111"].pack("B").encoding.should == Encoding::ASCII_8BIT # invalid as ASCII 
+      ["1111111010000000000000011000000000000010"].pack("B").encoding.should == Encoding::ASCII_8BIT # valid as UTF-8
+    end
+  end
+end
+
+
+describe "Array#pack with format 'b'" do
+  it "returns packed bit-string descending order" do
+    ["100001100100011011000110"].pack('b24').should == binary('abc')
+  end
+
+  it "conversion edge case: all zeros" do
+    ["00000000"].pack('b8').should == binary("\x00")
+  end
+
+  it "conversion edge case: all ones" do
+    ["11111111"].pack('b8').should == binary("\xFF")
+  end
+
+  it "conversion edge case: left one" do
+    ["10000000"].pack('b8').should == binary("\x01")
+  end
+
+  it "conversion edge case: right one" do
+    ["00000001"].pack('b8').should == binary("\x80")
+  end
+
+  it "conversion edge case: edge sequences not in first char" do
+    ["0000000010000000000000011111111100000000"].pack('b40').should == binary("\x00\x01\x80\xFF\x00")
+  end
+
+  # [ruby-dev:37279]
+  it "accepts characters other than 0 or 1 for compatibility to perl" do
+    lambda{ ["abbbbccddefffgghiijjjkkl"].pack('b24') }.should_not raise_error
+  end
+  ruby_version_is '1.9' do
+    it "treats the pack argument as a byte sequence when its characters are other than 0 or 1" do
+      ["\u3042"*8].pack('b*').length.should == "\u3042".bytesize * 8 / 8
+    end
+  end
+
+  it "uses zeros if count is not multiple of 8" do
+    ["00111111"].pack('b4').should == ["00110000"].pack('b8')
+  end
+
+  it "returns zero-char for each 2 of count that greater than string length" do
+    [""].pack('b6').should == binary("\x00\x00\x00")
+  end
+
+  it "returns extra zero char if count is odd and greater than string length" do
+    [""].pack('b7').should == binary("\x00\x00\x00\x00")
+  end
+
+  it "starts new char if argument string is ended before char's 8 bits" do
+    ["0011"].pack('b8').should == binary("\x0C\x00\x00")
+  end
+
+  it "considers count = 1 if no explicit count it given" do
+    ["10000000"].pack('b').should == ["10000000"].pack('b1')
+    ["01000000"].pack('b').should == ["01000000"].pack('b1')
+  end
+
+  it "returns empty string if count = 0" do
+    ["10101010"].pack('b0').should == binary("")
+  end
+
+  it "uses argument string length as count if count = *" do
+    ["00111111010"].pack('b*').should == ["00111111010"].pack('b11')
+  end
+
+  it "consumes only one array item per a format" do
+    ["0011", "1111"].pack('b*').should == ["0011"].pack('b4')
+    ["0011", "1011"].pack('b*b*').should == ["0011"].pack('b4') + ["1011"].pack('b4')
+  end
+
+  it "raises a TypeError if corresponding array item is not String" do
+    lambda { [123].pack('b8') }.should raise_error(TypeError)
+    lambda { [:data].pack('b8') }.should raise_error(TypeError)
+    lambda { [mock('not string')].pack('b8') }.should raise_error(TypeError)
+  end
+
+  ruby_version_is '1.9' do
+    it "returns an ASCII-8BIT string" do
+      ["10000010"].pack("b").encoding.should == Encoding::ASCII_8BIT # ASCII "A"
+      ["11111111"].pack("b").encoding.should == Encoding::ASCII_8BIT # invalid as ASCII 
+      ["1111111010000000000000011000000000000010"].pack("b").encoding.should == Encoding::ASCII_8BIT # valid as UTF-8
+    end
+  end
+end
+
+describe "Array#pack with format 'H'" do
+  it "encodes hexadecimal digits to byte sequence in the order of high-nibble first" do
+    ["41"].pack("H2").should == binary("\x41")
+    ["61"].pack("H2").should == binary("\x61")
+    ["7e"].pack("H2").should == binary("\x7E")
+    ["7E"].pack("H2").should == binary("\x7E")
+    ["1"].pack("H").should == binary("\x10")
+    ["7E1"].pack("H3").should == binary("\x7E\x10")
+  end
+
+  it "ignores rest of the pack argument when the argument is too long" do
+    ["41424344"].pack('H2').should == binary("\x41")
+    ["41424344"].pack('H4').should == binary("\x41\x42")
+  end
+
+  it "fills low-nibble of the last byte with 0 when count is odd" do
+    ["41424344"].pack('H3').should == binary("\x41\x40")
+    ["41424344"].pack('H5').should == binary("\x41\x42\x40")
+  end
+
+  it "fills the rest bytes with 0 if pack argument has insufficient length" do
+    ["4142"].pack("H4").should == binary("\x41\x42")
+    ["4142"].pack("H5").should == binary("\x41\x42\x00")
+    ["4142"].pack("H6").should == binary("\x41\x42\x00")
+    ["4142"].pack("H7").should == binary("\x41\x42\x00\x00")
+  end
+
+  ruby_bug("[ruby-dev:37283]", "1.8.7.73") do
+    it "fills low-nibble of the last byte with 0 when count is odd even if pack argument has insufficient length" do 
+      ["414"].pack("H3").should == binary("\x41\x40")
+      ["414"].pack("H4").should == binary("\x41\x40")
+      ["414"].pack("H5").should == binary("\x41\x40\x00")
+      ["414"].pack("H6").should == binary("\x41\x40\x00")
+    end
+  end
+
+  it "considers count = 1 if count omited" do
+    ['41'].pack('H').should == "\x40"
+  end
+
+  it "returns empty string if count = 0 with" do
+    ['4142'].pack('H0').should == ''
+  end
+
+  it "returns the whole argument string with star parameter" do
+    ['414243444546'].pack('H*').should == binary("\x41\x42\x43\x44\x45\x46")
+  end
+
+  it "consumes only one array item per a format" do
+    %w(41 31 2a).pack("H2").should == binary("\x41")
+    %w(41 31 2a).pack("H2H2H2").should == binary("\x41\x31\x2A")
+    %w(41 31 2a).pack("H6").should == binary("\x41\x00\x00")
+  end
+
+  it "tries to convert the pack argument to a String using #to_str" do
+    obj = mock('to_str')
+    obj.should_receive(:to_str).and_return("41")
+    [obj].pack('H2').should == "\x41"
+  end
+
+  ruby_version_is '1.9' do
+    it "returns an ASCII-8BIT string" do
+      ["41"].pack("H").encoding.should == Encoding::ASCII_8BIT
+    end
+  end
+end
+
+describe "Array#pack with format 'h'" do
+  it "encodes hexadecimal digits to byte sequence in the order of low-nibble first" do
+    ["14"].pack("h2").should == binary("\x41")
+    ["16"].pack("h2").should == binary("\x61")
+    ["e7"].pack("h2").should == binary("\x7E")
+    ["E7"].pack("h2").should == binary("\x7E")
+    ["1"].pack("h").should == binary("\x01")
+    ["E71"].pack("h3").should == binary("\x7E\x01")
+  end
+
+  it "ignores rest of the pack argument when the argument is too long" do
+    ["14243444"].pack('h2').should == binary("\x41")
+    ["14243444"].pack('h4').should == binary("\x41\x42")
+  end
+
+  it "fills low-nibble of the last byte with 0 when count is odd" do
+    ["14243444"].pack('h3').should == binary("\x41\x02")
+    ["14243444"].pack('h5').should == binary("\x41\x42\x03")
+  end
+
+  it "fills the rest bytes with 0 if pack argument has insufficient length" do
+    ["1424"].pack("h4").should == binary("\x41\x42")
+    ["1424"].pack("h5").should == binary("\x41\x42\x00")
+    ["1424"].pack("h6").should == binary("\x41\x42\x00")
+    ["1424"].pack("h7").should == binary("\x41\x42\x00\x00")
+  end
+
+  ruby_bug("[ruby-dev:37283]", "1.8.7.73") do
+    it "fills high-nibble of the last byte with 0 when count is odd even if pack argument has insufficient length" do 
+      ["142"].pack("h3").should == binary("\x41\x02")
+      ["142"].pack("h4").should == binary("\x41\x02")
+      ["142"].pack("h5").should == binary("\x41\x02\x00")
+      ["142"].pack("h6").should == binary("\x41\x02\x00")
+    end
+  end
+
+  it "considers count = 1 if count omited" do
+    ['14'].pack('h').should == "\x01"
+  end
+
+  it "returns empty string if count = 0 with" do
+    ['1424'].pack('h0').should == ''
+  end
+
+  it "returns the whole argument string with star parameter" do
+    ['142434445464'].pack('h*').should == binary("\x41\x42\x43\x44\x45\x46")
+  end
+
+  it "consumes only one array item per a format" do
+    %w(14 13 a2).pack("h2").should == binary("\x41")
+    %w(14 13 a2).pack("h2h2h2").should == binary("\x41\x31\x2A")
+    %w(14 13 a2).pack("h6").should == binary("\x41\x00\x00")
+  end
+
+  it "tries to convert the pack argument to a String using #to_str" do
+    obj = mock('to_str')
+    obj.should_receive(:to_str).and_return("14")
+    [obj].pack('h2').should == "\x41"
+  end
+
+  ruby_version_is '1.9' do
+    it "returns an ASCII-8BIT string" do
+      ["14"].pack("h").encoding.should == Encoding::ASCII_8BIT
+    end
+  end
+end
+
+
+
+
+#
+# shared behaviours for integer formats
+#
+
+describe "Array#pack with integer format which can not have platform dependent width", :shared => true do
+  before do
+    @format = @method
+    def self.format(count = nil)
+      "#{@format}#{count}"
+    end
+  end
+
+  it "raises ArgumentError when tails suffix '_'" do
+    lambda{ [1].pack("#{format}_") }.should raise_error(ArgumentError)
+  end
+
+  it "raises ArgumentError when tails suffix '!'" do
+    lambda{ [1].pack("#{format}!") }.should raise_error(ArgumentError)
+  end
+end
+
+describe "Array#pack with integer format (8bit)", :shared => true do
+  before do
+    @format = @method
+    def self.format(count = nil)
+      "#{@format}#{count}"
+    end
+  end
+
+  it "returns a string with byte of appropriate number" do
+    [49].pack(format).should == binary('1')
+  end
+
+  it "regards negative values as 2's complement in order to converts it to positive" do
+    [-1].pack(format).should == binary("\xFF")
+    [-(2**7)].pack(format).should == binary("\x80")
+  end
+
+  it "reduces value to fit in byte" do
+    [2**8-1].pack(format).should == binary("\xFF")
+    [2**8  ].pack(format).should == binary("\x00")
+    [2**8+1].pack(format).should == binary("\x01")
+
+    [-2**8+1].pack(format).should == binary("\x01")
+    [-2**8  ].pack(format).should == binary("\x00")
+    [-2**8-1].pack(format).should == binary("\xFF")
+  end
+
+  it "tries to convert the pack argument to an Integer using #to_int" do
+    [5.0].pack(format).should == binary("\x05")
+
+    obj = mock('to_int')
+    obj.should_receive(:to_int).and_return(5)
+    [obj].pack(format).should == binary("\x05")
+  end
+
+  not_compliant_on :rubinius do
+    ruby_version_is '' ... '1.9' do
+      it "accepts a Symbol as a pack argument because it responds to #to_int" do
+        [:hello].pack(format).should == [:hello.to_i].pack('C')
+      end
+    end
+  end
+
+  it "raises a TypeError if a pack argument can't be coerced to Integer" do
+    lambda { ["5"].pack(format) }.should raise_error(TypeError)
+
+    obj = mock('not an integer')
+    lambda { [obj].pack(format) }.should raise_error(TypeError)
+  end
+
+  it "processes count number of array elements if count given" do
+    [1, 2, 3].pack(format(3)).should == binary("\x01\x02\x03")
+    [1, 2, 3].pack(format(2) + format(1)).should == binary("\x01\x02\x03")
+  end
+
+  it "returns empty string if count = 0" do
+    [1, 2, 3].pack(format(0)).should == binary('')
+  end
+
+  it "with star parameter processes all remaining array items" do
+    [1, 2, 3, 4, 5].pack(format('*')).should == binary("\x01\x02\x03\x04\x05")
+  end
+
+  it "raises an ArgumentError if count is greater than array elements left" do
+    lambda { [1, 2].pack(format(3)) }.should raise_error(ArgumentError)
+  end
+
+  ruby_version_is '1.9' do
+    it "returns an ASCII-8BIT string" do
+      [0x41].pack(format).encoding.should == Encoding::ASCII_8BIT
+      [0xFF].pack(format).encoding.should == Encoding::ASCII_8BIT
+      [0xE3, 0x81, 0x82].pack(format(3)).encoding.should == Encoding::ASCII_8BIT
+    end
+  end
+end
+
+describe "Array#pack with integer format (16bit, little endian)", :shared => true do
+  before do
+    @format = @method
+    def self.format(count = nil)
+      "#{@format}#{count}"
+    end
+  end
+
+  it "returns a string containing 2 bytes for an integer" do
+    [0].pack(format).should == binary("\x00\x00")
+    [0xABCD].pack(format).should == binary("\xCD\xAB")
+  end
+
+  it "regards negative values as 2's complement in order to converts it to positive" do
+    [-1].pack(format).should == binary("\xFF\xFF")
+    [-2**15].pack(format).should == binary("\x00\x80")
+  end
+
+  it "drops higher bytes when a pack argument is >= 2**16" do
+    [2**16-1].pack(format).should == binary("\xFF\xFF")
+    [2**16  ].pack(format).should == binary("\x00\x00")
+    [2**16+1].pack(format).should == binary("\x01\x00")
+  end
+  it "drops higher bytes when a pack argument is < -2**16" do
+    [-2**16+1].pack(format).should == binary("\x01\x00")   # 0x ..F 00 01
+    [-2**16 ].pack(format).should == binary("\x00\x00")    # 0x ..F 00 00
+    [-2**16-1].pack(format).should == binary("\xFF\xFF")   # 0x .FE FF FF
+  end
+
+  ruby_version_is '' ... '1.9' do
+    platform_is :wordsize => 32 do
+      it "may raise a RangeError when a pack argument is >= 2**32" do
+        lambda { [2**32-1].pack(format) }.should_not raise_error(RangeError)
+        lambda { [2**32].pack(format) }.should raise_error(RangeError)
+      end
+
+      it "may raise a RangeError when a pack argument is <= -2**32" do
+        lambda { [-2**32+1].pack(format) }.should_not raise_error(RangeError)
+        lambda { [-2**32].pack(format) }.should raise_error(RangeError)
+      end
+    end
+    platform_is :wordsize => 64 do
+      it "may raise a RangeError when a pack argument is >= 2**64" do
+        lambda { [2**64-1].pack(format) }.should_not raise_error(RangeError)
+        lambda { [2**64].pack(format) }.should raise_error(RangeError)
+      end
+
+      it "may raise a RangeError when a pack argument is <= -2**64" do
+        lambda { [-2**64+1].pack(format) }.should_not raise_error(RangeError)
+        lambda { [-2**64].pack(format) }.should raise_error(RangeError)
+      end
+    end
+  end
+  # feature changed by MRI r5542 - [ruby-dev:22654].
+  ruby_version_is '1.9' do
+    platform_is :wordsize => 32 do
+      it "does not raise a RangeError even when a pack argument is >= 2**32" do
+        [2**32-1].pack(format).should == binary("\xFF\xFF")
+        [2**32  ].pack(format).should == binary("\x00\x00")
+        [2**32+1].pack(format).should == binary("\x01\x00")
+      end
+
+      it "does not raise a RangeError even when a pack argument is <= -2**32" do
+        [-2**32+1].pack(format).should == binary("\x01\x00")
+        [-2**32  ].pack(format).should == binary("\x00\x00")
+        [-2**32-1].pack(format).should == binary("\xFF\xFF")
+      end
+    end
+    platform_is :wordsize => 64 do
+      it "does not raise a RangeError even when a pack argument is >= 2**64" do
+        [2**64-1].pack(format).should == binary("\xFF\xFF")
+        [2**64  ].pack(format).should == binary("\x00\x00")
+        [2**64+1].pack(format).should == binary("\x00\x01")
+      end
+
+      it "does not raise a RangeError even when a pack argument is <= -2**64" do
+        [-2**64+1].pack(format).should == binary("\x01\x00")
+        [-2**64  ].pack(format).should == binary("\x00\x00")
+        [-2**64-1].pack(format).should == binary("\xFF\xFF")
+      end
+    end
+  end
+
+  it "tries to convert the pack argument to an Integer using #to_int" do
+    [5.0].pack(format).should == binary("\x05\x00")
+
+    obj = mock('to_int')
+    obj.should_receive(:to_int).and_return(5)
+    [obj].pack(format).should == binary("\x05\x00")
+  end
+
+  it "raises a TypeError if a pack argument can't be coerced to Integer" do
+    lambda { ["5"].pack(format) }.should raise_error(TypeError)
+
+    obj = mock('not an integer')
+    lambda { [obj].pack(format) }.should raise_error(TypeError)
+  end
+
+  it "processes count number of array elements if count given" do
+    [1, 2, 3].pack(format(3)).should == binary("\x01\x00\x02\x00\x03\x00")
+    [1, 2, 3].pack(format(2) + format(1)).should == binary("\x01\x00\x02\x00\x03\x00")
+  end
+
+  it "returns empty string if count = 0" do
+    [1, 2, 3].pack(format(0)).should == binary('')
+  end
+
+  it "with star parameter processes all remaining array items" do
+    [1, 2, 3, 4, 5].pack(format('*')).should == 
+      binary("\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00")
+  end
+
+  it "raises an ArgumentError if count is greater than array elements left" do
+    lambda { [1, 2].pack(format(3)) }.should raise_error(ArgumentError)
+  end
+
+  ruby_version_is '1.9' do
+    it "returns an ASCII-8BIT string" do
+      [0x41].pack(format).encoding.should == Encoding::ASCII_8BIT
+      [0xFF].pack(format).encoding.should == Encoding::ASCII_8BIT
+    end
+  end
+end
+
+describe "Array#pack with integer format (16bit, big endian)", :shared => true do
+  before do
+    @format = @method
+    def self.format(count = nil)
+      "#{@format}#{count}"
+    end
+  end
+
+  it "returns a string containing 2 bytes for an integer" do
+    [0].pack(format).should == binary("\x00\x00")
+    [0xABCD].pack(format).should == binary("\xAB\xCD")
+  end
+
+  it "regards negative values as 2's complement in order to converts it to positive" do
+    [-1].pack(format).should == binary("\xFF\xFF")
+    [-2**15].pack(format).should == binary("\x80\x00")
+  end
+
+  it "drops higher bytes when a pack argument is >= 2**32" do
+    [2**16-1].pack(format).should == binary("\xFF\xFF")
+    [2**16  ].pack(format).should == binary("\x00\x00")
+    [2**16+1].pack(format).should == binary("\x00\x01")
+  end
+
+  it "drops higher bytes when a pack argument is < -2**32" do
+    [-2**16+1].pack(format).should == binary("\x00\x01") # 0x ..F 00 01
+    [-2**16 ].pack(format).should == binary("\x00\x00")  # 0x ..F 00 00
+    [-2**16-1].pack(format).should == binary("\xFF\xFF") # 0x .FE FF FF
+  end
+
+  it "tries to convert the pack argument to an Integer using #to_int" do
+    [5.0].pack(format).should == binary("\x00\x05")
+
+    obj = mock('to_int')
+    obj.should_receive(:to_int).and_return(5)
+    [obj].pack(format).should == binary("\x00\x05")
+  end
+
+  ruby_version_is '' ... '1.9' do
+    platform_is :wordsize => 32 do
+      it "may raise a RangeError when a pack argument is >= 2**32" do
+        lambda { [2**32-1].pack(format) }.should_not raise_error(RangeError)
+        lambda { [2**32].pack(format) }.should raise_error(RangeError)
+      end
+
+      it "may raise a RangeError when a pack argument is <= -2**32" do
+        lambda { [-2**32+1].pack(format) }.should_not raise_error(RangeError)
+        lambda { [-2**32].pack(format) }.should raise_error(RangeError)
+      end
+    end
+    platform_is :wordsize => 64 do
+      it "may raise a RangeError when a pack argument is >= 2**64" do
+        lambda { [2**64-1].pack(format) }.should_not raise_error(RangeError)
+        lambda { [2**64].pack(format) }.should raise_error(RangeError)
+      end
+
+      it "may raise a RangeError when a pack argument is <= -2**64" do
+        lambda { [-2**64+1].pack(format) }.should_not raise_error(RangeError)
+        lambda { [-2**64].pack(format) }.should raise_error(RangeError)
+      end
+    end
+  end
+  # feature changed by MRI r5542 - [ruby-dev:22654].
+  ruby_version_is '1.9' do
+    platform_is :wordsize => 32 do
+      it "does not raise a RangeError even when a pack argument is >= 2**32" do
+        [2**32-1].pack(format).should == binary("\xFF\xFF")
+        [2**32  ].pack(format).should == binary("\x00\x00")
+        [2**32+1].pack(format).should == binary("\x00\x01")
+      end
+
+      it "does not raise a RangeError even when a pack argument is <= -2**32" do
+        [-2**32+1].pack(format).should == binary("\x00\x01")
+        [-2**32  ].pack(format).should == binary("\x00\x00")
+        [-2**32-1].pack(format).should == binary("\xFF\xFF")
+      end
+    end
+    platform_is :wordsize => 64 do
+      it "does not raise a RangeError even when a pack argument is >= 2**64" do
+        [2**64-1].pack(format).should == binary("\xFF\xFF")
+        [2**64  ].pack(format).should == binary("\x00\x00")
+        [2**64+1].pack(format).should == binary("\x00\x01")
+      end
+
+      it "does not raise a RangeError even when a pack argument is <= -2**64" do
+        [-2**64+1].pack(format).should == binary("\x00\x01")
+        [-2**64  ].pack(format).should == binary("\x00\x00")
+        [-2**64-1].pack(format).should == binary("\xFF\xFF")
+      end
+    end
+  end
+
+  it "raises a TypeError if a pack argument can't be coerced to Integer" do
+    lambda { ["5"].pack(format) }.should raise_error(TypeError)
+
+    obj = mock('not an integer')
+    lambda { [obj].pack(format) }.should raise_error(TypeError)
+  end
+
+  it "processes count number of array elements if count given" do
+    [1, 2, 3].pack(format(3)).should == binary("\x00\x01\x00\x02\x00\x03")
+    [1, 2, 3].pack(format(2) + format(1)).should == binary("\x00\x01\x00\x02\x00\x03")
+  end
+
+  it "returns empty string if count = 0" do
+    [1, 2, 3].pack(format(0)).should == binary('')
+  end
+
+  it "with star parameter processes all remaining array items" do
+    [1, 2, 3, 4, 5].pack(format('*')).should == 
+      binary("\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05")
+  end
+
+  it "raises an ArgumentError if count is greater than array elements left" do
+    lambda { [1, 2].pack(format(3)) }.should raise_error(ArgumentError)
+  end
+
+  ruby_version_is '1.9' do
+    it "returns an ASCII-8BIT string" do
+      [0x41].pack(format).encoding.should == Encoding::ASCII_8BIT
+      [0xFF].pack(format).encoding.should == Encoding::ASCII_8BIT
+    end
+  end
+end
+
+describe "Array#pack with integer format (32bit, little endian)", :shared => true do
+  before do
+    @format = @method
+    def self.format(count = nil)
+      "#{@format}#{count}"
+    end
+  end
+
+  it "returns a string containing 4 bytes for an integer" do
+    [0].pack(format).should == binary("\x00\x00\x00\x00")
+    [0xABCDEF01].pack(format).should == binary("\x01\xEF\xCD\xAB")
+  end
+
+  ruby_version_is '' ... '1.9' do
+    platform_is :wordsize => 32 do
+      it "raises a RangeError when a pack argument is >= 2**32" do
+        lambda { [2**32-1].pack(format) }.should_not raise_error(RangeError)
+        lambda { [2**32].pack(format) }.should raise_error(RangeError)
+      end
+
+      it "raises a RangeError when a pack argument is <= -2**32" do
+        lambda { [-2**32+1].pack(format) }.should_not raise_error(RangeError)
+        lambda { [-2**32].pack(format) }.should raise_error(RangeError)
+      end
+    end
+    platform_is :wordsize => 64 do
+      it "drops higher bytes when a pack argument is >= 2**32" do
+        [2**32-1].pack(format).should == binary("\xFF\xFF\xFF\xFF")
+        [2**32  ].pack(format).should == binary("\x00\x00\x00\x00")
+        [2**32+1].pack(format).should == binary("\x01\x00\x00\x00")
+      end
+
+      it "drops higher bytes when a pack argument is < -2**32" do
+        [-2**32+1].pack(format).should == binary("\x01\x00\x00\x00") # 0x ..F 00 00 00 01
+        [-2**32 ].pack(format).should == binary("\x00\x00\x00\x00")  # 0x ..F 00 00 00 00
+        [-2**32-1].pack(format).should == binary("\xFF\xFF\xFF\xFF") # 0x .FE FF FF FF FF
+      end
+    end
+  end
+  # feature changed by MRI r5542 - [ruby-dev:22654].
+  ruby_version_is '1.9' do
+    it "drops higher bytes when a pack argument is >= 2**32" do
+      [2**32-1].pack(format).should == binary("\xFF\xFF\xFF\xFF")
+      [2**32  ].pack(format).should == binary("\x00\x00\x00\x00")
+      [2**32+1].pack(format).should == binary("\x01\x00\x00\x00")
+    end
+
+    it "drops higher bytes when a pack argument is < -2**32" do
+      [-2**32+1].pack(format).should == binary("\x01\x00\x00\x00") # 0x ..F 00 00 00 01
+      [-2**32 ].pack(format).should == binary("\x00\x00\x00\x00")  # 0x ..F 00 00 00 00
+      [-2**32-1].pack(format).should == binary("\xFF\xFF\xFF\xFF") # 0x .FE FF FF FF FF
+    end
+  end
+
+  it "regards negative values as 2's complement in order to converts it to positive" do
+    [-1].pack(format).should == binary("\xFF\xFF\xFF\xFF")
+    [-2**31].pack(format).should == binary("\x00\x00\x00\x80")
+  end
+
+  it "tries to convert the pack argument to an Integer using #to_int" do
+    [5.0].pack(format).should == binary("\x05\x00\x00\x00")
+
+    obj = mock('to_int')
+    obj.should_receive(:to_int).and_return(5)
+    [obj].pack(format).should == binary("\x05\x00\x00\x00")
+  end
+
+  it "raises a TypeError if a pack argument can't be coerced to Integer" do
+    lambda { ["5"].pack(format) }.should raise_error(TypeError)
+
+    obj = mock('not an integer')
+    lambda { [obj].pack(format) }.should raise_error(TypeError)
+  end
+
+  it "processes count number of array elements if count given" do
+    [1, 2, 3].pack(format(3)).should == binary("\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00")
+    [1, 2, 3].pack(format(2) + format(1)).should == binary("\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00")
+  end
+
+  it "returns empty string if count = 0" do
+    [1, 2, 3].pack(format(0)).should == binary('')
+  end
+
+  it "with star parameter processes all remaining array items" do
+    [1, 2, 3, 4, 5].pack(format('*')).should == 
+      binary("\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x04\x00\x00\x00\x05\x00\x00\x00")
+  end
+
+  it "raises an ArgumentError if count is greater than array elements left" do
+    lambda { [1, 2].pack(format(3)) }.should raise_error(ArgumentError)
+  end
+
+  ruby_version_is '1.9' do
+    it "returns an ASCII-8BIT string" do
+      [0x41].pack(format).encoding.should == Encoding::ASCII_8BIT
+      [0xFF].pack(format).encoding.should == Encoding::ASCII_8BIT
+    end
+  end
+end
+
+describe "Array#pack with integer format (32bit, big endian)", :shared => true do
+  before do
+    @format = @method
+    def self.format(count = nil)
+      "#{@format}#{count}"
+    end
+  end
+
+  it "returns a string containing 4 bytes for an integer" do
+    [0].pack(format).should == binary("\x00\x00\x00\x00")
+    [0xABCDEF01].pack(format).should == binary("\xAB\xCD\xEF\x01")
+  end
+
+  it "regards negative values as 2's complement in order to converts it to positive" do
+    [-1].pack(format).should == binary("\xFF\xFF\xFF\xFF")
+    [-2**31].pack(format).should == binary("\x80\x00\x00\x00")
+  end
+
+  ruby_version_is '' ... '1.9' do
+    platform_is :wordsize => 32 do
+      it "raises a RangeError when a pack argument is >= 2**32" do
+        lambda { [2**32-1].pack(format) }.should_not raise_error(RangeError)
+        lambda { [2**32].pack(format) }.should raise_error(RangeError)
+      end
+
+      it "raises a RangeError when a pack argument is <= -2**32" do
+        lambda { [-2**32+1].pack(format) }.should_not raise_error(RangeError)
+        lambda { [-2**32].pack(format) }.should raise_error(RangeError)
+      end
+    end
+    platform_is :wordsize => 64 do
+      it "drops higher bytes when a pack argument is >= 2**32" do
+        [2**32-1].pack(format).should == binary("\xFF\xFF\xFF\xFF")
+        [2**32  ].pack(format).should == binary("\x00\x00\x00\x00")
+        [2**32+1].pack(format).should == binary("\x00\x00\x00\x01")
+      end
+
+      it "drops higher bytes when a pack argument is < -2**32" do
+        [-2**32+1].pack(format).should == binary("\x00\x00\x00\x01") # 0x ..F 00 00 00 01
+        [-2**32 ].pack(format).should == binary("\x00\x00\x00\x00")  # 0x ..F 00 00 00 00
+        [-2**32-1].pack(format).should == binary("\xFF\xFF\xFF\xFF") # 0x .FE FF FF FF FF
+      end
+    end
+  end
+  # feature changed by MRI r5542 - [ruby-dev:22654].
+  ruby_version_is '1.9' do
+    it "drops higher bytes when a pack argument is >= 2**32" do
+      [2**32-1].pack(format).should == binary("\xFF\xFF\xFF\xFF")
+      [2**32  ].pack(format).should == binary("\x00\x00\x00\x00")
+      [2**32+1].pack(format).should == binary("\x00\x00\x00\x01")
+    end
+
+    it "drops higher bytes when a pack argument is < -2**32" do
+      [-2**32+1].pack(format).should == binary("\x00\x00\x00\x01") # 0x ..F 00 00 00 01
+      [-2**32 ].pack(format).should == binary("\x00\x00\x00\x00")  # 0x ..F 00 00 00 00
+      [-2**32-1].pack(format).should == binary("\xFF\xFF\xFF\xFF") # 0x .FE FF FF FF FF
+    end
+  end
+
+  it "tries to convert the pack argument to an Integer using #to_int" do
+    [5.0].pack(format).should == binary("\x00\x00\x00\x05")
+
+    obj = mock('to_int')
+    obj.should_receive(:to_int).and_return(5)
+    [obj].pack(format).should == binary("\x00\x00\x00\x05")
+  end
+
+  it "raises a TypeError if a pack argument can't be coerced to Integer" do
+    lambda { ["5"].pack(format) }.should raise_error(TypeError)
+
+    obj = mock('not an integer')
+    lambda { [obj].pack(format) }.should raise_error(TypeError)
+  end
+
+  it "processes count number of array elements if count given" do
+    [1, 2, 3].pack(format(3)).should == binary("\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x03")
+    [1, 2, 3].pack(format(2) + format(1)).should == binary("\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x03")
+  end
+
+  it "returns empty string if count = 0" do
+    [1, 2, 3].pack(format(0)).should == binary('')
+  end
+
+  it "with star parameter processes all remaining array items" do
+    [1, 2, 3, 4, 5].pack(format('*')).should == 
+      binary("\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x04\x00\x00\x00\x05")
+  end
+
+  it "raises an ArgumentError if count is greater than array elements left" do
+    lambda { [1, 2].pack(format(3)) }.should raise_error(ArgumentError)
+  end
+
+  ruby_version_is '1.9' do
+    it "returns an ASCII-8BIT string" do
+      [0x41].pack(format).encoding.should == Encoding::ASCII_8BIT
+      [0xFF].pack(format).encoding.should == Encoding::ASCII_8BIT
+    end
+  end
+end
+
+describe "Array#pack with integer format (64bit, little endian)", :shared => true do
+  before do
+    @format = @method
+    def self.format(count = nil)
+      "#{@format}#{count}"
+    end
+  end
+
+  it "returns a string containing 8 bytes for an integer" do
+    [0].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x00")
+    [0xABCDEF0123456789].pack(format).should == binary("\x89\x67\x45\x23\x01\xEF\xCD\xAB")
+  end
+
+  it "regards negative values as 2's complement in order to converts it to positive" do
+    [-1].pack(format).should == binary("\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF")
+    [-2**63].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x80")
+  end
+
+  ruby_version_is '' ... '1.9' do
+    it "raises a RangeError when a pack argument is >= 2**64" do
+      lambda { [2**64-1].pack(format) }.should_not raise_error(RangeError)
+      lambda { [2**64].pack(format) }.should raise_error(RangeError)
+    end
+
+    it "raises a RangeError when a pack argument is <= -2**64" do
+      lambda { [-2**64+1].pack(format) }.should_not raise_error(RangeError)
+      lambda { [-2**64].pack(format) }.should raise_error(RangeError)
+    end
+  end
+  # feature changed by MRI r5542 - [ruby-dev:22654].
+  ruby_version_is '1.9' do
+    it "drops higher bytes when a pack argument is >= 2**64" do
+      [2**64-1].pack(format).should == binary("\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF")
+      [2**64  ].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x00")
+      [2**64+1].pack(format).should == binary("\x01\x00\x00\x00\x00\x00\x00\x00")
+    end
+
+    it "drops higher bytes when a pack argument is < -2**64" do
+      [-2**64+1].pack(format).should == binary("\x01\x00\x00\x00\x00\x00\x00\x00") # 0x ..F 00 00 00 00 00 00 00 01
+      [-2**64 ].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x00")  # 0x ..F 00 00 00 00 00 00 00 00
+      [-2**64-1].pack(format).should == binary("\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF") # 0x .FE FF FF FF FF FF FF FF FF
+    end
+  end
+
+  it "tries to convert the pack argument to an Integer using #to_int" do
+    [5.0].pack(format).should == binary("\x05\x00\x00\x00\x00\x00\x00\x00")
+
+    obj = mock('to_int')
+    obj.should_receive(:to_int).and_return(5)
+    [obj].pack(format).should == binary("\x05\x00\x00\x00\x00\x00\x00\x00")
+  end
+
+  it "raises a TypeError if a pack argument can't be coerced to Integer" do
+    lambda { ["5"].pack(format) }.should raise_error(TypeError)
+
+    obj = mock('not an integer')
+    lambda { [obj].pack(format) }.should raise_error(TypeError)
+  end
+
+  it "processes count number of array elements if count given" do
+    [1, 2, 3].pack(format(3)).should == binary(
+      "\x01\x00\x00\x00\x00\x00\x00\x00" +
+      "\x02\x00\x00\x00\x00\x00\x00\x00" +
+      "\x03\x00\x00\x00\x00\x00\x00\x00" )
+    [1, 2, 3].pack(format(2) + format(1)).should == binary(
+      "\x01\x00\x00\x00\x00\x00\x00\x00" +
+      "\x02\x00\x00\x00\x00\x00\x00\x00" +
+      "\x03\x00\x00\x00\x00\x00\x00\x00" )
+  end
+
+  it "returns empty string if count = 0" do
+    [1, 2, 3].pack(format(0)).should == binary('')
+  end
+
+  it "with star parameter processes all remaining array items" do
+    [1, 2, 3, 4, 5].pack(format('*')).should == binary(
+      "\x01\x00\x00\x00\x00\x00\x00\x00" + 
+      "\x02\x00\x00\x00\x00\x00\x00\x00" + 
+      "\x03\x00\x00\x00\x00\x00\x00\x00" + 
+      "\x04\x00\x00\x00\x00\x00\x00\x00" + 
+      "\x05\x00\x00\x00\x00\x00\x00\x00" )
+  end
+
+  it "raises an ArgumentError if count is greater than array elements left" do
+    lambda { [1, 2].pack(format(3)) }.should raise_error(ArgumentError)
+  end
+
+  ruby_version_is '1.9' do
+    it "returns an ASCII-8BIT string" do
+      [0x41].pack(format).encoding.should == Encoding::ASCII_8BIT
+      [0xFF].pack(format).encoding.should == Encoding::ASCII_8BIT
+    end
+  end
+end
+
+describe "Array#pack with integer format (64bit, big endian)", :shared => true do
+  before do
+    @format = @method
+    def self.format(count = nil)
+      "#{@format}#{count}"
+    end
+  end
+
+  it "returns a string containing 8 bytes for an integer" do
+    [0].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x00")
+    [0xABCDEF0123456789].pack(format).should == binary("\xAB\xCD\xEF\x01\x23\x45\x67\x89")
+  end
+
+  it "regards negative values as 2's complement in order to converts it to positive" do
+    [-1].pack(format).should == binary("\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF")
+    [-2**63].pack(format).should == binary("\x80\x00\x00\x00\x00\x00\x00\x00")
+  end
+
+  ruby_version_is '' ... '1.9' do
+    it "raises a RangeError when a pack argument is >= 2**64" do
+      lambda { [2**64-1].pack(format) }.should_not raise_error(RangeError)
+      lambda { [2**64].pack(format) }.should raise_error(RangeError)
+    end
+
+    it "raises a RangeError when a pack argument is <= -2**64" do
+      lambda { [-2**64+1].pack(format) }.should_not raise_error(RangeError)
+      lambda { [-2**64].pack(format) }.should raise_error(RangeError)
+    end
+  end
+  # feature changed by MRI r5542 - [ruby-dev:22654].
+  ruby_version_is '1.9' do
+    it "drops higher bytes when a pack argument is >= 2**64" do
+      [2**64-1].pack(format).should == binary("\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF")
+      [2**64  ].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x00")
+      [2**64+1].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x01")
+    end
+
+    it "drops higher bytes when a pack argument is < -2**64" do
+      [-2**64+1].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x01") # 0x ..F 00 00 00 00 00 00 00 01
+      [-2**64 ].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x00")  # 0x ..F 00 00 00 00 00 00 00 00
+      [-2**64-1].pack(format).should == binary("\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF") # 0x .FE FF FF FF FF FF FF FF FF
+    end
+  end
+
+  it "tries to convert the pack argument to an Integer using #to_int" do
+    [5.0].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x05")
+
+    obj = mock('to_int')
+    obj.should_receive(:to_int).and_return(5)
+    [obj].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x05")
+  end
+
+  it "raises a TypeError if a pack argument can't be coerced to Integer" do
+    lambda { ["5"].pack(format) }.should raise_error(TypeError)
+
+    obj = mock('not an integer')
+    lambda { [obj].pack(format) }.should raise_error(TypeError)
+  end
+
+  it "processes count number of array elements if count given" do
+    [1, 2, 3].pack(format(3)).should == binary(
+      "\x00\x00\x00\x00\x00\x00\x00\x01" +
+      "\x00\x00\x00\x00\x00\x00\x00\x02" +
+      "\x00\x00\x00\x00\x00\x00\x00\x03" )
+    [1, 2, 3].pack(format(2) + format(1)).should == binary(
+      "\x00\x00\x00\x00\x00\x00\x00\x01" +
+      "\x00\x00\x00\x00\x00\x00\x00\x02" +
+      "\x00\x00\x00\x00\x00\x00\x00\x03" )
+  end
+
+  it "returns empty string if count = 0" do
+    [1, 2, 3].pack(format(0)).should == binary('')
+  end
+
+  it "with star parameter processes all remaining array items" do
+    [1, 2, 3, 4, 5].pack(format('*')).should == binary(
+      "\x00\x00\x00\x00\x00\x00\x00\x01" +
+      "\x00\x00\x00\x00\x00\x00\x00\x02" +
+      "\x00\x00\x00\x00\x00\x00\x00\x03" +
+      "\x00\x00\x00\x00\x00\x00\x00\x04" +
+      "\x00\x00\x00\x00\x00\x00\x00\x05" )
+  end
+
+  it "raises an ArgumentError if count is greater than array elements left" do
+    lambda { [1, 2].pack(format(3)) }.should raise_error(ArgumentError)
+  end
+
+  ruby_version_is '1.9' do
+    it "returns an ASCII-8BIT string" do
+      [0x41].pack(format).encoding.should == Encoding::ASCII_8BIT
+      [0xFF].pack(format).encoding.should == Encoding::ASCII_8BIT
+    end
+  end
+end
+
+
+
+# integer formats which has platform independent width and fixed byte order
+
+describe "Array#pack with format 'C'" do
+  it_behaves_like "Array#pack with integer format (8bit)", 'C'
+  it_behaves_like "Array#pack with integer format which can not have platform dependent width", 'C'
+end
+describe "Array#pack with format 'c'" do
+  it_behaves_like "Array#pack with integer format (8bit)", 'c'
+  it_behaves_like "Array#pack with integer format which can not have platform dependent width", 'c'
+end
+
+describe "Array#pack with format 'n'" do
+  it_behaves_like "Array#pack with integer format (16bit, big endian)", 'n'
+  it_behaves_like "Array#pack with integer format which can not have platform dependent width", 'n'
+end
+describe "Array#pack with format 'v'" do
+  it_behaves_like "Array#pack with integer format (16bit, little endian)", 'v'
+  it_behaves_like "Array#pack with integer format which can not have platform dependent width", 'v'
+end
+
+describe "Array#pack with format 'N'" do
+  it_behaves_like "Array#pack with integer format (32bit, big endian)", 'N'
+  it_behaves_like "Array#pack with integer format which can not have platform dependent width", 'N'
+end
+describe "Array#pack with format 'V'" do
+  it_behaves_like "Array#pack with integer format (32bit, little endian)", 'V'
+  it_behaves_like "Array#pack with integer format which can not have platform dependent width", 'V'
+end
+
+
+# integer formats which has platform independent width but endian dependent
+
+describe "Array#pack with format 's'" do
+  big_endian    { it_behaves_like "Array#pack with integer format (16bit, big endian)", 's'    }
+  little_endian { it_behaves_like "Array#pack with integer format (16bit, little endian)", 's' }
+end
+describe "Array#pack with format 'S'" do
+  big_endian    { it_behaves_like "Array#pack with integer format (16bit, big endian)", 'S'    }
+  little_endian { it_behaves_like "Array#pack with integer format (16bit, little endian)", 'S' }
+end
+
+describe "Array#pack with format 'l'" do
+  big_endian    { it_behaves_like "Array#pack with integer format (32bit, big endian)", 'l'    }
+  little_endian { it_behaves_like "Array#pack with integer format (32bit, little endian)", 'l' }
+end
+describe "Array#pack with format 'L'" do
+  big_endian    { it_behaves_like "Array#pack with integer format (32bit, big endian)", 'L'    }
+  little_endian { it_behaves_like "Array#pack with integer format (32bit, little endian)", 'L' }
+end
+
+describe "Array#pack with format 'q'" do
+  big_endian    { it_behaves_like "Array#pack with integer format (64bit, big endian)", 'q'    }
+  little_endian { it_behaves_like "Array#pack with integer format (64bit, little endian)", 'q' }
+end
+describe "Array#pack with format 'Q'" do
+  big_endian    { it_behaves_like "Array#pack with integer format (64bit, big endian)", 'Q'    }
+  little_endian { it_behaves_like "Array#pack with integer format (64bit, little endian)", 'Q' }
+end
+
+
+# integer formats which has platform depended width
+
+# signed short int
+describe "Array#pack with format 's!'" do
+  platform_is :wordsize => 32 do
+    big_endian    { it_behaves_like "Array#pack with integer format (16bit, big endian)", 's!'    }
+    little_endian { it_behaves_like "Array#pack with integer format (16bit, little endian)", 's!' }
+  end
+  platform_is :wordsize => 64 do
+    # TODO: Is there an architecture whose short int is 32bit width?
+    big_endian    { it_behaves_like "Array#pack with integer format (16bit, big endian)", 's!'    }
+    little_endian { it_behaves_like "Array#pack with integer format (16bit, little endian)", 's!' }
+  end
+end
+describe "Array#pack with format 's_'" do
+  platform_is :wordsize => 32 do
+    big_endian    { it_behaves_like "Array#pack with integer format (16bit, big endian)", 's_'    }
+    little_endian { it_behaves_like "Array#pack with integer format (16bit, little endian)", 's_' }
+  end
+  platform_is :wordsize => 64 do
+    # TODO: Is there an architecture whose short int is 32bit width?
+    big_endian    { it_behaves_like "Array#pack with integer format (16bit, big endian)", 's_'    }
+    little_endian { it_behaves_like "Array#pack with integer format (16bit, little endian)", 's_' }
+  end
+end
+# unsigned short int
+describe "Array#pack with format 'S!'" do
+  platform_is :wordsize => 32 do
+    big_endian    { it_behaves_like "Array#pack with integer format (16bit, big endian)", 's'    }
+    little_endian { it_behaves_like "Array#pack with integer format (16bit, little endian)", 's' }
+  end
+  platform_is :wordsize => 64 do
+    # TODO: Is there an architecture whose short int is 32bit width?
+    big_endian    { it_behaves_like "Array#pack with integer format (16bit, big endian)", 's'    }
+    little_endian { it_behaves_like "Array#pack with integer format (16bit, little endian)", 's' }
+  end
+end
+describe "Array#pack with format 'S_'" do
+  platform_is :wordsize => 32 do
+    big_endian    { it_behaves_like "Array#pack with integer format (16bit, big endian)", 'S_'    }
+    little_endian { it_behaves_like "Array#pack with integer format (16bit, little endian)", 'S_' }
+  end
+  platform_is :wordsize => 64 do
+    # TODO: Is there an architecture whose short int is 32bit width?
+    big_endian    { it_behaves_like "Array#pack with integer format (16bit, big endian)", 'S_'    }
+    little_endian { it_behaves_like "Array#pack with integer format (16bit, little endian)", 'S_' }
+  end
+end
+
+# signed int
+describe "Array#pack with format 'i'" do
+  platform_is :wordsize => 32 do
+    big_endian    { it_behaves_like "Array#pack with integer format (32bit, big endian)", 'i'    }
+    little_endian { it_behaves_like "Array#pack with integer format (32bit, little endian)", 'i' }
+  end
+  platform_is :wordsize => 64 do
+    # TODO: supporting ILP64 architechture
+    big_endian    { it_behaves_like "Array#pack with integer format (32bit, big endian)", 'i'    }
+    little_endian { it_behaves_like "Array#pack with integer format (32bit, little endian)", 'i' }
+  end
+end
+describe "Array#pack with format 'i!'" do
+  platform_is :wordsize => 32 do
+    big_endian    { it_behaves_like "Array#pack with integer format (32bit, big endian)", 'i!'    }
+    little_endian { it_behaves_like "Array#pack with integer format (32bit, little endian)", 'i!' }
+  end
+  platform_is :wordsize => 64 do
+    # TODO: supporting ILP64 architechture
+    big_endian    { it_behaves_like "Array#pack with integer format (32bit, big endian)", 'i!'    }
+    little_endian { it_behaves_like "Array#pack with integer format (32bit, little endian)", 'i!' }
+  end
+end
+describe "Array#pack with format 'i_'" do
+  platform_is :wordsize => 32 do
+    big_endian    { it_behaves_like "Array#pack with integer format (32bit, big endian)", 'i_'    }
+    little_endian { it_behaves_like "Array#pack with integer format (32bit, little endian)", 'i_' }
+  end
+  platform_is :wordsize => 64 do
+    # TODO: supporting ILP64 architechture
+    big_endian    { it_behaves_like "Array#pack with integer format (32bit, big endian)", 'i_'    }
+    little_endian { it_behaves_like "Array#pack with integer format (32bit, little endian)", 'i_' }
+  end
+end
+
+# unsigned int
+describe "Array#pack with format 'I'" do
+  platform_is :wordsize => 32 do
+    big_endian    { it_behaves_like "Array#pack with integer format (32bit, big endian)", 'I'    }
+    little_endian { it_behaves_like "Array#pack with integer format (32bit, little endian)", 'I' }
+  end
+  platform_is :wordsize => 64 do
+    # TODO: supporting ILP64 architechture
+    big_endian    { it_behaves_like "Array#pack with integer format (32bit, big endian)", 'I'    }
+    little_endian { it_behaves_like "Array#pack with integer format (32bit, little endian)", 'I' }
+  end
+end
+describe "Array#pack with format 'I!'" do
+  platform_is :wordsize => 32 do
+    big_endian    { it_behaves_like "Array#pack with integer format (32bit, big endian)", 'I!'    }
+    little_endian { it_behaves_like "Array#pack with integer format (32bit, little endian)", 'I!' }
+  end
+  platform_is :wordsize => 64 do
+    # TODO: supporting ILP64 architechture
+    big_endian    { it_behaves_like "Array#pack with integer format (32bit, big endian)", 'I!'    }
+    little_endian { it_behaves_like "Array#pack with integer format (32bit, little endian)", 'I!' }
+  end
+end
+describe "Array#pack with format 'I_'" do
+  platform_is :wordsize => 32 do
+    big_endian    { it_behaves_like "Array#pack with integer format (32bit, big endian)", 'I_'    }
+    little_endian { it_behaves_like "Array#pack with integer format (32bit, little endian)", 'I_' }
+  end
+  platform_is :wordsize => 64 do
+    # TODO: supporting ILP64 architechture
+    big_endian    { it_behaves_like "Array#pack with integer format (32bit, big endian)", 'I_'    }
+    little_endian { it_behaves_like "Array#pack with integer format (32bit, little endian)", 'I_' }
+  end
+end
+
+# signed long
+describe "Array#pack with format 'l!'" do
+  platform_is :wordsize => 32 do
+    big_endian    { it_behaves_like "Array#pack with integer format (32bit, big endian)", 'l!'    }
+    little_endian { it_behaves_like "Array#pack with integer format (32bit, little endian)", 'l!' }
+  end
+  platform_is :wordsize => 64 do
+    # TODO: Is there anything other LLP64 platform which ruby can run on?
+    platform_is :os => :mswin do 
+      big_endian    { it_behaves_like "Array#pack with integer format (32bit, big endian)", 'l!'    }
+      little_endian { it_behaves_like "Array#pack with integer format (32bit, little endian)", 'l!' }
+    end
+    platform_is_not :os => :mswin do
+      big_endian    { it_behaves_like "Array#pack with integer format (64bit, big endian)", 'l!'    }
+      little_endian { it_behaves_like "Array#pack with integer format (64bit, little endian)", 'l!' }
+    end
+  end
+end
+describe "Array#pack with format 'l_'" do
+  platform_is :wordsize => 32 do
+    big_endian    { it_behaves_like "Array#pack with integer format (32bit, big endian)", 'l_'    }
+    little_endian { it_behaves_like "Array#pack with integer format (32bit, little endian)", 'l_' }
+  end
+  platform_is :wordsize => 64 do
+    # TODO: Is there anything other LLP64 platform which ruby can run on?
+    platform_is :os => :mswin do 
+      big_endian    { it_behaves_like "Array#pack with integer format (32bit, big endian)", 'l_'    }
+      little_endian { it_behaves_like "Array#pack with integer format (32bit, little endian)", 'l_' }
+    end
+    platform_is_not :os => :mswin do
+      big_endian    { it_behaves_like "Array#pack with integer format (64bit, big endian)", 'l_'    }
+      little_endian { it_behaves_like "Array#pack with integer format (64bit, little endian)", 'l_' }
+    end
+  end
+end
+
+# unsigned long
+describe "Array#pack with format 'L!'" do
+  platform_is :wordsize => 32 do
+    big_endian    { it_behaves_like "Array#pack with integer format (32bit, big endian)", 'L!'    }
+    little_endian { it_behaves_like "Array#pack with integer format (32bit, little endian)", 'L!' }
+  end
+  platform_is :wordsize => 64 do
+    # TODO: Is there anything other LLP64 platform which ruby can run on?
+    platform_is :os => :mswin do 
+      big_endian    { it_behaves_like "Array#pack with integer format (32bit, big endian)", 'L!'    }
+      little_endian { it_behaves_like "Array#pack with integer format (32bit, little endian)", 'L!' }
+    end
+    platform_is_not :os => :mswin do
+      big_endian    { it_behaves_like "Array#pack with integer format (64bit, big endian)", 'L!'    }
+      little_endian { it_behaves_like "Array#pack with integer format (64bit, little endian)", 'L!' }
+    end
+  end
+end
+describe "Array#pack with format 'L_'" do
+  platform_is :wordsize => 32 do
+    big_endian    { it_behaves_like "Array#pack with integer format (32bit, big endian)", 'L_'    }
+    little_endian { it_behaves_like "Array#pack with integer format (32bit, little endian)", 'L_' }
+  end
+  platform_is :wordsize => 64 do
+    # TODO: Is there anything other LLP64 platform which ruby can run on?
+    platform_is :os => :mswin do 
+      big_endian    { it_behaves_like "Array#pack with integer format (32bit, big endian)", 'L_'    }
+      little_endian { it_behaves_like "Array#pack with integer format (32bit, little endian)", 'L_' }
+    end
+    platform_is_not :os => :mswin do
+      big_endian    { it_behaves_like "Array#pack with integer format (64bit, big endian)", 'L_'    }
+      little_endian { it_behaves_like "Array#pack with integer format (64bit, little endian)", 'L_' }
+    end
+  end
+end
+
+
+
+# floating point number formats
+describe "Array#pack with float format", :shared => true do
+  before do
+    @format = @method
+    def self.format(count = nil)
+      "#{@format}#{count}"
+    end
+  end
+
+  it "consumes as many Floats as specified" do
+    [1.0, :a, :b, :c].pack(format).should == [1.0].pack(format)
+    [1.0, 2.0, :a, :b, :c].pack(format(2)).should == [1.0].pack(format) + [2.0].pack(format)
+    [1.0, 2.0, 3.0, :a, :b, :c].pack(format(2)+format).should == [1.0].pack(format) + [2.0].pack(format) + [3.0].pack(format)
+  end
+
+  it "tries to convert the pack argument to a Float using #to_f" do
+    obj = mock('to_f')
+    obj.should_receive(:to_f).and_return(1.5)
+    lambda{ [obj].pack(format) }.should_not raise_error
+  end
+
+  it "accepts a string representation of real number as the pack argument" do
+    lambda{ ["1.3333"].pack(format) }.should_not raise_error(TypeError)
+    lambda{ ["-1.3333"].pack(format) }.should_not raise_error(TypeError)
+  end
+
+  it "accepts an integer as the pack argument" do
+    lambda{ [1].pack(format) }.should_not raise_error(TypeError)
+    lambda{ [0x80000000].pack(format) }.should_not raise_error(TypeError)
+  end
+
+  it "does not raise an error even if passed a integer which is too large to cast into float value" do
+    lambda{ [2**1024].pack(format) }.should_not raise_error
+  end
+
+  ruby_version_is '' ... '1.8' do
+    it "may complain overflow when the passed integer is too large" do
+      lambda{ [2**1024].pack(format) }.should complain(/range/)
+    end
+  end
+
+  it "raises a TypeError if corresponding array item is not Float" do
+    lambda { [nil].pack(format) }.should raise_error(TypeError)
+    lambda { [:hello].pack(format) }.should raise_error(TypeError)
+    lambda { [mock('not float')].pack(format) }.should raise_error(TypeError)
+  end
+
+  ruby_version_is '1.9' do
+    it "returns a ASCII-8BIT string" do
+      [-1.0].pack(format).encoding.should == Encoding::ASCII_8BIT
+    end
+  end
+end
+
+describe "Array#pack with float format (IEEE754 single precision, big endian)", :shared => true do
+  before do
+    @format = @method
+    def self.format(count = nil)
+      "#{@format}#{count}"
+    end
+  end
+
+  it "returns a string with length 4" do
+    [1.0].pack(format).length.should == 4
+  end
+
+  it "accepts the positive zero" do
+    [+0.0].pack(format).should == binary("\x00\x00\x00\x00")
+  end
+  it "accepts the negative zero" do
+    [-0.0].pack(format).should == binary("\x80\x00\x00\x00")
+  end
+  it "accepts a positive value" do
+    [+1.0].pack(format).should == binary("\x3F\x80\x00\x00")
+  end
+  it "accepts a negative value" do
+    [-1.0].pack(format).should == binary("\xBF\x80\x00\x00")
+  end
+  it "accepts the positive infinity" do
+    [1.0/0.0].pack(format).should == binary("\x7F\x80\x00\x00")
+  end
+  it "accepts the negative infinity" do
+    [-1.0/0.0].pack(format).should == binary("\xFF\x80\x00\x00")
+  end
+  it "accepts a NaN" do
+    [0.0/0.0].pack(format).should =~ /\xFF(?:[\x81-\xFF]..|\x80[\x01-\xFF].|\x80.[\x01-\xFF])/n
+  end
+
+  it "keeps order of nonnegative real numbers" do
+    numbers = [ 0.0, 1.0e-126, 1.5e-126, 0.5, 1.0, 1.5, 1.0e127, 1.5e127, 1.0/0.0 ]
+    packed = numbers.map{|f| [f].pack(format) }
+    packed.should == packed.sort
+  end
+
+  it "reverses order of nonpositive real numbers" do
+    numbers = [ -1.0/0.0, -1.5e127, -1.0e127, -1.5, -1.0, -0.5, -1.5e-126, -1.0e-126, -0.0 ]
+    packed = numbers.map{|f| [f].pack(format) }
+    packed.should == packed.sort.reverse
+  end
+end
+
+describe "Array#pack with float format (IEEE754 single precision, little endian)", :shared => true do
+  before do
+    @format = @method
+    def self.format(count = nil)
+      "#{@format}#{count}"
+    end
+  end
+
+  it "returns a string with length 4" do
+    [1.0].pack(format).length.should == 4
+  end
+
+  it "accepts the positive zero" do
+    [+0.0].pack(format).should == binary("\x00\x00\x00\x00")
+  end
+  it "accepts the negative zero" do
+    [-0.0].pack(format).should == binary("\x00\x00\x00\x80")
+  end
+  it "accepts a positive value" do
+    [+1.0].pack(format).should == binary("\x00\x00\x80\x3F")
+  end
+  it "accepts a negative value" do
+    [-1.0].pack(format).should == binary("\x00\x00\x80\xBF")
+  end
+  it "accepts the positive infinity" do
+    [1.0/0.0].pack(format).should == binary("\x00\x00\x80\x7F")
+  end
+  it "accepts the negative infinity" do
+    [-1.0/0.0].pack(format).should == binary("\x00\x00\x80\xFF")
+  end
+  it "accepts a NaN" do
+    [0.0/0.0].pack(format).should =~ /(?:..[\x81-\xFF]|.[\x01-\xFF]\x80|[\x01-\xFF].\x80)\xFF/n
+  end
+end
+
+describe "Array#pack with float format (IEEE754 double precision, big endian)", :shared => true do
+  before do
+    @format = @method
+    def self.format(count = nil)
+      "#{@format}#{count}"
+    end
+  end
+
+  it "returns a string with length 8" do
+    [1.0].pack(format).length.should == 8
+  end
+
+  it "accepts the positive zero" do
+    [+0.0].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x00")
+  end
+  it "accepts the negative zero" do
+    [-0.0].pack(format).should == binary("\x80\x00\x00\x00\x00\x00\x00\x00")
+  end
+  it "accepts a positive value" do
+    [+1.0].pack(format).should == binary("\x3F\xF0\x00\x00\x00\x00\x00\x00")
+  end
+  it "accepts a negative value" do
+    [-1.0].pack(format).should == binary("\xBF\xF0\x00\x00\x00\x00\x00\x00")
+  end
+  it "accepts the positive infinity" do
+    [1.0/0.0].pack(format).should == binary("\x7F\xF0\x00\x00\x00\x00\x00\x00")
+  end
+  it "accepts the negative infinity" do
+    [-1.0/0.0].pack(format).should == binary("\xFF\xF0\x00\x00\x00\x00\x00\x00")
+  end
+  it "accepts a NaN" do
+    [0.0/0.0].pack(format).should =~ /\xFF(?:[\xF1-\xFF].{6}|\xF0\x00*[\x01-\xFF]\x00*)/n
+  end
+
+  it "keeps order of nonnegative real numbers" do
+    numbers = [ 0.0, 1.0e-1022, 1.5e-1022, 0.5, 1.0, 1.5, 1.0e1023, 1.5e1023, 1.0/0.0 ]
+    packed = numbers.map{|f| [f].pack(format) }
+    packed.should == packed.sort
+  end
+
+  it "reverses order of nonpositive real numbers" do
+    numbers = [ -1.0/0.0, -1.5e1023, -1.0e1023, -1.5, -1.0, -0.5, -1.5e-1022, -1.0e-1022, -0.0 ]
+    packed = numbers.map{|f| [f].pack(format) }
+    packed.should == packed.sort.reverse
+  end
+end
+
+describe "Array#pack with float format (IEEE754 double precision, little endian)", :shared => true do
+  before do
+    @format = @method
+    def self.format(count = nil)
+      "#{@format}#{count}"
+    end
+  end
+
+  it "returns a string with length 8" do
+    [1.0].pack(format).length.should == 8
+  end
+
+  it "accepts the positive zero" do
+    [+0.0].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x00")
+  end
+  it "accepts the negative zero" do
+    [-0.0].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x80")
+  end
+  it "accepts a positive value" do
+    [+1.0].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\xF0\x3F")
+  end
+  it "accepts a negative value" do
+    [-1.0].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\xF0\xBF")
+  end
+  it "accepts the positive infinity" do
+    [1.0/0.0].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\xF0\x7F")
+  end
+  it "accepts the negative infinity" do
+    [-1.0/0.0].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\xF0\xFF")
+  end
+  it "accepts a NaN" do
+    [0.0/0.0].pack(format).should =~ /(?:.{6}[\xF1-\xFF]|\x00*[\x01-\xFF]\x00*)\xFF/n
+  end
+end
+
+describe "Array#pack with format 'f'" do
+  it_behaves_like "Array#pack with float format", 'f'
+
+  # TODO: non IEEE754 platform
+  little_endian { it_behaves_like "Array#pack with float format (IEEE754 single precision, little endian)", 'f' }
+  big_endian { it_behaves_like "Array#pack with float format (IEEE754 single precision, big endian)", 'f' }
+end
+
+describe "Array#pack with format 'd'" do
+  it_behaves_like "Array#pack with float format", 'd'
+
+  # TODO: non IEEE754 platform
+  little_endian { it_behaves_like "Array#pack with float format (IEEE754 double precision, little endian)", 'd' }
+  big_endian { it_behaves_like "Array#pack with float format (IEEE754 double precision, big endian)", 'd' }
+end
+
+describe "Array#pack with format 'e'" do
+  it_behaves_like "Array#pack with float format", 'e'
+
+  # TODO: non IEEE754 platform
+  it_behaves_like "Array#pack with float format (IEEE754 single precision, little endian)", 'e'
+end
+
+describe "Array#pack with format 'E'" do
+  it_behaves_like "Array#pack with float format", 'E'
+
+  # TODO: non IEEE754 platform
+  it_behaves_like "Array#pack with float format (IEEE754 double precision, little endian)", 'E'
+end
+
+describe "Array#pack with format 'g'" do
+  it_behaves_like "Array#pack with float format", 'g'
+
+  # TODO: non IEEE754 platform
+  it_behaves_like "Array#pack with float format (IEEE754 single precision, big endian)", 'g'
+end
+
+describe "Array#pack with format 'G'" do
+  it_behaves_like "Array#pack with float format", 'G'
+
+  # TODO: non IEEE754 platform
+  it_behaves_like "Array#pack with float format (IEEE754 double precision, big endian)", 'G'
+end
+
+
+
+
+
+
+describe "Array#pack with format 'M'" do
+  it "enocdes string with Qouted Printable encoding" do
+    ["ABCDEF"].pack('M').should == "ABCDEF=\n"
+  end
+
+  it "doesn't encode new line chars" do
+    ["\nA"].pack('M').should == "\nA=\n"
+  end
+
+  it "always appends soft line break at the end of encoded string" do
+    ["ABC"].pack('M')[-2, 2].should == "=\n"
+  end
+
+  it "appends soft line break after each 72 chars + 1 encoded char in encoded string by default" do
+    s = ["A"*150].pack('M')
+    s.should == 
+      "A"*73 + "=\n" +
+      "A"*73 + "=\n" +
+      "A"* 4 + "=\n"
+
+    s = ["A"*72+"\001"].pack('M')
+    s.should == "A"*72 + "=01=\n"
+  end
+
+  it "appends soft line break after each specified number of chars + 1 encoded char in encoded string for the specified number > 1" do
+    s = ["A"*12].pack('M4')
+    s.should == "AAAAA=\nAAAAA=\nAA=\n"
+
+    s = ["A"*12+"\001"].pack('M4')
+    s.should == "AAAAA=\nAAAAA=\nAA=01=\n"
+
+    s = ["A"*14+"\001"].pack('M4')
+    s.should == "AAAAA=\nAAAAA=\nAAAA=01=\n"
+
+    s = ["A"*15+"\001"].pack('M4')
+    s.should == "AAAAA=\nAAAAA=\nAAAAA=\n=01=\n"
+  end
+
+  it "appends soft line break after each 72 chars + 1 encoded char in encoded string for the specified count is 1" do
+    s = ["A"*150].pack('M1')
+    s.should == 
+      "A"*73 + "=\n" +
+      "A"*73 + "=\n" +
+      "A"* 4 + "=\n"
+
+    s = ["A"*72+"\001"].pack('M1')
+    s.should == "A"*72 + "=01=\n"
+  end
+  it "appends soft line break after each 72 chars + 1 encoded char in encoded string for the specified count is 0" do
+    s = ["A"*150].pack('M0')
+    s.should == 
+      "A"*73 + "=\n" +
+      "A"*73 + "=\n" +
+      "A"* 4 + "=\n"
+
+    s = ["A"*72+"\001"].pack('M0')
+    s.should == "A"*72 + "=01=\n"
+  end
+
+  it "doesn't quote chars 32..60 and 62..126" do
+    32.upto(60) do |i|
+      [i.chr].pack('M').should == i.chr+"=\n"
+    end
+
+    62.upto(126) do |i|
+      [i.chr].pack('M').should == i.chr+"=\n"
+    end
+  end
+
+  it "quotes chars by adding equal sign and char's hex value" do
+    ["\001"].pack('M').should == "=01=\n"
+  end
+
+  it "quotes equal sign" do
+    ["="].pack('M').should == "=3D=\n"
+  end
+
+  it "doesn't quote \\t char" do
+    ["\t"].pack('M').should == "\t=\n"
+  end
+
+  it "returns empty string if source string is empty" do
+    [""].pack('M').should == ""
+  end
+
+  it "calls #to_s on object to convert to string" do
+    obj = mock('to_s')
+    obj.should_receive(:to_s).and_return('world')
+
+    [123].pack('M').should == "123=\n"
+    [:hello].pack('M').should == "hello=\n"
+    [obj].pack('M').should == "world=\n"
+  end
+
+  it "does not check whether the pack argument responds to #to_s before call #to_s" do
+    obj = mock('to_s')
+    obj.should_not_receive(:respond_to?).with(:to_s)
+    [obj].pack('M')
+  end
+
+  it "comsumres only one array item per a format" do
+    ["abc", "def"].pack('M').should == "abc=\n"
+    ["abcdef", "ghijkl"].pack('M3M3').should == "abcd=\nef=\nghij=\nkl=\n"
+  end
+
+  ruby_bug("[ruby-dev:37289]", "1.8.7.73") do
+    it "ignores star parameter" do
+      ["X"*150, "not used", "not used", "not used"].pack('M*').should == ["X"*150].pack('M')
+    end
+  end
+
+  it "properly handles recursive arrays" do
+    empty = ArraySpecs.empty_recursive_array
+    empty.pack('M').should be_kind_of(String)
+
+    array = ArraySpecs.recursive_array
+    array.pack('M').should == "1=\n"
+  end
+  
+  ruby_version_is '1.9' do
+    it "returns an US-ASCII string" do
+      ["abcd"].pack('M').encoding.should == Encoding::US_ASCII
+    end
+  end
+end
+
+describe "Array#pack with format 'm'" do
+  it "encodes string with Base64 encoding" do
+    ["ABCDEF"].pack('m').should == "QUJDREVG\n"
+  end
+
+  it "converts series of 3-char sequences into four 4-char sequences" do
+    ["ABCDEFGHI"].pack('m').size.should == 4+4+4+1
+  end
+
+  it "fills chars with non-significant bits with '=' sign" do
+    ["A"].pack('m').should == "QQ==\n"
+  end
+
+  it "appends newline at the end of result string" do
+    ["A"].pack('m')[-1].should == ?\n
+  end
+
+  it "appends newline whenever after consumes 45 bytes by default" do
+    ["ABC"*31].pack('m').should == 
+      "QUJD"*15 + "\n" +
+      "QUJD"*15 + "\n" +
+      "QUJD\n"
+  end
+
+  it "appends newline whenever after consumes [number/3]*3 of bytes for the specified number > 2, where [x] is the floor function" do
+    s = ["ABC"*3].pack('m3').should == "QUJD\n"*3
+    s = ["ABC"*3+"\x01"].pack('m3').should == "QUJD\n"*3 + "AQ==\n"
+
+    s = ["ABC"*3].pack('m4').should == "QUJD\n"*3
+    s = ["ABC"*3+"\x01"].pack('m4').should == "QUJD\n"*3 + "AQ==\n"
+    s = ["ABC"*3+"\x01"].pack('m5').should == "QUJD\n"*3 + "AQ==\n"
+    s = ["ABC"*3+"\x01"].pack('m6').should == "QUJDQUJD\nQUJDAQ==\n"
+  end
+
+  it "ignores line length parameter if it is 1 or 2" do
+    wrapped_at_45 = 
+      "QUJD"*15 + "\n" +
+      "QUJD"*15 + "\n" +
+      "QUJD\n"
+    ["ABC"*31].pack('m1').should == wrapped_at_45
+    ["ABC"*31].pack('m2').should == wrapped_at_45
+  end
+
+
+  ruby_version_is '' ... '1.9' do
+    it "ignores line length parameter if it is 0" do
+      ["ABC"*31].pack('m0').should == 
+        "QUJD"*15 + "\n" +
+        "QUJD"*15 + "\n" +
+        "QUJD\n"
+    end
+  end
+  # feature changed in 1.9 - [ruby-dev:35904].
+  ruby_version_is '1.9' do
+    it "does not append newline if line length parameter is 0" do
+      ["ABC"*31].pack('m0').should == "QUJD"*31
+      ["ABC"*31 + "\x01"].pack('m0').should == "QUJD"*31 + "AQ=="
+    end
+  end
+
+  it "comsumres only one array item per a format" do
+    ["ABC", "DEF"].pack('m').should == "QUJD\n"
+    ["ABC", "DEF"].pack('m3').should == "QUJD\n"
+    ["ABC", "DEF"].pack('m3m3').should == "QUJD\nREVG\n"
+  end
+
+  ruby_bug("[ruby-dev:37289]", "1.8.7.73") do
+    it "ignores star parameter" do
+      ["ABC"*150, 'not used', 'not used', 'not used'].pack('m*').should == ["ABC"*150].pack('m')
+      ["ABC"*150, 0x41, 0x42].pack('m*CC').should == ["ABC"*150].pack('m') + "\x41\x42"
+    end
+  end
+
+  it "encodes 6-bit char less than 26 with capital letters" do
+    [( 0*4).chr].pack('m').should == "AA==\n"
+    [( 1*4).chr].pack('m').should == "BA==\n"
+
+    [(25*4).chr].pack('m').should == "ZA==\n"
+  end
+
+  it "encodes 6-bit char from 26 to 51 with lowercase letters" do
+    [(26*4).chr].pack('m').should == "aA==\n"
+    [(27*4).chr].pack('m').should == "bA==\n"
+
+    [(51*4).chr].pack('m').should == "zA==\n"
+  end
+
+  it "encodes 6-bit char 62 with '+'" do
+    [(62*4).chr].pack('m').should == "+A==\n"
+  end
+
+  it "encodes 6-bit char 63 with '/'" do
+    [(63*4).chr].pack('m').should == "/A==\n"
+  end
+
+  it "returns empty string if source string is empty" do
+    [""].pack('m').should == ""
+  end
+
+  it "tries to convert the pack argument to a String using #to_str" do
+    obj = mock('to_str')
+    obj.should_receive(:to_str).and_return("ABC")
+    [obj].pack('m').should == "QUJD\n"
+  end
+
+  it "raises a TypeError if corresponding array item is not string" do
+    lambda { [123].pack('m') }.should raise_error(TypeError)
+    lambda { [:hello].pack('m') }.should raise_error(TypeError)
+    lambda { [mock('not string')].pack('m') }.should raise_error(TypeError)
+  end
+
+  ruby_version_is '1.9' do
+    it "returns an US-ASCII string" do
+      ["abcd"].pack('m').encoding.should == Encoding::US_ASCII
+    end
+  end
+end
+
+describe "Array#pack with format 'U'" do
+  it "regards a integer as a Unicode codepoint and encodes into UTF-8 byte sequence" do
+    ascii = (0x00 .. 0x7F)
+    ascii.each do |cp|
+      chr = [cp].pack('U')
+      binary(chr)[0,1].should == cp.chr
+    end
+    ascii.to_a.pack('U*').should == (0x00 .. 0x7F).map{|c| eval('"\x%02x"' % c)}.join
+
+    codepoints = [
+      0x80, 0x7FF, 0x800, 0xFFFF,          # BMP
+      0x10000, 0xFFFFF, 0x100000, 0x10FFFF # max of unicode code points
+    ]
+    codepoints.each do |cp|
+      lambda { [cp].pack('U') }.should_not raise_error
+    end
+
+    [0x7F, 0x7F].pack('U*').should == "\x7F\x7F"
+    [262193, 4736, 191, 12, 107].pack('U*').should == utf8("\xF1\x80\x80\xB1\xE1\x8A\x80\xC2\xBF\x0C\x6B")
+    [2**16+1, 2**30].pack('U2').should == utf8("\360\220\200\201\375\200\200\200\200\200")
+  end
+
+  it "raises an ArgumentError if count is greater than array elements left" do
+    lambda { [].pack('U') }.should raise_error(ArgumentError)
+    lambda { [1].pack('UU') }.should raise_error(ArgumentError)
+  end
+
+  it "raises RangeError when a pack argument is negative" do
+    lambda { [-1].pack('U') }.should raise_error(RangeError)
+    lambda { [-5].pack('U') }.should raise_error(RangeError)
+    lambda { [-2**32].pack('U') }.should raise_error(RangeError)
+  end
+
+  it "raises RangeError when a pack argument >= 2**32" do
+    lambda { [2**32].pack('U') }.should raise_error(RangeError)
+  end
+
+  it "may accept a pack argument > max of Unicode codepoint" do
+    lambda { [0x00110000].pack('U') }.should_not raise_error(RangeError) # 22bit
+    lambda { [0x04000000].pack('U') }.should_not raise_error(RangeError) # 27bit
+    lambda { [0x7FFFFFFF].pack('U') }.should_not raise_error(RangeError) # 31bit
+  end
+
+  it "only takes as many elements as specified after ('U')" do
+    [0x41, 0x42, 0x43, 0x44].pack('U2').should == "\x41\x42"
+    [0x41, 0x42, 0x43, 0x44].pack('U2U').should == "\x41\x42\x43"
+  end
+
+  ruby_version_is '1.9' do
+    it "returns a UTF-8 string" do
+      [0x00].pack('U').encoding.should == Encoding::UTF_8
+      [0x41].pack('U').encoding.should == Encoding::UTF_8
+      [0x7F].pack('U').encoding.should == Encoding::UTF_8
+      [0x80].pack('U').encoding.should == Encoding::UTF_8
+      [0x10FFFF].pack('U').encoding.should == Encoding::UTF_8
+    end
+  end
+end
+
+describe "Array#pack with format 'u'" do
+  it "encodes string with UU-encoding" do
+    ["ABCDEF"].pack('u').should == "&04)#1$5&\n"
+  end
+
+  it "converts series of 3-char sequences into four 4-char sequences" do
+    ["ABCDEFGHI"].pack('u').size.should == 4+4+4+1+1
+  end
+
+  it "appends zero-chars to source string if string length is not multiple of 3" do
+    ["A"].pack('u').should == "!00``\n"
+  end
+
+  it "appends newline at the end of result string" do
+    ["A"].pack('u')[-1].should == ?\n
+  end
+
+  it "appends newline whenever after consumes 45 bytes by default" do
+    s = ["ABC"*31].pack('u')
+    line_len = 1 + 4*(45/3) + 1
+    s[1*line_len - 1].should == ?\n
+    s[2*line_len - 1].should == ?\n
+    s[-1].should == ?\n
+  end
+
+  it "prepends encoded line length to each line with ('u')" do
+    s = ["ABC"*31].pack('u')
+    line_len = 1 + 4*(45/3) + 1
+    s[0*line_len, 1].should == (45+0x20).chr
+    s[1*line_len, 1].should == (45+0x20).chr
+    s[2*line_len, 1].should == (3*31-45*2 + 0x20).chr
+  end
+
+  it "appends newline whenever after consumes [number/3]*3 of bytes for the specified number > 2, where [x] is the floor function" do
+    s = ["ABC"*3].pack('u3').should == ( (3+0x20).chr + "04)#\n" ) * 3
+    s = ["ABC"*3+"\x01"].pack('u3').should ==  ( (3+0x20).chr + "04)#\n" )*3 + (1+0x20).chr + "`0``\n"
+
+    s = ["ABC"*3].pack('u4').should == ( (3+0x20).chr + "04)#\n" ) * 3
+    s = ["ABC"*3+"\x01"].pack('u4').should == ( (3+0x20).chr + "04)#\n" )*3 + (1+0x20).chr + "`0``\n"
+    s = ["ABC"*3+"\x01"].pack('u5').should == ( (3+0x20).chr + "04)#\n" )*3 + (1+0x20).chr + "`0``\n"
+    s = ["ABC"*3+"\x01"].pack('u6').should == 
+      (6+0x20).chr + "04)#04)#\n" +
+      (4+0x20).chr + "04)#`0``\n"
+  end
+
+  it "ignores line length parameter if it is < 3" do
+    wrapped_at_45 = 
+        (45+0x20).chr + "04)#"*(45/3) + "\n" +
+        (45+0x20).chr + "04)#"*(45/3) + "\n" +
+        ( 3+0x20).chr + "04)#" + "\n"
+
+    ["ABC"*31].pack('u0').should == wrapped_at_45
+    ["ABC"*31].pack('u1').should == wrapped_at_45
+    ["ABC"*31].pack('u2').should == wrapped_at_45
+  end
+
+  it "comsumres only one array item per a format" do
+    ["ABC", "DEF"].pack('u').should == "#04)#\n"
+    ["ABC", "DEF"].pack('u3').should == "#04)#\n"
+    ["ABC", "DEF"].pack('u3u3').should == "#04)#\n#1$5&\n"
+  end
+
+  it "ignores star parameter" do
+    ["ABC"*150, 'not used', 'not used', 'not used'].pack('u*').should == ["ABC"*150].pack('u')
+    ["ABC"*150, 0x41, 0x42].pack('u*CC').should == ["ABC"*150].pack('u') + "\x41\x42"
+  end
+
+  it "encodes 6-bit char with another char starting from char 32 with ('u')" do
+    [( 1 * 4).chr].pack('u').should == "!!```\n"
+    [(16 * 4).chr].pack('u').should == "!0```\n"
+    [(25 * 4).chr].pack('u').should == "!9```\n"
+    [(63 * 4).chr].pack('u').should == "!_```\n"
+  end
+
+  it "replaces spaces in encoded string with grave accent (`) char with ('u')" do
+    [( 0*4).chr].pack('u').should == "!````\n"
+  end
+
+  it "returns empty string if source string is empty with ('u')" do
+    [""].pack('u').should == ""
+  end
+
+  it "tries to convert the pack argument to a String using #to_str" do
+    obj = mock('to_str')
+    obj.should_receive(:to_str).and_return("ABC")
+    [obj].pack('u').should == "#04)#\n"
+  end
+
+  it "raises a TypeError if corresponding array item is not string" do
+    lambda { [123].pack('u') }.should raise_error(TypeError)
+    lambda { [:hello].pack('u') }.should raise_error(TypeError)
+    lambda { [mock('not string')].pack('u') }.should raise_error(TypeError)
+  end
+
+  ruby_version_is '1.9' do
+    it "returns an US-ASCII string" do
+      ["abcd"].pack('u').encoding.should == Encoding::US_ASCII
+    end
+  end
+end
+
+describe "Array#pack with format 'w'" do
+  it "converts to BER-compressed integer" do
+    [0].pack('w').should == binary("\000")
+    [1].pack('w').should == binary("\001")
+    [0, 1, 2].pack('w2').should == binary("\000\001")
+    [0, 1, 2].pack('w*').should == binary("\000\001\002")
+    [9999].pack('w').should == binary("\316\017")
+    [2**64].pack('w').should == binary("\202\200\200\200\200\200\200\200\200\000")
+  end
+
+  it "raises ArgumentError when a pack argument is negative" do
+    lambda { [-1].pack('w') }.should raise_error(ArgumentError)
+    lambda { [-2**256].pack('w') }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError if the count is greater than the number of remaining array elements" do
+    lambda { [1].pack('w2') }.should raise_error(ArgumentError)
+    lambda { [1, 2, 3, 4, 5].pack('w10') }.should raise_error(ArgumentError)
+  end
+
+  it "calls to_int on non-integer values before packing" do
+    obj = mock('1')
+    obj.should_receive(:to_int).and_return(1)
+    [obj].pack('w').should == binary("\001")
+  end
+
+  it "raises TypeError on nil and non-numeric arguments" do
+    lambda { [nil].pack('w') }.should raise_error(TypeError)
+    lambda { [()].pack('w') }.should raise_error(TypeError)
+    lambda { ['a'].pack('w') }.should raise_error(TypeError)
+    lambda { [Object.new].pack('w') }.should raise_error(TypeError)
+  end
+
+  ruby_version_is '1.9' do
+    it "returns an ASCII-8BIT string" do
+      [1].pack('w').encoding.should == Encoding::ASCII_8BIT
+    end
+  end
+end
+
+
+describe "Array#pack with format 'X'" do
+  it "decreases result string by one byte" do
+    ['abcdef'].pack('A4X').should == 'abc'
+  end
+  it "with count decreases result string by count bytes" do
+    ['abcdef'].pack('A6X4').should == 'ab'
+  end
+
+  it "with zero count doesn't change result string" do
+    ['abcdef'].pack('A6X0').should == 'abcdef'
+  end
+
+  it "treats start parameter as zero count" do
+    ['abcdef'].pack('A6X*').should == 'abcdef'
+  end
+
+  it "raises an ArgumentError if count greater than already generated string length" do
+    lambda { ['abcdef'].pack('A6X7') }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError if it is first directive" do
+    lambda { [].pack('X') }.should raise_error(ArgumentError)
+    lambda { [1].pack('XA') }.should raise_error(ArgumentError)
+  end
+
+  it "doesn't increment the array index count" do
+    ['abcd','efgh'].pack('A4X2A4').should == 'abefgh'
+  end
+
+  ruby_version_is '1.9' do
+    it "doesn't change encoding of the result string" do
+      [0x41, 0x42, 0x43].pack('U3X').encoding.should == Encoding::UTF_8
+      [1, 2, 3].pack('w3X').encoding.should == Encoding::ASCII_8BIT
+      ["\x01\x02"].pack("mX").encoding.should == Encoding::US_ASCII
+    end
+
+    it "doesn't care even if breaks a character" do
+      str = nil
+      lambda { str = [0x3042].pack("UX") }.should_not raise_error
+      str.encoding.should == Encoding::UTF_8
+      str.bytesize.should == 2
+      str.valid_encoding?.should be_false
+    end
+  end
+end
+
+describe "Array#pack with '@'" do
+  it "moves the end of result string into the specified position by offset from head" do
+    [0xABCDEF01].pack("N @2").should == binary("\xAB\xCD")
+  end
+  it "fills blank with NUL bytes if the position exceeds the end of string" do
+    [0xABCDEF01].pack("N @6").should == binary("\xAB\xCD\xEF\x01\x00\x00")
+  end
+  it "concatenates successing formats at the position '@' moves it into" do
+    [0xABCDEF01, 0x41].pack("N @2 C").should == binary("\xAB\xCD\x41")
+    [0xABCDEF01, 0x41].pack("N @6 C").should == binary("\xAB\xCD\xEF\x01\x00\x00\x41")
+  end
+  it "does not recover lost bytes when shorten the string and then extends it again" do
+    [0xABCDEF01, 0x41].pack("N @2 @6 C").should == binary("\xAB\xCD\x00\x00\x00\x00\x41")
+  end
+  it "is able to work with 'X'" do
+    [0xABCDEF01, 0x41].pack("N X @6 C").should == binary("\xAB\xCD\xEF\x00\x00\x00\x41")
+  end
+
+  ruby_version_is '1.9' do
+    it "doesn't change encoding of the result string" do
+      [0x41, 0x42, 0x43].pack('U3 at 6').encoding.should == Encoding::UTF_8
+      [1, 2, 3].pack('w3 at 3').encoding.should == Encoding::ASCII_8BIT
+      ["\x01\x02"].pack("m at 4").encoding.should == Encoding::US_ASCII
+    end
+
+    it "doesn't care even if breaks a character" do
+      str = nil
+      lambda { str = [0x3042].pack("U at 2") }.should_not raise_error
+      str.encoding.should == Encoding::UTF_8
+      str.bytesize.should == 2
+      str.valid_encoding?.should be_false
+    end
+  end
+end
+
+
+describe "Array#pack with format 'x'" do
+  it "returns NUL-byte string" do
+    [].pack('x').should == "\000"
+  end
+
+  it "returns string of count zero chars with count" do
+    [].pack('x5').should == "\000\000\000\000\000"
+  end
+
+  it "returns empty string with count == 0" do
+    [].pack('x0').should == ""
+  end
+
+  it "behaves like with count == 0 with star parameter" do
+    [].pack('x*').should == ""
+  end
+
+  it "doesn't increment the array index count" do
+    ['abcd','efgh'].pack('A4x2A4').should == "abcd\000\000efgh"
+  end
+
+  ruby_version_is '1.9' do
+    it "returns an US-ASCII string" do
+      ["abcd"].pack('u').encoding.should == Encoding::US_ASCII
+    end
+  end
+end
+
+
+
+describe "Array#pack with pointer format", :shared => true do
+  before(:all) { require 'dl' }
+  platform_is(:wordsize => 32){ before { @pointer_size = 4 } }
+  platform_is(:wordsize => 64){ before { @pointer_size = 8 } }
+
+  ruby_version_is '' ... '1.9' do
+    before do
+      def self.cstr(ptr)
+        ptr = ptr.unpack({ 4 => 'L', 8 => 'Q' }[@pointer_size]).first
+        ptr = DL::PtrData.new(ptr, 1)
+        def ptr.[](pos) super(pos,1)[0] end
+        ptr
+      end
+
+      def self.cbyte(byte)
+        byte.chr
+      end
+    end
+  end
+  ruby_version_is '1.9' do
+    before do
+      def self.cstr(ptr)
+        ptr = ptr.unpack({ 4 => 'L', 8 => 'Q' }[@pointer_size]).first
+        DL::CPtr.new(ptr, 1)
+      end
+      def self.cbyte(byte)
+        byte.ord
+      end
+    end
+  end
+
+  not_supported_on :jruby do
+    it "returns a pointer to internal byte sequence" do
+      ["abc"].pack('p').length.should == @pointer_size
+    end
+
+    it "returns a pointer which is able to dereferenced into NUL terminated byte sequence" do 
+      ptr = ["\x41\x42\x43"].pack('p')
+      cstr(ptr)[0].should == 0x41
+      cstr(ptr)[1].should == 0x42
+      cstr(ptr)[2].should == 0x43
+      cstr(ptr)[3].should == 0x00
+
+      ptr = [utf8("\xE3\x81\x82")].pack('p')  # Japanese Hiragana 'A' in UTF-8
+      (cstr(ptr)[0] & 0xFF).should == 0xE3
+      (cstr(ptr)[1] & 0xFF).should == 0x81
+      (cstr(ptr)[2] & 0xFF).should == 0x82
+      (cstr(ptr)[3] & 0xFF).should == 0x00
+    end
+
+    it "returns a pointer which is able to dereferenced into a right value" do
+      str = "Tim"
+      ptr = [str].pack('p')
+      cstr(ptr)[0] = cbyte(?J)
+      str.should == "Jim"
+    end
+
+    # TODO: Is there an architecture whose internal representation of NULL pointer is not zero and on which Ruby can work?
+    it "returns null pointer when passed nil" do
+      [nil].pack('p').should == "\x00" * @pointer_size
+    end
+  end
+end
+
+describe "Array#pack with format 'p'" do
+  not_supported_on :jruby do
+    it "consumes a String" do
+      lambda { ["abc"].pack('p') }.should_not raise_error
+      ["abc", 0x7E].pack('pC')[-1, 1].should == "\x7E"
+    end
+
+    it_behaves_like "Array#pack with pointer format", 'p'
+
+    it "tries to convert the pack argument to a String using #to_str" do
+      obj = mock('to_str')
+      obj.should_receive(:to_str).and_return("abc")
+      lambda{ [obj].pack('p') }.should_not raise_error
+    end
+
+    it "raises a TypeError if corresponding array item is not String" do
+      lambda { [123].pack('p') }.should raise_error(TypeError)
+      lambda { [:data].pack('p') }.should raise_error(TypeError)
+      lambda { [mock('not string')].pack('p') }.should raise_error(TypeError)
+    end
+
+    it "returns empty string if count = 0 with" do
+      ['abcde'].pack("p0").should == ''
+    end
+
+    it "only takes as many elements as specified after ('p')" do
+      ary = ["abc", "def", "ghi", "jkl"]
+      ary.pack('p').should == [ary[0]].pack('p')
+      ary.pack('p2').should == [ary[0]].pack('p') + [ary[1]].pack('p')
+      ary.pack('p2p').should == [ary[0]].pack('p') + [ary[1]].pack('p') + [ary[2]].pack('p')
+    end
+
+    it "consumes the whole argument string with star parameter" do
+      ary = ["abc", "def", "ghi", "jkl"]
+      ary.pack('p*').should == ary.pack('p4')
+    end
+
+    it "raises an ArgumentError if count is greater than array elements left" do
+      lambda { ["abc", "def"].pack("p3") }.should raise_error(ArgumentError)
+    end
+
+    ruby_version_is '1.9' do
+      it "returns an ASCII-8BIT string" do
+	["abcd"].pack('p').encoding.should == Encoding::ASCII_8BIT
+      end
+    end
+  end
+end
+
+describe "Array#pack with format 'P'" do
+  not_supported_on :jruby do
+    it "consumes a String" do
+      lambda { ["abc"].pack('P') }.should_not raise_error
+      ["abc", 0x7E].pack('PC')[-1, 1].should == "\x7E"
+    end
+
+    it_behaves_like "Array#pack with pointer format", 'P'
+
+    # TODO: Is there an architecture whose internal representation of NULL pointer is not zero and on which Ruby can work?
+    it "returns null pointer when passed nil" do
+      [nil].pack('P').should == "\x00" * @pointer_size
+    end
+
+    it "tries to convert the pack argument to a String using #to_str" do
+      obj = mock('to_str')
+      obj.should_receive(:to_str).any_number_of_times.and_return("abc")
+      lambda{ [obj].pack('P') }.should_not raise_error
+    end
+
+    it "raises a TypeError if corresponding array item is not String" do
+      lambda { [123].pack('P') }.should raise_error(TypeError)
+      lambda { [:data].pack('P') }.should raise_error(TypeError)
+      lambda { [mock('not string')].pack('P') }.should raise_error(TypeError)
+    end
+
+    it "consumes one array item per a format" do
+      ary = ["abc", "def", "ghi", "jkl"]
+      ary.pack('P').should == [ary[0]].pack('P')
+      ary.pack('P2').should == [ary[0]].pack('P')
+      ary.pack('P2P').should == [ary[0]].pack('P') + [ary[1]].pack('P')
+    end
+
+    ruby_bug("[ruby-dev:37289]", "1.8.7.73") do
+      it "ignores '*' parameter" do 
+	ary = ["abc", "def", "ghi", "jkl"]
+	ary.pack('P*').should == [ary[0]].pack('P')
+      end
+    end
+
+    it "returns a pointer to zero-length byte sequence if count = 0 with" do
+      str = 'abcde'
+      [str].pack('P0').should == [str].pack('P')
+    end
+
+    it "raises an ArgumentError if count is greater than the corresponding string in array" do
+      lambda { ["abc", "def"].pack("P3") }.should_not raise_error(ArgumentError)
+      lambda { ["ab", "def"].pack("P3") }.should raise_error(ArgumentError)
+    end
+
+    ruby_version_is '1.9' do
+      it "returns an ASCII-8BIT string" do
+	["abcd"].pack('P').encoding.should == Encoding::ASCII_8BIT
+      end
+    end
+  end
+end
+
+describe "String#unpack with 'w' directive" do
+  it "produces a BER-compressed integer" do
+    [88].pack('w').should == 'X'
+    [88,89,90].pack('www').should == 'XYZ'
+    [88,89,90].pack('w3').should == 'XYZ'
+    [92,48,48,49].pack('w4').should == '\001'
+    [104,101,108,108,111,32,119,111,114,108,100].pack('w*').should == 'hello world'
+    [1234567890].pack('w').should == "\204\314\330\205R"
+  end
+end
+
+# vim:fileencoding=iso-8859-1

Added: MacRuby/branches/experimental/spec/frozen/core/array/partition_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/partition_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/partition_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,43 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#partition" do
+  it "returns two arrays" do
+    [].partition {}.should == [[], []]
+  end
+  
+  it "returns in the left array values for which the block evaluates to true" do
+    ary = [0, 1, 2, 3, 4, 5]
+
+    ary.partition { |i| true }.should == [ary, []]
+    ary.partition { |i| 5 }.should == [ary, []]
+    ary.partition { |i| false }.should == [[], ary]
+    ary.partition { |i| nil }.should == [[], ary]
+    ary.partition { |i| i % 2 == 0 }.should == [[0, 2, 4], [1, 3, 5]]
+    ary.partition { |i| i / 3 == 0 }.should == [[0, 1, 2], [3, 4, 5]]
+  end
+
+  it "properly handles recursive arrays" do
+    empty = ArraySpecs.empty_recursive_array
+    empty.partition { true }.should == [[empty], []]
+    empty.partition { false }.should == [[], [empty]]
+
+    array = ArraySpecs.recursive_array
+    array.partition { true }.should == [
+      [1, 'two', 3.0, array, array, array, array, array],
+      []
+    ]
+    condition = true
+    array.partition { condition = !condition }.should == [
+      ['two', array, array, array],
+      [1, 3.0, array, array]
+    ]
+  end
+
+  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
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/plus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/plus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/plus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,59 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#+" do
+  it "concatenates two arrays" do
+    ([ 1, 2, 3 ] + [ 3, 4, 5 ]).should == [1, 2, 3, 3, 4, 5]
+    ([ 1, 2, 3 ] + []).should == [1, 2, 3]
+    ([] + [ 1, 2, 3 ]).should == [1, 2, 3]
+    ([] + []).should == []
+  end
+
+  it "can concatenate an array with itself" do
+    ary = [1, 2, 3]
+    (ary + ary).should == [1, 2, 3, 1, 2, 3]
+  end
+
+  it "tries to convert the passed argument to an Array using #to_ary" do
+    obj = mock('["x", "y"]')
+    obj.should_receive(:to_ary).and_return(["x", "y"])
+    ([1, 2, 3] + obj).should == [1, 2, 3, "x", "y"]
+  end
+
+  it "properly handles recursive arrays" do
+    empty = ArraySpecs.empty_recursive_array
+    (empty + empty).should == [empty, empty]
+
+    array = ArraySpecs.recursive_array
+    (empty + array).should == [empty, 1, 'two', 3.0, array, array, array, array, array]
+    (array + array).should == [
+      1, 'two', 3.0, array, array, array, array, array,
+      1, 'two', 3.0, array, array, array, array, array]
+  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
+  end
+
+  it "does not call to_ary on array subclasses" do
+    ([5, 6] + ArraySpecs::ToAryArray[1, 2]).should == [5, 6, 1, 2]
+  end
+
+  it "does not infected even if an original array is tainted" do
+    ([1, 2] + [3, 4]).tainted?.should be_false
+    ([1, 2].taint + [3, 4]).tainted?.should be_false
+    ([1, 2] + [3, 4].taint).tainted?.should be_false
+    ([1, 2].taint + [3, 4].taint).tainted?.should be_false
+  end
+
+  ruby_version_is '1.9' do
+    it "does not infected even if an original array is untrusted" do
+      ([1, 2] + [3, 4]).untrusted?.should be_false
+      ([1, 2].untrust + [3, 4]).untrusted?.should be_false
+      ([1, 2] + [3, 4].untrust).untrusted?.should be_false
+      ([1, 2].untrust + [3, 4].untrust).untrusted?.should be_false
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/pop_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/pop_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/pop_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,183 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#pop" do
+  it "removes and returns the last element of the array" do
+    a = ["a", 1, nil, true]
+
+    a.pop.should == true
+    a.should == ["a", 1, nil]
+
+    a.pop.should == nil
+    a.should == ["a", 1]
+
+    a.pop.should == 1
+    a.should == ["a"]
+
+    a.pop.should == "a"
+    a.should == []
+  end
+
+  it "returns nil if there are no more elements" do
+    [].pop.should == nil
+  end
+
+  it "properly handles recursive arrays" do
+    empty = ArraySpecs.empty_recursive_array
+    empty.pop.should == []
+
+    array = ArraySpecs.recursive_array
+    array.pop.should == [1, 'two', 3.0, array, array, array, array]
+  end
+
+  it "keeps taint status" do
+    a = [1, 2].taint
+    a.pop
+    a.tainted?.should be_true
+    a.pop
+    a.tainted?.should be_true
+  end
+
+  ruby_version_is '' ... '1.9' do
+    it "raises a TypeError on a frozen array" do
+      lambda { ArraySpecs.frozen_array.pop }.should raise_error(TypeError)
+    end
+  end
+
+  ruby_version_is '1.9' do
+    it "raises a RuntimeError on a frozen array" do
+      lambda { ArraySpecs.frozen_array.pop }.should raise_error(RuntimeError)
+    end
+
+    it "keeps untrusted status" do
+      a = [1, 2].untrust
+      a.pop
+      a.untrusted?.should be_true
+      a.pop
+      a.untrusted?.should be_true
+    end
+  end
+
+  ruby_version_is '' ... '1.8.7' do
+    it "raises an ArgumentError if passed an argument" do
+      lambda{ [1, 2].pop(1) }.should raise_error(ArgumentError)
+    end
+  end
+
+  describe "passed a number n as an argument" do
+    ruby_version_is '1.8.7' do
+      it "removes and returns an array with the last n element of the array" do
+        a = [1, 2, 3, 4, 5, 6]
+
+        a.pop(0).should == []
+        a.should == [1, 2, 3, 4, 5, 6]
+
+        a.pop(1).should == [6]
+        a.should == [1, 2, 3, 4, 5]
+
+        a.pop(2).should == [4, 5]
+        a.should == [1, 2, 3]
+
+        a.pop(3).should == [1, 2, 3]
+        a.should == []
+      end
+
+      it "returns a new empty array if there are no more elements" do
+        a = []
+        popped1 = a.pop(1)
+        popped1.should == []
+        a.should == []
+
+        popped2 = a.pop(2)
+        popped2.should == []
+        a.should == []
+
+        popped1.should_not equal(popped2)
+      end
+
+      it "returns whole elements if n exceeds size of the array" do
+        a = [1, 2, 3, 4, 5]
+        a.pop(6).should == [1, 2, 3, 4, 5]
+        a.should == []
+      end
+
+      it "does not return self even when it returns whole elements" do
+        a = [1, 2, 3, 4, 5]
+        a.pop(5).should_not equal(a)
+
+        a = [1, 2, 3, 4, 5]
+        a.pop(6).should_not equal(a)
+      end
+
+      it "raises an ArgumentError if n is negative" do
+        lambda{ [1, 2, 3].pop(-1) }.should raise_error(ArgumentError)
+      end
+
+      it "tries to convert n to an Integer using #to_int" do
+        a = [1, 2, 3, 4]
+        a.pop(2.3).should == [3, 4]
+
+        obj = mock('to_int')
+        obj.should_receive(:to_int).and_return(2)
+        a.should == [1, 2]
+        a.pop(obj).should == [1, 2]
+        a.should == []
+      end
+
+      it "raises a TypeError when the passed n can be coerced to Integer" do
+        lambda{ [1, 2].pop("cat") }.should raise_error(TypeError)
+        lambda{ [1, 2].pop(nil) }.should raise_error(TypeError)
+      end
+
+      it "raises an ArgumentError if more arguments are passed" do
+        lambda{ [1, 2].pop(1, 2) }.should raise_error(ArgumentError)
+      end
+
+      it "does not return subclass instances with Array subclass" do
+        ArraySpecs::MyArray[1, 2, 3].pop(2).class.should == Array
+      end
+
+      it "returns an untainted array even if the array is tainted" do
+        ary = [1, 2].taint
+        ary.pop(2).tainted?.should be_false
+        ary.pop(0).tainted?.should be_false
+      end
+
+      it "keeps taint status" do
+        a = [1, 2].taint
+        a.pop(2)
+        a.tainted?.should be_true
+        a.pop(2)
+        a.tainted?.should be_true
+      end
+
+      ruby_version_is '' ... '1.9' do
+        it "raises a TypeError on a frozen array" do
+          lambda { ArraySpecs.frozen_array.pop(2) }.should raise_error(TypeError)
+          lambda { ArraySpecs.frozen_array.pop(0) }.should raise_error(TypeError)
+        end
+      end
+    end
+
+    ruby_version_is '1.9' do
+      it "returns a trusted array even if the array is untrusted" do
+        ary = [1, 2].untrust
+        ary.pop(2).untrusted?.should be_false
+        ary.pop(0).untrusted?.should be_false
+      end
+
+      it "raises a RuntimeError on a frozen array" do
+        lambda { ArraySpecs.frozen_array.pop(2) }.should raise_error(RuntimeError)
+        lambda { ArraySpecs.frozen_array.pop(0) }.should raise_error(RuntimeError)
+      end
+
+      it "keeps untrusted status" do
+        a = [1, 2].untrust
+        a.pop(2)
+        a.untrusted?.should be_true
+        a.pop(2)
+        a.untrusted?.should be_true
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/push_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/push_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/push_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#push" do
+  it "appends the arguments to the array" do
+    a = [ "a", "b", "c" ]
+    a.push("d", "e", "f").should equal(a)
+    a.push().should == ["a", "b", "c", "d", "e", "f"]
+    a.push(5)
+    a.should == ["a", "b", "c", "d", "e", "f", 5]
+  end
+
+  it "isn't confused by previous shift" do
+    a = [ "a", "b", "c" ]
+    a.shift
+    a.push("foo")
+    a.should == ["b", "c", "foo"]
+  end
+
+  it "properly handles recursive arrays" do
+    empty = ArraySpecs.empty_recursive_array
+    empty.push(:last).should == [empty, :last]
+
+    array = ArraySpecs.recursive_array
+    array.push(:last).should == [1, 'two', 3.0, array, array, array, array, array, :last]
+  end
+
+  it "raises a TypeError on a frozen array if modification takes place" do
+    lambda { ArraySpecs.frozen_array.push(1) }.should raise_error(TypeError)
+  end
+
+  it "does not raise on a frozen array if no modification is made" do
+    ArraySpecs.frozen_array.push.should == [1, 2, 3]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/rassoc_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/rassoc_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/rassoc_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,38 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#rassoc" do
+  it "returns the first contained array whose second element is == object" do
+    ary = [[1, "a", 0.5], [2, "b"], [3, "b"], [4, "c"], [], [5], [6, "d"]]
+    ary.rassoc("a").should == [1, "a", 0.5]
+    ary.rassoc("b").should == [2, "b"]
+    ary.rassoc("d").should == [6, "d"]
+    ary.rassoc("z").should == nil
+  end
+
+  it "properly handles recursive arrays" do
+    empty = ArraySpecs.empty_recursive_array
+    empty.rassoc([]).should be_nil
+    [[empty, empty]].rassoc(empty).should == [empty, empty]
+
+    array = ArraySpecs.recursive_array
+    array.rassoc(array).should be_nil
+    [[empty, array]].rassoc(array).should == [empty, array]
+  end
+
+  it "calls elem == obj on the second element of each contained array" do
+    key = 'foobar'
+    o = mock('foobar')
+    def o.==(other); other == 'foobar'; end
+
+    [[1, :foobar], [2, o], [3, mock('foo')]].rassoc(key).should == [2, o]
+  end
+
+  it "does not check the last element in each contained but speficically the second" do
+    key = 'foobar'
+    o = mock('foobar')
+    def o.==(other); other == 'foobar'; end
+
+    [[1, :foobar, o], [2, o, 1], [3, mock('foo')]].rassoc(key).should == [2, o, 1]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/reject_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/reject_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/reject_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,95 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#reject" do
+  it "returns a new array without elements for which block is true" do
+    ary = [1, 2, 3, 4, 5]
+    ary.reject { true }.should == []
+    ary.reject { false }.should == ary
+    ary.reject { nil }.should == ary
+    ary.reject { 5 }.should == []
+    ary.reject { |i| i < 3 }.should == [3, 4, 5]
+    ary.reject { |i| i % 2 == 0 }.should == [1, 3, 5]
+  end
+
+  it "properly handles recursive arrays" do
+    empty = ArraySpecs.empty_recursive_array
+    empty.reject { false }.should == [empty]
+    empty.reject { true }.should == []
+
+    array = ArraySpecs.recursive_array
+    array.reject { false }.should == [1, 'two', 3.0, array, array, array, array, array]
+    array.reject { true }.should == []
+  end
+
+  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
+    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
+    end
+  end
+end
+
+describe "Array#reject!" do
+  it "removes elements for which block is true" do
+    a = [3, 4, 5, 6, 7, 8, 9, 10, 11]
+    a.reject! { |i| i % 2 == 0 }.should equal(a)
+    a.should == [3, 5, 7, 9, 11]
+    a.reject! { |i| i > 8 }
+    a.should == [3, 5, 7]
+    a.reject! { |i| i < 4 }
+    a.should == [5, 7]
+    a.reject! { |i| i == 5 }
+    a.should == [7]
+    a.reject! { true }
+    a.should == []
+    a.reject! { true }
+    a.should == []
+  end
+
+  it "properly handles recursive arrays" do
+    empty = ArraySpecs.empty_recursive_array
+    empty_dup = empty.dup
+    empty.reject! { false }.should == nil
+    empty.should == empty_dup
+
+    empty = ArraySpecs.empty_recursive_array
+    empty.reject! { true }.should == []
+    empty.should == []
+
+    array = ArraySpecs.recursive_array
+    array_dup = array.dup
+    array.reject! { false }.should == nil
+    array.should == array_dup
+
+    array = ArraySpecs.recursive_array
+    array.reject! { true }.should == []
+    array.should == []
+  end
+
+  it "returns nil if no changes are made" do
+    a = [1, 2, 3]
+
+    a.reject! { |i| i < 0 }.should == nil
+
+    a.reject! { true }
+    a.reject! { true }.should == nil
+  end
+
+  ruby_version_is "" ... "1.9" do
+    it "raises a TypeError on a frozen array" do
+      lambda { ArraySpecs.frozen_array.reject! {} }.should raise_error(TypeError)
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "raises a RuntimeError on a frozen array" do
+      lambda { ArraySpecs.frozen_array.reject! {} }.should raise_error(RuntimeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/replace_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/replace_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/replace_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/replace'
+
+describe "Array#replace" do
+  it_behaves_like(:array_replace, :replace)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/reverse_each_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/reverse_each_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/reverse_each_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,38 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#reverse_each" do
+  it "traverses array in reverse order and pass each element to block" do
+    a = []
+    [1, 3, 4, 6].reverse_each { |i| a << i }
+    a.should == [6, 4, 3, 1]
+  end
+
+  it "properly handles recursive arrays" do
+    res = []
+    empty = ArraySpecs.empty_recursive_array
+    empty.reverse_each { |i| res << i }
+    res.should == [empty]
+
+    res = []
+    array = ArraySpecs.recursive_array
+    array.reverse_each { |i| res << i }
+    res.should == [array, array, array, array, array, 3.0, 'two', 1]
+  end
+
+  it "does not fail when removing elements from block" do
+    ary = [0, 0, 1, 1, 3, 2, 1, :x]
+
+    count = 0
+
+    ary.reverse_each do |item|
+      count += 1
+
+      if item == :x then
+        ary.slice!(1..-1)
+      end
+    end
+
+    count.should == 2
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/reverse_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/reverse_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/reverse_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,42 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#reverse" do
+  it "returns a new array with the elements in reverse order" do
+    [].reverse.should == []
+    [1, 3, 5, 2].reverse.should == [2, 5, 3, 1]
+  end
+
+  it "returns subclass instance on Array subclasses" do
+    ArraySpecs::MyArray[1, 2, 3].reverse.class.should == ArraySpecs::MyArray
+  end
+
+  it "properly handles recursive arrays" do
+    empty = ArraySpecs.empty_recursive_array
+    empty.reverse.should == empty
+
+    array = ArraySpecs.recursive_array
+    array.reverse.should == [array, array, array, array, array, 3.0, 'two', 1]
+  end
+end
+
+describe "Array#reverse!" do
+  it "reverses the elements in place" do
+    a = [6, 3, 4, 2, 1]
+    a.reverse!.should equal(a)
+    a.should == [1, 2, 4, 3, 6]
+    [].reverse!.should == []
+  end
+
+  it "properly handles recursive arrays" do
+    empty = ArraySpecs.empty_recursive_array
+    empty.reverse!.should == [empty]
+
+    array = ArraySpecs.recursive_array
+    array.reverse!.should == [array, array, array, array, array, 3.0, 'two', 1]
+  end
+
+  it "raises a TypeError on a frozen array" do
+    lambda { ArraySpecs.frozen_array.reverse! }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/rindex_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/rindex_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/rindex_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,49 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#rindex" do
+  it "returns the first index backwards from the end where element == to object" do
+    key = 3
+    uno = mock('one')
+    dos = mock('two')
+    tres = mock('three')
+    tres.should_receive(:==).any_number_of_times.and_return(false)
+    dos.should_receive(:==).any_number_of_times.and_return(true)
+    uno.should_not_receive(:==)
+    ary = [uno, dos, tres]
+
+    ary.rindex(key).should == 1
+  end
+
+  it "returns size-1 if last element == to object" do
+    [2, 1, 3, 2, 5].rindex(5).should == 4
+  end
+
+  it "returns 0 if only first element == to object" do
+    [2, 1, 3, 1, 5].rindex(2).should == 0
+  end
+
+  it "returns nil if no element == to object" do
+    [1, 1, 3, 2, 1, 3].rindex(4).should == nil
+  end
+
+  it "does not fail when removing elements from block" do
+    sentinel = mock('sentinel')
+    ary = [0, 0, 1, 1, 3, 2, 1, sentinel]
+
+    sentinel.instance_variable_set(:@ary, ary)
+    def sentinel.==(o) @ary.slice!(1..-1); false; end
+
+    ary.rindex(0).should == 0
+  end
+
+  it "properly handles recursive arrays" do
+    empty = ArraySpecs.empty_recursive_array
+    empty.rindex(empty).should == 0
+    empty.rindex(1).should be_nil
+
+    array = ArraySpecs.recursive_array
+    array.rindex(1).should == 0
+    array.rindex(array).should == 7
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/select_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/select_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/select_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#select" do
+  it "returns a new array of elements for which block is true" do
+    [1, 3, 4, 5, 6, 9].select { |i| i % ((i + 1) / 2) == 0}.should == [1, 4, 6]
+  end
+
+  it "does not return subclass instance on Array subclasses" do
+    ArraySpecs::MyArray[1, 2, 3].select { true }.class.should == Array
+  end
+
+  it "properly handles recursive arrays" do
+    empty = ArraySpecs.empty_recursive_array
+    empty.select { true }.should == empty
+    empty.select { false }.should == []
+
+    array = ArraySpecs.recursive_array
+    array.select { true }.should == [1, 'two', 3.0, array, array, array, array, array]
+    array.select { false }.should == []
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/shared/clone.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/shared/clone.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/shared/clone.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,44 @@
+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
+  end
+
+  it "produces a shallow copy where the references are directly copied" do
+    a = [mock('1'), mock('2')]
+    b = a.send @method
+    b.first.object_id.should == a.first.object_id
+    b.last.object_id.should == a.last.object_id
+  end
+
+  it "creates a new array containing all elements or the original" do
+    a = [1, 2, 3, 4]
+    b = a.send @method
+    b.should == a
+    b.__id__.should_not == a.__id__
+  end
+
+  it "copies taint status from the original" do
+    a = [1, 2, 3, 4]
+    b = [1, 2, 3, 4]
+    a.taint
+    aa = a.send @method
+    bb = b.send @method
+
+    aa.tainted?.should == true
+    bb.tainted?.should == false
+  end
+
+  ruby_version_is '1.9' do
+    it "copies untrusted status from the original" do
+      a = [1, 2, 3, 4]
+      b = [1, 2, 3, 4]
+      a.untrust
+      aa = a.send @method
+      bb = b.send @method
+
+      aa.untrusted?.should == true
+      bb.untrusted?.should == false
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/shared/collect.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/shared/collect.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/shared/collect.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,143 @@
+describe :array_collect, :shared => true do
+  it "returns a copy of array with each element replaced by the value returned by block" do
+    a = ['a', 'b', 'c', 'd']
+    b = a.send(@method) { |i| i + '!' }
+    b.should == ["a!", "b!", "c!", "d!"]
+    b.object_id.should_not == a.object_id
+  end
+
+  it "does not return subclass instance" do
+    ArraySpecs::MyArray[1, 2, 3].send(@method) { |x| x + 1 }.class.should == Array
+  end
+
+  it "does not change self" do
+    a = ['a', 'b', 'c', 'd']
+    b = a.send(@method) { |i| i + '!' }
+    a.should == ['a', 'b', 'c', 'd']
+  end
+
+  it "returns the evaluated value of block if it broke in the block" do
+    a = ['a', 'b', 'c', 'd']
+    b = a.send(@method) {|i|
+      if i == 'c'
+        break 0
+      else
+        i + '!'
+      end
+    }
+    b.should == 0
+  end
+
+  ruby_version_is '' ... '1.9' do
+    it 'returns a copy of self if no block given' do
+      a = [1, 2, 3]
+
+      copy = a.send(@method)
+      copy.should == a
+      copy.should_not equal(a)
+    end
+  end
+  ruby_version_is '1.9' do
+    it "returns an Enumerator when no block given" do
+      a = [1, 2, 3]
+      a.send(@method).should be_kind_of(Enumerator)
+    end
+  end
+
+  it "does not copy tainted status" do
+    a = [1, 2, 3]
+    a.taint
+    a.send(@method){|x| x}.tainted?.should be_false
+  end
+
+  ruby_version_is '1.9' do
+    it "does not copy untrusted status" do
+      a = [1, 2, 3]
+      a.untrust
+      a.send(@method){|x| x}.untrusted?.should be_false
+    end
+  end
+end
+
+describe :array_collect_b, :shared => true do
+  it "replaces each element with the value returned by block" do
+    a = [7, 9, 3, 5]
+    a.send(@method) { |i| i - 1 }.should equal(a)
+    a.should == [6, 8, 2, 4]
+  end
+
+  it "returns self" do
+    a = [1, 2, 3, 4, 5]
+    b = a.send(@method) {|i| i+1 }
+    a.object_id.should == b.object_id
+  end
+
+  it "returns the evaluated value of block but its contents is partially modified, if it broke in the block" do
+    a = ['a', 'b', 'c', 'd']
+    b = a.send(@method) {|i|
+      if i == 'c'
+        break 0
+      else
+        i + '!'
+      end
+    }
+    b.should == 0
+    a.should == ['a!', 'b!', 'c', 'd']
+  end
+
+  ruby_version_is '' ... '1.8.7' do
+    it 'raises LocalJumpError if no block given' do
+      a = [1, 2, 3]
+      lambda { a.send(@method) }.should raise_error(LocalJumpError)
+    end
+  end
+
+  ruby_version_is '1.8.7' ... '1.9' do
+    it "returns an Enumerable::Enumerator when no block given, and the enumerator can modify the original array" do
+      a = [1, 2, 3]
+      enum = a.send(@method)
+      enum.should be_kind_of(Enumerable::Enumerator)
+      enum.each{|i| "#{i}!" }
+      a.should == ["1!", "2!", "3!"]
+    end
+  end
+
+  ruby_version_is '1.9' do
+    it "returns an Enumerator when no block given, and the enumeratoe can modify the original array" do
+      a = [1, 2, 3]
+      enum = a.send(@method)
+      enum.should be_kind_of(Enumerator)
+      enum.each{|i| "#{i}!" }
+      a.should == ["1!", "2!", "3!"]
+    end
+  end
+
+  it "keeps tainted status" do
+    a = [1, 2, 3]
+    a.taint
+    a.tainted?.should be_true
+    a.send(@method){|x| x}
+    a.tainted?.should be_true
+  end
+
+  ruby_version_is '1.9' do
+    it "keeps untrusted status" do
+      a = [1, 2, 3]
+      a.untrust
+      a.send(@method){|x| x}
+      a.untrusted?.should be_true
+    end
+  end
+
+  ruby_version_is '' ... '1.9' do
+    it "raises a TypeError on a frozen array" do
+      lambda { ArraySpecs.frozen_array.send(@method) {} }.should raise_error(TypeError)
+    end
+  end
+
+  ruby_version_is '1.9' do
+    it "raises a RuntimeError on a frozen array" do
+      lambda { ArraySpecs.frozen_array.send(@method) {} }.should raise_error(RuntimeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/shared/indexes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/shared/indexes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/shared/indexes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+describe :array_indexes, :shared => true do
+  it "returns elements at integer argument indexes (DEPRECATED)" do
+    array = [1, 2, 3, 4, 5]
+
+    x = mock('4')
+    def x.to_int() 4 end
+
+    params = [1, 0, 5, -1, -8, 10, x]
+    array.send(@method, *params).should == array.values_at(*params)
+  end
+  
+  it "tries to convert the passed arguments to Integers using #to_int" do
+    obj = mock('to_int')
+    obj.should_receive(:to_int).and_return(1, 3)
+    [1, 2, 3, 4, 5].send(@method, obj, obj).should == [2, 4]
+  end
+
+  it "returns elements in range arguments as nested arrays (DEPRECATED)" do
+    array = [1, 2, 3, 4, 5]
+    params = [0..2, 1...3, 4..6]
+    array.indexes(*params).should == [[1, 2, 3], [2, 3], [5]]
+    array.indices(*params).should == [[1, 2, 3], [2, 3], [5]]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/shared/join.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/shared/join.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/shared/join.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,124 @@
+describe :array_join, :shared => true do
+  it "returns an empty string if the Array is empty" do
+    a = []
+    a.send(@method, ':').should == ''
+  end
+
+  it "returns a string formed by concatenating each element.to_s separated by separator without trailing separator" do
+    obj = mock('foo')
+    def obj.to_s() 'foo' end
+    [1, 2, 3, 4, obj].send(@method, ' | ').should == '1 | 2 | 3 | 4 | foo'
+
+    obj = mock('o')
+    class << obj; undef :to_s; end
+    obj.should_receive(:method_missing).with(:to_s).and_return("o")
+    [1, obj].send(@method, ":").should == "1:o"
+  end
+
+  it "raises a NoMethodError if an element does not respond to #to_s" do
+    obj = mock('o')
+    class << obj; undef :to_s; end
+    lambda{ [1,obj].send(@method, ':') }.should raise_error(NoMethodError)
+  end
+
+  it "uses the same separator with nested arrays" do
+    [1, [2, [3, 4], 5], 6].send(@method, ":").should == "1:2:3:4:5:6"
+    [1, [2, ArraySpecs::MyArray[3, 4], 5], 6].send(@method, ":").should == "1:2:3:4:5:6"
+  end
+
+  it "tries to convert the passed separator to a String using #to_str" do
+    obj = mock('::')
+    obj.should_receive(:to_str).and_return("::")
+    [1, 2, 3, 4].send(@method, obj).should == '1::2::3::4'
+  end
+
+  # detail of joining recursive arrays is implementation depended. [ruby-dev:37021]
+  it "handles recursive arrays" do
+    x = []
+    x << x
+    x.send(@method, ':').should be_kind_of(String)
+
+    x = ["one", "two"]
+    x << x
+    str = x.send(@method, '/')
+    str.should include("one/two")
+
+    x << "three"
+    x << "four"
+    str = x.send(@method, '/')
+    str.should include("one/two")
+    str.should include("three/four")
+
+    # nested and recursive
+    x = [["one", "two"], ["three", "four"]]
+    x << x
+    str = x.send(@method, '/')
+    str.should include("one/two")
+    str.should include("three/four")
+
+    x = []
+    y = []
+    y << 9 << x << 8 << y << 7
+    x << 1 << x << 2 << y << 3
+    # representations when recursing from x
+    # these are here to make it easier to understand what is happening
+    str = x.send(@method, ':')
+    str.should include('1')
+    str.should include('2')
+    str.should include('3')
+  end
+
+  it "does not consider taint of either the array or the separator when the array is empty" do
+    [].send(@method, ":").tainted?.should == false
+    [].taint.send(@method, ":").tainted?.should == false
+    [].send(@method, ":".taint).tainted?.should == false
+    [].taint.send(@method, ":".taint).tainted?.should == false
+  end
+
+  it "returns a string which would be infected with taint of the array, its elements or the separator when the array is not empty" do
+    ["a", "b"].send(@method, ":").tainted?.should == false
+    ["a", "b"].send(@method, ":".taint).tainted?.should == true
+    ["a", "b"].taint.send(@method, ":").tainted?.should == true
+    ["a", "b"].taint.send(@method, ":".taint).tainted?.should == true
+    ["a", "b".taint].send(@method, ":").tainted?.should == true
+    ["a", "b".taint].send(@method, ":".taint).tainted?.should == true
+    ["a", "b".taint].taint.send(@method, ":").tainted?.should == true
+    ["a", "b".taint].taint.send(@method, ":".taint).tainted?.should == true
+    ["a".taint, "b"].send(@method, ":").tainted?.should == true
+    ["a".taint, "b"].send(@method, ":".taint).tainted?.should == true
+    ["a".taint, "b"].taint.send(@method, ":").tainted?.should == true
+    ["a".taint, "b"].taint.send(@method, ":".taint).tainted?.should == true
+    ["a".taint, "b".taint].send(@method, ":").tainted?.should == true
+    ["a".taint, "b".taint].send(@method, ":".taint).tainted?.should == true
+    ["a".taint, "b".taint].taint.send(@method, ":").tainted?.should == true
+    ["a".taint, "b".taint].taint.send(@method, ":".taint).tainted?.should == true
+  end
+
+  ruby_version_is '1.9' do
+    it "does not consider untrustworthiness of either the array or the separator when the array is empty" do
+      [].send(@method, ":").untrusted?.should == false
+      [].untrust.send(@method, ":").untrusted?.should == false
+      [].send(@method, ":".untrust).untrusted?.should == false
+      [].untrust.send(@method, ":".untrust).untrusted?.should == false
+    end
+
+    it "returns a string which would be infected with untrustworthiness of the array, its elements or the separator when the array is not empty" do
+      ["a", "b"].send(@method, ":").untrusted?.should == false
+      ["a", "b"].send(@method, ":".untrust).untrusted?.should == true
+      ["a", "b"].untrust.send(@method, ":").untrusted?.should == true
+      ["a", "b"].untrust.send(@method, ":".untrust).untrusted?.should == true
+      ["a", "b".untrust].send(@method, ":").untrusted?.should == true
+      ["a", "b".untrust].send(@method, ":".untrust).untrusted?.should == true
+      ["a", "b".untrust].untrust.send(@method, ":").untrusted?.should == true
+      ["a", "b".untrust].untrust.send(@method, ":".untrust).untrusted?.should == true
+      ["a".untrust, "b"].send(@method, ":").untrusted?.should == true
+      ["a".untrust, "b"].send(@method, ":".untrust).untrusted?.should == true
+      ["a".untrust, "b"].untrust.send(@method, ":").untrusted?.should == true
+      ["a".untrust, "b"].untrust.send(@method, ":".untrust).untrusted?.should == true
+      ["a".untrust, "b".untrust].send(@method, ":").untrusted?.should == true
+      ["a".untrust, "b".untrust].send(@method, ":".untrust).untrusted?.should == true
+      ["a".untrust, "b".untrust].untrust.send(@method, ":").untrusted?.should == true
+      ["a".untrust, "b".untrust].untrust.send(@method, ":".untrust).untrusted?.should == true
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/shared/length.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/shared/length.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/shared/length.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+describe :array_length, :shared => true do
+  it "returns the number of elements" do
+    [].send(@method).should == 0
+    [1, 2, 3].send(@method).should == 3
+  end
+
+  it "properly handles recursive arrays" do
+    ArraySpecs.empty_recursive_array.send(@method).should == 1
+    ArraySpecs.recursive_array.send(@method).should == 8
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/shared/replace.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/shared/replace.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/shared/replace.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,70 @@
+describe :array_replace, :shared => true do
+  it "replaces the elements with elements from other array" do
+    a = [1, 2, 3, 4, 5]
+    b = ['a', 'b', 'c']
+    a.send(@method, b).should equal(a)
+    a.should == b
+    a.should_not equal(b)
+
+    a.send(@method, [4] * 10)
+    a.should == [4] * 10
+
+    a.send(@method, [])
+    a.should == []
+  end
+
+  it "properly handles recursive arrays" do
+    orig = [1, 2, 3]
+    empty = ArraySpecs.empty_recursive_array
+    orig.send(@method, empty)
+    orig.should == empty
+
+    array = ArraySpecs.recursive_array
+    orig.send(@method, array)
+    orig.should == array
+  end
+
+  it "returns self" do
+    ary = [1, 2, 3]
+    other = [:a, :b, :c]
+    ary.send(@method, other).should equal(ary)
+  end
+
+  it "does not make self dependent to the original array" do
+    ary = [1, 2, 3]
+    other = [:a, :b, :c]
+    ary.send(@method, other)
+    ary.should == [:a, :b, :c]
+    ary << :d
+    ary.should == [:a, :b, :c, :d]
+    other.should == [:a, :b, :c]
+  end
+
+  it "tries to convert the passed argument to an Array using #to_ary" do
+    obj = mock('to_ary')
+    obj.stub!(:to_ary).and_return([1, 2, 3])
+    [].send(@method, obj).should == [1, 2, 3]
+  end
+
+  it "does not call #to_ary on Array subclasses" do
+    obj = ArraySpecs::ToAryArray[5, 6, 7]
+    obj.should_not_receive(:to_ary)
+    [].send(@method, ArraySpecs::ToAryArray[5, 6, 7]).should == [5, 6, 7]
+  end
+
+  ruby_version_is '' ... '1.9' do
+    it "raises a TypeError on a frozen array" do
+      lambda {
+        ArraySpecs.frozen_array.send(@method, ArraySpecs.frozen_array)
+      }.should raise_error(TypeError)
+    end
+  end
+
+  ruby_version_is '1.9' do
+    it "raises a RuntimeError on a frozen array" do
+      lambda {
+        ArraySpecs.frozen_array.send(@method, ArraySpecs.frozen_array)
+      }.should raise_error(RuntimeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/shared/slice.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/shared/slice.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/shared/slice.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,422 @@
+describe :array_slice, :shared => true do
+  it "returns the element at index with [index]" do
+    [ "a", "b", "c", "d", "e" ].send(@method, 1).should == "b"
+
+    a = [1, 2, 3, 4]
+
+    a.send(@method, 0).should == 1
+    a.send(@method, 1).should == 2
+    a.send(@method, 2).should == 3
+    a.send(@method, 3).should == 4
+    a.send(@method, 4).should == nil
+    a.send(@method, 10).should == nil
+
+    a.should == [1, 2, 3, 4]
+  end
+
+  it "returns the element at index from the end of the array with [-index]" do
+    [ "a", "b", "c", "d", "e" ].send(@method, -2).should == "d"
+
+    a = [1, 2, 3, 4]
+
+    a.send(@method, -1).should == 4
+    a.send(@method, -2).should == 3
+    a.send(@method, -3).should == 2
+    a.send(@method, -4).should == 1
+    a.send(@method, -5).should == nil
+    a.send(@method, -10).should == nil
+
+    a.should == [1, 2, 3, 4]
+  end
+
+  it "return count elements starting from index with [index, count]" do
+    [ "a", "b", "c", "d", "e" ].send(@method, 2, 3).should == ["c", "d", "e"]
+
+    a = [1, 2, 3, 4]
+
+    a.send(@method, 0, 0).should == []
+    a.send(@method, 0, 1).should == [1]
+    a.send(@method, 0, 2).should == [1, 2]
+    a.send(@method, 0, 4).should == [1, 2, 3, 4]
+    a.send(@method, 0, 6).should == [1, 2, 3, 4]
+    a.send(@method, 0, -1).should == nil
+    a.send(@method, 0, -2).should == nil
+    a.send(@method, 0, -4).should == nil
+
+    a.send(@method, 2, 0).should == []
+    a.send(@method, 2, 1).should == [3]
+    a.send(@method, 2, 2).should == [3, 4]
+    a.send(@method, 2, 4).should == [3, 4]
+    a.send(@method, 2, -1).should == nil
+
+    a.send(@method, 4, 0).should == []
+    a.send(@method, 4, 2).should == []
+    a.send(@method, 4, -1).should == nil
+
+    a.send(@method, 5, 0).should == nil
+    a.send(@method, 5, 2).should == nil
+    a.send(@method, 5, -1).should == nil
+
+    a.send(@method, 6, 0).should == nil
+    a.send(@method, 6, 2).should == nil
+    a.send(@method, 6, -1).should == nil
+
+    a.should == [1, 2, 3, 4]
+  end
+
+  it "returns count elements starting at index from the end of array with [-index, count]" do
+    [ "a", "b", "c", "d", "e" ].send(@method, -2, 2).should == ["d", "e"]
+
+    a = [1, 2, 3, 4]
+
+    a.send(@method, -1, 0).should == []
+    a.send(@method, -1, 1).should == [4]
+    a.send(@method, -1, 2).should == [4]
+    a.send(@method, -1, -1).should == nil
+
+    a.send(@method, -2, 0).should == []
+    a.send(@method, -2, 1).should == [3]
+    a.send(@method, -2, 2).should == [3, 4]
+    a.send(@method, -2, 4).should == [3, 4]
+    a.send(@method, -2, -1).should == nil
+
+    a.send(@method, -4, 0).should == []
+    a.send(@method, -4, 1).should == [1]
+    a.send(@method, -4, 2).should == [1, 2]
+    a.send(@method, -4, 4).should == [1, 2, 3, 4]
+    a.send(@method, -4, 6).should == [1, 2, 3, 4]
+    a.send(@method, -4, -1).should == nil
+
+    a.send(@method, -5, 0).should == nil
+    a.send(@method, -5, 1).should == nil
+    a.send(@method, -5, 10).should == nil
+    a.send(@method, -5, -1).should == nil
+
+    a.should == [1, 2, 3, 4]
+  end
+
+  it "returns the first count elements with [0, count]" do
+    [ "a", "b", "c", "d", "e" ].send(@method, 0, 3).should == ["a", "b", "c"]
+  end
+
+  it "returns the subarray which is independent to self with [index,count]" do
+    a = [1, 2, 3]
+    sub = a.send(@method, 1,2)
+    sub.replace([:a, :b])
+    a.should == [1, 2, 3]
+  end
+
+  it "tries to convert the passed argument to an Integer using #to_int" do
+    obj = mock('to_int')
+    obj.stub!(:to_int).and_return(2)
+
+    a = [1, 2, 3, 4]
+    a.send(@method, obj).should == 3
+    a.send(@method, obj, 1).should == [3]
+    a.send(@method, obj, obj).should == [3, 4]
+    a.send(@method, 0, obj).should == [1, 2]
+  end
+
+  it "returns the elements specified by Range indexes with [m..n]" do
+    [ "a", "b", "c", "d", "e" ].send(@method, 1..3).should == ["b", "c", "d"]
+    [ "a", "b", "c", "d", "e" ].send(@method, 4..-1).should == ['e']
+    [ "a", "b", "c", "d", "e" ].send(@method, 3..3).should == ['d']
+    [ "a", "b", "c", "d", "e" ].send(@method, 3..-2).should == ['d']
+    ['a'].send(@method, 0..-1).should == ['a']
+
+    a = [1, 2, 3, 4]
+
+    a.send(@method, 0..-10).should == []
+    a.send(@method, 0..0).should == [1]
+    a.send(@method, 0..1).should == [1, 2]
+    a.send(@method, 0..2).should == [1, 2, 3]
+    a.send(@method, 0..3).should == [1, 2, 3, 4]
+    a.send(@method, 0..4).should == [1, 2, 3, 4]
+    a.send(@method, 0..10).should == [1, 2, 3, 4]
+
+    a.send(@method, 2..-10).should == []
+    a.send(@method, 2..0).should == []
+    a.send(@method, 2..2).should == [3]
+    a.send(@method, 2..3).should == [3, 4]
+    a.send(@method, 2..4).should == [3, 4]
+
+    a.send(@method, 3..0).should == []
+    a.send(@method, 3..3).should == [4]
+    a.send(@method, 3..4).should == [4]
+
+    a.send(@method, 4..0).should == []
+    a.send(@method, 4..4).should == []
+    a.send(@method, 4..5).should == []
+
+    a.send(@method, 5..0).should == nil
+    a.send(@method, 5..5).should == nil
+    a.send(@method, 5..6).should == nil
+
+    a.should == [1, 2, 3, 4]
+  end
+
+  it "returns elements specified by Range indexes except the element at index n with [m...n]" do
+    [ "a", "b", "c", "d", "e" ].send(@method, 1...3).should == ["b", "c"]
+
+    a = [1, 2, 3, 4]
+
+    a.send(@method, 0...-10).should == []
+    a.send(@method, 0...0).should == []
+    a.send(@method, 0...1).should == [1]
+    a.send(@method, 0...2).should == [1, 2]
+    a.send(@method, 0...3).should == [1, 2, 3]
+    a.send(@method, 0...4).should == [1, 2, 3, 4]
+    a.send(@method, 0...10).should == [1, 2, 3, 4]
+
+    a.send(@method, 2...-10).should == []
+    a.send(@method, 2...0).should == []
+    a.send(@method, 2...2).should == []
+    a.send(@method, 2...3).should == [3]
+    a.send(@method, 2...4).should == [3, 4]
+
+    a.send(@method, 3...0).should == []
+    a.send(@method, 3...3).should == []
+    a.send(@method, 3...4).should == [4]
+
+    a.send(@method, 4...0).should == []
+    a.send(@method, 4...4).should == []
+    a.send(@method, 4...5).should == []
+
+    a.send(@method, 5...0).should == nil
+    a.send(@method, 5...5).should == nil
+    a.send(@method, 5...6).should == nil
+
+    a.should == [1, 2, 3, 4]
+  end
+
+  it "returns elements that exist if range start is in the array but range end is not with [m..n]" do
+    [ "a", "b", "c", "d", "e" ].send(@method, 4..7).should == ["e"]
+  end
+
+  it "accepts Range instances having a negative m and both signs for n with [m..n] and [m...n]" do
+    a = [1, 2, 3, 4]
+
+    a.send(@method, -1..-1).should == [4]
+    a.send(@method, -1...-1).should == []
+    a.send(@method, -1..3).should == [4]
+    a.send(@method, -1...3).should == []
+    a.send(@method, -1..4).should == [4]
+    a.send(@method, -1...4).should == [4]
+    a.send(@method, -1..10).should == [4]
+    a.send(@method, -1...10).should == [4]
+    a.send(@method, -1..0).should == []
+    a.send(@method, -1..-4).should == []
+    a.send(@method, -1...-4).should == []
+    a.send(@method, -1..-6).should == []
+    a.send(@method, -1...-6).should == []
+
+    a.send(@method, -2..-2).should == [3]
+    a.send(@method, -2...-2).should == []
+    a.send(@method, -2..-1).should == [3, 4]
+    a.send(@method, -2...-1).should == [3]
+    a.send(@method, -2..10).should == [3, 4]
+    a.send(@method, -2...10).should == [3, 4]
+
+    a.send(@method, -4..-4).should == [1]
+    a.send(@method, -4..-2).should == [1, 2, 3]
+    a.send(@method, -4...-2).should == [1, 2]
+    a.send(@method, -4..-1).should == [1, 2, 3, 4]
+    a.send(@method, -4...-1).should == [1, 2, 3]
+    a.send(@method, -4..3).should == [1, 2, 3, 4]
+    a.send(@method, -4...3).should == [1, 2, 3]
+    a.send(@method, -4..4).should == [1, 2, 3, 4]
+    a.send(@method, -4...4).should == [1, 2, 3, 4]
+    a.send(@method, -4...4).should == [1, 2, 3, 4]
+    a.send(@method, -4..0).should == [1]
+    a.send(@method, -4...0).should == []
+    a.send(@method, -4..1).should == [1, 2]
+    a.send(@method, -4...1).should == [1]
+
+    a.send(@method, -5..-5).should == nil
+    a.send(@method, -5...-5).should == nil
+    a.send(@method, -5..-4).should == nil
+    a.send(@method, -5..-1).should == nil
+    a.send(@method, -5..10).should == nil
+
+    a.should == [1, 2, 3, 4]
+  end
+
+  it "returns the subarray which is independent to self with [m..n]" do
+    a = [1, 2, 3]
+    sub = a.send(@method, 1..2)
+    sub.replace([:a, :b])
+    a.should == [1, 2, 3]
+  end
+
+  it "tries to convert Range elements to Integers using #to_int with [m..n] and [m...n]" do
+    from = mock('from')
+    to = mock('to')
+
+    # So we can construct a range out of them...
+    def from.<=>(o) 0 end
+    def to.<=>(o) 0 end
+
+    def from.to_int() 1 end
+    def to.to_int() -2 end
+
+    a = [1, 2, 3, 4]
+
+    a.send(@method, from..to).should == [2, 3]
+    a.send(@method, from...to).should == [2]
+    a.send(@method, 1..0).should == []
+    a.send(@method, 1...0).should == []
+
+    lambda { a.slice("a" .. "b") }.should raise_error(TypeError)
+    lambda { a.slice("a" ... "b") }.should raise_error(TypeError)
+    lambda { a.slice(from .. "b") }.should raise_error(TypeError)
+    lambda { a.slice(from ... "b") }.should raise_error(TypeError)
+  end
+
+  it "returns the same elements as [m..n] and [m...n] with Range subclasses" do
+    a = [1, 2, 3, 4]
+    range_incl = ArraySpecs::MyRange.new(1, 2)
+    range_excl = ArraySpecs::MyRange.new(-3, -1, true)
+
+    a[range_incl].should == [2, 3]
+    a[range_excl].should == [2, 3]
+  end
+
+  it "returns nil for a requested index not in the array with [index]" do
+    [ "a", "b", "c", "d", "e" ].send(@method, 5).should == nil
+  end
+
+  it "returns [] if the index is valid but length is zero with [index, length]" do
+    [ "a", "b", "c", "d", "e" ].send(@method, 0, 0).should == []
+    [ "a", "b", "c", "d", "e" ].send(@method, 2, 0).should == []
+  end
+
+  it "returns nil if length is zero but index is invalid with [index, length]" do
+    [ "a", "b", "c", "d", "e" ].send(@method, 100, 0).should == nil
+    [ "a", "b", "c", "d", "e" ].send(@method, -50, 0).should == nil
+  end
+
+  # This is by design. It is in the official documentation.
+  it "returns [] if index == array.size with [index, length]" do
+    %w|a b c d e|.send(@method, 5, 2).should == []
+  end
+
+  it "returns nil if index > array.size with [index, length]" do
+    %w|a b c d e|.send(@method, 6, 2).should == nil
+  end
+
+  it "returns nil if length is negative with [index, length]" do
+    %w|a b c d e|.send(@method, 3, -1).should == nil
+    %w|a b c d e|.send(@method, 2, -2).should == nil
+    %w|a b c d e|.send(@method, 1, -100).should == nil
+  end
+
+  it "returns nil if no requested index is in the array with [m..n]" do
+    [ "a", "b", "c", "d", "e" ].send(@method, 6..10).should == nil
+  end
+
+  it "returns nil if range start is not in the array with [m..n]" do
+    [ "a", "b", "c", "d", "e" ].send(@method, -10..2).should == nil
+    [ "a", "b", "c", "d", "e" ].send(@method, 10..12).should == nil
+  end
+
+  it "returns an empty array when m == n with [m...n]" do
+    [1, 2, 3, 4, 5].send(@method, 1...1).should == []
+  end
+
+  it "returns an empty array with [0...0]" do
+    [1, 2, 3, 4, 5].send(@method, 0...0).should == []
+  end
+
+  it "returns a subarray where m, n negatives and m < n with [m..n]" do
+    [ "a", "b", "c", "d", "e" ].send(@method, -3..-2).should == ["c", "d"]
+  end
+
+  it "returns an array containing the first element with [0..0]" do
+    [1, 2, 3, 4, 5].send(@method, 0..0).should == [1]
+  end
+
+  it "returns the entire array with [0..-1]" do
+    [1, 2, 3, 4, 5].send(@method, 0..-1).should == [1, 2, 3, 4, 5]
+  end
+
+  it "returns all but the last element with [0...-1]" do
+    [1, 2, 3, 4, 5].send(@method, 0...-1).should == [1, 2, 3, 4]
+  end
+
+  it "returns [3] for [2..-1] out of [1, 2, 3] <Specifies bug found by brixen, Defiler, mae>" do
+    [1,2,3].send(@method, 2..-1).should == [3]
+  end
+
+  it "returns an empty array when m > n and m, n are positive with [m..n]" do
+    [1, 2, 3, 4, 5].send(@method, 3..2).should == []
+  end
+
+  it "returns an empty array when m > n and m, n are negative with [m..n]" do
+    [1, 2, 3, 4, 5].send(@method, -2..-3).should == []
+  end
+
+  it "does not expand array when the indices are outside of the array bounds" do
+    a = [1, 2]
+    a.send(@method, 4).should == nil
+    a.should == [1, 2]
+    a.send(@method, 4, 0).should == nil
+    a.should == [1, 2]
+    a.send(@method, 6, 1).should == nil
+    a.should == [1, 2]
+    a.send(@method, 8...8).should == nil
+    a.should == [1, 2]
+    a.send(@method, 10..10).should == nil
+    a.should == [1, 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
+  end
+
+  not_compliant_on :rubinius do
+    it "raises a RangeError when the start index is out of range of Fixnum" do
+      array = [1, 2, 3, 4, 5, 6]
+      obj = mock('large value')
+      obj.should_receive(:to_int).and_return(0x8000_0000_0000_0000_0000)
+      lambda { array.send(@method, obj) }.should raise_error(RangeError)
+
+      obj = 8e19
+      lambda { array.send(@method, obj) }.should raise_error(RangeError)
+    end
+
+    it "raises a RangeError when the length is out of range of Fixnum" do
+      array = [1, 2, 3, 4, 5, 6]
+      obj = mock('large value')
+      obj.should_receive(:to_int).and_return(0x8000_0000_0000_0000_0000)
+      lambda { array.send(@method, 1, obj) }.should raise_error(RangeError)
+
+      obj = 8e19
+      lambda { array.send(@method, 1, obj) }.should raise_error(RangeError)
+    end
+  end
+
+  deviates_on :rubinius do
+    it "raises a TypeError when the start index is out of range of Fixnum" do
+      array = [1, 2, 3, 4, 5, 6]
+      obj = mock('large value')
+      obj.should_receive(:to_int).and_return(0x8000_0000_0000_0000_0000)
+      lambda { array.send(@method, obj) }.should raise_error(TypeError)
+
+      obj = 8e19
+      lambda { array.send(@method, obj) }.should raise_error(TypeError)
+    end
+
+    it "raises a TypeError when the length is out of range of Fixnum" do
+      array = [1, 2, 3, 4, 5, 6]
+      obj = mock('large value')
+      obj.should_receive(:to_int).and_return(0x8000_0000_0000_0000_0000)
+      lambda { array.send(@method, 1, obj) }.should raise_error(TypeError)
+
+      obj = 8e19
+      lambda { array.send(@method, 1, obj) }.should raise_error(TypeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/shift_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/shift_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/shift_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,44 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#shift" do
+  it "removes and returns the first element" do
+    a = [5, 1, 1, 5, 4]
+    a.shift.should == 5
+    a.should == [1, 1, 5, 4]
+    a.shift.should == 1
+    a.should == [1, 5, 4]
+    a.shift.should == 1
+    a.should == [5, 4]
+    a.shift.should == 5
+    a.should == [4]
+    a.shift.should == 4
+    a.should == []
+  end
+
+  it "returns nil when the array is empty" do
+    [].shift.should == nil
+  end
+
+  it "properly handles recursive arrays" do
+    empty = ArraySpecs.empty_recursive_array
+    empty.shift.should == []
+    empty.should == []
+
+    array = ArraySpecs.recursive_array
+    array.shift.should == 1
+    array[0..2].should == ['two', 3.0, array]
+  end
+
+  ruby_version_is "" ... "1.9" do
+    it "raises a TypeError on a frozen array" do
+      lambda { ArraySpecs.frozen_array.shift }.should raise_error(TypeError)
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "raises a RuntimeError on a frozen array" do
+      lambda { ArraySpecs.frozen_array.shift }.should raise_error(RuntimeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/length'
+
+describe "Array#size" do
+  it_behaves_like(:array_length, :size)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/slice_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/slice_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/slice_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,146 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/slice'
+
+describe "Array#slice!" do
+  it "removes and return the element at index" do
+    a = [1, 2, 3, 4]
+    a.slice!(10).should == nil
+    a.should == [1, 2, 3, 4]
+    a.slice!(-10).should == nil
+    a.should == [1, 2, 3, 4]
+    a.slice!(2).should == 3
+    a.should == [1, 2, 4]
+    a.slice!(-1).should == 4
+    a.should == [1, 2]
+    a.slice!(1).should == 2
+    a.should == [1]
+    a.slice!(-1).should == 1
+    a.should == []
+    a.slice!(-1).should == nil
+    a.should == []
+    a.slice!(0).should == nil
+    a.should == []
+  end
+
+  it "removes and returns length elements beginning at start" do
+    a = [1, 2, 3, 4, 5, 6]
+    a.slice!(2, 3).should == [3, 4, 5]
+    a.should == [1, 2, 6]
+    a.slice!(1, 1).should == [2]
+    a.should == [1, 6]
+    a.slice!(1, 0).should == []
+    a.should == [1, 6]
+    a.slice!(2, 0).should == []
+    a.should == [1, 6]
+    a.slice!(0, 4).should == [1, 6]
+    a.should == []
+    a.slice!(0, 4).should == []
+    a.should == []
+  end
+
+  it "properly handles recursive arrays" do
+    empty = ArraySpecs.empty_recursive_array
+    empty.slice(0).should == empty
+
+    array = ArraySpecs.recursive_array
+    array.slice(4).should == array
+    array.slice(0..3).should == [1, 'two', 3.0, array]
+  end
+
+  it "calls to_int on start and length arguments" do
+    obj = mock('2')
+    def obj.to_int() 2 end
+
+    a = [1, 2, 3, 4, 5]
+    a.slice!(obj).should == 3
+    a.should == [1, 2, 4, 5]
+    a.slice!(obj, obj).should == [4, 5]
+    a.should == [1, 2]
+    a.slice!(0, obj).should == [1, 2]
+    a.should == []
+  end
+
+  it "removes and return elements in range" do
+    a = [1, 2, 3, 4, 5, 6, 7, 8]
+    a.slice!(1..4).should == [2, 3, 4, 5]
+    a.should == [1, 6, 7, 8]
+    a.slice!(1...3).should == [6, 7]
+    a.should == [1, 8]
+    a.slice!(-1..-1).should == [8]
+    a.should == [1]
+    a.slice!(0...0).should == []
+    a.should == [1]
+    a.slice!(0..0).should == [1]
+    a.should == []
+  end
+
+  it "calls to_int on range arguments" do
+    from = mock('from')
+    to = mock('to')
+
+    # So we can construct a range out of them...
+    def from.<=>(o) 0 end
+    def to.<=>(o) 0 end
+
+    def from.to_int() 1 end
+    def to.to_int() -2 end
+
+    a = [1, 2, 3, 4, 5]
+
+    a.slice!(from .. to).should == [2, 3, 4]
+    a.should == [1, 5]
+
+    lambda { a.slice!("a" .. "b")  }.should raise_error(TypeError)
+    lambda { a.slice!(from .. "b") }.should raise_error(TypeError)
+  end
+
+  ruby_version_is "" ... "1.8.7" do
+    # See http://groups.google.com/group/ruby-core-google/t/af70e3d0e9b82f39
+    it "expands self when indices are out of bounds" do
+      a = [1, 2]
+      a.slice!(4).should == nil
+      a.should == [1, 2]
+      a.slice!(4, 0).should == nil
+      a.should == [1, 2, nil, nil]
+      a.slice!(6, 1).should == nil
+      a.should == [1, 2, nil, nil, nil, nil]
+      a.slice!(8...8).should == nil
+      a.should == [1, 2, nil, nil, nil, nil, nil, nil]
+      a.slice!(10..10).should == nil
+      a.should == [1, 2, nil, nil, nil, nil, nil, nil, nil, nil]
+    end
+  end
+
+  ruby_version_is "1.8.7" do
+    it "does not expand array with indices out of bounds" do
+      a = [1, 2]
+      a.slice!(4).should == nil
+      a.should == [1, 2]
+      a.slice!(4, 0).should == nil
+      a.should == [1, 2]
+      a.slice!(6, 1).should == nil
+      a.should == [1, 2]
+      a.slice!(8...8).should == nil
+      a.should == [1, 2]
+      a.slice!(10..10).should == nil
+      a.should == [1, 2]
+    end
+  end
+
+  ruby_version_is "" ... "1.9" do
+    it "raises a TypeError on a frozen array" do
+      lambda { ArraySpecs.frozen_array.slice!(0, 0) }.should raise_error(TypeError)
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "raises a RuntimeError on a frozen array" do
+      lambda { ArraySpecs.frozen_array.slice!(0, 0) }.should raise_error(RuntimeError)
+    end
+  end
+end
+
+describe "Array#slice" do
+  it_behaves_like(:array_slice, :slice)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/sort_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/sort_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/sort_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,244 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+module ArraySpecs
+  class SortSame
+    def <=>(other); 0; end
+    def ==(other); true; end
+  end
+
+  class UFOSceptic
+    def <=>(other); raise "N-uh, UFO:s do not exist!"; end
+  end
+
+  class MockForCompared
+    @@count = 0
+    @@compared = false
+    def initialize
+      @@compared = false
+      @order = (@@count += 1)
+    end
+    def <=>(rhs)
+      @@compared = true
+      return rhs.order <=> self.order
+    end
+    def self.compared?
+      @@compared
+    end
+
+    protected
+    attr_accessor :order
+  end
+end
+
+
+describe "Array#sort" do
+  it "returns a new array sorted based on comparing elements with <=>" do
+    a = [1, -2, 3, 9, 1, 5, -5, 1000, -5, 2, -10, 14, 6, 23, 0]
+    a.sort.should == [-10, -5, -5, -2, 0, 1, 1, 2, 3, 5, 6, 9, 14, 23, 1000]
+  end
+
+  it "does not affect the original Array" do
+    a = [0, 15, 2, 3, 4, 6, 14, 5, 7, 12, 8, 9, 1, 10, 11, 13]
+    b = a.sort
+    a.should == [0, 15, 2, 3, 4, 6, 14, 5, 7, 12, 8, 9, 1, 10, 11, 13]
+    b.should == (0..15).to_a
+  end
+
+  it "sorts already-sorted Arrays" do
+    (0..15).to_a.sort.should == (0..15).to_a
+  end
+
+  it "sorts reverse-sorted Arrays" do
+    (0..15).to_a.reverse.sort.should == (0..15).to_a
+  end
+
+  it "sorts Arrays that consist entirely of equal elements" do
+    a = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
+    a.sort.should == a
+    b = Array.new(15).map { ArraySpecs::SortSame.new }
+    b.sort.should == b
+  end
+
+  it "sorts Arrays that consist mostly of equal elements" do
+    a = [1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1]
+    a.sort.should == [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
+  end
+
+  it "does not return self even if the array would be already sorted" do
+    a = [1, 2, 3]
+    sorted = a.sort
+    sorted.should == a
+    sorted.should_not equal(a)
+  end
+
+  it "properly handles recursive arrays" do
+    empty = ArraySpecs.empty_recursive_array
+    empty.sort.should == empty
+
+    array = [[]]; array << array
+    array.sort.should == [[], array]
+  end
+
+  it "uses #<=> of elements in order to sort" do
+    a = ArraySpecs::MockForCompared.new
+    b = ArraySpecs::MockForCompared.new
+    c = ArraySpecs::MockForCompared.new
+
+    ArraySpecs::MockForCompared.compared?.should == false
+    [a, b, c].sort.should == [c, b, a]
+    ArraySpecs::MockForCompared.compared?.should == true
+  end
+
+  it "does not deal with exceptions raised by unimplemented or incorrect #<=>" do
+    o = Object.new
+
+    lambda { [o, 1].sort }.should raise_error
+  end
+
+  it "may take a block which is used to determine the order of objects a and b described as -1, 0 or +1" do
+    a = [5, 1, 4, 3, 2]
+    a.sort.should == [1, 2, 3, 4, 5]
+    a.sort {|x, y| y <=> x}.should == [5, 4, 3, 2, 1]
+  end
+
+  it "does not call #<=> on contained objects when invoked with a block" do
+    a = Array.new(25)
+    (0...25).each {|i| a[i] = ArraySpecs::UFOSceptic.new }
+
+    a.sort { -1 }.class.should == 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
+  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
+  end
+
+  it "returns subclass instance on Array subclasses" do
+    ary = ArraySpecs::MyArray[1, 2, 3]
+    ary.sort.class.should == ArraySpecs::MyArray
+  end
+
+  it "does not freezes self during being sorted" do
+    a = [1, 2, 3]
+    a.sort { |x,y| a.frozen?.should == false; x <=> y }
+  end
+
+  it "returns the specified value when it would break in the given block" do
+    [1, 2, 3].sort{ break :a }.should == :a
+  end
+end
+
+describe "Array#sort!" do
+  it "sorts array in place using <=>" do
+    a = [1, -2, 3, 9, 1, 5, -5, 1000, -5, 2, -10, 14, 6, 23, 0]
+    a.sort!
+    a.should == [-10, -5, -5, -2, 0, 1, 1, 2, 3, 5, 6, 9, 14, 23, 1000]
+  end
+
+  it "sorts array in place using block value if a block given" do
+    a = [0, 15, 2, 3, 4, 6, 14, 5, 7, 12, 8, 9, 1, 10, 11, 13]
+    a.sort! { |x, y| y <=> x }.should == (0..15).to_a.reverse
+  end
+
+  it "returns self if the order of elements changed" do
+    a = [6, 7, 2, 3, 7]
+    a.sort!.should equal(a)
+    a.should == [2, 3, 6, 7, 7]
+  end
+
+  it "returns self even if makes no modification" do
+    a = [1, 2, 3, 4, 5]
+    a.sort!.should equal(a)
+    a.should == [1, 2, 3, 4, 5]
+  end
+
+  it "properly handles recursive arrays" do
+    empty = ArraySpecs.empty_recursive_array
+    empty.sort!.should == empty
+
+    array = [[]]; array << array
+    array.sort!.should == array
+  end
+
+  it "uses #<=> of elements in order to sort" do
+    a = ArraySpecs::MockForCompared.new
+    b = ArraySpecs::MockForCompared.new
+    c = ArraySpecs::MockForCompared.new
+
+    ArraySpecs::MockForCompared.compared?.should == false
+    [a, b, c].sort!.should == [c, b, a]
+    ArraySpecs::MockForCompared.compared?.should == true
+  end
+
+  it "does not call #<=> on contained objects when invoked with a block" do
+    a = Array.new(25)
+    (0...25).each {|i| a[i] = ArraySpecs::UFOSceptic.new }
+
+    a.sort! { -1 }.class.should == 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
+  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
+  end
+
+  ruby_version_is '' ... '1.9' do
+    it "raises a TypeError on a frozen array" do
+      lambda { ArraySpecs.frozen_array.sort! }.should raise_error(TypeError)
+    end
+
+    it "temporarily freezes self and recovers after sorted" do
+      a = [1, 2, 3]
+      a.sort! { |x,y| a.frozen?.should == true; x <=> y }
+      a.frozen?.should == false
+    end
+  end
+
+  ruby_version_is '1.9' do
+    it "raises a RuntimeError on a frozen array" do
+      lambda { ArraySpecs.frozen_array.sort! }.should raise_error(RuntimeError)
+    end
+
+    it "ignores any changes of self which would take place during sort!ing" do
+      a = [3, 2, 1]
+      a.sort! {|x,y| a << 4; a.should include(4); x <=> y }
+      a.should == [1, 2, 3]
+
+      a = [3, 2, 1]
+      a.sort! {|x,y| a.replace([:a, :b, :c, :d, :e]); x <=> y}
+      a.should == [1, 2, 3]
+    end
+  end
+
+  it "returns the specified value when it would break in the given block" do
+    [1, 2, 3].sort{ break :a }.should == :a
+  end
+
+  it "makes some modification even if finished sorting when it would break in the given block" do
+    partially_sorted = (1..5).map{|i|
+      ary = [5, 4, 3, 2, 1]
+      ary.sort!{|x,y| break if x==i; x<=>y}
+      ary
+    }
+    partially_sorted.any?{|ary| ary != [1, 2, 3, 4, 5]}.should be_true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/to_a_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/to_a_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/to_a_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#to_a" do
+  it "returns self" do
+    a = [1, 2, 3]
+    a.to_a.should == [1, 2, 3]
+    a.should equal(a.to_a) 
+  end
+  
+  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 == [1]
+  end
+
+  it "properly handles recursive arrays" do
+    empty = ArraySpecs.empty_recursive_array
+    empty.to_a.should == empty
+
+    array = ArraySpecs.recursive_array
+    array.to_a.should == array
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/to_ary_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/to_ary_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/to_ary_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#to_ary" do
+  it "returns self" do
+    a = [1, 2, 3]
+    a.should equal(a.to_ary)
+    a = ArraySpecs::MyArray[1, 2, 3]
+    a.should equal(a.to_ary)
+  end
+
+  it "properly handles recursive arrays" do
+    empty = ArraySpecs.empty_recursive_array
+    empty.to_ary.should == empty
+
+    array = ArraySpecs.recursive_array
+    array.to_ary.should == array
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#to_s" do
+  it "is equivalent to #join without a separator string" do
+    old = $,
+    begin
+      a = [1, 2, 3, 4]
+      a.to_s.should == a.join
+      $, = '-'
+      a.to_s.should == a.join
+    ensure
+      $, = old
+    end
+  end
+
+  it "properly handles recursive arrays" do
+    ArraySpecs.empty_recursive_array.to_s.should == "[...]"
+    a = [1, 2, 3]; a << a
+    a.to_s.should == "123123[...]"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/transpose_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/transpose_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/transpose_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,53 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#transpose" do
+  it "assumes an array of arrays and returns the result of transposing rows and columns" do
+    [[1, 'a'], [2, 'b'], [3, 'c']].transpose.should == [[1, 2, 3], ["a", "b", "c"]]
+    [[1, 2, 3], ["a", "b", "c"]].transpose.should == [[1, 'a'], [2, 'b'], [3, 'c']]
+    [].transpose.should == []
+    [[]].transpose.should == []
+    [[], []].transpose.should == []
+    [[0]].transpose.should == [[0]]
+    [[0], [1]].transpose.should == [[0, 1]]
+  end
+
+  it "tries to convert the passed argument to an Array using #to_ary" do
+    obj = mock('[1,2]')
+    obj.should_receive(:to_ary).and_return([1, 2])
+    [obj, [:a, :b]].transpose.should == [[1, :a], [2, :b]]
+  end
+
+  it "properly handles recursive arrays" do
+    empty = ArraySpecs.empty_recursive_array
+    empty.transpose.should == empty
+
+    a = []; a << a
+    b = []; b << b
+    [a, b].transpose.should == [[a, b]]
+
+    a = [1]; a << a
+    b = [2]; b << b    
+    [a, b].transpose == [ [1, 2], [a, b] ]
+  end
+
+  it "raises a TypeError if the passed Argument does not respond to #to_ary" do
+    lambda { [Object.new, [:a, :b]].transpose }.should raise_error(TypeError)
+  end
+
+  it "does not call to_ary on array subclass elements" do
+    ary = [ArraySpecs::ToAryArray[1, 2], ArraySpecs::ToAryArray[4, 6]]
+    ary.transpose.should == [[1, 4], [2, 6]]
+  end
+
+  it "raises an IndexError if the arrays are not of the same length" do
+    lambda { [[1, 2], [:a]].transpose }.should raise_error(IndexError)
+  end
+
+  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
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/union_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/union_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/union_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,69 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#|" do
+  it "returns an array of elements that appear in either array (union)" do
+    ([] | []).should == []
+    ([1, 2] | []).should == [1, 2]
+    ([] | [1, 2]).should == [1, 2]
+    ([ 1, 2, 3, 4 ] | [ 3, 4, 5 ]).should == [1, 2, 3, 4, 5]
+  end
+  
+  it "creates an array with no duplicates" do
+    ([ 1, 2, 3, 1, 4, 5 ] | [ 1, 3, 4, 5, 3, 6 ]).should == [1, 2, 3, 4, 5, 6]
+  end
+  
+  it "creates an array with elements in order they are first encountered" do
+    ([ 1, 2, 3, 1 ] | [ 1, 3, 4, 5 ]).should == [1, 2, 3, 4, 5]
+  end
+
+  ruby_bug "#", "1.8.6.277" do
+    it "properly handles recursive arrays" do
+      empty = ArraySpecs.empty_recursive_array
+      (empty | empty).should == empty
+
+      array = ArraySpecs.recursive_array
+      (array | []).should == [1, 'two', 3.0, array]
+      ([] | array).should == [1, 'two', 3.0, array]
+      (array | array).should == [1, 'two', 3.0, array]
+      (array | empty).should == [1, 'two', 3.0, array, empty]
+    end
+  end
+
+  it "tries to convert the passed argument to an Array using #to_ary" do
+    obj = mock('[1,2,3]')
+    obj.should_receive(:to_ary).and_return([1, 2, 3])
+    ([0] | obj).should == ([0] | [1, 2, 3])
+  end
+
+  # MRI follows hashing semantics here, so doesn't actually call eql?/hash for Fixnum/Symbol
+  it "acts as if using an intermediate hash to collect values" do
+    ([5.0, 4.0] | [5, 4]).should == [5.0, 4.0, 5, 4]
+    str = "x"
+    ([str] | [str.dup]).should == [str]
+    
+    obj1 = mock('1')
+    obj2 = mock('2')
+    def obj1.hash; 0; end
+    def obj2.hash; 0; end
+    def obj1.eql? a; true; end
+    def obj2.eql? a; true; end
+    
+    ([obj1] | [obj2]).should == [obj1]
+    
+    def obj1.eql? a; false; end
+    def obj2.eql? a; false; end
+    
+    ([obj1] | [obj2]).should == [obj1, obj2]
+  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
+  end
+  
+  it "does not call to_ary on array subclasses" do
+    ([1, 2] | ArraySpecs::ToAryArray[5, 6]).should == [1, 2, 5, 6]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/uniq_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/uniq_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/uniq_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,137 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#uniq" do
+  it "returns an array with no duplicates" do
+    ["a", "a", "b", "b", "c"].uniq.should == ["a", "b", "c"]
+  end
+
+  ruby_bug "#", "1.8.6.277" do
+    it "properly handles recursive arrays" do
+      empty = ArraySpecs.empty_recursive_array
+      empty.uniq.should == [empty]
+
+      array = ArraySpecs.recursive_array
+      array.uniq.should == [1, 'two', 3.0, array]
+    end
+  end
+
+  it "uses eql? semantics" do
+    [1.0, 1].uniq.should == [1.0, 1]
+  end
+
+  it "compares elements first with hash" do
+    # Can't use should_receive because it uses hash internally
+    x = mock('0')
+    def x.hash() 0 end
+    y = mock('0')
+    def y.hash() 0 end
+
+    [x, y].uniq.should == [x, y]
+  end
+
+  it "does not compare elements with different hash codes via eql?" do
+    # Can't use should_receive because it uses hash and eql? internally
+    x = mock('0')
+    def x.eql?(o) raise("Shouldn't receive eql?") end
+    y = mock('1')
+    def y.eql?(o) raise("Shouldn't receive eql?") end
+
+    def x.hash() 0 end
+    def y.hash() 1 end
+
+    [x, y].uniq.should == [x, y]
+  end
+
+  it "compares elements with matching hash codes with #eql?" do
+    # Can't use should_receive because it uses hash and eql? internally
+    a = Array.new(2) do
+      obj = mock('0')
+
+      def obj.hash()
+        # It's undefined whether the impl does a[0].eql?(a[1]) or
+        # a[1].eql?(a[0]) so we taint both.
+        def self.eql?(o) taint; o.taint; false; end
+        return 0
+      end
+
+      obj
+    end
+
+    a.uniq.should == a
+    a[0].tainted?.should == true
+    a[1].tainted?.should == true
+
+    a = Array.new(2) do
+      obj = mock('0')
+
+      def obj.hash()
+        # It's undefined whether the impl does a[0].eql?(a[1]) or
+        # a[1].eql?(a[0]) so we taint both.
+        def self.eql?(o) taint; o.taint; true; end
+        return 0
+      end
+
+      obj
+    end
+
+    a.uniq.size.should == 1
+    a[0].tainted?.should == true
+    a[1].tainted?.should == true
+  end
+
+  it "returns subclass instance on Array subclasses" do
+    ArraySpecs::MyArray[1, 2, 3].uniq.class.should == ArraySpecs::MyArray
+  end
+end
+
+describe "Array#uniq!" do
+  it "modifies the array in place" do
+    a = [ "a", "a", "b", "b", "c" ]
+    a.uniq!
+    a.should == ["a", "b", "c"]
+  end
+
+  it "returns self" do
+    a = [ "a", "a", "b", "b", "c" ]
+    a.should equal(a.uniq!)
+  end
+
+  ruby_bug "#", "1.8.6.277" do
+    it "properly handles recursive arrays" do
+      empty = ArraySpecs.empty_recursive_array
+      empty_dup = empty.dup
+      empty.uniq!
+      empty.should == empty_dup
+
+      array = ArraySpecs.recursive_array
+      expected = array[0..3]
+      array.uniq!
+      array.should == expected
+    end
+  end
+
+  it "returns nil if no changes are made to the array" do
+    [ "a", "b", "c" ].uniq!.should == nil
+  end
+
+  ruby_version_is "" ... "1.9" do
+    it "raises a TypeError on a frozen array if modification would take place" do
+      dup_ary = [1, 1, 2]
+      dup_ary.freeze
+      lambda { dup_ary.uniq! }.should raise_error(TypeError)
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "raises a RuntimeError on a frozen array if modification would take place" do
+      dup_ary = [1, 1, 2]
+      dup_ary.freeze
+      lambda { dup_ary.uniq! }.should raise_error(RuntimeError)
+    end
+  end
+
+  it "does not raise an exception on a frozen array if no modification takes place" do
+    ArraySpecs.frozen_array.uniq!.should be_nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/unshift_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/unshift_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/unshift_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,57 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#unshift" do
+  it "prepends object to the original array" do
+    a = [1, 2, 3]
+    a.unshift("a").should equal(a)
+    a.should == ['a', 1, 2, 3]
+    a.unshift().should equal(a)
+    a.should == ['a', 1, 2, 3]
+    a.unshift(5, 4, 3)
+    a.should == [5, 4, 3, 'a', 1, 2, 3]
+
+    # shift all but one element
+    a = [1, 2]
+    a.shift
+    a.unshift(3, 4)
+    a.should == [3, 4, 2]
+
+    # now shift all elements
+    a.shift
+    a.shift
+    a.shift
+    a.unshift(3, 4)
+    a.should == [3, 4]
+  end
+
+  it "quietly ignores unshifting nothing" do
+    [].unshift().should == []
+    [].unshift(*[]).should == []
+  end
+
+  it "properly handles recursive arrays" do
+    empty = ArraySpecs.empty_recursive_array
+    empty.unshift(:new).should == [:new, empty]
+
+    array = ArraySpecs.recursive_array
+    array.unshift(:new)
+    array[0..5].should == [:new, 1, 'two', 3.0, array, array]
+  end
+
+  ruby_version_is "" ... "1.9" do
+    it "raises a TypeError on a frozen array" do
+      lambda { ArraySpecs.frozen_array.unshift(1) }.should raise_error(TypeError)
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "raises a RuntimeError on a frozen array" do
+      lambda { ArraySpecs.frozen_array.unshift(1) }.should raise_error(RuntimeError)
+    end
+  end
+
+  it "does not raise an exception on a frozen array if no modification takes place" do
+    ArraySpecs.frozen_array.unshift.should == [1, 2, 3]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/values_at_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/values_at_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/values_at_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,47 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#values_at" do
+  it "returns an array of elements at the indexes when passed indexes" do
+    [1, 2, 3, 4, 5].values_at().should == []
+    [1, 2, 3, 4, 5].values_at(1, 0, 5, -1, -8, 10).should == [2, 1, nil, 5, nil, nil]
+  end
+
+  it "calls to_int on its indices" do
+    obj = mock('1')
+    def obj.to_int() 1 end
+    [1, 2].values_at(obj, obj, obj).should == [2, 2, 2]
+  end
+
+  it "returns an array of elements in the ranges when passes ranges" do
+    [1, 2, 3, 4, 5].values_at(0..2, 1...3, 4..6).should == [1, 2, 3, 2, 3, 5, nil]
+    [1, 2, 3, 4, 5].values_at(6..4).should == []
+  end
+
+  it "properly handles recursive arrays" do
+    empty = ArraySpecs.empty_recursive_array
+    empty.values_at(0, 1, 2).should == [empty, nil, nil]
+
+    array = ArraySpecs.recursive_array
+    array.values_at(0, 1, 2, 3).should == [1, 'two', 3.0, array]
+  end
+
+  it "calls to_int on arguments of ranges when passes ranges" do
+    from = mock('from')
+    to = mock('to')
+
+    # So we can construct a range out of them...
+    def from.<=>(o) 0 end
+    def to.<=>(o) 0 end
+
+    def from.to_int() 1 end
+    def to.to_int() -2 end
+      
+    ary = [1, 2, 3, 4, 5]
+    ary.values_at(from .. to, from ... to, to .. from).should == [2, 3, 4, 2, 3]
+  end
+
+  it "does not return subclass instance on Array subclasses" do
+    ArraySpecs::MyArray[1, 2, 3].values_at(0, 1..2, 1).class.should == Array
+  end  
+end

Added: MacRuby/branches/experimental/spec/frozen/core/array/zip_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/array/zip_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/array/zip_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,43 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Array#zip" do
+  it "returns an array of arrays containing corresponding elements of each array" do
+    [1, 2, 3, 4].zip(["a", "b", "c", "d", "e"]).should ==
+      [[1, "a"], [2, "b"], [3, "c"], [4, "d"]]
+  end
+
+  it "fills in missing values with nil" do
+    [1, 2, 3, 4, 5].zip(["a", "b", "c", "d"]).should ==
+      [[1, "a"], [2, "b"], [3, "c"], [4, "d"], [5, nil]]
+  end
+
+  it "properly handles recursive arrays" do
+    a = []; a << a
+    b = [1]; b << b
+
+    a.zip(a).should == [ [a[0], a[0]] ]
+    a.zip(b).should == [ [a[0], b[0]] ]
+    b.zip(a).should == [ [b[0], a[0]], [b[1], a[1]] ]
+    b.zip(b).should == [ [b[0], b[0]], [b[1], b[1]] ]
+  end
+
+  it "calls #to_ary to convert the argument to an Array" do
+    obj = mock('[3,4]')
+    obj.should_receive(:to_ary).and_return([3, 4])
+    [1, 2].zip(obj).should == [[1, 3], [2, 4]]
+  end
+
+  it "calls block if supplied" do
+    values = []
+    [1, 2, 3, 4].zip(["a", "b", "c", "d", "e"]) { |value|
+      values << value
+    }.should == nil
+
+    values.should == [[1, "a"], [2, "b"], [3, "c"], [4, "d"]]
+  end
+
+  it "does not return subclass instance on Array subclasses" do
+    ArraySpecs::MyArray[1, 2, 3].zip(["a", "b"]).class.should == Array
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/basicobject/basic_object_class_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/basicobject/basic_object_class_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/basicobject/basic_object_class_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File::join( File::dirname(__FILE__), %w{ .. .. spec_helper } )
+require File::join( File::dirname(__FILE__), %w{ shared behavior } )
+
+ruby_version_is "1.9".."1.9.9" do
+
+  describe "BasicObject class" do
+
+    it "has no ancestors" do
+      BasicObject.ancestors.should == [ BasicObject ]
+    end
+    
+    it "is a class" do
+      ( Class === BasicObject ).should == true
+    end
+
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/basicobject/basic_object_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/basicobject/basic_object_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/basicobject/basic_object_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File::join( File::dirname(__FILE__), %w{ .. .. spec_helper } )
+require File::join( File::dirname(__FILE__), %w{ shared behavior } )
+
+ruby_version_is "1.9".."1.9.9" do
+
+  describe "BasicObject behaves" do
+    extend BasicObjectBehavior
+
+    it "privately" do
+      BasicObject.private_instance_methods.sort.should == private_features.sort
+    end
+
+    it "protectedly" do
+      BasicObject.protected_instance_methods.sort.should == protected_features.sort
+    end
+
+    it "publically" do
+      BasicObject.instance_methods.sort.should == public_features.sort
+    end
+
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/basicobject/basic_object_subclass_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/basicobject/basic_object_subclass_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/basicobject/basic_object_subclass_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File::join( File::dirname(__FILE__), %w{ .. .. spec_helper } )
+require File::join( File::dirname(__FILE__), %w{ shared behavior } )
+
+ruby_version_is "1.9".."1.9.9" do
+  MyBO = Class::new BasicObject
+
+  describe "BasicObject's subclasses behave" do
+    extend BasicObjectBehavior
+
+    it "privately" do
+      MyBO.private_instance_methods.sort.should == private_features.sort
+    end
+
+    it "protectedly" do
+      MyBO.protected_instance_methods.sort.should == protected_features.sort
+    end
+
+    it "publically" do
+      MyBO.instance_methods.sort.should == public_features.sort
+    end
+
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/basicobject/metaclass_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/basicobject/metaclass_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/basicobject/metaclass_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File::join( File::dirname(__FILE__), %w{ .. .. spec_helper } )
+require File::join( File::dirname(__FILE__), %w{ shared behavior } )
+
+ruby_version_is "1.9".."1.9.9" do
+
+  describe "BasicObject#metaclass" do
+    foo = metafoo = nil
+    before :each do
+      foo = BasicObject::new
+      metafoo = class << foo; self end
+      metafoo.module_eval do 
+	def meta_test_method; 42 end
+      end
+    end 
+
+    it "returns the basic object's metaclass" do
+      metafoo.superclass.should == BasicObject
+      ( metafoo === foo ).should == true
+    end # it? Cousin it, I presume?
+
+    it "does the job of a metaclass" do
+      foo.meta_test_method.should == 42
+      lambda { BasicObject::new.meta_test_method }.should raise_error( NameError )
+    end # no I want repeat that stupid (ch)|(j)oke
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/basicobject/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/basicobject/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/basicobject/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File::join( File::dirname(__FILE__), %w{ .. .. spec_helper } )
+
+ruby_version_is "1.9".."1.9.9" do
+  describe "BasicObject.new" do
+    it "creates a new BasicObject" do
+      ( BasicObject === BasicObject.new ).should == true
+    end
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/basicobject/remove_method_missing.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/basicobject/remove_method_missing.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/basicobject/remove_method_missing.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+ruby_version_is "1.9".."1.9.9" do
+
+  quarantine! do
+    it "shall not segfault by any means" do
+      class BasicObject
+	remove_method :method_missing
+      end
+      "Hello World".send( :kabooum_42 ).should raise_error( NoMethodError )
+    end
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/basicobject/shared/behavior.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/basicobject/shared/behavior.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/basicobject/shared/behavior.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+module BasicObjectBehavior
+  def private_features
+    [ :initialize, :method_missing, :singleton_method_added, :singleton_method_removed, :singleton_method_undefined ]
+  end
+  def protected_features
+    []
+  end
+  def public_features
+    [ :!, :!=, :==, :__send__, :equal?, :instance_eval, :instance_exec ]
+  end
+end
+
+module BasicObjectClassBehavior
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/abs_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/abs_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/abs_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#abs" do
+  it "returns the absolute value" do
+    bignum_value(39).abs.should == 9223372036854775847
+    (-bignum_value(18)).abs.should == 9223372036854775826
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/bit_and_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/bit_and_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/bit_and_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#&" do
+  before(:each) do
+    @bignum = bignum_value(5)
+  end
+  
+  it "returns self bitwise AND other" do
+    @bignum = bignum_value(5)
+    (@bignum & 3).should == 1
+    (@bignum & 52).should == 4
+    (@bignum & bignum_value(9921)).should == 9223372036854775809
+
+    ((2*bignum_value) & 1).should == 0
+    ((2*bignum_value) & -1).should == 18446744073709551616
+    ((4*bignum_value) & -1).should == 36893488147419103232
+    ((2*bignum_value) & (2*bignum_value)).should == 18446744073709551616
+    (bignum_value & bignum_value(0xffff).to_f).should == 9223372036854775808
+  end
+
+  it "tries to convert the given argument to an Integer using to_int" do
+    (@bignum & 3.4).should == 1
+    
+    (obj = mock('3')).should_receive(:to_int).and_return(3)
+    (@bignum & obj).should == 1
+  end
+  
+  it "raises a TypeError when the given argument can't be converted to Integer" do
+    obj = mock('asdf')
+    lambda { @bignum & obj }.should raise_error(TypeError)
+    
+    obj.should_receive(:to_int).and_return("asdf")
+    lambda { @bignum & obj }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/bit_or_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/bit_or_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/bit_or_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#|" do
+  before(:each) do
+    @bignum = bignum_value(11) 
+  end
+  
+  it "returns self bitwise OR other" do
+    (@bignum | 2).should == 9223372036854775819
+    (@bignum | 9).should == 9223372036854775819
+    (@bignum | bignum_value).should == 9223372036854775819
+    (bignum_value | bignum_value(0xffff).to_f).should == 9223372036854841344
+  end
+
+  it "tries to convert the given argument to an Integer using to_int" do
+    (@bignum | 9.9).should == 9223372036854775819
+    
+    (obj = mock('2')).should_receive(:to_int).and_return(2)
+    (@bignum | obj).should == 9223372036854775819
+  end
+  
+  it "raises a TypeError when the given argument can't be converted to Integer" do
+    obj = mock('asdf')
+    lambda { @bignum | obj }.should raise_error(TypeError)
+    
+    obj.should_receive(:to_int).and_return("asdf")
+    lambda { @bignum | obj }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/bit_xor_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/bit_xor_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/bit_xor_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#^" do
+  before(:each) do
+    @bignum = bignum_value(18) 
+  end
+  
+  it "returns self bitwise EXCLUSIVE OR other" do
+    (@bignum ^ 2).should == 9223372036854775824
+    (@bignum ^ @bignum).should == 0
+    (@bignum ^ 14).should == 9223372036854775836
+    (bignum_value ^ bignum_value(0xffff).to_f).should == 65536
+  end
+
+  it "tries to convert the given argument to an Integer using to_int" do
+    (@bignum ^ 14.5).should == 9223372036854775836
+    
+    (obj = mock('2')).should_receive(:to_int).and_return(2)
+    (@bignum ^ obj).should == 9223372036854775824
+  end
+  
+  it "raises a TypeError when the given argument can't be converted to Integer" do
+    obj = mock('asdf')
+    lambda { @bignum ^ obj }.should raise_error(TypeError)
+    
+    obj.should_receive(:to_int).and_return("asdf")
+    lambda { @bignum ^ obj }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/coerce_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/coerce_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/coerce_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,62 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#coerce" do
+  it "coerces other to a Bignum and returns [other, self] when passed a Fixnum" do
+    a = bignum_value
+    ary = a.coerce(2)
+
+    ary[0].should be_kind_of(Bignum)
+    ary[1].should be_kind_of(Bignum)
+    ary.should == [2, a]
+  end
+
+  it "returns [other, self] when passed a Bignum" do
+    a = bignum_value
+    b = bignum_value
+    ary = a.coerce(b)
+
+    ary[0].should be_kind_of(Bignum)
+    ary[1].should be_kind_of(Bignum)
+    ary.should == [b, a]
+  end
+
+  it "raises a TypeError when not passed a Fixnum or Bignum" do
+    a = bignum_value
+
+    lambda { a.coerce(nil)         }.should raise_error(TypeError)
+    lambda { a.coerce(mock('str')) }.should raise_error(TypeError)
+    lambda { a.coerce(1..4)        }.should raise_error(TypeError)
+    lambda { a.coerce(:test)       }.should raise_error(TypeError)
+  end
+
+  not_compliant_on :rubinius do
+    it "raises a TypeError when passed a Float or String" do
+      a = bignum_value
+
+      lambda { a.coerce(12.3)  }.should raise_error(TypeError)
+      lambda { a.coerce("123") }.should raise_error(TypeError)
+    end
+  end
+
+  deviates_on :rubinius do
+    it "coerces both values to Floats and returns [other, self] when passed a Float" do
+      a = bignum_value
+      a.coerce(1.2).should == [1.2, a.to_f]
+    end
+
+    it "coerces both values to Floats and returns [other, self] when passed a String" do
+      a = bignum_value
+      a.coerce("123").should == [123.0, a.to_f]
+    end
+
+    it "calls #to_f to coerce other to a Float" do
+      b = mock("bignum value")
+      b.should_receive(:to_f).and_return(1.2)
+
+      a = bignum_value
+      ary = a.coerce(b)
+
+      ary.should == [1.2, a.to_f]
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/comparison_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/comparison_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/comparison_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#<=>" do
+  before(:each) do
+    @bignum = bignum_value(96)
+  end
+  
+  it "returns -1 when self is less than the given argument" do
+    (- at bignum <=> @bignum).should == -1
+    (- at bignum <=> -1).should == -1
+    (- at bignum <=> -4.5).should == -1
+  end
+  
+  it "returns 0 when self is equal to the given argument" do
+    (@bignum <=> @bignum).should == 0
+    (- at bignum <=> - at bignum).should == 0
+  end
+  
+  it "returns 1 when self is greater than the given argument" do
+    (@bignum <=> - at bignum).should == 1
+    (@bignum <=> 1).should == 1
+    (@bignum <=> 4.5).should == 1
+  end
+
+  it "returns nil when the given argument is not an Integer" do
+    (@bignum <=> mock('str')).should == nil
+    (@bignum <=> 'test').should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/complement_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/complement_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/complement_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#~" do
+  it "returns self with each bit flipped" do
+    (~bignum_value(48)).should == -9223372036854775857
+    (~(-bignum_value(21))).should == 9223372036854775828
+    (~bignum_value(1)).should == -9223372036854775810
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/div_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/div_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/div_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/divide'
+
+describe "Bignum#div" do
+  it_behaves_like(:bignum_divide, :div)
+
+  # Note: #div should always return Integers, not Floats!
+  ruby_bug "#", "1.8.6" do
+    it "returns a result of integer division of self by a float argument" do
+      bignum_value(88).div(0xffff_ffff.to_f).should eql(2147483648)
+      bignum_value(88).div(bignum_value(88).to_f).should eql(1)
+      bignum_value(88).div(-bignum_value(88).to_f).should eql(-1)
+    end
+
+    it "raises FloatDomainError if the argument is a float zero" do
+      lambda { bignum_value(88).div(0.0) }.should raise_error(FloatDomainError)
+      lambda { bignum_value(88).div(-0.0) }.should raise_error(FloatDomainError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/divide_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/divide_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/divide_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/divide'
+
+describe "Bignum#/" do
+  it_behaves_like(:bignum_divide, :/)
+
+  it "returns self divided by float" do
+    (bignum_value(88) / 0xffff_ffff.to_f).should be_close(2147483648.5, TOLERANCE)
+  end
+
+  it "does NOT raise ZeroDivisionError if other is zero and is a Float" do
+    (bignum_value / 0.0).to_s.should == 'Infinity'
+    (bignum_value / -0.0).to_s.should == '-Infinity'
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/divmod_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/divmod_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/divmod_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,45 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#divmod" do
+  before(:each) do
+    @bignum = bignum_value(55)
+  end
+
+  # Based on MRI's test/test_integer.rb (test_divmod),
+  # MRI maintains the following property:
+  # if q, r = a.divmod(b) ==>
+  # assert(0 < b ? (0 <= r && r < b) : (b < r && r <= 0))
+  # So, r is always between 0 and b.
+  it "returns an Array containing quotient and modulus obtained from dividing self by the given argument" do
+    @bignum.divmod(4).should == [2305843009213693965, 3]
+    @bignum.divmod(13).should == [709490156681136604, 11]
+
+    @bignum.divmod(4.0).should == [2305843009213693952, 0.0]
+    @bignum.divmod(13.0).should == [709490156681136640, 8.0]
+
+    @bignum.divmod(2.0).should == [4611686018427387904, 0.0]
+    @bignum.divmod(bignum_value).should == [1, 55]
+
+    (-(10**50)).divmod(-(10**40 + 1)).should == [9999999999, -9999999999999999999999999999990000000001]
+    (10**50).divmod(10**40 + 1).should == [9999999999, 9999999999999999999999999999990000000001]
+
+    (-10**50).divmod(10**40 + 1).should == [-10000000000, 10000000000]
+    (10**50).divmod(-(10**40 + 1)).should == [-10000000000, -10000000000]
+  end
+
+  it "raises a ZeroDivisionError when the given argument is 0" do
+    lambda { @bignum.divmod(0) }.should raise_error(ZeroDivisionError)
+    lambda { (- at bignum).divmod(0) }.should raise_error(ZeroDivisionError)
+  end
+
+  it "raises a FloatDomainError when the given argument is 0 and a Float" do
+    lambda { @bignum.divmod(0.0) }.should raise_error(FloatDomainError)
+    lambda { (- at bignum).divmod(0.0) }.should raise_error(FloatDomainError)
+  end
+
+  it "raises a TypeError when the given argument is not an Integer" do
+    lambda { @bignum.divmod(mock('10')) }.should raise_error(TypeError)
+    lambda { @bignum.divmod("10") }.should raise_error(TypeError)
+    lambda { @bignum.divmod(:symbol) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/element_reference_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/element_reference_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/element_reference_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,30 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#[]" do
+  before(:each) do
+    @bignum = bignum_value(4996)
+  end
+  
+  it "returns the nth bit in the binary representation of self" do
+    @bignum[2].should == 1
+    @bignum[9.2].should == 1
+    @bignum[21].should == 0
+    @bignum[0xffffffff].should == 0
+    @bignum[-0xffffffff].should == 0
+  end
+
+  it "tries to convert the given argument to an Integer using #to_int" do
+    @bignum[1.3].should == @bignum[1]
+    
+    (obj = mock('2')).should_receive(:to_int).at_least(1).and_return(2)
+    @bignum[obj].should == 1
+  end
+
+  it "raises a TypeError when the given argument can't be converted to Integer" do
+    obj = mock('asdf')
+    lambda { @bignum[obj] }.should raise_error(TypeError)
+    
+    obj.should_receive(:to_int).and_return("asdf")
+    lambda { @bignum[obj] }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/eql_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/eql_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/eql_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#eql? when given a Bignum" do
+  it "returns true if the given argument has the same value" do
+    a = bignum_value(13)
+    a.should eql(bignum_value(13))
+    (-a).should eql(-bignum_value(13))
+  end
+end
+
+describe "Bignum#eql? when given a non-Bignum" do
+  it "returns false" do
+    a = bignum_value(13)
+    a.should_not eql(a.to_f)
+
+    a.should_not eql(2)
+    a.should_not eql(3.14)
+    a.should_not eql(:symbol)
+    a.should_not eql("String")
+    a.should_not eql(mock('str'))
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/equal_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/equal_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/equal_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#==" do
+  before(:each) do
+    @bignum = bignum_value
+  end
+  
+  it "returns true if self has the same value as the given argument" do
+    (@bignum == @bignum).should == true
+    (@bignum == @bignum.to_f).should == true
+    
+    (@bignum == @bignum + 1).should == false
+    (@bignum + 1 == @bignum).should == false
+    
+    (@bignum == 9).should == false
+    (@bignum == 9.01).should == false
+    
+    (@bignum == bignum_value(10)).should == false
+  end
+
+  it "calls 'other == self' if the given argument is not an Integer" do
+    obj = mock('not integer')
+    obj.should_receive(:==).and_return(true)
+    (@bignum == obj).should == true
+  end
+  
+  it "returns the result of 'other == self' as a boolean" do
+    obj = mock('not integer')
+    obj.should_receive(:==).exactly(2).times.and_return("woot", nil)
+    (@bignum == obj).should == true
+    (@bignum == obj).should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/exponent_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/exponent_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/exponent_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#**" do
+  before(:each) do
+    @bignum = bignum_value(47)
+  end
+  
+  it "returns self raised to other power" do
+    (@bignum ** 4).should == 7237005577332262361485077344629993318496048279512298547155833600056910050625
+    (@bignum ** 1.2).should be_close(57262152889751597425762.57804, TOLERANCE)
+  end
+
+  it "raises a TypeError when given a non-Integer" do
+    lambda { @bignum ** mock('10') }.should raise_error
+    lambda { @bignum ** "10" }.should raise_error
+    lambda { @bignum ** :symbol }.should raise_error
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/gt_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/gt_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/gt_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#>" do
+  before(:each) do
+    @bignum = bignum_value(732)
+  end
+  
+  it "returns true if self is greater than the given argument" do
+    (@bignum > (@bignum - 1)).should == true
+    (@bignum > 14.6).should == true
+    (@bignum > 10).should == true
+
+    (@bignum > (@bignum + 500)).should == false
+  end
+  
+  it "raises an ArgumentError when given a non-Integer" do
+    lambda { @bignum > "4" }.should raise_error(ArgumentError)
+    lambda { @bignum > mock('str') }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/gte_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/gte_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/gte_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#>=" do
+  before(:each) do
+    @bignum = bignum_value(14)
+  end
+  
+  it "returns true if self is greater than or equal to other" do
+    (@bignum >= @bignum).should == true
+    (@bignum >= (@bignum + 2)).should == false
+    (@bignum >= 5664.2).should == true
+    (@bignum >= 4).should == true
+  end
+
+  it "raises an ArgumentError when given a non-Integer" do
+    lambda { @bignum >= "4" }.should raise_error(ArgumentError)
+    lambda { @bignum >= mock('str') }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/hash_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/hash_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/hash_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#hash" do
+  it "is provided" do
+    bignum_value.respond_to?(:hash).should == true
+  end
+
+  it "is stable" do
+    bignum_value.hash.should == bignum_value.hash
+    bignum_value.hash.should_not == bignum_value(1).hash
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/left_shift_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/left_shift_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/left_shift_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,57 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#<<" do
+  before(:each) do
+    @bignum = bignum_value(9)
+  end
+  
+  it "returns self shifted the given amount of bits to the left" do
+    (@bignum << 4).should == 147573952589676413072
+    (@bignum << 9).should == 4722366482869645218304
+  end
+
+  it "performs a right-shift if given a negative value" do
+    (@bignum << -2).should == (@bignum >> 2)
+    (@bignum << -4).should == (@bignum >> 4)
+  end
+
+  it "tries to convert the given argument to an Integer using to_int" do
+    (@bignum << 4.5).should == 147573952589676413072
+    
+    (obj = mock('4')).should_receive(:to_int).and_return(4)
+    (@bignum << obj).should == 147573952589676413072
+  end
+
+  it "raises a TypeError when the given argument can't be converted to Integer" do
+    obj = mock("Converted to Integer")
+    lambda { @bignum << obj }.should raise_error(TypeError)
+    
+    obj.should_receive(:to_int).and_return("asdf")
+    lambda { @bignum << obj }.should raise_error(TypeError)
+  end
+
+  platform_is :wordsize => 32 do
+    it "raises a RangeError when the given argument is a Bignum" do
+      lambda { @bignum << bignum_value }.should raise_error(RangeError)
+      lambda { - at bignum << bignum_value }.should raise_error(RangeError)
+      
+      obj = mock("Converted to Integer")
+      obj.should_receive(:to_int).exactly(2).times.and_return(bignum_value)
+      lambda { @bignum << obj }.should raise_error(RangeError)
+      lambda { - at bignum << obj }.should raise_error(RangeError)
+    end
+  end
+
+  platform_is :wordsize => 64 do
+    it "raises a RangeError when the given argument is a Bignum" do
+      # check against 2**64 for 64-bit machines.
+      lambda { @bignum << (bignum_value << 1) }.should raise_error(RangeError)
+      lambda { - at bignum << (bignum_value << 1) }.should raise_error(RangeError)
+      
+      obj = mock("Converted to Integer")
+      obj.should_receive(:to_int).exactly(2).times.and_return(bignum_value << 1)
+      lambda { @bignum << obj }.should raise_error(RangeError)
+      lambda { - at bignum << obj }.should raise_error(RangeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/lt_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/lt_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/lt_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#<" do
+  before(:each) do
+    @bignum = bignum_value(32)
+  end
+  
+  it "returns true if self is less than the given argument" do
+    (@bignum < @bignum + 1).should == true
+    (- at bignum < -(@bignum - 1)).should == true
+    
+    (@bignum < 1).should == false
+    (@bignum < 5).should == false
+    
+    (@bignum < 4.999).should == false
+  end
+  
+  it "raises an ArgumentError when given a non-Integer" do
+    lambda { @bignum < "4" }.should raise_error(ArgumentError)
+    lambda { @bignum < mock('str') }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/lte_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/lte_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/lte_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#<=" do
+  before(:each) do
+    @bignum = bignum_value(39)
+  end
+
+  it "returns true if self is less than or equal to other" do
+    (@bignum <= @bignum).should == true
+    (- at bignum <= -(@bignum - 1)).should == true
+    
+    (@bignum <= (@bignum + 0.5)).should == true
+    (@bignum <= 4.999).should == false
+  end
+
+  it "raises an ArgumentError when given a non-Integer" do
+    lambda { @bignum <= "4" }.should raise_error(ArgumentError)
+    lambda { @bignum <= mock('str') }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/minus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/minus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/minus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#-" do
+  before(:each) do
+    @bignum = bignum_value(314)
+  end
+  
+  it "returns self minus the given Integer" do
+    (@bignum - 9).should == 9223372036854776113
+    (@bignum - 12.57).should be_close(9223372036854776109.43, TOLERANCE)
+    (@bignum - bignum_value(42)).should == 272
+  end
+
+  it "raises a TypeError when given a non-Integer" do
+    lambda { @bignum - mock('10') }.should raise_error(TypeError)
+    lambda { @bignum - "10" }.should raise_error(TypeError)
+    lambda { @bignum - :symbol }.should raise_error(TypeError)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/modulo_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/modulo_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/modulo_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/modulo'
+
+describe "Bignum#%" do
+  it_behaves_like(:bignum_modulo, :%)
+end
+
+describe "Bignum#modulo" do
+  it_behaves_like(:bignum_modulo, :modulo)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/multiply_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/multiply_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/multiply_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#*" do
+  before(:each) do
+    @bignum = bignum_value(772)
+  end
+  
+  it "returns self multiplied by the given Integer" do
+    (@bignum * (1/bignum_value(0xffff).to_f)).should be_close(0.999999999999992894572642398998, 3e-29)
+    (@bignum * 10).should == 92233720368547765800
+    (@bignum * (@bignum - 40)).should == 85070591730234629737795195287525433200
+  end
+
+  it "raises a TypeError when given a non-Integer" do
+    lambda { @bignum * mock('10') }.should raise_error(TypeError)
+    lambda { @bignum * "10" }.should raise_error(TypeError)
+    lambda { @bignum * :symbol }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/plus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/plus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/plus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#+" do
+  before(:each) do
+    @bignum = bignum_value(76)
+  end
+  
+  it "returns self plus the given Integer" do
+    (@bignum + 4).should == 9223372036854775888
+    (@bignum + 4.2).should be_close(9223372036854775888.2, TOLERANCE)
+    (@bignum + bignum_value(3)).should == 18446744073709551695
+  end
+
+  it "raises a TypeError when given a non-Integer" do
+    lambda { @bignum + mock('10') }.should raise_error(TypeError)
+    lambda { @bignum + "10" }.should raise_error(TypeError)
+    lambda { @bignum + :symbol}.should raise_error(TypeError)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/quo_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/quo_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/quo_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,36 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#quo" do
+  before(:each) do
+    @bignum = bignum_value(3)
+  end
+
+  it "returns the result of self divided by the given Integer as a Float" do
+    @bignum.quo(0xffff_afed.to_f).should be_close(2147493897.54892, TOLERANCE)
+    @bignum.quo(0xabcd_effe).should be_close(3199892875.41007, TOLERANCE)
+    @bignum.quo(bignum_value).should be_close(1.00000000279397, TOLERANCE)
+  end
+
+  conflicts_with :Rational do
+    it "does not raise a ZeroDivisionError when the given Integer is 0" do
+      @bignum.quo(0).to_s.should == "Infinity"
+      (- at bignum).quo(0).to_s.should == "-Infinity"
+    end
+  end
+
+  it "does not raise a FloatDomainError when the given Integer is 0 and a Float" do
+    @bignum.quo(0.0).to_s.should == "Infinity"
+    (- at bignum).quo(0.0).to_s.should == "-Infinity"
+  end
+
+  conflicts_with :Rational do
+    it "raises a TypeError when given a non-Integer" do
+      lambda {
+        (obj = mock('to_int')).should_not_receive(:to_int)
+        @bignum.quo(obj)
+      }.should raise_error(TypeError)
+      lambda { @bignum.quo("10") }.should raise_error(TypeError)
+      lambda { @bignum.quo(:symbol) }.should raise_error(TypeError)
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/remainder_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/remainder_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/remainder_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#remainder" do
+  it "returns the remainder of dividing self by other" do
+    a = bignum_value(79)
+    a.remainder(2).should == 1
+    a.remainder(97.345).should be_close(46.5674996147722, TOLERANCE)
+    a.remainder(bignum_value).should == 79
+  end
+  
+  it "raises a ZeroDivisionError if other is zero and not a Float" do
+    lambda { bignum_value(66).remainder(0) }.should raise_error(ZeroDivisionError)
+  end
+  
+  it "does NOT raise ZeroDivisionError if other is zero and is a Float" do
+    a = bignum_value(7)
+    b = bignum_value(32)
+    a.remainder(0.0).to_s.should == 'NaN'
+    b.remainder(-0.0).to_s.should == 'NaN'
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/right_shift_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/right_shift_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/right_shift_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,48 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#>>" do
+  before(:each) do 
+    @bignum = bignum_value(90812)
+  end
+
+  it "returns self shifted the given amount of bits to the right" do
+    (@bignum >> 1).should == 4611686018427433310
+    (@bignum >> 3).should == 1152921504606858327
+  end
+
+  it "performs a left-shift if given a negative value" do
+    (@bignum >> -1).should == (@bignum << 1)
+    (@bignum >> -3).should == (@bignum << 3)
+  end
+  
+  it "tries to convert the given argument to an Integer using to_int" do
+    (@bignum >> 1.3).should == 4611686018427433310
+    
+    (obj = mock('1')).should_receive(:to_int).and_return(1)
+    (@bignum >> obj).should == 4611686018427433310
+  end
+  
+  it "raises a TypeError when the given argument can't be converted to Integer" do
+    obj = mock('asdf')
+    lambda { @bignum >> obj }.should raise_error(TypeError)
+    
+    obj.should_receive(:to_int).and_return("asdf")
+    lambda { @bignum >> obj }.should raise_error(TypeError)
+  end
+
+  it "returns 0 when the given argument is a Bignum and self is positive" do
+    (@bignum >> bignum_value).should == 0
+    
+    obj = mock("Converted to Integer")
+    obj.should_receive(:to_int).and_return(bignum_value)
+    (@bignum >> obj).should == 0
+  end
+  
+  it "returns -1 when the given argument is a Bignum and self is negative" do
+    (- at bignum >> bignum_value).should == -1
+
+    obj = mock("Converted to Integer")
+    obj.should_receive(:to_int).and_return(bignum_value)
+    (- at bignum >> obj).should == -1
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/shared/divide.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/shared/divide.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/shared/divide.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+describe :bignum_divide, :shared => true do
+  before(:each) do
+    @bignum = bignum_value(88)
+  end
+  
+  it "returns self divided by other" do
+    @bignum.send(@method, 4).should == 2305843009213693974
+
+    @bignum.send(@method, bignum_value(2)).should be_close(1, TOLERANCE)
+    
+    (-(10**50)).send(@method, -(10**40 + 1)).should == 9999999999
+    (10**50).send(@method, 10**40 + 1).should == 9999999999
+
+    (-10**50).send(@method, 10**40 + 1).should == -10000000000
+    (10**50).send(@method, -(10**40 + 1)).should == -10000000000
+  end
+
+  it "raises a ZeroDivisionError if other is zero and not a Float" do
+    lambda { @bignum.send(@method, 0) }.should raise_error(ZeroDivisionError)
+  end
+
+  it "raises a TypeError when given a non-Integer" do
+    lambda { @bignum.send(@method, mock('10')) }.should raise_error(TypeError)
+    lambda { @bignum.send(@method, "2") }.should raise_error(TypeError)
+    lambda { @bignum.send(@method, :symbol) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/shared/modulo.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/shared/modulo.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/shared/modulo.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+describe :bignum_modulo, :shared => true do
+  before(:each) do
+    @bignum = bignum_value
+  end
+  
+  it "returns the modulus obtained from dividing self by the given argument" do
+    @bignum.send(@method, 5).should == 3
+    @bignum.send(@method, -5).should == -2
+    @bignum.send(@method, -100).should == -92
+    @bignum.send(@method, 2.22).should be_close(0.780180180180252, TOLERANCE)
+    @bignum.send(@method, bignum_value(10)).should == 9223372036854775808
+  end
+
+  it "raises a ZeroDivisionError when the given argument is 0" do
+    lambda { @bignum.send(@method, 0) }.should raise_error(ZeroDivisionError)
+    lambda { (- at bignum).send(@method, 0) }.should raise_error(ZeroDivisionError)
+  end
+
+  it "does not raise a FloatDomainError when the given argument is 0 and a Float" do
+    @bignum.send(@method, 0.0).to_s.should == "NaN" 
+    (- at bignum).send(@method, 0.0).to_s.should == "NaN" 
+  end
+
+  it "raises a TypeError when given a non-Integer" do
+    lambda { @bignum.send(@method, mock('10')) }.should raise_error(TypeError)
+    lambda { @bignum.send(@method, "10") }.should raise_error(TypeError)
+    lambda { @bignum.send(@method, :symbol) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#size" do
+
+  compliant_on :ironruby do
+    it "returns the number of bytes in the machine representation in multiples of four" do
+      (256**7).size.should == 8
+      (256**8).size.should == 12
+      (256**9).size.should == 12
+      (256**10).size.should == 12
+      (256**10-1).size.should == 12
+      (256**11).size.should == 12
+      (256**12).size.should == 16
+      (256**20-1).size.should == 20
+      (256**40-1).size.should == 40
+    end
+  end
+
+  deviates_on :rubinius, :jruby do
+    it "returns the number of bytes in the machine representation" do
+      (256**7).size   .should == 8
+      (256**8).size   .should == 9
+      (256**9).size   .should == 10
+      (256**10).size  .should == 11
+      (256**10-1).size.should == 10
+      (256**11).size   .should == 12
+      (256**12).size   .should == 13
+      (256**20-1).size .should == 20
+      (256**40-1).size .should == 40
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/to_f_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/to_f_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/to_f_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#to_f" do
+  it "returns self converted to a Float" do
+    bignum_value(0x4000_0aa0_0bb0_0000).to_f.should eql(13_835_069_737_789_292_544.00)
+    bignum_value(0x8000_0000_0000_0ccc).to_f.should eql(18_446_744_073_709_555_712.00)
+    (-bignum_value(99)).to_f.should eql(-9_223_372_036_854_775_808.00)
+  end
+
+  it "converts number close to Float::MAX without exceeding MAX or producing NaN" do
+    (10**308).to_f.should == 10.0 ** 308
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#to_s when given a base" do
+  it "returns self converted to a String using the given base" do
+    a = 2**64
+    a.to_s(2).should == "10000000000000000000000000000000000000000000000000000000000000000" 
+    a.to_s(8).should == "2000000000000000000000"
+    a.to_s(16).should == "10000000000000000"
+    a.to_s(32).should == "g000000000000" 
+  end
+  
+  it "raises an ArgumentError if the base is less than 2 or higher than 36" do
+    lambda { 123.to_s(-1) }.should raise_error(ArgumentError)
+    lambda { 123.to_s(0) }.should raise_error(ArgumentError)
+    lambda { 123.to_s(1) }.should raise_error(ArgumentError)
+    lambda { 123.to_s(37) }.should raise_error(ArgumentError)
+  end
+end
+
+describe "Bignum#to_s when given no base" do
+  it "returns self converted to a String using base 10" do
+    bignum_value(9).to_s.should == "9223372036854775817"
+    bignum_value.to_s.should == "9223372036854775808"
+    (-bignum_value(675)).to_s.should == "-9223372036854776483"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/bignum/uminus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/uminus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/uminus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Bignum#-@" do
+  it "returns self as a negative value" do
+    bignum_value.send(:-@).should == -9223372036854775808
+    (-bignum_value).send(:-@).should == 9223372036854775808
+    
+    bignum_value(921).send(:-@).should == -9223372036854776729
+    (-bignum_value(921).send(:-@)).should == 9223372036854776729
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/binding/clone_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/binding/clone_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/binding/clone_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/clone'
+
+describe "Binding#clone" do
+  it_behaves_like(:binding_clone, :clone)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/binding/dup_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/binding/dup_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/binding/dup_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/clone'
+
+describe "Binding#dup" do
+  it_behaves_like(:binding_clone, :dup)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/binding/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/binding/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/binding/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+module BindingSpecs
+  class Demo
+    def initialize(n)
+      @secret = n
+    end
+  
+    def square(n)
+      n * n
+    end
+
+    def get_binding
+      a = true
+      binding
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/binding/shared/clone.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/binding/shared/clone.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/binding/shared/clone.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+describe :binding_clone, :shared => true do
+  before(:each) do
+    @b1 = BindingSpecs::Demo.new(99).get_binding
+    @b2 = @b1.send(@method)
+  end
+
+  it "returns a copy of the Bind object" do
+    @b1.should_not == @b2
+
+    eval("@secret", @b1).should == eval("@secret", @b2)
+    eval("square(2)", @b1).should == eval("square(2)", @b2)
+    eval("self.square(2)", @b1).should == eval("self.square(2)", @b2)
+    eval("a", @b1).should == eval("a", @b2)
+  end
+
+  it "is a shallow copy of the Bind object" do
+    eval("a = false", @b1)
+    eval("a", @b2).should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/class/allocate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/class/allocate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/class/allocate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Class#allocate" do
+  it "returns an instance of self" do
+    klass = Class.new
+    klass.allocate.should be_kind_of(klass)
+  end
+  
+  it "returns a fully-formed instance of Module" do
+    klass = Class.allocate
+    klass.constants.should_not == nil
+    klass.methods.should_not == nil
+  end
+
+  it "does not call initialize on the new instance" do
+    klass = Class.new do
+      def initialize(*args)
+        @initialized = true
+      end
+      
+      def initialized?
+        @initialized || false
+      end
+    end
+    
+    klass.allocate.initialized?.should == false
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/class/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/class/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/class/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,48 @@
+module CoreClassSpecs
+  class Record
+    def self.called(sym)
+      @called = sym
+    end
+    
+    def self.called?
+      @called
+    end
+  end
+  
+  module M
+    def inherited(klass)
+      ::CoreClassSpecs::Record.called(klass)
+      super
+    end
+  end
+  
+  class F; end
+  class << F
+    include M
+  end
+  
+  class A
+    def self.inherited(klass)
+      ::CoreClassSpecs::Record.called(klass)
+    end
+  end
+  
+  class H < A
+    def self.inherited(klass)
+      super
+    end
+  end
+
+  module Inherited
+    class A
+      SUBCLASSES = []
+      def self.inherited(subclass)
+        SUBCLASSES << [self, subclass]
+      end
+    end
+
+    class B < A; end
+    class B < A; end # reopen
+    class C < B; end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/class/inherited_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/class/inherited_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/class/inherited_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,88 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Class.inherited" do
+
+  before :each do
+    CoreClassSpecs::Record.called nil
+  end
+  
+  it "is invoked with the child Class when self is subclassed" do
+    begin
+      top = Class.new do
+        def self.inherited(cls)
+          $child_class = cls
+        end
+      end
+      
+      child = Class.new(top)
+      $child_class.should == child
+
+      other_child = Class.new(top)
+      $child_class.should == other_child
+    ensure
+      $child_class = nil
+    end
+  end
+
+  it "is invoked only once per subclass" do
+    expected = [
+      [CoreClassSpecs::Inherited::A, CoreClassSpecs::Inherited::B],
+      [CoreClassSpecs::Inherited::B, CoreClassSpecs::Inherited::C],
+    ]
+
+    CoreClassSpecs::Inherited::A::SUBCLASSES.should == expected
+  end
+
+  it "is called when marked as a private class method" do
+    CoreClassSpecs::A.private_class_method :inherited
+    CoreClassSpecs::Record.called?.should == nil
+    module CoreClassSpecs; class B < A; end; end
+    CoreClassSpecs::Record.called?.should == CoreClassSpecs::B
+  end
+  
+  it "is called when marked as a protected class method" do
+    class << CoreClassSpecs::A
+      protected :inherited
+    end
+    CoreClassSpecs::Record.called?.should == nil
+    module CoreClassSpecs; class C < A; end; end
+    CoreClassSpecs::Record.called?.should == CoreClassSpecs::C
+  end
+  
+  it "is called when marked as a public class method" do
+    CoreClassSpecs::A.public_class_method :inherited
+    CoreClassSpecs::Record.called?.should == nil
+    module CoreClassSpecs; class D < A; end; end
+    CoreClassSpecs::Record.called?.should == CoreClassSpecs::D
+  end
+  
+  it "is called by super from a method provided by an included module" do
+    CoreClassSpecs::Record.called?.should == nil
+    module CoreClassSpecs; class E < F; end; end
+    CoreClassSpecs::Record.called?.should == CoreClassSpecs::E
+  end
+  
+  it "is called by super even when marked as a private class method" do
+    CoreClassSpecs::Record.called?.should == nil
+    CoreClassSpecs::H.private_class_method :inherited
+    module CoreClassSpecs; class I < H; end; end
+    CoreClassSpecs::Record.called?.should == CoreClassSpecs::I
+  end
+  
+  it "will be invoked by child class regardless of visibility" do
+    top = Class.new do
+      class << self
+        def inherited(cls); end
+      end
+    end
+
+    class << top; private :inherited; end
+    lambda { Class.new(top) }.should_not raise_error
+
+    class << top; protected :inherited; end
+    lambda { Class.new(top) }.should_not raise_error
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/class/initialize_copy_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/class/initialize_copy_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/class/initialize_copy_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/class/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/class/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/class/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Class#new" do
+  it "returns a new instance of self" do
+    klass = Class.new
+    klass.new.is_a?(klass).should == true
+  end
+  
+  it "invokes #initialize on the new instance with the given args" do
+    klass = Class.new do
+      def initialize(*args)
+        @initialized = true
+        @args = args
+      end
+      
+      def args
+        @args
+      end
+      
+      def initialized?
+        @initialized || false
+      end
+    end
+    
+    klass.new.initialized?.should == true
+    klass.new(1, 2, 3).args.should == [1, 2, 3]
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/class/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/class/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/class/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,82 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Class.new with a block given" do
+  it "uses the given block as the class' body" do
+    klass = Class.new do
+      def self.message
+        "text"
+      end
+
+      def hello
+        "hello again"
+      end
+    end
+
+    klass.message.should     == "text"
+    klass.new.hello.should == "hello again"
+  end
+
+  it "creates a subclass of the given superclass" do
+    sc = Class.new do
+      def self.body
+        @body
+      end
+      @body = self
+      def message; "text"; end
+    end
+    klass = Class.new(sc) do
+      def self.body
+        @body
+      end
+      @body = self
+      def message2; "hello"; end
+    end
+
+    klass.body.should == klass
+    sc.body.should == sc
+    klass.superclass.should == sc
+    klass.new.message.should == "text"
+    klass.new.message2.should == "hello"
+    klass.dup.body.should == klass
+  end
+end
+
+describe "Class.new" do
+  it "creates a new anonymous class" do
+    klass = Class.new
+    klass.is_a?(Class).should == true
+
+    klass_instance = klass.new
+    klass_instance.is_a?(klass).should == true
+  end
+
+  it "creates a class without a name" do
+    Class.new.name.should == ""
+  end
+
+  it "creates a class that can be given a name by assigning it to a constant" do
+    MyClass = Class.new
+    MyClass.name.should == "MyClass"
+    a = Class.new
+    MyClass::NestedClass = a
+    MyClass::NestedClass.name.should == "MyClass::NestedClass"
+  end
+
+  it "sets the new class' superclass to the given class" do
+    top = Class.new
+    Class.new(top).superclass.should == top
+  end
+
+  it "sets the new class' superclass to Object when no class given" do
+    Class.new.superclass.should == Object
+  end
+
+  it "raises a TypeError when given a non-Class" do
+    error_msg = /superclass must be a Class/
+    lambda { Class.new("")         }.should raise_error(TypeError)
+    lambda { Class.new(1)          }.should raise_error(TypeError)
+    lambda { Class.new(:symbol)    }.should raise_error(TypeError)
+    lambda { Class.new(mock('o'))  }.should raise_error(TypeError)
+    lambda { Class.new(Module.new) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/class/superclass_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/class/superclass_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/class/superclass_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Class#superclass" do
+  it "returns the superclass of self" do
+    Object.superclass.should == nil
+    Class.superclass.should == Module
+    Class.new.superclass.should == Object
+    Class.new(String).superclass.should == String
+    Class.new(Fixnum).superclass.should == Fixnum
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/comparable/between_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/comparable/between_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/comparable/between_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Comparable#between?" do
+  it "returns true if self is greater than or equal to the first and less than or equal to the second argument" do
+    a = ComparableSpecs::Weird.new(-1)
+    b = ComparableSpecs::Weird.new(0)
+    c = ComparableSpecs::Weird.new(1)
+    d = ComparableSpecs::Weird.new(2)
+
+    a.between?(a, a).should == true
+    a.between?(a, b).should == true
+    a.between?(a, c).should == true
+    a.between?(a, d).should == true
+    c.between?(c, d).should == true
+    d.between?(d, d).should == true
+    c.between?(a, d).should == true
+    
+    a.between?(b, b).should == false
+    a.between?(b, c).should == false
+    a.between?(b, d).should == false
+    c.between?(a, a).should == false
+    c.between?(a, b).should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/comparable/equal_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/comparable/equal_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/comparable/equal_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,63 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Comparable#==" do
+  it "returns true if other is the same as self" do
+    a = ComparableSpecs::Weird.new(0)
+    b = ComparableSpecs::Weird.new(20)
+    
+    (a == a).should == true
+    (b == b).should == true
+  end
+  
+  it "calls #<=> on self with other and returns true if #<=> returns 0" do
+    a = ComparableSpecs::Weird.new(0)
+    b = ComparableSpecs::Weird.new(10)
+    
+    a.should_receive(:<=>).any_number_of_times.and_return(0)
+    (a == b).should == true
+
+    a = ComparableSpecs::Weird.new(0)
+    a.should_receive(:<=>).any_number_of_times.and_return(0.0)
+    (a == b).should == true
+  end
+  
+  it "returns false if calling #<=> on self returns a non-zero Integer" do
+    a = ComparableSpecs::Weird.new(0)
+    b = ComparableSpecs::Weird.new(10)
+ 
+    a.should_receive(:<=>).any_number_of_times.and_return(1)
+    (a == b).should == false
+    
+    a = ComparableSpecs::Weird.new(0)
+    a.should_receive(:<=>).any_number_of_times.and_return(-1)
+    (a == b).should == false
+  end
+  
+  it "returns nil if calling #<=> on self returns nil or a non-Integer" do
+    a = ComparableSpecs::Weird.new(0)
+    b = ComparableSpecs::Weird.new(10)
+
+    a.should_receive(:<=>).any_number_of_times.and_return(nil)
+    (a == b).should == nil
+
+    a = ComparableSpecs::Weird.new(0)
+    a.should_receive(:<=>).any_number_of_times.and_return("abc")
+    (a == b).should == nil
+  end
+
+  it "returns nil if calling #<=> on self raises a StandardError" do
+    a = ComparableSpecs::Weird.new(0)
+    b = ComparableSpecs::Weird.new(10)
+    
+    def a.<=>(b) raise StandardError, "test"; end
+    (a == b).should == nil
+
+    # TypeError < StandardError
+    def a.<=>(b) raise TypeError, "test"; end
+    (a == b).should == nil
+
+    def a.<=>(b) raise Exception, "test"; end
+    lambda { (a == b).should == nil }.should raise_error(Exception)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/comparable/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/comparable/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/comparable/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+module ComparableSpecs
+  class Weird
+    include Comparable
+  
+    attr_reader :value
+  
+    def initialize(value)
+      @value = value
+    end
+  
+    def <=>(other)
+      self.value <=> other.value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/comparable/gt_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/comparable/gt_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/comparable/gt_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,43 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Comparable#>" do
+  it "calls #<=> on self with other and returns true if #<=> returns any Integer greater than 0" do
+    a = ComparableSpecs::Weird.new(0)
+    b = ComparableSpecs::Weird.new(20)
+    
+    a.should_receive(:<=>).any_number_of_times.and_return(1)
+    (a > b).should == true
+
+    a.should_receive(:<=>).any_number_of_times.and_return(0.1)
+    (a > b).should == true
+
+    a.should_receive(:<=>).any_number_of_times.and_return(10000000)
+    (a > b).should == true
+  end
+
+  it "returns false if calling #<=> on self returns 0 or any Integer less than 0" do
+    a = ComparableSpecs::Weird.new(0)
+    b = ComparableSpecs::Weird.new(10)
+ 
+    a.should_receive(:<=>).any_number_of_times.and_return(0)
+    (a > b).should == false
+    
+    a.should_receive(:<=>).any_number_of_times.and_return(0.0)
+    (a > b).should == false
+    
+    a.should_receive(:<=>).any_number_of_times.and_return(-1.0)
+    (a > b).should == false
+    
+    a.should_receive(:<=>).any_number_of_times.and_return(-10000000)
+    (a > b).should == false
+  end
+
+  it "raises an ArgumentError if calling #<=> on self returns nil" do
+    a = ComparableSpecs::Weird.new(0)
+    b = ComparableSpecs::Weird.new(20)
+    
+    a.should_receive(:<=>).any_number_of_times.and_return(nil)
+    lambda { (a > b) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/comparable/gte_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/comparable/gte_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/comparable/gte_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,47 @@
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Comparable#>=" do
+  it "calls #<=> on self with other and returns true if #<=> returns 0 or any Integer greater than 0" do
+    a = ComparableSpecs::Weird.new(0)
+    b = ComparableSpecs::Weird.new(20)
+
+    a.should_receive(:<=>).any_number_of_times.and_return(0)
+    (a >= b).should == true
+    
+    a.should_receive(:<=>).any_number_of_times.and_return(0.0)
+    (a >= b).should == true
+    
+    a.should_receive(:<=>).any_number_of_times.and_return(1)
+    (a >= b).should == true
+
+    a.should_receive(:<=>).any_number_of_times.and_return(0.1)
+    (a >= b).should == true
+
+    a.should_receive(:<=>).any_number_of_times.and_return(10000000)
+    (a >= b).should == true
+  end
+
+  it "returns false if calling #<=> on self returns any Integer less than 0" do
+    a = ComparableSpecs::Weird.new(0)
+    b = ComparableSpecs::Weird.new(10)
+ 
+
+    a.should_receive(:<=>).any_number_of_times.and_return(-0.1)
+    (a >= b).should == false
+    
+    a.should_receive(:<=>).any_number_of_times.and_return(-1.0)
+    (a >= b).should == false
+    
+    a.should_receive(:<=>).any_number_of_times.and_return(-10000000)
+    (a >= b).should == false
+  end
+
+  it "raises an ArgumentError if calling #<=> on self returns nil" do
+    a = ComparableSpecs::Weird.new(0)
+    b = ComparableSpecs::Weird.new(20)
+    
+    a.should_receive(:<=>).any_number_of_times.and_return(nil)
+    lambda { (a >= b) }.should raise_error(ArgumentError)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/comparable/lt_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/comparable/lt_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/comparable/lt_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,43 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Comparable#<" do
+  it "calls #<=> on self with other and returns true if #<=> returns any Integer less than 0" do
+    a = ComparableSpecs::Weird.new(0)
+    b = ComparableSpecs::Weird.new(20)
+    
+    a.should_receive(:<=>).any_number_of_times.and_return(-1)
+    (a < b).should == true
+
+    a.should_receive(:<=>).any_number_of_times.and_return(-0.1)
+    (a < b).should == true
+
+    a.should_receive(:<=>).any_number_of_times.and_return(-10000000)
+    (a < b).should == true
+  end
+
+  it "returns false if calling #<=> on self returns 0 or any Integer greater than 0" do
+    a = ComparableSpecs::Weird.new(0)
+    b = ComparableSpecs::Weird.new(10)
+ 
+    a.should_receive(:<=>).any_number_of_times.and_return(0)
+    (a < b).should == false
+    
+    a.should_receive(:<=>).any_number_of_times.and_return(0.0)
+    (a < b).should == false
+    
+    a.should_receive(:<=>).any_number_of_times.and_return(1.0)
+    (a < b).should == false
+    
+    a.should_receive(:<=>).any_number_of_times.and_return(10000000)
+    (a < b).should == false
+  end
+
+  it "raises an ArgumentError if calling #<=> on self returns nil" do
+    a = ComparableSpecs::Weird.new(0)
+    b = ComparableSpecs::Weird.new(20)
+    
+    a.should_receive(:<=>).any_number_of_times.and_return(nil)
+    lambda { (a < b) }.should raise_error(ArgumentError)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/comparable/lte_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/comparable/lte_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/comparable/lte_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,46 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Comparable#<=" do
+  it "calls #<=> on self with other and returns true if #<=> returns 0 or any Integer less than 0" do
+    a = ComparableSpecs::Weird.new(0)
+    b = ComparableSpecs::Weird.new(20)
+    
+    a.should_receive(:<=>).any_number_of_times.and_return(0)
+    (a <= b).should == true
+    
+    a.should_receive(:<=>).any_number_of_times.and_return(0.0)
+    (a <= b).should == true
+
+    a.should_receive(:<=>).any_number_of_times.and_return(-1)
+    (a <= b).should == true
+
+    a.should_receive(:<=>).any_number_of_times.and_return(-0.1)
+    (a <= b).should == true
+
+    a.should_receive(:<=>).any_number_of_times.and_return(-10000000)
+    (a <= b).should == true
+  end
+
+  it "returns false if calling #<=> on self returns any Integer greater than 0" do
+    a = ComparableSpecs::Weird.new(0)
+    b = ComparableSpecs::Weird.new(10)
+ 
+    a.should_receive(:<=>).any_number_of_times.and_return(0.1)
+    (a <= b).should == false
+
+    a.should_receive(:<=>).any_number_of_times.and_return(1.0)
+    (a <= b).should == false
+    
+    a.should_receive(:<=>).any_number_of_times.and_return(10000000)
+    (a <= b).should == false
+  end
+
+  it "raises an ArgumentError if calling #<=> on self returns nil" do
+    a = ComparableSpecs::Weird.new(0)
+    b = ComparableSpecs::Weird.new(20)
+    
+    a.should_receive(:<=>).any_number_of_times.and_return(nil)
+    lambda { (a <= b) }.should raise_error(ArgumentError)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/continuation/call_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/continuation/call_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/continuation/call_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/continuation/continuation_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/continuation/continuation_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/continuation/continuation_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,103 @@
+# This file specifies behaviour for the methods of
+# Continuation. The mechanics thereof may be further
+# examined in spec/language.
+#
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+# Class methods
+#   -
+#
+# Instance methods
+#   #call             OK
+#   #[]               OK
+
+
+describe "Creating a Continuation object" do
+  not_supported_on :ironruby do
+    it "must be done through Kernel.callcc, no .new" do
+      lambda { Continuation.new }.should raise_error(NoMethodError)
+
+      Kernel.callcc {|@cc|}
+      c = @cc
+      c.class.should == Continuation
+    end
+  end
+end
+
+
+describe "Executing a Continuation" do
+  not_supported_on :ironruby do
+    it "using #call transfers execution to right after the Kernel.callcc block" do
+      array = [:reached, :not_reached]
+
+      Kernel.callcc {|@cc|}
+
+      unless array.first == :not_reached
+        array.shift
+        @cc.call
+      end
+
+      array.should == [:not_reached]
+    end
+
+    it "arguments given to #call (or nil) are returned by the Kernel.callcc block (as Array unless only one object)" do
+      Kernel.callcc {|cc| cc.call}.should == nil
+      Kernel.callcc {|cc| cc.call 1}.should == 1
+      Kernel.callcc {|cc| cc.call 1, 2, 3}.should == [1, 2, 3]
+    end
+
+    it "#[] is an alias for #call" do
+      Kernel.callcc {|cc| cc.call}.should == Kernel.callcc {|cc| cc[]}
+      Kernel.callcc {|cc| cc.call 1}.should == Kernel.callcc {|cc| cc[1]}
+      Kernel.callcc {|cc| cc.call 1, 2, 3}.should == Kernel.callcc {|cc| cc[1, 2, 3]}
+    end
+
+    it "closes over lexical environments" do
+      o = Object.new
+      def o.f; a = 1; Kernel.callcc {|c| a = 2; c.call }; a; end
+      o.f().should == 2
+    end
+
+    it "escapes an inner ensure block" do
+      a = []
+      cont = nil
+      a << :pre_callcc
+      Kernel.callcc do |cc|
+        a << :in_callcc
+        cont = cc
+      end
+      a << :post_callcc
+      unless a.include? :pre_call
+        begin
+          a << :pre_call
+          cont.call
+          a << :post_call
+        ensure
+          a << :ensure
+        end
+      end
+      a.should == [:pre_callcc,:in_callcc,:post_callcc,:pre_call,:post_callcc]
+    end
+
+    it "executes an outer ensure block" do
+      a = []
+      cont = nil
+      begin
+        a << :pre_callcc
+        Kernel.callcc do |cc|
+          a << :in_callcc
+          cont = cc
+        end
+        a << :post_callcc
+        unless a.include? :pre_call
+          a << :pre_call
+          cont.call
+          a << :post_call
+        end
+      ensure
+        a << :ensure
+      end
+      a.should == [:pre_callcc,:in_callcc,:post_callcc,:pre_call,:post_callcc,:ensure]
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/continuation/element_reference_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/continuation/element_reference_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/continuation/element_reference_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/dir/chdir_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/chdir_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/chdir_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,77 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+
+describe "Dir.chdir" do
+  before(:each) do
+    @original = Dir.pwd
+  end
+  
+  after(:each) do
+    Dir.chdir(@original)
+  end
+  
+  it "defaults to $HOME with no arguments" do
+    if ENV['HOME']
+    Dir.chdir(ENV['HOME'])
+    home = Dir.pwd
+
+    Dir.chdir
+    Dir.pwd.should == home
+    end
+  end
+  
+  it "changes to the specified directory" do
+    Dir.chdir DirSpecs.mock_dir
+    Dir.pwd.should == DirSpecs.mock_dir
+  end
+  
+  it "returns 0 when successfully changing directory" do
+    Dir.chdir(@original).should == 0
+  end
+  
+  it "returns the value of the block when a block is given" do
+    Dir.chdir(@original) { :block_value }.should == :block_value
+  end
+  
+  it "changes to the specified directory for the duration of the block" do
+    ar = Dir.chdir(DirSpecs.mock_dir) { |dir| [dir, Dir.pwd] }
+    ar.should == [DirSpecs.mock_dir, DirSpecs.mock_dir]
+
+    Dir.pwd.should == @original
+  end
+  
+  it "raises a SystemCallError if the directory does not exist" do
+    lambda { Dir.chdir DirSpecs.nonexistent }.should raise_error(SystemCallError)
+    lambda { Dir.chdir(DirSpecs.nonexistent) { } }.should raise_error(SystemCallError)
+  end
+
+  it "raises a SystemCallError if the original directory no longer exists" do
+    dir1 = tmp('/testdir1')
+    dir2 = tmp('/testdir2')
+    File.exist?(dir1).should == false
+    File.exist?(dir2).should == false
+    Dir.mkdir dir1
+    Dir.mkdir dir2
+    begin
+      lambda {
+        Dir.chdir dir1 do
+          Dir.chdir(dir2) { Dir.unlink dir1 }
+        end
+      }.should raise_error(SystemCallError)
+    ensure
+      Dir.unlink dir1 if File.exist?(dir1)
+      Dir.unlink dir2 if File.exist?(dir2)
+    end
+  end
+
+  it "always returns to the original directory when given a block" do
+    begin
+      Dir.chdir(DirSpecs.mock_dir) do
+        raise StandardError, "something bad happened"
+      end
+    rescue StandardError
+    end
+
+    Dir.pwd.should == @original
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/dir/chroot_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/chroot_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/chroot_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+
+# Need special perms to run chroot
+# describe "Dir.chroot" do
+#   it 'Dir.chroot can be used to change the process\' root directory, see chroot(2)' do
+#     example do
+#      Kernel.fork {
+#        begin
+#          ret = Dir.chroot mock_dir
+#          File.open('/root_contents.txt', 'wb') {|f| f.puts ret; f.puts Dir.entries('/').sort}
+#          FileUtils.chmod 0777, '/root_contents.txt'
+#        rescue SystemCallError
+#          warn '**WARN: Insufficient permissions to test Dir.chroot! (Not a huge problem.)'
+#        end
+#      }
+# 
+#      Process.waitall
+# 
+#      contents = File.read "#{mock_dir}/root_contents.txt"
+#      FileUtils.rm "#{mock_dir}/root_contents.txt"
+# 
+#      # Should have the return value + the filenames
+#      contents.split("\n").sort
+#     end.should == %w|0 . .. .dotfile .dotsubdir subdir_one subdir_two deeply nondotfile file_one.ext file_two.ext root_contents.txt|.sort
+#   end
+# end

Added: MacRuby/branches/experimental/spec/frozen/core/dir/close_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/close_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/close_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+require File.dirname(__FILE__) + '/shared/closed'
+
+describe "Dir#close" do
+  platform_is_not :windows do
+  it "closes the stream and fd and returns nil" do
+    # This is a bit convoluted but we are trying to ensure the file gets closed.
+    # To do that, we peek to see what the next FD number is and then probe that
+    # to see whether it has been closed.
+    peek = IO.sysopen DirSpecs.mock_dir
+    File.for_fd(peek).close
+
+    dir = Dir.open DirSpecs.mock_dir
+    File.for_fd(peek).close                   # Should be open here
+
+    dir.close.should == nil
+    lambda { File.for_fd(peek).close }.should raise_error(SystemCallError)  # And closed here
+    end
+  end
+end
+
+describe "Dir#close" do
+  it_behaves_like :dir_closed, :close
+end

Added: MacRuby/branches/experimental/spec/frozen/core/dir/delete_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/delete_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/delete_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+require File.dirname(__FILE__) + '/shared/delete'
+
+describe "Dir.delete" do
+  it_behaves_like :dir_delete, :delete
+end

Added: MacRuby/branches/experimental/spec/frozen/core/dir/dir_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/dir_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/dir_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Dir" do
+  it "includes Enumerable" do
+    Dir.include?(Enumerable).should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/dir/each_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/each_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/each_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+require File.dirname(__FILE__) + '/shared/closed'
+
+describe "Dir#each" do
+  before(:each) do
+    @dir = Dir.open DirSpecs.mock_dir
+  end
+  
+  after(:each) do
+    @dir.close
+  end
+
+  it "yields each directory entry in succession" do
+    a = []
+    @dir.each {|dir| a << dir}
+
+    a.sort.should == DirSpecs.expected_paths
+  end
+
+  it "returns the directory which remains open" do
+    # an FS does not necessarily impose order
+    ls = Dir.entries(DirSpecs.mock_dir)
+    @dir.each {}.should == @dir
+    @dir.read.should == nil
+    @dir.rewind
+    ls.should include(@dir.read)
+  end
+end
+
+describe "Dir#each" do
+  it_behaves_like :dir_closed, :each
+end

Added: MacRuby/branches/experimental/spec/frozen/core/dir/element_reference_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/element_reference_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/element_reference_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+require File.dirname(__FILE__) + '/shared/glob'
+
+describe "Dir.[]" do
+  it_behaves_like :dir_glob, :[]
+end
+
+describe "Dir.[]" do
+  it_behaves_like :dir_glob_recursive, :[]
+end

Added: MacRuby/branches/experimental/spec/frozen/core/dir/entries_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/entries_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/entries_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+
+describe "Dir.entries" do
+  it "returns an Array of filenames in an existing directory including dotfiles" do
+    a = Dir.entries(DirSpecs.mock_dir).sort
+
+    a.should == DirSpecs.expected_paths
+
+    a = Dir.entries("#{DirSpecs.mock_dir}/deeply/nested").sort
+    a.should == %w|. .. .dotfile.ext directory|
+  end
+  
+  it "raises a SystemCallError if called with a nonexistent diretory" do
+    lambda { Dir.entries DirSpecs.nonexistent }.should raise_error(SystemCallError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/dir/fixtures/common.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/fixtures/common.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/fixtures/common.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,111 @@
+require 'fileutils'
+
+module DirSpecs
+  def DirSpecs.mock_dir
+    unless defined? @mock_dir then
+      @mock_dir = File.expand_path(tmp('mock'))
+    end
+
+    @mock_dir
+  end
+
+  def DirSpecs.nonexistent
+    name = mock_dir + "/nonexistent00"
+    name = name.next while File.exist? name
+    name
+  end
+
+  def DirSpecs.clear_dirs
+    old_kcode, $KCODE = $KCODE, 'u'
+    ['nonexisting', 'default_perms','reduced', 'always_returns_0', '???', [0xe9].pack('U')].each do |dir|
+      begin
+        Dir.rmdir dir
+      rescue
+      end
+    end
+  end
+
+  def DirSpecs.create_mock_dirs
+    mock_dir = self.mock_dir
+    files = %w[
+      .dotfile
+      .dotsubdir/.dotfile
+      .dotsubdir/nondotfile
+
+      deeply/.dotfile
+      deeply/nested/.dotfile.ext
+      deeply/nested/directory/structure/.ext
+      deeply/nested/directory/structure/bar
+      deeply/nested/directory/structure/baz
+      deeply/nested/directory/structure/file_one
+      deeply/nested/directory/structure/file_one.ext
+      deeply/nested/directory/structure/foo
+      deeply/nondotfile
+
+      file_one.ext
+      file_two.ext
+
+      dir_filename_ordering
+      dir/filename_ordering
+
+      nondotfile
+
+      subdir_one/.dotfile
+      subdir_one/nondotfile
+      subdir_two/nondotfile
+      subdir_two/nondotfile.ext
+
+      special/+
+
+      special/^
+      special/$
+
+      special/(
+      special/)
+      special/[
+      special/]
+      special/{
+      special/}
+    ]
+
+    platform_is_not :windows do
+      files += %w[
+        special/*
+        special/?
+
+        special/|
+      ]
+    end
+    
+    umask = File.umask 0
+    FileUtils.rm_rf mock_dir
+    files.each do |file|
+      file = File.join mock_dir, file
+      FileUtils.mkdir_p File.dirname(file)
+      FileUtils.touch file
+    end
+    File.umask umask
+  end
+
+  def self.expected_paths
+    %w[
+      .
+      ..
+      .dotfile
+      .dotsubdir
+      deeply
+      dir
+      dir_filename_ordering
+      file_one.ext
+      file_two.ext
+      nondotfile
+      special
+      subdir_one
+      subdir_two
+    ]
+  end
+
+end
+
+# Create the fixture directories every time the specs are run
+DirSpecs.create_mock_dirs

Added: MacRuby/branches/experimental/spec/frozen/core/dir/foreach_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/foreach_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/foreach_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+
+describe "Dir.foreach" do
+  it "yields all names in an existing directory to the provided block" do
+    a, b = [], []
+
+    Dir.foreach(DirSpecs.mock_dir) {|f| a << f}
+    Dir.foreach("#{DirSpecs.mock_dir}/deeply/nested") {|f| b << f}
+
+    a.sort.should == DirSpecs.expected_paths
+    b.sort.should == %w|. .. .dotfile.ext directory|
+  end
+
+  it "returns nil when successful" do
+    Dir.foreach(DirSpecs.mock_dir) {|f| f}.should == nil
+  end
+
+  it "raises a SystemCallError if passed a nonexistent directory" do
+    lambda { Dir.foreach(DirSpecs.nonexistent) {} }.should raise_error(SystemCallError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/dir/getwd_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/getwd_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/getwd_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+require File.dirname(__FILE__) + '/shared/pwd'
+
+describe "Dir.pwd" do
+  it_behaves_like :dir_pwd, :getwd
+end

Added: MacRuby/branches/experimental/spec/frozen/core/dir/glob_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/glob_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/glob_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,83 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+require File.dirname(__FILE__) + '/shared/glob'
+
+describe "Dir.glob" do
+  it_behaves_like :dir_glob, :glob
+end
+
+describe "Dir.glob" do
+  it_behaves_like :dir_glob_recursive, :[]
+end
+
+describe "Dir.glob" do
+  before(:all) do
+    @cwd = Dir.pwd
+
+    Dir.chdir DirSpecs.mock_dir
+  end
+
+  after(:all) do
+    Dir.chdir @cwd
+  end
+
+  it "matches both dot and non-dotfiles with '*' and option File::FNM_DOTMATCH" do
+    Dir.glob('*', File::FNM_DOTMATCH).sort.should == DirSpecs.expected_paths
+  end
+
+  it "matches files with any beginning with '*<non-special characters>' and option File::FNM_DOTMATCH" do
+    Dir.glob('*file', File::FNM_DOTMATCH).sort.should == %w|.dotfile nondotfile|.sort
+  end
+
+  it "matches any files in the current directory with '**' and option File::FNM_DOTMATCH" do
+    Dir.glob('**', File::FNM_DOTMATCH).sort.should == DirSpecs.expected_paths
+  end
+
+  it "recursively matches any subdirectories except './' or '../' with '**/' and option File::FNM_DOTMATCH" do
+    expected = %w[
+      .dotsubdir/
+      deeply/
+      deeply/nested/
+      deeply/nested/directory/
+      deeply/nested/directory/structure/
+      dir/
+      special/
+      subdir_one/
+      subdir_two/
+    ]
+
+    Dir.glob('**/', File::FNM_DOTMATCH).sort.should == expected
+  end
+  
+  platform_is_not(:windows) do
+    it "matches the literal character '\\' with option File::FNM_NOESCAPE" do
+      Dir.mkdir 'foo?bar'
+
+      begin
+        Dir.glob('foo?bar', File::FNM_NOESCAPE).should == %w|foo?bar|
+        Dir.glob('foo\?bar', File::FNM_NOESCAPE).should == []
+      ensure
+        Dir.rmdir 'foo?bar'
+      end
+
+      Dir.mkdir 'foo\?bar'
+
+      begin
+        Dir.glob('foo\?bar', File::FNM_NOESCAPE).should == %w|foo\\?bar|
+      ensure
+        Dir.rmdir 'foo\?bar'
+      end
+    end
+
+    it "returns nil for directories current user has no permission to read" do
+      Dir.mkdir('no_permission')
+      File.chmod(0, 'no_permission')
+
+      begin
+        Dir.glob('no_permission/*').should == []
+      ensure
+        Dir.rmdir('no_permission')
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/dir/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'

Added: MacRuby/branches/experimental/spec/frozen/core/dir/mkdir_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/mkdir_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/mkdir_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,58 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+
+describe "Dir.mkdir" do
+  it "creates the named directory with the given permissions" do
+    DirSpecs.clear_dirs
+
+    begin
+      File.exist?('nonexisting').should == false
+      Dir.mkdir 'nonexisting'
+      File.exist?('nonexisting').should == true
+      platform_is_not :windows do
+        Dir.mkdir 'default_perms'
+        a = File.stat('default_perms').mode
+        Dir.mkdir 'reduced', (a - 1)
+        File.stat('reduced').mode.should_not == a
+      end
+      platform_is :windows do
+        Dir.mkdir 'default_perms', 0666
+        a = File.stat('default_perms').mode
+        Dir.mkdir 'reduced', 0444
+        File.stat('reduced').mode.should_not == a
+      end
+
+      Dir.mkdir('always_returns_0').should == 0
+      platform_is_not(:windows) do
+        File.chmod(0777, "nonexisting","default_perms","reduced","always_returns_0")
+      end
+      platform_is_not(:windows) do
+        File.chmod(0644, "nonexisting","default_perms","reduced","always_returns_0")
+      end
+    ensure
+      DirSpecs.clear_dirs
+    end
+  end
+
+  it "raises a SystemCallError when lacking adequate permissions in the parent dir" do
+    # In case something happened it it didn't get cleaned up.
+      FileUtils.rm_rf 'noperms' if File.directory? 'noperms'
+
+    Dir.mkdir 'noperms', 0000
+
+    lambda { Dir.mkdir 'noperms/subdir' }.should raise_error(SystemCallError)
+
+    system 'chmod 0777 noperms'
+    platform_is_not :windows do
+      File.chmod 0777, "noperms"
+    end
+    platform_is :windows do
+      File.chmod 0666, "noperms"
+    end
+    Dir.rmdir 'noperms'
+  end
+
+  it "raises a SystemCallError if any of the directories in the path before the last does not exist" do
+    lambda { Dir.mkdir "#{DirSpecs.nonexistent}/subdir" }.should raise_error(SystemCallError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/dir/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'

Added: MacRuby/branches/experimental/spec/frozen/core/dir/open_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/open_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/open_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+require File.dirname(__FILE__) + '/shared/open'
+
+describe "Dir.open" do
+  it_behaves_like :dir_open, :open
+end

Added: MacRuby/branches/experimental/spec/frozen/core/dir/path_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/path_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/path_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+require File.dirname(__FILE__) + '/shared/closed'
+
+describe "Dir#path" do
+  it "returns the path that was supplied to .new or .open" do
+    dir = Dir.open DirSpecs.mock_dir
+    dir.path.should == DirSpecs.mock_dir
+    dir.close rescue nil
+  end
+end
+
+describe "Dir#path" do
+  ruby_version_is ""..."1.8.7" do
+    it "raises an IOError when called on a closed Dir instance" do
+      lambda {
+        dir = Dir.open DirSpecs.mock_dir
+        dir.close
+        dir.path
+      }.should raise_error(IOError)
+    end
+  end
+
+  ruby_version_is "1.8.7" do
+    it "returns the path even when called on a closed Dir instance" do
+      dir = Dir.open DirSpecs.mock_dir
+      dir.close
+      dir.path.should == DirSpecs.mock_dir
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/dir/pos_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/pos_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/pos_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+require File.dirname(__FILE__) + '/shared/closed'
+require File.dirname(__FILE__) + '/shared/pos'
+
+describe "Dir#pos" do
+  it_behaves_like :dir_pos, :pos
+end
+
+describe "Dir#pos" do
+  it_behaves_like :dir_closed, :pos
+end
+
+describe "Dir#pos=" do
+  it_behaves_like :dir_pos_set, :pos=
+end

Added: MacRuby/branches/experimental/spec/frozen/core/dir/pwd_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/pwd_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/pwd_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+require File.dirname(__FILE__) + '/shared/pwd'
+
+describe "Dir.pwd" do
+  it_behaves_like :dir_pwd, :pwd
+  
+  it "correctly displays dirs with unicode characters in them" do
+    DirSpecs.clear_dirs
+
+    begin
+      old_kcode, $KCODE=$KCODE,'u'
+      str = [0xe9].pack 'U' #Unicode \xE9
+      Dir.mkdir str
+      File.exist?(str).should == true
+
+      old_pwd = Dir.pwd
+      Dir.chdir(str) { Dir.pwd.should == File.join(old_pwd, str) }
+    ensure
+      DirSpecs.clear_dirs
+      $KCODE=old_kcode
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/dir/read_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/read_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/read_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+require File.dirname(__FILE__) + '/shared/closed'
+
+describe "Dir#read" do
+  it "returns the file name in the current seek position" do
+    # an FS does not necessarily impose order
+    ls = Dir.entries DirSpecs.mock_dir
+    dir = Dir.open DirSpecs.mock_dir
+    ls.should include(dir.read)
+    dir.close
+  end
+end
+
+describe "Dir#read" do
+  it_behaves_like :dir_closed, :read
+end

Added: MacRuby/branches/experimental/spec/frozen/core/dir/rewind_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/rewind_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/rewind_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,37 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+require File.dirname(__FILE__) + '/shared/closed'
+
+describe "Dir#rewind" do
+  before(:each) do
+    @dir = Dir.open DirSpecs.mock_dir
+  end
+
+  after(:each) do
+    @dir.close
+  end
+
+  it "resets the next read to start from the first entry" do
+    first   = @dir.pos
+    a       = @dir.read
+    b       = @dir.read
+    prejmp  = @dir.pos
+    ret     = @dir.rewind
+    second  = @dir.pos
+    c       = @dir.read
+
+    a.should_not == b
+    b.should_not == c
+    c.should     == a
+
+    second.should_not == prejmp
+  end
+
+  it "returns the Dir instance" do
+    @dir.rewind.should == @dir
+  end
+end
+
+describe "Dir#rewind" do
+  it_behaves_like :dir_closed, :rewind
+end

Added: MacRuby/branches/experimental/spec/frozen/core/dir/rmdir_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/rmdir_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/rmdir_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+require File.dirname(__FILE__) + '/shared/delete'
+
+describe "Dir.rmdir" do
+  it_behaves_like :dir_delete, :rmdir
+end

Added: MacRuby/branches/experimental/spec/frozen/core/dir/seek_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/seek_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/seek_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+require File.dirname(__FILE__) + '/shared/pos'
+
+describe "Dir#seek" do
+  it "returns the Dir instance" do
+    @dir.seek(@dir.pos).should == @dir
+  end
+
+  it_behaves_like :dir_pos_set, :seek
+end

Added: MacRuby/branches/experimental/spec/frozen/core/dir/shared/closed.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/shared/closed.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/shared/closed.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+describe :dir_closed, :shared => true do
+  it "raises an IOError when called on a closed Dir instance" do
+    lambda {
+      dir = Dir.open DirSpecs.mock_dir
+      dir.close
+      dir.send(@method) {}
+    }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/dir/shared/delete.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/shared/delete.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/shared/delete.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+describe :dir_delete, :shared => true do
+  it "removes empty directories" do
+    Dir.mkdir 'empty_subdir'
+    Dir.send(@method, 'empty_subdir').should == 0
+  end
+
+  it "raises a SystemCallError when trying to remove a nonempty directory" do
+    lambda { Dir.send @method, 'subdir_one' }.should raise_error(SystemCallError)
+  end
+
+  it "raises a SystemCallError if lacking adequate permissions to remove the directory" do
+    FileUtils.mkdir_p("noperm_#{@method}/child")
+    File.chmod(0000, "noperm_#{@method}")
+
+    lambda { Dir.send @method, "noperm_#{@method}/child" }.should raise_error(SystemCallError)
+
+    platform_is_not(:windows) do
+    system "chmod 0777 noperm_#{@method}"
+    end
+    platform_is(:windows) do
+      File.chmod(0666, "noperm_#{@method}")
+    end
+    Dir.rmdir "noperm_#{@method}/child"
+    Dir.rmdir "noperm_#{@method}"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/dir/shared/glob.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/shared/glob.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/shared/glob.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,253 @@
+describe :dir_glob, :shared => true do
+  before(:all) do
+    @cwd = Dir.pwd
+    Dir.chdir DirSpecs.mock_dir
+  end
+
+  after(:all) do
+    Dir.chdir @cwd
+  end
+
+  it "converts patterns with to_str" do
+    obj = mock('file_one.ext')
+    obj.should_receive(:to_str).and_return('file_one.ext')
+
+    Dir.send(@method, obj).should == %w[file_one.ext]
+  end
+
+  it "matches non-dotfiles with '*'" do
+    expected = %w[
+      deeply
+      dir
+      dir_filename_ordering
+      file_one.ext
+      file_two.ext
+      nondotfile
+      special
+      subdir_one
+      subdir_two
+    ]
+
+    Dir.send(@method,'*').sort.should == expected
+  end
+
+  it "returns empty array when empty pattern provided" do
+    Dir.send(@method, '').should == []
+  end
+
+  it "matches regexp special +" do
+    Dir.send(@method, 'special/+').should == ['special/+']
+  end
+
+  platform_is_not :windows do
+    it "matches regexp special *" do
+      Dir.send(@method, 'special/\*').should == ['special/*']
+    end
+
+    it "matches regexp special ?" do
+      Dir.send(@method, 'special/\?').should == ['special/?']
+    end
+
+    it "matches regexp special |" do
+      Dir.send(@method, 'special/|').should == ['special/|']
+    end
+  end
+
+  it "matches regexp special ^" do
+    Dir.send(@method, 'special/^').should == ['special/^']
+  end
+
+  it "matches regexp special $" do
+    Dir.send(@method, 'special/$').should == ['special/$']
+  end
+
+  it "matches regexp special (" do
+    Dir.send(@method, 'special/(').should == ['special/(']
+  end
+
+  it "matches regexp special )" do
+    Dir.send(@method, 'special/)').should == ['special/)']
+  end
+
+  it "matches regexp special [" do
+    Dir.send(@method, 'special/\[').should == ['special/[']
+  end
+
+  it "matches regexp special ]" do
+    Dir.send(@method, 'special/]').should == ['special/]']
+  end
+
+  it "matches regexp special {" do
+    Dir.send(@method, 'special/\{').should == ['special/{']
+  end
+
+  it "matches regexp special }" do
+    Dir.send(@method, 'special/\}').should == ['special/}']
+  end
+
+  it "matches dotfiles with '.*'" do
+    Dir.send(@method, '.*').sort.should == %w|. .. .dotfile .dotsubdir|.sort
+  end
+
+  it "matches non-dotfiles with '*<non-special characters>'" do
+    Dir.send(@method, '*file').sort.should == %w|nondotfile|.sort
+  end
+
+  it "matches dotfiles with '.*<non-special characters>'" do
+    Dir.send(@method, '.*file').sort.should == %w|.dotfile|.sort
+  end
+
+  it "matches files with any ending with '<non-special characters>*'" do
+    Dir.send(@method, 'file*').sort.should == %w|file_one.ext file_two.ext|.sort
+  end
+
+  it "matches files with any middle with '<non-special characters>*<non-special characters>'" do
+    Dir.send(@method, 'sub*_one').sort.should == %w|subdir_one|.sort
+  end
+
+  it "matches files with multiple '*' special characters" do
+    Dir.send(@method, '*fi*e*').sort.should == %w|dir_filename_ordering nondotfile file_one.ext file_two.ext|.sort
+  end
+
+  it "matches non-dotfiles in the current directory with '**'" do
+    expected = %w[
+      deeply
+      dir
+      dir_filename_ordering
+      file_one.ext
+      file_two.ext
+      nondotfile
+      special
+      subdir_one
+      subdir_two
+    ]
+
+    Dir.send(@method, '**').sort.should == expected
+  end
+
+  it "matches dotfiles in the current directory with '.**'" do
+    Dir.send(@method, '.**').sort.should == %w|. .. .dotsubdir .dotfile|.sort
+  end
+
+  it "recursively matches any nondot subdirectories with '**/'" do
+    expected = %w[
+      deeply/
+      deeply/nested/
+      deeply/nested/directory/
+      deeply/nested/directory/structure/
+      dir/
+      special/
+      subdir_one/
+      subdir_two/
+    ]
+
+    Dir.send(@method, '**/').sort.should == expected
+  end
+
+  it "recursively matches any subdirectories including ./ and ../ with '.**/'" do
+    Dir.chdir("#{DirSpecs.mock_dir}/subdir_one") do
+      Dir.send(@method, '.**/').sort.should == %w|./ ../|.sort
+    end
+  end
+
+  it "matches a single character except leading '.' with '?'" do
+    Dir.send(@method, '?ubdir_one').sort.should == %w|subdir_one|.sort
+  end
+
+  it "accepts multiple '?' characters in a pattern" do
+    Dir.send(@method, 'subdir_???').sort.should == %w|subdir_one subdir_two|.sort
+  end
+
+  it "matches any characters in a set with '[<characters>]'" do
+    Dir.send(@method, '[stfu]ubdir_one').sort.should == %w|subdir_one|.sort
+  end
+
+  it "matches any characters in a range with '[<character>-<character>]'" do
+    Dir.send(@method, '[a-zA-Z]ubdir_one').sort.should == %w|subdir_one|.sort
+  end
+
+  it "matches any characters except those in a set with '[^<characters>]'" do
+    Dir.send(@method, '[^wtf]ubdir_one').sort.should == %w|subdir_one|.sort
+  end
+
+  it "matches any characters except those in a range with '[^<character>-<character]'" do
+    Dir.send(@method, '[^0-9]ubdir_one').sort.should == %w|subdir_one|.sort
+  end
+
+  it "matches any one of the strings in a set with '{<string>,<other>,...}'" do
+    Dir.send(@method, 'subdir_{one,two,three}').sort.should == %w|subdir_one subdir_two|.sort
+  end
+
+  it "accepts string sets with empty strings with {<string>,,<other>}" do
+    a = Dir.send(@method, 'deeply/nested/directory/structure/file_one{.ext,}').sort
+    a.should == %w|deeply/nested/directory/structure/file_one.ext
+                   deeply/nested/directory/structure/file_one|.sort
+  end
+
+  it "matches dot or non-dotfiles with '{,.}*'" do
+    Dir.send(@method, '{,.}*').sort.should == DirSpecs.expected_paths
+  end
+
+  it "matches special characters by escaping with a backslash with '\\<character>'" do
+    Dir.mkdir 'foo^bar'
+
+    begin
+      Dir.glob('foo?bar').should == %w|foo^bar|
+      Dir.glob('foo\?bar').should == []
+      Dir.glob('nond\otfile').should == %w|nondotfile|
+    ensure
+      Dir.rmdir 'foo^bar'
+    end
+  end
+
+  it "recursively matches directories with '**/<characters>'" do
+    Dir.send(@method, '**/*fil?{,.}*').uniq.sort.should ==
+      %w[deeply/nested/directory/structure/file_one
+         deeply/nested/directory/structure/file_one.ext
+         deeply/nondotfile
+
+         dir/filename_ordering
+         dir_filename_ordering
+
+         file_one.ext
+         file_two.ext
+
+         nondotfile
+
+         subdir_one/nondotfile
+         subdir_two/nondotfile
+         subdir_two/nondotfile.ext]
+  end
+end
+
+describe :dir_glob_recursive, :shared => true do
+  before(:all) do
+    @cwd = Dir.pwd
+    @mock_dir = File.expand_path tmp('dir_glob_mock')
+
+    %w[
+      a/x/b/y/e
+      a/x/b/y/b/z/e
+    ].each do |path|
+      file = File.join @mock_dir, path
+      FileUtils.mkdir_p File.dirname(file)
+      FileUtils.touch file
+    end
+
+    Dir.chdir @mock_dir
+  end
+
+  after(:all) do
+    Dir.chdir @cwd
+    FileUtils.rm_r @mock_dir
+  end
+
+  it "matches multiple recursives" do
+    expected = %w[
+      a/x/b/y/b/z/e
+      a/x/b/y/e
+    ]
+
+    Dir.send(@method, 'a/**/b/**/e').uniq.sort.should == expected
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/dir/shared/open.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/shared/open.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/shared/open.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,39 @@
+describe :dir_open, :shared => true do
+  it "returns a Dir instance representing the specified directory" do
+    dir = Dir.send(@method, DirSpecs.mock_dir)
+    dir.class.should == Dir
+    dir.close
+  end
+
+  it "raises a SystemCallError if the directory does not exist" do
+    lambda do
+      Dir.send @method, DirSpecs.nonexistent
+    end.should raise_error(SystemCallError)
+  end
+
+  it "may take a block which is yielded to with the Dir instance" do
+    Dir.send(@method, DirSpecs.mock_dir) {|dir| dir.class.should == Dir }
+  end
+
+  it "returns the value of the block if a block is given" do
+    Dir.open(DirSpecs.mock_dir) {|dir| :value }.should == :value
+  end
+
+  it "closes the Dir instance when the block exits if given a block" do
+    closed_dir = Dir.send(@method, DirSpecs.mock_dir) { |dir| dir }
+    lambda { closed_dir.close }.should raise_error(IOError)
+  end
+
+  it "closes the Dir instance when the block exits the block even due to an exception" do
+    @closed_dir = nil
+
+    lambda do
+      Dir.send(@method, DirSpecs.mock_dir) do |dir|
+        @closed_dir = dir
+        raise
+      end
+    end.should raise_error
+
+    lambda { @closed_dir.close }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/dir/shared/pos.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/shared/pos.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/shared/pos.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,51 @@
+describe :dir_pos, :shared => true do
+  before :each do
+    @dir = Dir.open DirSpecs.mock_dir
+  end
+
+  after :each do
+    @dir.close rescue nil
+  end
+
+  it "returns an Integer representing the current position in the directory" do
+    @dir.send(@method).should be_kind_of(Integer)
+    @dir.send(@method).should be_kind_of(Integer)
+    @dir.send(@method).should be_kind_of(Integer)
+  end
+
+  it "returns a different Integer if moved from previous position" do
+    a = @dir.send(@method)
+    @dir.read
+    b = @dir.send(@method)
+
+    a.should be_kind_of(Integer)
+    b.should be_kind_of(Integer)
+
+    a.should_not == b
+  end
+end
+
+describe :dir_pos_set, :shared => true do
+  before(:each) do
+    @dir = Dir.open DirSpecs.mock_dir
+  end
+
+  after(:each) do
+    @dir.close
+  end
+  
+  # NOTE: #seek/#pos= to a position not returned by #tell/#pos is undefined
+  # and should not be spec'd.
+
+  it "moves the read position to a previously obtained position" do
+    pos = @dir.pos
+    a   = @dir.read
+    b   = @dir.read
+    ret = @dir.send @method, pos
+    c   = @dir.read
+
+    a.should_not == b
+    b.should_not == c
+    c.should     == a
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/dir/shared/pwd.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/shared/pwd.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/shared/pwd.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+describe :dir_pwd, :shared => true do
+  it "returns the current working directory" do
+    # On ubuntu gutsy, for example, /bin/pwd does not
+    # understand -P. With just `pwd -P`, /bin/pwd is run.
+    
+    # The following uses inode rather than file names to account for
+    # case insensitive file systems like default OS/X file systems
+    platform_is_not :windows do
+    File.stat(Dir.send(@method)).ino.should == File.stat(`/bin/sh -c "pwd -P"`.chomp).ino
+    end
+    platform_is :windows do
+      File.stat(Dir.send(@method)).ino.should == File.stat(File.expand_path(`cd`.chomp)).ino
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/dir/tell_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/tell_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/tell_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+require File.dirname(__FILE__) + '/shared/closed'
+require File.dirname(__FILE__) + '/shared/pos'
+
+describe "Dir#tell" do
+  it_behaves_like :dir_pos, :tell
+end
+
+describe "Dir#tell" do
+  it_behaves_like :dir_closed, :tell
+end

Added: MacRuby/branches/experimental/spec/frozen/core/dir/unlink_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/unlink_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/unlink_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+require File.dirname(__FILE__) + '/shared/delete'
+
+describe "Dir.unlink" do
+  it_behaves_like :dir_delete, :unlink
+end

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/all_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/all_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/all_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,115 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Enumerable#all?" do
+
+  before :each do
+    @enum = EnumerableSpecs::Numerous.new
+    @empty = EnumerableSpecs::Empty.new()
+    @enum1 = [0, 1, 2, -1]
+    @enum2 = [nil, false, true]
+  end
+
+  it "always returns true on empty enumeration" do
+    @empty.all?.should == true
+    @empty.all? { nil }.should == true
+
+    [].all?.should == true
+    [].all? { false }.should == true
+
+    {}.all?.should == true
+    {}.all? { nil }.should == true
+  end
+
+  it "raises an ArgumentError when any arguments provided" do
+    lambda { @enum.all?(Proc.new {}) }.should raise_error(ArgumentError)
+    lambda { @enum.all?(nil) }.should raise_error(ArgumentError)
+    lambda { @empty.all?(1) }.should raise_error(ArgumentError)
+    lambda { @enum1.all?(1) {} }.should raise_error(ArgumentError)
+    lambda { @enum2.all?(1, 2, 3) {} }.should raise_error(ArgumentError)
+  end
+
+  it "raises NoMethodError if there is no #each method defined" do
+    lambda { EnumerableSpecs::NoEach.new.all? }.should raise_error(NoMethodError)
+    lambda { EnumerableSpecs::NoEach.new.all? {} }.should raise_error(NoMethodError)
+  end
+
+  it "does not hide exceptions out of #each" do
+    lambda {
+      EnumerableSpecs::ThrowingEach.new.all?
+    }.should raise_error(RuntimeError)
+
+    lambda {
+      EnumerableSpecs::ThrowingEach.new.all? { false }
+    }.should raise_error(RuntimeError)
+  end
+
+  describe "with no block" do
+    it "returns true if no elements are false or nil" do
+      @enum.all?.should == true
+      @enum1.all?.should == true
+      @enum2.all?.should == false
+
+      EnumerableSpecs::Numerous.new('a','b','c').all?.should == true
+      EnumerableSpecs::Numerous.new(0, "x", true).all?.should == true
+    end
+
+    it "returns false if there are false or nil elements" do
+      EnumerableSpecs::Numerous.new(false).all?.should == false
+      EnumerableSpecs::Numerous.new(false, false).all?.should == false
+
+      EnumerableSpecs::Numerous.new(nil).all?.should == false
+      EnumerableSpecs::Numerous.new(nil, nil).all?.should == false
+
+      EnumerableSpecs::Numerous.new(1, nil, 2).all?.should == false
+      EnumerableSpecs::Numerous.new(0, "x", false, true).all?.should == false
+      @enum2.all?.should == false
+    end
+  end
+
+  describe "with block" do
+    it "returns true if the block never returns false or nil" do
+      @enum.all? { true }.should == true
+      @enum1.all?{ |o| o < 5 }.should == true
+      @enum1.all?{ |o| 5 }.should == true
+    end
+
+    it "returns false if the block ever returns false or nil" do
+      @enum.all? { false }.should == false
+      @enum.all? { nil }.should == false
+      @enum1.all?{ |o| o > 2 }.should == false
+
+      EnumerableSpecs::Numerous.new.all? { |i| i > 5 }.should == false
+      EnumerableSpecs::Numerous.new.all? { |i| i == 3 ? nil : true }.should == false
+    end
+
+    it "stops iterating once the return value is determined" do
+      yielded = []
+      EnumerableSpecs::Numerous.new(:one, :two, :three).all? do |e|
+        yielded << e
+        false
+      end.should == false
+      yielded.should == [:one]
+
+      yielded = []
+      EnumerableSpecs::Numerous.new(true, true, false, true).all? do |e|
+        yielded << e
+        e
+      end.should == false
+      yielded.should == [true, true, false]
+
+      yielded = []
+      EnumerableSpecs::Numerous.new(1, 2, 3, 4, 5).all? do |e|
+        yielded << e
+        e
+      end.should == true
+      yielded.should == [1, 2, 3, 4, 5]
+    end
+
+    it "does not hide exceptions out of the block" do
+      lambda {
+        @enum.all? { raise "from block" }
+      }.should raise_error(RuntimeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/any_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/any_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/any_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,128 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Enumerable#any?" do
+  before :each do
+    @enum = EnumerableSpecs::Numerous.new
+    @empty = EnumerableSpecs::Empty.new()
+    @enum1 = [0, 1, 2, -1]
+    @enum2 = [nil, false, true]
+  end
+
+  it "always returns false on empty enumeration" do
+    @empty.any?.should == false
+    @empty.any? { nil }.should == false
+
+    [].any?.should == false
+    [].any? { false }.should == false
+
+    {}.any?.should == false
+    {}.any? { nil }.should == false
+  end
+
+  it "raises an ArgumentError when any arguments provided" do
+    lambda { @enum.any?(Proc.new {}) }.should raise_error(ArgumentError)
+    lambda { @enum.any?(nil) }.should raise_error(ArgumentError)
+    lambda { @empty.any?(1) }.should raise_error(ArgumentError)
+    lambda { @enum1.any?(1) {} }.should raise_error(ArgumentError)
+    lambda { @enum2.any?(1, 2, 3) {} }.should raise_error(ArgumentError)
+  end
+
+  it "raises NoMethodError if there is no #each method defined" do
+    lambda { EnumerableSpecs::NoEach.new.any? }.should raise_error(NoMethodError)
+    lambda { EnumerableSpecs::NoEach.new.any? {} }.should raise_error(NoMethodError)
+  end
+
+  it "does not hide exceptions out of #each" do
+    lambda {
+      EnumerableSpecs::ThrowingEach.new.any?
+    }.should raise_error(RuntimeError)
+
+    lambda {
+      EnumerableSpecs::ThrowingEach.new.any? { false }
+    }.should raise_error(RuntimeError)
+  end
+
+  describe "with no block" do
+    it "returns true if any element is not false or nil" do
+      @enum.any?.should == true
+      @enum1.any?.should == true
+      @enum2.any?.should == true
+      EnumerableSpecs::Numerous.new(true).any?.should == true
+      EnumerableSpecs::Numerous.new('a','b','c').any?.should == true
+      EnumerableSpecs::Numerous.new('a','b','c', nil).any?.should == true
+      EnumerableSpecs::Numerous.new(1, nil, 2).any?.should == true
+      EnumerableSpecs::Numerous.new(1, false).any?.should == true
+      EnumerableSpecs::Numerous.new(false, nil, 1, false).any?.should == true
+      EnumerableSpecs::Numerous.new(false, 0, nil).any?.should == true
+    end
+
+    it "returns false if all elements are false or nil" do
+      EnumerableSpecs::Numerous.new(false).any?.should == false
+      EnumerableSpecs::Numerous.new(false, false).any?.should == false
+      EnumerableSpecs::Numerous.new(nil).any?.should == false
+      EnumerableSpecs::Numerous.new(nil, nil).any?.should == false
+      EnumerableSpecs::Numerous.new(nil, false, nil).any?.should == false
+    end
+  end
+
+  describe "with block" do
+    it "returns true if the block ever returns other than false or nil" do
+      @enum.any? { true } == true
+      @enum.any? { 0 } == true
+      @enum.any? { 1 } == true
+
+      @enum1.any? { Object.new } == true
+      @enum1.any?{ |o| o < 1 }.should == true
+      @enum1.any?{ |o| 5 }.should == true
+
+      @enum2.any? { |i| i == nil }.should == true
+    end
+
+    it "any? should return false if the block never returns other than false or nil" do
+      @enum.any? { false }.should == false
+      @enum.any? { nil }.should == false
+
+      @enum1.any?{ |o| o < -10 }.should == false
+      @enum1.any?{ |o| nil }.should == false
+
+      @enum2.any? { |i| i == :stuff }.should == false
+    end
+
+    it "stops iterating once the return value is determined" do
+      yielded = []
+      EnumerableSpecs::Numerous.new(:one, :two, :three).any? do |e|
+        yielded << e
+        false
+      end.should == false
+      yielded.should == [:one, :two, :three]
+
+      yielded = []
+      EnumerableSpecs::Numerous.new(true, true, false, true).any? do |e|
+        yielded << e
+        e
+      end.should == true
+      yielded.should == [true]
+
+      yielded = []
+      EnumerableSpecs::Numerous.new(false, nil, false, true, false).any? do |e|
+        yielded << e
+        e
+      end.should == true
+      yielded.should == [false, nil, false, true]
+
+      yielded = []
+      EnumerableSpecs::Numerous.new(1, 2, 3, 4, 5).any? do |e|
+        yielded << e
+        e
+      end.should == true
+      yielded.should == [1]
+    end
+
+    it "does not hide exceptions out of the block" do
+      lambda {
+        @enum.any? { raise "from block" }
+      }.should raise_error(RuntimeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/collect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/collect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/collect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/collect'
+
+describe "Enumerable#collect" do   
+  it_behaves_like(:enumerable_collect , :collect)
+
+  ruby_version_is "" ... "1.9" do
+    it "gathers whole arrays as elements when each yields multiple" do
+      multi = EnumerableSpecs::YieldsMulti.new
+      multi.collect {|e| e}.should == [[1,2],[3,4,5],[6,7,8,9]]
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "gathers initial args as elements when each yields multiple" do
+      multi = EnumerableSpecs::YieldsMulti.new
+      multi.collect {|e| e}.should == [1,3,6]
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/detect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/detect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/detect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/find'
+
+describe "Enumerable#detect" do
+  it_behaves_like(:enumerable_find , :detect) 
+end

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/each_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/each_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/each_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Enumerable.each" do    
+  it "is provided" do
+    EnumerableSpecs::Numerous.new.respond_to?(:each).should == true
+  end
+  
+  it "provides each element to the block" do 
+    @b=[]
+    EnumerableSpecs::Numerous.new.each { |i| @b << i }
+    @b.should == [2, 5, 3, 6, 1, 4]
+  end 
+end

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/each_with_index_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/each_with_index_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/each_with_index_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,37 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Enumerable#each_with_index" do
+
+  before :each do
+    @b = [2, 5, 3, 6, 1, 4]  
+  end 
+  
+  it "passes each element and its index to block" do
+    @a = []
+    EnumerableSpecs::Numerous.new.each_with_index { |o, i| @a << [o, i] }
+    @a.should == [[2, 0], [5, 1], [3, 2], [6, 3], [1, 4], [4, 5]]
+  end
+  
+  it "provides each element to the block" do  
+    acc = []
+    obj = EnumerableSpecs::EachDefiner.new()
+    res = obj.each_with_index {|a,i| acc << [a,i]}
+    acc.should == []
+    obj.should == res
+  end
+  
+  it "provides each element to the block and its index" do
+    acc = [] 
+    res = @b.each_with_index {|a,i| acc << [a,i]}
+    [[2, 0], [5, 1], [3, 2], [6, 3], [1, 4], [4, 5]].should == acc
+    @b.should == res
+  end
+
+  it "binds splat arguments properly" do
+    acc = []
+    res = @b.each_with_index { |*b| c,d = b; acc << c; acc << d }
+    [2, 0, 5, 1, 3, 2, 6, 3, 1, 4, 4, 5].should == acc
+    @b.should == res
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/entries_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/entries_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/entries_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/entries'
+
+describe "Enumerable#entries" do   
+  it_behaves_like(:enumerable_entries , :entries) 
+end

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/find_all_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/find_all_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/find_all_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/find_all'
+
+describe "Enumerable#find_all" do
+  it_behaves_like(:enumerable_find_all , :find_all) 
+end

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/find_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/find_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/find_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/find'
+
+describe "Enumerable#find" do
+  it_behaves_like(:enumerable_find , :find) 
+end

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,125 @@
+module EnumerableSpecs
+
+  class Numerous
+    include Enumerable
+    
+    def initialize(*list)
+      @list = list.empty? ? [2, 5, 3, 6, 1, 4] : list
+    end
+    
+    def each
+      @list.each { |i| yield i }
+    end      
+  end
+
+  class Empty
+    include Enumerable
+    def each
+    end
+  end
+
+  class ThrowingEach
+    include Enumerable
+    def each
+      raise "from each"
+    end
+  end
+
+  class NoEach
+    include Enumerable
+  end
+
+  # (Legacy form rubycon)
+  class EachDefiner
+
+    include Enumerable
+
+    attr_reader :arr
+
+    def initialize(*arr)
+      @arr = arr
+    end
+    
+    def each
+      i = 0
+      loop do
+        break if i == @arr.size
+        yield @arr[i]
+        i += 1
+      end
+    end
+
+  end 
+
+  class SortByDummy
+    def initialize(s)
+      @s = s
+    end
+
+    def s
+      @s
+    end
+  end
+
+  class ComparesByVowelCount
+    
+    attr_accessor :value, :vowels
+    
+    def self.wrap(*args)
+      args.map {|element| ComparesByVowelCount.new(element)}
+    end
+    
+    def initialize(string)
+      self.value = string
+      all_vowels = ['a', 'e' , 'i' , 'o', 'u']
+      self.vowels = string.gsub(/[^aeiou]/,'').size
+    end
+    
+    def <=>(other)
+      self.vowels <=> other.vowels
+    end
+    
+  end
+
+  class InvalidComparable
+    def <=>(other)
+      "Not Valid"
+    end
+  end
+
+  class ArrayConvertable
+    attr_accessor :called
+    def initialize(*values)
+      @values = values;
+    end
+    
+    def to_a
+      self.called = :to_a
+      @values
+    end
+    
+    def to_arr
+      self.called = :to_arr
+      @values
+    end
+  end
+
+  class Equals
+    def initialize(obj)
+      @obj = obj
+    end
+    def ==(other)
+      @obj == other
+    end
+  end
+
+  class YieldsMulti
+    include Enumerable
+    def each
+      yield 1,2
+      yield 3,4,5
+      yield 6,7,8,9
+    end
+  end
+
+end # EnumerableSpecs utility classes

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/grep_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/grep_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/grep_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Enumerable#grep" do
+  before(:each) do
+    @a = EnumerableSpecs::EachDefiner.new( 2, 4, 6, 8, 10)
+  end
+  
+  it "grep without a block should return an array of all elements === pattern" do
+    class EnumerableSpecGrep; def ===(obj); obj == '2'; end; end
+
+    EnumerableSpecs::Numerous.new('2', 'a', 'nil', '3', false).grep(EnumerableSpecGrep.new).should == ['2']
+  end
+  
+  it "grep with a block should return an array of elements === pattern passed through block" do
+    class EnumerableSpecGrep2; def ===(obj); /^ca/ =~ obj; end; end
+
+    EnumerableSpecs::Numerous.new("cat", "coat", "car", "cadr", "cost").grep(EnumerableSpecGrep2.new) { |i| i.upcase }.should == ["CAT", "CAR", "CADR"]
+  end 
+  
+  it "grep the enumerable (rubycon legacy)" do 
+    EnumerableSpecs::EachDefiner.new().grep(1).should == []
+    @a.grep(3..7).should == [4,6]
+    @a.grep(3..7) {|a| a+1}.should == [5,7]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/include_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/include_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/include_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/include'
+
+describe "Enumerable#include?" do
+  it_behaves_like(:enumerable_include, :include?) 
+end

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/inject_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/inject_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/inject_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,58 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Enumerable#inject" do  
+  it "inject with argument takes a block with an accumulator (with argument as initial value) and the current element. Value of block becomes new accumulator" do
+    a = []
+    EnumerableSpecs::Numerous.new.inject(0) { |memo, i| a << [memo, i]; i }
+    a.should == [[0, 2], [2, 5], [5, 3], [3, 6], [6, 1], [1, 4]]
+    EnumerableSpecs::EachDefiner.new(true, true, true).inject(nil) {|result, i| i && result}.should == nil
+  end
+
+  it "produces an array of the accumulator and the argument when given a block with a *arg" do
+    a = []
+    [1,2].inject(0) {|*args| a << args; args[0] + args[1]}
+    a.should == [[0, 1], [1, 2]]
+  end
+  
+  it "only takes one argument" do
+    lambda { EnumerableSpecs::Numerous.new.inject(0, 1) { |memo, i| i } }.should raise_error(ArgumentError)
+  end
+    
+  it "inject without argument takes a block with an accumulator (with first element as initial value) and the current element. Value of block becomes new accumulator" do
+    a = []
+    EnumerableSpecs::Numerous.new.inject { |memo, i| a << [memo, i]; i }
+    a.should == [[2, 5], [5, 3], [3, 6], [6, 1], [1, 4]]
+  end  
+  
+  it "inject with inject arguments(legacy rubycon)" do
+    # with inject argument
+    EnumerableSpecs::EachDefiner.new().inject(1) {|acc,x| 999 }.should == 1
+    EnumerableSpecs::EachDefiner.new(2).inject(1) {|acc,x| 999 }.should ==  999
+    EnumerableSpecs::EachDefiner.new(2).inject(1) {|acc,x| acc }.should == 1
+    EnumerableSpecs::EachDefiner.new(2).inject(1) {|acc,x| x }.should == 2
+
+    EnumerableSpecs::EachDefiner.new(1,2,3,4).inject(100) {|acc,x| acc + x }.should == 110
+    EnumerableSpecs::EachDefiner.new(1,2,3,4).inject(100) {|acc,x| acc * x }.should == 2400
+
+    EnumerableSpecs::EachDefiner.new('a','b','c').inject("z") {|result, i| i+result}.should == "cbaz"
+  end
+  
+  it "inject withou inject arguments(legacy rubycon)" do
+    # no inject argument
+    EnumerableSpecs::EachDefiner.new(2).inject {|acc,x| 999 } .should == 2
+    EnumerableSpecs::EachDefiner.new(2).inject {|acc,x| acc }.should == 2
+    EnumerableSpecs::EachDefiner.new(2).inject {|acc,x| x }.should == 2
+
+    EnumerableSpecs::EachDefiner.new(1,2,3,4).inject {|acc,x| acc + x }.should == 10
+    EnumerableSpecs::EachDefiner.new(1,2,3,4).inject {|acc,x| acc * x }.should == 24
+
+    EnumerableSpecs::EachDefiner.new('a','b','c').inject {|result, i| i+result}.should == "cba"
+    EnumerableSpecs::EachDefiner.new(3, 4, 5).inject {|result, i| result*i}.should == 60
+    EnumerableSpecs::EachDefiner.new([1], 2, 'a','b').inject{|r,i| r<<i}.should == [1, 2, 'a', 'b']
+
+  end
+  it "return nil when fails(legacy rubycon)" do
+    EnumerableSpecs::EachDefiner.new().inject {|acc,x| 999 }.should == nil 
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/map_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/map_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/map_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/collect'
+
+describe "Enumerable#map" do   
+  it_behaves_like(:enumerable_collect , :map) 
+end

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/max_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/max_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/max_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,75 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Enumerable#max" do
+  before :each do
+    @a = EnumerableSpecs::EachDefiner.new( 2, 4, 6, 8, 10 )
+
+    @e_strs = EnumerableSpecs::EachDefiner.new("333", "22", "666666", "1", "55555", "1010101010")
+    @e_ints = EnumerableSpecs::EachDefiner.new( 333,   22,   666666,   55555, 1010101010)
+  end
+
+  it "max should return the maximum element" do
+    EnumerableSpecs::Numerous.new.max.should == 6
+  end
+
+  it "return the maximum element (basics cases)" do
+    EnumerableSpecs::EachDefiner.new(55).max.should == 55
+
+    EnumerableSpecs::EachDefiner.new(11,99).max.should == 99
+    EnumerableSpecs::EachDefiner.new(99,11).max.should == 99
+    EnumerableSpecs::EachDefiner.new(2, 33, 4, 11).max.should == 33
+
+    EnumerableSpecs::EachDefiner.new(1,2,3,4,5).max.should == 5
+    EnumerableSpecs::EachDefiner.new(5,4,3,2,1).max.should == 5
+    EnumerableSpecs::EachDefiner.new(1,4,3,5,2).max.should == 5
+    EnumerableSpecs::EachDefiner.new(5,5,5,5,5).max.should == 5
+
+    EnumerableSpecs::EachDefiner.new("aa","tt").max.should == "tt"
+    EnumerableSpecs::EachDefiner.new("tt","aa").max.should == "tt"
+    EnumerableSpecs::EachDefiner.new("2","33","4","11").max.should == "4"
+
+    @e_strs.max.should == "666666"
+    @e_ints.max.should == 1010101010
+  end
+
+  it "return an error when introduce the wrong kind or number of parameters " do
+    # error cases
+    EnumerableSpecs::EachDefiner.new().max.should == nil
+    lambda {
+      EnumerableSpecs::EachDefiner.new(Object.new, Object.new).max
+    }.should raise_error(NoMethodError)
+    lambda {
+      EnumerableSpecs::EachDefiner.new(11,"22").max
+    }.should raise_error(ArgumentError)
+    lambda {
+      EnumerableSpecs::EachDefiner.new(11,12,22,33).max{|a, b| nil}
+    }.should raise_error(ArgumentError)
+  end
+
+  it "return the maximum element (with block" do
+    # with a block
+    EnumerableSpecs::EachDefiner.new("2","33","4","11").max {|a,b| a <=> b }.should == "4"
+    EnumerableSpecs::EachDefiner.new( 2 , 33 , 4 , 11 ).max {|a,b| a <=> b }.should == 33
+
+    EnumerableSpecs::EachDefiner.new("2","33","4","11").max {|a,b| b <=> a }.should == "11"
+    EnumerableSpecs::EachDefiner.new( 2 , 33 , 4 , 11 ).max {|a,b| b <=> a }.should == 2
+
+    @e_strs.max {|a,b| a.length <=> b.length }.should == "1010101010"
+
+    @e_strs.max {|a,b| a <=> b }.should == "666666"
+    @e_strs.max {|a,b| a.to_i <=> b.to_i }.should == "1010101010"
+
+    @e_ints.max {|a,b| a <=> b }.should == 1010101010
+    @e_ints.max {|a,b| a.to_s <=> b.to_s }.should == 666666
+  end
+
+  it "returns the minimum for enumerables that contain nils" do
+    arr = EnumerableSpecs::Numerous.new(nil, nil, true)
+    arr.max { |a, b|
+      x = a.nil? ? 1 : a ? 0 : -1
+      y = b.nil? ? 1 : b ? 0 : -1
+      x <=> y
+    }.should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/member_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/member_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/member_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/include'
+
+describe "Enumerable#member?" do
+  it_behaves_like(:enumerable_include, :member?) 
+end

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/min_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/min_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/min_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,79 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Enumerable#min" do
+  before :each do
+    @a = EnumerableSpecs::EachDefiner.new( 2, 4, 6, 8, 10 )
+
+    @e_strs = EnumerableSpecs::EachDefiner.new("333", "22", "666666", "1", "55555", "1010101010")
+    @e_ints = EnumerableSpecs::EachDefiner.new( 333,   22,   666666,   55555, 1010101010)
+  end
+
+  it "min should return the minimum element" do
+    EnumerableSpecs::Numerous.new.min.should == 1
+  end
+
+  it "return the minimun (basic cases)" do
+    EnumerableSpecs::EachDefiner.new(55).min.should == 55
+
+    EnumerableSpecs::EachDefiner.new(11,99).min.should ==  11
+    EnumerableSpecs::EachDefiner.new(99,11).min.should == 11
+    EnumerableSpecs::EachDefiner.new(2, 33, 4, 11).min.should == 2
+
+    EnumerableSpecs::EachDefiner.new(1,2,3,4,5).min.should == 1
+    EnumerableSpecs::EachDefiner.new(5,4,3,2,1).min.should == 1
+    EnumerableSpecs::EachDefiner.new(4,1,3,5,2).min.should == 1
+    EnumerableSpecs::EachDefiner.new(5,5,5,5,5).min.should == 5
+
+    EnumerableSpecs::EachDefiner.new("aa","tt").min.should == "aa"
+    EnumerableSpecs::EachDefiner.new("tt","aa").min.should == "aa"
+    EnumerableSpecs::EachDefiner.new("2","33","4","11").min.should == "11"
+
+    @e_strs.min.should == "1"
+    @e_ints.min.should == 22
+  end
+
+  it "return nil when error" do
+    EnumerableSpecs::EachDefiner.new().min.should == nil
+    lambda {
+      EnumerableSpecs::EachDefiner.new(Object.new, Object.new).min
+    }.should raise_error(NoMethodError)
+    lambda {
+      EnumerableSpecs::EachDefiner.new(11,"22").min
+    }.should raise_error(ArgumentError)
+    lambda {
+      EnumerableSpecs::EachDefiner.new(11,12,22,33).min{|a, b| nil}
+    }.should raise_error(ArgumentError)
+  end
+
+  it "return the minimun when using a block rule" do
+    EnumerableSpecs::EachDefiner.new("2","33","4","11").min {|a,b| a <=> b }.should == "11"
+    EnumerableSpecs::EachDefiner.new( 2 , 33 , 4 , 11 ).min {|a,b| a <=> b }.should == 2
+
+    EnumerableSpecs::EachDefiner.new("2","33","4","11").min {|a,b| b <=> a }.should == "4"
+    EnumerableSpecs::EachDefiner.new( 2 , 33 , 4 , 11 ).min {|a,b| b <=> a }.should == 33
+
+    EnumerableSpecs::EachDefiner.new( 1, 2, 3, 4 ).min {|a,b| 15 }.should == 1
+
+    EnumerableSpecs::EachDefiner.new(11,12,22,33).min{|a, b| 2 }.should == 11
+    @i = -2
+    EnumerableSpecs::EachDefiner.new(11,12,22,33).min{|a, b| @i += 1 }.should == 12
+
+    @e_strs.min {|a,b| a.length <=> b.length }.should == "1"
+
+    @e_strs.min {|a,b| a <=> b }.should == "1"
+    @e_strs.min {|a,b| a.to_i <=> b.to_i }.should == "1"
+
+    @e_ints.min {|a,b| a <=> b }.should == 22
+    @e_ints.min {|a,b| a.to_s <=> b.to_s }.should == 1010101010
+  end
+
+  it "returns the minimum for enumerables that contain nils" do
+    arr = EnumerableSpecs::Numerous.new(nil, nil, true)
+    arr.min { |a, b|
+      x = a.nil? ? -1 : a ? 0 : 1
+      y = b.nil? ? -1 : b ? 0 : 1
+      x <=> y
+    }.should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/partition_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/partition_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/partition_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Enumerable#partition" do
+  it "returns two arrays, the first containing elements for which the block is true, the second containing the rest" do
+    EnumerableSpecs::Numerous.new.partition { |i| i % 2 == 0 }.should == [[2, 6, 4], [5, 3, 1]]
+  end
+  
+  ruby_version_is "" ... "1.8.7" do
+    it "throws LocalJumpError if called without a block" do
+      lambda { EnumerableSpecs::Numerous.new.partition }.should raise_error(LocalJumpError)
+    end
+  end
+
+  ruby_version_is "1.8.7" do
+    it "returns an Enumerator if called without a block" do
+      EnumerableSpecs::Numerous.new.partition.should be_kind_of(Enumerable::Enumerator)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/reject_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/reject_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/reject_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Enumerable#reject" do 
+  it "returns an array of the elements for which block is false" do
+    EnumerableSpecs::Numerous.new.reject { |i| i > 3 }.should == [2, 3, 1]
+    entries = (1..10).to_a
+    numerous = EnumerableSpecs::Numerous.new(*entries)
+    numerous.reject {|i| i % 2 == 0 }.should == [1,3,5,7,9]
+    numerous.reject {|i| true }.should == []
+    numerous.reject {|i| false }.should == entries
+  end
+  
+  ruby_version_is "" ... "1.8.7" do
+    it "raises a LocalJumpError if no block is given" do
+      lambda { EnumerableSpecs::Numerous.new.reject }.should raise_error(LocalJumpError)
+    end
+  end
+
+  ruby_version_is "1.8.7" do
+    it "returns an Enumerator if called without a block" do
+      EnumerableSpecs::Numerous.new.reject.should be_kind_of(Enumerable::Enumerator)
+    end
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/select_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/select_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/select_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/find_all'
+
+describe "Enumerable#select" do
+  it_behaves_like(:enumerable_find_all , :select) 
+end

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/shared/collect.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/shared/collect.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/shared/collect.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+describe :enumerable_collect, :shared => true do
+  it "collect should return a new array with the results of passing each element to block" do
+    entries = [0, 1, 3, 4, 5, 6]
+    numerous = EnumerableSpecs::Numerous.new(*entries)
+    numerous.send(@method) { |i| i % 2 }.should == [0, 1, 1, 0, 1, 0]
+    numerous.send(@method) { |i| i }.should == entries
+  end 
+end

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/shared/entries.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/shared/entries.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/shared/entries.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+describe :enumerable_entries, :shared => true do
+  before :each do
+    @entries = [2, 4, 6, 8, 10]
+    @numerous = EnumerableSpecs::Numerous.new(*@entries)
+  end
+  
+  it "returns an array containing the items in enum." do
+    @numerous.send(@method).should == @entries
+  end
+
+  it "returns an array containing the elements" do
+    numerous = EnumerableSpecs::Numerous.new(1, nil, 'a', 2, false, true)
+    numerous.send(@method).should == [1, nil, "a", 2, false, true]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/shared/find.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/shared/find.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/shared/find.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,42 @@
+describe :enumerable_find, :shared => true do
+  # #detect and #find are aliases, so we only need one function 
+  before :each do
+    @elements = [2, 4, 6, 8, 10]
+    @numerous = EnumerableSpecs::Numerous.new(*@elements)
+  end
+  
+  it "passes each entry in enum to block while block when block is false" do
+    visited_elements = []
+    @numerous.send(@method) do |element|
+      visited_elements << element
+      false
+    end
+    visited_elements.should == @elements
+  end
+  
+  it "returns nil when the block is false and there is no ifnone proc given" do
+    @numerous.send(@method) {|e| false }.should == nil
+  end
+  
+  it "returns the first element for which the block is not false" do
+    @elements.each do |element|
+      @numerous.send(@method) {|e| e > element - 1 }.should == element
+    end
+  end
+  
+  it "returns the value of the ifnone proc if the block is false" do
+    fail_proc = lambda { "cheeseburgers" }
+    @numerous.send(@method, fail_proc) {|e| false }.should == "cheeseburgers"
+  end
+  
+  it "doesn't call the ifnone proc if an element is found" do
+    fail_proc = lambda { raise "This shouldn't have been called" }
+    @numerous.send(@method, fail_proc) {|e| e == @elements.first }.should == 2
+  end
+  
+  it "calls the ifnone proc only once when the block is false" do
+    times = 0
+    fail_proc = lambda { times += 1; raise if times > 1; "cheeseburgers" }
+    @numerous.send(@method, fail_proc) {|e| false }.should == "cheeseburgers"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/shared/find_all.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/shared/find_all.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/shared/find_all.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+describe :enumerable_find_all, :shared => true do
+  it "returns all elements for which the block is not false" do
+    entries = (1..10).to_a
+    numerous = EnumerableSpecs::Numerous.new(*entries)
+    numerous.send(@method) {|i| i % 3 == 0 }.should == [3, 6, 9]
+    numerous.send(@method) {|i| true }.should == (1..10).to_a
+    numerous.send(@method) {|i| false }.should == []
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/shared/include.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/shared/include.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/shared/include.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+describe :enumerable_include, :shared => true do
+  it "returns true if any element == argument" do
+    class EnumerableSpecIncludeP; def ==(obj) obj == 5; end; end
+
+    elements = (0..5).to_a
+    EnumerableSpecs::Numerous.new(*elements).send(@method,5).should == true 
+    EnumerableSpecs::Numerous.new(*elements).send(@method,10).should == false
+    EnumerableSpecs::Numerous.new(*elements).send(@method,EnumerableSpecIncludeP.new).should == true
+  end
+  
+  it "returns true if any member of enum equals obj when == compare different classes (legacy rubycon)" do
+    # equality is tested with ==
+    EnumerableSpecs::Numerous.new(2,4,6,8,10).send(@method, 2.0).should == true
+    EnumerableSpecs::Numerous.new(2,4,[6,8],10).send(@method, [6, 8]).should == true
+    EnumerableSpecs::Numerous.new(2,4,[6,8],10).send(@method, [6.0, 8.0]).should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/sort_by_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/sort_by_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/sort_by_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Enumerable#sort_by" do
+  it "returns an array of elements ordered by the result of block" do
+    a = EnumerableSpecs::Numerous.new("once", "upon", "a", "time")
+    a.sort_by { |i| i[0] }.should == ["a", "once", "time", "upon"]
+  end
+
+  it "sorts the object by the given attribute" do
+    a = EnumerableSpecs::SortByDummy.new("fooo")
+    b = EnumerableSpecs::SortByDummy.new("bar")
+
+    ar = [a, b].sort_by { |d| d.s }
+    ar.should == [b, a]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/sort_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/sort_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/sort_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Enumerable#sort" do
+  it "sorts by the natural order as defined by <=> " do
+    EnumerableSpecs::Numerous.new.sort.should == [1, 2, 3, 4, 5, 6]
+    sorted = EnumerableSpecs::ComparesByVowelCount.wrap("a" * 1, "a" * 2, "a"*3, "a"*4, "a"*5)
+    EnumerableSpecs::Numerous.new(sorted[2],sorted[0],sorted[1],sorted[3],sorted[4]).sort.should == sorted
+  end
+
+  it "yields elements to the provided block" do
+    EnumerableSpecs::Numerous.new.sort { |a, b| b <=> a }.should == [6, 5, 4, 3, 2, 1]
+    EnumerableSpecs::Numerous.new(2,0,1,3,4).sort { |n, m| -(n <=> m) }.should == [4,3,2,1,0]
+  end
+
+  it "sort should throw a NoMethodError if elements do not define <=>" do
+    lambda {
+      EnumerableSpecs::Numerous.new(Object.new, Object.new, Object.new).sort
+    }.should raise_error(NoMethodError)
+  end
+
+  it "sorts enumerables that contain nils" do
+    arr = EnumerableSpecs::Numerous.new(nil, true, nil, false, nil, true, nil, false, nil)
+    arr.sort { |a, b|
+      x = a ? -1 : a.nil? ? 0 : 1
+      y = b ? -1 : b.nil? ? 0 : 1
+      x <=> y
+    }.should == [true, true, nil, nil, nil, nil, nil, false, false]
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/to_a_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/to_a_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/to_a_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/entries'
+
+describe "Enumerable#to_a" do   
+  it_behaves_like(:enumerable_entries , :to_a) 
+end

Added: MacRuby/branches/experimental/spec/frozen/core/enumerable/zip_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/enumerable/zip_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/enumerable/zip_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,30 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Enumerable#zip" do
+
+  it "combines each element of the receiver with the element of the same index in arrays given as arguments" do
+    EnumerableSpecs::Numerous.new(1,2,3).zip([4,5,6],[7,8,9]).should == [[1,4,7],[2,5,8],[3,6,9]]
+    EnumerableSpecs::Numerous.new(1,2,3).zip.should == [[1],[2],[3]]
+  end
+  
+  it "passes each element of the result array to a block and return nil if a block is given" do
+    expected = [[1,4,7],[2,5,8],[3,6,9]]
+    EnumerableSpecs::Numerous.new(1,2,3).zip([4,5,6],[7,8,9]) do |result_component|
+      result_component.should == expected.shift
+    end.should == nil
+    expected.size.should == 0
+  end
+  
+  it "fills resulting array with nils if an argument array is too short" do
+    EnumerableSpecs::Numerous.new(1,2,3).zip([4,5,6], [7,8]).should == [[1,4,7],[2,5,8],[3,6,nil]]
+  end
+  
+  it "converts arguments to arrays using #to_a" do
+    convertable = EnumerableSpecs::ArrayConvertable.new(4,5,6)
+    EnumerableSpecs::Numerous.new(1,2,3).zip(convertable).should == [[1,4],[2,5],[3,6]]
+    convertable.called.should == :to_a
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/env/clear_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/clear_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/clear_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ENV.clear" do
+  it "deletes all environment variables" do
+    orig = ENV.to_hash
+    begin
+      ENV.clear
+      env.should == {}
+    ensure
+      ENV.replace orig
+    end
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/delete_if_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/delete_if_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/delete_if_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ENV.delete_if" do
+
+  it "deletes pairs if the block returns true" do
+    ENV["foo"] = "bar"
+    ENV.delete_if { |k, v| k == "foo" }
+    ENV["foo"].should == nil
+  end
+
+  it "returns ENV even if nothing deleted" do
+    ENV.delete_if { false }.should_not == nil
+  end
+
+  ruby_version_is "" ... "1.8.7" do
+    it "raises LocalJumpError if no block given" do
+      lambda { ENV.delete_if }.should raise_error(LocalJumpError)
+    end
+  end
+
+  ruby_version_is "1.8.7" do
+    it "returns an Enumerator if no block given" do
+      ENV.delete_if.should be_kind_of(Enumerable::Enumerator)
+    end
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/delete_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/delete_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/delete_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ENV.delete" do
+  it "removes the variable and return its value" do
+    ENV["foo"] = "bar"
+    ENV.delete("foo").should == "bar"
+    ENV["foo"].should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/each_key_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/each_key_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/each_key_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ENV.each_key" do
+
+  it "returns each key" do
+    e = []
+    orig = ENV.to_hash
+    begin
+      ENV.clear
+      ENV["1"] = "3"
+      ENV["2"] = "4"
+      ENV.each_key { |k| e << k }
+      e.should include("1")
+      e.should include("2")
+    ensure
+      ENV.replace orig
+    end
+  end
+
+  ruby_version_is "" ... "1.8.7" do
+    it "raises LocalJumpError if no block given" do
+      lambda { ENV.each_key }.should raise_error(LocalJumpError)
+    end
+  end
+
+  ruby_version_is "1.8.7" do
+    it "returns an Enumerator if called without a block" do
+      ENV.each_key.should be_kind_of(Enumerable::Enumerator)
+    end
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/each_pair_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/each_pair_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/each_pair_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/each.rb'
+
+describe "ENV.each_pair" do
+  it_behaves_like(:env_each, :each_pair)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/each_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/each_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/each_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/each.rb'
+
+describe "ENV.each" do
+  it_behaves_like(:env_each, :each)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/each_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/each_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/each_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ENV.each_value" do
+
+  it "returns each value" do
+    e = []
+    orig = ENV.to_hash
+    begin
+      ENV.clear
+      ENV["1"] = "3"
+      ENV["2"] = "4"
+      ENV.each_value { |v| e << v }
+      e.should include("3")
+      e.should include("4")
+    ensure
+      ENV.replace orig
+    end
+  end
+
+  ruby_version_is "" ... "1.8.7" do
+    it "raises LocalJumpError if no block given" do
+      lambda { ENV.each_value }.should raise_error(LocalJumpError)
+    end
+  end
+
+  ruby_version_is "1.8.7" do
+    it "returns an Enumerator if called without a block" do
+      ENV.each_value.should be_kind_of(Enumerable::Enumerator)
+    end
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/element_reference_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/element_reference_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/element_reference_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ENV.[]" do
+  before :each do
+    @variable_name = 'USER'
+    platform_is :windows do
+      @variable_name = 'USERNAME'
+    end
+  end
+
+  it "returns the specified environment variable" do
+    ENV[@variable_name].should == username
+  end
+
+  it "returns nil if the variable isn't found" do
+    ENV["this_var_is_never_set"].should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/element_set_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/element_set_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/element_set_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/store.rb'
+
+describe "ENV.[]=" do
+  it_behaves_like(:env_store, :[]=)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/empty_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/empty_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/empty_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ENV.empty?" do
+
+  it "return true if the Environment is empty" do
+    if ENV.keys.size > 0
+      ENV.empty?.should == false
+    end
+    orig = ENV.to_hash
+    begin
+      ENV.clear
+      ENV.empty?.should == true
+    ensure
+      ENV.replace orig
+    end
+  end
+
+  it "returns false if not empty" do
+    if ENV.keys.size > 0
+      ENV.empty?.should == false
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/fetch_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/fetch_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/fetch_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ENV.fetch" do
+
+  it "returns a value" do
+    ENV["foo"] = "bar"
+    ENV.fetch("foo").should == "bar"
+    ENV.delete "foo"
+  end
+
+  it "raises IndexError for an invalid key" do
+    lambda { ENV.fetch "should_never_be_set" }.should raise_error(IndexError)
+  end
+
+  it "provides the given default parameter" do
+    ENV.fetch("should_never_be_set", "default").should == "default"
+  end
+
+  it "provides a default value from a block" do
+    ENV.fetch("should_never_be_set") { |k| "wanted #{k}" }.should == "wanted should_never_be_set"
+  end
+
+  it "warns on block and default parameter given" do
+    lambda do
+       ENV.fetch("should_never_be_set", "default") { 1 }.should == 1
+    end.should complain(/block supersedes default value argument/)
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/has_key_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/has_key_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/has_key_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/include.rb'
+
+describe "ENV.has_key?" do
+  it_behaves_like(:env_include, :has_key?)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/has_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/has_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/has_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/value.rb'
+
+describe "ENV.has_value?" do
+  it_behaves_like(:env_value, :has_value?)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/include_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/include_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/include_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/include.rb'
+
+describe "ENV.include?" do
+  it_behaves_like(:env_include, :include?)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/index_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/index_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/index_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/env/indexes_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/indexes_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/indexes_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/env/indices_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/indices_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/indices_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/env/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ENV.inspect" do
+
+  it "returns a String that looks like a Hash with real data" do
+    ENV["foo"] = "bar"
+    ENV.inspect.should =~ /\{.*"foo"=>"bar".*\}/
+    ENV.delete "foo"
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/invert_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/invert_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/invert_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ENV.invert" do
+
+  it "returns a hash with ENV.keys as the values and vice versa" do
+    ENV["foo"] = "bar"
+    ENV.delete "bar"
+    ENV.invert["bar"].should == "foo"
+    ENV["foo"].should == "bar"
+    ENV["bar"].should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/key_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/key_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/key_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/include.rb'
+
+describe "ENV.key?" do
+  it_behaves_like(:env_include, :key?)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/keys_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/keys_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/keys_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ENV.keys" do
+
+  it "returns all the keys" do
+    ENV.keys.sort.should == ENV.to_hash.keys.sort
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/length.rb'
+
+describe "ENV.length" do
+ it_behaves_like(:env_length, :length)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/member_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/member_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/member_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/include.rb'
+
+describe "ENV.member?" do
+  it_behaves_like(:env_include, :member?)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/rehash_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/rehash_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/rehash_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/env/reject_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/reject_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/reject_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,88 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ENV.reject!" do
+  it "rejects entries based on key" do
+    ENV["foo"] = "bar"
+    ENV.reject! { |k, v| k == "foo" }
+    ENV["foo"].should == nil
+  end
+
+  it "rejects entries based on value" do
+    ENV["foo"] = "bar"
+    ENV.reject! { |k, v| v == "bar" }
+    ENV["foo"].should == nil
+  end
+
+  it "returns itself or nil" do
+    ENV.reject! { false }.should == nil
+    ENV["foo"] = "bar"
+    ENV.reject! { |k, v| k == "foo" }.should == ENV
+    ENV["foo"].should == nil
+  end
+
+  ruby_version_is "" ... "1.8.7" do
+    it "raises on no block given" do
+      lambda { ENV.reject! }.should raise_error(LocalJumpError)
+    end
+  end
+
+  ruby_version_is "1.8.7" do
+    it "returns an Enumerator if called without a block" do
+      ENV.reject!.should be_kind_of(Enumerable::Enumerator)
+    end
+  end
+
+  it "doesn't raise if empty" do
+    orig = ENV.to_hash
+    begin
+      ENV.clear
+      lambda { ENV.reject! }.should_not raise_error(LocalJumpError)
+    ensure
+      ENV.replace orig
+    end
+  end
+end
+
+describe "ENV.reject" do
+  it "rejects entries based on key" do
+    ENV["foo"] = "bar"
+    e = ENV.reject { |k, v| k == "foo" }
+    e["foo"].should == nil
+    ENV["foo"].should == "bar"
+    ENV["foo"] = nil
+  end
+
+  it "rejects entries based on value" do
+    ENV["foo"] = "bar"
+    e = ENV.reject { |k, v| v == "bar" }
+    e["foo"].should == nil
+    ENV["foo"].should == "bar"
+    ENV["foo"] = nil
+  end
+
+  it "returns a Hash" do
+    ENV.reject { false }.class.should == Hash
+  end
+
+  ruby_version_is "" ... "1.8.7" do
+    it "raises on no block given" do
+      lambda { ENV.reject }.should raise_error(LocalJumpError)
+    end
+  end
+
+  ruby_version_is "1.8.7" do
+    it "returns an Enumerator if called without a block" do
+      ENV.reject.should be_kind_of(Enumerable::Enumerator)
+    end
+  end
+
+  it "doesn't raise if empty" do
+    orig = ENV.to_hash
+    begin
+      ENV.clear
+      lambda { ENV.reject }.should_not raise_error(LocalJumpError)
+    ensure
+      ENV.replace orig
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/replace_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/replace_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/replace_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ENV.replace" do
+
+  it "replaces ENV with a Hash" do
+    ENV["foo"] = "bar"
+    e = ENV.reject { |k, v| k == "foo" }
+    e["baz"] = "bam"
+    ENV.replace e
+    ENV["foo"].should == nil
+    ENV["baz"].should == "bam"
+    ENV.delete "baz"
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/select_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/select_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/select_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ENV.select" do
+
+  it "returns the Hash for which block return true" do
+    ENV["foo"] = "bar"
+    ENV.select { |k, v| k == "foo" }.should == [["foo", "bar"]]
+    ENV.delete "foo"
+  end
+
+  ruby_version_is "" ... "1.8.7" do
+    it "raises when no block is given" do
+      lambda { ENV.select }.should raise_error(LocalJumpError)
+    end
+  end
+
+  ruby_version_is "1.8.7" do
+    it "returns an Enumerator when no block is given" do
+      ENV.select.should be_kind_of(Enumerable::Enumerator)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/shared/each.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/shared/each.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/shared/each.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+describe :env_each, :shared => true do
+  it "returns each pair" do
+    orig = ENV.to_hash
+    e = []
+    begin
+      ENV.clear
+      ENV["foo"] = "bar"
+      ENV["baz"] = "boo"
+      ENV.send(@method) { |k, v| e << [k, v] }
+      e.should include(["foo", "bar"])
+      e.should include(["baz", "boo"])
+    ensure
+      ENV.replace orig
+    end
+  end
+
+  ruby_version_is "" ... "1.8.7" do
+    it "raises LocalJumpError if no block given" do
+      lambda { ENV.send(@method) }.should raise_error(LocalJumpError)
+    end
+  end
+
+  ruby_version_is "1.8.7" do
+    it "returns an Enumerator if called without a block" do
+      ENV.send(@method).should be_kind_of(Enumerable::Enumerator)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/shared/include.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/shared/include.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/shared/include.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+describe :env_include, :shared => true do
+  it "returns true if ENV has the key" do
+    ENV["foo"] = "bar"
+    ENV.send(@method, "foo").should == true
+    ENV.delete "foo"
+  end
+
+  it "return false if ENV doesn't include the key" do
+    ENV.send(@method, "should_never_be_set").should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/shared/length.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/shared/length.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/shared/length.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+describe :env_length, :shared => true do
+  it "returns the number of ENV entries" do
+    orig = ENV.to_hash
+    begin
+      ENV.clear
+      ENV["foo"] = "bar"
+      ENV["baz"] = "boo"
+      ENV.send(@method).should == 2
+    ensure
+      ENV.replace orig
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/shared/store.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/shared/store.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/shared/store.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+describe :env_store, :shared => true do
+  it "sets the environment variable to the given value" do
+    ENV.send(@method, "foo", "bar")
+    env.key?("foo").should == true
+    env.value?("bar").should == true
+    ENV.delete "foo"
+    ENV["foo"].should == nil
+    ENV.store "foo", "bar"
+    env.key?("foo").should == true
+    env.value?("bar").should == true
+    ENV.delete "foo"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/shared/value.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/shared/value.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/shared/value.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+describe :env_value, :shared => true do
+  it "returns true if ENV has the value" do
+    ENV["foo"] = "bar"
+    ENV.send(@method, "bar").should == true
+    ENV["foo"] = nil
+  end
+
+  it "returns false if ENV doesn't have the value" do
+    ENV.send(@method, "this_value_should_never_exist").should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/shift_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/shift_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/shift_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ENV.shift" do
+
+  it "returns a pair and deletes it" do
+    ENV.empty?.should == false
+    orig = ENV.to_hash
+    begin
+      pair = ENV.shift
+      ENV.has_key?(pair.first).should == false
+    ensure
+      ENV.replace orig
+    end
+    ENV.has_key?(pair.first).should == true
+  end
+
+  it "returns nil if ENV.empty?" do
+    orig = ENV.to_hash
+    begin
+      ENV.clear
+      ENV.shift.should == nil
+    ensure
+      ENV.replace orig
+    end
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/length.rb'
+
+describe "ENV.size" do
+ it_behaves_like(:env_length, :size)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/store_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/store_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/store_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/store.rb'
+
+describe "ENV.store" do
+  it_behaves_like(:env_store, :store)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/to_a_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/to_a_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/to_a_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ENV.to_a" do
+
+  it "returns the ENV as an array" do
+    ENV["foo"] = "bar"
+    a = ENV.to_a
+    a.is_a?(Array).should == true
+    a.find { |e| e.first == "foo" }.should == ["foo", "bar"]
+    ENV.delete "foo"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/to_hash_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/to_hash_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/to_hash_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ENV.to_hash" do
+
+  it "returns the ENV as a hash" do
+    ENV["foo"] = "bar"
+    h = ENV.to_hash
+    h.is_a?(Hash).should == true
+    h["foo"].should == "bar"
+    ENV.delete "foo"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ENV.to_s" do
+  it "returns \"ENV\"" do
+    ENV.to_s.should == "ENV"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/update_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/update_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/update_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ENV.update" do
+
+  it "add the parameter hash to ENV" do
+    ENV["foo"].should == nil
+    ENV.update "foo" => "bar"
+    ENV["foo"].should == "bar"
+    ENV.delete "foo"
+  end
+
+  it "yields key, the old value and the new value when replacing entries" do
+    ENV.update "foo" => "bar"
+    ENV["foo"].should == "bar"
+    ENV.update("foo" => "boo") do |key, old, new|
+      key.should == "foo"
+      old.should == "bar"
+      new.should == "boo"
+      "rab"
+    end
+    ENV["foo"].should == "rab"
+    ENV.delete "foo"
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/value.rb'
+
+describe "ENV.value?" do
+  it_behaves_like(:env_value, :value?)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/values_at_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/values_at_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/values_at_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ENV.values_at" do
+
+  it "returns an array of the values referenced by the parameters as keys" do
+    ENV["foo"] = "oof"
+    ENV["bar"] = "rab"
+    ENV.values_at.should == []
+    ENV.values_at("bar", "foo").should == ["rab", "oof"]
+    ENV.delete "foo"
+    ENV.delete "bar"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/env/values_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/env/values_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/env/values_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ENV.values" do
+
+  it "returns an array of the values" do
+    orig = ENV.to_hash
+    begin
+      ENV.replace "a" => "b", "c" => "d"
+      a = ENV.values
+      a.sort.should == ["b", "d"]
+    ensure
+      ENV.replace orig
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/exception/arguments_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/exception/arguments_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/exception/arguments_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ArgumentError" do
+  it "is a subclass of StandardError" do
+    StandardError.should be_ancestor_of(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/exception/backtrace_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/exception/backtrace_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/exception/backtrace_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/exception/case_compare_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/exception/case_compare_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/exception/case_compare_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/exception/errno_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/exception/errno_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/exception/errno_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/exception/exception_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/exception/exception_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/exception/exception_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,40 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/new'
+
+describe "Exception.exception" do
+  it_behaves_like(:exception_new, :exception)
+end
+
+describe "Exception" do
+  it "is a Class" do
+    Exception.should be_kind_of(Class)
+  end
+
+  it "is a superclass of NoMemoryError" do
+    Exception.should be_ancestor_of(NoMemoryError)
+  end
+
+  it "is a superclass of ScriptError" do
+    Exception.should be_ancestor_of(ScriptError)
+  end
+  
+  it "is a superclass of SignalException" do
+    Exception.should be_ancestor_of(SignalException)
+  end
+  
+  it "is a superclass of Interrupt" do
+    SignalException.should be_ancestor_of(Interrupt)
+  end
+
+  it "is a superclass of StandardError" do
+    Exception.should be_ancestor_of(StandardError)
+  end
+  
+  it "is a superclass of SystemExit" do
+    Exception.should be_ancestor_of(SystemExit)
+  end
+
+  it "is a superclass of SystemStackError" do
+    Exception.should be_ancestor_of(SystemStackError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/exception/exit_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/exception/exit_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/exception/exit_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/exception/fixtures/common.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/exception/fixtures/common.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/exception/fixtures/common.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+module NoMethodErrorSpecs
+  class NoMethodErrorA; end
+
+  class NoMethodErrorB; end
+
+  class NoMethodErrorC;
+    protected
+    def a_protected_method;end
+    private
+    def a_private_method; end
+  end
+
+  class NoMethodErrorD; end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/exception/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/exception/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/exception/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/exception/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/exception/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/exception/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Exception#inspect" do
+  it "returns '#<Exception: Exception>' when no message given" do
+    Exception.new.inspect.should == "#<Exception: Exception>"
+  end
+  
+  it "includes message when given" do
+    [Exception.new("foobar").inspect].should == ["#<Exception: foobar>"]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/exception/io_error_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/exception/io_error_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/exception/io_error_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "IOError" do
+  it "is a superclass of EOFError" do
+    IOError.should be_ancestor_of(EOFError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/exception/message_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/exception/message_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/exception/message_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Exception#message" do
+  it "returns the exception message" do
+    [Exception.new.message, Exception.new("Ouch!").message].should == ["Exception", "Ouch!"]
+  end  
+end

Added: MacRuby/branches/experimental/spec/frozen/core/exception/name_error_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/exception/name_error_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/exception/name_error_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "NameError" do
+  it "is a superclass of NoMethodError" do
+    NameError.should be_ancestor_of(NoMethodError)
+  end
+end
+
+describe "NameError.new" do
+  it "NameError.new should take optional name argument" do
+    NameError.new("msg","name").name.should == "name"
+  end  
+end

Added: MacRuby/branches/experimental/spec/frozen/core/exception/name_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/exception/name_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/exception/name_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/exception/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/exception/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/exception/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/new'
+
+describe "Exception.new" do
+  it_behaves_like(:exception_new, :new)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/exception/no_method_error_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/exception/no_method_error_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/exception/no_method_error_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,57 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+
+describe "NoMethodError.new" do
+  it "allows passing method args" do
+    NoMethodError.new("msg","name","args").args.should == "args"
+  end
+end
+
+describe "NoMethodError#args" do
+  it "returns an empty array if the caller method had no arguments" do
+    begin
+      NoMethodErrorSpecs::NoMethodErrorB.new.foo
+    rescue Exception => e
+      e.args.should == []
+    end
+  end
+
+  it "returns an array with the same elements as passed to the method" do
+    begin
+      a = NoMethodErrorSpecs::NoMethodErrorA.new
+      NoMethodErrorSpecs::NoMethodErrorB.new.foo(1,a)
+    rescue Exception => e
+      e.args.should == [1,a]
+      e.args[1].object_id.should == a.object_id
+    end
+  end
+end
+
+describe "NoMethodError#message" do
+  it "for an undefined method match /undefined method/" do
+    begin
+      NoMethodErrorSpecs::NoMethodErrorD.new.foo
+    rescue Exception => e
+      e.class.should == NoMethodError
+    end
+  end
+
+  it "for an protected method match /protected method/" do
+    begin
+      NoMethodErrorSpecs::NoMethodErrorC.new.a_protected_method
+    rescue Exception => e
+      e.class.should == NoMethodError
+    end
+  end
+
+  not_compliant_on :rubinius do
+    it "for private method match /private method/" do
+      begin
+        NoMethodErrorSpecs::NoMethodErrorC.new.a_private_method
+      rescue Exception => e
+        e.class.should == NoMethodError
+        e.message.match(/private method/).should_not == nil
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/exception/range_error_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/exception/range_error_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/exception/range_error_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "RangeError" do
+  it "is a superclass of FloatDomainError" do
+    RangeError.should be_ancestor_of(FloatDomainError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/exception/script_error_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/exception/script_error_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/exception/script_error_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ScriptError" do
+   it "is a superclass of LoadError" do
+     ScriptError.should be_ancestor_of(LoadError)
+   end
+
+   it "is a superclass of NotImplementedError" do
+     ScriptError.should be_ancestor_of(NotImplementedError)
+   end
+
+   it "is a superclass of SyntaxError" do
+     ScriptError.should be_ancestor_of(SyntaxError)
+   end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/exception/set_backtrace_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/exception/set_backtrace_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/exception/set_backtrace_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Exception#set_backtrace" do
+  it "allows the user to set the backtrace to any array" do
+    err = RuntimeError.new
+    err.set_backtrace ["unhappy"]
+    err.backtrace.should == ["unhappy"]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/exception/shared/new.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/exception/shared/new.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/exception/shared/new.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+describe :exception_new, :shared => true do
+  it "creates a new instance of Exception" do
+    Exception.should be_ancestor_of(Exception.send(@method).class)
+  end
+
+  it "sets the message of the Exception when passes a message" do
+    Exception.send(@method, "I'm broken.").message.should == "I'm broken."
+  end
+
+  it "returns 'Exception' for message when no message given" do
+    Exception.send(@method).message.should == "Exception"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/exception/standard_error_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/exception/standard_error_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/exception/standard_error_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,54 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "StandardError" do
+  it "is a superclass of ArgumentError" do
+    StandardError.should be_ancestor_of(ArgumentError)
+  end
+
+  it "is a superclass of IOError" do
+    StandardError.should be_ancestor_of(IOError)
+  end
+
+  it "is a superclass of IndexError" do
+    StandardError.should be_ancestor_of(IndexError)
+  end
+
+  it "is a superclass of LocalJumpError" do
+    StandardError.should be_ancestor_of(LocalJumpError)
+  end
+
+  it "is a superclass of NameError" do
+    StandardError.should be_ancestor_of(NameError)
+  end
+  
+  it "is a superclass of RangeError" do
+    StandardError.should be_ancestor_of(RangeError)
+  end
+  
+  it "is a superclass of RegexpError" do
+    StandardError.should be_ancestor_of(RegexpError)
+  end
+
+  it "is a superclass of RuntimeError" do
+    StandardError.should be_ancestor_of(RuntimeError)
+  end
+
+  it "is a superclass of SecurityError" do
+    StandardError.should be_ancestor_of(SecurityError)
+  end
+
+  it "is a superclass of SystemCallError" do
+    StandardError.should be_ancestor_of(SystemCallError.new("").class)
+  end
+  it "is a superclass of ThreadError" do
+    StandardError.should be_ancestor_of(ThreadError)
+  end
+
+  it "is a superclass of TypeError" do
+    StandardError.should be_ancestor_of(TypeError)
+  end
+
+  it "is a superclass of ZeroDivisionError" do
+    StandardError.should be_ancestor_of(ZeroDivisionError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/exception/system_call_error_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/exception/system_call_error_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/exception/system_call_error_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,45 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "SystemCallError.new" do  
+  it "requires at least one argumentt" do
+    lambda { SystemCallError.new }.should raise_error(ArgumentError)
+  end
+
+  it "takes an optional errno argument" do
+    SystemCallError.should be_ancestor_of(SystemCallError.new("message",1).class)
+  end
+
+  it "accepts single Fixnum argument as errno" do
+    SystemCallError.new(-2**24).errno.should == -2**24
+    SystemCallError.new(42).errno.should == 42
+    SystemCallError.new(2**24).errno.should == 2**24
+  end
+end
+
+describe "SystemCallError#errno" do
+  it "returns nil when no errno given" do
+    SystemCallError.new("message").errno.should == nil
+  end  
+  
+  it "returns the errno given as optional argument to new" do
+    SystemCallError.new("message", -2**30).errno.should == -2**30
+    SystemCallError.new("message", -1).errno.should == -1
+    SystemCallError.new("message", 0).errno.should == 0
+    SystemCallError.new("message", 1).errno.should == 1
+    SystemCallError.new("message", 42).errno.should == 42
+    SystemCallError.new("message", 2**30).errno.should == 2**30
+  end
+end
+
+describe "SystemCallError#message" do
+  it "should return default message when no message given" do
+    SystemCallError.new(2**28).message.should =~ /Unknown error/i
+  end
+
+  it "returns the message given as an argument to new" do
+    SystemCallError.new("message", 1).message.should  =~ /message/
+    SystemCallError.new("XXX").message.should =~ /XXX/
+  end
+end
+
+

Added: MacRuby/branches/experimental/spec/frozen/core/exception/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/exception/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/exception/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/exception/to_str_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/exception/to_str_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/exception/to_str_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/false/and_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/false/and_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/false/and_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "FalseClass#&" do
+  it "returns false" do
+    (false & false).should == false
+    (false & true).should == false
+    (false & nil).should == false
+    (false & "").should == false
+    (false & mock('x')).should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/false/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/false/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/false/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "FalseClass#inspect" do
+  it "returns the string 'false'" do
+    false.inspect.should == "false"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/false/or_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/false/or_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/false/or_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "FalseClass#|" do
+  it "return false if other is nil or false, otherwise true" do
+    (false | false).should == false
+    (false | true).should == true
+    (false | nil).should == false
+    (false | "").should == true
+    (false | mock('x')).should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/false/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/false/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/false/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "FalseClass#to_s" do
+  it "returns the string 'false'" do
+    false.to_s.should == "false"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/false/xor_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/false/xor_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/false/xor_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "FalseClass#^" do
+  it "returns false if other is nil or false, otherwise true" do
+    (false ^ false).should == false
+    (false ^ true).should == true
+    (false ^ nil).should == false
+    (false ^ "").should == true
+    (false ^ mock('x')).should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/atime_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/atime_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/atime_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,37 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "File.atime" do
+  before :each do
+    @file = tmp('test.txt')
+    File.open(@file, "w") {} # touch
+  end
+
+  after :each do
+    File.delete(@file) if File.exist?(@file)
+  end
+
+  it "returns the last access time for the named file as a Time object" do
+    File.atime(@file)
+    File.atime(@file).should be_kind_of(Time)
+  end
+
+  it "raises an Errno::ENOENT exception if the file is not found" do
+    lambda { File.atime('a_fake_file') }.should raise_error(Errno::ENOENT)
+  end
+end
+
+describe "File#atime" do
+  before :each do
+    @name = File.expand_path(__FILE__)
+    @file = File.open(@name)
+  end
+
+  after :each do
+    @file.close rescue nil
+  end
+
+  it "returns the last access time to self" do
+    @file.atime
+    @file.atime.should be_kind_of(Time)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/basename_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/basename_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/basename_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,144 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "File.basename" do
+  before :each do
+    @name = tmp("test.txt")
+    File.delete(@name) if File.exist? @name
+    @file = File.open(@name, "w+")
+  end
+
+  after :each do
+    @file.close
+    File.delete(@name) if File.exist?(@name)
+  end
+
+  it "return the basename of a path (basic cases)" do
+    File.basename(@name).should == "test.txt"
+    File.basename(File.join("/tmp")).should == "tmp"
+    File.basename(File.join(*%w( g f d s a b))).should == "b"
+    File.basename("/tmp", ".*").should == "tmp"
+    File.basename("/tmp", ".c").should == "tmp"
+    File.basename("/tmp.c", ".c").should == "tmp"
+    File.basename("/tmp.c", ".*").should == "tmp"
+    File.basename("/tmp.c", ".?").should == "tmp.c"
+    File.basename("/tmp.cpp", ".*").should == "tmp"
+    File.basename("/tmp.cpp", ".???").should == "tmp.cpp"
+    File.basename("/tmp.o", ".c").should == "tmp.o"
+    #Version.greater_or_equal("1.8.0") do
+    File.basename(File.join("/tmp/")).should == "tmp"
+    File.basename("/").should == "/"
+    File.basename("//").should == "/"
+    File.basename("dir///base", ".*").should == "base"
+    File.basename("dir///base", ".c").should == "base"
+    File.basename("dir///base.c", ".c").should == "base"
+    File.basename("dir///base.c", ".*").should == "base"
+    File.basename("dir///base.o", ".c").should == "base.o"
+    File.basename("dir///base///").should == "base"
+    File.basename("dir//base/", ".*").should == "base"
+    File.basename("dir//base/", ".c").should == "base"
+    File.basename("dir//base.c/", ".c").should == "base"
+    File.basename("dir//base.c/", ".*").should == "base"
+    #end
+  end
+
+  it "return the last component of the filename" do
+    File.basename('a').should == 'a'
+    File.basename('/a').should == 'a'
+    File.basename('/a/b').should == 'b'
+    File.basename('/ab/ba/bag').should == 'bag'
+    File.basename('/ab/ba/bag.txt').should == 'bag.txt'
+    File.basename('/').should == '/'
+    File.basename('/foo/bar/baz.rb', '.rb').should == 'baz'
+    File.basename('baz.rb', 'z.rb').should == 'ba'
+  end
+
+  it "return an string" do
+    File.basename("foo").class.should == String
+  end
+
+  it "return the basename for unix format" do
+    File.basename("/foo/bar").should == "bar"
+    File.basename("/foo/bar.txt").should == "bar.txt"
+    File.basename("bar.c").should == "bar.c"
+    File.basename("/bar").should == "bar"
+    File.basename("/bar/").should == "bar"
+
+    # Considered UNC paths on Windows
+    platform_is :windows do
+      File.basename("baz//foo").should =="foo"
+      File.basename("//foo/bar/baz").should == "baz"
+    end
+  end
+
+  it "return the basename for edge cases" do
+    File.basename("").should == ""
+    File.basename(".").should == "."
+    File.basename("..").should == ".."
+    File.basename("//foo/").should == "foo"
+    File.basename("//foo//").should == "foo"
+    File.basename("foo/").should == "foo"
+  end
+
+  it "return the basename for unix suffix" do
+    File.basename("bar.c", ".c").should == "bar"
+    File.basename("bar.txt", ".txt").should == "bar"
+    File.basename("/bar.txt", ".txt").should == "bar"
+    File.basename("/foo/bar.txt", ".txt").should == "bar"
+    File.basename("bar.txt", ".exe").should == "bar.txt"
+    File.basename("bar.txt.exe", ".exe").should == "bar.txt"
+    File.basename("bar.txt.exe", ".txt").should == "bar.txt.exe"
+    File.basename("bar.txt", ".*").should == "bar"
+    File.basename("bar.txt.exe", ".*").should == "bar.txt"
+    File.basename("bar.txt.exe", ".txt.exe").should == "bar"
+    deviates_on :rbx do
+      File.basename("bar.txt.exe", ".txt.*").should == "bar"
+    end
+  end
+
+  it "raises a TypeError if the arguments are not String types" do
+    lambda { File.basename(nil)          }.should raise_error(TypeError)
+    lambda { File.basename(1)            }.should raise_error(TypeError)
+    lambda { File.basename("bar.txt", 1) }.should raise_error(TypeError)
+    lambda { File.basename(true)         }.should raise_error(TypeError)
+  end
+
+  it "raises an ArgumentError if passed more than two arguments" do
+    lambda { File.basename('bar.txt', '.txt', '.txt') }.should raise_error(ArgumentError)
+  end
+
+  # specific to MS Windows
+  platform_is :windows do
+    it "return the basename for windows" do
+      File.basename("C:\\foo\\bar\\baz.txt").should == "baz.txt"
+      File.basename("C:\\foo\\bar").should == "baz"
+      File.basename("C:\\foo\\bar\\").should == "baz"
+      File.basename("C:\\foo").should == "foo"
+      File.basename("C:\\").should == "C:\\"
+    end
+
+    it "return basename windows unc" do
+      File.basename("\\\\foo\\bar\\baz.txt").should == "baz.txt"
+      File.basename("\\\\foo\\bar\\baz").should =="baz"
+      File.basename("\\\\foo").should == "\\\\foo"
+      File.basename("\\\\foo\\bar").should == "\\\\foo\\bar"
+    end
+
+    it "return basename windows forward slash" do
+      File.basename("C:/").should == "C:/"
+      File.basename("C:/foo").should == "foo"
+      File.basename("C:/foo/bar").should == "bar"
+      File.basename("C:/foo/bar/").should "bar"
+      File.basename("C:/foo/bar//").shouldl == "bar"
+    end
+
+    it "return basename with windows suffix" do
+      File.basename("c:\\bar.txt", ".txt").should == "bar"
+      File.basename("c:\\foo\\bar.txt", ".txt").should == "bar"
+      File.basename("c:\\bar.txt", ".exe").should == "bar.txt"
+      File.basename("c:\\bar.txt.exe", ".exe").should == "bar.txt"
+      File.basename("c:\\bar.txt.exe", ".txt").should == "bar.txt.exe"
+      File.basename("c:\\bar.txt", ".*").should == "bar"
+      File.basename("c:\\bar.txt.exe", ".*").should == "bar.txt"
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/blockdev_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/blockdev_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/blockdev_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/blockdev'
+
+describe "File.blockdev?" do
+  it_behaves_like :file_blockdev, :blockdev?, File
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/chardev_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/chardev_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/chardev_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/chardev'
+
+describe "File.chardev?" do
+  it_behaves_like :file_chardev, :chardev?, File
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/chmod_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/chmod_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/chmod_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,201 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "File#chmod" do
+  before :each do
+    @filename = tmp('i_exist')
+    @file = File.open(@filename, 'w')
+  end
+
+  after :each do
+    @file.close
+    File.delete(@filename) if File.exist?(@filename)
+  end
+
+  it "returns 0 if successful" do
+    @file.chmod(0755).should == 0
+  end
+
+  platform_is_not :freebsd do
+    it "always succeeds with any numeric values" do
+      vals = [-2**30, -2**16, -2**8, -2, -1,
+        -0.5, 0, 1, 2, 5.555575, 16, 32, 64, 2**8, 2**16, 2**30]
+      vals.each { |v|
+        lambda { @file.chmod(v) }.should_not raise_error
+      }
+    end
+  end
+
+  # -256, -2 and -1 raise Errno::E079 on FreeBSD
+  platform_is :freebsd do
+    it "always succeeds with any numeric values" do
+      vals = [-2**30, -2**16, #-2**8, -2, -1,
+        -0.5, 0, 1, 2, 5.555575, 16, 32, 64, 2**8, 2**16, 2**30]
+      vals.each { |v|
+        lambda { @file.chmod(v) }.should_not raise_error
+      }
+    end
+  end
+
+  it "invokes to_int on non-integer argument" do
+    mode = File.stat(@filename).mode
+    (obj = mock('mode')).should_receive(:to_int).and_return(mode)
+    @file.chmod(obj)
+    File.stat(@filename).mode.should == mode
+  end
+
+  platform_is :windows do
+    it "with '0444' makes file readable and executable but not writable" do
+      @file.chmod(0444)
+      File.readable?(@filename).should == true
+      File.writable?(@filename).should == false
+      File.executable?(@filename).should == true
+    end
+
+    it "with '0644' makes file readable and writable and also executable" do
+      @file.chmod(0644)
+      File.readable?(@filename).should == true
+      File.writable?(@filename).should == true
+      File.executable?(@filename).should == true
+    end
+  end
+
+  platform_is_not :windows do
+    it "with '0222' makes file writable but not readable or executable" do
+      @file.chmod(0222)
+      File.readable?(@filename).should == false
+      File.writable?(@filename).should == true
+      File.executable?(@filename).should == false
+    end
+
+    it "with '0444' makes file readable but not writable or executable" do
+      @file.chmod(0444)
+      File.readable?(@filename).should == true
+      File.writable?(@filename).should == false
+      File.executable?(@filename).should == false
+    end
+
+    it "with '0666' makes file readable and writable but not executable" do
+      @file.chmod(0666)
+      File.readable?(@filename).should == true
+      File.writable?(@filename).should == true
+      File.executable?(@filename).should == false
+    end
+
+    it "with '0111' makes file executable but not readable or writable" do
+      @file.chmod(0111)
+      File.readable?(@filename).should == false
+      File.writable?(@filename).should == false
+      File.executable?(@filename).should == true
+    end
+
+    it "modifies the permission bits of the files specified" do
+      @file.chmod(0755)
+      File.stat(@filename).mode.should == 33261
+    end
+  end
+end
+
+describe "File.chmod" do
+  before :each do
+    @file = tmp('i_exist')
+    File.open(@file, 'w') {}
+    @count = File.chmod(0755, @file)
+  end
+
+  after :each do
+    File.delete(@file) if File.exist?(@file)
+  end
+
+  it "returns the number of files modified" do
+    @count.should == 1
+  end
+
+  platform_is_not :freebsd do
+    it "always succeeds with any numeric values" do
+      vals = [-2**30, -2**16, -2**8, -2, -1,
+        -0.5, 0, 1, 2, 5.555575, 16, 32, 64, 2**8, 2**16, 2**30]
+      vals.each { |v|
+        lambda { File.chmod(v, @file) }.should_not raise_error
+      }
+    end
+  end
+
+  # -256, -2 and -1 raise Errno::E079 on FreeBSD
+  platform_is :freebsd do
+    it "always succeeds with any numeric values" do
+      vals = [-2**30, -2**16, #-2**8, -2, -1,
+        -0.5, 0, 1, 2, 5.555575, 16, 32, 64, 2**8, 2**16, 2**30]
+      vals.each { |v|
+        lambda { File.chmod(v, @file) }.should_not raise_error
+      }
+    end
+  end
+
+  it "throws a TypeError if the given path is not coercable into a string" do
+    lambda { File.chmod(0, @file.to_sym) }.should raise_error(TypeError)
+  end
+
+  it "invokes to_int on non-integer argument" do
+    mode = File.stat(@file).mode
+    (obj = mock('mode')).should_receive(:to_int).and_return(mode)
+    File.chmod(obj, @file)
+    File.stat(@file).mode.should == mode
+  end
+
+  it "invokes to_str on non-string file names" do
+    mode = File.stat(@file).mode
+    (obj = mock('path')).should_receive(:to_str).and_return(@file)
+    File.chmod(mode, obj)
+    File.stat(@file).mode.should == mode
+  end
+
+  platform_is :windows do
+    it "with '0444' makes file readable and executable but not writable" do
+      File.chmod(0444, @file)
+      File.readable?(@file).should == true
+      File.writable?(@file).should == false
+      File.executable?(@file).should == true
+    end
+    
+    it "with '0644' makes file readable and writable and also executable" do
+      File.chmod(0644, @file)
+      File.readable?(@file).should == true
+      File.writable?(@file).should == true
+      File.executable?(@file).should == true
+    end
+  end
+
+  platform_is_not :windows do
+    it "with '0222' makes file writable but not readable or executable" do
+      File.chmod(0222, @file)
+      File.readable?(@file).should == false
+      File.writable?(@file).should == true
+      File.executable?(@file).should == false
+    end
+
+    it "with '0444' makes file readable but not writable or executable" do
+      File.chmod(0444, @file)
+      File.readable?(@file).should == true
+      File.writable?(@file).should == false
+      File.executable?(@file).should == false
+    end
+
+    it "with '0666' makes file readable and writable but not executable" do
+      File.chmod(0666, @file)
+      File.readable?(@file).should == true
+      File.writable?(@file).should == true
+      File.executable?(@file).should == false
+    end
+
+    it "with '0111' makes file executable but not readable or writable" do
+      File.chmod(0111, @file)
+      File.readable?(@file).should == false
+      File.writable?(@file).should == false
+      File.executable?(@file).should == true
+    end
+
+    it "modifies the permission bits of the files specified" do
+      File.stat(@file).mode.should == 33261
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/chown_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/chown_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/chown_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,130 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+as_superuser do
+  describe "File.chown" do
+    before :each do
+      @fname = tmp('file_chown_test')
+      File.open(@fname, 'w') { }
+    end
+
+    after :each do
+      File.delete @fname if File.exist? @fname
+    end
+
+    platform_is :windows do
+      it "does not modify the owner id of the file" do
+        File.chown 0, nil, @fname
+        File.stat(@fname).uid.should == 0
+        File.chown 501, nil, @fname
+        File.stat(@fname).uid.should == 0
+      end
+
+      it "does not modify the group id of the file" do
+        File.chown nil, 0, @fname
+        File.stat(@fname).gid.should == 0
+        File.chown nil, 501, @fname
+        File.stat(@fname).gid.should == 0
+      end
+    end
+
+    platform_is_not :windows do
+      it "changes the owner id of the file" do
+        File.chown 501, nil, @fname
+        File.stat(@fname).uid.should == 501
+        File.chown 0, nil, @fname
+        File.stat(@fname).uid.should == 0
+      end
+
+      it "changes the group id of the file" do
+        File.chown nil, 501, @fname
+        File.stat(@fname).gid.should == 501
+        File.chown nil, 0, @fname
+        File.stat(@fname).uid.should == 0
+      end
+
+      it "does not modify the owner id of the file if passed nil or -1" do
+        File.chown 501, nil, @fname
+        File.chown nil, nil, @fname
+        File.stat(@fname).uid.should == 501
+        File.chown nil, -1, @fname
+        File.stat(@fname).uid.should == 501
+      end
+
+      it "does not modify the group id of the file if passed nil or -1" do
+        File.chown nil, 501, @fname
+        File.chown nil, nil, @fname
+        File.stat(@fname).gid.should == 501
+        File.chown nil, -1, @fname
+        File.stat(@fname).gid.should == 501
+      end
+
+      it "returns the number of files processed" do
+        File.chown(nil, nil, @fname, @fname).should == 2
+      end
+    end
+  end
+
+  describe "File#chown" do
+    before :each do
+      @fname = tmp('file_chown_test')
+      @file = File.open(@fname, 'w')
+    end
+
+    after :each do
+      @file.close unless @file.closed?
+      File.delete @fname if File.exist? @fname
+    end
+
+    platform_is :windows do
+      it "does not modify the owner id of the file" do
+        File.chown 0, nil, @fname
+        File.stat(@fname).uid.should == 0
+        File.chown 501, nil, @fname
+        File.stat(@fname).uid.should == 0
+      end
+
+      it "does not modify the group id of the file" do
+        File.chown nil, 0, @fname
+        File.stat(@fname).gid.should == 0
+        File.chown nil, 501, @fname
+        File.stat(@fname).gid.should == 0
+      end
+    end
+
+    platform_is_not :windows do
+      it "changes the owner id of the file" do
+        @file.chown 501, nil
+        @file.stat.uid.should == 501
+        @file.chown 0, nil
+        @file.stat.uid.should == 0
+      end
+
+      it "changes the group id of the file" do
+        @file.chown nil, 501
+        @file.stat.gid.should == 501
+        @file.chown nil, 0
+        @file.stat.uid.should == 0
+      end
+
+      it "does not modify the owner id of the file if passed nil or -1" do
+        @file.chown 501, nil
+        @file.chown nil, nil
+        @file.stat.uid.should == 501
+        @file.chown nil, -1
+        @file.stat.uid.should == 501
+      end
+
+      it "does not modify the group id of the file if passed nil or -1" do
+        @file.chown nil, 501
+        @file.chown nil, nil
+        @file.stat.gid.should == 501
+        @file.chown nil, -1
+        @file.stat.gid.should == 501
+      end
+    end
+
+    it "returns 0" do
+      @file.chown(nil, nil).should == 0
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/constants/constants_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/constants/constants_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/constants/constants_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+["APPEND", "CREAT", "EXCL", "FNM_CASEFOLD",
+  "FNM_DOTMATCH", "FNM_NOESCAPE", "FNM_PATHNAME",
+  "FNM_SYSCASE", "LOCK_EX", "LOCK_NB", "LOCK_SH",
+  "LOCK_UN", "NONBLOCK", "RDONLY",
+  "RDWR", "SYNC", "TRUNC", "WRONLY"].each do |const|
+  describe "File::Constants::#{const}" do
+    it "is defined" do
+      File::Constants.const_defined?(const).should be_true
+    end
+  end
+end
+
+platform_is :windows do
+  describe "File::Constants::BINARY" do
+    it "is defined" do
+      File::Constants.const_defined?(:BINARY).should be_true
+    end
+  end
+end
+
+platform_is_not :windows do
+  describe "File::Constants::NOCTTY" do
+    it "is defined" do
+      File::Constants.const_defined?(:NOCTTY).should be_true
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/constants_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/constants_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/constants_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,141 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+# TODO: migrate these to constants/constants_spec.rb
+
+describe "File::Constants" do
+  it "match mode constants" do
+    File::FNM_NOESCAPE.should_not == nil
+    File::FNM_PATHNAME.should_not == nil
+    File::FNM_DOTMATCH.should_not == nil
+    File::FNM_CASEFOLD.should_not == nil
+    File::FNM_SYSCASE.should_not == nil
+
+    platform_is :windows do #|| VMS
+      File::FNM_SYSCASE.should == 8
+    end
+  end
+
+  # Only these constants are not inherited from the IO class
+  it "the separator constant" do
+    File::SEPARATOR.should_not == nil
+    File::Separator.should_not == nil
+    File::PATH_SEPARATOR.should_not == nil
+    File::SEPARATOR.should == "/"
+
+    platform_is :windows do #|| VMS
+      File::ALT_SEPARATOR.should_not == nil
+      File::PATH_SEPARATOR.should == ";"
+    end
+
+    platform_is_not :windows do
+      File::ALT_SEPARATOR.should == nil
+      File::PATH_SEPARATOR.should == ":"
+    end
+  end
+
+  it "the open mode constants" do
+    File::APPEND.should_not == nil
+    File::CREAT.should_not == nil
+    File::EXCL.should_not == nil
+    File::NONBLOCK.should_not == nil
+    File::RDONLY.should_not == nil
+    File::RDWR.should_not == nil
+    File::TRUNC.should_not == nil
+    File::WRONLY.should_not == nil
+
+    platform_is_not :windows do # Not sure about VMS here
+      File::NOCTTY.should_not == nil
+    end
+  end
+
+  it "lock mode constants" do
+    File::LOCK_EX.should_not == nil
+    File::LOCK_NB.should_not == nil
+    File::LOCK_SH.should_not == nil
+    File::LOCK_UN.should_not == nil
+  end
+end
+
+describe "File::Constants" do
+  # These mode and permission bits are platform dependent
+  it "File::RDONLY" do
+    defined?(File::RDONLY).should == "constant"
+  end
+
+  it "File::WRONLY" do
+    defined?(File::WRONLY).should == "constant"
+  end
+
+  it "File::CREAT" do
+    defined?(File::CREAT).should == "constant"
+  end
+
+  it "File::RDWR" do
+    defined?(File::RDWR).should == "constant"
+  end
+
+  it "File::APPEND" do
+    defined?(File::APPEND).should == "constant"
+  end
+
+  it "File::TRUNC" do
+    defined?(File::TRUNC).should == "constant"
+  end
+
+  platform_is_not :windows do # Not sure about VMS here
+    it "File::NOCTTY" do
+      defined?(File::NOCTTY).should == "constant"
+    end
+  end
+
+  it "File::NONBLOCK" do
+    defined?(File::NONBLOCK).should == "constant"
+  end
+
+  it "File::LOCK_EX" do
+    defined?(File::LOCK_EX).should == "constant"
+  end
+
+  it "File::LOCK_NB" do
+    defined?(File::LOCK_NB).should == "constant"
+  end
+
+  it "File::LOCK_SH" do
+    defined?(File::LOCK_SH).should == "constant"
+  end
+
+  it "File::LOCK_UN" do
+    defined?(File::LOCK_UN).should == "constant"
+  end
+
+  it "File::SEPARATOR" do
+    defined?(File::SEPARATOR).should == "constant"
+  end
+  it "File::Separator" do
+    defined?(File::Separator).should == "constant"
+  end
+
+  it "File::PATH_SEPARATOR" do
+    defined?(File::PATH_SEPARATOR).should == "constant"
+  end
+
+  it "File::SEPARATOR" do
+    defined?(File::SEPARATOR).should == "constant"
+    File::SEPARATOR.should == "/"
+  end
+
+  platform_is :windows do #|| VMS
+    it "File::ALT_SEPARATOR" do
+      defined?(File::ALT_SEPARATOR).should == "constant"
+      File::PATH_SEPARATOR.should == ";"
+    end
+  end
+
+  platform_is_not :windows do
+    it "File::PATH_SEPARATOR" do
+      defined?(File::PATH_SEPARATOR).should == "constant"
+      File::PATH_SEPARATOR.should == ":"
+    end
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/ctime_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/ctime_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/ctime_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,36 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "File.ctime" do
+  before :each do
+    @file = __FILE__
+  end
+
+  after :each do
+    @file = nil
+  end
+
+  it "Returns the change time for the named file (the time at which directory information about the file was changed, not the file itself)." do
+    File.ctime(@file)
+    File.ctime(@file).class.should == Time
+  end
+
+  it "raises an Errno::ENOENT exception if the file is not found" do
+    lambda { File.ctime('bogus') }.should raise_error(Errno::ENOENT)
+  end
+end
+
+describe "File#ctime" do
+  before :each do
+    @file = File.open(__FILE__)
+  end
+
+  after:each do
+    @file.close
+    @file = nil
+  end
+
+  it "Returns the change time for the named file (the time at which directory information about the file was changed, not the file itself)." do
+    @file.ctime
+    @file.ctime.class.should == Time
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/delete_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/delete_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/delete_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/unlink'
+
+describe "File.delete" do
+  it_behaves_like(:file_unlink, :delete)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/directory_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/directory_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/directory_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/directory'
+
+describe "File.directory?" do
+  it_behaves_like :file_directory, :directory?, File
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/dirname_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/dirname_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/dirname_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,95 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "File.dirname" do
+  it "returns all the components of filename except the last one" do
+    File.dirname('/home/jason').should == '/home'
+    File.dirname('/home/jason/poot.txt').should == '/home/jason'
+    File.dirname('poot.txt').should == '.'
+    File.dirname('/holy///schnikies//w00t.bin').should == '/holy///schnikies'
+    File.dirname('').should == '.'
+    File.dirname('/').should == '/'
+    File.dirname('/foo/foo').should == '/foo'
+  end
+
+  it "returns a String" do
+    File.dirname("foo").class.should == String
+  end
+
+  it "does not modify its argument" do
+    x = "/usr/bin"
+    File.dirname(x)
+    x.should == "/usr/bin"
+  end
+
+  it "returns the return all the components of filename except the last one (unix format)" do
+    File.dirname("foo").should =="."
+    File.dirname("/foo").should =="/"
+    File.dirname("/foo/bar").should =="/foo"
+    File.dirname("/foo/bar.txt").should =="/foo"
+    File.dirname("/foo/bar/baz").should =="/foo/bar"
+  end
+
+  it "returns all the components of filename except the last one (edge cases on all platforms)" do
+      File.dirname("").should == "."
+      File.dirname(".").should == "."
+      File.dirname("./").should == "."
+      File.dirname("./b/./").should == "./b"
+      File.dirname("..").should == "."
+      File.dirname("../").should == "."
+      File.dirname("/").should == "/"
+      File.dirname("/.").should == "/"
+      File.dirname("/foo/").should == "/"
+      File.dirname("/foo/.").should == "/foo"
+      File.dirname("/foo/./").should == "/foo"
+      File.dirname("/foo/../.").should == "/foo/.."
+      File.dirname("foo/../").should == "foo"
+  end
+
+  platform_is_not :windows do
+    it "returns all the components of filename except the last one (edge cases on non-windows)" do
+      File.dirname('/////').should == '/'
+      File.dirname("//foo//").should == "/"
+    end
+  end
+
+  platform_is :windows do
+    it "returns all the components of filename except the last one (edge cases on windows)" do
+      File.dirname("//foo").should == "//foo"
+      File.dirname("//foo//").should == "//foo"
+      File.dirname('/////').should == '//'
+    end
+  end
+
+  it "raises a TypeError if not passed a String type" do
+    lambda { File.dirname(nil)   }.should raise_error(TypeError)
+    lambda { File.dirname(0)     }.should raise_error(TypeError)
+    lambda { File.dirname(true)  }.should raise_error(TypeError)
+    lambda { File.dirname(false) }.should raise_error(TypeError)
+  end
+
+  # Windows specific tests
+  platform_is :windows do
+    it "returns the return all the components of filename except the last one (Windows format)" do
+      File.dirname("C:\\foo\\bar\\baz.txt").should =="C:\\foo\\bar"
+      File.dirname("C:\\foo\\bar").should =="C:\\foo"
+      File.dirname("C:\\foo\\bar\\").should == "C:\\foo"
+      File.dirname("C:\\foo").should == "C:\\"
+      File.dirname("C:\\").should =="C:\\"
+    end
+
+    it "returns the return all the components of filename except the last one (windows unc)" do
+      File.dirname("\\\\foo\\bar\\baz.txt").should == "\\\\foo\\bar"
+      File.dirname("\\\\foo\\bar\\baz").should == "\\\\foo\\bar"
+      File.dirname("\\\\foo").should =="\\\\foo"
+      File.dirname("\\\\foo\\bar").should =="\\\\foo\\bar"
+    end
+
+    it "returns the return all the components of filename except the last one (forward_slash)" do
+      File.dirname("C:/").should == "C:/"
+      File.dirname("C:/foo").should == "C:/"
+      File.dirname("C:/foo/bar").should == "C:/foo"
+      File.dirname("C:/foo/bar/").should == "C:/foo"
+      File.dirname("C:/foo/bar//").should == "C:/foo"
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/executable_real_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/executable_real_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/executable_real_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/executable_real'
+
+describe "File.executable_real?" do
+  it_behaves_like :file_executable_real, :executable_real?, File
+  it_behaves_like :file_executable_real_missing, :executable_real?, File
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/executable_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/executable_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/executable_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/executable'
+
+describe "File.executable?" do
+  it_behaves_like :file_executable, :executable?, File
+  it_behaves_like :file_executable_missing, :executable?, File
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/exist_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/exist_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/exist_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/exist'
+
+describe "File.exist?" do
+  it_behaves_like(:file_exist, :exist?, File)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/exists_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/exists_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/exists_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/exist'
+
+describe "File.exists?" do
+  it_behaves_like(:file_exist, :exists?, File)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/expand_path_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/expand_path_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/expand_path_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,98 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "File.expand_path" do
+  before :each do
+    platform_is :windows do
+      @base = `cd`.chomp.tr '\\', '/'
+      @tmpdir = "c:/tmp"
+      @rootdir = "c:/"
+    end
+
+    platform_is_not :windows do
+      @base = Dir.pwd
+      @tmpdir = "/tmp"
+      @rootdir = "/"
+    end
+  end
+
+  it "converts a pathname to an absolute pathname" do
+    File.expand_path('').should == @base
+    File.expand_path('a').should == File.join(@base, 'a')
+    File.expand_path('a', nil).should == File.join(@base, 'a')
+  end
+
+  not_compliant_on :ironruby do
+    it "converts a pathname to an absolute pathname, Ruby-Talk:18512 " do
+      # Because of Ruby-Talk:18512
+      File.expand_path('a.').should == File.join(@base, 'a.')
+      File.expand_path('.a').should == File.join(@base, '.a')
+      File.expand_path('a..').should == File.join(@base, 'a..')
+      File.expand_path('..a').should == File.join(@base, '..a')
+      File.expand_path('a../b').should == File.join(@base, 'a../b')
+    end
+  end
+
+  it "converts a pathname to an absolute pathname, using a complete path" do
+    File.expand_path("", "#{@tmpdir}").should == "#{@tmpdir}"
+    File.expand_path("a", "#{@tmpdir}").should =="#{@tmpdir}/a"
+    File.expand_path("../a", "#{@tmpdir}/xxx").should == "#{@tmpdir}/a"
+    File.expand_path(".", "#{@rootdir}").should == "#{@rootdir}"
+  end
+
+  # FIXME: do not use conditionals like this around #it blocks
+  unless not home = ENV['HOME']
+    it "converts a pathname to an absolute pathname, using ~ (home) as base" do
+      File.expand_path('~').should == home
+      File.expand_path('~', '/tmp/gumby/ddd').should == home
+      File.expand_path('~/a', '/tmp/gumby/ddd').should == File.join(home, 'a')
+    end
+  end
+
+  platform_is_not :windows do
+    # FIXME: these are insane!
+    it "expand path with " do
+      File.expand_path("../../bin", "/tmp/x").should == "/bin"
+      File.expand_path("../../bin", "/tmp").should == "/bin"
+      File.expand_path("../../bin", "/").should == "/bin"
+      File.expand_path("../../bin", "tmp/x").should == File.join(@base, 'bin')
+    end
+
+    it "expand_path for commoms unix path  give a full path" do
+      File.expand_path('/tmp/').should =='/tmp'
+      File.expand_path('/tmp/../../../tmp').should == '/tmp'
+      File.expand_path('').should == Dir.pwd
+      File.expand_path('./////').should == Dir.pwd
+      File.expand_path('.').should == Dir.pwd
+      File.expand_path(Dir.pwd).should == Dir.pwd
+      File.expand_path('~/').should == ENV['HOME']
+      File.expand_path('~/..badfilename').should == "#{ENV['HOME']}/..badfilename"
+      File.expand_path('..').should == Dir.pwd.split('/')[0...-1].join("/")
+      File.expand_path('//').should == '//'
+      File.expand_path('~/a','~/b').should == "#{ENV['HOME']}/a"
+    end
+
+    it "raises an ArgumentError if the path is not valid" do
+      lambda { File.expand_path("~a_fake_file") }.should raise_error(ArgumentError)
+    end
+
+    it "expands ~ENV['USER'] to the user's home directory" do
+      File.expand_path("~#{ENV['USER']}").should == ENV['HOME']
+      File.expand_path("~#{ENV['USER']}/a").should == "#{ENV['HOME']}/a"
+    end
+  end
+
+  it "raises an ArgumentError is not passed one or two arguments" do
+    lambda { File.expand_path }.should raise_error(ArgumentError)
+    lambda { File.expand_path '../', 'tmp', 'foo' }.should raise_error(ArgumentError)
+  end
+
+  it "raises a TypeError if not passed a String type" do
+    lambda { File.expand_path(1)    }.should raise_error(TypeError)
+    lambda { File.expand_path(nil)  }.should raise_error(TypeError)
+    lambda { File.expand_path(true) }.should raise_error(TypeError)
+  end
+
+  it "expands /./dir to /dir" do
+    File.expand_path("/./dir").should == "/dir"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/extname_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/extname_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/extname_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,41 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "File.extname" do
+  it "returns the extension (the portion of file name in path after the period)." do
+    File.extname("foo.rb").should == ".rb"
+    File.extname("/foo/bar.rb").should == ".rb"
+    File.extname("/foo.rb/bar.c").should == ".c"
+    File.extname("bar").should == ""
+    File.extname(".bashrc").should == ""
+    File.extname("/foo.bar/baz").should == ""
+    File.extname(".app.conf").should == ".conf"
+  end
+
+  it "returns the extension (the portion of file name in path after the period).(edge cases)" do
+    File.extname("").should ==  ""
+    File.extname(".").should ==  ""
+    File.extname("/").should ==  ""
+    File.extname("/.").should ==  ""
+    File.extname("..").should ==  ""
+    File.extname("...").should ==  ""
+    File.extname("....").should ==  ""
+    File.extname(".foo.").should ==  ""
+    File.extname("foo.").should ==  ""
+  end
+
+  it "returns only the last extension of a file with several dots" do
+    File.extname("a.b.c.d.e").should == ".e"
+  end
+
+  it "raises a TypeError if not passed a String type" do
+    lambda { File.extname(nil)   }.should raise_error(TypeError)
+    lambda { File.extname(0)     }.should raise_error(TypeError)
+    lambda { File.extname(true)  }.should raise_error(TypeError)
+    lambda { File.extname(false) }.should raise_error(TypeError)
+  end
+
+  it "raises an ArgumentError if not passed one argument" do
+    lambda { File.extname }.should raise_error(ArgumentError)
+    lambda { File.extname("foo.bar", "foo.baz") }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/file_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/file_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/file_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/file'
+
+describe "File" do
+  it "includes File::Constants" do
+    File.include?(File::Constants).should == true
+  end
+end
+
+describe "File.file?" do
+  it_behaves_like :file_file, :file?, File
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/fixtures/file_types.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/fixtures/file_types.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/fixtures/file_types.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,65 @@
+module FileSpecs
+  # Try to set up known locations of each filetype
+  def self.reconfigure()
+    @file   = tmp("test.txt")
+    @dir    = Dir.pwd
+    @fifo   = tmp("test_fifo")
+
+    platform_is_not :windows do
+      @block  = `find /dev /devices -type b 2> /dev/null`.split("\n").first
+      @char   = `find /dev /devices -type c 2> /dev/null`.split("\n").last
+
+      %w[/dev /usr/bin /usr/local/bin].each do |dir|
+        links = `find #{dir} -type l 2> /dev/null`.split("\n")
+        next if links.empty?
+        @link = links.first
+        break
+      end
+
+    end
+  end
+
+  # TODO: Automatic reload mechanism
+  reconfigure
+
+  def self.normal_file()
+    File.open(@file, "w") {} # 'Touch'
+    yield @file
+  ensure
+    File.unlink @file
+  end
+
+  def self.directory()
+    yield @dir
+  end
+
+  # TODO: need a platform-independent helper here
+  def self.fifo()
+    system "mkfifo #{@fifo} 2> /dev/null"
+    yield @fifo
+  ensure
+    File.unlink @fifo
+  end
+
+  def self.block_device()
+    yield @block
+  end
+
+  def self.character_device()
+    yield @char
+  end
+
+  def self.symlink()
+    yield @link
+  end
+
+  def self.socket()
+    require 'socket'
+    name = tmp("ftype_socket.socket")
+    File.delete name if File.exist? name
+    socket = UNIXServer.new name
+    yield name
+    socket.close
+    File.delete name if File.exist? name
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/flock_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/flock_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/flock_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "File#flock" do
+  before :each do
+    system "echo 'rubinius' > flock_test"
+  end
+
+  after :each do
+    File.delete('flock_test') if File.exist?('flock_test')
+  end
+
+  it "should lock a file" do
+    f = File.open('flock_test', "r")
+    f.flock(File::LOCK_EX).should == 0
+    File.open('flock_test', "w") do |f2|
+      f2.flock(File::LOCK_EX | File::LOCK_NB).should == false
+    end
+    f.flock(File::LOCK_UN).should == 0
+    File.open('flock_test', "w") do |f2|
+      f2.flock(File::LOCK_EX | File::LOCK_NB).should == 0
+      f2.flock(File::LOCK_UN).should == 0
+    end
+    f.close
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/fnmatch_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/fnmatch_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/fnmatch_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/fnmatch'
+
+describe "File.fnmatch" do
+  it_behaves_like(:file_fnmatch, :fnmatch)
+end
+
+describe "File.fnmatch?" do
+  it_behaves_like(:file_fnmatch, :fnmatch?)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/ftype_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/ftype_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/ftype_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,67 @@
+require "#{File.dirname(__FILE__)}/../../spec_helper"
+require "#{File.dirname(__FILE__)}/fixtures/file_types.rb"
+
+describe "File.ftype" do
+  it "raises ArgumentError if not given exactly one filename" do
+    lambda { File.ftype }.should raise_error(ArgumentError)
+    lambda { File.ftype('blah', 'bleh') }.should raise_error(ArgumentError)
+  end
+
+  it "raises Errno::ENOENT if the file is not valid" do
+    l = lambda { File.ftype("/#{$$}#{Time.now.to_f}") }
+    l.should raise_error(Errno::ENOENT)
+  end
+
+  it "returns a String " do
+    FileSpecs.normal_file do |file|
+      File.ftype(file).class.should == String
+    end
+  end
+
+  it "returns 'file' when the file is a file" do
+    FileSpecs.normal_file do |file|
+      File.ftype(file).should == 'file'
+    end
+  end
+
+  it "returns 'directory' when the file is a dir" do
+    FileSpecs.directory do |dir|
+      File.ftype(dir).should == 'directory'
+    end
+  end
+
+  # Both FreeBSD and Windows does not have block devices
+  platform_is_not :freebsd, :windows do
+    it "returns 'blockSpecial' when the file is a block" do
+      FileSpecs.block_device do |block|
+        File.ftype(block).should == 'blockSpecial'
+      end
+    end
+  end
+
+  platform_is_not :windows do
+    it "returns 'characterSpecial' when the file is a char"  do
+      FileSpecs.character_device do |char|
+        File.ftype(char).should == 'characterSpecial'
+      end
+    end
+
+    it "returns 'link' when the file is a link" do
+      FileSpecs.symlink do |link|
+        File.ftype(link).should == 'link'
+      end
+    end
+
+    it "returns fifo when the file is a fifo" do
+      FileSpecs.fifo do |fifo|
+        File.ftype(fifo).should == 'fifo'
+      end
+    end
+
+    it "returns 'socket' when the file is a socket" do
+      FileSpecs.socket do |socket|
+        File.ftype(socket).should == 'socket'
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/grpowned_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/grpowned_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/grpowned_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/grpowned'
+
+describe "File.grpowned?" do
+  it_behaves_like :file_grpowned, :grpowned?, File
+
+  it "returns false if file the does not exist" do
+    File.grpowned?("i_am_a_bogus_file").should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/identical_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/identical_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/identical_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/identical'
+
+describe "File.identical?" do
+  it_behaves_like :file_identical, :identical?, File
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "File#initialize" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../io/fixtures/classes'
+
+describe "File#inspect" do
+  it "returns string that contains 'closed' when invoked on closed file" do
+    IOSpecs.closed_file.inspect.should =~ /closed/
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/join_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/join_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/join_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,133 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "File.join" do
+  it "returns an empty string when given no arguments" do
+    File.join.should == ""
+  end
+
+  it "when given a single argument returns an equal string" do
+    File.join("").should == ""
+    File.join("usr").should == "usr"
+  end
+
+  it "joins parts using File::SEPARATOR" do
+    File.join('usr', 'bin').should == "usr/bin"
+  end
+
+  it "supports any number of arguments" do
+    File.join("a", "b", "c", "d").should == "a/b/c/d"
+  end
+
+  platform_is :windows do
+    it "joins parts using File::ALT_SEPARATOR on windows" do
+      File.join("C:\\", 'windows').should == "C:\\windows"
+      File.join("\\\\", "usr").should == "\\\\usr"
+    end
+  end
+
+  it "flattens nested arrays" do
+    File.join(["a", "b", "c"]).should == "a/b/c"
+    File.join(["a", ["b", ["c"]]]).should == "a/b/c"
+  end
+  
+  it "inserts the separator in between empty strings and arrays" do  
+    File.join("").should == ""
+    File.join("", "").should == "/"
+    File.join(["", ""]).should == "/"
+    File.join("a", "").should == "a/"
+    File.join("", "a").should == "/a"
+
+    File.join([]).should == ""
+    File.join([], []).should == "/"
+    File.join([[], []]).should == "/"
+    File.join("a", []).should == "a/"
+    File.join([], "a").should == "/a"
+  end
+
+  it "handles leading parts edge cases" do
+    File.join("/bin")     .should == "/bin"
+    File.join("", "bin")  .should == "/bin"
+    File.join("/", "bin") .should == "/bin"
+    File.join("/", "/bin").should == "/bin"
+  end
+
+  it "handles trailing parts edge cases" do
+    File.join("bin", "")  .should == "bin/"
+    File.join("bin/")     .should == "bin/"
+    File.join("bin/", "") .should == "bin/"
+    File.join("bin", "/") .should == "bin/"
+    File.join("bin/", "/").should == "bin/"
+  end
+
+  it "handles middle parts edge cases" do
+    File.join("usr",   "", "bin") .should == "usr/bin"
+    File.join("usr/",  "", "bin") .should == "usr/bin"
+    File.join("usr",   "", "/bin").should == "usr/bin"
+    File.join("usr/",  "", "/bin").should == "usr/bin"
+  end
+  
+  # TODO: Repeating items in recursive array seems like a bug.
+  it "handles recursive arrays" do
+    parts = []
+    parts << parts
+    File.join(parts).should == '[...]'
+
+    parts = ["one", "two"]
+    parts << parts
+    File.join(parts).should == 'one/two/one/two/[...]'
+
+    parts << "three"
+    parts << "four"
+    File.join(parts).should == 'one/two/one/two/[...]/three/four/three/four'
+
+    parts = [["one", "two"], ["three", "four"]]
+    parts << parts
+    File.join(parts).should == 'one/two/three/four/one/two/three/four/[...]'
+
+    a = ['a']
+    a << a
+    File.join(a).should == 'a/a/[...]'
+    File.join([a]).should == 'a/a/[...]'
+
+    a = ['a']
+    b = ['b']
+    a << b
+    b << a
+    File.join(a).should == "a/b/[...]"
+
+    a = []
+    b = []
+    a << b
+    b << a
+    File.join(a).should == '[...]'
+
+    a = ['a']
+    a << a
+    File.join(  a  ).should      == "a/a/[...]"
+    File.join( [a] ).should      == "a/a/[...]"
+    File.join([[a]]).should      == "a/a/[...]"
+    File.join(  a, 'b'  ).should == "a/a/[...]/b"
+    File.join( [a, 'b'] ).should == "a/a/[...]/b"
+    File.join([[a, 'b']]).should == "a/a/[...]/b"
+    File.join([[a], 'b']).should == "a/a/[...]/b"
+  end
+
+  it "doesn't remove File::SEPARATOR from the middle of arguments" do
+    path = File.join "file://usr", "bin"
+    path.should == "file://usr/bin"
+  end
+
+  it "raises a TypeError exception when args are nil" do
+    lambda { File.join nil }.should raise_error(TypeError)
+  end
+
+  it "calls #to_str" do
+    lambda { File.join(mock('x')) }.should raise_error(TypeError)
+
+    bin = mock("bin")
+    bin.should_receive(:to_str).exactly(:twice).and_return("bin")
+    File.join(bin).should == "bin"
+    File.join("usr", bin).should == "usr/bin"
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/lchmod_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/lchmod_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/lchmod_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "File.lchmod" do
+  platform_is_not :os => [:linux, :windows, :openbsd] do
+    before :each do
+      @fname = tmp('file_chmod_test')
+      @lname = @fname + '.lnk'
+      File.delete @fname rescue nil
+      File.delete @lname rescue nil
+      File.open(@fname, 'w') { |f| f.write "rubinius" }
+      File.symlink @fname, @lname
+    end
+    
+    after :each do
+      # the link should be removed first
+      File.delete @lname if File.exist? @lname
+      File.delete @fname if File.exist? @fname
+    end
+    
+    it "changes the file mode of the link and not of the file" do
+      File.chmod(0222, @lname).should  == 1
+      File.lchmod(0755, @lname).should == 1
+      
+      File.lstat(@lname).executable?.should == true
+      File.lstat(@lname).readable?.should   == true
+      File.lstat(@lname).writable?.should   == true
+  
+      File.stat(@lname).executable?.should == false
+      File.stat(@lname).readable?.should   == false
+      File.stat(@lname).writable?.should   == true
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/lchown_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/lchown_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/lchown_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,59 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+as_superuser do
+  describe "File.lchown" do
+    platform_is_not :windows do
+      before :each do
+        @fname = tmp('file_chown_test')
+        @lname = @fname + '.lnk'
+        File.delete @fname rescue nil
+        File.delete @lname rescue nil
+        File.open(@fname, 'w') { |f| f.chown 501, 501 }
+        File.symlink @fname, @lname
+      end
+
+      after :each do
+        File.delete @fname if File.exist? @fname
+        File.delete @lname if File.exist? @lname
+      end
+
+      it "changes the owner id of the file" do
+        File.lchown 502, nil, @lname
+        File.stat(@fname).uid.should == 501
+        File.lstat(@lname).uid.should == 502
+        File.lchown 0, nil, @lname
+        File.stat(@fname).uid.should == 501
+        File.lstat(@lname).uid.should == 0
+      end
+
+      it "changes the group id of the file" do
+        File.lchown nil, 502, @lname
+        File.stat(@fname).gid.should == 501
+        File.lstat(@lname).gid.should == 502
+        File.lchown nil, 0, @lname
+        File.stat(@fname).uid.should == 501
+        File.lstat(@lname).uid.should == 0
+      end
+
+      it "does not modify the owner id of the file if passed nil or -1" do
+        File.lchown 502, nil, @lname
+        File.lchown nil, nil, @lname
+        File.lstat(@lname).uid.should == 502
+        File.lchown nil, -1, @lname
+        File.lstat(@lname).uid.should == 502
+      end
+
+      it "does not modify the group id of the file if passed nil or -1" do
+        File.lchown nil, 502, @lname
+        File.lchown nil, nil, @lname
+        File.lstat(@lname).gid.should == 502
+        File.lchown nil, -1, @lname
+        File.lstat(@lname).gid.should == 502
+      end
+
+      it "returns the number of files processed" do
+        File.lchown(nil, nil, @lname, @lname).should == 2
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/link_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/link_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/link_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,41 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "File.link" do
+  before :each do
+    @file = "test.txt"
+    @link = "test.lnk"
+    File.delete(@link) if File.exist?(@link)
+    File.delete(@file) if File.exist?(@file)
+    File.open(@file,"w+")
+  end
+
+  after :each do
+    File.unlink(@link) if File.exist?(@link)
+    File.delete(@file) if File.exist?(@file)
+    @link = nil
+  end
+
+  platform_is_not :windows do
+    it "link a file with another" do
+      File.link(@file, @link).should == 0
+      File.exists?(@link).should == true
+      File.identical?(@file, @link).should == true
+    end
+
+    it "raises an Errno::EEXIST if the target already exists" do
+      File.link(@file, @link)
+      lambda { File.link(@file, @link) }.should raise_error(Errno::EEXIST)
+    end
+
+    it "raises an ArgumentError if not passed two arguments" do
+      lambda { File.link                      }.should raise_error(ArgumentError)
+      lambda { File.link(@file)               }.should raise_error(ArgumentError)
+      lambda { File.link(@file, @link, @file) }.should raise_error(ArgumentError)
+    end
+
+    it "raises a TypeError if not passed String types" do
+      lambda { File.link(@file, nil) }.should raise_error(TypeError)
+      lambda { File.link(@file, 1)   }.should raise_error(TypeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/lstat_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/lstat_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/lstat_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/stat'
+
+describe "File.lstat" do
+  it_behaves_like :file_stat, :lstat
+end
+
+describe "File.lstat" do
+  
+  before :each do
+    @file = tmp('i_exist')
+    @link = tmp('i_am_a_symlink')
+    File.open(@file,'w'){|f| f.write 'rubinius'}
+    File.symlink(@file, @link)
+  end
+
+  after :each do
+    File.delete(@link) if File.exist?(@link)
+    File.delete(@file) if File.exist?(@file)
+  end
+  
+  it "returns a File::Stat object with symlink properties for a symlink" do
+    st = File.lstat(@link)
+
+    st.symlink?.should == true
+    st.file?.should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/mtime_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/mtime_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/mtime_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,37 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "File.mtime" do
+  before :each do
+    @filename = tmp('i_exist')
+    File.open(@filename, 'w') { @mtime = Time.now }
+  end
+
+  after :each do
+    File.delete(@filename) if File.exist?(@filename)
+  end
+
+  it "returns the modification Time of the file" do
+    File.mtime(@filename).class.should == Time
+    File.mtime(@filename).should be_close(@mtime, 2.0)
+  end
+
+  it "raises an Errno::ENOENT exception if the file is not found" do
+    lambda { File.mtime('bogus') }.should raise_error(Errno::ENOENT)
+  end
+end
+
+describe "File#mtime" do
+  before :each do
+    @filename = tmp('i_exist')
+    @f = File.open(@filename, 'w')
+  end
+
+  after :each do
+    File.delete(@filename) if File.exist?(@filename)
+  end
+
+  it "returns the modification Time of the file" do
+    @f.mtime.class.should == Time
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,142 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "File.new" do
+  before :each do
+    @file = tmp('test.txt')
+    @fh = nil
+    @flags = File::CREAT | File::TRUNC | File::WRONLY
+    File.open(@file, "w") {} # touch
+  end
+
+  after :each do
+   @fh.close if @fh 
+    File.delete(@file) if File.exists?(@file)
+    @fh    = nil
+    @file  = nil
+    @flags = nil
+  end
+
+  it "return a new File with mode string" do
+    @fh = File.new(@file, 'w')
+    @fh.class.should == File
+    File.exists?(@file).should == true
+  end
+
+  it "return a new File with mode num" do
+    @fh = File.new(@file, @flags)
+    @fh.class.should == File
+    File.exists?(@file).should == true
+  end
+
+  it "return a new File with modus num and permissions" do
+    File.delete(@file)
+    File.umask(0011)
+    @fh = File.new(@file, @flags, 0755)
+    @fh.class.should == File
+    File.stat(@file).mode.to_s(8).should == "100744"
+    File.exists?(@file).should == true
+  end
+
+  it "creates the file and returns writable descriptor when called with 'w' mode and r-o permissions" do
+    # it should be possible to write to such a file via returned descriptior,
+    # even though the file permissions are r-r-r.
+
+    File.delete(@file) if File.exists?(@file)
+    begin
+      f = File.new(@file, "w", 0444)
+      lambda { f.puts("test") }.should_not raise_error(IOError)
+    ensure
+      f.close
+    end
+    File.exist?(@file).should == true
+    File.read(@file).should == "test\n"
+  end
+
+  it "opens the existing file, does not change permissions even when they are specified" do
+    File.chmod(0664, @file)           # r-w perms
+    orig_perms = File.stat(@file).mode.to_s(8)
+    begin
+      f = File.new(@file, "w", 0444)    # r-o perms, but they should be ignored
+      f.puts("test")
+    ensure
+      f.close
+    end
+    File.stat(@file).mode.to_s(8).should == orig_perms
+
+    # it should be still possible to read from the file
+    File.read(@file).should == "test\n"
+  end
+
+  it "return a new File with modus fd " do
+    begin
+      @fh_orig = File.new(@file)
+      @fh = File.new(@fh_orig.fileno)
+      @fh.class.should == File
+      File.exists?(@file).should == true
+    ensure
+      @fh.close rescue nil if @fh
+      @fh = nil
+      @fh_orig.close rescue nil if @fh_orig
+      @fh_orig = nil
+    end
+  end
+
+  it "create a new file when use File::EXCL mode " do
+    @fh = File.new(@file, File::EXCL)
+    @fh.class.should == File
+    File.exists?(@file).should == true
+  end
+
+  it "raises an Errorno::EEXIST if the file exists when create a new file with File::CREAT|File::EXCL" do
+    lambda { @fh = File.new(@file, File::CREAT|File::EXCL) }.should raise_error(Errno::EEXIST)
+  end
+
+  it "create a new file when use File::WRONLY|File::APPEND mode" do
+    @fh = File.new(@file, File::WRONLY|File::APPEND)
+    @fh.class.should == File
+    File.exists?(@file).should == true
+  end
+
+  it "raises an Errno::EINVAL error with File::APPEND" do
+    lambda { @fh = File.new(@file, File::APPEND) }.should raise_error(Errno::EINVAL)
+  end
+
+  it "raises an Errno::EINVAL error with File::RDONLY|File::APPEND" do
+    lambda { @fh = File.new(@file, File::RDONLY|File::APPEND) }.should raise_error(Errno::EINVAL)
+  end
+
+  it "raises an Errno::EINVAL error with File::RDONLY|File::WRONLY" do
+    @fh = File.new(@file, File::RDONLY|File::WRONLY)
+    @fh.class.should == File
+    File.exists?(@file).should == true
+  end
+
+
+  it "create a new file when use File::WRONLY|File::TRUNC mode" do
+    @fh = File.new(@file, File::WRONLY|File::TRUNC)
+    @fh.class.should == File
+    File.exists?(@file).should == true
+  end
+
+  it "coerces filename using to_str" do
+    name = mock("file")
+    name.should_receive(:to_str).and_return(@file)
+    File.new(name, "w") { }
+    File.exists?(@file).should == true
+  end
+
+  specify  "expected errors " do
+    lambda { File.new(true)  }.should raise_error(TypeError)
+    lambda { File.new(false) }.should raise_error(TypeError)
+    lambda { File.new(nil)   }.should raise_error(TypeError)
+    lambda { File.new(-1) }.should raise_error(Errno::EBADF)
+    lambda { File.new(@file, File::CREAT, 0755, 'test') }.should raise_error(ArgumentError)
+  end
+
+  # You can't alter mode or permissions when opening a file descriptor
+  #
+  it "can't alter mode or permissions when opening a file" do
+    @fh = File.new(@file)
+    lambda { File.new(@fh.fileno, @flags) }.should raise_error(Errno::EINVAL)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/open_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/open_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/open_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,545 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "File.open" do
+  before :all do
+    @file = tmp("test.txt")
+    File.delete(@file) if File.exist?(@file)
+    File.delete("fake") if File.exist?("fake")
+  end
+
+  before :each do
+    @fh = @fd = nil
+    @flags = File::CREAT | File::TRUNC | File::WRONLY
+    File.open(@file, "w") {} # touch
+  end
+
+  after :each do
+    File.delete(@file) if File.exist?(@file)
+    File.delete("fake") if File.exist?("fake")
+    @fh.close if @fh and not @fh.closed?
+  end
+
+  it "with block does not raise error when file is closed inside the block" do
+    lambda {
+      @fh = File.open(@file) { |fh| fh.close; fh }
+    }.should_not raise_error
+    @fh.closed?.should == true
+  end
+
+  it "with a block invokes close on opened file when exiting the block" do
+    file = File.open(@file, 'r') do |f|
+      class << f
+        @res = "close was not invoked"
+        alias_method(:close_orig, :close)
+        def close; close_orig; @res = "close was invoked"; end
+        def to_s;  @res; end
+      end
+      f
+    end
+    file.to_s.should == "close was invoked"
+  end
+
+  it "with a block propagates non-StandardErrors produced by close" do
+    lambda {
+      File.open(@file, 'r') do |f|
+        class << f
+          alias_method(:close_orig, :close)
+          def close
+            close_orig
+            raise Exception, "exception out of close"
+          end
+        end
+      end
+    }.should raise_error(Exception)
+  end
+
+  it "with a block swallows StandardErrors produced by close" do
+    File.open(@file, 'r') do |f|
+      class << f
+        alias_method(:close_orig, :close)
+        def close
+          raise IOError
+        end
+      end
+    end.should be_nil
+  end
+
+  it "opens the file (basic case)" do
+    @fh = File.open(@file)
+    @fh.should be_kind_of(File)
+    File.exist?(@file).should == true
+  end
+
+  it "opens file when call with a block (basic case)" do
+    File.open(@file){ |fh| @fd = fh.fileno }
+    lambda { File.open(@fd) }.should raise_error(SystemCallError) # Should be closed by block
+    File.exist?(@file).should == true
+  end
+
+  it "opens with mode string" do
+    @fh = File.open(@file, 'w')
+    @fh.should be_kind_of(File)
+    File.exist?(@file).should == true
+  end
+
+  it "opens a file with mode string and block" do
+    File.open(@file, 'w'){ |fh| @fd = fh.fileno }
+    lambda { File.open(@fd) }.should raise_error(SystemCallError)
+    File.exist?(@file).should == true
+  end
+
+  it "opens a file with mode num" do
+    @fh = File.open(@file, @flags)
+    @fh.should be_kind_of(File)
+    File.exist?(@file).should == true
+  end
+
+  it "opens a file with mode num and block" do
+    File.open(@file, 'w'){ |fh| @fd = fh.fileno }
+    lambda { File.open(@fd) }.should raise_error(SystemCallError)
+    File.exist?(@file).should == true
+  end
+
+  # For this test we delete the file first to reset the perms
+  it "opens the file when passed mode, num and permissions" do
+    File.delete(@file)
+    File.umask(0011)
+    @fh = File.open(@file, @flags, 0755)
+    @fh.should be_kind_of(File)
+    @fh.lstat.mode.to_s(8).should == "100744"
+    File.exist?(@file).should == true
+  end
+
+  # For this test we delete the file first to reset the perms
+  it "opens the file when passed mode, num, permissions and block" do
+    File.delete(@file)
+    File.umask(0022)
+    File.open(@file, "w", 0755){ |fh| @fd = fh.fileno }
+    lambda { File.open(@fd) }.should raise_error(SystemCallError)
+    File.stat(@file).mode.to_s(8).should == "100755"
+    File.exist?(@file).should == true
+  end
+
+  it "creates the file and returns writable descriptor when called with 'w' mode and r-o permissions" do
+    # it should be possible to write to such a file via returned descriptior,
+    # even though the file permissions are r-r-r.
+
+    File.delete(@file) if File.exists?(@file)
+    File.open(@file, "w", 0444){ |f|
+      lambda { f.puts("test") }.should_not raise_error(IOError)
+    }
+    File.exist?(@file).should == true
+    File.read(@file).should == "test\n"
+  end
+
+  it "opens the existing file, does not change permissions even when they are specified" do
+    File.chmod(0664, @file)           # r-w perms
+    orig_perms = File.stat(@file).mode.to_s(8)
+    File.open(@file, "w", 0444){ |f|  # r-o perms, but they should be ignored
+      lambda { f.puts("test") }.should_not raise_error(IOError)
+    }
+    # check that original permissions preserved
+    File.stat(@file).mode.to_s(8).should == orig_perms
+
+    # it should be still possible to read from the file
+    File.read(@file).should == "test\n"
+  end
+
+  it "creates a new write-only file when invoked with 'w' and '0222'" do
+    File.delete(@file) if File.exists?(@file)
+    File.open(@file, 'w', 0222) {}
+    File.readable?(@file).should == false
+    File.writable?(@file).should == true
+  end
+
+  it "opens the file when call with fd" do
+    @fh = File.open(@file)
+    @fh = File.open(@fh.fileno)
+    @fh.should be_kind_of(File)
+    File.exist?(@file).should == true
+  end
+
+  it "opens a file with a file descriptor d and a block" do
+    @fh = File.open(@file)
+    @fh.should be_kind_of(File)
+    File.open(@fh.fileno) { |fh| @fd = fh.fileno; @fh.close }
+    lambda { File.open(@fd) }.should raise_error(SystemCallError)
+    File.exist?(@file).should == true
+  end
+
+  it "opens a file that no exists when use File::WRONLY mode" do
+    lambda { File.open("fake", File::WRONLY) }.should raise_error(Errno::ENOENT)
+  end
+
+  it "opens a file that no exists when use File::RDONLY mode" do
+    lambda { File.open("fake", File::RDONLY) }.should raise_error(Errno::ENOENT)
+  end
+
+  it "opens a file that no exists when use 'r' mode" do
+    lambda { File.open("fake", 'r') }.should raise_error(Errno::ENOENT)
+  end
+
+  it "opens a file that no exists when use File::EXCL mode" do
+    lambda { File.open("fake", File::EXCL) }.should raise_error(Errno::ENOENT)
+  end
+
+  it "opens a file that no exists when use File::NONBLOCK mode" do
+    lambda { File.open("fake", File::NONBLOCK) }.should raise_error(Errno::ENOENT)
+  end
+
+  platform_is_not :openbsd do
+    it "opens a file that no exists when use File::TRUNC mode" do
+      lambda { File.open("fake", File::TRUNC) }.should raise_error(Errno::ENOENT)
+    end
+  end
+
+  platform_is :openbsd do
+    it "opens a file that no exists when use File::TRUNC mode" do
+      lambda { File.open("fake", File::TRUNC) }.should raise_error(Errno::EINVAL)
+    end
+  end
+
+  it "opens a file that no exists when use File::NOCTTY mode" do
+    lambda { File.open("fake", File::NOCTTY) }.should raise_error(Errno::ENOENT)
+  end
+
+  it "opens a file that no exists when use File::CREAT mode" do
+    @fh = File.open("fake", File::CREAT) { |f| f }
+    @fh.should be_kind_of(File)
+    File.exist?(@file).should == true
+  end
+
+  it "opens a file that no exists when use 'a' mode" do
+    @fh = File.open("fake", 'a') { |f| f }
+    @fh.should be_kind_of(File)
+    File.exist?(@file).should == true
+  end
+
+  it "opens a file that no exists when use 'w' mode" do
+    @fh = File.open("fake", 'w') { |f| f }
+    @fh.should be_kind_of(File)
+    File.exist?(@file).should == true
+  end
+
+  # Check the grants associated to the differents open modes combinations.
+  it "raises an ArgumentError exception when call with an unknown mode" do
+    lambda { File.open(@file, "q") }.should raise_error(ArgumentError)
+  end
+
+  it "can read in a block when call open with RDONLY mode" do
+    File.open(@file, File::RDONLY) do |f|
+      f.gets.should == nil
+    end
+  end
+
+  it "can read in a block when call open with 'r' mode" do
+    File.open(@file, "r") do |f|
+      f.gets.should == nil
+    end
+  end
+
+  it "raises an IO exception when write in a block opened with RDONLY mode" do
+    File.open(@file, File::RDONLY) do |f|
+      lambda { f.puts "writing ..." }.should raise_error(IOError)
+    end
+  end
+
+  it "raises an IO exception when write in a block opened with 'r' mode" do
+    File.open(@file, "r") do |f|
+      lambda { f.puts "writing ..." }.should raise_error(IOError)
+    end
+  end
+
+  it "can't write in a block when call open with File::WRONLY||File::RDONLY mode" do
+    File.open(@file, File::WRONLY|File::RDONLY ) do |f|
+      f.puts("writing").should == nil
+    end
+  end
+
+  it "can't read in a block when call open with File::WRONLY||File::RDONLY mode" do
+    lambda {
+      File.open(@file, File::WRONLY|File::RDONLY ) do |f|
+        f.gets.should == nil
+      end
+    }.should raise_error(IOError)
+  end
+
+  it "can write in a block when call open with WRONLY mode" do
+    File.open(@file, File::WRONLY) do |f|
+      f.puts("writing").should == nil
+    end
+  end
+
+  it "can write in a block when call open with 'w' mode" do
+    File.open(@file, "w") do |f|
+      f.puts("writing").should == nil
+    end
+  end
+
+  it "raises an IOError when read in a block opened with WRONLY mode" do
+    File.open(@file, File::WRONLY) do |f|
+      lambda { f.gets  }.should raise_error(IOError)
+    end
+  end
+
+  it "raises an IOError when read in a block opened with 'w' mode" do
+    File.open(@file, "w") do |f|
+      lambda { f.gets   }.should raise_error(IOError)
+    end
+  end
+
+  it "raises an IOError when read in a block opened with 'a' mode" do
+    File.open(@file, "a") do |f|
+      lambda { f.gets  }.should raise_error(IOError)
+    end
+  end
+
+  it "raises an IOError when read in a block opened with 'a' mode" do
+    File.open(@file, "a") do |f|
+      f.puts("writing").should == nil
+      lambda { f.gets }.should raise_error(IOError)
+    end
+  end
+
+  it "raises an IOError when read in a block opened with 'a' mode" do
+    File.open(@file, File::WRONLY|File::APPEND ) do |f|
+      lambda { f.gets }.should raise_error(IOError)
+    end
+  end
+
+  it "raises an IOError when read in a block opened with File::WRONLY|File::APPEND mode" do
+    File.open(@file, File::WRONLY|File::APPEND ) do |f|
+      f.puts("writing").should == nil
+      lambda { f.gets }.should raise_error(IOError)
+    end
+  end
+
+  ruby_version_is "" ... "1.9" do
+    it "raises an Errno::EINVAL when read in a block opened with File::RDONLY|File::APPEND mode" do
+      lambda {
+        File.open(@file, File::RDONLY|File::APPEND ) do |f|
+          f.puts("writing")
+        end
+      }.should raise_error(Errno::EINVAL)
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "raises an IOError when read in a block opened with File::RDONLY|File::APPEND mode" do
+      lambda {
+        File.open(@file, File::RDONLY|File::APPEND ) do |f|
+          f.puts("writing")
+        end
+      }.should raise_error(IOError)
+    end
+  end
+
+  it "can read and write in a block when call open with RDWR mode" do
+    File.open(@file, File::RDWR) do |f|
+      f.gets.should == nil
+      f.puts("writing").should == nil
+      f.rewind
+      f.gets.should == "writing\n"
+    end
+  end
+
+  it "can't read in a block when call open with File::EXCL mode" do
+    lambda {
+      File.open(@file, File::EXCL) do |f|
+        f.puts("writing").should == nil
+      end
+    }.should raise_error(IOError)
+  end
+
+  it "can read in a block when call open with File::EXCL mode" do
+    File.open(@file, File::EXCL) do |f|
+      f.gets.should == nil
+    end
+  end
+
+  it "can read and write in a block when call open with File::RDWR|File::EXCL mode" do
+    File.open(@file, File::RDWR|File::EXCL) do |f|
+      f.gets.should == nil
+      f.puts("writing").should == nil
+      f.rewind
+      f.gets.should == "writing\n"
+    end
+  end
+
+  it "raises an Errorno::EEXIST if the file exists when open with File::CREAT|File::EXCL" do
+    lambda {
+      File.open(@file, File::CREAT|File::EXCL) do |f|
+        f.puts("writing")
+      end
+    }.should raise_error(Errno::EEXIST)
+  end
+
+  it "create a new file when use File::WRONLY|File::APPEND mode" do
+    @fh = File.open(@file, File::WRONLY|File::APPEND)
+    @fh.should be_kind_of(File)
+    File.exist?(@file).should == true
+  end
+
+  it "opens a file when use File::WRONLY|File::APPEND mode" do
+    File.open(@file, File::WRONLY) do |f|
+      f.puts("hello file")
+    end
+    File.open(@file, File::RDWR|File::APPEND) do |f|
+      f.puts("bye file")
+      f.rewind
+      f.gets().should == "hello file\n"
+      f.gets().should == "bye file\n"
+      f.gets().should == nil
+    end
+  end
+
+  ruby_version_is "" ... "1.9" do
+    it "raises an Errno::EEXIST if the file exists when open with File::RDONLY|File::APPEND" do
+      lambda {
+        File.open(@file, File::RDONLY|File::APPEND) do |f|
+          f.puts("writing").should == nil
+        end
+      }.should raise_error(Errno::EINVAL)
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "raises an IOError if the file exists when open with File::RDONLY|File::APPEND" do
+      lambda {
+        File.open(@file, File::RDONLY|File::APPEND) do |f|
+          f.puts("writing").should == nil
+        end
+      }.should raise_error(IOError)
+    end
+  end
+
+  platform_is_not :openbsd do
+
+    it "truncates the file when passed File::TRUNC mode" do
+      File.open(@file, File::RDWR) { |f| f.puts "hello file" }
+      @fh = File.open(@file, File::TRUNC)
+      @fh.gets.should == nil
+    end
+
+    it "can't read in a block when call open with File::TRUNC mode" do
+      File.open(@file, File::TRUNC) do |f|
+        f.gets.should == nil
+      end
+    end
+
+  end
+
+  it "opens a file when use File::WRONLY|File::TRUNC mode" do
+    File.open(@file, "w")
+    @fh = File.open(@file, File::WRONLY|File::TRUNC)
+    @fh.should be_kind_of(File)
+    File.exist?(@file).should == true
+  end
+
+  platform_is_not :openbsd do
+    it "can't write in a block when call open with File::TRUNC mode" do
+      lambda {
+        File.open(@file, File::TRUNC) do |f|
+          f.puts("writing")
+        end
+      }.should raise_error(IOError)
+    end
+
+    it "raises an Errorno::EEXIST if the file exists when open with File::RDONLY|File::TRUNC" do
+      lambda {
+        File.open(@file, File::RDONLY|File::TRUNC) do |f|
+          f.puts("writing").should == nil
+        end
+      }.should raise_error(IOError)
+    end
+  end
+
+  platform_is :openbsd do
+    it "can't write in a block when call open with File::TRUNC mode" do
+      lambda {
+        File.open(@file, File::TRUNC) do |f|
+          f.puts("writing")
+        end
+      }.should raise_error(Errno::EINVAL)
+    end
+
+    it "raises an Errorno::EEXIST if the file exists when open with File::RDONLY|File::TRUNC" do
+      lambda {
+        File.open(@file, File::RDONLY|File::TRUNC) do |f|
+          f.puts("writing").should == nil
+        end
+      }.should raise_error(Errno::EINVAL)
+    end
+  end
+
+  it "raises an Errno::EACCES when opening non-permitted file" do
+    @fh = File.open(@file, "w")
+    @fh.chmod(000)
+    lambda { File.open(@file) }.should raise_error(Errno::EACCES)
+  end
+
+  it "raises an Errno::EACCES when opening read-only file" do
+    @fh = File.open(@file, "w")
+    @fh.chmod(0444)
+    lambda { File.open(@file, "w") }.should raise_error(Errno::EACCES)
+  end
+
+  it "opens a file for binary read" do
+    @fh = File.open(@file, "rb")
+    @fh.should be_kind_of(File)
+    File.exist?(@file).should == true
+  end
+
+  it "opens a file for binary write" do
+    @fh = File.open(@file, "wb")
+    @fh.should be_kind_of(File)
+    File.exist?(@file).should == true
+  end
+
+  it "opens a file for read-write and truncate the file" do
+    File.open(@file, "w") { |f| f.puts "testing" }
+    File.size(@file).should > 0
+    File.open(@file, "w+") do |f|
+      f.pos.should == 0
+      f.eof?.should == true
+    end
+    File.size(@file).should == 0
+  end
+
+  it "opens a file for binary read-write starting at the beginning of the file" do
+    File.open(@file, "w") { |f| f.puts "testing" }
+    File.size(@file).should > 0
+    File.open(@file, "rb+") do |f|
+      f.pos.should == 0
+      f.eof?.should == false
+    end
+  end
+
+  it "opens a file for binary read-write and truncate the file" do
+    File.open(@file, "w") { |f| f.puts "testing" }
+    File.size(@file).should > 0
+    File.open(@file, "wb+") do |f|
+      f.pos.should == 0
+      f.eof?.should == true
+    end
+    File.size(@file).should == 0
+  end
+
+  it "raises a TypeError if passed a filename that is not a String or Integer type" do
+    lambda { File.open(true)  }.should raise_error(TypeError)
+    lambda { File.open(false) }.should raise_error(TypeError)
+    lambda { File.open(nil)   }.should raise_error(TypeError)
+  end
+
+  it "raises a SystemCallError if passed an invalid Integer type" do
+    lambda { File.open(-1)    }.should raise_error(SystemCallError)
+  end
+
+  it "raises an ArgumentError if passed the wrong number of arguments" do
+    lambda { File.open(@file, File::CREAT, 0755, 'test') }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError if passed an invalid string for mode" do
+    lambda { File.open(@file, 'fake') }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/owned_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/owned_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/owned_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/owned'
+
+describe "File.owned?" do
+  it_behaves_like :file_owned, :owned?, File
+end
+
+describe "File.owned?" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/path_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/path_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/path_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "File#path" do
+  before :each do
+    @file1 = "testfile"
+    @file2 = tmp("../tmp/xxx")
+  end
+
+  after :each do
+    File.delete(@file1) if File.exist?(@file1)
+    File.delete(@file2) if File.exist?(@file2)
+  end
+
+  it "returns the pathname used to create file as a string" do
+    File.open(@file1,'w'){|file| file.path.should == "testfile"}
+    File.open(@file2, 'w'){|file| file.path.should == tmp("../tmp/xxx")}
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/pipe_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/pipe_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/pipe_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/pipe'
+
+describe "File.pipe?" do
+  it_behaves_like :file_pipe, :pipe?, File
+end
+
+describe "File.pipe?" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/readable_real_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/readable_real_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/readable_real_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/readable_real'
+
+describe "File.readable_real?" do
+  it_behaves_like :file_readable_real, :readable_real?, File
+  it_behaves_like :file_readable_real_missing, :readable_real?, File
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/readable_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/readable_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/readable_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/readable'
+
+describe "File.readable?" do
+  it_behaves_like :file_readable, :readable?, File
+  it_behaves_like :file_readable_missing, :readable?, File
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/readlink_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/readlink_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/readlink_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "File.readlink" do
+
+  before :each do
+    @file1 = 'test.txt'
+    @file3 = 'test.lnk'
+    File.delete(@file3) if File.exists?(@file3)
+
+    File.open(@file1, 'w+') { } #
+    File.symlink(@file1, @file3)
+  end
+
+  after :each do
+    File.delete(@file1) if File.exists?(@file1)
+    File.delete(@file3) if File.symlink?(@file3)
+  end
+
+  it "return the name of the file referenced by the given link" do
+    File.readlink(@file3).should == @file1
+  end
+
+  it "raises an Errno::ENOENT if called with an invalid argument" do
+    lambda { File.readlink("/this/surely/doesnt/exist") }.should raise_error(Errno::ENOENT)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/rename_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/rename_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/rename_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,40 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "File.rename" do
+  before :each do
+    @old = "test.txt"
+    @new = "test.new"
+    File.delete(@old) if File.exist?(@old)
+    File.delete(@new) if File.exist?(@new)
+    File.open(@old,"w+") {|f| f.puts "hello" }
+  end
+
+  after :each do
+    File.delete(@old) if File.exist?(@old)
+    File.delete(@new) if File.exist?(@new)
+  end
+
+  platform_is_not :windows do
+    it "renames a file " do
+      File.exists?(@old).should == true
+      File.exists?(@new).should == false
+      File.rename(@old, @new)
+      File.exists?(@old).should == false
+      File.exists?(@new).should == true
+    end
+
+    it "raises an Errno::ENOENT if the source does not exist" do
+      File.delete(@old)
+      lambda { File.rename(@old, @new) }.should raise_error(Errno::ENOENT)
+    end
+
+    it "raises an ArgumentError if not passed two arguments" do
+      lambda { File.rename        }.should raise_error(ArgumentError)
+      lambda { File.rename(@file) }.should raise_error(ArgumentError)
+    end
+
+    it "raises a TypeError if not passed String types" do
+      lambda { File.rename(1, 2)  }.should raise_error(TypeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/setgid_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/setgid_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/setgid_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/setgid'
+ 
+describe "File.setgid?" do
+  it_behaves_like :file_setgid, :setgid?, File
+end
+ 
+describe "File.setgid?" do
+  before(:each) do
+    @name = 'test.txt'
+    @file = File.new(@name, "w")
+  end
+  
+  after(:each) do
+    File.delete(@name) if File.exists?(@name)
+  end
+  
+  it "should return false if the file was just made" do
+    File.setgid?(@name).should == false
+  end
+  
+  it "should be false if the file doesn't exist" do
+    File.delete(@name) # delete it prematurely, just for this part
+    File.setgid?(@name).should == false
+  end
+  
+  platform_is_not :windows do
+    it "should return true when the gid bit is set" do
+      system "chmod g+s #{@name}"
+      
+      File.setgid?(@name).should == true
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/setuid_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/setuid_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/setuid_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/setuid'
+ 
+describe "File.setuid?" do
+  it_behaves_like :file_setuid, :setuid?, File
+end
+ 
+describe "File.setuid?" do
+  before(:each) do
+    @name = 'test.txt'
+    @file = File.new(@name, "w")
+  end
+  
+  after(:each) do
+    File.delete(@name) if File.exists?(@name)
+  end
+  
+  it "should return false if the file was just made" do
+    File.setuid?(@name).should == false
+  end
+  
+  it "should be false if the file doesn't exist" do
+    File.delete(@name) # delete it prematurely, just for this part
+    File.setuid?(@name).should == false
+  end
+  
+  platform_is_not :windows do
+    it "should return true when the gid bit is set" do
+      system "chmod u+s #{@name}"
+      
+      File.setuid?(@name).should == true
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/shared/fnmatch.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/shared/fnmatch.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/shared/fnmatch.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,180 @@
+describe :file_fnmatch, :shared => true do
+  it "matches entire strings" do
+    File.send(@method, 'cat', 'cat').should == true
+  end
+
+  it "does not match partial strings" do
+    File.send(@method, 'cat', 'category').should == false
+  end
+
+  it "does not support { } patterns" do
+    File.send(@method, 'c{at,ub}s', 'cats').should == false
+    File.send(@method, 'c{at,ub}s', 'c{at,ub}s').should == true
+  end
+
+  it "matches a single character for each ? character" do
+    File.send(@method, 'c?t', 'cat').should == true
+    File.send(@method, 'c??t', 'cat').should == false
+  end
+
+  it "matches zero or more characters for each * character" do
+    File.send(@method, 'c*', 'cats').should == true
+    File.send(@method, 'c*t', 'c/a/b/t').should == true
+  end
+
+  it "matches ranges of characters using bracket expresions (e.g. [a-z])" do
+    File.send(@method, 'ca[a-z]', 'cat').should == true
+  end
+
+  it "matches ranges of characters using bracket expresions, taking case into account" do
+    File.send(@method, '[a-z]', 'D').should == false
+    File.send(@method, '[^a-z]', 'D').should == true
+    File.send(@method, '[A-Z]', 'd').should == false
+    File.send(@method, '[^A-Z]', 'd').should == true
+    File.send(@method, '[a-z]', 'D', File::FNM_CASEFOLD).should == true
+  end
+
+  it "does not match characters outside of the range of the bracket expresion" do
+    File.send(@method, 'ca[x-z]', 'cat').should == false
+    File.send(@method, '/ca[s][s-t]/rul[a-b]/[z]he/[x-Z]orld', '/cats/rule/the/World').should == false
+  end
+
+  it "matches ranges of characters using exclusive bracket expresions (e.g. [^t] or [!t])" do
+    File.send(@method, 'ca[^t]', 'cat').should == false
+    File.send(@method, 'ca[!t]', 'cat').should == false
+  end
+
+  it "matches characters with a case sensitive comparison" do
+    File.send(@method, 'cat', 'CAT').should == false
+  end
+
+  it "matches characters with case insensitive comparison when flags includes FNM_CASEFOLD" do
+    File.send(@method, 'cat', 'CAT', File::FNM_CASEFOLD).should == true
+  end
+
+  platform_is_not :windows do
+    it "doesn't match case sensitive characters on platfroms with case sensitive paths, when flags include FNM_SYSCASE" do
+      File.send(@method, 'cat', 'CAT', File::FNM_SYSCASE).should == false
+    end
+  end
+
+  platform_is :windows do
+    it "matches case sensitive characters on platfroms with case insensitive paths, when flags include FNM_SYSCASE" do
+      File.send(@method, 'cat', 'CAT', Filee::FNM_SYSCASE).should == true
+    end
+  end
+
+  it "does not match '/' characters with ? or * when flags includes FNM_PATHNAME" do
+    File.send(@method, '?', '/', File::FNM_PATHNAME).should == false
+    File.send(@method, '*', '/', File::FNM_PATHNAME).should == false
+  end
+
+  it "does not match '/' characters inside bracket expressions when flags includes FNM_PATHNAME" do
+    File.send(@method, '[/]', '/', File::FNM_PATHNAME).should == false
+  end
+
+  it "matches literal ? or * in path when pattern includes \\? or \\*" do
+    File.send(@method, '\?', '?').should == true
+    File.send(@method, '\?', 'a').should == false
+
+    File.send(@method, '\*', '*').should == true
+    File.send(@method, '\*', 'a').should == false
+  end
+
+  it "matches literal character (e.g. 'a') in path when pattern includes escaped character (e.g. \\a)" do
+    File.send(@method, '\a', 'a').should == true
+    File.send(@method, 'this\b', 'thisb').should == true
+  end
+
+  it "matches '\\' characters in path when flags includes FNM_NOESACPE" do
+    File.send(@method, '\a', '\a', File::FNM_NOESCAPE).should == true
+    File.send(@method, '\a', 'a', File::FNM_NOESCAPE).should == false
+    File.send(@method, '\[foo\]\[bar\]', '[foo][bar]', File::FNM_NOESCAPE).should == false
+  end
+
+  it "escapes special characters inside bracket expression" do
+    File.send(@method, '[\?]', '?').should == true
+    File.send(@method, '[\*]', '*').should == true
+  end
+
+  it "does not match leading periods in filenames with wildcards by default" do
+    File.send(@method, '*', '.profile').should == false
+    File.send(@method, '*', 'home/.profile').should == true
+    File.send(@method, '*/*', 'home/.profile').should == true
+    File.send(@method, '*/*', 'dave/.profile', File::FNM_PATHNAME).should == false
+  end
+
+  it "matches patterns with leading periods to dotfiles by default" do
+    File.send(@method, '.*', '.profile').should == true
+    File.send(@method, ".*file", "nondotfile").should == false
+  end
+
+  it "matches leading periods in filenames when flags includes FNM_DOTMATCH" do
+    File.send(@method, '*', '.profile', File::FNM_DOTMATCH).should == true
+    File.send(@method, '*', 'home/.profile', File::FNM_DOTMATCH).should == true
+  end
+
+  it "matches multiple directories with ** and *" do
+    files = '**/*.rb'
+    File.send(@method, files, 'main.rb').should == false
+    File.send(@method, files, './main.rb').should == false
+    File.send(@method, files, 'lib/song.rb').should == true
+    File.send(@method, '**.rb', 'main.rb').should == true
+    File.send(@method, '**.rb', './main.rb').should == false
+    File.send(@method, '**.rb', 'lib/song.rb').should == true
+    File.send(@method, '*',     'dave/.profile').should == true
+  end
+
+  it "matches multiple directories with ** when flags includes File::FNM_PATHNAME" do
+    files = '**/*.rb'
+    flags = File::FNM_PATHNAME
+
+    File.send(@method, files, 'main.rb',               flags).should == true
+    File.send(@method, files, 'one/two/three/main.rb', flags).should == true
+    File.send(@method, files, './main.rb',             flags).should == false
+
+    flags = File::FNM_PATHNAME | File::FNM_DOTMATCH
+
+    File.send(@method, files, './main.rb',        flags).should == true
+    File.send(@method, files, 'one/two/.main.rb', flags).should == true
+
+    File.send(@method, "**/best/*", 'lib/my/best/song.rb').should == true
+  end
+
+  it "returns false if '/' in pattern do not match '/' in path when flags includes FNM_PATHNAME" do
+    pattern = '*/*'
+    File.send(@method, pattern, 'dave/.profile', File::FNM_PATHNAME).should be_false
+
+    pattern = '**/foo'
+    File.send(@method, pattern, 'a/.b/c/foo', File::FNM_PATHNAME).should be_false
+  end
+
+  it "returns true if '/' in pattern match '/' in path when flags includes FNM_PATHNAME" do
+    pattern = '*/*'
+    File.send(@method, pattern, 'dave/.profile', File::FNM_PATHNAME | File::FNM_DOTMATCH).should be_true
+
+    pattern = '**/foo'
+    File.send(@method, pattern, 'a/b/c/foo', File::FNM_PATHNAME).should be_true
+    File.send(@method, pattern, '/a/b/c/foo', File::FNM_PATHNAME).should be_true
+    File.send(@method, pattern, 'c:/a/b/c/foo', File::FNM_PATHNAME).should be_true
+    File.send(@method, pattern, 'a/.b/c/foo', File::FNM_PATHNAME | File::FNM_DOTMATCH).should be_true
+  end
+
+  it "raises a TypeError if the first and second arguments are not string-like" do
+    lambda { File.send(@method, nil, nil, 0, 0) }.should raise_error(ArgumentError)
+    lambda { File.send(@method, 1, 'some/thing') }.should raise_error(TypeError)
+    lambda { File.send(@method, 'some/thing', 1) }.should raise_error(TypeError)
+    lambda { File.send(@method, 1, 1) }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError if the third argument is not an Integer" do
+    lambda { File.send(@method, "*/place", "path/to/file", "flags") }.should raise_error(TypeError)
+    lambda { File.send(@method, "*/place", "path/to/file", nil) }.should raise_error(TypeError)
+  end
+
+  it "does not raise a TypeError if the third argument can be coerced to an Integer" do
+    flags = mock("flags")
+    flags.should_receive(:to_int).and_return(10)
+    lambda { File.send(@method, "*/place", "path/to/file", flags) }.should_not raise_error
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/shared/stat.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/shared/stat.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/shared/stat.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,42 @@
+describe :file_stat, :shared => true do
+  before :each do
+    @file = tmp('/i_exist')
+    File.open(@file,'w'){|f| f.write 'rubinius'}
+  end
+
+  after :each do
+    File.delete(@file) if File.exist?(@file)
+  end
+
+  it "returns a File::Stat object if the given file exists" do
+    st = File.send(@method, @file)
+
+    st.file?.should == true
+    st.zero?.should == false
+    st.size.should == 8
+    st.size?.should == 8
+    st.blksize.should > 0
+    st.atime.class.should == Time
+    st.ctime.class.should == Time
+    st.mtime.class.should == Time
+  end
+
+  it "should be able to use the instance methods" do
+    st = File.new(@file).send(@method)
+
+    st.file?.should == true
+    st.zero?.should == false
+    st.size.should == 8
+    st.size?.should == 8
+    st.blksize.should > 0
+    st.atime.class.should == Time
+    st.ctime.class.should == Time
+    st.mtime.class.should == Time
+  end
+
+  it "raises an Errno::ENOENT if the file does not exist" do
+    lambda {
+      File.send(@method, "fake_file")
+    }.should raise_error(Errno::ENOENT)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/shared/unlink.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/shared/unlink.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/shared/unlink.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,52 @@
+describe :file_unlink, :shared => true do
+  before :each do
+    @file1 = 'test.txt'
+    @file2 = 'test2.txt'
+    File.send(@method, @file1) if File.exists?(@file1)
+    File.send(@method, @file2) if File.exists?(@file2)
+
+    File.open(@file1, "w") {} # Touch
+    File.open(@file2, "w") {} # Touch
+  end
+
+  after :each do
+    File.send(@method, @file1) if File.exists?(@file1)
+    File.send(@method, @file2) if File.exists?(@file2)
+
+    @file1 = nil
+    @file2 = nil
+  end
+
+  it "returns 0 when called without arguments" do
+    File.send(@method).should == 0
+  end
+
+  it "deletes a single file" do
+    File.send(@method, @file1).should == 1
+    File.exists?(@file1).should == false
+  end
+
+  it "deletes multiple files" do
+    File.send(@method, @file1, @file2).should == 2
+    File.exists?(@file1).should == false
+    File.exists?(@file2).should == false
+  end
+
+  it "raises an TypeError if not passed a String type" do
+    lambda { File.send(@method, 1) }.should raise_error(TypeError)
+  end
+
+  it "raises an Errno::ENOENT when the given file doesn't exist" do
+    lambda { File.send(@method, 'bogus') }.should raise_error(Errno::ENOENT)
+  end
+
+  it "coerces a given parameter into a string if possible" do
+    class Coercable
+      def to_str
+        "test.txt"
+      end
+    end
+
+    File.send(@method, Coercable.new).should == 1
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/size'
+
+describe "File.size" do
+  before :each do
+    @file = tmp('i_exist')
+    File.open(@file,'w'){|f| f.write 'rubinius'}
+  end
+
+  after :each do
+    File.delete(@file) if File.exist?(@file)
+  end
+
+  it "returns the size of the file" do
+    File.size?(@file).should == 8
+  end
+
+  it "accepts a String-like (to_str) parameter" do
+    o = [@file]
+    def o.to_str; self[0]; end
+
+    File.size?(o).should == 8
+  end
+
+  it "accepts a File argument" do
+    File.size?(File.open(@file)).should == 8
+  end
+end
+
+describe "File.size?" do
+  it_behaves_like :file_size, :size?, File
+  it_behaves_like :file_size_missing, :size?, File
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/socket_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/socket_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/socket_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/socket'
+
+describe "File.socket?" do
+  it_behaves_like :file_socket, :socket?, File
+end
+
+describe "File.socket?" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/split_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/split_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/split_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,69 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "File.split" do
+  before :each do
+    @backslash_ext = "C:\\foo\\bar\\baz.rb"
+    @backslash = "C:\\foo\\bar\\baz"
+  end
+
+  it "splits the string at the last '/' when the last component does not have an extension" do
+    File.split("/foo/bar/baz").should == ["/foo/bar", "baz"]
+    File.split("C:/foo/bar/baz").should == ["C:/foo/bar", "baz"]
+  end
+
+  it "splits the string at the last '/' when the last component has an extension" do
+    File.split("/foo/bar/baz.rb").should == ["/foo/bar", "baz.rb"]
+    File.split("C:/foo/bar/baz.rb").should == ["C:/foo/bar", "baz.rb"]
+  end
+
+  it "splits an empty string into a '.' and an empty string" do
+    File.split("").should == [".", ""]
+  end
+
+  it "collapses multiple '/' characters and strips trailing ones" do
+    File.split("//foo////").should == ["/", "foo"]
+  end
+
+  platform_is_not :os => :windows do
+    not_compliant_on :jruby do
+      it "does not split a string that contains '\\'" do
+        File.split(@backslash).should == [".", "C:\\foo\\bar\\baz"]
+        File.split(@backslash_ext).should ==  [".", "C:\\foo\\bar\\baz.rb"]
+      end
+    end
+
+    deviates_on :jruby do
+      it "splits the string at the last '\\' when the last component does not have an extension" do
+        File.split(@backslash).should == ["C:\\foo\\bar", "baz"]
+      end
+
+      it "splits the string at the last '\\' when the last component has an extension" do
+        File.split(@backslash_ext).should ==  ["C:\\foo\\bar", "baz.rb"]
+      end
+    end
+  end
+
+  platform_is :os => :windows do
+    it "splits the string at the last '\\' when the last component does not have an extension" do
+      File.split(@backslash).should == ["C:\\foo\\bar", "baz"]
+    end
+
+    it "splits the string at the last '\\' when the last component has an extension" do
+      File.split(@backslash_ext).should ==  ["C:\\foo\\bar", "baz.rb"]
+    end
+  end
+
+  it "raises an ArgumentError when not passed a single argument" do
+    lambda { File.split }.should raise_error(ArgumentError)
+    lambda { File.split('string', 'another string') }.should raise_error(ArgumentError)
+  end
+
+  it "raises a TypeError if the argument is not a String type" do
+    lambda { File.split(1) }.should raise_error(TypeError)
+  end
+
+  it "coerces the argument with to_str if it is not a String type" do
+    class C; def to_str; "/rubinius/better/than/ruby"; end; end
+    File.split(C.new).should == ["/rubinius/better/than", "ruby"]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/atime_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/atime_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/atime_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "File::Stat#atime" do
+  before :each do
+    @file = tmp('i_exist')
+    File.open(@file,'w'){|f| f.write 'rubinius'}
+  end
+
+  after :each do
+    File.delete(@file) if File.exist?(@file)
+  end
+  
+  it "should be able to determine the atime on a File::Stat object" do
+    st = File.stat(@file)
+    st.atime.class.should == Time
+    st.atime.should <= Time.now
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/blksize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/blksize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/blksize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "File::Stat#blksize" do
+  before :each do
+    @file = tmp('i_exist')
+    File.open(@file,'w'){|f| f.write 'rubinius'}
+  end
+
+  after :each do
+    File.delete(@file) if File.exist?(@file)
+  end
+  
+  it "should be able to determine the blksize on a File::Stat object" do
+    st = File.stat(@file)
+    st.blksize.is_a?(Integer).should == true
+    st.blksize.should > 0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/blockdev_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/blockdev_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/blockdev_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../../../shared/file/blockdev'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "File::Stat#blockdev?" do
+  it_behaves_like :file_blockdev, :blockdev?, FileStat
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/blocks_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/blocks_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/blocks_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "File::Stat#blocks" do
+  before :each do
+    @file = tmp('i_exist')
+    File.open(@file,'w'){|f| f.write 'rubinius'}
+  end
+
+  after :each do
+    File.delete(@file) if File.exist?(@file)
+  end
+  
+  it "should be able to determine the blocks on a File::Stat object" do
+    st = File.stat(@file)
+    st.blocks.is_a?(Integer).should == true
+    st.blocks.should > 0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/chardev_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/chardev_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/chardev_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../../../shared/file/chardev'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "File::Stat#chardev?" do
+  it_behaves_like :file_chardev, :chardev?, FileStat
+end 

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/comparison_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/comparison_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/comparison_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,41 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "File::Stat#<=>" do
+  before :each do
+    @name1 = tmp("i_exist")
+    @name2 = tmp("i_exist_too")
+    @file1 = File.new @name1, "w"
+    @file2 = File.new @name2, "w"
+  end
+
+  after :each do
+    @file1.close unless @file1.closed?
+    @file2.close unless @file2.closed?
+    File.delete @name1
+    File.delete @name2
+  end
+
+  it "is able to compare files by the same modification times" do
+    (@file1.stat <=> @file2.stat).should == 0
+  end
+
+  it "is able to compare files by different modification times" do
+    File.utime(Time.now, Time.now + 100, @name2)
+    (@file1.stat <=> @file2.stat).should == -1
+
+    File.utime(Time.now, Time.now - 100, @name2)
+    (@file1.stat <=> @file2.stat).should == 1
+  end
+
+  it "should also include Comparable and thus == shows mtime equality between two File::Stat objects" do
+    (@file1.stat == @file2.stat).should == true
+    (@file1.stat == @file1.stat).should == true
+    (@file2.stat == @file2.stat).should == true
+
+    File.utime(Time.now, Time.now + 100, @name2)
+
+    (@file1.stat == @file2.stat).should == false
+    (@file1.stat == @file1.stat).should == true
+    (@file2.stat == @file2.stat).should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/ctime_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/ctime_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/ctime_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "File::Stat#ctime" do
+  before :each do
+    @file = tmp('i_exist')
+    File.open(@file,'w'){|f| f.write 'rubinius'}
+  end
+
+  after :each do
+    File.delete(@file) if File.exist?(@file)
+  end
+  
+  it "should be able to determine the ctime on a File::Stat object" do
+    st = File.stat(@file)
+    st.ctime.class.should == Time
+    st.ctime.should <= Time.now
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/dev_major_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/dev_major_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/dev_major_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "File::Stat#dev_major" do
+  it "returns the major part of File::Stat#dev" do
+    File.stat('/dev/null').dev_major.should be_kind_of(Integer)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/dev_minor_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/dev_minor_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/dev_minor_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "File::Stat#dev_minor" do
+  it "returns the minor part of File::Stat#dev" do
+    File.stat('/dev/null').dev_minor.should be_kind_of(Integer)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/dev_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/dev_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/dev_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe 'File::Stat#dev' do
+  it "returns the number of the device on which the file exists" do
+    File.stat('/dev/null').dev.should be_kind_of(Integer)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/directory_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/directory_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/directory_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../../../shared/file/directory'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "File::Stat#directory?" do
+  it_behaves_like :file_directory, :directory?, FileStat
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/executable_real_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/executable_real_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/executable_real_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../../../shared/file/executable_real'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "File::Stat#executable_real?" do
+  it_behaves_like :file_executable_real, :executable_real?, FileStat
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/executable_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/executable_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/executable_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../../../shared/file/executable'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "File::Stat#executable?" do
+  it_behaves_like :file_executable, :executable?, FileStat
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/file_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/file_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/file_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../../../shared/file/file'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "File::Stat#file?" do
+  it_behaves_like :file_file, :file?, FileStat
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+class FileStat
+  def self.method_missing(meth, file)
+    File.lstat(file).send(meth)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/ftype_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/ftype_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/ftype_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,59 @@
+require "#{File.dirname(__FILE__)}/../../../spec_helper"
+require "#{File.dirname(__FILE__)}/../fixtures/file_types.rb"
+
+describe "File::Stat#ftype" do
+  it "returns a String " do
+    FileSpecs.normal_file do |file|
+      File.lstat(file).ftype.class.should == String
+    end
+  end
+
+  it "returns 'file' when the file is a file" do
+    FileSpecs.normal_file do |file|
+      File.lstat(file).ftype.should == 'file'
+    end
+  end
+
+  it "returns 'directory' when the file is a dir" do
+    FileSpecs.directory do |dir|
+      File.lstat(dir).ftype.should == 'directory'
+    end
+  end
+
+  it "returns 'characterSpecial' when the file is a char"  do
+    FileSpecs.character_device do |char|
+      File.lstat(char).ftype.should == 'characterSpecial'
+    end
+  end
+
+  platform_is_not :freebsd do  # FreeBSD does not have block devices
+    it "returns 'blockSpecial' when the file is a block" do
+      FileSpecs.block_device do |block|
+        File.lstat(block).ftype.should == 'blockSpecial'
+      end
+    end
+  end
+
+  it "returns 'link' when the file is a link" do
+    FileSpecs.symlink do |link|
+      File.lstat(link).ftype.should == 'link'
+    end
+  end
+
+  it "returns fifo when the file is a fifo" do
+    FileSpecs.fifo do |fifo|
+      File.lstat(fifo).ftype.should == 'fifo'
+    end
+  end
+
+  # This will silently not execute the block if no socket
+  # can be found. However, if you are running X, there is
+  # a good chance that if nothing else, at least the X
+  # Server socket exists.
+  it "returns 'socket' when the file is a socket" do
+    FileSpecs.socket do |socket|
+      File.lstat(socket).ftype.should == 'socket'
+    end
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/gid_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/gid_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/gid_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "File::Stat#gid" do
+  before :each do
+    @file = tmp('i_exist')
+    File.open(@file,'w'){|f| f.write 'rubinius'}
+    File.chown(nil, Process.gid, @file)
+  end
+
+  after :each do
+    File.delete(@file) if File.exist?(@file)
+  end
+  
+  it "should be able to determine the group owner through a File::Stat object" do
+    st = File.stat(@file)
+    st.gid.is_a?(Integer).should == true
+    st.gid.should == Process.gid
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/grpowned_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/grpowned_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/grpowned_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../../../shared/file/grpowned'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "File::Stat#grpowned?" do
+  it_behaves_like :file_grpowned, :grpowned?, FileStat
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/ino_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/ino_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/ino_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "File::Stat#ino" do
+  before :each do
+    @file = tmp('i_exist')
+    File.open(@file,'w'){|f| f.write 'rubinius'}
+  end
+
+  after :each do
+    File.delete(@file) if File.exist?(@file)
+  end
+  
+  it "should be able to determine the ino on a File::Stat object" do
+    st = File.stat(@file)
+    st.ino.is_a?(Integer).should == true
+    st.ino.should > 0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "File::Stat#inspect" do
+
+  before :each do
+    @file = tmp('i_exist')
+    File.open(@file,'w'){|f| f.write 'rubinius'}
+  end
+
+  after :each do
+    File.delete(@file) if File.exist?(@file)
+  end
+  
+  it "produces a nicely formatted description of a File::Stat object" do
+    st = File.stat(@file)  
+    #p "#<File::Stat dev=0x#{st.dev.to_s(16)}, ino=#{st.ino}, mode=#{sprintf("%06s", st.mode.to_s(8))}, nlink=#{st.nlink}, uid=#{st.uid}, gid=#{st.gid}, rdev=0x#{st.rdev.to_s(16)}, size=#{st.size}, blksize=#{st.blksize}, blocks=#{st.blocks}, atime=#{st.atime}, mtime=#{st.mtime}, ctime=#{st.ctime}>"
+    st.inspect.should == "#<File::Stat dev=0x#{st.dev.to_s(16)}, ino=#{st.ino}, mode=#{sprintf("%07d", st.mode.to_s(8).to_i)}, nlink=#{st.nlink}, uid=#{st.uid}, gid=#{st.gid}, rdev=0x#{st.rdev.to_s(16)}, size=#{st.size}, blksize=#{st.blksize}, blocks=#{st.blocks}, atime=#{st.atime}, mtime=#{st.mtime}, ctime=#{st.ctime}>"
+    
+  end
+
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/mode_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/mode_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/mode_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "File::Stat#mode" do
+  before :each do
+    @file = tmp('i_exist')
+    File.open(@file,'w'){|f| f.write 'rubinius'}
+    File.chmod(0755, @file)
+  end
+
+  after :each do
+    File.delete(@file) if File.exist?(@file)
+  end
+  
+  it "should be able to determine the mode through a File::Stat object" do
+    st = File.stat(@file)
+    st.mode.is_a?(Integer).should == true
+    st.mode.should == 33261
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/mtime_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/mtime_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/mtime_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "File::Stat#mtime" do
+  before :each do
+    @file = tmp('i_exist')
+    File.open(@file,'w'){|f| f.write 'rubinius'}
+  end
+
+  after :each do
+    File.delete(@file) if File.exist?(@file)
+  end
+  
+  it "should be able to determine the mtime on a File::Stat object" do
+    st = File.stat(@file)
+    st.mtime.class.should == Time
+    st.mtime.should <= Time.now
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "File::Stat#initialize" do
+
+  before :each do
+    @file = tmp('i_exist')
+    File.open(@file,'w'){|f| f.write 'rubinius'}
+    File.chmod(0755, @file)
+  end
+
+  after :each do
+    File.delete(@file) if File.exist?(@file)
+  end
+
+  it "raises an exception if the file doesn't exist" do
+    lambda { File::Stat.new(tmp("i_am_a_dummy_file_that_doesnt_exist")) }.should raise_error
+  end
+
+  it "creates a File::Stat object for the given file" do
+    st = File::Stat.new(@file)
+    st.class.should == File::Stat
+    st.ftype.should == 'file'
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/nlink_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/nlink_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/nlink_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "File::Stat#nlink" do
+  before :each do
+    @file = tmp("stat_nlink")
+    @link = @file + ".lnk"
+    File.open(@file, "w") {}
+  end
+
+  after :each do
+    File.delete(@file) rescue nil
+    File.delete(@link) rescue nil
+  end
+
+  it "returns the number of links to a file" do
+    File::Stat.new(@file).nlink.should == 1
+    File.link(@file, @link)
+    File::Stat.new(@file).nlink.should == 2
+    File.delete(@link)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/owned_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/owned_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/owned_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../../../shared/file/owned'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "File::Stat#owned?" do
+  it_behaves_like :file_owned, :owned?, FileStat
+end
+
+describe "File::Stat#owned?" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/pipe_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/pipe_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/pipe_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../../../shared/file/pipe'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "File::Stat#pipe?" do
+  it_behaves_like :file_pipe, :pipe?, FileStat
+end
+
+describe "File::Stat#pipe?" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/rdev_major_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/rdev_major_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/rdev_major_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "File::Stat#rdev_major" do
+  it "returns the major part of File::Stat#rdev" do
+    File.stat('/dev/null').rdev_major.should be_kind_of(Integer)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/rdev_minor_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/rdev_minor_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/rdev_minor_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "File::Stat#rdev_minor" do
+  it "returns the minor part of File::Stat#rdev" do
+    File.stat('/dev/null').rdev_minor.should be_kind_of(Integer)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/rdev_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/rdev_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/rdev_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe 'File::Stat#rdev' do
+  it "returns the number of the device this file represents which the file exists" do
+    File.stat('/dev/null').rdev.should be_kind_of(Integer)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/readable_real_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/readable_real_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/readable_real_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../../../shared/file/readable_real'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "File::Stat#readable_real?" do
+  it_behaves_like :file_readable_real, :readable_real?, FileStat
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/readable_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/readable_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/readable_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../../../shared/file/readable'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "File::Stat#readable?" do
+  it_behaves_like :file_readable, :readable?, FileStat
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/setgid_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/setgid_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/setgid_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../../../shared/file/setgid'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "File::Stat#setgid?" do
+  it_behaves_like :file_setgid, :setgid?, FileStat
+end
+
+describe "File::Stat#setgid?" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/setuid_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/setuid_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/setuid_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../../../shared/file/setuid'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "File::Stat#setuid?" do
+  it_behaves_like :file_setuid, :setuid?, FileStat
+end
+
+describe "File::Stat#setuid?" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../../../shared/file/size'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "File::Stat#size?" do
+  it_behaves_like :file_size, :size?, FileStat
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/socket_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/socket_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/socket_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../../../shared/file/socket'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "File::Stat#socket?" do
+  it_behaves_like :file_socket, :socket?, FileStat
+end
+
+describe "File::Stat#socket?" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/sticky_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/sticky_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/sticky_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../../../shared/file/sticky'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "File::Stat#sticky?" do
+  it_behaves_like :file_sticky, :sticky?, FileStat
+end
+
+describe "File::Stat#sticky?" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/symlink_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/symlink_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/symlink_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../../../shared/file/symlink'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "File::Stat#symlink?" do
+  it_behaves_like :file_symlink, :symlink?, FileStat
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/uid_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/uid_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/uid_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "File::Stat#uid" do
+  before :each do
+    @file = tmp('i_exist')
+    File.open(@file,'w'){|f| f.write 'rubinius'}
+  end
+
+  after :each do
+    File.delete(@file) if File.exist?(@file)
+  end
+  
+  it "should be able to determine the owner through a File::Stat object" do
+    st = File.stat(@file)
+    st.uid.is_a?(Integer).should == true
+    st.uid.should == Process.uid
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/writable_real_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/writable_real_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/writable_real_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../../../shared/file/writable_real'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "File::Stat#writable_real?" do
+  it_behaves_like :file_writable_real, :writable_real?, FileStat
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/writable_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/writable_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/writable_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../../../shared/file/writable'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "File::Stat#writable?" do
+  it_behaves_like :file_writable, :writable?, FileStat
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat/zero_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat/zero_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat/zero_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../../../shared/file/zero'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "File::Stat#zero?" do
+  it_behaves_like :file_zero, :zero?, FileStat
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/stat_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/stat_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/stat_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,30 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/stat'
+
+describe "File.stat" do
+  it_behaves_like :file_stat, :stat
+end
+
+describe "File.stat" do
+
+  before :each do
+    @file = tmp('i_exist')
+    @link = tmp('i_am_a_symlink')
+    File.open(@file,'w'){|f| f.write 'rubinius'}
+    File.symlink(@file, @link)
+  end
+
+  after :each do
+    File.delete(@link) if File.exist?(@link)
+    File.delete(@file) if File.exist?(@file)
+  end
+
+  platform_is_not :windows do
+    it "returns a File::Stat object with file properties for a symlink" do
+      st = File.stat(@link)
+
+      st.file?.should == true
+      st.symlink?.should == false
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/sticky_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/sticky_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/sticky_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/sticky'
+
+describe "File.sticky?" do
+  it_behaves_like :file_sticky, :sticky?, File
+end
+
+describe "File.sticky?" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/symlink_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/symlink_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/symlink_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,51 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/symlink'
+
+describe "File.symlink" do
+  before :each do
+    @file = "test.txt"
+    @link = "test.lnk"
+    File.delete(@link) if File.exist?(@link)
+    File.delete(@file) if File.exist?(@file)
+    File.open(@file,"w+")
+  end
+
+  after :each do
+    File.unlink(@link) if File.exist?(@link)
+    File.delete(@file) if File.exist?(@file)
+    @link = nil
+  end
+
+  platform_is_not :windows do
+    it "create a symlink between a source and target file" do
+      File.symlink(@file, @link).should == 0
+      File.exists?(@link).should == true
+      File.identical?(@file, @link).should == true
+    end
+
+    it "create a symbolic link" do
+      File.symlink(@file, @link)
+      File.symlink?(@link).should == true
+    end
+
+    it "raises an Errno::EEXIST if the target already exists" do
+      File.symlink(@file, @link)
+      lambda { File.symlink(@file, @link) }.should raise_error(Errno::EEXIST)
+    end
+
+    it "raises an ArgumentError if not called with two arguments" do
+      lambda { File.symlink        }.should raise_error(ArgumentError)
+      lambda { File.symlink(@file) }.should raise_error(ArgumentError)
+    end
+
+    it "raises a TypeError if not called with String types" do
+      lambda { File.symlink(@file, nil) }.should raise_error(TypeError)
+      lambda { File.symlink(@file, 1)   }.should raise_error(TypeError)
+      lambda { File.symlink(1, 1)       }.should raise_error(TypeError)
+    end
+  end
+end
+
+describe "File.symlink?" do
+  it_behaves_like :file_symlink, :symlink?, File
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/truncate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/truncate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/truncate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,178 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "File.truncate" do
+  before :each do
+    @name = "test.txt"
+    @file  = File.open(@name, 'w')
+    File.open(@name,"w") { |f| f.write("1234567890") }
+  end
+
+  after :each do
+    @file.close
+    File.delete(@name) if File.exist?(@name)
+    @name = nil
+  end
+
+  it "truncates a file" do
+    File.open(@name, "w") { |f| f.puts "123456789" }
+    platform_is :windows do
+      File.size(@name).should == 11
+    end
+
+    platform_is_not :windows do
+      File.size(@name).should == 10
+    end
+    File.truncate(@name, 5)
+    File.size(@name).should == 5
+    File.open(@name, "r") do |f|
+      f.read(99).should == "12345"
+      f.eof?.should == true
+    end
+  end
+
+  it "truncate a file size to 0" do
+    File.truncate(@name, 0).should == 0
+    IO.read(@name).should == ""
+  end
+
+  it "truncate a file size to 5"  do
+    File.size(@name).should == 10
+    File.truncate(@name, 5)
+    File.size(@name).should == 5
+    IO.read(@name).should == "12345"
+  end
+
+  it "truncates to a larger file size than the original file" do
+    File.truncate(@name, 12)
+    File.size(@name).should == 12
+    IO.read(@name).should == "1234567890\000\000"
+  end
+
+  it "truncates to the same size as the original file" do
+    File.truncate(@name, File.size(@name))
+    File.size(@name).should == 10
+    IO.read(@name).should == "1234567890"
+  end
+
+  it "raises an Errno::ENOENT if the file does not exist" do
+    not_existing_file = "file-does-not-exist-for-sure.txt"
+
+    # make sure it doesn't exist for real
+    File.delete(not_existing_file) if File.exist?(not_existing_file)
+
+    begin
+      lambda { File.truncate(not_existing_file, 5) }.should raise_error(Errno::ENOENT)
+    ensure
+      File.delete(not_existing_file) if File.exist?(not_existing_file)
+    end
+  end
+
+  it "raises an ArgumentError if not passed two arguments" do
+    lambda { File.truncate        }.should raise_error(ArgumentError)
+    lambda { File.truncate(@name) }.should raise_error(ArgumentError)
+  end
+
+  platform_is_not :openbsd do
+    it "raises an Errno::EINVAL if the length argument is not valid" do
+      lambda { File.truncate(@name, -1)  }.should raise_error(Errno::EINVAL) # May fail
+    end
+  end
+
+  it "raises a TypeError if not passed a String type for the first argument" do
+    lambda { File.truncate(1, 1) }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError if not passed an Integer type for the second argument" do
+    lambda { File.truncate(@name, nil) }.should raise_error(TypeError)
+  end
+
+  platform_is_not :windows do
+    it "truncates an absolute pathname file" do
+      absolute_pathname_file = "/tmp/#{@name}"
+      File.open(absolute_pathname_file,"w") { |f| f.write("1234567890") }
+      File.truncate(absolute_pathname_file, 5)
+      File.size(absolute_pathname_file).should == 5
+      File.delete(absolute_pathname_file) if File.exist?(absolute_pathname_file)
+    end
+  end
+end
+
+
+describe "File#truncate" do
+  before :each do
+    @name = "test.txt"
+    @file  = File.open(@name, 'w')
+    File.open(@name,"w") { |f| f.write("1234567890") }
+  end
+
+  after :each do
+    @file.close unless @file.closed?
+    File.delete(@name) if File.exist?(@name)
+    @name = nil
+  end
+
+  it "truncates a file" do
+    File.open(@name, "w") { |f| f.puts "123456789" }
+    platform_is :windows do
+      File.size(@name).should == 11
+    end
+
+    platform_is_not :windows do
+      File.size(@name).should == 10
+    end
+    @file.truncate(5)
+    File.size(@name).should == 5
+    File.open(@name, "r") do |f|
+      f.read(99).should == "12345"
+      f.eof?.should == true
+    end
+  end
+
+  it "truncates a file size to 0" do
+    @file.truncate(0).should == 0
+    IO.read(@name).should == ""
+  end
+
+  it "truncates a file size to 5"  do
+    File.size(@name).should == 10
+    @file.truncate(5)
+    File.size(@name).should == 5
+    IO.read(@name).should == "12345"
+  end
+
+  it "truncates a file to a larger size than the original file" do
+    @file.truncate(12)
+    File.size(@name).should == 12
+    IO.read(@name).should == "1234567890\000\000"
+  end
+
+  it "truncates a file to the same size as the original file" do
+    @file.truncate(File.size(@name))
+    File.size(@name).should == 10
+    IO.read(@name).should == "1234567890"
+  end
+
+  it "raises an ArgumentError if not passed one argument" do
+    lambda { @file.truncate        }.should raise_error(ArgumentError)
+    lambda { @file.truncate(1) }.should_not raise_error(ArgumentError)
+  end
+
+  it "raises an Errno::EINVAL if the length argument is not valid" do
+    lambda { @file.truncate(-1)  }.should raise_error(Errno::EINVAL) # May fail
+  end
+
+  it "raises an IOError if file is closed" do
+    @file.close
+    @file.closed?.should == true
+    lambda { @file.truncate(42) }.should raise_error(IOError)
+  end
+
+  it "raises an IOError if file is not opened for writing" do
+    file = File.new(@name, 'r')
+    lambda { file.truncate(42) }.should raise_error(IOError)
+  end
+
+  it "raises a TypeError if not passed an Integer type for the for the argument" do
+    lambda { @file.truncate(nil) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/umask_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/umask_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/umask_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,61 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "File.umask" do
+  before :each do
+    @orig_umask = File.umask
+    @file = 'test.txt'
+    File.open(@file, 'w') {}
+  end
+
+  after :each do
+    File.delete(@file) if File.exists?(@file)
+    @file = nil
+    File.umask(@orig_umask)
+  end
+
+  it "return a Fixnum" do
+    File.umask.class.should == Fixnum
+  end
+
+  it "umask should return the current umask value for the process" do
+    File.umask(022)
+    File.umask(006).should == 022
+    File.umask.should == 006
+  end
+
+  it "invokes to_int on non-integer argument" do
+    (obj = mock(022)).should_receive(:to_int).any_number_of_times.and_return(022)
+    File.umask(obj)
+    File.umask(obj).should == 022
+  end
+
+  it "always succeeds with any integer values" do
+    vals = [-2**30, -2**16, -2**8, -2,
+      -1.5, -1, 0.5, 0, 1, 2, 7.77777, 16, 32, 64, 2**8, 2**16, 2**30]
+    vals.each { |v|
+      lambda { File.umask(v) }.should_not raise_error
+    }
+  end
+
+  it "raises ArgumentError when more than one argument is provided" do
+    lambda { File.umask(022, 022) }.should raise_error(ArgumentError)
+  end
+
+  platform_is :windows do
+    it "Returns the current umask value for this process. (basic)" do
+      File.umask.should == 0
+    end
+
+    # The value used here is the value of _S_IWRITE.
+    it "Returns the current umask value for this process." do
+      File.umask(0000200)
+      File.umask.should == 0000200
+    end
+
+    # FIXME: wtf?
+    it "raises an exception if the arguments are wrong type or are the incorect number of arguments " do
+      File.umask(0006)
+      File.umask.should == 0
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/unlink_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/unlink_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/unlink_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/unlink'
+
+describe "File.unlink" do
+  it_behaves_like(:file_unlink, :unlink)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/utime_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/utime_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/utime_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "File.utime" do
+  before :each do
+    @atime = Time.now
+    @mtime = Time.now
+    @file1 = tmp("specs_file_utime1")
+    @file2 = tmp("specs_file_utime2")
+    File.open(@file1, "w") {}
+    File.open(@file2, "w") {}
+  end
+
+  after :each do
+    File.delete(@file1) if File.exist?(@file1)
+    File.delete(@file2) if File.exist?(@file2)
+  end
+
+  it "sets the access and modification time of each file" do
+    File.utime(@atime, @mtime, @file1, @file2)
+    File.atime(@file1).to_i.should be_close(@atime.to_i, 2)
+    File.mtime(@file1).to_i.should be_close(@mtime.to_i, 2)
+    File.atime(@file2).to_i.should be_close(@atime.to_i, 2)
+    File.mtime(@file2).to_i.should be_close(@mtime.to_i, 2)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/writable_real_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/writable_real_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/writable_real_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/writable_real'
+
+describe "File.writable_real?" do
+  it_behaves_like :file_writable_real, :writable_real?, File
+  it_behaves_like :file_writable_real_missing, :writable_real?, File
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/writable_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/writable_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/writable_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/writable'
+
+describe "File.writable?" do
+  it_behaves_like :file_writable, :writable?, File
+  it_behaves_like :file_writable_missing, :writable?, File
+end

Added: MacRuby/branches/experimental/spec/frozen/core/file/zero_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/file/zero_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/file/zero_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/zero'
+
+describe "File.zero?" do
+  it_behaves_like :file_zero, :zero?, File
+  it_behaves_like :file_zero_missing, :zero?, File
+end

Added: MacRuby/branches/experimental/spec/frozen/core/filetest/blockdev_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/filetest/blockdev_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/filetest/blockdev_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/blockdev'
+
+describe "FileTest.blockdev?" do
+  it_behaves_like :file_blockdev, :blockdev?, FileTest
+end

Added: MacRuby/branches/experimental/spec/frozen/core/filetest/chardev_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/filetest/chardev_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/filetest/chardev_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/chardev'
+
+describe "FileTest.chardev?" do
+  it_behaves_like :file_chardev, :chardev?, FileTest
+end 

Added: MacRuby/branches/experimental/spec/frozen/core/filetest/directory_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/filetest/directory_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/filetest/directory_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/directory'
+
+describe "FileTest.directory?" do
+  it_behaves_like :file_directory, :directory?, FileTest
+end

Added: MacRuby/branches/experimental/spec/frozen/core/filetest/executable_real_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/filetest/executable_real_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/filetest/executable_real_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/executable_real'
+
+describe "FileTest.executable_real?" do
+  it_behaves_like :file_executable_real, :executable_real?, FileTest
+  it_behaves_like :file_executable_real_missing, :executable_real?, FileTest
+end

Added: MacRuby/branches/experimental/spec/frozen/core/filetest/executable_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/filetest/executable_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/filetest/executable_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/executable'
+
+describe "FileTest.executable?" do
+  it_behaves_like :file_executable, :executable?, FileTest
+  it_behaves_like :file_executable_missing, :executable?, FileTest
+end

Added: MacRuby/branches/experimental/spec/frozen/core/filetest/exist_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/filetest/exist_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/filetest/exist_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/exist'
+
+describe "FileTest.exist?" do
+  it_behaves_like :file_exist, :exist?, FileTest
+end

Added: MacRuby/branches/experimental/spec/frozen/core/filetest/exists_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/filetest/exists_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/filetest/exists_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/exist'
+
+describe "FileTest.exists?" do
+  it_behaves_like :file_exist, :exists?, FileTest
+end

Added: MacRuby/branches/experimental/spec/frozen/core/filetest/file_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/filetest/file_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/filetest/file_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/file'
+
+describe "File.file?" do
+  it_behaves_like :file_file, :file?, File
+end

Added: MacRuby/branches/experimental/spec/frozen/core/filetest/grpowned_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/filetest/grpowned_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/filetest/grpowned_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/grpowned'
+
+describe "FileTest.grpowned?" do
+  it_behaves_like :file_grpowned, :grpowned?, FileTest
+end

Added: MacRuby/branches/experimental/spec/frozen/core/filetest/identical_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/filetest/identical_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/filetest/identical_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/identical'
+
+describe "FileTest.identical?" do
+  it_behaves_like :file_identical, :identical?, FileTest
+end

Added: MacRuby/branches/experimental/spec/frozen/core/filetest/owned_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/filetest/owned_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/filetest/owned_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/owned'
+
+describe "FileTest.owned?" do
+  it_behaves_like :file_owned, :owned?, FileTest
+end

Added: MacRuby/branches/experimental/spec/frozen/core/filetest/pipe_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/filetest/pipe_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/filetest/pipe_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/pipe'
+
+describe "FileTest.pipe?" do
+  it_behaves_like :file_pipe, :pipe?, FileTest
+end

Added: MacRuby/branches/experimental/spec/frozen/core/filetest/readable_real_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/filetest/readable_real_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/filetest/readable_real_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/readable_real'
+
+describe "FileTest.readable_real?" do
+  it_behaves_like :file_readable_real, :readable_real?, FileTest
+  it_behaves_like :file_readable_real_missing, :readable_real?, FileTest
+end

Added: MacRuby/branches/experimental/spec/frozen/core/filetest/readable_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/filetest/readable_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/filetest/readable_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/readable'
+
+describe "FileTest.readable?" do
+  it_behaves_like :file_readable, :readable?, FileTest
+  it_behaves_like :file_readable_missing, :readable?, FileTest
+end

Added: MacRuby/branches/experimental/spec/frozen/core/filetest/setgid_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/filetest/setgid_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/filetest/setgid_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/setgid'
+
+describe "FileTest.setgid?" do
+  it_behaves_like :file_setgid, :setgid?, FileTest
+end

Added: MacRuby/branches/experimental/spec/frozen/core/filetest/setuid_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/filetest/setuid_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/filetest/setuid_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/setuid'
+
+describe "FileTest.setuid?" do
+  it_behaves_like :file_setuid, :setuid?, FileTest
+end

Added: MacRuby/branches/experimental/spec/frozen/core/filetest/size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/filetest/size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/filetest/size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/size'
+
+describe "FileTest.size?" do
+  it_behaves_like :file_size, :size?, FileTest
+  it_behaves_like :file_size_missing, :size?, FileTest
+end

Added: MacRuby/branches/experimental/spec/frozen/core/filetest/socket_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/filetest/socket_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/filetest/socket_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/socket'
+
+describe "FileTest.socket?" do
+  it_behaves_like :file_socket, :socket?, FileTest
+end

Added: MacRuby/branches/experimental/spec/frozen/core/filetest/sticky_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/filetest/sticky_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/filetest/sticky_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/sticky'
+
+describe "FileTest.sticky?" do
+  it_behaves_like :file_sticky, :sticky?, FileTest
+end

Added: MacRuby/branches/experimental/spec/frozen/core/filetest/symlink_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/filetest/symlink_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/filetest/symlink_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/symlink'
+
+describe "FileTest.symlink?" do
+  it_behaves_like :file_symlink, :symlink?, FileTest
+end

Added: MacRuby/branches/experimental/spec/frozen/core/filetest/writable_real_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/filetest/writable_real_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/filetest/writable_real_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/writable_real'
+
+describe "FileTest.writable_real?" do
+  it_behaves_like :file_writable_real, :writable_real?, FileTest
+  it_behaves_like :file_writable_real_missing, :writable_real?, FileTest
+end

Added: MacRuby/branches/experimental/spec/frozen/core/filetest/writable_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/filetest/writable_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/filetest/writable_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/writable'
+
+describe "FileTest.writable?" do
+  it_behaves_like :file_writable, :writable?, FileTest
+  it_behaves_like :file_writable_missing, :writable?, FileTest
+end

Added: MacRuby/branches/experimental/spec/frozen/core/filetest/zero_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/filetest/zero_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/filetest/zero_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../shared/file/zero'
+
+describe "FileTest.zero?" do
+  it_behaves_like :file_zero, :zero?, FileTest
+  it_behaves_like :file_zero_missing, :zero?, FileTest
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/abs_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/abs_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/abs_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#abs" do
+  it "returns self's absolute value" do
+    { 0 => [0, -0, +0], 2 => [2, -2, +2], 100 => [100, -100, +100] }.each do |key, values|
+      values.each do |value|
+        value.abs.should == key
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/bit_and_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/bit_and_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/bit_and_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,47 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#&" do
+  it "returns self bitwise AND other" do
+    (256 & 16).should == 0
+    (2010 & 5).should == 0
+    (65535 & 1).should == 1
+    (0xffff & bignum_value + 0xffff_ffff).should == 65535
+  end
+  
+  it "should be able to AND a bignum with a fixnum" do
+    (-1 & 2**64).should == 18446744073709551616
+  end
+  
+  ruby_version_is "" ... "1.9" do
+    ruby_bug "#", "1.8.6" do
+      it "doesn't raise an error if passed a Float out of Fixnum range" do
+        lambda { 1 & bignum_value(10000).to_f }.should_not raise_error()
+        lambda { 1 & -bignum_value(10000).to_f }.should_not raise_error()
+      end
+    end
+
+    it "converts a Float to an Integer" do
+      (3 & 2.4).should == 2
+    end
+  end
+
+  it "tries to convert it's int like argument to an Integer using to_int" do
+    (obj = mock('2')).should_receive(:to_int).and_return(2)
+    (3 & obj).should == 2
+  end
+  
+  it "raises a TypeError when the given argument can't be converted to Integer" do
+    obj = mock('asdf')
+    lambda { 3 & obj }.should raise_error(TypeError)
+    
+    obj.should_receive(:to_int).and_return("asdf")
+    lambda { 3 & obj }.should raise_error(TypeError)
+  end
+
+  ruby_bug "#", "1.8.6" do # Fixed at MRI 1.8.7
+    it "coerces arguments correctly even if it is a Bignum" do
+      (obj = mock('large value')).should_receive(:to_int).and_return(8000_0000_0000_0000_0000)
+      (3 & obj).should == 0
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/bit_or_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/bit_or_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/bit_or_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,48 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#|" do
+  it "returns self bitwise OR other" do
+    (1 | 0).should == 1
+    (5 | 4).should == 5
+    (5 | 6).should == 7
+    (248 | 4096).should == 4344
+    (0xffff | bignum_value + 0xf0f0).should == 0x8000_0000_0000_ffff
+  end
+
+  it "should be able to AND a bignum with a fixnum" do
+    (-1 | 2**64).should == -1
+  end
+
+  ruby_version_is "" ... "1.9" do
+    ruby_bug "#", "1.8.6" do
+      it "doesn't raise an error if passed a Float out of Fixnum range" do
+        lambda { 1 | bignum_value(10000).to_f }.should_not raise_error()
+        lambda { 1 | -bignum_value(10000).to_f }.should_not raise_error()
+      end
+    end
+  
+    it "converts a Float to an Integer" do
+      (5 | 4.3).should == 5
+    end
+  end
+    
+  it "tries to convert the int like argument to an Integer using to_int" do
+    (obj = mock('4')).should_receive(:to_int).and_return(4)
+    (3 | obj).should == 7
+  end
+  
+  it "raises a TypeError when the given argument can't be converted to Integer" do
+    obj = mock('asdf')
+    lambda { 3 | obj }.should raise_error(TypeError)
+    
+    obj.should_receive(:to_int).and_return("asdf")
+    lambda { 3 | obj }.should raise_error(TypeError)
+  end
+
+  ruby_bug "#", "1.8.6" do # Fixed at MRI 1.8.7
+    it "coerces arguments correctly even if it is a Bignum" do
+      (obj = mock('large value')).should_receive(:to_int).and_return(8000_0000_0000_0000_0000)
+      (3 | obj).should == 80000000000000000003
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/bit_xor_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/bit_xor_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/bit_xor_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,47 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#^" do
+  it "returns self bitwise EXCLUSIVE OR other" do
+    (3 ^ 5).should == 6
+    (-2 ^ -255).should == 255
+    (5 ^ bignum_value + 0xffff_ffff).should == 0x8000_0000_ffff_fffa
+  end
+  
+  it "should be able to AND a bignum with a fixnum" do
+    (-1 ^ 2**64).should == -18446744073709551617
+  end
+  
+  ruby_version_is "" ... "1.9" do
+    ruby_bug "#", "1.8.6" do
+      it "doesn't raise an error if passed a Float out of Fixnum range" do
+        lambda { 1 ^ bignum_value(10000).to_f }.should_not raise_error()
+        lambda { 1 ^ -bignum_value(10000).to_f }.should_not raise_error()
+      end
+    end
+  
+    it "converts a Float to an Integer" do
+      (5 ^ 4.3).should == 1
+      (-7 ^ 15.2).should == -10
+    end
+  end
+    
+  it "tries to convert the given argument to an Integer using to_int" do
+    (obj = mock('4')).should_receive(:to_int).and_return(4)
+    (3 ^ obj).should == 7
+  end
+  
+  it "raises a TypeError when the given argument can't be converted to Integer" do
+    obj = mock('asdf')
+    lambda { 3 ^ obj }.should raise_error(TypeError)
+    
+    obj.should_receive(:to_int).and_return("asdf")
+    lambda { 3 ^ obj }.should raise_error(TypeError)
+  end
+  
+  ruby_bug "#", "1.8.6" do # Fixed at MRI 1.8.7
+    it "coerces arguments correctly even if it is a Bignum" do
+      (obj = mock('large value')).should_receive(:to_int).and_return(8000_0000_0000_0000_0000)
+      (3 ^ obj).should == 80000000000000000003
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/coerce_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/coerce_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/coerce_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,39 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#coerce when given a Fixnum" do
+  it "returns an array containing two Fixnums" do
+    1.coerce(2).should == [2, 1]
+    1.coerce(2).map { |i| i.class }.should == [Fixnum, Fixnum]
+  end
+end
+
+describe "Fixnum#coerce when given a String" do
+  it "raises an ArgumentError when trying to coerce with a non-number String" do
+    lambda { 1.coerce(":)") }.should raise_error(ArgumentError)
+  end
+
+  it "returns  an array containing two Floats" do
+    1.coerce("2").should == [2.0, 1.0]
+    1.coerce("-2").should == [-2.0, 1.0]
+  end
+end
+
+describe "Fixnum#coerce" do
+  it "raises a TypeError when trying to coerce with nil" do
+    lambda { 1.coerce(nil) }.should raise_error(TypeError)
+  end
+
+  it "tries to convert the given Object into a Float by using #to_f" do
+    (obj = mock('1.0')).should_receive(:to_f).and_return(1.0)
+    2.coerce(obj).should == [1.0, 2.0]
+    
+    (obj = mock('0')).should_receive(:to_f).and_return('0')
+    lambda { 2.coerce(obj).should == [1.0, 2.0] }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError when given an Object that does not respond to #to_f" do
+    lambda { 1.coerce(mock('x'))  }.should raise_error(TypeError)
+    lambda { 1.coerce(1..4)       }.should raise_error(TypeError)
+    lambda { 1.coerce(:test)      }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/comparison_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/comparison_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/comparison_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#<=>" do
+  it "returns -1 when self is less than the given argument" do
+    (-3 <=> -1).should == -1
+    (-5 <=> 10).should == -1
+    (-5 <=> -4.5).should == -1
+  end
+  
+  it "returns 0 when self is equal to the given argument" do
+    (0 <=> 0).should == 0
+    (954 <=> 954).should == 0
+    (954 <=> 954.0).should == 0
+  end
+  
+  it "returns 1 when self is greater than the given argument" do
+    (496 <=> 5).should == 1
+    (200 <=> 100).should == 1
+    (51 <=> 50.5).should == 1
+  end
+
+  it "returns nil when the given argument is not an Integer" do
+    (3 <=> mock('x')).should == nil
+    (3 <=> 'test').should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/complement_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/complement_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/complement_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#~" do
+  it "returns self with each bit flipped" do
+    (~0).should == -1
+    (~1221).should == -1222
+    (~-2).should == 1
+    (~-599).should == 598
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/div_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/div_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/div_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,44 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#div with a Fixnum" do
+  it "returns self divided by the given argument as an Integer" do
+    2.div(2).should == 1
+    1.div(2).should == 0
+    5.div(2).should == 2
+  end
+end
+
+describe "Fixnum#div" do
+  it "rounds towards -inf" do
+    8192.div(10).should == 819
+    8192.div(-10).should == -820
+    (-8192).div(10).should == -820
+    (-8192).div(-10).should == 819
+  end
+
+  it "coerces self and the given argument to Floats and returns self divided by other as Fixnum" do
+    1.div(0.2).should == 5
+    1.div(0.16).should == 6
+    1.div(0.169).should == 5
+    -1.div(50.4).should == -1
+    1.div(bignum_value).should == 0
+  end
+  
+  it "raises a FloatDomainError when the given argument is 0 and a Float" do
+    lambda { 0.div(0.0)   }.should raise_error(FloatDomainError)
+    lambda { 10.div(0.0)  }.should raise_error(FloatDomainError)
+    lambda { -10.div(0.0) }.should raise_error(FloatDomainError)
+  end
+
+  it "raises a ZeroDivisionError when the given argument is 0" do
+    lambda { 13.div(0) }.should raise_error(ZeroDivisionError)
+  end
+  
+  it "raises a TypeError when given a non-Integer" do
+    lambda {
+      (obj = mock('10')).should_receive(:to_int).any_number_of_times.and_return(10)
+      13.div(obj)
+    }.should raise_error(TypeError)
+    lambda { 5.div("2") }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/divide_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/divide_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/divide_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#/" do
+  it "returns self divided by the given argument" do
+    (2 / 2).should == 1
+    (3 / 2).should == 1
+  end
+  
+  it "raises a ZeroDivisionError if the given argument is zero and not a Float" do
+    lambda { 1 / 0 }.should raise_error(ZeroDivisionError)
+  end
+  
+  it "does NOT raise ZeroDivisionError if the given argument is zero and is a Float" do
+    (1 / 0.0).to_s.should == 'Infinity'
+    (-1 / 0.0).to_s.should == '-Infinity'
+  end
+
+  it "coerces fixnum and return self divided by other" do
+    (-1 / 50.4).should be_close(-0.0198412698412698, TOLERANCE)
+    (1 / bignum_value).should == 0
+  end
+
+  it "raises a TypeError when given a non-Integer" do
+    lambda {
+      (obj = mock('10')).should_receive(:to_int).any_number_of_times.and_return(10)
+      13 / obj
+    }.should raise_error(TypeError)
+    lambda { 13 / "10"    }.should raise_error(TypeError)
+    lambda { 13 / :symbol }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/divmod_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/divmod_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/divmod_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#divmod" do
+  it "returns an Array containing quotient and modulus obtained from dividing self by the given argument" do
+    13.divmod(4).should == [3, 1]
+    4.divmod(13).should == [0, 4]
+
+    13.divmod(4.0).should == [3, 1]
+    4.divmod(13.0).should == [0, 4]
+
+    1.divmod(2.0).should == [0, 1.0]
+    200.divmod(bignum_value).should == [0, 200]
+  end
+  
+  it "raises a ZeroDivisionError when the given argument is 0" do
+    lambda { 13.divmod(0)  }.should raise_error(ZeroDivisionError)
+    lambda { 0.divmod(0)   }.should raise_error(ZeroDivisionError)
+    lambda { -10.divmod(0) }.should raise_error(ZeroDivisionError)
+  end
+
+  it "raises a FloatDomainError when the given argument is 0 and a Float" do
+    lambda { 0.divmod(0.0)   }.should raise_error(FloatDomainError)
+    lambda { 10.divmod(0.0)  }.should raise_error(FloatDomainError)
+    lambda { -10.divmod(0.0) }.should raise_error(FloatDomainError)
+  end
+
+  it "raises a TypeError when given a non-Integer" do
+    lambda {
+      (obj = mock('10')).should_receive(:to_int).any_number_of_times.and_return(10)
+      13.divmod(obj)
+    }.should raise_error(TypeError)
+    lambda { 13.divmod("10")    }.should raise_error(TypeError)
+    lambda { 13.divmod(:symbol) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/element_reference_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/element_reference_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/element_reference_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,38 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#[]" do
+  it "returns the nth bit in the binary representation of self" do
+    2[3].should == 0
+    15[1].should == 1
+
+    2[3].should == 0
+    3[0xffffffff].should == 0
+    3[-0xffffffff].should == 0
+  end
+  
+  it "tries to convert the given argument to an Integer using #to_int" do
+    15[1.3].should == 15[1]
+    
+    (obj = mock('1')).should_receive(:to_int).and_return(1)
+    2[obj].should == 1
+  end
+
+  it "raises a TypeError when the given argument can't be converted to Integer" do
+    obj = mock('asdf')
+    lambda { 3[obj] }.should raise_error(TypeError)
+    
+    obj.should_receive(:to_int).and_return("asdf")
+    lambda { 3[obj] }.should raise_error(TypeError)
+  end
+
+  ruby_bug "#", "1.8.6" do # Fixed at MRI 1.8.7
+    it "coerces arguments correctly even if it is a Bignum" do
+      (obj = mock('large value')).should_receive(:to_int).and_return(8000_0000_0000_0000_0000)
+      3[obj].should == 0
+      obj = 8e19
+      
+      3[obj].should == 0
+    end
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/equal_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/equal_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/equal_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#==" do
+  it "returns true if self has the same value as other" do
+    (1 == 1).should == true
+    (9 == 5).should == false
+    
+    # Actually, these call Float#==, Bignum#== etc.
+    (9 == 9.0).should == true
+    (9 == 9.01).should == false
+    
+    (10 == bignum_value).should == false
+  end
+  
+  it "calls 'other == self' if the given argument is not a Fixnum" do
+    (1 == '*').should == false
+    
+    obj = mock('one other')
+    obj.should_receive(:==).any_number_of_times.and_return(false)
+    1.should_not == obj
+
+    obj = mock('another')
+    obj.should_receive(:==).any_number_of_times.and_return(true)
+    2.should == obj
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/exponent_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/exponent_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/exponent_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#**" do
+  it "returns self raised to the given power" do
+    (2 ** 0).should == 1
+    (2 ** 1).should == 2
+    (2 ** 2).should == 4
+
+    (9 ** 0.5).to_s.should == '3.0'
+    (5 ** -1).to_f.to_s.should == '0.2'
+
+    (2 ** 40).should == 1099511627776
+  end
+
+  conflicts_with :Rational do
+    ruby_bug "ruby-dev:32084", "1.8.6.138" do
+      it "returns Infinity for 0**-1" do
+        (0**-1).should be_kind_of(Float)
+        (0**-1).infinite?.should == 1
+      end
+    end
+
+    it "raises a TypeError when given a non-Integer" do
+      lambda {
+        (obj = mock('10')).should_receive(:to_int).any_number_of_times.and_return(10)
+        13 ** obj
+      }.should raise_error(TypeError)
+      lambda { 13 ** "10"    }.should raise_error(TypeError)
+      lambda { 13 ** :symbol }.should raise_error(TypeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/gt_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/gt_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/gt_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#>" do
+  it "returns true if self is greater than the given argument" do
+    (13 > 2).should == true
+    (-500 > -600).should == true
+    
+    (1 > 5).should == false
+    (5 > 5).should == false
+    
+    (900 > bignum_value).should == false
+    (5 > 4.999).should == true
+  end
+  
+  it "raises an ArgumentError when given a non-Integer" do
+    lambda { 5 > "4"       }.should raise_error(ArgumentError)
+    lambda { 5 > mock('x') }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/gte_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/gte_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/gte_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#>=" do
+  it "returns true if self is greater than or equal to the given argument" do
+    (13 >= 2).should == true
+    (-500 >= -600).should == true
+    
+    (1 >= 5).should == false
+    (2 >= 2).should == true
+    (5 >= 5).should == true
+    
+    (900 >= bignum_value).should == false
+    (5 >= 4.999).should == true
+  end
+
+  it "raises an ArgumentError when given a non-Integer" do
+    lambda { 5 >= "4"       }.should raise_error(ArgumentError)
+    lambda { 5 >= mock('x') }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/hash_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/hash_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/hash_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#hash" do
+  it "is provided" do
+    1.respond_to?(:hash).should == true
+  end
+
+  it "is stable" do
+    1.hash.should == 1.hash
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/id2name_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/id2name_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/id2name_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#id2name" do
+
+  not_compliant_on :rubinius do
+    it "returns the string name of the object whose symbol ID is self" do
+      a = :@sym
+      b = :@ruby
+      c = :@rubinius
+      a.to_i.id2name.should == '@sym'
+      b.to_i.id2name.should == '@ruby'
+      c.to_i.id2name.should == '@rubinius'
+    end
+
+    it "returns nil if there is no symbol in the symbol table with this value" do
+      100000000.id2name.should == nil
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/induced_from_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/induced_from_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/induced_from_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum.induced_from with [Float]" do
+  it "returns a Fixnum when the passed Float is in Fixnum's range" do
+    Fixnum.induced_from(2.5).should eql(2)
+    Fixnum.induced_from(-3.14).should eql(-3)
+    Fixnum.induced_from(10 - TOLERANCE).should eql(9)
+    Fixnum.induced_from(TOLERANCE).should eql(0)
+  end
+  
+  it "raises a RangeError when the passed Float is out of Fixnum's range" do
+    lambda { Fixnum.induced_from((2**64).to_f) }.should raise_error(RangeError)
+    lambda { Fixnum.induced_from(-(2**64).to_f) }.should raise_error(RangeError)
+  end
+end
+
+describe "Fixnum.induced_from" do
+  it "returns the passed argument when passed a Fixnum" do
+    Fixnum.induced_from(3).should eql(3)
+    Fixnum.induced_from(-10).should eql(-10)
+  end
+  
+  it "tries to convert non-Integers to a Integers using #to_int" do
+    obj = mock("Converted to Integer")
+    obj.should_receive(:to_int).and_return(10)
+    Fixnum.induced_from(obj)
+  end
+  
+  it "raises a TypeError when conversion to Integer returns a Bignum" do
+    obj = mock("Not converted to Integer")
+    obj.should_receive(:to_int).and_return(bignum_value)
+    lambda { Fixnum.induced_from(obj) }.should raise_error(RangeError)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/left_shift_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/left_shift_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/left_shift_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,51 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#<<" do
+  it "returns self shifted the given amount of bits to the left" do
+    (7 << 2).should == 28
+    (9 << 4).should == 144
+    (1 <<30).should == 1073741824
+    (1 <<31).should == 2147483648
+    (1 <<32).should == 4294967296
+    (-1<<31).should == -2147483648
+    (-1<<32).should == -4294967296
+    (1 <<62).should == 4611686018427387904
+    (1 <<63).should == 9223372036854775808
+    (1 <<64).should == 18446744073709551616
+    (-1<<63).should == -9223372036854775808
+    (-1<<64).should == -18446744073709551616
+  end
+
+  it "performs a right-shift if given a negative value" do
+    (7 << -2).should == (7 >> 2)
+    (9 << -4).should == (9 >> 4)
+  end
+  
+  it "coerces result on overflow and return self shifted left other bits" do
+    (9 << 4.2).should == 144
+    (6 << 0xff).should == 347376267711948586270712955026063723559809953996921692118372752023739388919808
+  end
+  
+  it "tries to convert its argument to an Integer using to_int" do
+    (5 << 4.3).should == 80
+    
+    (obj = mock('4')).should_receive(:to_int).and_return(4)
+    (3 << obj).should == 48
+  end
+  
+  it "raises a TypeError when the given argument can't be converted to Integer" do
+    obj = mock('asdf')
+    lambda { 3 << obj }.should raise_error(TypeError)
+    
+    obj.should_receive(:to_int).and_return("asdf")
+    lambda { 3 << obj }.should raise_error(TypeError)
+  end
+
+  it "raises a RangeError when the given argument is out of range of Fixnum" do
+    (obj = mock('large value')).should_receive(:to_int).and_return(8000_0000_0000_0000_0000)
+    lambda { 3 << obj }.should raise_error(RangeError)
+
+    obj = 8e19
+    lambda { 3 << obj }.should raise_error(RangeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/lt_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/lt_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/lt_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#<" do
+  it "returns true if self is less than the given argument" do
+    (2 < 13).should == true
+    (-600 < -500).should == true
+    
+    (5 < 1).should == false
+    (5 < 5).should == false
+    
+    (900 < bignum_value).should == true
+    (5 < 4.999).should == false
+  end
+  
+  it "raises an ArgumentError when given a non-Integer" do
+    lambda { 5 < "4"       }.should raise_error(ArgumentError)
+    lambda { 5 < mock('x') }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/lte_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/lte_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/lte_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#<=" do
+  it "returns true if self is less than or equal to other" do
+    (2 <= 13).should == true
+    (-600 <= -500).should == true
+    
+    (5 <= 1).should == false
+    (5 <= 5).should == true
+    (-2 <= -2).should == true
+    
+    (900 <= bignum_value).should == true
+    (5 <= 4.999).should == false
+  end
+
+  it "raises an ArgumentError when given a non-Integer" do
+    lambda { 5 <= "4"       }.should raise_error(ArgumentError)
+    lambda { 5 <= mock('x') }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/minus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/minus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/minus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#-" do
+  it "returns self minus the given Integer" do
+    (5 - 10).should == -5
+    (9237212 - 5_280).should == 9231932
+    
+    (781 - 0.5).should == 780.5
+    (2_560_496 - bignum_value).should == -9223372036852215312
+  end
+  
+  it "raises a TypeError when given a non-Integer" do
+    lambda {
+      (obj = mock('10')).should_receive(:to_int).any_number_of_times.and_return(10)
+      13 - obj
+    }.should raise_error(TypeError)
+    lambda { 13 - "10"    }.should raise_error(TypeError)
+    lambda { 13 - :symbol }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/modulo_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/modulo_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/modulo_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/modulo'
+
+describe "Fixnum#%" do
+  it_behaves_like(:fixnum_modulo, :%)
+end
+
+describe "Fixnum#modulo" do
+  it_behaves_like(:fixnum_modulo, :modulo)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/multiply_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/multiply_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/multiply_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#*" do
+  it "returns self multiplied by the given Integer" do
+    (4923 * 2).should == 9846
+    (1342177 * 800).should == 1073741600
+    (65536 * 65536).should == 4294967296
+
+    (256 * bignum_value).should == 2361183241434822606848
+    (6712 * 0.25).should == 1678.0
+  end
+
+  it "raises a TypeError when given a non-Integer" do
+    lambda {
+      (obj = mock('10')).should_receive(:to_int).any_number_of_times.and_return(10)
+      13 * obj
+    }.should raise_error(TypeError)
+    lambda { 13 * "10"    }.should raise_error(TypeError)
+    lambda { 13 * :symbol }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/plus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/plus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/plus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#+" do
+  it "returns self plus the given Integer" do
+    (491 + 2).should == 493
+    (90210 + 10).should == 90220
+
+    (9 + bignum_value).should == 9223372036854775817
+    (1001 + 5.219).should == 1006.219
+  end
+
+  it "raises a TypeError when given a non-Integer" do
+    lambda {
+      (obj = mock('10')).should_receive(:to_int).any_number_of_times.and_return(10)
+      13 + obj
+    }.should raise_error(TypeError)
+    lambda { 13 + "10"    }.should raise_error(TypeError)
+    lambda { 13 + :symbol }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/quo_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/quo_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/quo_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#quo" do
+  it "returns the result of self divided by the given Integer as a Float" do
+    2.quo(2.5).should == 0.8
+    5.quo(2).should == 2.5
+    45.quo(bignum_value).should be_close(1.04773789668636e-08, TOLERANCE)
+  end
+
+  conflicts_with :Rational do
+    it "does not raise a ZeroDivisionError when the given Integer is 0" do
+      0.quo(0).to_s.should == "NaN"
+      10.quo(0).to_s.should == "Infinity"
+      -10.quo(0).to_s.should == "-Infinity"
+    end
+  end
+
+  it "does not raise a FloatDomainError when the given Integer is 0 and a Float" do
+    0.quo(0.0).to_s.should == "NaN"
+    10.quo(0.0).to_s.should == "Infinity"
+    -10.quo(0.0).to_s.should == "-Infinity"
+  end
+
+  conflicts_with :Rational do
+    it "raises a TypeError when given a non-Integer" do
+      lambda {
+        (obj = mock('x')).should_not_receive(:to_int)
+        13.quo(obj)
+      }.should raise_error(TypeError)
+      lambda { 13.quo("10")    }.should raise_error(TypeError)
+      lambda { 13.quo(:symbol) }.should raise_error(TypeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/right_shift_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/right_shift_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/right_shift_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,47 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#>>" do
+  it "returns self shifted the given amount of bits to the right" do
+    (7 >> 1).should == 3
+    (4095 >> 3).should == 511
+    (9245278 >> 1).should == 4622639
+  end
+
+  it "performs a left-shift if given a negative value" do
+    (7 >> -1).should == (7 << 1)
+    (4095 >> -3).should == (4095 << 3)
+  end
+  
+  it "performs a right-shift if given a negative value" do
+    (-7 >> 1).should == -4
+    (-4095 >> 3).should == -512
+  end
+  
+  it "tries to convert it's argument to an Integer using to_int" do
+    (7 >> 1.3).should == 3
+    
+    (obj = mock('1')).should_receive(:to_int).and_return(1)
+    (7 >> obj).should == 3
+  end
+  
+  it "raises a TypeError when the given argument can't be converted to Integer" do
+    obj = mock('asdf')
+    lambda { 3 >> obj }.should raise_error(TypeError)
+    
+    obj.should_receive(:to_int).and_return("asdf")
+    lambda { 3 >> obj }.should raise_error(TypeError)
+  end
+
+  it "does not raise RangeError when the given argument is out of range of Fixnum" do
+    (obj1 = mock('large value')).should_receive(:to_int).and_return(8000_0000_0000_0000_0000)
+    (obj2 = mock('large value')).should_receive(:to_int).and_return(8000_0000_0000_0000_0000)
+    (3 >> obj1).should == 0
+    (-3 >> obj2).should == -1
+
+    obj = 8e19
+    (3 >> obj).should == 0
+    (-3 >> obj).should == -1
+  end
+
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/shared/modulo.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/shared/modulo.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/shared/modulo.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,42 @@
+describe :fixnum_modulo, :shared => true do
+  it "returns the modulus obtained from dividing self by the given argument" do
+    13.send(@method, 4).should == 1
+    4.send(@method, 13).should == 4
+
+    13.send(@method, 4.0).should == 1
+    4.send(@method, 13.0).should == 4
+    
+    (-200).send(@method, 256).should == 56
+    (-1000).send(@method, 512).should == 24
+    
+    (-200).send(@method, -256).should == -200
+    (-1000).send(@method, -512).should == -488
+
+    (200).send(@method, -256).should == -56
+    (1000).send(@method, -512).should == -24    
+
+    1.send(@method, 2.0).should == 1.0
+    200.send(@method, bignum_value).should == 200
+  end
+
+  it "raises a ZeroDivisionError when the given argument is 0" do
+    lambda { 13.send(@method, 0)  }.should raise_error(ZeroDivisionError)
+    lambda { 0.send(@method, 0)   }.should raise_error(ZeroDivisionError)
+    lambda { -10.send(@method, 0) }.should raise_error(ZeroDivisionError)
+  end
+
+  it "does not raise a FloatDomainError when the given argument is 0 and a Float" do
+    0.send(@method, 0.0).to_s.should == "NaN" 
+    10.send(@method, 0.0).to_s.should == "NaN" 
+    -10.send(@method, 0.0).to_s.should == "NaN" 
+  end
+
+  it "raises a TypeError when given a non-Integer" do
+    lambda {
+      (obj = mock('10')).should_receive(:to_int).any_number_of_times.and_return(10)
+      13.send(@method, obj)
+    }.should raise_error(TypeError)
+    lambda { 13.send(@method, "10")    }.should raise_error(TypeError)
+    lambda { 13.send(@method, :symbol) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#size" do
+  platform_is :wordsize => 32 do
+    it "returns the number of bytes in the machine representation of self" do
+      -1.size.should == 4
+      0.size.should == 4
+      4091.size.should == 4
+    end
+  end
+
+  platform_is :wordsize => 64 do
+    it "returns the number of bytes in the machine representation of self" do
+      -1.size.should == 8
+      0.size.should == 8
+      4091.size.should == 8
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/to_f_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/to_f_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/to_f_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#to_f" do
+  it "returns self converted to a Float" do
+    0.to_f.should == 0.0
+    -500.to_f.should == -500.0
+    9_641_278.to_f.should == 9641278.0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#to_s when given a base" do
+  it "returns self converted to a String in the given base" do
+    12345.to_s(2).should == "11000000111001"
+    12345.to_s(8).should == "30071"
+    12345.to_s(10).should == "12345"
+    12345.to_s(16).should == "3039"
+    12345.to_s(36).should == "9ix"
+  end
+  
+  it "raises an ArgumentError if the base is less than 2 or higher than 36" do
+    lambda { 123.to_s(-1) }.should raise_error(ArgumentError)
+    lambda { 123.to_s(0)  }.should raise_error(ArgumentError)
+    lambda { 123.to_s(1)  }.should raise_error(ArgumentError)
+    lambda { 123.to_s(37) }.should raise_error(ArgumentError)
+  end
+end
+
+describe "Fixnum#to_s when no base given" do
+  it "returns self converted to a String using base 10" do
+    255.to_s.should == '255'
+    3.to_s.should == '3'
+    0.to_s.should == '0'
+    -9002.to_s.should == '-9002'
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/to_sym_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/to_sym_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/to_sym_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#to_sym" do
+  not_compliant_on :rubinius do
+    it "returns the symbol whose integer value is self" do
+      a = :@sym
+      b = :@ruby
+      c = :@rubinius
+
+      a.to_i.to_sym.should == :@sym
+      b.to_i.to_sym.should == :@ruby
+      c.to_i.to_sym.should == :@rubinius
+    end
+
+    it "returns nil if there is no symbol in the symbol table with this value" do
+      100000000.to_sym.should == nil
+    end
+
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/uminus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/uminus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/uminus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#-@" do
+  it "returns self as a negative value" do
+    2.send(:-@).should == -2
+    -2.should == -2
+    -268435455.should == -268435455
+    (--5).should == 5
+    -8.send(:-@).should == 8
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/fixnum/zero_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/fixnum/zero_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/fixnum/zero_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Fixnum#zero?" do
+  it "returns true if self is 0" do
+    0.zero?.should == true
+    -1.zero?.should == false
+    1.zero?.should == false
+  end  
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/abs_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/abs_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/abs_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#abs" do
+  it "returns the absolute value" do
+    -99.1.abs.should be_close(99.1, TOLERANCE)
+    4.5.abs.should be_close(4.5, TOLERANCE)
+    0.0.abs.should be_close(0.0, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/ceil_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/ceil_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/ceil_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#ceil" do
+  it "returns the smallest Integer greater than or equal to self" do
+    -1.2.ceil.should == -1
+    -1.0.ceil.should == -1
+    0.0.ceil.should == 0
+    1.3.ceil.should == 2
+    3.0.ceil.should == 3
+    -9223372036854775808.1.ceil.should == -9223372036854775808
+    9223372036854775808.1.ceil.should == 9223372036854775808
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/coerce_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/coerce_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/coerce_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#coerce" do
+  it "returns [other, self] both as Floats" do
+    1.2.coerce(1).should == [1.0, 1.2]
+    5.28.coerce(1.0).should == [1.0, 5.28]
+    1.0.coerce(1).should == [1.0, 1.0]
+    1.0.coerce("2.5").should == [2.5, 1.0]
+    1.0.coerce(3.14).should == [3.14, 1.0]
+
+    a, b = -0.0.coerce(bignum_value)
+    a.should be_close(9223372036854775808.000, TOLERANCE)
+    b.should be_close(-0.0, TOLERANCE)
+    a, b = 1.0.coerce(bignum_value)
+    a.should be_close(9223372036854775808.000, TOLERANCE)
+    b.should be_close(1.0, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/comparison_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/comparison_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/comparison_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#<=>" do
+  it "returns -1, 0, 1 when self is less than, equal, or greater than other" do
+    (1.5 <=> 5).should == -1
+    (2.45 <=> 2.45).should == 0
+    ((bignum_value*1.1) <=> bignum_value).should == 1
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/constants_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/constants_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/constants_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,52 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#CONSTANTS" do
+  specify  "the DIG value is  15" do
+    Float::DIG.should == 15
+  end
+
+  it "the EPSILON value is " do
+    Float::EPSILON.should == eval("0.0000000000000002220446049250313080847263336181640625")
+  end
+
+  it "the MANT_DIG is 53" do
+    Float::MANT_DIG.should == 53
+  end
+
+  it "the MAX_10_EXP is 308" do
+    Float::MAX_10_EXP.should == 308
+  end
+
+  it "the MIN_10_EXP is -308" do
+    Float::MIN_10_EXP.should == -307
+  end
+
+  it "the MAX_EXP is 1024" do
+    Float::MAX_EXP.should == 1024
+  end
+
+  it "the MIN_EXP is -1021" do
+    Float::MIN_EXP.should == -1021
+  end
+
+  it "the MAX is 1.79769313486232e+308" do
+    Float::MAX.should == eval("179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0")
+  end
+
+  not_compliant_on :jruby do
+    it "the MIN is 2.2250738585072e-308" do
+      Float::MIN.should == eval("2.225073858507201383090232717332404064219215980462331830553327416887204434813918195854283159012511020564067339731035811005152434161553460108856012385377718821130777993532002330479610147442583636071921565046942503734208375250806650616658158948720491179968591639648500635908770118304874799780887753749949451580451605050915399856582470818645113537935804992115981085766051992433352114352390148795699609591288891602992641511063466313393663477586513029371762047325631781485664350872122828637642044846811407613911477062801689853244110024161447421618567166150540154285084716752901903161322778896729707373123334086988983175067838846926092773977972858659654941091369095406136467568702398678315290680984617210924625396728515625e-308")
+    end
+  end
+
+  # TODO: Does this actually constitute noncompliance?
+  deviates_on :jruby do
+    it "the MIN is 4.9e-324" do
+      Float::MIN.should == 4.9e-324
+    end
+  end
+
+  it "the RADIX is 2" do
+    Float::RADIX.should == 2
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/divide_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/divide_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/divide_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#/" do
+  it "returns self divided by other" do
+    (5.75 / -2).should be_close(-2.875,TOLERANCE)
+    (451.0 / 9.3).should be_close(48.494623655914,TOLERANCE)
+    (91.1 / -0xffffffff).should be_close(-2.12108716418061e-08, TOLERANCE)
+  end
+  
+  it "properly handles BigDecimal argument" do
+    require 'bigdecimal'
+    (2.0 / BigDecimal.new('5.0')).should be_close(0.4, TOLERANCE)
+    (2.0 / BigDecimal.new('Infinity')).should == 0
+    (2.0 / BigDecimal.new('-Infinity')).should == 0
+    (2.0 / BigDecimal.new('0.0')).infinite?.should == 1
+    (2.0 / BigDecimal.new('-0.0')).infinite?.should == -1
+    (2.0 / BigDecimal.new('NaN')).nan?.should == true
+  end
+  
+  it "does NOT raise ZeroDivisionError if other is zero" do
+    (1.0 / 0.0).to_s.should == 'Infinity'
+    (-1.0 / 0.0).to_s.should == '-Infinity'
+    (1.0 / -0.0).to_s.should == '-Infinity'
+    (-1.0 / -0.0).to_s.should == 'Infinity'
+    (0.0 / 0.0).to_s.should == 'NaN'
+    (-0.0 / 0.0).to_s.should == 'NaN'
+    (-0.0 / -0.0).to_s.should == 'NaN'
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/divmod_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/divmod_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/divmod_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#divmod" do
+  it "returns an [quotient, modulus] from dividing self by other" do
+    values = 3.14.divmod(2)
+    values[0].should == 1
+    values[1].should be_close(1.14, TOLERANCE)
+    values = 2.8284.divmod(3.1415)
+    values[0].should == 0
+    values[1].should be_close(2.8284, TOLERANCE)
+    values = -1.0.divmod(bignum_value)
+    values[0].should == -1
+    values[1].should be_close(9223372036854775808.000, TOLERANCE)
+  end
+
+  it "raises FloatDomainError if other is zero" do
+    lambda { 1.0.divmod(0)   }.should raise_error(FloatDomainError)
+    lambda { 1.0.divmod(0.0) }.should raise_error(FloatDomainError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/eql_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/eql_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/eql_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#eql?" do
+  it "returns true if other is a Float equal to self" do
+    1.0.should_not eql(1)
+    0.0.should eql(0.0)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/equal_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/equal_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/equal_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#==" do
+  it "returns true if self has the same value as other" do
+    (1.0 == 1).should == true
+    (2.71828 == 1.428).should == false
+    (-4.2 == 4.2).should == false
+  end
+
+  it "calls 'other == self' if coercion fails" do
+    class X; def ==(other); 2.0 == other; end; end
+
+    (1.0 == X.new).should == false
+    (2.0 == X.new).should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/exponent_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/exponent_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/exponent_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#**" do
+  it "returns self raise to the other power" do
+    (2.3 ** 3).should be_close(12.167,TOLERANCE)
+    (5.2 ** -1).should be_close(0.192307692307692,TOLERANCE)
+    (9.5 ** 0.5).should be_close(3.08220700148449, TOLERANCE) 
+    (9.5 ** 0xffffffff).to_s.should == 'Infinity'
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/finite_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/finite_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/finite_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#finite?" do
+  it "returns true if a valid IEEE floating-point number" do
+    (1.5**0xffffffff).finite?.should == false
+    3.14159.finite?.should == true
+    (-1.0/0.0).finite?.should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/floor_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/floor_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/floor_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#floor" do
+  it "returns the largest Integer less than or equal to self" do
+    -1.2.floor.should == -2
+    -1.0.floor.should == -1
+    0.0.floor.should == 0
+    1.0.floor.should == 1
+    5.9.floor.should == 5
+    -9223372036854775808.1.floor.should == -9223372036854775808
+    9223372036854775808.1.floor.should == 9223372036854775808
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/gt_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/gt_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/gt_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#>" do
+  it "returns true if self is greater than other" do
+    (1.5 > 1).should == true
+    (2.5 > 3).should == false
+    (45.91 > bignum_value).should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/gte_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/gte_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/gte_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#>=" do
+  it "returns true if self is greater than or equal to other" do
+    (5.2 >= 5.2).should == true
+    (9.71 >= 1).should == true
+    (5.55382 >= 0xfabdafbafcab).should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/hash_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/hash_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/hash_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#hash" do
+  it "is provided" do
+    0.0.respond_to?(:hash).should == true
+  end
+
+  it "is stable" do
+    1.0.hash.should == 1.0.hash
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/induced_from_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/induced_from_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/induced_from_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,36 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float.induced_from" do
+  it "returns the passed argument when passed a Float" do
+    Float.induced_from(5.5).should eql(5.5)
+    Float.induced_from(-5.5).should eql(-5.5)
+    Float.induced_from(TOLERANCE).should eql(TOLERANCE)
+  end
+  
+  it "converts passed Fixnums or Bignums to Floats (using #to_f)" do
+    Float.induced_from(5).should eql(5.0)
+    Float.induced_from(-5).should eql(-5.0)
+    Float.induced_from(0).should eql(0.0)
+    
+    Float.induced_from(bignum_value).should eql(bignum_value.to_f)
+    Float.induced_from(-bignum_value).should eql(-bignum_value.to_f)
+  end
+
+  it "does not try to convert non-Integers to Integers using #to_int" do
+    obj = mock("Not converted to Integer")
+    obj.should_not_receive(:to_int)
+    lambda { Float.induced_from(obj) }.should raise_error(TypeError)
+  end
+
+  it "does not try to convert non-Integers to Floats using #to_f" do
+    obj = mock("Not converted to Float")
+    obj.should_not_receive(:to_f)
+    lambda { Float.induced_from(obj) }.should raise_error(TypeError)
+  end
+  
+  it "raises a TypeError when passed a non-Integer" do
+    lambda { Float.induced_from("2") }.should raise_error(TypeError)
+    lambda { Float.induced_from(:symbol) }.should raise_error(TypeError)
+    lambda { Float.induced_from(Object.new) }.should raise_error(TypeError)
+  end
+end 

Added: MacRuby/branches/experimental/spec/frozen/core/float/infinite_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/infinite_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/infinite_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#infinite?" do
+  it "returns nil, -1, +1 when self is finite, -Infinity, +Infinity" do
+    1.0.infinite?.should == nil
+    (1.0/0.0).infinite?.should == 1
+    (1.0/-0.0).infinite?.should == -1
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/lt_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/lt_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/lt_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#<" do
+  it "returns true if self is less than other" do
+    (71.3 < 91.8).should == true
+    (192.6 < -500).should == false
+    (-0.12 < 0x4fffffff).should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/lte_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/lte_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/lte_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#<=" do
+  it "returns true if self is less than or equal to other" do
+    (2.0 <= 3.14159).should == true
+    (-2.7183 <= -24).should == false
+    (0.0 <= 0.0).should == true
+    (9_235.9 <= bignum_value).should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/minus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/minus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/minus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#-" do
+  it "returns self minus other" do
+    (9_237_212.5280 - 5_280).should be_close(9231932.528, TOLERANCE)
+    (2_560_496.1691 - bignum_value).should be_close(-9223372036852215808.000, TOLERANCE)
+    (5.5 - 5.5).should be_close(0.0,TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/modulo_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/modulo_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/modulo_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/modulo'
+
+describe "Float#%" do
+  it_behaves_like(:float_modulo, :%)
+end
+
+describe "Float#modulo" do
+  it_behaves_like(:float_modulo, :modulo)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/multiply_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/multiply_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/multiply_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#*" do
+  it "returns self multiplied by other" do 
+    (4923.98221 * 2).should be_close(9847.96442, TOLERANCE) 
+    (6712.5 * 0.25).should be_close(1678.125, TOLERANCE) 
+    (256.4096 * bignum_value).should be_close(2364961134621118431232.000, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/nan_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/nan_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/nan_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#nan?" do
+  it "returns true if self is not a valid IEEE floating-point number" do
+    0.0.nan?.should == false
+    -1.5.nan?.should == false
+    (0.0/0.0).nan?.should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/plus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/plus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/plus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#+" do
+  it "returns self plus other" do
+    (491.213 + 2).should be_close(493.213, TOLERANCE)
+    (9.99 + bignum_value).should be_close(9223372036854775808.000, TOLERANCE)
+    (1001.99 + 5.219).should be_close(1007.209, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/round_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/round_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/round_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#round" do
+  it "returns the nearest Integer" do
+    5.5.round.should == 6
+    0.4.round.should == 0
+    -2.8.round.should == -3
+    0.0.round.should == 0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/shared/modulo.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/shared/modulo.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/shared/modulo.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+describe :float_modulo, :shared => true do
+  it "returns self modulo other" do
+    6543.21.send(@method, 137).should be_close(104.21, TOLERANCE)
+    5667.19.send(@method, bignum_value).should be_close(5667.19, TOLERANCE)
+    6543.21.send(@method, 137.24).should be_close(92.9299999999996, TOLERANCE)
+
+    6543.21.send(@method, 137).should be_close(6543.21.%(137), TOLERANCE)
+    5667.19.send(@method, bignum_value).should be_close(5667.19.%(0xffffffff), TOLERANCE)
+    6543.21.send(@method, 137.24).should be_close(6543.21.%(137.24), TOLERANCE)
+  end
+
+  it "does NOT raise ZeroDivisionError if other is zero" do
+    1.0.send(@method, 0).to_s.should == 'NaN'
+    1.0.send(@method, 0.0).to_s.should == 'NaN'
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/shared/to_i.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/shared/to_i.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/shared/to_i.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+describe :float_to_i, :shared => true do
+  it "returns self truncated to an Integer" do
+    899.2.send(@method).should == 899
+    -1.122256e-45.send(@method).should == 0
+    5_213_451.9201.send(@method).should == 5213451
+    1.233450999123389e+12.send(@method).should == 1233450999123
+    -9223372036854775808.1.send(@method).should == -9223372036854775808
+    9223372036854775808.1.send(@method).should == 9223372036854775808
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/to_f_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/to_f_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/to_f_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#to_f" do
+  it "returns self" do
+    -500.3.to_f.should == -500.3
+    267.51.to_f.should == 267.51
+    1.1412.to_f.should == 1.1412
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/to_i_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/to_i_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/to_i_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/to_i'
+
+describe "Float#to_i" do
+  it_behaves_like(:float_to_i, :to_i)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/to_int_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/to_int_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/to_int_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/to_i'
+
+describe "Float#" do
+  it_behaves_like(:float_to_i, :to_int)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#to_s" do
+  it "returns a string representation of self, possibly Nan, -Infinity, +Infinity" do
+    0.551e7.to_s.should == "5510000.0"
+    -3.14159.to_s.should == "-3.14159"
+    0.0.to_s.should == "0.0"
+    1000000000000.to_f.to_s.should == "1000000000000.0"
+    10000000000000.to_f.to_s.should == "10000000000000.0"
+    100000000000000.to_f.to_s.should == "1.0e+14"
+    -10000000000000.to_f.to_s.should == "-10000000000000.0"
+    -100000000000000.to_f.to_s.should == "-1.0e+14"
+    1.87687113714737e-40.to_s.should == "1.87687113714737e-40"
+    (0.0 / 0.0).to_s.should == "NaN"
+    (1.0 / 0.0).to_s.should == "Infinity"
+    (-1.0 / 0.0).to_s.should == "-Infinity"
+    1.50505000e-20.to_s.should == "1.50505e-20"
+  end
+  
+  platform_is_not :openbsd do
+    it "returns the correct values for -0.0" do
+      -0.0.to_s.should == "-0.0"
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/truncate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/truncate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/truncate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/to_i'
+
+describe "Float#truncate" do
+  it_behaves_like(:float_to_i, :truncate)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/uminus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/uminus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/uminus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#-@" do
+  it "negates self" do
+    (2.221.send(:-@)).should be_close(-2.221, TOLERANCE)
+    -2.01.should be_close(-2.01,TOLERANCE)
+    -2_455_999_221.5512.should be_close(-2455999221.5512, TOLERANCE)
+    (--5.5).should be_close(5.5, TOLERANCE)
+    -8.551.send(:-@).should be_close(8.551, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/uplus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/uplus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/uplus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#+@" do 
+  it "returns the same value with same sign (twos complement)" do 
+    34.56.send(:+@).should == 34.56
+    -34.56.send(:+@).should == -34.56
+    0.0.send(:+@).should == 0.0
+  end  
+end

Added: MacRuby/branches/experimental/spec/frozen/core/float/zero_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/zero_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/float/zero_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#zero?" do
+  it "returns true if self is 0.0" do
+    0.0.zero?.should == true
+    1.0.zero?.should == false
+    -1.0.zero?.should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/gc/disable_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/gc/disable_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/gc/disable_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/gc/enable_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/gc/enable_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/gc/enable_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/gc/garbage_collect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/gc/garbage_collect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/gc/garbage_collect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/gc/start_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/gc/start_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/gc/start_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/hash/allocate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/allocate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/allocate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Hash.allocate" do
+  it "returns an instance of Hash" do
+    hsh = Hash.allocate
+    hsh.should be_kind_of(Hash)
+  end
+  
+  it "returns a fully-formed instance of Hash" do
+    hsh = Hash.allocate
+    hsh.size.should == 0
+    hsh[:a] = 1
+    hsh.should == { :a => 1 }
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/clear_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/clear_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/clear_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Hash#clear" do
+  it "removes all key, value pairs" do
+    h = { 1 => 2, 3 => 4 }
+    h.clear.should equal(h)
+    h.should == {}
+  end
+
+  it "does not remove default values" do
+    h = Hash.new(5)
+    h.clear
+    h.default.should == 5
+
+    h = { "a" => 100, "b" => 200 }
+    h.default = "Go fish"
+    h.clear
+    h["z"].should == "Go fish"
+  end
+
+  it "does not remove default procs" do
+    h = Hash.new { 5 }
+    h.clear
+    h.default_proc.should_not == nil
+  end
+
+  it "raises a TypeError if called on a frozen instance" do
+    lambda { HashSpecs.frozen_hash.clear  }.should raise_error(TypeError)
+    lambda { HashSpecs.empty_frozen_hash.clear }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/clone_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/clone_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/clone_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Hash#clone" do
+  it "copies instance variable but not the objects they refer to" do
+    hash = { 'key' => 'value' }
+
+    clone = hash.clone
+
+    clone.should == hash
+    clone.object_id.should_not == hash.object_id
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/hash/default_proc_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/default_proc_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/default_proc_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Hash#default_proc" do
+  it "returns the block passed to Hash.new" do
+    h = Hash.new { |i| 'Paris' }
+    p = h.default_proc
+    p.call(1).should == 'Paris'
+  end
+  
+  it "returns nil if no block was passed to proc" do
+    Hash.new.default_proc.should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/default_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/default_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/default_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,46 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Hash#default" do
+  it "returns the default value" do
+    h = Hash.new(5)
+    h.default.should == 5
+    h.default(4).should == 5
+    {}.default.should == nil
+    {}.default(4).should == nil
+  end
+
+  it "uses the default proc to compute a default value, passing given key" do
+    h = Hash.new { |*args| args }
+    h.default(nil).should == [h, nil]
+    h.default(5).should == [h, 5]
+  end
+
+  it "calls default proc with nil arg if passed a default proc but no arg" do
+    h = Hash.new { |*args| args }
+    h.default.should == nil
+  end
+end
+
+describe "Hash#default=" do
+  it "sets the default value" do
+    h = Hash.new
+    h.default = 99
+    h.default.should == 99
+  end
+
+  it "unsets the default proc" do
+    [99, nil, lambda { 6 }].each do |default|
+      h = Hash.new { 5 }
+      h.default_proc.should_not == nil
+      h.default = default
+      h.default.should == default
+      h.default_proc.should == nil
+    end
+  end
+
+  it "raises a TypeError if called on a frozen instance" do
+    lambda { HashSpecs.frozen_hash.default = nil }.should raise_error(TypeError)
+    lambda { HashSpecs.empty_frozen_hash.default = nil }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/delete_if_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/delete_if_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/delete_if_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,47 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/iteration'
+
+describe "Hash#delete_if" do
+  it "yields two arguments: key and value" do
+    all_args = []
+    {1 => 2, 3 => 4}.delete_if { |*args| all_args << args }
+    all_args.sort.should == [[1, 2], [3, 4]]
+  end
+
+  it "removes every entry for which block is true and returns self" do
+    h = {:a => 1, :b => 2, :c => 3, :d => 4}
+    h.delete_if { |k,v| v % 2 == 1 }.should equal(h)
+    h.should == {:b => 2, :d => 4}
+  end
+
+  it "processes entries with the same order as each()" do
+    h = {:a => 1, :b => 2, :c => 3, :d => 4}
+
+    each_pairs = []
+    delete_pairs = []
+
+    h.each_pair { |*pair| each_pairs << pair }
+    h.delete_if { |*pair| delete_pairs << pair }
+
+    each_pairs.should == delete_pairs
+  end
+
+  ruby_version_is "" ... "1.9" do
+    it "raises an TypeError if called on a frozen instance" do
+      lambda { HashSpecs.frozen_hash.delete_if { false } }.should raise_error(TypeError)
+      lambda { HashSpecs.empty_frozen_hash.delete_if { true } }.should raise_error(TypeError)
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "raises an RuntimeError if called on a frozen instance" do
+      lambda { HashSpecs.frozen_hash.delete_if { false } }.should raise_error(RuntimeError)
+      lambda { HashSpecs.empty_frozen_hash.delete_if { true } }.should raise_error(RuntimeError)
+    end
+  end
+
+
+  it_behaves_like(:hash_iteration_method, :delete_if)
+  it_behaves_like(:hash_iteration_no_block, :delete_if)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/delete_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/delete_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/delete_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,36 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Hash#delete" do
+  it "removes the entry and returns the deleted value" do
+    h = {:a => 5, :b => 2}
+    h.delete(:b).should == 2
+    h.should == {:a => 5}
+  end
+
+  it "calls supplied block if the key is not found" do
+    {:a => 1, :b => 10, :c => 100 }.delete(:d) { 5 }.should == 5
+    Hash.new(:default).delete(:d) { 5 }.should == 5
+    Hash.new() { :defualt }.delete(:d) { 5 }.should == 5
+  end
+
+  it "returns nil if the key is not found when no block is given" do
+    {:a => 1, :b => 10, :c => 100 }.delete(:d).should == nil
+    Hash.new(:default).delete(:d).should == nil
+    Hash.new() { :defualt }.delete(:d).should == nil
+  end
+
+  ruby_version_is "" ... "1.9" do
+    it "raises a TypeError if called on a frozen instance" do
+      lambda { HashSpecs.frozen_hash.delete("foo")  }.should raise_error(TypeError)
+      lambda { HashSpecs.empty_frozen_hash.delete("foo") }.should raise_error(TypeError)
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "raises a RuntimeError if called on a frozen instance" do
+      lambda { HashSpecs.frozen_hash.delete("foo")  }.should raise_error(RuntimeError)
+      lambda { HashSpecs.empty_frozen_hash.delete("foo") }.should raise_error(RuntimeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/each_key_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/each_key_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/each_key_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/iteration'
+
+describe "Hash#each_key" do
+  it "calls block once for each key, passing key" do
+    r = {}
+    h = {1 => -1, 2 => -2, 3 => -3, 4 => -4 }
+    h.each_key { |k| r[k] = k }.should equal(h)
+    r.should == { 1 => 1, 2 => 2, 3 => 3, 4 => 4 }
+  end
+
+  it "processes keys in the same order as keys()" do
+    keys = []
+    h = {1 => -1, 2 => -2, 3 => -3, 4 => -4 }
+    h.each_key { |k| keys << k }
+    keys.should == h.keys
+  end
+
+  it_behaves_like(:hash_iteration_method, :each_key)
+  it_behaves_like(:hash_iteration_modifying, :each_key)
+  it_behaves_like(:hash_iteration_no_block, :each_key)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/each_pair_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/each_pair_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/each_pair_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/iteration'
+
+describe "Hash#each_pair" do
+  it "processes all pairs, yielding two arguments: key and value" do
+    all_args = []
+
+    h = {1 => 2, 3 => 4}
+    h2 = h.each_pair { |*args| all_args << args }
+    h2.should equal(h)
+
+    all_args.should == [[1, 2], [3, 4]]
+  end
+
+  it_behaves_like(:hash_iteration_method, :each_pair)
+  it_behaves_like(:hash_iteration_modifying, :each_pair)
+  it_behaves_like(:hash_iteration_no_block, :each_pair)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/each_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/each_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/each_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,36 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/iteration'
+
+describe "Hash#each" do
+  it "yields one argument: [key, value]" do
+    all_args = []
+    {1 => 2, 3 => 4}.each { |*args| all_args << args }
+    all_args.should == [[[1, 2]], [[3, 4]]]
+  end
+  
+  it "calls block once for each entry, passing key, value" do
+    r = {}
+    h = {:a => 1, :b => 2, :c => 3, :d => 5}
+    h.each { |k,v| r[k.to_s] = v.to_s }.should equal(h)
+    r.should == {"a" => "1", "b" => "2", "c" => "3", "d" => "5" }
+  end
+
+  it "uses the same order as keys() and values()" do
+    h = {:a => 1, :b => 2, :c => 3, :d => 5}
+    keys = []
+    values = []
+
+    h.each do |k, v|
+      keys << k
+      values << v
+    end
+    
+    keys.should == h.keys
+    values.should == h.values
+  end
+
+  it_behaves_like(:hash_iteration_method, :each)
+  it_behaves_like(:hash_iteration_modifying, :each)
+  it_behaves_like(:hash_iteration_no_block, :each)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/each_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/each_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/each_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/iteration'
+
+describe "Hash#each_value" do
+  it "calls block once for each key, passing value" do
+    r = []
+    h = { :a => -5, :b => -3, :c => -2, :d => -1, :e => -1 }
+    h.each_value { |v| r << v }.should equal(h)
+    r.sort.should == [-5, -3, -2, -1, -1]
+  end
+
+  it "processes values in the same order as values()" do
+    values = []
+    h = { :a => -5, :b => -3, :c => -2, :d => -1, :e => -1 }
+    h.each_value { |v| values << v }
+    values.should == h.values
+  end
+
+  it_behaves_like(:hash_iteration_method, :each_value)
+  it_behaves_like(:hash_iteration_modifying, :each_value)
+  it_behaves_like(:hash_iteration_no_block, :each_value)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/element_reference_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/element_reference_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/element_reference_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,149 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Hash.[]" do
+  it "creates a Hash; values can be provided as the argument list" do
+    Hash[:a, 1, :b, 2].should == {:a => 1, :b => 2}
+    Hash[].should == {}
+    Hash[:a, 1, :b, {:c => 2}].should == {:a => 1, :b => {:c => 2}}
+  end
+
+  it "creates a Hash; values can be provided as one single hash" do
+    Hash[:a => 1, :b => 2].should == {:a => 1, :b => 2}
+    Hash[{1 => 2, 3 => 4}].should == {1 => 2, 3 => 4}
+    Hash[{}].should == {}
+  end
+
+  it "raises an ArgumentError when passed an odd number of arguments" do
+    lambda { Hash[1, 2, 3] }.should raise_error(ArgumentError)
+    lambda { Hash[1, 2, {3 => 4}] }.should raise_error(ArgumentError)
+  end
+
+  ruby_bug "#", "1.8.6" do
+    it "call to_hash" do
+      obj = mock('x')
+      def obj.to_hash() { 1 => 2, 3 => 4 } end
+      Hash[obj].should == { 1 => 2, 3 => 4 }
+    end
+  end
+
+  it "returns an instance of the class it's called on" do
+    Hash[MyHash[1, 2]].class.should == Hash
+    MyHash[Hash[1, 2]].class.should == MyHash
+  end
+end
+
+describe "Hash#[]" do
+  it "returns the value for key" do
+    obj = mock('x')
+    h = { 1 => 2, 3 => 4, "foo" => "bar", obj => obj, [] => "baz" }
+    h[1].should == 2
+    h[3].should == 4
+    h["foo"].should == "bar"
+    h[obj].should == obj
+    h[[]].should == "baz"
+  end
+
+  it "returns nil as default default value" do
+    { 0 => 0 }[5].should == nil
+  end
+
+  it "returns the default (immediate) value for missing keys" do
+    h = Hash.new(5)
+    h[:a].should == 5
+    h[:a] = 0
+    h[:a].should == 0
+    h[:b].should == 5
+  end
+
+  it "calls subclass implementations of default" do
+    h = DefaultHash.new
+    h[:nothing].should == 100
+  end
+
+  it "does not create copies of the immediate default value" do
+    str = "foo"
+    h = Hash.new(str)
+    a = h[:a]
+    b = h[:b]
+    a << "bar"
+
+    a.should equal(b)
+    a.should == "foobar"
+    b.should == "foobar"
+  end
+
+  it "returns the default (dynamic) value for missing keys" do
+    h = Hash.new { |hsh, k| k.kind_of?(Numeric) ? hsh[k] = k + 2 : hsh[k] = k }
+    h[1].should == 3
+    h['this'].should == 'this'
+    h.should == {1 => 3, 'this' => 'this'}
+
+    i = 0
+    h = Hash.new { |hsh, key| i += 1 }
+    h[:foo].should == 1
+    h[:foo].should == 2
+    h[:bar].should == 3
+  end
+
+  it "does not return default values for keys with nil values" do
+    h = Hash.new(5)
+    h[:a] = nil
+    h[:a].should == nil
+
+    h = Hash.new() { 5 }
+    h[:a] = nil
+    h[:a].should == nil
+  end
+
+  it "compares keys with eql? semantics" do
+    { 1.0 => "x" }[1].should == nil
+    { 1.0 => "x" }[1.0].should == "x"
+    { 1 => "x" }[1.0].should == nil
+    { 1 => "x" }[1].should == "x"
+  end
+
+  it "compares key via hash" do
+    # Can't use should_receive because it uses hash internally
+    x = mock('0')
+    def x.hash() 0 end
+
+    { }[x].should == nil
+  end
+
+  it "does not compare key with unknown hash codes via eql?" do
+    # Can't use should_receive because it uses hash and eql? internally
+    x = mock('x')
+    y = mock('y')
+    def x.eql?(o) raise("Shouldn't receive eql?") end
+
+    def x.hash() 0 end
+    def y.hash() 1 end
+
+    { y => 1 }[x].should == nil
+  end
+
+  it "compares key with found hash code via eql?" do
+    # Can't use should_receive because it uses hash and eql? internally
+    y = mock('0')
+    def y.hash() 0 end
+
+    x = mock('0')
+    def x.hash()
+      def self.eql?(o) taint; false; end
+      return 0
+    end
+
+    { y => 1 }[x].should == nil
+    x.tainted?.should == true
+
+    x = mock('0')
+    def x.hash()
+      def self.eql?(o) taint; true; end
+      return 0
+    end
+
+    { y => 1 }[x].should == 1
+    x.tainted?.should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/element_set_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/element_set_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/element_set_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/store'
+
+describe "Hash#[]=" do
+  it_behaves_like(:hash_store, :[]=)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/empty_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/empty_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/empty_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Hash#empty?" do
+  it "returns true if the hash has no entries" do
+    {}.empty?.should == true
+    {1 => 1}.empty?.should == false
+  end
+
+  it "returns true if the hash has no entries and has a default value" do
+    Hash.new(5).empty?.should == true
+    Hash.new { 5 }.empty?.should == true
+    Hash.new { |hsh, k| hsh[k] = k }.empty?.should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/equal_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/equal_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/equal_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,158 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Hash#==" do
+  it "returns true if other Hash has the same number of keys and each key-value pair matches" do
+    Hash.new(5).should == Hash.new(1)
+    Hash.new {|h, k| 1}.should == Hash.new {}
+    Hash.new {|h, k| 1}.should == Hash.new(2)
+
+    a = {:a => 5}
+    b = {}
+    a.should_not == b
+
+    b[:a] = 5
+    a.should == b
+
+    c = {"a" => 5}
+    a.should_not == c
+
+    d = Hash.new {|h, k| 1}
+    e = Hash.new {}
+    d[1] = 2
+    e[1] = 2
+    d.should == e
+  end
+
+  it "does not call to_hash on hash subclasses" do
+    {5 => 6}.should == ToHashHash[5 => 6]
+  end
+
+  it "returns false when the numbers of keys differ without comparing any elements" do
+    obj = mock('x')
+    h = { obj => obj }
+
+    obj.should_not_receive(:==)
+    obj.should_not_receive(:eql?)
+
+    {}.should_not == h
+    h.should_not == {}
+  end
+
+  it "compares keys with eql? semantics" do
+    { 1.0 => "x" }.should == { 1.0 => "x" }
+    { 1 => "x" }.should_not == { 1.0 => "x" }
+    { 1.0 => "x" }.should_not == { 1 => "x" }
+  end
+
+  it "first compares keys via hash" do
+    # Can't use should_receive because it uses hash internally
+    x = mock('x')
+    def x.hash() 0 end
+    y = mock('y')
+    def y.hash() 0 end
+
+    { x => 1 }.should_not == { y => 1 }
+  end
+
+  it "does not compare keys with different hash codes via eql?" do
+    # Can't use should_receive because it uses hash and eql? internally
+    x = mock('x')
+    y = mock('y')
+    x.instance_variable_set(:@other, y)
+    y.instance_variable_set(:@other, x)
+    def x.eql?(o)
+      raise("x Shouldn't receive eql?") if o == @other
+      self == o
+    end
+    def y.eql?(o)
+      raise("y Shouldn't receive eql?") if o == @other
+      self == o
+    end
+
+    def x.hash() 0 end
+    def y.hash() 1 end
+
+    { x => 1 }.should_not == { y => 1 }
+  end
+
+  it "compares keys with matching hash codes via eql?" do
+    # Can't use should_receive because it uses hash and eql? internally
+    a = Array.new(2) do
+      obj = mock('0')
+
+      def obj.hash()
+        return 0
+      end
+      # It's undefined whether the impl does a[0].eql?(a[1]) or
+      # a[1].eql?(a[0]) so we taint both.
+      def obj.eql?(o)
+        return true if self == o
+        taint
+        o.taint
+        false
+      end
+
+      obj
+    end
+
+    { a[0] => 1 }.should_not == { a[1] => 1 }
+    a[0].tainted?.should == true
+    a[1].tainted?.should == true
+
+    a = Array.new(2) do
+      obj = mock('0')
+
+      def obj.hash()
+        # It's undefined whether the impl does a[0].eql?(a[1]) or
+        # a[1].eql?(a[0]) so we taint both.
+        def self.eql?(o) taint; o.taint; true; end
+        return 0
+      end
+
+      obj
+    end
+
+    { a[0] => 1 }.should == { a[1] => 1 }
+    a[0].tainted?.should == true
+    a[1].tainted?.should == true
+  end
+
+  it "computes equality for recursive hashes" do
+    h = {}
+    h[:a] = h
+    h.eql?(h[:a]).should == true
+    (h == h[:a]).should == true
+  end
+
+  it "compares values with == semantics" do
+    { "x" => 1.0 }.should == { "x" => 1 }
+  end
+
+  it "does not compare values when keys don't match" do
+    value = mock('x')
+    value.should_not_receive(:==)
+    { 1 => value }.should_not == { 2 => value }
+  end
+
+  it "compares values when keys match" do
+    x = mock('x')
+    y = mock('y')
+    def x.==(o) false end
+    def y.==(o) false end
+    { 1 => x }.should_not == { 1 => y }
+
+    x = mock('x')
+    y = mock('y')
+    def x.==(o) true end
+    def y.==(o) true end
+    { 1 => x }.should == { 1 => y }
+  end
+
+  it "ignores hash class differences" do
+    h = { 1 => 2, 3 => 4 }
+    MyHash[h].should == h
+    MyHash[h].should == MyHash[h]
+    h.should == MyHash[h]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/fetch_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/fetch_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/fetch_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Hash#fetch" do
+  it "returns the value for key" do
+    { :a => 1, :b => -1 }.fetch(:b).should == -1
+  end
+  
+  it "raises an IndexError if key is not found" do
+    lambda { {}.fetch(:a)             }.should raise_error(IndexError)
+    lambda { Hash.new(5).fetch(:a)    }.should raise_error(IndexError)
+    lambda { Hash.new { 5 }.fetch(:a) }.should raise_error(IndexError)
+  end
+  
+  it "returns default if key is not found when passed a default" do
+    {}.fetch(:a, nil).should == nil
+    {}.fetch(:a, 'not here!').should == "not here!"
+    { :a => nil }.fetch(:a, 'not here!').should == nil
+  end
+  
+  it "returns value of block if key is not found when passed a block" do
+    {}.fetch('a') { |k| k + '!' }.should == "a!"
+  end
+
+  it "gives precedence to the default block over the default argument when passed both" do
+    {}.fetch(9, :foo) { |i| i * i }.should == 81
+  end
+
+  it "raises an ArgumentError when not passed one or two arguments" do
+    lambda { {}.fetch()        }.should raise_error(ArgumentError)
+    lambda { {}.fetch(1, 2, 3) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+class MyHash < Hash; end
+
+class NewHash < Hash
+  def initialize(*args)
+    args.each_with_index do |val, index|
+      self[index] = val
+    end
+  end
+end
+
+class DefaultHash < Hash
+  def default(key)
+    100
+  end
+end
+
+class ToHashHash < Hash
+  def to_hash() { "to_hash" => "was", "called!" => "duh." } end
+end
+
+module HashSpecs
+  def self.empty_frozen_hash
+    @empty ||= {}
+    @empty.freeze
+    @empty
+  end
+  
+  def self.frozen_hash
+    @hash ||= {1 => 2, 3 => 4}
+    @hash.freeze
+    @hash
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/has_key_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/has_key_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/has_key_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/key'
+
+describe "Hash#has_key?" do
+  it_behaves_like(:hash_key_p, :has_key?)
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/hash/has_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/has_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/has_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/value'
+
+describe "Hash#has_value?" do
+  it_behaves_like(:hash_value_p, :has_value?)
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/hash/hash_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/hash_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/hash_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Hash" do
+  it "includes Enumerable" do
+    Hash.include?(Enumerable).should == true
+  end
+end
+
+describe "Hash#hash" do
+  # prior to 1.8.7, there were no sensible Hash#hash defined at all
+  ruby_version_is "1.8.7" do
+    ruby_bug "#", "1.8.7.10" do
+      it "returns a value which doesn't depend on the hash order" do
+        {0=>2, 11=>1}.hash.should == {11=>1, 0=>2}.hash
+      end
+    end
+  end
+
+  it "generates a hash for recursive hash structures" do
+    h = {}
+    h[:a] = h
+    (h.hash == h[:a].hash).should == true
+  end
+
+  ruby_version_is "" .. "1.8.6" do
+    it "computes recursive hash keys with identical hashes" do
+      h = {}
+      h[h] = h
+      (h.hash == h[h].hash).should == true
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/include_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/include_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/include_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/key'
+
+describe "Hash#include?" do
+  it_behaves_like(:hash_key_p, :include?)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/index_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/index_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/index_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Hash#index" do
+  it "returns the corresponding key for value" do
+    {2 => 'a', 1 => 'b'}.index('b').should == 1
+  end
+
+  it "returns nil if the value is not found" do
+    {:a => -1, :b => 3.14, :c => 2.718}.index(1).should == nil
+  end
+
+  it "doesn't return default value if the value is not found" do
+    Hash.new(5).index(5).should == nil
+  end
+
+  it "compares values using ==" do
+    {1 => 0}.index(0.0).should == 1
+    {1 => 0.0}.index(0).should == 1
+
+    needle = mock('needle')
+    inhash = mock('inhash')
+    inhash.should_receive(:==).with(needle).and_return(true)
+
+    {1 => inhash}.index(needle).should == 1
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/indexes_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/indexes_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/indexes_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/values_at_spec'
+
+describe "Hash#indexes" do
+  it_behaves_like(:hash_values_at, :indexes)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/indices_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/indices_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/indices_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/values_at_spec'
+
+describe "Hash#indices" do
+  it_behaves_like(:hash_values_at, :indices)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/initialize_copy_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/initialize_copy_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/initialize_copy_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/replace'
+
+describe "Hash#initialize_copy" do
+  it "is private" do
+    {}.private_methods.map { |m| m.to_s }.include?("initialize_copy").should == true
+  end
+
+  it_behaves_like(:hash_replace, :initialize_copy)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Hash#initialize" do
+  it "is private" do
+    {}.private_methods.map { |m| m.to_s }.include?("initialize").should == true
+  end
+
+  it "can be used to reset default_proc" do
+    h = { "foo" => 1, "bar" => 2 }
+    h.default_proc.should == nil
+    h.instance_eval { initialize { |h, k| k * 2 } }
+    h.default_proc.should_not == nil
+    h["a"].should == "aa"
+  end
+
+  it "should get passed whatever args were passed to Hash#new" do
+    NewHash.new(:one, :two)[0].should == :one
+    NewHash.new(:one, :two)[1].should == :two
+  end
+
+  it "raises a TypeError if called on a frozen instance" do
+    block = lambda { HashSpecs.frozen_hash.instance_eval { initialize() }}
+    block.should raise_error(TypeError)
+
+    block = lambda { HashSpecs.frozen_hash.instance_eval { initialize(nil) }  }
+    block.should raise_error(TypeError)
+
+    block = lambda { HashSpecs.frozen_hash.instance_eval { initialize(5) }    }
+    block.should raise_error(TypeError)
+
+    block = lambda { HashSpecs.frozen_hash.instance_eval { initialize { 5 } } }
+    block.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,60 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Hash#inspect" do
+  it "returns a string representation with same order as each()" do
+    h = {:a => [1, 2], :b => -2, :d => -6, nil => nil}
+    
+    pairs = []
+    h.each do |key, value|
+      pairs << key.inspect + "=>" + value.inspect
+    end
+    
+    str = '{' + pairs.join(', ') + '}'
+    h.inspect.should == str
+  end
+
+  it "calls inspect on keys and values" do
+    key = mock('key')
+    val = mock('val')
+    key.should_receive(:inspect).and_return('key')
+    val.should_receive(:inspect).and_return('val')
+    
+    { key => val }.inspect.should == '{key=>val}'
+  end
+
+  it "handles recursive hashes" do
+    x = {}
+    x[0] = x
+    x.inspect.should == '{0=>{...}}'
+
+    x = {}
+    x[x] = 0
+    x.inspect.should == '{{...}=>0}'
+
+    x = {}
+    x[x] = x
+    x.inspect.should == '{{...}=>{...}}'
+
+    x = {}
+    y = {}
+    x[0] = y
+    y[1] = x
+    x.inspect.should == "{0=>{1=>{...}}}"
+    y.inspect.should == "{1=>{0=>{...}}}"
+
+    x = {}
+    y = {}
+    x[y] = 0
+    y[x] = 1
+    x.inspect.should == "{{{...}=>1}=>0}"
+    y.inspect.should == "{{{...}=>0}=>1}"
+    
+    x = {}
+    y = {}
+    x[y] = x
+    y[x] = y
+    x.inspect.should == "{{{...}=>{...}}=>{...}}"
+    y.inspect.should == "{{{...}=>{...}}=>{...}}"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/invert_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/invert_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/invert_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Hash#invert" do
+  it "returns a new hash where keys are values and vice versa" do
+    { 1 => 'a', 2 => 'b', 3 => 'c' }.invert.should == { 'a' => 1, 'b' => 2, 'c' => 3 }
+  end
+  
+  it "handles collisions by overriding with the key coming later in keys()" do
+    h = { :a => 1, :b => 1 }
+    override_key = h.keys.last
+    h.invert[1].should == override_key
+  end
+
+  it "compares new keys with eql? semantics" do
+    h = { :a => 1.0, :b => 1 }
+    i = h.invert
+    i[1.0].should == :a
+    i[1].should == :b
+  end
+  
+  it "does not return subclass instances for subclasses" do
+    MyHash[1 => 2, 3 => 4].invert.class.should == Hash
+    MyHash[].invert.class.should == Hash
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/key_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/key_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/key_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/key'
+
+describe "Hash#key?" do
+  it_behaves_like(:hash_key_p, :key?)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/keys_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/keys_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/keys_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,38 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Hash#keys" do
+
+  ruby_version_is ""..."1.9" do
+    it "returns an array populated with keys" do
+      {}.keys.should == []
+      {}.keys.class.should == Array
+      Hash.new(5).keys.should == []
+      Hash.new { 5 }.keys.should == []
+      { 1 => 2, 2 => 4, 4 => 8 }.keys.sort.should == [1, 2, 4]
+      { 1 => 2, 2 => 4, 4 => 8 }.keys.should be_kind_of(Array)
+      { nil => nil }.keys.should == [nil]
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "returns an array with the keys in the order they were inserted" do
+      {}.keys.should == []
+      {}.keys.class.should == Array
+      Hash.new(5).keys.should == []
+      Hash.new { 5 }.keys.should == []
+      { 1 => 2, 4 => 8, 2 => 4 }.keys.should == [1, 4, 2]
+      { 1 => 2, 2 => 4, 4 => 8 }.keys.should be_kind_of(Array)
+      { nil => nil }.keys.should == [nil]
+    end
+  end
+
+
+  it "it uses the same order as #values" do
+    h = { 1 => "1", 2 => "2", 3 => "3", 4 => "4" }
+    
+    h.size.times do |i|
+      h[h.keys[i]].should == h.values[i]
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/length'
+
+describe "Hash#length" do
+  it_behaves_like(:hash_length, :length)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/member_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/member_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/member_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/key'
+
+describe "Hash#member?" do
+  it_behaves_like(:hash_key_p, :member?)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/merge_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/merge_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/merge_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,68 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/iteration'
+require File.dirname(__FILE__) + '/shared/update'
+
+describe "Hash#merge" do
+  it "returns a new hash by combining self with the contents of other" do
+    h = { 1 => :a, 2 => :b, 3 => :c }.merge(:a => 1, :c => 2)
+    h.should == { :c => 2, 1 => :a, 2 => :b, :a => 1, 3 => :c }
+  end
+
+  it "sets any duplicate key to the value of block if passed a block" do
+    h1 = { :a => 2, :b => 1, :d => 5}
+    h2 = { :a => -2, :b => 4, :c => -3 }
+    r = h1.merge(h2) { |k,x,y| nil }
+    r.should == { :a => nil, :b => nil, :c => -3, :d => 5 }
+
+    r = h1.merge(h2) { |k,x,y| "#{k}:#{x+2*y}" }
+    r.should == { :a => "a:-2", :b => "b:9", :c => -3, :d => 5 }
+
+    lambda {
+      h1.merge(h2) { |k, x, y| raise(IndexError) }
+    }.should raise_error(IndexError)
+
+    r = h1.merge(h1) { |k,x,y| :x }
+    r.should == { :a => :x, :b => :x, :d => :x }
+  end
+
+  it "tries to convert the passed argument to a hash using #to_hash" do
+    obj = mock('{1=>2}')
+    obj.should_receive(:to_hash).and_return({1 => 2})
+    {3 => 4}.merge(obj).should == {1 => 2, 3 => 4}
+  end
+
+  it "does not call to_hash on hash subclasses" do
+    {3 => 4}.merge(ToHashHash[1 => 2]).should == {1 => 2, 3 => 4}
+  end
+
+  it "returns subclass instance for subclasses" do
+    MyHash[1 => 2, 3 => 4].merge({1 => 2}).class.should == MyHash
+    MyHash[].merge({1 => 2}).class.should == MyHash
+
+    {1 => 2, 3 => 4}.merge(MyHash[1 => 2]).class.should == Hash
+    {}.merge(MyHash[1 => 2]).class.should == Hash
+  end
+
+  it "processes entries with same order as each()" do
+    h = {1 => 2, 3 => 4, 5 => 6, "x" => nil, nil => 5, [] => []}
+    merge_pairs = []
+    each_pairs = []
+    h.each_pair { |*pair| each_pairs << pair }
+    h.merge(h) { |k, v1, v2| merge_pairs << [k, v1] }
+    merge_pairs.should == each_pairs
+  end
+
+  it_behaves_like(:hash_iteration_method, :merge)
+  it_behaves_like(:hash_iteration_modifying, :merge)
+end
+
+describe "Hash#merge!" do
+  it_behaves_like(:hash_update, :merge!)
+
+  it_behaves_like(:hash_iteration_method, :merge!)
+
+  compliant_on :rubinius do
+    it_behaves_like(:hash_iteration_modifying, :merge!)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Hash.new" do
+  it "creates a new Hash with default object if pass a default argument " do
+    Hash.new(5).default.should == 5
+    Hash.new({}).default.should == {}
+  end
+
+  it "does not create a copy of the default argument" do
+    str = "foo"
+    Hash.new(str).default.should equal(str)
+  end
+  
+  it "creates a Hash with a default_proc if passed a block" do
+    Hash.new.default_proc.should == nil
+    
+    h = Hash.new { |x| "Answer to #{x}" }
+    h.default_proc.call(5).should == "Answer to 5"
+    h.default_proc.call("x").should == "Answer to x"
+  end
+  
+  it "raises an ArgumentError if more than one argument is passed" do
+    lambda { Hash.new(5,6) }.should raise_error(ArgumentError)
+  end
+  
+  it "raises an ArgumentError if passed both default argument and default block" do
+    lambda { Hash.new(5) { 0 }   }.should raise_error(ArgumentError)
+    lambda { Hash.new(nil) { 0 } }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/rehash_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/rehash_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/rehash_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,58 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Hash#rehash" do
+  it "reorganizes the hash by recomputing all key hash codes" do
+    k1 = [1]
+    k2 = [2]
+    h = {}
+    h[k1] = 0
+    h[k2] = 1
+
+    k1 << 2
+    h.key?(k1).should == false
+    h.keys.include?(k1).should == true
+
+    h.rehash.should equal(h)
+    h.key?(k1).should == true
+    h[k1].should == 0
+
+    k1 = mock('k1')
+    k2 = mock('k2')
+    v1 = mock('v1')
+    v2 = mock('v2')
+
+    # Can't use should_receive here because it uses hash() internally
+    def v1.hash() raise("values shouldn't be rehashed"); end
+    def v2.hash() raise("values shouldn't be rehashed"); end
+
+    h = { k1 => v1, k2 => v2 }
+
+    def k1.hash() 0 end
+    def k2.hash() 0 end
+
+    h.rehash
+    h[k1].should == v1
+    h[k2].should == v2
+  end
+
+  compliant_on :rubinius do
+    it "gives precedence to keys coming later in keys() on collisions" do
+      k1 = [1]
+      k2 = [2]
+      h = {}
+      h[k1] = 0
+      h[k2] = 1
+
+      k1.replace(k2)
+      override_val = h[h.keys.last]
+      h.rehash
+      h[k1].should == override_val
+    end
+  end
+
+  it "raises a TypeError if called on a frozen instance" do
+    lambda { HashSpecs.frozen_hash.rehash  }.should raise_error(TypeError)
+    lambda { HashSpecs.empty_frozen_hash.rehash }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/reject_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/reject_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/reject_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,100 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/iteration'
+
+describe "Hash#reject" do
+  it "is equivalent to hsh.dup.delete_if" do
+    h = { :a => 'a', :b => 'b', :c => 'd' }
+    h.reject { |k,v| k == 'd' }.should == (h.dup.delete_if { |k, v| k == 'd' })
+
+    all_args_reject = []
+    all_args_delete_if = []
+    h = {1 => 2, 3 => 4}
+    h.reject { |*args| all_args_reject << args }
+    h.delete_if { |*args| all_args_delete_if << args }
+    all_args_reject.should == all_args_delete_if
+
+    h = { 1 => 2 }
+    # dup doesn't copy singleton methods
+    def h.to_a() end
+    h.reject { false }.to_a.should == [[1, 2]]
+  end
+
+  it "returns subclass instance for subclasses" do
+    MyHash[1 => 2, 3 => 4].reject { false }.class.should == MyHash
+    MyHash[1 => 2, 3 => 4].reject { true }.class.should == MyHash
+  end
+
+  it "processes entries with the same order as reject!" do
+    h = {:a => 1, :b => 2, :c => 3, :d => 4}
+
+    reject_pairs = []
+    reject_bang_pairs = []
+    h.dup.reject { |*pair| reject_pairs << pair }
+    h.reject! { |*pair| reject_bang_pairs << pair }
+
+    reject_pairs.should == reject_bang_pairs
+  end
+
+  it_behaves_like(:hash_iteration_no_block, :reject)
+end
+
+describe "Hash#reject!" do
+  before(:each) do
+    @hsh = {1 => 2, 3 => 4, 5 => 6}
+    @empty = {}
+  end
+
+  it "is equivalent to delete_if if changes are made" do
+    {:a => 2}.reject! { |k,v| v > 1 }.should == ({:a => 2}.delete_if { |k, v| v > 1 })
+
+    h = {1 => 2, 3 => 4}
+    all_args_reject = []
+    all_args_delete_if = []
+    h.dup.reject! { |*args| all_args_reject << args }
+    h.dup.delete_if { |*args| all_args_delete_if << args }
+    all_args_reject.should == all_args_delete_if
+  end
+
+  it "returns nil if no changes were made" do
+    { :a => 1 }.reject! { |k,v| v > 1 }.should == nil
+  end
+
+  it "processes entries with the same order as delete_if" do
+    h = {:a => 1, :b => 2, :c => 3, :d => 4}
+
+    reject_bang_pairs = []
+    delete_if_pairs = []
+    h.dup.reject! { |*pair| reject_bang_pairs << pair }
+    h.dup.delete_if { |*pair| delete_if_pairs << pair }
+
+    reject_bang_pairs.should == delete_if_pairs
+  end
+
+  it "raises a TypeError if called on a frozen instance" do
+    lambda { HashSpecs.frozen_hash.reject! { false } }.should raise_error(TypeError)
+    lambda { HashSpecs.empty_frozen_hash.reject! { true } }.should raise_error(TypeError)
+  end
+
+  ruby_version_is "" ... "1.8.7" do
+    it "raises a LocalJumpError when called on a non-empty hash without a block" do
+      lambda { @hsh.reject! }.should raise_error(LocalJumpError)
+    end
+
+    it "does not raise a LocalJumpError when called on an empty hash without a block" do
+      @empty.reject!.should == nil
+    end
+  end
+
+  ruby_version_is "1.8.7" do
+    it "returns an Enumerator when called on a non-empty hash without a block" do
+      @hsh.reject!.should be_kind_of(Enumerable::Enumerator)
+    end
+
+    it "returns an Enumerator when called on an empty hash without a block" do
+      @empty.reject!.should be_kind_of(Enumerable::Enumerator)
+    end
+  end
+
+  it_behaves_like(:hash_iteration_method, :reject!)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/replace_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/replace_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/replace_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/replace'
+
+describe "Hash#replace" do
+  it_behaves_like(:hash_replace, :replace)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/select_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/select_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/select_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,55 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/iteration'
+
+describe "Hash#select" do
+  before(:each) do
+    @hsh = {1 => 2, 3 => 4, 5 => 6}
+    @empty = {}
+  end
+
+  it "yields two arguments: key and value" do
+    all_args = []
+    {1 => 2, 3 => 4}.select { |*args| all_args << args }
+    all_args.sort.should == [[1, 2], [3, 4]]
+  end
+
+  it "returns an array of entries for which block is true" do
+    a_pairs = { 'a' => 9, 'c' => 4, 'b' => 5, 'd' => 2 }.select { |k,v| v % 2 == 0 }
+    a_pairs.sort.should == [['c', 4], ['d', 2]]
+  end
+
+  it "processes entries with the same order as reject" do
+    h = { :a => 9, :c => 4, :b => 5, :d => 2 }
+
+    select_pairs = []
+    reject_pairs = []
+    h.dup.select { |*pair| select_pairs << pair }
+    h.reject { |*pair| reject_pairs << pair }
+
+    select_pairs.should == reject_pairs
+  end
+
+  ruby_version_is "" ... "1.8.7" do
+    it "raises a LocalJumpError when called on a non-empty hash without a block" do
+      lambda { @hsh.select }.should raise_error(LocalJumpError)
+    end
+
+    it "does not raise a LocalJumpError when called on an empty hash without a block" do
+      @empty.select.should == []
+    end
+  end
+
+  ruby_version_is "1.8.7" do
+    it "returns an Enumerator when called on a non-empty hash without a block" do
+      @hsh.select.should be_kind_of(Enumerable::Enumerator)
+    end
+
+    it "returns an Enumerator when called on an empty hash without a block" do
+      @empty.select.should be_kind_of(Enumerable::Enumerator)
+    end
+  end
+
+  it_behaves_like(:hash_iteration_method, :select)
+  it_behaves_like(:hash_iteration_modifying, :select)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/shared/iteration.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/shared/iteration.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/shared/iteration.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,80 @@
+describe :hash_iteration_method, :shared => true do
+  # These are the only ones that actually have the exceptions on MRI 1.8.
+  # sort and reject don't raise!
+  # 
+  #   delete_if each each_key each_pair each_value merge merge! reject!
+  #   select update
+  #
+  hsh = {1 => 2, 3 => 4, 5 => 6}  
+  big_hash = {}
+  64.times { |k| big_hash[k.to_s] = k }    
+     
+  # it "raises a RuntimeError if #rehash is called from block" do
+  #   h = hsh.dup
+  #   args = @method.to_s[/merge|update/] ? [h] : []
+  #   
+  #   lambda {
+  #     h.send(@method, *args) { h.rehash }
+  #   }.should raise_error(RuntimeError)
+  # end
+  # 
+  # # This specification seems arbitrary, but describes the behavior of MRI
+  # it "raises if more than 63 new entries are added from block" do
+  #   h = hsh.dup
+  #   args = @method.to_s[/merge|update/] ? [h] : []
+  # 
+  #   lambda {
+  #     h.send(@method, *args) { |*x| h.merge!(big_hash) }
+  #   }.should raise_error(RuntimeError)
+  # end
+
+end
+
+describe :hash_iteration_modifying, :shared => true do
+  hsh = {1 => 2, 3 => 4, 5 => 6}  
+  big_hash = {}
+  100.times { |k| big_hash[k.to_s] = k }    
+     
+  it "does not affect yielded items by removing the current element" do
+    n = 3
+  
+    h = Array.new(n) { hsh.dup }
+    args = Array.new(n) { |i| @method.to_s[/merge|update/] ? [h[i]] : [] }
+    r = Array.new(n) { [] }
+  
+    h[0].send(@method, *args[0]) { |*x| r[0] << x; true }
+    h[1].send(@method, *args[1]) { |*x| r[1] << x; h[1].shift; true }
+    h[2].send(@method, *args[2]) { |*x| r[2] << x; h[2].delete(h[2].keys.first); true }
+  
+    r[1..-1].each do |yielded|
+      yielded.should == r[0]
+    end
+  end
+end
+
+describe :hash_iteration_no_block, :shared => true do
+  before(:each) do
+    @hsh = {1 => 2, 3 => 4, 5 => 6}
+    @empty = {}
+  end
+  
+  ruby_version_is "" ... "1.8.7" do
+    it "raises a LocalJumpError when called on a non-empty hash without a block" do
+      lambda { @hsh.send(@method) }.should raise_error(LocalJumpError)
+    end
+
+    it "does not raise a LocalJumpError when called on an empty hash without a block" do
+      @empty.send(@method).should == @empty
+    end
+  end
+
+  ruby_version_is "1.8.7" do
+    it "returns an Enumerator if called on a non-empty hash without a block" do
+      @hsh.send(@method).should be_kind_of(Enumerable::Enumerator)
+    end
+
+    it "returns an Enumerator if called on an empty hash without a block" do
+      @empty.send(@method).should be_kind_of(Enumerable::Enumerator)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/shared/key.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/shared/key.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/shared/key.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+describe :hash_key_p, :shared => true do
+  it "returns true if argument is a key" do
+    h = { :a => 1, :b => 2, :c => 3, 4 => 0 }
+    h.send(@method, :a).should == true
+    h.send(@method, :b).should == true
+    h.send(@method, 'b').should == false
+    h.send(@method, 2).should == false
+    h.send(@method, 4).should == true
+    h.send(@method, 4.0).should == false
+  end
+
+  it "returns true if the key's matching value was nil" do
+    { :xyz => nil }.send(@method, :xyz).should == true
+  end
+
+  it "returns true if the key's matching value was false" do
+    { :xyz => false }.send(@method, :xyz).should == true
+  end
+
+  it "returns true if the key is nil" do
+    { nil => 'b'}.send(@method, nil).should == true
+    { nil => nil}.send(@method, nil).should == true
+  end
+
+  it "returns false for objects with the same hash" do
+    o1 = Object.new
+    def o1.hash() 0 end
+
+    o2 = Object.new
+    def o2.hash() 0 end
+
+    { o1 => nil }.send(@method, o2).should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/shared/length.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/shared/length.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/shared/length.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+describe :hash_length, :shared => true do
+  it "returns the number of entries" do
+    {:a => 1, :b => 'c'}.send(@method).should == 2
+    {:a => 1, :b => 2, :a => 2}.send(@method).should == 2
+    {:a => 1, :b => 1, :c => 1}.send(@method).should == 3
+    {}.send(@method).should == 0
+    Hash.new(5).send(@method).should == 0
+    Hash.new { 5 }.send(@method).should == 0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/shared/replace.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/shared/replace.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/shared/replace.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,45 @@
+describe :hash_replace, :shared => true do
+  it "replaces the contents of self with other" do
+    h = { :a => 1, :b => 2 }
+    h.send(@method, :c => -1, :d => -2).should equal(h)
+    h.should == { :c => -1, :d => -2 }
+  end
+
+  it "tries to convert the passed argument to a hash using #to_hash" do
+    obj = mock('{1=>2,3=>4}')
+    obj.should_receive(:to_hash).and_return({1 => 2, 3 => 4})
+
+    h = {}
+    h.send(@method, obj)
+    h.should == {1 => 2, 3 => 4}
+  end
+
+  it "calls to_hash on hash subclasses" do
+    h = {}
+    h.send(@method, ToHashHash[1 => 2])
+    h.should == {1 => 2}
+  end
+
+  it "does not transfer default values" do
+    hash_a = {}
+    hash_b = Hash.new(5)
+    hash_a.send(@method, hash_b)
+    hash_a.default.should == 5
+
+    hash_a = {}
+    hash_b = Hash.new { |h, k| k * 2 }
+    hash_a.send(@method, hash_b)
+    hash_a.default(5).should == 10
+
+    hash_a = Hash.new { |h, k| k * 5 }
+    hash_b = Hash.new(lambda { raise "Should not invoke lambda" })
+    hash_a.send(@method, hash_b)
+    hash_a.default.should == hash_b.default
+  end
+
+  it "raises a TypeError if called on a frozen instance" do
+    HashSpecs.frozen_hash.send(@method, HashSpecs.frozen_hash) # ok, nothing changed
+    block = lambda { HashSpecs.frozen_hash.send(@method, HashSpecs.empty_frozen_hash) }
+    block.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/shared/store.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/shared/store.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/shared/store.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,43 @@
+describe :hash_store, :shared => true do
+  it "associates the key with the value and return the value" do
+    h = { :a => 1 }
+    h.send(@method, :b, 2).should == 2
+    h.should == {:b=>2, :a=>1}
+  end
+
+  it "duplicates string keys using dup semantics" do
+    # dup doesn't copy singleton methods
+    key = "foo"
+    def key.reverse() "bar" end
+    h = {}
+    h.send(@method, key, 0)
+    h.keys[0].reverse.should == "oof"
+  end
+
+  it "stores unequal keys that hash to the same value" do
+    h = {}
+    k1 = ["x"]
+    k2 = ["y"]
+    # So they end up in the same bucket
+    def k1.hash() 0 end
+    def k2.hash() 0 end
+
+    h[k1] = 1
+    h[k2] = 2
+    h.size.should == 2
+  end
+
+  it "duplicates and freezes string keys" do
+    key = "foo"
+    h = {}
+    h.send(@method, key, 0)
+    key << "bar"
+
+    h.should == { "foo" => 0 }
+    h.keys[0].frozen?.should == true
+  end
+
+  it "raises a TypeError if called on a frozen instance" do
+    lambda { HashSpecs.frozen_hash.send(@method, 1, 2) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/shared/update.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/shared/update.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/shared/update.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,41 @@
+describe :hash_update, :shared => true do
+  it "adds the entries from other, overwriting duplicate keys. Returns self" do
+    h = { :_1 => 'a', :_2 => '3' }
+    h.send(@method, :_1 => '9', :_9 => 2).should equal(h)
+    h.should == {:_1 => "9", :_2 => "3", :_9 => 2}
+  end
+
+  it "sets any duplicate key to the value of block if passed a block" do
+    h1 = { :a => 2, :b => -1 }
+    h2 = { :a => -2, :c => 1 }
+    h1.send(@method, h2) { |k,x,y| 3.14 }.should equal(h1)
+    h1.should == {:c => 1, :b => -1, :a => 3.14}
+
+    h1.send(@method, h1) { nil }
+    h1.should == { :a => nil, :b => nil, :c => nil }
+  end
+
+  it "tries to convert the passed argument to a hash using #to_hash" do
+    obj = mock('{1=>2}')
+    obj.should_receive(:to_hash).and_return({1 => 2})
+    {3 => 4}.send(@method, obj).should == {1 => 2, 3 => 4}
+  end
+
+  it "does not call to_hash on hash subclasses" do    
+    {3 => 4}.send(@method, ToHashHash[1 => 2]).should == {1 => 2, 3 => 4}
+  end
+
+  it "processes entries with same order as merge()" do
+    h = {1 => 2, 3 => 4, 5 => 6, "x" => nil, nil => 5, [] => []}
+    merge_bang_pairs = []
+    merge_pairs = []
+    h.merge(h) { |*arg| merge_pairs << arg }
+    h.send(@method, h) { |*arg| merge_bang_pairs << arg }
+    merge_bang_pairs.should == merge_pairs
+  end
+
+  it "raises a TypeError if called on a non-empty, frozen instance" do
+    HashSpecs.frozen_hash.send(@method, HashSpecs.empty_frozen_hash) # ok, empty
+    lambda { HashSpecs.frozen_hash.send(@method, 1 => 2) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/shared/value.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/shared/value.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/shared/value.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+describe :hash_value_p, :shared => true do
+  it "returns true if the value exists in the hash" do
+    {:a => :b}.send(@method, :a).should == false
+    {1 => 2}.send(@method, 2).should == true
+    h = Hash.new(5)
+    h.send(@method, 5).should == false
+    h = Hash.new { 5 }
+    h.send(@method, 5).should == false
+  end
+
+  it "uses == semantics for comparing values" do
+    { 5 => 2.0 }.send(@method, 2).should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/shift_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/shift_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/shift_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,42 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Hash#shift" do
+  it "removes a pair from hash and return it (same order as to_a)" do
+    h = { :a => 1, :b => 2, "c" => 3, nil => 4, [] => 5 }
+    pairs = h.to_a
+
+    h.size.times do
+      r = h.shift
+      r.class.should == Array
+      r.should == pairs.shift
+      h.size.should == pairs.size
+    end
+
+    h.should == {}
+  end
+
+  it "returns nil from an empty hash " do
+    {}.shift.should == nil
+  end
+
+  it "returns (computed) default for empty hashes" do
+    Hash.new(5).shift.should == 5
+    h = Hash.new { |*args| args }
+    h.shift.should == [h, nil]
+  end
+
+  ruby_version_is "" ... "1.9" do
+    it "raises a TypeError if called on a frozen instance" do
+      lambda { HashSpecs.frozen_hash.shift  }.should raise_error(TypeError)
+      lambda { HashSpecs.empty_frozen_hash.shift }.should raise_error(TypeError)
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "raises a RuntimeError if called on a frozen instance" do
+      lambda { HashSpecs.frozen_hash.shift  }.should raise_error(RuntimeError)
+      lambda { HashSpecs.empty_frozen_hash.shift }.should raise_error(RuntimeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/length'
+
+describe "Hash#size" do
+  it_behaves_like(:hash_length, :size)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/sort_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/sort_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/sort_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Hash#sort" do
+  it "converts self to a nested array of [key, value] arrays and sort with Array#sort" do
+    { 'a' => 'b', '1' => '2', 'b' => 'a' }.sort.should == [["1", "2"], ["a", "b"], ["b", "a"]]
+  end
+  
+  it "works when some of the keys are themselves arrays" do
+    { [1,2] => 5, [1,1] => 5 }.sort.should == [[[1,1],5], [[1,2],5]]
+  end
+  
+  it "uses block to sort array if passed a block" do
+    { 1 => 2, 2 => 9, 3 => 4 }.sort { |a,b| b <=> a }.should == [[3, 4], [2, 9], [1, 2]]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/store_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/store_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/store_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/store'
+
+describe "Hash#store" do
+  it_behaves_like(:hash_store, :store)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/to_a_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/to_a_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/to_a_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Hash#to_a" do
+  it "returns a list of [key, value] pairs with same order as each()" do
+    h = {:a => 1, 1 => :a, 3 => :b, :b => 5}
+    pairs = []
+
+    h.each_pair do |*pair|
+      pairs << pair
+    end
+    
+    h.to_a.class.should == Array
+    h.to_a.should == pairs
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/to_hash_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/to_hash_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/to_hash_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Hash#to_hash" do
+  it "returns self" do
+    h = {}
+    h.to_hash.should equal(h)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Hash#to_s" do
+  it "returns a string by calling Hash#to_a and using Array#join with default separator" do
+    h = { :fun => 'x', 1 => 3, nil => "ok", [] => :y }
+    h.to_a.to_s.should == h.to_s
+    old, $, = $,, ':'
+    h.to_a.to_s.should == h.to_s
+    $, = old
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/update_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/update_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/update_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/iteration'
+require File.dirname(__FILE__) + '/shared/update'
+
+describe "Hash#update" do
+  it_behaves_like(:hash_update, :update)
+
+  it_behaves_like(:hash_iteration_method, :update)
+
+  compliant_on :rubinius do
+    it_behaves_like(:hash_iteration_modifying, :update)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/hash/value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/value'
+
+describe "Hash#value?" do
+  it_behaves_like(:hash_value_p, :value?)
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/hash/values_at_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/values_at_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/values_at_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe :hash_values_at, :shared => true do
+  it "returns an array of values for the given keys" do
+    h = {:a => 9, :b => 'a', :c => -10, :d => nil}
+    h.send(@method).class.should == Array
+    h.send(@method).should == []
+    h.send(@method, :a, :d, :b).class.should == Array
+    h.send(@method, :a, :d, :b).should == [9, nil, 'a']
+  end
+end
+
+describe "Hash#values_at" do
+  it_behaves_like(:hash_values_at, :values_at)
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/hash/values_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/hash/values_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/hash/values_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Hash#values" do
+  it "returns an array of values" do
+    h = { 1 => :a, 'a' => :a, 'the' => 'lang'}
+    h.values.class.should == Array
+    h.values.sort {|a, b| a.to_s <=> b.to_s}.should == [:a, :a, 'lang']
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/integer/ceil_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/integer/ceil_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/integer/ceil_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/to_i'
+
+describe "Integer#ceil" do
+  it_behaves_like(:integer_to_i, :ceil)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/integer/chr_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/integer/chr_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/integer/chr_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Integer#chr" do
+  it "returns a string containing the ASCII character represented by self" do
+    [82.chr, 117.chr, 98.chr, 105.chr, 110.chr, 105.chr, 117.chr, 115.chr, 
+     32.chr, 
+     114.chr, 111.chr, 99.chr, 107.chr, 115.chr].should == 
+      ["R", "u", "b", "i", "n", "i", "u", "s", " ", "r", "o", "c", "k", "s"]
+  end
+
+  it "returns a new String for each call" do
+    82.chr.should_not equal(82.chr)
+  end
+  
+  it "raises a RangeError if self is out of the ASCII character range" do
+    lambda { -1.chr }.should raise_error(RangeError)
+    lambda { -300.chr }.should raise_error(RangeError)
+    lambda { (-bignum_value).chr }.should raise_error(RangeError)
+
+    lambda { 300.chr }.should raise_error(RangeError)
+    lambda { bignum_value.chr }.should raise_error(RangeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/integer/downto_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/integer/downto_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/integer/downto_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,53 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Integer#downto [stop] when self and stop are Fixnums" do
+  it "does not yield when stop is greater than self" do
+    result = []
+    5.downto(6) { |x| result << x }
+    result.should == []
+  end
+  
+  it "yields once when stop equals self" do
+    result = []
+    5.downto(5) { |x| result << x }
+    result.should == [5]
+  end
+  
+  it "yields while decreasing self until it is less than stop" do
+    result = []
+    5.downto(2) { |x| result << x }
+    result.should == [5, 4, 3, 2]
+  end
+
+  it "yields while decreasing self until it less than ceil for a Float endpoint" do
+    result = []
+    9.downto(1.3) {|i| result << i}
+    3.downto(-1.3) {|i| result << i}
+    result.should == [9, 8, 7, 6, 5, 4, 3, 2, 3, 2, 1, 0, -1]
+  end
+
+  it "raises a ArgumentError for invalid endpoints" do
+    lambda {1.downto("A") {|x| p x } }.should raise_error(ArgumentError)
+    lambda {1.downto(nil) {|x| p x } }.should raise_error(ArgumentError)
+  end
+
+  ruby_version_is "" ... "1.8.7" do
+    it "does not require a block if self is less than stop" do
+      1.downto(2).should equal(1)
+    end
+    it "raises a LocalJumpError when no block given" do
+      lambda { 5.downto(2) }.should raise_error(LocalJumpError)
+    end
+  end
+
+  ruby_version_is "1.8.7" do
+    it "returns an Enumerator" do
+      result = []
+      
+      enum = 5.downto(2)
+      enum.each { |i| result << i }
+      
+      result.should == [5, 4, 3, 2]
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/integer/even_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/integer/even_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/integer/even_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+ruby_version_is "1.8.7" do
+  describe "Integer#even?" do
+    it "returns true when self is an even number" do
+      (-2).even?.should be_true
+      (-1).even?.should be_false
+
+      0.even?.should be_true
+      1.even?.should be_false
+      2.even?.should be_true
+
+      bignum_value(0).even?.should be_true
+      bignum_value(1).even?.should be_false
+
+      (-bignum_value(0)).even?.should be_true
+      (-bignum_value(1)).even?.should be_false
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/integer/floor_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/integer/floor_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/integer/floor_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/to_i'
+
+describe "Integer#floor" do
+  it_behaves_like(:integer_to_i, :floor)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/integer/induced_from_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/integer/induced_from_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/integer/induced_from_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,41 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Integer.induced_from with [Float]" do
+  it "returns a Fixnum when the passed Float is in Fixnum's range" do
+    Integer.induced_from(2.5).should eql(2)
+    Integer.induced_from(-3.14).should eql(-3)
+    Integer.induced_from(10 - TOLERANCE).should eql(9)
+    Integer.induced_from(TOLERANCE).should eql(0)
+  end
+  
+  it "returns a Bignum when the passed Float is out of Fixnum's range" do
+    Integer.induced_from(bignum_value.to_f).should eql(bignum_value)
+    Integer.induced_from(-bignum_value.to_f).should eql(-bignum_value)
+  end
+end
+
+describe "Integer.induced_from" do
+  it "returns the passed argument when passed a Bignum or Fixnum" do
+    Integer.induced_from(1).should eql(1)
+    Integer.induced_from(-10).should eql(-10)
+    Integer.induced_from(bignum_value).should eql(bignum_value)
+  end
+  
+  it "does not try to convert non-Integers to Integers using #to_int" do
+    obj = mock("Not converted to Integer")
+    obj.should_not_receive(:to_int)
+    lambda { Integer.induced_from(obj) }.should raise_error(TypeError)
+  end
+
+  it "does not try to convert non-Integers to Integers using #to_i" do
+    obj = mock("Not converted to Integer")
+    obj.should_not_receive(:to_i)
+    lambda { Integer.induced_from(obj) }.should raise_error(TypeError)
+  end
+  
+  it "raises a TypeError when passed a non-Integer" do
+    lambda { Integer.induced_from("2") }.should raise_error(TypeError)
+    lambda { Integer.induced_from(:symbol) }.should raise_error(TypeError)
+    lambda { Integer.induced_from(Object.new) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/integer/integer_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/integer/integer_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/integer/integer_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Integer#integer?" do
+  it "returns true" do
+    0.integer?.should == true 
+    -1.integer?.should == true
+    bignum_value.integer?.should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/integer/next_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/integer/next_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/integer/next_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/next'
+
+describe "Integer#next" do
+  it_behaves_like(:integer_next, :next)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/integer/odd_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/integer/odd_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/integer/odd_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+ruby_version_is "1.8.7" do
+  describe "Integer#odd?" do
+    it "returns true when self is an odd number" do
+      (-2).odd?.should be_false
+      (-1).odd?.should be_true
+
+      0.odd?.should be_false
+      1.odd?.should be_true
+      2.odd?.should be_false
+
+      bignum_value(0).odd?.should be_false
+      bignum_value(1).odd?.should be_true
+
+      (-bignum_value(0)).odd?.should be_false
+      (-bignum_value(1)).odd?.should be_true
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/integer/ord_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/integer/ord_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/integer/ord_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+ruby_version_is "1.8.7" do
+  describe "Integer#ord" do
+    it "returns self" do
+      20.ord.should eql(20)
+      40.ord.should eql(40)
+      
+      0.ord.should eql(0)
+      (-10).ord.should eql(-10)
+      
+      ?a.ord.should eql(97)
+      ?Z.ord.should eql(90)
+      
+      bignum_value.ord.should eql(bignum_value)
+      (-bignum_value).ord.should eql(-bignum_value)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/integer/pred_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/integer/pred_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/integer/pred_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+ruby_version_is "1.8.7" do
+  describe "Integer#pred" do
+    it "returns the Integer equal to self - 1" do
+      0.pred.should eql(-1) 
+      -1.pred.should eql(-2)
+      bignum_value.pred.should eql(bignum_value(-1))
+      20.pred.should eql(19)
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/integer/round_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/integer/round_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/integer/round_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/to_i'
+
+describe "Integer#round" do
+  it_behaves_like(:integer_to_i, :round)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/integer/shared/next.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/integer/shared/next.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/integer/shared/next.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+describe :integer_next, :shared => true do
+  it "returns the Integer equal to self + 1" do
+    0.send(@method).should == 1 
+    -1.send(@method).should == 0
+    bignum_value.send(@method).should == bignum_value(1)
+    20.send(@method).should == 21
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/integer/shared/to_i.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/integer/shared/to_i.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/integer/shared/to_i.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+describe :integer_to_i, :shared => true do
+  it "returns self" do
+    10.send(@method).should eql(10)
+    (-15).send(@method).should eql(-15)
+    bignum_value.send(@method).should eql(bignum_value)
+    (-bignum_value).send(@method).should eql(-bignum_value)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/integer/succ_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/integer/succ_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/integer/succ_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/next'
+
+describe "Integer#succ" do
+  it_behaves_like(:integer_next, :succ)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/integer/times_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/integer/times_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/integer/times_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,75 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Integer#times" do
+  it "returns self" do
+    5.times {}.should == 5
+    9.times {}.should == 9
+    9.times { |n| n - 2 }.should == 9
+  end
+  
+  it "yields each value from 0 to self - 1" do
+    a = []
+    9.times { |i| a << i }
+    -2.times { |i| a << i }
+    a.should == [0, 1, 2, 3, 4, 5, 6, 7, 8]
+  end
+  
+  it "skips the current iteration when encountering 'next'" do
+    a = []
+    3.times do |i|
+      next if i == 1
+      a << i
+    end
+    a.should == [0, 2]
+  end
+  
+  it "skips all iterations when encountering 'break'" do
+    a = []
+    5.times do |i|
+      break if i == 3
+      a << i
+    end
+    a.should == [0, 1, 2]
+  end
+  
+  it "skips all iterations when encountering break with an argument and returns that argument" do
+    9.times { break 2 }.should == 2
+  end
+
+  it "executes a nested while loop containing a break expression" do
+    a = [false]
+    b = 1.times do |i|
+      while true
+        a.shift or break
+      end
+    end
+    a.should == []
+    b.should == 1
+  end
+
+  it "executes a nested #times" do
+    a = 0
+    b = 3.times do |i|
+      2.times { a += 1 }
+    end
+    a.should == 6
+    b.should == 3
+  end
+  
+  ruby_version_is "" ... "1.8.7" do
+    it "raises a LocalJumpError when no block given" do
+      lambda { 3.times }.should raise_error(LocalJumpError)
+    end
+  end
+
+  ruby_version_is "1.8.7" do
+    it "returns an Enumerator" do
+      result = []
+      
+      enum = 3.times
+      enum.each { |i| result << i }
+      
+      result.should == [0, 1, 2]
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/integer/to_i_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/integer/to_i_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/integer/to_i_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/to_i'
+
+describe "Integer#to_i" do
+  it_behaves_like(:integer_to_i, :to_i)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/integer/to_int_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/integer/to_int_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/integer/to_int_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/to_i'
+
+describe "Integer#to_int" do
+  it_behaves_like(:integer_to_i, :to_int)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/integer/truncate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/integer/truncate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/integer/truncate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/to_i'
+
+describe "Integer#truncate" do
+  it_behaves_like(:integer_to_i, :truncate)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/integer/upto_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/integer/upto_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/integer/upto_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,50 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Integer#upto [stop] when self and stop are Fixnums" do
+  it "does not yield when stop is less than self" do
+    result = []
+    5.upto(4) { |x| result << x }
+    result.should == []
+  end
+  
+  it "yields once when stop equals self" do
+    result = []
+    5.upto(5) { |x| result << x }
+    result.should == [5]
+  end
+  
+  it "yields while increasing self until it is less than stop" do
+    result = []
+    2.upto(5) { |x| result << x }
+    result.should == [2, 3, 4, 5]
+  end
+
+  it "yields while increasing self until it is greater than floor of a Float endpoint" do
+    result = []
+    9.upto(13.3) {|i| result << i}
+    -5.upto(-1.3) {|i| result << i}
+    result.should == [9,10,11,12,13,-5,-4,-3,-2] 
+  end 
+
+  it "raises an ArgumentError for non-numeric endpoints" do
+    lambda { 1.upto("A") {|x| p x} }.should raise_error(ArgumentError) 
+    lambda { 1.upto(nil) {|x| p x} }.should raise_error(ArgumentError)
+  end
+
+  ruby_version_is "" ... "1.8.7" do
+    it "raises a LocalJumpError when no block given" do
+      lambda { 2.upto(5) }.should raise_error(LocalJumpError)
+    end
+  end
+
+  ruby_version_is "1.8.7" do
+    it "returns an Enumerator" do
+      result = []
+      
+      enum = 2.upto(5)
+      enum.each { |i| result << i }
+      
+      result.should == [2, 3, 4, 5]
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/binmode_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/binmode_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/binmode_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#binmode" do
+  before :each do
+    @filename = tmp("IO_binmode_file")
+    @file = File.open(@filename, "w")
+  end
+
+  after :each do
+    @file.close
+    File.unlink @filename
+  end
+  
+  it "does not raise any errors on closed stream" do
+    lambda { IOSpecs.closed_file.binmode }.should_not raise_error()
+  end
+
+  # Even if it does nothing in Unix it should not raise any errors.
+  it "puts a stream in binary mode" do
+    lambda { @file.binmode }.should_not raise_error
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/close_read_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/close_read_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/close_read_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,64 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require 'fileutils'
+
+describe "IO#close_read" do
+
+  before :each do
+    @io = IO.popen 'cat', "r+"
+    @path = tmp('io.close.txt')
+  end
+
+  after :each do
+    @io.close unless @io.closed?
+  end
+
+  it "closes the read end of a duplex I/O stream" do
+    @io.close_read
+
+    lambda { @io.read }.should raise_error(IOError)
+  end
+
+  it "raises an IOError on subsequent invocations" do
+    @io.close_read
+
+    lambda { @io.close_read }.should raise_error(IOError)
+  end
+
+  it "allows subsequent invocation of close" do
+    @io.close_read
+
+    lambda { @io.close }.should_not raise_error
+  end
+
+  it "raises an IOError if the stream is writable and not duplexed" do
+    io = File.open @path, 'w'
+
+    begin
+      lambda { io.close_read }.should raise_error(IOError)
+    ensure
+      io.close unless io.closed?
+    end
+    File.unlink(@path)
+  end
+
+  it "closes the stream if it is neither writable nor duplexed" do
+    io_close_path = @path
+    FileUtils.touch io_close_path
+
+    io = File.open io_close_path
+
+    io.close_read
+
+    io.closed?.should == true
+    File.unlink(@path)
+  end
+
+  it "raises IOError on closed stream" do
+    @io.close
+
+    lambda { @io.close_read }.should raise_error(IOError)
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/io/close_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/close_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/close_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,77 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "IO#close" do
+  before :each do
+    @path = tmp('io.close.txt')
+    @io = File.open @path, 'w'
+  end
+
+  after :each do
+    @io.close unless @io.closed?
+    p = File.unlink(@path) 
+  end
+
+  it "closes the stream" do
+    lambda { @io.close }.should_not raise_error
+    @io.closed?.should == true
+  end
+
+  it "returns nil" do
+    @io.close.should == nil
+  end
+
+  it "makes the stream unavailable for any further data operations" do
+    @io.close
+
+    lambda { @io.write "attempt to write" }.should raise_error(IOError)
+    lambda { @io.read }.should raise_error(IOError)
+  end
+
+  it "raises an IOError on subsequent invocations" do
+    @io.close
+
+    lambda { @io.close }.should raise_error(IOError)
+  end
+
+  it "raises when a file descriptor is closed twice" do
+    io2 = IO.new @io.fileno
+    @io.close
+
+    lambda { io2.close }.should raise_error(Errno::EBADF)
+  end
+
+end
+
+describe "IO#close on an IO.popen stream" do
+
+  it "clears #pid" do
+    io = IO.popen 'yes', 'r'
+
+    io.pid.should_not == 0
+
+    io.close
+
+    lambda { io.pid }.should raise_error(IOError)
+  end
+
+  it "sets $?" do
+    io = IO.popen 'true', 'r'
+    io.close
+
+    $?.exitstatus.should == 0
+
+    io = IO.popen 'false', 'r'
+    io.close
+
+    $?.exitstatus.should == 1
+  end
+
+  it "waits for the child to exit" do
+    io = IO.popen 'yes', 'r'
+    io.close
+
+    $?.exitstatus.should_not == 0 # SIGPIPE/EPIPE
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/io/close_write_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/close_write_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/close_write_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,68 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#close_write" do
+
+  before :each do
+    @io = IO.popen 'cat', 'r+'
+    @path = tmp('io.close.txt')
+  end
+
+  after :each do
+    @io.close unless @io.closed?
+  end
+
+  it "closes the write end of a duplex I/O stream" do
+    @io.close_write
+
+    lambda { @io.write "attempt to write" }.should raise_error(IOError)
+  end
+
+  it "raises an IOError on subsequent invocations" do
+    @io.close_write
+
+    lambda { @io.close_write }.should raise_error(IOError)
+  end
+
+  it "allows subsequent invocation of close" do
+    @io.close_write
+
+    lambda { @io.close }.should_not raise_error
+  end
+
+  it "raises an IOError if the stream is readable and not duplexed" do
+    io = File.open @path, 'w+'
+
+    begin
+      lambda { io.close_write }.should raise_error(IOError)
+    ensure
+      io.close unless io.closed?
+    end
+    File.unlink(@path)
+  end
+
+  it "closes the stream if it is neither readable nor duplexed" do
+    io = File.open @path, 'w'
+
+    io.close_write
+
+    io.closed?.should == true
+    File.unlink @path
+  end
+
+  it "flushes and closes the write stream" do
+    @io.puts '12345'
+
+    @io.close_write
+
+    @io.read.should == "12345\n"
+  end
+
+  it "raises IOError on closed stream" do
+    @io.close
+
+    lambda { @io.close_write }.should raise_error(IOError)
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/io/closed_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/closed_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/closed_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO##{}closed?" do
+  it "returns true on closed stream" do
+    IOSpecs.closed_file.closed?.should == true
+  end
+
+  it "returns false on open stream" do
+    File.open(File.dirname(__FILE__) + '/fixtures/gets.txt', 'r') { |io|
+      io.closed?.should == false
+    }
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/constants_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/constants_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/constants_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "IO::SEEK_SET" do
+  it "is defined" do
+    IO.const_defined?(:SEEK_SET).should == true
+  end
+end
+
+describe "IO::SEEK_CUR" do
+  it "is defined" do
+    IO.const_defined?(:SEEK_CUR).should == true
+  end
+end
+
+describe "IO::SEEK_END" do
+  it "is defined" do
+    IO.const_defined?(:SEEK_END).should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/data/data_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/data/data_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/data/data_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "DATA" do
+  before :each do
+    @data1_name = fixture __FILE__, "data1.rb"
+  end
+
+  it "presents $0 file data after __END__ as a File object" do
+    data = ruby_exe(@data1_name)
+    data.should == "[File, \"hello\"]"
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/io/data/fixtures/data1.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/data/fixtures/data1.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/data/fixtures/data1.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+print [DATA.class, DATA.read].inspect
+__END__
+hello
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/io/data/fixtures/data2.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/data/fixtures/data2.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/data/fixtures/data2.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+print DATA.flock(File::LOCK_EX | File::LOCK_NB)
+__END__
+hello
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/io/data/flock_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/data/flock_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/data/flock_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "DATA.flock" do
+  before :each do
+    @data2_name = fixture __FILE__, "data2.rb"
+  end
+
+  it "succeeds in locking the file DATA came from" do
+    data = ruby_exe(@data2_name)
+    data.should == "0"
+
+    begin
+      file = File.open(@data2_name)
+      file.flock(File::LOCK_EX)
+      data = ruby_exe(@data2_name)
+      data.should == "false"
+    ensure
+      file.flock(File::LOCK_UN) if file
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/io/dup_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/dup_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/dup_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,75 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#dup" do
+  before :all do
+    @file = tmp("rubinius_spec_io_dup_#{$$}_#{Time.now.to_f}")
+  end
+
+  before :each do
+    @f = File.open @file, 'w+'
+    @i = @f.dup
+
+    @f.sync = true
+    @i.sync = true
+  end
+
+  after :each do
+    @i.close unless @i.closed?
+    @f.close unless @f.closed?
+  end
+
+  after :all do
+    File.unlink @file if File.exists?(@file)
+  end
+
+  it "returns a new IO instance" do
+    @i.class.should == @f.class
+  end
+
+  it "sets a new descriptor on the returned object" do
+    @i.fileno.should_not == @f.fileno
+  end
+
+quarantine! do # This does not appear to be consistent across platforms
+  it "shares the original stream between the two IOs" do
+    start = @f.pos
+    @i.pos.should == start
+
+    s =  "Hello, wo.. wait, where am I?\n"
+    s2 = "<evil voice>       Muhahahaa!"
+
+    @f.write s
+    @i.pos.should == @f.pos
+
+    @i.rewind
+    @i.gets.should == s
+
+    @i.rewind
+    @i.write s2
+
+    @f.rewind
+    @f.gets.should == "#{s2}\n"
+  end
+end
+
+  it "allows closing the new IO without affecting the original" do
+    @i.close
+    lambda { @f.gets }.should_not raise_error(Exception)
+
+    @i.closed?.should == true
+    @f.closed?.should == false
+  end
+
+  it "allows closing the original IO without affecting the new one" do
+    @f.close
+    lambda { @i.gets }.should_not raise_error(Exception)
+
+    @i.closed?.should == false
+    @f.closed?.should == true
+  end
+
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.dup }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/each_byte_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/each_byte_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/each_byte_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#each_byte" do
+  it "raises IOError on closed stream" do
+    # each_byte must have a block in order to raise the Error.
+    # MRI 1.8.7 returns enumerator if block is not provided.
+    # See [ruby-core:16557].
+    lambda { IOSpecs.closed_file.each_byte {} }.should raise_error(IOError)
+  end
+
+  it "yields each byte" do
+    open IOSpecs.gets_fixtures do |io|
+      bytes = []
+
+      io.each_byte do |byte|
+        bytes << byte
+        break if bytes.length >= 5
+      end
+
+      bytes.should == [86, 111, 105, 99, 105]
+    end
+  end
+
+  it "works on empty streams" do
+    f = File.new(tmp("io-each-byte-spec"), "w+") 
+    lambda { 
+      f.each_byte { |b| raise IOError }
+    }.should_not raise_error
+    f.close
+    File.unlink(tmp("io-each-byte-spec"))
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/each_line_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/each_line_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/each_line_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/each'
+
+describe "IO#each_line" do
+  it_behaves_like :io_each, :each_line
+end
+
+describe "IO#each_line when passed a separator" do
+  it_behaves_like :io_each_separator, :each_line
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/each_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/each_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/each_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/each'
+
+describe "IO#each" do
+  it_behaves_like(:io_each, :each)
+end
+
+describe "IO#each when passed a separator" do
+  it_behaves_like :io_each_separator, :each_line
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/eof_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/eof_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/eof_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,99 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#eof?" do
+  before :each do
+    @file_name = File.dirname(__FILE__) + '/fixtures/readlines.txt'
+    @file = File.open(@file_name, 'r')
+  end
+
+  after :each do
+    @file.close unless @file.closed?
+  end
+
+  it "returns false when not at end of file" do
+    @file.read 1
+    @file.eof?.should == false
+  end
+
+  it "returns true after reading with read with no parameters" do
+    @file.read()
+    @file.eof?.should == true
+  end
+
+  it "returns true after reading with read" do
+    @file.read(File.size(@file_name))
+    @file.eof?.should == true
+  end
+
+  it "returns true after reading with sysread" do
+    @file.sysread(File.size(@file_name))
+    @file.eof?.should == true
+  end
+
+  it "returns true after reading with readlines" do
+    @file.readlines
+    @file.eof?.should == true
+  end
+
+  it "returns true on just opened empty stream" do
+    File.open(tmp('empty.txt'), "w") { |empty| } # ensure it exists
+    File.open(tmp('empty.txt')) { |empty|
+      empty.eof?.should == true
+    }
+    File.unlink(tmp("empty.txt"))
+  end
+
+  it "returns false on just opened non-empty stream" do
+    @file.eof?.should == false
+  end
+
+  it "should not consume the data from the stream" do
+    @file.eof?.should == false
+    @file.getc.should == 86
+  end
+
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.eof? }.should raise_error(IOError)
+  end
+
+  it "raises IOError on stream not opened for reading" do
+ 
+    File.open(tmp('empty.txt'), "w") { |empty|
+      lambda {
+        empty.eof?
+      }.should raise_error(IOError)
+    }
+    File.unlink(tmp("empty.txt"))
+  end
+
+  it "raises IOError on stream closed for reading by close_read" do
+    @file.close_read
+    lambda { @file.eof? }.should raise_error(IOError)
+  end
+
+  it "returns true on one-byte stream after single-byte read" do
+    File.open(File.dirname(__FILE__) + '/fixtures/one_byte.txt') { |one_byte|
+      one_byte.read(1)
+      one_byte.eof?.should == true
+    }
+  end
+
+  it "returns true on receiving side of Pipe when writing side is closed" do
+    r, w = IO.pipe
+    w.close
+    r.eof?.should == true
+    r.close
+  end
+
+  it "returns false on receiving side of Pipe when writing side wrote some data" do
+    r, w = IO.pipe
+    w.puts "hello"
+    r.eof?.should == false
+    w.close
+    r.eof?.should == false
+    r.read
+    r.eof?.should == true
+    r.close
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/fcntl_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/fcntl_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/fcntl_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#fcntl" do
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.fcntl(5, 5) }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/fileno_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/fileno_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/fileno_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#fileno" do
+  it "returns the numeric file descriptor of the given IO object" do
+    $stdout.fileno.should == 1
+  end
+
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.fileno }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+module IOSpecs
+  def self.lines
+    [ "Voici la ligne une.\n",
+      "Qui \303\250 la linea due.\n",
+      "\n",
+      "\n",
+      "Aqu\303\255 est\303\241 la l\303\255nea tres.\n",
+      "Ist hier Linie vier.\n",
+      "\n",
+      "Est\303\241 aqui a linha cinco.\n",
+      "Here is line six.\n" ]
+  end
+  
+  def self.gets_fixtures
+    File.dirname(__FILE__) + '/gets.txt'
+  end
+  
+  def self.gets_output
+    File.dirname(__FILE__) + '/gets_output.txt'
+  end
+  
+  def self.closed_file
+    File.open(File.dirname(__FILE__) + '/gets.txt', 'r') { |f| f }
+  end
+
+  def self.closed_io
+    File.open(gets_fixtures, 'r') { |file|
+      IO.open(file.fileno, 'r') { |io|
+        io
+      }
+    }
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/fixtures/gets.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/fixtures/gets.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/fixtures/gets.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+Voici la ligne une.
+Qui è la linea due.
+
+
+Aquí está la línea tres.
+Ist hier Linie vier.
+
+Está aqui a linha cinco.
+Here is line six.

Added: MacRuby/branches/experimental/spec/frozen/core/io/fixtures/numbered_lines.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/fixtures/numbered_lines.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/fixtures/numbered_lines.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+Line 1: One
+Line 2: Two
+Line 3: Three
+Line 4: Four
+Line 5: Five

Added: MacRuby/branches/experimental/spec/frozen/core/io/fixtures/one_byte.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/fixtures/one_byte.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/fixtures/one_byte.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+1
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/io/fixtures/paragraphs.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/fixtures/paragraphs.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/fixtures/paragraphs.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+This is
+
+an example
+
+
+
+of paragraphs.
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/io/fixtures/readlines.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/fixtures/readlines.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/fixtures/readlines.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+Voici la ligne une.
+Qui è la linea due.
+Aquí está la línea tres.
+Ist hier Linie vier.
+Está aqui a linha cinco.
+Here is line six.

Added: MacRuby/branches/experimental/spec/frozen/core/io/flush_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/flush_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/flush_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#flush" do
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.flush }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/for_fd_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/for_fd_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/for_fd_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/new'
+
+describe "IO.for_fd" do
+  it_behaves_like :io_new, :for_fd
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/foreach_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/foreach_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/foreach_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,112 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "IO::foreach" do
+  before :all do
+    @file = File.dirname(__FILE__) + '/fixtures/readlines.txt'
+    @content = ["Voici la ligne une.\n", "Qui \303\250 la linea due.\n",
+                "Aqu\303\255 est\303\241 la l\303\255nea tres.\n", "Ist hier Linie vier.\n",
+                "Est\303\241 aqui a linha cinco.\n", "Here is line six.\n"]
+    @content_with_r = ["Voici la ligne une.\nQui \303\250 la linea due.\nAqu\303\255 est\303\241 la l\303\255nea tr",
+                     "es.\nIst hier", " Linie vier",
+                     ".\nEst\303\241 aqui a linha cinco.\nHer","e is line six.\n"]
+  end
+  after :all do
+    @file = nil
+    @content = nil
+  end
+
+  it "yields a sequence of Strings that were separated by $/" do
+    lines = []
+    IO::foreach(@file) do |line|
+      lines << line
+    end
+    lines.should == @content
+  end
+
+  it "yields a sequence of Strings that were separated by r" do
+    lines = []
+    IO::foreach(File.dirname(__FILE__) + '/fixtures/readlines.txt','r') do |line|
+      lines << line
+    end
+    lines.should == @content_with_r
+  end
+
+  it "yields a single string with entire content when the separator is nil" do
+    lines = []
+    IO::foreach(@file, nil) do |line|
+      lines << line
+    end
+    lines.should == [@content.join]
+  end
+
+  it "yields a sequence of paragraphs when the separator is an empty string" do
+    lines = []
+    IO::foreach(File.dirname(__FILE__) + '/fixtures/gets.txt', "") do |line|
+      lines << line
+    end
+    lines.should == [
+      "Voici la ligne une.\nQui \303\250 la linea due.\n\n",
+      "Aqu\303\255 est\303\241 la l\303\255nea tres.\nIst hier Linie vier.\n\n",
+      "Est\303\241 aqui a linha cinco.\nHere is line six.\n"]
+  end
+
+  it "updates $. with each yield" do
+    count = 1
+    IO::foreach(@file, nil) do
+      $..should == count
+      count += 1
+    end
+
+    count = 1
+    IO::foreach(@file, "") do
+      $..should == count
+      count += 1
+    end
+
+    count = 1
+    IO::foreach(@file) do
+      $..should == count
+      count += 1
+    end
+
+    count = 1
+    IO::foreach(@file, "la") do
+      $..should == count
+      count += 1
+    end
+  end
+
+  it "can handle non-ASCII data as separator" do
+    lines = []
+    IO::foreach(@file, "\303\250") do |line|
+      lines << line
+    end
+    lines.should == ["Voici la ligne une.\nQui \303\250",
+      " la linea due.\nAqu\303\255 est\303\241 la l\303\255nea tres.\nIst hier Linie vier.\nEst\303\241 aqui a linha cinco.\nHere is line six.\n"]
+  end
+
+  it "raises TypeError if the first parameter is nil" do
+    lambda {
+      IO::foreach(nil) {}
+    }.should raise_error(TypeError)
+  end
+
+  it "converts first parameter to string and uses as file name" do
+    (obj = mock('readlines.txt')).should_receive(:to_str).and_return(@file)
+    lines = []
+    IO::foreach(obj) do |line|
+      lines << line
+    end
+    lines.should == @content
+  end
+
+  it "converts second parameter to string and uses as separator" do
+    (obj = mock('r')).should_receive(:to_str).and_return('r')
+    lines = []
+    IO::foreach(@file, obj) do |line|
+      lines << line
+    end
+    lines.should == @content_with_r
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/io/fsync_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/fsync_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/fsync_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#fsync" do
+   it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.fsync }.should raise_error(IOError)
+  end
+
+  it "writes the buffered data to permanent storage" do
+    ret = ""
+    File.open(tmp("fsync-specs"), "w") do |f|
+      f.write "one hit wonder"
+      lambda { 
+        ret = f.fsync
+      }.should_not raise_error
+    end
+
+    # it returns nil on unsupported systems
+    [0, nil].include?(ret).should == true
+
+    File.unlink(tmp("fsync-specs"))
+  end
+  
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/getc_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/getc_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/getc_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,39 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#getc" do
+  before :each do
+    @file_name = File.dirname(__FILE__) + '/fixtures/readlines.txt'
+    @file = File.open(@file_name, 'r')
+  end
+
+  after :each do
+    @file.close unless @file.closed?
+  end
+
+  it "returns the next byte from the stream" do
+    @file.getc.should == 86
+    @file.getc.should == 111
+    @file.getc.should == 105
+    # read the rest of line
+    @file.readline.should == "ci la ligne une.\n"
+    @file.getc.should == 81
+  end
+
+  it "returns nil when invoked at the end of the stream" do
+    # read entire content
+    @file.read
+    @file.getc.should == nil
+  end
+
+  it "returns nil on empty stream" do
+    File.open(tmp('empty.txt'), "w+") { |empty|
+      empty.getc.should == nil
+    }
+    File.unlink(tmp("empty.txt"))
+  end
+
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.getc }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/gets_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/gets_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/gets_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,191 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#gets" do
+  after :each do
+    File.delete IOSpecs.gets_output if File.exists?(IOSpecs.gets_output)
+  end
+
+  it "returns the next line of string that were separated by $/" do
+    File.open(IOSpecs.gets_fixtures, 'r') do |f|
+      IOSpecs.lines.each {|line| line.should == f.gets}
+    end
+  end
+
+  it "returns tainted strings" do
+    File.open(IOSpecs.gets_fixtures, 'r') do |f|
+      while (line = f.gets(nil))
+        line.tainted?.should == true
+      end
+    end
+
+    File.open(IOSpecs.gets_fixtures, 'r') do |f|
+      while (line = f.gets(""))
+        line.tainted?.should == true
+      end
+    end
+
+    File.open(IOSpecs.gets_fixtures, 'r') do |f|
+      while (line = f.gets)
+        line.tainted?.should == true
+      end
+    end
+
+    File.open(IOSpecs.gets_fixtures, 'r') do |f|
+      while (line = f.gets("la"))
+        line.tainted?.should == true
+      end
+    end
+  end
+
+  it "updates lineno with each invocation" do
+    count = 1
+    File.open(IOSpecs.gets_fixtures, 'r') do |f|
+      while (line = f.gets(nil))
+        f.lineno.should == count
+        count += 1
+      end
+    end
+
+    count = 1
+    File.open(IOSpecs.gets_fixtures, 'r') do |f|
+      while (line = f.gets(""))
+        f.lineno.should == count
+        count += 1
+      end
+    end
+
+    count = 1
+    File.open(IOSpecs.gets_fixtures, 'r') do |f|
+      while (line = f.gets)
+        f.lineno.should == count
+        count += 1
+      end
+    end
+
+    count = 1
+    File.open(IOSpecs.gets_fixtures, 'r') do |f|
+      while (line = f.gets("la"))
+        f.lineno.should == count
+        count += 1
+      end
+    end
+  end
+
+  it "updates $. with each invocation" do
+    count = 1
+    File.open(IOSpecs.gets_fixtures, 'r') do |f|
+      while (line = f.gets(nil))
+        $..should == count
+        count += 1
+      end
+    end
+
+    count = 1
+    File.open(IOSpecs.gets_fixtures, 'r') do |f|
+      while (line = f.gets(""))
+        $..should == count
+        count += 1
+      end
+    end
+
+    count = 1
+    File.open(IOSpecs.gets_fixtures, 'r') do |f|
+      while (line = f.gets)
+        $..should == count
+        count += 1
+      end
+    end
+
+    count = 1
+    File.open(IOSpecs.gets_fixtures, 'r') do |f|
+      while (line = f.gets("la"))
+        $..should == count
+        count += 1
+      end
+    end
+  end
+
+  it "assigns the returned line to $_" do
+    File.open(IOSpecs.gets_fixtures, 'r') do |f|
+      IOSpecs.lines.each do |line|
+        f.gets
+        $_.should == line
+      end
+    end
+  end
+
+  it "returns nil if called at the end of the stream" do
+    File.open(IOSpecs.gets_fixtures, 'r') do |f|
+      IOSpecs.lines.length.times { f.gets }
+      f.gets.should == nil
+    end
+  end
+
+  it "returns the entire content if the separator is nil" do
+    File.open(IOSpecs.gets_fixtures, 'r') do |f|
+      f.gets(nil).should == IOSpecs.lines.join('')
+    end
+  end
+
+  # Two successive newlines in the input separate paragraphs.
+  # When there are more than two successive newlines, only two are kept.
+  it "returns the next paragraph if the separator's length is 0" do
+    a = "Voici la ligne une.\nQui \303\250 la linea due.\n\n"
+    b = "Aqu\303\255 est\303\241 la l\303\255nea tres.\nIst hier Linie vier.\n\n"
+    c = "Est\303\241 aqui a linha cinco.\nHere is line six.\n"
+
+    File.open(IOSpecs.gets_fixtures, 'r') do |f|
+      f.gets("").should == a
+      f.gets("").should == b
+      f.gets("").should == c
+    end
+  end
+
+  # This could probably be added to the previous test using pos, but right now 
+  # this doesn't pass and the previous test does.
+  it "reads until the beginning of the next paragraph when the separator's length is 0" do
+    # Leverage the fact that there are three newlines between the first 
+    # and second paragraph
+    File.open(IOSpecs.gets_fixtures, 'r') do |f|
+      f.gets('')
+
+      # This should return 'A', the first character of the next paragraph, not $/
+      f.read(1).should == 'A'
+    end
+  end
+
+  it "raises an IOError if the stream is not opened for reading" do
+    path = tmp("gets_spec")
+    lambda { File.open(path, 'a') {|f| f.gets} }.should raise_error(IOError)
+    lambda { File.open(path, 'w') {|f| f.gets} }.should raise_error(IOError)
+    File.unlink(path) if File.exist?(path)
+  end
+
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.gets }.should raise_error(IOError)
+  end
+
+  it "fails on cloned opened streams" do
+    f = File.open(tmp("gets_specs"), "w")
+    f.puts("heh")
+    g = IO.new(f.fileno)
+    f.fileno.should == g.fileno
+    lambda { g.gets }.should raise_error(IOError)
+    g.close
+    File.unlink(tmp("gets_specs"))
+  end
+
+  it "accepts a separator" do
+    f = File.open(tmp("gets_specs"), "w")
+    f.print("A\n\n\nB\n")
+    f.close
+    f = File.new(tmp("gets_specs"), "r")
+    f.gets("\n\n")
+    b = f.gets("\n\n")
+    f.gets("\n\n")
+    f.close
+    b.should == "\nB\n"
+    File.unlink(tmp("gets_specs"))
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/initialize_copy_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/initialize_copy_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/initialize_copy_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "IO#initialize_copy" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#initialize" do
+  before :each do
+    @io = IO.allocate
+  end
+
+  it "succeeds when fd is a Fixnum" do
+    lambda { @io.send :initialize, $stdout.fileno, 'w' }.should_not raise_error(TypeError)
+  end
+
+  it "succeeds when fd responds to #to_int" do
+    obj = mock('fileno')
+    def obj.to_int() $stdout.fileno end
+
+    lambda { @io.send :initialize, obj, 'w' }.should_not raise_error(TypeError)
+  end
+
+  it "raises a TypeError when fd is an IO" do
+    lambda { @io.send :initialize, $stdout, 'w' }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError when given a non-integer" do
+    lambda { @io.send :initialize, @fname, 'w' }.should raise_error(TypeError)
+  end
+  
+  it "raises IOError on closed stream" do
+    lambda { @io.send :initialize, IOSpecs.closed_file.fileno }.should raise_error(IOError)
+  end
+
+  it "raises an Errno::EBADF when given an invalid file descriptor" do
+    lambda { @io.send :initialize, -1, 'w' }.should raise_error(Errno::EBADF)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#inspect" do
+  before :each do
+    @file = File.open(tmp("inspect_spec"), "w") 
+  end
+
+  after :each do
+    @file.close
+    File.unlink(tmp("inspect_spec"))
+  end
+
+  it "returns a string describing a stream" do
+    # don't hardcode the tmp path 
+    @file.inspect.should =~ /#<File.*inspect_spec>/
+    IO.new(@file.to_i).inspect.should =~ /<IO:[\w\d]+>/
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/io_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/io_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/io_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "IO" do
+  it "includes File::Constants" do
+    IO.include?(File::Constants).should == true
+  end
+
+  it "for_fd takes two arguments" do
+	IO.method(:for_fd).arity.should == -1
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/ioctl_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/ioctl_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/ioctl_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#ioctl" do
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.ioctl(5, 5) }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/isatty_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/isatty_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/isatty_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/tty'
+
+describe "IO#isatty" do
+  it_behaves_like :io_tty, :isatty
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/lineno_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/lineno_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/lineno_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,84 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#lineno" do
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.lineno }.should raise_error(IOError)
+  end
+
+  it "returns the current line number" do
+    File.open(IOSpecs.gets_fixtures, 'r') do |f|
+      f.lineno.should == 0
+      while (f.gets)
+        f.lineno.should > 0
+      end
+      f.rewind
+      f.lineno.should == 0
+    end
+  end
+end
+
+describe "IO#lineno=" do
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.lineno = 5 }.should raise_error(IOError)
+  end
+
+  it "invokes to_int on non-numeric arguments" do
+    (obj = mock('123')).should_receive(:to_int).and_return(123)
+    File.open(IOSpecs.gets_fixtures, 'r') do |f|
+      f.lineno = obj
+      f.lineno.should == 123
+
+      f.lineno = 1.5
+      f.lineno.should == 1
+
+      f.lineno = 92233.72036854775808
+      f.lineno.should == 92233
+    end
+  end
+
+  it "raises TypeError on nil argument" do
+    File.open(IOSpecs.gets_fixtures, 'r') do |f|
+      lambda { f.lineno = nil }.should raise_error(TypeError)
+    end
+  end
+
+  it "sets the current line number to the given value" do
+    File.open(IOSpecs.gets_fixtures, 'r') do |f|
+      count = 500
+      f.lineno = count - 1
+      while (f.gets)
+        f.lineno.should == count
+        count += 1
+      end
+      f.rewind
+      f.lineno.should == 0
+    end
+  end
+
+  it "does not change $." do
+    orig_value = $.
+    File.open(IOSpecs.gets_fixtures, 'r') do |f|
+      numbers = [-2**30, -2**16, -2**8, -100, -10, -1, 0, 1, 10, 2**8, 2**16, 2**30]
+      numbers.each { |num|
+        f.lineno = num
+        f.lineno.should == num
+        $..should == orig_value
+      }
+    end
+  end
+
+  it "does not change $. until next read" do
+    $. = 0
+    File.open(IOSpecs.gets_fixtures, 'r') do |f|
+      $..should == 0
+      count = 500
+      f.lineno = count - 1
+      $..should == 0
+      while (f.gets)
+        $..should == count
+        count += 1
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/new'
+
+describe "IO.new" do
+  it_behaves_like :io_new, :new
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/open_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/open_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/open_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,70 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/new'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO.open" do
+  it_behaves_like :io_new, :open
+end
+
+describe "IO.open" do
+  before :all do
+    @file_name = File.dirname(__FILE__) + '/fixtures/gets.txt'
+  end
+
+  it "raises IOError on closed stream" do
+    lambda { IO.open(IOSpecs.closed_file.fileno, 'w') }.should raise_error(IOError)
+  end
+
+  it "with a block invokes close on opened IO object when exiting the block" do
+    File.open(@file_name, 'r') do |f|
+      io = IO.open(f.fileno, 'r') do |io|
+        class << io
+          @res = "close was not invoked"
+          alias_method(:close_orig, :close)
+          def close; close_orig; @res = "close was invoked"; end
+          def to_s;  @res; end
+        end
+        io
+      end
+      io.to_s.should == "close was invoked"
+    end
+  end
+
+  it "with a block propagates non-StandardErrors produced by close" do
+    lambda {
+      File.open @file_name do |f|
+        IO.open f.fileno do |io|
+          def io.close
+            raise Exception, "exception out of close"
+          end
+        end
+      end # IO object is closed here
+    }.should raise_error(Exception)
+  end
+
+  it "with a block swallows StandardErrors produced by close" do
+    # This closes the file descriptor twice, the second raises Errno::EBADF
+    lambda {
+      File.open @file_name do |f|
+        IO.open f.fileno do end
+      end
+    }.should_not raise_error
+  end
+
+#  before :all do
+#    @filename = "/tmp/rubinius-spec-io-new-#{$$}.txt"
+#  end
+#
+#  after :all do
+#    File.unlink @filename
+#  end
+#
+#  before :each do
+#    @file = File.open @filename, "w"
+#  end
+#
+#  after :each do
+#    # This should normally NOT be rescued
+#    @file.close unless @file.closed? rescue nil
+#  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/output_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/output_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/output_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#<<" do
+  it "writes an object to the IO stream" do
+     lambda { 
+      $stderr << "Oh noes, an error!"
+    }.should output_to_fd("Oh noes, an error!", $stderr)
+  end
+  
+  it "calls #to_s on the object to print it" do
+     lambda { 
+       $stderr << 1337
+    }.should output_to_fd("1337", $stderr)
+   end
+
+  it "raises an error if the stream is closed" do
+    io = IOSpecs.closed_file
+    lambda { io << "test" }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/pid_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/pid_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/pid_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "IO#pid" do
+  before :each do
+    @file = File.open(File.dirname(__FILE__) + '/fixtures/readlines.txt', 'r')
+    @io = IO.open @file.fileno, 'r'
+  end
+
+  after :each do
+    # we *must* close both in order to not leak descriptors
+    @io.close unless @io.closed?
+    @file.close unless @file.closed? rescue Errno::EBADF
+  end
+
+  it "returns nil for IO not associated with a process" do
+    @io.pid.should == nil
+  end
+
+  it "returns the ID of a process associated with stream" do
+    IO.popen(RUBY_NAME, "r+") { |io|
+      io.pid.should_not == nil
+    }
+  end
+
+  it "raises IOError on closed stream" do
+    process_io = IO.popen(RUBY_NAME, "r+") { |io| io }
+    lambda { process_io.pid }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/pipe_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/pipe_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/pipe_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "IO.pipe" do
+  it "creates a two-ended pipe" do
+    r, w = IO.pipe
+    w.puts "test_create_pipe\\n"
+    w.close
+    r.read(16).should == "test_create_pipe"
+    r.close
+  end
+
+  it "returns two IO objects" do
+    r,w = IO.pipe
+    r.should be_kind_of(IO)
+    w.should be_kind_of(IO)
+  end
+end
+
+

Added: MacRuby/branches/experimental/spec/frozen/core/io/popen_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/popen_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/popen_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,57 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "IO::popen" do
+  # NOTE: cause Errno::EBADF on 1.8.6
+  #ruby_bug "#", "1.8.6" do
+    it "reads from a read-only pipe" do
+      IO.popen("echo foo", "r") do |io|
+        io.read.should == "foo\n"
+
+        lambda { io.write('foo').should }.should \
+          raise_error(IOError, 'not opened for writing')
+      end
+    end
+
+    platform_is_not :windows do
+      it "reads and writes to a read/write pipe" do
+        data = IO.popen("cat", "r+") do |io|
+          io.write("bar")
+          io.read 3
+        end
+
+        data.should == "bar"
+      end
+
+      it "writes to a write-only pipe" do
+        begin
+          tmp_file = tmp "IO_popen_spec_#{$$}"
+
+          data = IO.popen "cat > #{tmp_file}", 'w' do |io|
+            io.write 'bar'
+
+            lambda { io.read.should }.should \
+              raise_error(IOError, 'not opened for reading')
+          end
+
+          File.read(tmp_file).should == 'bar'
+
+        ensure
+          File.unlink tmp_file if File.exist? tmp_file
+        end
+      end
+    end
+
+    it "allows the io to be closed inside the block" do
+      io = IO.popen('yes', 'r') do |io|
+        io.close
+
+        io.closed?.should == true
+
+        io
+      end
+
+      io.closed?.should == true
+    end
+  #end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/io/pos_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/pos_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/pos_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,51 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/pos'
+
+describe "IO#pos" do
+  it_behaves_like(:io_pos, :pos)
+end
+
+describe "IO#pos=" do
+
+  before :each do
+    @fname = 'test.txt'
+    File.open @fname, 'w' do |f| f.write "123" end
+  end
+
+  after :each do
+    File.unlink @fname
+  end
+
+  it "sets the offset" do
+    File.open @fname do |f|
+      val1 = f.read 1
+      f.pos = 0
+      f.read(1).should == val1
+    end
+  end
+
+  it "can handle any numerical argument without breaking" do
+    File.open @fname do |io|
+      io.pos = 1.2
+      io.pos.should == 1
+
+      io.pos = 2**32
+      io.pos.should == 2**32
+
+      io.pos = 1.23423423432e12
+      io.pos.should == Integer(1.23423423432e12)
+
+      io.pos = Float::EPSILON
+      io.pos.should == 0
+
+      lambda { io.pos = 2**128 }.should raise_error(RangeError)
+    end
+  end
+  
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.pos = 0 }.should raise_error(IOError)
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/io/print_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/print_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/print_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,58 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe IO, "#print" do
+  class IOSpecPrint
+    attr_accessor :message
+    def to_s; @message; end
+  end
+
+  before :each do
+    @old_separator = $\
+    $\ = '->'
+  end
+
+  after :each do
+    $\ = @old_separator
+  end
+
+  it "writes $_.to_s followed by $\\ (if any) to the stream if no arguments given" do
+    o = IOSpecPrint.new
+    o.message = 'I know what you did last line!'
+    $_ = o
+    l = lambda { $stdout.print }.should output_to_fd("#{o.message}#{$\}", STDOUT)
+
+    string = File.open(__FILE__) {|f| f.gets }  # Set $_ to something known
+    lambda { $stdout.print }.should output_to_fd("#{string}#{$\}", STDOUT)
+  end
+
+  it "writes obj.to_s followed by $\\ (if any) to the stream when given one object" do
+    o = Object.new
+    def o.to_s(); 'I am an object'; end
+
+    lambda { $stdout.print(o) }.should output("#{o.to_s}#{$\}")
+  end
+
+  it "does not call obj.to_str" do
+    o = Object.new
+    def o.to_str(); 'Haha!'; end
+
+    lambda { $stdout.print(o) }.should output("#{o.to_s}#{$\}")
+  end
+
+  it "writes each obj.to_s to the stream and appends $\\ (if any) given multiple objects" do
+    o, o2 = Object.new, Object.new
+    def o.to_s(); 'o'; end
+    def o2.to_s(); 'o2'; end
+
+    lambda { $stdout.print(o, o2) }.should output("#{o.to_s}#{o2.to_s}#{$\}")
+  end
+
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.print("stuff") }.should raise_error(IOError)
+  end
+end
+
+describe "IO#print" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/printf_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/printf_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/printf_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#printf" do
+  before :each do
+    @io = IO.new STDOUT.fileno, 'w'
+  end
+
+  it "writes the #sprintf formatted string to the file descriptor" do
+    lambda {
+      @io.printf "%s\n", "look ma, no hands"
+    }.should output_to_fd("look ma, no hands\n", @io)
+  end
+
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.printf("stuff") }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/putc_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/putc_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/putc_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,48 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#putc" do
+  before :each do
+    @filename = tmp "IO_putc_file_#{$$}"
+    @io = File.open @filename, 'w'
+    @io.sync = true
+  end
+
+  after :each do
+    @io.close
+    File.unlink @filename
+  end
+
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.putc('a') }.should raise_error(IOError)
+  end
+
+  it "writes the first byte of a String" do
+    @io.putc "foo"
+    File.read(@filename).should == 'f'
+  end
+
+  it "writes the first byte of an object's string representation" do
+    o = Object.new
+    def o.to_int() 261 end # \005
+
+    @io.putc o
+    File.read(@filename).should == "\005"
+  end
+
+  it "writes Numerics that fit in a C char" do
+    @io.putc(-128)
+    @io.putc 0
+    @io.putc 255
+
+    File.read(@filename).should == "\200\000\377"
+  end
+
+  it "write the first byte of Numerics that don't fit in a C char" do
+    @io.putc(-129)
+    @io.putc 256
+
+    File.read(@filename).should == "\177\000"
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/puts_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/puts_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/puts_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,84 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+# TODO: need to find a better way to test this. Too fragile to set expectations
+# to each write call. Only care that all the characters are sent not the number
+# or write calls. Also, these tests do not make sure the ordering of the write calls
+# are correct.
+describe "IO#puts" do
+  before(:each) do
+    @io = IO.new(2, 'w')
+  end
+
+  it "writes just a newline when given no args" do
+    @io.should_receive(:write).with("\n")
+    @io.puts.should == nil
+  end
+
+  it "writes just a newline when given just a newline" do
+    lambda { $stdout.puts "\n" }.should output_to_fd("\n", STDOUT)
+  end
+
+  it "writes nil with a newline when given nil as an arg" do
+    @io.should_receive(:write).with("nil")
+    @io.should_receive(:write).with("\n")
+    @io.puts(nil).should == nil
+  end
+
+  it "calls to_s before writing non-string objects" do
+    object = mock('hola')
+    object.should_receive(:to_s).and_return("hola")
+    
+    @io.should_receive(:write).with("hola")
+    @io.should_receive(:write).with("\n")
+    @io.puts(object).should == nil
+  end
+  
+  it "writes each arg if given several" do
+    @io.should_receive(:write).with("1")
+    @io.should_receive(:write).with("two")
+    @io.should_receive(:write).with("3")
+    @io.should_receive(:write).with("\n").exactly(3).times
+    @io.puts(1, "two", 3).should == nil
+  end
+  
+  it "flattens a nested array before writing it" do
+    @io.should_receive(:write).with("1")
+    @io.should_receive(:write).with("2")
+    @io.should_receive(:write).with("3")
+    @io.should_receive(:write).with("\n").exactly(3).times
+    @io.puts([1, 2, [3]]).should == nil
+  end
+  
+  it "writes [...] for a recursive array arg" do
+    x = []
+    x << 2 << x
+    @io.should_receive(:write).with("2")
+    @io.should_receive(:write).with("[...]")
+    @io.should_receive(:write).with("\n").exactly(2).times
+    @io.puts(x).should == nil
+  end
+  
+  it "writes a newline after objects that do not end in newlines" do
+    @io.should_receive(:write).with("5")
+    @io.should_receive(:write).with("\n")
+    @io.puts(5).should == nil
+  end
+
+  it "does not write a newline after objects that end in newlines" do
+    @io.should_receive(:write).with("5\n")
+    @io.puts("5\n").should == nil
+  end
+  
+  it "ignores the $/ separator global" do
+    $/ = ":"
+    @io.should_receive(:write).with("5")
+    @io.should_receive(:write).with("\n")
+    @io.puts(5).should == nil
+    $/ = "\n"
+  end
+  
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.puts("stuff") }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/read_nonblock_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/read_nonblock_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/read_nonblock_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#read_nonblock" do
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.read_nonblock(5) }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/read_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/read_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/read_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,230 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO.read" do
+  before :each do
+    @fname = "test.txt"
+    @contents = "1234567890"
+    File.open(@fname, "w") { |f| f.write @contents }
+  end
+
+  after :each do
+    File.delete @fname if File.exists? @fname
+  end
+
+  it "reads the contents of a file" do
+    IO.read(@fname).should == @contents
+  end
+
+  it "treats second nil argument as no length limit" do
+    IO.read(@fname, nil).should == @contents
+    IO.read(@fname, nil, 5).should == IO.read(@fname, @contents.length, 5)
+  end
+
+  it "treats third nil argument as 0" do
+    IO.read(@fname, nil, nil).should == @contents
+    IO.read(@fname, 5, nil).should == IO.read(@fname, 5, 0)
+  end
+
+  it "reads the contents of a file up to a certain size when specified" do
+    IO.read(@fname, 5).should == @contents.slice(0..4)
+  end
+
+  it "reads the contents of a file from an offset of a specific size when specified" do
+    IO.read(@fname, 5, 3).should == @contents.slice(3, 5)
+  end
+
+  it "returns nil at end-of-file when length is passed" do
+    IO.read(@fname, 1, 10).should == nil
+  end
+
+  it "raises an Errno::ENOENT when the requested file does not exist" do
+    File.delete(@fname) if File.exists?(@fname)
+    lambda { IO.read @fname }.should raise_error(Errno::ENOENT)
+  end
+
+  it "raises a TypeError when not passed a String type" do
+    lambda { IO.read nil }.should raise_error(TypeError)
+  end
+
+  it "raises an ArgumentError when not passed a valid length" do
+    lambda { IO.read @fname, -1 }.should raise_error(ArgumentError)
+  end
+
+  it "raises an Errno::EINVAL when not passed a valid offset" do
+    lambda { IO.read @fname, 0, -1  }.should raise_error(Errno::EINVAL)
+    lambda { IO.read @fname, -1, -1 }.should raise_error(Errno::EINVAL)
+  end
+end
+
+describe "IO.read on an empty file" do
+  before :each do
+    @fname = 'empty_test.txt'
+    File.open(@fname, 'w') {|f| 1 }
+  end
+
+  after :each do
+    File.delete @fname  if File.exists? @fname
+  end
+
+  it "returns nil when length is passed" do
+    IO.read(@fname, 1).should == nil
+  end
+
+  it "returns an empty string when no length is passed" do
+    IO.read(@fname).should == ""
+  end
+end
+
+describe "IO#read" do
+
+  before :each do
+    @fname = "test.txt"
+    @contents = "1234567890"
+    open @fname, "w" do |io| io.write @contents end
+
+    @io = open @fname, "r+"
+  end
+
+  after :each do
+    @io.close
+    File.delete(@fname) if File.exists?(@fname)
+  end
+
+  it "can be read from consecutively" do
+    @io.read(1).should == '1'
+    @io.read(2).should == '23'
+    @io.read(3).should == '456'
+    @io.read(4).should == '7890'
+  end
+
+  it "can read lots of data" do
+    data = "\xaa" * (8096 * 2 + 1024) # HACK IO::BufferSize
+
+    File.open @fname, 'w' do |io| io.write data end
+
+    actual = nil
+
+    File.open @fname, 'r' do |io|
+      actual = io.read
+    end
+
+    actual.length.should == data.length
+    actual.split('').all? { |c| c == "\xaa" }.should == true
+  end
+
+  it "can read lots of data with length" do
+    read_length = 8096 * 2 + 1024 # HACK IO::BufferSize
+    data = "\xaa" * (read_length + 8096) # HACK same
+
+    File.open @fname, 'w' do |io| io.write data end
+
+    actual = nil
+
+    File.open @fname, 'r' do |io|
+      actual = io.read read_length
+    end
+
+    actual.length.should == read_length
+    actual.split('').all? { |c| c == "\xaa" }.should == true
+  end
+
+  it "consumes zero bytes when reading zero bytes" do
+    pre_pos = @io.pos
+
+    @io.read(0).should == ''
+
+    @io.getc.chr.should == '1'
+  end
+
+  it "is at end-of-file when everything has been read" do
+    @io.read
+    @io.eof?.should == true
+  end
+
+  it "reads the contents of a file" do
+    @io.read.should == @contents
+  end
+
+  it "places the specified number of bytes in the buffer" do
+    buf = ""
+    @io.read 5, buf
+
+    buf.should == "12345"
+  end
+
+  it "expands the buffer when too small" do
+    buf = "ABCDE"
+    @io.read nil, buf
+
+    buf.should == @contents
+  end
+
+  it "overwrites the buffer" do
+    buf = "ABCDEFGHIJ"
+    @io.read nil, buf
+
+    buf.should == @contents
+  end
+
+  it "truncates the buffer when too big" do
+    buf = "ABCDEFGHIJKLMNO"
+    @io.read nil, buf
+    buf.should == @contents
+
+    @io.rewind
+
+    buf = "ABCDEFGHIJKLMNO"
+    @io.read 5, buf
+    buf.should == @contents[0..4]
+  end
+
+  it "returns the given buffer" do
+    buf = ""
+
+    @io.read(nil, buf).object_id.should == buf.object_id
+  end
+
+  it "coerces the second argument to string and uses it as a buffer" do
+    buf = "ABCDE"
+    obj = mock("buff")
+    obj.should_receive(:to_str).any_number_of_times.and_return(buf)
+
+    @io.read(15, obj).object_id.should_not == obj.object_id
+    buf.should == @contents
+  end
+
+  it "returns an empty string at end-of-file" do
+    @io.read
+    @io.read.should == ''
+  end
+
+  it "reads the contents of a file when more bytes are specified" do
+    @io.read(@contents.length + 1).should == @contents
+  end
+
+  it "returns an empty string at end-of-file" do
+    @io.read
+    @io.read.should == ''
+  end
+
+  it "returns an empty string when the current pos is bigger than the content size" do
+    @io.pos = 1000
+    @io.read.should == ''
+  end
+
+  it "returns nil at end-of-file with a length" do
+    @io.read
+    @io.read(1).should == nil
+  end
+
+  it "with length argument returns nil when the current pos is bigger than the content size" do
+    @io.pos = 1000
+    @io.read(1).should == nil
+  end
+
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.read }.should raise_error(IOError)
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/io/readchar_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/readchar_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/readchar_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,46 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#readchar" do
+  before :each do
+    @file_name = File.dirname(__FILE__) + '/fixtures/readlines.txt'
+    @file = File.open(@file_name, 'r')
+  end
+
+  after :each do
+    @file.close unless @file.closed?
+  end
+
+  it "returns the next byte from the stream" do
+    @file.readchar.should == 86
+    @file.readchar.should == 111
+    @file.readchar.should == 105
+    # read the rest of line
+    @file.readline.should == "ci la ligne une.\n"
+    @file.readchar.should == 81
+  end
+
+  it "raises EOFError when invoked at the end of the stream" do
+    # read entire content
+    @file.read
+    lambda { @file.readchar }.should raise_error(EOFError)
+  end
+
+  it "raises EOFError when reaches the end of the stream" do
+    lambda { loop { @file.readchar } }.should raise_error(EOFError)
+  end
+
+  it "raises EOFError on empty stream" do
+    File.open(tmp('empty.txt'), "w+") { |empty|
+      lambda {
+        empty.readchar
+      }.should raise_error(EOFError)
+    }
+
+    File.unlink(tmp("empty.txt"))
+  end
+  
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.readchar }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/readline_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/readline_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/readline_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,42 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#readline" do
+
+  it "returns the next line on the stream" do
+    testfile = File.dirname(__FILE__) + '/fixtures/gets.txt'
+    f = File.open(testfile, 'r') do |f|
+      f.readline.should == "Voici la ligne une.\n"
+      f.readline.should == "Qui è la linea due.\n"
+    end
+  end
+
+  it "goes back to first position after a rewind" do
+    testfile = File.dirname(__FILE__) + '/fixtures/gets.txt'
+    f = File.open(testfile, 'r') do |f|
+      f.readline.should == "Voici la ligne une.\n"
+      f.rewind
+      f.readline.should == "Voici la ligne une.\n"
+    end
+  end
+
+  it "is modified by the cursor position" do
+    testfile = File.dirname(__FILE__) + '/fixtures/gets.txt'
+    f = File.open(testfile, 'r') do |f|
+      f.seek(1)
+      f.readline.should == "oici la ligne une.\n"
+    end
+  end
+
+  it "raises EOFError on end of stream" do
+    testfile = File.dirname(__FILE__) + '/fixtures/gets.txt'
+    File.open(testfile, 'r') do |f|
+      lambda { loop { f.readline } }.should raise_error(EOFError)
+    end
+
+  end
+
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.readline }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/readlines_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/readlines_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/readlines_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,200 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#readlines when passed no arguments" do
+  before(:each) do
+    @io = File.open(File.dirname(__FILE__) + '/fixtures/readlines.txt')
+  end
+  
+  after(:each) do
+    @io.close
+  end
+
+  it "returns an Array containing lines based on $/" do
+    begin
+      old_sep, $/ = $/, " "
+      @io.readlines.should == ["Voici ", "la ", "ligne ", "une.\nQui ", "\303\250 ",
+        "la ", "linea ", "due.\nAqu\303\255 ", "est\303\241 ", "la ", "l\303\255nea ",
+        "tres.\nIst ", "hier ", "Linie ", "vier.\nEst\303\241 ", "aqui ", "a ",
+        "linha ", "cinco.\nHere ", "is ", "line ", "six.\n"]
+    ensure
+      $/ = old_sep
+    end
+  end
+
+  it "updates self's position" do
+    @io.readlines
+    @io.pos.should eql(134)
+  end
+  
+  it "updates self's lineno based on the number of lines read" do
+    @io.readlines
+    @io.lineno.should eql(6)
+  end
+
+  it "does not change $_" do
+    $_ = "test"
+    @io.readlines(">")
+    $_.should == "test"
+  end
+
+  it "returns an empty Array when self is at the end" do
+    @io.pos = 134
+    @io.readlines.should == []
+  end
+end
+
+describe "IO#readlines when passed [separator]" do
+  before(:each) do
+    @io = File.open(File.dirname(__FILE__) + '/fixtures/readlines.txt')
+  end
+  
+  after(:each) do
+    @io.close
+  end
+  
+  it "returns an Array containing lines based on the passed separator" do
+    @io.readlines('r').should == [
+      "Voici la ligne une.\nQui \303\250 la linea due.\nAqu\303\255 est\303\241 la l\303\255nea tr",
+      "es.\nIst hier",
+      " Linie vier",
+      ".\nEst\303\241 aqui a linha cinco.\nHer",
+      "e is line six.\n"]
+  end
+
+  it "returns an empty Array when self is at the end" do
+    @io.pos = 134
+    @io.readlines.should == []
+  end
+
+  it "updates self's lineno based on the number of lines read" do
+    @io.readlines('r')
+    @io.lineno.should eql(5)
+  end
+
+  it "updates self's position based on the number of characters read" do
+    @io.readlines("r")
+    @io.pos.should eql(134)
+  end
+
+  it "does not change $_" do
+    $_ = "test"
+    @io.readlines("r")
+    $_.should == "test"
+  end
+
+  it "returns an Array containing all paragraphs when the passed separator is an empty String" do
+    File.open(File.dirname(__FILE__) + '/fixtures/paragraphs.txt') do |io|
+      io.readlines("").should == ["This is\n\n", "an example\n\n", "of paragraphs."]
+    end
+  end
+
+  it "returns the remaining content as one line starting at the current position when passed nil" do
+    @io.pos = 5
+    @io.readlines(nil).should == [" la ligne une.\nQui \303\250 la linea due.\n" + 
+      "Aqu\303\255 est\303\241 la l\303\255nea tres.\n" +
+      "Ist hier Linie vier.\nEst\303\241 aqui a linha cinco.\nHere is line six.\n"]
+  end
+  
+  it "tries to convert the passed separator to a String using #to_str" do
+    obj = mock('to_str')
+    obj.stub!(:to_str).and_return("r")
+    @io.readlines(obj).should == [
+      "Voici la ligne une.\nQui \303\250 la linea due.\nAqu\303\255 est\303\241 la l\303\255nea tr",
+      "es.\nIst hier",
+      " Linie vier",
+      ".\nEst\303\241 aqui a linha cinco.\nHer",
+      "e is line six.\n"]
+  end
+end
+
+describe "IO#readlines when in write-only mode" do
+  it "raises an IOError" do
+    path = tmp("write_only_specs")
+    File.open(path, 'a') do |io|
+      lambda { io.readlines }.should raise_error(IOError)
+    end
+
+    File.open(path) do |io|
+      io.close_read
+      lambda { io.readlines }.should raise_error(IOError)
+    end
+    File.unlink(path) if File.exists?(path)
+  end
+end
+
+describe "IO.readlines when passed [file_name]" do
+  before(:each) do
+    @file = File.dirname(__FILE__) + '/fixtures/readlines.txt'
+  end
+
+  it "returns an Array containing lines of file_name based on $/" do
+    begin
+      old_sep, $/ = $/, " "
+      IO.readlines(@file).should == ["Voici ", "la ", "ligne ", "une.\nQui ", "\303\250 ",
+        "la ", "linea ", "due.\nAqu\303\255 ", "est\303\241 ", "la ", "l\303\255nea ",
+        "tres.\nIst ", "hier ", "Linie ", "vier.\nEst\303\241 ", "aqui ", "a ",
+        "linha ", "cinco.\nHere ", "is ", "line ", "six.\n"]
+    ensure
+      $/ = old_sep
+    end
+  end
+
+  it "raises an Errno::ENOENT error when the passed file_name does not exist" do
+    non_existing_file = File.dirname(__FILE__) + '/fixtures/should_not_exist.txt'
+    lambda { IO.readlines(non_existing_file) }.should raise_error(Errno::ENOENT)
+  end
+
+  it "does not change $_" do
+    $_ = "test"
+    IO.readlines(@file)
+    $_.should == "test"
+  end
+
+  it "tries to convert the passed file_name to a String using #to_str" do
+    obj = mock('to_str')
+    obj.stub!(:to_str).and_return(@file)
+    IO.readlines(obj).should == ["Voici la ligne une.\n",
+      "Qui \303\250 la linea due.\n",
+      "Aqu\303\255 est\303\241 la l\303\255nea tres.\n",
+      "Ist hier Linie vier.\n", "Est\303\241 aqui a linha cinco.\n",
+      "Here is line six.\n"]
+  end
+end
+
+describe "IO#readlines when passed [file_name, separator]" do
+  before(:each) do
+    @file = File.dirname(__FILE__) + '/fixtures/readlines.txt'
+  end
+  
+  it "returns an Array containing lines of file_name based on the passed separator" do
+    IO.readlines(@file, 'r').should == [
+      "Voici la ligne une.\nQui \303\250 la linea due.\nAqu\303\255 est\303\241 la l\303\255nea tr",
+      "es.\nIst hier",
+      " Linie vier",
+      ".\nEst\303\241 aqui a linha cinco.\nHer",
+      "e is line six.\n"]
+  end
+
+  it "does not change $_" do
+    $_ = "test"
+    IO.readlines(@file, 'r')
+    $_.should == "test"
+  end
+
+  it "returns an Array containing all paragraphs when the passed separator is an empty String" do
+    para_file = File.dirname(__FILE__) + '/fixtures/paragraphs.txt'
+    IO.readlines(para_file, "").should == ["This is\n\n", "an example\n\n", "of paragraphs."]
+  end
+  
+  it "tries to convert the passed separator to a String using #to_str" do
+    obj = mock('to_str')
+    obj.stub!(:to_str).and_return("r")
+    IO.readlines(@file, obj).should == [
+      "Voici la ligne une.\nQui \303\250 la linea due.\nAqu\303\255 est\303\241 la l\303\255nea tr",
+      "es.\nIst hier",
+      " Linie vier",
+      ".\nEst\303\241 aqui a linha cinco.\nHer",
+      "e is line six.\n"]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/readpartial_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/readpartial_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/readpartial_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,85 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#readpartial" do
+  before :each do
+    @rd, @wr = IO.pipe
+  end
+
+  after :each do
+    @rd.close unless @rd.closed?
+    @wr.close unless @wr.closed?
+  end
+
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.readpartial(10) }.should raise_error(IOError)
+
+    @rd.close
+    lambda { @rd.readpartial(10) }.should raise_error(IOError)
+  end
+
+  it "reads at most the specified number of bytes" do
+    @wr.write("foobar")
+
+    # buffered read
+    @rd.read(1).should == 'f'
+    # return only specified number, not the whole buffer
+    @rd.readpartial(1).should == "o"
+  end
+
+  it "reads after ungetc with data in the buffer" do
+    @wr.write("foobar")
+    c = @rd.getc
+    @rd.ungetc(c)
+    @rd.readpartial(3).should == "foo"
+    @rd.readpartial(3).should == "bar"
+  end
+
+  it "reads after ungetc without data in the buffer" do
+    @wr.write("f")
+    c = @rd.getc
+    @rd.ungetc(c)
+    @rd.readpartial(2).should == "f"
+
+    # now, also check that the ungot char is cleared and
+    # not returned again
+    @wr.write("b")
+    @rd.readpartial(2).should == "b"
+  end
+
+  it "discards the existing buffer content upon successful read" do
+    buffer = "existing"
+    @wr.write("hello world")
+    @wr.close
+    @rd.readpartial(11, buffer)
+    buffer.should == "hello world"
+  end
+
+  it "raises EOFError on EOF" do
+    @wr.write("abc")
+    @wr.close
+    @rd.readpartial(10).should == 'abc'
+    lambda { @rd.readpartial(10) }.should raise_error(EOFError)
+  end
+
+  it "discards the existing buffer content upon error" do
+    buffer = 'hello'
+    @wr.close
+    lambda { @rd.readpartial(1, buffer) }.should raise_error(EOFError)
+    buffer.should be_empty
+  end
+
+  it "raises IOError if the stream is closed" do
+    @wr.close
+    lambda { @rd.readpartial(1) }.should raise_error(IOError)
+  end
+
+  it "raises ArgumentError if the negative argument is provided" do
+    lambda { @rd.readpartial(-1) }.should raise_error(ArgumentError)
+  end
+
+  it "immediately returns an empty string if the length argument is 0" do
+    @rd.readpartial(0).should == ""
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/reopen_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/reopen_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/reopen_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,116 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#reopen" do
+  before :each do
+    # for reading
+    @name1 = IOSpecs.gets_fixtures
+    @name2 = File.dirname(__FILE__) + '/fixtures/numbered_lines.txt'
+    @file1 = File.new(@name1)
+    @file2 = File.new(@name2)
+
+    # for writing
+    @name1_w = tmp("IO_reopen_file1") + $$.to_s
+    @name2_w = tmp("IO_reopen_file2") + $$.to_s
+    @file1_w = File.new(@name1_w, "w+")
+    @file2_w = File.new(@name2_w, "w+")
+  end
+
+  after :each do
+    @file1.close unless @file1.closed?
+    @file2.close unless @file2.closed?
+    @file1_w.close unless @file1_w.closed?
+    @file2_w.close unless @file2_w.closed?
+    File.delete(@name1_w)
+    File.delete(@name2_w)
+  end
+
+  it "raises IOError on closed stream" do
+    File.open(File.dirname(__FILE__) + '/fixtures/gets.txt', 'r') { |f|
+      lambda { f.reopen(IOSpecs.closed_file) }.should raise_error(IOError)
+    }
+  end
+
+  it "reassociates self to another file/descriptor but returns self" do
+    @file1.reopen(@file2).should == @file1
+    @file2.reopen(@file1).should == @file2
+    @file1.reopen(@name2).should == @file1
+    @file2.reopen(@name2).should == @file2
+  end
+  
+  it "reassociates self with a new stream opened on path, when self in initial state" do
+    @file1.reopen(@name2)
+    @file1.gets.should == "Line 1: One\n"
+  end
+
+  it "reassociates self with a new stream opened on path, after some reads" do
+    # reade some first
+    4.times {@file1.gets; @file2.gets}
+
+    @file1.reopen(@name2)
+    @file1.gets.should == "Line 1: One\n"
+  end
+
+  it "reassociates self with a new stream opened on path, after some writes" do
+    @file1_w.puts("line1-F1")
+    @file2_w.puts("line1-F2")
+    @file2_w.reopen(@name1_w)
+    @file1_w.puts("line2-F1")
+    @file2_w.puts("line2-F2")
+    @file1_w.close
+    @file2_w.close
+    File.readlines(@name1_w).should == ["line2-F2\n", "line2-F1\n"]
+    File.readlines(@name2_w).should == ["line1-F2\n"]
+  end
+
+  # JRUBY-2071: File#reopen blows with IllegalArgumentException in some cases
+  it "reassociates self with the I/O stream specified as an argument, after some reads" do
+    length = 12 # length of first lines in numbered_lines.txt
+
+    # read some first
+    @file1.gets
+    @file2.gets
+
+    pos = @file2.pos
+    @file1.reopen(@file2)
+    @file1.pos.should == pos
+
+    # MRI behavior: after reopen the buffers are not corrected,
+    # so we need the following line, or next gets wourd return nil.
+    @file1.pos = pos
+
+    @file1.gets.should == "Line 2: Two\n"
+  end
+
+  platform_is_not :darwin, :freebsd do
+    it "reassociates self with the I/O stream specified as an argument, after some sysreads" do
+      length = 12 # length of first lines in numbered_lines.txt
+
+      # reade some first
+      @file1.sysread(length)
+      @file2.sysread(length)
+
+      @file1.reopen(@file2)
+      @file1.sysread(length).should == "Line 2: Two\n"
+    end
+  end
+
+  it "reassociates self with the I/O stream specified as an argument, after some writes" do
+    @file1_w.puts("line1-F1")
+    @file2_w.puts("line1-F2")
+    @file2_w.reopen(@file1_w)
+    @file1_w.puts("line2-F1")
+    @file2_w.puts("line2-F2")
+    @file1_w.close
+    @file2_w.close
+    File.readlines(@name1_w).should == ["line1-F1\n", "line2-F1\n", "line2-F2\n"]
+    File.readlines(@name2_w).should == ["line1-F2\n"]
+  end
+
+  it "reassociates self with new a new stream after some reads" do
+    @file1.reopen(@file2)
+    @file1.gets
+    @file1.gets
+    @file1.reopen(@file2).gets.should == "Line 1: One\n"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/rewind_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/rewind_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/rewind_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,40 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#rewind" do
+  before :each do
+    @file = File.open(File.dirname(__FILE__) + '/fixtures/readlines.txt', 'r')
+    @io = IO.open @file.fileno, 'r'
+  end
+
+  after :each do
+    # we *must* close both in order to not leak descriptors
+    @io.close unless @io.closed?
+    @file.close unless @file.closed? rescue Errno::EBADF
+  end
+
+  it "positions the instance to the beginning of input" do
+    @io.readline.should == "Voici la ligne une.\n"
+    @io.readline.should == "Qui è la linea due.\n"
+    @io.rewind
+    @io.readline.should == "Voici la ligne une.\n"
+  end
+
+  it "positions the instance to the beginning of input and clears EOF" do
+    value = @io.read
+    @io.rewind
+    @io.eof?.should == false
+    value.should == @io.read
+  end
+
+  it "sets lineno to 0" do
+    @io.readline.should == "Voici la ligne une.\n"
+    @io.lineno.should == 1
+    @io.rewind
+    @io.lineno.should == 0
+  end
+
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.rewind }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/seek_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/seek_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/seek_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,73 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#seek" do
+  before :each do
+    @file = File.open(File.dirname(__FILE__) + '/fixtures/readlines.txt', 'r')
+    @io = IO.open @file.fileno, 'r'
+  end
+
+  after :each do
+    # we *must* close both in order to not leak descriptors
+    @io.close unless @io.closed?
+    @file.close unless @file.closed? rescue Errno::EBADF
+  end
+
+  it "moves the read position relative to the current position with SEEK_CUR" do
+    lambda { @io.seek(-1) }.should raise_error(Errno::EINVAL)
+    @io.seek(10, IO::SEEK_CUR)
+    @io.readline.should == "igne une.\n"
+    @io.seek(-5, IO::SEEK_CUR)
+    @io.readline.should == "une.\n"
+  end
+
+  it "moves the read position relative to the start with SEEK_SET" do
+    @io.seek(1)
+    @io.pos.should == 1
+    @io.rewind
+    @io.seek(42, IO::SEEK_SET)
+    @io.readline.should == "quí está la línea tres.\n"
+    @io.seek(5, IO::SEEK_SET)
+    @io.readline.should == " la ligne une.\n"
+  end
+
+  it "moves the read position relative to the end with SEEK_END" do
+    @io.seek(0, IO::SEEK_END)
+    @io.tell.should == 134
+    @io.seek(-25, IO::SEEK_END)
+    @io.readline.should == "cinco.\n"
+  end
+
+  it "can handle any numerical argument without breaking" do
+    @io.seek(1.2).should == 0
+    @io.seek(2**32).should == 0
+    @io.seek(1.23423423432e12).should == 0
+    @io.seek(0.00000000000000000000001).should == 0
+    lambda { @io.seek(2**128) }.should raise_error(RangeError)
+  end
+
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.seek(0) }.should raise_error(IOError)
+  end
+
+  it "moves the read position and clears EOF with SEEK_SET" do
+    value = @io.read
+    @io.seek(0, IO::SEEK_SET)
+    @io.eof?.should == false
+    value.should == @io.read
+  end
+
+  it "moves the read position and clears EOF with SEEK_CUR" do
+    value = @io.read
+    @io.seek(-1, IO::SEEK_CUR)
+    @io.eof?.should == false
+    value[-1].should == @io.read[0]
+  end
+
+  it "moves the read position and clears EOF with SEEK_END" do
+    value = @io.read
+    @io.seek(-1, IO::SEEK_END)
+    @io.eof?.should == false
+    value[-1].should == @io.read[0]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/select_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/select_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/select_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,87 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "IO.select" do
+  before :each do
+    @rd, @wr = IO.pipe
+  end
+
+  after :each do
+    @rd.close unless @rd.closed?
+    @wr.close unless @wr.closed?
+  end
+
+  it "blocks for duration of timeout if there are no objects ready for I/O" do
+    timeout = 0.5
+    start = Time.now
+    IO.select [@rd], nil, nil, timeout
+    (Time.now - start).should be_close(timeout, 0.5)
+  end
+
+  it "returns immediately all objects that are ready for I/O when timeout is 0" do
+    @wr.write("be ready")
+    result = IO.select [@rd], [@wr], nil, 0
+    result.should == [[@rd], [@wr], []]
+  end
+
+  it "returns nil after timeout if there are no objects ready for I/O" do
+    result = IO.select [@rd], nil, nil, 0
+    result.should == nil
+  end
+
+  it "returns supplied objects when they are ready for I/O" do
+    Thread.new { sleep 0.5; @wr.write "be ready" }
+    result = IO.select [@rd], nil, nil, nil
+    result.should == [[@rd], [], []]
+  end
+
+  it "returns supplied objects correctly even when monitoring the same object in different arrays" do
+    filename = tmp("IO_select_pipe_file") + $$.to_s
+    io = File.open(filename, 'w+')
+    result = IO.select [io], [io], nil, 0
+    result.should == [[io], [io], []]
+    io.close
+    File.delete(filename)
+  end
+
+  it "invokes to_io on supplied objects that are not IO" do
+    # make some data available
+    @wr.write("foobar")
+
+    obj = mock("read_io")
+    obj.should_receive(:to_io).at_least(1).and_return(@rd)
+    IO.select([obj]).should == [[obj], [], []]
+
+    obj = mock("write_io")
+    obj.should_receive(:to_io).at_least(1).and_return(@wr)
+    IO.select(nil, [obj]).should == [[], [obj], []]
+  end
+
+  it "raises TypeError if supplied objects are not IO" do
+    lambda { IO.select([Object.new]) }.should raise_error(TypeError)
+    lambda { IO.select(nil, [Object.new]) }.should raise_error(TypeError)
+
+    obj = mock("io")
+    obj.should_receive(:to_io).any_number_of_times.and_return(nil)
+
+    lambda { IO.select([obj]) }.should raise_error(TypeError)
+    lambda { IO.select(nil, [obj]) }.should raise_error(TypeError)
+  end
+
+  it "raises TypeError if the specified timeout value is not Numeric" do
+    lambda { IO.select([@rd], nil, nil, Object.new) }.should raise_error(TypeError)
+  end
+
+  it "raises TypeError if the first three arguments are not Arrays" do
+    lambda { IO.select(Object.new)}.should raise_error(TypeError)
+    lambda { IO.select(nil, Object.new)}.should raise_error(TypeError)
+    lambda { IO.select(nil, nil, Object.new)}.should raise_error(TypeError)
+  end
+
+  it "does not raise errors if the first three arguments are nil" do
+    lambda { IO.select(nil, nil, nil, 0)}.should_not raise_error
+  end
+
+  it "does not accept negative timeouts" do
+    lambda { IO.select(nil, nil, nil, -5)}.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/shared/each.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/shared/each.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/shared/each.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,143 @@
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe :io_each, :shared => true do
+  before(:each) do
+    @io = File.open(IOSpecs.gets_fixtures)
+  end
+  
+  after(:each) do
+    @io.close
+  end
+  
+  it "yields each line to the passed block" do
+    seen = []
+    @io.send(@method) {|s| seen << s }
+    seen.should == ["Voici la ligne une.\n",
+      "Qui \303\250 la linea due.\n",
+      "\n",
+      "\n", "Aqu\303\255 est\303\241 la l\303\255nea tres.\n",
+      "Ist hier Linie vier.\n",
+      "\n",
+      "Est\303\241 aqui a linha cinco.\n",
+      "Here is line six.\n"]
+  end
+  
+  it "yields each line starting from the current position" do
+    seen = []
+    @io.pos = 40
+    @io.send(@method) {|s| seen << s }
+    seen.should == ["\n", "\n", "\n", "Aqu\303\255 est\303\241 la l\303\255nea tres.\n", "Ist hier Linie vier.\n", "\n", "Est\303\241 aqui a linha cinco.\n", "Here is line six.\n"]
+  end
+
+  it "does not change $_" do
+    $_ = "test"
+    @io.send(@method) { |s| s}
+    $_.should == "test"
+  end
+
+  it "uses $/ as the default line separator" do
+    seen = []
+    begin
+      old_rs, $/ = $/, " "
+      @io.send(@method) {|s| seen << s }
+      seen.should == ["Voici ", "la ", "ligne ", "une.\nQui ", "\303\250 ",
+        "la ", "linea ", "due.\n\n\nAqu\303\255 ", "est\303\241 ", "la ",
+        "l\303\255nea ", "tres.\nIst ", "hier ", "Linie ", "vier.\n\nEst\303\241 ",
+        "aqui ", "a ", "linha ", "cinco.\nHere ", "is ", "line ", "six.\n"]
+    ensure
+      $/ = old_rs
+    end
+  end
+
+  it "returns self" do
+    @io.send(@method) {|l| l }.should equal(@io)
+  end
+  
+  it "raises an IOError when self is not readable" do
+    # method must have a block in order to raise the IOError.
+    # MRI 1.8.7 returns enumerator if block is not provided.
+    # See [ruby-core:16557].
+    lambda { IOSpecs.closed_file.send(@method){} }.should raise_error(IOError)
+  end
+
+  ruby_version_is "" ... "1.8.7" do
+    it "yields a LocalJumpError when passed no block" do
+      lambda { @io.send(@method) }.should raise_error(LocalJumpError)
+    end
+  end
+
+  ruby_version_is "1.8.7" do
+    it "returns an Enumerator when passed no block" do
+      enum = @io.send(@method)
+      enum.instance_of?(Enumerable::Enumerator).should be_true
+      
+      seen = []
+      enum.each { |b| seen << b }
+      seen.should == ["Voici la ligne une.\n",
+        "Qui \303\250 la linea due.\n",
+        "\n",
+        "\n", "Aqu\303\255 est\303\241 la l\303\255nea tres.\n",
+        "Ist hier Linie vier.\n",
+        "\n",
+        "Est\303\241 aqui a linha cinco.\n",
+        "Here is line six.\n"]
+    end
+  end
+end
+
+describe :io_each_separator, :shared => true do
+  before(:each) do
+    @io = File.open(IOSpecs.gets_fixtures)
+  end
+  
+  after(:each) do
+    @io.close
+  end
+
+  it "uses the passed argument as the line separator" do
+    seen = []
+    @io.send(@method, " ") {|s| seen << s}
+    seen.should == ["Voici ", "la ", "ligne ", "une.\nQui ", "\303\250 ", "la ",
+      "linea ", "due.\n\n\nAqu\303\255 ", "est\303\241 ", "la ", "l\303\255nea ",
+      "tres.\nIst ", "hier ", "Linie ", "vier.\n\nEst\303\241 ", "aqui ", "a ",
+      "linha ", "cinco.\nHere ", "is ", "line ", "six.\n"]
+  end
+  
+  it "does not change $_" do
+    $_ = "test"
+    @io.send(@method, " ") { |s| s}
+    $_.should == "test"
+  end
+
+  it "returns self" do
+    @io.send(@method) {|l| l }.should equal(@io)
+  end
+
+  it "tries to convert the passed separator to a String using #to_str" do
+    obj = mock("to_str")
+    obj.stub!(:to_str).and_return(" ")
+    
+    seen = []
+    @io.send(@method, obj) { |l| seen << l }
+    seen.should == ["Voici ", "la ", "ligne ", "une.\nQui ", "\303\250 ", "la ",
+      "linea ", "due.\n\n\nAqu\303\255 ", "est\303\241 ", "la ", "l\303\255nea ",
+      "tres.\nIst ", "hier ", "Linie ", "vier.\n\nEst\303\241 ", "aqui ", "a ",
+      "linha ", "cinco.\nHere ", "is ", "line ", "six.\n"]
+  end
+
+  it "yields self's content starting from the current position when the passed separator is nil" do
+    seen = []
+    @io.pos = 100
+    @io.send(@method, nil) {|s| seen << s}
+    seen.should == ["qui a linha cinco.\nHere is line six.\n"]
+  end
+  
+  it "yields each paragraph when passed an empty String as separator" do
+    seen = []
+    para_file = File.dirname(__FILE__) + '/../fixtures/paragraphs.txt'
+    File.open(para_file) do |io|
+      io.send(@method, "") {|s| seen << s}
+    end
+    seen.should == ["This is\n\n", "an example\n\n", "of paragraphs."]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/shared/new.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/shared/new.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/shared/new.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,112 @@
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe :io_new, :shared => true do
+  before :all do
+    @filename = tmp("rubinius-spec-io-new-#{$$}.txt")
+  end
+
+  after :all do
+    File.unlink @filename
+  end
+
+  before :each do
+    @file = File.open @filename, "w"
+  end
+
+  after :each do
+    @file.close unless @file.closed? rescue Errno::EBADF
+  end
+
+  it "returns a new IO object" do
+    begin
+      io = IO.send(@method, @file.fileno, 'w')
+    ensure
+      io.close
+    end
+    io.class.should == IO
+  end
+
+  it "takes an Integer or #to_int argument as the descriptor to open" do
+    o = mock('descriptor')
+    o.should_receive(:to_int).any_number_of_times.and_return(@file.fileno)
+
+    begin
+      io = IO.send(@method, @file.fileno, 'w')
+      io.fileno.should == @file.fileno
+
+      io2 = IO.send(@method, o, 'w')
+      io2.fileno.should == @file.fileno
+    ensure
+      io.close unless io.closed? rescue Errno::EBADF
+      io2.close unless io2.closed? rescue Errno::EBADF
+    end
+  end
+
+  it "associates new IO with the old descriptor so each IO directly affects the other" do
+    io = IO.send @method, @file.fileno, 'w'
+
+    @file.syswrite "Hello "
+    @file.closed?.should == false
+
+    io.close
+    io.closed?.should == true
+
+    # Using #syswrite to force no Ruby buffering which could mask this error
+    lambda { @file.syswrite "there\n" }.should raise_error(Errno::EBADF)
+  end
+
+  it "raises TypeError if not given an Integer or #to_int" do
+    lambda { IO.send(@method, nil, 'r') }.should raise_error(TypeError)
+    lambda { IO.send(@method, Object.new, 'r') }.should raise_error(TypeError)
+  end
+
+  it "raises EBADF if the file descriptor given is not a valid and open one" do
+    lambda { IO.send(@method, -2, 'r') }.should raise_error(Errno::EBADF)
+
+    fd = @file.fileno
+    @file.close
+    lambda { IO.send(@method, fd, 'w') }.should raise_error(Errno::EBADF)
+  end
+
+  it "raises EINVAL if mode is not compatible with the descriptor's current mode" do
+    lambda { IO.send(@method, @file.fileno, 'r') }.should raise_error(Errno::EINVAL)
+    lambda { io = IO.send(@method, @file.fileno, 'w'); io.close }.should_not raise_error
+  end
+
+  it "raises IOError on closed stream" do
+    lambda { IO.new(IOSpecs.closed_file.fileno, 'w') }.should raise_error(IOError)
+  end
+
+  it "does not close the stream automatically if given a block" do
+    begin
+      io = IO.new(@file.fileno, 'w') {|f| puts f.read }
+      io.closed?.should == false
+      @file.closed?.should == false
+    ensure
+      io.close
+    end
+  end
+
+  it "emits a warning if given a block" do
+    lambda {
+      io = IO.new(@file.fileno, 'w') {|io| puts io.read }
+      io.close
+    }.should complain(/IO::new.*does not take block.*IO::open.*instead/)
+  end
+
+  it "accepts only one argument" do
+    # By default, IO.new without an arg assumes RO
+    @file.close
+    io = ""
+    @file = File.open @filename, 'r'
+    lambda {
+      io = IO.new(@file.fileno)
+    }.should_not raise_error()
+
+    io.close
+  end
+
+    it "cannot open an IO with incompatible flags" do
+      lambda { IO.new(@file.fileno, "r") }.should raise_error
+    end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/shared/pos.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/shared/pos.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/shared/pos.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+describe :io_pos, :shared => true do
+  before :each do
+    @fname = 'test.txt'
+    File.open @fname, 'w' do |f| f.write "123" end
+  end
+
+  after :each do
+    File.unlink @fname
+  end
+
+  it "gets the offset" do
+    File.open @fname do |f|
+      f.send(@method).should == 0
+      f.read 1
+      f.send(@method).should == 1
+      f.read 2
+      f.send(@method).should == 3
+    end
+  end
+
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.send(@method) }.should raise_error(IOError)
+  end
+
+  it "resets #eof?" do
+    open @fname do |io|
+      io.read 1
+      io.read 1
+      io.send(@method)
+      io.eof?.should == false
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/shared/tty.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/shared/tty.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/shared/tty.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe :io_tty, :shared => true do
+  with_tty do
+    # Yeah, this will probably break.
+    it "returns true if this stream is a terminal device (TTY)" do
+      File.open('/dev/tty') {|f| f.send @method }.should == true
+    end
+  end
+
+  it "returns false if this stream is not a terminal device (TTY)" do
+    File.open(__FILE__) {|f| f.send @method }.should == false
+  end
+
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.send @method }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/shared/write.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/shared/write.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/shared/write.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,70 @@
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe :io_write, :shared => true do
+  before :each do
+    @filename = tmp("IO_syswrite_file") + $$.to_s
+    File.open(@filename, "w") do |file|
+      file.send(@method, "012345678901234567890123456789")
+    end
+    @file = File.open(@filename, "r+")
+    @readonly_file = File.open(@filename)
+  end
+
+  after :each do
+    @file.close
+    @readonly_file.close
+    File.delete(@filename)
+  end
+
+  it "coerces the argument to a string using to_s" do
+    (obj = mock('test')).should_receive(:to_s).and_return('a string')
+    @file.send(@method, obj)
+  end
+
+  it "checks if the file is writable if writing more than zero bytes" do
+    lambda { @readonly_file.send(@method, "abcde") }.should raise_error(IOError)
+  end
+
+  it "returns the number of bytes written" do
+    written = @file.send(@method, "abcde")
+    written.should == 5
+  end
+
+  it "invokes to_s on non-String argument" do
+    data = "abcdefgh9876"
+    (obj = mock(data)).should_receive(:to_s).and_return(data)
+    @file.send(@method, obj)
+    @file.seek(0)
+    @file.read(data.length).should == data
+  end
+
+  it "writes all of the string's bytes without buffering if mode is sync" do
+    @file.sync = true
+    written = @file.send(@method, "abcde")
+    written.should == 5
+    File.open(@filename) do |file|
+      file.read(10).should == "abcde56789"
+    end
+  end
+
+  it "does not warn if called after IO#read" do
+    @file.read(5)
+    lambda { @file.send(@method, "fghij") }.should_not complain
+  end
+
+  it "writes to the current position after IO#read" do
+    @file.read(5)
+    @file.send(@method, "abcd")
+    @file.rewind
+    @file.read.should == "01234abcd901234567890123456789"
+  end
+
+  it "advances the file position by the count of given bytes" do
+    @file.send(@method, "abcde")
+    @file.read(10).should == "5678901234"
+  end
+
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.send(@method, "hello") }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/stat_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/stat_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/stat_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#stat" do
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_io.stat }.should raise_error(IOError)
+  end
+
+  it "returns a File::Stat object for the stream" do
+    io = IO.new $stderr.fileno
+    io.stat.class.should == File::Stat
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/sync_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/sync_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/sync_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,50 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#sync=" do
+  before :each do
+    @io = File.open(File.dirname(__FILE__) + '/fixtures/readlines.txt')
+  end
+
+  after :each do
+    @io.close unless @io.closed?
+  end
+
+  it "sets the sync mode to true or false" do
+    @io.sync = true
+    @io.sync.should == true
+    @io.sync = false
+    @io.sync.should == false
+  end
+
+  it "accepts non-boolean arguments" do
+    @io.sync = 10
+    @io.sync.should == true
+    @io.sync = nil
+    @io.sync.should == false
+    @io.sync = Object.new
+    @io.sync.should == true
+  end
+
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.sync = true }.should raise_error(IOError)
+  end
+end
+
+describe "IO#sync" do
+  before :each do
+    @io = File.open(File.dirname(__FILE__) + '/fixtures/readlines.txt')
+  end
+
+  after :each do
+    @io.close unless @io.closed?
+  end
+
+  it "returns the current sync mode" do
+    @io.sync.should == false
+  end
+
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.sync }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/sysopen_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/sysopen_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/sysopen_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,36 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "IO.sysopen" do
+
+  before :all do
+    @filename = tmp("rubinius-spec-io-sysopen-#{$$}.txt")
+  end
+
+  after :all do
+    File.unlink @filename
+  end
+
+
+  it "returns the file descriptor for a given path" do
+    fd = IO.sysopen(@filename, "w")
+    fd.should be_kind_of(Fixnum)
+    fd.should_not equal(0)
+  end
+
+  it "works on directories" do
+    fd = IO.sysopen(tmp(""))    # /tmp
+    fd.should be_kind_of(Fixnum)
+    fd.should_not equal(0)
+  end
+
+  it "accepts a mode as second argument" do
+    fd = 0
+    lambda { fd = IO.sysopen(@filename, "w") }.should_not raise_error
+    fd.should_not equal(0)
+  end
+
+  it "accepts permissions as third argument" do
+    fd = IO.sysopen(@filename, "w", 777)
+    fd.should_not equal(0)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/sysread_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/sysread_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/sysread_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,82 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#sysread on a file" do
+  before :each do
+    @file_name = tmp("IO_sysread_file") + $$.to_s
+    File.open(@file_name, "w") do |f|
+      # write some stuff
+      f.write("012345678901234567890123456789")
+    end
+    @file = File.open(@file_name, "r+")
+  end
+  
+  after :each do
+    @file.close
+    File.delete(@file_name)
+  end
+  
+  it "reads the specified number of bytes from the file" do
+    @file.sysread(15).should == "012345678901234"
+  end
+
+  it "reads the specified number of bytes from the file to the buffer" do
+    buf = "" # empty buffer
+    @file.sysread(15, buf).should == buf
+    buf.should == "012345678901234"
+
+    @file.rewind
+
+    buf = "ABCDE" # small buffer
+    @file.sysread(15, buf).should == buf
+    buf.should == "012345678901234"
+
+    @file.rewind
+
+    buf = "ABCDE" * 5 # large buffer
+    @file.sysread(15, buf).should == buf
+    buf.should == "012345678901234"
+  end
+
+  it "coerces the second argument to string and uses it as a buffer" do
+    buf = "ABCDE"
+    (obj = mock("buff")).should_receive(:to_str).any_number_of_times.and_return(buf)
+    @file.sysread(15, obj).should == buf
+    buf.should == "012345678901234"
+  end
+  
+  it "advances the position of the file by the specified number of bytes" do
+    @file.sysread(15)
+    @file.sysread(5).should == "56789"
+  end
+  
+  it "throws IOError when called immediately after a buffered IO#read" do
+    @file.read(15)
+    lambda { @file.sysread(5) }.should raise_error(IOError)
+  end
+  
+  it "does not raise error if called after IO#read followed by IO#write" do
+    @file.read(5)
+    @file.write("abcde")
+    lambda { @file.sysread(5) }.should_not raise_error(IOError)
+  end
+  
+  it "does not raise error if called after IO#read followed by IO#syswrite" do
+    @file.read(5)
+    @file.syswrite("abcde")
+    lambda { @file.sysread(5) }.should_not raise_error(IOError)
+  end
+
+  it "reads updated content after the flushed buffered IO#write" do
+    @file.write("abcde")
+    @file.flush
+    @file.sysread(5).should == "56789"
+    File.open(@file_name) do |f|
+      f.sysread(10).should == "abcde56789"
+    end
+  end
+
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.sysread(5) }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/sysseek_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/sysseek_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/sysseek_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,70 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#sysseek on a file" do
+  # TODO: This should be made more generic with seek spec
+  before :each do
+    @file = File.open(File.dirname(__FILE__) + '/fixtures/readlines.txt', 'r')
+    @io = IO.open @file.fileno, 'r'
+  end
+
+  after :each do
+    # we *must* close both in order to not leak descriptors
+    @io.close unless @io.closed?
+    @file.close unless @file.closed? rescue Errno::EBADF
+  end
+
+  it "moves the read position relative to the current position with SEEK_CUR" do
+    @io.sysseek(10, IO::SEEK_CUR)
+    @io.readline.should == "igne une.\n"
+  end
+
+  it "raises an error when called after buffered reads" do
+    @io.readline
+    lambda { @io.sysseek(-5, IO::SEEK_CUR) }.should raise_error(IOError)
+  end
+
+  it "warns if called immediately after a buffered IO#write" do
+    begin
+      # copy contents to a separate file
+      tmpfile = File.open(tmp("tmp_IO_sysseek"), "w")
+      tmpfile.write(@file.read)
+      tmpfile.seek(0, File::SEEK_SET)
+
+      tmpfile.write("abcde")
+      lambda { tmpfile.sysseek(10) }.should complain(/sysseek/)
+    ensure
+      tmpfile.close
+      File.unlink(tmpfile.path)
+    end
+  end
+
+  it "moves the read position relative to the start with SEEK_SET" do
+    @io.sysseek(42, IO::SEEK_SET)
+    @io.readline.should == "quí está la línea tres.\n"
+  end
+
+  it "moves the read position relative to the end with SEEK_END" do
+    @io.sysseek(1, IO::SEEK_END)
+
+    # this is the safest way of checking the EOF when
+    # sys-* methods are invoked
+    lambda {
+      @io.sysread(1)
+    }.should raise_error(EOFError)
+
+    @io.sysseek(-25, IO::SEEK_END)
+    @io.sysread(7).should == "cinco.\n"
+  end
+
+  it "can handle any numerical argument without breaking and can seek past EOF" do
+    @io.sysseek(1.2).should == 1
+    @io.sysseek(2**10).should == 1024
+    @io.sysseek(2**32).should == 4294967296
+    lambda { @io.sysseek(2**128) }.should raise_error(RangeError)
+  end
+
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.sysseek(0) }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/syswrite_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/syswrite_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/syswrite_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,56 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/write'
+
+describe "IO#syswrite on a file" do
+  before :each do
+    @filename = tmp("IO_syswrite_file") + $$.to_s
+    File.open(@filename, "w") do |file|
+      file.syswrite("012345678901234567890123456789")
+    end
+    @file = File.open(@filename, "r+")
+    @readonly_file = File.open(@filename)
+  end
+
+  after :each do
+    @file.close
+    @readonly_file.close
+    File.delete(@filename)
+  end
+
+  it "writes all of the string's bytes but does not buffer them" do
+    written = @file.syswrite("abcde")
+    written.should == 5
+    File.open(@filename) do |file|
+      file.sysread(10).should == "abcde56789"
+      file.seek(0)
+      @file.fsync
+      file.sysread(10).should == "abcde56789"
+    end
+  end
+
+  not_compliant_on :rubinius do
+    it "warns if called immediately after a buffered IO#write" do
+      @file.write("abcde")
+      lambda { @file.syswrite("fghij") }.should complain(/syswrite/)
+    end
+  end
+
+  it "does not warn if called after IO#write with intervening IO#sysread" do
+    @file.syswrite("abcde")
+    @file.sysread(5)
+    lambda { @file.syswrite("fghij") }.should_not complain
+  end
+
+  it "writes to the actual file position when called after buffered IO#read" do
+    @file.read(5)
+    @file.syswrite("abcde")
+    File.open(@filename) do |file|
+      file.sysread(10).should == "01234abcde"
+    end
+  end
+end
+
+describe "IO#syswrite" do
+  it_behaves_like :io_write, :syswrite
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/tell_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/tell_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/tell_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/pos'
+
+describe "IO#tell" do
+  it_behaves_like(:io_pos, :tell)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/to_i_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/to_i_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/to_i_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#to_i" do
+  it "return the numeric file descriptor of the given IO object" do
+    $stdout.to_i.should == 1
+  end
+
+  it "raises IOError on closed stream" do
+    lambda { IOSpecs.closed_file.to_i }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/to_io_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/to_io_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/to_io_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#to_io" do
+  it "returns self for open stream" do
+    io = IO.new(2, 'w')
+    io.to_io.should == io
+
+    File.open(File.dirname(__FILE__) + '/fixtures/readlines.txt', 'r') { |io|
+      io.to_io.should == io
+    }
+  end
+
+  it "returns self for closed stream" do
+    io = IOSpecs.closed_file
+    io.to_io.should == io
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/tty_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/tty_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/tty_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/tty'
+
+describe "IO#tty?" do
+  it_behaves_like :io_tty, :tty?
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/ungetc_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/ungetc_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/ungetc_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,105 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "IO#ungetc" do
+  before :each do
+    @file_name = File.dirname(__FILE__) + '/fixtures/readlines.txt'
+    @file = File.open(@file_name, 'r')
+  end
+
+  after :each do
+    @file.close unless @file.closed?
+  end
+
+  it "pushes back one character onto stream" do
+    @file.getc.should == 86
+    @file.ungetc(86)
+    @file.getc.should == 86
+
+    @file.ungetc(10)
+    @file.getc.should == 10
+
+    @file.getc.should == 111
+    @file.getc.should == 105
+    # read the rest of line
+    @file.readline.should == "ci la ligne une.\n"
+    @file.getc.should == 81
+    @file.ungetc(99)
+    @file.getc.should == 99
+  end
+
+  it "pushes back one character when invoked at the end of the stream" do
+    # read entire content
+    @file.read
+    @file.ungetc(100)
+    @file.getc.should == 100
+  end
+  
+  it "pushes back one character when invoked at the start of the stream" do
+    @file.read(0)
+    @file.ungetc(100)
+    @file.getc.should == 100
+  end
+
+  it "pushes back one character when invoked on empty stream" do
+    File.open(tmp('empty.txt'), "w+") { |empty|
+      empty.getc().should == nil
+      empty.ungetc(10)
+      empty.getc.should == 10
+    }
+    File.unlink(tmp("empty.txt"))
+  end
+
+  it "affects EOF state" do
+    File.open(tmp('empty.txt'), "w+") { |empty|
+      empty.eof?.should == true
+      empty.getc.should == nil
+      empty.ungetc(100)
+      empty.eof?.should == false
+    }
+    File.unlink(tmp("empty.txt"))
+  end
+
+  it "adjusts the stream position" do
+    @file.pos.should == 0
+
+    # read one char
+    c = @file.getc
+    @file.pos.should == 1
+    @file.ungetc(c)
+    @file.pos.should == 0
+
+    # read all
+    @file.read
+    pos = @file.pos
+    @file.ungetc(98)
+    @file.pos.should == pos - 1
+  end
+
+  # TODO: file MRI bug
+  # Another specified behavior that MRI doesn't follow:
+  # "Has no effect with unbuffered reads (such as IO#sysread)."
+  #
+  #it "has no effect with unbuffered reads" do
+  #  length = File.size(@file_name)
+  #  content = @file.sysread(length)
+  #  @file.rewind
+  #  @file.ungetc(100)
+  #  @file.sysread(length).should == content
+  #end
+
+  it "makes subsequent unbuffered operations to raise IOError" do
+    @file.getc
+    @file.ungetc(100)
+    lambda { @file.sysread(1) }.should raise_error(IOError)
+  end
+
+  it "raises IOError when invoked on stream that was not yet read" do
+    lambda { @file.ungetc(100) }.should raise_error(IOError)
+  end
+
+  it "raises IOError on closed stream" do
+    @file.getc
+    @file.close
+    lambda { @file.ungetc(100) }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/write_nonblock_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/write_nonblock_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/write_nonblock_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,39 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/write'
+
+describe "IO#write_nonblock on a file" do
+  before :each do
+    @filename = tmp("IO_syswrite_file") + $$.to_s
+    File.open(@filename, "w") do |file|
+      file.write_nonblock("012345678901234567890123456789")
+    end
+    @file = File.open(@filename, "r+")
+    @readonly_file = File.open(@filename)
+  end
+
+  after :each do
+    @file.close
+    @readonly_file.close
+    File.delete(@filename)
+  end
+
+  it "writes all of the string's bytes but does not buffer them" do
+    written = @file.write_nonblock("abcde")
+    written.should == 5
+    File.open(@filename) do |file|
+      file.sysread(10).should == "abcde56789"
+      file.seek(0)
+      @file.fsync
+      file.sysread(10).should == "abcde56789"
+    end
+  end
+
+  it "checks if the file is writable if writing zero bytes" do
+    lambda { @readonly_file.write_nonblock("") }.should raise_error
+  end
+end
+
+describe "IO#write_nonblock" do
+  it_behaves_like :io_write, :write_nonblock
+end

Added: MacRuby/branches/experimental/spec/frozen/core/io/write_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/write_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/write_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,44 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/write'
+
+describe "IO#write on a file" do
+  before :each do
+    @filename = tmp("IO_syswrite_file") + $$.to_s
+    File.open(@filename, "w") do |file|
+      file.write("012345678901234567890123456789")
+    end
+    @file = File.open(@filename, "r+")
+    @readonly_file = File.open(@filename)
+  end
+
+  after :each do
+    @file.close
+    @readonly_file.close
+    File.delete(@filename)
+  end
+
+  # TODO: impl detail? discuss this with matz. This spec is useless. - rdavis
+  it "writes all of the string's bytes but buffers them" do
+    written = @file.write("abcde")
+    written.should == 5
+    File.open(@filename) do |file|
+      file.read.should == "012345678901234567890123456789"
+      @file.fsync
+      file.rewind
+      file.read.should == "abcde5678901234567890123456789"
+    end
+  end
+
+  it "does not check if the file is writable if writing zero bytes" do
+    lambda { @readonly_file.write("") }.should_not raise_error
+  end
+
+  it "returns a length of 0 when writing a blank string" do
+    @file.write('').should == 0
+  end
+end
+
+describe "IO#write" do
+  it_behaves_like :io_write, :write
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/Array_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/Array_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/Array_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,41 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#Array" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:Array)
+  end
+  
+  it "first tries to call #to_ary on the given argument" do
+    (obj = mock('[1,2,3]')).should_receive(:to_ary).and_return([1, 2, 3])
+    obj.should_not_receive(:to_a)
+    
+    Array(obj).should == [1, 2, 3]
+  end
+  
+  it "tries to call #to_a on the given argument if #to_ary is not provided" do
+    (obj = mock('[4,5,6]')).should_receive(:to_a).and_return([4, 5, 6])
+    Array(obj).should == [4, 5, 6]
+  end
+  
+  it "returns an array with the given argument if neither #to_ary nor #to_a are provided" do
+    obj = mock('x')
+    Array(obj).should == [obj]
+  end
+  
+  it "returns an empty array if the given argument is nil" do
+    Array(nil).should == []
+  end
+  
+  it "raises a TypeError if #to_ary / #to_a do not return an array" do
+    (obj = mock('ha!')).should_receive(:to_a).and_return("ha!")
+    lambda { Array(obj) }.should raise_error(TypeError)
+
+    obj.should_receive(:to_ary).and_return("ha!")
+    lambda { Array(obj) }.should raise_error(TypeError)
+  end
+end
+
+describe "Kernel.Array" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/Float_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/Float_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/Float_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,44 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel.Float when passed a String" do
+  it "raises a TypeError when the given String can't be fully converted to a Float" do
+    lambda { Float('0.0.0')  }.should raise_error(ArgumentError)
+    lambda { Float('float')  }.should raise_error(ArgumentError)
+    lambda { Float('10.0:D') }.should raise_error(ArgumentError)
+    lambda { Float('D10')    }.should raise_error(ArgumentError)
+  end
+end
+
+describe "Kernel.Float" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:Float)
+  end
+  
+  it "converts the given argument to a Float by calling #to_f" do
+    Kernel.Float(1).should == 1.0
+    Kernel.Float(1.12).should == 1.12
+    Kernel.Float(1000000000000).should == 1000000000000.0
+    Kernel.Float("10").should == 10.0
+    
+    (obj = mock('1.2')).should_receive(:to_f).any_number_of_times.and_return(1.2)
+    obj.should_not_receive(:to_i)
+    Kernel.Float(obj).should == 1.2
+  end
+  
+  it "raises a TypeError of #to_f is not provided" do
+    lambda { Kernel.Float(mock('x')) }.should raise_error(TypeError)
+  end
+  
+  it "raises a TypeError if #to_f does not return a Float" do
+    (obj = mock('ha!')).should_receive(:to_f).any_number_of_times.and_return('ha!')
+    lambda { Kernel.Float(obj) }.should raise_error(TypeError)
+
+    (obj = mock('123')).should_receive(:to_f).any_number_of_times.and_return(123)
+    lambda { Kernel.Float(obj) }.should raise_error(TypeError)
+  end
+end
+
+describe "Kernel#Float" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/Integer_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/Integer_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/Integer_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,55 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel.Integer when given a String" do
+  it "does not call #to_i on the given String" do
+    (obj = "2").should_not_receive(:to_i)
+    Integer(obj).should == 2
+    (obj = "0").should_not_receive(:to_i)
+    Integer(obj).should == 0
+  end
+  
+  it "ignores whitespaces" do
+    Integer("  2  ").should == 2
+    Integer("  22222  ").should == 22222
+  end
+  
+  it "raises an ArgumentError if the given String has no valid Integer representation" do
+    [ "", "--2", "-+2", "++2", "a2", "2a", "__2",
+      " _2", "2__", "2 _", "2 a"].each do |str|
+      lambda { Integer(str) }.should raise_error(ArgumentError)
+    end
+  end
+end
+
+describe "Kernel.Integer" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:Integer)
+  end
+  
+  it "calls #to_int if the given object responds to it" do
+    obj = mock('1')
+    obj.should_receive(:to_int).and_return(1)
+    obj.should_not_receive(:to_i)
+    
+    Integer(obj).should == 1
+  end
+  
+  it "calls to_i to convert any arbitrary argument to an Integer" do
+    (obj = mock('7')).should_receive(:to_i).and_return(7)
+    Integer(obj).should == 7
+  end
+
+  it "raises a TypeError if there is no to_i method on an object" do
+    lambda { Integer(mock('x')) }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError if to_i doesn't return an Integer" do
+    (obj = mock('ha!')).should_receive(:to_i).and_return("ha!")
+    lambda { Integer(obj) }.should raise_error(TypeError)
+  end
+end
+
+describe "Kernel#Integer" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/String_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/String_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/String_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,40 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel.String" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:String)
+  end
+  
+  it "converts the given argument to a String by calling #to_s" do
+    Kernel.String(nil).should == ""
+    Kernel.String("10").should == "10"
+    Kernel.String(1.12).should == "1.12"
+    Kernel.String(false).should == "false"
+    Kernel.String(Object).should == "Object"
+
+    (obj = mock('test')).should_receive(:to_s).and_return("test")
+    Kernel.String(obj).should == "test"
+  end
+
+# TODO: does not work yet because of undef_method
+#
+#  it "raises a TypeError of #to_s is not provided" do
+#    class << (obj = mock('to_s'))
+#      undef_method :to_s
+#    end
+#    
+#    lambda {
+#      Kernel.String(obj)
+#    }.should raise_error(TypeError)
+#  end
+  
+  it "raises a TypeError if #to_s does not return a String" do
+    (obj = mock('123')).should_receive(:to_s).and_return(123)
+    lambda { Kernel.String(obj) }.should raise_error(TypeError)
+  end
+end
+
+describe "Kernel#String" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/__id___spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/__id___spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/__id___spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/object_id'
+
+describe "Kernel#__id__" do
+  it_behaves_like(:kernel_object_id, :__id__) 
+end
+
+describe "Kernel#__id__" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/__send___spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/__send___spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/__send___spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#__send__" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/abort_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/abort_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/abort_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#abort" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:abort)
+  end
+end
+
+describe "Kernel.abort" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/at_exit_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/at_exit_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/at_exit_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel.at_exit" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:at_exit)
+  end
+
+  it "runs after all other code" do
+    ruby_exe("at_exit {print 5}; print 6").should == "65"
+  end
+
+  it "runs in reverse order of registration" do
+    code = "at_exit {print 4};at_exit {print 5}; print 6; at_exit {print 7}"
+    ruby_exe(code).should == "6754"
+  end
+end
+
+describe "Kernel#at_exit" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/autoload_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/autoload_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/autoload_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,113 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+# These specs only illustrate the basic autoload cases
+# and where toplevel autoload behaves differently from
+# Module#autoload. See those specs for more examples.
+
+autoload :KSAutoloadA, "autoload_a.rb"
+autoload :KSAutoloadB, fixture(__FILE__, "autoload_b.rb")
+
+def check_autoload(const)
+  autoload? const
+end
+
+describe "Kernel#autoload" do
+  before :each do
+    @loaded_features = $".dup
+  end
+
+  after :each do
+    $".replace @loaded_features
+  end
+
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:autoload)
+  end
+
+  it "registers a file to load the first time the named constant is accessed" do
+    Object.autoload?(:KSAutoloadA).should == "autoload_a.rb"
+  end
+
+  it "registers a file to load the first time the named constant is accessed" do
+    check_autoload(:KSAutoloadA).should == "autoload_a.rb"
+  end
+
+  it "sets the autoload constant in Object's constant table" do
+    Object.should have_constant(:KSAutoloadA)
+  end
+
+  it "loads the file when the constant is accessed" do
+    KSAutoloadB.loaded.should == :ksautoload_b
+  end
+
+  it "does not call Kernel.require or Kernel.load to load the file" do
+    filename = fixture(__FILE__, "autoload_c.rb")
+    autoload :KSAutoloadC, filename
+    Kernel.should_not_receive(:require)
+    Kernel.should_not_receive(:load)
+    KSAutoloadC.loaded.should == :ksautoload_c
+  end
+end
+
+describe "Kernel#autoload?" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:autoload?)
+  end
+
+  it "returns the name of the file that will be autoloaded" do
+    check_autoload(:KSAutoloadA).should == "autoload_a.rb"
+  end
+
+  it "returns nil if no file has been registered for a constant" do
+    check_autoload(:Manualload).should be_nil
+  end
+end
+
+Kernel.autoload :KSAutoloadBB, "no_autoload.rb"
+
+describe "Kernel.autoload" do
+  before :all do
+    @non_existent = fixture __FILE__, "no_autoload.rb"
+  end
+
+  before :each do
+    @loaded_features = $".dup
+
+    ScratchPad.clear
+  end
+
+  after :each do
+    $".replace @loaded_features
+  end
+
+  it "registers a file to load the first time the toplevel constant is accessed" do
+    Kernel.autoload :KSAutoloadAA, @non_existent
+    Kernel.autoload?(:KSAutoloadAA).should == @non_existent
+  end
+
+  ruby_version_is "" ... "1.9" do
+    it "sets the autoload constant in Object's constant table" do
+      Object.should have_constant(:KSAutoloadBB)
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "sets the autoload constant in Object's metaclass's constant table" do
+      class << Object
+        should have_constant(:KSAutoloadBB)
+      end
+    end
+  end
+end
+
+describe "Kernel.autoload?" do
+  it "returns the name of the file that will be autoloaded" do
+    Kernel.autoload :KSAutoload, "autoload.rb"
+    Kernel.autoload?(:KSAutoload).should == "autoload.rb"
+  end
+
+  it "returns nil if no file has been registered for a constant" do
+    Kernel.autoload?(:Manualload).should be_nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/backtick_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/backtick_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/backtick_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,58 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#`" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:`)
+  end
+  
+  it "returns the standard output of the executed sub-process" do
+    ip = 'world'
+    `echo disc #{ip}`.should == "disc world\n"
+  end
+  
+  it "tries to convert the given argument to String using #to_str" do
+    (obj = mock('echo test')).should_receive(:to_str).and_return("echo test")
+    Kernel.`(obj).should == "test\n"
+  end
+
+  platform_is_not :windows do
+    it "sets $? to the exit status of the executed sub-process" do
+      ip = 'world'
+      `echo disc #{ip}`
+      $?.class.should == Process::Status
+      $?.stopped?.should == false
+      $?.exited?.should == true
+      $?.exitstatus.should == 0
+      $?.success?.should == true
+      `echo disc #{ip}; exit 99`
+      $?.class.should == Process::Status
+      $?.stopped?.should == false
+      $?.exited?.should == true
+      $?.exitstatus.should == 99
+      $?.success?.should == false
+    end
+  end
+
+  platform_is :windows do
+    it "sets $? to the exit status of the executed sub-process" do
+      ip = 'world'
+      `echo disc #{ip}`
+      $?.class.should == Process::Status
+      $?.stopped?.should == false
+      $?.exited?.should == true
+      $?.exitstatus.should == 0
+      $?.success?.should == true
+      `echo disc #{ip}& exit 99`
+      $?.class.should == Process::Status
+      $?.stopped?.should == false
+      $?.exited?.should == true
+      $?.exitstatus.should == 99
+      $?.success?.should == false
+    end
+  end
+end
+
+describe "Kernel.`" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/binding_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/binding_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/binding_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,37 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#binding" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:binding)
+  end
+  
+  before(:each) do
+    @b1 = KernelSpecs::Binding.new(99).get_binding
+  end
+
+  it "returns a Binding object" do
+    @b1.kind_of?(Binding).should == true
+  end
+
+  it "encapsulates the execution context properly" do
+    eval("@secret", @b1).should == 100
+    eval("a", @b1).should == true
+    eval("b", @b1).should == true
+    eval("@@super_secret", @b1).should == "password"
+
+    eval("square(2)", @b1).should == 4
+    eval("self.square(2)", @b1).should == 4
+
+    eval("a = false", @b1)
+    eval("a", @b1).should == false
+  end
+
+  it "raises a NameError on undefined variable" do
+    lambda { eval("a_fake_variable", @b1) }.should raise_error(NameError)
+  end
+end
+
+describe "Kernel.binding" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/block_given_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/block_given_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/block_given_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#block_given?" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:block_given?)
+  end
+  
+  it "returns true if and only if a block is supplied" do
+    KernelSpecs::BlockGiven::accept_block {}.should_not == false
+    KernelSpecs::BlockGiven::accept_block_as_argument {}.should_not == false
+    KernelSpecs::BlockGiven::accept_block.should_not == true
+    KernelSpecs::BlockGiven::accept_block_as_argument.should_not == true
+  end
+end
+
+describe "Kernel.block_given?" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/callcc_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/callcc_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/callcc_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,71 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#callcc" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:callcc)
+  end
+
+  it "is possible to exit a loop like a break" do
+    i = 0
+    Kernel.callcc do |x|
+      loop do
+        i += 1
+        x.call() if i == 5
+      end
+    end.should == nil
+    i.should == 5
+  end
+
+  it "is possible to call a continuation multiple times" do
+    i = 0
+    cont = nil
+    Kernel.callcc {|cont|}
+    i += 1
+    cont.call() if i < 5
+    i.should == 5
+  end
+
+  it "returns the results of a block if continuation is not called" do
+    cont = nil
+    a = callcc {|cont| 0}
+    a.should == 0
+  end
+
+  it "returns the results of continuation once called" do
+    cont = nil
+    a = callcc {|cont| 0}
+    cont.call(1) if a == 0
+    a.should == 1
+  end
+
+  it "returns the arguments to call" do
+    callcc {|cont| cont.call }.should == nil
+    callcc {|cont| cont.call 1 }.should == 1
+    callcc {|cont| cont.call 1,2,3 }.should == [1,2,3]
+  end
+
+  it "preserves changes to block-local scope" do
+    i = "before"
+    cont = callcc { |c| c }
+    if cont # nil the second time
+      i = "after"
+      cont.call
+    end
+    i.should == "after"
+  end
+
+  it "preserves changes to method-local scope" do
+    # This spec tests that a continuation shares the same locals
+    # tuple as the scope that created it.
+    KernelSpecs.before_and_after.should == "after"
+  end
+
+  it "raises a LocalJumpError if callcc is not given a block" do
+    lambda { Kernel.callcc }.should raise_error(LocalJumpError)
+  end
+end
+
+describe "Kernel.callcc" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/caller_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/caller_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/caller_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,90 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+# DO NOT PUT ANYTHING ABOVE THIS
+describe "Kernel#caller" do
+  before :each do
+    def a(skip)
+      caller(skip)
+    end
+    def b(skip)
+      a(skip)
+    end
+    def c(skip)
+      b(skip)
+    end
+  end
+  
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:caller)
+  end
+  
+  it "returns the current call stack" do
+    stack = c 0
+    stack[0].should =~ /caller_spec.rb.*?8.*?`a'/
+    stack[1].should =~ /caller_spec.rb.*?11.*?`b'/
+    stack[2].should =~ /caller_spec.rb.*?14.*?`c'/
+  end
+  
+  it "omits a number of frames corresponding to the parameter" do
+    c(0)[1..-1].should == c(1)
+    c(0)[2..-1].should == c(2)
+    c(0)[3..-1].should == c(3)
+  end
+  
+  it "defaults to omitting one frame" do
+    caller.should == caller(1)
+  end
+
+  # The contents of the array returned by #caller depends on whether
+  # the call is made from an instance_eval block or a <block>#call.
+  # We purposely do not spec what happens if you request to omit
+  # more entries than exist in the array returned.
+end
+
+describe "Kernel#caller in a Proc or eval" do
+  it "returns the definition trace of a block when evaluated in a Proc binding" do
+    stack = CallerFixture.caller_of(CallerFixture.block)
+    stack[0].should =~ /caller_fixture1\.rb:4/
+    stack[1].should =~ /caller_fixture1\.rb:4:in `.+'/
+  end
+
+  it "returns the definition trace of a Proc" do
+    stack = CallerFixture.caller_of(CallerFixture.example_proc)
+    stack[0].should =~ /caller_fixture1\.rb:14:in `example_proc'/
+    stack[1].should =~ /caller_fixture1\.rb:14/
+  end
+
+  it "returns the correct caller line from a called Proc" do
+    stack = CallerFixture.entry_point.call
+    stack[0].should =~ /caller_fixture1\.rb:31:in `third'/
+    stack[1].should =~ /caller_spec\.rb:59/
+  end
+
+  it "returns the correct definition line for a complex Proc trace" do
+    stack = CallerFixture.caller_of(CallerFixture.entry_point)
+    stack[0].should =~ /caller_fixture1\.rb:29:in `third'/
+    ruby_bug("http://redmine.ruby-lang.org/issues/show/146", "1.8.7") do
+      stack[1].should =~ /caller_fixture1\.rb:25:in `second'/
+    end
+  end
+
+  it "begins with (eval) for caller(0) in eval" do
+    stack = CallerFixture.eval_caller(0)
+    stack[0].should == "(eval):1:in `eval_caller'"
+    stack[1].should =~ /caller_spec\.rb:73/
+  end
+
+  it "begins with the eval's sender's sender for caller(1) in eval" do
+    stack = CallerFixture.eval_caller(1)
+    stack[0].should =~ /caller_spec\.rb:79/
+  end
+
+  it "shows the current line in the calling block twice when evaled" do
+    stack = CallerFixture.eval_caller(0)
+    stack[0].should == "(eval):1:in `eval_caller'"
+    stack[1].should =~/caller_spec\.rb:84/
+    stack[2].should =~/caller_fixture2\.rb:23/
+    stack[3].should =~/caller_spec\.rb:84/
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/case_compare_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/case_compare_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/case_compare_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,174 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+
+module Specs
+  module Kernel
+
+    class HasNone
+    end
+
+    class HasOpEqual
+      def ==(other)
+        other.kind_of? HasOpEqual
+      end
+    end
+
+    class HasEqual
+      def equal?(other)
+        false
+      end
+    end
+
+    class HasOppoOpEqual
+      def ==(other)
+        false
+      end
+
+      def equal?(other)
+        false
+      end
+    end
+
+    class RandomID
+      def ==(other)
+        true
+      end
+
+      def equal?(other)
+        true
+      end
+
+      def object_id()
+        @ids ||= []
+
+        loop {
+          candidate = rand
+          next if @ids.include? candidate
+          @ids << candidate
+          return candidate
+        }
+      end
+    end
+
+  end
+end
+
+
+describe "Kernel#=== for a class with default #== and #equal?" do
+  before :each do
+    @o1 = Specs::Kernel::HasNone.new
+    @o2 = @o1.dup
+  end
+
+  it "returns true if other object has same object id" do
+    @o1.object_id.should == @o1.object_id
+    (@o1 === @o1).should == true
+  end
+
+  it "returns false if other object does not have same object id" do
+    @o1.object_id.should_not == @o2.object_id
+    (@o1 === @o2).should == false
+  end
+end
+
+describe "Kernel#=== for a class with #== overridden to consider other object's class" do
+  before :each do
+    @o  = Object.new
+    @o1 = Specs::Kernel::HasOpEqual.new
+    @o2 = @o1.dup
+  end
+
+  it "returns true if #== returns true even if #equal? is false" do
+    @o1.should_not equal(@o2)
+    (@o1 == @o2).should == true
+    (@o1 === @o2).should == true
+  end
+
+  it "returns true if #equal? returns true" do
+    @o1.should equal(@o1)
+    (@o1 === @o1).should == true
+  end
+
+  it "returns false if neither #== nor #equal? returns true" do
+    @o1.should_not equal(@o)
+    (@o1 == @o).should == false
+    (@o1 === @o).should == false
+  end
+end
+
+describe "Kernel#=== for a class with #equal? overridden to always be false" do
+  before :each do
+    @o  = Object.new
+    @o1 = Specs::Kernel::HasEqual.new
+    @o2 = @o1.dup
+  end
+
+  it "returns true if #== returns true even if #equal? is false" do
+    @o1.should_not equal(@o1)
+    (@o1 == @o1).should == true
+    (@o1 === @o1).should == true
+  end
+
+  it "returns false if neither #== nor #equal? returns true" do
+    @o1.should_not equal(@o)
+    (@o1 == @o).should == false
+    (@o1 === @o).should == false
+  end
+end
+
+describe "Kernel#=== for a class with #== and #equal? overridden to always be false" do
+  before :each do
+    @o  = Object.new
+    @o1 = Specs::Kernel::HasOppoOpEqual.new
+    @o2 = @o1.dup
+  end
+
+  not_compliant_on :rubinius do
+    it "returns true if the object id is the same even if both #== and #equal? return false" do
+      @o1.object_id.should == @o1.object_id
+
+      @o1.should_not equal(@o1)
+      (@o1 == @o1).should == false
+
+      (@o1 === @o1).should == true
+    end
+  end
+
+  deviates_on :rubinius do
+    it "returns false if both #== and #equal? return false even if object id is same" do
+      @o1.object_id.should == @o1.object_id
+
+      @o1.should_not equal(@o1)
+      (@o1 == @o1).should == false
+
+      (@o1 === @o1).should == false
+    end
+  end
+
+  it "returns false if the object id is not the same and both #== and #equal? return false" do
+    @o1.object_id.should_not == @o2.object_id
+
+    @o1.should_not equal(@o2)
+    (@o1 == @o2).should == false
+
+    (@o1 === @o2).should == false
+  end
+end
+
+describe "Kernel#=== for a class with #object_id overridden to always be different #== and #equal? overridden to always be true" do
+  before :each do
+    @o  = Object.new
+    @o1 = Specs::Kernel::RandomID.new
+    @o2 = @o1.dup
+  end
+
+  it "returns true if #== or #equal? is true even if object id is different" do
+    @o1.object_id.should_not == @o1.object_id
+
+    @o1.should equal(@o1)
+    (@o1 == @o1).should == true
+
+    (@o1 === @o1).should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/catch_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/catch_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/catch_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,88 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel.catch" do
+  it "executes its block" do
+    block_executed = false
+    result = catch :blah do
+      block_executed = true
+    end
+    block_executed.should == true
+  end
+
+  it "returns the last expression evaluated if throw was not called" do
+    result = catch :blah do
+      :normal_return_value
+    end
+    result.should == :normal_return_value
+  end
+
+  it "throws the given name and is caught by matching catch block" do
+    bad = false
+    catch :blah do
+      throw :blah
+      bad = true
+    end
+    bad.should == false
+  end
+
+  it "can be used even in a method different from where throw is called" do
+    class CatchSpecs
+      def self.throwing_method
+        throw :blah, :thrown_value
+      end
+      def self.catching_method
+        catch :blah do
+          throwing_method
+        end
+      end
+    end
+    CatchSpecs.catching_method.should == :thrown_value
+  end
+
+  it "can be nested" do
+    one = two = three = 0
+    catch :three do
+      catch :two do
+        catch :three do
+          three = 3
+          throw :three
+          three = :wrong
+        end
+        two = 2
+        throw :two
+        two = :wrong
+      end
+      one = 1
+      throw :three
+      one = :wrong
+    end
+    [one, two, three].should == [1, 2, 3]
+  end
+
+  it "raises ArgumentError if the number of arguments is not one" do
+    lambda {
+      catch {}
+    }.should raise_error(ArgumentError)
+    lambda {
+      catch(:one, :two) {}
+    }.should raise_error(ArgumentError)
+  end
+
+  it "raises TypeError if the argument is not a symbol" do
+    lambda {
+      catch Object.new {}
+    }.should raise_error(TypeError)
+  end
+
+  it "raises LocalJumpError if no block is given" do
+    lambda { catch :blah }.should raise_error(LocalJumpError)
+  end
+end
+
+describe "Kernel#catch" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:catch)
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/chomp_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/chomp_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/chomp_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#chomp" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:chomp)
+  end
+end
+
+describe "Kernel#chomp!" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:chomp!)
+  end
+end
+
+describe "Kernel.chomp" do
+  it "needs to be reviewed for spec completeness"
+end
+
+describe "Kernel.chomp!" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/chop_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/chop_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/chop_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#chop" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:chop)
+  end
+end
+
+describe "Kernel#chop!" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:chop!)
+  end
+end
+
+describe "Kernel.chop" do
+  it "needs to be reviewed for spec completeness"
+end
+
+describe "Kernel.chop!" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/class_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/class_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/class_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#class" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/clone_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/clone_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/clone_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#clone" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/display_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/display_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/display_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#display" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/dup_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/dup_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/dup_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#dup" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/eql_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/eql_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/eql_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#eql?" do 
+  it "returns true if obj and anObject are the same object." do 
+    o1 = mock('o1')
+    o2 = mock('o2')
+    o1.should eql(o1)
+    o2.should eql(o2)
+    o1.should_not eql(o2)
+  end
+  
+  it "returns true if obj and anObject have the same value." do
+    :hola.should_not eql(1)
+    1.should eql(1)
+    :hola.should eql(:hola)
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/equal_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/equal_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/equal_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#equal?" do
+  it "returns true only if obj and other are the same object" do
+    o1 = mock('o1')
+    o2 = mock('o2')
+    (o1.equal? o1).should == true
+    (o2.equal? o2).should == true
+    (o1.equal? o2).should== false
+    (nil.equal? nil).should == true
+    (o1.equal?  nil).should== false
+    (nil.equal?  o2).should== false
+  end  
+  
+  it "returns true if obj and anObject have the same value." do 
+    o1 = 1
+    o2 = :hola
+    (:hola.equal? o1).should == false
+    (1.equal? o1).should == true
+    (:hola.equal? o2).should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/equal_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/equal_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/equal_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#==" do 
+  it "returns true only if obj and other are the same object" do
+    o1 = mock('o1')
+    o2 = mock('o2')
+    (o1 == o1).should == true
+    (o2 == o2).should == true
+    (o1 == o2).should== false
+    (nil == nil).should == true
+    (o1 == nil).should== false
+    (nil == o2).should== false
+  end   
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/eval_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/eval_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/eval_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,181 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+class A
+  eval "class B; end"
+  def c
+    eval "class C; end"
+  end
+end
+
+A.new.c
+
+describe "Kernel#eval" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:eval)
+  end
+
+  it "is a module function" do
+    Kernel.respond_to?(:eval).should == true
+  end
+
+  it "evaluates the code within" do
+    eval("2 + 3").should == 5
+  end
+
+  it "evaluates within the scope of the eval" do
+    A::B.name.should == "A::B"
+  end
+
+  it "evaluates such that consts are scoped to the class of the eval" do
+    A::C.name.should == "A::C"
+  end
+
+  it "accepts a Proc object as a binding" do
+    x = 1
+    bind = proc {}
+
+    eval("x", bind).should == 1
+    eval("y = 2", bind).should == 2
+    eval("y", bind).should == 2
+
+    eval("z = 3").should == 3
+    eval("z", bind).should == 3
+  end
+
+  it "does not make Proc locals visible to evaluated code" do
+    bind = proc { inner = 4 }
+    lambda { eval("inner", bind) }.should raise_error(NameError)
+  end
+
+  it "allows a binding to be captured inside an eval" do
+    outer_binding = binding
+    level1 = eval("binding", outer_binding)
+    level2 = eval("binding", level1)
+
+    eval("w = 1")
+    eval("x = 2", outer_binding)
+    eval("y = 3", level1)
+
+    eval("w").should == 1
+    eval("w", outer_binding).should == 1
+    eval("w", level1).should == 1
+    eval("w", level2).should == 1
+
+    eval("x").should == 2
+    eval("x", outer_binding).should == 2
+    eval("x", level1).should == 2
+    eval("x", level2).should == 2
+
+    eval("y").should == 3
+    eval("y", outer_binding).should == 3
+    eval("y", level1).should == 3
+    eval("y", level2).should == 3
+  end
+
+  it "allows Proc and binding to be nested in horrible ways" do
+    outer_binding = binding
+    proc_binding = eval("proc {l = 5; binding}.call", outer_binding)
+    inner_binding = eval("proc {k = 6; binding}.call", proc_binding)
+
+    eval("w = 1")
+    eval("x = 2", outer_binding)
+    eval("yy = 3", proc_binding)
+    eval("z = 4", inner_binding)
+
+    eval("w").should == 1
+    eval("w", outer_binding).should == 1
+    eval("w", proc_binding).should == 1
+    eval("w", inner_binding).should == 1
+
+    eval("x").should == 2
+    eval("x", outer_binding).should == 2
+    eval("x", proc_binding).should == 2
+    eval("x", inner_binding).should == 2
+
+    lambda { eval("yy") }.should raise_error(NameError)
+    lambda { eval("yy", outer_binding) }.should raise_error(NameError)
+    eval("yy", proc_binding).should == 3
+    eval("yy", inner_binding).should == 3
+
+    lambda { eval("z") }.should raise_error(NameError)
+    lambda { eval("z", outer_binding) }.should raise_error(NameError)
+    lambda { eval("z", proc_binding)  }.should raise_error(NameError)
+    eval("z", inner_binding).should == 4
+
+    lambda { eval("l") }.should raise_error(NameError)
+    lambda { eval("l", outer_binding) }.should raise_error(NameError)
+    eval("l", proc_binding).should == 5
+    eval("l", inner_binding).should == 5
+
+    lambda { eval("k") }.should raise_error(NameError)
+    lambda { eval("k", outer_binding) }.should raise_error(NameError)
+    lambda { eval("k", proc_binding)  }.should raise_error(NameError)
+    eval("k", inner_binding).should == 6
+  end
+
+  it "allows creating a new class in a binding" do
+    bind = proc {}
+    eval "class A; end", bind
+    eval("A.name", bind).should == "A"
+  end
+
+  it "allows creating a new class in a binding created by #eval" do
+    bind = eval "binding"
+    eval "class A; end", bind
+    eval("A.name").should == "A"
+  end
+
+  it "allows creating a new class in a binding returned by a method defined with #eval" do
+    bind = eval "def spec_binding; binding; end; spec_binding"
+    eval "class A; end", bind
+    eval("A.name").should == "A"
+  end
+
+  it "includes file and line information in syntax error" do
+    expected = 'speccing.rb'
+    lambda {
+      eval('if true',TOPLEVEL_BINDING,expected)
+    }.should raise_error(SyntaxError) { |e|
+      e.message.should =~ /^#{expected}:1:.+/
+    }
+  end
+
+  it "should perform top level evaluations from inside a block" do
+    [1].each { eval "Const = 1"}
+    Const.should ==1
+    class Object
+      remove_const :Const
+    end
+  end
+
+  it "uses the filename of the binding if none is provided" do
+    eval("__FILE__").should == "(eval)"
+    eval("__FILE__", binding).should == __FILE__
+    eval("__FILE__", binding, "success").should == "success"
+    eval("eval '__FILE__', binding").should == "(eval)"
+    eval("eval '__FILE__', binding", binding).should == __FILE__
+    eval("eval '__FILE__', binding", binding, 'success').should == 'success'
+  end
+end
+
+describe "Kernel.eval" do
+#  TODO: This is how MRI 1.9 and JRuby behave. Bug or feature?
+#  it "yields to the block of the method when evaling 'yield' inside it" do
+#    class TT
+#      def self.call_yield_from_eval_no_binding
+#        eval('yield')
+#      end
+#    end
+#
+#    (TT.call_yield_from_eval_no_binding {"content"}).should == "content"
+#  end
+
+  it "does not pass the block to the method being eval'ed" do
+    lambda {
+      eval('KernelSpecs::EvalTest.call_yield') { "content" }
+    }.should raise_error(LocalJumpError)
+  end
+
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/exec_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/exec_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/exec_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#exec" do  
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:exec)
+  end
+  
+  it "raises a SystemCallError if cmd cannot execute" do
+    lambda { exec "" }.should raise_error(SystemCallError)
+  end  
+end
+
+describe "Kernel.exec" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/exit_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/exit_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/exit_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#exit" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:exit)
+  end
+end
+
+describe "Kernel#exit!" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:exit!)
+  end
+end
+
+
+describe "Kernel.exit" do
+  it "needs to be reviewed for spec completeness"
+end
+
+describe "Kernel.exit!" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/extend_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/extend_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/extend_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,50 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+module KernelSpecs::M
+  def self.extend_object(o)
+    ScratchPad << "extend_object"
+    super
+  end
+
+  def self.extended(o)
+    ScratchPad << "extended"
+    super
+  end
+end
+
+describe "Kernel#extend" do
+  before(:each) do
+    ScratchPad.record []
+  end
+
+  it "calls extend_object on argument" do
+    o = mock('o')
+    o.extend KernelSpecs::M
+    ScratchPad.recorded.include?("extend_object").should == true
+  end
+
+  it "calls extended on argument" do
+    o = mock('o')
+    o.extend KernelSpecs::M
+    ScratchPad.recorded.include?("extended").should == true
+  end
+
+  it "makes the class a kind_of? the argument" do
+    class C
+      extend KernelSpecs::M
+    end
+    (C.kind_of? KernelSpecs::M).should == true
+  end
+
+  it "raises a TypeError if self is frozen" do
+    module KernelSpecs::Mod; end
+    o = mock('o')
+    o.freeze
+    lambda { o.extend KernelSpecs::Mod }.should raise_error(TypeError)
+  end
+end
+
+describe "Kernel#extend" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/fail_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/fail_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/fail_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,43 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel.fail" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:fail)
+  end
+  
+  it "raises a RuntimeError" do
+    lambda { fail }.should raise_error(RuntimeError)
+  end
+
+  it "accepts an Object with an exception method returning an Exception" do
+    class Boring
+      def self.exception(msg)
+        StandardError.new msg
+      end
+    end
+    lambda { fail Boring, "..." }.should raise_error(StandardError)
+  end
+
+  it "instantiates the specified exception class" do
+    class LittleBunnyFooFoo < RuntimeError; end
+    lambda { fail LittleBunnyFooFoo }.should raise_error(LittleBunnyFooFoo)
+  end
+
+  it "uses the specified message" do
+    lambda { 
+      begin
+        fail "the duck is not irish."
+      rescue => e
+        e.message.should == "the duck is not irish."
+        raise
+      else
+        raise Exception
+      end
+    }.should raise_error(RuntimeError)
+  end
+end
+
+describe "Kernel#fail" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/.gitignore
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/.gitignore	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/.gitignore	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+load_spec_dynamic.rb
+load_spec_dynamic.rbc
+*.rbc
+*.old

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/autoload_b.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/autoload_b.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/autoload_b.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+module KSAutoloadB
+  def self.loaded
+    :ksautoload_b
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/autoload_c.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/autoload_c.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/autoload_c.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+module KSAutoloadC
+  def self.loaded
+    :ksautoload_c
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/caller_fixture1.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/caller_fixture1.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/caller_fixture1.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,42 @@
+require File.dirname(__FILE__) + '/caller_fixture2'
+2 + 2
+3 + 3
+CallerFixture.capture do
+  5 + 5
+  6 + 6
+  :seven
+  8 + 8
+end
+
+module CallerFixture
+  module_function
+  def example_proc
+    Proc.new do
+      1 + 1
+      2 + 2
+    end
+  end
+
+  def entry_point
+    second
+  end
+
+  def second
+    third
+  end
+
+  def third
+    b = fourth do
+      1 + 1
+      caller(0)
+    end
+    2 + 2
+    3 + 3
+    return b
+  end
+
+  def fourth(&block)
+    return block
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/caller_fixture2.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/caller_fixture2.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/caller_fixture2.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+module CallerFixture
+  def block
+    @block
+  end
+  module_function :block
+
+  def block=(block)
+    @block = block
+  end
+  module_function :block=
+
+  def capture(&block)
+    @block = block
+  end
+  module_function :capture
+
+  def caller_of(block)
+    eval("caller(0)", block.binding)
+  end
+  module_function :caller_of
+
+  def eval_caller(depth)
+    eval("caller(#{depth})")
+  end
+  module_function :eval_caller
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/check_expansion.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/check_expansion.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/check_expansion.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+if ARGV[0] != ARGV[1]
+  exit 1
+else
+  exit 0
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,190 @@
+require File.dirname(__FILE__) + '/caller_fixture1'
+
+module KernelSpecs
+  class Methods
+    def self.ichi; end
+    def ni; end
+    class << self
+      def san; end
+    end
+  
+    private
+  
+    def self.shi; end
+    def juu_shi; end
+  
+    class << self
+      def roku; end
+
+      private
+    
+      def shichi; end
+    end
+  
+    protected
+  
+    def self.hachi; end
+    def ku; end
+  
+    class << self
+      def juu; end
+    
+      protected
+    
+      def juu_ichi; end
+    end
+  
+    public
+  
+    def self.juu_ni; end
+    def juu_san; end
+  end
+
+  class A
+    def public_method; :public_method; end
+
+    def undefed_method; :undefed_method; end
+    undef_method :undefed_method
+
+    protected
+    def protected_method; :protected_method; end
+
+    private
+    def private_method; :private_method; end
+  end
+
+  class Binding
+    @@super_secret = "password"
+
+    def initialize(n)
+      @secret = n
+    end
+  
+    def square(n)
+      n * n
+    end
+    
+    def get_binding
+      a = true
+      @bind = binding
+
+      # Add/Change stuff
+      b = true 
+      @secret += 1
+
+      @bind
+    end
+  end
+  
+  module MethodMissing
+    def self.method_missing(*args) :method_missing end
+    def self.existing() :existing end
+
+    def self.private_method() :private_method end
+    private_class_method :private_method
+  end
+  
+  class MethodMissingC
+    def self.method_missing(*args) :method_missing end
+    def method_missing(*args) :instance_method_missing end
+
+    def self.existing() :existing end
+    def existing() :instance_existing end
+
+    def self.private_method() :private_method end
+    def self.protected_method() :protected_method end
+    class << self
+      private :private_method
+      protected :protected_method
+    end
+
+    def private_method() :private_instance_method end
+    private :private_method
+
+    def protected_method() :protected_instance_method end
+    protected :protected_method
+  end
+  
+  module NoMethodMissing
+    def self.existing() :existing end
+
+    def self.private_method() :private_method end
+    private_class_method :private_method
+  end
+    
+  class NoMethodMissingC
+    def self.existing() :existing end
+    def existing() :instance_existing end
+
+    def self.private_method() :private_method end
+    def self.protected_method() :protected_method end
+    class << self
+      private :private_method
+      protected :protected_method
+    end
+
+    def private_method() :private_instance_method end
+    private :private_method
+
+    def protected_method() :protected_instance_method end
+    protected :protected_method
+  end
+  
+  module BlockGiven
+    def self.accept_block
+      block_given?
+    end
+    
+    def self.accept_block_as_argument(&block)
+      block_given?
+    end
+  end
+  
+  def self.before_and_after
+    i = "before"
+    cont = callcc { |c| c }
+    if cont # nil the second time
+      i = "after"
+      cont.call
+    end
+    i
+  end
+  
+  class IVars
+    def initialize
+      @secret = 99
+    end
+  end
+  
+  module InstEval
+    def self.included(base)
+      base.instance_eval { @@count = 2 }
+    end
+  end
+  
+  class IncludesInstEval
+    include InstEval
+  end
+
+  class EvalTest
+    def self.eval_yield_with_binding
+      eval("yield", binding)
+    end
+    def self.call_yield
+      yield
+    end
+  end
+
+  def self.helper_script
+    File.dirname(__FILE__) + '/check_expansion.rb'
+  end
+end
+
+# for Kernel#sleep to have Channel in it's specs
+# TODO: switch directly to queue for both Kernel#sleep and Thread specs?
+unless defined? Channel
+  require 'thread'
+  class Channel < Queue
+    alias receive shift
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/test.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/test.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/fixtures/test.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,362 @@
+def foo1
+end 
+
+def foo2
+end
+
+def foo3
+end 
+  
+def foo4
+end
+  
+def foo5
+end
+
+def foo6
+end
+  
+def foo7
+end
+
+def foo8
+end 
+  
+def foo9
+end
+  
+def foo10
+end
+
+def foo11
+end
+
+def foo12
+end
+
+def foo13
+end 
+  
+def foo14
+end
+  
+def foo15
+end
+
+def foo16
+end
+  
+def foo17
+end
+
+def foo18
+end 
+  
+def foo19
+end
+  
+def foo20
+end
+
+def foo21
+end
+
+def foo22
+end
+
+def foo23
+end 
+  
+def foo24
+end
+  
+def foo25
+end
+
+def foo26
+end
+
+def foo27
+end
+
+def foo28
+end 
+  
+def foo29
+end
+  
+def foo30
+end
+
+def foo31
+end
+
+def foo32
+end
+
+def foo33
+end 
+  
+def foo34
+end
+  
+def foo35
+end
+
+def foo36
+end
+
+def foo37
+end
+
+def foo38
+end 
+  
+def foo39
+end
+  
+def foo40
+end
+
+def foo41
+end
+
+def foo42
+end
+
+def foo43
+end 
+  
+def foo44
+end
+  
+def foo45
+end
+
+def foo46
+end
+
+def foo47
+end
+
+def foo48
+end 
+  
+def foo49
+end
+  
+def foo50
+end
+
+def foo51
+end
+
+def foo52
+end
+
+def foo53
+end 
+  
+def foo54
+end
+  
+def foo55
+end
+
+def foo56
+end
+
+def foo57
+end
+
+def foo58
+end 
+  
+def foo59
+end
+  
+def foo60
+end
+
+def foo61
+end
+  
+def foo62
+end
+
+def foo63
+end 
+  
+def foo64
+end
+  
+def foo65
+end
+
+def foo66
+end
+  
+def foo67
+end
+
+def foo68
+end 
+  
+def foo69
+end
+  
+def foo70
+end
+
+def foo71
+end
+
+def foo72
+end
+
+def foo73
+end 
+  
+def foo74
+end
+  
+def foo75
+end
+
+def foo76
+end
+
+def foo77
+end
+
+def foo78
+end 
+  
+def foo79
+end
+  
+def foo80
+end
+
+def foo81
+end
+
+def foo82
+end
+
+def foo83
+end 
+  
+def foo84
+end
+  
+def foo85
+end
+
+def foo86
+end
+
+def foo87
+end
+
+def foo88
+end 
+  
+def foo89
+end
+  
+def foo90
+end
+
+def foo91
+end
+
+def foo92
+end
+
+def foo93
+end 
+  
+def foo94
+end
+  
+def foo95
+end
+
+def foo96
+end
+
+def foo97
+end
+
+def foo98
+end 
+  
+def foo99
+end
+  
+def foo100
+end
+
+def foo101
+end
+
+def foo102
+end
+
+def foo103
+end 
+  
+def foo104
+end
+  
+def foo105
+end
+
+def foo106
+end
+    
+def foo107
+end
+
+def foo108
+end 
+  
+def foo109
+end
+  
+def foo110
+end
+
+def foo111
+end 
+    
+def foo112
+end
+
+def foo113
+end 
+  
+def foo114
+end
+  
+def foo115
+end
+
+def foo116
+end
+
+def foo117
+end
+
+def foo118
+end 
+  
+def foo119
+end
+  
+def foo120
+end
+
+def foo121
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/fork_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/fork_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/fork_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#fork" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:fork)
+  end
+end
+
+describe "Kernel.fork" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/format_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/format_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/format_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#format" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:format)
+  end
+end
+
+describe "Kernel.format" do
+  it "is accessible as a module function" do
+    Kernel.format("%s", "hello").should == "hello"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/freeze_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/freeze_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/freeze_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,46 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#freeze" do
+  it "prevents self from being further modified" do
+    o = mock('o')
+    o.frozen?.should == false
+    o.freeze
+    o.frozen?.should == true
+  end
+
+  it "has no effect on immediate values" do
+    a = nil
+    b = true
+    c = false
+    d = 1
+    a.freeze
+    b.freeze
+    c.freeze
+    d.freeze
+    a.frozen?.should == false
+    b.frozen?.should == false
+    c.frozen?.should == false
+    d.frozen?.should == false
+  end
+
+  ruby_version_is "" ... "1.9" do
+    it "causes mutative calls to raise TypeError" do
+      o = Class.new do
+        def mutate; @foo = 1; end
+      end.new
+      o.freeze
+      lambda {o.mutate}.should raise_error(TypeError)
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "causes mutative calls to raise RuntimeError" do
+      o = Class.new do
+        def mutate; @foo = 1; end
+      end.new
+      o.freeze
+      lambda {o.mutate}.should raise_error(RuntimeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/frozen_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/frozen_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/frozen_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#frozen?" do
+  it "returns true if self is frozen" do
+    o = mock('o')
+    p = mock('p')
+    p.freeze
+    o.frozen?.should == false
+    p.frozen?.should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/getc_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/getc_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/getc_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#getc" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:getc)
+  end
+end
+
+describe "Kernel.getc" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/gets_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/gets_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/gets_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#gets" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:gets)
+  end
+end
+
+describe "Kernel.gets" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/global_variables_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/global_variables_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/global_variables_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel.global_variables" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:global_variables)
+  end
+  
+  it "finds subset starting with std" do
+    global_variables.grep(/std/).should include("$stderr", "$stdin", "$stdout")
+    a = global_variables.size
+    global_variables.include?("$foolish_global_var").should == false
+    eval("$foolish_global_var = 1")
+    global_variables.size.should == a+1
+    global_variables.should include("$foolish_global_var")
+  end
+end
+
+describe "Kernel#global_variables" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/gsub_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/gsub_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/gsub_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,91 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#gsub" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:gsub)
+  end
+
+  it "raises a TypeError if $_ is not a String" do
+    lambda {
+      $_ = 123
+      gsub /./, "!"
+    }.should raise_error(TypeError)
+  end
+
+  it "when matches sets $_ to a new string, leaving the former value unaltered" do
+    orig_value = $_ = "hello"
+    gsub "ello", "ola"
+    $_.should_not equal(orig_value)
+    $_.should == "hola"
+    orig_value.should == "hello"
+  end
+
+  it "returns a string with the same contents as $_ after the operation" do
+    $_ = "bye"
+    gsub("non-match", "?").should == "bye"
+
+    orig_value = $_ = "bye"
+    gsub(/$/, "!").should == "bye!"
+  end
+
+  it "accepts Regexps as patterns" do
+    $_ = "food"
+    gsub /.$/, "l"
+    $_.should == "fool"
+  end
+
+  it "accepts Strings as patterns, treated literally" do
+    $_ = "hello, world."
+    gsub ".", "!"
+    $_.should == "hello, world!"
+  end
+
+  it "accepts objects which respond to #to_str as patterns and treats them as strings" do
+    $_ = "hello, world."
+    stringlike = mock(".")
+    stringlike.should_receive(:to_str).and_return(".")
+    gsub stringlike, "!"
+    $_.should == "hello, world!"
+  end
+end
+
+describe "Kernel#gsub with a pattern and replacement" do
+  it "accepts strings for replacement" do
+    $_ = "hello"
+    gsub /./, "."
+    $_.should == "....."
+  end
+
+  it "accepts objects which respond to #to_str for replacement" do
+    o = mock("o")
+    o.should_receive(:to_str).and_return("o")
+    $_ = "ping"
+    gsub "i", o
+    $_.should == "pong"
+  end
+
+  it "replaces \\1 sequences with the regexp's corresponding capture" do
+    $_ = "hello!"
+    gsub /(.)(.)/, '\2\1'
+    $_.should == "ehll!o"
+  end
+end
+
+describe "Kernel#gsub with pattern and block" do
+  it "acts similarly to using $_.gsub" do
+    $_ = "olleh dlrow"
+    gsub(/(\w+)/){ $1.reverse }
+    $_.should == "hello world"
+  end
+end
+
+describe "Kernel#gsub!" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:gsub!)
+  end
+end
+
+describe "Kernel.gsub!" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/hash_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/hash_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/hash_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#hash" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/id_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/id_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/id_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#id" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/initialize_copy_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/initialize_copy_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/initialize_copy_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#initialize_copy" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:initialize_copy)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#inspect" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/instance_eval_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/instance_eval_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/instance_eval_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,112 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#instance_eval" do
+  it "expects a block with no arguments" do
+    lambda { "hola".instance_eval }.should raise_error(ArgumentError)
+  end
+  
+  it "takes no arguments with a block" do
+    lambda { "hola".instance_eval(4, 5) { |a,b| a + b } }.should raise_error(ArgumentError)
+  end
+  
+  it "passes the object to the block" do
+    "hola".instance_eval { |o| o.size }.should == 4
+  end
+  
+  it "only binds the eval to the receiver" do
+    f = Object.new
+    f.instance_eval do 
+      def foo
+        1
+      end
+    end
+    f.foo.should == 1
+    lambda { Object.new.foo }.should raise_error(NoMethodError)
+  end
+
+  # TODO: This should probably be replaced with a "should behave like" that uses
+  # the many scoping/binding specs from kernel/eval_spec, since most of those
+  # behaviors are the same for instance_eval. See also module_eval/class_eval.
+  it "shares a scope across sibling evals" do
+    a, b = Object.new, Object.new
+
+    result = nil
+    a.instance_eval "x = 1"
+    lambda do
+      b.instance_eval "result = x"
+    end.should_not raise_error
+    result.should == 1
+  end
+
+  it "binds self to the receiver" do
+    s = "hola"
+    (s == s.instance_eval { self }).should == true
+    o = mock('o')
+    (o == o.instance_eval("self")).should == true
+  end
+  
+  it "executes in the context of the receiver" do
+    "Ruby-fu".instance_eval { size }.should == 7
+    "hola".instance_eval("size").should == 4
+    Object.class_eval { "hola".instance_eval("to_s") }.should == "hola"
+    Object.class_eval { "Ruby-fu".instance_eval{ to_s } }.should == "Ruby-fu"
+
+  end
+
+  it "has access to receiver's instance variables" do
+    KernelSpecs::IVars.new.instance_eval { @secret }.should == 99
+    KernelSpecs::IVars.new.instance_eval("@secret").should == 99
+  end
+
+  it "treats block-local variables as local to the block" do
+    prc = instance_eval <<-CODE
+      proc do |x, prc|
+        if x
+          n = 2
+        else
+          n = 1
+          prc.call(true, prc)
+          n
+        end
+      end
+    CODE
+
+    prc.call(false, prc).should == 1
+  end
+
+  it "sets class variables in the receiver" do
+    KernelSpecs::IncludesInstEval.class_variables.should include("@@count")
+    KernelSpecs::IncludesInstEval.send(:class_variable_get, :@@count).should == 2
+  end
+
+  it "raises a TypeError when defining methods on an immediate" do
+    lambda do
+      1.instance_eval { def foo; end }
+    end.should raise_error(TypeError)
+    lambda do
+      :foo.instance_eval { def foo; end }
+    end.should raise_error(TypeError)
+  end
+
+quarantine! do # Not clean, leaves cvars lying around to break other specs
+  it "scopes class var accesses in the caller when called on a Fixnum" do
+    # Fixnum can take instance vars
+    Fixnum.class_eval "@@__tmp_instance_eval_spec = 1"
+    (defined? @@__tmp_instance_eval_spec).should == nil
+
+    @@__tmp_instance_eval_spec = 2
+    1.instance_eval { @@__tmp_instance_eval_spec }.should == 2
+    Fixnum.__send__(:remove_class_variable, :@@__tmp_instance_eval_spec)
+  end
+end
+
+  it "raises a TypeError when defining methods on numerics" do
+    lambda do
+      (1.0).instance_eval { def foo; end }
+    end.should raise_error(TypeError)
+    lambda do
+      (1 << 64).instance_eval { def foo; end }
+    end.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/instance_of_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/instance_of_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/instance_of_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Kernel#instance_of?" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/instance_variable_defined_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/instance_variable_defined_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/instance_variable_defined_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Kernel#instance_variable_defined?" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/instance_variable_get_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/instance_variable_get_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/instance_variable_get_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,114 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#instance_variable_get" do
+  before(:each) do
+    @obj = Object.new
+    @obj.instance_variable_set("@test", :test)
+  end
+
+  it "tries to convert the passed argument to a String using #to_str" do
+    obj = mock("to_str")
+    obj.should_receive(:to_str).and_return("@test")
+    @obj.instance_variable_get(obj)
+  end
+
+  it "returns the value of the passed instance variable that is referred to by the conversion result" do
+    obj = mock("to_str")
+    obj.stub!(:to_str).and_return("@test")
+    @obj.instance_variable_get(obj).should == :test
+  end
+
+  it "returns nil when the referred instance variable does not exist" do
+    @obj.instance_variable_get(:@does_not_exist).should be_nil
+  end
+
+  it "raises a TypeError when the passed argument does not respond to #to_str" do
+    lambda { @obj.instance_variable_get(Object.new) }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError when the passed argument can't be converted to a String" do
+    obj = mock("to_str")
+    obj.stub!(:to_str).and_return(123)
+    lambda { @obj.instance_variable_get(obj) }.should raise_error(TypeError)
+  end
+
+  it "raises a NameError when the conversion result does not start with an '@'" do
+    obj = mock("to_str")
+    obj.stub!(:to_str).and_return("test")
+    lambda { @obj.instance_variable_get(obj) }.should raise_error(NameError)
+  end
+end
+
+describe "Kernel#instance_variable_get when passed Symbol" do
+  before(:each) do
+    @obj = Object.new
+    @obj.instance_variable_set("@test", :test)
+  end
+
+  it "returns the value of the instance variable that is referred to by the passed Symbol" do
+    @obj.instance_variable_get(:@test).should == :test
+  end
+
+  it "raises a NameError when the passed Symbol does not start with an '@'" do
+    lambda { @obj.instance_variable_get(:test) }.should raise_error(NameError)
+  end
+end
+
+describe "Kernel#instance_variable_get when passed String" do
+  before(:each) do
+    @obj = Object.new
+    @obj.instance_variable_set("@test", :test)
+  end
+
+  it "returns the value of the instance variable that is referred to by the passed String" do
+    @obj.instance_variable_get("@test").should == :test
+  end
+
+  it "raises a NameError when the passed String does not start with an '@'" do
+    lambda { @obj.instance_variable_get("test") }.should raise_error(NameError)
+  end
+end
+
+describe "Kernel#instance_variable_get when passed Fixnum" do
+  before(:each) do
+    @obj = Object.new
+    @obj.instance_variable_set("@test", :test)
+  end
+
+  ruby_version_is "" ... "1.9" do
+    deviates_on :rubinius do
+      it "always raises an ArgumentError" do
+        lambda { @obj.instance_variable_get(0) }.should raise_error(ArgumentError)
+        lambda { @obj.instance_variable_get(10) }.should raise_error(ArgumentError)
+        lambda { @obj.instance_variable_get(100) }.should raise_error(ArgumentError)
+        lambda { @obj.instance_variable_get(-100) }.should raise_error(ArgumentError)
+      end
+    end
+
+    not_compliant_on :rubinius do
+      it "tries to convert the passed Integer to a Symbol and returns the instance variable that is referred by the Symbol" do
+        @obj.instance_variable_get(:@test.to_i).should == :test
+      end
+
+      it "outputs a warning" do
+        lambda { @obj.instance_variable_get(:@test.to_i) }.should complain(/#{"do not use Fixnums as Symbols"}/)
+      end
+
+      it "raises an ArgumentError when the passed Fixnum can't be converted to a Symbol" do
+        lambda { @obj.instance_variable_get(-10) }.should raise_error(ArgumentError)
+      end
+
+      it "raises a NameError when the Symbol does not start with an '@'" do
+        lambda { @obj.instance_variable_get(:test.to_i) }.should raise_error(NameError)
+      end
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "raises a TypeError" do
+      lambda { @obj.instance_variable_get(10) }.should raise_error(TypeError)
+      lambda { @obj.instance_variable_get(-10) }.should raise_error(TypeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/instance_variable_set_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/instance_variable_set_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/instance_variable_set_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,57 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#instance_variable_set" do
+  it "sets the value of the specified instance variable" do
+    class Dog
+      def initialize(p1, p2) 
+        @a, @b = p1, p2 
+      end 
+    end 
+    Dog.new('cat', 99).instance_variable_set(:@a, 'dog').should == "dog"
+  end
+
+  it "sets the value of the instance variable when no instance variables exist yet" do
+    class NoVariables; end
+    NoVariables.new.instance_variable_set(:@a, "new").should == "new"
+  end
+
+  it "raises a NameError exception if the argument is not of form '@x'" do
+    class NoDog; end
+    lambda { NoDog.new.instance_variable_set(:c, "cat") }.should raise_error(NameError)
+  end
+
+  it "raises an ArgumentError if the instance variable name is a Fixnum" do
+    lambda { "".instance_variable_set(1, 2) }.should raise_error(ArgumentError)
+  end
+  
+  it "raises a TypeError if the instance variable name is an object that does not respond to to_str" do
+    class KernelSpecs::A; end
+    lambda { "".instance_variable_set(KernelSpecs::A.new, 3) }.should raise_error(TypeError)
+  end
+  
+  it "raises a NameError if the passed object, when coerced with to_str, does not start with @" do
+    class KernelSpecs::B
+      def to_str
+        ":c"
+      end
+    end
+    lambda { "".instance_variable_set(KernelSpecs::B.new, 4) }.should raise_error(NameError)
+  end
+  
+  it "raises a NameError if pass an object that cannot be a symbol" do
+    lambda { "".instance_variable_set(:c, 1) }.should raise_error(NameError)
+  end
+  
+  it "accepts as instance variable name any instance of a class that responds to to_str" do
+    class KernelSpecs::C
+      def initialize
+        @a = 1
+      end
+      def to_str
+        "@a"
+      end
+    end
+    KernelSpecs::C.new.instance_variable_set(KernelSpecs::C.new, 2).should == 2
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/instance_variables_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/instance_variables_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/instance_variables_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#instance_variables" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/is_a_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/is_a_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/is_a_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Kernel#is_a?" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/iterator_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/iterator_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/iterator_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#iterator?" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:iterator?)
+  end
+end
+
+describe "Kernel.iterator?" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/kind_of_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/kind_of_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/kind_of_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Kernel#kind_of?" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/lambda_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/lambda_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/lambda_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/lambda'
+
+describe "Kernel.lambda" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:lambda)
+  end
+
+  it_behaves_like(:kernel_lambda, :lambda)
+end
+
+describe "Kernel#lambda" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/load_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/load_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/load_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,233 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+$load_fixture_dir = (File.dirname(__FILE__) + '/../../fixtures/load')
+$LOAD_PATH << $load_fixture_dir
+
+$load_spec_1 = nil
+$load_spec_2 = nil
+$load_spec_3 = nil
+$load_spec_4 = nil
+$load_spec_5 = nil
+$load_spec_6 = nil
+$load_spec_7 = nil
+$load_spec_8 = nil
+$load_spec_9 = nil
+$load_spec_10 = nil
+$load_spec_wrap   = nil
+$load_spec_wrap2  = nil
+$load_spec = nil
+$load_spec_rooby = nil
+
+require 'rbconfig'
+
+# The files used below just contain code that assigns
+# Time.now to the respective global variable.
+#
+# The only exception are the _wrap files which contain
+# similarly named classes. The class definitions, in
+# addition, contain another global timestamp assignment.
+describe "Kernel#load" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:load)
+  end
+
+  # Avoid storing .rbc in repo
+  before :all do
+    Dir.chdir($load_fixture_dir) do |dir|
+      FileUtils.rm_f(Dir["*.rbc"])
+    end
+  end
+
+  it "loads a .rb from an absolute path and returns true" do
+    path = File.expand_path(File.dirname(__FILE__) + '/../../fixtures/load/load_spec_1.rb')
+
+    load(path).should == true
+    $load_spec_1.nil?.should == false
+  end
+
+  it "loads a .rb from a relative path and returns true" do
+    Dir.chdir($load_fixture_dir) do |dir|
+      $load_spec_1 = nil
+      load('../../fixtures/load/load_spec_1.rb').should == true
+      $load_spec_1.nil?.should == false
+
+      $load_spec_1 = nil
+      load('./../load/load_spec_1.rb').should == true
+      $load_spec_1.nil?.should == false
+    end
+  end
+
+  # TODO: add an implementation-agnostic method for creating
+  # an extension file
+  it "loads extension files"
+
+  it "loads an unqualified .rb by looking in $LOAD_PATH and returns true" do
+    load('load_spec_2.rb').should == true
+    $load_spec_2.nil?.should == false
+  end
+
+  it "does not expand/resolve qualified files against $LOAD_PATH" do
+    Dir.chdir($load_fixture_dir + '/../') do |dir|
+      # This would be a valid path if expanded against the fixture dir
+      lambda { load '../load/load_spec_2.rb' }.should raise_error LoadError
+    end
+  end
+
+  it "allows unqualified files to contain path information (just not in the beginning)" do
+    name = (File.dirname(__FILE__) + '/../../fixtures')
+    $LOAD_PATH << name
+
+    $load_spec_2 = nil
+    load('load/../load/load_spec_2.rb').should == true
+    $load_spec_2.nil?.should == false
+    
+    $LOAD_PATH.delete name
+  end
+
+  it "loads a file with no extension as a ruby source file" do
+    load('load_spec').should == true
+    $load_spec.nil?.should == false
+  end
+
+  it "loads a file with any extension as a ruby source file" do
+    load('load_spec.rooby').should == true
+    $load_spec_rooby.nil?.should == false
+  end
+
+  it "does not create a .rb file for the non-.rb files" do
+    load('load_spec').should == true
+    load('load_spec.rooby').should == true
+
+    File.exist?("#{$load_fixture_dir}/load_spec.rb").should == false
+    File.exist?("#{$load_fixture_dir}/load_spec.rooby.rb").should == false
+  end
+
+  it "does not add the loaded file to $LOADED_FEATURES" do
+    $LOADED_FEATURES.grep(/load_spec_3.rb/).should == []
+    load('load_spec_3.rb').should == true
+    $load_spec_3.nil?.should == false
+    $LOADED_FEATURES.grep(/load_spec_3.rb/).should == []
+  end
+
+  it "produces __FILE__ as the given filename and __LINE__ as the source line number" do
+    Dir.chdir($load_fixture_dir) do |dir|
+      load('load_spec_4.rb').should == true 
+      $load_spec_4.should == [['./load_spec_4.rb', 1], ['./load_spec_4.rb', 10]]
+
+      extended_on :rubinius do
+        `rm load_spec_4.rbc`
+      end
+    end
+
+    load("#{$load_fixture_dir}/load_spec_4.rb").should == true
+    $load_spec_4[0][0].should =~ %r[^.*/fixtures/load/load_spec_4.rb]
+    $load_spec_4[0][1].should == 1
+    $load_spec_4[1][0].should =~ %r[^.*/fixtures/load/load_spec_4.rb]
+    $load_spec_4[1][1].should == 10
+  end
+
+  it "reloads the file if invoked on the same filename again, returning true" do
+    load('load_spec_4.rb').should == true
+    load('load_spec_4.rb').should == true
+  end
+
+  it "re-evaluates the file each time it is loaded" do
+    load('load_spec_5.rb').should == true
+    a = $load_spec_5
+    load('load_spec_5.rb').should == true
+    b = $load_spec_5
+
+    a.should_not eql(b)
+  end
+
+  it "loads the file even if it has already been #required" do
+    require('load_spec_6.rb').should == true
+    a = $load_spec_6
+
+    require('load_spec_6.rb').should == false
+    b = $load_spec_6
+
+    load('load_spec_6.rb').should == true
+    c = $load_spec_6
+
+    a.should eql(b)
+    c.should_not eql(a)
+  end
+
+  it "does not cause #require on the same filename to fail" do 
+    load('load_spec_7.rb').should == true
+    a = $load_spec_7
+
+    require('load_spec_7.rb').should == true
+    b = $load_spec_7
+
+    load('load_spec_7.rb').should == true
+    c = $load_spec_7
+
+    a.should_not eql(b)
+    b.should_not eql(c)
+    c.should_not eql(a)
+  end
+
+  it "raises a LoadError if the file can't be found" do
+    lambda { load("./nonexistent#{Time.now.to_f}#{$$}") }.should raise_error LoadError
+  end
+
+  # TODO: This currently fails on Rubinius because the #load logic
+  #       will take 'load_spec_1' and try 'load_spec_1.rbc' since
+  #       that is the logic for .rb files. 
+  it "raises a LoadError if filename given without its extension" do
+    lambda { load('load_spec_1') }.should raise_error LoadError
+    load('load_spec_1.rb').should == true
+    lambda { load('load_spec_1') }.should raise_error LoadError
+  end
+
+  it "only accepts strings as the filename argument" do
+    lambda { load(nil) }.should raise_error TypeError
+    lambda { load(42) }.should raise_error TypeError
+    lambda { load([]) }.should raise_error TypeError
+  end
+
+  runner_is_not :rspec do
+    it "allows wrapping the code in the file in an anonymous module" do
+      !!defined?(LoadSpecWrap).should == false
+      !!defined?(LoadSpecWrapTwo).should == false
+
+      load('load_spec_wrap.rb').should == true
+      $load_spec_wrap.nil?.should == false
+      LoadSpecWrap.lsw.should == :lsw
+
+      load('load_spec_wrap2.rb', true).should == true
+      $load_spec_wrap2.nil?.should == false
+      !!defined?(LoadSpecWrapTwo).should == false
+    end
+  end
+end
+
+describe "Shell expansion in Kernel#load" do
+  before :all do
+    @rs_home = ENV["HOME"]
+    ENV["HOME"] = $load_fixture_dir
+    @rs_short = "~/load_spec_1.rb"
+    @rs_long  = "#{$load_fixture_dir}/load_spec_1.rb"
+  end
+
+  after :all do
+    ENV["HOME"] = @rs_home
+  end
+
+  before :each do
+    $LOADED_FEATURES.delete @rs_long
+    $LOADED_FEATURES.delete @rs_short
+  end
+
+  it "expands a preceding ~/ to the user's home directory to use as path" do
+    $load_spec_1 = nil
+    load(@rs_short).should == true
+    $load_spec_1.nil?.should == false
+  end
+end
+
+describe "Kernel.load" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/local_variables_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/local_variables_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/local_variables_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel.local_variables" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:local_variables)
+  end
+  
+  it "contains locals as they are added" do
+    a = 1
+    b = 2
+    local_variables.should include("a", "b")
+  end
+
+  it "is accessable from bindings" do
+    def local_var_foo
+      a = 1
+      b = 2
+      binding      
+    end
+    foo_binding = local_var_foo()
+    res = eval("local_variables",foo_binding)
+    res.should include("a", "b")
+  end
+end
+
+describe "Kernel#local_variables" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/loop_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/loop_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/loop_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,38 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel.loop" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:loop)
+  end
+  
+  it "calls block until it is terminated by a break" do
+    i = 0
+    loop do
+      i += 1
+      break if i == 10
+    end
+
+    i.should == 10
+  end
+
+  it "returns value passed to break" do
+    loop do
+      break 123
+    end.should == 123
+  end
+
+  it "returns nil if no value passed to break" do
+    loop do
+      break
+    end.should == nil
+  end
+
+  it "raises a LocalJumpError if no block given" do
+    lambda { loop }.should raise_error(LocalJumpError)
+  end
+end
+
+describe "Kernel#loop" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/match_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/match_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/match_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#=~" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/method_missing_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/method_missing_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/method_missing_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,60 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#method_missing" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:method_missing)
+  end
+  
+  it "is not called when a defined method is called" do
+    KernelSpecs::MethodMissing.should_not_receive(:method_missing)
+    KernelSpecs::MethodMissingC.should_not_receive(:method_missing)
+    obj = KernelSpecs::MethodMissingC.new
+    obj.should_not_receive(:method_missing)
+    
+    KernelSpecs::MethodMissing.existing.should == :existing
+    KernelSpecs::MethodMissingC.existing.should == :existing
+    obj.existing.should == :instance_existing
+  end
+  
+  it "is called when an undefined method is called" do
+    KernelSpecs::MethodMissing.nonexistent.should == :method_missing
+    KernelSpecs::MethodMissingC.nonexistent.should == :method_missing
+    KernelSpecs::MethodMissingC.new.nonexistent.should == :instance_method_missing
+  end
+  
+  it "is called when a private method is called" do
+    KernelSpecs::MethodMissing.private_method.should == :method_missing
+    KernelSpecs::MethodMissingC.private_method.should == :method_missing
+    KernelSpecs::MethodMissingC.new.private_method.should == :instance_method_missing
+  end
+  
+  it "is called when a protected method is called" do
+    KernelSpecs::MethodMissingC.protected_method.should == :method_missing
+    KernelSpecs::MethodMissingC.new.protected_method.should == :instance_method_missing
+  end
+end
+
+describe "When Kernel#method_missing is undefined" do
+  it "a NoMethodError is raised when an undefined method is called" do
+    lambda { KernelSpecs::NoMethodMissing.nonexistent      }.should raise_error(NoMethodError)
+    lambda { KernelSpecs::NoMethodMissingC.nonexistent     }.should raise_error(NoMethodError)
+    lambda { KernelSpecs::NoMethodMissingC.new.nonexistent }.should raise_error(NoMethodError)
+  end
+  
+  it "a NoMethodError is raised when a private method is called" do
+    lambda { KernelSpecs::NoMethodMissing.nonexistent      }.should raise_error(NoMethodError)
+    lambda { KernelSpecs::NoMethodMissingC.nonexistent     }.should raise_error(NoMethodError)
+    lambda { KernelSpecs::NoMethodMissingC.new.nonexistent }.should raise_error(NoMethodError)
+  end
+  
+  it "a NoMethodError is raised when a protected method is called" do
+    lambda { KernelSpecs::NoMethodMissing.nonexistent      }.should raise_error(NoMethodError)
+    lambda { KernelSpecs::NoMethodMissingC.nonexistent     }.should raise_error(NoMethodError)
+    lambda { KernelSpecs::NoMethodMissingC.new.nonexistent }.should raise_error(NoMethodError)
+  end
+end
+
+describe "Kernel.method_missing" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/method_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/method_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/method_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,44 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#method" do
+  it "returns a method object for a valid method" do
+    class KernelSpecs::Foo; def bar; 'done'; end; end
+    KernelSpecs::Foo.new.method(:bar).class.should == Method
+  end
+
+  it "returns a method object for a valid singleton method" do
+    class KernelSpecs::Foo; def self.bar; 'done'; end; end
+    KernelSpecs::Foo.method(:bar).class.should == Method
+  end
+
+  it "raises a NameError for an invalid method name" do
+    class KernelSpecs::Foo; def bar; 'done'; end; end
+    lambda {
+      KernelSpecs::Foo.new.method(:invalid_and_silly_method_name)
+    }.should raise_error(NameError)
+  end
+
+  it "raises a NameError for an invalid singleton method name" do
+    class KernelSpecs::Foo; def self.bar; 'done'; end; end
+    lambda { KernelSpecs::Foo.method(:baz) }.should raise_error(NameError)
+  end
+
+  # This may be a bug; see http://redmine.ruby-lang.org/issues/show/1151
+  ruby_version_is "" ... "1.9" do
+    it "changes the method called for super on a target aliased method" do
+      c1 = Class.new do
+        def a; 'a'; end
+        def b; 'b'; end
+      end
+      c2 = Class.new(c1) do
+        def a; super; end
+        alias b a
+      end
+
+      c2.new.a.should == 'a'
+      c2.new.b.should == 'a'
+      c2.new.method(:b).call.should == 'b'
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/methods_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/methods_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/methods_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,84 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+module KernelSpecs
+  class MethodsUndefd
+    def all; end
+  end
+
+  class MethodsUndefdParent
+    def parent_method; end
+  end
+
+  class MethodsUndefdChild < MethodsUndefdParent
+    undef_method :parent_method
+  end
+end
+
+describe "Kernel#methods" do
+
+  it "picks up methods added via self.meth" do
+    KernelSpecs::Methods.methods(false).should include("ichi")
+  end
+
+  it "picks up methods added inside 'class << self'" do
+    KernelSpecs::Methods.methods(false).should include("san")
+  end
+
+  it "picks up private methods added via self.meth" do
+    KernelSpecs::Methods.methods(false).should include("shi")
+  end
+
+  it "picks up methods added inside 'class << self' after private" do
+    KernelSpecs::Methods.methods(false).should include("roku")
+  end
+
+  it "doesn't pick up methods added inside 'class << self; private'" do
+    KernelSpecs::Methods.methods(false).should_not include("shichi")
+  end
+
+  it "returns a list of the names of publicly accessible methods in the object" do
+    meths =  KernelSpecs::Methods.methods(false)
+
+    ["hachi", "ichi", "juu", "juu_ichi", "juu_ni", "roku", "san", "shi"].each do|m|
+      meths.should include(m)
+    end
+
+    KernelSpecs::Methods.new.methods(false).should == []
+  end
+
+  it "returns a list of the names of publicly accessible methods in the object and its ancestors and mixed-in modules" do
+    meths = KernelSpecs::Methods.methods(false) & KernelSpecs::Methods.methods
+    ["hachi", "ichi", "juu", "juu_ichi", "juu_ni", "roku", "san", "shi"].each do |m|
+      meths.should include(m)
+    end
+
+    m = KernelSpecs::Methods.new.methods
+    m.should include('ku')
+    m.should include('ni')
+    m.should include('juu_san')
+  end
+
+  it "does not include any .undef'd methods" do
+    o = KernelSpecs::MethodsUndefd.new
+
+    def o.single; end
+
+    o.methods.should include("all")
+    o.methods.should include("single")
+
+    KernelSpecs::MethodsUndefd.send :undef_method, :all
+
+    o.methods.should_not include("all")
+
+    class << o; self; end.send :undef_method, :single
+
+    o.methods.should_not include("single")
+  end
+
+  it "does not include any .undef'd methods even if method is inherited" do
+    o = KernelSpecs::MethodsUndefdChild.new
+    o.methods.should_not include("inh")
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/nil_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/nil_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/nil_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#nil?" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/object_id_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/object_id_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/object_id_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/object_id'
+
+describe "Object.object_id" do
+  it_behaves_like(:kernel_object_id, :object_id) 
+end
+
+describe "Kernel#object_id" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/open_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/open_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/open_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,70 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#open" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:open)
+  end
+  
+  before :each do
+    @file = "test.txt"
+    File.open(@file, "w"){ |f| f.puts "This is a test" }
+  end
+  
+  after :each do
+    File.delete(@file) rescue nil
+  end
+  
+  it "opens a file when given a valid filename" do
+    @file = open("test.txt")
+    @file.class.should == File
+  end
+  
+  it "opens a file when called with a block" do
+    @output = open("test.txt", "r") { |f| f.gets }
+    @output.should == "This is a test\n"
+  end
+  
+  platform_is_not :windows do
+    
+    it "opens an io when path starts with a pipe" do
+      @io = open("|date")
+      @io.should be_kind_of(IO)
+    end
+    
+    it "opens an io when called with a block" do
+      @output = open("|date") { |f| f.gets }
+      @output.should_not == ''
+    end
+  
+  end
+
+  platform_is :windows do
+    
+    it "opens an io when path starts with a pipe" do
+      @io = open("|date /t")
+      @io.should be_kind_of(IO)
+    end
+    
+    it "opens an io when called with a block" do
+      @output = open("|date /t") { |f| f.gets }
+      @output.should_not == ''
+    end
+  
+  end
+    
+  
+  it "raises an ArgumentError if not passed one argument" do
+    lambda { open }.should raise_error(ArgumentError)
+  end
+  
+  it "raises a TypeError if not passed a String type" do
+    lambda { open(nil)       }.should raise_error(TypeError)
+    lambda { open(7)         }.should raise_error(TypeError)
+    lambda { open(mock('x')) }.should raise_error(TypeError)
+  end
+end
+
+describe "Kernel.open" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/p_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/p_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/p_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,78 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#p" do
+  before :all do
+    @rs_f, @rs_b, @rs_c = $/, $\, $,
+  end
+
+  after :each do
+    $/, $\, $, = @rs_f, @rs_b, @rs_c
+  end
+
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:p)
+  end
+  
+  it "flushes output if receiver is a File" do
+    filename = tmp("Kernel_p_flush") + $$.to_s
+    begin
+      File.open(filename, "w") do |f|
+        begin
+          old_stdout = $stdout
+          $stdout = f
+          p("abcde")
+        ensure
+          $stdout = old_stdout
+        end
+
+        File.open(filename) do |f2|
+          f2.read(7).should == "\"abcde\""
+        end
+      end
+    ensure
+      File.delete(filename) rescue nil
+    end
+  end
+
+  it "prints obj.inspect followed by system record separator for each argument given" do
+    o = mock("Inspector Gadget")
+    o.should_receive(:inspect).any_number_of_times.and_return "Next time, Gadget, NEXT TIME!"
+
+    lambda { p(o) }.should output("Next time, Gadget, NEXT TIME!\n")
+    lambda { p(*[o]) }.should output("Next time, Gadget, NEXT TIME!\n")
+    lambda { p(*[o, o]) }.should output("Next time, Gadget, NEXT TIME!\nNext time, Gadget, NEXT TIME!\n")
+    lambda { p([o])}.should output("[#{o.inspect}]\n")
+  end
+
+  it "is not affected by setting $\\, $/ or $," do
+    o = mock("Inspector Gadget")
+    o.should_receive(:inspect).any_number_of_times.and_return "Next time, Gadget, NEXT TIME!"
+
+    $, = " *helicopter sound*\n"
+    lambda { p(o) }.should output_to_fd("Next time, Gadget, NEXT TIME!\n")
+
+    $\ = " *helicopter sound*\n"
+    lambda { p(o) }.should output_to_fd("Next time, Gadget, NEXT TIME!\n")
+
+    $/ = " *helicopter sound*\n"
+    lambda { p(o) }.should output_to_fd("Next time, Gadget, NEXT TIME!\n")
+  end
+
+  it "prints nothing if no argument is given" do
+    lambda { p }.should output("")
+  end
+
+  it "prints nothing if called splatting an empty Array" do
+    lambda { p(*[]) }.should output("")
+  end
+
+=begin Not sure how to spec this, but wanted to note the behavior here  
+  it "does not flush if receiver is not a TTY or a File" do
+  end 
+=end
+end
+
+describe "Kernel.p" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/print_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/print_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/print_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#print" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:print)
+  end
+end
+
+describe "Kernel.print" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/printf_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/printf_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/printf_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#printf" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:printf)
+  end
+end
+
+describe "Kernel.printf" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/private_methods_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/private_methods_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/private_methods_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#private_methods" do
+  it "returns a list of the names of privately accessible methods in the object" do
+    m = KernelSpecs::Methods.private_methods(false)
+    m.should include("shichi")
+    m = KernelSpecs::Methods.new.private_methods(false)
+    m.should include("juu_shi")
+  end
+  
+  it "returns a list of the names of privately accessible methods in the object and its ancestors and mixed-in modules" do
+    m = (KernelSpecs::Methods.private_methods(false) & KernelSpecs::Methods.private_methods)
+    
+    m.should include("shichi")
+    m = KernelSpecs::Methods.new.private_methods
+    m.should include('juu_shi')
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/proc_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/proc_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/proc_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/lambda'
+
+describe "Kernel.proc" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:proc)
+  end
+  
+  it_behaves_like(:kernel_lambda, :proc)
+end
+
+describe "Kernel#proc" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/protected_methods_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/protected_methods_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/protected_methods_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#protected_methods" do
+  it "returns a list of the names of protected methods accessible in the object" do
+    KernelSpecs::Methods.protected_methods(false).sort.should include("juu_ichi")
+    KernelSpecs::Methods.new.protected_methods(false).should include("ku")
+  end
+  
+  it "returns a list of the names of protected methods accessible in the object and from its ancestors and mixed-in modules" do
+    l1 = KernelSpecs::Methods.protected_methods(false)
+    l2 = KernelSpecs::Methods.protected_methods
+    (l1 & l2).should include("juu_ichi")
+    KernelSpecs::Methods.new.protected_methods.should include('ku')
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/public_methods_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/public_methods_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/public_methods_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#public_methods" do
+  it "returns a list of the names of publicly accessible methods in the object" do
+    KernelSpecs::Methods.public_methods(false).sort.should include("allocate", "hachi",
+      "ichi", "juu", "juu_ni", "new", "roku", "san", "shi", "superclass")
+    KernelSpecs::Methods.new.public_methods(false).sort.should include("juu_san", "ni")
+  end
+  
+  it "returns a list of the names of publicly accessible methods in the object and its ancestors and mixed-in modules" do
+    (KernelSpecs::Methods.public_methods(false) & KernelSpecs::Methods.public_methods).sort.should include(
+      "allocate", "hachi", "ichi", "juu", "juu_ni", "new", "roku", "san", "shi", "superclass")
+    m = KernelSpecs::Methods.new.public_methods
+    m.should include('ni', 'juu_san')
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/putc_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/putc_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/putc_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#putc" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:putc)
+  end
+end
+
+describe "Kernel.putc" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/puts_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/puts_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/puts_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,85 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#puts" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:puts)
+  end
+
+  before(:each) do
+    @old_stdout = $stdout
+    $stdout = IO.new(2, 'w')
+  end
+
+  after(:each) do
+    $stdout = @old_stdout
+  end
+
+  it "writes just a newline when given no args" do
+    $stdout.should_receive(:write).with("\n")
+    Kernel.puts.should == nil
+  end
+
+  it "writes nil with a newline when given nil as an arg" do
+    $stdout.should_receive(:write).with("nil")
+    $stdout.should_receive(:write).with("\n")
+    Kernel.puts(nil).should == nil
+  end
+
+  it "calls to_s before writing non-string objects" do
+    object = mock('hola')
+    object.should_receive(:to_s).and_return("hola")
+
+    $stdout.should_receive(:write).with("hola")
+    $stdout.should_receive(:write).with("\n")
+    Kernel.puts(object).should == nil
+  end
+
+  it "writes each arg if given several" do
+    $stdout.should_receive(:write).with("1")
+    $stdout.should_receive(:write).with("two")
+    $stdout.should_receive(:write).with("3")
+    $stdout.should_receive(:write).with("\n").exactly(3).times
+    Kernel.puts(1, "two", 3).should == nil
+  end
+
+  it "flattens a nested array before writing it" do
+    $stdout.should_receive(:write).with("1")
+    $stdout.should_receive(:write).with("2")
+    $stdout.should_receive(:write).with("3")
+    $stdout.should_receive(:write).with("\n").exactly(3).times
+    Kernel.puts([1, 2, [3]]).should == nil
+  end
+
+  it "writes [...] for a recursive array arg" do
+    x = []
+    x << 2 << x
+    $stdout.should_receive(:write).with("2")
+    $stdout.should_receive(:write).with("[...]")
+    $stdout.should_receive(:write).with("\n").exactly(2).times
+    Kernel.puts(x).should == nil
+  end
+
+  it "writes a newline after objects that do not end in newlines" do
+    $stdout.should_receive(:write).with("5")
+    $stdout.should_receive(:write).with("\n")
+    Kernel.puts(5).should == nil
+  end
+
+  it "does not write a newline after objects that end in newlines" do
+    $stdout.should_receive(:write).with("5\n")
+    Kernel.puts("5\n").should == nil
+  end
+
+  it "ignores the $/ separator global" do
+    $/ = ":"
+    $stdout.should_receive(:write).with("5")
+    $stdout.should_receive(:write).with("\n")
+    Kernel.puts(5).should == nil
+    $/ = "\n"
+  end
+end
+
+describe "Kernel.puts" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/raise_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/raise_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/raise_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/../../shared/kernel/raise'
+
+describe "Kernel#raise" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:raise)
+  end
+end
+
+describe "Kernel#raise" do
+  it_behaves_like :kernel_raise, :raise, Kernel
+end
+
+describe "Kernel.raise" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/rand_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/rand_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/rand_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,40 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel.rand" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:rand)
+  end
+  
+  it "returns a random float less than 1 if no max argument is passed" do
+    rand.kind_of?(Float).should == true
+  end
+
+  it "returns a random int or bigint less than the argument for an integer argument" do
+    rand(77).kind_of?(Integer).should == true
+  end
+
+  it "returns a random integer less than the argument casted to an int for a float argument greater than 1" do
+    rand(1.3).kind_of?(Integer).should == true
+  end
+
+  it "returns a random float less than 1 for float arguments less than 1" do
+    rand(0.01).kind_of?(Float).should == true
+  end
+
+  it "never returns a value greater or equal to 1.0 with no arguments" do
+    1000.times do
+      (rand < 1.0).should == true
+    end
+  end
+
+  it "never returns a value greater or equal to any passed in max argument" do
+    1000.times do
+      (rand(100) < 100).should == true
+    end
+  end
+end
+
+describe "Kernel#rand" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/readline_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/readline_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/readline_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#readline" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:readline)
+  end
+end
+
+describe "Kernel.readline" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/readlines_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/readlines_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/readlines_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#readlines" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:readlines)
+  end
+end
+
+describe "Kernel.readlines" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/remove_instance_variable_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/remove_instance_variable_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/remove_instance_variable_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#remove_instance_variable" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:remove_instance_variable)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/require_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/require_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/require_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,304 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+$require_fixture_dir = (File.dirname(__FILE__) + '/../../fixtures/require')
+$require_tmp_dir = tmp("require_specs")
+$LOAD_PATH << $require_fixture_dir
+$LOAD_PATH << $require_tmp_dir
+
+$require_spec   = nil
+$require_spec_1 = nil
+$require_spec_2 = nil
+$require_spec_3 = nil
+$require_spec_4 = nil
+$require_spec_5 = nil
+$require_spec_6 = nil
+$require_spec_7 = nil
+$require_spec_8 = nil
+$require_spec_9 = nil
+$require_spec_10 = nil
+$require_spec_rooby = nil
+$require_spec_recursive = nil
+
+require 'rbconfig'
+
+describe "Kernel#require" do
+  conflicts_with :Gem do
+    # rubygems redefines #require without setting its
+    # visibility back to module_function or private
+    it "is a private method" do
+      Kernel.should have_private_instance_method(:require)
+    end
+  end
+
+  # Avoid storing .rbc in repo
+  before :all do
+    Dir.mkdir($require_tmp_dir)
+    Dir.chdir($require_tmp_dir) { 
+      FileUtils.touch("require_spec_dummy.#{Config::CONFIG['DLEXT']}")
+      FileUtils.touch("require_spec_dummy.rb")
+    }
+  end
+
+  after :all do
+    FileUtils.rm_rf($require_tmp_dir)
+  end
+
+  # The files used below just contain code that assigns
+  # Time.now to the respective global variable so that
+  # reloads can easily be verified.
+
+  # CAUTION: Some of these work because a different path is used to
+  #          load the same file. Be careful if you change the order
+  #          or add items.
+
+  it "requires arbitrarily complex files (files with large numbers of AST nodes)" do
+    lambda {require File.expand_path(File.dirname(__FILE__)) + '/fixtures/test'}.should_not raise_error
+  end
+  it "loads a .rb from an absolute path and returns true" do
+    path = File.expand_path(File.dirname(__FILE__) + '/../../fixtures/require/require_spec_1.rb')
+
+    require(path).should == true
+    $require_spec_1.nil?.should == false
+  end
+
+  it "loads a .rb from a relative path and returns true" do
+    Dir.chdir($require_fixture_dir) do |dir|
+      $require_spec_1 = nil
+      require('../../fixtures/require/require_spec_1.rb').should == true
+      $require_spec_1.nil?.should == false
+
+      $require_spec_1 = nil
+      require('./../require/require_spec_1.rb').should == true
+      $require_spec_1.nil?.should == false
+    end
+  end
+
+  it "loads an unqualified .rb by looking in $LOAD_PATH and returns true" do
+    require('require_spec_2.rb').should == true
+    $require_spec_2.nil?.should == false
+  end
+
+  # TODO: add an implementation-agnostic method for creating
+  # an extension file
+  it "loads extension files"
+
+  it "does not expand/resolve qualified files against $LOAD_PATH" do
+    num_features = $LOADED_FEATURES.size
+    Dir.chdir($require_fixture_dir + '/../') do |dir|
+      # This would be a valid path if expanded against the fixture dir
+      lambda { require '../require/require_spec_2.rb' }.should raise_error LoadError
+    end
+    $LOADED_FEATURES.size.should == num_features
+  end
+
+  it "allows unqualified files to contain path information (just not in the beginning)" do
+    name = (File.dirname(__FILE__) + '/../../fixtures')
+    $LOAD_PATH << name
+
+    $require_spec2 = nil
+    require('require/../require/require_spec_2.rb').should == true
+    $require_spec_2.nil?.should == false
+    
+    $LOAD_PATH.delete name
+  end
+
+  it "loads a file with ./filename even if . is not in path" do
+    Dir.chdir($require_fixture_dir) do |dir| 
+	 path_backup = $LOAD_PATH.clone
+	 $LOAD_PATH.clear
+	 $LOAD_PATH << "Someirrelevantpath"
+     begin
+      require('./require_spec.rb').should == true    
+     ensure
+	  $LOAD_PATH.clear
+	  $LOAD_PATH.concat(path_backup)    
+	 end 
+	end
+  end
+  
+  it "appends a file with no extension with .rb/.<ext> in that order to locate file" do
+    load('require_spec')
+    $require_spec.should == :noext
+    load('require_spec.rb')
+    $require_spec.should == :rb
+
+    $require_spec = nil
+
+    require('require_spec')
+    $require_spec.should == :rb
+  end
+
+  it "prefers to use .rb over .<ext> if given non-extensioned file and both exist" do
+    require('require_spec_dummy').should == true
+    $LOADED_FEATURES.include?('require_spec_dummy.rb').should == true
+    $LOADED_FEATURES.include?("require_spec_dummy.#{Config::CONFIG['DLEXT']}").should == false
+  end
+
+  runner_is_not :rspec do
+    it "will not add a bad load to LOADED_FEATURES" do
+      lambda { require('require_spec_raises') }.should raise_error(RuntimeError)
+    
+      $LOADED_FEATURES.include?('require_spec_raises.rb').should == false
+    end
+  end
+
+  it "will load file.rb when given 'file' if it exists even if file.<ext> is loaded" do
+    $LOADED_FEATURES << "require_spec_3.#{Config::CONFIG['DLEXT']}"
+    require('require_spec_3.rb').should == true
+    $LOADED_FEATURES.include?('require_spec_3.rb').should == true
+  end
+
+  it "will not load file.<ext> when given 'file' if file.rb already loaded" do
+    unless $LOADED_FEATURES.include?('require_spec_dummy.rb')
+      require('require_spec_dummy.rb') 
+    end
+
+    require('require_spec_dummy').should == false
+  end
+
+  # TODO: add an implementation-agnostic method for creating
+  # an extension file
+  it "will load explicit file.<ext> even if file.rb already loaded and vice versa"
+
+  it "appends any non-ruby extensioned file with .rb/.<ext> in that order to locate file" do
+    load('require_spec.rooby')
+    $require_spec_rooby.should == :rooby
+    load('require_spec.rooby.rb')
+    $require_spec_rooby.should == :rb
+
+    $require_spec_rooby = nil
+
+    require('require_spec.rooby')
+    $require_spec_rooby.should == :rb
+  end
+
+  it "produces __FILE__ as the given filename and __LINE__ as the source line number" do
+    Dir.chdir($require_fixture_dir) do |dir|
+      require('require_spec_4').should == true 
+      $require_spec_4.should == [['./require_spec_4.rb', 1], ['./require_spec_4.rb', 10]]
+
+      extended_on :rubinius do
+        `rm require_spec_4.rbc`
+      end
+    end
+
+    $require_spec_4 = nil
+
+    require("#{$require_fixture_dir}/require_spec_4").should == true 
+    $require_spec_4[0][0].should =~ %r[^.*/fixtures/require/require_spec_4.rb]
+    $require_spec_4[0][1].should == 1
+    $require_spec_4[1][0].should =~ %r[^.*/fixtures/require/require_spec_4.rb]
+    $require_spec_4[1][1].should == 10
+  end
+
+  it "stores the loaded file in $LOADED_FEATURES" do
+    $LOADED_FEATURES.include?('require_spec_6.rb').should == false
+    require('require_spec_6.rb').should == true
+    $LOADED_FEATURES.include?('require_spec_6.rb').should == true
+  end
+
+  it "stores a non-extensioned file with its located suffix" do
+    $LOADED_FEATURES.delete 'require_spec_6.rb'
+
+    require('require_spec_6').should == true
+
+    $LOADED_FEATURES.include?('require_spec_6.rb').should == true
+  end
+
+  it "bases the filename in $LOADED_FEATURES on the path given, not just basename" do
+    $LOADED_FEATURES.include?('require_spec_6.rb').should == true
+
+    Dir.chdir($require_fixture_dir) do |dir|
+      require('../../fixtures/require/require_spec_6.rb').should == true 
+    end
+
+    $LOADED_FEATURES.include?('require_spec_6.rb').should == true
+    $LOADED_FEATURES.include?('../../fixtures/require/require_spec_6.rb').should == true
+  end
+
+  it "will not load the same file twice, returns false instead" do
+    $LOADED_FEATURES.include?('require_spec_7.rb').should == false
+
+    require('require_spec_7.rb').should == true
+    a = $require_spec_7
+    a.nil?.should == false
+    
+    $LOADED_FEATURES.include?('require_spec_7.rb').should == true
+
+    require('require_spec_7.rb').should == false
+    b = $require_spec_7
+    b.nil?.should == false
+
+    # Timestamps should not differ
+    a.should eql(b)
+
+    $LOADED_FEATURES.include?('require_spec_7.rb').should == true
+  end
+
+  it "checks $LOADED_FEATURES to see whether file is already loaded" do
+    $LOADED_FEATURES.include?('require_spec_7.rb').should == true
+    require('require_spec_7.rb').should == false
+
+    $LOADED_FEATURES.delete 'require_spec_7.rb'
+    require('require_spec_7.rb').should == true
+    require('require_spec_7.rb').should == false
+
+    $LOADED_FEATURES.include?('require_spec_7.rb').should == true
+  end
+  
+  it "raises a LoadError if the file can't be found" do
+    lambda { require "nonesuch#{$$}#{Time.now.to_f}" }.should raise_error LoadError
+  end
+
+  it "only accepts strings" do
+    lambda { require(nil) }.should raise_error(TypeError)
+    lambda { require(42)  }.should raise_error(TypeError)
+    lambda { require([])  }.should raise_error(TypeError)
+  end
+
+  it "does not infinite loop on an rb file that requires itself" do
+    $require_spec_recursive = nil
+    $LOADED_FEATURES.delete 'require_spec_recursive.rb'
+
+    $LOADED_FEATURES.include?('require_spec_recursive.rb').should == false
+    require('require_spec_recursive').should == true
+    $LOADED_FEATURES.include?('require_spec_recursive.rb').should == true
+    $require_spec_recursive.nil?.should == false
+  end
+end
+
+describe "Shell expansion in Kernel#require" do
+  before :all do
+    @rs_home = ENV["HOME"]
+    ENV["HOME"] = $require_fixture_dir
+    @rs_short = "~/require_spec_1.rb"
+    @rs_long  = "#{$require_fixture_dir}/require_spec_1.rb"
+  end
+
+  after :all do
+    ENV["HOME"] = @rs_home
+  end
+
+  before :each do
+    $LOADED_FEATURES.delete @rs_long
+    $LOADED_FEATURES.delete @rs_short
+  end
+
+  it "expands a preceding ~/ to the user's home directory for building the path to search" do
+    $require_spec_1 = nil
+    require(@rs_short).should == true
+    $require_spec_1.nil?.should == false
+  end
+
+  it "adds the path to $LOADED_FEATURES" do
+    $require_spec_1 = nil
+    require(@rs_short).should == true
+    $require_spec_1.nil?.should == false
+
+    $LOADED_FEATURES.find {|f| f == @rs_short || f == @rs_long }.nil?.should == false
+  end
+end
+
+describe "Kernel.require" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/respond_to_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/respond_to_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/respond_to_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,63 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel.respond_to?" do  
+  it "indicates if a singleton object responds to a particular message" do
+    class KernelSpecs::Foo; def self.bar; 'done'; end; end
+    KernelSpecs::Foo.respond_to?(:bar).should == true
+    KernelSpecs::Foo.respond_to?(:baz).should == false
+  end
+end
+
+describe "Kernel#respond_to?" do
+  before :each do 
+    @a = KernelSpecs::A.new  
+  end
+
+  it "returns false if the given method was undefined" do
+    @a.respond_to?(:undefed_method).should == false
+    @a.respond_to?("undefed_method").should == false
+  end
+
+  it "returns true if obj responds to the given public method" do    
+    @a.respond_to?("five").should == false
+    @a.respond_to?(:public_method).should == true
+    @a.respond_to?("public_method").should == true
+  end
+  
+  it "returns true if obj responds to the given protected method" do
+    @a.respond_to?("five", true).should == false
+    @a.respond_to?(:protected_method, false).should == true
+    @a.respond_to?("protected_method", false).should == true
+  end
+  
+  it "returns true if obj responds to the given protected method, include_private = true" do 
+    @a.respond_to?("seven").should == false
+    @a.respond_to?(:protected_method).should == true
+    @a.respond_to?("protected_method").should == true
+  end
+  
+  it "returns true if obj responds to the given protected method" do
+    @a.respond_to?("seven", true).should == false
+    @a.respond_to?(:protected_method, false).should == true
+    @a.respond_to?("protected_method", false).should == true
+  end
+  
+  it "returns true if obj responds to the given private method, include_private = true" do
+    @a.respond_to?("six").should == false
+    @a.respond_to?(:private_method).should == false
+    @a.respond_to?("private_method").should == false
+  end
+  
+  it "returns true if obj responds to the given private method" do    
+    @a.respond_to?("six", true).should == false
+    @a.respond_to?(:private_method, true).should == true    
+    @a.respond_to?("private_method", true).should == true
+  end 
+
+  it "indicates if an object responds to a particular message" do
+    class KernelSpecs::Foo; def bar; 'done'; end; end
+    KernelSpecs::Foo.new.respond_to?(:bar).should == true
+    KernelSpecs::Foo.new.respond_to?(:invalid_and_silly_method_name).should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/scan_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/scan_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/scan_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#scan" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:scan)
+  end
+end
+
+describe "Kernel.scan" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/select_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/select_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/select_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#select" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:select)
+  end
+end
+
+describe "Kernel.select" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/send_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/send_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/send_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,102 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#send" do
+  it "invokes the named method" do
+    class KernelSpecs::Foo
+      def bar
+        'done'
+      end
+
+      private
+      def bar2
+        'done2'
+      end
+    end
+    KernelSpecs::Foo.new.send(:bar).should == 'done'
+    KernelSpecs::Foo.new.send(:bar2).should == 'done2'
+  end
+
+  it "invokes a class method if called on a class" do
+    class KernelSpecs::Foo
+      def self.bar
+        'done'
+      end
+    end
+    KernelSpecs::Foo.send(:bar).should == 'done'
+  end
+
+  it "raises a NoMethodError if the corresponding method can't be found" do
+    class KernelSpecs::Foo
+      def bar
+        'done'
+      end
+    end
+    lambda { KernelSpecs::Foo.new.send(:baz) }.should raise_error(NameError)
+  end
+
+  it "raises a NoMethodError if the corresponding singleton method can't be found" do
+    class KernelSpecs::Foo
+      def self.bar
+        'done'
+      end
+    end
+    lambda { KernelSpecs::Foo.send(:baz) }.should raise_error(NameError)
+  end
+
+  it "raises an ArgumentError if called with more arguments than available parameters" do
+    class KernelSpecs::Foo
+      def bar; end
+    end
+
+    lambda { KernelSpecs::Foo.new.send(:bar, :arg) }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError if called with fewer arguments than required parameters" do
+    class KernelSpecs::Foo
+      def foo(arg); end
+    end
+
+    lambda { KernelSpecs::Foo.new.send(:foo) }.should raise_error(ArgumentError)
+  end
+
+  it "succeeds if passed an arbitrary number of arguments as a splat parameter" do
+    class KernelSpecs::Foo
+      def baz(*args) args end
+    end
+
+    begin
+      KernelSpecs::Foo.new.send(:baz).should == []
+      KernelSpecs::Foo.new.send(:baz, :quux).should == [:quux]
+      KernelSpecs::Foo.new.send(:baz, :quux, :foo).should == [:quux, :foo]
+    rescue
+      fail
+    end
+  end
+
+  it "succeeds when passing 1 or more arguments as a required and a splat parameter" do
+    class KernelSpecs::Foo
+      def foo(first, *rest) [first, *rest] end
+    end
+
+    begin
+      KernelSpecs::Foo.new.send(:baz, :quux).should == [:quux]
+      KernelSpecs::Foo.new.send(:baz, :quux, :foo).should == [:quux, :foo]
+    rescue
+      fail
+    end
+  end
+
+  it "succeeds when passing 0 arguments to a method with one parameter with a default" do
+    class KernelSpecs::Foo
+      def foo(first = true) first end
+    end
+
+    begin
+      KernelSpecs::Foo.new.send(:foo).should == true
+      KernelSpecs::Foo.new.send(:foo, :arg).should == :arg
+    rescue
+      fail
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/set_trace_func_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/set_trace_func_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/set_trace_func_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#set_trace_func" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:set_trace_func)
+  end
+end
+
+describe "Kernel.set_trace_func" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/shared/lambda.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/shared/lambda.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/shared/lambda.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,39 @@
+describe :kernel_lambda, :shared => true do
+  it "returns a Proc object" do
+    send(@method) { true }.kind_of?(Proc).should == true
+  end
+
+  it "raises an ArgumentError when no block is given" do
+    lambda { send(@method) }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError when given too many arguments" do
+    lambda {
+      send(@method) { |a, b| a + b }.call(1, 2, 5)
+    }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError when given too few arguments" do
+    lambda {
+      send(@method) { |a, b| a + b }.call(1)
+    }.should raise_error(ArgumentError)
+  end
+
+  it "returns from block into caller block" do
+    # More info in the pickaxe book pg. 359
+    def some_method(cmd)
+      p = send(cmd) { return 99 }
+      res = p.call
+      "returned #{res}"
+    end
+
+    # Have to pass in the @method errors otherwise
+    some_method(@method).should == "returned 99"
+
+    def some_method2(&b) b end
+    a_proc = send(@method) { return true }
+    res = some_method2(&a_proc)
+
+    res.call.should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/shared/object_id.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/shared/object_id.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/shared/object_id.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+describe :kernel_object_id, :shared => true do
+  # #object_id and #__id__ are aliases, so we only need one function
+  # that tests both methods
+  it "returns an integer" do
+    mock('fixnum').send(@method).class.should == Fixnum
+    nil.send(@method).class.should == Fixnum
+  end
+
+  it "returns the same value on all calls to id for a given object" do
+    o1 = mock('x')
+    o1.send(@method).should == o1.send(@method)
+  end
+
+  it "returns different values for different objects" do
+    o1 = mock('o1')
+    o2 = mock('o2')
+    o1.send(@method).should_not == o2.send(@method)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/singleton_method_added_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/singleton_method_added_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/singleton_method_added_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#singleton_method_added" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:singleton_method_added)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/singleton_method_removed_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/singleton_method_removed_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/singleton_method_removed_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#singleton_method_removed" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:singleton_method_removed)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/singleton_method_undefined_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/singleton_method_undefined_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/singleton_method_undefined_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#singleton_method_undefined" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:singleton_method_undefined)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/singleton_methods_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/singleton_methods_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/singleton_methods_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#singleton_methods" do
+  it "returns a list of the names of singleton methods in the object" do
+    m = KernelSpecs::Methods.singleton_methods(false)
+    ["hachi", "ichi", "juu", "juu_ichi", "juu_ni", "roku", "san", "shi"].each do |e|
+      m.should include(e)
+    end
+    
+    KernelSpecs::Methods.new.singleton_methods(false).should == []
+  end
+  
+  it "should handle singleton_methods call with and without argument" do
+    [1, "string", :symbol, [], {} ].each do |e|
+      lambda {e.singleton_methods}.should_not raise_error
+      lambda {e.singleton_methods(true)}.should_not raise_error
+      lambda {e.singleton_methods(false)}.should_not raise_error
+    end
+    
+  end
+  
+  it "returns a list of the names of singleton methods in the object and its ancestors and mixed-in modules" do
+    m = (KernelSpecs::Methods.singleton_methods(false) & KernelSpecs::Methods.singleton_methods)
+    ["hachi", "ichi", "juu", "juu_ichi", "juu_ni", "roku", "san", "shi"].each do |e|
+      m.should include(e)
+    end
+    
+    KernelSpecs::Methods.new.singleton_methods.should == []
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/sleep_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/sleep_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/sleep_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,42 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#sleep" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:sleep)
+  end
+  
+  it "pauses execution for approximately the duration requested" do
+    duration = 0.1
+    start = Time.now
+    sleep duration
+    (Time.now - start).should be_close(duration, 0.1)
+  end
+  
+  it "returns the rounded number of seconds asleep" do
+    sleep(0.01).should be_kind_of(Integer)
+  end
+  
+  it "raises a TypeError when passed a non-numeric duration" do
+    lambda { sleep(nil)   }.should raise_error(TypeError)
+    lambda { sleep('now') }.should raise_error(TypeError)
+    lambda { sleep('2')   }.should raise_error(TypeError)
+  end
+  
+  it "pauses execution indefinitely if not given a duration" do
+    lock = Channel.new
+    t = Thread.new do
+      lock << :ready
+      sleep
+      5
+    end    
+    lock.receive.should == :ready
+    Thread.pass unless t.status == "sleep"
+    t.run
+    t.value.should == 5
+  end
+end
+
+describe "Kernel.sleep" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/split_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/split_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/split_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#split" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:split)
+  end
+end
+
+describe "Kernel.split" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/sprintf_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/sprintf_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/sprintf_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#sprintf" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:sprintf)
+  end
+  
+  it "treats nil arguments as zero-width strings in %s slots" do
+    sprintf("%s%d%s%s", nil, 4, 'a', 'b').should == '4ab'
+  end
+
+  it "treats nil arguments as zeroes in %d slots" do
+    sprintf("%d%d%s%s", nil, 4, 'a', 'b').should == '04ab'
+  end
+end
+
+describe "Kernel.sprintf" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/srand_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/srand_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/srand_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel.srand" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:srand)
+  end
+  
+  it "srand should return the previous seed value" do
+    srand(10)
+    srand(20).should == 10
+  end
+
+  it "srand should seed the RNG correctly and repeatably" do
+    srand(10)
+    x = rand
+    srand(10)
+    rand.should == x
+  end
+
+  it "defaults number to a random value" do
+    lambda { srand }.should_not raise_error
+    srand.should_not == 0
+  end
+
+  it "calls #to_i on number" do
+    srand(3.8)
+    srand.should == 3
+  end
+end
+
+describe "Kernel#srand" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/sub_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/sub_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/sub_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#sub" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:sub)
+  end
+end
+
+describe "Kernel#sub!" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:sub!)
+  end
+end
+
+describe "Kernel.sub" do
+  it "needs to be reviewed for spec completeness"
+end
+
+describe "Kernel.sub!" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/syscall_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/syscall_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/syscall_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#syscall" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:syscall)
+  end
+end
+
+describe "Kernel.syscall" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/system_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/system_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/system_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,60 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#system" do
+
+  it "can run basic things that exist" do
+    begin
+      result = false
+
+      File.exist?("happy").should == false
+      result = system("echo a >> happy")
+      result.should == true
+      File.exist?("happy").should == true
+    ensure
+      File.unlink "happy"
+    end
+  end
+
+  it "returns false when it can't" do
+    result = system("sad")
+    result.should == false
+  end
+
+  it "does not write to stderr when it can't find a command" do
+    system("sad").should output_to_fd("") # nothing in stderr
+  end  
+
+  it "uses /bin/sh if freaky shit is in the command" do
+    begin
+      result = false
+
+      File.exist?("happy").should == false
+      result = system("echo woot > happy")
+      result.should == true
+      File.exist?("happy").should == true
+    ensure
+      File.unlink "happy"
+    end
+  end
+
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:system)
+  end
+
+  before :each do
+    ENV['TEST_SH_EXPANSION'] = 'foo'
+    @shell_var = platform_is(:windows) ? '%TEST_SH_EXPANSION%' : '$TEST_SH_EXPANSION'
+    @helper_script = KernelSpecs.helper_script
+  end
+
+  it "expands shell variables when given a single string argument" do
+    result = system("ruby #{@helper_script} #{@shell_var} foo")
+    result.should be_true
+  end
+  
+  it "does not expand shell variables when given multiples arguments" do
+    result = system("ruby", @helper_script, @shell_var, "foo")
+    result.should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/taint_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/taint_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/taint_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#taint" do
+  it "sets self to be tainted" do
+    mock('tainted?').taint.tainted?.should == true
+  end
+  
+  it "has no effect on immediate values" do
+    a = nil
+    b = true
+    c = false
+    d = 1
+    a.tainted?.should == false
+    b.tainted?.should == false
+    c.tainted?.should == false
+    d.tainted?.should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/tainted_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/tainted_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/tainted_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#tainted?" do
+  it "returns true if Object is tainted" do
+    o = mock('o')
+    p = mock('p')
+    p.taint
+    o.tainted?.should == false
+    p.tainted?.should == true
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/test_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/test_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/test_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#test" do
+  before :all do
+    @file = File.dirname(__FILE__) + '/fixtures/classes.rb'
+    @dir = File.dirname(__FILE__) + '/fixtures'
+  end
+  
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:test)
+  end
+  
+  it "returns true when passed ?f if the argument is a regular file" do
+    Kernel.test(?f, @file).should == true
+  end
+  
+  it "returns true when passed ?e if the argument is a file" do
+    Kernel.test(?e, @file).should == true
+  end
+  
+  it "returns true when passed ?d if the argument is a directory" do
+    Kernel.test(?d, @dir).should == true
+  end
+end
+
+describe "Kernel.test" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/throw_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/throw_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/throw_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,91 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel.throw" do
+  it "transfers control to the end of the active catch block waiting for symbol" do
+    catch(:blah) do
+      :value
+      throw :blah
+      fail("throw didn't transfer the control")
+    end.should be_nil
+  end
+
+  it "transfers control to the innermost catch block waiting for the same sympol" do
+    one = two = three = 0
+    catch :duplicate do
+      catch :duplicate do
+        catch :duplicate do
+          one = 1
+          throw :duplicate
+        end
+        two = 2
+        throw :duplicate
+      end
+      three = 3
+      throw :duplicate
+    end
+    [one, two, three].should == [1, 2, 3]
+  end
+
+  it "sets the return value of the catch block to nil by default" do
+    res = catch :blah do
+      throw :blah
+    end
+    res.should == nil
+  end
+
+  it "sets the return value of the catch block to a value specified as second parameter" do
+    res = catch :blah do
+      throw :blah, :return_value
+    end
+    res.should == :return_value
+  end
+
+  it "raises NameError if there is no catch block for the symbol" do
+    proc {
+      throw :blah
+    }.should raise_error(NameError) { |error|
+      # TODO:
+      # See: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/17629
+      #
+      # The ruby docs are not clear whether NameError#name should
+      # retrun String or Symbol. Well, the docs state the *String*
+      # should be returned, but the actual MRI behavior is to return Symbol.
+      # And in MRI 1.9, even different Exception raised altogether.
+
+      # So, instead of checking that error.name == :blah, we perform
+      # more generic test, suitable for different implementations
+      # (like JRuby, since JRuby follows the ruby-doc, and returns String).
+      error.name.to_s.should == "blah"
+    }
+  end
+
+  it "raises ArgumentError if 3 or more arguments provided" do
+    lambda {
+      catch :blah do
+        throw :blah, :return_value, 2
+      end
+    }.should raise_error(ArgumentError)
+
+    lambda {
+      catch :blah do
+        throw :blah, :return_value, 2, 3, 4, 5
+      end
+    }.should raise_error(ArgumentError)
+  end
+
+  it "raises TypeError if the first argument is not a symbol" do
+    lambda {
+      catch :blah do
+        throw Object.new
+      end
+    }.should raise_error(TypeError)
+  end
+
+end
+
+describe "Kernel#throw" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:throw)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/to_a_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/to_a_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/to_a_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#to_a" do
+  it "is defined on Kernel" do
+    Kernel.instance_methods.should include('to_a')
+  end
+end
+
+describe "Kernel#to_a when the receiver is an Array" do
+  it "returns self" do
+    array = [1, 2]
+    array.to_a.should equal(array)
+  end
+end
+
+describe "Kernel#to_a when the receiver is not an Array" do
+  it "returns an Array containing self" do
+    object = "I am not an array"
+    object.to_a.should == [object]
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#to_s" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/trace_var_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/trace_var_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/trace_var_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#trace_var" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:trace_var)
+  end
+end
+
+describe "Kernel.trace_var" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/trap_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/trap_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/trap_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#trap" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:trap)
+  end
+end
+
+describe "Kernel.trap" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/trust_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/trust_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/trust_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#trust" do
+  ruby_version_is "1.9" do
+    it "clears the untrusted bit from a target object" do
+      o = mock('o')
+      o.untrusted?.should == false
+      o.untrust
+      o.untrusted?.should == true
+      o.trust
+      o.untrusted?.should == false
+    end
+
+    it "can not be called on frozen object" do
+      o = mock('o')
+      o.untrust
+      lambda {o.trust}.should_not raise_error
+      o.untrust
+      o.freeze
+      lambda {o.trust}.should raise_error(RuntimeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/type_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/type_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/type_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#type" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/untaint_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/untaint_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/untaint_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#untaint" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/untrace_var_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/untrace_var_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/untrace_var_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#untrace_var" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:untrace_var)
+  end
+end
+
+describe "Kernel.untrace_var" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/untrust_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/untrust_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/untrust_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#untrusted?" do
+  ruby_version_is "1.9" do
+    it "sets the untrusted bit on a target object" do
+      o = mock('o')
+      o.untrusted?.should == false
+      o.untrust
+      o.untrusted?.should == true
+    end
+
+    it "can not be called on frozen object" do
+      o = mock('o')
+      lambda {o.untrust}.should_not raise_error
+      o.trust
+      o.freeze
+      lambda {o.untrust}.should raise_error(RuntimeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/untrusted_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/untrusted_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/untrusted_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#untrusted?" do
+  ruby_version_is "1.9" do
+    it "returns the untrusted status of an object" do
+      o = mock('o')
+      o.untrusted?.should == false
+      o.untrust
+      o.untrusted?.should == true
+    end
+
+    it "has no effect on immediate values" do
+      a = nil
+      b = true
+      c = false
+      d = 1
+      a.untrust
+      b.untrust
+      c.untrust
+      d.untrust
+      a.untrusted?.should == false
+      b.untrusted?.should == false
+      c.untrusted?.should == false
+      d.untrusted?.should == false
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/kernel/warn_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/warn_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/warn_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,59 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel.warn" do
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:warn)
+  end
+  
+  it "calls #write on $stderr if $VERBOSE is true" do
+    lambda {
+      v = $VERBOSE
+      $VERBOSE = true
+
+      warn("this is some simple text")
+
+      $VERBOSE = v
+    }.should output(nil, "this is some simple text\n")
+  end
+
+  it "calls #write on $stderr if $VERBOSE is false" do
+    lambda {
+      v = $VERBOSE
+      $VERBOSE = false
+
+      warn("this is some simple text")
+
+      $VERBOSE = v
+    }.should output(nil, "this is some simple text\n")
+  end
+
+  it "does not call #write on $stderr if $VERBOSE is nil" do
+    lambda {
+      v = $VERBOSE
+      $VERBOSE = nil
+
+      warn("this is some simple text")
+
+      $VERBOSE = v
+    }.should output(nil, "")
+  end
+
+  it "writes the default record separator and NOT $/ to $stderr after the warning message" do
+    lambda {
+      v = $VERBOSE
+      rs = $/
+      $VERBOSE = true
+      $/ = 'rs'
+
+      warn("")
+
+      $VERBOSE = v
+      $/ = rs
+    }.should output(nil, /\n/)
+  end
+end
+
+describe "Kernel#warn" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/core/marshal/dump_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/marshal/dump_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/marshal/dump_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,170 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/marshal_data'
+
+mv = [Marshal::MAJOR_VERSION].pack 'C'
+nv = [Marshal::MINOR_VERSION].pack 'C'
+
+class UserDefinedBad
+  def _dump(depth); 10; end
+end
+
+# TODO: these need to be reviewed and cleaned up
+describe "Marshal.dump" do
+  it "raises an ArgumentError when the recursion limit is exceeded" do
+    lambda { Marshal.dump([], 1) }.should_not raise_error(ArgumentError)
+    lambda { Marshal.dump([[]], 2) }.should_not raise_error(ArgumentError)
+    lambda { Marshal.dump([[[]]], 3) }.should_not raise_error(ArgumentError)
+
+    h = {'one' => {'two' => {'three' => 0}}}
+    lambda { Marshal.dump(h, 3) }.should raise_error(ArgumentError)
+    lambda { Marshal.dump([h], 4) }.should raise_error(ArgumentError)
+    lambda { Marshal.dump({}, 1) }.should_not raise_error(ArgumentError)
+    lambda { Marshal.dump(h, 4) }.should_not raise_error(ArgumentError)
+
+    lambda { Marshal.dump([], 0)     }.should raise_error(ArgumentError)
+    lambda { Marshal.dump([[[]]], 1) }.should raise_error(ArgumentError)
+  end
+
+  it "ignores the recursion limit if the limit is negative" do
+    Marshal.dump([], -1).should == "\004\b[\000"
+    Marshal.dump([[]], -1).should == "\004\b[\006[\000"
+    Marshal.dump([[[]]], -1).should == "\004\b[\006[\006[\000"
+  end
+
+  it "writes the serialized data to the IO-Object" do
+    (obj = mock('test')).should_receive(:write).at_least(1)
+    Marshal.dump("test", obj)
+  end
+
+  it "returns the IO-Object" do
+    (obj = mock('test')).should_receive(:write).at_least(1)
+    Marshal.dump("test", obj).should == obj
+  end
+
+  it "raises an Error when the IO-Object does not respond to #write" do
+    obj = mock('test')
+    lambda { Marshal.dump("test", obj) }.should raise_error(TypeError)
+  end
+
+  it "raises an ArgumentError when given more than three arguments" do
+    lambda { Marshal.dump(nil, nil, nil, nil) }.should raise_error(ArgumentError)
+  end
+
+  it "raises an Error when trying to dump an anonymous class/module" do
+    klass = Class.new
+    mod = Module.new
+
+    lambda { Marshal.dump(klass) }.should raise_error(TypeError)
+    lambda { Marshal.dump(mod)   }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError if _dump returns a non-string" do
+    lambda { Marshal.dump(UserDefinedBad.new) }.should raise_error(TypeError)
+  end
+
+  it "dumps an Object" do
+    Marshal.dump(Object.new).should == "#{mv+nv}o:\x0BObject\x00"
+  end
+
+  it "dumps an extended_object" do
+    Marshal.dump(Object.new.extend(Meths)).should == "#{mv+nv}e:\x0AMethso:\x0BObject\x00"
+  end
+
+  it "dumps an object having ivar" do
+    s = 'hi'
+    obj = Object.new
+    obj.instance_variable_set(:@str, [:so, :so, s, s])
+    Marshal.dump(obj).should == "#{mv+nv}o:\x0BObject\x06:\x09 at str[\x09:\x07so;\x07\"\x07hi@\x07"
+  end
+
+  it "dumps an extended_user_regexp having ivar" do
+    r = UserRegexp.new('').extend(Meths)
+    r.instance_variable_set(:@noise, 'much')
+    Marshal.dump(r).should == "#{mv+nv}Ie:\x0AMethsC:\x0FUserRegexp/\x00\x00\x06:\x0B at noise\"\x09much"
+  end
+
+  it "raises a TypeError with hash having default proc" do
+    lambda { Marshal.dump(Hash.new {}) }.should raise_error(TypeError)
+  end
+
+  it "dumps an extended_user_hash_default" do
+    h = UserHash.new(:Meths).extend(Meths)
+    h['three'] = 3
+    Marshal.dump(h).should == "#{mv+nv}e:\x0AMethsC:\x0DUserHash}\x06\"\x0Athreei\x08;\x00"
+  end
+
+  it "dumps an extended_user_hash with a parameter to initialize" do
+    h = UserHashInitParams.new(:abc).extend(Meths)
+    h['three'] = 3
+    Marshal.dump(h).should == "\004\bIe:\nMethsC:\027UserHashInitParams{\006\"\nthreei\b\006:\a at a:\babc"
+  end
+
+  it "dumps an array containing objects having _dump method" do
+    o1 = UserDefined.new
+    o2 = UserDefinedWithIvar.new
+    a = [o1, o2, o1, o2]
+    Marshal.dump(a).should ==
+      "#{mv+nv}[\tu:\020UserDefined\022\004\b[\a\"\nstuff@\006u:\030UserDefinedWithIvar5\004\b[\bI\"\nstuff\006:\t at foo:\030UserDefinedWithIvar\"\tmore@\a@\006@\a"
+  end
+
+  it "dumps an array containing objects having marshal_dump method" do
+    o1 = UserMarshal.new
+    o2 = UserMarshalWithIvar.new
+    a = [o1, o2, o1, o2]
+    Marshal.dump(a).should ==
+      "#{mv+nv}[\tU:\020UserMarshal\"\nstuffU:\030UserMarshalWithIvar[\006\"\fmy data@\006@\b"
+  end
+
+  it "dumps an array containing the same objects" do
+    s = 'oh'; b = 'hi'; r = //; d = [b, :no, s, :go]; c = String
+    a = [:so, 'hello', 100, :so, :so, d, :so, :so, :no, :go, c, nil,
+          :go, :no, s, b, r, :so, 'huh', true, b, b, 99, r, b, s, :so, c, :no, d]
+    Marshal.dump(a).should ==
+      "#{mv+nv}[\x23:\x07so\"\x0Ahelloi\x69;\x00;\x00[\x09\"\x07hi:\x07no\"\x07oh:\x07go;\x00;\x00;\x06;\x07c\x0BString0;\x07;\x06@\x09@\x08/\x00\x00;\x00\"\x08huhT@\x08@\x08i\x68@\x0B@\x08@\x09;\x00@\x0A;\x06@\x07"
+  end
+
+  it "dumps an extended_array having ivar" do
+    s = 'well'
+    s.instance_variable_set(:@foo, 10)
+    a = ['5', s, 'hi'].extend(Meths, MethsMore)
+    a.instance_variable_set(:@mix, s)
+    Marshal.dump(a).should ==
+      "#{mv+nv}Ie:\x0AMethse:\x0EMethsMore[\x08\"\x065I\"\x09well\x06:\x09 at fooi\x0F\"\x07hi\x06:\x09 at mix@\x07"
+  end
+
+  it "dumps a struct having ivar" do
+    st = Struct.new("Thick").new
+    st.instance_variable_set(:@foo, 5)
+    Marshal.dump(st).should == "#{mv+nv}IS:\x12Struct::Thick\x00\x06:\x09 at fooi\x0A"
+  end
+
+  it "dumps a struct having fields" do
+    Marshal.dump(Struct.new("Ure1", :a, :b).new).should == "#{mv+nv}S:\x11Struct::Ure1\x07:\x06a0:\x06b0"
+  end
+
+  it "dumps an extended_struct having fields with same objects" do
+    s = 'hi'
+    st = Struct.new("Ure2", :a, :b).new.extend(Meths)
+    st.a = [:a, s]; st.b = [:Meths, s]
+    Marshal.dump(st).should ==
+      "#{mv+nv}e:\x0AMethsS:\x11Struct::Ure2\x07:\x06a[\x07;\x07\"\x07hi:\x06b[\x07;\x00@\x07"
+  end
+end
+
+describe "Marshal.dump" do
+  MarshalSpec::DATA.each do |description, (object, marshal, attributes)|
+    it "dumps a #{description}" do
+      unless attributes then
+        Marshal.dump(object).should == marshal
+      else
+        # these objects have non-deterministic field order in the
+        # marshal stream, so they need a round trip and independent
+        # verification.
+        object = Marshal.load(Marshal.dump(object))
+        attributes.each do |attr, val|
+          object.send(attr).should == val
+        end
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/marshal/fixtures/marshal_data.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/marshal/fixtures/marshal_data.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/marshal/fixtures/marshal_data.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,236 @@
+class UserDefined
+
+  class Nested
+    def ==(other)
+      other.kind_of? self.class
+    end
+  end
+
+  attr_reader :a, :b
+
+  def initialize
+    @a = 'stuff'
+    @b = @a
+  end
+
+  def _dump(depth)
+    Marshal.dump [@a, @b]
+  end
+
+  def self._load(data)
+    a, b = Marshal.load data
+
+    obj = allocate
+    obj.instance_variable_set :@a, a
+    obj.instance_variable_set :@b, b
+
+    obj
+  end
+
+  def ==(other)
+    self.class === other and
+    @a == other.a and
+    @b == other.b
+  end
+
+end
+
+class UserDefinedWithIvar
+  attr_reader :a, :b, :c
+
+  def initialize
+    @a = 'stuff'
+    @a.instance_variable_set :@foo, :UserDefinedWithIvar
+    @b = 'more'
+    @c = @b
+  end
+
+  def _dump(depth)
+    Marshal.dump [@a, @b, @c]
+  end
+
+  def self._load(data)
+    a, b, c = Marshal.load data
+
+    obj = allocate
+    obj.instance_variable_set :@a, a
+    obj.instance_variable_set :@b, b
+    obj.instance_variable_set :@c, c
+
+    obj
+  end
+
+  def ==(other)
+    self.class === other and
+    @a == other.a and
+    @b == other.b and
+    @c == other.c and
+    @a.instance_variable_get(:@foo) == other.a.instance_variable_get(:@foo)
+  end
+end
+
+class UserMarshal
+  attr_reader :data
+
+  def initialize
+    @data = 'stuff'
+  end
+  def marshal_dump() @data end
+  def marshal_load(data) @data = data end
+  def ==(other) self.class === other and @data == other.data end
+end
+
+class UserMarshalWithIvar
+  attr_reader :data
+
+  def initialize
+    @data = 'my data'
+  end
+
+  def marshal_dump
+    [@data]
+  end
+
+  def marshal_load(o)
+    @data = o.first
+  end
+
+  def ==(other)
+    self.class === other and
+    @data = other.data
+  end
+end
+
+class UserArray < Array
+end
+
+class UserHash < Hash
+end
+
+class UserHashInitParams < Hash
+  def initialize(a)
+    @a = a
+  end
+end
+
+class UserObject
+end
+
+class UserRegexp < Regexp
+end
+
+class UserString < String
+end
+
+module Meths
+  def meths_method() end
+end
+
+module MethsMore
+  def meths_more_method() end
+end
+
+Struct.new "Pyramid"
+Struct.new "Useful", :a, :b
+
+module MarshalSpec
+  DATA = {
+    "nil" => [nil, "\004\b0"],
+    "1..2" => [(1..2),
+               "\004\bo:\nRange\b:\nbegini\006:\texclF:\bendi\a",
+               { :begin => 1, :end => 2, :exclude_end? => false }],
+    "1...2" => [(1...2),
+                "\004\bo:\nRange\b:\nbegini\006:\texclT:\bendi\a",
+               { :begin => 1, :end => 2, :exclude_end? => true }],
+    "'a'..'b'" => [('a'..'b'),
+                   "\004\bo:\nRange\b:\nbegin\"\006a:\texclF:\bend\"\006b",
+                   { :begin => 'a', :end => 'b', :exclude_end? => false }],
+    "Struct" => [Struct::Useful.new(1, 2),
+                 "\004\bS:\023Struct::Useful\a:\006ai\006:\006bi\a"],
+    "Symbol" => [:symbol,
+                 "\004\b:\vsymbol"],
+    "true" => [true,
+               "\004\bT"],
+    "false" => [false,
+                "\004\bF"],
+    "String empty" => ['',
+                       "\004\b\"\000"],
+    "String small" => ['small',
+                       "\004\b\"\012small"],
+    "String big" => ['big' * 100,
+                     "\004\b\"\002,\001#{'big' * 100}"],
+    "String extended" => [''.extend(Meths), # TODO: check for module on load
+                          "\004\be:\nMeths\"\000"],
+    "String subclass" => [UserString.new,
+                          "\004\bC:\017UserString\"\000"],
+    "String subclass extended" => [UserString.new.extend(Meths),
+                                   "\004\be:\nMethsC:\017UserString\"\000"],
+    "Symbol small" => [:big,
+                       "\004\b:\010big"],
+    "Symbol big" => [('big' * 100).to_sym,
+                               "\004\b:\002,\001#{'big' * 100}"],
+    "Bignum -2**64" => [-2**64,
+                        "\004\bl-\n\000\000\000\000\000\000\000\000\001\000"],
+    "Bignum -2**63" => [-2**63,
+                        "\004\bl-\t\000\000\000\000\000\000\000\200"],
+    "Fixnum -2**24" => [-2**24,
+                        "\004\bi\375\000\000\000"],
+    "Fixnum -2**16" => [-2**16,
+                        "\004\bi\376\000\000"],
+    "Fixnum -2**8" => [-2**8,
+                       "\004\bi\377\000"],
+    "Fixnum -123" => [-123,
+                      "\004\bi\200"],
+    "Fixnum 0" => [0,
+                   "\004\bi\000"],
+    "Fixnum 5" => [5,
+                   "\004\bi\n"],
+    "Fixnum 2**8" => [2**8,
+                      "\004\bi\002\000\001"],
+    "Fixnum 2**16" => [2**16,
+                       "\004\bi\003\000\000\001"],
+    "Fixnum 2**24" => [2**24,
+                       "\004\bi\004\000\000\000\001"],
+    "Bignum 2**64" => [2**64,
+                       "\004\bl+\n\000\000\000\000\000\000\000\000\001\000"],
+    "Bignum 2**90" => [2**90,
+                       "\004\bl+\v#{"\000" * 11}\004"],
+    "Class String" => [String,
+                       "\004\bc\vString"],
+    "Module Marshal" => [Marshal,
+                         "\004\bm\fMarshal"],
+    "Module nested" => [UserDefined::Nested.new,
+                        "\004\bo:\030UserDefined::Nested\000"],
+    "_dump object" => [UserDefinedWithIvar.new,
+                       "\004\bu:\030UserDefinedWithIvar5\004\b[\bI\"\nstuff\006:\t at foo:\030UserDefinedWithIvar\"\tmore@\a"],
+    "_dump object extended" => [UserDefined.new.extend(Meths),
+                                "\004\bu:\020UserDefined\022\004\b[\a\"\nstuff@\006"],
+    "marshal_dump object" => [UserMarshalWithIvar.new,
+                              "\004\bU:\030UserMarshalWithIvar[\006\"\fmy data"],
+    "Regexp" => [/\A.\Z/,
+                 "\004\b/\n\\A.\\Z\000"],
+    "Regexp subclass /i" => [UserRegexp.new('', Regexp::IGNORECASE),
+                             "\004\bC:\017UserRegexp/\000\001"],
+    "Float 0.0" => [0.0,
+                    "\004\bf\0060"],
+    "Float -0.0" => [-0.0,
+                     "\004\bf\a-0"],
+    "Float Infinity" => [(1.0 / 0.0),
+                         "\004\bf\binf"],
+    "Float -Infinity" => [(-1.0 / 0.0),
+                          "\004\bf\t-inf"],
+    "Float 1.0" => [1.0,
+                    "\004\bf\0061"],
+    "Hash" => [Hash.new,
+               "\004\b{\000"],
+    "Hash subclass" => [UserHash.new,
+                        "\004\bC:\rUserHash{\000"],
+    "Array" => [Array.new,
+                "\004\b[\000"],
+    "Array subclass" => [UserArray.new,
+                     "\004\bC:\016UserArray[\000"],
+    "Struct" => [Struct::Pyramid.new,
+                 "\004\bS:\024Struct::Pyramid\000"],
+  }
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/marshal/load_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/marshal/load_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/marshal/load_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,228 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/marshal_data'
+
+describe "Marshal::load" do
+  it "loads a extended_struct having fields with same objects" do
+    s = 'hi'
+    obj = Struct.new("Ure2", :a, :b).new.extend(Meths)
+    obj.a = [:a, s]; obj.b = [:Meths, s]
+
+    Marshal.load("\004\be:\nMethsS:\021Struct::Ure2\a:\006a[\a;\a\"\ahi:\006b[\a;\000@\a").should ==
+      obj
+  end
+
+  it "loads a string having ivar with ref to self" do
+    obj = 'hi'
+    obj.instance_variable_set(:@self, obj)
+    Marshal.load("\004\bI\"\ahi\006:\n at self@\000").should == obj
+  end
+
+  it "loads an extended_user_hash with a parameter to initialize" do
+    obj = UserHashInitParams.new(:abc).extend(Meths)
+
+    new_obj = Marshal.load "\004\bIe:\nMethsC:\027UserHashInitParams{\000\006:\a at a:\babc"
+
+    new_obj.should == obj
+    new_obj_metaclass_ancestors = class << new_obj; ancestors; end
+    new_obj_metaclass_ancestors[0].should == Meths
+    new_obj_metaclass_ancestors[1].should == UserHashInitParams
+  end
+
+  it "loads a user-marshaled extended object" do
+    obj = UserMarshal.new.extend(Meths)
+
+    new_obj = Marshal.load "\004\bU:\020UserMarshal\"\nstuff"
+
+    new_obj.should == obj
+    new_obj_metaclass_ancestors = class << new_obj; ancestors; end
+    new_obj_metaclass_ancestors.first.should == UserMarshal
+  end
+
+  it "loads a user_object" do
+    obj = UserObject.new
+    Marshal.load("\004\bo:\017UserObject\000").class.should == UserObject
+  end
+
+  it "loads a object" do
+    Marshal.load("\004\bo:\vObject\000").class.should == Object
+  end
+
+  it "loads an extended Object" do
+    obj = Object.new.extend(Meths)
+
+    new_obj = Marshal.load "\004\be:\nMethso:\vObject\000"
+
+    new_obj.class.should == obj.class
+    new_obj_metaclass_ancestors = class << new_obj; ancestors; end
+    new_obj_metaclass_ancestors.first(2).should == [Meths, Object]
+  end
+
+  it "loads a object having ivar" do
+    s = 'hi'
+    arr = [:so, :so, s, s]
+    obj = Object.new
+    obj.instance_variable_set :@str, arr
+
+    new_obj = Marshal.load "\004\bo:\vObject\006:\t at str[\t:\aso;\a\"\ahi@\a"
+    new_str = new_obj.instance_variable_get :@str
+
+    new_str.should == arr
+  end
+
+  it "loads an extended Regexp" do
+    obj = /[a-z]/.extend(Meths, MethsMore)
+    new_obj = Marshal.load "\004\be:\nMethse:\016MethsMore/\n[a-z]\000"
+
+    new_obj.should == obj
+    new_obj_metaclass_ancestors = class << new_obj; ancestors; end
+    new_obj_metaclass_ancestors.first(3).should ==
+      [Meths, MethsMore, Regexp]
+  end
+
+  it "loads a extended_user_regexp having ivar" do
+    obj = UserRegexp.new('').extend(Meths)
+    obj.instance_variable_set(:@noise, 'much')
+
+    new_obj = Marshal.load "\004\bIe:\nMethsC:\017UserRegexp/\000\000\006:\v at noise\"\tmuch"
+
+    new_obj.should == obj
+    new_obj.instance_variable_get(:@noise).should == 'much'
+    new_obj_metaclass_ancestors = class << new_obj; ancestors; end
+    new_obj_metaclass_ancestors.first(3).should ==
+      [Meths, UserRegexp, Regexp]
+  end
+
+  it "loads a Float NaN" do
+    obj = 0.0 / 0.0
+    Marshal.load("\004\bf\bnan").to_s.should == obj.to_s
+  end
+
+  it "loads a Float 1.3" do
+    Marshal.load("\004\bf\v1.3\000\314\315").should == 1.3
+  end
+
+  it "loads a Float -5.1867345e-22" do
+    obj = -5.1867345e-22
+    Marshal.load("\004\bf\037-5.1867345000000008e-22\000\203_").should be_close(obj, 1e-30)
+  end
+
+  it "loads a Float 1.1867345e+22" do
+    obj = 1.1867345e+22
+    Marshal.load("\004\bf\0361.1867344999999999e+22\000\344@").should ==
+      obj
+  end
+
+  it "loads a array containing objects having _dump method, and with proc" do
+    arr = []
+    proc = Proc.new { |o| arr << o }
+    o1 = UserDefined.new; o2 = UserDefinedWithIvar.new
+    obj = [o1, o2, o1, o2]
+
+    Marshal.load "\004\b[\tu:\020UserDefined\022\004\b[\a\"\nstuff@\006u:\030UserDefinedWithIvar5\004\b[\bI\"\nstuff\006:\t at foo:\030UserDefinedWithIvar\"\tmore@\a@\006@\a", proc
+
+    arr.should == [o1, o2, obj]
+  end
+
+  it "loads an array containing objects having marshal_dump method, and with proc" do
+    arr = []
+    proc = Proc.new { |o| arr << o }
+    o1 = UserMarshal.new
+    o2 = UserMarshalWithIvar.new
+    obj = [o1, o2, o1, o2]
+
+    Marshal.load "\004\b[\tU:\020UserMarshal\"\nstuffU:\030UserMarshalWithIvar[\006\"\fmy data@\006@\b", proc
+
+    arr.should == ['stuff', o1, 'my data', ['my data'], o2, obj]
+  end
+
+  it "loads an Array with proc" do
+    arr = []
+    s = 'hi'
+    s.instance_variable_set(:@foo, 5)
+    st = Struct.new("Brittle", :a).new
+    st.instance_variable_set(:@clue, 'none')
+    st.a = 0.0
+    h = Hash.new('def')
+    h['nine'] = 9
+    a = [:a, :b, :c]
+    a.instance_variable_set(:@two, 2)
+    obj = [s, 10, s, s, st, h, a]
+    obj.instance_variable_set(:@zoo, 'ant')
+
+    proc = Proc.new { |o| arr << o }
+    new_obj = Marshal.load "\004\bI[\fI\"\ahi\006:\t at fooi\ni\017@\006@\006IS:\024Struct::Brittle\006:\006af\0060\006:\n at clue\"\tnone}\006\"\tninei\016\"\bdefI[\b;\a:\006b:\006c\006:\t at twoi\a\006:\t at zoo\"\bant", proc
+
+    new_obj.should == obj
+    new_obj.instance_variable_get(:@zoo).should == 'ant'
+
+    arr.should ==
+      [5, s, 10, 0.0, 'none', st, 'nine', 9, 'def', h, :b, :c, 2, a, 'ant', obj]
+  end
+
+  it "loads a array containing the same objects" do
+    s = 'oh'; b = 'hi'; r = //; d = [b, :no, s, :go]; c = String; f = 1.0
+    o1 = UserMarshalWithIvar.new; o2 = UserMarshal.new
+    obj = [:so, 'hello', 100, :so, :so, d, :so, o2, :so, :no, o2,
+           :go, c, nil, Struct::Pyramid.new, f, :go, :no, s, b, r,
+           :so, 'huh', o1, true, b, b, 99, r, b, s, :so, f, c, :no, o1, d]
+
+    Marshal.load("\004\b[*:\aso\"\nhelloii;\000;\000[\t\"\ahi:\ano\"\aoh:\ago;\000U:\020UserMarshal\"\nstuff;\000;\006@\n;\ac\vString0S:\024Struct::Pyramid\000f\0061;\a;\006@\t@\b/\000\000;\000\"\bhuhU:\030UserMarshalWithIvar[\006\"\fmy dataT@\b@\bih@\017@\b@\t;\000@\016@\f;\006@\021@\a").should ==
+      obj
+  end
+
+  it "loads an array having ivar" do
+    s = 'well'
+    s.instance_variable_set(:@foo, 10)
+    obj = ['5', s, 'hi'].extend(Meths, MethsMore)
+    obj.instance_variable_set(:@mix, s)
+    Marshal.load("\004\bI[\b\"\0065I\"\twell\006:\t at fooi\017\"\ahi\006:\t at mix@\a").should ==
+      obj
+  end
+
+  it "loads a struct having ivar" do
+    obj = Struct.new("Thick").new
+    obj.instance_variable_set(:@foo, 5)
+    Marshal.load("\004\bIS:\022Struct::Thick\000\006:\t at fooi\n").should ==
+      obj
+  end
+
+  it "loads a struct having fields" do
+    obj = Struct.new("Ure1", :a, :b).new
+    Marshal.load("\004\bS:\021Struct::Ure1\a:\006a0:\006b0").should ==
+      obj
+  end
+
+  it "raises a TypeError with bad Marshal version" do
+    marshal_data = '\xff\xff'
+    marshal_data[0] = (Marshal::MAJOR_VERSION).chr
+    marshal_data[1] = (Marshal::MINOR_VERSION + 1).chr
+
+    lambda { Marshal.load marshal_data }.should raise_error(TypeError)
+
+    marshal_data = '\xff\xff'
+    marshal_data[0] = (Marshal::MAJOR_VERSION - 1).chr
+    marshal_data[1] = (Marshal::MINOR_VERSION).chr
+
+    lambda { Marshal.load marshal_data }.should raise_error(TypeError)
+  end
+  
+  it "raises EOFError on loading an empty file" do
+    temp_file = tmp("marshal.rubinius.tmp.#{Process.pid}")
+    file = File.new(temp_file, "w+")
+    begin
+      # TODO: This should be in an ensure block, but because of a bug in
+      # Rubinius that can't be done yet.
+      File.unlink(temp_file)
+
+      lambda { Marshal.load(file) }.should raise_error(EOFError)
+    ensure
+      file.close
+    end
+  end
+
+  MarshalSpec::DATA.each do |description, (object, marshal, attributes)|
+    it "loads a #{description}" do
+      Marshal.load(marshal).should == object
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/marshal/restore_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/marshal/restore_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/marshal/restore_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/matchdata/begin_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/matchdata/begin_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/matchdata/begin_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "MatchData#begin" do
+  it "returns the offset of the start of the nth element" do
+    /(.)(.)(\d+)(\d)/.match("THX1138.").begin(0).should == 1
+    /(.)(.)(\d+)(\d)/.match("THX1138.").begin(2).should == 2
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/matchdata/captures_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/matchdata/captures_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/matchdata/captures_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "MatchData#captures" do
+  it "returns an array of the match captures" do
+    /(.)(.)(\d+)(\d)/.match("THX1138.").captures.should == ["H","X","113","8"]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/matchdata/element_reference_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/matchdata/element_reference_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/matchdata/element_reference_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "MatchData#[]" do
+  it "acts as normal array indexing [index]" do
+    /(.)(.)(\d+)(\d)/.match("THX1138.")[0].should == 'HX1138'
+    /(.)(.)(\d+)(\d)/.match("THX1138.")[1].should == 'H'
+    /(.)(.)(\d+)(\d)/.match("THX1138.")[2].should == 'X'
+  end
+
+  it "supports accessors [start, length]" do
+    /(.)(.)(\d+)(\d)/.match("THX1138.")[1, 2].should == %w|H X|
+    /(.)(.)(\d+)(\d)/.match("THX1138.")[-3, 2].should == %w|X 113|
+  end
+
+  it "supports ranges [start..end]" do
+    /(.)(.)(\d+)(\d)/.match("THX1138.")[1..3].should == %w|H X 113|
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/matchdata/end_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/matchdata/end_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/matchdata/end_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "MatchData#end" do
+  it "returns the offset of the end of the nth element" do
+    /(.)(.)(\d+)(\d)/.match("THX1138.").end(0).should == 7
+    /(.)(.)(\d+)(\d)/.match("THX1138.").end(2).should == 3 
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/matchdata/initialize_copy_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/matchdata/initialize_copy_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/matchdata/initialize_copy_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/matchdata/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/matchdata/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/matchdata/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/matchdata/length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/matchdata/length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/matchdata/length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/length'
+
+describe "MatchData#length" do
+  it_behaves_like(:matchdata_length, :length)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/matchdata/offset_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/matchdata/offset_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/matchdata/offset_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "MatchData#offset" do
+  it "returns a two element array with the begin and end of the nth match" do
+    /(.)(.)(\d+)(\d)/.match("THX1138.").offset(0).should == [1, 7]
+    /(.)(.)(\d+)(\d)/.match("THX1138.").offset(4).should == [6, 7]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/matchdata/post_match_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/matchdata/post_match_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/matchdata/post_match_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "MatchData#post_match" do
+  it "returns the string after the match equiv. special var $'" do
+    /(.)(.)(\d+)(\d)/.match("THX1138: The Movie").post_match.should == ': The Movie' 
+    $'.should == ': The Movie'
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/matchdata/pre_match_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/matchdata/pre_match_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/matchdata/pre_match_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "MatchData#pre_match" do
+  it "returns the string before the match, equiv. special var $`" do
+    /(.)(.)(\d+)(\d)/.match("THX1138: The Movie").pre_match.should == 'T'
+    $`.should == 'T'
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/matchdata/select_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/matchdata/select_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/matchdata/select_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "MatchData#select" do
+  it "yields the contents of the match array to a block" do
+     /(.)(.)(\d+)(\d)/.match("THX1138: The Movie").select { |x| x }.should == ["HX1138", "H", "X", "113", "8"]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/matchdata/shared/length.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/matchdata/shared/length.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/matchdata/shared/length.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+describe :matchdata_length, :shared => true do
+  it "length should return the number of elements in the match array" do
+    /(.)(.)(\d+)(\d)/.match("THX1138.").send(@method).should == 5
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/matchdata/size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/matchdata/size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/matchdata/size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/length'
+
+describe "MatchData#size" do
+  it_behaves_like(:matchdata_length, :size)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/matchdata/string_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/matchdata/string_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/matchdata/string_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "MatchData#string" do
+  it "returns a copy of the match string" do
+    str = /(.)(.)(\d+)(\d)/.match("THX1138.").string
+    str.should == "THX1138."
+  end
+
+  it "returns a frozen copy of the match string" do
+    str = /(.)(.)(\d+)(\d)/.match("THX1138.").string
+    str.should == "THX1138."
+    str.frozen?.should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/matchdata/to_a_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/matchdata/to_a_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/matchdata/to_a_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "MatchData#to_a" do
+  it "returns an array of matches" do
+    /(.)(.)(\d+)(\d)/.match("THX1138.").to_a.should == ["HX1138", "H", "X", "113", "8"]
+  end  
+end

Added: MacRuby/branches/experimental/spec/frozen/core/matchdata/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/matchdata/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/matchdata/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "MatchData#to_s" do
+  it "returns the entire matched string" do
+    /(.)(.)(\d+)(\d)/.match("THX1138.").to_s.should == "HX1138"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/matchdata/values_at_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/matchdata/values_at_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/matchdata/values_at_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "MatchData#values_at" do
+  it "returns an array of the matching value" do
+    /(.)(.)(\d+)(\d)/.match("THX1138: The Movie").values_at(0, 2, -2).should == ["HX1138", "X", "113"]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/math/acos_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/math/acos_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/math/acos_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,60 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+# arccosine : (-1.0, 1.0) --> (0, PI)	 	                
+describe "Math.acos" do  
+  before(:each) do
+    ScratchPad.clear
+  end
+  
+  it "returns a float" do 
+    Math.acos(1).class.should == Float 
+  end 
+  
+  it "returns the arccosine of the argument" do 
+    Math.acos(1).should be_close(0.0, TOLERANCE) 
+    Math.acos(0).should be_close(1.5707963267949, TOLERANCE) 
+    Math.acos(-1).should be_close(Math::PI,TOLERANCE) 
+    Math.acos(0.25).should be_close(1.31811607165282, TOLERANCE) 
+    Math.acos(0.50).should be_close(1.0471975511966 , TOLERANCE) 
+    Math.acos(0.75).should be_close(0.722734247813416, TOLERANCE) 
+  end  
+  
+  conflicts_with :Complex do
+    it "raises an Errno::EDOM if the argument is greater than 1.0" do    
+      lambda { Math.acos(1.0001) }.should raise_error(Errno::EDOM)
+    end  
+  
+    it "raises an Errno::EDOM if the argument is less than -1.0" do    
+      lambda { Math.acos(-1.0001) }.should raise_error(Errno::EDOM)
+    end
+  end
+  
+  it "raises an ArgumentError if the string argument cannot be coerced with Float()" do    
+    lambda { Math.acos("test") }.should raise_error(ArgumentError)
+  end
+  
+  it "raises an TypeError if the argument cannot be coerced with Float()" do    
+    lambda { Math.acos(MathSpecs::UserClass.new) }.should raise_error(TypeError)
+  end
+  
+  it "raises a TypeError if the argument is nil" do
+    lambda { Math.acos(nil) }.should raise_error(TypeError)
+  end  
+
+  it "accepts any argument that can be coerced with Float()" do
+    Math.acos(MathSpecs::Float.new(0.5)).should be_close(Math.acos(0.5), TOLERANCE)
+  end
+  
+  it "coerces string argument with Float() without calling to_f" do  
+    s = MathSpecs::StringSubClass.new("0.5")
+    s.should_not_receive(:to_f)
+    Math.acos(s).should be_close(Math.acos(0.5), TOLERANCE)
+  end  
+end
+
+describe "Math#acos" do
+  it "is accessible as a private instance method" do
+    IncludesMath.new.send(:acos, 0).should be_close(1.5707963267949, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/math/acosh_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/math/acosh_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/math/acosh_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,39 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Math.acosh" do
+  it "returns a float" do
+    Math.acosh(1.0).class.should == Float
+  end
+  
+  it "returns the principle value of the inverse hyperbolic cosine of the argument" do
+    Math.acosh(14.2).should be_close(3.345146999647, TOLERANCE)
+    Math.acosh(1.0).should be_close(0.0, TOLERANCE)
+  end
+  
+  conflicts_with :Complex do
+    it "it raises Errno::EDOM if the passed argument is less than -1.0 or greater than 1.0" do
+      lambda { Math.acosh(1.0 - TOLERANCE) }.should raise_error(Errno::EDOM)
+      lambda { Math.acosh(0) }.should raise_error(Errno::EDOM)
+      lambda { Math.acosh(-1.0) }.should raise_error(Errno::EDOM)
+    end
+  end
+  
+  it "raises an ArgumentError if the argument cannot be coerced with Float()" do
+    lambda { Math.acosh("test") }.should raise_error(ArgumentError)
+  end
+
+  it "raises a TypeError if the argument is nil" do
+    lambda { Math.acosh(nil) }.should raise_error(TypeError)
+  end  
+
+  it "accepts any argument that can be coerced with Float()" do
+    Math.acosh(MathSpecs::Float.new).should == 0.0
+  end
+end
+
+describe "Math#acosh" do
+  it "is accessible as a private instance method" do
+    IncludesMath.new.send(:acosh, 1.0).should be_close(0.0, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/math/asin_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/math/asin_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/math/asin_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,46 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+# arcsine : (-1.0, 1.0) --> (-PI/2, PI/2)
+describe "Math.asin" do
+  it "return a float" do 
+    Math.asin(1).class.should == Float
+  end 
+  
+  it "returns the arcsine of the argument" do   
+    Math.asin(1).should be_close(Math::PI/2, TOLERANCE)
+    Math.asin(0).should be_close(0.0, TOLERANCE)
+    Math.asin(-1).should be_close(-Math::PI/2, TOLERANCE)
+    Math.asin(0.25).should be_close(0.252680255142079, TOLERANCE)
+    Math.asin(0.50).should be_close(0.523598775598299, TOLERANCE)
+    Math.asin(0.75).should be_close(0.8480620789814816,TOLERANCE) 
+  end
+  
+  conflicts_with :Complex do
+    it "raises an Errno::EDOM if the argument is greater than 1.0" do    
+      lambda { Math.asin(1.0001) }.should raise_error( Errno::EDOM)
+    end
+  
+    it "raises an Errno::EDOM if the argument is less than -1.0" do    
+      lambda { Math.asin(-1.0001) }.should raise_error( Errno::EDOM)
+    end
+  end
+  
+  it "raises an ArgumentError if the argument cannot be coerced with Float()" do    
+    lambda { Math.asin("test") }.should raise_error(ArgumentError)
+  end
+  
+  it "raises a TypeError if the argument is nil" do
+    lambda { Math.asin(nil) }.should raise_error(TypeError)
+  end
+
+  it "accepts any argument that can be coerced with Float()" do
+    Math.asin(MathSpecs::Float.new).should be_close(1.5707963267949, TOLERANCE)
+  end
+end
+
+describe "Math#asin" do
+  it "is accessible as a private instance method" do
+    IncludesMath.new.send(:asin, 0.5).should be_close(0.523598775598299, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/math/asinh_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/math/asinh_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/math/asinh_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,38 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Math.asinh" do
+  it "returns a float" do
+    Math.asinh(1.5).class.should == Float
+  end
+  
+  it "returns the inverse hyperbolic sin of the argument" do
+    Math.asinh(1.5).should be_close(1.19476321728711, TOLERANCE)
+    Math.asinh(-2.97).should be_close(-1.8089166921397, TOLERANCE)
+    Math.asinh(0.0).should == 0.0
+    Math.asinh(-0.0).should == -0.0
+    Math.asinh(1.05367e-08).should be_close(1.05367e-08, TOLERANCE)
+    Math.asinh(-1.05367e-08).should be_close(-1.05367e-08, TOLERANCE)
+    # Default tolerance does not scale right for these...
+    #Math.asinh(94906265.62).should be_close(19.0615, TOLERANCE)
+    #Math.asinh(-94906265.62).should be_close(-19.0615, TOLERANCE)
+  end
+  
+  it "raises an ArgumentError if the argument cannot be coerced with Float()" do    
+    lambda { Math.asinh("test") }.should raise_error(ArgumentError)
+  end
+  
+  it "raises a TypeError if the argument is nil" do
+    lambda { Math.asinh(nil) }.should raise_error(TypeError)
+  end
+
+  it "accepts any argument that can be coerced with Float()" do
+    Math.asinh(MathSpecs::Float.new).should be_close(0.881373587019543, TOLERANCE)
+  end
+end
+
+describe "Math#asinh" do
+  it "is accessible as a private instance method" do
+    IncludesMath.new.send(:asinh, 19.275).should be_close(3.65262832292466, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/math/atan2_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/math/atan2_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/math/atan2_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,37 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Math.atan2" do
+  it "returns a float" do
+    Math.atan2(1.2, 0.5).class.should == Float
+  end
+  
+  it "returns the arc tangent of y, x" do
+    Math.atan2(4.2, 0.3).should be_close(1.49948886200961, TOLERANCE)
+    Math.atan2(0.0, 1.0).should be_close(0.0, TOLERANCE)
+    Math.atan2(-9.1, 3.2).should be_close(-1.23265379809025, TOLERANCE)
+    Math.atan2(7.22, -3.3).should be_close(1.99950888779256, TOLERANCE)
+  end
+  
+  it "raises an ArgumentError if the argument cannot be coerced with Float()" do    
+    lambda { Math.atan2(1.0, "test")    }.should raise_error(ArgumentError)
+    lambda { Math.atan2("test", 0.0)    }.should raise_error(ArgumentError)
+    lambda { Math.atan2("test", "this") }.should raise_error(ArgumentError)
+  end
+  
+  it "raises a TypeError if the argument is nil" do
+    lambda { Math.atan2(nil, 1.0)  }.should raise_error(TypeError)
+    lambda { Math.atan2(-1.0, nil) }.should raise_error(TypeError)
+    lambda { Math.atan2(nil, nil)  }.should raise_error(TypeError)
+  end
+
+  it "accepts any argument that can be coerced with Float()" do
+    Math.atan2(MathSpecs::Float.new, MathSpecs::Float.new).should be_close(0.785398163397448, TOLERANCE)
+  end
+end
+
+describe "Math#atan2" do
+  it "is accessible as a private instance method" do
+    IncludesMath.new.send(:atan2, 1.1, 2.2).should be_close(0.463647609000806, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/math/atan_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/math/atan_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/math/atan_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,36 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+# arctangent : (-Inf, Inf) --> (-PI/2, PI/2)
+describe "Math.atan" do     
+  it "returns a float" do 
+    Math.atan(1).class.should == Float
+  end 
+  
+  it "return the arctangent of the argument" do    
+    Math.atan(1).should be_close(Math::PI/4, TOLERANCE)
+    Math.atan(0).should be_close(0.0, TOLERANCE)
+    Math.atan(-1).should be_close(-Math::PI/4, TOLERANCE)
+    Math.atan(0.25).should be_close(0.244978663126864, TOLERANCE)
+    Math.atan(0.50).should be_close(0.463647609000806, TOLERANCE)
+    Math.atan(0.75).should be_close(0.643501108793284, TOLERANCE)
+  end   
+  
+  it "raises an ArgumentError if the argument cannot be coerced with Float()" do    
+    lambda { Math.atan("test") }.should raise_error(ArgumentError)
+  end
+  
+  it "raises a TypeError if the argument is nil" do
+    lambda { Math.atan(nil) }.should raise_error(TypeError)
+  end  
+  
+  it "accepts any argument that can be coerced with Float()" do
+    Math.atan(MathSpecs::Float.new).should be_close(0.785398163397448, TOLERANCE)
+  end
+end
+
+describe "Math#atan" do
+  it "is accessible as a private instance method" do
+    IncludesMath.new.send(:atan, 3.1415).should be_close(1.2626187313511, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/math/atanh_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/math/atanh_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/math/atanh_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,66 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Math.atanh" do
+  it "returns a float" do
+    Math.atanh(0.5).class.should == Float
+  end
+  
+  it "returns the inverse hyperbolic tangent of the argument" do
+    Math.atanh(0.0).should == 0.0
+    Math.atanh(-0.0).should == -0.0
+    Math.atanh(0.5).should be_close(0.549306144334055, TOLERANCE)
+    Math.atanh(-0.2).should be_close(-0.202732554054082, TOLERANCE)
+  end
+  
+  platform_is :darwin, :freebsd, :java do
+    it "returns Infinity for 1.0" do
+      Math.atanh(1.0).infinite?.should == 1
+    end
+  
+    it "returns -Infinity for -1.0" do
+      Math.atanh(-1.0).infinite?.should == -1
+    end
+  end
+
+  platform_is :windows, :linux, :openbsd do
+    # jruby is cross-platform and behaves as :darwin above
+    not_compliant_on :jruby do
+      it "raises an Errno::EDOM if x = 1.0" do
+        lambda { Math.atanh(1.0) }.should raise_error(Errno::EDOM)
+      end
+
+      it "raises an Errno::EDOM if x = -1.0" do
+        lambda { Math.atanh(-1.0) }.should raise_error(Errno::EDOM)
+      end
+    end
+  end
+
+  conflicts_with :Complex do
+    it "raises an Errno::EDOM if the passed argument is greater than 1.0" do
+      lambda { Math.atanh(1.0 + TOLERANCE)  }.should raise_error(Errno::EDOM)
+    end
+    
+    it "raises an Errno::EDOM if the passed argument is less than -1.0" do
+      lambda { Math.atanh(-1.0 - TOLERANCE) }.should raise_error(Errno::EDOM)
+    end
+  end
+  
+  it "raises an ArgumentError if the argument cannot be coerced with Float()" do
+    lambda { Math.atanh("test") }.should raise_error(ArgumentError)
+  end
+
+  it "raises a TypeError if the argument is nil" do
+    lambda { Math.atanh(nil) }.should raise_error(TypeError)
+  end
+  
+  it "accepts any argument that can be coerced with Float()" do
+    Math.atanh(MathSpecs::Float.new(0.5)).infinite?.should == nil
+  end
+end
+
+describe "Math#atanh" do
+  it "is accessible as a private instance method" do
+    IncludesMath.new.send(:atanh, 0.1415).should be_close(0.14245589281616, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/math/constants_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/math/constants_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/math/constants_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Math::PI" do
+  it "approximates the value of pi" do
+    Math::PI.should be_close(3.14159_26535_89793_23846, TOLERANCE)
+  end
+  
+  it "is accessible to a class that includes Math" do
+    IncludesMath::PI.should == Math::PI
+  end
+end
+
+describe "Math::E" do
+  it "approximates the value of Napier's constant" do
+    Math::E.should be_close(2.71828_18284_59045_23536, TOLERANCE)
+  end
+
+  it "is accessible to a class that includes Math" do
+    IncludesMath::E.should == Math::E
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/math/cos_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/math/cos_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/math/cos_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+# cosine : (-Inf, Inf) --> (-1.0, 1.0)
+describe "Math.cos" do  
+  it "returns a float" do 
+    Math.cos(Math::PI).class.should == Float
+  end 
+
+  it "returns the cosine of the argument expressed in radians" do    
+    Math.cos(Math::PI).should be_close(-1.0, TOLERANCE)
+    Math.cos(0).should be_close(1.0, TOLERANCE)
+    Math.cos(Math::PI/2).should be_close(0.0, TOLERANCE)    
+    Math.cos(3*Math::PI/2).should be_close(0.0, TOLERANCE)
+    Math.cos(2*Math::PI).should be_close(1.0, TOLERANCE)
+  end  
+  
+  it "raises an ArgumentError if the argument cannot be coerced with Float()" do    
+    lambda { Math.cos("test") }.should raise_error(ArgumentError)
+  end
+  
+  it "raises a TypeError if the argument is nil" do
+    lambda { Math.cos(nil) }.should raise_error(TypeError)
+  end
+  
+  it "accepts any argument that can be coerced with Float()" do
+    Math.cos(MathSpecs::Float.new).should be_close(0.54030230586814, TOLERANCE)
+  end
+end  
+
+describe "Math#cos" do
+  it "is accessible as a private instance method" do
+    IncludesMath.new.send(:cos, 3.1415).should be_close(-0.999999995707656, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/math/cosh_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/math/cosh_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/math/cosh_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Math.cosh" do
+  it "returns a float" do
+    Math.cosh(1.0).class.should == Float
+  end
+  
+  it "returns the hyperbolic cosine of the argument" do
+    Math.cosh(0.0).should == 1.0
+    Math.cosh(-0.0).should == 1.0
+    Math.cosh(1.5).should be_close(2.35240961524325, TOLERANCE)
+    Math.cosh(-2.99).should be_close(9.96798496414416, TOLERANCE)
+  end
+
+  it "raises an ArgumentError if the argument cannot be coerced with Float()" do    
+    lambda { Math.cosh("test") }.should raise_error(ArgumentError)
+  end
+  
+  it "raises a TypeError if the argument is nil" do
+    lambda { Math.cosh(nil) }.should raise_error(TypeError)
+  end
+  
+  it "accepts any argument that can be coerced with Float()" do
+    Math.cosh(MathSpecs::Float.new).should be_close(1.54308063481524, TOLERANCE)
+  end
+end
+
+describe "Math#cosh" do
+  it "is accessible as a private instance method" do
+    IncludesMath.new.send(:cos, 3.1415).should be_close(-0.999999995707656, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/math/erf_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/math/erf_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/math/erf_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,40 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+# erf method is the "error function" encountered in integrating the normal 
+# distribution (which is a normalized form of the Gaussian function).
+describe "Math.erf" do
+  it "returns a float" do 
+    Math.erf(1).class.should == Float
+  end 
+  
+  it "returns the error function of the argument" do 
+    Math.erf(0).should be_close(0.0, TOLERANCE)
+    Math.erf(1).should be_close(0.842700792949715, TOLERANCE)
+    Math.erf(-1).should be_close(-0.842700792949715, TOLERANCE)
+    Math.erf(0.5).should be_close(0.520499877813047, TOLERANCE)
+    Math.erf(-0.5).should be_close(-0.520499877813047, TOLERANCE)
+    Math.erf(10000).should be_close(1.0, TOLERANCE)
+    Math.erf(-10000).should be_close(-1.0, TOLERANCE)
+    Math.erf(0.00000000000001).should be_close(0.0, TOLERANCE)
+    Math.erf(-0.00000000000001).should be_close(0.0, TOLERANCE) 
+  end
+  
+  it "raises an ArgumentError if the argument cannot be coerced with Float()" do    
+    lambda { Math.erf("test") }.should raise_error(ArgumentError)
+  end
+  
+  it "raises a TypeError if the argument is nil" do
+    lambda { Math.erf(nil) }.should raise_error(TypeError)
+  end 
+  
+  it "accepts any argument that can be coerced with Float()" do
+    Math.erf(MathSpecs::Float.new).should be_close(0.842700792949715, TOLERANCE)
+  end
+end
+
+describe "Math#erf" do
+  it "is accessible as a private instance method" do
+    IncludesMath.new.send(:erf, 3.1415).should be_close(0.999991118444483, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/math/erfc_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/math/erfc_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/math/erfc_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,39 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+# erfc is the complementary error function  
+describe "Math.erfc" do
+  it "returns a float" do
+    Math.erf(1).class.should == Float
+  end
+  
+  it "returns the complimentary error function of the argument" do
+    Math.erfc(0).should be_close(1.0, TOLERANCE)
+    Math.erfc(1).should be_close(0.157299207050285, TOLERANCE)
+    Math.erfc(-1).should be_close(1.84270079294971, TOLERANCE)
+    Math.erfc(0.5).should be_close(0.479500122186953, TOLERANCE)
+    Math.erfc(-0.5).should be_close(1.52049987781305, TOLERANCE)
+    Math.erfc(10000).should be_close(0.0, TOLERANCE)
+    Math.erfc(-10000).should be_close(2.0, TOLERANCE)
+    Math.erfc(0.00000000000001).should be_close(0.999999999999989, TOLERANCE)
+    Math.erfc(-0.00000000000001).should be_close(1.00000000000001, TOLERANCE) 
+  end  
+  
+  it "raises an ArgumentError if the argument cannot be coerced with Float()" do    
+    lambda { Math.erfc("test") }.should raise_error(ArgumentError)
+  end
+  
+  it "raises a TypeError if the argument is nil" do
+    lambda { Math.erfc(nil) }.should raise_error(TypeError)
+  end 
+  
+  it "accepts any argument that can be coerced with Float()" do
+    Math.erfc(MathSpecs::Float.new).should be_close(0.157299207050285, TOLERANCE)
+  end
+end
+
+describe "Math#erfc" do
+  it "is accessible as a private instance method" do
+    IncludesMath.new.send(:erf, 3.1415).should be_close(0.999991118444483, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/math/exp_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/math/exp_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/math/exp_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Math.exp" do
+  it "returns a float" do
+    Math.exp(1.0).class.should == Float
+  end
+  
+  it "returns the base-e exponential of the argument" do
+    Math.exp(0.0).should == 1.0
+    Math.exp(-0.0).should == 1.0
+    Math.exp(-1.8).should be_close(0.165298888221587, TOLERANCE)
+    Math.exp(1.25).should be_close(3.49034295746184, TOLERANCE)
+  end
+
+  it "raises an ArgumentError if the argument cannot be coerced with Float()" do    
+    lambda { Math.exp("test") }.should raise_error(ArgumentError)
+  end
+  
+  it "raises a TypeError if the argument is nil" do
+    lambda { Math.exp(nil) }.should raise_error(TypeError)
+  end
+  
+  it "accepts any argument that can be coerced with Float()" do
+    Math.exp(MathSpecs::Float.new).should be_close(Math::E, TOLERANCE)
+  end
+end
+
+describe "Math#exp" do
+  it "is accessible as a private instance method" do
+    IncludesMath.new.send(:exp, 23.1415).should be_close(11226018484.0012, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/math/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/math/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/math/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+class IncludesMath
+  include Math
+end
+
+module MathSpecs
+  class Float
+    def initialize(value=1.0)
+      @value = value
+    end
+
+    def to_f
+      @value
+    end
+  end
+
+  class Integer
+    def to_int
+      2
+    end
+  end
+  
+  class UserClass
+  end
+  
+  class StringSubClass < String
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/math/frexp_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/math/frexp_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/math/frexp_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Math.frexp" do
+  it "returns the normalized fraction and exponent" do
+    frac, exp = Math.frexp(102.83)
+    frac.should be_close(0.803359375, TOLERANCE)
+    exp.should == 7
+  end
+
+  it "raises an ArgumentError if the argument cannot be coerced with Float()" do    
+    lambda { Math.frexp("test") }.should raise_error(ArgumentError)
+  end
+  
+  it "raises a TypeError if the argument is nil" do
+    lambda { Math.frexp(nil) }.should raise_error(TypeError)
+  end
+  
+  it "accepts any argument that can be coerced with Float()" do
+    frac, exp = Math.frexp(MathSpecs::Float.new)
+    frac.should be_close(0.5, TOLERANCE)
+    exp.should == 1
+  end
+end
+
+describe "Math#frexp" do
+  it "is accessible as a private instance method" do
+    frac, exp = IncludesMath.new.send(:frexp, 2.1415)
+    frac.should be_close(0.535375, TOLERANCE)
+    exp.should == 2
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/math/hypot_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/math/hypot_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/math/hypot_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Math.hypot" do
+  it "returns a float" do
+    Math.hypot(3, 4).class.should == Float
+  end
+  
+  it "returns the length of the hypotenuse of a right triangle with legs given by the arguments" do 
+    Math.hypot(0, 0).should be_close(0.0, TOLERANCE)
+    Math.hypot(2, 10).should be_close( 10.1980390271856, TOLERANCE)
+    Math.hypot(5000, 5000).should be_close(7071.06781186548, TOLERANCE)
+    Math.hypot(0.0001, 0.0002).should be_close(0.000223606797749979, TOLERANCE)
+    Math.hypot(-2, -10).should be_close(10.1980390271856, TOLERANCE)
+    Math.hypot(2, 10).should be_close(10.1980390271856, TOLERANCE)
+  end
+    
+  it "raises an ArgumentError if the argument cannot be coerced with Float()" do    
+    lambda { Math.hypot("test", "this") }.should raise_error(ArgumentError)
+  end
+  
+  it "raises a ArgumentError if the argument is nil" do
+    lambda { Math.hypot(nil) }.should raise_error(ArgumentError)
+  end 
+  
+  it "accepts any argument that can be coerced with Float()" do
+    Math.hypot(MathSpecs::Float.new, MathSpecs::Float.new).should be_close(1.4142135623731, TOLERANCE)
+  end
+end 
+
+describe "Math#hypot" do
+  it "is accessible as a private instance method" do
+    IncludesMath.new.send(:hypot, 2, 3.1415).should be_close(3.72411361937307, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/math/ldexp_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/math/ldexp_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/math/ldexp_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,46 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Math.ldexp" do
+  it "returns a float" do
+    Math.ldexp(1.0, 2).class.should == Float
+  end
+  
+  it "returns the argument multiplied by 2**n" do
+    Math.ldexp(0.0, 0.0).should == 0.0
+    Math.ldexp(0.0, 1.0).should == 0.0
+    Math.ldexp(-1.25, 2).should be_close(-5.0, TOLERANCE)
+    Math.ldexp(2.1, -3).should be_close(0.2625, TOLERANCE)
+    Math.ldexp(5.7, 4).should be_close(91.2, TOLERANCE)
+  end
+
+  it "raises an ArgumentError if the first argument cannot be coerced with Float()" do    
+    lambda { Math.ldexp("test", 2) }.should raise_error(ArgumentError)
+  end
+  
+  it "raises an TypeError if the second argument cannot be coerced with Integer()" do
+    lambda { Math.ldexp(3.2, "this") }.should raise_error(TypeError)
+  end
+  
+  it "raises a TypeError if the first argument is nil" do
+    lambda { Math.ldexp(nil, 2) }.should raise_error(TypeError)
+  end
+  
+  it "raises a TypeError if the second argument is nil" do
+    lambda { Math.ldexp(3.1, nil) }.should raise_error(TypeError)
+  end
+  
+  it "accepts any first argument that can be coerced with Float()" do
+    Math.ldexp(MathSpecs::Float.new, 2).should be_close(4.0, TOLERANCE)
+  end
+  
+  it "accepts any second argument that can be coerced with Integer()" do
+    Math.ldexp(3.23, MathSpecs::Integer.new).should be_close(12.92, TOLERANCE)
+  end
+end
+
+describe "Math#ldexp" do
+  it "is accessible as a private instance method" do
+    IncludesMath.new.send(:ldexp, 3.1415, 2).should be_close(12.566, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/math/log10_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/math/log10_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/math/log10_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,41 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+# The common logarithm, having base 10
+describe "Math.log10" do
+  it "returns a float" do 
+    Math.log10(1).class.should == Float
+  end
+  
+  it "return the base-10 logarithm of the argument" do
+    Math.log10(0.0001).should be_close(-4.0, TOLERANCE)
+    Math.log10(0.000000000001e-15).should be_close(-27.0, TOLERANCE)
+    Math.log10(1).should be_close(0.0, TOLERANCE)
+    Math.log10(10).should be_close(1.0, TOLERANCE)
+    Math.log10(10e15).should be_close(16.0, TOLERANCE)
+  end
+  
+  conflicts_with :Complex do
+    it "raises an Errno::EDOM if the argument is less than 0" do
+      lambda { Math.log10(-1e-15) }.should raise_error( Errno::EDOM)
+    end
+  end
+  
+  it "raises an ArgumentError if the argument cannot be coerced with Float()" do
+    lambda { Math.log10("test") }.should raise_error(ArgumentError)
+  end
+
+  it "raises a TypeError if the argument is nil" do
+    lambda { Math.log10(nil) }.should raise_error(TypeError)
+  end
+  
+  it "accepts any argument that can be coerced with Float()" do
+    Math.log10(MathSpecs::Float.new).should be_close(0.0, TOLERANCE)
+  end
+end
+
+describe "Math#log10" do
+  it "is accessible as a private instance method" do
+    IncludesMath.new.send(:log10, 4.15).should be_close(0.618048096712093, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/math/log2_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/math/log2_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/math/log2_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+extended_on :rubinius do
+  describe "Math.log2" do
+    it "returns a float" do
+      Math.log2(5.79).should be_close(2.53356334821451, TOLERANCE)
+    end
+
+    it "returns the natural logarithm of the argument" do
+      Math.log2(1.1).should be_close(0.137503523749935, TOLERANCE)
+      Math.log2(3.14).should be_close(1.6507645591169, TOLERANCE)
+    end
+
+    it "raises an Errno::EDOM if the argument is less than 0" do
+      lambda { Math.log2(-1e-15) }.should raise_error( Errno::EDOM)
+    end
+
+    it "raises an ArgumentError if the argument cannot be coerced with Float()" do
+      lambda { Math.log2("test") }.should raise_error(ArgumentError)
+    end
+
+    it "raises a TypeError if the argument is nil" do
+      lambda { Math.log2(nil) }.should raise_error(TypeError)
+    end
+
+    it "accepts any argument that can be coerced with Float()" do
+      Math.log2(MathSpecs::Float.new).should be_close(0.0, TOLERANCE)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/math/log_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/math/log_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/math/log_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,41 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+# The natural logarithm, having base Math::E
+describe "Math.log" do
+  it "returns a float" do
+    Math.log(1).class.should == Float
+  end
+  
+  it "returns the natural logarithm of the argument" do 
+    Math.log(0.0001).should be_close(-9.21034037197618, TOLERANCE)
+    Math.log(0.000000000001e-15).should be_close(-62.1697975108392, TOLERANCE)
+    Math.log(1).should be_close(0.0, TOLERANCE)
+    Math.log(10).should be_close( 2.30258509299405, TOLERANCE)
+    Math.log(10e15).should be_close(36.8413614879047, TOLERANCE)
+  end
+  
+  conflicts_with :Complex do
+    it "raises an Errno::EDOM if the argument is less than 0" do    
+      lambda { Math.log(-1e-15) }.should raise_error(Errno::EDOM)
+    end
+  end
+  
+  it "raises an ArgumentError if the argument cannot be coerced with Float()" do    
+    lambda { Math.log("test") }.should raise_error(ArgumentError)
+  end
+  
+  it "raises a TypeError if the argument is nil" do
+    lambda { Math.log(nil) }.should raise_error(TypeError)
+  end
+  
+  it "accepts any argument that can be coerced with Float()" do
+    Math.log(MathSpecs::Float.new).should be_close(0.0, TOLERANCE)
+  end
+end
+
+describe "Math#log" do
+  it "is accessible as a private instance method" do
+    IncludesMath.new.send(:log, 5.21).should be_close(1.65057985576528, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/math/sin_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/math/sin_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/math/sin_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+# sine : (-Inf, Inf) --> (-1.0, 1.0)
+describe "Math.sin" do 
+  it "returns a float" do 
+    Math.sin(Math::PI).class.should == Float
+  end 
+  
+  it "returns the sine of the argument expressed in radians" do    
+    Math.sin(Math::PI).should be_close(0.0, TOLERANCE)
+    Math.sin(0).should be_close(0.0, TOLERANCE)
+    Math.sin(Math::PI/2).should be_close(1.0, TOLERANCE)    
+    Math.sin(3*Math::PI/2).should be_close(-1.0, TOLERANCE)
+    Math.sin(2*Math::PI).should be_close(0.0, TOLERANCE)
+  end  
+ 
+  it "raises an ArgumentError if the argument cannot be coerced with Float()" do    
+    lambda { Math.sin("test") }.should raise_error(ArgumentError)
+  end
+  
+  it "raises a TypeError if the argument is nil" do
+    lambda { Math.sin(nil) }.should raise_error(TypeError)
+  end  
+  
+  it "accepts any argument that can be coerced with Float()" do
+    Math.sin(MathSpecs::Float.new).should be_close(0.841470984807897, TOLERANCE)
+  end
+end
+
+describe "Math#sin" do
+  it "is accessible as a private instance method" do
+    IncludesMath.new.send(:sin, 1.21).should be_close(0.935616001553386, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/math/sinh_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/math/sinh_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/math/sinh_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Math.sinh" do
+  it "returns a float" do
+    Math.sinh(1.2).class.should == Float
+  end
+  
+  it "returns the hyperbolic sin of the argument" do
+    Math.sinh(0.0).should == 0.0
+    Math.sinh(-0.0).should == 0.0
+    Math.sinh(1.5).should be_close(2.12927945509482, TOLERANCE)
+    Math.sinh(-2.8).should be_close(-8.19191835423591, TOLERANCE)
+  end
+
+  it "raises an ArgumentError if the argument cannot be coerced with Float()" do    
+    lambda { Math.sinh("test") }.should raise_error(ArgumentError)
+  end
+  
+  it "raises a TypeError if the argument is nil" do
+    lambda { Math.sinh(nil) }.should raise_error(TypeError)
+  end  
+  
+  it "accepts any argument that can be coerced with Float()" do
+    Math.sinh(MathSpecs::Float.new).should be_close(1.1752011936438, TOLERANCE)
+  end
+end
+
+describe "Math#sinh" do
+  it "is accessible as a private instance method" do
+    IncludesMath.new.send(:sinh, 1.99).should be_close(3.58941916843202, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/math/sqrt_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/math/sqrt_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/math/sqrt_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Math.sqrt" do
+  it "returns a float" do
+    Math.sqrt(1).class.should == Float
+  end
+  
+  it "returns the square root of the argument" do
+    Math.sqrt(1).should == 1.0
+    Math.sqrt(4.0).should == 2.0
+    Math.sqrt(15241578780673814.441547445).to_s.should == '123456789.123457'
+  end
+
+  it "raises an ArgumentError if the argument cannot be coerced with Float()" do
+    lambda { Math.sqrt("test") }.should raise_error(ArgumentError)
+  end
+
+  it "raises a TypeError if the argument is nil" do
+    lambda { Math.sqrt(nil) }.should raise_error(TypeError)
+  end    
+  
+  it "accepts any argument that can be coerced with Float()" do
+    Math.sqrt(MathSpecs::Float.new).should be_close(1.0, TOLERANCE)
+  end
+end
+
+describe "Math#sqrt" do
+  it "is accessible as a private instance method" do
+    IncludesMath.new.send(:sqrt, 2.23).should be_close(1.49331845230681, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/math/tan_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/math/tan_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/math/tan_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,38 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Math.tan" do
+  it "returns a float" do
+    Math.tan(1.35).class.should == Float
+  end
+  
+  it "returns the tangent of the argument" do
+    Math.tan(0.0).should == 0.0
+    Math.tan(-0.0).should == -0.0
+    Math.tan(4.22).should be_close(1.86406937682395, TOLERANCE)
+    Math.tan(-9.65).should be_close(-0.229109052606441, TOLERANCE)
+  end
+  
+  it "returns NaN if called with +-Infinitty" do
+    Math.tan(1.0/0.0).nan?.should == true
+    Math.tan(1.0/-0.0).nan?.should == true
+  end
+
+  it "raises an ArgumentError if the argument cannot be coerced with Float()" do
+    lambda { Math.tan("test") }.should raise_error(ArgumentError)
+  end
+
+  it "raises a TypeError if the argument is nil" do
+    lambda { Math.tan(nil) }.should raise_error(TypeError)
+  end    
+  
+  it "accepts any argument that can be coerced with Float()" do
+    Math.tan(MathSpecs::Float.new).should be_close(1.5574077246549, TOLERANCE)
+  end
+end
+
+describe "Math#tan" do
+  it "is accessible as a private instance method" do
+    IncludesMath.new.send(:tan, 1.0).should be_close(1.5574077246549, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/math/tanh_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/math/tanh_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/math/tanh_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Math.tanh" do
+  it "returns a float" do
+    Math.tanh(0.5).class.should == Float
+  end
+  
+  it "returns the hyperbolic tangent of the argument" do
+    Math.tanh(0.0).should == 0.0
+    Math.tanh(-0.0).should == -0.0
+    Math.tanh(1.0/0.0).should == 1.0
+    Math.tanh(1.0/-0.0).should == -1.0
+    Math.tanh(2.5).should be_close(0.98661429815143, TOLERANCE)
+    Math.tanh(-4.892).should be_close(-0.999887314427707, TOLERANCE)
+  end
+  
+  it "raises an ArgumentError if the argument cannot be coerced with Float()" do
+    lambda { Math.tanh("test") }.should raise_error(ArgumentError)
+  end
+
+  it "raises a TypeError if the argument is nil" do
+    lambda { Math.tanh(nil) }.should raise_error(TypeError)
+  end    
+  
+  it "accepts any argument that can be coerced with Float()" do
+    Math.tanh(MathSpecs::Float.new).should be_close(0.761594155955765, TOLERANCE)
+  end
+end
+
+describe "Math#tanh" do
+  it "is accessible as a private instance method" do
+    IncludesMath.new.send(:tanh, 5.21).should be_close(0.99994034202065, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/method/arity_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/method/arity_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/method/arity_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,48 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Method#arity" do
+  before(:each) do
+    @m = MethodSpecs::Methods.new
+  end
+
+  it "returns n, where n is the number of required arguments, when there are zero or more required arguments only" do
+    @m.method(:zero).arity.should    == 0
+    @m.method(:one_req).arity.should == 1
+    @m.method(:two_req).arity.should == 2
+  end
+
+  it "returns -(n+1), where n is the number of required arguments, when there is at least one optional argument" do
+    @m.method(:one_opt).arity.should         == -1
+    @m.method(:one_req_one_opt).arity.should == -2
+    @m.method(:one_req_two_opt).arity.should == -2
+    @m.method(:two_req_one_opt).arity.should == -3
+  end
+
+  it "returns -(n+1), where n is the number of required arguments, when there is a splat argument, regardless of optional arguments" do
+    @m.method(:zero_with_splat).arity.should            == -1
+    @m.method(:one_req_with_splat).arity.should         == -2
+    @m.method(:one_req_one_opt_with_splat).arity.should == -2
+    @m.method(:one_req_two_opt_with_splat).arity.should == -2
+    @m.method(:two_req_with_splat).arity.should         == -3
+    @m.method(:two_req_one_opt_with_splat).arity.should == -3
+  end
+
+  it "returns the same value regardless of the presence of a block" do
+    @m.method(:zero_with_block).arity.should                      == @m.method(:zero).arity
+    @m.method(:one_req_with_block).arity.should                   == @m.method(:one_req).arity
+    @m.method(:two_req_with_block).arity.should                   == @m.method(:two_req).arity
+
+    @m.method(:one_opt_with_block).arity.should                   == @m.method(:one_opt).arity
+    @m.method(:one_req_one_opt_with_block).arity.should           == @m.method(:one_req_one_opt).arity
+    @m.method(:one_req_two_opt_with_block).arity.should           == @m.method(:one_req_two_opt).arity
+    @m.method(:two_req_one_opt_with_block).arity.should           == @m.method(:two_req_one_opt).arity
+
+    @m.method(:zero_with_splat_and_block).arity.should            == @m.method(:zero_with_splat).arity
+    @m.method(:one_req_with_splat_and_block).arity.should         == @m.method(:one_req_with_splat).arity
+    @m.method(:one_req_one_opt_with_splat_and_block).arity.should == @m.method(:one_req_one_opt_with_splat).arity
+    @m.method(:one_req_two_opt_with_splat_and_block).arity.should == @m.method(:one_req_two_opt_with_splat).arity
+    @m.method(:two_req_with_splat_and_block).arity.should         == @m.method(:two_req_with_splat).arity
+    @m.method(:two_req_one_opt_with_splat_and_block).arity.should == @m.method(:two_req_one_opt_with_splat).arity
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/method/call_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/method/call_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/method/call_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/call' 
+
+describe "Method#call" do
+  it_behaves_like(:method_call, :call)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/method/clone_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/method/clone_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/method/clone_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Method#clone" do
+  it "returns a copy of the method" do
+    m1 = MethodSpecs::Methods.new.method(:foo)
+    m2 = m1.clone
+
+    m1.should == m2
+    m1.should_not eql(m2)
+
+    m1.call.should == m2.call
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/method/element_reference_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/method/element_reference_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/method/element_reference_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/call'
+
+describe "Method#[]" do
+  it_behaves_like(:method_call, :[])
+end

Added: MacRuby/branches/experimental/spec/frozen/core/method/equal_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/method/equal_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/method/equal_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,43 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Method#==" do
+  before(:each) do
+    @m = MethodSpecs::Methods.new
+    @m2 = MethodSpecs::Methods.new
+    @a = MethodSpecs::A.new
+  end
+
+  it "returns true if methods are the same" do
+    m1 = @m.method(:foo)
+    m2 = @m.method(:foo)
+
+    (m1 == m1).should == true
+    (m1 == m2).should == true
+  end
+
+  it "returns true on aliased methods" do
+    m1 = @m.method(:foo)
+    m2 = @m.method(:bar)
+
+    (m1 == m2).should == true
+  end
+  
+  it "returns false on a method which is neither aliases nor the same method" do
+    m1 = @m.method(:foo)
+    m2 = @m.method(:zero)
+    
+    (m1 == m2).should == false
+  end
+  
+  it "returns false for a method which is not bound to the same object" do
+    m1 = @m.method(:foo)
+    m2 = @m2.method(:foo)
+
+    a = @a.method(:baz)
+    
+    (m1 == m2).should == false
+    (m1 == a).should == false
+    (m2 == a).should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/method/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/method/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/method/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,66 @@
+module MethodSpecs
+  class Methods
+    def foo
+      true
+    end
+    alias bar foo
+
+    def zero; end
+    def one_req(a); end
+    def two_req(a, b); end
+
+    def zero_with_block(&block); end
+    def one_req_with_block(a, &block); end
+    def two_req_with_block(a, b, &block); end
+
+    def one_opt(a=nil); end
+    def one_req_one_opt(a, b=nil); end
+    def one_req_two_opt(a, b=nil, c=nil); end
+    def two_req_one_opt(a, b, c=nil); end
+
+    def one_opt_with_block(a=nil, &block); end
+    def one_req_one_opt_with_block(a, b=nil, &block); end
+    def one_req_two_opt_with_block(a, b=nil, c=nil, &block); end
+    def two_req_one_opt_with_block(a, b, c=nil, &block); end
+
+    def zero_with_splat(*a); end
+    def one_req_with_splat(a, *b); end
+    def two_req_with_splat(a, b, *c); end
+    def one_req_one_opt_with_splat(a, b=nil, *c); end
+    def two_req_one_opt_with_splat(a, b, c=nil, *d); end
+    def one_req_two_opt_with_splat(a, b=nil, c=nil, *d); end
+
+    def zero_with_splat_and_block(*a, &block); end
+    def one_req_with_splat_and_block(a, *b, &block); end
+    def two_req_with_splat_and_block(a, b, *c, &block); end
+    def one_req_one_opt_with_splat_and_block(a, b=nil, *c, &block); end
+    def two_req_one_opt_with_splat_and_block(a, b, c=nil, *d, &block); end
+    def one_req_two_opt_with_splat_and_block(a, b=nil, c=nil, *d, &block); end
+  end
+
+  module MyMod
+    def bar; :bar; end
+  end
+
+  class MySuper
+    include MyMod
+  end
+
+  class MySub < MySuper; end
+
+  class A
+    def baz(a, b)
+      self.class
+    end
+  end
+
+  class B < A
+  end
+
+  class C < B
+  end
+
+  class D
+    def bar() 'done' end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/method/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/method/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/method/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/to_s'
+
+describe "Method#inspect" do
+  it_behaves_like(:method_to_s, :inspect)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/method/shared/call.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/method/shared/call.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/method/shared/call.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+describe :method_call, :shared => true do
+  it "invokes the method with the specified arguments, returning the method's return value" do
+    m = 12.method("+")
+    m.send(@method, 3).should == 15
+    m.send(@method, 20).should == 32
+  end
+
+  it "raises an ArgumentError when given incorrect number of arguments" do
+    lambda {
+      MethodSpecs::Methods.new.method(:two_req).send(@method, 1, 2, 3)
+    }.should raise_error(ArgumentError)
+    lambda {
+      MethodSpecs::Methods.new.method(:two_req).send(@method, 1)
+    }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/method/shared/to_s.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/method/shared/to_s.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/method/shared/to_s.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require "#{File.dirname __FILE__}/../../../spec_helper"
+require "#{File.dirname __FILE__}/../fixtures/classes"
+
+describe :method_to_s, :shared => true do
+  before :each do
+    @m = MethodSpecs::MySub.new.method :bar
+    @string = @m.send(@method).sub(/0x\w+/, '0xXXXXXX')
+  end
+
+  it "returns a String" do
+    @m.send(@method).class.should == String
+  end
+
+  it "returns a String containing 'Method'" do
+    @string.should =~ /\bMethod\b/
+  end
+
+  it "returns a String containing the method name" do
+    @string.should =~ /\#bar/
+  end
+
+  it "returns a String containing the Module the method is defined in" do
+    @string.should =~ /MethodSpecs::MyMod/
+  end
+
+  it "returns a String containing the Module the method is referenced from" do
+    @string.should =~ /MethodSpecs::MySub/
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/method/to_proc_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/method/to_proc_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/method/to_proc_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,50 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Method#to_proc" do
+  before(:each) do
+    @m = MethodSpecs::Methods.new
+    @meth = @m.method(:foo)
+  end
+
+  it "returns a Proc object corresponding to the method" do
+    @meth.to_proc.kind_of?(Proc).should == true
+  end
+
+  it "Proc object should have the correct arity" do
+    # This may seem redundant but this bug has cropped up in jruby, mri and yarv.
+    # http://jira.codehaus.org/browse/JRUBY-124
+    [ :zero, :one_req, :two_req,
+      :zero_with_block, :one_req_with_block, :two_req_with_block,
+      :one_opt, :one_req_one_opt, :one_req_two_opt, :two_req_one_opt,
+      :one_opt_with_block, :one_req_one_opt_with_block, :one_req_two_opt_with_block, :two_req_one_opt_with_block,
+      :zero_with_splat, :one_req_with_splat, :two_req_with_splat,
+      :one_req_one_opt_with_splat, :one_req_two_opt_with_splat, :two_req_one_opt_with_splat,
+      :zero_with_splat_and_block, :one_req_with_splat_and_block, :two_req_with_splat_and_block,
+      :one_req_one_opt_with_splat_and_block, :one_req_two_opt_with_splat_and_block, :two_req_one_opt_with_splat_and_block
+    ].each do |m|
+      @m.method(m).to_proc.arity.should == @m.method(m).arity
+    end
+  end
+
+  it "returns a proc that can be used by define_method" do
+    x = 'test'
+    to_s = class << x
+      define_method :foo, method(:to_s).to_proc
+      to_s
+    end
+
+    x.foo.should == to_s
+  end
+
+  it "returns a proc that can be yielded to" do
+    x = Object.new
+    def x.foo(*a); a; end
+    def x.bar; yield; end
+    def x.baz(*a); yield(*a); end
+
+    m = x.method :foo
+    x.bar(&m).should == []
+    x.baz(1,2,3,&m).should == [1,2,3]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/method/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/method/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/method/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/to_s'
+
+describe "Method#to_s" do
+  it_behaves_like(:method_to_s, :to_s)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/method/unbind_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/method/unbind_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/method/unbind_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,37 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Method#unbind" do
+  before(:each) do
+    @normal = MethodSpecs::Methods.new
+    @normal_m = @normal.method :foo
+    @normal_um = @normal_m.unbind
+    @pop_um = MethodSpecs::MySub.new.method(:bar).unbind
+    @string = @pop_um.inspect.sub(/0x\w+/, '0xXXXXXX')
+  end
+
+  it "returns an UnboundMethod" do
+    @normal_um.class.should == UnboundMethod
+  end
+
+  it "returns a String containing 'UnboundMethod'" do
+    @string.should =~ /\bUnboundMethod\b/
+  end
+
+  it "returns a String containing the method name" do
+    @string.should =~ /\#bar/
+  end
+
+  it "returns a String containing the Module the method is defined in" do
+    @string.should =~ /MethodSpecs::MyMod/
+  end
+
+  it "returns a String containing the Module the method is referenced from" do
+    @string.should =~ /MethodSpecs::MySub/
+  end
+
+  specify "rebinding UnboundMethod to Method's obj produces exactly equivalent Methods" do
+    @normal_um.bind(@normal).should == @normal_m
+    @normal_m.should == @normal_um.bind(@normal)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/alias_method_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/alias_method_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/alias_method_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,59 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#alias_method" do
+  before(:each) do
+    @class = Class.new(ModuleSpecs::Aliasing)
+    @object = @class.new 
+  end
+  
+  it "makes a copy of the method" do
+    @class.make_alias :uno, :public_one
+    @class.make_alias :double, :public_two
+    @object.uno.should == @object.public_one
+    @object.double(12).should == @object.public_two(12)
+  end
+
+  it "retains method visibility" do
+    @class.make_alias :private_ichi, :private_one
+    lambda { @object.private_one  }.should raise_error(NameError)
+    lambda { @object.private_ichi }.should raise_error(NameError)
+    @class.make_alias :public_ichi, :public_one
+    @object.public_ichi.should == @object.public_one
+    @class.make_alias :protected_ichi, :protected_one
+    lambda { @object.protected_ichi }.should raise_error(NameError)
+  end
+  
+  it "fails if origin method not found" do
+    lambda { @class.make_alias :ni, :san }.should raise_error(NameError)
+  end
+
+  it "converts a non string/symbol/fixnum name to string using to_str" do
+    @class.make_alias "un", "public_one"
+    @class.make_alias :deux, "public_one"
+    @class.make_alias "trois", :public_one
+    @class.make_alias :quatre, :public_one
+    name = mock('cinq')
+    name.should_receive(:to_str).any_number_of_times.and_return("cinq")
+    @class.make_alias name, "public_one"
+    @class.make_alias "cinq", name
+  end
+
+  it "raises a TypeError when the given name can't be converted using to_str" do
+    lambda { @class.make_alias mock('x'), :public_one }.should raise_error(TypeError)
+  end
+
+  it "is a private method" do
+    lambda { @class.alias_method :ichi, :public_one }.should raise_error(NoMethodError)
+  end
+
+  it "works in module" do
+    ModuleSpecs::Allonym.new.publish.should == :report
+  end
+  
+  it "works on private module methods in a module that has been reopened" do
+    ModuleSpecs::ReopeningModule.foo.should == true
+    lambda { ModuleSpecs::ReopeningModule.foo2 }.should_not raise_error(NoMethodError)
+  end
+  
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/allocate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/allocate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/allocate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Module.allocate" do
+  it "returns an instance of Module" do
+    mod = Module.allocate
+    mod.should be_kind_of(Module)
+  end
+  
+  it "returns a fully-formed instance of Module" do
+    mod = Module.allocate
+    mod.constants.should_not == nil
+    mod.methods.should_not == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/ancestors_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/ancestors_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/ancestors_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#ancestors" do
+  it "returns a list of modules included in self (including self)" do
+    ModuleSpecs.ancestors.should         include(ModuleSpecs)
+    ModuleSpecs::Basic.ancestors.should  include(ModuleSpecs::Basic)
+    ModuleSpecs::Super.ancestors.should  include(ModuleSpecs::Super, ModuleSpecs::Basic)
+    ModuleSpecs::Parent.ancestors.should include(ModuleSpecs::Parent, Object, Kernel)
+    ModuleSpecs::Child.ancestors.should  include(ModuleSpecs::Child, ModuleSpecs::Super, ModuleSpecs::Basic, ModuleSpecs::Parent, Object, Kernel)
+  end
+  
+  it "returns only modules and classes" do
+    class << ModuleSpecs::Child; self; end.ancestors.should include(ModuleSpecs::Internal, Class, Module, Object, Kernel)
+  end
+
+  it "has 1 entry per module or class" do
+    ModuleSpecs::Parent.ancestors.should == ModuleSpecs::Parent.ancestors.uniq
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/append_features_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/append_features_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/append_features_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#append_features" do
+  it "gets called when self is included in another module/class" do
+    begin
+      m = Module.new do
+        def self.append_features(mod)
+          $appended_to = mod
+        end
+      end
+      
+      c = Class.new do
+        include m
+      end
+      
+      $appended_to.should == c
+    ensure
+      $appended_to = nil
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/attr_accessor_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/attr_accessor_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/attr_accessor_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,57 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#attr_accessor" do
+  it "creates a getter and setter for each given attribute name" do
+    c = Class.new do
+      attr_accessor :a, "b"
+    end
+    
+    o = c.new
+    
+    ['a','b'].each do |x|
+      o.respond_to?(x).should == true
+      o.respond_to?("#{x}=").should == true
+    end
+    
+    o.a = "a"
+    o.a.should == "a"
+
+    o.b = "b"
+    o.b.should == "b"
+    o.a = o.b = nil
+
+    o.send(:a=,"a")
+    o.send(:a).should == "a"
+
+    o.send(:b=, "b")
+    o.send(:b).should == "b"
+  end
+  
+  it "converts non string/symbol/fixnum names to strings using to_str" do
+    (o = mock('test')).should_receive(:to_str).any_number_of_times.and_return("test")
+    c = Class.new do
+      attr_accessor o
+    end
+    
+    c.new.respond_to?("test").should == true
+    c.new.respond_to?("test=").should == true
+  end
+
+  it "raises a TypeError when the given names can't be converted to strings using to_str" do
+    o = mock('o')
+    lambda { Class.new { attr_accessor o } }.should raise_error(TypeError)
+    (o = mock('123')).should_receive(:to_str).and_return(123)
+    lambda { Class.new { attr_accessor o } }.should raise_error(TypeError)
+  end
+
+  it "applies current visibility to methods created" do
+    c = Class.new do
+      protected
+      attr_accessor :foo
+    end
+
+    lambda { c.new.foo }.should raise_error(NoMethodError)
+    lambda { c.new.foo=1 }.should raise_error(NoMethodError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/attr_reader_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/attr_reader_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/attr_reader_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,52 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#attr_reader" do
+  it "creates a getter for each given attribute name" do
+    c = Class.new do
+      attr_reader :a, "b"
+      
+      def initialize
+        @a = "test"
+        @b = "test2"
+      end
+    end
+    
+    o = c.new
+    %w{a b}.each do |x|
+      o.respond_to?(x).should == true
+      o.respond_to?("#{x}=").should == false
+    end
+
+    o.a.should == "test"
+    o.b.should == "test2"
+    o.send(:a).should == "test"
+    o.send(:b).should == "test2"
+  end
+
+  it "converts non string/symbol/fixnum names to strings using to_str" do
+    (o = mock('test')).should_receive(:to_str).any_number_of_times.and_return("test")
+    c = Class.new do
+      attr_reader o
+    end
+    
+    c.new.respond_to?("test").should == true
+    c.new.respond_to?("test=").should == false
+  end
+
+  it "raises a TypeError when the given names can't be converted to strings using to_str" do
+    o = mock('o')
+    lambda { Class.new { attr_reader o } }.should raise_error(TypeError)
+    (o = mock('123')).should_receive(:to_str).and_return(123)
+    lambda { Class.new { attr_reader o } }.should raise_error(TypeError)
+  end
+
+  it "applies current visibility to methods created" do
+    c = Class.new do
+      protected
+      attr_reader :foo
+    end
+
+    lambda { c.new.foo }.should raise_error(NoMethodError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/attr_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/attr_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/attr_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,134 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#attr" do
+  it "creates a getter for the given attribute name" do
+    c = Class.new do
+      attr :attr
+      attr "attr3"
+      
+      def initialize
+        @attr, @attr2, @attr3 = "test", "test2", "test3"
+      end
+    end
+    
+    o = c.new
+    
+    %w{attr attr3}.each do |a|
+      o.respond_to?(a).should == true
+      o.respond_to?("#{a}=").should == false
+    end
+
+    o.attr.should  == "test"
+    o.attr3.should == "test3"
+    o.send(:attr).should == "test"
+    o.send(:attr3).should == "test3"
+  end
+  
+  ruby_version_is "" .. "1.9" do
+    it "creates a setter for the given attribute name if writable is true" do
+      c = Class.new do
+        attr :attr, true
+        attr "attr3", true
+        
+        def initialize
+          @attr, @attr2, @attr3 = "test", "test2", "test3"
+        end
+      end
+      
+      o = c.new
+      
+      %w{attr attr3}.each do |a|
+        o.respond_to?(a).should == true
+        o.respond_to?("#{a}=").should == true
+      end
+      
+      o.attr = "test updated"
+      o.attr3 = "test3 updated"
+    end
+    
+    it "creates a getter and setter for the given attribute name if called with and without writeable is true" do
+      c = Class.new do
+        attr :attr, true
+        attr :attr
+
+        attr "attr3", true
+        attr "attr3"
+        
+        def initialize
+          @attr, @attr2, @attr3 = "test", "test2", "test3"
+        end
+      end
+      
+      o = c.new
+
+      %w{attr attr3}.each do |a|
+        o.respond_to?(a).should == true
+        o.respond_to?("#{a}=").should == true
+      end
+      
+      o.attr.should == "test"
+      o.attr = "test updated"
+      o.attr.should == "test updated"
+
+      o.attr3.should == "test3"
+      o.attr3 = "test3 updated"
+      o.attr3.should == "test3 updated"
+    end
+    
+    it "applies current visibility to methods created" do
+      c = Class.new do
+        protected
+        attr :foo, true
+      end
+
+      lambda { c.new.foo }.should raise_error(NoMethodError)
+      lambda { c.new.foo=1 }.should raise_error(NoMethodError)
+    end
+  end
+  
+  ruby_version_is "1.9" do
+    it "creates a getter but no setter for all given attribute names" do
+      c = Class.new do
+        attr :attr, "attr2", "attr3"
+        
+        def initialize
+          @attr, @attr2, @attr3 = "test", "test2", "test3"
+        end
+      end
+      
+      o = c.new
+      
+      %w{attr attr2 attr3}.each do |a|
+        o.respond_to?(a).should == true
+        o.respond_to?("#{a}=").should == false
+      end
+
+      o.attr.should  == "test"
+      o.attr2.should == "test2"
+      o.attr3.should == "test3"
+    end
+    
+    it "applies current visibility to methods created" do
+      c = Class.new do
+        protected
+        attr :foo, :bar
+      end
+
+      lambda { c.new.foo }.should raise_error(NoMethodError)
+      lambda { c.new.bar }.should raise_error(NoMethodError)
+    end
+  end
+
+  it "converts non string/symbol/fixnum names to strings using to_str" do
+    (o = mock('test')).should_receive(:to_str).any_number_of_times.and_return("test")
+    Class.new { attr o }.new.respond_to?("test").should == true
+  end
+  
+  it "raises a TypeError when the given names can't be converted to strings using to_str" do
+    o = mock('o')
+    lambda { Class.new { attr o } }.should raise_error(TypeError)
+    (o = mock('123')).should_receive(:to_str).and_return(123)
+    lambda { Class.new { attr o } }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/attr_writer_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/attr_writer_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/attr_writer_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,67 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#attr_writer" do
+  it "creates a setter for each given attribute name" do
+    c = Class.new do
+      attr_writer :test1, "test2"
+    end
+    o = c.new
+
+    o.respond_to?("test1").should == false
+    o.respond_to?("test2").should == false
+
+    o.respond_to?("test1=").should == true
+    o.test1 = "test_1"
+    o.instance_variable_get(:@test1).should == "test_1"
+
+    o.respond_to?("test2=").should == true
+    o.test2 = "test_2"
+    o.instance_variable_get(:@test2).should == "test_2"
+    o.send(:test1=,"test_1 updated")
+    o.instance_variable_get(:@test1).should == "test_1 updated"
+    o.send(:test2=,"test_2 updated")
+    o.instance_variable_get(:@test2).should == "test_2 updated"
+  end
+
+  not_compliant_on :rubinius do
+    it "creates a setter for an attribute name given as a Fixnum" do
+      c = Class.new do
+        attr_writer :test1.to_i
+      end
+
+      o = c.new
+      o.respond_to?("test1").should == false
+      o.respond_to?("test1=").should == true
+
+      o.test1 = "test_1"
+      o.instance_variable_get(:@test1).should == "test_1"
+    end
+  end
+
+  it "converts non string/symbol/fixnum names to strings using to_str" do
+    (o = mock('test')).should_receive(:to_str).any_number_of_times.and_return("test")
+    c = Class.new do
+      attr_writer o
+    end
+
+    c.new.respond_to?("test").should == false
+    c.new.respond_to?("test=").should == true
+  end
+
+  it "raises a TypeError when the given names can't be converted to strings using to_str" do
+    o = mock('test1')
+    lambda { Class.new { attr_writer o } }.should raise_error(TypeError)
+    (o = mock('123')).should_receive(:to_str).and_return(123)
+    lambda { Class.new { attr_writer o } }.should raise_error(TypeError)
+  end
+
+  it "applies current visibility to methods created" do
+    c = Class.new do
+      protected
+      attr_writer :foo
+    end
+
+    lambda { c.new.foo=1 }.should raise_error(NoMethodError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/autoload_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/autoload_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/autoload_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,299 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#autoload?" do
+  it "returns the name of the file that will be autoloaded" do
+    ModuleSpecs::Autoload.autoload :Autoload, "autoload.rb"
+    ModuleSpecs::Autoload.autoload?(:Autoload).should == "autoload.rb"
+  end
+
+  it "returns nil if no file has been registered for a constant" do
+    ModuleSpecs::Autoload.autoload?(:Manualload).should be_nil
+  end
+end
+
+describe "Module#autoload" do
+  before :all do
+    @non_existent = fixture __FILE__, "no_autoload.rb"
+  end
+
+  before :each do
+    @loaded_features = $".dup
+
+    ScratchPad.clear
+  end
+
+  after :each do
+    $".replace @loaded_features
+  end
+
+  it "registers a file to load the first time the named constant is accessed" do
+    ModuleSpecs::Autoload.autoload :A, @non_existent
+    ModuleSpecs::Autoload.autoload?(:A).should == @non_existent
+  end
+
+  it "sets the autoload constant in the constants table" do
+    ModuleSpecs::Autoload.autoload :B, @non_existent
+    ModuleSpecs::Autoload.should have_constant(:B)
+  end
+
+  it "loads the registered constant when it is accessed" do
+    ModuleSpecs::Autoload.should_not have_constant(:X)
+    ModuleSpecs::Autoload.autoload :X, fixture(__FILE__, "autoload_x.rb")
+    ModuleSpecs::Autoload::X.should == :x
+  end
+
+  it "loads the registered constant into a dynamically created class" do
+    cls = Class.new { autoload :C, fixture(__FILE__, "autoload_c.rb") }
+    ModuleSpecs::Autoload::DynClass = cls
+
+    ScratchPad.recorded.should be_nil
+    ModuleSpecs::Autoload::DynClass::C.new.loaded.should == :dynclass_c
+    ScratchPad.recorded.should == :loaded
+  end
+
+  it "loads the registered constant into a dynamically created module" do
+    mod = Module.new { autoload :D, fixture(__FILE__, "autoload_d.rb") }
+    ModuleSpecs::Autoload::DynModule = mod
+
+    ScratchPad.recorded.should be_nil
+    ModuleSpecs::Autoload::DynModule::D.new.loaded.should == :dynmodule_d
+    ScratchPad.recorded.should == :loaded
+  end
+
+  it "loads the registered constant when it is opened as a class" do
+    ModuleSpecs::Autoload.autoload :E, fixture(__FILE__, "autoload_e.rb")
+    class ModuleSpecs::Autoload::E
+    end
+    ModuleSpecs::Autoload::E.new.loaded.should == :autoload_e
+  end
+
+  it "loads the registered constant when it is opened as a module" do
+    ModuleSpecs::Autoload.autoload :F, fixture(__FILE__, "autoload_f.rb")
+    module ModuleSpecs::Autoload::F
+    end
+    ModuleSpecs::Autoload::F.loaded.should == :autoload_f
+  end
+
+  it "loads the registered constant when it is inherited from" do
+    ModuleSpecs::Autoload.autoload :G, fixture(__FILE__, "autoload_g.rb")
+    class ModuleSpecs::Autoload::Gsub < ModuleSpecs::Autoload::G
+    end
+    ModuleSpecs::Autoload::Gsub.new.loaded.should == :autoload_g
+  end
+
+  it "loads the registered constant when it is included" do
+    ModuleSpecs::Autoload.autoload :H, fixture(__FILE__, "autoload_h.rb")
+    class ModuleSpecs::Autoload::HClass
+      include ModuleSpecs::Autoload::H
+    end
+    ModuleSpecs::Autoload::HClass.new.loaded.should == :autoload_h
+  end
+
+  it "does not load the file when the constant is already set" do
+    ModuleSpecs::Autoload.autoload :I, fixture(__FILE__, "autoload_i.rb")
+    ModuleSpecs::Autoload.const_set :I, 3
+    ModuleSpecs::Autoload::I.should == 3
+    ScratchPad.recorded.should be_nil
+  end
+
+  it "loads a file with .rb extension when passed the name without the extension" do
+    ModuleSpecs::Autoload.autoload :J, fixture(__FILE__, "autoload_j")
+    ModuleSpecs::Autoload::J.should == :autoload_j
+  end
+
+  it "does not load the file if the file is manually required" do
+    filename = fixture(__FILE__, "autoload_k.rb")
+    ModuleSpecs::Autoload.autoload :K, filename
+
+    require filename
+    ScratchPad.recorded.should == :loaded
+    ScratchPad.clear
+
+    ModuleSpecs::Autoload::K.should == :autoload_k
+    ScratchPad.recorded.should be_nil
+  end
+
+  it "allows multiple autoload constants for a single file" do
+    filename = fixture(__FILE__, "autoload_lm.rb")
+    ModuleSpecs::Autoload.autoload :L, filename
+    ModuleSpecs::Autoload.autoload :M, filename
+    ModuleSpecs::Autoload::L.should == :autoload_l
+    ModuleSpecs::Autoload::M.should == :autoload_m
+  end
+
+  ruby_version_is "" ... "1.9" do
+    it "removes the constant from the constant table if load fails" do
+      ModuleSpecs::Autoload.autoload :Fail, @non_existent
+      ModuleSpecs::Autoload.should have_constant(:Fail)
+
+      lambda { ModuleSpecs::Autoload::Fail }.should raise_error(LoadError)
+      ModuleSpecs::Autoload.should_not have_constant(:Fail)
+    end
+
+    it "removes the constant from the constant table if the loaded files does not define it" do
+      ModuleSpecs::Autoload.autoload :O, fixture(__FILE__, "autoload_o.rb")
+      ModuleSpecs::Autoload.should have_constant(:O)
+
+      lambda { ModuleSpecs::Autoload::O }.should raise_error(NameError)
+      ModuleSpecs::Autoload.should_not have_constant(:O)
+    end
+
+    it "does not load the file when refering to the constant in defined?" do
+      module ModuleSpecs::Autoload::Q
+        autoload :R, fixture(__FILE__, "autoload.rb")
+        defined?(R).should == "constant"
+      end
+      ModuleSpecs::Autoload::Q.should have_constant(:R)
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "does not remove the constant from the constant table if load fails" do
+      ModuleSpecs::Autoload.autoload :Fail, @non_existent
+      ModuleSpecs::Autoload.should have_constant(:Fail)
+
+      lambda { ModuleSpecs::Autoload::Fail }.should raise_error(LoadError)
+      ModuleSpecs::Autoload.should have_constant(:Fail)
+    end
+
+    it "does not remove the constant from the constant table if the loaded files does not define it" do
+      ModuleSpecs::Autoload.autoload :O, fixture(__FILE__, "autoload_o.rb")
+      ModuleSpecs::Autoload.should have_constant(:O)
+
+      lambda { ModuleSpecs::Autoload::O }.should raise_error(NameError)
+      ModuleSpecs::Autoload.should have_constant(:O)
+    end
+
+    it "does not load the file when refering to the constant in defined?" do
+      module ModuleSpecs::Autoload::Q
+        autoload :R, fixture(__FILE__, "autoload.rb")
+        defined?(R).should be_nil
+      end
+      ModuleSpecs::Autoload::Q.should have_constant(:R)
+    end
+  end
+
+  it "does not load the file when removing an autoload constant" do
+    module ModuleSpecs::Autoload::Q
+      autoload :R, fixture(__FILE__, "autoload.rb")
+      remove_const :R
+    end
+    ModuleSpecs::Autoload::Q.should_not have_constant(:R)
+  end
+
+  it "does not load the file when accessing the constants table of the module" do
+    ModuleSpecs::Autoload.autoload :P, @non_existent
+    ModuleSpecs::Autoload.const_defined?(:P).should be_true
+  end
+
+  it "loads the file when opening a module that is the autoloaded constant" do
+    module ModuleSpecs::Autoload::U
+      autoload :V, fixture(__FILE__, "autoload_v.rb")
+
+      class V
+        X = get_value
+      end
+    end
+
+    ModuleSpecs::Autoload::U::V::X.should == :autoload_uvx
+  end
+
+  # [ruby-core:19127]
+  it "raises a NameError when the autoload file did not define the constant and a module is opened with the same name" do
+    lambda do
+      module ModuleSpecs::Autoload
+        class W
+          autoload :Y, fixture(__FILE__, "autoload_w.rb")
+
+          class Y
+          end
+        end
+      end
+    end.should raise_error(NameError)
+    ScratchPad.recorded.should == :loaded
+  end
+
+  it "raises an ArgumentError when an empty filename is given" do
+    lambda { ModuleSpecs.autoload :A, "" }.should raise_error(ArgumentError)
+  end
+
+  it "raises a NameError when the constant name starts with a lower case letter" do
+    lambda { ModuleSpecs.autoload "a", @non_existent }.should raise_error(NameError)
+  end
+
+  it "raises a NameError when the constant name starts with a number" do
+    lambda { ModuleSpecs.autoload "1two", @non_existent }.should raise_error(NameError)
+  end
+
+  it "raises a NameError when the constant name has a space in it" do
+    lambda { ModuleSpecs.autoload "a name", @non_existent }.should raise_error(NameError)
+  end
+
+  ruby_bug "redmine #620", "1.8.6.322" do
+    it "shares the autoload request across dup'ed copies of modules" do
+      filename = fixture(__FILE__, "autoload_t.rb")
+      mod1 = Module.new { autoload :T, filename }
+      ModuleSpecs::Autoload::S = mod1
+      mod2 = mod1.dup
+
+      mod1.autoload?(:T).should == filename
+      mod2.autoload?(:T).should == filename
+
+      mod1::T.should == :autoload_t
+      lambda { mod2::T }.should raise_error(NameError)
+    end
+  end
+
+  it "raises a TypeError if opening a class with a different superclass than the class defined in the autoload file" do
+    ModuleSpecs::Autoload.autoload :Z, fixture(__FILE__, "autoload_z.rb")
+    class ModuleSpecs::Autoload::ZZ
+    end
+
+    lambda do
+      class ModuleSpecs::Autoload::Z < ModuleSpecs::Autoload::ZZ
+      end
+    end.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError if not passed a String for the filename" do
+    name = mock("autoload_name.rb")
+    name.stub!(:to_s).and_return("autoload_name.rb")
+    name.stub!(:to_str).and_return("autoload_name.rb")
+
+    lambda { ModuleSpecs::Autoload.autoload :Str, name }.should raise_error(TypeError)
+  end
+end
+
+describe "Module#autoload" do
+  # It would be nice to check this with a simple obj.should_not_receive,
+  # but getting at that obj is implementation specific. This method is the
+  # least implementation specific because it inserts the method that raises
+  # an exception into the dynamic lookup chain.
+  before :all do
+    module Kernel
+      alias_method :original_require, :require
+      alias_method :original_load,    :load
+
+      def require(name)
+        raise Exception, "Kernel#require called"
+      end
+
+      def load(name)
+        raise Exception, "Kernel#load called"
+      end
+    end
+  end
+
+  after :all do
+    module Kernel
+      alias_method :require, :original_require
+      alias_method :load,    :original_load
+    end
+  end
+
+  it "does not call Kernel#require or Kernel#load dynamically" do
+    ModuleSpecs::Autoload.autoload :N, fixture(__FILE__, "autoload_n.rb")
+    ModuleSpecs::Autoload::N.should == :autoload_n
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/case_compare_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/case_compare_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/case_compare_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#===" do
+  it "returns true when the given Object is an instance of self or of self's descendants" do
+    (ModuleSpecs::Child       === ModuleSpecs::Child.new).should == true
+    (ModuleSpecs::Parent      === ModuleSpecs::Parent.new).should == true
+    
+    (ModuleSpecs::Parent      === ModuleSpecs::Child.new).should == true
+    (Object                   === ModuleSpecs::Child.new).should == true
+
+    (ModuleSpecs::Child       === String.new).should == false
+    (ModuleSpecs::Child       === mock('x')).should == false
+  end
+  
+  it "returns true when the given Object's class includes self or when the given Object is extended by self" do
+    (ModuleSpecs::Basic === ModuleSpecs::Child.new).should == true
+    (ModuleSpecs::Super === ModuleSpecs::Child.new).should == true
+    (ModuleSpecs::Basic === mock('x').extend(ModuleSpecs::Super)).should == true
+    (ModuleSpecs::Super === mock('y').extend(ModuleSpecs::Super)).should == true
+
+    (ModuleSpecs::Basic === ModuleSpecs::Parent.new).should == false
+    (ModuleSpecs::Super === ModuleSpecs::Parent.new).should == false
+    (ModuleSpecs::Basic === mock('z')).should == false
+    (ModuleSpecs::Super === mock('a')).should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/class_eval_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/class_eval_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/class_eval_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/class_eval'
+
+describe "Module#class_eval" do
+  it_behaves_like :module_class_eval, :class_eval
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/class_variable_defined_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/class_variable_defined_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/class_variable_defined_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,67 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#class_variable_defined?" do
+  it "returns true if a class variable with the given name is defined in self" do
+    c = Class.new { class_variable_set :@@class_var, "test" }
+    c.class_variable_defined?(:@@class_var).should == true
+    c.class_variable_defined?("@@class_var").should == true
+    c.class_variable_defined?(:@@no_class_var).should == false
+    c.class_variable_defined?("@@no_class_var").should == false
+    ModuleSpecs::CVars.class_variable_defined?("@@cls").should == true
+  end
+
+  it "returns true if a class variable with the given name is defined in the metaclass" do
+    ModuleSpecs::CVars.class_variable_defined?("@@meta").should == true
+  end
+
+  it "returns true if a class variables with the given name is defined in an included module" do
+    c = Class.new { include ModuleSpecs::MVars }
+    c.class_variable_defined?("@@mvar").should == true
+  end
+
+  it "returns false if a class variables with the given name is defined in an extended module" do
+    c = Class.new
+    c.extend ModuleSpecs::MVars
+    c.class_variable_defined?("@@mvar").should == false
+  end
+
+  not_compliant_on :rubinius do
+    it "accepts Fixnums for class variables" do
+      c = Class.new { class_variable_set :@@class_var, "test" }
+      c.class_variable_defined?(:@@class_var.to_i).should == true
+      c.class_variable_defined?(:@@no_class_var.to_i).should == false
+    end
+  end
+
+  it "raises a NameError when the given name is not allowed" do
+    c = Class.new
+
+    lambda {
+      c.class_variable_defined?(:invalid_name)
+    }.should raise_error(NameError)
+
+    lambda {
+      c.class_variable_defined?("@invalid_name")
+    }.should raise_error(NameError)
+  end
+
+  it "converts a non string/symbol/fixnum name to string using to_str" do
+    c = Class.new { class_variable_set :@@class_var, "test" }
+    (o = mock('@@class_var')).should_receive(:to_str).and_return("@@class_var")
+    c.class_variable_defined?(o).should == true
+  end
+
+  it "raises a TypeError when the given names can't be converted to strings using to_str" do
+    c = Class.new { class_variable_set :@@class_var, "test" }
+    o = mock('123')
+    lambda {
+      c.class_variable_defined?(o)
+    }.should raise_error(TypeError)
+
+    o.should_receive(:to_str).and_return(123)
+    lambda {
+      c.class_variable_defined?(o)
+    }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/class_variable_get_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/class_variable_get_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/class_variable_get_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,77 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#class_variable_get" do
+  it "returns the value of the class variable with the given name" do
+    c = Class.new { class_variable_set :@@class_var, "test" }
+    c.send(:class_variable_get, :@@class_var).should == "test"
+    c.send(:class_variable_get, "@@class_var").should == "test"
+  end
+
+  it "returns the value of a class variable with the given name defined in an included module" do
+    c = Class.new { include ModuleSpecs::MVars }
+    c.send(:class_variable_get, "@@mvar").should == :mvar
+  end
+
+  it "raises a NameError for a class variables with the given name defined in an extended module" do
+    c = Class.new
+    c.extend ModuleSpecs::MVars
+    lambda {
+      c.send(:class_variable_get, "@@mvar")
+    }.should raise_error(NameError)
+  end
+
+  it "returns class variables defined in the class body and accessed in the metaclass" do
+    ModuleSpecs::CVars.cls.should == :class
+  end
+
+  it "returns class variables defined in the metaclass and accessed by class methods" do
+    ModuleSpecs::CVars.meta.should == :meta
+  end
+
+  it "returns class variables defined in the metaclass and accessed by instance methods" do
+    ModuleSpecs::CVars.new.meta.should == :meta
+  end
+
+  not_compliant_on :rubinius do
+    it "accepts Fixnums for class variables" do
+      c = Class.new { class_variable_set :@@class_var, "test" }
+      c.send(:class_variable_get, :@@class_var.to_i).should == "test"
+    end
+
+    it "raises a NameError when a Fixnum for an uninitialized class variable is given" do
+      c = Class.new
+      lambda {
+        c.send :class_variable_get, :@@no_class_var.to_i
+      }.should raise_error(NameError)
+    end
+  end
+
+  it "raises a NameError when an uninitialized class variable is accessed" do
+    c = Class.new
+    [:@@no_class_var, "@@no_class_var"].each do |cvar|
+      lambda  { c.send(:class_variable_get, cvar) }.should raise_error(NameError)
+    end
+  end
+
+  it "raises a NameError when the given name is not allowed" do
+    c = Class.new
+
+    lambda { c.send(:class_variable_get, :invalid_name)   }.should raise_error(NameError)
+    lambda { c.send(:class_variable_get, "@invalid_name") }.should raise_error(NameError)
+  end
+
+  it "converts a non string/symbol/fixnum name to string using to_str" do
+    c = Class.new { class_variable_set :@@class_var, "test" }
+    (o = mock('@@class_var')).should_receive(:to_str).and_return("@@class_var")
+    c.send(:class_variable_get, o).should == "test"
+  end
+
+  it "raises a TypeError when the given names can't be converted to strings using to_str" do
+    c = Class.new { class_variable_set :@@class_var, "test" }
+    o = mock('123')
+    lambda { c.send(:class_variable_get, o) }.should raise_error(TypeError)
+    o.should_receive(:to_str).and_return(123)
+    lambda { c.send(:class_variable_get, o) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/class_variable_set_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/class_variable_set_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/class_variable_set_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,63 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#class_variable_set" do
+  it "sets the class variable with the given name to the given value" do
+    c = Class.new
+
+    c.send(:class_variable_set, :@@test, "test")
+    c.send(:class_variable_set, "@@test3", "test3")
+
+    c.send(:class_variable_get, :@@test).should == "test"
+    c.send(:class_variable_get, :@@test3).should == "test3"
+  end
+
+  it "sets the value of a class variable with the given name defined in an included module" do
+    c = Class.new { include ModuleSpecs::MVars }
+    c.send(:class_variable_set, "@@mvar", :new_mvar).should == :new_mvar
+    c.send(:class_variable_get, "@@mvar").should == :new_mvar
+  end
+
+  not_compliant_on :rubinius do
+    it "accepts Fixnums for class variables" do
+      c = Class.new
+      c.send(:class_variable_set, :@@test2.to_i, "test2")
+      c.send(:class_variable_get, :@@test2).should == "test2"
+    end
+  end
+
+  it "raises a TypeError when self is frozen" do
+    lambda {
+      Class.new.freeze.send(:class_variable_set, :@@test, "test")
+    }.should raise_error(TypeError)
+    lambda {
+      Module.new.freeze.send(:class_variable_set, :@@test, "test")
+    }.should raise_error(TypeError)
+  end
+
+  it "raises a NameError when the given name is not allowed" do
+    c = Class.new
+
+    lambda {
+      c.send(:class_variable_set, :invalid_name, "test")
+    }.should raise_error(NameError)
+    lambda {
+      c.send(:class_variable_set, "@invalid_name", "test")
+    }.should raise_error(NameError)
+  end
+
+  it "converts a non string/symbol/fixnum name to string using to_str" do
+    (o = mock('@@class_var')).should_receive(:to_str).and_return("@@class_var")
+    c = Class.new
+    c.send(:class_variable_set, o, "test")
+    c.send(:class_variable_get, :@@class_var).should == "test"
+  end
+
+  it "raises a TypeError when the given names can't be converted to strings using to_str" do
+    c = Class.new { class_variable_set :@@class_var, "test" }
+    o = mock('123')
+    lambda { c.send(:class_variable_set, o, "test") }.should raise_error(TypeError)
+    o.should_receive(:to_str).and_return(123)
+    lambda { c.send(:class_variable_set, o, "test") }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/class_variables_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/class_variables_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/class_variables_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#class_variables" do
+  it "returns an Array with the names of class variables of self and self's ancestors" do
+    ModuleSpecs::ClassVars::A.class_variables.should include("@@a_cvar")
+    ModuleSpecs::ClassVars::M.class_variables.should include("@@m_cvar")
+    ModuleSpecs::ClassVars::B.class_variables.should include("@@a_cvar", "@@b_cvar", "@@m_cvar")
+  end
+
+  it "returns an Array with names of class variables defined in metaclasses" do
+    ModuleSpecs::CVars.class_variables.should include("@@cls", "@@meta")
+  end
+
+  it "returns an Array with names of class variables defined in included modules" do
+    c = Class.new { include ModuleSpecs::MVars }
+    c.class_variables.should include("@@mvar")
+  end
+
+  it "does not return class variables defined in extended modules" do
+    c = Class.new
+    c.extend ModuleSpecs::MVars
+    c.class_variables.should_not include("@@mvar")
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/comparison_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/comparison_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/comparison_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,36 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#<=>" do
+  it "returns -1 if self is a subclass of or includes the given module" do
+    (ModuleSpecs::Child <=> ModuleSpecs::Parent).should == -1
+    (ModuleSpecs::Child <=> ModuleSpecs::Basic).should == -1
+    (ModuleSpecs::Child <=> ModuleSpecs::Super).should == -1
+    (ModuleSpecs::Super <=> ModuleSpecs::Basic).should == -1
+  end
+  
+  it "returns 0 if self is the same as the given module" do
+    (ModuleSpecs::Child  <=> ModuleSpecs::Child).should == 0
+    (ModuleSpecs::Parent <=> ModuleSpecs::Parent).should == 0
+    (ModuleSpecs::Basic  <=> ModuleSpecs::Basic).should == 0
+    (ModuleSpecs::Super  <=> ModuleSpecs::Super).should == 0
+  end
+  
+  it "returns +1 if self is a superclas of or included by the given module" do
+    (ModuleSpecs::Parent <=> ModuleSpecs::Child).should == +1
+    (ModuleSpecs::Basic  <=> ModuleSpecs::Child).should == +1
+    (ModuleSpecs::Super  <=> ModuleSpecs::Child).should == +1
+    (ModuleSpecs::Basic  <=> ModuleSpecs::Super).should == +1
+  end
+  
+  it "returns nil if self and the given module are not related" do
+    (ModuleSpecs::Parent <=> ModuleSpecs::Basic).should == nil
+    (ModuleSpecs::Parent <=> ModuleSpecs::Super).should == nil
+    (ModuleSpecs::Basic  <=> ModuleSpecs::Parent).should == nil
+    (ModuleSpecs::Super  <=> ModuleSpecs::Parent).should == nil
+  end
+  
+  it "returns nil if the argument is not a class/module" do
+    (ModuleSpecs::Parent <=> mock('x')).should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/const_defined_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/const_defined_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/const_defined_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,59 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../fixtures/constants'
+
+describe "Module#const_defined?" do
+  it "returns true if the given Symbol names a constant defined in the receiver" do
+    ConstantSpecs.const_defined?(:CS_CONST2).should == true
+    ConstantSpecs.const_defined?(:ModuleA).should == true
+    ConstantSpecs.const_defined?(:ClassA).should == true
+    ConstantSpecs::ContainerA.const_defined?(:ChildA).should == true
+  end
+
+  it "returns true if the given String names a constant defined in the receiver" do
+    ConstantSpecs.const_defined?("CS_CONST2").should == true
+    ConstantSpecs.const_defined?("ModuleA").should == true
+    ConstantSpecs.const_defined?("ClassA").should == true
+    ConstantSpecs::ContainerA.const_defined?("ChildA").should == true
+  end
+
+  it "returns false if the constant is not defined in the receiver" do
+    ConstantSpecs::ContainerA::ChildA.const_defined?(:CS_CONST4).should == false
+    ConstantSpecs::ParentA.const_defined?(:CS_CONST12).should == false
+  end
+
+  it "does not call #const_missing if the constant is not defined in the receiver" do
+    ConstantSpecs::ClassA.should_not_receive(:const_missing)
+    ConstantSpecs::ClassA.const_defined?(:CS_CONSTX).should == false
+  end
+
+  it "calls #to_str to convert the given name to a String" do
+    name = mock("ClassA")
+    name.should_receive(:to_str).and_return("ClassA")
+    ConstantSpecs.const_defined?(name).should == true
+  end
+
+  it "raises a NameError if the name does not start with a capital letter" do
+    lambda { ConstantSpecs.const_defined? "name" }.should raise_error(NameError)
+  end
+
+  it "raises a NameError if the name starts with a non-alphabetic character" do
+    lambda { ConstantSpecs.const_defined? "__CONSTX__" }.should raise_error(NameError)
+    lambda { ConstantSpecs.const_defined? "@Name" }.should raise_error(NameError)
+    lambda { ConstantSpecs.const_defined? "!Name" }.should raise_error(NameError)
+    lambda { ConstantSpecs.const_defined? "::Name" }.should raise_error(NameError)
+  end
+
+  it "raises a NameError if the name contains non-alphabetic characters except '_'" do
+    ConstantSpecs.const_defined?("CS_CONSTX").should == false
+    lambda { ConstantSpecs.const_defined? "Name=" }.should raise_error(NameError)
+    lambda { ConstantSpecs.const_defined? "Name?" }.should raise_error(NameError)
+  end
+
+  it "raises a TypeError if conversion to a String by calling #to_str fails" do
+    name = mock('123')
+    lambda { ConstantSpecs.const_defined? name }.should raise_error(TypeError)
+
+    name.should_receive(:to_str).and_return(123)
+    lambda { ConstantSpecs.const_defined? name }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/const_get_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/const_get_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/const_get_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,156 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../fixtures/constants'
+
+describe "Module#const_get" do
+  it "accepts a String or Symbol name" do
+    Object.const_get(:CS_CONST1).should == :const1
+    Object.const_get("CS_CONST1").should == :const1
+  end
+
+  it "raises a NameError if no constant is defined in the search path" do
+    lambda { ConstantSpecs.const_get :CS_CONSTX }.should raise_error(NameError)
+  end
+
+  it "raises a NameError if the name does not start with a capital letter" do
+    lambda { ConstantSpecs.const_get "name" }.should raise_error(NameError)
+  end
+
+  it "raises a NameError if the name starts with a non-alphabetic character" do
+    lambda { ConstantSpecs.const_get "__CONSTX__" }.should raise_error(NameError)
+    lambda { ConstantSpecs.const_get "@Name" }.should raise_error(NameError)
+    lambda { ConstantSpecs.const_get "!Name" }.should raise_error(NameError)
+    lambda { ConstantSpecs.const_get "::Name" }.should raise_error(NameError)
+  end
+
+  it "raises a NameError if the name contains non-alphabetic characters except '_'" do
+    Object.const_get("CS_CONST1").should == :const1
+    lambda { ConstantSpecs.const_get "Name=" }.should raise_error(NameError)
+    lambda { ConstantSpecs.const_get "Name?" }.should raise_error(NameError)
+  end
+
+  it "calls #to_str to convert the given name to a String" do
+    name = mock("ClassA")
+    name.should_receive(:to_str).and_return("ClassA")
+    ConstantSpecs.const_get(name).should == ConstantSpecs::ClassA
+  end
+
+  it "raises a TypeError if conversion to a String by calling #to_str fails" do
+    name = mock('123')
+    lambda { ConstantSpecs.const_get(name) }.should raise_error(TypeError)
+
+    name.should_receive(:to_str).and_return(123)
+    lambda { ConstantSpecs.const_get(name) }.should raise_error(TypeError)
+  end
+
+  it "calls #const_missing on the receiver if unable to locate the constant" do
+    ConstantSpecs::ContainerA.should_receive(:const_missing).with(:CS_CONSTX)
+    ConstantSpecs::ContainerA.const_get(:CS_CONSTX)
+  end
+
+  it "does not search the singleton class of a Class or Module" do
+    lambda do
+      ConstantSpecs::ContainerA::ChildA.const_get(:CS_CONST14)
+    end.should raise_error(NameError)
+    lambda { ConstantSpecs.const_get(:CS_CONST14) }.should raise_error(NameError)
+  end
+
+  it "does not search the containing scope" do
+    ConstantSpecs::ContainerA::ChildA.const_get(:CS_CONST20).should == :const20_2
+    lambda do
+      ConstantSpecs::ContainerA::ChildA.const_get(:CS_CONST5)
+    end.should raise_error(NameError)
+  end
+
+  describe "with statically assigned constants" do
+    it "searches the immediate class or module first" do
+      ConstantSpecs::ClassA.const_get(:CS_CONST10).should == :const10_10
+      ConstantSpecs::ModuleA.const_get(:CS_CONST10).should == :const10_1
+      ConstantSpecs::ParentA.const_get(:CS_CONST10).should == :const10_5
+      ConstantSpecs::ContainerA.const_get(:CS_CONST10).should == :const10_2
+      ConstantSpecs::ContainerA::ChildA.const_get(:CS_CONST10).should == :const10_3
+    end
+
+    it "searches a module included in the immediate class before the superclass" do
+      ConstantSpecs::ContainerA::ChildA.const_get(:CS_CONST15).should == :const15_1
+    end
+
+    it "searches the superclass before a module included in the superclass" do
+      ConstantSpecs::ContainerA::ChildA.const_get(:CS_CONST11).should == :const11_1
+    end
+
+    it "searches a module included in the superclass" do
+      ConstantSpecs::ContainerA::ChildA.const_get(:CS_CONST12).should == :const12_1
+    end
+
+    it "searches the superclass chain" do
+      ConstantSpecs::ContainerA::ChildA.const_get(:CS_CONST13).should == :const13
+    end
+
+    it "returns a toplevel constant when the receiver is a Class" do
+      ConstantSpecs::ContainerA::ChildA.const_get(:CS_CONST1).should == :const1
+    end
+
+    it "returns a toplevel constant when the receiver is a Module" do
+      ConstantSpecs.const_get(:CS_CONST1).should == :const1
+      ConstantSpecs::ModuleA.const_get(:CS_CONST1).should == :const1
+    end
+  end
+
+  describe "with dynamically assigned constants" do
+    it "searches the immediate class or module first" do
+      ConstantSpecs::ClassA::CS_CONST301 = :const301_1
+      ConstantSpecs::ClassA.const_get(:CS_CONST301).should == :const301_1
+
+      ConstantSpecs::ModuleA::CS_CONST301 = :const301_2
+      ConstantSpecs::ModuleA.const_get(:CS_CONST301).should == :const301_2
+
+      ConstantSpecs::ParentA::CS_CONST301 = :const301_3
+      ConstantSpecs::ParentA.const_get(:CS_CONST301).should == :const301_3
+
+      ConstantSpecs::ContainerA::ChildA::CS_CONST301 = :const301_5
+      ConstantSpecs::ContainerA::ChildA.const_get(:CS_CONST301).should == :const301_5
+    end
+
+    it "searches a module included in the immediate class before the superclass" do
+      ConstantSpecs::ParentB::CS_CONST302 = :const302_1
+      ConstantSpecs::ModuleF::CS_CONST302 = :const302_2
+      ConstantSpecs::ContainerB::ChildB.const_get(:CS_CONST302).should == :const302_2
+    end
+
+    it "searches the superclass before a module included in the superclass" do
+      ConstantSpecs::ModuleE::CS_CONST303 = :const303_1
+      ConstantSpecs::ParentB::CS_CONST303 = :const303_2
+      ConstantSpecs::ContainerB::ChildB.const_get(:CS_CONST303).should == :const303_2
+    end
+
+    it "searches a module included in the superclass" do
+      ConstantSpecs::ModuleA::CS_CONST304 = :const304_1
+      ConstantSpecs::ModuleE::CS_CONST304 = :const304_2
+      ConstantSpecs::ContainerB::ChildB.const_get(:CS_CONST304).should == :const304_2
+    end
+
+    it "searches the superclass chain" do
+      ConstantSpecs::ModuleA::CS_CONST305 = :const305
+      ConstantSpecs::ContainerB::ChildB.const_get(:CS_CONST305).should == :const305
+    end
+
+    it "returns a toplevel constant when the receiver is a Class" do
+      Object::CS_CONST306 = :const306
+      ConstantSpecs::ContainerB::ChildB.const_get(:CS_CONST306).should == :const306
+    end
+
+    it "returns a toplevel constant when the receiver is a Module" do
+      Object::CS_CONST308 = :const308
+      ConstantSpecs.const_get(:CS_CONST308).should == :const308
+      ConstantSpecs::ModuleA.const_get(:CS_CONST308).should == :const308
+    end
+
+    it "returns the updated value of a constant" do
+      ConstantSpecs::ClassB::CS_CONST309 = :const309_1
+      ConstantSpecs::ClassB.const_get(:CS_CONST309).should == :const309_1
+
+      ConstantSpecs::ClassB::CS_CONST309 = :const309_2
+      ConstantSpecs::ClassB.const_get(:CS_CONST309).should == :const309_2
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/const_missing_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/const_missing_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/const_missing_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../fixtures/constants'
+
+describe "Module#const_missing" do
+  it "is called when an undefined constant is referenced via literal form" do
+    ConstantSpecs::ClassA::CS_CONSTX.should == :CS_CONSTX
+  end
+
+  it "is called when an undefined constant is referenced via #const_get" do
+    ConstantSpecs::ClassA.const_get(:CS_CONSTX).should == :CS_CONSTX
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/const_set_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/const_set_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/const_set_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,48 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../fixtures/constants'
+
+describe "Module#const_set" do
+  it "sets the constant specified by a String or Symbol to the given value" do
+    ConstantSpecs.const_set :CS_CONST401, :const401
+    ConstantSpecs::CS_CONST401.should == :const401
+
+    ConstantSpecs.const_set "CS_CONST402", :const402
+    ConstantSpecs.const_get(:CS_CONST402).should == :const402
+  end
+
+  it "returns the value set" do
+    ConstantSpecs.const_set(:CS_CONST403, :const403).should == :const403
+  end
+
+  it "raises a NameError if the name does not start with a capital letter" do
+    lambda { ConstantSpecs.const_set "name", 1 }.should raise_error(NameError)
+  end
+
+  it "raises a NameError if the name starts with a non-alphabetic character" do
+    lambda { ConstantSpecs.const_set "__CONSTX__", 1 }.should raise_error(NameError)
+    lambda { ConstantSpecs.const_set "@Name", 1 }.should raise_error(NameError)
+    lambda { ConstantSpecs.const_set "!Name", 1 }.should raise_error(NameError)
+    lambda { ConstantSpecs.const_set "::Name", 1 }.should raise_error(NameError)
+  end
+
+  it "raises a NameError if the name contains non-alphabetic characters except '_'" do
+    ConstantSpecs.const_set("CS_CONST404", :const404).should == :const404
+    lambda { ConstantSpecs.const_set "Name=", 1 }.should raise_error(NameError)
+    lambda { ConstantSpecs.const_set "Name?", 1 }.should raise_error(NameError)
+  end
+
+  it "calls #to_str to convert the given name to a String" do
+    name = mock("CS_CONST405")
+    name.should_receive(:to_str).and_return("CS_CONST405")
+    ConstantSpecs.const_set(name, :const405).should == :const405
+    ConstantSpecs::CS_CONST405.should == :const405
+  end
+
+  it "raises a TypeError if conversion to a String by calling #to_str fails" do
+    name = mock('123')
+    lambda { ConstantSpecs.const_set name, 1 }.should raise_error(TypeError)
+
+    name.should_receive(:to_str).and_return(123)
+    lambda { ConstantSpecs.const_set name, 1 }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/constants_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/constants_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/constants_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,66 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../fixtures/constants'
+
+describe "Module.constants" do
+  it "returns an array of the names of all toplevel constants" do
+    count = Module.constants.size
+    module ConstantSpecsAdded
+      CS_CONST1 = 1
+    end
+    Module.constants.size.should == count + 1
+  end
+
+  ruby_version_is "" ... "1.9" do
+    it "returns an array of String names" do
+      # This in NOT an exhaustive list
+      Module.constants.should include("Array", "Bignum", "Class", "Comparable", "Dir",
+                                      "Enumerable", "ENV", "Exception", "FalseClass",
+                                      "File", "Fixnum", "Float", "Hash", "Integer", "IO",
+                                      "Kernel", "Math", "Method", "Module", "NilClass",
+                                      "Numeric", "Object", "Range", "Regexp", "String",
+                                      "Symbol", "Thread", "Time", "TrueClass")
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "returns an array of Symbol names" do
+      # This in NOT an exhaustive list
+      Module.constants.should include(:Array, :Bignum, :Class, :Comparable, :Dir,
+                                      :Enumerable, :ENV, :Exception, :FalseClass,
+                                      :File, :Fixnum, :Float, :Hash, :Integer, :IO,
+                                      :Kernel, :Math, :Method, :Module, :NilClass,
+                                      :Numeric, :Object, :Range, :Regexp, :String,
+                                      :Symbol, :Thread, :Time, :TrueClass)
+    end
+  end
+end
+
+describe "Module#constants" do
+  ruby_version_is "" ... "1.9" do
+    it "returns an array of String names of all constants defined in the module" \
+       "and all included modules" do
+      ConstantSpecs::ContainerA.constants.sort.should == [
+        "CS_CONST10", "CS_CONST23", "CS_CONST24", "CS_CONST5", "ChildA"
+      ]
+    end
+
+    it "includes names of constants defined after a module is included" do
+      ConstantSpecs::ModuleM::CS_CONST250 = :const250
+      ConstantSpecs::ContainerA.constants.should include("CS_CONST250")
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "returns an array of Symbol names of all constants defined in the module" \
+       "and all included modules" do
+      ConstantSpecs::ContainerA.constants.sort.should == [
+        :CS_CONST10, :CS_CONST23, :CS_CONST24, :CS_CONST5, :ChildA
+      ]
+    end
+
+    it "includes names of constants defined after a module is included" do
+      ConstantSpecs::ModuleM::CS_CONST251 = :const251
+      ConstantSpecs::ContainerA.constants.should include(:CS_CONST251)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/define_method_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/define_method_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/define_method_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,76 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+class DefineMethodSpecClass
+end
+
+describe "Module#define_method when given an UnboundMethod" do
+  it "correctly passes given arguments to the new method" do
+    klass = Class.new do
+      def test_method(arg1, arg2)
+        [arg1, arg2]
+      end
+      define_method(:another_test_method, instance_method(:test_method))
+    end
+    
+    klass.new.another_test_method(1, 2).should == [1, 2]
+  end
+
+  it "adds the new method to the methods list" do
+    klass = Class.new do
+      def test_method(arg1, arg2)
+        [arg1, arg2]
+      end
+      define_method(:another_test_method, instance_method(:test_method))
+    end
+    
+    klass.new.methods.should include("another_test_method")
+  end
+end
+
+describe "Module#define_method" do
+  it "defines the given method as an instance method with the given name in self" do
+    class DefineMethodSpecClass
+      def test1
+        "test" 
+      end
+      define_method(:another_test, instance_method(:test1))
+    end
+    
+    o = DefineMethodSpecClass.new
+    o.test1.should == o.another_test
+  end
+  
+  it "defines a new method with the given name and the given block as body in self" do
+    class DefineMethodSpecClass
+      define_method(:block_test1) { self }
+      define_method(:block_test2, &lambda { self })
+    end
+    
+    o = DefineMethodSpecClass.new
+    o.block_test1.should == o
+    o.block_test2.should == o
+  end
+  
+  it "raises a TypeError when the given method is no Method/Proc" do
+    lambda {
+      Class.new { define_method(:test, "self") }
+    }.should raise_error(TypeError)
+    
+    lambda {
+      Class.new { define_method(:test, 1234) }
+    }.should raise_error(TypeError)
+  end
+  
+  it "should maintain the Proc's scope" do
+    class DefineMethodByProcClass
+      in_scope = true
+      method_proc = proc { in_scope }
+      
+      define_method(:proc_test, &method_proc)
+    end
+    
+    o = DefineMethodByProcClass.new
+    o.proc_test.should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/eql_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/eql_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/eql_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/equal_value'
+
+describe "Module#eql?" do
+  it_behaves_like(:module_equal, :eql?)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/equal_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/equal_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/equal_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/equal_value'
+
+describe "Module#equal?" do
+  it_behaves_like(:module_equal, :equal?)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/equal_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/equal_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/equal_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/equal_value'
+
+describe "Module#==" do
+  it_behaves_like(:module_equal, :==)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/extend_object_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/extend_object_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/extend_object_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#extend_object" do
+  it "extends the given object with constants and methods of self" do
+    m = Module.new do
+      const_set :C, "test"
+      def test() "hello" end
+    end
+    
+    o = mock('test')
+    m.send(:extend_object, o)
+    
+    o.test.should == "hello"
+    (class << o; C; end).should == "test"
+  end
+  
+  it "is called when an object gets extended with self" do
+    begin
+      m = Module.new do
+        def self.extend_object(o)
+          $extended_object = o
+        end
+      end
+      
+      (o = mock('x')).extend(m)
+      
+      $extended_object.should == o
+    ensure
+      $extended_object = nil
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/extended_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/extended_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/extended_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,40 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#extended" do
+  it "is called when an object gets extended with self" do
+    begin
+      m = Module.new do
+        def self.extended(o)
+          $extended_object = o
+        end
+      end
+      
+      (o = mock('x')).extend(m)
+      
+      $extended_object.should == o
+    ensure
+      $extended_object = nil
+    end
+  end
+  
+  it "is called after Module#extend_object" do
+    begin
+      m = Module.new do
+        def self.extend_object(o)
+          $extended_object = nil
+        end
+        
+        def self.extended(o)
+          $extended_object = o
+        end
+      end
+      
+      (o = mock('x')).extend(m)
+      
+      $extended_object.should == o
+    ensure
+      $extended_object = nil
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+$m.const_set(:AAA, "test") unless $m.nil?
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_c.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_c.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_c.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+module ModuleSpecs::Autoload
+  class DynClass
+    class C
+      def loaded
+        :dynclass_c
+      end
+    end
+  end
+end
+
+ScratchPad.record :loaded

Added: MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_d.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_d.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_d.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+module ModuleSpecs::Autoload
+  module DynModule
+    class D
+      def loaded
+        :dynmodule_d
+      end
+    end
+  end
+end
+
+ScratchPad.record :loaded

Added: MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_e.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_e.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_e.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+module ModuleSpecs::Autoload
+  class E
+    def loaded
+      :autoload_e
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_f.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_f.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_f.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+module ModuleSpecs::Autoload
+  module F
+    def self.loaded
+      :autoload_f
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_g.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_g.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_g.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+module ModuleSpecs::Autoload
+  class G
+    def loaded
+      :autoload_g
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_h.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_h.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_h.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+module ModuleSpecs::Autoload
+  module H
+    def loaded
+      :autoload_h
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_i.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_i.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_i.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+module ModuleSpecs::Autoload
+  I = :autoloaded
+end
+
+ScratchPad.record :loaded

Added: MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_j.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_j.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_j.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+module ModuleSpecs::Autoload
+  J = :autoload_j
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_k.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_k.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_k.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+module ModuleSpecs::Autoload
+  K = :autoload_k
+end
+
+ScratchPad.record :loaded

Added: MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_lm.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_lm.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_lm.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+module ModuleSpecs::Autoload
+  L = :autoload_l
+  M = :autoload_m
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_n.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_n.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_n.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+module ModuleSpecs::Autoload
+  N = :autoload_n
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_o.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_o.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_o.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+# does not define ModuleSpecs::Autoload::O

Added: MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_t.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_t.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_t.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+module ModuleSpecs::Autoload::S
+  T = :autoload_t
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_v.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_v.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_v.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+module ModuleSpecs::Autoload::U
+  class V
+    def self.get_value
+      :autoload_uvx
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_w.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_w.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_w.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+# Fails to define ModuleSpecs::Autoload::W::Y
+ScratchPad.record :loaded

Added: MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_x.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_x.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_x.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+module ModuleSpecs::Autoload
+  X = :x
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_z.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_z.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/fixtures/autoload_z.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+class ModuleSpecs::Autoload::YY
+end
+
+class ModuleSpecs::Autoload::Z < ModuleSpecs::Autoload::YY
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,314 @@
+module ModuleSpecs
+  CONST = :plain_constant
+
+  class Subclass < Module
+  end
+
+  class SubclassSpec
+  end
+
+  module LookupModInMod
+    INCS = :ethereal
+  end
+
+  module LookupMod
+    include LookupModInMod
+
+    MODS = :rockers
+  end
+
+  class Lookup
+    include LookupMod
+    LOOKIE = :lookie
+  end
+
+  class LookupChild < Lookup
+  end
+
+  class Parent
+    # For private_class_method spec
+    def self.private_method; end
+    private_class_method :private_method
+
+    def undefed_method() end
+    undef_method :undefed_method
+
+    # For public_class_method spec
+    private
+    def self.public_method; end
+    public_class_method :public_method
+
+    public
+    def public_parent() end
+
+    protected
+    def protected_parent() end
+
+    private
+    def private_parent() end
+  end
+
+  module Basic
+    def public_module() end
+
+    protected
+    def protected_module() end
+
+    private
+    def private_module() end
+  end
+
+  module Super
+    include Basic
+
+    def public_super_module() end
+
+    protected
+    def protected_super_module() end
+
+    private
+    def private_super_module() end
+
+    class SuperChild
+    end
+  end
+
+  module Internal
+  end
+
+  class Child < Parent
+    include Super
+
+    class << self
+      include Internal
+    end
+    attr_accessor :accessor_method
+
+    def undefed_child() end
+
+    def public_child() end
+
+    protected
+    def protected_child() end
+
+    private
+    def private_child() end
+  end
+
+  class Child2 < Parent
+    attr_reader :foo
+  end
+
+  # Be careful touching the Counts* classes as there used for testing
+  # private_instance_methods, public_instance_methods, etc.  So adding, removing
+  # a method will break those tests.
+  module CountsMixin
+    def public_3; end
+    public :public_3
+
+    def private_3; end
+    private :private_3
+
+    def protected_3; end
+    protected :protected_3
+  end
+
+  class CountsParent
+    include CountsMixin
+
+    def public_2; end
+
+    private
+    def private_2; end
+
+    protected
+    def protected_2; end
+  end
+
+  class CountsChild < CountsParent
+    def public_1; end
+
+    private
+    def private_1; end
+
+    protected
+    def protected_1; end
+  end
+
+  module AddConstant
+  end
+
+  module A
+    CONSTANT_A = :a
+    OVERRIDE = :a
+    def ma(); :a; end
+    def self.cma(); :a; end
+  end
+
+  module B
+    CONSTANT_B = :b
+    OVERRIDE = :b
+    include A
+    def mb(); :b; end
+    def self.cmb(); :b; end
+  end
+
+  class C
+    OVERRIDE = :c
+    include B
+  end
+
+  module Z
+    MODULE_SPEC_TOPLEVEL_CONSTANT = 1
+  end
+
+  module Alias
+    def report() :report end
+    alias publish report
+  end
+
+  class Allonym
+    include ModuleSpecs::Alias
+  end
+
+  class Aliasing
+    def self.make_alias(*a)
+      alias_method(*a)
+    end
+
+    def public_one; 1; end
+
+    def public_two(n); n * 2; end
+
+    private
+    def private_one; 1; end
+
+    protected
+    def protected_one; 1; end
+  end
+
+  module ReopeningModule
+    def foo; true; end
+    module_function :foo
+    private :foo
+  end
+
+  # Yes, we want to re-open the module
+  module ReopeningModule
+    alias :foo2 :foo
+    module_function :foo2
+  end
+
+  module Nesting
+    @tests = {}
+    def self.[](name); @tests[name]; end
+    def self.[]=(name, val); @tests[name] = val; end
+    def self.meta; class << self; self; end; end
+
+    Nesting[:basic] = Module.nesting
+
+    module ::ModuleSpecs
+      Nesting[:open_first_level] = Module.nesting
+    end
+
+    class << self
+      Nesting[:open_meta] = Module.nesting
+    end
+
+    def self.called_from_module_method
+      Module.nesting
+    end
+
+    class NestedClass
+      Nesting[:nest_class] = Module.nesting
+
+      def self.called_from_class_method
+        Module.nesting
+      end
+
+      def called_from_inst_method
+        Module.nesting
+      end
+    end
+
+  end
+
+  Nesting[:first_level] = Module.nesting
+
+  module InstanceMethMod
+    def bar(); :bar; end
+  end
+
+  class InstanceMeth
+    include InstanceMethMod
+    def foo(); :foo; end
+  end
+
+  class InstanceMethChild < InstanceMeth
+  end
+
+  module ClassVars
+    class A
+      @@a_cvar = :a_cvar
+    end
+
+    module M
+      @@m_cvar = :m_cvar
+    end
+
+    class B < A
+      include M
+
+      @@b_cvar = :b_cvar
+    end
+  end
+
+  class CVars
+    @@cls = :class
+
+    class << self
+      def cls
+        @@cls
+      end
+      @@meta = :meta
+    end
+
+    def self.meta
+      @@meta
+    end
+
+    def meta
+      @@meta
+    end
+  end
+
+  module MVars
+    @@mvar = :mvar
+  end
+
+  class SubModule < Module
+    attr_reader :special
+    def initialize
+      @special = 10
+    end
+  end
+
+  module MA; end
+  module MB
+    include MA
+  end
+  module MC; end
+
+  class MultipleIncludes
+    include MB
+  end
+
+  # empty modules
+  module M1; end
+  module M2; end
+
+  module Autoload
+  end
+end
+
+ModuleSpecs::Nesting[:root_level] = Module.nesting

Added: MacRuby/branches/experimental/spec/frozen/core/module/freeze_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/freeze_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/freeze_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#freeze" do
+  it "prevents further modifications to self" do
+    m = Module.new.freeze
+    m.frozen?.should == true
+
+    # Does not raise
+    class << m; end
+
+    lambda {
+      class << m
+        def test() "test" end
+      end
+    }.should raise_error(TypeError)
+
+    lambda { def m.test() "test" end }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/gt_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/gt_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/gt_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#>" do
+  it "returns true if self is a superclass of or included by the given module" do
+    (ModuleSpecs::Parent > ModuleSpecs::Child).should == true
+    (ModuleSpecs::Basic  > ModuleSpecs::Child).should == true
+    (ModuleSpecs::Super  > ModuleSpecs::Child).should == true
+    (ModuleSpecs::Basic  > ModuleSpecs::Super).should == true
+  end
+  
+  it "returns false if self is the same as the given module" do
+    (ModuleSpecs::Child  > ModuleSpecs::Child).should == false
+    (ModuleSpecs::Parent > ModuleSpecs::Parent).should == false
+    (ModuleSpecs::Basic  > ModuleSpecs::Basic).should == false
+    (ModuleSpecs::Super  > ModuleSpecs::Super).should == false
+  end
+  
+  it "returns nil if self is not related to the given module" do
+    (ModuleSpecs::Parent > ModuleSpecs::Basic).should == nil
+    (ModuleSpecs::Parent > ModuleSpecs::Super).should == nil
+    (ModuleSpecs::Basic  > ModuleSpecs::Parent).should == nil
+    (ModuleSpecs::Super  > ModuleSpecs::Parent).should == nil
+  end
+  
+  it "raises a TypeError if the argument is not a class/module" do
+    lambda { ModuleSpecs::Parent > mock('x') }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/gte_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/gte_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/gte_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#>=" do
+  it "returns true if self is a superclass of, the same as or included by given module" do
+    (ModuleSpecs::Parent >= ModuleSpecs::Child).should == true
+    (ModuleSpecs::Basic  >= ModuleSpecs::Child).should == true
+    (ModuleSpecs::Super  >= ModuleSpecs::Child).should == true
+    (ModuleSpecs::Basic  >= ModuleSpecs::Super).should == true
+    (ModuleSpecs::Child  >= ModuleSpecs::Child).should == true
+    (ModuleSpecs::Parent >= ModuleSpecs::Parent).should == true
+    (ModuleSpecs::Basic  >= ModuleSpecs::Basic).should == true
+    (ModuleSpecs::Super  >= ModuleSpecs::Super).should == true
+  end
+  
+  it "returns nil if self is not related to the given module" do
+    (ModuleSpecs::Parent >= ModuleSpecs::Basic).should == nil
+    (ModuleSpecs::Parent >= ModuleSpecs::Super).should == nil
+    (ModuleSpecs::Basic  >= ModuleSpecs::Parent).should == nil
+    (ModuleSpecs::Super  >= ModuleSpecs::Parent).should == nil
+  end
+  
+  it "returns false if self is a subclass of or includes the given module" do
+    (ModuleSpecs::Child >= ModuleSpecs::Parent).should == false
+    (ModuleSpecs::Child >= ModuleSpecs::Basic).should == false
+    (ModuleSpecs::Child >= ModuleSpecs::Super).should == false
+    (ModuleSpecs::Super >= ModuleSpecs::Basic).should == false
+  end
+
+  it "raises a TypeError if the argument is not a class/module" do
+    lambda { ModuleSpecs::Parent >= mock('x') }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/include_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/include_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/include_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,154 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#include" do
+  it "calls #append_features(self) in reversed order on each module" do
+    $appended_modules = []
+
+    m = Module.new do
+      def self.append_features(mod)
+        $appended_modules << [ self, mod ]
+      end
+    end
+
+    m2 = Module.new do
+      def self.append_features(mod)
+        $appended_modules << [ self, mod ]
+      end
+    end
+
+    m3 = Module.new do
+      def self.append_features(mod)
+        $appended_modules << [ self, mod ]
+      end
+    end
+
+    c = Class.new { include(m, m2, m3) }
+
+    $appended_modules.should == [ [ m3, c], [ m2, c ], [ m, c ] ]
+  end
+
+  it "adds all ancestor modules when a previously included module is included again" do
+    ModuleSpecs::MultipleIncludes.ancestors.should include(ModuleSpecs::MA, ModuleSpecs::MB)
+    ModuleSpecs::MB.send(:include, ModuleSpecs::MC)
+    ModuleSpecs::MultipleIncludes.send(:include, ModuleSpecs::MB)
+    ModuleSpecs::MultipleIncludes.ancestors.should include(ModuleSpecs::MA, ModuleSpecs::MB, ModuleSpecs::MC)
+  end
+
+  it "raises a TypeError when the argument is not a Module" do
+    lambda { ModuleSpecs::Basic.send(:include, Class.new) }.should raise_error(TypeError)
+  end
+
+  it "does not raise a TypeError when the argument is an instance of a subclass of Module" do
+    lambda { ModuleSpecs::SubclassSpec.send(:include, ModuleSpecs::Subclass.new) }.should_not raise_error(TypeError)
+  end
+
+  it "imports constants to modules and classes" do
+    ModuleSpecs::A.constants.should include("CONSTANT_A")
+    ModuleSpecs::B.constants.should include("CONSTANT_A","CONSTANT_B")
+    ModuleSpecs::C.constants.should include("CONSTANT_A","CONSTANT_B")
+  end
+
+  it "does not override existing constants in modules and classes" do
+    ModuleSpecs::A::OVERRIDE.should == :a
+    ModuleSpecs::B::OVERRIDE.should == :b
+    ModuleSpecs::C::OVERRIDE.should == :c
+  end
+
+  it "imports instance methods to modules and classes" do
+    ModuleSpecs::A.instance_methods.should include("ma")
+    ModuleSpecs::B.instance_methods.should include("ma","mb")
+    ModuleSpecs::C.instance_methods.should include("ma","mb")
+  end
+
+  it "imports constants to the toplevel" do
+    eval "include ModuleSpecs::Z", TOPLEVEL_BINDING
+    MODULE_SPEC_TOPLEVEL_CONSTANT.should == 1
+  end
+
+  it "does not import methods to modules and classes" do
+    ModuleSpecs::A.methods.include?("cma").should == true
+    ModuleSpecs::B.methods.include?("cma").should == false
+    ModuleSpecs::B.methods.include?("cmb").should == true
+    ModuleSpecs::C.methods.include?("cma").should == false
+    ModuleSpecs::C.methods.include?("cmb").should == false
+  end
+
+  it "attaches the module as the caller's immediate ancestor" do
+    module IncludeSpecsTop
+      def value; 5; end
+    end
+
+    module IncludeSpecsMiddle
+      include IncludeSpecsTop
+      def value; 6; end
+    end
+
+    class IncludeSpecsClass
+      include IncludeSpecsMiddle
+    end
+
+    IncludeSpecsClass.new.value.should == 6
+  end
+
+  it "doesn't include module if it is included in a super class" do
+    module ModuleSpecs::M1
+      module M; end
+      class A; include M; end
+      class B < A; include M; end
+      
+      all = [A,B,M]
+      
+      (B.ancestors & all).should == [B, A, M]
+    end
+  end
+  
+  it "recursively includes new mixins" do
+    module ModuleSpecs::M1
+      module U; end
+      module V; end
+      module W; end
+      module X; end
+      module Y; end
+      class A; include X; end;
+      class B < A; include U, V, W; end;
+      
+      all = [U,V,W,X,Y,A,B]
+      
+      # update V
+      module V; include X, U, Y; end
+      
+      (B.ancestors & all).should == [B, U, V, W, A, X]
+      
+      class B; include V; end
+      
+      # the only new module is Y, it is added after U since it follows U in V mixin list:
+      (B.ancestors & all).should == [B, U, Y, V, W, A, X]
+    end
+  end
+  
+  it "detects cyclic includes" do
+    lambda {
+      module ModuleSpecs::M
+        include ModuleSpecs::M
+      end
+    }.should raise_error(ArgumentError)
+  end
+end
+
+describe "Module#include?" do
+  it "returns true if the given module is included by self or one of it's ancestors" do
+    ModuleSpecs::Super.include?(ModuleSpecs::Basic).should == true
+    ModuleSpecs::Child.include?(ModuleSpecs::Basic).should == true
+    ModuleSpecs::Child.include?(ModuleSpecs::Super).should == true
+    ModuleSpecs::Child.include?(Kernel).should == true
+
+    ModuleSpecs::Parent.include?(ModuleSpecs::Basic).should == false
+    ModuleSpecs::Basic.include?(ModuleSpecs::Super).should == false
+  end
+
+  it "raises a TypeError when no module was given" do
+    lambda { ModuleSpecs::Child.include?("Test") }.should raise_error(TypeError)
+    lambda { ModuleSpecs::Child.include?(ModuleSpecs::Parent) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/included_modules_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/included_modules_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/included_modules_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#included_modules" do
+  it "returns a list of modules included in self" do
+    ModuleSpecs.included_modules.should         == []
+    ModuleSpecs::Child.included_modules.should  include(ModuleSpecs::Super, ModuleSpecs::Basic, Kernel)
+    ModuleSpecs::Parent.included_modules.should include(Kernel)
+    ModuleSpecs::Basic.included_modules.should  == []
+    ModuleSpecs::Super.included_modules.should  include(ModuleSpecs::Basic)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/included_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/included_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/included_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#included" do
+  it "is invoked when self is included in another module or class" do
+    begin
+      m = Module.new do
+        def self.included(o)
+          $included_by = o
+        end
+      end
+
+      c = Class.new { include m }
+
+      $included_by.should == c
+    ensure
+      $included_by = nil
+    end
+  end
+
+  it "allows extending self with the object into which it is being included" do
+    m = Module.new do
+      def self.included(o)
+        o.extend(self)
+      end
+
+      def test
+        :passed
+      end
+    end
+
+    c = Class.new{ include(m) }
+    c.test.should == :passed
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/initialize_copy_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/initialize_copy_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/initialize_copy_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'

Added: MacRuby/branches/experimental/spec/frozen/core/module/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#initialize" do
+  it "accepts a block" do
+    m = Module.new do
+      const_set :A, "A"
+    end
+    m.const_get("A").should == "A"
+  end
+  
+  it "is called on subclasses" do
+    m = ModuleSpecs::SubModule.new
+    m.special.should == 10
+    m.methods.should_not == nil
+    m.constants.should_not == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/instance_method_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/instance_method_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/instance_method_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,47 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#instance_method" do
+  before :all do
+    @parent_um = ModuleSpecs::InstanceMeth.instance_method(:foo)
+    @child_um = ModuleSpecs::InstanceMethChild.instance_method(:foo)
+    @mod_um = ModuleSpecs::InstanceMethChild.instance_method(:bar)
+  end
+
+  it "returns an UnboundMethod corresponding to the given name" do
+    @parent_um.class.should == UnboundMethod
+    @parent_um.bind(ModuleSpecs::InstanceMeth.new).call.should == :foo
+  end
+
+  it "returns an UnboundMethod corresponding to the given name from a superclass" do
+    @child_um.class.should == UnboundMethod
+    @child_um.bind(ModuleSpecs::InstanceMethChild.new).call.should == :foo
+  end
+
+  it "returns an UnboundMethod corresponding to the given name from an included Module" do
+    @mod_um.class.should == UnboundMethod
+    @mod_um.bind(ModuleSpecs::InstanceMethChild.new).call.should == :bar
+  end
+
+  it "gives UnboundMethod method name, Module defined in and Module extracted from" do
+    @parent_um.inspect.should =~ /\bfoo\b/
+    @parent_um.inspect.should =~ /\bModuleSpecs::InstanceMeth\b/
+    @parent_um.inspect.should =~ /\bModuleSpecs::InstanceMeth\b/
+    @child_um.inspect.should  =~ /\bfoo\b/
+    @child_um.inspect.should  =~ /\bModuleSpecs::InstanceMeth\b/
+    @child_um.inspect.should  =~ /\bModuleSpecs::InstanceMethChild\b/
+    @mod_um.inspect.should    =~ /\bbar\b/
+    @mod_um.inspect.should    =~ /\bModuleSpecs::InstanceMethMod\b/
+    @mod_um.inspect.should    =~ /\bModuleSpecs::InstanceMethChild\b/
+  end
+
+  it "raises a TypeError if the given name is not a string/symbol" do
+    lambda { Object.instance_method(nil)       }.should raise_error(TypeError)
+    lambda { Object.instance_method(mock('x')) }.should raise_error(TypeError)
+  end
+
+  it "raises a NameError if the given method doesn't exist" do
+    lambda { Object.instance_method(:missing) }.should raise_error(NameError)
+    lambda { Object.instance_method(:missing) }.should_not raise_error(NoMethodError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/instance_methods_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/instance_methods_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/instance_methods_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#instance_methods" do
+  it "does not return undefined methods" do
+    methods = ModuleSpecs::Parent.instance_methods(false)
+    methods.should_not include("undefed_method")
+
+    ModuleSpecs::Child.send(:undef_method, 'undefed_child')
+    methods = ModuleSpecs::Child.instance_methods
+    methods.should_not include("undefed_method")
+    methods.should_not include("undefed_child")
+  end
+
+  it "returns an array containing the public and protected methods of self if include_super is false" do
+    methods = ModuleSpecs::Parent.instance_methods(false)
+    methods.should include("protected_parent", "public_parent")
+
+    methods = ModuleSpecs::Child.instance_methods(false)
+    methods.should include("protected_child", "public_child")
+  end
+
+  it "returns an array containing the public and protected methods of self and it's ancestors" do
+    methods = ModuleSpecs::Basic.instance_methods
+    methods.should include("protected_module", "public_module")
+
+    methods = ModuleSpecs::Super.instance_methods
+    methods.should include("protected_module", "protected_super_module",
+      "public_module", "public_super_module")
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/lt_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/lt_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/lt_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#<" do
+  it "returns true if self is a subclass of or includes the given module" do
+    (ModuleSpecs::Child < ModuleSpecs::Parent).should == true
+    (ModuleSpecs::Child < ModuleSpecs::Basic).should == true
+    (ModuleSpecs::Child < ModuleSpecs::Super).should == true
+    (ModuleSpecs::Super < ModuleSpecs::Basic).should == true
+  end
+  
+  it "returns false if self is the same as the given module" do
+    (ModuleSpecs::Child  < ModuleSpecs::Child).should == false
+    (ModuleSpecs::Parent < ModuleSpecs::Parent).should == false
+    (ModuleSpecs::Basic  < ModuleSpecs::Basic).should == false
+    (ModuleSpecs::Super  < ModuleSpecs::Super).should == false
+  end
+  
+  it "returns nil if self is not related to the given module" do
+    (ModuleSpecs::Parent < ModuleSpecs::Basic).should == nil
+    (ModuleSpecs::Parent < ModuleSpecs::Super).should == nil
+    (ModuleSpecs::Basic  < ModuleSpecs::Parent).should == nil
+    (ModuleSpecs::Super  < ModuleSpecs::Parent).should == nil
+  end
+  
+  it "raises a TypeError if the argument is not a class/module" do
+    lambda { ModuleSpecs::Parent < mock('x') }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/lte_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/lte_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/lte_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#<=" do
+  it "returns true if self is a subclass of, the same as or includes the given module" do
+    (ModuleSpecs::Child  <= ModuleSpecs::Parent).should == true
+    (ModuleSpecs::Child  <= ModuleSpecs::Basic).should == true
+    (ModuleSpecs::Child  <= ModuleSpecs::Super).should == true
+    (ModuleSpecs::Super  <= ModuleSpecs::Basic).should == true
+    (ModuleSpecs::Child  <= ModuleSpecs::Child).should == true
+    (ModuleSpecs::Parent <= ModuleSpecs::Parent).should == true
+    (ModuleSpecs::Basic  <= ModuleSpecs::Basic).should == true
+    (ModuleSpecs::Super  <= ModuleSpecs::Super).should == true
+  end
+  
+  it "returns nil if self is not related to the given module" do
+    (ModuleSpecs::Parent <= ModuleSpecs::Basic).should == nil
+    (ModuleSpecs::Parent <= ModuleSpecs::Super).should == nil
+    (ModuleSpecs::Basic  <= ModuleSpecs::Parent).should == nil
+    (ModuleSpecs::Super  <= ModuleSpecs::Parent).should == nil
+  end
+  
+  it "returns false if self is a superclass of or is included by the given module" do
+    (ModuleSpecs::Parent <= ModuleSpecs::Child).should == false
+    (ModuleSpecs::Basic  <= ModuleSpecs::Child).should == false
+    (ModuleSpecs::Super  <= ModuleSpecs::Child).should == false
+    (ModuleSpecs::Basic  <= ModuleSpecs::Super).should == false
+  end
+
+  it "raises a TypeError if the argument is not a class/module" do
+    lambda { ModuleSpecs::Parent <= mock('x') }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/method_added_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/method_added_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/method_added_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#method_added" do
+  it "is a private instance method" do
+    Module.should have_private_instance_method(:method_added)
+  end
+  
+  it "returns nil in the default implementation" do
+    Module.new do
+      method_added(:test).should == nil
+    end
+  end
+  
+  it "is called when a new method is defined in self" do
+    begin
+      $methods_added = []
+      
+      m = Module.new do
+        def self.method_added(name)
+          $methods_added << name
+        end
+        
+        def test() end
+        def test2() end
+        def test() end
+      end
+      
+      $methods_added.should == [:test,:test2, :test] 
+    ensure
+      $methods_added = nil
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/method_defined_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/method_defined_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/method_defined_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,42 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#method_defined?" do
+  it "returns true if a public or private method with the given name is defined in self, self's ancestors or one of self's included modules" do
+    # Defined in Child
+    ModuleSpecs::Child.method_defined?(:public_child).should == true
+    ModuleSpecs::Child.method_defined?("private_child").should == false
+    ModuleSpecs::Child.method_defined?(:accessor_method).should == true
+
+    # Defined in Parent
+    ModuleSpecs::Child.method_defined?("public_parent").should == true
+    ModuleSpecs::Child.method_defined?(:private_parent).should == false
+
+    # Defined in Module
+    ModuleSpecs::Child.method_defined?(:public_module).should == true
+    ModuleSpecs::Child.method_defined?(:protected_module).should == true
+    ModuleSpecs::Child.method_defined?(:private_module).should == false
+
+    # Defined in SuperModule
+    ModuleSpecs::Child.method_defined?(:public_super_module).should == true
+    ModuleSpecs::Child.method_defined?(:protected_super_module).should == true
+    ModuleSpecs::Child.method_defined?(:private_super_module).should == false
+  end
+
+  it "raises a TypeError when the given object is not a string/symbol/fixnum" do
+    c = Class.new
+    o = mock('123')
+    
+    lambda { c.method_defined?(o) }.should raise_error(TypeError)
+    
+    o.should_receive(:to_str).and_return(123)
+    lambda { c.method_defined?(o) }.should raise_error(TypeError)
+  end
+  
+  it "converts the given name to a string using to_str" do
+    c = Class.new { def test(); end }
+    (o = mock('test')).should_receive(:to_str).and_return("test")
+    
+    c.method_defined?(o).should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/method_removed_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/method_removed_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/method_removed_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#method_removed" do
+  it "is called when a method is removed from self" do
+    begin
+      Module.new do
+        def self.method_removed(name)
+          $method_removed = name
+        end
+        
+        def test
+          "test"
+        end
+        remove_method :test
+      end
+      
+      $method_removed.should == :test
+    ensure
+      $method_removed = nil
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/method_undefined_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/method_undefined_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/method_undefined_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#method_undefined" do
+  it "is called when a method is undefined from self" do
+    begin
+      Module.new do
+        def self.method_undefined(name)
+          $method_undefined = name
+        end
+        
+        def test
+          "test"
+        end
+        undef_method :test
+      end
+      
+      $method_undefined.should == :test
+    ensure
+      $method_undefined = nil
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/module_eval_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/module_eval_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/module_eval_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/class_eval'
+
+describe "Module#module_eval" do
+  it_behaves_like :module_class_eval, :module_eval
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/module_function_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/module_function_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/module_function_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,232 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#module_function with specific method names" do
+  it "creates duplicates of the given instance methods on the Module object" do
+    m = Module.new do
+      def test()  end
+      def test2() end
+      def test3() end
+
+      module_function :test, :test2
+    end
+
+    m.respond_to?(:test).should  == true
+    m.respond_to?(:test2).should == true
+    m.respond_to?(:test3).should == false
+  end
+
+  it "returns the current module" do
+    x = nil
+    m = Module.new do
+      def test()  end
+      x = module_function :test
+    end
+
+    x.should == m
+  end
+
+  it "creates an independent copy of the method, not a redirect" do
+    module Mixin
+      def test
+        "hello"
+      end
+      module_function :test
+    end
+
+    class BaseClass
+      include Mixin
+      def call_test
+        test
+      end
+    end
+
+    Mixin.test.should == "hello"
+    c = BaseClass.new
+    c.call_test.should == "hello"
+
+    module Mixin
+      def test
+        "goodbye"
+      end
+    end
+
+    Mixin.test.should == "hello"
+    c.call_test.should == "goodbye"
+  end
+
+  it "makes the instance methods private" do
+    m = Module.new do
+      def test() "hello" end
+      module_function :test
+    end
+
+    (o = mock('x')).extend(m)
+    o.respond_to?(:test).should == false
+    m.should have_private_instance_method(:test)
+    o.send(:test).should == "hello"
+    lambda { o.test }.should raise_error(NoMethodError)
+  end
+
+  it "makes the new Module methods public" do
+    m = Module.new do
+      def test() "hello" end
+      module_function :test
+    end
+
+    m.public_methods.map {|m| m.to_s }.include?('test').should == true
+  end
+
+  it "tries to convert the given names to strings using to_str" do
+    (o = mock('test')).should_receive(:to_str).any_number_of_times.and_return("test")
+    (o2 = mock('test2')).should_receive(:to_str).any_number_of_times.and_return("test2")
+
+    m = Module.new do
+      def test() end
+      def test2() end
+      module_function o, o2
+    end
+
+    m.respond_to?(:test).should  == true
+    m.respond_to?(:test2).should == true
+  end
+
+  it "raises a TypeError when the given names can't be converted to string using to_str" do
+    o = mock('123')
+
+    lambda { Module.new { module_function(o) } }.should raise_error(TypeError)
+
+    o.should_receive(:to_str).and_return(123)
+    lambda { Module.new { module_function(o) } }.should raise_error(TypeError)
+  end
+end
+
+describe "Module#module_function as a toggle (no arguments) in a Module body" do
+  it "makes any subsequently defined methods module functions with the normal semantics" do
+    m = Module.new {
+          module_function
+            def test1() end
+            def test2() end
+        }
+
+    m.respond_to?(:test1).should == true
+    m.respond_to?(:test2).should == true
+  end
+
+  it "returns the current module" do
+    x = nil
+    m = Module.new {
+      x = module_function
+    }
+
+    x.should == m
+  end
+
+  it "stops creating module functions if the body encounters another toggle " \
+     "like public/protected/private without arguments" do
+    m = Module.new {
+          module_function
+            def test1() end
+            def test2() end
+          public
+            def test3() end
+        }
+
+    m.respond_to?(:test1).should == true
+    m.respond_to?(:test2).should == true
+    m.respond_to?(:test3).should == false
+  end
+
+  it "does not stop creating module functions if the body encounters " \
+     "public/protected/private WITH arguments" do
+    m = Module.new {
+          def foo() end
+
+          module_function
+            def test1() end
+            def test2() end
+
+            public :foo
+
+            def test3() end
+        }
+
+    m.respond_to?(:test1).should == true
+    m.respond_to?(:test2).should == true
+    m.respond_to?(:test3).should == true
+  end
+
+  it "does not affect module_evaled method definitions also if outside the eval itself" do
+    m = Module.new {
+          module_function
+
+          module_eval { def test1() end }
+          module_eval " def test2() end "
+        }
+
+    c = Class.new { include m }
+
+    m.respond_to?(:test1).should == false
+    m.respond_to?(:test2).should == false
+  end
+
+  it "has no effect if inside a module_eval if the definitions are outside of it" do
+    m = Module.new {
+          module_eval { module_function }
+
+          def test1() end
+          def test2() end
+        }
+
+    m.respond_to?(:test1).should == false
+    m.respond_to?(:test2).should == false
+  end
+
+  it "functions normally if both toggle and definitions inside a module_eval" do
+    m = Module.new {
+          module_eval {
+            module_function
+
+            def test1() end
+            def test2() end
+          }
+        }
+
+    m.respond_to?(:test1).should == true
+    m.respond_to?(:test2).should == true
+  end
+
+  it "affects evaled method definitions also even when outside the eval itself" do
+    m = Module.new {
+          module_function
+
+          eval "def test1() end"
+        }
+
+    m.respond_to?(:test1).should == true
+  end
+
+  it "affects definitions when inside an eval even if the definitions are outside of it" do
+    m = Module.new {
+          eval "module_function"
+
+          def test1() end
+        }
+
+    m.respond_to?(:test1).should == true
+  end
+
+  it "functions normally if both toggle and definitions inside a module_eval" do
+    m = Module.new {
+          eval <<-CODE
+            module_function
+
+            def test1() end
+            def test2() end
+          CODE
+        }
+
+    m.respond_to?(:test1).should == true
+    m.respond_to?(:test2).should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/name_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/name_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/name_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#name" do
+  it "returns the name of self" do
+    Module.new.name.should == ""
+    Class.new.name.should == ""
+    
+    ModuleSpecs.name.should == "ModuleSpecs"
+    ModuleSpecs::Child.name.should == "ModuleSpecs::Child"
+    ModuleSpecs::Parent.name.should == "ModuleSpecs::Parent"
+    ModuleSpecs::Basic.name.should == "ModuleSpecs::Basic"
+    ModuleSpecs::Super.name.should == "ModuleSpecs::Super"
+    
+    begin
+      (ModuleSpecs::X = Module.new).name.should == "ModuleSpecs::X"
+    ensure
+      ModuleSpecs.send :remove_const, :X
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/nesting_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/nesting_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/nesting_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module::Nesting" do
+
+  it "returns the list of Modules nested at the point of call" do
+    ModuleSpecs::Nesting[:root_level].should == []
+    ModuleSpecs::Nesting[:first_level].should == [ModuleSpecs]
+    ModuleSpecs::Nesting[:basic].should == [ModuleSpecs::Nesting, ModuleSpecs]
+    ModuleSpecs::Nesting[:open_first_level].should == 
+      [ModuleSpecs, ModuleSpecs::Nesting, ModuleSpecs]
+    ModuleSpecs::Nesting[:open_meta].should == 
+      [ModuleSpecs::Nesting.meta, ModuleSpecs::Nesting, ModuleSpecs]
+    ModuleSpecs::Nesting[:nest_class].should == 
+      [ModuleSpecs::Nesting::NestedClass, ModuleSpecs::Nesting, ModuleSpecs]
+  end
+
+  it "returns the nesting for module/class declaring the called method" do 
+    ModuleSpecs::Nesting.called_from_module_method.should == 
+      [ModuleSpecs::Nesting, ModuleSpecs]
+    ModuleSpecs::Nesting::NestedClass.called_from_class_method.should == 
+      [ModuleSpecs::Nesting::NestedClass, ModuleSpecs::Nesting, ModuleSpecs]
+    ModuleSpecs::Nesting::NestedClass.new.called_from_inst_method.should == 
+      [ModuleSpecs::Nesting::NestedClass, ModuleSpecs::Nesting, ModuleSpecs]
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module.new" do
+  it "creates a new anonymous Module" do
+    Module.new.is_a?(Module).should == true
+  end
+
+  it "creates a new Module and passes it to the provided block" do
+    test_mod = nil
+    m = Module.new do |mod|
+      mod.should_not == nil
+      self.should == mod
+      test_mod = mod
+      mod.is_a?(Module).should == true
+      Object.new # trying to return something
+    end
+    test_mod.should == m
+  end
+
+  it "evaluates a passed block in the context of the module" do
+    fred = Module.new do
+      def hello() "hello" end
+      def bye()   "bye"   end
+    end
+    
+    (o = mock('x')).extend(fred)
+    o.hello.should == "hello"
+    o.bye.should   == "bye"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/private_class_method_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/private_class_method_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/private_class_method_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,73 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#private_class_method" do
+  before(:each) do
+    # This is not in classes.rb because after marking a class method private it 
+    # will stay private.
+    class << ModuleSpecs::Parent
+      def private_method_1; end
+      def private_method_2; end
+      def private_method_3; end
+    end
+  end
+
+  it "makes an existing class method private" do
+    ModuleSpecs::Parent.private_method_1.should == nil
+    ModuleSpecs::Parent.private_class_method :private_method_1
+    lambda { ModuleSpecs::Parent.private_method_1  }.should raise_error(NoMethodError)
+
+    # Technically above we're testing the Singleton classes, class method(right?).
+    # Try a "real" class method set private.
+    lambda { ModuleSpecs::Parent.private_method }.should raise_error(NoMethodError)
+  end
+
+  it "makes an existing class method private up the inheritance tree" do
+    ModuleSpecs::Child.private_method_1.should == nil
+    ModuleSpecs::Child.private_class_method :private_method_1
+
+    lambda { ModuleSpecs::Child.private_method_1 }.should raise_error(NoMethodError)
+    lambda { ModuleSpecs::Child.private_method   }.should raise_error(NoMethodError)
+  end
+
+  it "accepts more than one method at a time" do
+    ModuleSpecs::Parent.private_method_1.should == nil
+    ModuleSpecs::Parent.private_method_2.should == nil
+    ModuleSpecs::Parent.private_method_3.should == nil
+
+    ModuleSpecs::Child.private_class_method :private_method_1, :private_method_2, :private_method_3
+    
+    lambda { ModuleSpecs::Child.private_method_1 }.should raise_error(NoMethodError)
+    lambda { ModuleSpecs::Child.private_method_2 }.should raise_error(NoMethodError)
+    lambda { ModuleSpecs::Child.private_method_3 }.should raise_error(NoMethodError)
+  end
+
+  it "raises a NameError if class method doesn't exist" do
+    lambda { ModuleSpecs.private_class_method :no_method_here }.should raise_error(NameError)
+  end
+
+  it "makes a class method private" do
+    c = Class.new do
+      def self.foo() "foo" end
+      private_class_method :foo
+    end
+    lambda { c.foo }.should raise_error(NoMethodError)
+  end
+
+  it "raises a NameError when the given name is not a method" do
+    lambda {
+      c = Class.new do
+        private_class_method :foo
+      end
+    }.should raise_error(NameError)
+  end
+
+  it "raises a NameError when the given name is an instance method" do
+    lambda {
+      c = Class.new do
+        def foo() "foo" end
+        private_class_method :foo
+      end
+    }.should raise_error(NameError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/private_instance_methods_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/private_instance_methods_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/private_instance_methods_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,30 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#private_instance_methods" do
+  it "returns a list of private methods in module and its ancestors" do
+    ModuleSpecs::CountsMixin.should have_private_instance_method(:private_3)
+
+    ModuleSpecs::CountsParent.should have_private_instance_method(:private_2)
+    ModuleSpecs::CountsParent.should have_private_instance_method(:private_3)
+
+    ModuleSpecs::CountsChild.should have_private_instance_method(:private_1)
+    ModuleSpecs::CountsChild.should have_private_instance_method(:private_2)
+    ModuleSpecs::CountsChild.should have_private_instance_method(:private_3)
+  end
+
+  it "when passed false as a parameter, should return only methods defined in that module" do
+    ModuleSpecs::CountsMixin.should have_private_instance_method(:private_3, false)
+    ModuleSpecs::CountsParent.should have_private_instance_method(:private_2, false)
+    ModuleSpecs::CountsChild.should have_private_instance_method(:private_1, false)
+  end
+
+  it "default list should be the same as passing true as an argument" do
+    ModuleSpecs::CountsMixin.private_instance_methods(true).should ==
+      ModuleSpecs::CountsMixin.private_instance_methods
+    ModuleSpecs::CountsParent.private_instance_methods(true).should ==
+      ModuleSpecs::CountsParent.private_instance_methods
+    ModuleSpecs::CountsChild.private_instance_methods(true).should ==
+      ModuleSpecs::CountsChild.private_instance_methods
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/private_method_defined_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/private_method_defined_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/private_method_defined_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,82 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#private_method_defined?" do
+  it "returns true if the named private method is defined by module or its ancestors" do
+    ModuleSpecs::CountsMixin.private_method_defined?("private_3").should == true
+
+    ModuleSpecs::CountsParent.private_method_defined?("private_3").should == true
+    ModuleSpecs::CountsParent.private_method_defined?("private_2").should == true
+
+    ModuleSpecs::CountsChild.private_method_defined?("private_3").should == true
+    ModuleSpecs::CountsChild.private_method_defined?("private_2").should == true
+    ModuleSpecs::CountsChild.private_method_defined?("private_1").should == true
+  end
+
+  it "returns false if method is not a private method" do
+    ModuleSpecs::CountsChild.private_method_defined?("public_3").should == false
+    ModuleSpecs::CountsChild.private_method_defined?("public_2").should == false
+    ModuleSpecs::CountsChild.private_method_defined?("public_1").should == false
+
+    ModuleSpecs::CountsChild.private_method_defined?("protected_3").should == false
+    ModuleSpecs::CountsChild.private_method_defined?("protected_2").should == false
+    ModuleSpecs::CountsChild.private_method_defined?("protected_1").should == false
+  end
+
+  it "returns false if the named method is not defined by the module or its ancestors" do
+    ModuleSpecs::CountsMixin.private_method_defined?(:private_10).should == false
+  end
+
+  it "accepts symbols for the method name" do
+    ModuleSpecs::CountsMixin.private_method_defined?(:private_3).should == true
+  end
+
+  not_compliant_on :rubinius do
+    it "raises an ArgumentError if passed a Fixnum" do
+      lambda {
+        ModuleSpecs::CountsMixin.private_method_defined?(1)
+      }.should raise_error(ArgumentError)
+    end
+
+    it "raises a TypeError if not passed a Symbol" do
+      lambda {
+        ModuleSpecs::CountsMixin.private_method_defined?(nil)
+      }.should raise_error(TypeError)
+      lambda {
+        ModuleSpecs::CountsMixin.private_method_defined?(false)
+      }.should raise_error(TypeError)
+      lambda {
+        ModuleSpecs::CountsMixin.private_method_defined?(mock('x'))
+      }.should raise_error(TypeError)
+
+      sym = mock('symbol')
+      def sym.to_sym() :private_3 end
+      lambda {
+        ModuleSpecs::CountsMixin.private_method_defined?(sym)
+      }.should raise_error(TypeError)
+    end
+  end
+
+  it "accepts any argument that is a String type" do
+    str = mock('string')
+    def str.to_str() 'private_3' end
+    ModuleSpecs::CountsMixin.private_method_defined?(str).should == true
+  end
+
+  deviates_on :rubinius do
+    it "raises a TypeError if not passed a String type" do
+      lambda {
+        ModuleSpecs::CountsMixin.private_method_defined?(1)
+      }.should raise_error(TypeError)
+      lambda {
+        ModuleSpecs::CountsMixin.private_method_defined?(nil)
+      }.should raise_error(TypeError)
+      lambda {
+        ModuleSpecs::CountsMixin.private_method_defined?(false)
+      }.should raise_error(TypeError)
+      lambda {
+        ModuleSpecs::CountsMixin.private_method_defined?(mock('x'))
+      }.should raise_error(TypeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/private_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/private_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/private_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#private" do
+  it "should make the target method uncallable from other types" do
+    obj = Object.new
+    class << obj
+      def foo; true; end
+    end
+
+    obj.foo.should == true
+
+    class << obj
+      private :foo
+    end
+
+    lambda { obj.foo }.should raise_error(NoMethodError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/protected_instance_methods_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/protected_instance_methods_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/protected_instance_methods_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#protected_instance_methods" do
+  it "returns a list of protected methods in module and its ancestors" do
+    methods = ModuleSpecs::CountsMixin.protected_instance_methods
+    methods.should include('protected_3')
+  
+    methods = ModuleSpecs::CountsParent.protected_instance_methods
+    methods.should include('protected_3')
+    methods.should include('protected_2')
+
+    methods = ModuleSpecs::CountsChild.protected_instance_methods
+    methods.should include('protected_3')
+    methods.should include('protected_2')
+    methods.should include('protected_1')
+  end
+
+  it "when passed false as a parameter, should return only methods defined in that module" do
+    ModuleSpecs::CountsMixin.protected_instance_methods(false).should == ['protected_3']
+    ModuleSpecs::CountsParent.protected_instance_methods(false).should == ['protected_2']
+    ModuleSpecs::CountsChild.protected_instance_methods(false).should == ['protected_1']
+  end
+
+  it "default list should be the same as passing true as an argument" do
+    ModuleSpecs::CountsMixin.protected_instance_methods(true).should ==
+      ModuleSpecs::CountsMixin.protected_instance_methods
+    ModuleSpecs::CountsParent.protected_instance_methods(true).should ==
+      ModuleSpecs::CountsParent.protected_instance_methods
+    ModuleSpecs::CountsChild.protected_instance_methods(true).should ==
+      ModuleSpecs::CountsChild.protected_instance_methods
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/protected_method_defined_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/protected_method_defined_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/protected_method_defined_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,70 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#protected_method_defined?" do
+  it "returns true if the named protected method is defined by module or its ancestors" do
+    ModuleSpecs::CountsMixin.protected_method_defined?("protected_3").should == true
+
+    ModuleSpecs::CountsParent.protected_method_defined?("protected_3").should == true
+    ModuleSpecs::CountsParent.protected_method_defined?("protected_2").should == true
+
+    ModuleSpecs::CountsChild.protected_method_defined?("protected_3").should == true
+    ModuleSpecs::CountsChild.protected_method_defined?("protected_2").should == true
+    ModuleSpecs::CountsChild.protected_method_defined?("protected_1").should == true
+  end
+
+  it "returns false if method is not a protected method" do
+    ModuleSpecs::CountsChild.protected_method_defined?("public_3").should == false
+    ModuleSpecs::CountsChild.protected_method_defined?("public_2").should == false
+    ModuleSpecs::CountsChild.protected_method_defined?("public_1").should == false
+
+    ModuleSpecs::CountsChild.protected_method_defined?("private_3").should == false
+    ModuleSpecs::CountsChild.protected_method_defined?("private_2").should == false
+    ModuleSpecs::CountsChild.protected_method_defined?("private_1").should == false
+  end
+
+  it "returns false if the named method is not defined by the module or its ancestors" do
+    ModuleSpecs::CountsMixin.protected_method_defined?(:protected_10).should == false
+  end
+
+  it "accepts symbols for the method name" do
+    ModuleSpecs::CountsMixin.protected_method_defined?(:protected_3).should == true
+  end
+
+  not_compliant_on :rubinius do
+    it "raises an ArgumentError if passed a Fixnum" do
+      lambda {
+        ModuleSpecs::CountsMixin.protected_method_defined?(1)
+      }.should raise_error(ArgumentError)
+    end
+
+    it "raises a TypeError if not passed a Symbol" do
+      lambda {
+        ModuleSpecs::CountsMixin.protected_method_defined?(nil)
+      }.should raise_error(TypeError)
+      lambda {
+        ModuleSpecs::CountsMixin.protected_method_defined?(false)
+      }.should raise_error(TypeError)
+
+      sym = mock('symbol')
+      def sym.to_sym() :protected_3 end
+      lambda {
+        ModuleSpecs::CountsMixin.protected_method_defined?(sym)
+      }.should raise_error(TypeError)
+    end
+  end
+
+  it "accepts any object that is a String type" do
+    str = mock('protected_3')
+    def str.to_str() 'protected_3' end
+    ModuleSpecs::CountsMixin.protected_method_defined?(str).should == true
+  end
+
+  deviates_on :rubinius do
+    it "raises a TypeError if not passed a String type" do
+      lambda {
+        ModuleSpecs::CountsMixin.protected_method_defined?(mock('x'))
+      }.should raise_error(TypeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/protected_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/protected_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/protected_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#protected" do
+  
+  before :each do
+    class << ModuleSpecs::Parent
+      def protected_method_1; 5; end
+    end
+  end
+  
+  it "makes an existing class method protected" do
+    ModuleSpecs::Parent.protected_method_1.should == 5
+    
+    class << ModuleSpecs::Parent
+      protected :protected_method_1
+    end
+    
+    lambda { ModuleSpecs::Parent.protected_method_1 }.should raise_error(NoMethodError)
+  end
+  
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/module/public_class_method_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/public_class_method_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/public_class_method_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,73 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#public_class_method" do
+  before(:each) do
+    class << ModuleSpecs::Parent
+      private
+      def public_method_1; end
+      def public_method_2; end
+      def public_method_3; end
+    end
+  end
+
+  it "makes an existing class method public" do
+    lambda { ModuleSpecs::Parent.public_method_1 }.should raise_error(NoMethodError)
+    ModuleSpecs::Parent.public_class_method :public_method_1
+    ModuleSpecs::Parent.public_method_1.should == nil
+
+    # Technically above we're testing the Singleton classes, class method(right?).
+    # Try a "real" class method set public.
+    ModuleSpecs::Parent.public_method.should == nil
+  end
+
+  it "makes an existing class method public up the inheritance tree" do
+    lambda { ModuleSpecs::Child.public_method_1 }.should raise_error(NoMethodError)
+    ModuleSpecs::Child.public_class_method :public_method_1
+
+    ModuleSpecs::Child.public_method_1.should == nil
+    ModuleSpecs::Child.public_method.should == nil
+  end
+
+  it "accepts more than one method at a time" do
+    lambda { ModuleSpecs::Parent.public_method_1 }.should raise_error(NameError)
+    lambda { ModuleSpecs::Parent.public_method_2 }.should raise_error(NameError)
+    lambda { ModuleSpecs::Parent.public_method_3 }.should raise_error(NameError)
+
+    ModuleSpecs::Child.public_class_method :public_method_1, :public_method_2, :public_method_3
+    
+    ModuleSpecs::Child.public_method_1.should == nil
+    ModuleSpecs::Child.public_method_2.should == nil
+    ModuleSpecs::Child.public_method_3.should == nil
+  end
+
+  it "raises a NameError if class method doesn't exist" do
+    lambda { ModuleSpecs.public_class_method :no_method_here }.should raise_error(NameError)
+  end
+
+  it "makes a class method public" do
+    c = Class.new do
+      def self.foo() "foo" end
+      public_class_method :foo
+    end
+
+    c.foo.should == "foo"
+  end
+
+  it "raises a NameError when the given name is not a method" do
+    lambda {
+      c = Class.new do
+        public_class_method :foo
+      end
+    }.should raise_error(NameError)
+  end
+
+  it "raises a NameError when the given name is an instance method" do
+    lambda {
+      c = Class.new do
+        def foo() "foo" end
+        public_class_method :foo
+      end
+    }.should raise_error(NameError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/public_instance_methods_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/public_instance_methods_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/public_instance_methods_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,36 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#public_instance_methods" do
+  it "returns a list of public methods in module and its ancestors" do
+    methods = ModuleSpecs::CountsMixin.public_instance_methods
+    methods.should include('public_3')
+  
+    methods = ModuleSpecs::CountsParent.public_instance_methods
+    methods.should include('public_3')
+    methods.should include('public_2')
+
+    methods = ModuleSpecs::CountsChild.public_instance_methods
+    methods.should include('public_3')
+    methods.should include('public_2')
+    methods.should include('public_1')
+
+    methods = ModuleSpecs::Child2.public_instance_methods
+    methods.should include('foo')
+  end
+
+  it "when passed false as a parameter, should return only methods defined in that module" do
+    ModuleSpecs::CountsMixin.public_instance_methods(false).should == ['public_3']
+    ModuleSpecs::CountsParent.public_instance_methods(false).should == ['public_2']
+    ModuleSpecs::CountsChild.public_instance_methods(false).should == ['public_1']
+  end
+
+  it "default list should be the same as passing true as an argument" do
+    ModuleSpecs::CountsMixin.public_instance_methods(true).should ==
+      ModuleSpecs::CountsMixin.public_instance_methods
+    ModuleSpecs::CountsParent.public_instance_methods(true).should ==
+      ModuleSpecs::CountsParent.public_instance_methods
+    ModuleSpecs::CountsChild.public_instance_methods(true).should ==
+      ModuleSpecs::CountsChild.public_instance_methods
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/public_method_defined_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/public_method_defined_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/public_method_defined_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,70 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Module#public_method_defined?" do
+  it "returns true if the named public method is defined by module or its ancestors" do
+    ModuleSpecs::CountsMixin.public_method_defined?("public_3").should == true
+
+    ModuleSpecs::CountsParent.public_method_defined?("public_3").should == true
+    ModuleSpecs::CountsParent.public_method_defined?("public_2").should == true
+
+    ModuleSpecs::CountsChild.public_method_defined?("public_3").should == true
+    ModuleSpecs::CountsChild.public_method_defined?("public_2").should == true
+    ModuleSpecs::CountsChild.public_method_defined?("public_1").should == true
+  end
+
+  it "returns false if method is not a public method" do
+    ModuleSpecs::CountsChild.public_method_defined?("private_3").should == false
+    ModuleSpecs::CountsChild.public_method_defined?("private_2").should == false
+    ModuleSpecs::CountsChild.public_method_defined?("private_1").should == false
+
+    ModuleSpecs::CountsChild.public_method_defined?("protected_3").should == false
+    ModuleSpecs::CountsChild.public_method_defined?("protected_2").should == false
+    ModuleSpecs::CountsChild.public_method_defined?("protected_1").should == false
+  end
+
+  it "returns false if the named method is not defined by the module or its ancestors" do
+    ModuleSpecs::CountsMixin.public_method_defined?(:public_10).should == false
+  end
+
+  it "accepts symbols for the method name" do
+    ModuleSpecs::CountsMixin.public_method_defined?(:public_3).should == true
+  end
+
+  not_compliant_on :rubinius do
+    it "raises an ArgumentError if called with a Fixnum" do
+      lambda {
+        ModuleSpecs::CountsMixin.public_method_defined?(1)
+      }.should raise_error(ArgumentError)
+    end
+
+    it "raises a TypeError if not passed a Symbol" do
+      lambda {
+        ModuleSpecs::CountsMixin.public_method_defined?(nil)
+      }.should raise_error(TypeError)
+      lambda {
+        ModuleSpecs::CountsMixin.public_method_defined?(false)
+      }.should raise_error(TypeError)
+
+      sym = mock('symbol')
+      def sym.to_sym() :public_3 end
+      lambda {
+        ModuleSpecs::CountsMixin.public_method_defined?(sym)
+      }.should raise_error(TypeError)
+    end
+  end
+
+  it "accepts any object that is a String type" do
+    str = mock('public_3')
+    def str.to_str() 'public_3' end
+    ModuleSpecs::CountsMixin.public_method_defined?(str).should == true
+  end
+
+  deviates_on :rubinius do
+    it "raises a TypeError if not passed a String type" do
+      lambda {
+        ModuleSpecs::CountsMixin.public_method_defined?(mock('x'))
+      }.should raise_error(TypeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/public_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/public_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/public_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'

Added: MacRuby/branches/experimental/spec/frozen/core/module/remove_class_variable_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/remove_class_variable_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/remove_class_variable_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'

Added: MacRuby/branches/experimental/spec/frozen/core/module/remove_const_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/remove_const_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/remove_const_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,77 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/../../fixtures/constants'
+
+describe "Module#remove_const" do
+  it "removes the constant specified by a String or Symbol from the receiver's constant table" do
+    ConstantSpecs::ModuleM::CS_CONST252 = :const252
+    ConstantSpecs::ModuleM::CS_CONST252.should == :const252
+
+    ConstantSpecs::ModuleM.send :remove_const, :CS_CONST252
+    lambda { ConstantSpecs::ModuleM::CS_CONST252 }.should raise_error(NameError)
+
+    ConstantSpecs::ModuleM::CS_CONST253 = :const253
+    ConstantSpecs::ModuleM::CS_CONST253.should == :const253
+
+    ConstantSpecs::ModuleM.send :remove_const, "CS_CONST253"
+    lambda { ConstantSpecs::ModuleM::CS_CONST253 }.should raise_error(NameError)
+  end
+
+  it "returns the value of the removed constant" do
+    ConstantSpecs::ModuleM::CS_CONST254 = :const254
+    ConstantSpecs::ModuleM.send(:remove_const, :CS_CONST254).should == :const254
+  end
+
+  it "raises a NameError if the constant is not defined directly in the module" do
+    ConstantSpecs::ModuleM::CS_CONST255 = :const255
+    ConstantSpecs::ContainerA::CS_CONST255.should == :const255
+    lambda do
+      ConstantSpecs::ContainerA.send :remove_const, :CS_CONST255
+    end.should raise_error(NameError)
+  end
+
+  it "raises a NameError if the name does not start with a capital letter" do
+    lambda { ConstantSpecs.send :remove_const, "name" }.should raise_error(NameError)
+  end
+
+  it "raises a NameError if the name starts with a non-alphabetic character" do
+    lambda { ConstantSpecs.send :remove_const, "__CONSTX__" }.should raise_error(NameError)
+    lambda { ConstantSpecs.send :remove_const, "@Name" }.should raise_error(NameError)
+    lambda { ConstantSpecs.send :remove_const, "!Name" }.should raise_error(NameError)
+    lambda { ConstantSpecs.send :remove_const, "::Name" }.should raise_error(NameError)
+  end
+
+  it "raises a NameError if the name contains non-alphabetic characters except '_'" do
+    ConstantSpecs::ModuleM::CS_CONST256 = :const256
+    ConstantSpecs::ModuleM.send :remove_const, "CS_CONST256"
+    lambda { ConstantSpecs.send :remove_const, "Name=" }.should raise_error(NameError)
+    lambda { ConstantSpecs.send :remove_const, "Name?" }.should raise_error(NameError)
+  end
+
+  it "calls #to_str to convert the given name to a String" do
+    ConstantSpecs::CS_CONST257 = :const257
+    name = mock("CS_CONST257")
+    name.should_receive(:to_str).and_return("CS_CONST257")
+    ConstantSpecs.send(:remove_const, name).should == :const257
+  end
+
+  it "raises a TypeError if conversion to a String by calling #to_str fails" do
+    name = mock('123')
+    lambda { ConstantSpecs.send :remove_const, name }.should raise_error(TypeError)
+
+    name.should_receive(:to_str).and_return(123)
+    lambda { ConstantSpecs.send :remove_const, name }.should raise_error(TypeError)
+  end
+
+  ruby_version_is "" ... "1.9" do
+    it "is a private method" do
+      Module.private_methods.should include("remove_const")
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "is a private method" do
+      Module.private_methods.should include(:remove_const)
+    end
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/module/remove_method_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/remove_method_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/remove_method_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,57 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+module ModuleSpecs
+  class NoInheritance
+    def method_to_remove; 1; end
+
+    remove_method :method_to_remove
+  end
+  
+  class Parent
+    def method_to_remove; 1; end
+  end
+  
+  class Child < Parent
+    def method_to_remove; 2; end     
+
+    remove_method :method_to_remove
+  end
+  
+  class First
+    def method_to_remove; 1; end
+  end
+  
+  class Second < First
+    def method_to_remove; 2; end
+  end
+end
+
+describe "Module#remove_method" do
+  it "removes the method from a class" do
+    x = ModuleSpecs::NoInheritance.new
+    x.respond_to?(:method_to_remove).should == false
+  end
+  
+  it "removes method from subclass, but not parent" do
+    x = ModuleSpecs::Child.new
+    x.respond_to?(:method_to_remove).should == true    
+    x.method_to_remove.should == 1
+  end
+  
+  it "raises a NameError when attempting to remove method further up the inheritance tree" do
+    lambda {
+      class Third < ModuleSpecs::Second
+        remove_method :method_to_remove
+      end
+    }.should raise_error(NameError)
+  end
+
+  it "raises a NameError when attempting to remove a missing method" do
+    lambda {
+      class Third < ModuleSpecs::Second
+        remove_method :blah
+      end
+    }.should raise_error(NameError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/shared/class_eval.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/shared/class_eval.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/shared/class_eval.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,72 @@
+describe :module_class_eval, :shared => true do
+  # TODO: This should probably be replaced with a "should behave like" that uses
+  # the many scoping/binding specs from kernel/eval_spec, since most of those
+  # behaviors are the same for instance_eval. See also module_eval/class_eval.
+  it "shares a scope across sibling evals" do
+    a, b = Object.new, Object.new
+
+    result = nil
+    a.instance_eval "x = 1"
+    lambda do
+      b.instance_eval "result = x"
+    end.should_not raise_error
+    result.should == 1
+  end
+
+  it "evaluates a given string in the context of self" do
+    ModuleSpecs.send(@method, "self").should == ModuleSpecs
+    ModuleSpecs.send(@method, "1 + 1").should == 2
+  end
+
+  it "does not add defined methods to other classes" do
+    FalseClass.class_eval do
+      def foo
+        'foo'
+      end
+    end
+    lambda {42.foo}.should raise_error(NoMethodError)
+  end
+
+  it "defines constants in the receiver's scope" do
+    ModuleSpecs.send(@method, "module NewEvaluatedModule;end")
+    ModuleSpecs.const_defined?(:NewEvaluatedModule).should == true
+  end
+  
+  it "evaluates a given block in the context of self" do
+    ModuleSpecs.send(@method) { self }.should == ModuleSpecs
+    ModuleSpecs.send(@method) { 1 + 1 }.should == 2
+  end
+  
+  it "uses the optional filename and lineno parameters for error messages" do
+    ModuleSpecs.send(@method, "[__FILE__, __LINE__]", "test", 102).should == ["test", 102]
+  end
+
+  it "converts non string eval-string to string using to_str" do
+    (o = mock('1 + 1')).should_receive(:to_str).and_return("1 + 1")
+    ModuleSpecs.send(@method, o).should == 2
+  end
+
+  it "raises a TypeError when the given eval-string can't be converted to string using to_str" do
+    o = mock('x')
+    lambda { ModuleSpecs.send(@method, o) }.should raise_error(TypeError)
+  
+    (o = mock('123')).should_receive(:to_str).and_return(123)
+    lambda { ModuleSpecs.send(@method, o) }.should raise_error(TypeError)
+  end
+
+  it "raises an ArgumentError when no arguments and no block are given" do
+    lambda { ModuleSpecs.send(@method) }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError when more than 3 arguments are given" do
+    lambda {
+      ModuleSpecs.send(@method, "1 + 1", "some file", 0, "bogus")
+    }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError when a block and normal arguments are given" do
+    lambda {
+      ModuleSpecs.send(@method, "1 + 1") { 1 + 1 }
+    }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/shared/equal_value.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/shared/equal_value.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/shared/equal_value.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+describe :module_equal, :shared => true do
+  it "returns true if self and the given module are the same" do
+    ModuleSpecs.send(@method, ModuleSpecs).should == true
+    ModuleSpecs::Child.send(@method, ModuleSpecs::Child).should == true
+    ModuleSpecs::Parent.send(@method, ModuleSpecs::Parent).should == true
+    ModuleSpecs::Basic.send(@method, ModuleSpecs::Basic).should == true
+    ModuleSpecs::Super.send(@method, ModuleSpecs::Super).should == true
+    
+    ModuleSpecs::Child.send(@method, ModuleSpecs).should == false
+    ModuleSpecs::Child.send(@method, ModuleSpecs::Parent).should == false
+    ModuleSpecs::Child.send(@method, ModuleSpecs::Basic).should == false
+    ModuleSpecs::Child.send(@method, ModuleSpecs::Super).should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/module/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'

Added: MacRuby/branches/experimental/spec/frozen/core/module/undef_method_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/module/undef_method_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/module/undef_method_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,85 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+module ModuleSpecs
+  class NoInheritance
+    def method_to_undef() 1 end
+    def another_method_to_undef() 1 end
+  end
+
+  class Parent
+    def method_to_undef() 1 end
+    def another_method_to_undef() 1 end
+  end
+
+  class Child < Parent
+  end
+
+  class Ancestor
+    def method_to_undef() 1 end
+    def another_method_to_undef() 1 end
+  end
+
+  class Descendant < Ancestor
+  end
+end
+
+describe "Module#undef_method with symbol" do
+  it "removes a method defined in a class" do
+    x = ModuleSpecs::NoInheritance.new
+
+    x.method_to_undef.should == 1
+
+    ModuleSpecs::NoInheritance.send :undef_method, :method_to_undef
+
+    lambda { x.method_to_undef }.should raise_error(NoMethodError)
+  end
+
+  it "removes a method defined in a super class" do
+    child = ModuleSpecs::Child.new
+    child.method_to_undef.should == 1
+
+    ModuleSpecs::Child.send :undef_method, :method_to_undef
+
+    lambda { child.method_to_undef }.should raise_error(NoMethodError)
+  end
+
+  it "does not remove a method defined in a super class when removed from a subclass" do
+    ancestor = ModuleSpecs::Ancestor.new
+    ancestor.method_to_undef.should == 1
+
+    ModuleSpecs::Descendant.send :undef_method, :method_to_undef
+
+    ancestor.method_to_undef.should == 1
+  end
+end
+
+describe "Module#undef_method with string" do
+  it "removes a method defined in a class" do
+    x = ModuleSpecs::NoInheritance.new
+
+    x.another_method_to_undef.should == 1
+
+    ModuleSpecs::NoInheritance.send :undef_method, 'another_method_to_undef'
+
+    lambda { x.another_method_to_undef }.should raise_error(NoMethodError)
+  end
+
+  it "removes a method defined in a super class" do
+    child = ModuleSpecs::Child.new
+    child.another_method_to_undef.should == 1
+
+    ModuleSpecs::Child.send :undef_method, 'another_method_to_undef'
+
+    lambda { child.another_method_to_undef }.should raise_error(NoMethodError)
+  end
+
+  it "does not remove a method defined in a super class when removed from a subclass" do
+    ancestor = ModuleSpecs::Ancestor.new
+    ancestor.another_method_to_undef.should == 1
+
+    ModuleSpecs::Descendant.send :undef_method, 'another_method_to_undef'
+
+    ancestor.another_method_to_undef.should == 1
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/nil/and_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/nil/and_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/nil/and_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "NilClass#&" do
+  it "returns false" do
+    (nil & nil).should == false
+    (nil & true).should == false
+    (nil & false).should == false
+    (nil & "").should == false
+    (nil & mock('x')).should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/nil/dup_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/nil/dup_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/nil/dup_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+describe "NilClass#dup" do
+  it "raises a TypeError" do
+    lambda { nil.dup }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/nil/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/nil/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/nil/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "NilClass#inspect" do
+  it "returns the string 'nil'" do
+    nil.inspect.should == "nil"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/nil/nil_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/nil/nil_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/nil/nil_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "NilClass#nil?" do
+  it "returns true" do
+    nil.nil?.should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/nil/or_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/nil/or_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/nil/or_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "NilClass#|" do
+  it "returns false if other is nil or false, otherwise true" do
+    (nil | nil).should == false
+    (nil | true).should == true
+    (nil | false).should == false
+    (nil | "").should == true
+    (nil | mock('x')).should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/nil/to_a_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/nil/to_a_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/nil/to_a_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "NilClass#to_a" do
+  it "returns an empty array" do
+    nil.to_a.should == []
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/nil/to_f_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/nil/to_f_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/nil/to_f_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "NilClass#to_f" do
+  it "returns 0.0" do
+    nil.to_f.should == 0.0
+  end
+  
+  it "does not cause NilClass to be coerced to Float" do
+    (0.0 == nil).should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/nil/to_i_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/nil/to_i_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/nil/to_i_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "NilClass#to_i" do
+  it "returns 0" do
+    nil.to_i.should == 0
+  end
+  
+  it "does not cause NilClass to be coerced to Fixnum" do
+    (0 == nil).should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/nil/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/nil/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/nil/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "NilClass#to_s" do
+  it "returns the string ''" do
+    nil.to_s.should == ""
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/nil/xor_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/nil/xor_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/nil/xor_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "NilClass#^" do
+  it "returns false if other is nil or false, otherwise true" do
+    (nil ^ nil).should == false
+    (nil ^ true).should == true
+    (nil ^ false).should == false
+    (nil ^ "").should == true
+    (nil ^ mock('x')).should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/numeric/abs_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/numeric/abs_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/numeric/abs_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Numeric#abs" do
+  before(:each) do
+    @obj = NumericSub.new
+  end
+  
+  it "returns self when self is greater than 0" do
+    @obj.should_receive(:<).with(0).and_return(false)
+    @obj.abs.should == @obj
+  end
+  
+  it "returns self\#@- when self is less than 0" do
+    @obj.should_receive(:<).with(0).and_return(true)
+    @obj.should_receive(:-@).and_return(:absolute_value)
+    @obj.abs.should == :absolute_value
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/numeric/ceil_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/numeric/ceil_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/numeric/ceil_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Numeric#ceil" do
+  before(:each) do
+    @obj = NumericSub.new
+  end
+  
+  it "converts self to a Float (using #to_f) and returns the #ceil'ed result" do
+    @obj.should_receive(:to_f).and_return(1 + TOLERANCE, - 1 - TOLERANCE)
+    @obj.ceil.should == 2
+    @obj.ceil.should == -1
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/numeric/coerce_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/numeric/coerce_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/numeric/coerce_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,59 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Numeric#coerce" do
+  before(:each) do
+    @obj = NumericSub.new
+    @obj.should_receive(:to_f).any_number_of_times.and_return(10.5)
+  end
+
+  it "returns [other, self] if self and other are instances of the same class" do
+    a = NumericSub.new
+    b = NumericSub.new
+
+    a.coerce(b).should == [b, a]
+  end
+
+  it "calls #to_f to convert other if self responds to #to_f" do
+    other = NumericSub.new
+    lambda { @obj.coerce(other) }.should raise_error(TypeError)
+  end
+
+  it "returns [other.to_f, self.to_f] if self and other are instances of different classes" do
+    result = @obj.coerce(2.5)
+    result.should == [2.5, 10.5]
+    result.first.should be_kind_of(Float)
+    result.last.should be_kind_of(Float)
+
+    result = @obj.coerce(3)
+    result.should == [3.0, 10.5]
+    result.first.should be_kind_of(Float)
+    result.last.should be_kind_of(Float)
+
+    result = @obj.coerce("4.4")
+    result.should == [4.4, 10.5]
+    result.first.should be_kind_of(Float)
+    result.last.should be_kind_of(Float)
+
+    result = @obj.coerce(bignum_value)
+    result.should == [bignum_value.to_f, 10.5]
+    result.first.should be_kind_of(Float)
+    result.last.should be_kind_of(Float)
+  end
+
+  it "raises a TypeError when passed nil" do
+    lambda { @obj.coerce(nil)     }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError when passed a boolean" do
+    lambda { @obj.coerce(false)   }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError when passed a Symbol" do
+    lambda { @obj.coerce(:symbol) }.should raise_error(TypeError)
+  end
+
+  it "raises an ArgumentError when passed a String" do
+    lambda { @obj.coerce("test")  }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/numeric/comparison_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/numeric/comparison_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/numeric/comparison_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Numeric#<=>" do
+  before(:each) do
+    @obj = NumericSub.new
+  end
+
+  it "returns 0 if self equals other" do
+    (@obj <=> @obj).should == 0
+  end
+  
+  it "returns nil if self does not equal other" do
+    (@obj <=> NumericSub.new).should == nil
+    (@obj <=> 10).should == nil
+    (@obj <=> -3.5).should == nil
+    (@obj <=> bignum_value).should == nil
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/numeric/div_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/numeric/div_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/numeric/div_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Numeric#div" do
+  before(:each) do
+    @obj = NumericSub.new
+  end
+  
+  it "calls self#/ with other, converts the result to a Float (using #to_f) and returns the #floor'ed result" do
+    result = mock("Numeric#div result")
+    result.should_receive(:to_f).and_return(13 - TOLERANCE)
+    @obj.should_receive(:/).with(10).and_return(result)
+    
+    @obj.div(10).should == 12
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/numeric/divmod_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/numeric/divmod_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/numeric/divmod_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Numeric#divmod" do
+  before(:each) do
+    @obj = NumericSub.new
+  end
+
+  it "returns [quotient, modulus], with quotient being obtained as in Numeric#div and modulus being obtained by calling self#% with other" do
+    @obj.should_receive(:/).with(10).and_return(13 - TOLERANCE)
+    @obj.should_receive(:%).with(10).and_return(3)
+    
+    @obj.divmod(10).should == [12, 3]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/numeric/eql_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/numeric/eql_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/numeric/eql_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Numeric#eql?" do
+  before(:each) do
+    @obj = NumericSub.new
+  end
+
+  it "returns false if self's and other's types don't match" do
+    @obj.should_not eql(1)
+    @obj.should_not eql(-1.5)
+    @obj.should_not eql(bignum_value)
+    @obj.should_not eql(:sym)
+  end
+  
+  it "returns the result of calling self#== with other when self's and other's types match" do
+    other = NumericSub.new
+    @obj.should_receive(:==).with(other).and_return("result", nil)
+    @obj.should eql(other)
+    @obj.should_not eql(other)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/numeric/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/numeric/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/numeric/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+class NumericSub < Numeric
+  # Allow methods to be mocked
+  def singleton_method_added(val)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/numeric/floor_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/numeric/floor_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/numeric/floor_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Numeric#floor" do
+  before(:each) do
+    @obj = NumericSub.new
+  end
+  
+  it "converts self to a Float (using #to_f) and returns the #floor'ed result" do
+    @obj.should_receive(:to_f).and_return(2 - TOLERANCE, TOLERANCE - 2)
+    @obj.floor.should == 1
+    @obj.floor.should == -2
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/numeric/initialize_copy_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/numeric/initialize_copy_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/numeric/initialize_copy_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Numeric#singleton_method_added" do
+  it "raises a TypeError when trying to #dup a Numeric" do
+    lambda do
+      a = NumericSub.new
+      a.dup
+    end.should raise_error(TypeError)
+    
+    lambda do
+      a = 1
+      a.dup
+    end.should raise_error(TypeError)
+
+    lambda do
+      a = 1.5
+      a.dup
+    end.should raise_error(TypeError)
+
+    lambda do
+      a = bignum_value
+      a.dup
+    end.should raise_error(TypeError)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/numeric/integer_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/numeric/integer_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/numeric/integer_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Numeric#integer?" do
+  it "returns false" do
+    NumericSub.new.integer?.should == false
+  end   
+end 

Added: MacRuby/branches/experimental/spec/frozen/core/numeric/modulo_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/numeric/modulo_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/numeric/modulo_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Numeric#modulo" do 
+  it "returns the result of calling self#% with other" do
+    obj = NumericSub.new
+    obj.should_receive(:%).with(20).and_return(:result)
+    
+    obj.modulo(20).should == :result
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/numeric/nonzero_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/numeric/nonzero_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/numeric/nonzero_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Numeric#nonzero?" do 
+  before(:each) do
+    @obj = NumericSub.new
+  end
+  
+  it "returns self if self#zero? is false" do
+    @obj.should_receive(:zero?).and_return(false)
+    @obj.nonzero?.should == @obj
+  end
+  
+  it "returns nil if self#zero? is true" do
+    @obj.should_receive(:zero?).and_return(true)
+    @obj.nonzero?.should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/numeric/quo_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/numeric/quo_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/numeric/quo_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Numeric#quo" do
+  it "returns the result of calling self#/ with other" do
+    obj = NumericSub.new
+    obj.should_receive(:/).with(19).and_return(:result)
+    
+    obj.quo(19).should == :result
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/numeric/remainder_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/numeric/remainder_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/numeric/remainder_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,67 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Numeric#remainder" do
+  before(:each) do
+    @obj    = NumericSub.new
+    @result = mock("Numeric#% result")
+    @other  = mock("Passed Object")
+  end
+
+  it "returns the result of calling self#% with other if self is 0" do
+    @obj.should_receive(:%).with(@other).and_return(@result)
+    @result.should_receive(:==).with(0).and_return(true)
+    
+    @obj.remainder(@other).should equal(@result)
+  end
+
+  it "returns the result of calling self#% with other if self and other are greater than 0" do
+    @obj.should_receive(:%).with(@other).and_return(@result)
+    @result.should_receive(:==).with(0).and_return(false)
+
+    @obj.should_receive(:<).with(0).and_return(false)
+
+    @obj.should_receive(:>).with(0).and_return(true)
+    @other.should_receive(:<).with(0).and_return(false)
+    
+    @obj.remainder(@other).should equal(@result)
+  end
+
+  it "returns the result of calling self#% with other if self and other are less than 0" do
+    @obj.should_receive(:%).with(@other).and_return(@result)
+    @result.should_receive(:==).with(0).and_return(false)
+
+    @obj.should_receive(:<).with(0).and_return(true)
+    @other.should_receive(:>).with(0).and_return(false)
+
+    @obj.should_receive(:>).with(0).and_return(false)
+    
+    @obj.remainder(@other).should equal(@result)
+  end
+
+  it "returns the result of calling self#% with other - other if self is greater than 0 and other is less than 0" do
+    @obj.should_receive(:%).with(@other).and_return(@result)
+    @result.should_receive(:==).with(0).and_return(false)
+
+    @obj.should_receive(:<).with(0).and_return(false)
+    
+    @obj.should_receive(:>).with(0).and_return(true)
+    @other.should_receive(:<).with(0).and_return(true)
+    
+    @result.should_receive(:-).with(@other).and_return(:result)
+    
+    @obj.remainder(@other).should == :result
+  end
+
+  it "returns the result of calling self#% with other - other if self is less than 0 and other is greater than 0" do
+    @obj.should_receive(:%).with(@other).and_return(@result)
+    @result.should_receive(:==).with(0).and_return(false)
+
+    @obj.should_receive(:<).with(0).and_return(true)
+    @other.should_receive(:>).with(0).and_return(true)
+    
+    @result.should_receive(:-).with(@other).and_return(:result)
+    
+    @obj.remainder(@other).should == :result
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/numeric/round_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/numeric/round_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/numeric/round_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Numeric#round" do  
+  before(:each) do
+    @obj = NumericSub.new
+  end
+  
+  it "converts self to a Float (using #to_f) and returns the #round'ed result" do
+    @obj.should_receive(:to_f).and_return(2 - TOLERANCE, TOLERANCE - 2)
+    @obj.round.should == 2
+    @obj.round.should == -2
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/numeric/singleton_method_added_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/numeric/singleton_method_added_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/numeric/singleton_method_added_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,41 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Numeric#singleton_method_added" do
+  before(:all) do
+    class ::NumericSub
+      # We want restore default Numeric behaviour for this particular test
+      remove_method :singleton_method_added
+    end
+  end
+  
+  after(:all) do
+    class ::NumericSub
+      # Allow mocking methods again
+      def singleton_method_added(val)
+      end
+    end
+  end
+  
+  it "raises a TypeError when trying to define a singleton method on a Numeric" do
+    lambda do
+      a = NumericSub.new
+      def a.test; end
+    end.should raise_error(TypeError)
+    
+    lambda do
+      a = 1
+      def a.test; end
+    end.should raise_error(TypeError)
+
+    lambda do
+      a = 1.5
+      def a.test; end
+    end.should raise_error(TypeError)
+
+    lambda do
+      a = bignum_value
+      def a.test; end
+    end.should raise_error(TypeError)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/numeric/step_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/numeric/step_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/numeric/step_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,191 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Numeric#step with [stop, step]" do
+  before(:each) do
+    @obj = NumericSub.new
+  end
+  
+  it "raises an ArgumentError when step is 0" do
+    lambda { @obj.step(5, 0) {} }.should raise_error(ArgumentError)
+  end
+  
+  ruby_version_is "" ... "1.8.7" do
+    it "raises no LocalJumpError when passed no block and self > stop" do
+      @stop = mock("Stop value")
+      @step = mock("Step value")
+      @step.should_receive(:>).with(0).and_return(true)
+      
+      @obj.should_receive(:>).with(@stop).and_return(true)
+      
+      lambda { @obj.step(@stop, @step) }.should_not raise_error(LocalJumpError)
+    end
+
+    it "raises a LocalJumpError when passed no block and self < stop" do
+      @stop = mock("Stop value")
+      @step = mock("Step value")
+      @step.should_receive(:>).with(0).and_return(true)
+      
+      @obj.should_receive(:>).with(@stop).and_return(false)
+      
+      lambda { @obj.step(@stop, @step) }.should raise_error(LocalJumpError)
+    end
+  end
+
+  ruby_version_is "1.8.7" do
+    it "returns an Enumerator when passed no block and self > stop" do
+      @stop = mock("Stop value")
+      @step = mock("Step value")
+      
+      @obj.step(@stop, @step).should be_kind_of(Enumerable::Enumerator)
+    end
+
+    it "returns an Enumerator when passed no block and self < stop" do
+      @stop = mock("Stop value")
+      @step = mock("Step value")
+      
+      @obj.step(@stop, @step).should be_kind_of(Enumerable::Enumerator)
+    end
+  end
+  
+  it "increments self (using #+) until self > stop when step > 0" do
+    values = []
+    
+    @stop = mock("Stop value")
+    @step = mock("Step value")
+    @step.should_receive(:>).with(0).and_return(true)
+    
+    # Stepping 3 times
+    @obj.should_receive(:>).with(@stop).and_return(false, false, false, true)
+    @obj.should_receive(:+).with(@step).and_return(@obj, @obj, @obj)
+    
+    @obj.step(@stop, @step) { |i| values << i }
+    
+    values.should == [@obj, @obj, @obj]
+  end
+  
+  it "decrements self (using #-) until self < stop when step < 0" do
+    values = []
+    
+    @stop = mock("Stop value")
+    @step = mock("Step value")
+    @step.should_receive(:>).with(0).and_return(false)
+    
+    # Stepping 3 times
+    @obj.should_receive(:<).with(@stop).and_return(false, false, false, true)
+    # Calling #+ with negative step decrements self
+    @obj.should_receive(:+).with(@step).and_return(@obj, @obj, @obj)
+    
+    @obj.step(@stop, @step) { |i| values << i }
+    
+    values.should == [@obj, @obj, @obj]
+  end
+end
+
+describe "Numeric#step with [stop, step] when self, stop and step are Fixnums" do
+  it "raises an ArgumentError when step is 0" do
+    lambda { 1.step(5, 0) {} }.should raise_error(ArgumentError)
+  end
+
+  it "yields only Fixnums" do
+    1.step(5, 1) { |x| x.should be_kind_of(Fixnum) }
+  end
+  
+  it "defaults to step = 1" do
+    result = []
+    1.step(5) { |x| result << x }
+    result.should == [1, 2, 3, 4, 5]
+  end
+end
+
+describe "Numeric#step with [stop, +step] when self, stop and step are Fixnums" do
+  it "yields while increasing self by step until stop is reached" do
+    result = []
+    1.step(5, 1) { |x| result << x }
+    result.should == [1, 2, 3, 4, 5]
+  end
+
+  it "yields once when self equals stop" do
+    result = []
+    1.step(1, 1) { |x| result << x }
+    result.should == [1]
+  end
+
+  it "does not yield when self is greater than stop" do
+    result = []
+    2.step(1, 1) { |x| result << x }
+    result.should == []
+  end
+end
+  
+describe "Numeric#step with [stop, -step] when self, stop and step are Fixnums" do
+  it "yields while decreasing self by step until stop is reached" do
+    result = []
+    5.step(1, -1) { |x| result << x }
+    result.should == [5, 4, 3, 2, 1]
+  end
+
+  it "yields once when self equals stop" do
+    result = []
+    5.step(5, -1) { |x| result << x }
+    result.should == [5]
+  end
+
+  it "does not yield when self is less than stop" do
+    result = []
+    1.step(5, -1) { |x| result << x }
+    result.should == []
+  end
+end
+
+describe "Numeric#step with [stop, step] when self, stop or step is a Float" do
+  it "raises an ArgumentError when step is 0" do
+    lambda { 1.1.step(2, 0.0) {} }.should raise_error(ArgumentError)
+  end
+  
+  it "yields only Floats" do
+    1.5.step(5, 1) { |x| x.should be_kind_of(Float) }
+    1.step(5.0, 1) { |x| x.should be_kind_of(Float) }
+    1.step(5, 1.0) { |x| x.should be_kind_of(Float) }
+  end
+end
+
+describe "Numeric#step with [stop, +step] when self, stop or step is a Float" do
+  it "yields while increasing self by step until stop is reached" do
+    result = []
+    1.5.step(5, 1) { |x| result << x }
+    result.should == [1.5, 2.5, 3.5, 4.5]
+  end
+
+  it "yields once when self equals stop" do
+    result = []
+    1.5.step(1.5, 1) { |x| result << x }
+    result.should == [1.5]
+  end
+
+  it "does not yield when self is greater than stop" do
+    result = []
+    2.5.step(1.5, 1) { |x| result << x }
+    result.should == []
+  end
+end
+
+describe "Numeric#step with [stop, -step] when self, stop or step is a Float" do
+  it "yields while decreasing self by step until stop is reached" do
+    result = []
+    5.step(1.5, -1) { |x| result << x }
+    result.should == [5.0, 4.0, 3.0, 2.0]
+  end
+
+  it "yields once when self equals stop" do
+    result = []
+    1.5.step(1.5, -1) { |x| result << x }
+    result.should == [1.5]
+  end
+
+  it "does not yield when self is less than stop" do
+    result = []
+    1.step(5, -1.5) { |x| result << x }
+    result.should == []
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/numeric/to_int_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/numeric/to_int_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/numeric/to_int_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Numeric#to_int" do  
+  it "returns self#to_i" do
+    obj = NumericSub.new
+    obj.should_receive(:to_i).and_return(:result)
+    obj.to_int.should == :result
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/numeric/truncate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/numeric/truncate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/numeric/truncate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Numeric#truncate" do
+  before(:each) do
+    @obj = NumericSub.new
+  end
+  
+  it "converts self to a Float (using #to_f) and returns the #truncate'd result" do
+    @obj.should_receive(:to_f).and_return(2.5555, -2.3333)
+    @obj.truncate.should == 2
+    @obj.truncate.should == -2
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/numeric/uminus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/numeric/uminus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/numeric/uminus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Numeric#-@" do    
+  it " should return the same value with opposite sign (integers)" do 
+    0.send(:-@).should == 0
+    100.send(:-@).should == -100
+    -100.send(:-@).should == 100 
+  end  
+
+  it " should return the same value with opposite sign (floats)" do 
+    34.56.send(:-@).should == -34.56
+    -34.56.send(:-@).should == 34.56
+  end   
+
+  it " should return the same value with opposite sign (two complement)" do 
+    2147483648.send(:-@).should == -2147483648
+    -2147483648.send(:-@).should == 2147483648
+    9223372036854775808.send(:-@).should == -9223372036854775808
+    -9223372036854775808.send(:-@).should == 9223372036854775808
+  end  
+end

Added: MacRuby/branches/experimental/spec/frozen/core/numeric/uplus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/numeric/uplus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/numeric/uplus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Numeric#+@" do    
+  it "returns self" do
+    obj = NumericSub.new
+    obj.send(:+@).should == obj
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/numeric/zero_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/numeric/zero_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/numeric/zero_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Numeric#zero?" do
+  before(:each) do
+    @obj = NumericSub.new
+  end
+  
+  it "returns true if self is 0" do
+    @obj.should_receive(:==).with(0).and_return(true)
+    @obj.zero?.should == true
+  end
+  
+  it "returns false if self is not 0" do
+    @obj.should_receive(:==).with(0).and_return(false)
+    @obj.zero?.should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/object/clone_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/object/clone_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/object/clone_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/dup_clone'
+
+describe "Object#clone" do
+  it_behaves_like :object_dup_clone, :clone
+
+  it "preserves frozen state from the original" do
+    o = ObjectSpecDupInitCopy.new
+    o2 = o.clone
+    o.freeze
+    o3 = o.clone
+
+    o2.frozen?.should == false
+    o3.frozen?.should == true
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/object/dup_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/object/dup_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/object/dup_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/dup_clone'
+
+describe "Object#dup" do
+  it_behaves_like :object_dup_clone, :dup
+
+  it "does not preserve frozen state from the original" do
+    o = ObjectSpecDupInitCopy.new
+    o.freeze
+    o2 = o.dup
+
+    o2.frozen?.should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/object/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/object/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/object/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/object/instance_of_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/object/instance_of_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/object/instance_of_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,53 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+module ObjectSpecs
+  module SomeOtherModule; end
+  module AncestorModule; end
+  module MyModule; end
+
+  class AncestorClass < String 
+    include AncestorModule 
+  end
+
+  class InstanceClass < AncestorClass
+    include MyModule
+  end
+end
+
+describe Object, "#instance_of?" do
+  before(:each) do
+    @o = ObjectSpecs::InstanceClass.new
+  end
+
+  it "returns true if given class is object's class" do
+    @o.instance_of?(ObjectSpecs::InstanceClass).should == true 
+    [].instance_of?(Array).should == true 
+    ''.instance_of?(String).should == true 
+  end
+
+  it "returns false if given class is object's ancestor class" do
+    @o.instance_of?(ObjectSpecs::AncestorClass).should == false
+  end
+
+  it "returns false if given class is not object's class nor object's ancestor class" do
+    @o.instance_of?(Array).should == false
+  end
+
+  it "returns false if given a Module that is included in object's class" do
+    @o.instance_of?(ObjectSpecs::MyModule).should == false
+  end
+
+  it "returns false if given a Module that is included one of object's ancestors only" do
+    @o.instance_of?(ObjectSpecs::AncestorModule).should == false
+  end
+
+  it "returns false if given a Module that is not included in object's class" do
+    @o.instance_of?(ObjectSpecs::SomeOtherModule).should == false
+  end
+
+  it "raises a TypeError if given an object that is not a Class nor a Module" do
+    lambda { @o.instance_of?(Object.new) }.should raise_error(TypeError)
+    lambda { @o.instance_of?('ObjectSpecs::InstanceClass') }.should raise_error(TypeError)
+    lambda { @o.instance_of?(1) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/object/is_a_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/object/is_a_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/object/is_a_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/kind_of'
+
+describe "Object#is_a?" do
+  it_behaves_like(:object_kind_of , :is_a?)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/object/kind_of_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/object/kind_of_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/object/kind_of_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/kind_of'
+
+describe "Object#kind_of?" do
+  it_behaves_like(:object_kind_of , :kind_of?)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/object/match_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/object/match_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/object/match_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe Object, '=~' do
+  it 'returns false matching any object' do
+    o = Object.new
+
+    (o =~ /Object/).should == false
+    (o =~ 'Object').should == false
+    (o =~ Object).should == false
+    (o =~ Object.new).should == false
+    (o =~ nil).should == false
+    (o =~ true).should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/object/metaclass_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/object/metaclass_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/object/metaclass_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+
+describe "Object#metaclass" do
+  it "returns the object's metaclass" do
+    foo = "foo"
+    foo.instance_eval "class << self; def meta_test_method; 5; end; end"
+    foo.respond_to?(:meta_test_method).should == true
+    lambda { "hello".metaclass.method(:meta_test_method) }.should raise_error(NameError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/object/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/object/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/object/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Object.new" do
+  it "creates a new Object" do
+    Object.new.class.should == Object
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/object/shared/dup_clone.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/object/shared/dup_clone.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/object/shared/dup_clone.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,76 @@
+class ObjectSpecDup
+  def initialize()
+    @obj = :original
+  end
+
+  attr_accessor :obj
+end
+
+class ObjectSpecDupInitCopy
+  def initialize()
+    @obj = :original
+  end
+
+  attr_accessor :obj, :original
+
+  def initialize_copy(original)
+    @obj = :init_copy
+    @original = original
+  end
+
+  private :initialize_copy
+end
+
+describe :object_dup_clone, :shared => true do
+  it "returns a new object duplicated from the original" do
+    o = ObjectSpecDup.new
+    o2 = ObjectSpecDup.new
+
+    o.obj = 10
+
+    o3 = o.send(@method)
+
+    o3.obj.should == 10
+    o2.obj.should == :original
+  end
+
+  it "produces a shallow copy, contained objects are not recursively dupped" do
+    o = ObjectSpecDup.new
+    array = [1, 2]
+    o.obj = array
+
+    o2 = o.send(@method)
+    o2.obj.should equal(o.obj)
+  end
+
+  it "calls #initialize_copy on the NEW object if available, passing in original object" do
+    o = ObjectSpecDupInitCopy.new
+    o2 = o.send(@method)
+
+    o.obj.should == :original
+    o2.obj.should == :init_copy
+    o2.original.should equal(o)
+  end
+
+  it "preserves tainted state from the original" do
+    o = ObjectSpecDupInitCopy.new
+    o2 = o.send(@method)
+    o.taint
+    o3 = o.send(@method)
+
+    o2.tainted?.should == false
+    o3.tainted?.should == true
+  end
+
+  ruby_version_is "1.9" do
+    it "preserves untrusted state from the original" do
+      o = ObjectSpecDupInitCopy.new
+      o2 = o.send(@method)
+      o.untrust
+      o3 = o.send(@method)
+
+      o2.untrusted?.should == false
+      o3.untrusted?.should == true
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/object/shared/kind_of.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/object/shared/kind_of.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/object/shared/kind_of.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,60 @@
+module ObjectSpecs
+  module SomeOtherModule; end
+  module AncestorModule; end
+  module MyModule; end
+  module MyExtensionModule; end
+
+  class AncestorClass < String 
+    include AncestorModule 
+  end
+
+  class KindaClass < AncestorClass
+    include MyModule
+    def initialize
+      self.extend MyExtensionModule
+    end
+  end
+end
+
+describe :object_kind_of, :shared => true do
+  before(:each) do
+    @o = ObjectSpecs::KindaClass.new
+  end
+
+  it "returns true if given class is the object's class" do
+    @o.send(@method, ObjectSpecs::KindaClass).should == true
+  end
+
+  it "returns true if given class is an ancestor of the object's class" do
+    @o.send(@method, ObjectSpecs::AncestorClass).should == true
+    @o.send(@method, String).should == true
+    @o.send(@method, Object).should == true
+  end
+
+  it "returns false if the given class is not object's class nor an ancestor" do
+    @o.send(@method, Array).should == false
+  end
+
+  it "returns true if given a Module that is included in object's class" do
+    @o.send(@method, ObjectSpecs::MyModule).should == true
+  end
+
+  it "returns true if given a Module that is included one of object's ancestors only" do
+    @o.send(@method, ObjectSpecs::AncestorModule).should == true
+  end
+  
+  it "returns true if given a Module that object has been extended with" do
+    @o.send(@method, ObjectSpecs::MyExtensionModule).should == true
+  end
+
+  it "returns false if given a Module not included in object's class nor ancestors" do
+    @o.send(@method, ObjectSpecs::SomeOtherModule).should == false
+  end
+
+  it "raises a TypeError if given an object that is not a Class nor a Module" do
+    lambda { @o.send(@method, 1) }.should raise_error(TypeError)
+    lambda { @o.send(@method, 'KindaClass') }.should raise_error(TypeError)
+    lambda { @o.send(@method, :KindaClass) }.should raise_error(TypeError)
+    lambda { @o.send(@method, Object.new) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/objectspace/_id2ref_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/objectspace/_id2ref_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/objectspace/_id2ref_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ObjectSpace._id2ref" do
+  it "converts an object id to a reference to the object" do
+    s = "I am a string"
+    r = ObjectSpace._id2ref(s.object_id)
+    r.should == s
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/objectspace/add_finalizer_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/objectspace/add_finalizer_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/objectspace/add_finalizer_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/objectspace/call_finalizer_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/objectspace/call_finalizer_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/objectspace/call_finalizer_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/objectspace/define_finalizer_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/objectspace/define_finalizer_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/objectspace/define_finalizer_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures'
+
+# NOTE: A call to define_finalizer does not guarantee that the
+# passed proc or callable will be called at any particular time.
+# It is highly questionable whether these aspects of ObjectSpace
+# should be spec'd at all.
+describe "ObjectSpace.define_finalizer" do
+  it "raises an ArgumentError if the action does not respond to call" do
+    lambda { 
+      ObjectSpace.define_finalizer("", 3)
+    }.should raise_error(ArgumentError)
+  end
+
+  it "accepts an object and a proc" do
+    handler = lambda { |obj| obj }
+    ObjectSpace.define_finalizer("garbage", handler).should == [0, handler]
+  end
+
+  it "accepts an object and a callable" do
+    handler = mock("callable")
+    def handler.call(obj) end
+    ObjectSpace.define_finalizer("garbage", handler).should == [0, handler]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/objectspace/each_object_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/objectspace/each_object_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/objectspace/each_object_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ObjectSpace.each_object" do
+  it "calls the block once for each living, nonimmediate object in the Ruby process" do
+    class ObjectSpaceSpecEachObject; end
+    new_obj = ObjectSpaceSpecEachObject.new
+
+    count = ObjectSpace.each_object(ObjectSpaceSpecEachObject) {}
+    count.should == 1
+    # this is needed to prevent the new_obj from being GC'd too early
+    new_obj.should_not == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/objectspace/finalizers_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/objectspace/finalizers_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/objectspace/finalizers_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/objectspace/fixtures.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/objectspace/fixtures.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/objectspace/fixtures.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,30 @@
+module ObjectSpaceFixtures
+  def self.garbage
+    blah
+  end
+
+  def self.blah
+    o = "hello"
+    @garbage_objid = o.object_id
+    return o
+  end
+
+  @last_objid = nil
+
+  def self.last_objid
+    @last_objid
+  end
+
+  def self.garbage_objid
+    @garbage_objid
+  end
+
+  def self.make_finalizer
+    proc { |obj_id| @last_objid = obj_id }
+  end
+
+  def self.define_finalizer
+    handler = lambda { |obj| ScratchPad.record :finalized }
+    ObjectSpace.define_finalizer "#{rand 5}", handler
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/objectspace/garbage_collect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/objectspace/garbage_collect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/objectspace/garbage_collect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/objectspace/remove_finalizer_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/objectspace/remove_finalizer_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/objectspace/remove_finalizer_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/objectspace/undefine_finalizer_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/objectspace/undefine_finalizer_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/objectspace/undefine_finalizer_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/precision/included_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/precision/included_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/precision/included_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Precision.included" do
+  it "raises a TypeError when a class mixed with Precision does not specify induced_from" do
+    class Foo ;include Precision ;end
+    lambda { Foo.induced_from(1) }.should raise_error(TypeError)
+  end
+
+  it "doesn't raise a TypeError when a class mixed with Precision specifies induced_from" do
+    class Foo
+      include Precision
+      def self.induced_from(obj)
+        # nothing
+      end
+    end
+    lambda { Foo.induced_from(1) }.should_not raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/precision/prec_f_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/precision/prec_f_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/precision/prec_f_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Precision#prec_f" do
+  it "converts a Integer to Float when called on an Integer" do
+    1.prec_f.should==1.0
+  end
+
+  it "returns the same Float when called on a Float" do
+    1.9.prec_f.should==1.9
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/precision/prec_i_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/precision/prec_i_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/precision/prec_i_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Precision#prec_i" do
+  it "returns the same Integer when called on an Integer"  do
+    1.prec_i.should == 1
+  end
+
+  it "converts Float to an Integer when called on an Integer" do
+    1.9.prec_i.should == 1
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/precision/prec_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/precision/prec_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/precision/prec_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Float#prec" do
+  it "returns the same Float when given the class Float" do
+    1.4.prec(Float).should == 1.4
+  end
+
+  it "converts the Float to an Integer when given the class Integer" do
+    1.4.prec(Integer).should == 1
+  end
+end
+
+describe "Integer#prec" do
+  it "returns the same Integer when given the class Integer" do
+    1.prec(Integer).should == 1
+  end
+
+  it "converts the Integer to Float when given the class Float" do
+    1.prec(Float).should == 1.0
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/proc/arity_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/proc/arity_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/proc/arity_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,57 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Proc#arity" do
+  it "returns the number of arguments, using Proc.new" do
+    Proc.new { || }.arity.should == 0
+    Proc.new { |a| }.arity.should == 1
+    Proc.new { |_| }.arity.should == 1
+    Proc.new { |a, b| }.arity.should == 2
+    Proc.new { |a, b, c| }.arity.should == 3
+  end
+  
+  it "returns the number of arguments, using Kernel#lambda" do
+    lambda { || }.arity.should == 0
+    lambda { |a| }.arity.should == 1
+    lambda { |_| }.arity.should == 1
+    lambda { |a, b| }.arity.should == 2
+    lambda { |a, b, c| }.arity.should == 3
+  end
+  
+  it "return the number of arguments, using Kernel#proc" do
+    proc { || }.arity.should == 0
+    proc { |a| }.arity.should == 1
+    proc { |_| }.arity.should == 1
+    proc { |a, b| }.arity.should == 2
+    proc { |a, b, c| }.arity.should == 3
+  end
+  
+  it "if optional arguments, return the negative number of mandatory arguments using Proc.new " do
+    Proc.new { |*a| }.arity.should == -1
+    Proc.new { |a, *b| }.arity.should == -2
+    Proc.new { |a, b, *c| }.arity.should == -3
+  end
+  
+  it "if optional arguments, return the negative number of mandatory arguments using Kernel#lambda" do
+    lambda { |*a| }.arity.should == -1
+    lambda { |a, *b| }.arity.should == -2
+    lambda { |a, b, *c| }.arity.should == -3
+  end
+  
+  it "if optional arguments, return the negative number of mandatory arguments using Kernel#proc" do
+    proc { |*a| }.arity.should == -1
+    proc { |a, *b| }.arity.should == -2
+    proc { |a, b, *c| }.arity.should == -3
+  end
+  
+  it "returns -1 if no argument declaration is made, using Proc.new" do
+    Proc.new { }.arity.should == -1
+  end
+  
+  it "returns -1 if no argument declaration is made, using Kernel#lambda" do
+    lambda { }.arity.should == -1
+  end
+  
+  it "returns -1 if no argument declaration is made, using Kernel#proc" do
+    proc { }.arity.should == -1
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/proc/binding_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/proc/binding_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/proc/binding_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Proc#binding" do
+  it "returns a Binding instance" do
+    [Proc.new{}, lambda {}, proc {}].each { |p|
+      p.binding.class.should == Binding
+    }
+  end
+
+  it "returns the binding associated wiht self" do
+    obj = mock('binding')
+    def obj.test_binding(some, params)
+      lambda {}
+    end
+
+    lambdas_binding = obj.test_binding(1, 2).binding
+
+    eval("some", lambdas_binding).should == 1
+    eval("params", lambdas_binding).should == 2
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/proc/block_pass_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/proc/block_pass_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/proc/block_pass_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Proc as a block pass argument" do
+  def revivify(&b)
+    b
+  end
+
+  it "remains the same object if re-vivified by the target method" do
+    p = Proc.new {}
+    p2 = revivify(&p)
+    p.object_id.should == p2.object_id
+    p.should == p2
+  end
+
+  it "remains the same object if reconstructed with Proc.new" do
+    p = Proc.new {}
+    p2 = Proc.new(&p)
+    p.object_id.should == p2.object_id
+    p.should == p2
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/proc/call_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/proc/call_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/proc/call_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/call'
+
+describe "Proc#call" do
+  it_behaves_like :proc_call, :call
+end
+
+describe "Proc#call on a Proc created with Proc.new" do
+  it_behaves_like :proc_call_on_proc_new, :call
+end
+
+describe "Proc#call on a Proc created with Kernel#lambda or Kernel#proc" do
+  it_behaves_like :proc_call_on_proc_or_lambda, :call
+end

Added: MacRuby/branches/experimental/spec/frozen/core/proc/clone_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/proc/clone_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/proc/clone_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/dup'
+
+describe "Proc#clone" do
+  it_behaves_like(:proc_dup, :clone)
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/proc/dup_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/proc/dup_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/proc/dup_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/dup'
+
+describe "Proc#dup" do
+  it_behaves_like(:proc_dup, :dup)
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/proc/element_reference_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/proc/element_reference_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/proc/element_reference_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/call'
+
+describe "Proc#[]" do
+  it_behaves_like :proc_call, :[]
+end
+
+describe "Proc#call on a Proc created with Proc.new" do
+  it_behaves_like :proc_call_on_proc_new, :call
+end
+
+describe "Proc#call on a Proc created with Kernel#lambda or Kernel#proc" do
+  it_behaves_like :proc_call_on_proc_or_lambda, :call
+end

Added: MacRuby/branches/experimental/spec/frozen/core/proc/equal_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/proc/equal_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/proc/equal_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Proc#==" do
+  it "returns true when the given value is self or a copy of self" do
+    a = lambda { "hello" }
+    
+    a.should == a
+    a.should == a.dup
+    
+    a.should_not == lambda { "hello" }
+    a.should_not == Proc.new {}
+    a.should_not == nil
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/proc/fixtures/procs.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/proc/fixtures/procs.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/proc/fixtures/procs.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+module ProcSpecs
+  def self.new_proc_in_method
+    Proc.new
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/proc/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/proc/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/proc/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,45 @@
+require File.dirname(__FILE__) + '/fixtures/procs.rb'
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Proc.new with an associated block" do
+  it "returns a proc that represents the block" do
+    Proc.new { }.call.should == nil
+    Proc.new { "hello" }.call.should == "hello"
+  end
+
+  it "raises a LocalJumpError when context of the block no longer exists" do
+    def some_method(&b) b end
+    a_proc = Proc.new { return } 
+    res = some_method(&a_proc)
+
+    lambda { res.call }.should raise_error(LocalJumpError)
+  end
+
+  it "returns from within enclosing method when 'return' is used in the block" do
+    # we essentially verify that the created instance behaves like proc,
+    # not like lambda.
+    def some_method
+      Proc.new { return :proc_return_value }.call
+      :method_return_value
+    end
+    some_method.should == :proc_return_value
+  end
+
+end
+
+describe "Proc.new without a block" do
+  it "raises an ArgumentError" do
+    lambda { Proc.new }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError if invoked from within a method with no block" do
+    lambda {
+      ProcSpecs.new_proc_in_method
+    }.should raise_error(ArgumentError)
+  end
+
+  it "returns a new Proc instance from the block passed to the containing method" do
+    ProcSpecs.new_proc_in_method { "hello" }.call.should == "hello"
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/proc/shared/call.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/proc/shared/call.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/proc/shared/call.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,81 @@
+describe :proc_call, :shared => true do
+  it "invokes self" do
+    Proc.new { "test!" }.send(@method).should == "test!"
+    lambda { "test!" }.send(@method).should == "test!"
+    proc { "test!" }.send(@method).should == "test!"
+  end
+  
+  it "sets self's parameters to the given values" do
+    Proc.new { |a, b| a + b }.send(@method, 1, 2).should == 3
+    Proc.new { |*args| args }.send(@method, 1, 2, 3, 4).should == [1, 2, 3, 4]
+    Proc.new { |_, *args| args }.send(@method, 1, 2, 3).should == [2, 3]
+    
+    lambda { |a, b| a + b }.send(@method, 1, 2).should == 3
+    lambda { |*args| args }.send(@method, 1, 2, 3, 4).should == [1, 2, 3, 4]
+    lambda { |_, *args| args }.send(@method, 1, 2, 3).should == [2, 3]
+
+    proc { |a, b| a + b }.send(@method, 1, 2).should == 3
+    proc { |*args| args }.send(@method, 1, 2, 3, 4).should == [1, 2, 3, 4]
+    proc { |_, *args| args }.send(@method, 1, 2, 3).should == [2, 3]
+  end
+  
+  it "sets self's single parameter to an Array of all given values" do
+    [Proc.new { |x| [x] }, lambda { |x| [x] }, proc { |x| [x] }].each do |p|
+      a = p.send(@method)
+      a.class.should == Array
+      a.should == [nil]
+      
+      a = p.send(@method, 1)
+      a.class.should == Array
+      a.should == [1]
+      
+      a = p.send(@method, 1, 2)
+      a.class.should == Array
+      a.should == [[1, 2]]
+      
+      a = p.send(@method, 1, 2, 3)
+      a.class.should == Array
+      a.should == [[1, 2, 3]]
+    end
+  end
+end
+
+describe :proc_call_on_proc_new, :shared => true do
+  it "replaces missing arguments with nil" do
+    Proc.new { |a, b| [a, b] }.send(@method).should == [nil, nil]
+    Proc.new { |a, b| [a, b] }.send(@method, 1).should == [1, nil]
+  end
+
+  it "silently ignores extra arguments" do
+    Proc.new { |a, b| a + b }.send(@method, 1, 2, 5).should == 3
+  end
+
+  it "auto-explodes a single Array argument" do
+    p = Proc.new { |a, b| [a, b] }
+    p.send(@method, 1, 2).should == [1, 2]
+    p.send(@method, [1, 2]).should == [1, 2]
+    p.send(@method, [1, 2, 3]).should == [1, 2]
+    p.send(@method, [1, 2, 3], 4).should == [[1, 2, 3], 4]
+  end
+end
+
+describe :proc_call_on_proc_or_lambda, :shared => true do
+  it "raises an ArgumentError when called with too few arguments" do
+    lambda { lambda { |a, b| [a, b] }.send(@method)    }.should raise_error(ArgumentError)
+    lambda { lambda { |a, b| [a, b] }.send(@method, 1) }.should raise_error(ArgumentError)
+    lambda { proc { |a, b| [a, b] }.send(@method)      }.should raise_error(ArgumentError)
+    lambda { proc { |a, b| [a, b] }.send(@method, 1)   }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError when called with too many arguments" do
+    lambda { lambda { |a, b| [a, b] }.send(@method, 1, 2, 3) }.should raise_error(ArgumentError)
+    lambda { proc { |a, b| [a, b] }.send(@method, 1, 2, 3)   }.should raise_error(ArgumentError)
+  end
+
+  it "treats a single Array argument as a single argument" do
+    lambda { |a| [a] }.send(@method, [1, 2]).should == [[1, 2]]
+    lambda { lambda { |a, b| [a, b] }.send(@method, [1, 2]) }.should raise_error(ArgumentError)
+    proc { |a| [a] }.send(@method, [1, 2]).should == [[1, 2]]
+    lambda { proc { |a, b| [a, b] }.send(@method, [1, 2]) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/proc/shared/dup.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/proc/shared/dup.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/proc/shared/dup.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+describe :proc_dup, :shared => true do
+  it "returns a copy of self" do
+    a = lambda { "hello" }
+    b = a.send(@method)
+
+    a.should_not equal(b)
+
+    a.call.should == b.call
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/proc/to_proc_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/proc/to_proc_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/proc/to_proc_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Proc#to_proc" do
+  it "returns self" do
+    [Proc.new {}, lambda {}, proc {}].each { |p|
+      p.to_proc.should equal(p)
+    }
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/proc/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/proc/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/proc/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Proc#to_s" do
+  it "returns a description of self" do
+    Proc.new { "hello" }.to_s.should =~ /^#<Proc:(.*?)@(.*)\/to_s_spec\.rb:5>$/
+    lambda { "hello" }.to_s.should =~ /^#<Proc:(.*?)@(.*)\/to_s_spec\.rb:6>$/
+    proc { "hello" }.to_s.should =~ /^#<Proc:(.*?)@(.*)\/to_s_spec\.rb:7>$/
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/process/abort_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/abort_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/abort_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+# TODO: share with Kernel.abort, abort.
+describe "Process.abort" do
+  platform_is_not :windows do
+    it "terminates execution immediately" do
+      @file = '/tmp/i_exist'
+      File.delete(@file) if File.exist?(@file)
+      pid = Process.fork {
+        Process.abort
+        File.open(@file,'w'){|f| f.write 'rubinius'}
+      }
+      File.exist?(@file).should == false
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/process/constants_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/constants_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/constants_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,63 @@
+
+describe "Process::Constants" do
+  platform_is :os => [:darwin, :netbsd, :freebsd] do
+    it "should have the correct constant values on BSD-like systems" do
+      Process::WNOHANG.should == 1
+      Process::WUNTRACED.should == 2
+      Process::PRIO_PROCESS.should == 0
+      Process::PRIO_PGRP.should == 1
+      Process::PRIO_USER.should == 2
+      Process::RLIM_INFINITY.should == 9223372036854775807
+      Process::RLIMIT_CPU.should == 0
+      Process::RLIMIT_FSIZE.should == 1
+      Process::RLIMIT_DATA.should == 2
+      Process::RLIMIT_STACK.should == 3
+      Process::RLIMIT_CORE.should == 4
+      Process::RLIMIT_RSS.should == 5
+      Process::RLIMIT_MEMLOCK.should == 6
+      Process::RLIMIT_NPROC.should == 7
+      Process::RLIMIT_NOFILE.should == 8
+    end
+  end
+  
+  platform_is :os => [:darwin] do
+    it "should have the correct constant values on Darwin" do
+      Process::RLIM_SAVED_MAX.should == 9223372036854775807
+      Process::RLIM_SAVED_CUR.should == 9223372036854775807
+      Process::RLIMIT_AS.should == 5
+    end 
+  end
+
+  platform_is :os => [:linux] do
+    it "should have the correct constant values on Linux" do
+      Process::WNOHANG.should == 1
+      Process::WUNTRACED.should == 2
+      Process::PRIO_PROCESS.should == 0
+      Process::PRIO_PGRP.should == 1
+      Process::PRIO_USER.should == 2
+      Process::RLIMIT_CPU.should == 0
+      Process::RLIMIT_FSIZE.should == 1
+      Process::RLIMIT_DATA.should == 2
+      Process::RLIMIT_STACK.should == 3
+      Process::RLIMIT_CORE.should == 4
+      Process::RLIMIT_RSS.should == 5
+      Process::RLIMIT_NPROC.should == 6
+      Process::RLIMIT_NOFILE.should == 7
+      Process::RLIMIT_MEMLOCK.should == 8
+      Process::RLIMIT_AS.should == 9
+
+      # These values appear to change according to the platform.
+      values = [9223372036854775807, 18446744073709551615]
+      values.include?(Process::RLIM_INFINITY).should be_true
+      values.include?(Process::RLIM_SAVED_MAX).should be_true
+      values.include?(Process::RLIM_SAVED_CUR).should be_true
+    end
+  end
+
+  platform_is :os => [:netbsd, :freebsd] do
+    it "Process::RLIMIT_SBSIZE" do
+      Process::RLIMIT_SBSIZE.should == 9 # FIXME: what's it equal?
+      Process::RLIMIT_AS.should == 10
+    end 
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/process/detach_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/detach_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/detach_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Process#detach" do
+  platform_is_not :windows do
+    it "requires one argument" do
+      lambda { Process.detach }.should raise_error(ArgumentError)
+    end
+
+    it "returns a thread" do
+      p1 = Process.fork { Process.exit! }
+      Process.detach(p1).class.should == Thread
+    end
+
+    platform_is_not :openbsd do
+      it "reaps the child process's status automatically" do
+        p1 = Process.fork { Process.exit! }
+        Process.detach(p1)
+
+        t = Time.now
+        while true
+          alive = Process.kill(0, p1) rescue nil
+          break unless alive && (Time.now - t < 5) # fail safe
+        end
+        lambda { Process.waitpid(p1) }.should raise_error(Errno::ECHILD)
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/process/egid_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/egid_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/egid_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Process.egid" do
+  it "returns the effective group ID for this process" do
+    Process.egid.class.should == Fixnum
+  end
+
+  it "also goes by Process::GID.eid" do
+    Process::GID.eid.should == Process.egid
+  end
+
+  it "also goes by Process::Sys.getegid" do
+    Process::Sys.getegid.should == Process.egid
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/process/euid_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/euid_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/euid_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Process.euid" do
+  it "returns the effective user ID for this process" do
+    Process.euid.class.should == Fixnum
+  end
+
+  it "also goes by Process::UID.eid" do
+    Process::UID.eid.should == Process.euid
+  end
+
+  it "also goes by Process::Sys.geteuid" do
+    Process::Sys.geteuid.should == Process.euid
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/process/exit_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/exit_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/exit_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/process/fork_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/fork_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/fork_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Process.fork" do
+  not_supported_on :jruby, :windows do
+    before :each do
+      @file = tmp('i_exist')
+      File.delete(@file) if File.exist?(@file)
+    end
+
+    after :each do
+      File.delete(@file) if File.exist?(@file)
+    end
+
+    it "return nil for the child process" do
+      child_id = Process.fork
+      if child_id == nil
+        File.open(@file,'w'){|f| f.write 'rubinius'}
+        Process.exit!
+      else
+        Process.waitpid(child_id)
+      end
+      File.exist?(@file).should == true
+    end
+
+    it "runs a block in a child process" do
+      pid = Process.fork {
+        File.open(@file,'w'){|f| f.write 'rubinius'}
+        Process.exit!
+      }
+      Process.waitpid(pid)
+      File.exist?(@file).should == true
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/process/getpgid_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/getpgid_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/getpgid_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Process.getpgid" do
+  it "requires one argument" do
+    lambda { Process.getpgid }.should raise_error(ArgumentError)
+  end
+
+  platform_is_not :windows do
+    it "returns the process group ID for the given process id" do
+      Process.getpgid(Process.pid).should == Process.getpgrp
+    end
+
+    it "returns the process group ID for the calling process id when passed 0" do
+      Process.getpgid(0).should == Process.getpgrp
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/process/getpgrp_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/getpgrp_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/getpgrp_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+# see setpgrp_spec.rb

Added: MacRuby/branches/experimental/spec/frozen/core/process/getpriority_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/getpriority_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/getpriority_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Process.getpriority" do
+  platform_is_not :windows do
+    it "takes two arguments" do
+      lambda { Process.getpriority }.should raise_error(ArgumentError)
+      lambda {
+        Process.getpriority(Process::PRIO_PROCESS)
+      }.should raise_error(ArgumentError)
+    end
+
+    it "gets the scheduling priority for a specified process" do
+      Process.getpriority(Process::PRIO_PROCESS, 0).class.should == Fixnum
+    end
+
+    it "gets the scheduling priority for a specified process group" do
+      Process.getpriority(Process::PRIO_PGRP, 0).class.should == Fixnum
+    end
+
+    it "gets the scheduling priority for a specified user" do
+      Process.getpriority(Process::PRIO_USER, 0).class.should == Fixnum
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/process/getrlimit_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/getrlimit_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/getrlimit_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+# see setrlimit_spec.rb

Added: MacRuby/branches/experimental/spec/frozen/core/process/gid_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/gid_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/gid_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Process.gid" do
+  it "returns the correct gid for the user executing this process" do
+     current_gid_according_to_unix = `id -gr`.to_i
+     Process.gid.should == current_gid_according_to_unix
+  end
+
+  it "also goes by Process::GID.rid" do
+    Process::GID.rid.should == Process.gid
+  end
+
+  it "also goes by Process::Sys.getgid" do
+    Process::Sys.getgid.should == Process.gid
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/process/groups_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/groups_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/groups_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Process.groups" do
+  platform_is_not :windows do
+    it "takes no arguments" do
+      lambda { Process.groups(1) }.should raise_error(ArgumentError)
+    end
+
+    it "gets an Array of the gids of groups in the supplemental group access list" do
+      groups = `id -G`.scan(/\d+/).map {|i| i.to_i}
+
+      # NOTE: if/when this fails, make sure you are running in the most
+      # basic environment you have available. This spec fails
+      # consistently on me (Ryan Davis) when I'm running the specs
+      # inside a shell inside emacs that was launched by OSX's
+      # windowserver (double click in finder or quicksilver/launchbar
+      # etc). When run any other way the spec passes.
+      Process.groups.uniq.sort.should == groups.uniq.sort
+    end
+
+    # NOTE: This is kind of sketchy.
+    it "sets the list of gids of groups in the supplemental group access list" do
+      groups = Process.groups
+      if Process.uid == 0
+        Process.groups = []
+        Process.groups.should == []
+        Process.groups = groups
+        Process.groups.sort.should == groups.sort
+      else
+        lambda { Process.groups = [] }.should raise_error(Errno::EPERM)
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/process/initgroups_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/initgroups_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/initgroups_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Process.initgroups" do
+  it "requires two arguments" do
+    lambda { Process.initgroups }.should raise_error(ArgumentError)
+    lambda { Process.initgroups("root") }.should raise_error(ArgumentError)
+  end
+
+  platform_is_not :windows do
+    it "initializes the supplemental group access list" do
+      name = `id -un`.strip
+      groups = Process.groups
+      gid = groups.max.to_i + 1
+      augmented_groups = `id -G`.scan(/\d+/).map {|i| i.to_i} << gid
+      if Process.uid == 0
+        Process.groups = []
+        Process.initgroups(name, gid).sort.should == augmented_groups.sort
+        Process.groups.sort.should == augmented_groups.sort
+        Process.groups = groups
+      else
+        lambda { Process.initgroups(name, gid) }.should raise_error(Errno::EPERM)
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/process/kill_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/kill_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/kill_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,138 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+# if run indirectly (eg via CI), kills the runner. TODO: needs guard
+describe "Process.kill" do
+  it "requires at least two arguments" do
+    lambda { Process.kill }.should raise_error(ArgumentError)
+    lambda { Process.kill(0) }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError for unknown signals" do
+    lambda { Process.kill("FOO", 0) }.should raise_error(ArgumentError)
+  end
+
+  it "doesn't accept lowercase signal names" do
+    lambda { Process.kill("hup", 0) }.should raise_error(ArgumentError)
+  end
+
+  it "doesn't tolerate leading or trailing spaces in signal names" do
+    lambda { Process.kill(" HUP", 0) }.should raise_error(ArgumentError)
+    lambda { Process.kill("HUP ", 0) }.should raise_error(ArgumentError)
+  end
+
+  platform_is_not :windows do
+    it "tests for the existence of a process without sending a signal" do
+      Process.kill(0, 0).should == 1
+      pid = Process.fork {
+        begin
+          Signal.trap("HUP") { Process.exit! 99 }
+          sleep(2) # only so that failures are cleaned up
+        ensure
+          Process.exit!
+        end
+      }
+      Process.kill(0, pid).should == 1
+      Process.kill(1, pid).should == 1
+      Process.waitpid(pid)
+      lambda { Process.kill(0, pid) }.should raise_error(Errno::ESRCH)
+    end
+  end
+
+  it "raises an EPERM if permission is denied" do
+    if Process.uid != 0
+      lambda { Process.kill(1, 1) }.should raise_error(Errno::EPERM)
+    end
+  end
+end
+
+describe "Process.kill" do
+  platform_is_not :windows do
+    before :all do
+      @saved_trap = Signal.trap("HUP") {}
+    end
+
+    before :each do
+      @foo = 0
+      @read, @write = IO.pipe
+      Signal.trap("HUP") {
+        @foo = 42
+        @write << "1"
+        @write.close
+      }
+    end
+
+    after :each do
+      @read.gets # the signal handler has run
+      @read.close
+      @foo.should == 42
+    end
+
+    after :all do
+      Signal.trap("HUP", @saved_trap)
+    end
+
+    with_tty do # 0 goes to the entire process group, not just current pid
+      it "sends the given signal to the current process if pid is zero" do
+        Process.kill("HUP", 0).should == 1
+      end
+
+      it "accepts integer signal numbers" do
+        Process.kill(1, 0).should == 1
+      end
+
+      it "accepts POSIX signal names without 'SIG' prefix" do
+        Process.kill("HUP", 0).should == 1
+      end
+
+      it "accepts POSIX signal names with 'SIG' prefix" do
+        Process.kill("SIGHUP", 0).should == 1
+      end
+    end
+  end
+end
+
+describe "Process.kill" do
+  platform_is_not :windows do
+    before :each do
+      @read, @write = IO.pipe
+      @pid = Process.fork {
+        begin
+          @read.close
+          Process.setpgid(0, 0)
+          Signal.trap("HUP") { Process.exit! 99 }
+          @write << "1"
+          @write.close
+          sleep(2) # only so that failures are cleaned up
+        ensure
+          Process.exit! 42
+        end
+      }
+      @write.close
+      @read.gets # the child has changed process groups
+      @read.close
+    end
+
+    after :each do
+      Process.waitpid(@pid).should == @pid
+      $?.exitstatus.should == 99
+    end
+
+    with_tty do
+      it "sends the given signal to the specified process" do
+        Process.kill("HUP", @pid).should == 1
+      end
+
+      it "kills process groups if signal is negative" do
+        Process.kill(-1, Process.getpgid(@pid)).should == 1
+      end
+
+      it "kills process groups if signal starts with a minus sign" do
+        Process.kill("-HUP", Process.getpgid(@pid)).should == 1
+      end
+
+      it "kills process groups if signal starts with a minus sign and 'SIG'" do
+        Process.kill("-SIGHUP", Process.getpgid(@pid)).should == 1
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/process/maxgroups_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/maxgroups_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/maxgroups_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Process.maxgroups" do
+  it "returns the maximum number of gids allowed in the supplemental group access list" do
+    Process.maxgroups.class.should == Fixnum
+  end
+
+  it "sets the maximum number of gids allowed in the supplemental group access list" do
+    n = Process.maxgroups
+    Process.maxgroups = n + 1
+    Process.maxgroups.should == n + 1
+    Process.maxgroups = n
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/process/pid_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/pid_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/pid_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Process.pid" do
+  it "returns the process id of this process" do
+    pid = Process.pid
+    pid.class.should == Fixnum
+    Process.pid.should == pid 
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/process/ppid_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/ppid_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/ppid_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Process.ppid" do
+  it "returns the process id of the parent of this process" do
+
+    read, write = IO.pipe
+
+    child_pid = Process.fork {
+      read.close
+      write << "#{Process.ppid}\n"
+      write.close
+      exit!
+    }
+    write.close
+    pid = read.gets
+    read.close
+    Process.wait(child_pid)
+    pid.to_i.should == Process.pid
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/process/setpgid_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/setpgid_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/setpgid_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Process.setpgid" do
+  it "requires two arguments" do
+    lambda { Process.setpgid }.should raise_error(ArgumentError)
+    lambda { Process.setpgid(0) }.should raise_error(ArgumentError)
+  end
+
+  it "sets the process group id of the specified process" do
+    rd, wr = IO.pipe
+
+    pid = Process.fork do
+      wr.close
+      rd.read
+      rd.close
+      Process.exit!
+    end
+
+    rd.close
+
+    Process.getpgid(pid).should == Process.getpgrp
+    Process.setpgid(pid, pid).should == 0
+    Process.getpgid(pid).should == pid
+
+    wr.write ' '
+    wr.close
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/process/setpgrp_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/setpgrp_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/setpgrp_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,48 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+# TODO: put these in the right files.
+describe "Process.setpgrp and Process.getpgrp" do
+  platform_is_not :windows do
+    it "take no arguments" do
+      lambda { Process.setpgrp(0) }.should raise_error(ArgumentError)
+      lambda { Process.getpgrp(1) }.should raise_error(ArgumentError)
+    end
+
+    it "set and get the process group ID of the calling process" do
+      # there are two synchronization points here:
+      # One for the child to let the parent know that it has finished
+      #   setting its process group;
+      # and another for the parent to let the child know that it's ok to die.
+      read1, write1 = IO.pipe
+      read2, write2 = IO.pipe
+      pid = Process.fork do
+        read1.close
+        write2.close
+        Process.setpgrp
+        write1 << Process.getpgrp
+        write1.close
+        read2.read(1)
+        read2.close
+        Process.exit!
+      end
+      write1.close
+      read2.close
+      pgid = read1.read # wait for child to change process groups
+      read1.close
+
+      Process.getpgid(pid).should == pgid.to_i
+
+      write2 << "!"
+      write2.close
+    end
+
+  end
+
+  describe "Process.setpgrp" do
+    platform_is_not :windows do
+      it "returns zero" do
+        Process.setpgrp.should == 0
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/process/setpriority_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/setpriority_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/setpriority_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,79 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Process.setpriority" do
+  it "takes three arguments" do
+    lambda { Process.setpriority }.should raise_error(ArgumentError)
+    lambda {
+      Process.setpriority(Process::PRIO_PROCESS)
+    }.should raise_error(ArgumentError)
+    lambda {
+      Process.setpriority(Process::PRIO_PROCESS, 0)
+    }.should raise_error(ArgumentError)
+  end
+
+  # Needs a valid version written for Linux
+  platform_is :os => :darwin do
+  it "sets the scheduling priority for a specified process" do
+    p = Process.getpriority(Process::PRIO_PROCESS, 0)
+    Process.setpriority(Process::PRIO_PROCESS, 0, p + 1).should == 0
+    Process.getpriority(Process::PRIO_PROCESS, 0).should == (p + 1)
+    if Process.uid == 0
+      Process.setpriority(Process::PRIO_PROCESS, 0, p).should == 0
+    else
+      lambda {
+        Process.setpriority(Process::PRIO_PROCESS, 0, p)
+      }.should raise_error(Errno::EACCES)
+    end
+  end
+  end
+
+  # Darwin and FreeBSD don't seem to handle these at all, getting all out of
+  # whack with either permission errors or just the wrong value
+  platform_is_not :os => [:darwin, :freebsd] do
+  it "sets the scheduling priority for a specified process group" do
+    pr = Process.getpriority(Process::PRIO_PGRP, 0)
+
+    Process.setpriority(Process::PRIO_PGRP, 0, pr + 1).should == 0
+    Process.getpriority(Process::PRIO_PGRP, 0).should == (pr + 1)
+    if Process.uid == 0
+      Process.setpriority(Process::PRIO_PGRP, 0, pr).should == 0
+    else
+      # EACCESS is not always raised. It's a stupid OS behavior.
+      ok = false
+      begin
+        Process.setpriority(Process::PRIO_PGRP, 0, pr)
+        ok = true
+      rescue Errno::EACCES
+        ok = true
+      rescue Object
+        ok = false
+      end
+
+      ok.should == true
+    end
+  end
+  end
+
+  it "sets the scheduling priority for a specified user" do
+    p = Process.getpriority(Process::PRIO_USER, 0)
+    if Process.uid == 0
+      Process.setpriority(Process::PRIO_USER, 0, p + 1).should == 0
+      Process.getpriority(Process::PRIO_USER, 0).should == (p + 1)
+      Process.setpriority(Process::PRIO_USER, 0, p).should == 0
+    else
+      # EACCESS is not always raised. It's a stupid OS behavior.
+      ok = false
+      begin
+        Process.setpriority(Process::PRIO_USER, 0, p - 1)
+        ok = true
+      rescue Errno::EACCES
+        ok = true
+      rescue Object
+        ok = false
+      end
+
+      ok.should == true
+    end
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/process/setrlimit_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/setrlimit_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/setrlimit_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,104 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Process.setrlimit" do
+  platform_is_not :windows do
+    it "requires at least two arguments" do
+      lambda {
+        Process.setrlimit(Process::RLIMIT_CORE)
+      }.should raise_error(ArgumentError)
+    end
+  end
+end
+
+describe "Process.getrlimit" do
+  it "requires one argument" do
+    lambda { Process.getrlimit }.should raise_error(ArgumentError)
+  end
+end
+
+describe "Process.setrlimit and Process.getrlimit" do
+  platform_is_not :windows do
+    it "limit and get core size (bytes)" do
+      lim, max = Process.getrlimit(Process::RLIMIT_CORE)
+      lim.kind_of?(Integer).should == true
+      max.kind_of?(Integer).should == true
+      Process.setrlimit(Process::RLIMIT_CORE, lim, max).should == nil
+    end
+
+    it "limit and get CPU time (seconds)" do
+      lim, max = Process.getrlimit(Process::RLIMIT_CPU)
+      lim.kind_of?(Integer).should == true
+      max.kind_of?(Integer).should == true
+      Process.setrlimit(Process::RLIMIT_CPU, lim, max).should == nil
+    end
+
+    it "limit and get data segment (bytes)" do
+      lim, max = Process.getrlimit(Process::RLIMIT_DATA)
+      lim.kind_of?(Integer).should == true
+      max.kind_of?(Integer).should == true
+      Process.setrlimit(Process::RLIMIT_DATA, lim, max).should == nil
+    end
+
+    it "limit and get file size (bytes)" do
+      lim, max = Process.getrlimit(Process::RLIMIT_FSIZE)
+      lim.kind_of?(Integer).should == true
+      max.kind_of?(Integer).should == true
+      Process.setrlimit(Process::RLIMIT_FSIZE, lim, max).should == nil
+    end
+
+    it "limit and get file descriptors (number)" do
+      lim, max = Process.getrlimit(Process::RLIMIT_NOFILE)
+      lim.kind_of?(Integer).should == true
+      max.kind_of?(Integer).should == true
+      Process.setrlimit(Process::RLIMIT_NOFILE, lim, max).should == nil
+    end
+
+    it "limit and get stack size (bytes)" do
+      lim, max = Process.getrlimit(Process::RLIMIT_STACK)
+      lim.kind_of?(Integer).should == true
+      max.kind_of?(Integer).should == true
+      Process.setrlimit(Process::RLIMIT_STACK, lim, max).should == nil
+    end
+
+    platform_is_not :openbsd do
+      it "limit and get total available memory (bytes)" do
+        lim, max = Process.getrlimit(Process::RLIMIT_AS)
+        lim.kind_of?(Integer).should == true
+        max.kind_of?(Integer).should == true
+        Process.setrlimit(Process::RLIMIT_AS, lim, max).should == nil
+      end
+    end
+
+    it "limit and get total size for mlock(2) (bytes)" do
+      lim, max = Process.getrlimit(Process::RLIMIT_MEMLOCK)
+      lim.kind_of?(Integer).should == true
+      max.kind_of?(Integer).should == true
+      max = lim if lim > max # EINVAL is raised if this invariant is violated
+      Process.setrlimit(Process::RLIMIT_MEMLOCK, lim, max).should == nil
+    end
+
+    it "limit and get number of processes for the user (number)" do
+      lim, max = Process.getrlimit(Process::RLIMIT_NPROC)
+      lim.kind_of?(Integer).should == true
+      max.kind_of?(Integer).should == true
+      Process.setrlimit(Process::RLIMIT_NPROC, lim, max).should == nil
+    end
+
+    it "limit and get resident memory size (bytes)" do
+      lim, max = Process.getrlimit(Process::RLIMIT_RSS)
+      lim.kind_of?(Integer).should == true
+      max.kind_of?(Integer).should == true
+      Process.setrlimit(Process::RLIMIT_RSS, lim, max).should == nil
+    end
+
+    platform_is :os => [:netbsd, :freebsd] do
+      it "limit and get all socket buffers (bytes)" do
+        #TODO
+        # lim = Process.setrlimit(Process::RLIMIT_SBSIZE, )
+        # lim.kind_of?(Integer).should == true
+        # max.kind_of?(Integer).should == true
+        # Process.setrlimit(Process::RLIMIT_SBSIZE , ).should == nil
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/process/setsid_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/setsid_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/setsid_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Process.setsid" do
+  it "takes no arguments" do
+    lambda { Process.setsid(0) }.should raise_error(ArgumentError)
+  end
+
+  it "establishes this process as a new session and process group leader" do
+    read, write = IO.pipe
+    pid = Process.fork {
+      begin
+        read.close
+        pgid = Process.setsid
+        write << pgid.class.to_s
+        write.close
+      rescue Exception => e
+        write << e << e.backtrace
+      end
+      Process.exit!
+    }
+    write.close
+    klass = read.gets
+    read.close
+    klass.should == "Fixnum"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/process/times_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/times_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/times_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Process.times" do
+  it "returns a Struct::Tms" do
+    Process::times.class.should == Struct::Tms
+  end
+
+  it "returns current cpu times" do
+
+    t = Process::times
+
+    # Stall for 1 second, but do work instead of sleeping
+    # because process times won't increase.
+    start = Time.now
+    1 until (Time.now - start) > 1.2
+
+    # Ensure times is larger. NOTE that there is no 
+    # guarantee of an upper bound since anything may be 
+    # happening at the OS level, so we ONLY check that at 
+    # least an interval has elapsed. Also, we are assuming 
+    # there is a correlation between wall clock time and 
+    # process time. In practice, there is an observed 
+    # discrepancy often 10% or greater. In other words, 
+    # this is a very fuzzy test.
+    t2 = Process::times
+    diff = (t2.utime + t2.stime) - (t.utime + t.stime)
+    diff.should > 0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/process/uid_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/uid_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/uid_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Process.uid" do
+  it "returns the correct uid for the user executing this process" do
+    current_uid_according_to_unix = `id -ur`.to_i
+    Process.uid.should == current_uid_according_to_unix
+  end
+
+  it "also goes by Process::UID.rid" do
+    Process::UID.rid.should == Process.uid
+  end
+
+  it "also goes by Process::Sys.getuid" do
+    Process::Sys.getuid.should == Process.uid
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/process/wait2_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/wait2_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/wait2_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Process.wait2" do
+  before :all do
+    # HACK: this kludge is temporarily necessary because some
+    # misbehaving spec somewhere else does not clear processes
+    Process.waitall
+  end
+
+  platform_is_not :windows do
+    it "returns the pid and status of child process" do
+      pidf = Process.fork { Process.exit! 99 }
+      results = Process.wait2
+      results.size.should == 2
+      pidw, status = results
+      pidf.should == pidw
+      status.exitstatus.should == 99
+    end
+  end
+
+  it "raises a StandardError if no child processes exist" do
+    lambda { Process.wait2 }.should raise_error(Errno::ECHILD)
+    lambda { Process.wait2 }.should raise_error(StandardError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/process/wait_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/wait_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/wait_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,82 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Process.wait" do
+  before :all do
+    Process.waitall
+  end
+
+  it "raises a Errno::ECHILD if there are no child processes" do
+    lambda { Process.wait }.should raise_error(Errno::ECHILD)
+  end
+
+  platform_is_not :windows do
+    it "returns its childs pid" do
+      pid = Process.fork { Process.exit! }
+      Process.wait.should == pid
+    end
+
+    it "sets $? to a Process::Status" do
+      pid = Process.fork { Process.exit! }
+      Process.wait
+      $?.class.should == Process::Status
+      $?.pid.should == pid
+    end
+
+    it "waits for any child process if no pid is given" do
+      pid = Process.fork { Process.exit! }
+      Process.wait.should == pid
+      lambda { Process.kill(0, pid) }.should raise_error(Errno::ESRCH)
+    end
+
+    it "waits for a specific child if a pid is given" do
+      pid1 = Process.fork { Process.exit! }
+      pid2 = Process.fork { Process.exit! }
+      Process.wait(pid2).should == pid2
+      Process.wait(pid1).should == pid1
+      lambda { Process.kill(0, pid1) }.should raise_error(Errno::ESRCH)
+      lambda { Process.kill(0, pid2) }.should raise_error(Errno::ESRCH)
+    end
+
+    # This spec is probably system-dependent.
+    it "waits for a child whose process group ID is that of the calling process" do
+      read, write = IO.pipe
+      pid1 = Process.fork {
+        read.close
+        Process.setpgid(0, 0)
+        write << 1
+        write.close
+        Process.exit!
+      }
+      Process.setpgid(0, 0)
+      ppid = Process.pid
+      pid2 = Process.fork {
+        read.close
+        Process.setpgid(0, ppid);
+        write << 2
+        write.close
+        Process.exit!
+      }
+
+      write.close
+      read.read(1)
+      read.read(1) # to give children a chance to set their process groups
+      read.close
+      Process.wait(0).should == pid2
+      Process.wait.should == pid1
+    end
+
+    # This spec is probably system-dependent.
+    it "doesn't block if no child is available when WNOHANG is used" do
+      pid = Process.fork { 10.times { sleep(1) }; Process.exit! }
+      Process.wait(pid, Process::WNOHANG).should == nil
+      Process.kill("TERM", pid)
+      Process.wait.should == pid
+    end
+
+    it "always accepts flags=0" do
+      pid = Process.fork { Process.exit! }
+      Process.wait(-1, 0).should == pid
+      lambda { Process.kill(0, pid) }.should raise_error(Errno::ESRCH)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/process/waitall_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/waitall_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/waitall_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,45 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Process.waitall" do
+  before :all do
+    Process.waitall
+  end
+
+  it "returns an empty array when there are no children" do
+    Process.waitall.should == []
+  end
+
+  it "takes no arguments" do
+    lambda { Process.waitall(0) }.should raise_error(ArgumentError)
+  end
+
+  platform_is_not :windows do
+    it "waits for all children" do
+      pids = []
+      pids << Process.fork { Process.exit! 2 }
+      pids << Process.fork { Process.exit! 1 }
+      pids << Process.fork { Process.exit! 0 }
+      Process.waitall
+      pids.each { |pid|
+        lambda { Process.kill(0, pid) }.should raise_error(Errno::ESRCH)
+      }
+    end
+
+    it "returns an array of pid/status pairs" do
+      pids = []
+      pids << Process.fork { Process.exit! 2 }
+      pids << Process.fork { Process.exit! 1 }
+      pids << Process.fork { Process.exit! 0 }
+      a = Process.waitall
+      a.class.should == Array
+      a.size.should == 3
+      pids.each { |pid|
+        pid_status = a.assoc(pid)
+        pid_status.class.should == Array
+        pid_status.size.should == 2
+        pid_status.first.should == pid
+        pid_status.last.class.should == Process::Status
+      }
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/process/waitpid2_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/waitpid2_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/waitpid2_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/process/waitpid_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/process/waitpid_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/process/waitpid_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/range/begin_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/range/begin_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/range/begin_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/begin'
+
+describe "Range#begin" do
+  it_behaves_like(:range_begin, :begin)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/range/case_compare_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/range/case_compare_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/range/case_compare_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/include'
+
+describe "Range#===" do
+  it_behaves_like(:range_include, :===)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/range/each_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/range/each_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/range/each_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,46 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Range#each" do
+  it "passes each element to the given block by using #succ" do
+    a = []
+    (-5..5).each { |i| a << i }
+    a.should == [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5]
+
+    a = []
+    ('A'..'D').each { |i| a << i }
+    a.should == ['A','B','C','D']
+
+    a = []
+    ('A'...'D').each { |i| a << i }
+    a.should == ['A','B','C']
+    
+    a = []
+    (0xfffd...0xffff).each { |i| a << i }
+    a.should == [0xfffd, 0xfffe]
+
+    y = mock('y')
+    x = mock('x')
+    x.should_receive(:<=>).with(y).any_number_of_times.and_return(-1)
+    x.should_receive(:<=>).with(x).any_number_of_times.and_return(0)
+    x.should_receive(:succ).any_number_of_times.and_return(y)
+    y.should_receive(:<=>).with(x).any_number_of_times.and_return(1)
+    y.should_receive(:<=>).with(y).any_number_of_times.and_return(0)
+    
+    a = []
+    (x..y).each { |i| a << i }
+    a.should == [x, y]
+  end
+  
+  it "raises a TypeError if the first element does not respond to #succ" do
+    lambda { (0.5..2.4).each { |i| i } }.should raise_error(TypeError)
+    
+    b = mock('x')
+    (a = mock('1')).should_receive(:method_missing).with(:<=>, b).and_return(1)
+    
+    lambda { (a..b).each { |i| i } }.should raise_error(TypeError)
+  end
+  
+  it "returns self" do
+    (1..10).each {}.should == (1..10)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/range/end_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/range/end_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/range/end_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/end'
+
+describe "Range#end" do
+  it_behaves_like(:range_end, :end)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/range/eql_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/range/eql_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/range/eql_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/equal_value'
+
+describe "Range#eql?" do
+  it_behaves_like(:range_eql, :eql?)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/range/equal_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/range/equal_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/range/equal_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/equal_value'
+
+describe "Range#==" do
+  it_behaves_like(:range_eql, :==)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/range/exclude_end_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/range/exclude_end_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/range/exclude_end_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Range#exclude_end?" do
+  it "returns true if the range exludes the end value" do
+    (-2..2).exclude_end?.should == false
+    ('A'..'B').exclude_end?.should == false
+    (0.5..2.4).exclude_end?.should == false
+    (0xfffd..0xffff).exclude_end?.should == false
+
+    (0...5).exclude_end?.should == true
+    ('A'...'B').exclude_end?.should == true
+    (0.5...2.4).exclude_end?.should == true
+    (0xfffd...0xffff).exclude_end?.should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/range/first_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/range/first_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/range/first_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/begin'
+
+describe "Range#first" do
+  it_behaves_like(:range_begin, :first)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/range/hash_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/range/hash_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/range/hash_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Range#hash" do
+  it "is provided" do
+    (0..1).respond_to?(:hash).should == true
+    ('A'..'Z').respond_to?(:hash).should == true
+    (0xfffd..0xffff).respond_to?(:hash).should == true
+    (0.5..2.4).respond_to?(:hash).should == true
+  end
+  
+  it "generates the same hash values for Ranges with the same start, end and exclude_end? values" do
+    (0..1).hash.should == (0..1).hash
+    (0...10).hash.should == (0...10).hash
+    (0..10).hash.should_not == (0...10).hash
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/range/include_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/range/include_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/range/include_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/include'
+
+describe "Range#include?" do
+  it_behaves_like(:range_include, :include?)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/range/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/range/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/range/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/range/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/range/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/range/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Range#inspect" do
+  it "provides a printable form, using #inspect to convert the start and end objects" do
+    ('A'..'Z').inspect.should == '"A".."Z"'
+    ('A'...'Z').inspect.should == '"A"..."Z"'
+    
+    (0..21).inspect.should == "0..21"
+    (-8..0).inspect.should ==  "-8..0"
+    (-411..959).inspect.should == "-411..959"
+    (0xfff..0xfffff).inspect.should == "4095..1048575"
+    (0.5..2.4).inspect.should == "0.5..2.4"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/range/last_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/range/last_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/range/last_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/end'
+
+describe "Range#last" do
+  it_behaves_like(:range_end, :last)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/range/member_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/range/member_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/range/member_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/include'
+
+describe "Range#member?" do
+  it_behaves_like(:range_include, :member?)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/range/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/range/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/range/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Range.new" do
+  it "constructs a range using the given start and end" do
+    range = Range.new('a', 'c')
+    range.should == ('a'..'c')
+    
+    range.first.should == 'a'
+    range.last.should == 'c'
+  end
+  
+  it "includes the end object when the third parameter is omitted or false" do
+    Range.new('a', 'c').to_a.should == ['a', 'b', 'c']
+    Range.new(1, 3).to_a.should == [1, 2, 3]
+    
+    Range.new('a', 'c', false).to_a.should == ['a', 'b', 'c']
+    Range.new(1, 3, false).to_a.should == [1, 2, 3]
+    
+    Range.new('a', 'c', true).to_a.should == ['a', 'b']
+    Range.new(1, 3, 1).to_a.should == [1, 2]
+    
+    Range.new(1, 3, mock('[1,2]')).to_a.should == [1, 2]
+    Range.new(1, 3, :test).to_a.should == [1, 2]
+  end
+  
+  it "raises an ArgumentError when the given start and end can't be compared by using #<=>" do
+    lambda { Range.new(1, mock('x'))         }.should raise_error(ArgumentError)
+    lambda { Range.new(mock('x'), mock('y')) }.should raise_error(ArgumentError)
+    
+    b = mock('x')
+    (a = mock('nil')).should_receive(:method_missing).with(:<=>, b).and_return(nil)
+    lambda { Range.new(a, b) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/range/shared/begin.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/range/shared/begin.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/range/shared/begin.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+describe :range_begin, :shared => true do
+  it "returns the first element of self" do
+    (-1..1).send(@method).should == -1
+    (0..1).send(@method).should == 0
+    (0xffff...0xfffff).send(@method).should == 65535
+    ('Q'..'T').send(@method).should == 'Q'
+    ('Q'...'T').send(@method).should == 'Q'
+    (0.5..2.4).send(@method).should == 0.5
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/range/shared/end.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/range/shared/end.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/range/shared/end.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+describe :range_end, :shared => true do
+  it "end returns the last element of self" do
+    (-1..1).send(@method).should == 1
+    (0..1).send(@method).should == 1
+    ("A".."Q").send(@method).should == "Q"
+    ("A"..."Q").send(@method).should == "Q"
+    (0xffff...0xfffff).send(@method).should == 1048575
+    (0.5..2.4).send(@method).should == 2.4
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/range/shared/equal_value.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/range/shared/equal_value.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/range/shared/equal_value.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+describe :range_eql, :shared => true do
+  it "returns true if other has same begin, end, and exclude_end? values" do
+    (0..2).send(@method, 0..2).should == true
+    ('G'..'M').send(@method,'G'..'M').should == true
+    (0.5..2.4).send(@method, 0.5..2.4).should == true
+    (5..10).send(@method, Range.new(5,10)).should == true
+    ('D'..'V').send(@method, Range.new('D','V')).should == true
+    (0.5..2.4).send(@method, Range.new(0.5, 2.4)).should == true
+    (0xffff..0xfffff).send(@method, 0xffff..0xfffff).should == true
+    (0xffff..0xfffff).send(@method, Range.new(0xffff,0xfffff)).should == true
+
+
+    ('Q'..'X').send(@method, 'A'..'C').should == false
+    ('Q'...'X').send(@method, 'Q'..'W').should == false
+    ('Q'..'X').send(@method, 'Q'...'X').should == false
+    (0.5..2.4).send(@method, 0.5...2.4).should == false
+    (1482..1911).send(@method, 1482...1911).should == false
+    (0xffff..0xfffff).send(@method, 0xffff...0xfffff).should == false
+  end
+
+  it "returns false if other is no Range" do
+    (1..10).send(@method, 1).should == false
+    (1..10).send(@method, 'a').should == false
+    (1..10).send(@method, mock('x')).should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/range/shared/include.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/range/shared/include.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/range/shared/include.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+describe :range_include, :shared => true do
+  it "returns true if other is an element of self" do
+    (0..5).send(@method, 2).should == true
+    (-5..5).send(@method, 0).should == true
+    (-1...1).send(@method, 10.5).should == false
+    (-10..-2).send(@method, -2.5).should == true
+    ('C'..'X').send(@method, 'M').should == true
+    ('C'..'X').send(@method, 'A').should == false
+    ('B'...'W').send(@method, 'W').should == false
+    ('B'...'W').send(@method, 'Q').should == true
+    (0xffff..0xfffff).send(@method, 0xffffd).should == true
+    (0xffff..0xfffff).send(@method, 0xfffd).should == false
+    (0.5..2.4).send(@method, 2).should == true
+    (0.5..2.4).send(@method, 2.5).should == false
+    (0.5..2.4).send(@method, 2.4).should == true
+    (0.5...2.4).send(@method, 2.4).should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/range/step_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/range/step_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/range/step_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,50 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Range#step" do
+  it "passes each nth element to the block" do
+    a = []
+    (-5..5).step(2) { |x| a << x }
+    a.should == [-5, -3, -1, 1, 3, 5]
+
+    a = []
+    ("A".."F").step(2) { |x| a << x }
+    a.should == ["A", "C", "E"]
+
+    a = []
+    ("A"..."G").step(2) { |x| a << x }
+    a.should == ["A", "C", "E"]
+    
+    a = []
+    (0.5..2.4).step(0.5) { |x| a << x }
+    a.should == [0.5, 1, 1.5, 2]
+  end
+
+  it "raises an ArgumentError if stepsize is 0 or negative" do
+    lambda { (-5..5).step(0) { |x| x }       }.should raise_error(ArgumentError)
+    lambda { (-5.5..5.7).step(0.0) { |x| x } }.should raise_error(ArgumentError)
+    lambda { (-5..5).step(-2) { |x| x }      }.should raise_error(ArgumentError)
+  end
+
+  it "raises a TypeError if the first element does not respond to #succ" do
+    b = mock('x')
+    (a = mock('1')).should_receive(:method_missing).with(:<=>, b).and_return(1)
+    
+    lambda { (a..b).step(1) { |i| i } }.should raise_error(TypeError)
+  end
+
+  it "returns self" do
+    (1..10).step(1) {}.should == (1..10)
+  end
+
+  it "raises TypeError if the argument is non-numeric" do
+    obj = mock("mock")
+    lambda { (1..10).step(obj) {} }.should raise_error(TypeError)
+  end
+
+  it "coerces the argument to intger by invoking to_int" do
+    (obj = mock("2")).should_receive(:to_int).and_return(2)
+    res = []
+    (1..10).step(obj) {|x| res << x}
+    res.should == [1, 3, 5, 7, 9]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/range/to_a_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/range/to_a_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/range/to_a_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Range#to_a" do
+  it "converts self to an array" do
+    (-5..5).to_a.should == [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5]
+    ('A'..'D').to_a.should == ['A','B','C','D']
+    ('A'...'D').to_a.should == ['A','B','C']    
+    (0xfffd...0xffff).to_a.should == [0xfffd,0xfffe]
+    lambda { (0.5..2.4).to_a }.should raise_error(TypeError)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/range/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/range/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/range/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Range#to_s" do
+  it "provides a printable form of self" do
+    (0..21).to_s.should == "0..21"
+    (-8..0).to_s.should ==  "-8..0"
+    (-411..959).to_s.should == "-411..959"
+    ('A'..'Z').to_s.should == 'A..Z'
+    ('A'...'Z').to_s.should == 'A...Z'
+    (0xfff..0xfffff).to_s.should == "4095..1048575"
+    (0.5..2.4).inspect.should == "0.5..2.4"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/regexp/case_compare_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/regexp/case_compare_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/regexp/case_compare_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Regexp#===" do
+  it "is true if there is a match" do
+    (/abc/ === "aabcc").should == true
+  end
+  
+  it "is false if there is no match" do
+    (/abc/ === "xyz").should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/regexp/casefold_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/regexp/casefold_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/regexp/casefold_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Regexp#casefold?" do
+  it "returns the value of the case-insensitive flag" do
+    /abc/i.casefold?.should == true
+    /xyz/.casefold?.should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/regexp/compile_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/regexp/compile_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/regexp/compile_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/new'
+
+describe "Range.compile" do
+  it_behaves_like :regexp_new, :compile
+end
+
+describe "Regexp.compile given a String" do
+  it_behaves_like :regexp_new_string, :compile
+end
+
+describe "Regexp.compile given a Regexp" do
+  it_behaves_like :regexp_new_regexp, :compile
+end

Added: MacRuby/branches/experimental/spec/frozen/core/regexp/eql_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/regexp/eql_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/regexp/eql_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/equal_value'
+
+describe "Regexp#eql?" do
+  it_behaves_like(:regexp_eql, :eql?)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/regexp/equal_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/regexp/equal_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/regexp/equal_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/equal_value'
+
+describe "Regexp#==" do
+  it_behaves_like(:regexp_eql, :==)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/regexp/escape_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/regexp/escape_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/regexp/escape_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/quote'
+
+describe "Range.escape" do
+  it_behaves_like(:regexp_quote, :escape)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/regexp/hash_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/regexp/hash_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/regexp/hash_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Regexp#hash" do
+  it "is provided" do
+    Regexp.new('').respond_to?(:hash).should == true
+  end
+
+  it "is based on the text and options of Regexp" do
+    (/cat/ix.hash == /cat/ixn.hash).should == true
+    (/dog/m.hash  == /dog/m.hash).should == true
+    (/cat/.hash   == /cat/ix.hash).should == false
+    (/cat/.hash   == /dog/.hash).should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/regexp/initialize_copy_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/regexp/initialize_copy_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/regexp/initialize_copy_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/regexp/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/regexp/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/regexp/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/regexp/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/regexp/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/regexp/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Regexp#inspect" do
+  it "returns a formatted string that would eval to the same regexp" do
+    /ab+c/ix.inspect.should == "/ab+c/ix"
+    /a(.)+s/n.inspect.should =~ %r|/a(.)+s/n?|  # Default 'n' may not appear
+    /a(.)+s/u.inspect.should == "/a(.)+s/u"     # But a specified one does
+  end
+  
+  it "correctly escapes forward slashes /" do
+    Regexp.new("/foo/bar").inspect.should == "/\\/foo\\/bar/"
+    Regexp.new("/foo/bar[/]").inspect.should == "/\\/foo\\/bar[\\/]/"
+  end  
+end

Added: MacRuby/branches/experimental/spec/frozen/core/regexp/kcode_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/regexp/kcode_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/regexp/kcode_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Regexp#kcode" do
+  it "returns the character set code" do
+    default = /f.(o)/.kcode
+    default.should_not == 'sjis'
+    default.should_not == 'euc'
+    default.should_not == 'utf8'
+
+    /ab+c/s.kcode.should == "sjis"
+    /a(.)+s/n.kcode.should == "none"
+    /xyz/e.kcode.should == "euc"
+    /cars/u.kcode.should == "utf8"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/regexp/last_match_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/regexp/last_match_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/regexp/last_match_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Range.last_match" do
+  it "returns MatchData instance when not passed arguments" do
+    /c(.)t/ =~ 'cat'
+    
+    Regexp.last_match.should be_kind_of(MatchData)
+  end
+  
+  it "returns the nth field in this MatchData when passed a Fixnum" do
+    /c(.)t/ =~ 'cat'
+    Regexp.last_match(1).should == 'a'
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/regexp/match_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/regexp/match_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/regexp/match_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/match'
+
+describe "Regexp#=~" do
+  it_behaves_like(:regexp_match, :=~)
+end
+
+describe "Regexp#match" do
+  it_behaves_like(:regexp_match, :match)
+end
+
+describe "Regexp#~" do
+  it "matches against the contents of $_" do
+    $_ = "input data"
+    (~ /at/).should == 7
+  end
+end
+
+describe "Regexp#=~ on a successful match" do
+  it "returns the index of the first character of the matching region" do
+    (/(.)(.)(.)/ =~ "abc").should == 0
+  end
+end
+
+describe "Regexp#match on a successful match" do
+  it "returns a MatchData object" do
+    (/(.)(.)(.)/.match "abc").class.should == MatchData
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/regexp/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/regexp/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/regexp/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/new'
+
+describe "Regexp.new" do
+  it_behaves_like :regexp_new, :new
+end
+
+describe "Regexp.new given a String" do
+  it_behaves_like :regexp_new_string, :compile
+end
+
+describe "Regexp.new given a Regexp" do
+  it_behaves_like :regexp_new_regexp, :compile
+end

Added: MacRuby/branches/experimental/spec/frozen/core/regexp/options_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/regexp/options_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/regexp/options_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Regexp#options" do
+  it "returns a Fixnum bitvector of regexp options for the Regexp object" do
+    /cat/.options.class.should == Fixnum
+    /cat/ix.options.class.should == Fixnum
+  end
+
+  it "allows checking for presence of a certain option with bitwise &" do
+    (/cat/.options & Regexp::IGNORECASE).should == 0
+    (/cat/i.options & Regexp::IGNORECASE).should_not == 0
+    (/cat/.options & Regexp::MULTILINE).should == 0
+    (/cat/m.options & Regexp::MULTILINE).should_not == 0
+    (/cat/.options & Regexp::EXTENDED).should == 0
+    (/cat/x.options & Regexp::EXTENDED).should_not == 0
+    (/cat/mx.options & Regexp::MULTILINE).should_not == 0
+    (/cat/mx.options & Regexp::EXTENDED).should_not == 0
+    (/cat/xi.options & Regexp::IGNORECASE).should_not == 0
+    (/cat/xi.options & Regexp::EXTENDED).should_not == 0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/regexp/quote_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/regexp/quote_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/regexp/quote_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/quote'
+
+describe "Range.quote" do
+  it_behaves_like(:regexp_quote, :quote)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/regexp/shared/equal_value.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/regexp/shared/equal_value.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/regexp/shared/equal_value.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+describe :regexp_eql, :shared => true do
+  it "is true if self and other have the same pattern" do
+    /abc/.send(@method, /abc/).should == true
+    /abc/.send(@method, /abd/).should == false
+  end
+
+  it "is true if self and other have the same character set code" do
+    /abc/.send(@method, /abc/x).should == false
+    /abc/x.send(@method, /abc/x).should == true
+    /abc/u.send(@method, /abc/n).should == false
+    /abc/u.send(@method, /abc/u).should == true
+    /abc/n.send(@method, /abc/n).should == true
+  end
+
+  it "is true if other has the same #casefold? values" do
+    /abc/.send(@method, /abc/i).should == false
+    /abc/i.send(@method, /abc/i).should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/regexp/shared/match.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/regexp/shared/match.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/regexp/shared/match.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+describe :regexp_match, :shared => true do
+  it "returns nil if there is no match" do
+    /xyz/.send(@method,"abxyc").should == nil
+  end
+
+  it "returns nil if the object is nil" do
+    /\w+/.send(@method, nil).should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/regexp/shared/new.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/regexp/shared/new.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/regexp/shared/new.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,161 @@
+describe :regexp_new, :shared => true do
+  it "requires one argument and creates a new regular expression object" do
+    Regexp.send(@method, '').is_a?(Regexp).should == true
+  end
+
+  it "works by default for subclasses with overridden #initialize" do
+    class RegexpSpecsSubclass < Regexp
+      def initialize(*args)
+        super
+        @args = args
+      end
+
+      attr_accessor :args
+    end
+
+    class RegexpSpecsSubclassTwo < Regexp; end
+
+    RegexpSpecsSubclass.send(@method, "hi").class.should == RegexpSpecsSubclass
+    RegexpSpecsSubclass.send(@method, "hi").args.first.should == "hi"
+
+    RegexpSpecsSubclassTwo.send(@method, "hi").class.should == RegexpSpecsSubclassTwo
+  end
+end
+
+describe :regexp_new_string, :shared => true do
+  it "uses the String argument as an unescaped literal to construct a Regexp object" do
+    Regexp.send(@method, "^hi{2,3}fo.o$").should == /^hi{2,3}fo.o$/
+  end
+
+  it "should throw regexp error with incorrect regexp" do
+    lambda { Regexp.send(@method, "^[$", 0) }.should raise_error(RegexpError)
+  end
+
+  it "does not set Regexp options if only given one argument" do
+    r = Regexp.send(@method, 'Hi')
+    (r.options & Regexp::IGNORECASE).should     == 0
+    (r.options & Regexp::MULTILINE).should      == 0
+    (r.options & Regexp::EXTENDED).should       == 0
+  end
+
+  it "does not set Regexp options if second argument is nil or false" do
+    r = Regexp.send(@method, 'Hi', nil)
+    (r.options & Regexp::IGNORECASE).should     == 0
+    (r.options & Regexp::MULTILINE).should      == 0
+    (r.options & Regexp::EXTENDED).should       == 0
+
+    r = Regexp.send(@method, 'Hi', false)
+    (r.options & Regexp::IGNORECASE).should     == 0
+    (r.options & Regexp::MULTILINE).should      == 0
+    (r.options & Regexp::EXTENDED).should       == 0
+  end
+
+  it "sets options from second argument if it is one of the Fixnum option constants" do
+    r = Regexp.send(@method, 'Hi', Regexp::IGNORECASE)
+    (r.options & Regexp::IGNORECASE).should_not == 0
+    (r.options & Regexp::MULTILINE).should      == 0
+    (r.options & Regexp::EXTENDED).should       == 0
+
+    r = Regexp.send(@method, 'Hi', Regexp::MULTILINE)
+    (r.options & Regexp::IGNORECASE).should     == 0
+    (r.options & Regexp::MULTILINE).should_not  == 0
+    (r.options & Regexp::EXTENDED).should       == 0
+
+    r = Regexp.send(@method, 'Hi', Regexp::EXTENDED)
+    (r.options & Regexp::IGNORECASE).should     == 0
+    (r.options & Regexp::MULTILINE).should      == 0
+    (r.options & Regexp::EXTENDED).should_not   == 1
+  end
+
+  it "accepts a Fixnum of two or more options ORed together as the second argument" do
+    r = Regexp.send(@method, 'Hi', Regexp::IGNORECASE | Regexp::EXTENDED)
+    (r.options & Regexp::IGNORECASE).should_not == 0
+    (r.options & Regexp::MULTILINE).should      == 0
+    (r.options & Regexp::EXTENDED).should_not   == 0
+  end
+
+  it "treats any non-Fixnum, non-nil, non-false second argument as IGNORECASE" do
+    r = Regexp.send(@method, 'Hi', Object.new)
+    (r.options & Regexp::IGNORECASE).should_not == 0
+    (r.options & Regexp::MULTILINE).should      == 0
+    (r.options & Regexp::EXTENDED).should       == 0
+  end
+
+  it "does not enable multibyte support by default" do
+    r = Regexp.send @method, 'Hi', true
+    r.kcode.should_not == 'euc'
+    r.kcode.should_not == 'sjis'
+    r.kcode.should_not == 'utf8'
+  end
+
+  it "enables EUC encoding if third argument is 'e' or 'euc' (case-insensitive)" do
+    Regexp.send(@method, 'Hi', nil, 'e').kcode.should     == 'euc'
+    Regexp.send(@method, 'Hi', nil, 'E').kcode.should     == 'euc'
+    Regexp.send(@method, 'Hi', nil, 'euc').kcode.should   == 'euc'
+    Regexp.send(@method, 'Hi', nil, 'EUC').kcode.should   == 'euc'
+    Regexp.send(@method, 'Hi', nil, 'EuC').kcode.should   == 'euc'
+  end
+
+  it "enables SJIS encoding if third argument is 's' or 'sjis' (case-insensitive)" do
+    Regexp.send(@method, 'Hi', nil, 's').kcode.should     == 'sjis'
+    Regexp.send(@method, 'Hi', nil, 'S').kcode.should     == 'sjis'
+    Regexp.send(@method, 'Hi', nil, 'sjis').kcode.should  == 'sjis'
+    Regexp.send(@method, 'Hi', nil, 'SJIS').kcode.should  == 'sjis'
+    Regexp.send(@method, 'Hi', nil, 'sJiS').kcode.should  == 'sjis'
+  end
+
+  it "enables UTF-8 encoding if third argument is 'u' or 'utf8' (case-insensitive)" do
+    Regexp.send(@method, 'Hi', nil, 'u').kcode.should     == 'utf8'
+    Regexp.send(@method, 'Hi', nil, 'U').kcode.should     == 'utf8'
+    Regexp.send(@method, 'Hi', nil, 'utf8').kcode.should  == 'utf8'
+    Regexp.send(@method, 'Hi', nil, 'UTF8').kcode.should  == 'utf8'
+    Regexp.send(@method, 'Hi', nil, 'uTf8').kcode.should  == 'utf8'
+  end
+
+  it "disables multibyte support if third argument is 'n' or 'none' (case insensitive)" do
+    Regexp.send(@method, 'Hi', nil, 'N').kcode.should == 'none'
+    Regexp.send(@method, 'Hi', nil, 'n').kcode.should == 'none'
+    Regexp.send(@method, 'Hi', nil, 'nONE').kcode.should == 'none'
+  end
+end
+
+describe :regexp_new_regexp, :shared => true do
+  it "uses the argument as a literal to construct a Regexp object" do
+    Regexp.send(@method, /^hi{2,3}fo.o$/).should == /^hi{2,3}fo.o$/
+  end
+
+  it "preserves any options given in the Regexp literal" do
+    (Regexp.send(@method, /Hi/i).options & Regexp::IGNORECASE).should_not == 0
+    (Regexp.send(@method, /Hi/m).options & Regexp::MULTILINE).should_not == 0
+    (Regexp.send(@method, /Hi/x).options & Regexp::EXTENDED).should_not == 0
+
+    r = Regexp.send @method, /Hi/imx
+    (r.options & Regexp::IGNORECASE).should_not == 0
+    (r.options & Regexp::MULTILINE).should_not == 0
+    (r.options & Regexp::EXTENDED).should_not == 0
+
+    r = Regexp.send @method, /Hi/
+    (r.options & Regexp::IGNORECASE).should == 0
+    (r.options & Regexp::MULTILINE).should == 0
+    (r.options & Regexp::EXTENDED).should == 0
+  end
+
+  it "does not honour options given as additional arguments" do
+    r = Regexp.send @method, /hi/, Regexp::IGNORECASE
+    (r.options & Regexp::IGNORECASE).should == 0
+  end
+
+  it "does not enable multibyte support by default" do
+    r = Regexp.send @method, /Hi/
+    r.kcode.should_not == 'euc'
+    r.kcode.should_not == 'sjis'
+    r.kcode.should_not == 'utf8'
+  end
+
+  it "enables multibyte support if given in the literal" do
+    Regexp.send(@method, /Hi/u).kcode.should == 'utf8'
+    Regexp.send(@method, /Hi/e).kcode.should == 'euc'
+    Regexp.send(@method, /Hi/s).kcode.should == 'sjis'
+    Regexp.send(@method, /Hi/n).kcode.should == 'none'
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/regexp/shared/quote.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/regexp/shared/quote.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/regexp/shared/quote.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+describe :regexp_quote, :shared => true do
+  it "escapes any characters with special meaning in a regular expression" do
+    Regexp.send(@method, '\*?{}.+^[]()- ').should == '\\\\\*\?\{\}\.\+\^\[\]\(\)\-\\ '
+    Regexp.send(@method, "\*?{}.+^[]()- ").should == '\\*\\?\\{\\}\\.\\+\\^\\[\\]\\(\\)\\-\\ '
+    Regexp.send(@method, '\n\r\f\t').should == '\\\\n\\\\r\\\\f\\\\t'
+    Regexp.send(@method, "\n\r\f\t").should == '\\n\\r\\f\\t'
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/regexp/source_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/regexp/source_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/regexp/source_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Regexp#source" do
+  it "returns the original string of the pattern" do
+    /ab+c/ix.source.should == "ab+c"
+    /x(.)xz/.source.should == "x(.)xz"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/regexp/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/regexp/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/regexp/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,50 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Regexp#to_s" do
+  it "should display options if included" do
+     /abc/mxi.to_s.should == "(?mix:abc)"
+   end
+
+   it "should show non-included options after a - sign" do
+     /abc/i.to_s.should == "(?i-mx:abc)"
+   end
+
+   it "should show all options as excluded if none are selected" do
+     /abc/.to_s.should == "(?-mix:abc)"
+   end
+
+   it "should show the pattern after the options" do
+     /ab+c/mix.to_s.should == "(?mix:ab+c)"
+     /xyz/.to_s.should == "(?-mix:xyz)"
+   end
+
+   it "should display groups with options" do
+     /(?ix:foo)(?m:bar)/.to_s.should == "(?-mix:(?ix:foo)(?m:bar))"
+     /(?ix:foo)bar/m.to_s.should == "(?m-ix:(?ix:foo)bar)"
+   end
+
+  it "displays single group with same options as main regex as the main regex" do
+    /(?i:nothing outside this group)/.to_s.should == "(?i-mx:nothing outside this group)"
+  end
+
+  it "deals properly with uncaptured groups" do
+    /whatever(?:0d)/ix.to_s.should == "(?ix-m:whatever(?:0d))"
+  end
+
+  it "deals properly with the two types of lookahead groups" do
+    /(?=5)/.to_s.should == "(?-mix:(?=5))"
+    /(?!5)/.to_s.should == "(?-mix:(?!5))"
+  end
+
+  it "returns a string in (?xxx:yyy) notation" do
+    /ab+c/ix.to_s.should == "(?ix-m:ab+c)"
+    /jis/s.to_s.should == "(?-mix:jis)"
+    /(?i:.)/.to_s.should == "(?i-mx:.)"
+    /(?:.)/.to_s.should == "(?-mix:.)"
+  end
+
+  it "handles abusive option groups" do
+    /(?mmmmix-miiiix:)/.to_s.should == '(?-mix:)'
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/regexp/union_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/regexp/union_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/regexp/union_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Regexp.union" do
+  it "returns /(?!)/ when passed no arguments" do
+    Regexp.union.should == /(?!)/
+  end
+  
+  it "returns a regular expression that will match passed arguments" do
+    Regexp.union("penzance").should == /penzance/
+    Regexp.union("skiing", "sledding").should == /skiing|sledding/
+    Regexp.union(/dogs/, /cats/i).should == /(?-mix:dogs)|(?i-mx:cats)/
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/signal/list_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/signal/list_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/signal/list_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,64 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Signal.list" do
+  RUBY18_SIGNALS = %w{
+    EXIT
+    HUP
+    INT
+    QUIT
+    ILL
+    TRAP
+    IOT
+    ABRT
+    EMT
+    FPE
+    KILL
+    BUS
+    SEGV
+    SYS
+    PIPE
+    ALRM
+    TERM
+    URG
+    STOP
+    TSTP
+    CONT
+    CHLD
+    CLD
+    TTIN
+    TTOU
+    IO
+    XCPU
+    XFSZ
+    VTALRM
+    PROF
+    WINCH
+    USR1
+    USR2
+    LOST
+    MSG
+    PWR
+    POLL
+    DANGER
+    MIGRATE
+    PRE
+    GRANT
+    RETRACT
+    SOUND
+    INFO
+  }
+
+  it "doesn't contain other signals than in 1.8" do
+    (Signal.list.keys - RUBY18_SIGNALS).should == []
+  end
+
+  if Signal.list["CHLD"]
+    it "should redefine CLD with CHLD if defined" do
+      Signal.list["CLD"].should == Signal.list["CHLD"]
+    end
+  end
+
+  it "should contain the EXIT key with a value of zero" do
+    Signal.list["EXIT"].should == 0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/signal/trap_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/signal/trap_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/signal/trap_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/string/allocate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/allocate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/allocate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "String.allocate" do
+  it "returns an instance of String" do
+    str = String.allocate
+    str.should be_kind_of(String)
+  end
+  
+  it "returns a fully-formed String" do
+    str = String.allocate
+    str.size.should == 0
+    str << "more"
+    str.should == "more"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/append_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/append_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/append_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.dirname(__FILE__) + '/shared/concat.rb'
+
+describe "String#<<" do
+  it_behaves_like :string_concat, :<<
+end
+
+describe "String#<< with Fixnum" do
+  it_behaves_like :string_concat_fixnum, :<<
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/capitalize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/capitalize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/capitalize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,53 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#capitalize" do
+  it "returns a copy of self with the first character converted to uppercase and the remainder to lowercase" do
+    "".capitalize.should == ""
+    "h".capitalize.should == "H"
+    "H".capitalize.should == "H"
+    "hello".capitalize.should == "Hello"
+    "HELLO".capitalize.should == "Hello"
+    "123ABC".capitalize.should == "123abc"
+  end
+
+  it "taints resulting string when self is tainted" do
+    "".taint.capitalize.tainted?.should == true
+    "hello".taint.capitalize.tainted?.should == true
+  end
+
+  it "is locale insensitive (only upcases a-z and only downcases A-Z)" do
+    "ÄÖÜ".capitalize.should == "ÄÖÜ"
+    "ärger".capitalize.should == "ärger"
+    "BÄR".capitalize.should == "BÄr"
+  end
+
+  it "returns subclass instances when called on a subclass" do
+    StringSpecs::MyString.new("hello").capitalize.class.should == StringSpecs::MyString
+    StringSpecs::MyString.new("Hello").capitalize.class.should == StringSpecs::MyString
+  end
+end
+
+describe "String#capitalize!" do
+  it "capitalizes self in place" do
+    a = "hello"
+    a.capitalize!.should equal(a)
+    a.should == "Hello"
+  end
+
+  it "returns nil when no changes are made" do
+    a = "Hello"
+    a.capitalize!.should == nil
+    a.should == "Hello"
+
+    "".capitalize!.should == nil
+    "H".capitalize!.should == nil
+  end
+
+  it "raises a TypeError when self is frozen" do
+    ["", "Hello", "hello"].each do |a|
+      a.freeze
+      lambda { a.capitalize! }.should raise_error(TypeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/casecmp_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/casecmp_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/casecmp_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,69 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#casecmp" do
+  it "is a case-insensitive version of String#<=>" do
+    "abcdef".casecmp("abcde").should == 1
+    "aBcDeF".casecmp("abcdef").should == 0
+    "abcdef".casecmp("abcdefg").should == -1
+    "abcdef".casecmp("ABCDEF").should == 0
+  end
+  
+  # Broken in MRI 1.8.4
+  it "doesn't consider non-ascii characters equal that aren't" do
+    # -- Latin-1 --
+    upper_a_tilde  = "\xC3"
+    upper_a_umlaut = "\xC4"
+    lower_a_tilde  = "\xE3"
+    lower_a_umlaut = "\xE4"
+
+    lower_a_tilde.casecmp(lower_a_umlaut).should_not == 0
+    lower_a_umlaut.casecmp(lower_a_tilde).should_not == 0
+    upper_a_tilde.casecmp(upper_a_umlaut).should_not == 0
+    upper_a_umlaut.casecmp(upper_a_tilde).should_not == 0
+    
+    # -- UTF-8 --
+    upper_a_tilde  = "\xC3\x83"
+    upper_a_umlaut = "\xC3\x84"
+    lower_a_tilde  = "\xC3\xA3"
+    lower_a_umlaut = "\xC3\xA4"
+    
+    lower_a_tilde.casecmp(lower_a_umlaut).should_not == 0
+    lower_a_umlaut.casecmp(lower_a_tilde).should_not == 0
+    upper_a_tilde.casecmp(upper_a_umlaut).should_not == 0
+    upper_a_umlaut.casecmp(upper_a_tilde).should_not == 0
+  end
+  
+  it "doesn't do case mapping for non-ascii characters" do
+    # -- Latin-1 --
+    upper_a_tilde  = "\xC3"
+    upper_a_umlaut = "\xC4"
+    lower_a_tilde  = "\xE3"
+    lower_a_umlaut = "\xE4"
+    
+    upper_a_tilde.casecmp(lower_a_tilde).should == -1
+    upper_a_umlaut.casecmp(lower_a_umlaut).should == -1
+    lower_a_tilde.casecmp(upper_a_tilde).should == 1
+    lower_a_umlaut.casecmp(upper_a_umlaut).should == 1
+
+    # -- UTF-8 --
+    upper_a_tilde  = "\xC3\x83"
+    upper_a_umlaut = "\xC3\x84"
+    lower_a_tilde  = "\xC3\xA3"
+    lower_a_umlaut = "\xC3\xA4"
+
+    upper_a_tilde.casecmp(lower_a_tilde).should == -1
+    upper_a_umlaut.casecmp(lower_a_umlaut).should == -1
+    lower_a_tilde.casecmp(upper_a_tilde).should == 1
+    lower_a_umlaut.casecmp(upper_a_umlaut).should == 1
+  end
+  
+  it "ignores subclass differences" do
+    str = "abcdef"
+    my_str = StringSpecs::MyString.new(str)
+    
+    str.casecmp(my_str).should == 0
+    my_str.casecmp(str).should == 0
+    my_str.casecmp(my_str).should == 0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/center_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/center_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/center_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,99 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#center with length, padding" do
+  it "returns a new string of specified length with self centered and padded with padstr" do
+    "one".center(9, '.').should       == "...one..."
+    "hello".center(20, '123').should  == "1231231hello12312312"
+    "middle".center(13, '-').should   == "---middle----"
+
+    "".center(1, "abcd").should == "a"
+    "".center(2, "abcd").should == "aa"
+    "".center(3, "abcd").should == "aab"
+    "".center(4, "abcd").should == "abab"
+    "".center(6, "xy").should == "xyxxyx"
+    "".center(11, "12345").should == "12345123451"
+
+    "|".center(2, "abcd").should == "|a"
+    "|".center(3, "abcd").should == "a|a"
+    "|".center(4, "abcd").should == "a|ab"
+    "|".center(5, "abcd").should == "ab|ab"
+    "|".center(6, "xy").should == "xy|xyx"
+    "|".center(7, "xy").should == "xyx|xyx"
+    "|".center(11, "12345").should == "12345|12345"
+    "|".center(12, "12345").should == "12345|123451"
+
+    "||".center(3, "abcd").should == "||a"
+    "||".center(4, "abcd").should == "a||a"
+    "||".center(5, "abcd").should == "a||ab"
+    "||".center(6, "abcd").should == "ab||ab"
+    "||".center(8, "xy").should == "xyx||xyx"
+    "||".center(12, "12345").should == "12345||12345"
+    "||".center(13, "12345").should == "12345||123451"
+  end
+  
+  it "pads with whitespace if no padstr is given" do
+    "two".center(5).should    == " two "
+    "hello".center(20).should == "       hello        "
+  end
+  
+  it "returns self if it's longer than or as long as the specified length" do
+    "".center(0).should == ""
+    "".center(-1).should == ""
+    "hello".center(4).should == "hello"
+    "hello".center(-1).should == "hello"
+    "this".center(3).should == "this"
+    "radiology".center(8, '-').should == "radiology"
+  end
+
+  it "taints result when self or padstr is tainted" do
+    "x".taint.center(4).tainted?.should == true
+    "x".taint.center(0).tainted?.should == true
+    "".taint.center(0).tainted?.should == true
+    "x".taint.center(4, "*").tainted?.should == true
+    "x".center(4, "*".taint).tainted?.should == true
+  end
+  
+  it "calls #to_int to convert length to an integer" do
+    "_".center(3.8, "^").should == "^_^"
+    
+    obj = mock('3')
+    obj.should_receive(:to_int).and_return(3)
+      
+    "_".center(obj, "o").should == "o_o"
+  end
+  
+  it "raises a TypeError when length can't be converted to an integer" do
+    lambda { "hello".center("x")       }.should raise_error(TypeError)
+    lambda { "hello".center("x", "y")  }.should raise_error(TypeError)
+    lambda { "hello".center([])        }.should raise_error(TypeError)
+    lambda { "hello".center(mock('x')) }.should raise_error(TypeError)
+  end
+  
+  it "calls #to_str to convert padstr to a String" do
+    padstr = mock('123')
+    padstr.should_receive(:to_str).and_return("123")
+
+    "hello".center(20, padstr).should == "1231231hello12312312"
+  end
+  
+  it "raises a TypeError when padstr can't be converted to a string" do
+    lambda { "hello".center(20, 100)       }.should raise_error(TypeError)
+    lambda { "hello".center(20, :llo)      }.should raise_error(TypeError)
+    lambda { "hello".center(20, mock('x')) }.should raise_error(TypeError)
+  end
+  
+  it "raises an ArgumentError if padstr is empty" do
+    lambda { "hello".center(10, "") }.should raise_error(ArgumentError)
+    lambda { "hello".center(0, "")  }.should raise_error(ArgumentError)
+  end
+  
+  it "returns subclass instances when called on subclasses" do
+    StringSpecs::MyString.new("").center(10).class.should == StringSpecs::MyString
+    StringSpecs::MyString.new("foo").center(10).class.should == StringSpecs::MyString
+    StringSpecs::MyString.new("foo").center(10, StringSpecs::MyString.new("x")).class.should == StringSpecs::MyString
+    
+    "".center(10, StringSpecs::MyString.new("x")).class.should == String
+    "foo".center(10, StringSpecs::MyString.new("x")).class.should == String
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/chomp_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/chomp_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/chomp_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,146 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#chomp with separator" do
+  it "returns a new string with the given record separator removed" do
+    "hello".chomp("llo").should == "he"
+    "hellollo".chomp("llo").should == "hello"
+  end
+
+  it "removes carriage return (except \\r) chars multiple times when separator is an empty string" do
+    "".chomp("").should == ""
+    "hello".chomp("").should == "hello"
+    "hello\n".chomp("").should == "hello"
+    "hello\nx".chomp("").should == "hello\nx"
+    "hello\r\n".chomp("").should == "hello"
+    "hello\r\n\r\n\n\n\r\n".chomp("").should == "hello"
+
+    "hello\r".chomp("").should == "hello\r"
+    "hello\n\r".chomp("").should == "hello\n\r"
+    "hello\r\r\r\n".chomp("").should == "hello\r\r"
+  end
+  
+  it "removes carriage return chars (\\n, \\r, \\r\\n) when separator is \\n" do
+    "hello".chomp("\n").should == "hello"
+    "hello\n".chomp("\n").should == "hello"
+    "hello\r\n".chomp("\n").should == "hello"
+    "hello\n\r".chomp("\n").should == "hello\n"
+    "hello\r".chomp("\n").should == "hello"
+    "hello \n there".chomp("\n").should == "hello \n there"
+    "hello\r\n\r\n\n\n\r\n".chomp("\n").should == "hello\r\n\r\n\n\n"
+    
+    "hello\n\r".chomp("\r").should == "hello\n"
+    "hello\n\r\n".chomp("\r\n").should == "hello\n"
+  end
+  
+  it "returns self if the separator is nil" do
+    "hello\n\n".chomp(nil).should == "hello\n\n"
+  end
+  
+  it "returns an empty string when called on an empty string" do
+    "".chomp("\n").should == ""
+    "".chomp("\r").should == ""
+    "".chomp("").should == ""
+    "".chomp(nil).should == ""
+  end
+  
+  it "uses $/ as the separator when none is given" do
+    ["", "x", "x\n", "x\r", "x\r\n", "x\n\r\r\n", "hello"].each do |str|
+      ["", "llo", "\n", "\r", nil].each do |sep|
+        begin
+          expected = str.chomp(sep)
+
+          old_rec_sep, $/ = $/, sep
+
+          str.chomp.should == expected
+        ensure
+          $/ = old_rec_sep
+        end
+      end
+    end
+  end
+  
+  it "taints result when self is tainted" do
+    "hello".taint.chomp("llo").tainted?.should == true
+    "hello".taint.chomp("").tainted?.should == true
+    "hello".taint.chomp(nil).tainted?.should == true
+    "hello".taint.chomp.tainted?.should == true
+    "hello\n".taint.chomp.tainted?.should == true
+    
+    "hello".chomp("llo".taint).tainted?.should == false
+  end
+  
+  it "calls #to_str to convert separator to a String" do
+    separator = mock('llo')
+    separator.should_receive(:to_str).and_return("llo")
+
+    "hello".chomp(separator).should == "he"
+  end
+  
+  it "raises a TypeError if separator can't be converted to a string" do
+    lambda { "hello".chomp(?o)        }.should raise_error(TypeError)
+    lambda { "hello".chomp(:llo)      }.should raise_error(TypeError)
+    lambda { "hello".chomp(mock('x')) }.should raise_error(TypeError)
+  end
+  
+  it "returns subclass instances when called on a subclass" do
+    StringSpecs::MyString.new("hello\n").chomp.class.should == StringSpecs::MyString
+    StringSpecs::MyString.new("hello").chomp.class.should == StringSpecs::MyString
+    StringSpecs::MyString.new("").chomp.class.should == StringSpecs::MyString
+  end
+end
+
+describe "String#chomp! with separator" do
+  it "modifies self in place and returns self" do
+    s = "one\n"
+    s.chomp!.should equal(s)
+    s.should == "one"
+    
+    t = "two\r\n"
+    t.chomp!.should equal(t)
+    t.should == "two"
+    
+    u = "three\r"
+    u.chomp!
+    u.should == "three"
+    
+    v = "four\n\r"
+    v.chomp!
+    v.should == "four\n"
+    
+    w = "five\n\n"
+    w.chomp!(nil)
+    w.should == "five\n\n"
+    
+    x = "six"
+    x.chomp!("ix")
+    x.should == "s"
+    
+    y = "seven\n\n\n\n"
+    y.chomp!("")
+    y.should == "seven"
+  end
+  
+  it "returns nil if no modifications were made" do
+     v = "four"
+     v.chomp!.should == nil
+     v.should == "four"
+    
+    "".chomp!.should == nil
+    "line".chomp!.should == nil
+    
+    "hello\n".chomp!("x").should == nil
+    "hello".chomp!("").should == nil
+    "hello".chomp!(nil).should == nil
+  end
+
+  it "raises a TypeError when self is frozen" do
+    a = "string\n\r"
+    a.freeze
+
+    lambda { a.chomp! }.should raise_error(TypeError)
+
+    a.chomp!(nil) # ok, no change
+    a.chomp!("x") # ok, no change
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/chop_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/chop_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/chop_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,75 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#chop" do
+  it "returns a new string with the last character removed" do
+    "hello\n".chop.should == "hello"
+    "hello\x00".chop.should == "hello"
+    "hello".chop.should == "hell"
+    
+    ori_str = ""
+    256.times { |i| ori_str << i }
+    
+    str = ori_str
+    256.times do |i|
+      str = str.chop
+      str.should == ori_str[0, 255 - i]
+    end
+  end
+  
+  it "removes both characters if the string ends with \\r\\n" do
+    "hello\r\n".chop.should == "hello"
+    "hello\r\n\r\n".chop.should == "hello\r\n"
+    "hello\n\r".chop.should == "hello\n"
+    "hello\n\n".chop.should == "hello\n"
+    "hello\r\r".chop.should == "hello\r"
+    
+    "\r\n".chop.should == ""
+  end
+  
+  it "returns an empty string when applied to an empty string" do
+    "".chop.should == ""
+  end
+
+  it "taints result when self is tainted" do
+    "hello".taint.chop.tainted?.should == true
+    "".taint.chop.tainted?.should == true
+  end
+  
+  it "returns subclass instances when called on a subclass" do
+    StringSpecs::MyString.new("hello\n").chop.class.should == StringSpecs::MyString
+    StringSpecs::MyString.new("hello").chop.class.should == StringSpecs::MyString
+    StringSpecs::MyString.new("").chop.class.should == StringSpecs::MyString
+  end
+end
+
+describe "String#chop!" do
+  it "behaves just like chop, but in-place" do
+    ["hello\n", "hello\r\n", "hello", ""].each do |base|
+      str = base.dup
+      str.chop!
+      
+      str.should == base.chop
+    end
+  end
+
+  it "returns self if modifications were made" do
+    ["hello", "hello\r\n"].each do |s|
+      s.chop!.should equal(s)
+    end
+  end
+
+  it "returns nil when called on an empty string" do
+    "".chop!.should == nil
+  end
+  
+  it "raises a TypeError when self is frozen" do
+    a = "string\n\r"
+    a.freeze
+    lambda { a.chop! }.should raise_error(TypeError)
+
+    a = ""
+    a.freeze
+    a.chop! # ok, no change
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/comparison_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/comparison_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/comparison_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,72 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#<=> with String" do
+  it "compares individual characters based on their ascii value" do
+    ascii_order = Array.new(256) { |x| x.chr }
+    sort_order = ascii_order.sort
+    sort_order.should == ascii_order
+  end
+  
+  it "returns -1 when self is less than other" do
+    ("this" <=> "those").should == -1
+  end
+
+  it "returns 0 when self is equal to other" do
+    ("yep" <=> "yep").should == 0
+  end
+
+  it "returns 1 when self is greater than other" do
+    ("yoddle" <=> "griddle").should == 1
+  end
+  
+  it "considers string that comes lexicographically first to be less if strings have same size" do
+    ("aba" <=> "abc").should == -1
+    ("abc" <=> "aba").should == 1
+  end
+
+  it "doesn't consider shorter string to be less if longer string starts with shorter one" do
+    ("abc" <=> "abcd").should == -1
+    ("abcd" <=> "abc").should == 1
+  end
+
+  it "compares shorter string with corresponding number of first chars of longer string" do
+    ("abx" <=> "abcd").should == 1
+    ("abcd" <=> "abx").should == -1
+  end
+  
+  it "ignores subclass differences" do
+    a = "hello"
+    b = StringSpecs::MyString.new("hello")
+    
+    (a <=> b).should == 0
+    (b <=> a).should == 0
+  end
+end
+
+# Note: This is inconsistent with Array#<=> which calls #to_ary instead of
+# just using it as an indicator.
+describe "String#<=>" do
+  it "returns nil if its argument does not provide #to_str" do
+    ("abc" <=> 1).should == nil
+    ("abc" <=> :abc).should == nil
+    ("abc" <=> mock('x')).should == nil
+  end
+
+  it "returns nil if its argument does not provide #<=>" do
+    obj = mock('x')
+    ("abc" <=> obj).should == nil
+  end
+
+  it "calls #to_str to convert the argument to a String and calls #<=> to compare with self" do
+    obj = mock('x')
+
+    # String#<=> merely checks if #to_str is defined on the object. It
+    # does not call the method.
+    obj.stub!(:to_str)
+
+    obj.should_receive(:<=>).with("abc").and_return(1)
+
+    ("abc" <=> obj).should == -1
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/concat_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/concat_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/concat_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.dirname(__FILE__) + '/shared/concat.rb'
+
+describe "String#concat" do
+  it_behaves_like :string_concat, :concat
+end
+
+describe "String#concat with Fixnum" do
+  it_behaves_like :string_concat_fixnum, :concat
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/count_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/count_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/count_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,95 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#count" do
+  it "counts occurrences of chars from the intersection of the specified sets" do
+    s = "hello\nworld\x00\x00"
+
+    s.count(s).should == s.size
+    s.count("lo").should == 5
+    s.count("eo").should == 3
+    s.count("l").should == 3
+    s.count("\n").should == 1
+    s.count("\x00").should == 2
+    
+    s.count("").should == 0
+    "".count("").should == 0
+
+    s.count("l", "lo").should == s.count("l")
+    s.count("l", "lo", "o").should == s.count("")
+    s.count("helo", "hel", "h").should == s.count("h")
+    s.count("helo", "", "x").should == 0
+  end
+
+  it "raises an ArgumentError when given no arguments" do
+    lambda { "hell yeah".count }.should raise_error(ArgumentError)
+  end
+
+  it "negates sets starting with ^" do
+    s = "^hello\nworld\x00\x00"
+    
+    s.count("^").should == 1 # no negation, counts ^
+
+    s.count("^leh").should == 9
+    s.count("^o").should == 12
+
+    s.count("helo", "^el").should == s.count("ho")
+    s.count("aeiou", "^e").should == s.count("aiou")
+    
+    "^_^".count("^^").should == 1
+    "oa^_^o".count("a^").should == 3
+  end
+
+  it "counts all chars in a sequence" do
+    s = "hel-[()]-lo012^"
+    
+    s.count("\x00-\xFF").should == s.size
+    s.count("ej-m").should == 3
+    s.count("e-h").should == 2
+
+    # no sequences
+    s.count("-").should == 2
+    s.count("e-").should == s.count("e") + s.count("-")
+    s.count("-h").should == s.count("h") + s.count("-")
+
+    s.count("---").should == s.count("-")
+    
+    # see an ASCII table for reference
+    s.count("--2").should == s.count("-./012")
+    s.count("(--").should == s.count("()*+,-")
+    s.count("A-a").should == s.count("A-Z[\\]^_`a")
+    
+    # empty sequences (end before start)
+    s.count("h-e").should == 0
+    s.count("^h-e").should == s.size
+
+    # negated sequences
+    s.count("^e-h").should == s.size - s.count("e-h")
+    s.count("^^-^").should == s.size - s.count("^")
+    s.count("^---").should == s.size - s.count("-")
+
+    "abcdefgh".count("a-ce-fh").should == 6
+    "abcdefgh".count("he-fa-c").should == 6
+    "abcdefgh".count("e-fha-c").should == 6
+
+    "abcde".count("ac-e").should == 4
+    "abcde".count("^ac-e").should == 1
+  end
+
+  it "calls #to_str to convert each set arg to a String" do
+    other_string = mock('lo')
+    other_string.should_receive(:to_str).and_return("lo")
+
+    other_string2 = mock('o')
+    other_string2.should_receive(:to_str).and_return("o")
+
+    s = "hello world"
+    s.count(other_string, other_string2).should == s.count("o")
+  end
+
+  it "raises a TypeError when a set arg can't be converted to a string" do
+    lambda { "hello world".count(100)       }.should raise_error(TypeError)
+    lambda { "hello world".count(:o)        }.should raise_error(TypeError)
+    lambda { "hello world".count(mock('x')) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/crypt_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/crypt_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/crypt_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,106 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#crypt" do
+  # Note: MRI's documentation just says that the C stdlib function crypt() is
+  # called.
+  #
+  # I'm not sure if crypt() is guaranteed to produce the same result across
+  # different platforms. It seems that there is one standard UNIX implementation
+  # of crypt(), but that alternative implementations are possible. See
+  # http://www.unix.org.ua/orelly/networking/puis/ch08_06.htm
+  it "returns a cryptographic hash of self by applying the UNIX crypt algorithm with the specified salt" do
+    "".crypt("aa").should == "aaQSqAReePlq6"
+    "nutmeg".crypt("Mi").should == "MiqkFWCm1fNJI"
+    "ellen1".crypt("ri").should == "ri79kNd7V6.Sk"
+    "Sharon".crypt("./").should == "./UY9Q7TvYJDg"
+    "norahs".crypt("am").should == "amfIADT2iqjA."
+    "norahs".crypt("7a").should == "7azfT5tIdyh0I"
+
+    # Only uses first 8 chars of string
+    "01234567".crypt("aa").should == "aa4c4gpuvCkSE"
+    "012345678".crypt("aa").should == "aa4c4gpuvCkSE"
+    "0123456789".crypt("aa").should == "aa4c4gpuvCkSE"
+
+    # Only uses first 2 chars of salt
+    "hello world".crypt("aa").should == "aayPz4hyPS1wI"
+    "hello world".crypt("aab").should == "aayPz4hyPS1wI"
+    "hello world".crypt("aabc").should == "aayPz4hyPS1wI"
+  end
+
+  platform_is_not :darwin do
+    not_compliant_on :jruby do
+      it "returns an empty string when the salt starts NULL bytes" do
+        "hello".crypt("\x00\x00").should == ""
+        "hello".crypt("\x00a").should == ""
+      end
+
+      it "ignores trailing NULL bytes in the salt but counts them for the 2 character minimum" do
+        "hello".crypt("a\x00").should == "aa1dYAU.hgL3A"
+      end
+    end
+
+    # TODO: verify this
+    deviates_on :jruby do
+      it "returns NULL bytes prepended to the string when the salt contains NULL bytes" do
+        "hello".crypt("\x00\x00").should == "\x00\x00dR0/E99ehpU"
+        "hello".crypt("\x00a").should == "\000aeipc4xPxhGY"
+        "hello".crypt("a\x00").should == "a\000GJVggM8eWwo"
+      end
+    end
+  end
+
+  platform_is :darwin do
+    not_compliant_on :jruby do
+      it "returns '.' prepended to the string for each NULL byte the salt contains" do
+        "hello".crypt("\x00\x00").should == "..dR0/E99ehpU"
+        "hello".crypt("\x00a").should == ".aeipc4xPxhGY"
+        "hello".crypt("a\x00").should == "a.GJVggM8eWwo"
+      end
+    end
+
+    deviates_on :jruby do
+      it "returns NULL bytes prepended to the string when the salt contains NULL bytes" do
+        "hello".crypt("\x00\x00").should == "\x00\x00dR0/E99ehpU"
+        "hello".crypt("\x00a").should == "\000aeipc4xPxhGY"
+        "hello".crypt("a\x00").should == "a\000GJVggM8eWwo"
+      end
+    end
+  end
+
+  it "raises an ArgumentError when the salt is shorter than two characters" do
+    lambda { "hello".crypt("")  }.should raise_error(ArgumentError)
+    lambda { "hello".crypt("f") }.should raise_error(ArgumentError)
+  end
+
+  it "calls #to_str to converts the salt arg to a String" do
+    obj = mock('aa')
+    obj.should_receive(:to_str).and_return("aa")
+
+    "".crypt(obj).should == "aaQSqAReePlq6"
+  end
+
+  it "raises a type error when the salt arg can't be converted to a string" do
+    lambda { "".crypt(5)         }.should raise_error(TypeError)
+    lambda { "".crypt(mock('x')) }.should raise_error(TypeError)
+  end
+
+  it "taints the result if either salt or self is tainted" do
+    tainted_salt = "aa"
+    tainted_str = "hello"
+
+    tainted_salt.taint
+    tainted_str.taint
+
+    "hello".crypt("aa").tainted?.should == false
+    tainted_str.crypt("aa").tainted?.should == true
+    "hello".crypt(tainted_salt).tainted?.should == true
+    tainted_str.crypt(tainted_salt).tainted?.should == true
+  end
+
+  it "doesn't return subclass instances" do
+    StringSpecs::MyString.new("hello").crypt("aa").class.should == String
+    "hello".crypt(StringSpecs::MyString.new("aa")).class.should == String
+    StringSpecs::MyString.new("hello").crypt(StringSpecs::MyString.new("aa")).class.should == String
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/delete_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/delete_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/delete_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,101 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#delete" do
+  it "returns a new string with the chars from the intersection of sets removed" do
+    s = "hello"
+    s.delete("lo").should == "he"
+    s.should == "hello"
+
+    "hello".delete("l", "lo").should == "heo"
+
+    "hell yeah".delete("").should == "hell yeah"
+  end
+
+  it "raises an ArgumentError when given no arguments" do
+    lambda { "hell yeah".delete }.should raise_error(ArgumentError)
+  end
+
+  it "negates sets starting with ^" do
+    "hello".delete("aeiou", "^e").should == "hell"
+    "hello".delete("^leh").should == "hell"
+    "hello".delete("^o").should == "o"
+    "hello".delete("^").should == "hello"
+    "^_^".delete("^^").should == "^^"
+    "oa^_^o".delete("a^").should == "o_o"
+  end
+
+  it "deletes all chars in a sequence" do
+    "hello".delete("\x00-\xFF").should == ""
+    "hello".delete("ej-m").should == "ho"
+    "hello".delete("e-h").should == "llo"
+    "hel-lo".delete("e-").should == "hllo"
+    "hel-lo".delete("-h").should == "ello"
+    "hel-lo".delete("---").should == "hello"
+    "hel-012".delete("--2").should == "hel"
+    "hel-()".delete("(--").should == "hel"
+    "hello".delete("h-e").should == "hello"
+    "hello".delete("^h-e").should == ""
+    "hello".delete("^e-h").should == "he"
+    "hello^".delete("^^-^").should == "^"
+    "hel--lo".delete("^---").should == "--"
+
+    "abcdefgh".delete("a-ce-fh").should == "dg"
+    "abcdefgh".delete("he-fa-c").should == "dg"
+    "abcdefgh".delete("e-fha-c").should == "dg"
+
+    "abcde".delete("ac-e").should == "b"
+    "abcde".delete("^ac-e").should == "acde"
+
+    "ABCabc[]".delete("A-a").should == "bc"
+  end
+
+  it "taints result when self is tainted" do
+    "hello".taint.delete("e").tainted?.should == true
+    "hello".taint.delete("a-z").tainted?.should == true
+
+    "hello".delete("e".taint).tainted?.should == false
+  end
+
+  it "tries to convert each set arg to a string using to_str" do
+    other_string = mock('lo')
+    other_string.should_receive(:to_str).and_return("lo")
+
+    other_string2 = mock('o')
+    other_string2.should_receive(:to_str).and_return("o")
+
+    "hello world".delete(other_string, other_string2).should == "hell wrld"
+  end
+
+  it "raises a TypeError when one set arg can't be converted to a string" do
+    lambda { "hello world".delete(100)       }.should raise_error(TypeError)
+    lambda { "hello world".delete(:o)        }.should raise_error(TypeError)
+    lambda { "hello world".delete(mock('x')) }.should raise_error(TypeError)
+  end
+
+  it "returns subclass instances when called on a subclass" do
+    StringSpecs::MyString.new("oh no!!!").delete("!").class.should == StringSpecs::MyString
+  end
+end
+
+describe "String#delete!" do
+  it "modifies self in place and returns self" do
+    a = "hello"
+    a.delete!("aeiou", "^e").should equal(a)
+    a.should == "hell"
+  end
+
+  it "returns nil if no modifications were made" do
+    a = "hello"
+    a.delete!("z").should == nil
+    a.should == "hello"
+  end
+
+  it "raises a TypeError when self is frozen" do
+    a = "hello"
+    a.freeze
+
+    lambda { a.delete!("")            }.should raise_error(TypeError)
+    lambda { a.delete!("aeiou", "^e") }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/downcase_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/downcase_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/downcase_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,50 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#downcase" do
+  it "returns a copy of self with all uppercase letters downcased" do
+    "hELLO".downcase.should == "hello"
+    "hello".downcase.should == "hello"
+  end
+
+  it "is locale insensitive (only replaces A-Z)" do
+    "ÄÖÜ".downcase.should == "ÄÖÜ"
+
+    str = Array.new(256) { |c| c.chr }.join
+    expected = Array.new(256) do |i|
+      c = i.chr
+      c.between?("A", "Z") ? c.downcase : c
+    end.join
+
+    str.downcase.should == expected
+  end
+
+  it "taints result when self is tainted" do
+    "".taint.downcase.tainted?.should == true
+    "x".taint.downcase.tainted?.should == true
+    "X".taint.downcase.tainted?.should == true
+  end
+
+  it "returns a subclass instance for subclasses" do
+    StringSpecs::MyString.new("FOObar").downcase.class.should == StringSpecs::MyString
+  end
+end
+
+describe "String#downcase!" do
+  it "modifies self in place" do
+    a = "HeLlO"
+    a.downcase!.should equal(a)
+    a.should == "hello"
+  end
+
+  it "returns nil if no modifications were made" do
+    a = "hello"
+    a.downcase!.should == nil
+    a.should == "hello"
+  end
+
+  it "raises a TypeError when self is frozen" do
+    lambda { "HeLlo".freeze.downcase! }.should raise_error(TypeError)
+    lambda { "hello".freeze.downcase! }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/dump_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/dump_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/dump_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#dump" do
+  # Older versions of MRI wrongly print \b as \010
+  it "produces a version of self with all nonprinting charaters replaced by \\nnn notation" do
+    ("\000".."A").to_a.to_s.dump.should == "\"\\000\\001\\002\\003\\004\\005\\006\\a\\b\\t\\n\\v\\f\\r\\016\\017\\020\\021\\022\\023\\024\\025\\026\\027\\030\\031\\032\\e\\034\\035\\036\\037 !\\\"\\\#$%&'()*+,-./0123456789\""
+  end
+  
+  it "ignores the $KCODE setting" do
+    old_kcode = $KCODE
+
+    begin
+      $KCODE = "NONE"
+      "äöü".dump.should == "\"\\303\\244\\303\\266\\303\\274\""
+
+      $KCODE = "UTF-8"
+      "äöü".dump.should == "\"\\303\\244\\303\\266\\303\\274\""
+    ensure
+      $KCODE = old_kcode
+    end
+  end
+
+  it "taints result when self is tainted" do
+    "".taint.dump.tainted?.should == true
+    "x".taint.dump.tainted?.should == true
+  end
+  
+  it "returns a subclass instance for subclasses" do
+    StringSpecs::MyString.new("hi!").dump.class.should == StringSpecs::MyString
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/each_byte_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/each_byte_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/each_byte_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,40 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#each_byte" do
+  it "passes each byte in self to the given block" do
+    a = []
+    "hello\x00".each_byte { |c| a << c }
+    a.should == [104, 101, 108, 108, 111, 0]
+  end
+
+  it "keeps iterating from the old position (to new string end) when self changes" do
+    r = ""
+    s = "hello world"
+    s.each_byte do |c|
+      r << c
+      s.insert(0, "<>") if r.size < 3
+    end
+    r.should == "h><>hello world"
+
+    r = ""
+    s = "hello world"
+    s.each_byte { |c| s.slice!(-1); r << c }
+    r.should == "hello "
+
+    r = ""
+    s = "hello world"
+    s.each_byte { |c| s.slice!(0); r << c }
+    r.should == "hlowrd"
+
+    r = ""
+    s = "hello world"
+    s.each_byte { |c| s.slice!(0..-1); r << c }
+    r.should == "h"
+  end
+  
+  it "returns self" do
+    s = "hello"
+    (s.each_byte {}).should equal(s)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/each_char_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/each_char_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/each_char_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+extended_on :rubinius do
+  describe "String#each_char" do
+    it "passes each char in self to the given block" do
+      a = []
+      "hello".each_char { |c| a << c }
+      a.should == ['h', 'e', 'l', 'l', 'o']
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/each_line_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/each_line_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/each_line_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/each'
+
+describe "String#each_line" do
+  it_behaves_like(:string_each, :each_line)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/each_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/each_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/each_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/each'
+
+describe "String#each" do
+  it_behaves_like(:string_each, :each)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/element_reference_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/element_reference_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/element_reference_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.dirname(__FILE__) + '/shared/slice.rb'
+
+describe "String#[]" do
+  it_behaves_like :string_slice, :[]
+end
+
+describe "String#[] with index, length" do
+  it_behaves_like :string_slice_index_length, :[]
+end
+
+describe "String#[] with Range" do
+  it_behaves_like :string_slice_range, :[]
+end
+
+describe "String#[] with Regexp" do
+  it_behaves_like :string_slice_regexp, :[]
+end
+
+describe "String#[] with Regexp, index" do
+  it_behaves_like :string_slice_regexp_index, :[]
+end
+
+describe "String#[] with String" do
+  it_behaves_like :string_slice_string, :[]
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/element_set_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/element_set_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/element_set_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,237 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+# TODO: Add missing String#[]= specs:
+#   String#[range] = obj
+#   String#[re] = obj
+#   String#[re, idx] = obj
+#   String#[str] = obj
+
+describe "String#[]= with index" do
+  it "sets the code of the character at idx to char modulo 256" do
+    a = "hello"
+    a[0] = ?b
+    a.should == "bello"
+    a[-1] = ?a
+    a.should == "bella"
+    a[-1] = 0
+    a.should == "bell\x00"
+    a[-5] = 0
+    a.should == "\x00ell\x00"
+
+    a = "x"
+    a[0] = ?y
+    a.should == "y"
+    a[-1] = ?z
+    a.should == "z"
+
+    a[0] = 255
+    a[0].should == 255
+    a[0] = 256
+    a[0].should == 0
+    a[0] = 256 * 3 + 42
+    a[0].should == 42
+    a[0] = -214
+    a[0].should == 42
+  end
+
+  it "raises an IndexError without changing self if idx is outside of self" do
+    a = "hello"
+
+    lambda { a[20] = ?a }.should raise_error(IndexError)
+    a.should == "hello"
+
+    lambda { a[-20] = ?a }.should raise_error(IndexError)
+    a.should == "hello"
+
+    lambda { ""[0] = ?a  }.should raise_error(IndexError)
+    lambda { ""[-1] = ?a }.should raise_error(IndexError)
+  end
+
+  it "calls to_int on index" do
+    str = "hello"
+    str[0.5] = ?c
+    str.should == "cello"
+
+    obj = mock('-1')
+    obj.should_receive(:to_int).and_return(-1)
+    str[obj] = ?y
+    str.should == "celly"
+  end
+
+  it "sets the code to char % 256" do
+    str = "Hello"
+
+    str[0] = ?a + 256 * 3
+    str[0].should == ?a
+    str[0] = -200
+    str[0].should == 56
+  end
+
+  it "doesn't call to_int on char" do
+    obj = mock('x')
+    obj.should_not_receive(:to_int)
+    lambda { "hi"[0] = obj }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError when self is frozen" do
+    a = "hello"
+    a.freeze
+
+    lambda { a[0] = ?b }.should raise_error(TypeError)
+  end
+end
+
+describe "String#[]= with String" do
+  it "replaces the char at idx with other_str" do
+    a = "hello"
+    a[0] = "bam"
+    a.should == "bamello"
+    a[-2] = ""
+    a.should == "bamelo"
+  end
+
+  it "taints self if other_str is tainted" do
+    a = "hello"
+    a[0] = "".taint
+    a.tainted?.should == true
+
+    a = "hello"
+    a[0] = "x".taint
+    a.tainted?.should == true
+  end
+
+  it "raises an IndexError without changing self if idx is outside of self" do
+    str = "hello"
+
+    lambda { str[20] = "bam" }.should raise_error(IndexError)
+    str.should == "hello"
+
+    lambda { str[-20] = "bam" }.should raise_error(IndexError)
+    str.should == "hello"
+
+    lambda { ""[0] = "bam"  }.should raise_error(IndexError)
+    lambda { ""[-1] = "bam" }.should raise_error(IndexError)
+  end
+
+  it "raises IndexError if the string index doesn't match a position in the string" do
+    str = "hello"
+    lambda { str['y'] = "bam" }.should raise_error(IndexError)
+    str.should == "hello"
+  end
+
+  it "raises IndexError if the regexp index doesn't match a position in the string" do
+    str = "hello"
+    lambda { str[/y/] = "bam" }.should raise_error(IndexError)
+    str.should == "hello"
+  end
+
+  it "raises a TypeError when self is frozen" do
+    a = "hello"
+    a.freeze
+
+    lambda { a[0] = "bam" }.should raise_error(TypeError)
+  end
+
+  it "calls to_int on index" do
+    str = "hello"
+    str[0.5] = "hi "
+    str.should == "hi ello"
+
+    obj = mock('-1')
+    obj.should_receive(:to_int).and_return(-1)
+    str[obj] = "!"
+    str.should == "hi ell!"
+  end
+
+  it "calls #to_str to convert other to a String" do
+    other_str = mock('-test-')
+    other_str.should_receive(:to_str).and_return("-test-")
+
+    a = "abc"
+    a[1] = other_str
+    a.should == "a-test-c"
+  end
+
+  it "raises a TypeError if other_str can't be converted to a String" do
+    lambda { "test"[1] = :test     }.should raise_error(TypeError)
+    lambda { "test"[1] = mock('x') }.should raise_error(TypeError)
+    lambda { "test"[1] = nil       }.should raise_error(TypeError)
+  end
+end
+
+describe "String#[]= with index, count" do
+  it "starts at idx and overwrites count characters before inserting the rest of other_str" do
+    a = "hello"
+    a[0, 2] = "xx"
+    a.should == "xxllo"
+    a = "hello"
+    a[0, 2] = "jello"
+    a.should == "jellollo"
+  end
+
+  it "counts negative idx values from end of the string" do
+    a = "hello"
+    a[-1, 0] = "bob"
+    a.should == "hellbobo"
+    a = "hello"
+    a[-5, 0] = "bob"
+    a.should == "bobhello"
+  end
+
+  it "overwrites and deletes characters if count is more than the length of other_str" do
+    a = "hello"
+    a[0, 4] = "x"
+    a.should == "xo"
+    a = "hello"
+    a[0, 5] = "x"
+    a.should == "x"
+  end
+
+  it "deletes characters if other_str is an empty string" do
+    a = "hello"
+    a[0, 2] = ""
+    a.should == "llo"
+  end
+
+  it "deletes characters up to the maximum length of the existing string" do
+    a = "hello"
+    a[0, 6] = "x"
+    a.should == "x"
+    a = "hello"
+    a[0, 100] = ""
+    a.should == ""
+  end
+
+  it "appends other_str to the end of the string if idx == the length of the string" do
+    a = "hello"
+    a[5, 0] = "bob"
+    a.should == "hellobob"
+  end
+
+  it "taints self if other_str is tainted" do
+    a = "hello"
+    a[0, 0] = "".taint
+    a.tainted?.should == true
+
+    a = "hello"
+    a[1, 4] = "x".taint
+    a.tainted?.should == true
+  end
+
+  it "raises an IndexError if |idx| is greater than the length of the string" do
+    lambda { "hello"[6, 0] = "bob"  }.should raise_error(IndexError)
+    lambda { "hello"[-6, 0] = "bob" }.should raise_error(IndexError)
+  end
+
+  it "raises an IndexError if count < 0" do
+    lambda { "hello"[0, -1] = "bob" }.should raise_error(IndexError)
+    lambda { "hello"[1, -1] = "bob" }.should raise_error(IndexError)
+  end
+
+  it "raises a TypeError if other_str is a type other than String" do
+    lambda { "hello"[0, 2] = nil  }.should raise_error(TypeError)
+    lambda { "hello"[0, 2] = :bob }.should raise_error(TypeError)
+    lambda { "hello"[0, 2] = 33   }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/empty_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/empty_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/empty_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#empty?" do
+  it "returns true if the string has a length of zero" do
+    "hello".empty?.should == false
+    " ".empty?.should == false
+    "\x00".empty?.should == false
+    "".empty?.should == true
+    StringSpecs::MyString.new("").empty?.should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/entries_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/entries_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/entries_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/to_a'
+
+describe "String#entries" do
+  it_behaves_like :string_to_a, :entries
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/eql_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/eql_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/eql_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.dirname(__FILE__) + '/shared/equal_value.rb'
+
+describe "String#eql?" do
+  it_behaves_like(:string_equal_value, :eql?)
+end
+
+describe "String#eql? when given a non-String" do
+  it "returns false" do
+    'hello'.should_not eql(5)
+    'hello'.should_not eql(:hello)
+    'hello'.should_not eql(mock('x'))
+  end
+  
+  it "does not try to call #to_str on the given argument" do
+    (obj = mock('x')).should_not_receive(:to_str)
+    'hello'.should_not eql(obj)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/string/equal_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/equal_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/equal_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.dirname(__FILE__) + '/shared/equal_value.rb'
+
+describe "String#==" do
+  it_behaves_like(:string_equal_value, :==)
+end
+
+describe "String#==" do
+  it "returns false if obj does not respond to to_str" do
+    ('hello' == 5).should == false
+    ('hello' == :hello).should == false
+    ('hello' == mock('x')).should == false
+  end
+
+  it "returns obj == self if obj responds to to_str" do
+    obj = Object.new
+
+    # String#== merely checks if #to_str is defined. It does
+    # not call it.
+    obj.stub!(:to_str)
+
+    obj.should_receive(:==).and_return(true)
+
+    ('hello' == obj).should ==  true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+module StringSpecs
+  class MyString < String; end
+  class MyArray < Array; end
+  class MyRange < Range; end
+
+  class SubString < String
+    attr_reader :special
+    
+    def initialize(str=nil)
+      @special = str
+    end
+  end
+  
+  class StringWithRaisingConstructor < String
+    def initialize(str)
+      raise ArgumentError.new('constructor was called') unless str == 'silly:string'
+      self.replace(str)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/gsub_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/gsub_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/gsub_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,403 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#gsub with pattern and replacement" do
+
+  it "doesn't freak out when replacing ^" do
+    "Text\n".gsub(/^/, ' ').should == " Text\n"
+    "Text\nFoo".gsub(/^/, ' ').should == " Text\n Foo"
+  end
+
+  it "returns a copy of self with all occurrences of pattern replaced with replacement" do
+    "hello".gsub(/[aeiou]/, '*').should == "h*ll*"
+
+    str = "hello homely world. hah!"
+    str.gsub(/\Ah\S+\s*/, "huh? ").should == "huh? homely world. hah!"
+
+    "hello".gsub(//, ".").should == ".h.e.l.l.o."
+  end
+  
+  it "ignores a block if supplied" do
+    "food".gsub(/f/, "g") { "w" }.should == "good"
+  end
+
+  it "supports \\G which matches at the beginning of the remaining (non-matched) string" do
+    str = "hello homely world. hah!"
+    str.gsub(/\Gh\S+\s*/, "huh? ").should == "huh? huh? world. hah!"
+  end
+  
+  it "supports /i for ignoring case" do
+    str = "Hello. How happy are you?"
+    str.gsub(/h/i, "j").should == "jello. jow jappy are you?"
+    str.gsub(/H/i, "j").should == "jello. jow jappy are you?"
+  end
+  
+  it "doesn't interpret regexp metacharacters if pattern is a string" do
+    "12345".gsub('\d', 'a').should == "12345"
+    '\d'.gsub('\d', 'a').should == "a"
+  end
+  
+  it "replaces \\1 sequences with the regexp's corresponding capture" do
+    str = "hello"
+    
+    str.gsub(/([aeiou])/, '<\1>').should == "h<e>ll<o>"
+    str.gsub(/(.)/, '\1\1').should == "hheelllloo"
+
+    str.gsub(/.(.?)/, '<\0>(\1)').should == "<he>(e)<ll>(l)<o>()"
+
+    str.gsub(/.(.)+/, '\1').should == "o"
+
+    str = "ABCDEFGHIJKLabcdefghijkl"
+    re = /#{"(.)" * 12}/
+    str.gsub(re, '\1').should == "Aa"
+    str.gsub(re, '\9').should == "Ii"
+    # Only the first 9 captures can be accessed in MRI
+    str.gsub(re, '\10').should == "A0a0"
+  end
+
+  it "treats \\1 sequences without corresponding captures as empty strings" do
+    str = "hello!"
+    
+    str.gsub("", '<\1>').should == "<>h<>e<>l<>l<>o<>!<>"
+    str.gsub("h", '<\1>').should == "<>ello!"
+
+    str.gsub(//, '<\1>').should == "<>h<>e<>l<>l<>o<>!<>"
+    str.gsub(/./, '\1\2\3').should == ""
+    str.gsub(/.(.{20})?/, '\1').should == ""
+  end
+
+  it "replaces \\& and \\0 with the complete match" do
+    str = "hello!"
+    
+    str.gsub("", '<\0>').should == "<>h<>e<>l<>l<>o<>!<>"
+    str.gsub("", '<\&>').should == "<>h<>e<>l<>l<>o<>!<>"
+    str.gsub("he", '<\0>').should == "<he>llo!"
+    str.gsub("he", '<\&>').should == "<he>llo!"
+    str.gsub("l", '<\0>').should == "he<l><l>o!"
+    str.gsub("l", '<\&>').should == "he<l><l>o!"
+    
+    str.gsub(//, '<\0>').should == "<>h<>e<>l<>l<>o<>!<>"
+    str.gsub(//, '<\&>').should == "<>h<>e<>l<>l<>o<>!<>"
+    str.gsub(/../, '<\0>').should == "<he><ll><o!>"
+    str.gsub(/../, '<\&>').should == "<he><ll><o!>"
+    str.gsub(/(.)./, '<\0>').should == "<he><ll><o!>"
+  end
+
+  it "replaces \\` with everything before the current match" do
+    str = "hello!"
+    
+    str.gsub("", '<\`>').should == "<>h<h>e<he>l<hel>l<hell>o<hello>!<hello!>"
+    str.gsub("h", '<\`>').should == "<>ello!"
+    str.gsub("l", '<\`>').should == "he<he><hel>o!"
+    str.gsub("!", '<\`>').should == "hello<hello>"
+    
+    str.gsub(//, '<\`>').should == "<>h<h>e<he>l<hel>l<hell>o<hello>!<hello!>"
+    str.gsub(/../, '<\`>').should == "<><he><hell>"
+  end
+
+  it "replaces \\' with everything after the current match" do
+    str = "hello!"
+    
+    str.gsub("", '<\\\'>').should == "<hello!>h<ello!>e<llo!>l<lo!>l<o!>o<!>!<>"
+    str.gsub("h", '<\\\'>').should == "<ello!>ello!"
+    str.gsub("ll", '<\\\'>').should == "he<o!>o!"
+    str.gsub("!", '<\\\'>').should == "hello<>"
+    
+    str.gsub(//, '<\\\'>').should == "<hello!>h<ello!>e<llo!>l<lo!>l<o!>o<!>!<>"
+    str.gsub(/../, '<\\\'>').should == "<llo!><o!><>"
+  end
+  
+  it "replaces \\+ with the last paren that actually matched" do
+    str = "hello!"
+    
+    str.gsub(/(.)(.)/, '\+').should == "el!"
+    str.gsub(/(.)(.)+/, '\+').should == "!"
+    str.gsub(/(.)()/, '\+').should == ""
+    str.gsub(/(.)(.{20})?/, '<\+>').should == "<h><e><l><l><o><!>"
+
+    str = "ABCDEFGHIJKLabcdefghijkl"
+    re = /#{"(.)" * 12}/
+    str.gsub(re, '\+').should == "Ll"
+  end
+
+  it "treats \\+ as an empty string if there was no captures" do
+    "hello!".gsub(/./, '\+').should == ""
+  end
+  
+  it "maps \\\\ in replacement to \\" do
+    "hello".gsub(/./, '\\\\').should == '\\' * 5
+  end
+
+  it "leaves unknown \\x escapes in replacement untouched" do
+    "hello".gsub(/./, '\\x').should == '\\x' * 5
+    "hello".gsub(/./, '\\y').should == '\\y' * 5
+  end
+
+  it "leaves \\ at the end of replacement untouched" do
+    "hello".gsub(/./, 'hah\\').should == 'hah\\' * 5
+  end
+  
+  it "taints the result if the original string or replacement is tainted" do
+    hello = "hello"
+    hello_t = "hello"
+    a = "a"
+    a_t = "a"
+    empty = ""
+    empty_t = ""
+    
+    hello_t.taint; a_t.taint; empty_t.taint
+    
+    hello_t.gsub(/./, a).tainted?.should == true
+    hello_t.gsub(/./, empty).tainted?.should == true
+
+    hello.gsub(/./, a_t).tainted?.should == true
+    hello.gsub(/./, empty_t).tainted?.should == true
+    hello.gsub(//, empty_t).tainted?.should == true
+    
+    hello.gsub(//.taint, "foo").tainted?.should == false
+  end
+
+  ruby_version_is "1.9" do
+    it "untrusts the result if the original string or replacement is untrusted" do
+      hello = "hello"
+      hello_t = "hello"
+      a = "a"
+      a_t = "a"
+      empty = ""
+      empty_t = ""
+
+      hello_t.untrust; a_t.untrust; empty_t.untrust
+
+      hello_t.gsub(/./, a).untrusted?.should == true
+      hello_t.gsub(/./, empty).untrusted?.should == true
+
+      hello.gsub(/./, a_t).untrusted?.should == true
+      hello.gsub(/./, empty_t).untrusted?.should == true
+      hello.gsub(//, empty_t).untrusted?.should == true
+
+      hello.gsub(//.untrust, "foo").untrusted?.should == false
+    end
+  end
+
+  it "tries to convert pattern to a string using to_str" do
+    pattern = mock('.')
+    def pattern.to_str() "." end
+    
+    "hello.".gsub(pattern, "!").should == "hello!"
+  end
+
+  it "raises a TypeError when pattern can't be converted to a string" do
+    lambda { "hello".gsub(:woot, "x") }.should raise_error(TypeError)
+    lambda { "hello".gsub(?e, "x")    }.should raise_error(TypeError)
+  end
+  
+  it "tries to convert replacement to a string using to_str" do
+    replacement = mock('hello_replacement')
+    def replacement.to_str() "hello_replacement" end
+    
+    "hello".gsub(/hello/, replacement).should == "hello_replacement"
+  end
+  
+  it "raises a TypeError when replacement can't be converted to a string" do
+    lambda { "hello".gsub(/[aeiou]/, :woot) }.should raise_error(TypeError)
+    lambda { "hello".gsub(/[aeiou]/, ?f)    }.should raise_error(TypeError)
+  end
+  
+  it "returns subclass instances when called on a subclass" do
+    StringSpecs::MyString.new("").gsub(//, "").class.should == StringSpecs::MyString
+    StringSpecs::MyString.new("").gsub(/foo/, "").class.should == StringSpecs::MyString
+    StringSpecs::MyString.new("foo").gsub(/foo/, "").class.should == StringSpecs::MyString
+    StringSpecs::MyString.new("foo").gsub("foo", "").class.should == StringSpecs::MyString
+  end
+
+  # Note: $~ cannot be tested because mspec messes with it
+  
+  it "sets $~ to MatchData of last match and nil when there's none" do
+    'hello.'.gsub('hello', 'x')
+    $~[0].should == 'hello'
+  
+    'hello.'.gsub('not', 'x')
+    $~.should == nil
+  
+    'hello.'.gsub(/.(.)/, 'x')
+    $~[0].should == 'o.'
+  
+    'hello.'.gsub(/not/, 'x')
+    $~.should == nil
+  end
+end
+
+describe "String#gsub with pattern and block" do
+  it "returns a copy of self with all occurrences of pattern replaced with the block's return value" do
+    "hello".gsub(/./) { |s| s.succ + ' ' }.should == "i f m m p "
+    "hello!".gsub(/(.)(.)/) { |*a| a.inspect }.should == '["he"]["ll"]["o!"]'
+    "hello".gsub('l') { 'x'}.should == 'hexxo'
+  end
+  
+  it "sets $~ for access from the block" do
+    str = "hello"
+    str.gsub(/([aeiou])/) { "<#{$~[1]}>" }.should == "h<e>ll<o>"
+    str.gsub(/([aeiou])/) { "<#{$1}>" }.should == "h<e>ll<o>"
+    str.gsub("l") { "<#{$~[0]}>" }.should == "he<l><l>o"
+    
+    offsets = []
+    
+    str.gsub(/([aeiou])/) do
+      md = $~
+      md.string.should == str
+      offsets << md.offset(0)
+      str
+    end.should == "hhellollhello"
+    
+    offsets.should == [[1, 2], [4, 5]]
+  end
+  
+  it "restores $~ after leaving the block" do
+    [/./, "l"].each do |pattern|
+      old_md = nil
+      "hello".gsub(pattern) do
+        old_md = $~
+        "ok".match(/./)
+        "x"
+      end
+
+      $~.should == old_md
+      $~.string.should == "hello"
+    end
+  end
+
+  it "sets $~ to MatchData of last match and nil when there's none for access from outside" do
+    'hello.'.gsub('l') { 'x' }
+    $~.begin(0).should == 3
+    $~[0].should == 'l'
+
+    'hello.'.gsub('not') { 'x' }
+    $~.should == nil
+
+    'hello.'.gsub(/.(.)/) { 'x' }
+    $~[0].should == 'o.'
+
+    'hello.'.gsub(/not/) { 'x' }
+    $~.should == nil
+  end
+
+  it "raises a RuntimeError if the string is modified while substituting" do
+    str = "hello"
+    lambda { str.gsub(//) { str[0] = 'x' } }.should raise_error(RuntimeError)
+  end
+  
+  it "doesn't interpolate special sequences like \\1 for the block's return value" do
+    repl = '\& \0 \1 \` \\\' \+ \\\\ foo'
+    "hello".gsub(/(.+)/) { repl }.should == repl
+  end
+  
+  it "converts the block's return value to a string using to_s" do
+    replacement = mock('hello_replacement')
+    def replacement.to_s() "hello_replacement" end
+    
+    "hello".gsub(/hello/) { replacement }.should == "hello_replacement"
+    
+    obj = mock('ok')
+    def obj.to_s() "ok" end
+    
+    "hello".gsub(/.+/) { obj }.should == "ok"
+  end
+
+  ruby_version_is "1.9" do
+    it "untrusts the result if the original string or replacement is untrusted" do
+      hello = "hello"
+      hello_t = "hello"
+      a = "a"
+      a_t = "a"
+      empty = ""
+      empty_t = ""
+
+      hello_t.untrust; a_t.untrust; empty_t.untrust
+
+      hello_t.gsub(/./) { a }.untrusted?.should == true
+      hello_t.gsub(/./) { empty }.untrusted?.should == true
+
+      hello.gsub(/./) { a_t }.untrusted?.should == true
+      hello.gsub(/./) { empty_t }.untrusted?.should == true
+      hello.gsub(//) { empty_t }.untrusted?.should == true
+
+      hello.gsub(//.untrust) { "foo" }.untrusted?.should == false
+    end
+  end
+end
+
+describe "String#gsub! with pattern and replacement" do
+  it "modifies self in place and returns self" do
+    a = "hello"
+    a.gsub!(/[aeiou]/, '*').should equal(a)
+    a.should == "h*ll*"
+  end
+
+  it "taints self if replacement is tainted" do
+    a = "hello"
+    a.gsub!(/./.taint, "foo").tainted?.should == false
+    a.gsub!(/./, "foo".taint).tainted?.should == true
+  end
+
+  ruby_version_is "1.9" do
+    it "untrusts self if replacement is untrusted" do
+      a = "hello"
+      a.gsub!(/./.untrust, "foo").untrusted?.should == false
+      a.gsub!(/./, "foo".untrust).untrusted?.should == true
+    end
+  end
+  
+  it "returns nil if no modifications were made" do
+    a = "hello"
+    a.gsub!(/z/, '*').should == nil
+    a.gsub!(/z/, 'z').should == nil
+    a.should == "hello"
+  end
+  
+  it "raises a TypeError when self is frozen" do
+    s = "hello"
+    s.freeze
+  
+    s.gsub!(/ROAR/, "x") # ok
+    lambda { s.gsub!(/e/, "e")       }.should raise_error(TypeError)
+    lambda { s.gsub!(/[aeiou]/, '*') }.should raise_error(TypeError)
+  end
+end
+
+describe "String#gsub! with pattern and block" do
+  it "modifies self in place and returns self" do
+    a = "hello"
+    a.gsub!(/[aeiou]/) { '*' }.should equal(a)
+    a.should == "h*ll*"
+  end
+
+  it "taints self if block's result is tainted" do
+    a = "hello"
+    a.gsub!(/./.taint) { "foo" }.tainted?.should == false
+    a.gsub!(/./) { "foo".taint }.tainted?.should == true
+  end
+
+  ruby_version_is "1.9" do
+    it "untrusts self if block's result is untrusted" do
+      a = "hello"
+      a.gsub!(/./.untrust) { "foo" }.untrusted?.should == false
+      a.gsub!(/./) { "foo".untrust }.untrusted?.should == true
+    end
+  end
+  
+  it "returns nil if no modifications were made" do
+    a = "hello"
+    a.gsub!(/z/) { '*' }.should == nil
+    a.gsub!(/z/) { 'z' }.should == nil
+    a.should == "hello"
+  end
+  
+  it "raises a RuntimeError when self is frozen" do
+    s = "hello"
+    s.freeze
+
+    s.gsub!(/ROAR/) { "x" } # ok
+    lambda { s.gsub!(/e/) { "e" }       }.should raise_error(RuntimeError)
+    lambda { s.gsub!(/[aeiou]/) { '*' } }.should raise_error(RuntimeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/hash_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/hash_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/hash_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#hash" do
+  it "returns a hash based on a string's length and content" do
+    "abc".hash.should == "abc".hash
+    "abc".hash.should_not == "cba".hash
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/hex_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/hex_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/hex_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,53 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+# TODO: Move actual results to String#to_int() and spec in terms of it
+describe "String#hex" do
+  it "treats leading characters of self as a string of hex digits" do
+    "0a".hex.should == 10
+    "0o".hex.should == 0
+    "0x".hex.should == 0
+    "A_BAD_BABE".hex.should == 0xABADBABE
+    "0b1010".hex.should == "b1010".hex
+    "0d500".hex.should == "d500".hex
+    "abcdefG".hex.should == 0xabcdef
+  end
+  
+  ruby_version_is "" ... "1.8.7" do
+    it "accepts a sequence of underscores as part of a number" do
+      "a__b".hex.should == 0xab
+      "a____b".hex.should == 0xab
+      "a___f".hex.should == 0xaf
+    end
+  end
+  
+  ruby_version_is "1.8.7" do
+    it "does not accept a sequence of underscores as part of a number" do
+      "a__b".hex.should == 0xa
+      "a____b".hex.should == 0xa
+      "a___f".hex.should == 0xa
+    end
+  end
+  
+  it "takes an optional sign" do
+    "-1234".hex.should == -4660
+    "+1234".hex.should == 4660
+  end
+  
+  it "takes an optional 0x" do
+    "0x0a".hex.should == 10
+    "0a".hex.should == 10
+  end
+
+  it "requires that the sign is in front of the 0x if present" do 
+    "-0x1".hex.should == -1
+    "0x-1".hex.should == 0
+  end  
+  
+  it "returns 0 on error" do
+    "".hex.should == 0
+    "+-5".hex.should == 0
+    "wombat".hex.should == 0
+    "0x0x42".hex.should == 0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/include_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/include_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/include_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,45 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#include? with String" do
+  it "returns true if self contains other_str" do
+    "hello".include?("lo").should == true
+    "hello".include?("ol").should == false
+  end
+  
+  it "ignores subclass differences" do
+    "hello".include?(StringSpecs::MyString.new("lo")).should == true
+    StringSpecs::MyString.new("hello").include?("lo").should == true
+    StringSpecs::MyString.new("hello").include?(StringSpecs::MyString.new("lo")).should == true
+  end
+  
+  it "tries to convert other to string using to_str" do
+    other = mock('lo')
+    other.should_receive(:to_str).and_return("lo")
+
+    "hello".include?(other).should == true
+  end
+  
+  it "raises a TypeError if other can't be converted to string" do
+    lambda { "hello".include?(:lo)       }.should raise_error(TypeError)
+    lambda { "hello".include?(mock('x')) }.should raise_error(TypeError)
+  end
+end
+
+describe "String#include? with Fixnum" do
+  it "returns true if self contains the given char" do
+    "hello".include?(?h).should == true
+    "hello".include?(?z).should == false
+    "hello".include?(0).should == false
+  end
+  
+  it "uses fixnum % 256" do
+    "hello".include?(?h + 256 * 3).should == true
+  end
+  
+  it "doesn't try to convert fixnum to an Integer using to_int" do
+    obj = mock('x')
+    obj.should_not_receive(:to_int)
+    lambda { "hello".include?(obj) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/index_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/index_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/index_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,334 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#index with object" do
+  it "raises a TypeError if obj isn't a String, Fixnum or Regexp" do
+    lambda { "hello".index(:sym)      }.should raise_error(TypeError)
+    lambda { "hello".index(mock('x')) }.should raise_error(TypeError)
+  end
+
+  it "doesn't try to convert obj to an Integer via to_int" do
+    obj = mock('x')
+    lambda { "hello".index(obj) }.should raise_error(TypeError)
+  end
+
+  it "tries to convert obj to a string via to_str" do
+    obj = mock('lo')
+    obj.should_receive(:to_str).and_return("lo")
+    "hello".index(obj).should == "hello".index("lo")
+  end
+end
+
+describe "String#index with Fixnum" do
+  it "returns the index of the first occurrence of the given character" do
+    "hello".index(?e).should == 1
+    "hello".index(?l).should == 2
+  end
+  
+  it "character values over 255 (256th ASCII character) always result in nil" do
+    # A naive implementation could try to use % 256
+    "hello".index(?e + 256 * 3).should == nil
+  end
+
+  it "negative character values always result in nil" do
+    # A naive implementation could try to use % 256
+    "hello".index(-(256 - ?e)).should == nil
+  end
+  
+  it "starts the search at the given offset" do
+    "blablabla".index(?b, 0).should == 0
+    "blablabla".index(?b, 1).should == 3
+    "blablabla".index(?b, 2).should == 3
+    "blablabla".index(?b, 3).should == 3
+    "blablabla".index(?b, 4).should == 6
+    "blablabla".index(?b, 5).should == 6
+    "blablabla".index(?b, 6).should == 6
+
+    "blablabla".index(?a, 0).should == 2
+    "blablabla".index(?a, 2).should == 2
+    "blablabla".index(?a, 3).should == 5
+    "blablabla".index(?a, 4).should == 5
+    "blablabla".index(?a, 5).should == 5
+    "blablabla".index(?a, 6).should == 8
+    "blablabla".index(?a, 7).should == 8
+    "blablabla".index(?a, 8).should == 8
+  end
+  
+  it "starts the search at offset + self.length if offset is negative" do
+    str = "blablabla"
+    
+    [?a, ?b].each do |needle|
+      (-str.length .. -1).each do |offset|
+        str.index(needle, offset).should ==
+        str.index(needle, offset + str.length)
+      end
+    end
+
+    "blablabla".index(?b, -9).should == 0
+  end
+  
+  it "returns nil if offset + self.length is < 0 for negative offsets" do
+    "blablabla".index(?b, -10).should == nil
+    "blablabla".index(?b, -20).should == nil
+  end
+  
+  it "returns nil if the character isn't found" do
+    "hello".index(0).should == nil
+    
+    "hello".index(?H).should == nil
+    "hello".index(?z).should == nil
+    "hello".index(?e, 2).should == nil
+
+    "blablabla".index(?b, 7).should == nil
+    "blablabla".index(?b, 10).should == nil
+
+    "blablabla".index(?a, 9).should == nil
+    "blablabla".index(?a, 20).should == nil
+  end
+  
+  it "converts start_offset to an integer via to_int" do
+    obj = mock('1')
+    obj.should_receive(:to_int).and_return(1)
+    "ROAR".index(?R, obj).should == 3
+  end
+end
+
+describe "String#index with String" do
+  it "behaves the same as String#index(char) for one-character strings" do
+    ["blablabla", "hello cruel world...!"].each do |str|
+      str.split("").uniq.each do |str|
+        chr = str[0]
+        str.index(str).should == str.index(chr)
+        
+        0.upto(str.size + 1) do |start|
+          str.index(str, start).should == str.index(chr, start)
+        end
+        
+        (-str.size - 1).upto(-1) do |start|
+          str.index(str, start).should == str.index(chr, start)
+        end
+      end
+    end
+  end
+  
+  it "returns the index of the first occurrence of the given substring" do
+    "blablabla".index("").should == 0
+    "blablabla".index("b").should == 0
+    "blablabla".index("bla").should == 0
+    "blablabla".index("blabla").should == 0
+    "blablabla".index("blablabla").should == 0
+
+    "blablabla".index("l").should == 1
+    "blablabla".index("la").should == 1
+    "blablabla".index("labla").should == 1
+    "blablabla".index("lablabla").should == 1
+
+    "blablabla".index("a").should == 2
+    "blablabla".index("abla").should == 2
+    "blablabla".index("ablabla").should == 2
+  end  
+  
+  it "doesn't set $~" do
+    $~ = nil
+    
+    'hello.'.index('ll')
+    $~.should == nil
+  end
+
+  it "ignores string subclasses" do
+    "blablabla".index(StringSpecs::MyString.new("bla")).should == 0
+    StringSpecs::MyString.new("blablabla").index("bla").should == 0
+    StringSpecs::MyString.new("blablabla").index(StringSpecs::MyString.new("bla")).should == 0
+  end
+  
+  it "starts the search at the given offset" do
+    "blablabla".index("bl", 0).should == 0
+    "blablabla".index("bl", 1).should == 3
+    "blablabla".index("bl", 2).should == 3
+    "blablabla".index("bl", 3).should == 3
+
+    "blablabla".index("bla", 0).should == 0
+    "blablabla".index("bla", 1).should == 3
+    "blablabla".index("bla", 2).should == 3
+    "blablabla".index("bla", 3).should == 3
+
+    "blablabla".index("blab", 0).should == 0
+    "blablabla".index("blab", 1).should == 3
+    "blablabla".index("blab", 2).should == 3
+    "blablabla".index("blab", 3).should == 3
+
+    "blablabla".index("la", 1).should == 1
+    "blablabla".index("la", 2).should == 4
+    "blablabla".index("la", 3).should == 4
+    "blablabla".index("la", 4).should == 4
+
+    "blablabla".index("lab", 1).should == 1
+    "blablabla".index("lab", 2).should == 4
+    "blablabla".index("lab", 3).should == 4
+    "blablabla".index("lab", 4).should == 4
+
+    "blablabla".index("ab", 2).should == 2
+    "blablabla".index("ab", 3).should == 5
+    "blablabla".index("ab", 4).should == 5
+    "blablabla".index("ab", 5).should == 5
+    
+    "blablabla".index("", 0).should == 0
+    "blablabla".index("", 1).should == 1
+    "blablabla".index("", 2).should == 2
+    "blablabla".index("", 7).should == 7
+    "blablabla".index("", 8).should == 8
+    "blablabla".index("", 9).should == 9
+  end
+  
+  it "starts the search at offset + self.length if offset is negative" do
+    str = "blablabla"
+    
+    ["bl", "bla", "blab", "la", "lab", "ab", ""].each do |needle|
+      (-str.length .. -1).each do |offset|
+        str.index(needle, offset).should ==
+        str.index(needle, offset + str.length)
+      end
+    end
+  end
+
+  it "returns nil if the substring isn't found" do
+    "blablabla".index("B").should == nil
+    "blablabla".index("z").should == nil
+    "blablabla".index("BLA").should == nil
+    "blablabla".index("blablablabla").should == nil
+    "blablabla".index("", 10).should == nil
+        
+    "hello".index("he", 1).should == nil
+    "hello".index("he", 2).should == nil
+  end
+  
+  it "converts start_offset to an integer via to_int" do
+    obj = mock('1')
+    obj.should_receive(:to_int).and_return(1)
+    "RWOARW".index("RW", obj).should == 4
+  end
+end
+
+describe "String#index with Regexp" do
+  it "behaves the same as String#index(string) for escaped string regexps" do
+    ["blablabla", "hello cruel world...!"].each do |str|
+      ["", "b", "bla", "lab", "o c", "d."].each do |needle|
+        regexp = Regexp.new(Regexp.escape(needle))
+        str.index(regexp).should == str.index(needle)
+        
+        0.upto(str.size + 1) do |start|
+          str.index(regexp, start).should == str.index(needle, start)
+        end
+        
+        (-str.size - 1).upto(-1) do |start|
+          str.index(regexp, start).should == str.index(needle, start)
+        end
+      end
+    end
+  end
+  
+  it "returns the index of the first match of regexp" do
+    "blablabla".index(/bla/).should == 0
+    "blablabla".index(/BLA/i).should == 0
+
+    "blablabla".index(/.{0}/).should == 0
+    "blablabla".index(/.{6}/).should == 0
+    "blablabla".index(/.{9}/).should == 0
+
+    "blablabla".index(/.*/).should == 0
+    "blablabla".index(/.+/).should == 0
+
+    "blablabla".index(/lab|b/).should == 0
+    
+    "blablabla".index(/\A/).should == 0
+    "blablabla".index(/\Z/).should == 9
+    "blablabla".index(/\z/).should == 9
+    "blablabla\n".index(/\Z/).should == 9
+    "blablabla\n".index(/\z/).should == 10
+
+    "blablabla".index(/^/).should == 0
+    "\nblablabla".index(/^/).should == 0
+    "b\nablabla".index(/$/).should == 1
+    "bl\nablabla".index(/$/).should == 2
+    
+    "blablabla".index(/.l./).should == 0
+  end
+
+  it "sets $~ to MatchData of match and nil when there's none" do
+    'hello.'.index(/.(.)/)
+    $~[0].should == 'he'
+
+    'hello.'.index(/not/)
+    $~.should == nil
+  end
+  
+  it "starts the search at the given offset" do
+    "blablabla".index(/.{0}/, 5).should == 5
+    "blablabla".index(/.{1}/, 5).should == 5
+    "blablabla".index(/.{2}/, 5).should == 5
+    "blablabla".index(/.{3}/, 5).should == 5
+    "blablabla".index(/.{4}/, 5).should == 5
+
+    "blablabla".index(/.{0}/, 3).should == 3
+    "blablabla".index(/.{1}/, 3).should == 3
+    "blablabla".index(/.{2}/, 3).should == 3
+    "blablabla".index(/.{5}/, 3).should == 3
+    "blablabla".index(/.{6}/, 3).should == 3
+
+    "blablabla".index(/.l./, 0).should == 0
+    "blablabla".index(/.l./, 1).should == 3
+    "blablabla".index(/.l./, 2).should == 3
+    "blablabla".index(/.l./, 3).should == 3
+    
+    "xblaxbla".index(/x./, 0).should == 0
+    "xblaxbla".index(/x./, 1).should == 4
+    "xblaxbla".index(/x./, 2).should == 4
+    
+    "blablabla\n".index(/\Z/, 9).should == 9
+  end
+  
+  it "starts the search at offset + self.length if offset is negative" do
+    str = "blablabla"
+    
+    ["bl", "bla", "blab", "la", "lab", "ab", ""].each do |needle|
+      (-str.length .. -1).each do |offset|
+        str.index(needle, offset).should ==
+        str.index(needle, offset + str.length)
+      end
+    end
+  end
+
+  it "returns nil if the substring isn't found" do
+    "blablabla".index(/BLA/).should == nil
+
+    "blablabla".index(/.{10}/).should == nil
+    "blaxbla".index(/.x/, 3).should == nil
+    "blaxbla".index(/..x/, 2).should == nil
+  end
+
+  it "supports \\G which matches at the given start offset" do
+    "helloYOU.".index(/\GYOU/, 5).should == 5
+    "helloYOU.".index(/\GYOU/).should == nil
+
+    re = /\G.+YOU/
+    # The # marks where \G will match.
+    [
+      ["#hi!YOUall.", 0],
+      ["h#i!YOUall.", 1],
+      ["hi#!YOUall.", 2],
+      ["hi!#YOUall.", nil]
+    ].each do |spec|
+      
+      start = spec[0].index("#")
+      str = spec[0].delete("#")
+      
+      str.index(re, start).should == spec[1]
+    end
+  end
+  
+  it "converts start_offset to an integer via to_int" do
+    obj = mock('1')
+    obj.should_receive(:to_int).and_return(1)
+    "RWOARW".index(/R./, obj).should == 4
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,65 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#initialize" do
+  it "is a private method" do
+    "".private_methods.should include("initialize")
+  end
+
+  it "replaces contents of self with the passed string" do
+    s = "some string"
+    id = s.object_id
+    s.send :initialize, "another string"
+    s.should == "another string"
+    s.object_id.should == id
+  end
+
+  it "does not change self when not passed a string" do
+    s = "some string"
+    s.send :initialize
+    s.should == "some string"
+  end
+
+  it "replaces the taint status of self with that of the passed string" do
+    a = "an untainted string"
+    b = "a tainted string".taint
+    a.send :initialize, b
+    a.tainted?.should == true
+  end
+
+  it "returns an instance of a subclass" do
+    a = StringSpecs::MyString.new("blah")
+    a.should be_kind_of(StringSpecs::MyString)
+    a.should == "blah"
+  end
+
+  it "is called on subclasses" do
+    s = StringSpecs::SubString.new
+    s.special.should == nil
+    s.should == ""
+
+    s = StringSpecs::SubString.new "subclass"
+    s.special.should == "subclass"
+    s.should == ""
+  end
+
+  it "converts its argument to a string representation" do
+    obj = mock 'foo'
+    obj.should_receive(:to_str).and_return('foo')
+
+    String.new obj
+  end
+
+  # Rubinius String makes a String of 5 NULs.  This behavior may need to be
+  # removed from many places.
+  it "raises TypeError on inconvertible object" do
+    lambda { String.new 5 }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError if self is frozen" do
+    a = "hello".freeze
+
+    a.send :initialize, a
+    lambda { a.send :initialize, "world" }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/insert_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/insert_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/insert_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,63 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#insert with index, other" do
+  it "inserts other before the character at the given index" do
+    "abcd".insert(0, 'X').should == "Xabcd"
+    "abcd".insert(3, 'X').should == "abcXd"
+    "abcd".insert(4, 'X').should == "abcdX"
+  end
+
+  it "modifies self in place" do
+    a = "abcd"
+    a.insert(4, 'X').should == "abcdX"
+    a.should == "abcdX"
+  end
+
+  it "inserts after the given character on an negative count" do
+    "abcd".insert(-5, 'X').should == "Xabcd"
+    "abcd".insert(-3, 'X').should == "abXcd"
+    "abcd".insert(-1, 'X').should == "abcdX"
+  end
+
+  it "raises an IndexError if the index is beyond string" do
+    lambda { "abcd".insert(5, 'X')  }.should raise_error(IndexError)
+    lambda { "abcd".insert(-6, 'X') }.should raise_error(IndexError)
+  end
+
+  it "converts index to an integer using to_int" do
+    other = mock('-3')
+    other.should_receive(:to_int).and_return(-3)
+
+    "abcd".insert(other, "XYZ").should == "abXYZcd"
+  end
+
+  it "converts other to a string using to_str" do
+    other = mock('XYZ')
+    other.should_receive(:to_str).and_return("XYZ")
+
+    "abcd".insert(-3, other).should == "abXYZcd"
+  end
+
+  it "taints self if string to insert is tainted" do
+    str = "abcd"
+    str.insert(0, "T".taint).tainted?.should == true
+
+    str = "abcd"
+    other = mock('T')
+    def other.to_str() "T".taint end
+    str.insert(0, other).tainted?.should == true
+  end
+
+  it "raises a TypeError if other can't be converted to string" do
+    lambda { "abcd".insert(-6, ?e)        }.should raise_error(TypeError)
+    lambda { "abcd".insert(-6, :sym)      }.should raise_error(TypeError)
+    lambda { "abcd".insert(-6, mock('x')) }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError if self is frozen" do
+    str = "abcd".freeze
+    lambda { str.insert(4, '')  }.should raise_error(TypeError)
+    lambda { str.insert(4, 'X') }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,47 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#inspect" do
+  # Older versions of MRI wrongly print \b as \010
+  it "produces a version of self with all nonprinting charaters replaced by \\nnn notation" do
+    ("\000".."A").to_a.to_s.inspect.should == "\"\\000\\001\\002\\003\\004\\005\\006\\a\\b\\t\\n\\v\\f\\r\\016\\017\\020\\021\\022\\023\\024\\025\\026\\027\\030\\031\\032\\e\\034\\035\\036\\037 !\\\"\\\#$%&'()*+,-./0123456789\""
+  end
+  
+  it "produces different output based on $KCODE" do
+    old_kcode = $KCODE
+
+    begin
+      $KCODE = "NONE"
+      "äöü".inspect.should == "\"\\303\\244\\303\\266\\303\\274\""
+
+      $KCODE = "UTF-8"
+      "äöü".inspect.should == "\"äöü\""
+    ensure
+      $KCODE = old_kcode
+    end
+  end
+
+  it "can handle malformed UTF-8 string when $KCODE is UTF-8" do
+    old_kcode = $KCODE
+
+    begin
+      $KCODE = "UTF-8"
+      # malformed UTF-8 sequence
+      "\007äöüz\303".inspect.should == "\"\\aäöüz\\303\""
+    ensure
+      $KCODE = old_kcode
+    end
+  end
+
+  it "taints the result if self is tainted" do
+    "foo".taint.inspect.tainted?.should == true
+    "foo\n".taint.inspect.tainted?.should == true
+  end
+
+  it "does not return subclass instances" do
+    str = StringSpecs::MyString.new
+    str << "test"
+    str.should == "test"
+    str.inspect.class.should_not == StringSpecs::MyString
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/intern_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/intern_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/intern_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.dirname(__FILE__) + '/shared/to_sym.rb'
+
+describe "String#intern" do
+  it_behaves_like(:string_to_sym, :intern)
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/string/length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.dirname(__FILE__) + '/shared/length'
+
+describe "String#length" do
+  it_behaves_like(:string_length, :length)
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/string/ljust_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/ljust_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/ljust_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,82 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#ljust with length, padding" do
+  it "returns a new string of specified length with self left justified and padded with padstr" do
+    "hello".ljust(20, '1234').should == "hello123412341234123"
+
+    "".ljust(1, "abcd").should == "a"
+    "".ljust(2, "abcd").should == "ab"
+    "".ljust(3, "abcd").should == "abc"
+    "".ljust(4, "abcd").should == "abcd"
+    "".ljust(6, "abcd").should == "abcdab"
+
+    "OK".ljust(3, "abcd").should == "OKa"
+    "OK".ljust(4, "abcd").should == "OKab"
+    "OK".ljust(6, "abcd").should == "OKabcd"
+    "OK".ljust(8, "abcd").should == "OKabcdab"
+  end
+  
+  it "pads with whitespace if no padstr is given" do
+    "hello".ljust(20).should == "hello               "
+  end
+
+  it "returns self if it's longer than or as long as the specified length" do
+    "".ljust(0).should == ""
+    "".ljust(-1).should == ""
+    "hello".ljust(4).should == "hello"
+    "hello".ljust(-1).should == "hello"
+    "this".ljust(3).should == "this"
+    "radiology".ljust(8, '-').should == "radiology"
+  end
+
+  it "taints result when self or padstr is tainted" do
+    "x".taint.ljust(4).tainted?.should == true
+    "x".taint.ljust(0).tainted?.should == true
+    "".taint.ljust(0).tainted?.should == true
+    "x".taint.ljust(4, "*").tainted?.should == true
+    "x".ljust(4, "*".taint).tainted?.should == true
+  end
+
+  it "tries to convert length to an integer using to_int" do
+    "^".ljust(3.8, "_^").should == "^_^"
+
+    obj = mock('3')
+    obj.should_receive(:to_int).and_return(3)
+
+    "o".ljust(obj, "_o").should == "o_o"
+  end
+  
+  it "raises a TypeError when length can't be converted to an integer" do
+    lambda { "hello".ljust("x")       }.should raise_error(TypeError)
+    lambda { "hello".ljust("x", "y")  }.should raise_error(TypeError)
+    lambda { "hello".ljust([])        }.should raise_error(TypeError)
+    lambda { "hello".ljust(mock('x')) }.should raise_error(TypeError)
+  end
+
+  it "tries to convert padstr to a string using to_str" do
+    padstr = mock('123')
+    padstr.should_receive(:to_str).and_return("123")
+
+    "hello".ljust(10, padstr).should == "hello12312"
+  end
+
+  it "raises a TypeError when padstr can't be converted" do
+    lambda { "hello".ljust(20, :sym)      }.should raise_error(TypeError)
+    lambda { "hello".ljust(20, ?c)        }.should raise_error(TypeError)
+    lambda { "hello".ljust(20, mock('x')) }.should raise_error(TypeError)
+  end
+  
+  it "raises an ArgumentError when padstr is empty" do
+    lambda { "hello".ljust(10, '') }.should raise_error(ArgumentError)
+  end
+  
+  it "returns subclass instances when called on subclasses" do
+    StringSpecs::MyString.new("").ljust(10).class.should == StringSpecs::MyString
+    StringSpecs::MyString.new("foo").ljust(10).class.should == StringSpecs::MyString
+    StringSpecs::MyString.new("foo").ljust(10, StringSpecs::MyString.new("x")).class.should == StringSpecs::MyString
+    
+    "".ljust(10, StringSpecs::MyString.new("x")).class.should == String
+    "foo".ljust(10, StringSpecs::MyString.new("x")).class.should == String
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/lstrip_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/lstrip_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/lstrip_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,45 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#lstrip" do
+  it "returns a copy of self with leading whitespace removed" do
+   "  hello  ".lstrip.should == "hello  "
+   "  hello world  ".lstrip.should == "hello world  "
+   "\n\r\t\n\v\r hello world  ".lstrip.should == "hello world  "
+   "hello".lstrip.should == "hello"
+  end
+
+  # spec/core/string/lstrip_spec.rb
+  not_compliant_on :rubinius do
+    it "does not strip leading \0" do
+     "\x00hello".lstrip.should == "\x00hello"
+    end
+  end
+
+  it "taints the result when self is tainted" do
+    "".taint.lstrip.tainted?.should == true
+    "ok".taint.lstrip.tainted?.should == true
+    "   ok".taint.lstrip.tainted?.should == true
+  end
+end
+
+describe "String#lstrip!" do
+  it "modifies self in place and returns self" do
+    a = "  hello  "
+    a.lstrip!.should equal(a)
+    a.should == "hello  "
+  end
+
+  it "returns nil if no modifications were made" do
+    a = "hello"
+    a.lstrip!.should == nil
+    a.should == "hello"
+  end
+
+  it "raises a TypeError if self is frozen" do
+    "hello".freeze.lstrip! # ok, nothing changed
+    "".freeze.lstrip! # ok, nothing changed
+
+    lambda { "  hello  ".freeze.lstrip! }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/match_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/match_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/match_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,81 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#=~" do
+  it "behaves the same way as index() when given a regexp" do
+    ("rudder" =~ /udder/).should == "rudder".index(/udder/)
+    ("boat" =~ /[^fl]oat/).should == "boat".index(/[^fl]oat/)
+    ("bean" =~ /bag/).should == "bean".index(/bag/)
+    ("true" =~ /false/).should == "true".index(/false/)
+  end
+
+  it "raises a TypeError if a obj is a string" do
+    lambda { "some string" =~ "another string" }.should raise_error(TypeError)
+    lambda { "a" =~ StringSpecs::MyString.new("b")          }.should raise_error(TypeError)
+  end
+  
+  it "invokes obj.=~ with self if obj is neither a string nor regexp" do
+    str = "w00t"
+    obj = mock('x')
+
+    obj.should_receive(:=~).with(str).any_number_of_times.and_return(true)
+    str.should =~ obj
+
+    obj = mock('y')
+    obj.should_receive(:=~).with(str).any_number_of_times.and_return(false)
+    str.should_not =~ obj
+  end
+  
+  it "sets $~ to MatchData when there is a match and nil when there's none" do
+    'hello' =~ /./
+    $~[0].should == 'h'
+    
+    'hello' =~ /not/
+    $~.should == nil
+  end
+end
+
+describe "String#match" do
+  it "matches the pattern against self" do
+    'hello'.match(/(.)\1/)[0].should == 'll'
+  end
+  
+  it "tries to convert pattern to a string via to_str" do
+    obj = mock('.')
+    def obj.to_str() "." end
+    "hello".match(obj)[0].should == "h"
+    
+    obj = mock('.')
+    def obj.respond_to?(type) true end
+    def obj.method_missing(*args) "." end
+    "hello".match(obj)[0].should == "h"    
+  end
+  
+  it "raises a TypeError if pattern is not a regexp or a string" do
+    lambda { 'hello'.match(10)   }.should raise_error(TypeError)
+    lambda { 'hello'.match(:ell) }.should raise_error(TypeError)
+  end
+
+  it "converts string patterns to regexps without escaping" do
+    'hello'.match('(.)\1')[0].should == 'll'
+  end
+  
+  it "returns nil if there's no match" do
+    'hello'.match('xx').should == nil
+  end
+
+  it "matches \\G at the start of the string" do
+    'hello'.match(/\Gh/)[0].should == 'h'
+    'hello'.match(/\Go/).should == nil
+  end
+
+  it "sets $~ to MatchData of match or nil when there is none" do
+    'hello'.match(/./)
+    $~[0].should == 'h'
+    Regexp.last_match[0].should == 'h'
+
+    'hello'.match(/X/)
+    $~.should == nil
+    Regexp.last_match.should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/modulo_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/modulo_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/modulo_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,712 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#%" do
+  it "formats multiple expressions" do
+    ("%b %x %d %s" % [10, 10, 10, 10]).should == "1010 a 10 10"
+  end
+
+  it "formats expressions mid string" do
+    ("hello %s!" % "world").should == "hello world!"
+  end
+
+  it "formats %% into %" do
+    ("%d%% %s" % [10, "of chickens!"]).should == "10% of chickens!"
+  end
+
+  it "formats single % characters before a newline or NULL as literal %s" do
+    ("%" % []).should == "%"
+    ("foo%" % []).should == "foo%"
+    ("%\n" % []).should == "%\n"
+    ("foo%\n" % []).should == "foo%\n"
+    ("%\0" % []).should == "%\0"
+    ("foo%\0" % []).should == "foo%\0"
+    ("%\n.3f" % 1.2).should == "%\n.3f"
+    ("%\0.3f" % 1.2).should == "%\0.3f"
+  end
+
+  it "raises an error if single % appears anywhere else" do
+    lambda { (" % " % []) }.should raise_error(ArgumentError)
+    lambda { ("foo%quux" % []) }.should raise_error(ArgumentError)
+  end
+
+  it "raises an error if NULL or \n appear anywhere else in the format string" do
+    begin
+      old_debug, $DEBUG = $DEBUG, false
+
+      lambda { "%.\n3f" % 1.2 }.should raise_error(ArgumentError)
+      lambda { "%.3\nf" % 1.2 }.should raise_error(ArgumentError)
+      lambda { "%.\03f" % 1.2 }.should raise_error(ArgumentError)
+      lambda { "%.3\0f" % 1.2 }.should raise_error(ArgumentError)
+    ensure
+      $DEBUG = old_debug
+    end
+  end
+
+  it "ignores unused arguments when $DEBUG is false" do
+    begin
+      old_debug = $DEBUG
+      $DEBUG = false
+
+      ("" % [1, 2, 3]).should == ""
+      ("%s" % [1, 2, 3]).should == "1"
+    ensure
+      $DEBUG = old_debug
+    end
+  end
+
+  it "raises an ArgumentError for unused arguments when $DEBUG is true" do
+    begin
+      old_debug = $DEBUG
+      $DEBUG = true
+      s = $stderr
+      $stderr = IOStub.new
+
+      lambda { "" % [1, 2, 3]   }.should raise_error(ArgumentError)
+      lambda { "%s" % [1, 2, 3] }.should raise_error(ArgumentError)
+    ensure
+      $DEBUG = old_debug
+      $stderr = s
+    end
+  end
+
+  it "always allows unused arguments when positional argument style is used" do
+    begin
+      old_debug = $DEBUG
+      $DEBUG = false
+
+      ("%2$s" % [1, 2, 3]).should == "2"
+      $DEBUG = true
+      ("%2$s" % [1, 2, 3]).should == "2"
+    ensure
+      $DEBUG = old_debug
+    end
+  end
+
+  it "replaces trailing absolute argument specifier without type with percent sign" do
+    ("hello %1$" % "foo").should == "hello %"
+  end
+
+  it "raises an ArgumentError when given invalid argument specifiers" do
+    lambda { "%1" % [] }.should raise_error(ArgumentError)
+    lambda { "%+" % [] }.should raise_error(ArgumentError)
+    lambda { "%-" % [] }.should raise_error(ArgumentError)
+    lambda { "%#" % [] }.should raise_error(ArgumentError)
+    lambda { "%0" % [] }.should raise_error(ArgumentError)
+    lambda { "%*" % [] }.should raise_error(ArgumentError)
+    lambda { "%." % [] }.should raise_error(ArgumentError)
+    lambda { "%_" % [] }.should raise_error(ArgumentError)
+    lambda { "%0$s" % "x"              }.should raise_error(ArgumentError)
+    lambda { "%*0$s" % [5, "x"]        }.should raise_error(ArgumentError)
+    lambda { "%*1$.*0$1$s" % [1, 2, 3] }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError when multiple positional argument tokens are given for one format specifier" do
+    lambda { "%1$1$s" % "foo" }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError when multiple width star tokens are given for one format specifier" do
+    lambda { "%**s" % [5, 5, 5] }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError when a width star token is seen after a width token" do
+    lambda { "%5*s" % [5, 5] }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError when multiple precision tokens are given" do
+    lambda { "%.5.5s" % 5      }.should raise_error(ArgumentError)
+    lambda { "%.5.*s" % [5, 5] }.should raise_error(ArgumentError)
+    lambda { "%.*.5s" % [5, 5] }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError when there are less arguments than format specifiers" do
+    ("foo" % []).should == "foo"
+    lambda { "%s" % []     }.should raise_error(ArgumentError)
+    lambda { "%s %s" % [1] }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError when absolute and relative argument numbers are mixed" do
+    lambda { "%s %1$s" % "foo" }.should raise_error(ArgumentError)
+    lambda { "%1$s %s" % "foo" }.should raise_error(ArgumentError)
+
+    lambda { "%s %2$s" % ["foo", "bar"] }.should raise_error(ArgumentError)
+    lambda { "%2$s %s" % ["foo", "bar"] }.should raise_error(ArgumentError)
+
+    lambda { "%*2$s" % [5, 5, 5]     }.should raise_error(ArgumentError)
+    lambda { "%*.*2$s" % [5, 5, 5]   }.should raise_error(ArgumentError)
+    lambda { "%*2$.*2$s" % [5, 5, 5] }.should raise_error(ArgumentError)
+    lambda { "%*.*2$s" % [5, 5, 5]   }.should raise_error(ArgumentError)
+  end
+
+  it "allows reuse of the one argument multiple via absolute argument numbers" do
+    ("%1$s %1$s" % "foo").should == "foo foo"
+    ("%1$s %2$s %1$s %2$s" % ["foo", "bar"]).should == "foo bar foo bar"
+  end
+
+  it "always interprets an array argument as a list of argument parameters" do
+    lambda { "%p" % [] }.should raise_error(ArgumentError)
+    ("%p" % [1]).should == "1"
+    ("%p %p" % [1, 2]).should == "1 2"
+  end
+
+  it "always interprets an array subclass argument as a list of argument parameters" do
+    lambda { "%p" % StringSpecs::MyArray[] }.should raise_error(ArgumentError)
+    ("%p" % StringSpecs::MyArray[1]).should == "1"
+    ("%p %p" % StringSpecs::MyArray[1, 2]).should == "1 2"
+  end
+
+  it "allows positional arguments for width star and precision star arguments" do
+    ("%*1$.*2$3$d" % [10, 5, 1]).should == "     00001"
+  end
+
+  it "calls to_int on width star and precision star tokens" do
+    w = mock('10')
+    w.should_receive(:to_int).and_return(10)
+
+    p = mock('5')
+    p.should_receive(:to_int).and_return(5)
+
+    ("%*.*f" % [w, p, 1]).should == "   1.00000"
+  end
+
+  ruby_bug "#", "1.8.6.228" do
+    it "tries to convert the argument to Array by calling #to_ary" do
+      obj = mock('[1,2]')
+      def obj.to_ary() [1, 2] end
+      def obj.to_s() "obj" end
+      ("%s %s" % obj).should == "1 2"
+      ("%s" % obj).should == "1"
+    end
+  end
+
+  it "doesn't return subclass instances when called on a subclass" do
+    universal = mock('0')
+    def universal.to_int() 0 end
+    def universal.to_str() "0" end
+    def universal.to_f() 0.0 end
+
+    [
+      "", "foo",
+      "%b", "%B", "%c", "%d", "%e", "%E",
+      "%f", "%g", "%G", "%i", "%o", "%p",
+      "%s", "%u", "%x", "%X"
+    ].each do |format|
+      (StringSpecs::MyString.new(format) % universal).class.should == String
+    end
+  end
+
+  it "always taints the result when the format string is tainted" do
+    universal = mock('0')
+    def universal.to_int() 0 end
+    def universal.to_str() "0" end
+    def universal.to_f() 0.0 end
+
+    [
+      "", "foo",
+      "%b", "%B", "%c", "%d", "%e", "%E",
+      "%f", "%g", "%G", "%i", "%o", "%p",
+      "%s", "%u", "%x", "%X"
+    ].each do |format|
+      subcls_format = StringSpecs::MyString.new(format)
+      subcls_format.taint
+      format.taint
+
+      (format % universal).tainted?.should == true
+      (subcls_format % universal).tainted?.should == true
+    end
+  end
+
+  it "supports binary formats using %b" do
+    ("%b" % 10).should == "1010"
+    ("% b" % 10).should == " 1010"
+    ("%1$b" % [10, 20]).should == "1010"
+    ("%#b" % 10).should == "0b1010"
+    ("%+b" % 10).should == "+1010"
+    ("%-9b" % 10).should == "1010     "
+    ("%05b" % 10).should == "01010"
+    ("%*b" % [10, 6]).should == "       110"
+    ("%*b" % [-10, 6]).should == "110       "
+
+    ("%b" % -5).should == "..1011"
+    ("%0b" % -5).should == "1011"
+    ("%.4b" % 2).should == "0010"
+    ("%.1b" % -5).should == "1011"
+    ("%.7b" % -5).should == "1111011"
+    ("%.10b" % -5).should == "1111111011"
+    ("% b" % -5).should == "-101"
+    ("%+b" % -5).should == "-101"
+    ("%b" % -(2 ** 64 + 5)).should ==
+    "..101111111111111111111111111111111111111111111111111111111111111011"
+  end
+
+  it "supports binary formats using %B with same behaviour as %b except for using 0B instead of 0b for #" do
+    ("%B" % 10).should == ("%b" % 10)
+    ("% B" % 10).should == ("% b" % 10)
+    ("%1$B" % [10, 20]).should == ("%1$b" % [10, 20])
+    ("%+B" % 10).should == ("%+b" % 10)
+    ("%-9B" % 10).should == ("%-9b" % 10)
+    ("%05B" % 10).should == ("%05b" % 10)
+    ("%*B" % [10, 6]).should == ("%*b" % [10, 6])
+    ("%*B" % [-10, 6]).should == ("%*b" % [-10, 6])
+
+    ("%B" % -5).should == ("%b" % -5)
+    ("%0B" % -5).should == ("%0b" % -5)
+    ("%.1B" % -5).should == ("%.1b" % -5)
+    ("%.7B" % -5).should == ("%.7b" % -5)
+    ("%.10B" % -5).should == ("%.10b" % -5)
+    ("% B" % -5).should == ("% b" % -5)
+    ("%+B" % -5).should == ("%+b" % -5)
+    ("%B" % -(2 ** 64 + 5)).should == ("%b" % -(2 ** 64 + 5))
+
+    ("%#B" % 10).should == "0B1010"
+  end
+
+  it "supports character formats using %c" do
+    ("%c" % 10).should == "\n"
+    ("%2$c" % [10, 11, 14]).should == "\v"
+    ("%-4c" % 10).should == "\n   "
+    ("%*c" % [10, 3]).should == "         \003"
+    ("%c" % (256 + 42)).should == "*"
+
+    lambda { "%c" % Object }.should raise_error(TypeError)
+  end
+
+  it "uses argument % 256" do
+    ("%c" % [256 * 3 + 64]).should == ("%c" % 64)
+    ("%c" % -200).should == ("%c" % 56)
+  end
+
+  ruby_version_is "1.8.6.278" do
+    it "calls #to_ary on argument for %c formats" do
+      obj = mock('65')
+      obj.should_receive(:to_ary).and_return([65])
+      ("%c" % obj).should == ("%c" % [65])
+    end
+
+    it "calls #to_int on argument for %c formats, if the argument does not respond to #to_ary" do
+      obj = mock('65')
+      obj.should_receive(:to_int).and_return(65)
+
+      ("%c" % obj).should == ("%c" % 65)
+    end
+  end
+
+  %w(d i).each do |f|
+    format = "%" + f
+
+    it "supports integer formats using #{format}" do
+      ("%#{f}" % 10).should == "10"
+      ("% #{f}" % 10).should == " 10"
+      ("%1$#{f}" % [10, 20]).should == "10"
+      ("%+#{f}" % 10).should == "+10"
+      ("%-7#{f}" % 10).should == "10     "
+      ("%04#{f}" % 10).should == "0010"
+      ("%*#{f}" % [10, 4]).should == "         4"
+    end
+  end
+
+  it "supports float formats using %e" do
+    ("%e" % 10).should == "1.000000e+01"
+    ("% e" % 10).should == " 1.000000e+01"
+    ("%1$e" % 10).should == "1.000000e+01"
+    ("%#e" % 10).should == "1.000000e+01"
+    ("%+e" % 10).should == "+1.000000e+01"
+    ("%-7e" % 10).should == "1.000000e+01"
+    ("%05e" % 10).should == "1.000000e+01"
+    ("%*e" % [10, 9]).should == "9.000000e+00"
+  end
+
+  not_compliant_on :rubinius, :jruby do
+    it "supports float formats using %e, and downcases -Inf, Inf, and NaN" do
+      ("%e" % 1e1020).should == "inf"
+      ("%e" % -1e1020).should == "-inf"
+      ("%e" % (0.0/0)).should == "nan"
+      ("%e" % (-0e0/0)).should == "nan"
+    end
+  end
+
+  # Inf, -Inf, and NaN are identifiers for results of floating point operations
+  # that cannot be expressed with any value in the set of real numbers. Upcasing
+  # or downcasing these identifiers for %e or %E, which refers to the case of the
+  # of the exponent identifier, is silly.
+  deviates_on :rubinius, :jruby do
+    it "supports float formats using %e, but Inf, -Inf, and NaN are not floats" do
+      ("%e" % 1e1020).should == "Inf"
+      ("%e" % -1e1020).should == "-Inf"
+      ("%e" % (-0e0/0)).should == "NaN"
+      ("%e" % (0.0/0)).should == "NaN"
+    end
+
+    it "supports float formats using %E, but Inf, -Inf, and NaN are not floats" do
+      ("%E" % 1e1020).should == "Inf"
+      ("%E" % -1e1020).should == "-Inf"
+      ("%-10E" % 1e1020).should == "Inf       "
+      ("%10E" % 1e1020).should == "       Inf"
+      ("%+E" % 1e1020).should == "+Inf"
+      ("% E" % 1e1020).should == " Inf"
+      ("%E" % (0.0/0)).should == "NaN"
+      ("%E" % (-0e0/0)).should == "NaN"
+    end
+  end
+
+  it "supports float formats using %E" do
+    ("%E" % 10).should == "1.000000E+01"
+    ("% E" % 10).should == " 1.000000E+01"
+    ("%1$E" % 10).should == "1.000000E+01"
+    ("%#E" % 10).should == "1.000000E+01"
+    ("%+E" % 10).should == "+1.000000E+01"
+    ("%-7E" % 10).should == "1.000000E+01"
+    ("%05E" % 10).should == "1.000000E+01"
+    ("%*E" % [10, 9]).should == "9.000000E+00"
+  end
+
+  not_compliant_on :rubinius, :jruby do
+    it "supports float formats using %E, and upcases Inf, -Inf, and NaN" do
+      ("%E" % 1e1020).should == "INF"
+      ("%E" % -1e1020).should == "-INF"
+      ("%-10E" % 1e1020).should == "INF       "
+      ("%+E" % 1e1020).should == "+INF"
+      ("% E" % 1e1020).should == " INF"
+      ("%E" % (0.0/0)).should == "NAN"
+      ("%E" % (-0e0/0)).should == "NAN"
+    end
+
+    platform_is :darwin do
+      it "pads with zeros using %E with Inf, -Inf, and NaN" do
+        ("%010E" % -1e1020).should == "-000000INF"
+        ("%010E" % 1e1020).should == "0000000INF"
+        ("%010E" % (0.0/0)).should == "0000000NAN"
+      end
+    end
+
+    platform_is_not :darwin do
+      it "pads with spaces for %E with Inf, -Inf, and NaN" do
+        ("%010E" % -1e1020).should == "      -INF"
+        ("%010E" % 1e1020).should == "       INF"
+        ("%010E" % (0.0/0)).should == "       NAN"
+      end
+    end
+  end
+
+  it "supports float formats using %f" do
+    ("%f" % 10).should == "10.000000"
+    ("% f" % 10).should == " 10.000000"
+    ("%1$f" % 10).should == "10.000000"
+    ("%#f" % 10).should == "10.000000"
+    ("%+f" % 10).should == "+10.000000"
+    ("%-7f" % 10).should == "10.000000"
+    ("%05f" % 10).should == "10.000000"
+    ("%*f" % [10, 9]).should == "  9.000000"
+  end
+
+  it "supports float formats using %g" do
+    ("%g" % 10).should == "10"
+    ("% g" % 10).should == " 10"
+    ("%1$g" % 10).should == "10"
+    ("%#g" % 10).should == "10.0000"
+    ("%+g" % 10).should == "+10"
+    ("%-7g" % 10).should == "10     "
+    ("%05g" % 10).should == "00010"
+    ("%*g" % [10, 9]).should == "         9"
+  end
+
+  it "supports float formats using %G" do
+    ("%G" % 10).should == "10"
+    ("% G" % 10).should == " 10"
+    ("%1$G" % 10).should == "10"
+    ("%#G" % 10).should == "10.0000"
+    ("%+G" % 10).should == "+10"
+    ("%-7G" % 10).should == "10     "
+    ("%05G" % 10).should == "00010"
+    ("%*G" % [10, 9]).should == "         9"
+  end
+
+  it "supports octal formats using %o" do
+    ("%o" % 10).should == "12"
+    ("% o" % 10).should == " 12"
+    ("%1$o" % [10, 20]).should == "12"
+    ("%#o" % 10).should == "012"
+    ("%+o" % 10).should == "+12"
+    ("%-9o" % 10).should == "12       "
+    ("%05o" % 10).should == "00012"
+    ("%*o" % [10, 6]).should == "         6"
+
+    # These are incredibly wrong. -05 == -5, not 7177777...whatever
+    ("%o" % -5).should == "..73"
+    ("%0o" % -5).should == "73"
+    ("%.4o" % 20).should == "0024"
+    ("%.1o" % -5).should == "73"
+    ("%.7o" % -5).should == "7777773"
+    ("%.10o" % -5).should == "7777777773"
+
+    ("% o" % -26).should == "-32"
+    ("%+o" % -26).should == "-32"
+    ("%o" % -(2 ** 64 + 5)).should == "..75777777777777777777773"
+  end
+
+  it "supports inspect formats using %p" do
+    ("%p" % 10).should == "10"
+    ("%1$p" % [10, 5]).should == "10"
+    ("%-22p" % 10).should == "10                    "
+    ("%*p" % [10, 10]).should == "        10"
+  end
+
+  it "calls inspect on arguments for %p format" do
+    obj = mock('obj')
+    def obj.inspect() "obj" end
+    ("%p" % obj).should == "obj"
+
+    # undef is not working
+    # obj = mock('obj')
+    # class << obj; undef :inspect; end
+    # def obj.method_missing(*args) "obj" end
+    # ("%p" % obj).should == "obj"
+  end
+
+  it "taints result for %p when argument.inspect is tainted" do
+    obj = mock('x')
+    def obj.inspect() "x".taint end
+
+    ("%p" % obj).tainted?.should == true
+
+    obj = mock('x'); obj.taint
+    def obj.inspect() "x" end
+
+    ("%p" % obj).tainted?.should == false
+  end
+
+  it "supports string formats using %s" do
+    ("%s" % 10).should == "10"
+    ("%1$s" % [10, 8]).should == "10"
+    ("%-5s" % 10).should == "10   "
+    ("%*s" % [10, 9]).should == "         9"
+  end
+
+  it "calls to_s on arguments for %s format" do
+    obj = mock('obj')
+    def obj.to_s() "obj" end
+
+    ("%s" % obj).should == "obj"
+
+    # undef doesn't work
+    # obj = mock('obj')
+    # class << obj; undef :to_s; end
+    # def obj.method_missing(*args) "obj" end
+    #
+    # ("%s" % obj).should == "obj"
+  end
+
+  it "taints result for %s when argument is tainted" do
+    ("%s" % "x".taint).tainted?.should == true
+    ("%s" % mock('x').taint).tainted?.should == true
+    ("%s" % 5.0.taint).tainted?.should == true
+  end
+
+  # MRI crashes on this one.
+  # See http://groups.google.com/group/ruby-core-google/t/c285c18cd94c216d
+  it "raises an ArgumentError for huge precisions for %s" do
+    block = lambda { "%.25555555555555555555555555555555555555s" % "hello world" }
+    block.should raise_error(ArgumentError)
+  end
+
+  # Note: %u has been changed to an alias for %d in MRI 1.9 trunk.
+  # Let's wait a bit for it to cool down and see if it will
+  # be changed for 1.8 as well.
+  it "supports unsigned formats using %u" do
+    ("%u" % 10).should == "10"
+    ("% u" % 10).should == " 10"
+    ("%1$u" % [10, 20]).should == "10"
+    ("%+u" % 10).should == "+10"
+    ("%-7u" % 10).should == "10     "
+    ("%04u" % 10).should == "0010"
+    ("%*u" % [10, 4]).should == "         4"
+  end
+
+  ruby_version_is "" ... "1.9" do
+    platform_is :wordsize => 64 do
+      it "supports unsigned formats using %u on 64-bit" do
+        ("%u" % -5).should == "..#{2**64 - 5}"
+        ("%0u" % -5).should == (2**64 - 5).to_s
+        ("%.1u" % -5).should == (2**64 - 5).to_s
+        ("%.7u" % -5).should == (2**64 - 5).to_s
+        ("%.10u" % -5).should == (2**64 - 5).to_s
+      end
+    end
+
+    platform_is :wordsize => 32 do
+      it "supports unsigned formats using %u on 32-bit" do
+        ("%u" % -5).should == "..#{2**32 - 5}"
+        ("%0u" % -5).should == (2**32 - 5).to_s
+        ("%.1u" % -5).should == (2**32 - 5).to_s
+        ("%.7u" % -5).should == (2**32 - 5).to_s
+        ("%.10u" % -5).should == (2**32 - 5).to_s
+      end
+    end
+  end
+
+  it "formats negative values with a leading sign using %u" do
+    ("% u" % -26).should == "-26"
+    ("%+u" % -26).should == "-26"
+  end
+
+  not_compliant_on :rubinius do
+    # This is the proper, compliant behavior of both JRuby, and
+    # MRI 1.8.6 with patchlevel greater than 114.
+    ruby_bug "http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/8418", "1.8.6.114" do
+      it "supports negative bignums by prefixing the value with dots" do
+        ("%u" % -(2 ** 64 + 5)).should == "..79228162495817593519834398715"
+      end
+    end
+  end
+
+  deviates_on :rubinius do
+    it "does not support negative bignums" do
+      lambda { ("%u" % -(2 ** 64 + 5)) }.should raise_error(ArgumentError)
+    end
+  end
+
+  it "supports hex formats using %x" do
+    ("%x" % 10).should == "a"
+    ("% x" % 10).should == " a"
+    ("%1$x" % [10, 20]).should == "a"
+    ("%#x" % 10).should == "0xa"
+    ("%+x" % 10).should == "+a"
+    ("%-9x" % 10).should == "a        "
+    ("%05x" % 10).should == "0000a"
+    ("%*x" % [10, 6]).should == "         6"
+
+    ("%x" % -5).should == "..fb"
+    ("%0x" % -5).should == "fb"
+    ("%.4x" % 20).should == "0014"
+    ("%.1x" % -5).should == "fb"
+    ("%.7x" % -5).should == "ffffffb"
+    ("%.10x" % -5).should == "fffffffffb"
+    ("% x" % -26).should == "-1a"
+    ("%+x" % -26).should == "-1a"
+    ("%x" % 0xFFFFFFFF).should == "ffffffff"
+    ("%x" % -(2 ** 64 + 5)).should == "..fefffffffffffffffb"
+  end
+
+  it "supports hex formats using %X" do
+    ("%X" % 10).should == "A"
+    ("% X" % 10).should == " A"
+    ("%1$X" % [10, 20]).should == "A"
+    ("%#X" % 10).should == "0XA"
+    ("%+X" % 10).should == "+A"
+    ("%-9X" % 10).should == "A        "
+    ("%05X" % 10).should == "0000A"
+    ("%*X" % [10, 6]).should == "         6"
+
+    ("%X" % -5).should == "..FB"
+    ("%0X" % -5).should == "FB"
+    ("%.1X" % -5).should == "FB"
+    ("%.7X" % -5).should == "FFFFFFB"
+    ("%.10X" % -5).should == "FFFFFFFFFB"
+    ("% X" % -26).should == "-1A"
+    ("%+X" % -26).should == "-1A"
+    ("%X" % 0xFFFFFFFF).should == "FFFFFFFF"
+    ("%X" % -(2 ** 64 + 5)).should == "..FEFFFFFFFFFFFFFFFB"
+  end
+
+  ruby_version_is "1.9" do
+    it 'formats zero without prefix using %#x' do
+      ("%#x" % 0).should == "0"
+    end
+
+    it 'formats zero without prefix using %#X' do
+      ("%#X" % 0).should == "0"
+    end
+  end
+
+  ruby_version_is "" ... "1.9" do
+    it 'formats zero with prefix using %#x' do
+      ("%#x" % 0).should == "0x0"
+    end
+
+    it 'formats zero without prefix using %#X' do
+      ("%#X" % 0).should == "0X0"
+    end
+  end
+
+  %w(b d i o u x X).each do |f|
+    format = "%" + f
+
+    it "behaves as if calling Kernel#Integer for #{format} argument, if it does not respond to #to_ary" do
+      (format % "10").should == (format % Kernel.Integer("10"))
+      (format % nil).should == (format % Kernel.Integer(nil))
+      (format % "0x42").should == (format % Kernel.Integer("0x42"))
+      (format % "0b1101").should == (format % Kernel.Integer("0b1101"))
+      (format % "0b1101_0000").should == (format % Kernel.Integer("0b1101_0000"))
+      (format % "0777").should == (format % Kernel.Integer("0777"))
+      lambda {
+        # see [ruby-core:14139] for more details
+        (format % "0777").should == (format % Kernel.Integer("0777"))
+      }.should_not raise_error(ArgumentError)
+
+      lambda { format % "0__7_7_7" }.should raise_error(ArgumentError)
+
+      lambda { format % "" }.should raise_error(ArgumentError)
+      lambda { format % "x" }.should raise_error(ArgumentError)
+      lambda { format % "5x" }.should raise_error(ArgumentError)
+      lambda { format % "08" }.should raise_error(ArgumentError)
+      lambda { format % "0b2" }.should raise_error(ArgumentError)
+      lambda { format % "123__456" }.should raise_error(ArgumentError)
+
+      obj = mock('5')
+      obj.should_receive(:to_i).and_return(5)
+      (format % obj).should == (format % 5)
+
+      obj = mock('6')
+      obj.stub!(:to_i).and_return(5)
+      obj.should_receive(:to_int).and_return(6)
+      (format % obj).should == (format % 6)
+    end
+
+    it "doesn't taint the result for #{format} when argument is tainted" do
+      (format % "5".taint).tainted?.should == false
+    end
+  end
+
+  %w(e E f g G).each do |f|
+    format = "%" + f
+
+    ruby_version_is "1.8.6.278" do
+      it "tries to convert the passed argument to an Array using #to_ary" do
+        obj = mock('3.14')
+        obj.should_receive(:to_ary).and_return([3.14])
+        (format % obj).should == (format % [3.14])
+      end
+    end
+
+    it "behaves as if calling Kernel#Float for #{format} arguments, when the passed argument does not respond to #to_ary" do
+      (format % 10).should == (format % 10.0)
+      (format % "-10.4e-20").should == (format % -10.4e-20)
+      (format % ".5").should == (format % 0.5)
+      (format % "-.5").should == (format % -0.5)
+      # Something's strange with this spec:
+      # it works just fine in individual mode, but not when run as part of a group
+      (format % "10_1_0.5_5_5").should == (format % 1010.555)
+
+      (format % "0777").should == (format % 777)
+
+      lambda { format % "" }.should raise_error(ArgumentError)
+      lambda { format % "x" }.should raise_error(ArgumentError)
+      lambda { format % "." }.should raise_error(ArgumentError)
+      lambda { format % "10." }.should raise_error(ArgumentError)
+      lambda { format % "5x" }.should raise_error(ArgumentError)
+      lambda { format % "0xA" }.should raise_error(ArgumentError)
+      lambda { format % "0b1" }.should raise_error(ArgumentError)
+      lambda { format % "10e10.5" }.should raise_error(ArgumentError)
+      lambda { format % "10__10" }.should raise_error(ArgumentError)
+      lambda { format % "10.10__10" }.should raise_error(ArgumentError)
+
+      obj = mock('5.0')
+      obj.should_receive(:to_f).and_return(5.0)
+      (format % obj).should == (format % 5.0)
+    end
+
+    it "doesn't taint the result for #{format} when argument is tainted" do
+      (format % "5".taint).tainted?.should == false
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/multiply_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/multiply_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/multiply_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,45 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#*" do
+  it "returns a new string containing count copies of self" do
+    ("cool" * 0).should == ""
+    ("cool" * 1).should == "cool"
+    ("cool" * 3).should == "coolcoolcool"
+  end
+  
+  it "tries to convert the given argument to an integer using to_int" do
+    ("cool" * 3.1).should == "coolcoolcool"
+    ("a" * 3.999).should == "aaa"
+
+    a = mock('4')
+    a.should_receive(:to_int).and_return(4)
+
+    ("a" * a).should == "aaaa"
+  end
+  
+  it "raises an ArgumentError when given integer is negative" do
+    lambda { "cool" * -3    }.should raise_error(ArgumentError)
+    lambda { "cool" * -3.14 }.should raise_error(ArgumentError)
+  end
+  
+  it "raises a RangeError when given integer is a Bignum" do
+    lambda { "cool" * 999999999999999999999 }.should raise_error(RangeError)
+  end
+  
+  it "returns subclass instances" do
+    (StringSpecs::MyString.new("cool") * 0).class.should == StringSpecs::MyString
+    (StringSpecs::MyString.new("cool") * 1).class.should == StringSpecs::MyString
+    (StringSpecs::MyString.new("cool") * 2).class.should == StringSpecs::MyString
+  end
+  
+  it "always taints the result when self is tainted" do
+    ["", "OK", StringSpecs::MyString.new(""), StringSpecs::MyString.new("OK")].each do |str|
+      str.taint
+
+      [0, 1, 2].each do |arg|
+        (str * arg).tainted?.should == true
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "String.new" do
+  it "returns an instance of String" do
+    str = String.new
+    str.should be_kind_of(String)
+  end
+  
+  it "returns a fully-formed String" do
+    str = String.new
+    str.size.should == 0
+    str << "more"
+    str.should == "more"
+  end
+  
+  it "returns a new string given a string argument" do
+    str1 = "test"
+    str = String.new(str1)
+    str.should be_kind_of(String)
+    str.should == str
+    str << "more"
+    str.should == "testmore"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/next_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/next_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/next_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.dirname(__FILE__) + '/shared/succ.rb'
+
+describe "String#next" do
+  it_behaves_like(:string_succ, :next)
+end
+
+describe "String#next!" do
+  it_behaves_like(:string_succ_bang, :"next!")
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/string/oct_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/oct_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/oct_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,49 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+# Note: We can't completely spec this in terms of to_int() because hex()
+# allows the base to be changed by a base specifier in the string.
+# See http://groups.google.com/group/ruby-core-google/browse_frm/thread/b53e9c2003425703
+describe "String#oct" do
+  it "treats leading characters of self as a string of oct digits" do
+    "0".oct.should == 0
+    "77".oct.should == 077
+    "78".oct.should == 7
+    "077".oct.should == 077
+    "0o".oct.should == 0
+
+    "755_333".oct.should == 0755_333
+    "5678".oct.should == 0567
+
+    "0b1010".oct.should == 0b1010
+    "0xFF".oct.should == 0xFF
+    "0d500".oct.should == 500
+  end
+  
+  ruby_version_is "" ... "1.8.7" do
+    it "accepts a sequence of underscores as part of a number" do
+      "7__3".oct.should == 073
+      "7___3".oct.should == 073
+      "7__5".oct.should == 075
+    end
+  end
+  
+  ruby_version_is "1.8.7" do
+    it "does not accept a sequence of underscores as part of a number" do
+      "7__3".oct.should == 07
+      "7___3".oct.should == 07
+      "7__5".oct.should == 07
+    end
+  end
+  
+  it "takes an optional sign" do
+    "-1234".oct.should == -01234
+    "+1234".oct.should == 01234
+  end
+  
+  it "returns 0 on error" do
+    "".oct.should == 0
+    "+-5".oct.should == 0
+    "wombat".oct.should == 0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/plus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/plus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/plus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,44 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#+" do
+  it "returns a new string containing the given string concatenated to self" do
+    ("" + "").should == ""
+    ("" + "Hello").should == "Hello"
+    ("Hello" + "").should == "Hello"
+    ("Ruby !" + "= Rubinius").should == "Ruby != Rubinius"
+  end
+
+  it "converts any non-String argument with #to_str" do
+    c = mock 'str'
+    c.should_receive(:to_str).any_number_of_times.and_return(' + 1 = 2')
+
+    ("1" + c).should == '1 + 1 = 2'
+  end
+
+  it "raises a TypeError when given any object that fails #to_str" do
+    lambda { "" + Object.new }.should raise_error(TypeError)
+    lambda { "" + 65 }.should raise_error(TypeError)
+  end
+
+  it "doesn't return subclass instances" do
+    (StringSpecs::MyString.new("hello") + "").class.should == String
+    (StringSpecs::MyString.new("hello") + "foo").class.should == String
+    (StringSpecs::MyString.new("hello") + StringSpecs::MyString.new("foo")).class.should == String
+    (StringSpecs::MyString.new("hello") + StringSpecs::MyString.new("")).class.should == String
+    (StringSpecs::MyString.new("") + StringSpecs::MyString.new("")).class.should == String
+    ("hello" + StringSpecs::MyString.new("foo")).class.should == String
+    ("hello" + StringSpecs::MyString.new("")).class.should == String
+  end
+
+  it "taints the result when self or other is tainted" do
+    strs = ["", "OK", StringSpecs::MyString.new(""), StringSpecs::MyString.new("OK")]
+    strs += strs.map { |s| s.dup.taint }
+
+    strs.each do |str|
+      strs.each do |other|
+        (str + other).tainted?.should == (str.tainted? | other.tainted?)
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/replace_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/replace_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/replace_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,37 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#replace" do
+  it "replaces the content of self with other and returns self" do
+    a = "some string"
+    a.replace("another string").should equal(a)
+    a.should == "another string"
+  end
+
+  it "replaces the taint status of self with that of other" do
+    a = "an untainted string"
+    b = "a tainted string".taint
+    a.replace(b)
+    a.tainted?.should == true
+  end
+
+  it "tries to convert other to string using to_str" do
+    other = mock('x')
+    other.should_receive(:to_str).and_return("converted to a string")
+    "hello".replace(other).should == "converted to a string"
+  end
+
+  it "raises a TypeError if other can't be converted to string" do
+    lambda { "hello".replace(123)       }.should raise_error(TypeError)
+    lambda { "hello".replace(:test)     }.should raise_error(TypeError)
+    lambda { "hello".replace(mock('x')) }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError if self is frozen" do
+    a = "hello".freeze
+
+    a.replace(a) # ok, no change
+    lambda { a.replace("")      }.should raise_error(TypeError)
+    lambda { a.replace("world") }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/reverse_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/reverse_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/reverse_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#reverse" do
+  it "returns a new string with the characters of self in reverse order" do
+    "stressed".reverse.should == "desserts"
+    "m".reverse.should == "m"
+    "".reverse.should == ""
+  end
+
+  it "taints the result if self is tainted" do
+    "".taint.reverse.tainted?.should == true
+    "m".taint.reverse.tainted?.should == true
+  end
+end
+
+describe "String#reverse!" do
+  it "reverses self in place and always returns self" do
+    a = "stressed"
+    a.reverse!.should equal(a)
+    a.should == "desserts"
+
+    "".reverse!.should == ""
+  end
+
+  it "raises a TypeError if self is frozen" do
+    "".freeze.reverse! # ok, no change
+    lambda { "anna".freeze.reverse!  }.should raise_error(TypeError)
+    lambda { "hello".freeze.reverse! }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/rindex_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/rindex_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/rindex_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,404 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#rindex with object" do
+  it "raises a TypeError if obj isn't a String, Fixnum or Regexp" do
+    lambda { "hello".rindex(:sym)      }.should raise_error(TypeError)    
+    lambda { "hello".rindex(mock('x')) }.should raise_error(TypeError)
+  end
+
+  it "doesn't try to convert obj to an integer via to_int" do
+    obj = mock('x')
+    obj.should_not_receive(:to_int)
+    lambda { "hello".rindex(obj) }.should raise_error(TypeError)
+  end
+
+  ruby_bug "#", "1.8.6" do # Fixed at MRI 1.8.7
+    it "tries to convert obj to a string via to_str" do
+      obj = mock('lo')
+      def obj.to_str() "lo" end
+      "hello".rindex(obj).should == "hello".rindex("lo")
+
+      obj = mock('o')
+      def obj.respond_to?(arg) true end
+      def obj.method_missing(*args) "o" end
+      "hello".rindex(obj).should == "hello".rindex("o")
+    end
+  end
+end
+
+describe "String#rindex with Fixnum" do
+  it "returns the index of the last occurrence of the given character" do
+    "hello".rindex(?e).should == 1
+    "hello".rindex(?l).should == 3
+  end
+  
+  it "doesn't use fixnum % 256" do
+    "hello".rindex(?e + 256 * 3).should == nil
+    "hello".rindex(-(256 - ?e)).should == nil
+  end
+  
+  it "starts the search at the given offset" do
+    "blablabla".rindex(?b, 0).should == 0
+    "blablabla".rindex(?b, 1).should == 0
+    "blablabla".rindex(?b, 2).should == 0
+    "blablabla".rindex(?b, 3).should == 3
+    "blablabla".rindex(?b, 4).should == 3
+    "blablabla".rindex(?b, 5).should == 3
+    "blablabla".rindex(?b, 6).should == 6
+    "blablabla".rindex(?b, 7).should == 6
+    "blablabla".rindex(?b, 8).should == 6
+    "blablabla".rindex(?b, 9).should == 6
+    "blablabla".rindex(?b, 10).should == 6
+
+    "blablabla".rindex(?a, 2).should == 2
+    "blablabla".rindex(?a, 3).should == 2
+    "blablabla".rindex(?a, 4).should == 2
+    "blablabla".rindex(?a, 5).should == 5
+    "blablabla".rindex(?a, 6).should == 5
+    "blablabla".rindex(?a, 7).should == 5
+    "blablabla".rindex(?a, 8).should == 8
+    "blablabla".rindex(?a, 9).should == 8
+    "blablabla".rindex(?a, 10).should == 8
+  end
+  
+  it "starts the search at offset + self.length if offset is negative" do
+    str = "blablabla"
+    
+    [?a, ?b].each do |needle|
+      (-str.length .. -1).each do |offset|
+        str.rindex(needle, offset).should ==
+        str.rindex(needle, offset + str.length)
+      end
+    end
+  end
+  
+  it "returns nil if the character isn't found" do
+    "hello".rindex(0).should == nil
+    
+    "hello".rindex(?H).should == nil
+    "hello".rindex(?z).should == nil
+    "hello".rindex(?o, 2).should == nil
+    
+    "blablabla".rindex(?a, 0).should == nil
+    "blablabla".rindex(?a, 1).should == nil
+    
+    "blablabla".rindex(?a, -8).should == nil
+    "blablabla".rindex(?a, -9).should == nil
+    
+    "blablabla".rindex(?b, -10).should == nil
+    "blablabla".rindex(?b, -20).should == nil
+  end
+  
+  it "tries to convert start_offset to an integer via to_int" do
+    obj = mock('5')
+    def obj.to_int() 5 end
+    "str".rindex(?s, obj).should == 0
+    
+    obj = mock('5')
+    def obj.respond_to?(arg) true end
+    def obj.method_missing(*args); 5; end
+    "str".rindex(?s, obj).should == 0
+  end
+  
+  it "raises a TypeError when given offset is nil" do
+    lambda { "str".rindex(?s, nil) }.should raise_error(TypeError)
+    lambda { "str".rindex(?t, nil) }.should raise_error(TypeError)
+  end
+end
+
+describe "String#rindex with String" do
+  it "behaves the same as String#rindex(char) for one-character strings" do
+    ["blablabla", "hello cruel world...!"].each do |str|
+      str.split("").uniq.each do |str|
+        chr = str[0]
+        str.rindex(str).should == str.rindex(chr)
+        
+        0.upto(str.size + 1) do |start|
+          str.rindex(str, start).should == str.rindex(chr, start)
+        end
+        
+        (-str.size - 1).upto(-1) do |start|
+          str.rindex(str, start).should == str.rindex(chr, start)
+        end
+      end
+    end
+  end
+  
+  it "returns the index of the last occurrence of the given substring" do
+    "blablabla".rindex("").should == 9
+    "blablabla".rindex("a").should == 8
+    "blablabla".rindex("la").should == 7
+    "blablabla".rindex("bla").should == 6
+    "blablabla".rindex("abla").should == 5
+    "blablabla".rindex("labla").should == 4
+    "blablabla".rindex("blabla").should == 3
+    "blablabla".rindex("ablabla").should == 2
+    "blablabla".rindex("lablabla").should == 1
+    "blablabla".rindex("blablabla").should == 0
+    
+    "blablabla".rindex("l").should == 7
+    "blablabla".rindex("bl").should == 6
+    "blablabla".rindex("abl").should == 5
+    "blablabla".rindex("labl").should == 4
+    "blablabla".rindex("blabl").should == 3
+    "blablabla".rindex("ablabl").should == 2
+    "blablabla".rindex("lablabl").should == 1
+    "blablabla".rindex("blablabl").should == 0
+
+    "blablabla".rindex("b").should == 6
+    "blablabla".rindex("ab").should == 5
+    "blablabla".rindex("lab").should == 4
+    "blablabla".rindex("blab").should == 3
+    "blablabla".rindex("ablab").should == 2
+    "blablabla".rindex("lablab").should == 1
+    "blablabla".rindex("blablab").should == 0
+  end  
+  
+  it "doesn't set $~" do
+    $~ = nil
+    
+    'hello.'.rindex('ll')
+    $~.should == nil
+  end
+  
+  it "ignores string subclasses" do
+    "blablabla".rindex(StringSpecs::MyString.new("bla")).should == 6
+    StringSpecs::MyString.new("blablabla").rindex("bla").should == 6
+    StringSpecs::MyString.new("blablabla").rindex(StringSpecs::MyString.new("bla")).should == 6
+  end
+  
+  it "starts the search at the given offset" do
+    "blablabla".rindex("bl", 0).should == 0
+    "blablabla".rindex("bl", 1).should == 0
+    "blablabla".rindex("bl", 2).should == 0
+    "blablabla".rindex("bl", 3).should == 3
+
+    "blablabla".rindex("bla", 0).should == 0
+    "blablabla".rindex("bla", 1).should == 0
+    "blablabla".rindex("bla", 2).should == 0
+    "blablabla".rindex("bla", 3).should == 3
+
+    "blablabla".rindex("blab", 0).should == 0
+    "blablabla".rindex("blab", 1).should == 0
+    "blablabla".rindex("blab", 2).should == 0
+    "blablabla".rindex("blab", 3).should == 3
+    "blablabla".rindex("blab", 6).should == 3
+    "blablablax".rindex("blab", 6).should == 3
+
+    "blablabla".rindex("la", 1).should == 1
+    "blablabla".rindex("la", 2).should == 1
+    "blablabla".rindex("la", 3).should == 1
+    "blablabla".rindex("la", 4).should == 4
+
+    "blablabla".rindex("lab", 1).should == 1
+    "blablabla".rindex("lab", 2).should == 1
+    "blablabla".rindex("lab", 3).should == 1
+    "blablabla".rindex("lab", 4).should == 4
+
+    "blablabla".rindex("ab", 2).should == 2
+    "blablabla".rindex("ab", 3).should == 2
+    "blablabla".rindex("ab", 4).should == 2
+    "blablabla".rindex("ab", 5).should == 5
+    
+    "blablabla".rindex("", 0).should == 0
+    "blablabla".rindex("", 1).should == 1
+    "blablabla".rindex("", 2).should == 2
+    "blablabla".rindex("", 7).should == 7
+    "blablabla".rindex("", 8).should == 8
+    "blablabla".rindex("", 9).should == 9
+    "blablabla".rindex("", 10).should == 9
+  end
+  
+  it "starts the search at offset + self.length if offset is negative" do
+    str = "blablabla"
+    
+    ["bl", "bla", "blab", "la", "lab", "ab", ""].each do |needle|
+      (-str.length .. -1).each do |offset|
+        str.rindex(needle, offset).should ==
+        str.rindex(needle, offset + str.length)
+      end
+    end
+  end
+
+  it "returns nil if the substring isn't found" do
+    "blablabla".rindex("B").should == nil
+    "blablabla".rindex("z").should == nil
+    "blablabla".rindex("BLA").should == nil
+    "blablabla".rindex("blablablabla").should == nil
+        
+    "hello".rindex("lo", 0).should == nil
+    "hello".rindex("lo", 1).should == nil
+    "hello".rindex("lo", 2).should == nil
+
+    "hello".rindex("llo", 0).should == nil
+    "hello".rindex("llo", 1).should == nil
+
+    "hello".rindex("el", 0).should == nil
+    "hello".rindex("ello", 0).should == nil
+    
+    "hello".rindex("", -6).should == nil
+    "hello".rindex("", -7).should == nil
+
+    "hello".rindex("h", -6).should == nil
+  end
+  
+  it "tries to convert start_offset to an integer via to_int" do
+    obj = mock('5')
+    def obj.to_int() 5 end
+    "str".rindex("st", obj).should == 0
+    
+    obj = mock('5')
+    def obj.respond_to?(arg) true end
+    def obj.method_missing(*args) 5 end
+    "str".rindex("st", obj).should == 0
+  end
+
+  it "raises a TypeError when given offset is nil" do
+    lambda { "str".rindex("st", nil) }.should raise_error(TypeError)
+  end
+end
+
+describe "String#rindex with Regexp" do
+  it "behaves the same as String#rindex(string) for escaped string regexps" do
+    ["blablabla", "hello cruel world...!"].each do |str|
+      ["", "b", "bla", "lab", "o c", "d."].each do |needle|
+        regexp = Regexp.new(Regexp.escape(needle))
+        str.rindex(regexp).should == str.rindex(needle)
+        
+        0.upto(str.size + 1) do |start|
+          str.rindex(regexp, start).should == str.rindex(needle, start)
+        end
+        
+        (-str.size - 1).upto(-1) do |start|
+          str.rindex(regexp, start).should == str.rindex(needle, start)
+        end
+      end
+    end
+  end
+  
+  it "returns the index of the first match from the end of string of regexp" do
+    "blablabla".rindex(/bla/).should == 6
+    "blablabla".rindex(/BLA/i).should == 6
+
+    "blablabla".rindex(/.{0}/).should == 9
+    "blablabla".rindex(/.{1}/).should == 8
+    "blablabla".rindex(/.{2}/).should == 7
+    "blablabla".rindex(/.{6}/).should == 3
+    "blablabla".rindex(/.{9}/).should == 0
+
+    "blablabla".rindex(/.*/).should == 9
+    "blablabla".rindex(/.+/).should == 8
+
+    "blablabla".rindex(/bla|a/).should == 8
+    
+    "blablabla".rindex(/\A/).should == 0
+    "blablabla".rindex(/\Z/).should == 9
+    "blablabla".rindex(/\z/).should == 9
+    "blablabla\n".rindex(/\Z/).should == 10
+    "blablabla\n".rindex(/\z/).should == 10
+
+    "blablabla".rindex(/^/).should == 0
+    "\nblablabla".rindex(/^/).should == 1
+    "b\nlablabla".rindex(/^/).should == 2
+    "blablabla".rindex(/$/).should == 9
+    
+    "blablabla".rindex(/.l./).should == 6
+  end
+  
+  it "sets $~ to MatchData of match and nil when there's none" do
+    'hello.'.rindex(/.(.)/)
+    $~[0].should == 'o.'
+
+    'hello.'.rindex(/not/)
+    $~.should == nil
+  end
+  
+  it "starts the search at the given offset" do
+    "blablabla".rindex(/.{0}/, 5).should == 5
+    "blablabla".rindex(/.{1}/, 5).should == 5
+    "blablabla".rindex(/.{2}/, 5).should == 5
+    "blablabla".rindex(/.{3}/, 5).should == 5
+    "blablabla".rindex(/.{4}/, 5).should == 5
+
+    "blablabla".rindex(/.{0}/, 3).should == 3
+    "blablabla".rindex(/.{1}/, 3).should == 3
+    "blablabla".rindex(/.{2}/, 3).should == 3
+    "blablabla".rindex(/.{5}/, 3).should == 3
+    "blablabla".rindex(/.{6}/, 3).should == 3
+
+    "blablabla".rindex(/.l./, 0).should == 0
+    "blablabla".rindex(/.l./, 1).should == 0
+    "blablabla".rindex(/.l./, 2).should == 0
+    "blablabla".rindex(/.l./, 3).should == 3
+    
+    "blablablax".rindex(/.x/, 10).should == 8
+    "blablablax".rindex(/.x/, 9).should == 8
+    "blablablax".rindex(/.x/, 8).should == 8
+
+    "blablablax".rindex(/..x/, 10).should == 7
+    "blablablax".rindex(/..x/, 9).should == 7
+    "blablablax".rindex(/..x/, 8).should == 7
+    "blablablax".rindex(/..x/, 7).should == 7
+    
+    "blablabla\n".rindex(/\Z/, 9).should == 9
+  end
+  
+  it "starts the search at offset + self.length if offset is negative" do
+    str = "blablabla"
+    
+    ["bl", "bla", "blab", "la", "lab", "ab", ""].each do |needle|
+      (-str.length .. -1).each do |offset|
+        str.rindex(needle, offset).should ==
+        str.rindex(needle, offset + str.length)
+      end
+    end
+  end
+
+  it "returns nil if the substring isn't found" do
+    "blablabla".rindex(/BLA/).should == nil
+    "blablabla".rindex(/.{10}/).should == nil
+    "blablablax".rindex(/.x/, 7).should == nil
+    "blablablax".rindex(/..x/, 6).should == nil
+    
+    "blablabla".rindex(/\Z/, 5).should == nil
+    "blablabla".rindex(/\z/, 5).should == nil
+    "blablabla\n".rindex(/\z/, 9).should == nil
+  end
+
+  it "supports \\G which matches at the given start offset" do
+    "helloYOU.".rindex(/YOU\G/, 8).should == 5
+    "helloYOU.".rindex(/YOU\G/).should == nil
+
+    idx = "helloYOUall!".index("YOU")
+    re = /YOU.+\G.+/
+    # The # marks where \G will match.
+    [
+      ["helloYOU#all.", nil],
+      ["helloYOUa#ll.", idx],
+      ["helloYOUal#l.", idx],
+      ["helloYOUall#.", idx],
+      ["helloYOUall.#", nil]
+    ].each do |i|
+      start = i[0].index("#")
+      str = i[0].delete("#")
+
+      str.rindex(re, start).should == i[1]
+    end
+  end
+  
+  it "tries to convert start_offset to an integer via to_int" do
+    obj = mock('5')
+    def obj.to_int() 5 end
+    "str".rindex(/../, obj).should == 1
+    
+    obj = mock('5')
+    def obj.respond_to?(arg) true end
+    def obj.method_missing(*args); 5; end
+    "str".rindex(/../, obj).should == 1
+  end
+
+  it "raises a TypeError when given offset is nil" do
+    lambda { "str".rindex(/../, nil) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/rjust_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/rjust_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/rjust_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,82 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#rjust with length, padding" do
+  it "returns a new string of specified length with self right justified and padded with padstr" do
+    "hello".rjust(20, '1234').should == "123412341234123hello"
+
+    "".rjust(1, "abcd").should == "a"
+    "".rjust(2, "abcd").should == "ab"
+    "".rjust(3, "abcd").should == "abc"
+    "".rjust(4, "abcd").should == "abcd"
+    "".rjust(6, "abcd").should == "abcdab"
+
+    "OK".rjust(3, "abcd").should == "aOK"
+    "OK".rjust(4, "abcd").should == "abOK"
+    "OK".rjust(6, "abcd").should == "abcdOK"
+    "OK".rjust(8, "abcd").should == "abcdabOK"
+  end
+  
+  it "pads with whitespace if no padstr is given" do
+    "hello".rjust(20).should == "               hello"
+  end
+
+  it "returns self if it's longer than or as long as the specified length" do
+    "".rjust(0).should == ""
+    "".rjust(-1).should == ""
+    "hello".rjust(4).should == "hello"
+    "hello".rjust(-1).should == "hello"
+    "this".rjust(3).should == "this"
+    "radiology".rjust(8, '-').should == "radiology"
+  end
+
+  it "taints result when self or padstr is tainted" do
+    "x".taint.rjust(4).tainted?.should == true
+    "x".taint.rjust(0).tainted?.should == true
+    "".taint.rjust(0).tainted?.should == true
+    "x".taint.rjust(4, "*").tainted?.should == true
+    "x".rjust(4, "*".taint).tainted?.should == true
+  end
+
+  it "tries to convert length to an integer using to_int" do
+    "^".rjust(3.8, "^_").should == "^_^"
+
+    obj = mock('3')
+    obj.should_receive(:to_int).and_return(3)
+
+    "o".rjust(obj, "o_").should == "o_o"
+  end
+  
+  it "raises a TypeError when length can't be converted to an integer" do
+    lambda { "hello".rjust("x")       }.should raise_error(TypeError)
+    lambda { "hello".rjust("x", "y")  }.should raise_error(TypeError)
+    lambda { "hello".rjust([])        }.should raise_error(TypeError)
+    lambda { "hello".rjust(mock('x')) }.should raise_error(TypeError)
+  end
+
+  it "tries to convert padstr to a string using to_str" do
+    padstr = mock('123')
+    padstr.should_receive(:to_str).and_return("123")
+
+    "hello".rjust(10, padstr).should == "12312hello"
+  end
+
+  it "raises a TypeError when padstr can't be converted" do
+    lambda { "hello".rjust(20, :sym)      }.should raise_error(TypeError)
+    lambda { "hello".rjust(20, ?c)        }.should raise_error(TypeError)
+    lambda { "hello".rjust(20, mock('x')) }.should raise_error(TypeError)
+  end
+  
+  it "raises an ArgumentError when padstr is empty" do
+    lambda { "hello".rjust(10, '') }.should raise_error(ArgumentError)
+  end
+  
+  it "returns subclass instances when called on subclasses" do
+    StringSpecs::MyString.new("").rjust(10).class.should == StringSpecs::MyString
+    StringSpecs::MyString.new("foo").rjust(10).class.should == StringSpecs::MyString
+    StringSpecs::MyString.new("foo").rjust(10, StringSpecs::MyString.new("x")).class.should == StringSpecs::MyString
+    
+    "".rjust(10, StringSpecs::MyString.new("x")).class.should == String
+    "foo".rjust(10, StringSpecs::MyString.new("x")).class.should == String
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/rstrip_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/rstrip_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/rstrip_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,39 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#rstrip" do
+  it "returns a copy of self with trailing whitespace removed" do
+   "  hello  ".rstrip.should == "  hello"
+   "  hello world  ".rstrip.should == "  hello world"
+   "  hello world \n\r\t\n\v\r".rstrip.should == "  hello world"
+   "hello".rstrip.should == "hello"
+   "hello\x00".rstrip.should == "hello"
+  end
+
+  it "taints the result when self is tainted" do
+    "".taint.rstrip.tainted?.should == true
+    "ok".taint.rstrip.tainted?.should == true
+    "ok    ".taint.rstrip.tainted?.should == true
+  end
+end
+
+describe "String#rstrip!" do
+  it "modifies self in place and returns self" do
+    a = "  hello  "
+    a.rstrip!.should equal(a)
+    a.should == "  hello"
+  end
+
+  it "returns nil if no modifications were made" do
+    a = "hello"
+    a.rstrip!.should == nil
+    a.should == "hello"
+  end
+
+  it "raises a TypeError if self is frozen" do
+    "hello".freeze.rstrip! # ok, nothing changed
+    "".freeze.rstrip! # ok, nothing changed
+
+    lambda { "  hello  ".freeze.rstrip! }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/scan_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/scan_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/scan_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,172 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#scan" do
+  it "returns an array containing all matches" do
+    "cruel world".scan(/\w+/).should == ["cruel", "world"]
+    "cruel world".scan(/.../).should == ["cru", "el ", "wor"]
+
+    # Edge case
+    "hello".scan(//).should == ["", "", "", "", "", ""]
+    "".scan(//).should == [""]
+  end
+
+  it "stores groups as arrays in the returned arrays" do
+    "hello".scan(/()/).should == [[""]] * 6
+    "hello".scan(/()()/).should == [["", ""]] * 6
+    "cruel world".scan(/(...)/).should == [["cru"], ["el "], ["wor"]]
+    "cruel world".scan(/(..)(..)/).should == [["cr", "ue"], ["l ", "wo"]]
+  end
+
+  it "scans for occurrences of the string if pattern is a string" do
+    "one two one two".scan('one').should == ["one", "one"]
+    "hello.".scan('.').should == ['.']
+  end
+
+  it "sets $~ to MatchData of last match and nil when there's none" do
+    'hello.'.scan(/.(.)/)
+    $~[0].should == 'o.'
+
+    'hello.'.scan(/not/)
+    $~.should == nil
+
+    'hello.'.scan('l')
+    $~.begin(0).should == 3
+    $~[0].should == 'l'
+
+    'hello.'.scan('not')
+    $~.should == nil
+  end
+
+  it "supports \\G which matches the end of the previous match / string start for first match" do
+    "one two one two".scan(/\G\w+/).should == ["one"]
+    "one two one two".scan(/\G\w+\s*/).should == ["one ", "two ", "one ", "two"]
+    "one two one two".scan(/\G\s*\w+/).should == ["one", " two", " one", " two"]
+  end
+
+  it "tries to convert pattern to a string via to_str" do
+    obj = mock('o')
+    obj.should_receive(:to_str).and_return("o")
+    "o_o".scan(obj).should == ["o", "o"]
+  end
+
+  it "raises a TypeError if pattern isn't a Regexp and can't be converted to a String" do
+    lambda { "cruel world".scan(5)         }.should raise_error(TypeError)
+    lambda { "cruel world".scan(:test)     }.should raise_error(TypeError)
+    lambda { "cruel world".scan(mock('x')) }.should raise_error(TypeError)
+  end
+
+  # Note: MRI taints for tainted regexp patterns,
+  # but not for tainted string patterns.
+  # TODO: Report to ruby-core.
+  it "taints the match strings if self is tainted, unless the taint happens in the method call" do
+    a = "hello hello hello".scan("hello".taint)
+    a.each { |m| m.tainted?.should == false }
+
+    a = "hello hello hello".taint.scan("hello")
+    a.each { |m| m.tainted?.should == true }
+
+    a = "hello".scan(/./.taint)
+    a.each { |m| m.tainted?.should == true }
+
+    a = "hello".taint.scan(/./)
+    a.each { |m| m.tainted?.should == true }
+  end
+end
+
+describe "String#scan with pattern and block" do
+  it "returns self" do
+    s = "foo"
+    s.scan(/./) {}.should equal(s)
+    s.scan(/roar/) {}.should equal(s)
+  end
+
+  it "passes each match to the block as one argument: an array" do
+    a = []
+    "cruel world".scan(/\w+/) { |*w| a << w }
+    a.should == [["cruel"], ["world"]]
+  end
+
+  it "passes groups to the block as one argument: an array" do
+    a = []
+    "cruel world".scan(/(..)(..)/) { |w| a << w }
+    a.should == [["cr", "ue"], ["l ", "wo"]]
+  end
+
+  it "sets $~ for access from the block" do
+    str = "hello"
+
+    matches = []
+    offsets = []
+
+    str.scan(/([aeiou])/) do
+       md = $~
+       md.string.should == str
+       matches << md.to_a
+       offsets << md.offset(0)
+       str
+    end
+
+    matches.should == [["e", "e"], ["o", "o"]]
+    offsets.should == [[1, 2], [4, 5]]
+
+    matches = []
+    offsets = []
+
+    str.scan("l") do
+       md = $~
+       md.string.should == str
+       matches << md.to_a
+       offsets << md.offset(0)
+       str
+    end
+
+    matches.should == [["l"], ["l"]]
+    offsets.should == [[2, 3], [3, 4]]
+  end
+
+  it "restores $~ after leaving the block" do
+    [/./, "l"].each do |pattern|
+      old_md = nil
+      "hello".scan(pattern) do
+        old_md = $~
+        "ok".match(/./)
+        "x"
+      end
+
+      $~.should == old_md
+      $~.string.should == "hello"
+    end
+  end
+
+  it "sets $~ to MatchData of last match and nil when there's none for access from outside" do
+    'hello.'.scan('l') { 'x' }
+    $~.begin(0).should == 3
+    $~[0].should == 'l'
+
+    'hello.'.scan('not') { 'x' }
+    $~.should == nil
+
+    'hello.'.scan(/.(.)/) { 'x' }
+    $~[0].should == 'o.'
+
+    'hello.'.scan(/not/) { 'x' }
+    $~.should == nil
+  end
+
+  # Note: MRI taints for tainted regexp patterns,
+  # but not for tainted string patterns.
+  # TODO: Report to ruby-core.
+  it "taints the match strings if self is tainted, unless the tain happens inside the scan" do
+    "hello hello hello".scan("hello".taint) { |m| m.tainted?.should == false }
+
+    deviates_on :rubinius do
+      "hello hello hello".scan("hello".taint) { |m| m.tainted?.should == true }
+    end
+
+    "hello hello hello".taint.scan("hello") { |m| m.tainted?.should == true }
+
+    "hello".scan(/./.taint) { |m| m.tainted?.should == true }
+    "hello".taint.scan(/./) { |m| m.tainted?.should == true }
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/shared/concat.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/shared/concat.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/shared/concat.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,71 @@
+describe :string_concat, :shared => true do
+  it "concatenates the given argument to self and returns self" do
+    str = 'hello '
+    str.send(@method, 'world').should equal(str)
+    str.should == "hello world"
+  end
+
+  it "converts the given argument to a String using to_str" do
+    obj = mock('world!')
+    obj.should_receive(:to_str).and_return("world!")
+    a = 'hello '.send(@method, obj)
+    a.should == 'hello world!'
+  end
+
+  it "raises a TypeError if the given argument can't be converted to a String" do
+    lambda { a = 'hello '.send(@method, :world)    }.should raise_error(TypeError)
+    lambda { a = 'hello '.send(@method, mock('x')) }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError when self is frozen" do
+    a = "hello"
+    a.freeze
+
+    lambda { a.send(@method, "")     }.should raise_error(TypeError)
+    lambda { a.send(@method, "test") }.should raise_error(TypeError)
+  end
+
+  it "works when given a subclass instance" do
+    a = "hello"
+    a << StringSpecs::MyString.new(" world")
+    a.should == "hello world"
+  end
+
+  it "taints self if other is tainted" do
+    x = "x"
+    x.send(@method, "".taint).tainted?.should == true
+
+    x = "x"
+    x.send(@method, "y".taint).tainted?.should == true
+  end
+end
+
+describe :string_concat_fixnum, :shared => true do
+  it "converts the given Fixnum to a char before concatenating" do
+    b = 'hello '.send(@method, 'world').send(@method, 33)
+    b.should == "hello world!"
+    b.send(@method, 0)
+    b.should == "hello world!\x00"
+  end
+
+  it "raises a TypeError when the given Fixnum is not between 0 and 255" do
+    lambda { "hello world".send(@method, 333) }.should raise_error(TypeError)
+    lambda { "".send(@method, (256 * 3 + 64)) }.should raise_error(TypeError)
+    lambda { "".send(@method, -200)           }.should raise_error(TypeError)
+  end
+
+  it "doesn't call to_int on its argument" do
+    x = mock('x')
+    x.should_not_receive(:to_int)
+
+    lambda { "".send(@method, x) }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError when self is frozen" do
+    a = "hello"
+    a.freeze
+
+    lambda { a.send(@method, 0)  }.should raise_error(TypeError)
+    lambda { a.send(@method, 33) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/shared/each.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/shared/each.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/shared/each.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,88 @@
+describe :string_each, :shared => true do
+  it "splits self using the supplied record separator and passes each substring to the block" do
+    a = []
+    "one\ntwo\r\nthree".send(@method, "\n") { |s| a << s }
+    a.should == ["one\n", "two\r\n", "three"]
+
+    b = []
+    "hello\nworld".send(@method, 'l') { |s| b << s }
+    b.should == [ "hel", "l", "o\nworl", "d" ]
+
+    c = []
+    "hello\n\n\nworld".send(@method, "\n") { |s| c << s }
+    c.should == ["hello\n", "\n", "\n", "world"]
+  end
+
+  it "taints substrings that are passed to the block if self is tainted" do
+    "one\ntwo\r\nthree".taint.send(@method) { |s| s.tainted?.should == true }
+
+    "x.y.".send(@method, ".".taint) { |s| s.tainted?.should == false }
+  end
+
+  it "passes self as a whole to the block if the separator is nil" do
+    a = []
+    "one\ntwo\r\nthree".send(@method, nil) { |s| a << s }
+    a.should == ["one\ntwo\r\nthree"]
+  end
+
+  it "appends multiple successive newlines together when the separator is an empty string" do
+    a = []
+    "hello\nworld\n\n\nand\nuniverse\n\n\n\n\n".send(@method, '') { |s| a << s }
+    a.should == ["hello\nworld\n\n\n", "and\nuniverse\n\n\n\n\n"]
+  end
+
+  it "uses $/ as the separator when none is given" do
+    [
+      "", "x", "x\ny", "x\ry", "x\r\ny", "x\n\r\r\ny",
+      "hello hullo bello"
+    ].each do |str|
+      ["", "llo", "\n", "\r", nil].each do |sep|
+        begin
+          expected = []
+          str.send(@method, sep) { |x| expected << x }
+
+          old_rec_sep, $/ = $/, sep
+
+          actual = []
+          str.send(@method) { |x| actual << x }
+
+          actual.should == expected
+        ensure
+          $/ = old_rec_sep
+        end
+      end
+    end
+  end
+
+  it "yields subclass instances for subclasses" do
+    a = []
+    StringSpecs::MyString.new("hello\nworld").send(@method) { |s| a << s.class }
+    a.should == [StringSpecs::MyString, StringSpecs::MyString]
+  end
+
+  it "returns self" do
+    s = "hello\nworld"
+    (s.send(@method) {}).should equal(s)
+  end
+
+  it "tries to convert the separator to a string using to_str" do
+    separator = mock('l')
+    separator.should_receive(:to_str).and_return("l")
+
+    a = []
+    "hello\nworld".send(@method, separator) { |s| a << s }
+    a.should == [ "hel", "l", "o\nworl", "d" ]
+  end
+
+  it "raises a RuntimeError if the string is modified while substituting" do
+    str = "hello\nworld"
+    lambda { str.send(@method) { str[0] = 'x' } }.should raise_error(RuntimeError)
+  end
+
+  it "raises a TypeError when the separator can't be converted to a string" do
+    lambda { "hello world".send(@method, false) {}     }.should raise_error(TypeError)
+    lambda { "hello world".send(@method, ?o) {}        }.should raise_error(TypeError)
+    lambda { "hello world".send(@method, :o) {}        }.should raise_error(TypeError)
+    lambda { "hello world".send(@method, mock('x')) {} }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/shared/equal_value.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/shared/equal_value.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/shared/equal_value.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+describe :string_equal_value, :shared => true do
+  it "returns true if self <=> string returns 0" do
+    'hello'.send(@method, 'hello').should == true
+  end
+
+  it "returns false if self <=> string does not return 0" do
+    "more".send(@method, "MORE").should == false
+    "less".send(@method, "greater").should == false
+  end
+
+  it "ignores subclass differences" do
+    a = "hello"
+    b = StringSpecs::MyString.new("hello")
+
+    a.send(@method, b).should == true
+    b.send(@method, a).should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/shared/length.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/shared/length.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/shared/length.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+describe :string_length, :shared => true do
+  it "returns the length of self" do
+    "".send(@method).should == 0
+    "\x00".send(@method).should == 1
+    "one".send(@method).should == 3
+    "two".send(@method).should == 3
+    "three".send(@method).should == 5
+    "four".send(@method).should == 4
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/shared/slice.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/shared/slice.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/shared/slice.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,408 @@
+describe :string_slice, :shared => true do
+  it "returns the character code of the character at the given index" do
+    "hello".send(@method, 0).should == ?h
+    "hello".send(@method, -1).should == ?o
+  end
+
+  it "returns nil if index is outside of self" do
+    "hello".send(@method, 20).should == nil
+    "hello".send(@method, -20).should == nil
+
+    "".send(@method, 0).should == nil
+    "".send(@method, -1).should == nil
+  end
+
+  it "calls to_int on the given index" do
+    "hello".send(@method, 0.5).should == ?h
+
+    obj = mock('1')
+    obj.should_receive(:to_int).and_return(1)
+    "hello".send(@method, obj).should == ?e
+  end
+
+  it "raises a TypeError if the given index is nil" do
+    lambda { "hello".send(@method, nil) }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError if the given index can't be converted to an Integer" do
+    lambda { "hello".send(@method, mock('x')) }.should raise_error(TypeError)
+    lambda { "hello".send(@method, {})        }.should raise_error(TypeError)
+    lambda { "hello".send(@method, [])        }.should raise_error(TypeError)
+  end
+end
+
+describe :string_slice_index_length, :shared => true do
+  it "returns the substring starting at the given index with the given length" do
+    "hello there".send(@method, 0,0).should == ""
+    "hello there".send(@method, 0,1).should == "h"
+    "hello there".send(@method, 0,3).should == "hel"
+    "hello there".send(@method, 0,6).should == "hello "
+    "hello there".send(@method, 0,9).should == "hello the"
+    "hello there".send(@method, 0,12).should == "hello there"
+
+    "hello there".send(@method, 1,0).should == ""
+    "hello there".send(@method, 1,1).should == "e"
+    "hello there".send(@method, 1,3).should == "ell"
+    "hello there".send(@method, 1,6).should == "ello t"
+    "hello there".send(@method, 1,9).should == "ello ther"
+    "hello there".send(@method, 1,12).should == "ello there"
+
+    "hello there".send(@method, 3,0).should == ""
+    "hello there".send(@method, 3,1).should == "l"
+    "hello there".send(@method, 3,3).should == "lo "
+    "hello there".send(@method, 3,6).should == "lo the"
+    "hello there".send(@method, 3,9).should == "lo there"
+
+    "hello there".send(@method, 4,0).should == ""
+    "hello there".send(@method, 4,3).should == "o t"
+    "hello there".send(@method, 4,6).should == "o ther"
+    "hello there".send(@method, 4,9).should == "o there"
+
+    "foo".send(@method, 2,1).should == "o"
+    "foo".send(@method, 3,0).should == ""
+    "foo".send(@method, 3,1).should == ""
+
+    "".send(@method, 0,0).should == ""
+    "".send(@method, 0,1).should == ""
+
+    "x".send(@method, 0,0).should == ""
+    "x".send(@method, 0,1).should == "x"
+    "x".send(@method, 1,0).should == ""
+    "x".send(@method, 1,1).should == ""
+
+    "x".send(@method, -1,0).should == ""
+    "x".send(@method, -1,1).should == "x"
+
+    "hello there".send(@method, -3,2).should == "er"
+  end
+
+  it "always taints resulting strings when self is tainted" do
+    str = "hello world"
+    str.taint
+
+    str.send(@method, 0,0).tainted?.should == true
+    str.send(@method, 0,1).tainted?.should == true
+    str.send(@method, 2,1).tainted?.should == true
+  end
+
+  it "returns nil if the offset falls outside of self" do
+    "hello there".send(@method, 20,3).should == nil
+    "hello there".send(@method, -20,3).should == nil
+
+    "".send(@method, 1,0).should == nil
+    "".send(@method, 1,1).should == nil
+
+    "".send(@method, -1,0).should == nil
+    "".send(@method, -1,1).should == nil
+
+    "x".send(@method, 2,0).should == nil
+    "x".send(@method, 2,1).should == nil
+
+    "x".send(@method, -2,0).should == nil
+    "x".send(@method, -2,1).should == nil
+  end
+
+  it "returns nil if the length is negative" do
+    "hello there".send(@method, 4,-3).should == nil
+    "hello there".send(@method, -4,-3).should == nil
+  end
+
+  it "calls to_int on the given index and the given length" do
+    "hello".send(@method, 0.5, 1).should == "h"
+    "hello".send(@method, 0.5, 2.5).should == "he"
+    "hello".send(@method, 1, 2.5).should == "el"
+
+    obj = mock('2')
+    obj.should_receive(:to_int).exactly(4).times.and_return(2)
+
+    "hello".send(@method, obj, 1).should == "l"
+    "hello".send(@method, obj, obj).should == "ll"
+    "hello".send(@method, 0, obj).should == "he"
+  end
+
+  it "raises a TypeError when idx or length can't be converted to an integer" do
+    lambda { "hello".send(@method, mock('x'), 0) }.should raise_error(TypeError)
+    lambda { "hello".send(@method, 0, mock('x')) }.should raise_error(TypeError)
+
+    # I'm deliberately including this here.
+    # It means that str.send(@method, other, idx) isn't supported.
+    lambda { "hello".send(@method, "", 0) }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError when the given index or the given length is nil" do
+    lambda { "hello".send(@method, 1, nil)   }.should raise_error(TypeError)
+    lambda { "hello".send(@method, nil, 1)   }.should raise_error(TypeError)
+    lambda { "hello".send(@method, nil, nil) }.should raise_error(TypeError)
+  end
+
+  it "returns subclass instances" do
+    s = StringSpecs::MyString.new("hello")
+    s.send(@method, 0,0).class.should == StringSpecs::MyString
+    s.send(@method, 0,4).class.should == StringSpecs::MyString
+    s.send(@method, 1,4).class.should == StringSpecs::MyString
+  end
+end
+
+describe :string_slice_range, :shared => true do
+  it "returns the substring given by the offsets of the range" do
+    "hello there".send(@method, 1..1).should == "e"
+    "hello there".send(@method, 1..3).should == "ell"
+    "hello there".send(@method, 1...3).should == "el"
+    "hello there".send(@method, -4..-2).should == "her"
+    "hello there".send(@method, -4...-2).should == "he"
+    "hello there".send(@method, 5..-1).should == " there"
+    "hello there".send(@method, 5...-1).should == " ther"
+
+    "".send(@method, 0..0).should == ""
+
+    "x".send(@method, 0..0).should == "x"
+    "x".send(@method, 0..1).should == "x"
+    "x".send(@method, 0...1).should == "x"
+    "x".send(@method, 0..-1).should == "x"
+
+    "x".send(@method, 1..1).should == ""
+    "x".send(@method, 1..-1).should == ""
+  end
+
+  it "returns nil if the beginning of the range falls outside of self" do
+    "hello there".send(@method, 12..-1).should == nil
+    "hello there".send(@method, 20..25).should == nil
+    "hello there".send(@method, 20..1).should == nil
+    "hello there".send(@method, -20..1).should == nil
+    "hello there".send(@method, -20..-1).should == nil
+
+    "".send(@method, -1..-1).should == nil
+    "".send(@method, -1...-1).should == nil
+    "".send(@method, -1..0).should == nil
+    "".send(@method, -1...0).should == nil
+  end
+
+  it "returns an empty string if range.begin is inside self and > real end" do
+    "hello there".send(@method, 1...1).should == ""
+    "hello there".send(@method, 4..2).should == ""
+    "hello".send(@method, 4..-4).should == ""
+    "hello there".send(@method, -5..-6).should == ""
+    "hello there".send(@method, -2..-4).should == ""
+    "hello there".send(@method, -5..-6).should == ""
+    "hello there".send(@method, -5..2).should == ""
+
+    "".send(@method, 0...0).should == ""
+    "".send(@method, 0..-1).should == ""
+    "".send(@method, 0...-1).should == ""
+
+    "x".send(@method, 0...0).should == ""
+    "x".send(@method, 0...-1).should == ""
+    "x".send(@method, 1...1).should == ""
+    "x".send(@method, 1...-1).should == ""
+  end
+
+  it "always taints resulting strings when self is tainted" do
+    str = "hello world"
+    str.taint
+
+    str.send(@method, 0..0).tainted?.should == true
+    str.send(@method, 0...0).tainted?.should == true
+    str.send(@method, 0..1).tainted?.should == true
+    str.send(@method, 0...1).tainted?.should == true
+    str.send(@method, 2..3).tainted?.should == true
+    str.send(@method, 2..0).tainted?.should == true
+  end
+
+  it "returns subclass instances" do
+    s = StringSpecs::MyString.new("hello")
+    s.send(@method, 0...0).class.should == StringSpecs::MyString
+    s.send(@method, 0..4).class.should == StringSpecs::MyString
+    s.send(@method, 1..4).class.should == StringSpecs::MyString
+  end
+
+  it "calls to_int on range arguments" do
+    from = mock('from')
+    to = mock('to')
+
+    # So we can construct a range out of them...
+    from.should_receive(:<=>).twice.and_return(0)
+
+    from.should_receive(:to_int).twice.and_return(1)
+    to.should_receive(:to_int).twice.and_return(-2)
+
+    "hello there".send(@method, from..to).should == "ello ther"
+    "hello there".send(@method, from...to).should == "ello the"
+  end
+
+  it "works with Range subclasses" do
+    a = "GOOD"
+    range_incl = StringSpecs::MyRange.new(1, 2)
+    range_excl = StringSpecs::MyRange.new(-3, -1, true)
+
+    a.send(@method, range_incl).should == "OO"
+    a.send(@method, range_excl).should == "OO"
+  end
+end
+
+describe :string_slice_regexp, :shared => true do
+  it "returns the matching portion of self" do
+    "hello there".send(@method, /[aeiou](.)\1/).should == "ell"
+    "".send(@method, //).should == ""
+  end
+
+  it "returns nil if there is no match" do
+    "hello there".send(@method, /xyz/).should == nil
+  end
+
+  it "always taints resulting strings when self or regexp is tainted" do
+    strs = ["hello world"]
+    strs += strs.map { |s| s.dup.taint }
+
+    strs.each do |str|
+      str.send(@method, //).tainted?.should == str.tainted?
+      str.send(@method, /hello/).tainted?.should == str.tainted?
+
+      tainted_re = /./
+      tainted_re.taint
+
+      str.send(@method, tainted_re).tainted?.should == true
+    end
+  end
+
+  it "returns subclass instances" do
+    s = StringSpecs::MyString.new("hello")
+    s.send(@method, //).class.should == StringSpecs::MyString
+    s.send(@method, /../).class.should == StringSpecs::MyString
+  end
+
+  it "sets $~ to MatchData when there is a match and nil when there's none" do
+    'hello'.send(@method, /./)
+    $~[0].should == 'h'
+
+    'hello'.send(@method, /not/)
+    $~.should == nil
+  end
+end
+
+describe :string_slice_regexp_index, :shared => true do
+  it "returns the capture for the given index" do
+    "hello there".send(@method, /[aeiou](.)\1/, 0).should == "ell"
+    "hello there".send(@method, /[aeiou](.)\1/, 1).should == "l"
+    "hello there".send(@method, /[aeiou](.)\1/, -1).should == "l"
+
+    "har".send(@method, /(.)(.)(.)/, 0).should == "har"
+    "har".send(@method, /(.)(.)(.)/, 1).should == "h"
+    "har".send(@method, /(.)(.)(.)/, 2).should == "a"
+    "har".send(@method, /(.)(.)(.)/, 3).should == "r"
+    "har".send(@method, /(.)(.)(.)/, -1).should == "r"
+    "har".send(@method, /(.)(.)(.)/, -2).should == "a"
+    "har".send(@method, /(.)(.)(.)/, -3).should == "h"
+  end
+
+  it "always taints resulting strings when self or regexp is tainted" do
+    strs = ["hello world"]
+    strs += strs.map { |s| s.dup.taint }
+
+    strs.each do |str|
+      str.send(@method, //, 0).tainted?.should == str.tainted?
+      str.send(@method, /hello/, 0).tainted?.should == str.tainted?
+
+      str.send(@method, /(.)(.)(.)/, 0).tainted?.should == str.tainted?
+      str.send(@method, /(.)(.)(.)/, 1).tainted?.should == str.tainted?
+      str.send(@method, /(.)(.)(.)/, -1).tainted?.should == str.tainted?
+      str.send(@method, /(.)(.)(.)/, -2).tainted?.should == str.tainted?
+
+      tainted_re = /(.)(.)(.)/
+      tainted_re.taint
+
+      str.send(@method, tainted_re, 0).tainted?.should == true
+      str.send(@method, tainted_re, 1).tainted?.should == true
+      str.send(@method, tainted_re, -1).tainted?.should == true
+    end
+  end
+
+  it "returns nil if there is no match" do
+    "hello there".send(@method, /(what?)/, 1).should == nil
+  end
+
+  it "returns nil if there is no capture for the given index" do
+    "hello there".send(@method, /[aeiou](.)\1/, 2).should == nil
+    # You can't refer to 0 using negative indices
+    "hello there".send(@method, /[aeiou](.)\1/, -2).should == nil
+  end
+
+  it "calls to_int on the given index" do
+    obj = mock('2')
+    obj.should_receive(:to_int).and_return(2)
+
+    "har".send(@method, /(.)(.)(.)/, 1.5).should == "h"
+    "har".send(@method, /(.)(.)(.)/, obj).should == "a"
+  end
+
+  it "raises a TypeError when the given index can't be converted to Integer" do
+    lambda { "hello".send(@method, /(.)(.)(.)/, mock('x')) }.should raise_error(TypeError)
+    lambda { "hello".send(@method, /(.)(.)(.)/, {})        }.should raise_error(TypeError)
+    lambda { "hello".send(@method, /(.)(.)(.)/, [])        }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError when the given index is nil" do
+    lambda { "hello".send(@method, /(.)(.)(.)/, nil) }.should raise_error(TypeError)
+  end
+
+  it "returns subclass instances" do
+    s = StringSpecs::MyString.new("hello")
+    s.send(@method, /(.)(.)/, 0).class.should == StringSpecs::MyString
+    s.send(@method, /(.)(.)/, 1).class.should == StringSpecs::MyString
+  end
+
+  it "sets $~ to MatchData when there is a match and nil when there's none" do
+    'hello'.send(@method, /.(.)/, 0)
+    $~[0].should == 'he'
+
+    'hello'.send(@method, /.(.)/, 1)
+    $~[1].should == 'e'
+
+    'hello'.send(@method, /not/, 0)
+    $~.should == nil
+  end
+end
+
+describe :string_slice_string, :shared => true do
+  it "returns other_str if it occurs in self" do
+    s = "lo"
+    "hello there".send(@method, s).should == s
+  end
+
+  it "taints resulting strings when other is tainted" do
+    strs = ["", "hello world", "hello"]
+    strs += strs.map { |s| s.dup.taint }
+
+    strs.each do |str|
+      strs.each do |other|
+        r = str.send(@method, other)
+
+        r.tainted?.should == !r.nil? & other.tainted?
+      end
+    end
+  end
+
+  it "doesn't set $~" do
+    $~ = nil
+
+    'hello'.send(@method, 'll')
+    $~.should == nil
+  end
+
+  it "returns nil if there is no match" do
+    "hello there".send(@method, "bye").should == nil
+  end
+
+  it "doesn't call to_str on its argument" do
+    o = mock('x')
+    o.should_not_receive(:to_str)
+
+    lambda { "hello".send(@method, o) }.should raise_error(TypeError)
+  end
+
+  it "returns a subclass instance when given a subclass instance" do
+    s = StringSpecs::MyString.new("el")
+    r = "hello".send(@method, s)
+    r.should == "el"
+    r.class.should == StringSpecs::MyString
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/shared/succ.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/shared/succ.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/shared/succ.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,86 @@
+describe :string_succ, :shared => true do
+  it "returns an empty string for empty strings" do
+    "".send(@method).should == ""
+  end
+
+  it "returns the successor by increasing the rightmost alphanumeric (digit => digit, letter => letter with same case)" do
+    "abcd".send(@method).should == "abce"
+    "THX1138".send(@method).should == "THX1139"
+
+    "<<koala>>".send(@method).should == "<<koalb>>"
+    "==A??".send(@method).should == "==B??"
+  end
+
+  it "increases non-alphanumerics (via ascii rules) if there are no alphanumerics" do
+    "***".send(@method).should == "**+"
+    "**`".send(@method).should == "**a"
+  end
+
+  it "increases the next best alphanumeric (jumping over non-alphanumerics) if there is a carry" do
+    "dz".send(@method).should == "ea"
+    "HZ".send(@method).should == "IA"
+    "49".send(@method).should == "50"
+
+    "izz".send(@method).should == "jaa"
+    "IZZ".send(@method).should == "JAA"
+    "699".send(@method).should == "700"
+
+    "6Z99z99Z".send(@method).should == "7A00a00A"
+
+    "1999zzz".send(@method).should == "2000aaa"
+    "NZ/[]ZZZ9999".send(@method).should == "OA/[]AAA0000"
+  end
+
+  it "increases the next best character if there is a carry for non-alphanumerics" do
+    "(\xFF".send(@method).should == ")\x00"
+    "`\xFF".send(@method).should == "a\x00"
+    "<\xFF\xFF".send(@method).should == "=\x00\x00"
+  end
+
+  it "adds an additional character (just left to the last increased one) if there is a carry and no character left to increase" do
+    "z".send(@method).should == "aa"
+    "Z".send(@method).should == "AA"
+    "9".send(@method).should == "10"
+
+    "zz".send(@method).should == "aaa"
+    "ZZ".send(@method).should == "AAA"
+    "99".send(@method).should == "100"
+
+    "9Z99z99Z".send(@method).should == "10A00a00A"
+
+    "ZZZ9999".send(@method).should == "AAAA0000"
+    "/[]ZZZ9999".send(@method).should == "/[]AAAA0000"
+    "Z/[]ZZZ9999".send(@method).should == "AA/[]AAA0000"
+
+    # non-alphanumeric cases
+    "\xFF".send(@method).should == "\x01\x00"
+    "\xFF\xFF".send(@method).should == "\x01\x00\x00"
+  end
+
+  it "returns subclass instances when called on a subclass" do
+    StringSpecs::MyString.new("").send(@method).class.should == StringSpecs::MyString
+    StringSpecs::MyString.new("a").send(@method).class.should == StringSpecs::MyString
+    StringSpecs::MyString.new("z").send(@method).class.should == StringSpecs::MyString
+  end
+
+  it "taints the result if self is tainted" do
+    ["", "a", "z", "Z", "9", "\xFF", "\xFF\xFF"].each do |s|
+      s.taint.send(@method).tainted?.should == true
+    end
+  end
+end
+
+describe :string_succ_bang, :shared => true do
+  it "is equivalent to succ, but modifies self in place (still returns self)" do
+    ["", "abcd", "THX1138"].each do |s|
+      r = s.dup.send(@method)
+      s.send(@method).should equal(s)
+      s.should == r
+    end
+  end
+
+  it "raises a TypeError if self is frozen" do
+    lambda { "".freeze.send(@method)     }.should raise_error(TypeError)
+    lambda { "abcd".freeze.send(@method) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/shared/to_a.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/shared/to_a.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/shared/to_a.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+describe :string_to_a, :shared => true do
+  it "returns an empty array for empty strings" do
+    "".send(@method).should == []
+  end
+
+  it "returns an array containing the string for non-empty strings" do
+    "hello".send(@method).should == ["hello"]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/shared/to_s.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/shared/to_s.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/shared/to_s.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+describe :string_to_s, :shared => true do
+  it "returns self when self.class == String" do
+    a = "a string"
+    a.should equal(a.send(@method))
+  end
+
+  it "returns a new instance of String when called on a subclass" do
+    a = StringSpecs::MyString.new("a string")
+    s = a.send(@method)
+    s.should == "a string"
+    s.class.should == String
+  end
+
+  it "taints the result when self is tainted" do
+    "x".taint.send(@method).tainted?.should == true
+    StringSpecs::MyString.new("x").taint.send(@method).tainted?.should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/shared/to_sym.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/shared/to_sym.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/shared/to_sym.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+describe :string_to_sym, :shared => true do
+  it "returns the symbol corresponding to self" do
+    "Koala".send(@method).should == :Koala
+    'cat'.send(@method).should == :cat
+    '@cat'.send(@method).should == :@cat
+    'cat and dog'.send(@method).should == :"cat and dog"
+    "abc=".send(@method).should == :abc=
+  end
+
+  it "raises an ArgumentError when self can't be converted to symbol" do
+    lambda { "".send(@method)           }.should raise_error(ArgumentError)
+    lambda { "foo\x00bar".send(@method) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.dirname(__FILE__) + '/shared/length'
+
+describe "String#size" do
+  it_behaves_like(:string_length, :size)
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/string/slice_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/slice_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/slice_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,426 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.dirname(__FILE__) + '/shared/slice.rb'
+
+describe "String#slice" do
+  it_behaves_like :string_slice, :slice
+end
+
+describe "String#slice with index, length" do
+  it_behaves_like :string_slice_index_length, :slice
+end
+
+describe "String#slice with Range" do
+  it_behaves_like :string_slice_range, :slice
+end
+
+describe "String#slice with Regexp" do
+  it_behaves_like :string_slice_regexp, :slice
+end
+
+describe "String#slice with Regexp, index" do
+  it_behaves_like :string_slice_regexp_index, :slice
+end
+
+describe "String#slice with String" do
+  it_behaves_like :string_slice_string, :slice
+end
+
+describe "String#slice! with index" do
+  it "deletes and return the char at the given position" do
+    a = "hello"
+    a.slice!(1).should == ?e
+    a.should == "hllo"
+    a.slice!(-1).should == ?o
+    a.should == "hll"
+  end
+
+  it "returns nil if idx is outside of self" do
+    a = "hello"
+    a.slice!(20).should == nil
+    a.should == "hello"
+    a.slice!(-20).should == nil
+    a.should == "hello"
+  end
+
+  it "raises a TypeError if self is frozen" do
+    lambda { "hello".freeze.slice!(1) }.should raise_error(TypeError)
+  end
+
+  it "doesn't raise a TypeError if self is frozen and idx is outside of self" do
+    "hello".freeze.slice!(10).should be_nil
+    "".freeze.slice!(0).should be_nil
+  end
+
+  it "calls to_int on index" do
+    "hello".slice!(0.5).should == ?h
+
+    obj = mock('1')
+    # MRI calls this twice so we can't use should_receive here.
+    def obj.to_int() 1 end
+    "hello".slice!(obj).should == ?e
+
+    obj = mock('1')
+    def obj.respond_to?(name) name == :to_int ? true : super; end
+    def obj.method_missing(name, *) name == :to_int ? 1 : super; end
+    "hello".slice!(obj).should == ?e
+  end
+end
+
+describe "String#slice! with index, length" do
+  it "deletes and returns the substring at idx and the given length" do
+    a = "hello"
+    a.slice!(1, 2).should == "el"
+    a.should == "hlo"
+
+    a.slice!(1, 0).should == ""
+    a.should == "hlo"
+
+    a.slice!(-2, 4).should == "lo"
+    a.should == "h"
+  end
+
+  it "always taints resulting strings when self is tainted" do
+    str = "hello world"
+    str.taint
+
+    str.slice!(0, 0).tainted?.should == true
+    str.slice!(2, 1).tainted?.should == true
+  end
+
+  it "returns nil if the given position is out of self" do
+    a = "hello"
+    a.slice(10, 3).should == nil
+    a.should == "hello"
+
+    a.slice(-10, 20).should == nil
+    a.should == "hello"
+  end
+
+  it "returns nil if the length is negative" do
+    a = "hello"
+    a.slice(4, -3).should == nil
+    a.should == "hello"
+  end
+
+  it "raises a TypeError if self is frozen" do
+    lambda { "hello".freeze.slice!(1, 2) }.should raise_error(TypeError)
+  end
+
+  it "doesn't raise a TypeError if self is frozen but the given position is out of self" do
+    "hello".freeze.slice!(10, 3).should be_nil
+    "hello".freeze.slice!(-10, 3).should be_nil
+  end
+
+  it "doesn't raise a TypeError if self is frozen but length is negative" do
+    "hello".freeze.slice!(4, -3).should be_nil
+  end
+
+  it "calls to_int on idx and length" do
+    "hello".slice!(0.5, 2.5).should == "he"
+
+    obj = mock('2')
+    def obj.to_int() 2 end
+    "hello".slice!(obj, obj).should == "ll"
+
+    obj = mock('2')
+    def obj.respond_to?(name) name == :to_int; end
+    def obj.method_missing(name, *) name == :to_int ? 2 : super; end
+    "hello".slice!(obj, obj).should == "ll"
+  end
+
+  it "returns subclass instances" do
+    s = StringSpecs::MyString.new("hello")
+    s.slice!(0, 0).class.should == StringSpecs::MyString
+    s.slice!(0, 4).class.should == StringSpecs::MyString
+  end
+end
+
+describe "String#slice! Range" do
+  it "deletes and return the substring given by the offsets of the range" do
+    a = "hello"
+    a.slice!(1..3).should == "ell"
+    a.should == "ho"
+    a.slice!(0..0).should == "h"
+    a.should == "o"
+    a.slice!(0...0).should == ""
+    a.should == "o"
+
+    # Edge Case?
+    "hello".slice!(-3..-9).should == ""
+  end
+
+  it "returns nil if the given range is out of self" do
+    a = "hello"
+    a.slice!(-6..-9).should == nil
+    a.should == "hello"
+
+    b = "hello"
+    b.slice!(10..20).should == nil
+    b.should == "hello"
+  end
+
+  it "always taints resulting strings when self is tainted" do
+    str = "hello world"
+    str.taint
+
+    str.slice!(0..0).tainted?.should == true
+    str.slice!(2..3).tainted?.should == true
+  end
+
+  it "returns subclass instances" do
+    s = StringSpecs::MyString.new("hello")
+    s.slice!(0...0).class.should == StringSpecs::MyString
+    s.slice!(0..4).class.should == StringSpecs::MyString
+  end
+
+  it "calls to_int on range arguments" do
+    from = mock('from')
+    to = mock('to')
+
+    # So we can construct a range out of them...
+    def from.<=>(o) 0 end
+    def to.<=>(o) 0 end
+
+    def from.to_int() 1 end
+    def to.to_int() -2 end
+
+    "hello there".slice!(from..to).should == "ello ther"
+
+    from = mock('from')
+    to = mock('to')
+
+    def from.<=>(o) 0 end
+    def to.<=>(o) 0 end
+
+    def from.respond_to?(name) name == :to_int; end
+    def from.method_missing(name) name == :to_int ? 1 : super; end
+    def to.respond_to?(name) name == :to_int; end
+    def to.method_missing(name) name == :to_int ? -2 : super; end
+
+    "hello there".slice!(from..to).should == "ello ther"
+  end
+
+  it "works with Range subclasses" do
+    a = "GOOD"
+    range_incl = StringSpecs::MyRange.new(1, 2)
+
+    a.slice!(range_incl).should == "OO"
+  end
+
+  it "raises a TypeError if self is frozen" do
+    lambda { "hello".freeze.slice!(1..3) }.should raise_error(TypeError)
+  end
+
+  it "doesn't raise a TypeError if self is frozen but the given range is out of self" do
+    "hello".freeze.slice!(10..20).should == nil
+  end
+end
+
+describe "String#slice! with Regexp" do
+  it "deletes and returns the first match from self" do
+    s = "this is a string"
+    s.slice!(/s.*t/).should == 's is a st'
+    s.should == 'thiring'
+
+    c = "hello hello"
+    c.slice!(/llo/).should == "llo"
+    c.should == "he hello"
+  end
+
+  it "returns nil if there was no match" do
+    s = "this is a string"
+    s.slice!(/zzz/).should == nil
+    s.should == "this is a string"
+  end
+
+  it "always taints resulting strings when self or regexp is tainted" do
+    strs = ["hello world"]
+    strs += strs.map { |s| s.dup.taint }
+
+    strs.each do |str|
+      str = str.dup
+      str.slice!(//).tainted?.should == str.tainted?
+      str.slice!(/hello/).tainted?.should == str.tainted?
+
+      tainted_re = /./
+      tainted_re.taint
+
+      str.slice!(tainted_re).tainted?.should == true
+    end
+  end
+
+  it "doesn't taint self when regexp is tainted" do
+    s = "hello"
+    s.slice!(/./.taint)
+    s.tainted?.should == false
+  end
+
+  it "returns subclass instances" do
+    s = StringSpecs::MyString.new("hello")
+    s.slice!(//).class.should == StringSpecs::MyString
+    s.slice!(/../).class.should == StringSpecs::MyString
+  end
+
+  # This currently fails, but passes in a pure Rubinius environment (without mspec)
+  # probably because mspec uses match internally for its operation
+  it "sets $~ to MatchData when there is a match and nil when there's none" do
+    'hello'.slice!(/./)
+    $~[0].should == 'h'
+
+    'hello'.slice!(/not/)
+    $~.should == nil
+  end
+
+  it "raises a TypeError if self is frozen" do
+    lambda { "this is a string".freeze.slice!(/s.*t/) }.should raise_error(TypeError)
+  end
+
+  it "doesn't raise a TypeError if self is frozen but there is no match" do
+    "this is a string".freeze.slice!(/zzz/).should == nil
+  end
+end
+
+describe "String#slice! with Regexp, index" do
+  it "deletes and returns the capture for idx from self" do
+    str = "hello there"
+    str.slice!(/[aeiou](.)\1/, 0).should == "ell"
+    str.should == "ho there"
+    str.slice!(/(t)h/, 1).should == "t"
+    str.should == "ho here"
+  end
+
+  it "always taints resulting strings when self or regexp is tainted" do
+    strs = ["hello world"]
+    strs += strs.map { |s| s.dup.taint }
+
+    strs.each do |str|
+      str = str.dup
+      str.slice!(//, 0).tainted?.should == str.tainted?
+      str.slice!(/hello/, 0).tainted?.should == str.tainted?
+
+      tainted_re = /(.)(.)(.)/
+      tainted_re.taint
+
+      str.slice!(tainted_re, 1).tainted?.should == true
+    end
+  end
+
+  it "doesn't taint self when regexp is tainted" do
+    s = "hello"
+    s.slice!(/(.)(.)/.taint, 1)
+    s.tainted?.should == false
+  end
+
+  it "returns nil if there was no match" do
+    s = "this is a string"
+    s.slice!(/x(zzz)/, 1).should == nil
+    s.should == "this is a string"
+  end
+
+  it "returns nil if there is no capture for idx" do
+    "hello there".slice!(/[aeiou](.)\1/, 2).should == nil
+    # You can't refer to 0 using negative indices
+    "hello there".slice!(/[aeiou](.)\1/, -2).should == nil
+  end
+
+  it "calls to_int on idx" do
+    obj = mock('2')
+    def obj.to_int() 2 end
+
+    "har".slice!(/(.)(.)(.)/, 1.5).should == "h"
+    "har".slice!(/(.)(.)(.)/, obj).should == "a"
+
+    obj = mock('2')
+    def obj.respond_to?(name) name == :to_int; end
+    def obj.method_missing(name) name == :to_int ? 2: super; end
+    "har".slice!(/(.)(.)(.)/, obj).should == "a"
+  end
+
+  it "returns subclass instances" do
+    s = StringSpecs::MyString.new("hello")
+    s.slice!(/(.)(.)/, 0).class.should == StringSpecs::MyString
+    s.slice!(/(.)(.)/, 1).class.should == StringSpecs::MyString
+  end
+
+  it "sets $~ to MatchData when there is a match and nil when there's none" do
+    'hello'[/.(.)/, 0]
+    $~[0].should == 'he'
+
+    'hello'[/.(.)/, 1]
+    $~[1].should == 'e'
+
+    'hello'[/not/, 0]
+    $~.should == nil
+  end
+
+  it "raises a TypeError if self is frozen" do
+    lambda { "this is a string".freeze.slice!(/s.*t/) }.should raise_error(TypeError)
+  end
+
+  it "doesn't raise a TypeError if self is frozen but there is no match" do
+    "this is a string".freeze.slice!(/zzz/, 0).should == nil
+  end
+
+  it "doesn't raise a TypeError if self is frozen but there is no capture for idx" do
+    "this is a string".freeze.slice!(/(.)/, 2).should == nil
+  end
+end
+
+describe "String#slice! with String" do
+  it "removes and returns the first occurrence of other_str from self" do
+    c = "hello hello"
+    c.slice!('llo').should == "llo"
+    c.should == "he hello"
+  end
+
+  it "taints resulting strings when other is tainted" do
+    strs = ["", "hello world", "hello"]
+    strs += strs.map { |s| s.dup.taint }
+
+    strs.each do |str|
+      str = str.dup
+      strs.each do |other|
+        other = other.dup
+        r = str.slice!(other)
+
+        r.tainted?.should == !r.nil? & other.tainted?
+      end
+    end
+  end
+
+  it "doesn't set $~" do
+    $~ = nil
+
+    'hello'.slice!('ll')
+    $~.should == nil
+  end
+
+  it "returns nil if self does not contain other" do
+    a = "hello"
+    a.slice!('zzz').should == nil
+    a.should == "hello"
+  end
+
+  it "doesn't call to_str on its argument" do
+    o = mock('x')
+    o.should_not_receive(:to_str)
+
+    lambda { "hello".slice!(o) }.should raise_error(TypeError)
+  end
+
+  it "returns a subclass instance when given a subclass instance" do
+    s = StringSpecs::MyString.new("el")
+    r = "hello".slice!(s)
+    r.should == "el"
+    r.class.should == StringSpecs::MyString
+  end
+
+  it "raises a TypeError if self is frozen" do
+    lambda { "hello hello".freeze.slice!('llo') }.should raise_error(TypeError)
+  end
+
+  it "doesn't raise a TypeError if self is frozen but self does not contain other" do
+    "this is a string".freeze.slice!('zzz').should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/split_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/split_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/split_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,294 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#split with String" do
+  it "returns an array of substrings based on splitting on the given string" do
+    "mellow yellow".split("ello").should == ["m", "w y", "w"]
+  end
+  
+  it "suppresses trailing empty fields when limit isn't given or 0" do
+    "1,2,,3,4,,".split(',').should == ["1", "2", "", "3", "4"]
+    "1,2,,3,4,,".split(',', 0).should == ["1", "2", "", "3", "4"]
+    "  a  b  c\nd  ".split("  ").should == ["", "a", "b", "c\nd"]
+    "hai".split("hai").should == []
+    ",".split(",").should == []
+    ",".split(",", 0).should == []
+  end
+
+  it "returns an array with one entry if limit is 1: the original string" do
+    "hai".split("hai", 1).should == ["hai"]
+    "x.y.z".split(".", 1).should == ["x.y.z"]
+    "hello world ".split(" ", 1).should == ["hello world "]
+    "hi!".split("", 1).should == ["hi!"]
+  end
+
+  it "returns at most limit fields when limit > 1" do
+    "hai".split("hai", 2).should == ["", ""]
+
+    "1,2,,3,4,,".split(',', 2).should == ["1", "2,,3,4,,"]
+    "1,2,,3,4,,".split(',', 3).should == ["1", "2", ",3,4,,"]
+    "1,2,,3,4,,".split(',', 4).should == ["1", "2", "", "3,4,,"]
+    "1,2,,3,4,,".split(',', 5).should == ["1", "2", "", "3", "4,,"]
+    "1,2,,3,4,,".split(',', 6).should == ["1", "2", "", "3", "4", ","]
+
+    "x".split('x', 2).should == ["", ""]
+    "xx".split('x', 2).should == ["", "x"]
+    "xx".split('x', 3).should == ["", "", ""]
+    "xxx".split('x', 2).should == ["", "xx"]
+    "xxx".split('x', 3).should == ["", "", "x"]
+    "xxx".split('x', 4).should == ["", "", "", ""]
+  end
+  
+  it "doesn't suppress or limit fields when limit is negative" do
+    "1,2,,3,4,,".split(',', -1).should == ["1", "2", "", "3", "4", "", ""]
+    "1,2,,3,4,,".split(',', -5).should == ["1", "2", "", "3", "4", "", ""]
+    "  a  b  c\nd  ".split("  ", -1).should == ["", "a", "b", "c\nd", ""]
+    ",".split(",", -1).should == ["", ""]
+  end
+  
+  it "defaults to $; when string isn't given or nil" do
+    begin
+      old_fs = $;
+    
+      [",", ":", "", "XY", nil].each do |fs|
+        $; = fs
+        
+        ["x,y,z,,,", "1:2:", "aXYbXYcXY", ""].each do |str|
+          expected = str.split(fs || " ")
+          
+          str.split(nil).should == expected
+          str.split.should == expected
+
+          str.split(nil, -1).should == str.split(fs || " ", -1)
+          str.split(nil, 0).should == str.split(fs || " ", 0)
+          str.split(nil, 2).should == str.split(fs || " ", 2)
+        end
+      end
+    ensure
+      $; = old_fs
+    end    
+  end
+    
+  it "ignores leading and continuous whitespace when string is a single space" do
+    " now's  the time  ".split(' ').should == ["now's", "the", "time"]
+    " now's  the time  ".split(' ', -1).should == ["now's", "the", "time", ""]
+
+    "\t\n a\t\tb \n\r\r\nc\v\vd\v ".split(' ').should == ["a", "b", "c", "d"]
+    "a\x00a b".split(' ').should == ["a\x00a", "b"]
+  end
+  
+  it "splits between characters when its argument is an empty string" do
+    "hi!".split("").should == ["h", "i", "!"]
+    "hi!".split("", -1).should == ["h", "i", "!", ""]
+    "hi!".split("", 2).should == ["h", "i!"]
+  end
+  
+  it "tries converting its pattern argument to a string via to_str" do
+    obj = mock('::')
+    obj.should_receive(:to_str).and_return("::")
+
+    "hello::world".split(obj).should == ["hello", "world"]
+  end
+  
+  it "tries converting limit to an integer via to_int" do
+    obj = mock('2')
+    obj.should_receive(:to_int).and_return(2)
+
+    "1.2.3.4".split(".", obj).should == ["1", "2.3.4"]
+  end
+  
+  it "doesn't set $~" do
+    $~ = nil
+    "x.y.z".split(".")
+    $~.should == nil
+  end
+  
+  it "returns subclass instances based on self" do
+    ["", "x.y.z.", "  x  y  "].each do |str|
+      ["", ".", " "].each do |pat|
+        [-1, 0, 1, 2].each do |limit|
+          StringSpecs::MyString.new(str).split(pat, limit).each do |x|
+            x.class.should == StringSpecs::MyString
+          end
+          
+          str.split(StringSpecs::MyString.new(pat), limit).each do |x|
+            x.class.should == String 
+          end
+        end
+      end
+    end
+  end
+  
+  it "does not call constructor on created subclass instances" do
+    # can't call should_not_receive on an object that doesn't yet exist
+    # so failure here is signalled by exception, not expectation failure
+    
+    s = StringSpecs::StringWithRaisingConstructor.new('silly:string')
+    s.split(':').first.should == 'silly'
+  end
+    
+  it "taints the resulting strings if self is tainted" do
+    ["", "x.y.z.", "  x  y  "].each do |str|
+      ["", ".", " "].each do |pat|
+        [-1, 0, 1, 2].each do |limit|
+          str.dup.taint.split(pat).each do |x|
+            x.tainted?.should == true
+          end
+          
+          str.split(pat.dup.taint).each do |x|
+            x.tainted?.should == false
+          end
+        end
+      end
+    end    
+  end
+end
+
+describe "String#split with Regexp" do
+  it "divides self on regexp matches" do
+    " now's  the time".split(/ /).should == ["", "now's", "", "the", "time"]
+    " x\ny ".split(/ /).should == ["", "x\ny"]
+    "1, 2.34,56, 7".split(/,\s*/).should == ["1", "2.34", "56", "7"]
+    "1x2X3".split(/x/i).should == ["1", "2", "3"]
+  end
+
+  it "treats negative limits as no limit" do
+    "".split(%r!/+!, -1).should == []
+  end
+  
+  it "suppresses trailing empty fields when limit isn't given or 0" do
+    "1,2,,3,4,,".split(/,/).should == ["1", "2", "", "3", "4"]
+    "1,2,,3,4,,".split(/,/, 0).should == ["1", "2", "", "3", "4"]
+    "  a  b  c\nd  ".split(/\s+/).should == ["", "a", "b", "c", "d"]
+    "hai".split(/hai/).should == []
+    ",".split(/,/).should == []
+    ",".split(/,/, 0).should == []
+  end
+
+  it "returns an array with one entry if limit is 1: the original string" do
+    "hai".split(/hai/, 1).should == ["hai"]
+    "xAyBzC".split(/[A-Z]/, 1).should == ["xAyBzC"]
+    "hello world ".split(/\s+/, 1).should == ["hello world "]
+    "hi!".split(//, 1).should == ["hi!"]
+  end
+
+  it "returns at most limit fields when limit > 1" do
+    "hai".split(/hai/, 2).should == ["", ""]
+
+    "1,2,,3,4,,".split(/,/, 2).should == ["1", "2,,3,4,,"]
+    "1,2,,3,4,,".split(/,/, 3).should == ["1", "2", ",3,4,,"]
+    "1,2,,3,4,,".split(/,/, 4).should == ["1", "2", "", "3,4,,"]
+    "1,2,,3,4,,".split(/,/, 5).should == ["1", "2", "", "3", "4,,"]
+    "1,2,,3,4,,".split(/,/, 6).should == ["1", "2", "", "3", "4", ","]
+
+    "x".split(/x/, 2).should == ["", ""]
+    "xx".split(/x/, 2).should == ["", "x"]
+    "xx".split(/x/, 3).should == ["", "", ""]
+    "xxx".split(/x/, 2).should == ["", "xx"]
+    "xxx".split(/x/, 3).should == ["", "", "x"]
+    "xxx".split(/x/, 4).should == ["", "", "", ""]
+  end
+  
+  it "doesn't suppress or limit fields when limit is negative" do
+    "1,2,,3,4,,".split(/,/, -1).should == ["1", "2", "", "3", "4", "", ""]
+    "1,2,,3,4,,".split(/,/, -5).should == ["1", "2", "", "3", "4", "", ""]
+    "  a  b  c\nd  ".split(/\s+/, -1).should == ["", "a", "b", "c", "d", ""]
+    ",".split(/,/, -1).should == ["", ""]
+  end
+  
+  it "defaults to $; when regexp isn't given or nil" do
+    begin
+      old_fs = $;
+    
+      [/,/, /:/, //, /XY/, /./].each do |fs|
+        $; = fs
+        
+        ["x,y,z,,,", "1:2:", "aXYbXYcXY", ""].each do |str|
+          expected = str.split(fs)
+          
+          str.split(nil).should == expected
+          str.split.should == expected
+
+          str.split(nil, -1).should == str.split(fs, -1)
+          str.split(nil, 0).should == str.split(fs, 0)
+          str.split(nil, 2).should == str.split(fs, 2)
+        end
+      end
+    ensure
+      $; = old_fs
+    end    
+  end
+  
+  it "splits between characters when regexp matches a zero-length string" do
+    "hello".split(//).should == ["h", "e", "l", "l", "o"]
+    "hello".split(//, -1).should == ["h", "e", "l", "l", "o", ""]
+    "hello".split(//, 2).should == ["h", "ello"]
+    
+    "hi mom".split(/\s*/).should == ["h", "i", "m", "o", "m"]
+  end
+  
+  it "includes all captures in the result array" do
+    "hello".split(/(el)/).should == ["h", "el", "lo"]
+    "hi!".split(/()/).should == ["h", "", "i", "", "!"]
+    "hi!".split(/()/, -1).should == ["h", "", "i", "", "!", "", ""]
+    "hello".split(/((el))()/).should == ["h", "el", "el", "", "lo"]
+    "AabB".split(/([a-z])+/).should == ["A", "b", "B"]
+  end
+
+  it "does not include non-matching captures in the result array" do
+    "hello".split(/(el)|(xx)/).should == ["h", "el", "lo"]
+  end
+
+  it "tries converting limit to an integer via to_int" do
+    obj = mock('2')
+    obj.should_receive(:to_int).and_return(2)
+
+    "1.2.3.4".split(".", obj).should == ["1", "2.3.4"]
+  end
+  
+  it "doesn't set $~" do
+    $~ = nil
+    "x:y:z".split(/:/)
+    $~.should == nil
+  end
+  
+  it "returns the original string if no matches are found" do
+    "foo".split("\n").should == ["foo"]
+  end
+  
+  it "returns subclass instances based on self" do
+    ["", "x:y:z:", "  x  y  "].each do |str|
+      [//, /:/, /\s+/].each do |pat|
+        [-1, 0, 1, 2].each do |limit|
+          StringSpecs::MyString.new(str).split(pat, limit).each do |x|
+            x.class.should == StringSpecs::MyString
+          end
+        end
+      end
+    end
+  end
+
+  it "does not call constructor on created subclass instances" do
+    # can't call should_not_receive on an object that doesn't yet exist
+    # so failure here is signalled by exception, not expectation failure
+    
+    s = StringSpecs::StringWithRaisingConstructor.new('silly:string')
+    s.split(/:/).first.should == 'silly'
+  end
+  
+  it "taints the resulting strings if self is tainted" do
+    ["", "x:y:z:", "  x  y  "].each do |str|
+      [//, /:/, /\s+/].each do |pat|
+        [-1, 0, 1, 2].each do |limit|
+          str.dup.taint.split(pat).each do |x|
+            x.tainted?.should == true
+          end
+          
+          str.split(pat.dup.taint).each do |x|
+            x.tainted?.should == false
+          end
+        end
+      end
+    end    
+  end  
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/squeeze_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/squeeze_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/squeeze_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,100 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#squeeze" do
+  it "returns new string where runs of the same character are replaced by a single character when no args are given" do
+    "yellow moon".squeeze.should == "yelow mon"
+  end
+
+  it "only squeezes chars that are in the intersection of all sets given" do
+    "woot squeeze cheese".squeeze("eost", "queo").should == "wot squeze chese"
+    "  now   is  the".squeeze(" ").should == " now is the"
+  end
+
+  it "negates sets starting with ^" do
+    s = "<<subbookkeeper!!!>>"
+    s.squeeze("beko", "^e").should == s.squeeze("bko")
+    s.squeeze("^<bek!>").should == s.squeeze("o")
+    s.squeeze("^o").should == s.squeeze("<bek!>")
+    s.squeeze("^").should == s
+    "^__^".squeeze("^^").should == "^_^"
+    "((^^__^^))".squeeze("_^").should == "((^_^))"
+  end
+
+  it "squeezes all chars in a sequence" do
+    s = "--subbookkeeper--"
+    s.squeeze("\x00-\xFF").should == s.squeeze
+    s.squeeze("bk-o").should == s.squeeze("bklmno")
+    s.squeeze("b-e").should == s.squeeze("bcde")
+    s.squeeze("e-").should == "-subbookkeper-"
+    s.squeeze("-e").should == "-subbookkeper-"
+    s.squeeze("---").should == "-subbookkeeper-"
+    "ook--001122".squeeze("--2").should == "ook-012"
+    "ook--(())".squeeze("(--").should == "ook-()"
+    s.squeeze("e-b").should == s
+    s.squeeze("^e-b").should == s.squeeze
+    s.squeeze("^b-e").should == "-subbokeeper-"
+    "^^__^^".squeeze("^^-^").should == "^^_^^"
+    "^^--^^".squeeze("^---").should == "^--^"
+
+    s.squeeze("b-dk-o-").should == "-subokeeper-"
+    s.squeeze("-b-dk-o").should == "-subokeeper-"
+    s.squeeze("b-d-k-o").should == "-subokeeper-"
+
+    s.squeeze("bc-e").should == "--subookkeper--"
+    s.squeeze("^bc-e").should == "-subbokeeper-"
+
+    "AABBCCaabbcc[[]]".squeeze("A-a").should == "ABCabbcc[]"
+  end
+
+  it "taints the result when self is tainted" do
+    "hello".taint.squeeze("e").tainted?.should == true
+    "hello".taint.squeeze("a-z").tainted?.should == true
+
+    "hello".squeeze("e".taint).tainted?.should == false
+    "hello".squeeze("l".taint).tainted?.should == false
+  end
+
+  it "tries to convert each set arg to a string using to_str" do
+    other_string = mock('lo')
+    other_string.should_receive(:to_str).and_return("lo")
+
+    other_string2 = mock('o')
+    other_string2.should_receive(:to_str).and_return("o")
+
+    "hello room".squeeze(other_string, other_string2).should == "hello rom"
+  end
+
+  it "raises a TypeError when one set arg can't be converted to a string" do
+    lambda { "hello world".squeeze(?o)        }.should raise_error(TypeError)
+    lambda { "hello world".squeeze(:o)        }.should raise_error(TypeError)
+    lambda { "hello world".squeeze(mock('x')) }.should raise_error(TypeError)
+  end
+
+  it "returns subclass instances when called on a subclass" do
+    StringSpecs::MyString.new("oh no!!!").squeeze("!").class.should == StringSpecs::MyString
+  end
+end
+
+describe "String#squeeze!" do
+  it "modifies self in place and returns self" do
+    a = "yellow moon"
+    a.squeeze!.should equal(a)
+    a.should == "yelow mon"
+  end
+
+  it "returns nil if no modifications were made" do
+    a = "squeeze"
+    a.squeeze!("u", "sq").should == nil
+    a.squeeze!("q").should == nil
+    a.should == "squeeze"
+  end
+
+  it "raises a TypeError when self is frozen" do
+    a = "yellow moon"
+    a.freeze
+
+    lambda { a.squeeze!("") }.should raise_error(TypeError)
+    lambda { a.squeeze!     }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/strip_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/strip_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/strip_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,38 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#strip" do
+  it "returns a new string with leading and trailing whitespace removed" do
+    "   hello   ".strip.should == "hello"
+    "   hello world   ".strip.should == "hello world"
+    "\tgoodbye\r\v\n".strip.should == "goodbye"
+    "  goodbye \000".strip.should == "goodbye"
+  end
+
+  it "taints the result when self is tainted" do
+    "".taint.strip.tainted?.should == true
+    "ok".taint.strip.tainted?.should == true
+    "  ok  ".taint.strip.tainted?.should == true
+  end
+end
+
+describe "String#strip!" do
+  it "modifies self in place and returns self" do
+    a = "   hello   "
+    a.strip!.should equal(a)
+    a.should == "hello"
+  end
+
+  it "returns nil if no modifications where made" do
+    a = "hello"
+    a.strip!.should == nil
+    a.should == "hello"
+  end
+
+  it "raises a TypeError if self is frozen" do
+    "hello".freeze.strip! # ok, nothing changed
+    "".freeze.strip! # ok, nothing changed
+
+    lambda { "  hello  ".freeze.strip! }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/sub_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/sub_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/sub_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,371 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#sub with pattern, replacement" do
+  it "returns a copy of self with all occurrences of pattern replaced with replacement" do
+    "hello".sub(/[aeiou]/, '*').should == "h*llo"
+    "hello".sub(//, ".").should == ".hello"
+  end
+
+  it "ignores a block if supplied" do
+    "food".sub(/f/, "g") { "w" }.should == "good"
+  end
+
+  it "supports \\G which matches at the beginning of the string" do
+    "hello world!".sub(/\Ghello/, "hi").should == "hi world!"
+  end
+
+  it "supports /i for ignoring case" do
+    "Hello".sub(/h/i, "j").should == "jello"
+    "hello".sub(/H/i, "j").should == "jello"
+  end
+
+  it "doesn't interpret regexp metacharacters if pattern is a string" do
+    "12345".sub('\d', 'a').should == "12345"
+    '\d'.sub('\d', 'a').should == "a"
+  end
+
+  it "replaces \\1 sequences with the regexp's corresponding capture" do
+    str = "hello"
+
+    str.sub(/([aeiou])/, '<\1>').should == "h<e>llo"
+    str.sub(/(.)/, '\1\1').should == "hhello"
+
+    str.sub(/.(.?)/, '<\0>(\1)').should == "<he>(e)llo"
+
+    str.sub(/.(.)+/, '\1').should == "o"
+
+    str = "ABCDEFGHIJKL"
+    re = /#{"(.)" * 12}/
+    str.sub(re, '\1').should == "A"
+    str.sub(re, '\9').should == "I"
+    # Only the first 9 captures can be accessed in MRI
+    str.sub(re, '\10').should == "A0"
+  end
+
+  it "treats \\1 sequences without corresponding captures as empty strings" do
+    str = "hello!"
+
+    str.sub("", '<\1>').should == "<>hello!"
+    str.sub("h", '<\1>').should == "<>ello!"
+
+    str.sub(//, '<\1>').should == "<>hello!"
+    str.sub(/./, '\1\2\3').should == "ello!"
+    str.sub(/.(.{20})?/, '\1').should == "ello!"
+  end
+
+  it "replaces \\& and \\0 with the complete match" do
+    str = "hello!"
+
+    str.sub("", '<\0>').should == "<>hello!"
+    str.sub("", '<\&>').should == "<>hello!"
+    str.sub("he", '<\0>').should == "<he>llo!"
+    str.sub("he", '<\&>').should == "<he>llo!"
+    str.sub("l", '<\0>').should == "he<l>lo!"
+    str.sub("l", '<\&>').should == "he<l>lo!"
+
+    str.sub(//, '<\0>').should == "<>hello!"
+    str.sub(//, '<\&>').should == "<>hello!"
+    str.sub(/../, '<\0>').should == "<he>llo!"
+    str.sub(/../, '<\&>').should == "<he>llo!"
+    str.sub(/(.)./, '<\0>').should == "<he>llo!"
+  end
+
+  it "replaces \\` with everything before the current match" do
+    str = "hello!"
+
+    str.sub("", '<\`>').should == "<>hello!"
+    str.sub("h", '<\`>').should == "<>ello!"
+    str.sub("l", '<\`>').should == "he<he>lo!"
+    str.sub("!", '<\`>').should == "hello<hello>"
+
+    str.sub(//, '<\`>').should == "<>hello!"
+    str.sub(/..o/, '<\`>').should == "he<he>!"
+  end
+
+  it "replaces \\' with everything after the current match" do
+    str = "hello!"
+
+    str.sub("", '<\\\'>').should == "<hello!>hello!"
+    str.sub("h", '<\\\'>').should == "<ello!>ello!"
+    str.sub("ll", '<\\\'>').should == "he<o!>o!"
+    str.sub("!", '<\\\'>').should == "hello<>"
+
+    str.sub(//, '<\\\'>').should == "<hello!>hello!"
+    str.sub(/../, '<\\\'>').should == "<llo!>llo!"
+  end
+
+  it "replaces \\\\\\+ with \\\\+" do
+    "x".sub(/x/, '\\\+').should == "\\+"
+  end
+
+  it "replaces \\+ with the last paren that actually matched" do
+    str = "hello!"
+
+    str.sub(/(.)(.)/, '\+').should == "ello!"
+    str.sub(/(.)(.)+/, '\+').should == "!"
+    str.sub(/(.)()/, '\+').should == "ello!"
+    str.sub(/(.)(.{20})?/, '<\+>').should == "<h>ello!"
+
+    str = "ABCDEFGHIJKL"
+    re = /#{"(.)" * 12}/
+    str.sub(re, '\+').should == "L"
+  end
+
+  it "treats \\+ as an empty string if there was no captures" do
+    "hello!".sub(/./, '\+').should == "ello!"
+  end
+
+  it "maps \\\\ in replacement to \\" do
+    "hello".sub(/./, '\\\\').should == '\\ello'
+  end
+
+  it "leaves unknown \\x escapes in replacement untouched" do
+    "hello".sub(/./, '\\x').should == '\\xello'
+    "hello".sub(/./, '\\y').should == '\\yello'
+  end
+
+  it "leaves \\ at the end of replacement untouched" do
+    "hello".sub(/./, 'hah\\').should == 'hah\\ello'
+  end
+
+  it "taints the result if the original string or replacement is tainted" do
+    hello = "hello"
+    hello_t = "hello"
+    a = "a"
+    a_t = "a"
+    empty = ""
+    empty_t = ""
+
+    hello_t.taint; a_t.taint; empty_t.taint
+
+    hello_t.sub(/./, a).tainted?.should == true
+    hello_t.sub(/./, empty).tainted?.should == true
+
+    hello.sub(/./, a_t).tainted?.should == true
+    hello.sub(/./, empty_t).tainted?.should == true
+    hello.sub(//, empty_t).tainted?.should == true
+
+    hello.sub(//.taint, "foo").tainted?.should == false
+  end
+
+  it "tries to convert pattern to a string using to_str" do
+    pattern = mock('.')
+    pattern.should_receive(:to_str).and_return(".")
+
+    "hello.".sub(pattern, "!").should == "hello!"
+  end
+
+  it "raises a TypeError when pattern can't be converted to a string" do
+    lambda { "hello".sub(:woot, "x") }.should raise_error(TypeError)
+    lambda { "hello".sub(?e, "x")    }.should raise_error(TypeError)
+  end
+
+  it "tries to convert replacement to a string using to_str" do
+    replacement = mock('hello_replacement')
+    replacement.should_receive(:to_str).and_return("hello_replacement")
+
+    "hello".sub(/hello/, replacement).should == "hello_replacement"
+  end
+
+  it "raises a TypeError when replacement can't be converted to a string" do
+    lambda { "hello".sub(/[aeiou]/, :woot) }.should raise_error(TypeError)
+    lambda { "hello".sub(/[aeiou]/, ?f)    }.should raise_error(TypeError)
+  end
+
+  it "returns subclass instances when called on a subclass" do
+    StringSpecs::MyString.new("").sub(//, "").class.should == StringSpecs::MyString
+    StringSpecs::MyString.new("").sub(/foo/, "").class.should == StringSpecs::MyString
+    StringSpecs::MyString.new("foo").sub(/foo/, "").class.should == StringSpecs::MyString
+    StringSpecs::MyString.new("foo").sub("foo", "").class.should == StringSpecs::MyString
+  end
+
+  it "sets $~ to MatchData of match and nil when there's none" do
+    'hello.'.sub('hello', 'x')
+    $~[0].should == 'hello'
+
+    'hello.'.sub('not', 'x')
+    $~.should == nil
+
+    'hello.'.sub(/.(.)/, 'x')
+    $~[0].should == 'he'
+
+    'hello.'.sub(/not/, 'x')
+    $~.should == nil
+  end
+
+  it 'replaces \\\1 with \1' do
+    "ababa".sub(/(b)/, '\\\1').should == "a\\1aba"
+  end
+
+  it 'replaces \\\\1 with \\1' do
+    "ababa".sub(/(b)/, '\\\\1').should == "a\\1aba"
+  end
+
+  it 'replaces \\\\\1 with \\' do
+    "ababa".sub(/(b)/, '\\\\\1').should == "a\\baba"
+  end
+
+end
+
+describe "String#sub with pattern and block" do
+  it "returns a copy of self with the first occurrences of pattern replaced with the block's return value" do
+    "hi".sub(/./) { |s| s[0].to_s + ' ' }.should == "104 i"
+    "hi!".sub(/(.)(.)/) { |*a| a.inspect }.should == '["hi"]!'
+  end
+
+  it "sets $~ for access from the block" do
+    str = "hello"
+    str.sub(/([aeiou])/) { "<#{$~[1]}>" }.should == "h<e>llo"
+    str.sub(/([aeiou])/) { "<#{$1}>" }.should == "h<e>llo"
+    str.sub("l") { "<#{$~[0]}>" }.should == "he<l>lo"
+
+    offsets = []
+
+    str.sub(/([aeiou])/) do
+       md = $~
+       md.string.should == str
+       offsets << md.offset(0)
+       str
+    end.should == "hhellollo"
+
+    offsets.should == [[1, 2]]
+  end
+
+  it "restores $~ after leaving the block" do
+    [/./, "l"].each do |pattern|
+      old_md = nil
+      "hello".sub(pattern) do
+        old_md = $~
+        "ok".match(/./)
+        "x"
+      end
+
+      $~.should == old_md
+      $~.string.should == "hello"
+    end
+  end
+
+  it "sets $~ to MatchData of last match and nil when there's none for access from outside" do
+    'hello.'.sub('l') { 'x' }
+    $~.begin(0).should == 2
+    $~[0].should == 'l'
+
+    'hello.'.sub('not') { 'x' }
+    $~.should == nil
+
+    'hello.'.sub(/.(.)/) { 'x' }
+    $~[0].should == 'he'
+
+    'hello.'.sub(/not/) { 'x' }
+    $~.should == nil
+  end
+
+  it "doesn't raise a RuntimeError if the string is modified while substituting" do
+    str = "hello"
+    str.sub(//) { str[0] = 'x' }.should == "xhello"
+    str.should == "xello"
+  end
+
+  it "doesn't interpolate special sequences like \\1 for the block's return value" do
+    repl = '\& \0 \1 \` \\\' \+ \\\\ foo'
+    "hello".sub(/(.+)/) { repl }.should == repl
+  end
+
+  it "converts the block's return value to a string using to_s" do
+    obj = mock('hello_replacement')
+    obj.should_receive(:to_s).and_return("hello_replacement")
+    "hello".sub(/hello/) { obj }.should == "hello_replacement"
+
+    obj = mock('ok')
+    obj.should_receive(:to_s).and_return("ok")
+    "hello".sub(/.+/) { obj }.should == "ok"
+  end
+
+  it "taints the result if the original string or replacement is tainted" do
+    hello = "hello"
+    hello_t = "hello"
+    a = "a"
+    a_t = "a"
+    empty = ""
+    empty_t = ""
+
+    hello_t.taint; a_t.taint; empty_t.taint
+
+    hello_t.sub(/./) { a }.tainted?.should == true
+    hello_t.sub(/./) { empty }.tainted?.should == true
+
+    hello.sub(/./) { a_t }.tainted?.should == true
+    hello.sub(/./) { empty_t }.tainted?.should == true
+    hello.sub(//) { empty_t }.tainted?.should == true
+
+    hello.sub(//.taint) { "foo" }.tainted?.should == false
+  end
+end
+
+describe "String#sub! with pattern, replacement" do
+  it "modifies self in place and returns self" do
+    a = "hello"
+    a.sub!(/[aeiou]/, '*').should equal(a)
+    a.should == "h*llo"
+  end
+
+  it "taints self if replacement is tainted" do
+    a = "hello"
+    a.sub!(/./.taint, "foo").tainted?.should == false
+    a.sub!(/./, "foo".taint).tainted?.should == true
+  end
+
+  it "returns nil if no modifications were made" do
+    a = "hello"
+    a.sub!(/z/, '*').should == nil
+    a.sub!(/z/, 'z').should == nil
+    a.should == "hello"
+  end
+
+  it "raises a TypeError when self is frozen" do
+    s = "hello"
+    s.freeze
+
+    s.sub!(/ROAR/, "x") # ok
+    lambda { s.sub!(/e/, "e")       }.should raise_error(TypeError)
+    lambda { s.sub!(/[aeiou]/, '*') }.should raise_error(TypeError)
+  end
+end
+
+describe "String#sub! with pattern and block" do
+  it "modifies self in place and returns self" do
+    a = "hello"
+    a.sub!(/[aeiou]/) { '*' }.should equal(a)
+    a.should == "h*llo"
+  end
+
+  it "taints self if block's result is tainted" do
+    a = "hello"
+    a.sub!(/./.taint) { "foo" }.tainted?.should == false
+    a.sub!(/./) { "foo".taint }.tainted?.should == true
+  end
+
+  it "returns nil if no modifications were made" do
+    a = "hello"
+    a.sub!(/z/) { '*' }.should == nil
+    a.sub!(/z/) { 'z' }.should == nil
+    a.should == "hello"
+  end
+
+  not_compliant_on :rubinius do
+    it "raises a RuntimeError if the string is modified while substituting" do
+      str = "hello"
+      lambda { str.sub!(//) { str << 'x' } }.should raise_error(RuntimeError)
+    end
+  end
+
+  it "raises a RuntimeError when self is frozen" do
+    s = "hello"
+    s.freeze
+
+    s.sub!(/ROAR/) { "x" } # ok
+    lambda { s.sub!(/e/) { "e" } }.should raise_error(RuntimeError)
+    lambda { s.sub!(/[aeiou]/) { '*' } }.should raise_error(RuntimeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/succ_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/succ_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/succ_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.dirname(__FILE__) + '/shared/succ.rb'
+
+describe "String#succ" do
+  it_behaves_like(:string_succ, :succ)
+end
+
+describe "String#succ!" do
+  it_behaves_like(:string_succ_bang, :"succ!")
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/string/sum_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/sum_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/sum_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#sum" do
+  it "returns a basic n-bit checksum of the characters in self" do
+    "ruby".sum.should == 450
+    "ruby".sum(8).should == 194
+    "rubinius".sum(23).should == 881
+  end
+
+  it "tries to convert n to an integer using to_int" do
+    obj = mock('8')
+    obj.should_receive(:to_int).and_return(8)
+
+    "hello".sum(obj).should == "hello".sum(8)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/swapcase_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/swapcase_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/swapcase_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,49 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#swapcase" do
+  it "returns a new string with all uppercase chars from self converted to lowercase and vice versa" do
+   "Hello".swapcase.should == "hELLO"
+   "cYbEr_PuNk11".swapcase.should == "CyBeR_pUnK11"
+   "+++---111222???".swapcase.should == "+++---111222???"
+  end
+
+  it "taints resulting string when self is tainted" do
+    "".taint.swapcase.tainted?.should == true
+    "hello".taint.swapcase.tainted?.should == true
+  end
+
+  it "is locale insensitive (only upcases a-z and only downcases A-Z)" do
+    "ÄÖÜ".swapcase.should == "ÄÖÜ"
+    "ärger".swapcase.should == "äRGER"
+    "BÄR".swapcase.should == "bÄr"
+  end
+
+  it "returns subclass instances when called on a subclass" do
+    StringSpecs::MyString.new("").swapcase.class.should == StringSpecs::MyString
+    StringSpecs::MyString.new("hello").swapcase.class.should == StringSpecs::MyString
+  end
+end
+
+describe "String#swapcase!" do
+  it "modifies self in place" do
+    a = "cYbEr_PuNk11"
+    a.swapcase!.should equal(a)
+    a.should == "CyBeR_pUnK11"
+  end
+
+  it "returns nil if no modifications were made" do
+    a = "+++---111222???"
+    a.swapcase!.should == nil
+    a.should == "+++---111222???"
+
+    "".swapcase!.should == nil
+  end
+
+  it "raises a TypeError when self is frozen" do
+    ["", "hello"].each do |a|
+      a.freeze
+      lambda { a.swapcase! }.should raise_error(TypeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/to_a_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/to_a_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/to_a_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/to_a'
+
+describe "String#to_a" do
+  it_behaves_like :string_to_a, :to_a
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/to_f_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/to_f_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/to_f_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,73 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+# src.scan(/[+-]?[\d_]+\.[\d_]+(e[+-]?[\d_]+)?\b|[+-]?[\d_]+e[+-]?[\d_]+\b/i)
+
+describe "String#to_f" do
+  it "treats leading characters of self as a floating point number" do
+   "123.45e1".to_f.should == 1234.5
+   "45.67 degrees".to_f.should == 45.67
+   "0".to_f.should == 0.0
+   "123.45e1".to_f.should == 1234.5
+
+   ".5".to_f.should == 0.5
+   ".5e1".to_f.should == 5.0
+  end
+
+  not_compliant_on :jruby do
+    it "treats special float value strings as characters" do
+      "NaN".to_f.should == 0
+      "Infinity".to_f.should == 0
+      "-Infinity".to_f.should == 0
+    end
+  end
+
+  deviates_on :jruby do
+    it "creates special float values from string representations" do
+      "NaN".to_f.nan?.should == true
+      "Infinity".to_f.infinite?.should == 1
+      "-Infinity".to_f.infinite?.should == -1
+    end
+  end
+
+  it "allows for varying case" do
+    "123.45e1".to_f.should == 1234.5
+    "123.45E1".to_f.should == 1234.5
+  end
+
+  it "allows for varying signs" do
+    "+123.45e1".to_f.should == +123.45e1
+    "-123.45e1".to_f.should == -123.45e1
+    "123.45e+1".to_f.should == 123.45e+1
+    "123.45e-1".to_f.should == 123.45e-1
+    "+123.45e+1".to_f.should == +123.45e+1
+    "+123.45e-1".to_f.should == +123.45e-1
+    "-123.45e+1".to_f.should == -123.45e+1
+    "-123.45e-1".to_f.should == -123.45e-1
+  end
+
+  it "allows for underscores, even in the decimal side" do
+    "1_234_567.890_1".to_f.should == 1_234_567.890_1
+  end
+
+  it "returns 0 for strings with any non-digit in them" do
+    "blah".to_f.should == 0
+    "0b5".to_f.should == 0
+    "0d5".to_f.should == 0
+    "0o5".to_f.should == 0
+    "0xx5".to_f.should == 0
+  end
+
+  it "takes an optional sign" do
+    "-45.67 degrees".to_f.should == -45.67
+    "+45.67 degrees".to_f.should == 45.67
+    "-5_5e-5_0".to_f.should == -55e-50
+    "-".to_f.should == 0.0
+    (1.0 / "-0".to_f).to_s.should == "-Infinity"
+  end
+
+  it "returns 0.0 if the conversion fails" do
+    "bad".to_f.should == 0.0
+    "thx1138".to_f.should == 0.0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/to_i_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/to_i_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/to_i_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,132 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#to_i" do
+  it "ignores leading whitespaces" do
+    [ " 123", "     123", "\r\n\r\n123", "\t\t123",
+      "\r\n\t\n123", " \t\n\r\t 123"].each do |str|
+      str.to_i.should == 123
+    end
+  end
+  
+  it "ignores leading underscores" do
+    "_123".to_i.should == 123
+    "__123".to_i.should == 123
+    "___123".to_i.should == 123
+  end
+  
+  it "ignores underscores in between the digits" do
+    "1_2_3asdf".to_i.should == 123
+  end
+  
+  it "ignores subsequent invalid characters" do
+    "123asdf".to_i.should == 123
+    "123#123".to_i.should == 123
+    "123 456".to_i.should == 123
+  end
+  
+  it "returns 0 if self is no valid integer-representation" do
+    [ "++2", "+-2", "--2" ].each do |str|
+      str.to_i.should == 0
+    end
+  end
+  
+  it "ignores a leading mix of whitespaces and underscores" do
+    [ "_ _123", "_\t_123", "_\r\n_123" ].each do |str|
+      str.to_i.should == 123
+    end
+  end
+
+  it "interprets leading characters as a number in the given base" do
+    "100110010010".to_i(2).should == 0b100110010010
+    "100110201001".to_i(3).should == 186409
+    "103110201001".to_i(4).should == 5064769
+    "103110241001".to_i(5).should == 55165126
+    "153110241001".to_i(6).should == 697341529
+    "153160241001".to_i(7).should == 3521513430
+    "153160241701".to_i(8).should == 14390739905
+    "853160241701".to_i(9).should == 269716550518
+    "853160241791".to_i(10).should == 853160241791
+    
+    "F00D_BE_1337".to_i(16).should == 0xF00D_BE_1337
+    "-hello_world".to_i(32).should == -18306744
+    "abcXYZ".to_i(36).should == 623741435
+    
+    ("z" * 24).to_i(36).should == 22452257707354557240087211123792674815
+
+    "5e10".to_i.should == 5
+  end
+  
+  it "auto-detects base 8 via leading 0 when base = 0" do
+    "01778".to_i(0).should == 0177
+    "-01778".to_i(0).should == -0177
+  end
+
+  it "auto-detects base 2 via 0b when base = 0" do
+    "0b112".to_i(0).should == 0b11
+    "-0b112".to_i(0).should == -0b11
+  end
+
+  it "auto-detects base 10 via 0d when base = 0" do
+    "0d19A".to_i(0).should == 19
+    "-0d19A".to_i(0).should == -19
+  end
+
+  it "auto-detects base 8 via 0o when base = 0" do
+    "0o178".to_i(0).should == 0o17
+    "-0o178".to_i(0).should == -0o17
+  end
+
+  it "auto-detects base 16 via 0x when base = 0" do
+    "0xFAZ".to_i(0).should == 0xFA
+    "-0xFAZ".to_i(0).should == -0xFA
+  end
+
+  it "auto-detects base 10 with no base specifier when base = 0" do
+    "1234567890ABC".to_i(0).should == 1234567890
+    "-1234567890ABC".to_i(0).should == -1234567890
+  end
+
+  it "doesn't handle foreign base specifiers when base is > 0" do
+    [2, 3, 4, 8, 10].each do |base|
+      "0111".to_i(base).should == "111".to_i(base)
+      
+      "0b11".to_i(base).should == (base ==  2 ? 0b11 : 0)
+      "0d11".to_i(base).should == (base == 10 ? 0d11 : 0)
+      "0o11".to_i(base).should == (base ==  8 ? 0o11 : 0)
+      "0xFA".to_i(base).should == 0
+    end
+    
+    "0xD00D".to_i(16).should == 0xD00D
+    
+    "0b11".to_i(16).should == 0xb11
+    "0d11".to_i(16).should == 0xd11
+    "0o11".to_i(25).should == 15026
+    "0x11".to_i(34).should == 38183
+  end
+  
+  it "tries to convert the base to an integer using to_int" do
+    obj = mock('8')
+    obj.should_receive(:to_int).and_return(8)
+
+    "777".to_i(obj).should == 0777
+  end
+  
+  it "requires that the sign if any appears before the base specifier" do
+    "0b-1".to_i( 2).should == 0
+    "0d-1".to_i(10).should == 0
+    "0o-1".to_i( 8).should == 0
+    "0x-1".to_i(16).should == 0
+
+    "0b-1".to_i(2).should == 0
+    "0o-1".to_i(8).should == 0
+    "0d-1".to_i(10).should == 0
+    "0x-1".to_i(16).should == 0
+  end
+  
+  it "raises an ArgumentError for illegal bases (1, < 0 or > 36)" do
+    lambda { "".to_i(1)  }.should raise_error(ArgumentError)
+    lambda { "".to_i(-1) }.should raise_error(ArgumentError)
+    lambda { "".to_i(37) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.dirname(__FILE__) + '/shared/to_s.rb'
+
+describe "String#to_s" do
+  it_behaves_like(:string_to_s, :to_s)
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/string/to_str_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/to_str_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/to_str_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.dirname(__FILE__) + '/shared/to_s.rb'
+
+describe "String#to_str" do
+  it_behaves_like(:string_to_s, :to_str)
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/string/to_sym_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/to_sym_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/to_sym_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.dirname(__FILE__) + '/shared/to_sym.rb'
+
+describe "String#to_sym" do
+  it_behaves_like(:string_to_sym, :to_sym)
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/string/tr_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/tr_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/tr_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,91 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#tr_s" do
+  it "returns a string processed according to tr with newly duplicate characters removed" do
+    "hello".tr_s('l', 'r').should == "hero"
+    "hello".tr_s('el', '*').should == "h*o"
+    "hello".tr_s('el', 'hx').should == "hhxo"
+    "hello".tr_s('o', '.').should == "hell."
+  end
+
+  it "accepts c1-c2 notation to denote ranges of characters" do
+    "hello".tr_s('a-y', 'b-z').should == "ifmp"
+    "123456789".tr_s("2-5", "abcdefg").should == "1abcd6789"
+    "hello ^--^".tr_s("e-", "__").should == "h_llo ^_^"
+    "hello ^--^".tr_s("---", "_").should == "hello ^_^"
+  end
+
+  it "pads to_str with its last char if it is shorter than from_string" do
+    "this".tr_s("this", "x").should == "x"
+  end
+
+  it "translates chars not in from_string when it starts with a ^" do
+    "hello".tr_s('^aeiou', '*').should == "*e*o"
+    "123456789".tr_s("^345", "abc").should == "c345c"
+    "abcdefghijk".tr_s("^d-g", "9131").should == "1defg1"
+
+    "hello ^_^".tr_s("a-e^e", ".").should == "h.llo ._."
+    "hello ^_^".tr_s("^^", ".").should == ".^.^"
+    "hello ^_^".tr_s("^", "x").should == "hello x_x"
+    "hello ^-^".tr_s("^-^", "x").should == "x^-^"
+    "hello ^-^".tr_s("^^-^", "x").should == "x^x^"
+    "hello ^-^".tr_s("^---", "x").should == "x-x"
+    "hello ^-^".tr_s("^---l-o", "x").should == "xllox-x"
+  end
+
+  it "tries to convert from_str and to_str to strings using to_str" do
+    from_str = mock('ab')
+    from_str.should_receive(:to_str).and_return("ab")
+
+    to_str = mock('AB')
+    to_str.should_receive(:to_str).and_return("AB")
+
+    "bla".tr_s(from_str, to_str).should == "BlA"
+  end
+
+  it "returns subclass instances when called on a subclass" do
+    StringSpecs::MyString.new("hello").tr_s("e", "a").class.should == StringSpecs::MyString
+  end
+
+  it "taints the result when self is tainted" do
+    ["h", "hello"].each do |str|
+      tainted_str = str.dup.taint
+
+      tainted_str.tr_s("e", "a").tainted?.should == true
+
+      str.tr_s("e".taint, "a").tainted?.should == false
+      str.tr_s("e", "a".taint).tainted?.should == false
+    end
+  end
+end
+
+describe "String#tr_s!" do
+  it "modifies self in place" do
+    s = "hello"
+    s.tr_s!("l", "r").should == "hero"
+    s.should == "hero"
+  end
+
+  it "returns nil if no modification was made" do
+    s = "hello"
+    s.tr_s!("za", "yb").should == nil
+    s.tr_s!("", "").should == nil
+    s.should == "hello"
+  end
+
+  it "does not modify self if from_str is empty" do
+    s = "hello"
+    s.tr_s!("", "").should == nil
+    s.should == "hello"
+    s.tr_s!("", "yb").should == nil
+    s.should == "hello"
+  end
+
+  it "raises a TypeError if self is frozen" do
+    s = "hello".freeze
+    lambda { s.tr_s!("el", "ar") }.should raise_error(TypeError)
+    lambda { s.tr_s!("l", "r")   }.should raise_error(TypeError)
+    lambda { s.tr_s!("", "")     }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/tr_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/tr_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/tr_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,91 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#tr" do
+  it "returns a new string with the characters from from_string replaced by the ones in to_string" do
+    "hello".tr('aeiou', '*').should == "h*ll*"
+    "hello".tr('el', 'ip').should == "hippo"
+    "Lisp".tr("Lisp", "Ruby").should == "Ruby"
+  end
+
+  it "accepts c1-c2 notation to denote ranges of characters" do
+    "hello".tr('a-y', 'b-z').should == "ifmmp"
+    "123456789".tr("2-5","abcdefg").should == "1abcd6789"
+    "hello ^-^".tr("e-", "__").should == "h_llo ^_^"
+    "hello ^-^".tr("---", "_").should == "hello ^_^"
+  end
+
+  it "pads to_str with its last char if it is shorter than from_string" do
+    "this".tr("this", "x").should == "xxxx"
+    "hello".tr("a-z", "A-H.").should == "HE..."
+  end
+
+  it "translates chars not in from_string when it starts with a ^" do
+    "hello".tr('^aeiou', '*').should == "*e**o"
+    "123456789".tr("^345", "abc").should == "cc345cccc"
+    "abcdefghijk".tr("^d-g", "9131").should == "111defg1111"
+
+    "hello ^_^".tr("a-e^e", ".").should == "h.llo ._."
+    "hello ^_^".tr("^^", ".").should == "......^.^"
+    "hello ^_^".tr("^", "x").should == "hello x_x"
+    "hello ^-^".tr("^-^", "x").should == "xxxxxx^-^"
+    "hello ^-^".tr("^^-^", "x").should == "xxxxxx^x^"
+    "hello ^-^".tr("^---", "x").should == "xxxxxxx-x"
+    "hello ^-^".tr("^---l-o", "x").should == "xxlloxx-x"
+  end
+
+  it "tries to convert from_str and to_str to strings using to_str" do
+    from_str = mock('ab')
+    from_str.should_receive(:to_str).and_return("ab")
+
+    to_str = mock('AB')
+    to_str.should_receive(:to_str).and_return("AB")
+
+    "bla".tr(from_str, to_str).should == "BlA"
+  end
+
+  it "returns subclass instances when called on a subclass" do
+    StringSpecs::MyString.new("hello").tr("e", "a").class.should == StringSpecs::MyString
+  end
+
+  it "taints the result when self is tainted" do
+    ["h", "hello"].each do |str|
+      tainted_str = str.dup.taint
+
+      tainted_str.tr("e", "a").tainted?.should == true
+
+      str.tr("e".taint, "a").tainted?.should == false
+      str.tr("e", "a".taint).tainted?.should == false
+    end
+  end
+end
+
+describe "String#tr!" do
+  it "modifies self in place" do
+    s = "abcdefghijklmnopqR"
+    s.tr!("cdefg", "12").should == "ab12222hijklmnopqR"
+    s.should == "ab12222hijklmnopqR"
+  end
+
+  it "returns nil if no modification was made" do
+    s = "hello"
+    s.tr!("za", "yb").should == nil
+    s.tr!("", "").should == nil
+    s.should == "hello"
+  end
+
+  it "does not modify self if from_str is empty" do
+    s = "hello"
+    s.tr!("", "").should == nil
+    s.should == "hello"
+    s.tr!("", "yb").should == nil
+    s.should == "hello"
+  end
+
+  it "raises a TypeError if self is frozen" do
+    s = "abcdefghijklmnopqR".freeze
+    lambda { s.tr!("cdefg", "12") }.should raise_error(TypeError)
+    lambda { s.tr!("R", "S")      }.should raise_error(TypeError)
+    lambda { s.tr!("", "")        }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/unpack_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/unpack_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/unpack_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,456 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+if ENV['MRI'] then
+  $: << 'kernel/core'
+  require 'unpack'
+end
+
+# FIXME: "according to the format string" is NOT a spec description!
+
+describe "String#unpack" do
+  it "returns an array by decoding self according to the format string" do
+    "abc \0\0abc \0\0".unpack('A6Z6').should == ["abc", "abc "]
+    "abc \0\0".unpack('a3a3').should == ["abc", " \000\000"]
+    "aa".unpack('b8B8').should == ["10000110", "01100001"]
+    "aaa".unpack('h2H2c').should == ["16", "61", 97]
+    "now=20is".unpack('M*').should == ["now is"]
+    "whole".unpack('xax2aX2aX1aX2a').should == ["h", "e", "l", "l", "o"]
+  end
+
+  little_endian do
+    it "returns an array by decoding self in little-endian (native format) order according to the format string" do
+      "\xfe\xff\xfe\xff".unpack('sS').should == [-2, 65534]
+    end
+  end
+
+  big_endian do
+    it "returns an array by decoding self in big-endian (native format) order according to the format string" do
+      "\xfe\xff\xfe\xff".unpack('sS').should == [-257, 65279]
+    end
+  end
+end
+
+describe "String#unpack with nil format argument" do
+  it "raises a TypeError exception" do
+    lambda { "abc".unpack(nil) }.should raise_error(TypeError)
+  end
+end
+
+describe "String#unpack with 'Z' directive" do
+  it "returns an array by decoding self according to the format string" do
+    "abc \0abc \0".unpack('Z*Z*').should == ["abc ", "abc "]
+    "abc \0abc \0".unpack('Z10').should == ["abc "]
+    "abc \0abc \0".unpack('Z7Z*').should == ["abc ", "c "]
+    "abc \0abc \0".unpack('Z50Z*').should == ["abc ", ""]
+    "abc \0\0\0abc \0".unpack('Z*Z*').should == ["abc ", ""]
+    "abc \0\0\0\0".unpack('Z*').should == ["abc "]
+    "abc \0\0\0\0".unpack('Z*Z*').should == ["abc ", ""]
+    "\0".unpack('Z*').should == [""]
+    "\0\0".unpack('Z*').should == [""]
+    "\0\0abc".unpack('Z*').should == [""]
+    "\0\0abc\0\0".unpack('Z*').should == [""]
+    "\0 abc\0\0abc\0abc \0\0 ".unpack('Z2Z*Z3ZZ*Z10Z10').should == ["", "abc", "", "c", "", "abc ", ""]
+  end
+end
+
+describe "String#unpack with 'N' and 'n' directives" do
+  it "returns an array by decoding self according to the format string" do
+    "\xF3\x02\x00\x42".unpack('N').should == [4076994626]
+    "\xF3\x02".unpack('N').should == [nil]
+    "\xF3\x02\x00\x42\x32\x87\xF3\x00".unpack('N2').should == [4076994626, 847770368]
+    "\xF3\x02\xC0\x42\x3A\x87\xF3\x00".unpack('N*').should == [4077043778, 981988096]
+    "\xF3\x02\x00\x42".unpack('n').should == [62210]
+    "\x01\x62\xEE\x42".unpack('n-7n').should == [354, 60994]
+    "\xF3\x02\x00\x42".unpack('n5').should == [62210, 66, nil, nil, nil]
+    "\xF3".unpack('n').should == [nil]
+    "\xF3\x02\x00\x42\x32\x87\xF3\x00".unpack('n3').should == [62210, 66, 12935]
+    "\xF3\x02\x00\x42\x32\x87\xF3\x00".unpack('n*').should == [62210, 66, 12935, 62208]
+    "\xF3\x02\x00\x42\x32\x87\xF3\x02".unpack('n0N*').should == [4076994626, 847770370]
+  end
+end
+
+describe "String#unpack with 'V' and 'v' directives" do
+  it "returns an array by decoding self according to the format string" do
+    "\xF3\x02\x00\x42".unpack('V').should == [1107297011]
+    "\xF3\x02".unpack('V').should == [nil]
+    "\xF3\xFF\xFF\xFF\x32\x0B\x02\x00".unpack('V2').should == [4294967283, 133938]
+    "\xF3\x02\xC0\x42\x3A\x87\xF3\x00".unpack('V*').should == [1119879923, 15959866]
+    "\xF3\x02\x00\x42".unpack('v').should == [755]
+    "\x01\x62\xEE\x42".unpack('v-7v').should == [25089, 17134]
+    "\xF3\x02\x00\x42".unpack('v5').should == [755, 16896, nil, nil, nil]
+    "\xF3".unpack('v').should == [nil]
+    "\xF3\xFF\xFF\xFF\x32\x87\xF3\x00".unpack('v3').should == [65523, 65535, 34610]
+    "\xF3\x02\x00\x42\x32\x87\xF3\x00".unpack('v*').should == [755, 16896, 34610, 243]
+    "\xF3\x02\x00\x42\x32\x87\xF3\x02".unpack('v0V*').should == [1107297011, 49514290]
+  end
+end
+
+describe "String#unpack with 'C' and 'c' directives" do
+  it "returns an array by decoding self according to the format string" do
+    "\xF3\x02\x00\x42".unpack('C').should == [243]
+    "".unpack('C').should == [nil]
+    "\xF3\x02\x00\x42\x32\x87\xF3\x00".unpack('C2').should == [243, 2]
+    "\xF3\x02\xC0\x42\x3A\x87\xF3\x00".unpack('C*').should == [243, 2, 192, 66, 58, 135, 243, 0]
+    "\xF3\x02\x00\x42".unpack('c').should == [-13]
+    "\x01\x62\xEE\x42".unpack('c-7c').should == [1, 98]
+    "\xF3\x02\x00\x42".unpack('c5').should == [-13, 2, 0, 66, nil]
+    "\x80".unpack('c').should == [-128]
+    "\x7F\x02\x00\x42\x32\x87\xF3\x00".unpack('c3').should == [127, 2, 0]
+    "\x80\x02\x00\x42\xFF\x87\xF3\x00".unpack('c*').should == [-128, 2, 0, 66, -1, -121, -13, 0]
+    "\xF3\x02\x00\x42\x32\x87\xF3\x02".unpack('c0C*').should == [243, 2, 0, 66, 50, 135, 243, 2]
+  end
+end
+
+describe "String#unpack with 'Q' and 'q' directives" do
+  little_endian do
+    it "returns an array in little-endian (native format) order by decoding self according to the format string" do
+      "\xF3\x02\x00\x42\x32\x23\xB3\xF0".unpack('Q').should == [17344245288696546035]
+      "\xF3\x02".unpack('Q*').should == []
+      "\xF3\xFF\xFF\xFF\x32\x0B\x02\x00".unpack('Q2').should == [575263624658931]
+      "\xF3\x02\xC0\x42\x3A\x87\xF3\x00\xFA\xFF\x00\x02\x32\x87\xF3\xEE".unpack('Q*').should ==
+        [68547103638422259, 17218254449219272698]
+      "\xF3\x02\x00\x42".unpack('q').should == [nil]
+      "\x01\x62\xEE\x42".unpack('q-7q').should == [nil, nil]
+      "\xF3\x02\x00\x42".unpack('q5').should == [nil, nil, nil, nil, nil]
+      "\xF3".unpack('q').should == [nil]
+      "\xF3\xFF\xFF\xFF\xFF\xFA\xF3\xFD".unpack('q3').should == [-147498385354522637, nil, nil]
+      "\x0A\x02\x00\x02\x32\x87\xF3\x00\xFA\xFF\x00\x02\x32\x87\xF3\xEE".unpack('q*').should ==
+        [68547068192358922, -1228489624490278918]
+      "\x7F\x77\x77\x77\x77\x77\x77\x77".unpack('q0Q*').should == [8608480567731124095]
+    end
+  end
+
+  big_endian do
+    it "returns an array in big-endian (native format) order by decoding self according to the format string" do
+      "\xF3\x02\x00\x42\x32\x23\xB3\xF0".unpack('Q').should == [17510558585478951920]
+      "\xF3\x02".unpack('Q*').should == []
+      "\xF3\xFF\xFF\xFF\x32\x0B\x02\x00".unpack('Q2').should == [17582052941799031296]
+      "\xF3\x02\xC0\x42\x3A\x87\xF3\x00\xFA\xFF\x00\x02\x32\x87\xF3\xEE".unpack('Q*').should ==
+        [17510769691852272384, 18086174637980906478]
+      "\xF3\x02\x00\x42".unpack('q').should == [nil]
+      "\x01\x62\xEE\x42".unpack('q-7q').should == [nil, nil]
+      "\xF3\x02\x00\x42".unpack('q5').should == [nil, nil, nil, nil, nil]
+      "\xF3".unpack('q').should == [nil]
+      "\xF3\xFF\xFF\xFF\xFF\xFA\xF3\xFD".unpack('q3').should == [-864691128455465987, nil, nil]
+      "\x0A\x02\x00\x02\x32\x87\xF3\x00\xFA\xFF\x00\x02\x32\x87\xF3\xEE".unpack('q*').should ==
+        [721138899770405632, -360569435728645138]
+      "\x7F\x77\x77\x77\x77\x77\x77\x77".unpack('q0Q*').should == [9184941320034547575]
+    end
+  end
+
+  little_endian do
+    it "returns Bignums for big numeric values on little-endian platforms" do
+      "\xF3\x02\x00\x42\x32\x23\xB3\xF0".unpack('Q')[0].class.should ==
+        17344245288696546035.class
+      "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFE".unpack('q')[0].class.should == -72057594037927937.class
+    end
+  end
+
+  big_endian do
+    it "returns Bignums for big numeric values on big-endian platforms" do
+      "\xF3\x02\x00\x42\x32\x23\xB3\xF0".unpack('Q')[0].class.should ==
+        17344245288696546035.class
+      "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFE".unpack('q')[0].class.should == Fixnum
+    end
+  end
+
+  it "returns Fixnums for small numeric values" do
+    "\x00\x00\x00\x00\x00\x00\x00\x00".unpack('Q').should == [0]
+    "\x00\x00\x00\x00\x00\x00\x00\x00".unpack('q').should == [0]
+    "\x00\x00\x00\x00\x00\x00\x00\x00".unpack('Q')[0].class.should == Fixnum
+    "\x00\x00\x00\x00\x00\x00\x00\x00".unpack('q')[0].class.should == Fixnum
+  end
+end
+
+describe "String#unpack with 'a', 'X' and 'x' directives" do
+  it "returns an array by decoding self according to the format string" do
+    "abc".unpack('x3a').should == [""]
+    "abc".unpack('x3X3x0a').should == ["a"]
+    "abc".unpack('x2X-5a').should == ["b"]
+    "abcdefghijklmnopqrstuvwxyz".unpack('aaax10aX14X0a').should == ["a", "b", "c", "n", "a"]
+    "abcdefghijklmnopqrstuvwxyz".unpack('aa-8ax10aX*a').should == ["a", "b", "c", "n", "c"]
+    "abcdefghijklmnopqrstuvwxyz".unpack('x*aX26a').should == ["", "a"]
+    "abcdefghijklmnopqrstuvwxyz".unpack('x*x*x*aX26a').should == ["", "a"]
+    "abc".unpack('x3X*').should == []
+    "abc".unpack('x3X*a').should == [""]
+    "abc".unpack('x3X*X3a').should == ["a"]
+    lambda { "abc".unpack('X*') }.should raise_error(ArgumentError)
+    lambda { "abc".unpack('x*x') }.should raise_error(ArgumentError)
+    lambda { "abc".unpack('x4') }.should raise_error(ArgumentError)
+    lambda { "abc".unpack('X') }.should raise_error(ArgumentError)
+    lambda { "abc".unpack('xX*') }.should raise_error(ArgumentError)
+  end
+end
+
+describe "String#unpack with 'DdEeFfGg' directives" do
+  before :each do
+    @precision_small = 1E-12
+    @precision_large = 1E+17
+  end
+  
+  it "returns an array by decoding self according to the format string" do
+    res = "\xF3\x02\x00\x42\xF3\x02\x00\x42".unpack('eg')
+    res.length.should == 2
+    res[0].should be_close(32.0028800964355, @precision_small)
+    res[1].should be_close(-1.02997409159585e+31, @precision_large)
+
+    res = "\xF3\x02\x00\x42\xF3\x02\x00\x42".unpack('eg')
+    res.length.should == 2
+    res[0].should be_close(32.0028800964355, @precision_small)
+    res[1].should be_close(-1.02997409159585e+31, @precision_large)
+
+    "\xF3\x02".unpack('GD').should == [nil, nil]
+
+#     "\xF3\x02\x00\x42\x32\x87\xF3\x00".unpack('E*')[0].should be_close(
+#         4.44943241769783e-304, @precision_small)
+#     "\x00\x00\x00\x42\x32\x87\xF3\x02".unpack('g0G*')[0].should be_close(
+#         1.40470576419087e-312, @precision_small)
+  end
+  
+  little_endian do
+    it "returns an array by decoding self in little-endian order according to the format string" do
+      # 'F2' pattern
+      res = "\xF3\xFF\xFF\xFF\x32\x0B\x02\x00".unpack('F2')
+      res.length.should == 2
+      res[0].nan?.should == true
+      res[1].should be_close(1.87687113714737e-40, @precision_small)
+
+      # 'f*' pattern
+      res = "\xF3\x02\xC0\x42\x3A\x87\xF3\x00".unpack('f*')
+      res.length.should == 2
+      res[0].should be_close(96.0057601928711, @precision_small)
+      res[1].should be_close(2.23645357166299e-38, @precision_small)
+
+      "\xFF\x80\x00\x00".unpack('g').to_s.should == "-Infinity"
+      "\x01\x62\xEE\x42".unpack('e-7e')[0].should  be_close(
+          119.191413879395, @precision_small)
+      "\x00\x00\x00\x00".unpack('f5').should == [0.0, nil, nil, nil, nil]
+      "\xF3".unpack('E').should == [nil]
+
+      # 'd3' pattern
+      res = "\xF3\xFF\xFF\xFF\x32\x87\xF3\x00".unpack('d3')
+      res.length.should == 3
+#       res[0].should be_close(4.44943499804409e-304, @precision_small)
+      res[1].should == nil
+      res[2].should == nil
+    end
+  end
+  
+  big_endian do
+    it "returns an array by decoding self in big-endian order according to the format string" do
+      # 'F2' pattern
+      res = "\xFF\xFF\xFF\xF3\x00\x02\x0B\x32".unpack('F2')
+      res.length.should == 2
+      res[0].nan?.should == true
+      res[1].should be_close(1.87687113714737e-40, @precision_small)
+
+      # 'f*' pattern
+      res = "\x42\xC0\x02\xF3\x00\xF3\x87\x3A".unpack('f*')
+      res.length.should == 2
+      res[0].should be_close(96.0057601928711, @precision_small)
+      res[1].should be_close(2.23645357166299e-38, @precision_small)
+
+      # 'd3' pattern
+      res = "\x00\xF3\x87\x32\xFF\xFF\xFF\xF3".unpack('d3')
+      res.length.should == 3
+#       res[0].should be_close(4.44943499804409e-304, @precision_small)
+      res[1].should == nil
+      res[2].should == nil
+    end
+  end
+end
+
+describe "String#unpack with 'B' and 'b' directives" do
+  it "returns an array by decoding self according to the format string" do
+    "\xFF\x00\x80\x01\x7E\xAA\xF0\x0F".unpack('B64').should ==
+      ["1111111100000000100000000000000101111110101010101111000000001111"]
+    "\xFF\x00\x80\x01\x7E\xAA\xF0\x0F".unpack('b64').should ==
+      ["1111111100000000000000011000000001111110010101010000111111110000"]
+    "\xFF\x00\x80\x01\x7E\xAA\xF0\x0F".unpack('B12b12B12b12B*b*').should ==
+      ["111111110000", "000000011000", "011111101010", "000011111111", "", ""]
+    "\xFF\x00\x80\x01\x7E\xAA\xF0\x0F".unpack('B4b4B4b4B4b4B16').should ==
+      ["1111", "0000", "1000", "1000", "0111", "0101", "1111000000001111"]
+    "\xFF\x00\x80\xAA".unpack('b-5B8b8b0B2b1B1').should ==
+      ["1", "00000000", "00000001", "", "10", "", ""]
+    "\xFF\x00\x80\xAA".unpack('B0b0').should == ["", ""]
+    "\xFF\x00\x80\xAA".unpack('B3b*B*').should == ["111", "000000000000000101010101", ""]
+    "\xFF\x00\x80\xAA".unpack('B3B*b*').should == ["111", "000000001000000010101010", ""]
+  end
+end
+
+describe "String#unpack with 'H' and 'h' directives" do
+  it "returns an array by decoding self according to the format string" do
+    "\xFF\x00\x80\x01\x7E\xAA\xF0\x0F".unpack('H16').should == ["ff0080017eaaf00f"]
+    "\xFF\x00\x80\x01\x7E\xAA\xF0\x0F".unpack('h16').should == ["ff000810e7aa0ff0"]
+    "\xFF\x00\x80\x01\x7E\xAA\xF0\x0F".unpack('H3h3H3h3H*h*').should ==
+      ["ff0", "081", "7ea", "0ff", "", ""]
+    "\xFF\x00\x80\x01\x7E\xAA\xF0\x0F".unpack('HhHhHhH4').should ==
+      ["f", "0", "8", "1", "7", "a", "f00f"]
+    "\xFF\x00\x80\xAA".unpack('h-5H2h2h0Hh1H1').should ==
+      ["f", "00", "08", "", "a", "", ""]
+    "\xFF\x00\x80\xAA".unpack('H0h0').should == ["", ""]
+    "\xFF\x00\x80\xAA".unpack('H3h*H*').should == ["ff0", "08aa", ""]
+    "\xFF\x00\x80\xAA".unpack('H3H*h*').should == ["ff0", "80aa", ""]
+  end
+end
+
+describe "String#unpack with 'IiLlSs' directives" do
+  platform_is :wordsize => 32 do
+    little_endian do
+      it "returns an array in little-endian (native format) by decoding self according to the format string" do
+        "\xF3\x02\x00\x42\x32\x23\xB3\xF0".unpack('SLI').should == [755, 590496256, nil]
+        "\xF3\x02".unpack('L*I*').should == []
+        "\xF3\xFF\xFF\xFF\x32\x0B\x02\x00".unpack('I2').should == [4294967283, 133938]
+        "\xF3\x02\xC0\x42\x3A\x87\xF3\x00\xFA\xFF\x00\x02\x32\x87\xF3\xEE".unpack('L*').should ==
+          [1119879923, 15959866, 33619962, 4008937266]
+        "\xF3\x02\x00\x42".unpack('i').should == [1107297011]
+        "\x01\x62\xEE\x42".unpack('l-7l').should == [1122918913, nil]
+        "\xF3\x02\x00\x42".unpack('s5').should == [755, 16896, nil, nil, nil]
+        "\xF3".unpack('s').should == [nil]
+        "\xF3\xFF\xFF\xFF\xFF\xFA\xF3\xFD".unpack('i3').should == [-13, -34342145, nil]
+        "\x0A\x02\x00\x02\x32\x87\xF3\x00\xFA\xFF\x00\x02\x32\x87\xF3\xEE".unpack('l*').should ==
+          [33554954, 15959858, 33619962, -286030030]
+        "\x7F\x77\x77\x77\x77\x77\x77\x77".unpack('i0I*').should == [2004318079, 2004318071]
+      end
+    end
+
+    big_endian do
+      it "returns an array in big-endian (native format) by decoding self according to the format string" do
+        "\xF3\x02\x00\x42\x32\x23\xB3\xF0".unpack('SLI').should == [62210, 4338211, nil]
+        "\xF3\x02".unpack('L*I*').should == []
+        "\xF3\xFF\xFF\xFF\x32\x0B\x02\x00".unpack('I2').should == [4093640703, 839582208]
+        "\xF3\x02\xC0\x42\x3A\x87\xF3\x00\xFA\xFF\x00\x02\x32\x87\xF3\xEE".unpack('L*').should ==
+          [4077043778, 981988096, 4211015682, 847770606]
+        "\xF3\x02\x00\x42".unpack('i').should == [-217972670]
+        "\x01\x62\xEE\x42".unpack('l-7l').should == [23260738, nil]
+        "\xF3\x02\x00\x42".unpack('s5').should == [-3326, 66, nil, nil, nil]
+        "\xF3".unpack('s').should == [nil]
+        "\xF3\xFF\xFF\xFF\xFF\xFA\xF3\xFD".unpack('i3').should == [-201326593, -330755, nil]
+        "\x0A\x02\x00\x02\x32\x87\xF3\x00\xFA\xFF\x00\x02\x32\x87\xF3\xEE".unpack('l*').should ==
+          [167903234, 847770368, -83951614, 847770606]
+        "\x7F\x77\x77\x77\x77\x77\x77\x77".unpack('i0I*').should == [2138535799, 2004318071]
+      end
+    end
+  end
+end
+
+describe "String#unpack with 'U' directive" do
+  it "returns an array by decoding self according to the format string" do
+    "\xFD\x80\x80\xB7\x80\x80".unpack('U').should == [1073967104]
+    "\xF9\x80\x80\x80\x80".unpack('U').should == [16777216]
+    "\xF1\x80\x80\x80".unpack('UU').should == [262144]
+    "\xE1\xB7\x80".unpack('U').should == [7616]
+    "\xC2\x80\xD2\x80".unpack('U-8U').should == [128, 1152]
+    "\x00\x7F".unpack('U100').should == [0, 127]
+    "\x05\x7D".unpack('U0U0').should == []
+    "".unpack('U').should == []
+    "\xF1\x80\x80\xB1\xE1\x8A\x80\xC2\xBF\x0C\x6B".unpack('U*').should == [262193, 4736, 191, 12, 107]
+    "\xF1\x8F\x85\xB1\xE1\x8A\x89\xC2\xBF\x0C\x6B".unpack('U2x2U').should == [323953, 4745, 12]
+    lambda { "\xF0\x80\x80\x80".unpack('U') }.should raise_error(ArgumentError)
+    lambda { "\xE0\x80\x80".unpack('U') }.should raise_error(ArgumentError)
+    lambda { "\xC0\x80".unpack('U') }.should raise_error(ArgumentError)
+    lambda { "\xC1\x80".unpack('U') }.should raise_error(ArgumentError)
+    lambda { "\x80".unpack('U') }.should raise_error(ArgumentError)
+    lambda { "\xF1\x80\x80".unpack('U') }.should raise_error(ArgumentError)
+    lambda { "\xE1\x80".unpack('U') }.should raise_error(ArgumentError)
+    lambda { "\xC2".unpack('U') }.should raise_error(ArgumentError)
+    lambda { "\xF1\x00\x00\x00".unpack('U') }.should raise_error(ArgumentError)
+    lambda { "\xE1\x00\x00".unpack('U') }.should raise_error(ArgumentError)
+    lambda { "\xC2\x00".unpack('U') }.should raise_error(ArgumentError)
+    lambda { "\xFE".unpack('U') }.should raise_error(ArgumentError)
+    lambda { "\x03\xFF".unpack('UU') }.should raise_error(ArgumentError)
+  end
+end
+
+describe "String#unpack with 'A' directive" do
+  it "returns an array by decoding self according to the format string" do
+    "".unpack('A').should == [""]
+    " \0 abc \0\0\0abc\0\0 \0abc".unpack('A*').should ==
+      [" \000 abc \000\000\000abc\000\000 \000abc"]
+    " \0 abc \0\0\0abc\0\0 \0abc \0 a ".unpack('A16A-9A*A*A100').should ==
+      [" \000 abc \000\000\000abc", "", "abc \000 a", "", ""]
+    " \0 abc \0\0\0abc\0\0 \0abc \0 a ".unpack('A3A4AAA').should == ["", "abc", "", "", ""]
+    " \0 abc \0\0\0abc\0\0 \0abc \0 a ".unpack('A2A0A14').should == ["", "", " abc \000\000\000abc"]
+  end
+end
+
+describe "String#unpack with '@' directive" do
+  it "returns an array by decoding self according to the format string" do
+    "abcdefg".unpack('@2').should     == []
+    "abcdefg".unpack('@3 at -5a').should == ["a"]
+    "abcdefg".unpack('@*@a').should   == ["a"]
+    "abcdefg".unpack('@3 at 5a').should  == ["f"]
+    "abcdefg".unpack('@*a').should    == [""]
+    "abcdefg".unpack('@7a').should    == [""]
+    lambda { "abcdefg".unpack('@8') }.should raise_error(ArgumentError)
+  end
+end
+
+describe "String#unpack with 'M' directive" do
+  it "returns an array by decoding self according to the format string" do
+    "".unpack('M').should == [""]
+    "=5".unpack('Ma').should == ["", ""]
+    "abc=".unpack('M').should == ["abc"]
+    "a=*".unpack('MMMM').should == ["a", "*", "", ""]
+
+    "\x3D72=65abcdefg=5%=33".unpack('M').should    == ["reabcdefg"]
+    "\x3D72=65abcdefg=5%=33".unpack('M0').should   == ["reabcdefg"]
+    "\x3D72=65abcdefg=5%=33".unpack('M100').should == ["reabcdefg"]
+    "\x3D72=65abcdefg=5%=33".unpack('M*').should   == ["reabcdefg"]
+    "\x3D72=65abcdefg=5%=33".unpack('M-8M').should == ["reabcdefg", "%3"]
+
+    "abc===abc".unpack('MMMMM').should == ["abc", "", "\253c", "", ""]
+    "=$$=47".unpack('MMMM').should == ["", "$$G", "", ""]
+    "=$$=4@=47".unpack('MMMMM').should == ["", "$$", "@G", "", ""]
+    "=$$=4@=47".unpack('M5000').should == [""]
+    "=4@".unpack('MMM').should == ["", "@", ""]
+  end
+end
+
+describe "String#unpack with 'm' directive" do
+  it "returns an array by decoding self according to the format string" do
+    "YQ==".unpack('m').should == ["a"]
+    "YWE=".unpack('m').should == ["aa"]
+    "ab c=awerB2y+".unpack('mmmmm').should == ["i\267", "k\a\253\al\276", "", "", ""]
+    "a=b=c=d=e=f=g=".unpack('mamamamam').should ==
+      ["i", "=", "q", "=", "y", "=", "", "", ""]
+    "a===b===c===d===e===f===g===".unpack('mamamamam').should ==
+      ["i", "=", "q", "=", "y", "=", "", "", ""]
+    "ab c= de f= gh i= jk l=".unpack('mmmmmmmmmm').should ==
+      ["i\267", "u\347", "\202\030", "\216I", "", "", "", "", "", ""]
+    "+/=\n".unpack('mam').should           == ["\373", "=", ""]
+    "aA==aA==aA==".unpack('m-100').should  == ["h"]
+    "aGk=aGk=aGk=".unpack('m*mm').should   == ["hi", "hi", "hi"]
+    "aA".unpack('m55').should              == [""]
+    "aGk".unpack('m').should               == [""]
+    "/w==".unpack('m').should              == ["\377"]
+    "Pj4+".unpack('m').should              == [">>>"]
+    "<>:?Pj@$%^&*4+".unpack('m').should    == [">>>"]
+    "<>:?Pja@$%^&*4+".unpack('ma').should  == [">6\270", ""]
+    "<>:?P@$%^&*+".unpack('ma').should     == ["", ""]
+    "54321".unpack('m').should             == ["\347\215\366"]
+    "==43".unpack('m').should              == [""]
+    "43aw".unpack('mmm').should            == ["\343v\260", "", ""]
+    "=======43aw".unpack('m').should       == ["\343v\260"]
+    "cmVxdWlyZSAnYmFzZTY0Jw==".unpack('m').should == ["require 'base64'"]
+    "+/=".unpack('m').should == ["\373"]
+    "YXNkb2Zpc09BSVNERk9BU0lESjk4ODc5ODI0YWlzdWYvLy8rKw==".unpack('m').should ==
+      ["asdofisOAISDFOASIDJ98879824aisuf///++"]
+    "IUAjJSMgJCBeJV4qJV4oXiYqKV8qKF8oKStQe308Pj9LTCJLTCI6\n".unpack('m').should ==
+      ["!@#$@#%# $ ^%^*%^(^&*)_*(_()+P{}<>?KL\"KL\":"]
+    "sfj98349//+ASDd98934jg+N,CBMZP2133GgHJiYrB12".unpack('m').should ==
+      ["\261\370\375\363~=\377\377\200H7}\363\335\370\216\017\215\b\023\031?mw\334h\a&&+"]
+  end
+end
+
+describe "String#unpack with 'w' directive" do
+  it "produces a BER-compressed integer" do
+    'X'.unpack('w').should == [88]
+    'XYZ'.unpack('www').should == [88,89,90]
+    'XYZ'.unpack('w3').should == [88,89,90]
+    '\001\002\003\004'.unpack('w4').should == [92,48,48,49]
+    'hello world'.unpack('w*').should == [104,101,108,108,111,32,119,111,114,108,100]
+    "\204\314\330\205R".unpack('w').should == [1234567890]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/upcase_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/upcase_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/upcase_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,50 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#upcase" do
+  it "returns a copy of self with all lowercase letters upcased" do
+    "Hello".upcase.should == "HELLO"
+    "hello".upcase.should == "HELLO"
+  end
+
+  it "is locale insensitive (only replaces a-z)" do
+    "äöü".upcase.should == "äöü"
+
+    str = Array.new(256) { |c| c.chr }.join
+    expected = Array.new(256) do |i|
+      c = i.chr
+      c.between?("a", "z") ? c.upcase : c
+    end.join
+
+    str.upcase.should == expected
+  end
+
+  it "taints result when self is tainted" do
+    "".taint.upcase.tainted?.should == true
+    "X".taint.upcase.tainted?.should == true
+    "x".taint.upcase.tainted?.should == true
+  end
+
+  it "returns a subclass instance for subclasses" do
+    StringSpecs::MyString.new("fooBAR").upcase.class.should == StringSpecs::MyString
+  end
+end
+
+describe "String#upcase!" do
+  it "modifies self in place" do
+    a = "HeLlO"
+    a.upcase!.should equal(a)
+    a.should == "HELLO"
+  end
+
+  it "returns nil if no modifications were made" do
+    a = "HELLO"
+    a.upcase!.should == nil
+    a.should == "HELLO"
+  end
+
+  it "raises a TypeError when self is frozen" do
+    lambda { "HeLlo".freeze.upcase! }.should raise_error(TypeError)
+    lambda { "HELLO".freeze.upcase! }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/string/upto_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/string/upto_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/string/upto_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,65 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes.rb'
+
+describe "String#upto" do
+  it "passes successive values, starting at self and ending at other_string, to the block" do
+    a = []
+    "*+".upto("*3") { |s| a << s }
+    a.should == ["*+", "*,", "*-", "*.", "*/", "*0", "*1", "*2", "*3"]
+  end
+
+  it "calls the block once even when start eqals stop" do
+    a = []
+    "abc".upto("abc") { |s| a << s }
+    a.should == ["abc"]
+  end
+
+  # This is weird but MRI behaves like that
+  it "upto calls block with self even if self is less than stop but stop length is less than self length" do
+    a = []
+    "25".upto("5") { |s| a << s }
+    a.should == ["25"]
+  end
+
+  it "upto doesn't call block if stop is less than self and stop length is less than self length" do
+    a = []
+    "25".upto("1") { |s| a << s }
+    a.should == []
+  end
+
+  it "doesn't call the block if self is greater than stop" do
+    a = []
+    "5".upto("2") { |s| a << s }
+    a.should == []
+  end
+
+  it "stops iterating as soon as the current value's character count gets higher than stop's" do
+    a = []
+    "0".upto("A") { |s| a << s }
+    a.should == ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
+  end
+
+  it "returns self" do
+    "abc".upto("abd") { }.should == "abc"
+    "5".upto("2") { |i| i }.should == "5"
+  end
+
+  it "tries to convert other to string using to_str" do
+    other = mock('abd')
+    def other.to_str() "abd" end
+
+    a = []
+    "abc".upto(other) { |s| a << s }
+    a.should == ["abc", "abd"]
+  end
+
+  it "raises a TypeError if other can't be converted to a string" do
+    lambda { "abc".upto(123)       }.should raise_error(TypeError)
+    lambda { "abc".upto(:def) { }  }.should raise_error(TypeError)
+    lambda { "abc".upto(mock('x')) }.should raise_error(TypeError)
+  end
+
+  it "raises a LocalJumpError if other is a string but no block was given" do
+    lambda { "abc".upto("def") }.should raise_error(LocalJumpError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/struct/each_pair_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/struct/each_pair_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/struct/each_pair_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Struct#each_pair" do
+  it "passes each key value pair to the given block" do
+    car = Struct::Car.new('Ford', 'Ranger', 2001)
+    car.each_pair do |key, value|
+      value.should == car[key]
+    end
+  end
+
+  ruby_version_is "" ... "1.8.7" do
+    it "fails if not passed a block" do
+      car = Struct::Car.new('Ford', 'Ranger')
+      lambda { car.each_pair }.should raise_error(LocalJumpError)
+    end
+  end
+
+  ruby_version_is "1.8.7" do
+    it "returns an Enumerator if not passed a block" do
+      car = Struct::Car.new('Ford', 'Ranger')
+      car.each_pair.should be_kind_of(Enumerable::Enumerator)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/struct/each_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/struct/each_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/struct/each_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Struct#each" do
+  it "passes each value to the given block" do
+    car = Struct::Car.new('Ford', 'Ranger')
+    i = -1
+    car.each do |value|
+      value.should == car[i += 1]
+    end
+  end
+
+  ruby_version_is "" ... "1.8.7" do
+    it "fails if not passed a block" do
+      car = Struct::Car.new('Ford', 'Ranger')
+      lambda { car.each }.should raise_error(LocalJumpError)
+    end
+  end
+
+  ruby_version_is "1.8.7" do
+    it "returns an Enumerator if not passed a block" do
+      car = Struct::Car.new('Ford', 'Ranger')
+      car.each.should be_kind_of(Enumerable::Enumerator)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/struct/element_reference_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/struct/element_reference_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/struct/element_reference_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,44 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Struct[]" do
+  it "is a synonym for new" do
+    Struct::Ruby['2.0', 'i686'].class.should == Struct::Ruby
+  end
+end
+
+describe "Struct#[]" do
+  it "returns the attribute referenced" do
+    car = Struct::Car.new('Ford', 'Ranger', 1983)
+    car['make'].should == 'Ford'
+    car['model'].should == 'Ranger'
+    car['year'].should == 1983
+    car[:make].should == 'Ford'
+    car[:model].should == 'Ranger'
+    car[:year].should == 1983
+    car[0].should == 'Ford'
+    car[1].should == 'Ranger'
+    car[2].should == 1983
+    car[-3].should == 'Ford'
+    car[-2].should == 'Ranger'
+    car[-1].should == 1983
+  end
+
+  it "fails when it does not know about the requested attribute" do
+    car = Struct::Car.new('Ford', 'Ranger')
+    lambda { car[3]        }.should raise_error(IndexError)
+    lambda { car[-4]       }.should raise_error(IndexError)
+    lambda { car[:body]    }.should raise_error(NameError)
+    lambda { car['wheels'] }.should raise_error(NameError)
+  end
+
+  it "fails if passed too many arguments" do
+    car = Struct::Car.new('Ford', 'Ranger')
+    lambda { car[:make, :model] }.should raise_error(ArgumentError)
+  end
+
+  it "fails if not passed a string, symbol, or integer" do
+    car = Struct::Car.new('Ford', 'Ranger')
+    lambda { car[Object.new] }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/struct/element_set_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/struct/element_set_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/struct/element_set_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Struct#[]=" do
+  it "assigns the passed value" do
+    car = Struct::Car.new('Ford', 'Ranger')
+
+    car[:model] = 'Escape'
+    car[:model].should == 'Escape'
+
+    car['model'] = 'Fusion'
+    car[:model].should == 'Fusion'
+
+    car[1] = 'Excursion'
+    car[:model].should == 'Excursion'
+
+    car[-1] = '2000-2005'
+    car[:year].should == '2000-2005'
+  end
+
+  it "fails when trying to assign attributes which don't exist" do
+    car = Struct::Car.new('Ford', 'Ranger')
+
+    lambda { car[:something] = true }.should raise_error(NameError)
+    lambda { car[3] = true          }.should raise_error(IndexError)
+    lambda { car[-4] = true         }.should raise_error(IndexError)
+    lambda { car[Object.new] = true }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/struct/eql_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/struct/eql_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/struct/eql_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/equal_value'
+
+describe "Struct#eql?" do
+  it_behaves_like(:struct_equal_value, :eql?)
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/struct/equal_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/struct/equal_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/struct/equal_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/equal_value'
+
+describe "Struct#==" do
+  it_behaves_like(:struct_equal_value, :==)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/struct/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/struct/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/struct/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+class Apple < Struct; end
+
+Struct.new('Ruby', :version, :platform)
+Struct.new('Car', :make, :model, :year)

Added: MacRuby/branches/experimental/spec/frozen/core/struct/hash_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/struct/hash_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/struct/hash_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Struct#hash" do
+  
+  it "returns the same fixnum for structs with the same content" do
+    [Struct::Ruby.new("1.8.6", "PPC"), Struct::Car.new("Hugo", "Foo", "1972")].each do |stc|
+      stc.hash.should == stc.dup.hash
+      stc.hash.class.should == Fixnum
+    end
+  end
+  
+  it "returns the same value if structs are #eql?" do
+    car = Struct::Car.new("Honda", "Accord", "1998")
+    similar_car = Struct::Car.new("Honda", "Accord", "1998")
+    car.should eql(similar_car)
+    car.hash.should == similar_car.hash
+  end
+  
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/struct/initialize_copy_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/struct/initialize_copy_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/struct/initialize_copy_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+

Added: MacRuby/branches/experimental/spec/frozen/core/struct/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/struct/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/struct/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Struct#initialize" do
+  
+  it "is private" do
+    Struct::Car.should have_private_instance_method(:initialize)
+  end
+  
+  it "does nothing when passed a set of fields equal to self" do
+    car = same_car = Struct::Car.new("Honda", "Accord", "1998")
+    car.instance_eval { initialize("Honda", "Accord", "1998") }
+    car.should == same_car
+  end
+  
+end

Added: MacRuby/branches/experimental/spec/frozen/core/struct/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/struct/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/struct/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Struct#inspect" do
+  it "returns a string representation of some kind" do
+    car = Struct::Car.new('Ford', 'Ranger')
+    car.inspect.should == '#<struct Struct::Car make="Ford", model="Ranger", year=nil>'
+    Whiskey = Struct.new(:name, :ounces)
+    Whiskey.new('Jack', 100).inspect.should == '#<struct Whiskey name="Jack", ounces=100>'
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/struct/length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/struct/length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/struct/length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Struct#length" do
+  it "returns the number of attributes" do
+    Struct::Car.new('Cadillac', 'DeVille').length.should == 3
+    Struct::Car.new.length.should == 3
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/struct/members_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/struct/members_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/struct/members_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Struct#members" do
+  it "returns an array of attribute names" do
+    Struct::Car.new.members.should == %w(make model year)
+    Struct::Car.new('Cadillac').members.should == %w(make model year)
+    Struct::Ruby.members.should == %w(version platform)
+  end  
+end

Added: MacRuby/branches/experimental/spec/frozen/core/struct/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/struct/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/struct/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,108 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Struct.new" do
+  it "creates a constant in Struct namespace with string as first argument" do
+    struct = Struct.new('Animal', :name, :legs, :eyeballs)
+    struct.should == Struct::Animal
+    struct.name.should == "Struct::Animal"
+  end
+
+  it "overwrites previously defined constants with string as first argument" do
+    first = Struct.new('Person', :height, :weight)
+    first.should == Struct::Person
+
+    second = Struct.new('Person', :hair, :sex)
+    second.should == Struct::Person
+
+    first.members.should_not == second.members
+  end
+
+  it "calls to_str on its first argument (constant name)" do
+    obj = mock('Foo')
+    def obj.to_str() "Foo" end
+    struct = Struct.new(obj)
+    struct.should == Struct::Foo
+    struct.name.should == "Struct::Foo"
+  end
+
+  it "creates a new anonymous class with nil first argument" do
+    struct = Struct.new(nil, :foo)
+    struct.new("bar").foo.should == "bar"
+    struct.class.should == Class
+    struct.name.should == ""
+  end
+
+  it "does not create a constant with symbol as first argument" do
+    struct = Struct.new(:Animal, :name, :legs, :eyeballs)
+    struct.should_not == Struct::Animal
+  end
+
+  it "creates a new anonymous class with symbol arguments" do
+    struct = Struct.new(:make, :model)
+    struct.class.should == Class
+    struct.name.should == ""
+  end
+
+  it "fails with invalid constant name as first argument" do
+    lambda { Struct.new('animal', :name, :legs, :eyeballs) }.should raise_error(NameError)
+  end
+
+  it "raises a TypeError if object doesn't respond to to_sym" do
+    lambda { Struct.new(:animal, mock('giraffe'))      }.should raise_error(TypeError)
+    lambda { Struct.new(:animal, 1.0)                  }.should raise_error(TypeError)
+    lambda { Struct.new(:animal, Time.now)             }.should raise_error(TypeError)
+    lambda { Struct.new(:animal, Class)                }.should raise_error(TypeError)
+    lambda { Struct.new(:animal, nil)                  }.should raise_error(TypeError)
+    lambda { Struct.new(:animal, true)                 }.should raise_error(TypeError)
+    lambda { Struct.new(:animal, ['chris', 'evan'])    }.should raise_error(TypeError)
+    lambda { Struct.new(:animal, { :name => 'chris' }) }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError if object is not a Symbol" do
+    obj = mock(':ruby')
+    def obj.to_sym() :ruby end
+    lambda { Struct.new(:animal, obj) }.should raise_error(TypeError)
+  end
+
+  not_compliant_on :rubinius do
+    it "accepts Fixnums as Symbols unless fixnum.to_sym.nil?" do
+      num = :foo.to_i
+      Struct.new(nil, num).new("bar").foo.should == "bar"
+    end
+
+    it "raises an ArgumentError if fixnum#to_sym is nil" do
+      num = 10000
+      num.to_sym.should == nil  # if this fails, we need a new Fixnum to test
+      lambda { Struct.new(:animal, num) }.should raise_error(ArgumentError)
+    end
+  end
+
+  it "instance_eval's a passed block" do
+    klass = Struct.new(:something) { @something_else = 'something else entirely!' }
+    klass.instance_variables.should include('@something_else')
+  end
+
+  it "creates a constant in subclass' namespace" do
+    struct = Apple.new('Computer', :size)
+    struct.should == Apple::Computer
+  end
+
+  it "creates an instance" do
+    Struct::Ruby.new.kind_of?(Struct::Ruby).should == true
+  end
+
+  it "creates reader methods" do
+    Struct::Ruby.new.should have_method(:version)
+    Struct::Ruby.new.should have_method(:platform)
+  end
+
+  it "creates writer methods" do
+    Struct::Ruby.new.should have_method(:version=)
+    Struct::Ruby.new.should have_method(:platform=)
+  end
+
+  it "fails with too many arguments" do
+    lambda { Struct::Ruby.new('2.0', 'i686', true) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/struct/select_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/struct/select_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/struct/select_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Struct#select" do
+  it "raises an ArgumentError if given any non-block arguments" do
+    lambda { Struct::Car.new.select(1) { } }.should raise_error(ArgumentError)
+  end
+  
+  it "returns a new array of elements for which block is true" do
+    struct = Struct::Car.new("Toyota", "Tercel", "2000")
+    struct.select { |i| i == "2000" }.should == [ "2000" ]
+  end
+  
+  it "returns an instance of Array" do
+    struct = Struct::Car.new("Ford", "Escort", "1995")
+    struct.select { true }.class.should == Array
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/struct/shared/equal_value.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/struct/shared/equal_value.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/struct/shared/equal_value.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+describe :struct_equal_value, :shared => true do
+  it "returns true if the other is the same object" do
+    car = same_car = Struct::Car.new("Honda", "Accord", "1998")
+    car.send(@method, same_car).should == true
+  end
+
+  it "returns true if the other has all the same fields" do
+    car = Struct::Car.new("Honda", "Accord", "1998")
+    similar_car = Struct::Car.new("Honda", "Accord", "1998")
+    car.send(@method, similar_car).should == true
+  end
+
+  it "returns false if the other is a different object or has different fields" do
+    car = Struct::Car.new("Honda", "Accord", "1998")
+    different_car = Struct::Car.new("Honda", "Accord", "1995")
+    car.send(@method, different_car).should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/struct/size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/struct/size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/struct/size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Struct#size" do
+  it "is a synonym for length" do
+    Struct::Car.new.size.should == Struct::Car.new.length
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/struct/struct_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/struct/struct_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/struct/struct_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,40 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Struct anonymous class instance methods" do
+  it "Enumerable methods should work" do
+    car = Struct::Car.new('Ford', 'Ranger', '2001')
+    car.detect { |value| value.include? 'F' }.should == 'Ford'
+    car.reject { |value| value.include? 'F' }.should == ['Ranger', '2001']
+  end
+
+  it "reader method should be a synonym for []" do
+    klass = Struct.new(:clock, :radio)
+    alarm = klass.new(true)
+    alarm.clock.should == alarm[:clock]
+    alarm.radio.should == alarm['radio']
+  end
+
+  it "reader method should not interfere with undefined methods" do
+    car = Struct::Car.new('Ford', 'Ranger')
+    lambda { car.something_weird }.should raise_error(NoMethodError)
+  end
+
+  it "writer method be a synonym for []=" do
+    car = Struct::Car.new('Ford', 'Ranger')
+    car.model.should == 'Ranger'
+    car.model = 'F150'
+    car.model.should == 'F150'
+    car[:model].should == 'F150'
+    car['model'].should == 'F150'
+    car[1].should == 'F150'
+  end
+end
+
+describe "Struct subclasses" do
+  it "can be subclassed" do
+    compact = Class.new Struct::Car
+    compact.new.class.should == compact
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/struct/to_a_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/struct/to_a_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/struct/to_a_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Struct#to_a" do
+  it "returns the values for this instance as an array" do
+    Struct::Car.new('Geo', 'Metro', 1995).to_a.should == ['Geo', 'Metro', 1995]
+    Struct::Car.new('Ford').to_a.should == ['Ford', nil, nil]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/struct/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/struct/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/struct/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Struct#to_s" do
+  it "is a synonym for inspect" do
+    car = Struct::Car.new('Ford', 'Ranger')
+    car.inspect.should == car.to_s
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/struct/values_at_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/struct/values_at_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/struct/values_at_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Struct#values_at" do
+  it "returns an array of values" do
+    clazz = Struct.new(:name, :director, :year)
+    movie = clazz.new('Sympathy for Mr. Vengence', 'Chan-wook Park', 2002)
+    movie.values_at(0, 1).should == ['Sympathy for Mr. Vengence', 'Chan-wook Park']
+    movie.values_at(0..2).should == ['Sympathy for Mr. Vengence', 'Chan-wook Park', 2002]
+  end
+
+  it "fails when passed unsupported types" do
+    car = Struct::Car.new('Ford', 'Ranger')
+    lambda { car.values_at('make') }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/struct/values_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/struct/values_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/struct/values_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Struct#values" do
+  it "is a synonym for to_a" do
+    car = Struct::Car.new('Nissan', 'Maxima')
+    car.values.should == car.to_a
+
+    Struct::Car.new.values.should == Struct::Car.new.to_a
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/symbol/all_symbols_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/symbol/all_symbols_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/symbol/all_symbols_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Symbol.all_symbols" do
+  it "returns an array containing all the Symbols in the symbol table" do
+    Symbol.all_symbols.is_a?(Array).should == true
+    Symbol.all_symbols.all? { |s| s.is_a?(Symbol) ? true : (p s; false) }.should == true
+  end
+  # it "is a pain in the ass to test..."
+end

Added: MacRuby/branches/experimental/spec/frozen/core/symbol/case_compare_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/symbol/case_compare_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/symbol/case_compare_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Symbol#===" do
+  it "returns true when the other is a Symbol" do
+    (Symbol === :ruby).should == true
+    (Symbol === :"ruby").should == true
+    (Symbol === :'ruby').should == true
+    (Symbol === 'ruby').should == false
+  end
+end
+
+# Symbol === :fnord
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/symbol/equal_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/symbol/equal_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/symbol/equal_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Symbol#==" do
+  it "only returns true when the other is exactly the same symbol" do
+    (:ruby == :ruby).should == true
+    (:ruby == :"ruby").should == true
+    (:ruby == :'ruby').should == true
+    (:@ruby == :@ruby).should == true
+    
+    (:ruby == :@ruby).should == false
+    (:foo == :bar).should == false
+    (:ruby == 'ruby').should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/symbol/id2name_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/symbol/id2name_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/symbol/id2name_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/id2name'
+
+describe "Symbol#id2name" do
+  it_behaves_like(:symbol_id2name, :id2name)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/symbol/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/symbol/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/symbol/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,104 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Symbol#inspect" do
+  symbols = {
+    :fred      => ":fred",
+    :fred?     => ":fred?",
+    :fred!     => ":fred!",
+    :$ruby     => ":$ruby",
+    :@ruby     => ":@ruby",
+    :@@ruby    => ":@@ruby",
+    :"$ruby!"  => ":\"$ruby!\"",
+    :"$ruby?"  => ":\"$ruby?\"",
+    :"@ruby!"  => ":\"@ruby!\"",
+    :"@ruby?"  => ":\"@ruby?\"",
+    :"@@ruby!" => ":\"@@ruby!\"",
+    :"@@ruby?" => ":\"@@ruby?\"",
+
+    :$-w       => ":$-w",
+    :"$-ww"    => ":\"$-ww\"",
+    :"$+"      => ":$+",
+    :"$~"      => ":$~",
+    :"$:"      => ":$:",
+    :"$?"      => ":$?",
+    :"$<"      => ":$<",
+    :"$_"      => ":$_",
+    :"$/"      => ":$/",
+    :"$'"      => ":$'",
+    :"$\""     => ":$\"",
+    :"$$"      => ":$$",
+    :"$."      => ":$.",
+    :"$,"      => ":$,",
+    :"$`"      => ":$`",
+    :"$!"      => ":$!",
+    :"$;"      => ":$;",
+    :"$\\"     => ":$\\",
+    :"$="      => ":$=",
+    :"$*"      => ":$*",
+    :"$>"      => ":$>",
+    :"$&"      => ":$&",
+    :"$@"      => ":$@",
+    :"$1234"   => ":$1234",
+
+    :-@        => ":-@",
+    :+@        => ":+@",
+    :%         => ":%",
+    :&         => ":&",
+    :*         => ":*",
+    :**        => ":**",
+    :"/"       => ":/",     # lhs quoted for emacs happiness
+    :<         => ":<",
+    :<=        => ":<=",
+    :<=>       => ":<=>",
+    :==        => ":==",
+    :===       => ":===",
+    :=~        => ":=~",
+    :>         => ":>",
+    :>=        => ":>=",
+    :>>        => ":>>",
+    :[]        => ":[]",
+    :[]=       => ":[]=",
+    :"\<\<"    => ":\<\<",
+    :^         => ":^",
+    :"`"       => ":`",     # for emacs, and justice!
+    :~         => ":~",
+    :|         => ":|",
+
+    :"!"       => ":\"!\"",
+    :"!="      => ":\"!=\"",
+    :"!~"      => ":\"!~\"",
+    :"\$"      => ":\"$\"", # for justice!
+    :"&&"      => ":\"&&\"",
+    :"'"       => ":\"\'\"",
+    :","       => ":\",\"",
+    :"."       => ":\".\"",
+    :".."      => ":\"..\"",
+    :"..."     => ":\"...\"",
+    :":"       => ":\":\"",
+    :"::"      => ":\"::\"",
+    :";"       => ":\";\"",
+    :"="       => ":\"=\"",
+    :"=>"      => ":\"=>\"",
+    :"\?"      => ":\"?\"", # rawr!
+    :"@"       => ":\"@\"",
+    :"||"      => ":\"||\"",
+    :"|||"     => ":\"|||\"",
+    :"++"      => ":\"++\"",
+
+    :"\""      => ":\"\\\"\"",
+    :"\"\""    => ":\"\\\"\\\"\"",
+
+    :"9"       => ":\"9\"",
+    :"foo bar" => ":\"foo bar\"",
+    :"*foo"    => ":\"*foo\"",
+    :"foo "    => ":\"foo \"",
+    :" foo"    => ":\" foo\"",
+    :" "       => ":\" \"",
+  }
+
+  symbols.each do |input, expected|
+    it "returns self as a symbol literal for #{expected}" do
+      input.inspect.should   == expected
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/symbol/shared/id2name.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/symbol/shared/id2name.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/symbol/shared/id2name.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+describe :symbol_id2name, :shared => true do
+  it "returns the string corresponding to self" do
+    :rubinius.send(@method).should == "rubinius"
+    :squash.send(@method).should == "squash"
+    :[].send(@method).should == "[]"
+    :@ruby.send(@method).should == "@ruby"
+    :@@ruby.send(@method).should == "@@ruby"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/symbol/to_i_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/symbol/to_i_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/symbol/to_i_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Symbol#to_i" do
+  not_compliant_on :rubinius do
+    it "returns an integer that is unique for each symbol for each program execution" do
+      :ruby.to_i.is_a?(Integer).should == true
+      :ruby.to_i.should == :ruby.to_i
+      :ruby.to_i.should_not == :rubinius.to_i
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/symbol/to_int_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/symbol/to_int_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/symbol/to_int_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Symbol#to_int" do
+  not_compliant_on :rubinius do
+    it "returns Symbol#to_i" do
+      :ruby.to_int.is_a?(Integer).should == true
+      :ruby.to_int.should == :ruby.to_i
+      :ruby.to_int.should_not == :rubinius.to_i
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/symbol/to_proc_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/symbol/to_proc_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/symbol/to_proc_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+ruby_version_is "1.8.7" do
+  describe "Symbol#to_proc" do
+    it "returns a new Proc" do
+      proc = :to_s.to_proc
+      proc.should be_kind_of(Proc)
+    end
+  
+    it "sends self to arguments passed when calling #call on the proc" do
+      obj = mock("Receiving #to_s")
+      obj.should_receive(:to_s).and_return("Received #to_s")
+      :to_s.to_proc.call(obj).should == "Received #to_s"
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/symbol/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/symbol/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/symbol/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/id2name'
+
+describe "Symbol#to_s" do
+  it_behaves_like(:symbol_id2name, :to_s)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/symbol/to_sym_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/symbol/to_sym_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/symbol/to_sym_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Symbol#to_sym" do
+  it "returns self" do
+    [:rubinius, :squash, :[], :@ruby, :@@ruby].each do |sym|
+      sym.to_sym.should == sym
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/systemexit/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/systemexit/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/systemexit/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "SystemExit#initialize" do
+  it "accepts a status" do
+    s = SystemExit.new 1
+    s.status.should == 1
+    s.message.should == 'SystemExit'
+  end
+
+  it "accepts a message" do
+    s = SystemExit.new 'message'
+    s.status.should == 0
+    s.message.should == 'message'
+  end
+
+  it "accepts a status and message" do
+    s = SystemExit.new 10, 'message'
+    s.status.should == 10
+    s.message.should == 'message'
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/thread/abort_on_exception_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/abort_on_exception_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/abort_on_exception_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Thread#abort_on_exception" do
+  it "is changeable to true or false" do
+    Thread.abort_on_exception = true
+    Thread.abort_on_exception.should == true
+    Thread.abort_on_exception = false
+    Thread.abort_on_exception.should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/thread/alive_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/alive_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/alive_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,44 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Thread#alive?" do
+  it "can check it's own status" do
+    ThreadSpecs.status_of_current_thread.alive?.should == true
+  end
+
+  it "describes a running thread" do
+    ThreadSpecs.status_of_running_thread.alive?.should == true
+  end
+
+  it "describes a sleeping thread" do
+    ThreadSpecs.status_of_sleeping_thread.alive?.should == true
+  end
+
+  it "describes a blocked thread" do
+    ThreadSpecs.status_of_blocked_thread.alive?.should == true
+  end
+
+  it "describes a completed thread" do
+    ThreadSpecs.status_of_completed_thread.alive?.should == false
+  end
+
+  it "describes a killed thread" do
+    ThreadSpecs.status_of_killed_thread.alive?.should == false
+  end
+
+  it "describes a thread with an uncaught exception" do
+    ThreadSpecs.status_of_thread_with_uncaught_exception.alive?.should == false
+  end
+
+  it "describes a dying running thread" do
+    ThreadSpecs.status_of_dying_running_thread.alive?.should == true
+  end
+
+  it "describes a dying sleeping thread" do
+    ThreadSpecs.status_of_dying_sleeping_thread.alive?.should == true
+  end
+
+  it "reports aborting on a killed thread" do
+    ThreadSpecs.status_of_aborting_thread.alive?.should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/thread/critical_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/critical_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/critical_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,94 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Thread.critical=" do
+  before(:each) do
+    ScratchPad.clear
+  end
+
+  it "should be sticky" do
+    Thread.critical = true
+    Thread.critical.should == true
+    Thread.critical = false
+    ThreadSpecs.critical_is_reset.should == true
+  end
+
+  it "allows all non-bool arguments" do
+    Thread.critical = "Hello"
+    Thread.critical.should == true
+
+    Thread.critical = nil
+    ThreadSpecs.critical_is_reset.should == true
+  end
+
+  it "functions as a critical section" do
+    ThreadSpecs.counter = 0
+    iters = 50
+    t = Thread.new { ThreadSpecs.increment_counter(iters) }
+    ThreadSpecs.increment_counter(iters)
+    t.join
+    ThreadSpecs.counter.should == iters * 2
+  end
+
+  it "does not change status of other existing threads" do
+    t = ThreadSpecs.create_critical_thread { ScratchPad.record Thread.main.status }
+    Thread.pass while t.status != false
+    ScratchPad.recorded.should == "run"
+  end
+
+  it "is reentrant" do
+    Thread.critical = true
+    Thread.critical = true
+    Thread.critical.should == true
+    Thread.critical = false
+    Thread.critical = false
+    ThreadSpecs.critical_is_reset.should == true
+  end
+
+  it "can be mismatched" do
+    Thread.critical = true
+    Thread.critical = true
+    Thread.critical.should == true
+    Thread.critical = false
+    ThreadSpecs.critical_is_reset.should == true
+  end
+
+  # Hangs on 1.8.6.114 OS X, possibly also on Linux
+  quarantine! do
+  it "schedules other threads on Thread.pass" do
+    ThreadSpecs.critical_thread_yields_to_main_thread { Thread.pass }
+  end
+
+  it "schedules other threads on sleep" do
+    ThreadSpecs.critical_thread_yields_to_main_thread(true) { sleep }
+  end
+  end
+
+  it "schedules other threads on Thread.stop" do
+    # Note that Thread.Stop resets Thread.critical, whereas sleep does not
+    ThreadSpecs.critical_thread_yields_to_main_thread(false, true) { Thread.stop }
+  end
+
+  it "defers exit" do
+    critical_thread = ThreadSpecs.create_and_kill_critical_thread()
+    Thread.pass while critical_thread.status != false
+    ScratchPad.recorded.should == "status=aborting"
+  end
+
+  it "defers exit until Thread.pass" do
+    critical_thread = ThreadSpecs.create_and_kill_critical_thread(true)
+    Thread.pass while critical_thread.status != false
+    ScratchPad.recorded.should == nil
+  end
+
+  not_compliant_on(:ironruby) do # requires green threads so that another thread can be scheduled when the critical thread is killed
+    it "is not reset if the critical thread is killed" do
+      critical_thread = ThreadSpecs.create_and_kill_critical_thread(true)
+      Thread.pass while critical_thread.status != false
+      Thread.critical.should == true
+
+      Thread.critical = false
+      ThreadSpecs.critical_is_reset.should == true
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/thread/current_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/current_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/current_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Thread.current" do
+  it "returns a thread" do
+    current = Thread.current
+    current.class.should == Thread
+  end
+
+  it "returns the current thread" do
+    t = Thread.new { Thread.current }
+    t.value.should equal(t)
+    Thread.current.should_not equal(t.value)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/thread/element_reference_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/element_reference_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/element_reference_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,44 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Thread#[]" do
+  it "gives access to thread local values" do
+    th = Thread.new do
+      Thread.current[:value] = 5
+    end
+    th.join
+    th[:value].should == 5
+    Thread.current[:value].should == nil
+  end
+
+  it "is not shared across threads" do
+    t1 = Thread.new do
+      Thread.current[:value] = 1
+    end
+    t2 = Thread.new do
+      Thread.current[:value] = 2
+    end
+    [t1,t2].each {|x| x.join}
+    t1[:value].should == 1
+    t2[:value].should == 2
+  end
+
+  it "is accessable using strings or symbols" do
+    t1 = Thread.new do
+      Thread.current[:value] = 1
+    end
+    t2 = Thread.new do
+      Thread.current["value"] = 2
+    end
+    [t1,t2].each {|x| x.join}
+    t1[:value].should == 1
+    t1["value"].should == 1
+    t2[:value].should == 2
+    t2["value"].should == 2
+  end
+
+  it "raises exceptions on the wrong type of keys" do
+    lambda { Thread.current[nil] }.should raise_error(TypeError)
+    lambda { Thread.current[5] }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/thread/element_set_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/element_set_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/element_set_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Thread#[]=" do
+  it "raises exceptions on the wrong type of keys" do
+    lambda { Thread.current[nil] = true }.should raise_error(TypeError)
+    lambda { Thread.current[5] = true }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/thread/exit_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/exit_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/exit_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/exit'
+
+describe "Thread#exit" do
+  it_behaves_like :thread_exit, :exit
+end

Added: MacRuby/branches/experimental/spec/frozen/core/thread/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,278 @@
+unless defined? Channel
+  require 'thread'
+  class Channel < Queue
+    alias receive shift
+  end
+end
+
+module ThreadSpecs
+  class Status
+    attr_reader :thread, :inspect, :status
+    def initialize(thread)
+      @thread = thread
+      @alive = thread.alive?
+      @inspect = thread.inspect
+      @status = thread.status
+      @stop = thread.stop?
+    end
+    
+    def alive?
+      @alive
+    end
+    
+    def stop?
+      @stop
+    end
+  end
+
+  def self.sleeping_thread
+    Thread.new do
+      begin
+        sleep
+        ScratchPad.record :woken
+      rescue Object => e
+        ScratchPad.record e
+      end
+    end
+  end
+
+  def self.running_thread
+    Thread.new do
+      begin
+        loop {}
+        ScratchPad.record :woken
+      rescue Object => e
+        ScratchPad.record e
+      end
+    end
+  end
+  
+  def self.completed_thread
+    Thread.new {}
+  end
+  
+  def self.status_of_current_thread
+    Thread.new { Status.new(Thread.current) }.value
+  end
+  
+  def self.status_of_running_thread
+    t = running_thread
+    Thread.pass while t.alive? && t.status != "run"
+    status = Status.new t
+    t.kill
+    t.join
+    status
+  end
+  
+  def self.status_of_completed_thread
+    t = completed_thread
+    t.join
+    Status.new t
+  end
+  
+  def self.status_of_sleeping_thread
+    t = sleeping_thread
+    Thread.pass until t.status == 'sleep'
+    status = Status.new t
+    t.run
+    t.join
+    status
+  end
+  
+  def self.status_of_blocked_thread
+    m = Mutex.new
+    m.lock
+    t = Thread.new { m.lock }
+    Thread.pass until t.status == 'sleep'
+    status = Status.new t
+    m.unlock
+    t.join
+    status
+  end
+  
+  def self.status_of_aborting_thread
+    t = Thread.new { sleep }
+    begin
+      Thread.critical = true
+      t.kill
+      Status.new t
+    ensure
+      Thread.critical = false      
+    end
+  end
+  
+  def self.status_of_killed_thread
+    t = Thread.new { sleep }
+    Thread.pass until t.status == 'sleep'
+    t.kill
+    t.join
+    Status.new t
+  end
+  
+  def self.status_of_thread_with_uncaught_exception
+    t = Thread.new { raise "error" }
+    begin
+      t.join
+    rescue RuntimeError
+    end
+    Status.new t
+  end
+  
+  def self.status_of_dying_running_thread
+    status = nil
+    t = dying_thread_ensures { status = Status.new Thread.current }     
+    t.join
+    status
+  end
+  
+  def self.status_of_dying_sleeping_thread
+    t = dying_thread_ensures { Thread.stop; }           
+    Thread.pass until t.status == 'sleep'
+    status = Status.new t
+    t.wakeup
+    t.join
+    status
+  end
+  
+  def self.dying_thread_ensures(kill_method_name=:kill)
+    t = Thread.new do
+      begin
+        Thread.current.send(kill_method_name)
+      ensure
+        yield
+      end
+    end
+  end
+  
+  def self.dying_thread_with_outer_ensure(kill_method_name=:kill)
+    t = Thread.new do
+      begin
+        begin
+          Thread.current.send(@method)
+        ensure
+          raise "In dying thread"
+        end
+      ensure
+        yield
+      end
+    end
+  end
+    
+  def self.join_dying_thread_with_outer_ensure(kill_method_name=:kill)
+    t = dying_thread_with_outer_ensure(kill_method_name) { yield }
+    lambda { t.join }.should raise_error(RuntimeError, "In dying thread")
+    return t
+  end
+  
+  def self.wakeup_dying_sleeping_thread(kill_method_name=:kill)
+    thread = ThreadSpecs.dying_thread_ensures(kill_method_name) { yield }
+    Thread.pass until thread.status == "sleep"
+    thread.wakeup
+    thread.join
+  end
+  
+  def self.critical_is_reset
+    # Create another thread to verify that it can call Thread.critical=
+    t = Thread.new do
+      initial_critical = Thread.critical
+      Thread.critical = true
+      Thread.critical = false
+      initial_critical == false && Thread.critical == false
+    end
+    v = t.value
+    t.join
+    v
+  end
+
+  def self.counter
+    @@counter
+  end
+  
+  def self.counter= c
+    @@counter = c
+  end
+  
+  def self.increment_counter(incr)
+    incr.times do
+      begin
+        Thread.critical = true
+        @@counter += 1
+      ensure
+        Thread.critical = false
+      end
+    end
+  end
+
+  def self.critical_thread1()
+    Thread.critical = true
+    Thread.current.key?(:thread_specs).should == false
+  end
+  
+  def self.critical_thread2(isThreadStop)
+    Thread.current[:thread_specs].should == 101
+    Thread.critical.should == !isThreadStop
+    if not isThreadStop
+      Thread.critical = false
+    end
+  end
+  
+  def self.main_thread1(critical_thread, isThreadSleep, isThreadStop)
+    # Thread.stop resets Thread.critical. Also, with native threads, the Thread.Stop may not have executed yet
+    # since the main thread will race with the critical thread
+    if not isThreadStop
+      Thread.critical.should == true
+    end
+    critical_thread[:thread_specs] = 101
+    if isThreadSleep or isThreadStop
+      # Thread#wakeup calls are not queued up. So we need to ensure that the thread is sleeping before calling wakeup
+      Thread.pass while critical_thread.status != "sleep"
+      critical_thread.wakeup
+    end
+  end
+  
+  def self.main_thread2(critical_thread)
+    Thread.pass # The join below seems to cause a deadlock with CRuby unless Thread.pass is called first
+    critical_thread.join
+    Thread.critical.should == false
+  end
+
+  def self.critical_thread_yields_to_main_thread(isThreadSleep=false, isThreadStop=false)        
+    @@after_first_sleep = false
+    
+    critical_thread = Thread.new do
+      Thread.pass while Thread.main.status != "sleep"
+      critical_thread1()
+      Thread.main.wakeup
+      yield
+      Thread.pass while @@after_first_sleep != true # Need to ensure that the next statement does not see the first sleep itself
+      Thread.pass while Thread.main.status != "sleep"
+      critical_thread2(isThreadStop)
+      Thread.main.wakeup
+    end
+    
+    sleep 5
+    @@after_first_sleep = true
+    main_thread1(critical_thread, isThreadSleep, isThreadStop)
+    sleep 5
+    main_thread2(critical_thread)
+  end
+  
+  def self.create_critical_thread()
+    critical_thread = Thread.new do
+      Thread.critical = true
+      yield
+      Thread.critical = false
+    end
+    return critical_thread
+  end
+  
+  def self.create_and_kill_critical_thread(passAfterKill=false)
+    critical_thread = ThreadSpecs.create_critical_thread do
+      Thread.current.kill
+      if passAfterKill
+        Thread.pass
+      end
+      ScratchPad.record("status=" + Thread.current.status)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/thread/fork_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/fork_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/fork_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/thread/group_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/group_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/group_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/thread/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/thread/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,44 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Thread#inspect" do
+  it "can check it's own status" do
+    ThreadSpecs.status_of_current_thread.inspect.should include('run')
+  end
+
+  it "describes a running thread" do
+    ThreadSpecs.status_of_running_thread.inspect.should include('run')
+  end
+
+  it "describes a sleeping thread" do
+    ThreadSpecs.status_of_sleeping_thread.inspect.should include('sleep')
+  end
+
+  it "describes a blocked thread" do
+    ThreadSpecs.status_of_blocked_thread.inspect.should include('sleep')
+  end
+
+  it "describes a completed thread" do
+    ThreadSpecs.status_of_completed_thread.inspect.should include('dead')
+  end
+
+  it "describes a killed thread" do
+    ThreadSpecs.status_of_killed_thread.inspect.should include('dead')
+  end
+
+  it "describes a thread with an uncaught exception" do
+    ThreadSpecs.status_of_thread_with_uncaught_exception.inspect.should include('dead')
+  end
+
+  it "describes a dying running thread" do
+    ThreadSpecs.status_of_dying_running_thread.inspect.should include('aborting')
+  end
+
+  it "describes a dying sleeping thread" do
+    ThreadSpecs.status_of_dying_sleeping_thread.status.should include('sleep')
+  end
+
+  it "reports aborting on a killed thread" do
+    ThreadSpecs.status_of_aborting_thread.inspect.should include('aborting')
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/thread/join_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/join_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/join_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,52 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Thread#join" do
+  it "returns the thread when it is finished" do
+    t = Thread.new {}
+    t.join.should equal(t)
+  end
+
+  it "returns the thread when it is finished when given a timeout" do
+    t = Thread.new {}
+    t.join
+    t.join(0).should equal(t)
+  end
+
+  it "returns nil if it is not finished when given a timeout" do
+    c = Channel.new
+    t = Thread.new { c.receive }
+    begin
+      t.join(0).should == nil
+    ensure
+      c << true
+    end
+    t.join.should == t
+  end
+
+  it "accepts a floating point timeout length" do
+    c = Channel.new
+    t = Thread.new { c.receive }
+    begin
+      t.join(0.01).should == nil
+    ensure
+      c << true
+    end
+    t.join.should == t
+  end
+  
+  it "raises any exceptions encountered in the thread body" do
+    t = Thread.new { raise NotImplementedError.new("Just kidding") }
+    lambda { t.join }.should raise_error(NotImplementedError)
+  end
+
+  it "returns the dead thread" do
+    t = Thread.new { Thread.current.kill }
+    t.join.should equal(t)
+  end
+
+  it "returns the dead thread even if an uncaught exception is thrown from ensure block" do
+    t = ThreadSpecs.dying_thread_ensures { raise "In dying thread" }
+    t.join.should equal(t)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/thread/key_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/key_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/key_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Thread#key?" do
+  before :each do
+    @th = Thread.new do
+      Thread.current[:oliver] = "a"
+    end
+    @th.join
+  end
+
+  it "tests for existance of thread local variables using symbols or strings" do
+    @th.key?(:oliver).should == true
+    @th.key?("oliver").should == true
+    @th.key?(:stanley).should == false
+    @th.key?(:stanley.to_s).should == false
+  end
+
+  it "raises exceptions on the wrong type of keys" do
+    lambda { Thread.current.key? nil }.should raise_error(TypeError)
+    lambda { Thread.current.key? 5 }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/thread/keys_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/keys_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/keys_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Thread#keys" do
+  it "returns an array of the names of the thread-local variables as symbols" do
+    th = Thread.new do
+      Thread.current["cat"] = 'woof'
+      Thread.current[:cat] = 'meow'
+      Thread.current[:dog] = 'woof'
+    end
+    th.join
+    th.keys.sort_by {|x| x.to_s}.should == [:cat,:dog]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/thread/kill_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/kill_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/kill_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/exit'
+
+describe "Thread#kill" do
+  it_behaves_like :thread_exit, :kill
+end

Added: MacRuby/branches/experimental/spec/frozen/core/thread/list_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/list_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/list_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Thread::list" do
+  it "includes the current and main thread" do
+    Thread.list.should include(Thread.current)
+    Thread.list.should include(Thread.main)
+  end
+
+  it "does not include deceased threads" do
+    t = Thread.new { 1; }
+    t.join
+    Thread.list.should_not include(t)
+  end
+
+  it "includes waiting threads" do
+    c = Channel.new
+    t = Thread.new { c.receive }
+    begin
+      Thread.list.should include(t)
+    ensure
+      c << nil
+      t.join
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/thread/main_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/main_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/main_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Thread.main" do
+  it "returns the main thread" do
+    Thread.new { @main = Thread.main ; @current = Thread.current}.join
+    @main.should_not == @current
+    @main.should == Thread.current
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/thread/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Thread.new" do
+  it "creates a thread executing the given block" do
+    c = Channel.new
+    Thread.new { c << true }.join
+    c << false
+    c.receive.should == true
+  end
+  
+  it "can pass arguments to the thread block" do
+    arr = []
+    a, b, c = 1, 2, 3
+    t = Thread.new(a,b,c) {|d,e,f| arr << d << e << f }
+    t.join
+    arr.should == [a,b,c]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/thread/pass_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/pass_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/pass_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Thread.pass" do
+  it "returns nil" do
+    Thread.pass.should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/thread/priority_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/priority_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/priority_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/thread/raise_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/raise_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/raise_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,127 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/../../shared/kernel/raise'
+
+describe "Thread#raise" do
+  it "ignores dead threads" do
+    t = Thread.new { :dead }
+    Thread.pass while t.alive?
+    lambda {t.raise("Kill the thread")}.should_not raise_error
+    lambda {t.value}.should_not raise_error
+  end
+end
+
+describe "Thread#raise on a sleeping thread" do
+  before :each do
+    ScratchPad.clear
+    @thr = ThreadSpecs.sleeping_thread
+    Thread.pass while (@thr.alive? && @thr.status != "sleep")
+  end
+
+  after :each do
+    @thr.kill
+  end
+
+  it "raises a RuntimeError if no exception class is given" do
+    @thr.raise
+    Thread.pass while @thr.status
+    ScratchPad.recorded.should be_kind_of(RuntimeError)
+  end
+
+  it "raises the given exception" do
+    @thr.raise Exception
+    Thread.pass while @thr.status
+    ScratchPad.recorded.class.should == Exception
+  end
+
+  it "raises the given exception with the given message" do
+    @thr.raise Exception, "get to work"
+    Thread.pass while @thr.status
+    ScratchPad.recorded.class.should == Exception
+    ScratchPad.recorded.message.should == "get to work"
+  end
+
+  it "can go unhandled" do
+    t = Thread.new do
+      sleep
+    end
+
+    t.raise
+    lambda {t.value}.should raise_error(RuntimeError)
+  end
+
+  it "re-raises active exception" do
+    t = Thread.new do
+      begin
+        1/0
+      rescue ZeroDivisionError
+        sleep 3
+      end
+    end
+
+    Thread.pass while t.status != "sleep"
+    t.raise
+    lambda {t.value}.should raise_error(ZeroDivisionError)
+    t.kill
+  end
+end
+
+describe "Thread#raise on a running thread" do
+  before :each do
+    ScratchPad.clear
+    @thr = ThreadSpecs.running_thread
+    Thread.pass while (@thr.alive? && @thr.status != "run")
+  end
+  
+  after :each do
+    @thr.kill
+  end
+
+  it "raises a RuntimeError if no exception class is given" do
+    @thr.raise
+    Thread.pass while @thr.status
+    ScratchPad.recorded.should be_kind_of(RuntimeError)
+  end
+
+  it "raises the given exception" do
+    @thr.raise Exception
+    Thread.pass while @thr.status
+    ScratchPad.recorded.class.should == Exception
+  end
+
+  it "raises the given exception with the given message" do
+    @thr.raise Exception, "get to work"
+    Thread.pass while @thr.status
+    ScratchPad.recorded.class.should == Exception
+    ScratchPad.recorded.message.should == "get to work"
+  end
+
+  it "can go unhandled" do
+    t = Thread.new do
+      loop {}
+    end
+
+    t.raise
+    lambda {t.value}.should raise_error(RuntimeError)
+  end
+
+  it "re-raises active exception" do
+    raised = false
+    t = Thread.new do
+      begin
+        1/0
+      rescue ZeroDivisionError
+        raised = true
+        loop { }
+      end
+    end
+
+    Thread.pass until raised || !t.alive?
+    t.raise
+    lambda {t.value}.should raise_error(ZeroDivisionError)
+  end
+end
+
+describe "Thread#raise on same thread" do
+  it_behaves_like :kernel_raise, :raise, Thread.current
+end

Added: MacRuby/branches/experimental/spec/frozen/core/thread/run_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/run_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/run_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+require File.dirname(__FILE__) + '/shared/wakeup'
+
+describe "Thread#run" do
+  it_behaves_like :thread_wakeup, :run
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/thread/safe_level_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/safe_level_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/safe_level_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/thread/shared/exit.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/shared/exit.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/shared/exit.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,139 @@
+describe :thread_exit, :shared => true do
+  before(:each) do
+    ScratchPad.clear
+  end
+
+  it "kills sleeping thread" do
+    sleeping_thread = Thread.new do
+      sleep
+      ScratchPad.record :after_sleep
+    end
+    Thread.pass while sleeping_thread.status != "sleep"
+    sleeping_thread.send(@method)
+    sleeping_thread.join
+    ScratchPad.recorded.should == nil
+  end
+  
+  it "kills current thread" do
+    thread = Thread.new do
+      Thread.current.send(@method)
+      ScratchPad.record :after_sleep
+    end
+    thread.join
+    ScratchPad.recorded.should == nil
+  end
+  
+  it "runs ensure clause" do
+    thread = ThreadSpecs.dying_thread_ensures(@method) { ScratchPad.record :in_ensure_clause }
+    thread.join
+    ScratchPad.recorded.should == :in_ensure_clause
+  end
+  
+  it "does not set $!" do
+    thread = ThreadSpecs.dying_thread_ensures(@method) { ScratchPad.record $! }
+    thread.join
+    ScratchPad.recorded.should == nil
+  end
+   
+  it "cannot be rescued" do
+    thread = Thread.new do
+      begin
+        Thread.current.send(@method)
+      rescue Exception
+        ScratchPad.record :in_rescue
+      end
+     ScratchPad.record :end_of_thread_block
+    end
+    
+    thread.join
+    ScratchPad.recorded.should == nil
+  end
+  
+  it "killing dying sleeping thread wakes up thread" do
+    t = ThreadSpecs.dying_thread_ensures { Thread.stop; ScratchPad.record :after_stop }
+    Thread.pass until t.status == "sleep"
+    t.send(@method)
+    t.join
+    ScratchPad.recorded.should == :after_stop
+  end
+  
+  it "killing dying running does nothing" do
+    in_ensure_clause = false
+    exit_loop = true
+    t = ThreadSpecs.dying_thread_ensures do
+      in_ensure_clause = true
+      loop { if exit_loop then break end }
+      ScratchPad.record :after_stop
+    end
+    
+    Thread.pass until in_ensure_clause == true
+    10.times { t.send(@method); Thread.pass }
+    exit_loop = true
+    t.join
+    ScratchPad.recorded.should == :after_stop
+  end
+  
+  it "propogates inner exception to Thread.join if there is an outer ensure clause" do
+    thread = ThreadSpecs.dying_thread_with_outer_ensure(@method) { }
+    lambda { thread.join }.should raise_error(RuntimeError, "In dying thread")
+  end
+  
+  it "runs all outer ensure clauses even if inner ensure clause raises exception" do
+    thread = ThreadSpecs.join_dying_thread_with_outer_ensure(@method) { ScratchPad.record :in_outer_ensure_clause }
+    ScratchPad.recorded.should == :in_outer_ensure_clause
+  end
+  
+  it "sets $! in outer ensure clause if inner ensure clause raises exception" do
+    thread = ThreadSpecs.join_dying_thread_with_outer_ensure(@method) { ScratchPad.record $! }
+    ScratchPad.recorded.to_s.should == "In dying thread"
+  end
+  
+  it "can be rescued by outer rescue clause when inner ensure clause raises exception" do
+    thread = Thread.new do
+      begin
+        begin
+          Thread.current.send(@method)
+        ensure
+          raise "In dying thread"
+        end
+      rescue Exception
+        ScratchPad.record $!
+      end
+      :end_of_thread_block
+    end
+
+    thread.value.should == :end_of_thread_block
+    ScratchPad.recorded.to_s.should == "In dying thread"
+  end
+  
+  it "is deferred if ensure clause does Thread.stop" do
+    ThreadSpecs.wakeup_dying_sleeping_thread(@method) { Thread.stop; ScratchPad.record :after_sleep }
+    ScratchPad.recorded.should == :after_sleep
+  end
+
+  # Hangs on 1.8.6.114 OS X, possibly also on Linux
+  # FIX: There is no such thing as not_compliant_on(:ruby)!!!
+  quarantine! do
+  not_compliant_on(:ruby) do # Doing a sleep in the ensure block hangs the process
+    it "is deferred if ensure clause sleeps" do
+      ThreadSpecs.wakeup_dying_sleeping_thread(@method) { sleep; ScratchPad.record :after_sleep }
+      ScratchPad.recorded.should == :after_sleep
+    end
+  end
+  end
+  
+  # This case occurred in JRuby where native threads are used to provide
+  # the same behavior as MRI green threads. Key to this issue was the fact
+  # that the thread which called #exit in its block was also being explicitly
+  # sent #join from outside the thread. The 100.times provides a certain
+  # probability that the deadlock will occur. It was sufficient to reliably
+  # reproduce the deadlock in JRuby.
+  it "does not deadlock when called from within the thread while being joined from without" do
+    100.times do
+      t = Thread.new { Thread.stop; Thread.current.send(@method) }
+      Thread.pass until t.status == "sleep"
+      t.wakeup.should == t
+      t.join.should == t
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/thread/shared/wakeup.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/shared/wakeup.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/shared/wakeup.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,49 @@
+describe :thread_wakeup, :shared => true do
+  it "is not queued" do
+    exit_loop = false
+    after_sleep1 = false
+    after_sleep2 = false
+    t = Thread.new do
+      loop do
+        if exit_loop == true
+          break
+        end
+      end
+      
+      sleep
+      after_sleep1 = true
+      
+      sleep
+      after_sleep2 = true
+    end
+
+    10.times { t.send(@method); Thread.pass } # These will all get ignored because the thread is not sleeping yet
+
+    exit_loop = true
+    
+    Thread.pass while t.status != "sleep"
+    after_sleep1.should == false # t should be blocked on the first sleep
+    t.send(@method)
+
+    Thread.pass while after_sleep1 != true
+    Thread.pass while t.status != "sleep"
+    after_sleep2.should == false # t should be blocked on the second sleep
+    t.send(@method)
+    Thread.pass while after_sleep2 != true
+    
+    t.join
+  end
+
+  it "does not result in a deadlock" do
+    t = Thread.new do
+      1000.times {Thread.stop }
+    end
+
+    while(t.status != false) do
+      t.send(@method)
+      Thread.pass
+    end
+    
+    1.should == 1 # test succeeds if we reach here
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/thread/start_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/start_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/start_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/core/thread/status_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/status_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/status_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,44 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Thread#status" do
+  it "can check it's own status" do
+    ThreadSpecs.status_of_current_thread.status.should == 'run'
+  end
+
+  it "describes a running thread" do
+    ThreadSpecs.status_of_running_thread.status.should == 'run'
+  end
+
+  it "describes a sleeping thread" do
+    ThreadSpecs.status_of_sleeping_thread.status.should == 'sleep'
+  end
+
+  it "describes a blocked thread" do
+    ThreadSpecs.status_of_blocked_thread.status.should == 'sleep'
+  end
+
+  it "describes a completed thread" do
+    ThreadSpecs.status_of_completed_thread.status.should == false
+  end
+
+  it "describes a killed thread" do
+    ThreadSpecs.status_of_killed_thread.status.should == false
+  end
+
+  it "describes a thread with an uncaught exception" do
+    ThreadSpecs.status_of_thread_with_uncaught_exception.status.should == nil
+  end
+
+  it "describes a dying running thread" do
+    ThreadSpecs.status_of_dying_running_thread.status.should == 'aborting'
+  end
+
+  it "describes a dying sleeping thread" do
+    ThreadSpecs.status_of_dying_sleeping_thread.status.should == 'sleep'
+  end
+
+  it "reports aborting on a killed thread" do
+    ThreadSpecs.status_of_aborting_thread.status.should == 'aborting'
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/thread/stop_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/stop_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/stop_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,62 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Thread.stop" do
+  it "causes the current thread to sleep indefinitely" do
+    t = Thread.new { Thread.stop; 5 }
+    Thread.pass until t.status == 'sleep'
+    t.status.should == 'sleep'
+    t.run
+    t.value.should == 5
+  end
+
+  it "resets Thread.critical to false" do
+    t = Thread.new { Thread.critical = true; Thread.stop }
+    Thread.pass until t.status == 'sleep'
+    Thread.critical.should == false
+    t.run
+    t.join
+  end
+end
+
+describe "Thread#stop?" do
+  it "can check it's own status" do
+    ThreadSpecs.status_of_current_thread.stop?.should == false
+  end
+
+  it "describes a running thread" do
+    ThreadSpecs.status_of_running_thread.stop?.should == false
+  end
+
+  it "describes a sleeping thread" do
+    ThreadSpecs.status_of_sleeping_thread.stop?.should == true
+  end
+
+  it "describes a blocked thread" do
+    ThreadSpecs.status_of_blocked_thread.stop?.should == true
+  end
+
+  it "describes a completed thread" do
+    ThreadSpecs.status_of_completed_thread.stop?.should == true
+  end
+
+  it "describes a killed thread" do
+    ThreadSpecs.status_of_killed_thread.stop?.should == true
+  end
+
+  it "describes a thread with an uncaught exception" do
+    ThreadSpecs.status_of_thread_with_uncaught_exception.stop?.should == true
+  end
+
+  it "describes a dying running thread" do
+    ThreadSpecs.status_of_dying_running_thread.stop?.should == false
+  end
+
+  it "describes a dying sleeping thread" do
+    ThreadSpecs.status_of_dying_sleeping_thread.stop?.should == true
+  end
+
+  it "reports aborting on a killed thread" do
+    ThreadSpecs.status_of_aborting_thread.stop?.should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/thread/terminate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/terminate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/terminate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/exit'
+
+describe "Thread#terminate" do
+  it_behaves_like :thread_exit, :terminate
+end

Added: MacRuby/branches/experimental/spec/frozen/core/thread/value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Thread#value" do
+  it "returns the result of the block" do
+    Thread.new { 3 }.value.should == 3
+  end
+
+  it "re-raises error for an uncaught exception" do
+    t = Thread.new { raise "Hello" }
+    lambda { t.value }.should raise_error(RuntimeError, "Hello")
+  end
+
+  it "is false for a killed thread" do
+    t = Thread.new { Thread.current.exit }
+    t.value.should == false
+  end
+
+  it "is false for an uncaught exception thrown from a dying thread" do
+    t = ThreadSpecs.dying_thread_ensures { 1/0 }
+    t.value.should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/thread/wakeup_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/thread/wakeup_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/wakeup_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/wakeup'
+
+describe "Thread#wakeup" do
+  it_behaves_like :thread_wakeup, :wakeup
+end

Added: MacRuby/branches/experimental/spec/frozen/core/threadgroup/add_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/threadgroup/add_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/threadgroup/add_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,36 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "ThreadGroup#add" do
+  before(:each) do
+    @chan1, at chan2 = Channel.new,Channel.new
+    @thread = Thread.new { @chan1 << :go; @chan2.receive }
+    @chan1.receive
+  end
+  
+  after(:each) do
+    @chan2 << :done
+    @thread.join
+  end
+  
+  it "adds the given thread to a group and returns self" do
+    @thread.group.should_not == nil
+    
+    tg = ThreadGroup.new
+    tg.add(@thread).should == tg
+    @thread.group.should == tg
+    tg.list.include?(@thread).should == true
+  end
+  
+  it "removes itself from any other threadgroup" do
+    tg1 = ThreadGroup.new
+    tg2 = ThreadGroup.new
+    
+    tg1.add(@thread)
+    @thread.group.should == tg1
+    tg2.add(@thread)
+    @thread.group.should == tg2
+    tg2.list.include?(@thread).should == true
+    tg1.list.include?(@thread).should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/threadgroup/enclose_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/threadgroup/enclose_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/threadgroup/enclose_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/threadgroup/enclosed_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/threadgroup/enclosed_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/threadgroup/enclosed_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/core/threadgroup/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/threadgroup/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/threadgroup/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+unless defined? Channel
+  require 'thread'
+  class Channel < Queue
+    alias receive shift
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/threadgroup/list_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/threadgroup/list_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/threadgroup/list_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "ThreadGroup#list" do
+  it "returns the list of threads in the group" do
+    chan = Channel.new
+    th1 = Thread.new { chan << :go; sleep }
+    chan.receive.should == :go
+    tg = ThreadGroup.new
+    tg.add(th1)
+    tg.list.should include(th1)
+    
+    th2 = Thread.new { chan << :go; sleep }
+    chan.receive.should == :go
+    
+    tg.add(th2)    
+    (tg.list & [th1, th2]).should include(th1, th2)
+
+    Thread.pass until th1.status == 'sleep' || !th1.alive?
+    Thread.pass until th2.status == 'sleep' || !th2.alive?
+    th1.run; th1.join
+    th2.run; th2.join
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/_dump_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/_dump_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/_dump_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,42 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+
+describe "Time#_dump" do
+  before :each do
+    @t = Time.at(946812800)
+    @t = @t.gmtime
+    @s = @t._dump
+  end
+
+  ruby_bug("http://redmine.ruby-lang.org/issues/show/627", "1.8.7") do
+    it "preserves the GMT flag" do
+      @t.gmt?.should == true
+      dump = @t._dump.unpack("VV").first
+      ((dump >> 30) & 0x1).should == 1
+    end
+
+    it "dumps a Time object to a bytestring" do
+      @s.should be_kind_of(String)
+      @s.should == [3222863947, 2235564032].pack("VV")
+    end
+
+    it "dumps an array with a date as first element" do
+      high =                1 << 31 |
+            (@t.gmt? ? 1 : 0) << 30 |
+             (@t.year - 1900) << 14 |
+                (@t.mon  - 1) << 10 |
+                       @t.mday << 5 |
+                            @t.hour
+
+      high.should == @s.unpack("VV").first
+    end
+  end
+
+  it "dumps an array with a time as second element" do
+    low =  @t.min  << 26 |
+           @t.sec  << 20 |
+           @t.usec
+    low.should == @s.unpack("VV").last
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/core/time/_load_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/_load_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/_load_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+
+describe "Time#_load" do
+  ruby_bug("http://redmine.ruby-lang.org/issues/show/627", "1.8.7") do
+    it "loads a time object in the new format" do
+      t = Time.local(2000, 1, 15, 20, 1, 1)
+      t = t.gmtime
+
+      high =               1 << 31 |
+            (t.gmt? ? 1 : 0) << 30 |
+             (t.year - 1900) << 14 |
+                (t.mon  - 1) << 10 |
+                       t.mday << 5 |
+                            t.hour
+
+      low =  t.min  << 26 |
+             t.sec  << 20 |
+                   t.usec
+
+      Time._load([high, low].pack("VV")).should == t
+    end
+  end
+
+  it "loads a time object in the old UNIX timestamp based format" do
+    t = Time.local(2000, 1, 15, 20, 1, 1, 203)
+    timestamp = t.to_i
+
+    high = timestamp & ((1 << 31) - 1)
+
+    low =  t.usec
+
+    Time._load([high, low].pack("VV")).should == t
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/asctime_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/asctime_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/asctime_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+require File.dirname(__FILE__) + '/shared/asctime'
+
+describe "Time#asctime" do
+  it_behaves_like(:time_asctime, :asctime)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/at_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/at_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/at_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+
+describe "Time.at" do
+  it "converts to time object" do
+    # the #chomp calls are necessary because of RSpec
+    Time.at(1168475924).inspect.chomp.should == localtime(1168475924).chomp
+  end
+  
+  it "creates a new time object with the value given by time" do
+    t = Time.now
+    Time.at(t).inspect.should == t.inspect
+  end
+  
+  it "creates a dup time object with the value given by time" do
+    t1 = Time.new
+    t2 = Time.at(t1)
+    t1.object_id.should_not == t2.object_id
+  end
+  
+  it "is able to create a time object with a float" do
+    t = Time.at(10.5)
+    t.usec.should == 500000.0
+    t.should_not == Time.at(10)
+  end
+
+  it "is able to create a time object with a microseconds" do
+    t = Time.at(10, 500000)
+    t.usec.should == 500000.0
+    t.should_not == Time.at(10)
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/comparison_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/comparison_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/comparison_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+
+describe "Time#<=>" do
+  it "returns 1 if the first argument is a point in time after the second argument" do
+    (Time.now <=> Time.at(0)).should == 1
+    (Time.at(0, 100) <=> Time.at(0, 0)).should == 1
+    (Time.at(1202778512, 100) <=> Time.at(1202778512, 99)).should == 1
+  end
+  
+  it "returns 0 if time is the same as other" do
+    (Time.at(1202778513) <=> Time.at(1202778513)).should == 0
+    (Time.at(100, 100) <=> Time.at(100, 100)).should == 0
+  end
+  
+  it "returns -1 if the first argument is a point in time before the second argument" do
+    (Time.at(0) <=> Time.now).should == -1
+    (Time.at(0, 0) <=> Time.at(0, 100)).should == -1
+    (Time.at(100, 100) <=> Time.at(101, 100)).should == -1
+  end
+
+  # see [ruby-core:15333]
+  it "returns nil when Time is compared to Numeric" do
+    (Time.at(100) <=> 100).should == nil
+    (Time.at(100) <=> 100.0).should == nil
+  end
+
+  it "returns nil when Time is compared to some Object" do
+    (Time.at(100) <=> Object.new).should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/ctime_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/ctime_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/ctime_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+require File.dirname(__FILE__) + '/shared/asctime'
+
+describe "Time#ctime" do
+  it_behaves_like(:time_asctime, :ctime)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/day_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/day_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/day_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+require File.dirname(__FILE__) + '/shared/day'
+
+describe "Time#day" do
+  it_behaves_like(:time_day, :day)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/dst_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/dst_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/dst_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+require File.dirname(__FILE__) + '/shared/isdst'
+
+describe "Time#dst?" do
+  it_behaves_like(:time_isdst, :dst?)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/dup_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/dup_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/dup_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+
+describe "Time#dup" do
+  it "returns a Time object that represents the same time" do
+	  t = Time.at(100)
+	  t.dup.tv_sec.should == t.tv_sec
+  end
+
+  it "copies the gmt state flag" do
+	  Time.now.gmtime.dup.gmt?.should == true
+  end
+
+  it "returns an independent Time object" do
+	  t = Time.now
+	  t2 = t.dup
+	  t.gmtime
+
+	  t2.gmt?.should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/eql_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/eql_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/eql_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+
+describe "Time#eql?" do
+  it "returns true iff time is equal in seconds and usecs to other time" do
+    Time.at(100, 100).should eql(Time.at(100, 100))
+    Time.at(100, 100).should_not eql(Time.at(100, 99))
+    Time.at(100, 100).should_not eql(Time.at(99, 100))
+  end  
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/fixtures/methods.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/fixtures/methods.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/fixtures/methods.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+def with_timezone(name, offset = nil, daylight_saving_zone = "")
+  zone = name.dup
+
+  if (offset)
+    # TZ convention is backwards
+    offset = -offset
+
+    zone << offset.to_s
+    zone << ":00:00"
+  end
+  zone << daylight_saving_zone
+
+  old = ENV["TZ"]
+  ENV["TZ"] = zone
+
+  begin
+    yield
+  ensure
+    ENV["TZ"] = old
+  end
+end
+
+def localtime(seconds)
+  platform_is :os => [:darwin, :bsd] do
+    return `LC_ALL=C date -r #{seconds} +'%a %b %d %H:%M:%S %z %Y'`.chomp
+  end
+
+  platform_is :os => :linux do
+    return `LC_ALL=C date -d @#{seconds} +'%a %b %d %H:%M:%S %z %Y'`.chomp
+  end
+
+  return `LC_ALL=C date -j -f "%s" #{seconds} "+%a %b %d %H:%M:%S %z %Y"`.chomp
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/getgm_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/getgm_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/getgm_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+require File.dirname(__FILE__) + '/shared/getgm'
+
+describe "Time#getgm" do
+  it_behaves_like(:time_getgm, :getgm)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/getlocal_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/getlocal_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/getlocal_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+
+describe "Time#getlocal" do
+  it "returns a new time which is the local representation of time" do
+    # Testing with America/Regina here because it doesn't have DST.
+    with_timezone("CST", -6) do
+      t = Time.gm(2007, 1, 9, 12, 0, 0)
+      t.localtime.should == Time.local(2007, 1, 9, 6, 0, 0)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/getutc_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/getutc_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/getutc_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+require File.dirname(__FILE__) + '/shared/getgm'
+
+describe "Time#getutc" do
+  it_behaves_like(:time_getgm, :getutc)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/gm_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/gm_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/gm_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+require File.dirname(__FILE__) + '/shared/gm'
+require File.dirname(__FILE__) + '/shared/time_params'
+
+describe "Time.gm" do
+  it_behaves_like(:time_gm, :gm)
+  it_behaves_like(:time_params, :gm)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/gmt_offset_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/gmt_offset_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/gmt_offset_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+require File.dirname(__FILE__) + '/shared/gmt_offset'
+
+describe "Time#gmt_offset" do
+  it_behaves_like(:time_gmt_offset, :gmt_offset)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/gmt_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/gmt_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/gmt_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+
+describe "Time#gmt?" do
+  it "returns true if time represents a time in UTC (GMT)" do
+    Time.now.gmt?.should == false
+    Time.now.gmtime.gmt?.should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/gmtime_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/gmtime_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/gmtime_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+require File.dirname(__FILE__) + '/shared/gmtime'
+
+describe "Time#gmtime" do
+  it_behaves_like(:time_gmtime, :gmtime)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/gmtoff_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/gmtoff_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/gmtoff_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+require File.dirname(__FILE__) + '/shared/gmt_offset'
+
+describe "Time#gmtoff" do
+  it_behaves_like(:time_gmt_offset, :gmtoff)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/hash_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/hash_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/hash_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+
+describe "Time#hash" do
+  it "returns a unique integer for each time" do
+    Time.at(100).hash.should == 100
+    Time.at(100, 123456).hash.should == 123428
+    Time.gm(1980).hash.should == 315532800
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/hour_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/hour_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/hour_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+
+describe "Time#hour" do
+  it "returns the hour of the day (0..23) for time" do
+    with_timezone("CET", 1) do
+      Time.at(0).hour.should == 1
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/initialize_copy_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/initialize_copy_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/initialize_copy_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'

Added: MacRuby/branches/experimental/spec/frozen/core/time/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'

Added: MacRuby/branches/experimental/spec/frozen/core/time/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'

Added: MacRuby/branches/experimental/spec/frozen/core/time/isdst_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/isdst_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/isdst_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+require File.dirname(__FILE__) + '/shared/isdst'
+
+describe "Time#isdst" do
+  it_behaves_like(:time_isdst, :isdst)
+end  

Added: MacRuby/branches/experimental/spec/frozen/core/time/local_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/local_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/local_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+require File.dirname(__FILE__) + '/shared/local'
+require File.dirname(__FILE__) + '/shared/time_params'
+
+describe "Time.local" do
+  it_behaves_like(:time_local, :local)
+  it_behaves_like(:time_params, :local)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/localtime_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/localtime_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/localtime_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+
+describe "Time#localtime" do
+  it "returns the local representation of time" do
+    # Testing with America/Regina here because it doesn't have DST.
+    with_timezone("CST", -6) do
+      t = Time.gm(2007, 1, 9, 12, 0, 0)
+      t.localtime
+      t.should == Time.local(2007, 1, 9, 6, 0, 0)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/mday_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/mday_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/mday_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+require File.dirname(__FILE__) + '/shared/day'
+
+describe "Time#mday" do
+  it_behaves_like(:time_day, :mday)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/min_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/min_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/min_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+
+describe "Time#min" do
+  it "returns the minute of the hour (0..59) for time" do
+    with_timezone("CET", 1) do
+      Time.at(0).min.should == 0
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/minus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/minus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/minus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+
+describe "Time#-" do
+  it "decrements the time by the specified amount" do
+    (Time.at(100) - 100).should == Time.at(0)
+    (Time.at(100) - Time.at(99)).should == 1.0
+    (Time.at(1.1) - 0.2).should == Time.at(0.9)
+  end
+
+  it "accepts arguments that can be coerced into Float" do
+    (obj = mock('9.5')).should_receive(:to_f).and_return(9.5)
+    (Time.at(100) - obj).should == Time.at(90.5)    
+  end
+
+  it "raises TypeError on argument that can't be coerced into Float" do
+    lambda { Time.now - Object.new }.should raise_error(TypeError)
+    lambda { Time.now - "stuff" }.should raise_error(TypeError)
+  end
+
+  it "raises TypeError on nil argument" do
+    lambda { Time.now - nil }.should raise_error(TypeError)
+  end
+
+  it "tracks microseconds" do
+    time = Time.at(0.777777)
+    time -= 0.654321
+    time.usec.should == 123456
+    time -= 0.123456
+    time.usec.should == 0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/mktime_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/mktime_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/mktime_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+require File.dirname(__FILE__) + '/shared/local'
+require File.dirname(__FILE__) + '/shared/time_params'
+
+describe "Time.mktime" do
+  it_behaves_like(:time_local, :mktime)
+  it_behaves_like(:time_params, :mktime)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/mon_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/mon_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/mon_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+require File.dirname(__FILE__) + '/shared/month'
+
+describe "Time#mon" do
+  it_behaves_like(:time_month, :mon)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/month_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/month_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/month_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+require File.dirname(__FILE__) + '/shared/month'
+
+describe "Time#month" do
+  it_behaves_like(:time_month, :month)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/now_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/now_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/now_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'

Added: MacRuby/branches/experimental/spec/frozen/core/time/plus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/plus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/plus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+
+describe "Time#+" do
+  it "increments the time by the specified amount" do
+    (Time.at(0) + 100).should == Time.at(100)
+    (Time.at(1.1) + 0.9).should == Time.at(2)
+  end
+
+  it "accepts arguments that can be coerced into Float" do
+    (obj = mock('10.5')).should_receive(:to_f).and_return(10.5)
+    (Time.at(100) + obj).should == Time.at(110.5)
+  end
+
+  it "raises TypeError on argument that can't be coerced into Float" do
+    lambda { Time.now + Object.new }.should raise_error(TypeError)
+    lambda { Time.now + "stuff" }.should raise_error(TypeError)
+  end
+
+  it "raises TypeError on Time argument" do
+    lambda { Time.now + Time.now }.should raise_error(TypeError)
+  end
+
+  it "raises TypeError on nil argument" do
+    lambda { Time.now + nil }.should raise_error(TypeError)
+  end
+
+  it "tracks microseconds" do
+    time = Time.at(0)
+    time += 0.123456
+    time.usec.should == 123456
+    time += 0.654321
+    time.usec.should == 777777
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/sec_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/sec_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/sec_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+
+describe "Time#sec" do
+  it "returns the second of the minute(0..60) for time" do
+    Time.at(0).sec.should == 0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/shared/asctime.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/shared/asctime.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/shared/asctime.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+describe :time_asctime, :shared => true do
+  it "returns a canonical string representation of time" do
+    t = Time.now
+    t.send(@method).should == t.strftime("%a %b %e %H:%M:%S %Y")
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/shared/day.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/shared/day.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/shared/day.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+describe :time_day, :shared => true do
+  it "returns the day of the month (1..n) for time" do
+    with_timezone("CET", 1) do
+      Time.at(0).send(@method).should == 1
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/shared/getgm.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/shared/getgm.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/shared/getgm.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+describe :time_getgm, :shared => true do
+  it "returns a new time which is the utc representation of time" do
+    # Testing with America/Regina here because it doesn't have DST.
+    with_timezone("CST", -6) do
+      t = Time.local(2007, 1, 9, 6, 0, 0)
+      t.send(@method).should == Time.gm(2007, 1, 9, 12, 0, 0)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/shared/gm.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/shared/gm.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/shared/gm.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+describe :time_gm, :shared => true do
+  it "creates a time based on given values, interpreted as UTC (GMT)" do
+    Time.send(@method, 2000,"jan",1,20,15,1).inspect.should == "Sat Jan 01 20:15:01 UTC 2000"
+  end
+
+  it "creates a time based on given C-style gmtime arguments, interpreted as UTC (GMT)" do
+    time = Time.send(@method, 1, 15, 20, 1, 1, 2000, :ignored, :ignored, :ignored, :ignored)
+    time.inspect.should == "Sat Jan 01 20:15:01 UTC 2000"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/shared/gmt_offset.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/shared/gmt_offset.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/shared/gmt_offset.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+describe :time_gmt_offset, :shared => true do
+  it "returns the offset in seconds between the timezone of time and UTC" do
+    with_timezone("AST", 3) do
+      Time.new.send(@method).should == 10800
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/shared/gmtime.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/shared/gmtime.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/shared/gmtime.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+describe :time_gmtime, :shared => true do
+  it "returns the utc representation of time" do
+    # Testing with America/Regina here because it doesn't have DST.
+    with_timezone("CST", -6) do
+      t = Time.local(2007, 1, 9, 6, 0, 0)
+      t.send(@method)
+      t.should == Time.gm(2007, 1, 9, 12, 0, 0)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/shared/isdst.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/shared/isdst.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/shared/isdst.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../fixtures/methods'
+
+describe :time_isdst, :shared => true do
+  it "dst? returns whether time is during daylight saving time" do
+    with_timezone("America/Los_Angeles") do
+      Time.local(2007, 9, 9, 0, 0, 0).send(@method).should == true
+      Time.local(2007, 1, 9, 0, 0, 0).send(@method).should == false
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/shared/local.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/shared/local.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/shared/local.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+describe :time_local, :shared => true do
+  it "creates a time based on given values, interpreted in the local time zone" do
+    with_timezone("PST", -8) do
+      Time.send(@method, 2000,"jan",1,20,15,1).inspect.should == "Sat Jan 01 20:15:01 -0800 2000"
+    end
+  end
+
+  it "creates a time based on given C-style gmtime arguments, interpreted in the local time zone" do
+    with_timezone("PST", -8) do
+      time = Time.send(@method, 1, 15, 20, 1, 1, 2000, :ignored, :ignored, :ignored, :ignored)
+      time.inspect.should == "Sat Jan 01 20:15:01 -0800 2000"
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/shared/month.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/shared/month.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/shared/month.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+describe :time_month, :shared => true do
+  it "returns the month of the year" do
+    Time.at(99999).send(@method).should == 1
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/shared/time_params.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/shared/time_params.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/shared/time_params.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,83 @@
+describe :time_params, :shared => true do
+  it "handles string-like second argument" do
+    Time.send(@method, 2008, "12").should  == Time.send(@method, 2008, 12)
+    Time.send(@method, 2008, "dec").should == Time.send(@method, 2008, 12)
+    (obj = mock('12')).should_receive(:to_str).and_return("12")
+    Time.send(@method, 2008, obj).should == Time.send(@method, 2008, 12)
+  end
+
+  ruby_bug "#", "1.8.6.114" do
+    # Exclude MRI 1.8.6 because it segfaults. :)
+    # But the problem is fixed in MRI repository already.
+    it "handles string-like second argument" do
+      (obj = mock('dec')).should_receive(:to_str).and_return('dec')
+      Time.send(@method, 2008, obj).should == Time.send(@method, 2008, 12)
+    end
+  end
+
+  it "handles string arguments" do
+    Time.send(@method, "2000", "1", "1" , "20", "15", "1").should == Time.send(@method, 2000, 1, 1, 20, 15, 1)
+    Time.send(@method, "1", "15", "20", "1", "1", "2000", :ignored, :ignored, :ignored, :ignored).should == Time.send(@method, 1, 15, 20, 1, 1, 2000, :ignored, :ignored, :ignored, :ignored)
+  end
+
+  it "handles float arguments" do
+    Time.send(@method, 2000.0, 1.0, 1.0, 20.0, 15.0, 1.0).should == Time.send(@method, 2000, 1, 1, 20, 15, 1)
+    Time.send(@method, 1.0, 15.0, 20.0, 1.0, 1.0, 2000.0, :ignored, :ignored, :ignored, :ignored).should == Time.send(@method, 1, 15, 20, 1, 1, 2000, :ignored, :ignored, :ignored, :ignored)
+  end
+
+  it "should accept various year ranges" do
+    Time.send(@method, 1901, 12, 31, 23, 59, 59, 0).wday.should == 2
+    Time.send(@method, 2037, 12, 31, 23, 59, 59, 0).wday.should == 4
+
+    platform_is :wordsize => 32 do
+      lambda { Time.send(@method, 1900, 12, 31, 23, 59, 59, 0) }.should raise_error(ArgumentError) # mon
+      lambda { Time.send(@method, 2038, 12, 31, 23, 59, 59, 0) }.should raise_error(ArgumentError) # mon
+    end
+
+    platform_is :wordsize => 64 do
+      Time.send(@method, 1900, 12, 31, 23, 59, 59, 0).wday.should == 1
+      Time.send(@method, 2038, 12, 31, 23, 59, 59, 0).wday.should == 5
+    end
+  end
+
+  it "throws ArgumentError for out of range values" do
+    # year-based Time.local(year (, month, day, hour, min, sec, usec))
+    # Year range only fails on 32 bit archs
+    platform_is :wordsize => 32 do
+      lambda { Time.send(@method, 1111, 12, 31, 23, 59, 59, 0) }.should raise_error(ArgumentError) # year
+    end
+    lambda { Time.send(@method, 2008, 13, 31, 23, 59, 59, 0) }.should raise_error(ArgumentError) # mon
+    lambda { Time.send(@method, 2008, 12, 32, 23, 59, 59, 0) }.should raise_error(ArgumentError) # day
+    lambda { Time.send(@method, 2008, 12, 31, 25, 59, 59, 0) }.should raise_error(ArgumentError) # hour
+    lambda { Time.send(@method, 2008, 12, 31, 23, 61, 59, 0) }.should raise_error(ArgumentError) # min
+    lambda { Time.send(@method, 2008, 12, 31, 23, 59, 61, 0) }.should raise_error(ArgumentError) # sec
+
+    # second based Time.local(sec, min, hour, day, month, year, wday, yday, isdst, tz)
+    lambda { Time.send(@method, 61, 59, 23, 31, 12, 2008, :ignored, :ignored, :ignored, :ignored) }.should raise_error(ArgumentError) # sec
+    lambda { Time.send(@method, 59, 61, 23, 31, 12, 2008, :ignored, :ignored, :ignored, :ignored) }.should raise_error(ArgumentError) # min
+    lambda { Time.send(@method, 59, 59, 25, 31, 12, 2008, :ignored, :ignored, :ignored, :ignored) }.should raise_error(ArgumentError) # hour
+    lambda { Time.send(@method, 59, 59, 23, 32, 12, 2008, :ignored, :ignored, :ignored, :ignored) }.should raise_error(ArgumentError) # day
+    lambda { Time.send(@method, 59, 59, 23, 31, 13, 2008, :ignored, :ignored, :ignored, :ignored) }.should raise_error(ArgumentError) # month
+    # Year range only fails on 32 bit archs
+    platform_is :wordsize => 32 do
+      lambda { Time.send(@method, 59, 59, 23, 31, 12, 1111, :ignored, :ignored, :ignored, :ignored) }.should raise_error(ArgumentError) # year
+    end
+  end
+
+  it "throws ArgumentError for invalid number of arguments" do
+    # Time.local only takes either 1-8, or 10 arguments
+    lambda {
+      Time.send(@method, 59, 1, 2, 3, 4, 2008, 0, 0, 0)
+    }.should raise_error(ArgumentError) # 9 go boom
+
+    # please stop using should_not raise_error... it is implied
+    Time.send(@method, 2008).wday.should == 2
+    Time.send(@method, 2008, 12).wday.should == 1
+    Time.send(@method, 2008, 12, 31).wday.should == 3
+    Time.send(@method, 2008, 12, 31, 23).wday.should == 3
+    Time.send(@method, 2008, 12, 31, 23, 59).wday.should == 3
+    Time.send(@method, 2008, 12, 31, 23, 59, 59).wday.should == 3
+    Time.send(@method, 2008, 12, 31, 23, 59, 59, 0).wday.should == 3
+    Time.send(@method, 59, 1, 2, 3, 4, 2008, :x, :x, :x, :x).wday.should == 4
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/shared/to_i.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/shared/to_i.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/shared/to_i.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+describe :time_to_i, :shared => true do
+  it "returns the value of time as an integer number of seconds since epoch" do
+    Time.at(0).send(@method).should == 0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/strftime_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/strftime_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/strftime_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,73 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+
+describe "Time#strftime" do
+  it "formats time according to the directives in the given format string" do
+    with_timezone("GMT", 0) do
+      Time.at(0).strftime("There is %M minutes in epoch").should == "There is 00 minutes in epoch"
+    end
+  end
+
+  it "supports week of year format with %U and %W" do
+    # start of the yer
+    saturday_first = Time.local(2000,1,1,14,58,42)
+    saturday_first.strftime("%U").should == "00"
+    saturday_first.strftime("%W").should == "00"
+
+    sunday_second = Time.local(2000,1,2,14,58,42)
+    sunday_second.strftime("%U").should == "01"
+    sunday_second.strftime("%W").should == "00"
+
+    monday_third = Time.local(2000,1,3,14,58,42)
+    monday_third.strftime("%U").should == "01"
+    monday_third.strftime("%W").should == "01"
+
+    sunday_9th = Time.local(2000,1,9,14,58,42)
+    sunday_9th.strftime("%U").should == "02"
+    sunday_9th.strftime("%W").should == "01"
+
+    monday_10th = Time.local(2000,1,10,14,58,42)
+    monday_10th.strftime("%U").should == "02"
+    monday_10th.strftime("%W").should == "02"
+
+    # middle of the year
+    some_sunday = Time.local(2000,8,6,4,20,00)
+    some_sunday.strftime("%U").should == "32"
+    some_sunday.strftime("%W").should == "31"
+    some_monday = Time.local(2000,8,7,4,20,00)
+    some_monday.strftime("%U").should == "32"
+    some_monday.strftime("%W").should == "32"
+
+    # end of year, and start of next one
+    saturday_30th = Time.local(2000,12,30,14,58,42)
+    saturday_30th.strftime("%U").should == "52"
+    saturday_30th.strftime("%W").should == "52"
+
+    sunday_last = Time.local(2000,12,31,14,58,42)
+    sunday_last.strftime("%U").should == "53"
+    sunday_last.strftime("%W").should == "52"
+
+    monday_first = Time.local(2001,1,1,14,58,42)
+    monday_first.strftime("%U").should == "00"
+    monday_first.strftime("%W").should == "01"
+  end
+
+  it "supports mm/dd/yy formatting with %D" do
+    now = Time.now
+    mmddyy = now.strftime('%m/%d/%y')
+    now.strftime('%D').should == mmddyy
+  end
+
+  it "supports HH:MM:SS formatting with %T" do
+    now = Time.now
+    hhmmss = now.strftime('%H:%M:%S')
+    now.strftime('%T').should == hhmmss
+  end
+
+  it "supports timezone formatting with %z" do
+    with_timezone("UTC", 0) do
+      time = Time.utc(2005, 2, 21, 17, 44, 30)
+      time.strftime("%z").should == "+0000"
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/succ_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/succ_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/succ_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+
+describe "Time#succ" do
+  it "returns a new time one second later than time" do
+    Time.at(100).succ.should == Time.at(101)
+  end
+  
+  it "returns a new instance" do
+    t1 = Time.at(100)
+    t2 = t1.succ
+    t1.object_id.should_not == t2.object_id
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/times_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/times_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/times_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'

Added: MacRuby/branches/experimental/spec/frozen/core/time/to_a_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/to_a_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/to_a_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+
+describe "Time#to_a" do
+  it "returns a 10 element array representing the deconstructed time" do
+    # Testing with America/Regina here because it doesn't have DST.
+    with_timezone("America/Regina") do
+      Time.at(0).to_a.should == [0, 0, 18, 31, 12, 1969, 3, 365, false, "CST"]
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/to_f_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/to_f_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/to_f_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+
+describe "Time#to_f" do
+  it "returns the float number of seconds + usecs since the epoch" do
+    Time.at(100, 100).to_f.should == 100.0001
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/to_i_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/to_i_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/to_i_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+require File.dirname(__FILE__) + '/shared/to_i'
+
+describe "Time#to_i" do
+  it_behaves_like(:time_to_i, :to_i)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'

Added: MacRuby/branches/experimental/spec/frozen/core/time/tv_sec_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/tv_sec_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/tv_sec_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+require File.dirname(__FILE__) + '/shared/to_i'
+
+describe "Time#tv_sec" do
+  it_behaves_like(:time_to_i, :tv_sec)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/tv_usec_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/tv_usec_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/tv_usec_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'

Added: MacRuby/branches/experimental/spec/frozen/core/time/usec_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/usec_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/usec_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+
+describe "Time#usec" do
+  it "returns the microseconds for time" do
+    Time.at(0).usec.should == 0
+    (Time.at(1.1) + 0.9).usec.should == 0
+    (Time.at(1.1) - 0.2).usec.should == 900000
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/utc_offset_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/utc_offset_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/utc_offset_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+require File.dirname(__FILE__) + '/shared/gmt_offset'
+
+describe "Time#utc_offset" do
+  it_behaves_like(:time_gmt_offset, :utc_offset)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/utc_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/utc_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/utc_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+require File.dirname(__FILE__) + '/shared/gm'
+require File.dirname(__FILE__) + '/shared/gmtime'
+require File.dirname(__FILE__) + '/shared/time_params'
+
+describe "Time#utc?" do
+  it "returns true if time represents a time in UTC (GMT)" do
+    Time.now.utc?.should == false
+  end  
+end
+
+describe "Time.utc" do
+  it_behaves_like(:time_gm, :utc)
+  it_behaves_like(:time_params, :utc)
+end
+
+describe "Time#utc" do
+  it_behaves_like(:time_gmtime, :utc)
+end  

Added: MacRuby/branches/experimental/spec/frozen/core/time/wday_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/wday_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/wday_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+
+describe "Time#wday" do
+  it "returns an integer representing the day of the week, 0..6, with Sunday being 0" do
+    with_timezone("GMT", 0) do
+      Time.at(0).wday.should == 4
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/yday_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/yday_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/yday_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+
+describe "Time#yday" do
+  it "returns an integer representing the day of the year, 1..366" do
+    with_timezone("UTC") do
+      Time.at(9999999).yday.should == 116
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/year_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/year_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/year_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+
+describe "Time#year" do
+  it "returns the four digit year for time as an integer" do
+    with_timezone("CET", 1) do
+      Time.at(0).year.should == 1970
+    end
+  end  
+end

Added: MacRuby/branches/experimental/spec/frozen/core/time/zone_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/time/zone_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/time/zone_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/methods'
+
+describe "Time#zone" do
+  it "returns the time zone used for time" do
+    # Testing with Asia/Kuwait here because it doesn't have DST.
+    with_timezone("Asia/Kuwait") do
+      Time.now.zone.should == "AST"
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/true/and_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/true/and_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/true/and_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "TrueClass#&" do
+  it "returns false if other is nil or false, otherwise true" do
+    (true & true).should == true
+    (true & false).should == false
+    (true & nil).should == false
+    (true & "").should == true
+    (true & mock('x')).should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/true/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/true/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/true/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "TrueClass#inspect" do
+  it "returns the string 'true'" do
+    true.inspect.should == "true"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/true/or_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/true/or_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/true/or_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "TrueClass#|" do
+  it "returns true" do
+    (true | true).should == true
+    (true | false).should == true
+    (true | nil).should == true
+    (true | "").should == true
+    (true | mock('x')).should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/true/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/true/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/true/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "TrueClass#to_s" do
+  it "returns the string 'true'" do
+    true.to_s.should == "true"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/true/xor_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/true/xor_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/true/xor_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "TrueClass#^" do
+  it "returns true if other is nil or false, otherwise false" do
+    (true ^ true).should == false
+    (true ^ false).should == true
+    (true ^ nil).should == true
+    (true ^ "").should == false
+    (true ^ mock('x')).should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/unboundmethod/arity_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/unboundmethod/arity_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/unboundmethod/arity_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,36 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "UnboundMethod#arity" do
+  before(:each) do
+    @um = UnboundMethodSpecs::Methods.new
+  end
+
+  it "returns the number of arguments accepted by a method, using Method#unbind" do
+    @um.method(:one).unbind.arity.should == 0
+    @um.method(:two).unbind.arity.should == 1
+    @um.method(:three).unbind.arity.should == 2
+    @um.method(:four).unbind.arity.should == 2
+  end
+
+  it "returns the number arguments accepted by a method, using Module#instance_method" do
+    UnboundMethodSpecs::Methods.instance_method(:one).arity.should == 0
+    UnboundMethodSpecs::Methods.instance_method(:two).arity.should == 1
+    UnboundMethodSpecs::Methods.instance_method(:three).arity.should == 2
+    UnboundMethodSpecs::Methods.instance_method(:four).arity.should == 2
+  end
+
+  it "if optional arguments returns the negative number of mandatory arguments, using Method#unbind" do
+    @um.method(:neg_one).unbind.arity.should == -1
+    @um.method(:neg_two).unbind.arity.should == -2
+    @um.method(:neg_three).unbind.arity.should == -3
+    @um.method(:neg_four).unbind.arity.should == -3
+  end
+
+  it "if optional arguments returns the negative number of mandatory arguments, using Module#instance_method" do
+    UnboundMethodSpecs::Methods.instance_method(:neg_one).arity.should == -1
+    UnboundMethodSpecs::Methods.instance_method(:neg_two).arity.should == -2
+    UnboundMethodSpecs::Methods.instance_method(:neg_three).arity.should == -3
+    UnboundMethodSpecs::Methods.instance_method(:neg_four).arity.should == -3
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/unboundmethod/bind_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/unboundmethod/bind_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/unboundmethod/bind_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,37 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "UnboundMethod#bind" do
+  before :each do
+    @normal_um = UnboundMethodSpecs::Methods.new.method(:foo).unbind
+    @parent_um = UnboundMethodSpecs::Parent.new.method(:foo).unbind
+    @child1_um = UnboundMethodSpecs::Child1.new.method(:foo).unbind
+    @child2_um = UnboundMethodSpecs::Child2.new.method(:foo).unbind
+  end
+
+  it "raises TypeError if object is not kind_of? the Module the method defined in" do
+    lambda { @normal_um.bind(UnboundMethodSpecs::B.new) }.should raise_error(TypeError)
+  end
+
+  it "returns Method for any object that is kind_of? the Module method was extracted from" do
+    @normal_um.bind(UnboundMethodSpecs::Methods.new).class.should == Method
+  end
+
+  deviates_on :rubinius do
+    it "returns Method for any object kind_of? the Module the method is defined in" do
+      @parent_um.bind(UnboundMethodSpecs::Child1.new).class.should == Method
+      @child1_um.bind(UnboundMethodSpecs::Parent.new).class.should == Method
+      @child2_um.bind(UnboundMethodSpecs::Child1.new).class.should == Method
+    end
+  end
+
+  it "Method returned for obj is equal to one directly returned by obj.method" do
+    obj = UnboundMethodSpecs::Methods.new
+    @normal_um.bind(obj).should == obj.method(:foo)
+  end
+
+  it "returns a callable method" do
+    obj = UnboundMethodSpecs::Methods.new
+    @normal_um.bind(obj).call.should == obj.foo
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/unboundmethod/clone_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/unboundmethod/clone_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/unboundmethod/clone_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "UnboundMethod#clone" do
+  it "returns a copy of the UnboundMethod" do
+    um1 = UnboundMethodSpecs::Methods.instance_method(:foo)
+    um2 = um1.clone
+
+    (um1 == um2).should == true
+    um1.bind(UnboundMethodSpecs::Methods.new).call.should == um2.bind(UnboundMethodSpecs::Methods.new).call
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/unboundmethod/equal_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/unboundmethod/equal_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/unboundmethod/equal_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,119 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+context "Creating UnboundMethods" do
+  specify "there is no difference between Method#unbind and Module#instance_method" do
+    UnboundMethodSpecs::Methods.instance_method(:foo).class.should == UnboundMethod
+    UnboundMethodSpecs::Methods.new.method(:foo).unbind.class.should == UnboundMethod
+  end
+end
+
+describe "UnboundMethod#==" do
+  before :all do
+    @from_module = UnboundMethodSpecs::Methods.instance_method(:foo)
+    @from_unbind = UnboundMethodSpecs::Methods.new.method(:foo).unbind
+
+    @includee = UnboundMethodSpecs::Mod.instance_method(:from_mod)
+    @includer = UnboundMethodSpecs::Methods.instance_method(:from_mod)
+
+    @alias_1 = UnboundMethodSpecs::Methods.instance_method(:alias_1)
+    @alias_2 = UnboundMethodSpecs::Methods.instance_method(:alias_2)
+
+    @original_body = UnboundMethodSpecs::Methods.instance_method(:original_body)
+    @identical_body = UnboundMethodSpecs::Methods.instance_method(:identical_body)
+
+    @parent = UnboundMethodSpecs::Parent.instance_method(:foo)
+    @child1 = UnboundMethodSpecs::Child1.instance_method(:foo)
+    @child2 = UnboundMethodSpecs::Child2.instance_method(:foo)
+
+    @child1_alt = UnboundMethodSpecs::Child1.instance_method(:foo)
+
+    @discard_1 = UnboundMethodSpecs::Methods.instance_method(:discard_1)
+    @discard_2 = UnboundMethodSpecs::Methods.instance_method(:discard_2)
+
+    @method_one = UnboundMethodSpecs::Methods.instance_method(:one)
+    @method_two = UnboundMethodSpecs::Methods.instance_method(:two)
+  end
+
+  it "returns true if objects refer to the same method" do
+    (@from_module == @from_module).should == true
+    (@from_unbind == @from_unbind).should == true
+    (@from_module == @from_unbind).should == true
+    (@from_unbind == @from_module).should == true
+  end
+
+  it "returns true if either is an alias for the other" do
+    (@from_module == @alias_1).should == true
+    (@alias_1 == @from_module).should == true
+  end
+
+  it "returns true if both are aliases for a third method" do
+    (@from_module == @alias_1).should == true
+    (@alias_1 == @from_module).should == true
+
+    (@from_module == @alias_2).should == true
+    (@alias_2 == @from_module).should == true
+
+    (@alias_1 == @alias_2).should == true
+    (@alias_2 == @alias_1).should == true
+  end
+
+  it "returns true if same method is extracted from the same subclass" do
+    (@child1 == @child1_alt).should == true
+    (@child1_alt == @child1).should == true
+  end
+
+  # See below for MRI
+  deviates_on :rubinius do
+    it "returns true if same method extracted from super- and subclass" do
+      (@parent == @child1).should == true
+      (@child1 == @parent).should == true
+    end
+
+    it "returns true if same method extracted from two different subclasses" do
+      (@child2 == @child1).should == true
+      (@child1 == @child2).should == true
+    end
+
+    it "returns true if same method and the method is defined in an included Module" do
+      (@includee == @includer).should == true
+      (@includer == @includee).should == true
+    end
+  end
+
+  it "returns false if UnboundMethods are different methods" do
+    (@method_one == @method_two).should == false
+    (@method_two == @method_one).should == false
+  end
+
+  it "returns false if both have identical body but are not the same" do
+    (@original_name == @identical_body).should == false
+    (@identical_body == @original_name).should == false
+  end
+
+  # See above for Rubinius
+  not_compliant_on :rubinius do
+    it "returns false if same method but one extracted from a subclass" do
+      (@parent == @child1).should == false
+      (@child1 == @parent).should == false
+    end
+
+    it "returns false if same method but extracted from two different subclasses" do
+      (@child2 == @child1).should == false
+      (@child1 == @child2).should == false
+    end
+
+    it "returns false if methods are the same but added from an included Module" do
+      (@includee == @includer).should == false
+      (@includer == @includee).should == false
+    end
+  end
+
+  it "returns false if both have same Module, same name, identical body but not the same" do
+    class UnboundMethodSpecs::Methods
+      def discard_1; :discard; end
+    end
+
+    (@discard_1 == UnboundMethodSpecs::Methods.instance_method(:discard_1)).should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/unboundmethod/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/unboundmethod/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/unboundmethod/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,51 @@
+module UnboundMethodSpecs
+  module Mod
+    def from_mod; end
+  end
+
+  class Methods
+    include Mod
+
+    def foo
+      true
+    end
+    alias bar foo
+    alias alias_1 foo
+    alias alias_2 foo
+
+    def original_body(); :this; end
+    def identical_body(); :this; end
+
+    def one; end
+    def two(a); end
+    def three(a, b); end
+    def four(a, b, &c); end
+
+    def neg_one(*a); end
+    def neg_two(a, *b); end
+    def neg_three(a, b, *c); end
+    def neg_four(a, b, *c, &d); end
+
+    def discard_1(); :discard; end
+    def discard_2(); :discard; end
+  end
+
+  class Parent
+    def foo; end
+  end
+
+  class Child1 < Parent; end
+  class Child2 < Parent; end
+
+  class A
+    def baz(a, b)
+      return [__FILE__, self.class]
+    end
+  end
+
+  class B < A
+  end
+
+  class C < B
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/unboundmethod/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/unboundmethod/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/unboundmethod/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + "/fixtures/classes"
+require File.dirname(__FILE__) + '/shared/to_s'
+
+describe "UnboundMethod#inspect" do
+  it_behaves_like(:unboundmethod_to_s, :inspect)
+end

Added: MacRuby/branches/experimental/spec/frozen/core/unboundmethod/shared/to_s.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/unboundmethod/shared/to_s.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/unboundmethod/shared/to_s.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require "#{File.dirname __FILE__}/../../../spec_helper"
+require "#{File.dirname __FILE__}/../fixtures/classes"
+
+describe :unboundmethod_to_s, :shared => true do
+  before :each do
+    @from_module = UnboundMethodSpecs::Methods.instance_method(:from_mod)
+    @from_method = UnboundMethodSpecs::Methods.new.method(:from_mod).unbind
+  end
+
+  it "returns a String" do
+    @from_module.send(@method).class.should == String
+    @from_method.send(@method).class.should == String
+  end
+
+  it "the String reflects that this is an UnboundMethod object" do
+    @from_module.send(@method).should =~ /\bUnboundMethod\b/
+    @from_method.send(@method).should =~ /\bUnboundMethod\b/
+  end
+
+  it "the String shows the method name, Module defined in and Module extracted from" do
+    @from_module.send(@method).should =~ /\bfrom_mod\b/
+    @from_module.send(@method).should =~ /\bUnboundMethodSpecs::Mod\b/
+    @from_method.send(@method).should =~ /\bUnboundMethodSpecs::Methods\b/
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/core/unboundmethod/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/unboundmethod/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/unboundmethod/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/to_s'
+
+describe "UnboundMethod#to_s" do
+  it_behaves_like(:unboundmethod_to_s, :to_s)
+end

Added: MacRuby/branches/experimental/spec/frozen/fixtures/class.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/class.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/class.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,101 @@
+module ClassSpecs
+  class A; end
+  
+  class B
+    @@cvar = :cvar
+    @ivar = :ivar
+  end
+  
+  class C
+    def self.make_class_variable
+      @@cvar = :cvar
+    end
+
+    def self.make_class_instance_variable
+      @civ = :civ
+    end
+  end
+  
+  class D
+    def make_class_variable
+      @@cvar = :cvar
+    end
+  end
+  
+  class E
+    def self.cmeth() :cmeth end
+    def meth() :meth end
+    
+    class << self
+      def smeth() :smeth end
+    end
+    
+    CONSTANT = :constant!
+  end
+  
+  class F; end
+  class F
+    def meth() :meth end
+  end
+  class F
+    def another() :another end
+  end
+  
+  class G
+    def override() :nothing end
+    def override() :override end
+  end
+  
+  class Container
+    class A; end
+    class B; end
+  end
+
+  O = Object.new
+  class << O
+    def smeth
+      :smeth
+    end
+  end
+  
+  class H
+    def self.inherited(sub)
+      track_inherited << sub
+    end
+    
+    def self.track_inherited
+      @inherited_modules ||= []
+    end
+  end
+  
+  class K < H; end
+  
+  class I
+    class J < self 
+    end
+  end
+
+  class K
+    def example_instance_method
+    end
+    def self.example_class_method
+    end
+  end
+
+  class L; end
+
+  class M < L; end
+end
+
+class Class
+  def example_instance_method_of_class; end
+  def self.example_class_method_of_class; end
+end
+class << Class
+  def example_instance_method_of_metaclass; end
+  def self.example_class_method_of_metaclass; end
+end
+class Object
+  def example_instance_method_of_object; end
+  def self.example_class_method_of_object; end
+end

Added: MacRuby/branches/experimental/spec/frozen/fixtures/class_variables.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/class_variables.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/class_variables.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,58 @@
+module ClassVariablesSpec
+
+  class ClassA
+    @@cvar_a = :cvar_a
+
+    def cvar_a
+      @@cvar_a 
+    end
+
+    def cvar_a=(val) 
+      @@cvar_a = val 
+    end
+  end
+
+  class ClassB < ClassA; end
+
+  # Extended in ClassC 
+  module ModuleM
+    @@cvar_m = :value
+
+    def cvar_m
+      @@cvar_m
+    end
+    
+    def cvar_m=(val)
+      @@cvar_m = val
+    end
+  end
+
+  # Extended in ModuleO
+  module ModuleN
+    @@cvar_n = :value
+
+    def cvar_n
+      @@cvar_n
+    end
+    
+    def cvar_n=(val)
+      @@cvar_n = val
+    end
+  end
+
+  module ModuleO
+    extend ModuleN
+  end
+
+  class ClassC
+    extend ModuleM
+
+    def self.cvar_defined?
+      self.class_variable_defined?(:@@cvar)
+    end
+    
+    def self.cvar_c=(val)
+      @@cvar = val
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/fixtures/constants.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/constants.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/constants.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,274 @@
+# Contains all static code examples of all constants behavior in language and
+# library specs. The specs include language/constants_spec.rb and the specs
+# for Module#const_defined?, Module#const_get, Module#const_set,
+# Module#remove_const, Module#const_missing and Module#constants.
+#
+# Rather than defining a class structure for each example, a canonical set of
+# classes is used along with numerous constants, in most cases, a unique
+# constant for each facet of behavior. This potentially leads to some
+# redundancy but hopefully the minimal redundancy that includes reasonable
+# variety in class and module configurations, including hierarchy,
+# containment, inclusion, singletons and toplevel.
+#
+# Constants are numbered for for uniqueness. The CS_ prefix is uniformly used
+# and is to minimize clashes with other toplevel constants (see e.g. ModuleA
+# which is included in Object). Constant values are symbols. A numbered suffix
+# is used to distinguish constants with the same name defined in different
+# areas (e.g. CS_CONST10 has values :const10_1, :const10_2, etc.).
+#
+# Methods are named after the constants they reference (e.g. ClassA.const10
+# references CS_CONST10). Where it is reasonable to do so, both class and
+# instance methods are defined. This is an instance of redundancy (class
+# methods should behave no differently than instance methods) but is useful
+# for ensuring compliance in implementations.
+
+
+# This constant breaks the rule of defining all constants, classes, modules
+# inside a module namespace for the particular specs, however, it is needed
+# for completeness. No other constant of this name should be defined in the
+# specs.
+CS_CONST1 = :const1   # only defined here
+
+module ConstantSpecs
+
+  # Included at toplevel
+  module ModuleA
+    CS_CONST10 = :const10_1
+    CS_CONST12 = :const12_2
+    CS_CONST13 = :const13
+    CS_CONST21 = :const21_2
+  end
+
+  # Included in ParentA
+  module ModuleB
+    CS_CONST10 = :const10_9
+    CS_CONST11 = :const11_2
+    CS_CONST12 = :const12_1
+  end
+
+  # Included in ChildA
+  module ModuleC
+    CS_CONST10 = :const10_4
+    CS_CONST15 = :const15_1
+  end
+
+  # Included in ChildA metaclass
+  module ModuleH
+    CS_CONST10 = :const10_7
+  end
+
+  # Included in ModuleD
+  module ModuleM
+    CS_CONST10 = :const10_11
+    CS_CONST24 = :const24
+  end
+
+  # Included in ContainerA
+  module ModuleD
+    include ModuleM
+
+    CS_CONST10 = :const10_8
+  end
+
+  # The following classes/modules have all the constants set "statically".
+  # Contrast with the classes below where the constants are set as the specs
+  # are run.
+
+  class ClassA
+    CS_CONST10 = :const10_10
+    CS_CONST16 = :const16
+    CS_CONST17 = :const17_2
+    CS_CONST22 = :const22_1
+
+    def self.const_missing(const)
+      const
+    end
+
+    def self.constx;  CS_CONSTX;       end
+    def self.const10; CS_CONST10;      end
+    def self.const16; ParentA.const16; end
+    def self.const22; ParentA.const22 { CS_CONST22 }; end
+
+    def const10; CS_CONST10; end
+    def constx;  CS_CONSTX;  end
+  end
+
+  class ParentA
+    include ModuleB
+
+    CS_CONST4 = :const4
+    CS_CONST10 = :const10_5
+    CS_CONST11 = :const11_1
+    CS_CONST15 = :const15_2
+    CS_CONST20 = :const20_2
+    CS_CONST21 = :const21_1
+    CS_CONST22 = :const22_2
+
+    def self.constx;  CS_CONSTX;  end
+    def self.const10; CS_CONST10; end
+    def self.const16; CS_CONST16; end
+    def self.const22; yield;      end
+
+    def const10; CS_CONST10; end
+    def constx;  CS_CONSTX;  end
+  end
+
+  class ContainerA
+    include ModuleD
+
+    CS_CONST5 = :const5
+    CS_CONST10 = :const10_2
+    CS_CONST23 = :const23
+
+    class ChildA < ParentA
+      include ModuleC
+
+      class << self
+        include ModuleH
+
+        CS_CONST10 = :const10_6
+        CS_CONST14 = :const14_1
+        CS_CONST19 = :const19_1
+
+        def const19; CS_CONST19; end
+      end
+
+      CS_CONST6 = :const6
+      CS_CONST10 = :const10_3
+      CS_CONST19 = :const19_2
+
+      def self.const10; CS_CONST10; end
+      def self.const11; CS_CONST11; end
+      def self.const12; CS_CONST12; end
+      def self.const13; CS_CONST13; end
+      def self.const15; CS_CONST15; end
+      def self.const21; CS_CONST21; end
+
+      def const10; CS_CONST10; end
+      def const11; CS_CONST11; end
+      def const12; CS_CONST12; end
+      def const13; CS_CONST13; end
+      def const15; CS_CONST15; end
+    end
+
+    def self.const10; CS_CONST10; end
+
+    def const10; CS_CONST10; end
+  end
+
+  class ContainerA::ChildA
+    def self.const23; CS_CONST23; end
+  end
+
+  class ::Object
+    CS_CONST20 = :const20_1
+
+    module ConstantSpecs
+      class ContainerA
+        class ChildA
+          def self.const20; CS_CONST20; end
+        end
+      end
+    end
+  end
+
+  # Included in ParentB
+  module ModuleE
+  end
+
+  # Included in ChildB
+  module ModuleF
+  end
+
+  # Included in ContainerB
+  module ModuleG
+  end
+
+  # The following classes/modules have the same structure as the ones above
+  # but the constants are set as the specs are run.
+
+  class ClassB
+    def self.const201; CS_CONST201; end
+    def self.const209; ParentB.const209; end
+    def self.const210; ParentB.const210 { CS_CONST210 }; end
+
+    def const201; CS_CONST201; end
+  end
+
+  class ParentB
+    include ModuleE
+
+    def self.const201; CS_CONST201; end
+    def self.const209; CS_CONST209; end
+    def self.const210; yield;       end
+
+    def const201; CS_CONST201; end
+  end
+
+  class ContainerB
+    include ModuleG
+
+    class ChildB < ParentB
+      include ModuleF
+
+      class << self
+        def const206; CS_CONST206; end
+      end
+
+      def self.const201; CS_CONST201; end
+      def self.const202; CS_CONST202; end
+      def self.const203; CS_CONST203; end
+      def self.const204; CS_CONST204; end
+      def self.const205; CS_CONST205; end
+      def self.const212; CS_CONST212; end
+      def self.const213; CS_CONST213; end
+
+      def const201; CS_CONST201; end
+      def const202; CS_CONST202; end
+      def const203; CS_CONST203; end
+      def const204; CS_CONST204; end
+      def const205; CS_CONST205; end
+      def const213; CS_CONST213; end
+    end
+
+    def self.const201; CS_CONST201; end
+  end
+
+  class ContainerB::ChildB
+    def self.const214; CS_CONST214; end
+  end
+
+  class ::Object
+    module ConstantSpecs
+      class ContainerB
+        class ChildB
+          def self.const211; CS_CONST211; end
+        end
+      end
+    end
+  end
+
+  # Constants
+  CS_CONST2 = :const2   # only defined here
+  CS_CONST17 = :const17_1
+
+  class << self
+    CS_CONST14 = :const14_2
+  end
+
+  # Singleton
+  a = ClassA.new
+  def a.const17; CS_CONST17; end
+  CS_CONST18 = a
+
+  b = ClassB.new
+  def b.const207; CS_CONST207; end
+  CS_CONST208 = b
+
+  # Methods
+  def self.get_const; self; end
+
+  def const10; CS_CONST10; end
+end
+
+include ConstantSpecs::ModuleA

Added: MacRuby/branches/experimental/spec/frozen/fixtures/load/.gitignore
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/load/.gitignore	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/load/.gitignore	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+*.rba
+*.rbc
+*.old
+*dummy*
+*dynamic*

Added: MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+$load_spec = Time.now

Added: MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec.rooby
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec.rooby	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec.rooby	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+$load_spec_rooby = Time.now

Added: MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_1.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_1.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_1.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+$load_spec_1 = Time.now

Added: MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_10.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_10.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_10.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+$load_spec_10 = Time.now

Added: MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_2.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_2.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_2.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+$load_spec_2 = Time.now

Added: MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_3.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_3.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_3.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+$load_spec_3 = Time.now

Added: MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_4.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_4.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_4.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+one = [__FILE__, __LINE__]
+
+
+
+
+
+
+
+
+two = [__FILE__, __LINE__]
+
+$load_spec_4 = [one, two]

Added: MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_5.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_5.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_5.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+$load_spec_5 ||= 0 
+$load_spec_5 += 1
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_6.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_6.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_6.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+$load_spec_6 ||= 0 
+$load_spec_6 += 1

Added: MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_7.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_7.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_7.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+$load_spec_7 ||= 1
+$load_spec_7 += 1

Added: MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_8.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_8.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_8.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+$load_spec_8 = [1197436446, 943810]

Added: MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_9.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_9.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_9.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+$load_spec_9 = Time.now

Added: MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_wrap.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_wrap.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_wrap.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+class LoadSpecWrap
+  $load_spec_wrap = Time.now
+
+  def self.lsw
+    :lsw
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_wrap2.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_wrap2.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_wrap2.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+class LoadSpecWrapTwo
+  $load_spec_wrap2 = Time.now
+
+  def self.lsw
+    :lsw
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_wrap_2.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_wrap_2.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/load/load_spec_wrap_2.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+class LoadSpecWrapTwo
+  $load_spec_wrap2 = :yep
+
+  def self.lsw
+    :lsw
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/fixtures/matrix.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/matrix.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/matrix.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+class TrivialField < Numeric
+  def eql?(rhs)
+    rhs.kind_of? TrivialField
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/fixtures/require/.gitignore
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/require/.gitignore	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/require/.gitignore	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+*.rba
+*.rbc
+*.old
+*dummy*
+*dynamic*

Added: MacRuby/branches/experimental/spec/frozen/fixtures/require/masked_require_spec_2.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/require/masked_require_spec_2.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/require/masked_require_spec_2.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+$require_spec_2 = :yep

Added: MacRuby/branches/experimental/spec/frozen/fixtures/require/masked_require_spec_3.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/require/masked_require_spec_3.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/require/masked_require_spec_3.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+$require_spec_3 = :yep

Added: MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+$require_spec = :noext

Added: MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+$require_spec = :rb

Added: MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec.rooby
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec.rooby	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec.rooby	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+$require_spec_rooby = :rooby

Added: MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec.rooby.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec.rooby.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec.rooby.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+$require_spec_rooby = :rb

Added: MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_1.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_1.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_1.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+$require_spec_1 = :yep

Added: MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_10.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_10.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_10.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+$require_spec_10 = Time.new

Added: MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_2.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_2.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_2.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+$require_spec_2 = Time.now

Added: MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_3.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_3.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_3.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+$require_spec_3 = Time.now

Added: MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_4.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_4.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_4.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+one = [__FILE__, __LINE__]
+
+
+
+
+
+
+
+
+two = [__FILE__, __LINE__]
+
+$require_spec_4 = [one, two]

Added: MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_6.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_6.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_6.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+$require_spec_6 = :yep

Added: MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_7.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_7.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_7.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+$require_spec_7 = Time.new

Added: MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_8.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_8.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_8.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+$require_spec_8 = Time.now

Added: MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_9.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_9.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_9.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+$require_spec_9 = Time.new

Added: MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_raises.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_raises.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_raises.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+runner_is_not :rspec do
+raise "no"
+end

Added: MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_recursive.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_recursive.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/fixtures/require/require_spec_recursive.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/require_spec_recursive'
+$require_spec_recursive = [1198633335, 432396]

Added: MacRuby/branches/experimental/spec/frozen/language/README
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/README	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/README	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,30 @@
+There are numerous possible way of categorizing the entities and concepts that
+make up a programming language. Ruby has a fairly large number of reserved
+words. These words significantly describe major elements of the language,
+including flow control constructs like 'for' and 'while', conditional
+execution like 'if' and 'unless', exceptional execution control like 'rescue',
+etc. There are also literals for the basic "types" like String, Regexp, Array
+and Fixnum.
+
+Behavorial specifications describe the behavior of concrete entities. Rather
+than using concepts of computation to organize these spec files, we use
+entities of the Ruby language. Consider looking at any syntactic element of a
+Ruby program. With (almost) no ambiguity, one can identify it as a literal,
+reserved word, variable, etc. There is a spec file that corresponds to each
+literal construct and most reserved words, with the exceptions noted below.
+There are also several files that are more difficult to classify: all
+predefined variables, constants, and objects (predefined_spec.rb), the
+precedence of all operators (precedence_spec.rb), the behavior of assignment
+to variables (variables_spec.rb), the behavior of subprocess execution
+(execution_spec.rb), the behavior of the raise method as it impacts the
+execution of a Ruby program (raise_spec.rb), and the block entities like
+'begin', 'do', ' { ... }' (block_spec.rb).
+
+Several reserved words and other entities are combined with the primary
+reserved word or entity to which they are related:
+
+false, true, nil, self              predefined_spec.rb
+in                                  for_spec.rb
+then, elsif                         if_spec.rb
+when                                case_spec.rb
+catch                               throw_spec.rb
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/language/alias_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/alias_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/alias_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,84 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+class AliasObject
+  attr :foo
+  attr_reader :bar
+  attr_accessor :baz
+  
+  def prep; @foo = 3; @bar = 4; end
+  def value; 5; end
+  def false_value; 6; end
+end
+
+describe "The alias keyword" do
+  before(:each) do
+    @obj = AliasObject.new
+    @meta = class << @obj;self;end
+  end
+
+  it "creates a new name for an existing method" do
+    @meta.class_eval do
+      alias __value value
+    end
+    @obj.__value.should == 5
+  end
+
+  it "adds the new method to the list of methods" do
+    original_methods = @obj.methods
+    @meta.class_eval do
+      alias __value value
+    end
+    (@obj.methods - original_methods).should == ["__value"]
+  end
+
+  it "adds the new method to the list of public methods" do
+    original_methods = @obj.public_methods
+    @meta.class_eval do
+      alias __value value
+    end
+    (@obj.public_methods - original_methods).should == ["__value"]
+  end
+
+  it "overwrites an existing method with the target name" do
+    @meta.class_eval do
+      alias false_value value
+    end
+    @obj.false_value.should == 5
+  end
+
+  it "is reversible" do
+    @meta.class_eval do
+      alias __value value
+      alias value false_value
+    end
+    @obj.value.should == 6
+
+    @meta.class_eval do
+      alias value __value
+    end
+    @obj.value.should == 5
+  end
+
+  it "operates on the object's metaclass when used in instance_eval" do
+    @obj.instance_eval do
+      alias __value value
+    end
+
+    @obj.__value.should == 5
+    lambda { AliasObject.new.__value }.should raise_error(NoMethodError)
+  end
+
+  it "operates on methods defined via attr, attr_reader, and attr_accessor" do
+    @obj.prep
+    @obj.instance_eval do
+      alias afoo foo
+      alias abar bar
+      alias abaz baz
+    end
+
+    @obj.afoo.should == 3
+    @obj.abar.should == 4
+    @obj.baz = 5
+    @obj.abaz.should == 5
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/and_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/and_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/and_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,66 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe "The '&&' statement" do
+  
+  it "short-circuits evaluation at the first condition to be false" do
+    x = nil
+    true && false && x = 1
+    x.should be_nil
+  end
+  
+  it "evalutes to the first condition not to be true" do
+    ("yes" && 1 && nil && true).should == nil
+    ("yes" && 1 && false && true).should == false
+  end
+  
+  it "evalutes to the last condition if all are true" do
+    ("yes" && 1).should == 1
+    (1 && "yes").should == "yes"
+  end
+  
+  it "evaluates the full set of chained conditions during assignment" do
+    x, y = nil
+    x = 1 && y = 2
+    # "1 && y = 2" is evaluated and then assigned to x
+    x.should == 2
+  end
+
+  it "treats empty expressions as nil" do
+    (() && true).should be_nil
+    (true && ()).should be_nil
+    (() && ()).should be_nil
+  end
+
+end
+
+describe "The 'and' statement" do
+  it "short-circuits evaluation at the first condition to be false" do
+    x = nil
+    true and false and x = 1
+    x.should be_nil
+  end
+  
+  it "evalutes to the first condition not to be true" do
+    ("yes" and 1 and nil and true).should == nil
+    ("yes" and 1 and false and true).should == false
+  end
+  
+  it "evalutes to the last condition if all are true" do
+    ("yes" and 1).should == 1
+    (1 and "yes").should == "yes"
+  end
+  
+  it "when used in assignment, evaluates and assigns expressions individually" do
+    x, y = nil
+    x = 1 and y = 2
+    # evaluates (x=1) and (y=2)
+    x.should == 1
+  end
+
+  it "treats empty expressions as nil" do
+    (() and true).should be_nil
+    (true and ()).should be_nil
+    (() and ()).should be_nil
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/language/array_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/array_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/array_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,114 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/array'
+
+describe "Array literals" do
+  it "[] should return a new array populated with the given elements" do
+    array = [1, 'a', nil]
+    array.class.should == Array
+    array[0].should == 1
+    array[1].should == 'a'
+    array[2].should == nil
+  end
+
+  it "[] treats empty expressions as nil elements" do
+    array = [0, (), 2, (), 4]
+    array.should be_kind_of(Array)
+    array[0].should == 0
+    array[1].should == nil
+    array[2].should == 2
+    array[3].should == nil
+    array[4].should == 4
+  end
+
+  it "[] accepts a literal hash without curly braces as its only parameter" do
+    ["foo" => :bar, :baz => 42].should == [{"foo" => :bar, :baz => 42}]
+  end
+end
+
+describe "Bareword array literal" do
+  it "%w() transforms unquoted barewords into an array" do
+    a = 3
+    %w(a #{3+a} 3).should == ["a", '#{3+a}', "3"]
+  end
+
+  it "%W() transforms unquoted barewords into an array, supporting interpolation" do
+    a = 3
+    %W(a #{3+a} 3).should == ["a", '6', "3"]
+  end
+
+  it "%W() always treats interpolated expressions as a single word" do
+    a = "hello world"
+    %W(a b c #{a} d e).should == ["a", "b", "c", "hello world", "d", "e"]
+  end
+
+  it "treats consecutive whitespace characters the same as one" do
+    %w(a  b c  d).should == ["a", "b", "c", "d"]
+    %W(hello
+       world).should == ["hello", "world"]
+  end
+
+  it "treats whitespace as literals characters when escaped by a backslash" do
+    %w(a b\ c d e).should == ["a", "b c", "d", "e"]
+    %w(a b\
+c d).should == ["a", "b\nc", "d"]
+    %W(a\  b\tc).should == ["a ", "b\tc"]
+    %W(white\  \  \ \  \ space).should == ["white ", " ", "  ", " space"]
+  end
+end
+
+describe "The unpacking splat operator (*)" do
+  it "when applied to a literal nested array, unpacks its elements into the containing array" do
+    [1, 2, *[3, 4, 5]].should == [1, 2, 3, 4, 5]
+  end
+
+  it "when applied to a nested referenced array, unpacks its elements into the containing array" do
+    splatted_array = [3, 4, 5]
+    [1, 2, *splatted_array].should == [1, 2, 3, 4, 5]
+  end
+
+  it "when applied to a value with no other items in the containing array, coerces the passed value to an array and returns it unchanged" do
+    splatted_array = [3, 4, 5]
+    [*splatted_array].should equal(splatted_array)
+  end
+
+  it "unpacks the start and count arguments in an array slice assignment" do
+    alphabet_1 = ['a'..'z'].to_a
+    alphabet_2 = alphabet_1.dup
+    start_and_count_args = [1, 10]
+
+    alphabet_1[1, 10] = 'a'
+    alphabet_2[*start_and_count_args] = 'a'
+
+    alphabet_1.should == alphabet_2
+  end
+
+  it "unpacks arguments as if they were listed statically" do
+    static = [1,2,3,4]
+    receiver = static.dup
+    args = [0,1]
+    static[0,1] = []
+    static.should == [2,3,4]
+    receiver[*args] = []
+    receiver.should == static
+  end
+
+  it "unpacks a literal array into arguments in a method call" do
+    tester = ArraySpec::Splat.new
+    tester.unpack_3args(*[1, 2, 3]).should == [1, 2, 3]
+    tester.unpack_4args(1, 2, *[3, 4]).should == [1, 2, 3, 4]
+    tester.unpack_4args("a", %w(b c), *%w(d e)).should == ["a", ["b", "c"], "d", "e"]
+  end
+
+  it "unpacks a referenced array into arguments in a method call" do
+    args = [1, 2, 3]
+    tester = ArraySpec::Splat.new
+    tester.unpack_3args(*args).should == [1, 2, 3]
+    tester.unpack_4args(0, *args).should == [0, 1, 2, 3]
+  end
+end
+
+describe "The packing splat operator (*)" do
+  
+end
+
+language_version __FILE__, "array"

Added: MacRuby/branches/experimental/spec/frozen/language/block_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/block_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/block_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,77 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/block'
+
+describe "A block with a 'rest' arg" do
+  it "collects all of the arguments passed to yield" do
+    ret = nil
+    BlockSpecs::Yield.new.splat(1,2,3) {|*args| ret = args}
+    ret.should == [1,2,3]
+  end
+end
+
+describe "A block with an anonymous 'rest' arg" do
+  it "ignores all of the arguments passed to yield" do
+    ret = [1].each {|*| }
+    ret.should == [1]
+  end
+end
+
+describe "Block parameters" do
+  it "assign to local variable" do
+    i = 0
+    a = [1,2,3]
+    a.each {|i| ;}
+    i.should == 3
+  end
+
+  it "captures variables from the outer scope" do
+    a = [1,2,3]
+    sum = 0
+    var = nil
+    a.each {|var| sum += var}
+    sum.should == 6
+    var.should == 3
+  end
+end
+
+describe "A block whose arguments are splatted" do
+  it "captures the arguments passed to the block in an array" do
+    a = []
+    BlockSpecs::Yield.new.two_args { |*args| a << args }
+    a.should == [[1, 2]]
+  end
+
+  it "captures the array passed to the block in an array" do
+    a = []
+    BlockSpecs::Yield.new.two_arg_array { |*args| a << args }
+    a.should == [[[1, 2]]]
+  end
+
+  it "yields the correct arguments in a nested block" do
+    a = []
+    BlockSpecs::Yield.new.yield_splat_inside_block {|a1, a2| a << [a1, a2]}
+    a.should == [[1, 0], [2, 1]]
+  end
+end
+
+describe "Block parameters (to be removed from MRI)" do
+  it "assigns to a global variable" do
+    $global_for_block_assignment = 0
+    a = [1,2,3]
+    a.each {|$global_for_block_assignment| ;}
+    $global_for_block_assignment.should == 3
+  end
+
+  it "calls method=" do
+    class T
+      def n; return @n; end
+      def n=(val); @n = val + 1; end
+      def initialize; @n = 0; end
+    end
+    t = T.new
+    t.n.should == 0
+    a = [1,2,3]
+    a.each {|t.n| }
+    t.n.should == 4
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/break_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/break_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/break_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,220 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe "The break statement" do
+  it "raises a LocalJumpError if used not within block or while/for loop" do
+    def x; break; end
+    lambda { x }.should raise_error(LocalJumpError)
+  end
+
+  it "ends block execution if used whithin block" do
+    a = []
+    lambda {
+      a << 1
+      break
+      a << 2
+    }.call
+    a.should == [1]
+  end
+
+  it "causes block to return value passed to break" do
+    lambda { break 123; 456 }.call.should == 123
+  end
+
+  it "causes block to return nil if an empty expression passed to break" do
+    lambda { break (); 456 }.call.should be_nil
+  end
+
+  it "causes block to return nil if no value passed to break" do
+    lambda { break; 456 }.call.should == nil
+  end
+end
+
+describe "Executing break from within a block" do
+  it "returns from the invoking singleton method" do
+    obj = Object.new
+    def obj.meth_with_block
+      yield
+      fail("break didn't break from the singleton method")
+    end
+    obj.meth_with_block { break :value }.should == :value
+  end
+
+  it "returns from the invoking method with the argument to break" do
+    class BreakTest
+      def self.meth_with_block
+        yield
+        fail("break didn't break from the method")
+      end
+    end
+    BreakTest.meth_with_block { break :value }.should == :value
+  end
+
+  # Discovered in JRuby (see JRUBY-2756)
+  it "returns from the original invoking method even in case of chained calls" do
+    class BreakTest
+      # case #1: yield
+      def self.meth_with_yield(&b)
+        yield
+        fail("break returned from yield to wrong place")
+      end
+      def self.invoking_method(&b)
+        meth_with_yield(&b)
+        fail("break returned from 'meth_with_yield' method to wrong place")
+      end
+
+      # case #2: block.call
+      def self.meth_with_block_call(&b)
+        b.call
+        fail("break returned from b.call to wrong place")
+      end
+      def self.invoking_method2(&b)
+        meth_with_block_call(&b)
+        fail("break returned from 'meth_with_block_call' method to wrong place")
+      end
+    end
+
+    # this calls a method that calls another method that yields to the block
+    BreakTest.invoking_method do
+      break
+      fail("break didn't, well, break")
+    end
+
+    # this calls a method that calls another method that calls the block
+    BreakTest.invoking_method2 do
+      break
+      fail("break didn't, well, break")
+    end
+
+    res = BreakTest.invoking_method do
+      break :return_value
+      fail("break didn't, well, break")
+    end
+    res.should == :return_value
+
+    res = BreakTest.invoking_method2 do
+      break :return_value
+      fail("break didn't, well, break")
+    end
+    res.should == :return_value
+
+  end
+end
+
+describe "Breaking out of a loop with a value" do
+
+  it "assigns objects" do
+    a = loop do break; end;          a.should == nil
+    a = loop do break nil; end;      a.should == nil
+    a = loop do break 1; end;        a.should == 1
+    a = loop do break []; end;       a.should == []
+    a = loop do break [1]; end;      a.should == [1]
+    a = loop do break [nil]; end;    a.should == [nil]
+    a = loop do break [[]]; end;     a.should == [[]]
+    a = loop do break [*[]]; end;    a.should == []
+    a = loop do break [*[1]]; end;   a.should == [1]
+    a = loop do break [*[1,2]]; end; a.should == [1,2]
+  end
+
+  it "assigns splatted objects" do
+    a = loop do break *nil; end;      a.should == nil
+    a = loop do break *1; end;        a.should == 1
+    a = loop do break *[]; end;       a.should == nil
+    a = loop do break *[1]; end;      a.should == 1
+    a = loop do break *[nil]; end;    a.should == nil
+    a = loop do break *[[]]; end;     a.should == []
+    a = loop do break *[*[]]; end;    a.should == nil
+    a = loop do break *[1]; end;      a.should == 1
+    a = loop do break *[*[1]]; end;   a.should == 1
+    a = loop do break *[1,2]; end;    a.should == [1,2]
+    a = loop do break *[*[1,2]]; end; a.should == [1,2]
+  end
+
+  it "assigns to a splatted reference" do
+    *a = loop do break; end;          a.should == [nil]
+    *a = loop do break nil; end;      a.should == [nil]
+    *a = loop do break 1; end;        a.should == [1]
+    *a = loop do break []; end;       a.should == [[]]
+    *a = loop do break [1]; end;      a.should == [[1]]
+    *a = loop do break [nil]; end;    a.should == [[nil]]
+    *a = loop do break [[]]; end;     a.should == [[[]]]
+    *a = loop do break [1,2]; end;    a.should == [[1,2]]
+    *a = loop do break [*[]]; end;    a.should == [[]]
+    *a = loop do break [*[1]]; end;   a.should == [[1]]
+    *a = loop do break [*[1,2]]; end; a.should == [[1,2]]
+  end
+
+  it "assigns splatted objects to a splatted reference" do
+    *a = loop do break *nil; end;      a.should == [nil]
+    *a = loop do break *1; end;        a.should == [1]
+    *a = loop do break *[]; end;       a.should == [nil]
+    *a = loop do break *[1]; end;      a.should == [1]
+    *a = loop do break *[nil]; end;    a.should == [nil]
+    *a = loop do break *[[]]; end;     a.should == [[]]
+    *a = loop do break *[1,2]; end;    a.should == [[1,2]]
+    *a = loop do break *[*[]]; end;    a.should == [nil]
+    *a = loop do break *[*[1]]; end;   a.should == [1]
+    *a = loop do break *[*[1,2]]; end; a.should == [[1,2]]
+  end
+
+  it "assigns splatted objects to a splatted reference from a splatted loop" do
+    *a = *loop do break *nil; end;      a.should == [nil]
+    *a = *loop do break *1; end;        a.should == [1]
+    *a = *loop do break *[]; end;       a.should == [nil]
+    *a = *loop do break *[1]; end;      a.should == [1]
+    *a = *loop do break *[nil]; end;    a.should == [nil]
+    *a = *loop do break *[[]]; end;     a.should == []
+    *a = *loop do break *[1,2]; end;    a.should == [1,2]
+    *a = *loop do break *[*[]]; end;    a.should == [nil]
+    *a = *loop do break *[*[1]]; end;   a.should == [1]
+    *a = *loop do break *[*[1,2]]; end; a.should == [1,2]
+  end
+
+  it "assigns objects to multiple block variables" do
+    a,b,*c = loop do break; end;          [a,b,c].should == [nil,nil,[]]
+    a,b,*c = loop do break nil; end;      [a,b,c].should == [nil,nil,[]]
+    a,b,*c = loop do break 1; end;        [a,b,c].should == [1,nil,[]]
+    a,b,*c = loop do break []; end;       [a,b,c].should == [nil,nil,[]]
+    a,b,*c = loop do break [1]; end;      [a,b,c].should == [1,nil,[]]
+    a,b,*c = loop do break [nil]; end;    [a,b,c].should == [nil,nil,[]]
+    a,b,*c = loop do break [[]]; end;     [a,b,c].should == [[],nil,[]]
+    a,b,*c = loop do break [1,2]; end;    [a,b,c].should == [1,2,[]]
+    a,b,*c = loop do break [*[]]; end;    [a,b,c].should == [nil,nil,[]]
+    a,b,*c = loop do break [*[1]]; end;   [a,b,c].should == [1,nil,[]]
+    a,b,*c = loop do break [*[1,2]]; end; [a,b,c].should == [1,2,[]]
+  end
+
+  it "assigns splatted objects to multiple block variables" do
+    a,b,*c = loop do break *nil; end;      [a,b,c].should == [nil,nil,[]]
+    a,b,*c = loop do break *1; end;        [a,b,c].should == [1,nil,[]]
+    a,b,*c = loop do break *[]; end;       [a,b,c].should == [nil,nil,[]]
+    a,b,*c = loop do break *[1]; end;      [a,b,c].should == [1,nil,[]]
+    a,b,*c = loop do break *[nil]; end;    [a,b,c].should == [nil,nil,[]]
+    a,b,*c = loop do break *[[]]; end;     [a,b,c].should == [nil,nil,[]]
+    a,b,*c = loop do break *[1,2]; end;    [a,b,c].should == [1,2,[]]
+    a,b,*c = loop do break *[*[]]; end;    [a,b,c].should == [nil,nil,[]]
+    a,b,*c = loop do break *[*[1]]; end;   [a,b,c].should == [1,nil,[]]
+    a,b,*c = loop do break *[*[1,2]]; end; [a,b,c].should == [1,2,[]]
+  end
+
+  it "stops any loop type at the correct spot" do
+    i = 0; loop do break i if i == 2; i+=1; end.should == 2
+    i = 0; loop do break if i == 3; i+=1; end; i.should == 3
+    i = 0; 0.upto(5) {|i| break i if i == 2 }.should == 2
+    i = 0; 0.upto(5) {|i| break if i == 3 }; i.should == 3
+    i = 0; while (i < 5) do break i if i == 2 ; i+=1; end.should == 2
+    i = 0; while (i < 5) do break if i == 3 ; i+=1; end; i.should == 3
+  end
+
+  it "stops a yielded method at the correct spot" do
+    def break_test()
+      yield 1
+      yield 2
+      yield 3
+    end
+    break_test {|i| break i if i == 2 }.should == 2
+    i = 0
+    break_test {|i| break i if i == 1 }
+    i.should == 1
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/language/case_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/case_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/case_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,309 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe "The 'case'-construct" do
+  it "evaluates the body of the when clause matching the case target expression" do
+    case 1
+      when 2: false
+      when 1: true
+    end.should == true
+  end
+
+  it "evaluates the body of the when clause whose array expression includes the case target expression" do
+    case 2
+      when 3, 4: false
+      when 1, 2: true
+    end.should == true
+  end
+
+  it "evaluates the body of the when clause whose range expression includes the case target expression" do
+    case 5
+      when 21..30: false
+      when 1..20: true
+    end.should == true
+  end
+
+  it "returns nil when no 'then'-bodies are given" do
+    case "a"
+      when "a"
+      when "b"
+    end.should == nil
+  end
+  
+  it "evaluates the 'else'-body when no other expression matches" do
+    case "c"
+      when "a": 'foo'
+      when "b": 'bar'
+      else 'zzz'
+    end.should == 'zzz'
+  end
+  
+  it "returns nil when no expression matches and 'else'-body is empty" do
+    case "c"
+      when "a": "a"
+      when "b": "b"
+      else
+    end.should == nil
+  end
+
+  it "returns 2 when a then body is empty" do
+    case Object.new
+    when Numeric then
+      1
+    when String then
+      # ok
+    else
+      2
+    end.should == 2
+  end
+
+  it "returns the statement following ':'" do
+    case "a"
+      when "a": 'foo'
+      when "b": 'bar'
+    end.should == 'foo'
+  end
+    
+  it "returns the statement following 'then'" do
+    case "a"
+      when "a" then 'foo'
+      when "b" then 'bar'
+    end.should == 'foo'
+  end
+    
+  it "allows mixing ':' and 'then'" do
+    case "b"
+      when "a": 'foo'
+      when "b" then 'bar'
+    end.should == 'bar'
+  end
+    
+  it "tests classes with case equality" do
+    case "a"
+      when String
+        'foo'
+      when Symbol
+        'bar'
+    end.should == 'foo'
+  end
+  
+  it "tests with matching regexps" do
+    case "hello"
+      when /abc/: false
+      when /^hell/: true
+    end.should == true
+  end
+  
+  it "does not test with equality when given classes" do
+    case :symbol.class
+      when Symbol
+        "bar"
+      when String
+        "bar"
+      else
+        "foo"
+    end.should == "foo"
+  end
+  
+  it "takes lists of values" do
+    case 'z'
+      when 'a', 'b', 'c', 'd'
+        "foo" 
+      when 'x', 'y', 'z'
+        "bar" 
+    end.should == "bar"
+
+    case 'b'
+      when 'a', 'b', 'c', 'd'
+        "foo" 
+      when 'x', 'y', 'z'
+        "bar" 
+    end.should == "foo"
+  end
+  
+  it "expands arrays to lists of values" do
+    case 'z'
+      when *['a', 'b', 'c', 'd']
+        "foo" 
+      when *['x', 'y', 'z']
+        "bar" 
+    end.should == "bar"
+  end
+
+  it "takes an expanded array in addition to a list of values" do
+    case 'f'
+      when 'f', *['a', 'b', 'c', 'd']
+        "foo" 
+      when *['x', 'y', 'z']
+        "bar" 
+    end.should == "foo"
+
+    case 'b'
+      when 'f', *['a', 'b', 'c', 'd']
+        "foo" 
+      when *['x', 'y', 'z']
+        "bar" 
+    end.should == "foo"
+  end
+
+  it "concats arrays before expanding them" do
+    a = ['a', 'b', 'c', 'd']
+    b = ['f']
+  
+    case 'f'
+      when 'f', *a|b
+        "foo" 
+      when *['x', 'y', 'z']
+        "bar" 
+    end.should == "foo"
+  end
+  
+  it "never matches when clauses with no values" do
+    case nil
+      when *[]
+        "foo"
+    end.should == nil
+  end
+  
+  it "lets you define a method after the case statement" do
+    case (def foo; 'foo'; end; 'f')
+      when 'a'
+        'foo'
+      when 'f'
+        'bar'
+    end.should == 'bar'
+  end
+  
+  it "raises a SyntaxError when 'else' is used when no 'when' is given" do
+    lambda {
+      eval <<-CODE
+      case 4
+        else
+          true
+      end
+      CODE
+    }.should raise_error(SyntaxError)
+  end
+
+  it "raises a SyntaxError when 'else' is used before a 'when' was given" do
+    lambda {
+      eval <<-CODE
+      case 4
+        else
+          true
+        when 4: false
+      end
+      CODE
+    }.should raise_error(SyntaxError)
+  end
+
+  it "supports nested case statements" do
+    result = false
+    case :x
+    when Symbol
+      case :y
+      when Symbol
+        result = true
+      end
+    end
+    result.should == true
+  end
+
+  it "supports nested case statements followed by a when with a splatted array" do
+    result = false
+    case :x
+    when Symbol
+      case :y
+      when Symbol
+        result = true
+      end
+    when *[Symbol]
+      result = false
+    end
+    result.should == true
+  end
+
+  it "supports nested case statements followed by a when with a splatted non-array" do
+    result = false
+    case :x
+    when Symbol
+      case :y
+      when Symbol
+        result = true
+      end
+    when *Symbol
+      result = false
+    end
+    result.should == true
+  end
+
+  it "works even if there's only one when statement" do
+    case 1
+    when 1
+      100
+    end.should == 100
+  end
+end
+
+describe "The 'case'-construct with no target expression" do
+  it "evaluates the body of the first clause when at least one of its condition expressions is true" do
+      case
+        when true, false: 'foo'
+      end.should == 'foo'
+    end
+    
+  it "evaluates the body of the first when clause that is not false/nil" do
+    case
+      when false: 'foo'
+      when 2: 'bar'
+      when 1 == 1: 'baz'
+    end.should == 'bar'
+  
+    case
+      when false: 'foo'
+      when nil: 'foo'
+      when 1 == 1: 'bar'
+    end.should == 'bar'
+  end
+      
+  it "evaluates the body of the else clause if all when clauses are false/nil" do
+    case
+      when false: 'foo'
+      when nil: 'foo'
+      when 1 == 2: 'bar'
+      else 'baz'
+    end.should == 'baz'
+  end
+  
+  it "evaluates multiple conditional expressions as a boolean disjunction" do
+    case
+      when true, false: 'foo'
+      else 'bar'
+    end.should == 'foo'
+
+    case
+      when false, true: 'foo'
+      else 'bar'
+    end.should == 'foo'
+  end
+
+  it "evaluates true as only 'true' when true is the first clause" do
+    case 1
+      when true; "bad"
+      when Integer; "good"
+    end.should == "good"
+  end
+
+  it "evaluates false as only 'false' when false is the first clause" do
+    case nil
+      when false; "bad"
+      when nil; "good"
+    end.should == "good"
+  end
+
+  it "treats a literal array as its own when argument, rather than a list of arguments" do
+    case 'foo'
+    when ['foo', 'foo']; 'bad'
+    when 'foo'; 'good'
+    end.should == 'good'
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/catch_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/catch_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/catch_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,56 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe "The catch keyword" do  
+  it "only allows symbols and strings" do
+    lambda { catch(:foo) {} }.should_not raise_error
+    lambda { catch("foo") {} }.should_not raise_error
+    lambda { catch 1 }.should raise_error(ArgumentError)    
+    lambda { catch Object.new }.should raise_error(TypeError)    
+  end
+
+  it "returns the last value of the block if it nothing is thrown" do
+    catch(:exit) do      
+      :noexit
+    end.should == :noexit
+  end
+  
+  it "matches strings as symbols" do
+    lambda { catch("exit") { throw :exit } }.should_not raise_error
+    lambda { catch("exit") { throw "exit" } }.should_not raise_error
+  end
+
+  it "requires a block" do
+    lambda { catch :foo }.should raise_error(LocalJumpError)
+  end
+
+  it "supports nesting" do
+    i = []
+    catch(:exita) do
+      i << :a
+      catch(:exitb) do
+        i << :b
+        throw :exita
+        i << :after_throw
+      end
+      i << :b_exit
+    end
+    i << :a_exit
+
+    i.should == [:a,:b,:a_exit]
+  end
+
+  it "supports nesting with the same name" do
+    i = []
+    catch(:exit) do
+      i << :a
+      catch(:exit) do
+        i << :b
+        throw :exit,:msg
+      end.should == :msg
+      i << :b_exit
+    end.should == [:a,:b,:b_exit]
+    i << :a_exit
+
+    i.should == [:a,:b,:b_exit,:a_exit]
+  end  
+end

Added: MacRuby/branches/experimental/spec/frozen/language/class_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/class_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/class_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,168 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/class'
+
+ClassSpecsNumber = 12
+
+module ClassSpecs
+  Number = 12
+end
+
+describe "A class definition" do
+  it "creates a new class" do
+    ClassSpecs::A.class.should == Class
+    ClassSpecs::A.new.class.should == ClassSpecs::A
+  end
+  
+  it "has no class variables" do
+    ClassSpecs::A.class_variables.should == []
+  end
+
+  it "raises TypeError if constant given as class name exists and is not a Module" do
+    lambda {
+      class ClassSpecsNumber
+      end
+    }.should raise_error(TypeError)
+  end
+
+  # test case known to be detecting bugs (JRuby, MRI 1.9)
+  it "raises TypeError if the constant qualifying the class is nil" do
+    lambda {
+      class nil::Foo
+      end
+    }.should raise_error(TypeError)
+  end
+
+  it "raises TypeError if any constant qualifying the class is not a Module" do
+    lambda {
+      class ClassSpecs::Number::MyClass
+      end
+    }.should raise_error(TypeError)
+
+    lambda {
+      class ClassSpecsNumber::MyClass
+      end
+    }.should raise_error(TypeError)
+  end
+  
+  it "allows using self as the superclass iff self is a class" do
+    ClassSpecs::I::J.superclass.should == ClassSpecs::I
+    
+    lambda {
+      class ShouldNotWork < self; end
+    }.should raise_error(TypeError)
+  end
+  
+#  # I do not think this is a valid spec   -- rue
+#  it "has no class-level instance variables" do
+#    ClassSpecs::A.instance_variables.should == []
+#  end
+
+  it "allows the declaration of class variables in the body" do
+    ClassSpecs::B.class_variables.should == ["@@cvar"]
+    ClassSpecs::B.send(:class_variable_get, :@@cvar).should == :cvar
+  end
+  
+  it "stores instance variables defined in the class body in the class object" do
+    ClassSpecs::B.instance_variables.include?("@ivar").should == true
+    ClassSpecs::B.instance_variable_get(:@ivar).should == :ivar
+  end
+
+  it "allows the declaration of class variables in a class method" do
+    ClassSpecs::C.class_variables.should == []
+    ClassSpecs::C.make_class_variable
+    ClassSpecs::C.class_variables.should == ["@@cvar"]
+  end
+
+  it "allows the definition of class-level instance variables in a class method" do
+    ClassSpecs::C.instance_variables.include?("@civ").should == false
+    ClassSpecs::C.make_class_instance_variable
+    ClassSpecs::C.instance_variables.include?("@civ").should == true
+  end
+  
+  it "allows the declaration of class variables in an instance method" do
+    ClassSpecs::D.class_variables.should == []
+    ClassSpecs::D.new.make_class_variable
+    ClassSpecs::D.class_variables.should == ["@@cvar"]
+  end
+  
+  it "allows the definition of instance methods" do
+    ClassSpecs::E.new.meth.should == :meth
+  end
+  
+  it "allows the definition of class methods" do
+    ClassSpecs::E.cmeth.should == :cmeth
+  end
+  
+  it "allows the definition of class methods using class << self" do
+    ClassSpecs::E.smeth.should == :smeth
+  end
+  
+  it "allows the definition of Constants" do
+    Object.const_defined?('CONSTANT').should == false
+    ClassSpecs::E.const_defined?('CONSTANT').should == true
+    ClassSpecs::E::CONSTANT.should == :constant!
+  end
+  
+  it "returns the value of the last statement in the body" do
+    class ClassSpecs::Empty; end.should == nil
+    class ClassSpecs::Twenty; 20; end.should == 20
+    class ClassSpecs::Plus; 10 + 20; end.should == 30
+    class ClassSpecs::Singleton; class << self; :singleton; end; end.should == :singleton
+  end
+end
+
+describe "An outer class definition" do
+  it "contains the inner classes" do
+    ClassSpecs::Container.constants.should include('A', 'B')
+  end
+end
+
+describe "A Class Definitions extending an object" do
+  it "allows adding methods" do
+    ClassSpecs::O.smeth.should == :smeth
+  end
+  
+  it "raises a TypeError when trying to extend numbers" do
+    lambda {
+      eval <<-CODE
+        class << 1
+          def xyz
+            self
+          end
+        end
+      CODE
+    }.should raise_error(TypeError)
+  end
+end
+
+describe "Reopening a class" do
+  it "extends the previous definitions" do
+    c = ClassSpecs::F.new
+    c.meth.should == :meth
+    c.another.should == :another
+  end
+  
+  it "overwrites existing methods" do
+    ClassSpecs::G.new.override.should == :override
+  end
+  
+  it "raises a TypeError when superclasses mismatch" do
+    lambda { class ClassSpecs::A < Array; end }.should raise_error(TypeError)
+  end
+
+  it "adds new methods to subclasses" do
+    lambda { ClassSpecs::M.m }.should raise_error(NoMethodError)
+    class ClassSpecs::L
+      def self.m
+        1
+      end
+    end
+    ClassSpecs::M.m.should == 1
+  end  
+end
+
+describe "class provides hooks" do
+  it "calls inherited when a class is created" do
+    ClassSpecs::H.track_inherited.should == [ClassSpecs::K]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/class_variable_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/class_variable_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/class_variable_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,56 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/class_variables'
+
+describe "A class variable" do
+  it "can be accessed from a subclass" do
+    ClassVariablesSpec::ClassB.new.cvar_a.should == :cvar_a
+  end
+
+  it "is set in the superclass" do
+    a = ClassVariablesSpec::ClassA.new
+    b = ClassVariablesSpec::ClassB.new
+    b.cvar_a = :new_val
+
+    a.cvar_a.should == :new_val
+  end
+end
+
+describe "A class variable defined in a module" do
+  it "can be accessed from classes that extend the module" do
+    ClassVariablesSpec::ClassC.cvar_m.should == :value
+  end
+
+  it "is not defined in these classes" do
+    ClassVariablesSpec::ClassC.cvar_defined?.should be_false
+  end
+  
+  it "is only updated in the module a method defined in the module is used" do
+    ClassVariablesSpec::ClassC.cvar_m = "new value"
+    ClassVariablesSpec::ClassC.cvar_m.should == "new value"
+    
+    ClassVariablesSpec::ClassC.cvar_defined?.should be_false
+  end
+  
+  it "is updated in the class when a Method defined in the class is used" do
+    ClassVariablesSpec::ClassC.cvar_c = "new value"    
+    ClassVariablesSpec::ClassC.cvar_defined?.should be_true
+  end
+
+  it "can be accessed inside the class using the module methods" do
+    ClassVariablesSpec::ClassC.cvar_c = "new value"
+
+    ClassVariablesSpec::ClassC.cvar_m.should == "new value"
+  end
+
+  it "can be accessed from modules that extend the module" do
+    ClassVariablesSpec::ModuleO.cvar_n.should == :value
+  end
+
+  it "is defined in the extended module" do
+    ClassVariablesSpec::ModuleN.class_variable_defined?(:@@cvar_n).should be_true
+  end
+
+  it "is not defined in the extending module" do
+    ClassVariablesSpec::ModuleO.class_variable_defined?(:@@cvar_n).should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/constants_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/constants_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/constants_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,328 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/constants'
+
+# Read the documentation in fixtures/constants.rb for the guidelines and
+# rationale for the structure and organization of these specs.
+
+describe "Literal (A::X) constant resolution" do
+  describe "with statically assigned constants" do
+    it "searches the immediate class or module scope first" do
+      ConstantSpecs::ClassA::CS_CONST10.should == :const10_10
+      ConstantSpecs::ModuleA::CS_CONST10.should == :const10_1
+      ConstantSpecs::ParentA::CS_CONST10.should == :const10_5
+      ConstantSpecs::ContainerA::CS_CONST10.should == :const10_2
+      ConstantSpecs::ContainerA::ChildA::CS_CONST10.should == :const10_3
+    end
+
+    it "searches a module included in the immediate class before the superclass" do
+      ConstantSpecs::ContainerA::ChildA::CS_CONST15.should == :const15_1
+    end
+
+    it "searches the superclass before a module included in the superclass" do
+      ConstantSpecs::ContainerA::ChildA::CS_CONST11.should == :const11_1
+    end
+
+    it "searches a module included in the superclass" do
+      ConstantSpecs::ContainerA::ChildA::CS_CONST12.should == :const12_1
+    end
+
+    it "searches the superclass chain" do
+      ConstantSpecs::ContainerA::ChildA::CS_CONST13.should == :const13
+    end
+
+    it "searches Object if no class or module qualifier is given" do
+      CS_CONST1.should == :const1
+      CS_CONST10.should == :const10_1
+    end
+
+    it "searches Object if a toplevel qualifier (::X) is given" do
+      ::CS_CONST1.should == :const1
+      ::CS_CONST10.should == :const10_1
+    end
+
+    it "does not search the singleton class of the class or module" do
+      lambda do
+        ConstantSpecs::ContainerA::ChildA::CS_CONST14
+      end.should raise_error(NameError)
+      lambda { ConstantSpecs::CS_CONST14 }.should raise_error(NameError)
+    end
+  end
+
+  describe "with dynamically assigned constants" do
+    it "searches the immediate class or module scope first" do
+      ConstantSpecs::ClassB::CS_CONST101 = :const101_1
+      ConstantSpecs::ClassB::CS_CONST101.should == :const101_1
+
+      ConstantSpecs::ParentB::CS_CONST101 = :const101_2
+      ConstantSpecs::ParentB::CS_CONST101.should == :const101_2
+
+      ConstantSpecs::ContainerB::CS_CONST101 = :const101_3
+      ConstantSpecs::ContainerB::CS_CONST101.should == :const101_3
+
+      ConstantSpecs::ContainerB::ChildB::CS_CONST101 = :const101_4
+      ConstantSpecs::ContainerB::ChildB::CS_CONST101.should == :const101_4
+
+      ConstantSpecs::ModuleA::CS_CONST101 = :const101_5
+      ConstantSpecs::ModuleA::CS_CONST101.should == :const101_5
+    end
+
+    it "searches a module included in the immediate class before the superclass" do
+      ConstantSpecs::ParentB::CS_CONST102 = :const102_1
+      ConstantSpecs::ModuleF::CS_CONST102 = :const102_2
+      ConstantSpecs::ContainerB::ChildB::CS_CONST102.should == :const102_2
+    end
+
+    it "searches the superclass before a module included in the superclass" do
+      ConstantSpecs::ModuleE::CS_CONST103 = :const103_1
+      ConstantSpecs::ParentB::CS_CONST103 = :const103_2
+      ConstantSpecs::ContainerB::ChildB::CS_CONST103.should == :const103_2
+    end
+
+    it "searches a module included in the superclass" do
+      ConstantSpecs::ModuleA::CS_CONST104 = :const104_1
+      ConstantSpecs::ModuleE::CS_CONST104 = :const104_2
+      ConstantSpecs::ContainerB::ChildB::CS_CONST104.should == :const104_2
+    end
+
+    it "searches the superclass chain" do
+      ConstantSpecs::ModuleA::CS_CONST105 = :const105
+      ConstantSpecs::ContainerB::ChildB::CS_CONST105.should == :const105
+    end
+
+    it "searches Object if no class or module qualifier is given" do
+      CS_CONST106 = :const106
+      CS_CONST106.should == :const106
+    end
+
+    it "searches Object if a toplevel qualifier (::X) is given" do
+      ::CS_CONST107 = :const107
+      ::CS_CONST107.should == :const107
+    end
+
+    it "does not search the singleton class of the class or module" do
+      class << ConstantSpecs::ContainerB::ChildB
+        CS_CONST108 = :const108_1
+      end
+
+      lambda do
+        ConstantSpecs::ContainerB::ChildB::CS_CONST108
+      end.should raise_error(NameError)
+
+      module ConstantSpecs
+        class << self
+          CS_CONST108 = :const108_2
+        end
+      end
+
+      lambda { ConstantSpecs::CS_CONST108 }.should raise_error(NameError)
+    end
+
+    it "returns the updated value when a constant is reassigned" do
+      ConstantSpecs::ClassB::CS_CONST109 = :const109_1
+      ConstantSpecs::ClassB::CS_CONST109.should == :const109_1
+
+      ConstantSpecs::ClassB::CS_CONST109 = :const109_2
+      ConstantSpecs::ClassB::CS_CONST109.should == :const109_2
+    end
+  end
+
+  it "raises a NameError if no constant is defined in the search path" do
+    lambda { ConstantSpecs::ParentA::CS_CONSTX }.should raise_error(NameError)
+  end
+
+  it "sends #const_missing to the original class or module scope" do
+    ConstantSpecs::ClassA::CS_CONSTX.should == :CS_CONSTX
+  end
+
+  it "evaluates the qualifier" do
+    ConstantSpecs.get_const::CS_CONST2.should == :const2
+  end
+
+  it "raises a TypeError if a non-class or non-module qualifier is given" do
+    lambda { CS_CONST1::CS_CONST }.should raise_error(TypeError)
+    lambda { 1::CS_CONST         }.should raise_error(TypeError)
+    lambda { "mod"::CS_CONST     }.should raise_error(TypeError)
+    lambda { false::CS_CONST     }.should raise_error(TypeError)
+  end
+end
+
+describe "Constant resolution within methods" do
+  describe "with statically assigned constants" do
+    it "searches the immediate class or module scope first" do
+      ConstantSpecs::ClassA.const10.should == :const10_10
+      ConstantSpecs::ParentA.const10.should == :const10_5
+      ConstantSpecs::ContainerA.const10.should == :const10_2
+      ConstantSpecs::ContainerA::ChildA.const10.should == :const10_3
+
+      ConstantSpecs::ClassA.new.const10.should == :const10_10
+      ConstantSpecs::ParentA.new.const10.should == :const10_5
+      ConstantSpecs::ContainerA::ChildA.new.const10.should == :const10_3
+    end
+
+    it "searches a module included in the immediate class before the superclass" do
+      ConstantSpecs::ContainerA::ChildA.const15.should == :const15_1
+      ConstantSpecs::ContainerA::ChildA.new.const15.should == :const15_1
+    end
+
+    it "searches the superclass before a module included in the superclass" do
+      ConstantSpecs::ContainerA::ChildA.const11.should == :const11_1
+      ConstantSpecs::ContainerA::ChildA.new.const11.should == :const11_1
+    end
+
+    it "searches a module included in the superclass" do
+      ConstantSpecs::ContainerA::ChildA.const12.should == :const12_1
+      ConstantSpecs::ContainerA::ChildA.new.const12.should == :const12_1
+    end
+
+    it "searches the superclass chain" do
+      ConstantSpecs::ContainerA::ChildA.const13.should == :const13
+      ConstantSpecs::ContainerA::ChildA.new.const13.should == :const13
+    end
+
+    it "searches the lexical scope of the method not the receiver's immediate class" do
+      ConstantSpecs::ContainerA::ChildA.const19.should == :const19_1
+    end
+
+    it "searches the lexical scope of a singleton method" do
+      ConstantSpecs::CS_CONST18.const17.should == :const17_1
+    end
+
+    it "does not search the lexical scope of the caller" do
+      lambda { ConstantSpecs::ClassA.const16 }.should raise_error(NameError)
+    end
+
+    it "searches the lexical scope of a block" do
+      ConstantSpecs::ClassA.const22.should == :const22_1
+    end
+
+    it "searches Object as a lexical scope only if Object is explicitly opened" do
+      ConstantSpecs::ContainerA::ChildA.const20.should == :const20_1
+      ConstantSpecs::ContainerA::ChildA.const21.should == :const21_1
+    end
+
+    it "does not search the lexical scope of qualifying modules" do
+      lambda do
+        ConstantSpecs::ContainerA::ChildA.const23
+      end.should raise_error(NameError)
+    end
+  end
+
+  describe "with dynamically assigned constants" do
+    it "searches the immediate class or module scope first" do
+      ConstantSpecs::ModuleA::CS_CONST201 = :const201_1
+
+      class ConstantSpecs::ClassB; CS_CONST201 = :const201_2; end
+      ConstantSpecs::ParentB::CS_CONST201 = :const201_3
+      ConstantSpecs::ContainerB::CS_CONST201 = :const201_4
+      ConstantSpecs::ContainerB::ChildB::CS_CONST201 = :const201_5
+
+      ConstantSpecs::ClassB.const201.should == :const201_2
+      ConstantSpecs::ParentB.const201.should == :const201_3
+      ConstantSpecs::ContainerB.const201.should == :const201_4
+      ConstantSpecs::ContainerB::ChildB.const201.should == :const201_5
+
+      ConstantSpecs::ClassB.new.const201.should == :const201_2
+      ConstantSpecs::ParentB.new.const201.should == :const201_3
+      ConstantSpecs::ContainerB::ChildB.new.const201.should == :const201_5
+    end
+
+    it "searches a module included in the immediate class before the superclass" do
+      ConstantSpecs::ParentB::CS_CONST202 = :const202_2
+      ConstantSpecs::ContainerB::ChildB::CS_CONST202 = :const202_1
+
+      ConstantSpecs::ContainerB::ChildB.const202.should == :const202_1
+      ConstantSpecs::ContainerB::ChildB.new.const202.should == :const202_1
+    end
+
+    it "searches the superclass before a module included in the superclass" do
+      ConstantSpecs::ParentB::CS_CONST203 = :const203_1
+      ConstantSpecs::ModuleE::CS_CONST203 = :const203_2
+
+      ConstantSpecs::ContainerB::ChildB.const203.should == :const203_1
+      ConstantSpecs::ContainerB::ChildB.new.const203.should == :const203_1
+    end
+
+    it "searches a module included in the superclass" do
+      ConstantSpecs::ModuleA::CS_CONST204 = :const204_2
+      ConstantSpecs::ModuleE::CS_CONST204 = :const204_1
+
+      ConstantSpecs::ContainerB::ChildB.const204.should == :const204_1
+      ConstantSpecs::ContainerB::ChildB.new.const204.should == :const204_1
+    end
+
+    it "searches the superclass chain" do
+      ConstantSpecs::ModuleA::CS_CONST205 = :const205
+
+      ConstantSpecs::ContainerB::ChildB.const205.should == :const205
+      ConstantSpecs::ContainerB::ChildB.new.const205.should == :const205
+    end
+
+    it "searches the lexical scope of the method not the receiver's immediate class" do
+      ConstantSpecs::ContainerB::ChildB::CS_CONST206 = :const206_2
+      class ConstantSpecs::ContainerB::ChildB
+        class << self
+          CS_CONST206 = :const206_1
+        end
+      end
+
+      ConstantSpecs::ContainerB::ChildB.const206.should == :const206_1
+    end
+
+    it "searches the lexical scope of a singleton method" do
+      ConstantSpecs::CS_CONST207 = :const207_1
+      ConstantSpecs::ClassB::CS_CONST207 = :const207_2
+
+      ConstantSpecs::CS_CONST208.const207.should == :const207_1
+    end
+
+    it "does not search the lexical scope of the caller" do
+      ConstantSpecs::ClassB::CS_CONST209 = :const209
+
+      lambda { ConstantSpecs::ClassB.const209 }.should raise_error(NameError)
+    end
+
+    it "searches the lexical scope of a block" do
+      ConstantSpecs::ClassB::CS_CONST210 = :const210_1
+      ConstantSpecs::ParentB::CS_CONST210 = :const210_2
+
+      ConstantSpecs::ClassB.const210.should == :const210_1
+    end
+
+    it "searches Object as a lexical scope only if Object is explicitly opened" do
+      Object::CS_CONST211 = :const211_1
+      ConstantSpecs::ParentB::CS_CONST211 = :const211_2
+      ConstantSpecs::ContainerB::ChildB.const211.should == :const211_1
+
+      Object::CS_CONST212 = :const212_2
+      ConstantSpecs::ParentB::CS_CONST212 = :const212_1
+      ConstantSpecs::ContainerB::ChildB.const212.should == :const212_1
+    end
+
+    it "returns the updated value when a constant is reassigned" do
+      ConstantSpecs::ParentB::CS_CONST213 = :const213_1
+      ConstantSpecs::ContainerB::ChildB.const213.should == :const213_1
+      ConstantSpecs::ContainerB::ChildB.new.const213.should == :const213_1
+
+      ConstantSpecs::ParentB::CS_CONST213 = :const213_2
+      ConstantSpecs::ContainerB::ChildB.const213.should == :const213_2
+      ConstantSpecs::ContainerB::ChildB.new.const213.should == :const213_2
+    end
+
+    it "does not search the lexical scope of qualifying modules" do
+      ConstantSpecs::ContainerB::CS_CONST214 = :const214
+
+      lambda do
+        ConstantSpecs::ContainerB::ChildB.const214
+      end.should raise_error(NameError)
+    end
+  end
+
+  it "raises a NameError if no constant is defined in the search path" do
+    lambda { ConstantSpecs::ParentA.constx }.should raise_error(NameError)
+  end
+
+  it "sends #const_missing to the original class or module scope" do
+    ConstantSpecs::ClassA.constx.should == :CS_CONSTX
+    ConstantSpecs::ClassA.new.constx.should == :CS_CONSTX
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/def_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/def_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/def_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,515 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+# Language-level method behaviour
+describe "Redefining a method" do
+  it "replaces the original method" do
+    def barfoo; 100; end
+    barfoo.should == 100
+
+    def barfoo; 200; end
+    barfoo.should == 200
+  end
+end
+
+describe "Defining an 'initialize' method" do
+  it "should make it private" do
+    class DefInitializeSpec
+      def initialize
+      end
+    end
+    DefInitializeSpec.new.private_methods(false).should include('initialize')
+  end
+end
+
+describe "Defining an 'initialize_copy' method" do
+  it "should make it private" do
+    class DefInitializeCopySpec
+      def initialize_copy
+      end
+    end
+    DefInitializeCopySpec.new.private_methods(false).should include('initialize_copy')
+  end
+end
+
+describe "An instance method definition with a splat" do
+  it "accepts an unnamed '*' argument" do
+    def foo(*); end;
+
+    foo.should == nil
+    foo(1, 2).should == nil
+    foo(1, 2, 3, 4, :a, :b, 'c', 'd').should == nil
+  end
+
+  it "accepts a named * argument" do
+    def foo(*a); a; end;
+    foo.should == []
+    foo(1, 2).should == [1, 2]
+    foo([:a]).should == [[:a]]
+  end
+
+  it "accepts non-* arguments before the * argument" do
+    def foo(a, b, c, d, e, *f); [a, b, c, d, e, f]; end
+    foo(1, 2, 3, 4, 5, 6, 7, 8).should == [1, 2, 3, 4, 5, [6, 7, 8]]
+  end
+
+  it "creates a method that can be invoked with an inline hash argument" do
+    def foo(a,b,*c); [a,b,c] end
+
+    foo('abc', 'rbx' => 'cool', 'specs' => 'fail sometimes', 'oh' => 'shit', *[789, 'yeah']).
+      should ==
+      ['abc', { 'rbx' => 'cool', 'specs' => 'fail sometimes', 'oh' => 'shit'}, [789, 'yeah']]
+  end
+
+  it "creates a method that can be invoked with an inline hash and a block" do
+    def foo(a,b,*c,&d); [a,b,c,yield(d)] end
+
+    foo('abc', 'rbx' => 'cool', 'specs' => 'fail sometimes', 'oh' => 'shit', *[789, 'yeah']) { 3 }.
+      should ==
+      ['abc', { 'rbx' => 'cool', 'specs' => 'fail sometimes', 'oh' => 'shit'}, [789, 'yeah'], 3]
+
+    foo('abc', 'rbx' => 'cool', 'specs' => 'fail sometimes', *[789, 'yeah']) do 3 end.should ==
+      ['abc', { 'rbx' => 'cool', 'specs' => 'fail sometimes' }, [789, 'yeah'], 3]
+
+    l = lambda { 3 }
+
+    foo('abc', 'rbx' => 'cool', 'specs' => 'fail sometimes', *[789, 'yeah'], &l).should ==
+      ['abc', { 'rbx' => 'cool', 'specs' => 'fail sometimes' }, [789, 'yeah'], 3]
+  end
+
+  it "allows only a single * argument" do
+    lambda { eval 'def foo(a, *b, *c); end' }.should raise_error(SyntaxError)
+  end
+
+  it "requires the presence of any arguments that precede the *" do
+    def foo(a, b, *c); end
+    lambda { foo 1 }.should raise_error(ArgumentError)
+  end
+end
+
+describe "An instance method with a default argument" do
+  it "evaluates the default when no arguments are passed" do
+    def foo(a = 1)
+      a
+    end
+    foo.should == 1
+    foo(2).should == 2
+  end
+
+  it "evaluates the default empty expression when no arguments are passed" do
+    def foo(a = ())
+      a
+    end
+    foo.should == nil
+    foo(2).should == 2
+  end
+
+  it "assigns an empty Array to an unused splat argument" do
+    def foo(a = 1, *b)
+      [a,b]
+    end
+    foo.should == [1, []]
+    foo(2).should == [2, []]
+  end
+
+  it "evaluates the default when required arguments precede it" do
+    def foo(a, b = 2)
+      [a,b]
+    end
+    lambda { foo }.should raise_error(ArgumentError)
+    foo(1).should == [1, 2]
+  end
+
+  it "prefers to assign to a default argument before a splat argument" do
+    def foo(a, b = 2, *c)
+      [a,b,c]
+    end
+    lambda { foo }.should raise_error(ArgumentError)
+    foo(1).should == [1,2,[]]
+  end
+
+  it "prefers to assign to a default argument when there are no required arguments" do
+    def foo(a = 1, *args)
+      [a,args]
+    end
+    foo(2,2).should == [2,[2]]
+  end
+
+  it "does not evaluate the default when passed a value and a * argument" do
+    def foo(a, b = 2, *args)
+      [a,b,args]
+    end
+    foo(2,3,3).should == [2,3,[3]]
+  end
+end
+
+describe "A singleton method definition" do
+  it "can be declared for a local variable" do
+    a = "hi"
+    def a.foo
+      5
+    end
+    a.foo.should == 5
+  end
+
+  it "can be declared for an instance variable" do
+    @a = "hi"
+    def @a.foo
+      6
+    end
+    @a.foo.should == 6
+  end
+
+  it "can be declared for a global variable" do
+    $__a__ = "hi"
+    def $__a__.foo
+      7
+    end
+    $__a__.foo.should == 7
+  end
+
+  it "can be declared for a class variable" do
+    @@a = "hi"
+    def @@a.foo
+      8
+    end
+    @@a.foo.should == 8
+  end
+
+  it "can be declared with an empty method body" do
+    class DefSpec
+      def self.foo;end
+    end
+    DefSpec.foo.should == nil
+  end
+
+  it "can be redefined" do
+    obj = Object.new
+    def obj.==(other)
+      1
+    end
+    (obj==1).should == 1
+    def obj.==(other)
+      2
+    end
+    (obj==2).should == 2
+  end
+end
+
+describe "Redefining a singleton method" do
+  it "does not inherit a previously set visibility " do
+    o = Object.new
+
+    class << o; private; def foo; end; end;
+
+    class << o; should have_private_instance_method(:foo); end
+
+    class << o; def foo; end; end;
+
+    class << o; should_not have_private_instance_method(:foo); end
+    class << o; should have_instance_method(:foo); end
+
+  end
+end
+
+describe "Redefining a singleton method" do
+  it "does not inherit a previously set visibility " do
+    o = Object.new
+
+    class << o; private; def foo; end; end;
+
+    class << o; should have_private_instance_method(:foo); end
+
+    class << o; def foo; end; end;
+
+    class << o; should_not have_private_instance_method(:foo); end
+    class << o; should have_instance_method(:foo); end
+
+  end
+end
+
+describe "A method defined with extreme default arguments" do
+  it "can redefine itself when the default is evaluated" do
+    class DefSpecs
+      def foo(x = (def foo; "hello"; end;1));x;end
+    end
+
+    d = DefSpecs.new
+    d.foo(42).should == 42
+    d.foo.should == 1
+    d.foo.should == 'hello'
+  end
+
+  it "may use an fcall as a default" do
+    def foo(x = caller())
+      x
+    end
+    foo.shift.class.should == String
+  end
+
+  it "evaluates the defaults in the method's scope" do
+    def foo(x = ($foo_self = self; nil)); end
+    foo
+    $foo_self.should == self
+  end
+
+  it "may use preceding arguments as defaults" do
+    def foo(obj, width=obj.length)
+      width
+    end
+    foo('abcde').should == 5
+  end
+
+  it "may use a lambda as a default" do
+    def foo(output = 'a', prc = lambda {|n| output * n})
+      prc.call(5)
+    end
+    foo.should == 'aaaaa' 
+  end
+end
+
+describe "A singleton method defined with extreme default arguments" do
+  it "may use a method definition as a default" do
+    $__a = "hi"
+    def $__a.foo(x = (def $__a.foo; "hello"; end;1));x;end
+
+    $__a.foo(42).should == 42
+    $__a.foo.should == 1
+    $__a.foo.should == 'hello'
+  end
+
+  it "may use an fcall as a default" do
+    a = "hi"
+    def a.foo(x = caller())
+      x
+    end
+    a.foo.shift.class.should == String
+  end
+
+  it "evaluates the defaults in the singleton scope" do
+    a = "hi"
+    def a.foo(x = ($foo_self = self; nil)); 5 ;end
+    a.foo
+    $foo_self.should == a
+  end
+
+  it "may use preceding arguments as defaults" do
+    a = 'hi'
+    def a.foo(obj, width=obj.length)
+      width
+    end
+    a.foo('abcde').should == 5
+  end
+  
+  it "may use a lambda as a default" do
+    a = 'hi'
+    def a.foo(output = 'a', prc = lambda {|n| output * n})
+      prc.call(5)
+    end
+    a.foo.should == 'aaaaa' 
+  end
+end
+
+describe "A method definition inside a metaclass scope" do
+  it "can create a class method" do
+    class DefSpecSingleton
+      class << self
+        def a_class_method;self;end
+      end
+    end
+
+    DefSpecSingleton.a_class_method.should == DefSpecSingleton
+    lambda { Object.a_class_method }.should raise_error(NoMethodError)
+  end
+
+  it "can create a singleton method" do
+    obj = Object.new
+    class << obj
+      def a_singleton_method;self;end
+    end
+
+    obj.a_singleton_method.should == obj
+    lambda { Object.new.a_singleton_method }.should raise_error(NoMethodError)
+  end
+end
+
+describe "A nested method definition" do
+  it "creates an instance method when evaluated in an instance method" do
+    class DefSpecNested
+      def create_instance_method
+        def an_instance_method;self;end
+        an_instance_method
+      end
+    end
+
+    obj = DefSpecNested.new
+    obj.create_instance_method.should == obj
+    obj.an_instance_method.should == obj
+
+    other = DefSpecNested.new
+    other.an_instance_method.should == other
+
+    DefSpecNested.instance_methods.should include("an_instance_method")
+  end
+
+  it "creates a class method when evaluated in a class method" do
+    class DefSpecNested
+      class << self
+        def create_class_method
+          def a_class_method;self;end
+          a_class_method
+        end
+      end
+    end
+
+    lambda { DefSpecNested.a_class_method }.should raise_error(NoMethodError)
+    DefSpecNested.create_class_method.should == DefSpecNested
+    DefSpecNested.a_class_method.should == DefSpecNested
+    lambda { Object.a_class_method }.should raise_error(NoMethodError)
+    lambda { DefSpecNested.new.a_class_method }.should raise_error(NoMethodError)
+  end
+
+  it "creates a singleton method when evaluated in the metaclass of an instance" do
+    class DefSpecNested
+      def create_singleton_method
+        class << self
+          def a_singleton_method;self;end
+        end
+        a_singleton_method
+      end
+    end
+
+    obj = DefSpecNested.new
+    obj.create_singleton_method.should == obj
+    obj.a_singleton_method.should == obj
+
+    other = DefSpecNested.new
+    lambda { other.a_singleton_method }.should raise_error(NoMethodError)
+  end
+end
+
+describe "A method definition inside an instance_eval" do
+  it "creates a singleton method" do
+    obj = Object.new
+    obj.instance_eval do
+      def an_instance_eval_method;self;end
+    end
+    obj.an_instance_eval_method.should == obj
+
+    other = Object.new
+    lambda { other.an_instance_eval_method }.should raise_error(NoMethodError)
+  end
+
+  it "creates a singleton method when evaluated inside a metaclass" do
+    obj = Object.new
+    obj.instance_eval do
+      class << self
+        def a_metaclass_eval_method;self;end
+      end
+    end
+    obj.a_metaclass_eval_method.should == obj
+
+    other = Object.new
+    lambda { other.a_metaclass_eval_method }.should raise_error(NoMethodError)
+  end
+
+  it "creates a class method when the receiver is a class" do
+    DefSpecNested.instance_eval do
+      def an_instance_eval_class_method;self;end
+    end
+
+    DefSpecNested.an_instance_eval_class_method.should == DefSpecNested
+    lambda { Object.an_instance_eval_class_method }.should raise_error(NoMethodError)
+  end
+end
+
+describe "A method definition in an eval" do
+  it "creates an instance method" do
+    class DefSpecNested
+      def eval_instance_method
+        eval "def an_eval_instance_method;self;end", binding
+        an_eval_instance_method
+      end
+    end
+
+    obj = DefSpecNested.new
+    obj.eval_instance_method.should == obj
+    obj.an_eval_instance_method.should == obj
+
+    other = DefSpecNested.new
+    other.an_eval_instance_method.should == other
+
+    lambda { Object.new.an_eval_instance_method }.should raise_error(NoMethodError)
+  end
+
+  it "creates a class method" do
+    class DefSpecNestedB
+      class << self
+        def eval_class_method
+          eval "def an_eval_class_method;self;end" #, binding
+          an_eval_class_method
+        end
+      end
+    end
+
+    DefSpecNestedB.eval_class_method.should == DefSpecNestedB
+    DefSpecNestedB.an_eval_class_method.should == DefSpecNestedB
+
+    lambda { Object.an_eval_class_method }.should raise_error(NoMethodError)
+    lambda { DefSpecNestedB.new.an_eval_class_method}.should raise_error(NoMethodError)
+  end
+
+  it "creates a singleton method" do
+    class DefSpecNested
+      def eval_singleton_method
+        class << self
+          eval "def an_eval_singleton_method;self;end", binding
+        end
+        an_eval_singleton_method
+      end
+    end
+
+    obj = DefSpecNested.new
+    obj.eval_singleton_method.should == obj
+    obj.an_eval_singleton_method.should == obj
+
+    other = DefSpecNested.new
+    lambda { other.an_eval_singleton_method }.should raise_error(NoMethodError)
+  end
+end
+
+describe "a method definition that sets more than one default parameter all to the same value" do
+  def foo(a=b=c={})
+    [a,b,c]
+  end
+  it "assigns them all the same object by default" do
+    foo.should == [{},{},{}]
+    a, b, c = foo
+    a.should eql(b)
+    a.should eql(c)
+  end
+
+  it "allows the first argument to be given, and sets the rest to null" do
+    foo(1).should == [1,nil,nil]
+  end
+
+  it "assigns the parameters different objects across different default calls" do
+    a, b, c = foo
+    d, e, f = foo
+    a.should_not equal(d)
+  end
+
+  it "only allows overriding the default value of the first such parameter in each set" do
+    lambda { foo(1,2) }.should raise_error(ArgumentError)
+  end
+
+  def bar(a=b=c=1,d=2)
+    [a,b,c,d]
+  end
+
+  it "treats the argument after the multi-parameter normally" do
+    bar.should == [1,1,1,2]
+    bar(3).should == [3,nil,nil,2]
+    bar(3,4).should == [3,nil,nil,4]
+    lambda { bar(3,4,5) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/defined_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/defined_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/defined_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,223 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe "The defined? keyword" do
+  class LanguageDefinedSpecs
+    SomeConst = 5
+
+    attr_accessor :ivar
+
+    def no_args
+    end
+    def args(x)
+    end
+
+    def lvar_defined
+      x = 1
+      defined?(x)
+    end
+
+    def ivar_definition
+      defined? @ivar
+    end
+
+  end
+
+  class LanguageDefinedSubclass < LanguageDefinedSpecs
+    def no_args
+      defined?(super)
+    end
+    def args
+      defined?( super() )
+    end
+  end
+
+  module AAA
+    self::FOO = 'x' unless defined? self::FOO rescue nil
+  end
+
+  it "returns 'method' when defined?(exit) is sent" do
+    ret = defined?(exit)
+    ret.should == 'method'
+  end
+
+  it "returns 'method' when defined?(Kernel.puts) is sent (attribute)" do
+    ret = defined?(Kernel.puts)
+    ret.should == 'method'
+  end
+
+  it "returns nil when defined?(DoesNotExist.puts) is sent" do
+    ret = defined?(DoesNotExist.puts)
+    ret.should == nil
+  end
+
+  it "returns nil when defined?(Kernel.does_not_exist) is sent" do
+    ret = defined?(Kernel.does_not_exist)
+    ret.should == nil
+  end
+
+  it "returns 'assignment' when defined?(x = 2) is sent" do
+    ret = defined?(x = 2)
+    ret.should == 'assignment'
+  end
+
+  it "returns 'local-variable' when x = 1; defined?(x) is sent" do
+    obj = LanguageDefinedSpecs.new
+    obj.lvar_defined.should == 'local-variable'
+  end
+
+  it "returns 'constant' when defined?(Object) is sent" do
+    ret = defined?(Object)
+    ret.should == 'constant'
+  end
+
+  it "returns 'class variable' when @@x = 1; defined?(@@x) is sent" do
+    @@x = 1
+    ret = defined?(@@x)
+    ret.should == 'class variable'
+  end
+
+  it "returns 'instance-variable' when @x = 1; defined?(@x) is sent" do
+    @x = 1
+    ret = defined?(@x)
+    ret.should == 'instance-variable'
+  end
+
+  it "returns 'global-variable' when $x = 1; defined?($x) is sent" do
+    $x = 1
+    ret = defined?($x)
+    ret.should == 'global-variable'
+  end
+
+  it "returns 'expression' when defined?('foo = bar') is sent" do
+    ret = defined?('foo = bar')
+    ret.should == "expression"
+  end
+
+  it "returns 'self' when defined?(self) is sent" do
+    ret = defined?(self)
+    ret.should == "self"
+  end
+
+  it "returns 'nil' when defined?(nil) is sent" do
+    ret = defined?(nil)
+    ret.should == "nil"
+  end
+
+  it "returns 'true' when defined?(true) is sent" do
+    ret = defined?(true)
+    ret.should == "true"
+  end
+
+  it "returns 'false' when defined?(false) is sent" do
+    ret = defined?(false)
+    ret.should == "false"
+  end
+
+  it "returns nil when defined?(no_such_local) is sent" do
+    ret = defined?(no_such_local)
+    ret.should == nil
+  end
+
+  it "returns 'expression' when defined?(:File) is sent" do
+    ret = defined?(:File)
+    ret.should == "expression"
+  end
+
+  it "returns 'constant' when defined?(LanguageDefinedSpecs::SomeConst) is sent" do
+    ret = defined?(LanguageDefinedSpecs::SomeConst)
+    ret.should == "constant"
+  end
+
+  it "returns 'constant' when evaluating self::FOO in module AAA" do
+    ret = defined?(AAA::FOO)
+    ret.should == 'constant'
+  end
+
+  it "returns 'constant' when defined?(File) is sent" do
+    ret = defined?(File)
+    ret.should == "constant"
+  end
+
+  it "returns 'constant' when defined?(File::SEPARATOR) is sent" do
+    ret = defined?(File::SEPARATOR)
+    ret.should == "constant"
+  end
+
+  it "returns 'method' when defined?(Object.nil?) is sent" do
+    ret = defined?(Object.nil?)
+    ret.should == "method"
+  end
+
+  it "returns 'expression' when defined?(0) is sent" do
+    ret = defined?(0)
+    ret.should == "expression"
+  end
+
+  deviates_on :rubinius do
+    # Rubinius does not care about dynamic vars
+    it "returns 'local-variable' when defined? is called on a block var" do
+      block = Proc.new { |x| defined?(x) }
+      ret = block.call(1)
+      ret.should == 'local-variable'
+    end
+  end
+
+  not_compliant_on :rubinius do
+    # I (Evan) am not certain we'll support defined?(super) ever.
+    # for now, i'm marking these as compliant.
+    it "returns 'super' when Subclass#no_args uses defined?" do
+      ret = (LanguageDefinedSpecs::LanguageDefinedSubclass.new.no_args)
+      ret.should == "super"
+    end
+
+    it "returns 'super' when Subclass#args uses defined?" do
+      ret = (LanguageDefinedSpecs::LanguageDefinedSubclass.new.args)
+      ret.should == "super"
+    end
+
+    it "returns 'local-variable' when defined? is called on a block var" do
+      block = Proc.new { |xxx| defined?(xxx) }
+      ret = block.call(1)
+      ret.should == 'local-variable(in-block)'
+    end
+  end
+
+  it "returns nil for an instance variable not yet accessed" do
+    instance = LanguageDefinedSpecs.new
+    ret = instance.ivar_definition
+    ret.should == nil
+  end
+
+  it "returns nil for an instance variable read but not yet assigned" do
+    instance = LanguageDefinedSpecs.new
+    read_value = instance.ivar
+    ret = instance.ivar_definition
+    ret.should == nil
+  end
+
+  it "returns 'instance-variable' for an instance variable defined in an instance" do
+    instance = LanguageDefinedSpecs.new
+    instance.ivar = 2
+    ret = instance.ivar_definition
+    ret.should == 'instance-variable'
+  end
+
+  it "follows normal lexical and hierarchical scoping for constants" do
+    o = Object.new
+    class << o
+      module Foo
+        Bar = 1
+      end
+      class Baz; include Foo; end
+      class Baz;
+        def self.foo_defined; defined? Foo; end
+        def self.bar_defined; defined? Bar; end
+      end
+      def baz; Baz; end
+    end
+
+    o.baz.foo_defined.should == "constant";
+    o.baz.bar_defined.should == "constant";
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/language/eigenclass_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/eigenclass_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/eigenclass_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,275 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/class'
+
+describe "self in an eigenclass body (class << obj)" do
+  it "is TrueClass for true" do
+    class << true; self; end.should == TrueClass
+  end
+
+  it "is FalseClass for false" do
+    class << false; self; end.should == FalseClass
+  end
+
+  it "is NilClass for nil" do
+    class << nil; self; end.should == NilClass
+  end
+
+  it "raises a TypeError for Fixnum's" do
+    1.should be_kind_of(Fixnum)
+    lambda { class << 1; self; end }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError for symbols" do
+    lambda { class << :symbol; self; end }.should raise_error(TypeError)
+  end
+
+  it "is a singleton Class instance" do
+    mock = mock('x')
+    cls = class << mock; self; end
+    cls.is_a?(Class).should == true
+    cls.should_not equal(Object)
+    mock.is_a?(cls).should be_true
+  end
+
+  ruby_version_is "1.9" do
+    it "is a metaclass for classes" do
+      cls = class << ClassSpecs::A; self; end
+      cls.is_a?(class << Class; self end).should == true
+      cls.is_a?(Object).should == true
+      cls.should_not equal(Class)
+      ClassSpecs::A.is_a?(cls).should be_true
+    end
+
+    it "is a metametaclass for metaclasses" do
+      klass = class << ClassSpecs::A; self end
+      cls = class << klass; self end
+      cls.is_a?(class << Class; class << self; self end end).should == true
+      cls.is_a?(class << Class; self end).should == true
+      cls.is_a?(Class)
+      cls.is_a?(Object).should == true
+      cls.should_not equal(Class)
+      cls.should_not equal(class << Class; self end)
+      klass.is_a?(cls).should be_true
+    end
+
+    it "has the class's metaclass as superclass for classes" do
+      cls = class << ClassSpecs::K; self end
+      cls.superclass.should == class << ClassSpecs::H; self end
+    end
+
+    it "has Class as superclass for BasicObject class" do
+      cls = class << BasicObject; self end
+      cls.superclass.should == Class
+    end
+
+    it "has the class's metaclass's metaclass as superclass for metaclasses" do
+      cls = class << ClassSpecs::K; class << self; self end end
+      cls.superclass.should == class << ClassSpecs::H; class << self; self end end
+    end
+
+    it "has the metaclass of Class as superclass for the metaclass of BasicObject" do
+      cls = class << BasicObject; class << self; self end end
+      cls.superclass.should == class << Class; self end
+    end
+
+    it "has the object's class as superclass" do
+      cls = class << "blah"; self; end
+      cls.superclass.should == String
+    end
+
+    ruby_bug("#601", "1.9") do
+      it "raises a TypeError for Bignum's" do
+        (1<<1024).should be_kind_of(Bignum)
+        lambda { class << (1<<1024); self; end }.should raise_error(TypeError)
+      end
+    end
+  end
+
+  deviates_on(:rubinius) do 
+    it "is a MetaClass instance" do
+      cls = class << mock('x'); self; end
+      cls.is_a?(MetaClass).should == true
+    end
+
+  end
+end
+
+describe "A constant on an eigenclass" do
+  before(:each) do
+    @object = Object.new
+    class << @object
+      CONST = self
+    end
+  end
+
+  it "can be accessed after the eigenclass body is reopened" do
+    class << @object
+      CONST.should == self
+    end
+  end
+
+  it "can be accessed via self::CONST" do
+    class << @object
+      self::CONST.should == self
+    end
+  end
+
+  it "can be accessed via const_get" do
+    class << @object
+      const_get(:CONST).should == self
+    end
+  end
+
+  it "is not defined on the object's class" do
+    @object.class.const_defined?(:CONST).should be_false
+  end
+
+  it "is not defined in the eigenclass opener's scope" do
+    class << @object
+      CONST
+    end
+    lambda { CONST }.should raise_error(NameError)
+  end
+
+  it "cannot be accessed via object::CONST" do
+    lambda do
+      @object::CONST
+    end.should raise_error(TypeError)
+  end
+
+  it "raises a NameError for anonymous_module::CONST" do
+    @object = Class.new
+    class << @object
+      CONST = 100
+    end
+    
+    lambda do
+      @object::CONST
+    end.should raise_error(NameError)
+  end
+
+  ruby_version_is "" ... "1.9" do
+    it "appears in the eigenclass constant list" do
+      constants = class << @object; constants; end 
+      constants.should include("CONST")
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "appears in the eigenclass constant list" do
+      constants = class << @object; constants; end 
+      constants.should include(:CONST)
+    end
+  end
+
+  it "does not appear in the object's class constant list" do
+    @object.class.constants.should_not include(:CONST)
+  end
+
+  it "is not preserved when the object is duped" do
+    @object = @object.dup
+
+    lambda do
+      class << @object; CONST; end
+    end.should raise_error(NameError)
+  end
+
+  it "is preserved when the object is cloned" do
+    @object = @object.clone
+
+    class << @object
+      CONST.should_not be_nil
+    end
+  end
+end
+
+# TODO: write these for 1.8.
+ruby_version_is "1.9" do
+  describe "Instance methods of an eigenclass" do
+    it "includes ones of the object's class" do
+      (class << ClassSpecs::K.new; self end).instance_methods.should include(:example_instance_method)
+    end
+
+    it "does not include class methods of the object's class" do
+      (class << ClassSpecs::K.new; self end).instance_methods.should_not include(:example_class_method)
+    end
+
+    it "includes instance methods of Object" do
+      (class << ClassSpecs::A.new; self end).instance_methods.should include(:example_instance_method_of_object)
+    end
+
+    it "does not include class methods of Object" do
+      (class << ClassSpecs::A.new; self end).instance_methods.should_not include(:example_class_method_of_object)
+    end
+
+    it "includes instance methods of Class, for a class" do
+      (class << ClassSpecs::A; self end).instance_methods.should include(:example_instance_method_of_class)
+    end
+
+    it "does not include class methods of Class, for a class" do
+      (class << ClassSpecs::A; self end).instance_methods.should_not include(:example_class_method_of_class)
+    end
+
+    it "does not include instance methods of the metaclass of Class, for a class" do
+      (class << ClassSpecs::A; self end).instance_methods.should_not include(:example_instance_method_of_metaclass)
+    end
+
+    it "does not include class methods of the metaclass of Class, for a class" do
+      (class << ClassSpecs::A; self end).instance_methods.should_not include(:example_class_method_of_metaclass)
+    end
+
+    it "includes instance methods of the metaclass of Class, for a metaclass" do
+      metaclass = class << ClassSpecs::A; self end
+      (class << metaclass; self end).instance_methods.should include(:example_instance_method_of_metaclass)
+    end
+
+    it "does not include class methods of the metaclass of Class, for a metaclass" do
+      metaclass = class << ClassSpecs::A; self end
+      (class << metaclass; self end).instance_methods.should_not include(:example_class_method_of_metaclass)
+    end
+  end
+
+  describe "Class methods of an eigenclass" do
+    it "includes ones of the object's class" do
+      (class << ClassSpecs::K.new; self end).methods.should include(:example_class_method)
+    end
+
+    it "does not include instance methods of the object's class" do
+      (class << ClassSpecs::K.new; self end).methods.should_not include(:example_instance_method)
+    end
+
+    it "includes instance methods of Class" do
+      (class << ClassSpecs::A.new; self end).methods.should include(:example_instance_method_of_class)
+    end
+
+    it "does not include class mtehods of Class" do
+      (class << ClassSpecs::A.new; self end).methods.should_not include(:example_class_method_of_class)
+    end
+
+    it "includes instance methods of Class, for a class" do
+      (class << ClassSpecs::A; self end).methods.should include(:example_instance_method_of_class)
+    end
+
+    it "includes class methods of Class, for a class" do
+      (class << ClassSpecs::A; self end).methods.should include(:example_class_method_of_class)
+    end
+
+    it "includes instance methods of the metaclass of Class, for a class" do
+      (class << ClassSpecs::A; self end).methods.should include(:example_instance_method_of_metaclass)
+    end
+
+    it "does not include class methods of the metaclass of Class, for a class" do
+      (class << ClassSpecs::A; self end).methods.should_not include(:example_class_method_of_metaclass)
+    end
+
+    it "includes instance methods of the metaclass of Class, for a metaclass" do
+      metaclass = class << ClassSpecs::A; self end
+      (class << metaclass; self end).methods.should include(:example_instance_method_of_metaclass)
+    end
+
+    it "includes class methods of the metaclass of Class, for a metaclass" do
+      metaclass = class << ClassSpecs::A; self end
+      (class << metaclass; self end).methods.should include(:example_class_method_of_metaclass)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/else_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/else_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/else_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/language/encoding_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/encoding_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/encoding_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,30 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+ruby_version_is "1.9" do
+  describe "The __ENCODING__ pseudo-variable" do
+    it "is an instance of Encoding" do
+      __ENCODING__.should be_kind_of(Encoding)
+    end
+
+    it "is US-ASCII by default" do
+      __ENCODING__.should == Encoding::US_ASCII
+    end
+
+    it "is the evaluated strings's one inside an eval" do
+      eval("__ENCODING__".force_encoding("US-ASCII")).should == Encoding::US_ASCII
+      eval("__ENCODING__".force_encoding("ASCII-8BIT")).should == Encoding::ASCII_8BIT
+    end
+
+    it "is equal to the specified encoding when a magic comment exists" do
+      code = "# coding: ASCII-8BIT\n__ENCODING__".force_encoding("US-ASCII")
+      eval(code).should == Encoding::ASCII_8BIT
+
+      code = "# coding: US-ASCII\n__ENCODING__".force_encoding("ASCII-8BIT")
+      eval(code).should == Encoding::US_ASCII
+    end
+
+    it "is not assignable" do
+      lambda { eval("__ENCODING__ = nil") }.should raise_error(SyntaxError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/ensure_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/ensure_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/ensure_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,109 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/ensure'
+
+describe "An ensure block inside a begin block" do
+  it "is executed when an exception is raised in it's corresponding begin block" do
+    begin
+      executed = []
+      
+      lambda {
+        begin
+          executed << :begin
+          raise "An exception occured!"
+        ensure
+          executed << :ensure
+        end
+      }.should raise_error(RuntimeError)
+      
+      executed.should eql([:begin, :ensure])
+    end
+  end
+
+  it "is executed when an exception is raised and rescued in it's corresponding begin block" do
+    begin
+      executed = []
+      
+      begin
+        executed << :begin
+        raise "An exception occured!"
+      rescue
+        executed << :rescue
+      ensure
+        executed << :ensure
+      end
+      
+      executed.should eql([:begin, :rescue, :ensure])
+    end
+  end
+
+  it "is executed even when a symbol is thrown in it's corresponding begin block" do
+    begin
+      executed = []
+      
+      catch(:symbol) do
+        begin
+          executed << :begin
+          throw(:symbol)
+        rescue
+          executed << :rescue
+        ensure
+          executed << :ensure
+        end
+      end
+      
+      executed.should eql([:begin, :ensure])
+    end
+  end
+
+  it "is executed when nothing is raised or thrown in it's corresponding begin block" do
+    executed = []
+    
+    begin
+      executed << :begin
+      raise "An exception occured!"
+    rescue
+      executed << :rescue
+    ensure
+      executed << :ensure
+    end
+    
+    executed.should eql([:begin, :rescue, :ensure])
+  end
+  
+  it "has non return value" do
+    begin
+      :begin
+    ensure
+      :ensure
+    end.should == :begin
+  end
+end
+
+describe "An ensure block inside a method" do
+  before(:each) do
+    @obj = EnsureSpec::Container.new
+  end
+  
+  it "is executed when an exception is raised in the method" do
+    lambda { @obj.raise_in_method_with_ensure }.should raise_error(RuntimeError)
+    @obj.executed.should == [:method, :ensure]
+  end
+
+  it "is executed when an exception is raised and rescued in the method" do
+    @obj.raise_and_rescue_in_method_with_ensure
+    @obj.executed.should == [:method, :rescue, :ensure]
+  end
+  
+  it "is executed even when a symbol is thrown in the method" do
+    catch(:symbol) { @obj.throw_in_method_with_ensure }
+    @obj.executed.should == [:method, :ensure]
+  end
+  
+  it "has no impact on the method's implicit return value" do
+    @obj.implicit_return_in_method_with_ensure.should == :method
+  end
+  
+  it "has an impact on the method's explicit return value" do
+    @obj.explicit_return_in_method_with_ensure.should == :ensure
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/language/execution_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/execution_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/execution_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe "``" do
+  it "returns the output of the executed sub-process" do
+    ip = 'world'
+    `echo disc #{ip}`.should == "disc world\n"
+  end
+end
+
+describe "%x" do
+  it "is the same as ``" do
+    ip = 'world'
+    %x(echo disc #{ip}).should == "disc world\n"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/file_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/file_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/file_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+# specs for __FILE__
+
+describe "The __FILE__ constant" do
+  it "equals the current filename" do
+    File.basename(__FILE__).should == "file_spec.rb"
+  end
+
+  it "equals (eval) inside an eval" do
+    eval("__FILE__").should == "(eval)"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/fixtures/array.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/fixtures/array.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/fixtures/array.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+module ArraySpec
+  class Splat
+    def unpack_3args(a, b, c)
+      [a, b, c]
+    end
+
+    def unpack_4args(a, b, c, d)
+      [a, b, c, d]
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/fixtures/block.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/fixtures/block.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/fixtures/block.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+module BlockSpecs
+  class Yield
+    def splat(*args)
+      yield *args
+    end
+    
+    def two_args
+      yield 1, 2
+    end
+    
+    def two_arg_array
+      yield [1, 2]
+    end
+
+    def yield_splat_inside_block
+      [1, 2].send(:each_with_index) {|*args| yield(*args)}
+    end
+  end
+end
+
+# def block_spec_method(*args)
+#   yield(*args)
+# end
+# 
+# def block_spec_method2
+#   yield 1, 2
+# end
+# 
+# def block_spec_method3
+#   yield [1, 2]
+# end
+# 

Added: MacRuby/branches/experimental/spec/frozen/language/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,55 @@
+module LanguageSpecs
+  class ClassWith_to_s
+    def initialize(to_s_callback = nil)
+      @to_s_callback = to_s_callback
+    end
+    
+    def to_s
+      if @to_s_callback then
+        @to_s_callback.call()
+      else
+        "class_with_to_s"
+      end
+    end
+  end
+
+  class ClassWithout_to_s
+    undef :to_s
+  end
+  
+  #############################################################################
+  # Regexp support
+  #############################################################################
+
+  def self.paired_delimiters
+    [%w[( )], %w[{ }], %w[< >], ["[", "]"]]
+  end
+  
+  def self.non_paired_delimiters
+    %w[~ ! # $ % ^ & * _ + ` - = " ' , . ? / | \\]
+  end
+  
+  def self.blanks
+    " \t"
+  end
+  
+  def self.white_spaces
+    ruby_version_is "1.9" do
+      # 1.9 treats \v as white space.
+      return blanks + "\f\n\r\v"
+    end
+    return blanks + "\f\n\r"
+  end
+  
+  def self.non_alphanum_non_space
+    '~!@#$%^&*()+-\|{}[]:";\'<>?,./'
+  end
+  
+  def self.punctuations
+    ",.?" # TODO - Need to fill in the full list
+  end
+  
+  def self.get_regexp_with_substitution o
+    /#{o}/o
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/fixtures/ensure.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/fixtures/ensure.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/fixtures/ensure.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,72 @@
+module EnsureSpec
+  class Container
+    attr_reader :executed
+    
+    def initialize
+      @executed = []
+    end
+    
+    def raise_in_method_with_ensure
+      @executed << :method
+      raise "An Exception"
+    ensure
+      @executed << :ensure
+    end
+    
+    def raise_and_rescue_in_method_with_ensure
+      @executed << :method
+      raise "An Exception"
+    rescue
+      @executed << :rescue
+    ensure
+      @executed << :ensure
+    end
+    
+    def throw_in_method_with_ensure
+      @executed << :method
+      throw(:symbol)
+    ensure
+      @executed << :ensure
+    end
+    
+    def implicit_return_in_method_with_ensure
+      :method
+    ensure
+      :ensure
+    end
+
+    def explicit_return_in_method_with_ensure
+      return :method
+    ensure
+      return :ensure
+    end
+  end
+end
+
+module EnsureSpec
+
+  class Test
+
+    def initialize
+      @values = []
+    end
+
+    attr_reader :values
+  
+    def call_block
+      begin
+        @values << :start
+        yield
+      ensure
+        @values << :end
+      end
+    end
+
+    def do_test
+      call_block do
+        @values << :in_block
+        return :did_test
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/fixtures/predefined.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/fixtures/predefined.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/fixtures/predefined.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+puts Object.const_defined?(:DATA)
+__END__

Added: MacRuby/branches/experimental/spec/frozen/language/fixtures/private.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/fixtures/private.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/fixtures/private.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,63 @@
+module Private
+  class A
+    def foo
+      "foo"
+    end
+
+    private
+    def bar
+      "bar"
+    end
+  end
+
+  class B
+    def foo
+      "foo"
+    end
+
+    private
+    class C
+      def baz
+        "baz"
+      end
+    end
+
+    class << self
+      def public_class_method1; 1; end
+      private 
+      def private_class_method1; 1; end
+    end
+    def self.public_class_method2; 2; end
+
+    def bar
+      "bar"
+    end
+  end
+  
+  module D
+    private
+    def foo
+      "foo"
+    end
+  end
+   
+   class E
+     include D
+   end
+
+   class F
+     def foo
+       "foo"
+     end
+   end
+
+   class G
+     def foo
+       "foo"
+     end
+   end
+
+   class H < A
+     private :foo
+   end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/fixtures/super.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/fixtures/super.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/fixtures/super.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,183 @@
+module Super
+  module S1
+    class A
+      def foo(a)
+        a << "A#foo"
+        bar(a)
+      end
+      def bar(a)
+        a << "A#bar"
+      end
+    end
+    class B < A    
+      def foo(a)
+        a << "B#foo"
+        super(a)
+      end
+      def bar(a)
+        a << "B#bar"
+        super(a)
+      end
+    end
+  end
+
+  module S2
+    class A
+      def baz(a)
+        a << "A#baz"
+      end
+    end
+    class B < A
+      def foo(a)
+        a << "B#foo"
+        baz(a)
+      end
+    end
+    class C < B
+      def baz(a)
+        a << "C#baz"
+        super(a)
+      end
+    end
+  end
+
+  module S3
+    class A
+      def foo(a)
+        a << "A#foo"
+      end
+      def self.foo(a)
+        a << "A::foo"
+      end
+      def self.bar(a)
+        a << "A::bar"
+        foo(a)
+      end
+    end
+    class B < A
+      def self.foo(a)
+        a << "B::foo"
+        super(a)
+      end
+      def self.bar(a)
+        a << "B::bar"
+        super(a)
+      end
+    end
+  end
+  
+  module S4
+    class A
+      def foo(a)
+        a << "A#foo"
+      end
+    end
+    class B < A
+      def foo(a, b)
+        a << "B#foo(a,#{b})"
+        super(a)
+      end
+    end
+  end
+
+  module MS1
+    module ModA
+      def foo(a)
+        a << "ModA#foo"
+        bar(a)
+      end      
+      def bar(a)
+        a << "ModA#bar"
+      end
+    end
+    class A
+      include ModA
+    end
+    module ModB
+      def bar(a)
+        a << "ModB#bar"
+        super(a)
+      end
+    end
+    class B < A    
+      def foo(a)
+        a << "B#foo"
+        super(a)
+      end
+      include ModB
+    end
+  end
+  
+  module MS2
+    class A
+      def baz(a)
+        a << "A#baz"
+      end
+    end
+    module ModB
+      def foo(a)
+        a << "ModB#foo"
+        baz(a)
+      end
+    end
+    class B < A
+      include ModB
+    end
+    class C < B
+      def baz(a)
+        a << "C#baz"
+        super(a)
+      end
+    end
+  end
+  
+  module MS3
+    module ModA
+      def foo(a)
+        a << "ModA#foo"
+      end
+      def bar(a)
+        a << "ModA#bar"
+        foo(a)
+      end
+    end
+    class A
+      def foo(a)
+        a << "A#foo"
+      end
+      class << self
+        include ModA
+      end
+    end
+    class B < A
+      def self.foo(a)
+        a << "B::foo"
+        super(a)
+      end
+      def self.bar(a)
+        a << "B::bar"
+        super(a)
+      end
+    end
+  end  
+
+  module MS4
+    module Layer1
+      def example
+        5
+      end
+    end
+
+    module Layer2
+      include Layer1
+      def example
+        super
+      end
+    end
+
+    class A
+      include Layer2
+      public :example
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/fixtures/variables.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/fixtures/variables.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/fixtures/variables.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,45 @@
+module VariablesSpecs
+  class ParAsgn
+    attr_accessor :x
+
+    def initialize
+      @x = 0
+    end
+
+    def inc
+      @x += 1
+    end
+
+    def to_ary
+      [1,2,3,4]
+    end
+  end
+
+  class OpAsgn
+    attr_accessor :a, :b, :side_effect
+    
+    def do_side_effect
+      self.side_effect = true
+      return @a
+    end
+
+    def do_more_side_effects
+      @a += 5
+      self
+    end
+
+    def do_bool_side_effects
+      @b += 1
+      self
+    end
+  end
+
+  class Hashalike
+    def [](k) k end
+    def []=(k, v) [k, v] end
+  end
+
+  def self.reverse_foo(a, b)
+    return b, a
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/fixtures/yield.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/fixtures/yield.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/fixtures/yield.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+module YieldSpecs
+  def self.no_block
+    yield
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/for_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/for_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/for_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,165 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+# for name[, name]... in expr [do]
+#   body
+# end
+describe "The for expression" do
+  it "iterates over an Enumerable passing each element to the block" do
+    j = 0
+    for i in 1..3
+      j += i
+    end
+    j.should == 6
+  end
+
+  it "iterates over an Hash passing each key-value pair to the block" do
+    k = 0
+    l = 0
+    
+    for i, j in { 1 => 10, 2 => 20 }
+      k += i
+      l += j
+    end
+    
+    k.should == 3
+    l.should == 30
+  end
+  
+  it "iterates over any object responding to 'each'" do
+    class XYZ
+      def each
+        (0..10).each { |i| yield i }
+      end
+    end
+    
+    j = 0
+    for i in XYZ.new
+      j += i
+    end
+    j.should == 55
+  end
+
+  it "allows an instance variable as an iterator name" do
+    m = [1,2,3]
+    n = 0
+    for @var in m
+      n += 1
+    end
+    @var.should == 3
+    n.should == 3
+  end
+  
+  # TODO: commented out due to a compiler error
+  #it "allows a class variable as an iterator name" do
+  #  m = [1,2,3]
+  #  n = 0
+  #  for @@var in m
+  #    n += 1
+  #  end
+  #  @@var.should == 3
+  #  n.should == 3
+  #end
+
+  it "splats multiple arguments together if there are fewer arguments than values" do
+    class OFor
+      def each
+        [[1,2,3], [4,5,6]].each do |a|
+          yield(a[0],a[1],a[2])
+        end
+      end
+    end
+    o = OFor.new
+    qs = []
+    for q in o
+      qs << q
+    end
+    qs.should == [[1,2,3], [4,5,6]]
+    q.should == [4,5,6]
+  end
+  
+  it "optionally takes a 'do' after the expression" do
+    j = 0
+    for i in 1..3 do
+      j += i
+    end
+    j.should == 6
+  end
+  
+  it "allows body begin on the same line if do is used" do
+    j = 0
+    for i in 1..3 do j += i
+    end
+    j.should == 6
+  end
+  
+  it "executes code in containing variable scope" do
+    for i in 1..2
+      a = 123
+    end
+    
+    a.should == 123
+  end
+  
+  it "executes code in containing variable scope with 'do'" do
+    for i in 1..2 do
+      a = 123
+    end
+    
+    a.should == 123
+  end
+
+  it "returns expr" do
+    for i in 1..3; end.should == (1..3)
+    for i,j in { 1 => 10, 2 => 20 }; end.should == { 1 => 10, 2 => 20 }
+  end
+
+  it "breaks out of a loop upon 'break', returning nil" do
+    j = 0
+    for i in 1..3
+      j += i
+
+      break if i == 2
+    end.should == nil
+    
+    j.should == 3
+  end
+  
+  it "allows 'break' to have an argument which becomes the value of the for expression" do
+    for i in 1..3
+      break 10 if i == 2
+    end.should == 10
+  end
+
+  it "starts the next iteration with 'next'" do
+    j = 0
+    for i in 1..5
+      next if i == 2
+
+      j += i
+    end
+    
+    j.should == 13
+  end
+  
+  it "repeats current iteration with 'redo'" do
+    j = 0
+    for i in 1..3
+      j += i
+      
+      redo if i == 2 && j < 4
+    end
+    
+    j.should == 8
+  end
+  
+  it "repeats the loop from the beginning with 'retry'" do
+    j = 0
+    for i in 1..5
+      j += i
+      
+      retry if i == 3 && j < 7
+    end
+    
+    j.should == 21
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/hash_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/hash_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/hash_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe "Hash literal" do
+  it "{} should return an empty hash" do
+    {}.size.should == 0
+    {}.should == {}
+  end
+
+  it "{} should return a new hash populated with the given elements" do
+    h = {:a => 'a', 'b' => 3, 44 => 2.3}
+    h.size.should == 3
+    h.should == {:a => "a", "b" => 3, 44 => 2.3}
+  end
+
+  it "treats empty expressions as nils" do
+    h = {() => ()}
+    h.keys.should == [nil]
+    h.values.should == [nil]
+    h[nil].should == nil
+
+    h = {() => :value}
+    h.keys.should == [nil]
+    h.values.should == [:value]
+    h[nil].should == :value
+
+    h = {:key => ()}
+    h.keys.should == [:key]
+    h.values.should == [nil]
+    h[:key].should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/if_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/if_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/if_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,352 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe "The if expression" do
+  it "evaluates body if expression is true" do
+    a = []
+    if true
+      a << 123
+    end
+    a.should == [123]
+  end
+
+  it "does not evaluate body if expression is false" do
+    a = []
+    if false
+      a << 123
+    end
+    a.should == []
+  end
+
+  it "does not evaluate body if expression is empty" do
+    a = []
+    if ()
+      a << 123
+    end
+    a.should == []
+  end
+
+  it "does not evaluate else-body if expression is true" do
+    a = []
+    if true
+      a << 123
+    else
+      a << 456
+    end
+    a.should == [123]
+  end
+
+  it "evaluates only else-body if expression is false" do
+    a = []
+    if false
+      a << 123
+    else
+      a << 456
+    end
+    a.should == [456]
+  end
+
+  it "returns result of then-body evaluation if expression is true" do
+    if true
+      123
+    end.should == 123
+  end
+
+  it "returns result of last statement in then-body if expression is true" do
+    if true
+      'foo'
+      'bar'
+      'baz'
+    end.should == 'baz'
+  end
+
+  it "returns result of then-body evaluation if expression is true and else part is present" do
+    if true
+      123
+    else
+      456
+    end.should == 123
+  end
+
+  it "returns result of else-body evaluation if expression is false" do
+    if false
+      123
+    else
+      456
+    end.should == 456
+  end
+
+  it "returns nil if then-body is empty and expression is true" do
+    if true
+    end.should == nil
+  end
+
+  it "returns nil if then-body is empty, expression is true and else part is present" do
+    if true
+    else
+      456
+    end.should == nil
+  end
+
+  it "returns nil if then-body is empty, expression is true and else part is empty" do
+    if true
+    else
+    end.should == nil
+  end
+
+  it "returns nil if else-body is empty and expression is false" do
+    if false
+      123
+    else
+    end.should == nil
+  end
+
+  it "returns nil if else-body is empty, expression is false and then-body is empty" do
+    if false
+    else
+    end.should == nil
+  end
+
+  it "considers an expression with nil result as false" do
+    if nil
+      123
+    else
+      456
+    end.should == 456
+  end
+
+  it "considers a non-nil and non-boolean object in expression result as true" do
+    if mock('x')
+      123
+    else
+      456
+    end.should == 123
+  end
+
+  it "considers a zero integer in expression result as true" do
+    if 0
+      123
+    else
+      456
+    end.should == 123
+  end
+
+  it "allows starting then-body on the same line if colon is used" do
+    if true: 123
+    else
+      456
+    end.should == 123
+  end
+
+  it "allows starting else-body on the same line" do
+    if false
+      123
+    else 456
+    end.should == 456
+  end
+
+  it "allows both then- and else-bodies start on the same line (with colon after expression)" do
+    if false: 123
+    else 456
+    end.should == 456
+  end
+
+  it "evaluates subsequent elsif statements and execute body of first matching" do
+    if false
+      123
+    elsif false
+      234
+    elsif true
+      345
+    elsif true
+      456
+    end.should == 345
+  end
+
+  it "evaluates else-body if no if/elsif statements match" do
+    if false
+      123
+    elsif false
+      234
+    elsif false
+      345
+    else
+      456
+    end.should == 456
+  end
+
+  it "allows ':' after expression when then-body is on the next line" do
+    if true:
+      123
+    end.should == 123
+
+    if true; 123; end.should == 123
+  end
+
+  it "allows 'then' after expression when then-body is on the next line" do
+    if true then
+      123
+    end.should == 123
+
+    if true then ; 123; end.should == 123
+  end
+
+  it "allows then-body on the same line separated with ':'" do
+    if true: 123
+    end.should == 123
+
+    if true: 123; end.should == 123
+  end
+
+  it "allows then-body on the same line separated with 'then'" do
+    if true then 123
+    end.should == 123
+
+    if true then 123; end.should == 123
+  end
+
+  it "returns nil when then-body on the same line separated with ':' and expression is false" do
+    if false: 123
+    end.should == nil
+
+    if false: 123; end.should == nil
+  end
+
+  it "returns nil when then-body on the same line separated with 'then' and expression is false" do
+    if false then 123
+    end.should == nil
+
+    if false then 123; end.should == nil
+  end
+
+  it "returns nil when then-body separated by ':' is empty and expression is true" do
+    if true:
+    end.should == nil
+
+    if true: ; end.should == nil
+  end
+
+  it "returns nil when then-body separated by 'then' is empty and expression is true" do
+    if true then
+    end.should == nil
+
+    if true then ; end.should == nil
+  end
+
+  it "returns nil when then-body separated by ':', expression is false and no else part" do
+    if false:
+    end.should == nil
+
+    if false: ; end.should == nil
+  end
+
+  it "returns nil when then-body separated by 'then', expression is false and no else part" do
+    if false then
+    end.should == nil
+
+    if false then ; end.should == nil
+  end
+
+  it "evaluates then-body when then-body separated by ':', expression is true and else part is present" do
+    if true: 123
+    else 456
+    end.should == 123
+
+    if true: 123; else 456; end.should == 123
+  end
+
+  it "evaluates then-body when then-body separated by 'then', expression is true and else part is present" do
+    if true then 123
+    else 456
+    end.should == 123
+
+    if true then 123; else 456; end.should == 123
+  end
+
+  it "evaluates else-body when then-body separated by ':' and expression is false" do
+    if false: 123
+    else 456
+    end.should == 456
+
+    if false: 123; else 456; end.should == 456
+  end
+
+  it "evaluates else-body when then-body separated by 'then' and expression is false" do
+    if false then 123
+    else 456
+    end.should == 456
+
+    if false then 123; else 456; end.should == 456
+  end
+
+  it "allows elsif-body at the same line separated by ':' or 'then'" do
+    if false then 123
+    elsif false: 234
+    elsif true then 345
+    elsif true: 456
+    end.should == 345
+
+    if false: 123; elsif false then 234; elsif true: 345; elsif true then 456; end.should == 345
+  end
+end
+
+describe "The postfix if form" do
+  it "evaluates statement if expression is true" do
+    a = []
+    a << 123 if true
+    a.should == [123]
+  end
+
+  it "does not evaluate statement if expression is false" do
+    a = []
+    a << 123 if false
+    a.should == []
+  end
+
+  it "returns result of expression if value is true" do
+    (123 if true).should == 123
+  end
+
+  it "returns nil if expression is false" do
+    (123 if false).should == nil
+  end
+
+  it "considers a nil expression as false" do
+    (123 if nil).should == nil
+  end
+
+  it "considers a non-nil object as true" do
+    (123 if mock('x')).should == 123
+  end
+
+  it "evaluates then-body in containing scope" do
+    a = 123
+    if true
+      b = a+1
+    end
+    b.should == 124
+  end
+
+  it "evaluates else-body in containing scope" do
+    a = 123
+    if false
+      b = a+1
+    else
+      b = a+2
+    end
+    b.should == 125
+  end
+
+  it "evaluates elsif-body in containing scope" do
+    a = 123
+    if false
+      b = a+1
+    elsif false
+      b = a+2
+    elsif true
+      b = a+3
+    else
+      b = a+4
+    end
+    b.should == 126
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/line_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/line_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/line_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe "The __LINE__ constant" do
+  it "increments for each line" do    
+    cline = __LINE__
+    __LINE__.should == cline + 1
+    # comment is at cline + 2
+    __LINE__.should == cline + 3
+  end
+
+  it "is eval aware" do
+    eval("__LINE__").should == 1    
+    cmd =<<EOF
+# comment at line 1
+__LINE__
+EOF
+    eval(cmd).should == 2
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/loop_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/loop_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/loop_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,68 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe "The loop expression" do
+  
+  it "repeats the given block until a break is called" do
+    outer_loop = 0
+    loop do
+      outer_loop += 1
+      break if outer_loop == 10
+    end
+    outer_loop.should == 10
+  end
+  
+  it "executes code in its own scope" do
+    loop do
+      inner_loop = 123
+      break
+    end
+    lambda { inner_loop }.should raise_error(NameError)
+  end
+  
+  it "returns the value passed to break if interrupted by break" do
+    loop do
+      break 123
+    end.should == 123
+  end
+  
+  it "returns nil if interrupted by break with no arguments" do
+    loop do
+      break
+    end.should == nil
+  end
+
+  it "skips to end of body with next" do
+    a = []
+    i = 0
+    loop do
+      break if (i+=1) >= 5
+      next if i == 3
+      a << i
+    end
+    a.should == [1, 2, 4]
+  end
+  
+  it "restarts the current iteration with redo" do
+    a = []
+    loop do
+      a << 1
+      redo if a.size < 2
+      a << 2
+      break if a.size == 3      
+    end
+    a.should == [1, 1, 2]
+  end
+
+  it "uses a spaghetti nightmare of redo, next and break" do
+    a = []
+    loop do
+      a << 1
+      redo if a.size == 1
+      a << 2
+      next if a.size == 3
+      a << 3
+      break if a.size > 6
+    end
+    a.should == [1, 1, 2, 1, 2, 3, 1, 2, 3]
+  end  
+end

Added: MacRuby/branches/experimental/spec/frozen/language/magic_comment_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/magic_comment_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/magic_comment_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,60 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+ruby_version_is "1.9" do
+  describe "Magic comment" do
+    it "is optional" do
+      lambda { eval("__ENCODING__") }.should_not raise_error(SyntaxError)
+    end
+
+    it "determines __ENCODING__" do
+      eval(<<EOS.force_encoding("US-ASCII")).should == Encoding::ASCII_8BIT
+# coding: ASCII-8BIT
+__ENCODING__
+EOS
+    end
+
+    it "is case-insensitive" do
+      eval(<<EOS.force_encoding("US-ASCII")).should == Encoding::ASCII_8BIT
+# CoDiNg:   aScIi-8bIt
+__ENCODING__
+EOS
+    end
+
+    it "must be at the first line" do
+      eval(<<EOS.force_encoding("US-ASCII")).should == Encoding::US_ASCII
+
+# coding: ASCII-8BIT
+__ENCODING__
+EOS
+    end
+
+    it "must be at the first of line" do
+      eval(<<EOS.force_encoding("US-ASCII")).should == Encoding::US_ASCII
+1+1 # coding: ASCII-8BIT
+__ENCODING__
+EOS
+    end
+
+    it "can be after the shebang" do
+      eval(<<EOS.force_encoding("US-ASCII")).should == Encoding::ASCII_8BIT
+#!/usr/bin/ruby -Ku
+# coding: ASCII-8BIT
+__ENCODING__
+EOS
+    end
+
+    it "can take Emacs style" do
+      eval(<<EOS.force_encoding("US-ASCII")).should == Encoding::ASCII_8BIT
+# -*- coding: ascii-8bit -*-
+__ENCODING__
+EOS
+    end
+
+    it "can take vim style" do
+      eval(<<EOS.force_encoding("US-ASCII")).should == Encoding::ASCII_8BIT
+# vim: filetype=ruby, fileencoding=ascii-8bit, tabsize=3, shiftwidth=3
+__ENCODING__
+EOS
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/metaclass_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/metaclass_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/metaclass_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,126 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/class'
+
+describe "self in a metaclass body (class << obj)" do
+  it "is TrueClass for true" do
+    class << true; self; end.should == TrueClass
+  end
+
+  it "is FalseClass for false" do
+    class << false; self; end.should == FalseClass
+  end
+
+  it "is NilClass for nil" do
+    class << nil; self; end.should == NilClass
+  end
+
+  it "raises a TypeError for numbers" do
+    lambda { class << 1; self; end }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError for symbols" do
+    lambda { class << :symbol; self; end }.should raise_error(TypeError)
+  end
+
+  it "is a singleton Class instance" do
+    cls = class << mock('x'); self; end
+    cls.is_a?(Class).should == true
+    cls.should_not equal(Object)
+  end
+  
+  deviates_on(:rubinius) do 
+    it "is a MetaClass instance" do
+      cls = class << mock('x'); self; end
+      cls.is_a?(MetaClass).should == true
+    end
+
+    it "has the object's class as superclass" do
+      cls = class << "blah"; self; end
+      cls.superclass.should == String
+    end
+  end
+end
+
+describe "A constant on a metaclass" do
+  before(:each) do
+    @object = Object.new
+    class << @object
+      CONST = self
+    end
+  end
+
+  it "can be accessed after the metaclass body is reopened" do
+    class << @object
+      CONST.should == self
+    end
+  end
+
+  it "can be accessed via self::CONST" do
+    class << @object
+      self::CONST.should == self
+    end
+  end
+
+  it "can be accessed via const_get" do
+    class << @object
+      const_get(:CONST).should == self
+    end
+  end
+
+  it "is not defined on the object's class" do
+    @object.class.const_defined?(:CONST).should be_false
+  end
+
+  it "is not defined in the metaclass opener's scope" do
+    class << @object
+      CONST
+    end
+    lambda { CONST }.should raise_error(NameError)
+  end
+
+  it "cannot be accessed via object::CONST" do
+    lambda do
+      @object::CONST
+    end.should raise_error(TypeError)
+  end
+
+  it "raises a NameError for anonymous_module::CONST" do
+    @object = Class.new
+    class << @object
+      CONST = 100
+    end
+    
+    lambda do
+      @object::CONST
+    end.should raise_error(NameError)
+  end
+
+  it "appears in the metaclass constant list" do
+    constants = class << @object; constants; end 
+    constants.should include("CONST")
+  end
+
+  it "does not appear in the object's class constant list" do
+    @object.class.constants.should_not include("CONST")
+  end
+
+  it "is not preserved when the object is duped" do
+    @object = @object.dup
+
+    lambda do
+      class << @object; CONST; end
+    end.should raise_error(NameError)
+  end
+
+  it "is preserved when the object is cloned" do
+    @object = @object.clone
+
+    class << @object
+      CONST.should_not be_nil
+    end
+  end
+end
+
+
+
+

Added: MacRuby/branches/experimental/spec/frozen/language/method_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/method_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/method_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,260 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+# Why so many fixed arg tests?  JRuby and I assume other Ruby impls have
+# separate call paths for simple fixed arity methods.  Testing up to five
+# will verify special and generic arity code paths for all impls.
+#
+# Method naming conventions:
+# P - Pre Required Args
+# O - Optional Arg
+# R - Rest Arg
+# Q - Post Required Args (1.9)
+
+describe "Calling a method" do
+  it "with no arguments is ok" do
+    def fooP0; 100 end
+
+    fooP0.should == 100
+  end
+
+  it "with simple required arguments works" do
+    def fooP1(a); [a]; end
+    fooP1(1).should == [1]
+
+    def fooP2(a,b); [a,b]; end
+    fooP2(1,2).should == [1,2]
+
+    def fooP3(a,b,c); [a,b,c]; end
+    fooP3(1,2,3).should == [1,2,3]
+
+    def fooP4(a,b,c,d); [a,b,c,d]; end
+    fooP4(1,2,3,4).should == [1,2,3,4]
+
+    def fooP5(a,b,c,d,e); [a,b,c,d,e]; end
+    fooP5(1,2,3,4,5).should == [1,2,3,4,5]
+  end
+
+  it "works with optional arguments" do
+    def fooP0O1(a=1); [a]; end
+    fooP0O1().should == [1]
+
+    def fooP1O1(a,b=1); [a,b]; end
+    fooP1O1(1).should == [1,1]
+
+    def fooP2O1(a,b,c=1); [a,b,c]; end
+    fooP2O1(1,2).should == [1,2,1]
+
+    def fooP3O1(a,b,c,d=1); [a,b,c,d]; end
+    fooP3O1(1,2,3).should == [1,2,3,1]
+
+    def fooP4O1(a,b,c,d,e=1); [a,b,c,d,e]; end
+    fooP4O1(1,2,3,4).should == [1,2,3,4,1]
+
+    def fooP0O2(a=1,b=2); [a,b]; end
+    fooP0O2().should == [1,2]
+  end
+
+  it "works with rest arguments" do
+    def fooP0R(*r); r; end
+    fooP0R().should == []
+    fooP0R(1).should == [1]
+    fooP0R(1,2).should == [1, 2]
+
+    def fooP1R(a, *r); [a, r]; end
+    fooP1R(1).should == [1, []]
+    fooP1R(1,2).should == [1, [2]]
+
+    def fooP0O1R(a=1, *r); [a, r]; end
+    fooP0O1R().should == [1, []]
+    fooP0O1R(2).should == [2, []]
+    fooP0O1R(2,3).should == [2, [3]]
+
+    def fooP1O1R(a, b=1, *r); [a, b, r]; end
+    fooP1O1R(1).should == [1, 1, []]
+    fooP1O1R(1,2).should == [1, 2, []]
+    fooP1O1R(1,2,3).should == [1, 2, [3]]
+  end
+
+  it "with an empty expression is like calling with nil argument" do
+    def foo(a); a end
+    foo(()).should be_nil
+  end
+
+  it "with block as block argument is ok" do
+    def foo(a,&b); [a,yield(b)] end
+
+    foo(10) do 200 end.should == [10,200]
+    foo(10) { 200 }.should == [10,200]
+  end
+
+  it "with block argument converts the block to proc" do
+    def makeproc(&b) b end
+    makeproc { "hello" }.call.should == "hello"
+    makeproc { "hello" }.class.should == Proc
+
+    # check that converted proc is indeed behaves like proc,
+    # not like lambda
+    def proc_caller(&b) b.call end
+    def enclosing_method
+      proc_caller { return :break_return_value }
+      :method_return_value
+    end
+
+    enclosing_method.should == :break_return_value
+  end
+
+  it "with an object that responds to 'to_proc' as a block argument coerces it to a proc" do
+    x = "my proc"
+    class << x
+      def to_proc; Proc.new {|y| self + y}; end
+    end
+
+    def foo(&b); b.call(" called"); end
+    def foo2; yield(" yielded"); end
+
+    foo(&x).should == "my proc called"
+    foo2(&x).should == "my proc yielded"
+  end
+  it "fails with both lambda and block argument" do
+    def foo(a,&b); [a,yield(b)] end
+
+    l = lambda { 300 }
+    lambda { eval "foo(10, &l){ 42}"}.should raise_error(SyntaxError)
+  end
+
+  it "with same names as existing variables is ok" do
+    foobar = 100
+
+    def foobar; 200; end
+
+    foobar.should == 100
+    foobar().should == 200
+  end
+
+  it "with splat operator * and literal array unpacks params" do
+    def fooP3(a,b,c); [a,b,c] end
+
+    fooP3(*[1,2,3]).should == [1,2,3]
+  end
+
+  it "with splat operator * and referenced array unpacks params" do
+    def fooP3(a,b,c); [a,b,c] end
+
+    a = [1,2,3]
+    fooP3(*a).should == [1,2,3]
+  end
+
+  it "without parentheses works" do
+    def fooP3(a,b,c); [a,b,c] end
+
+    (fooP3 1,2,3).should == [1,2,3]
+  end
+
+  it "with a space separating method name and parenthesis treats expression in parenthesis as first argument" do
+    def myfoo(x); x * 2 end
+    def mybar
+      # means myfoo((5).to_s)
+      # NOT   (myfoo(5)).to_s
+      myfoo (5).to_s
+    end
+
+    mybar().should == "55"
+  end
+
+  it "with invalid argument count raises an ArgumentError" do
+    def fooP3(a,b,c); end
+
+    lambda { fooP3 }.should raise_error(ArgumentError)
+    lambda { fooP3(1,2) }.should raise_error(ArgumentError)
+    lambda { fooP3(1,2,3,4) }.should raise_error(ArgumentError)
+    lambda { fooP3((), (), (), ()) }.should raise_error(ArgumentError)
+  end
+
+  # "Allows infinite arguments" is kinda hard to spec
+  it "allows any number of args beyond required to method with a splat" do
+    def foo(a, b, *c); [c.size, c.last]; end
+
+    a = Array.new(2500) { Object.new }
+    obj = a[-1]
+
+    lambda { foo 1 }.should raise_error(ArgumentError)
+
+    res = foo 1, 2
+    res.first.should == 0
+    res.last.nil?.should == true
+
+    res = foo 1, 2, 3
+    res.first.should == 1
+    res.last.should == 3
+
+    res = foo 1, 2, 3, *a
+    res.first.should == 2501
+    res.last.should equal(obj)
+  end
+
+  it "allows to pass literal hashes without curly braces as the last parameter" do
+    def foo(a,b,c); [a,b,c] end
+
+    foo('abc', 456, 'rbx' => 'cool', 'specs' => 'fail sometimes', 'oh' => 'weh').should ==
+      ['abc', 456, { 'rbx' => 'cool', 'specs' => 'fail sometimes', 'oh' => 'weh'}]
+
+    (foo 'abc', 456, 'rbx' => 'cool', 'specs' => 'fail sometimes', 'oh' => 'weh').should ==
+      ['abc', 456, { 'rbx' => 'cool', 'specs' => 'fail sometimes', 'oh' => 'weh'}]
+  end
+
+  it "allows to literal hashes without curly braces as the only parameter" do
+    def foo(a); a end
+
+    foo(:rbx => :cool, :specs => :fail_sometimes).should ==
+      { :rbx => :cool, :specs => :fail_sometimes }
+
+    (foo :rbx => :cool, :specs => :fail_sometimes).should ==
+      { :rbx => :cool, :specs => :fail_sometimes }
+  end
+
+end
+
+describe "Calling a private setter method" do
+  it "permits self as a receiver" do
+    module MethodSpecs
+      class PrivateSetter
+        attr_reader :foo
+        attr_writer :foo
+        private :foo=
+
+        def call_self_foo_equals(value)
+          self.foo = value
+        end
+      end
+    end
+
+    receiver = MethodSpecs::PrivateSetter.new
+    receiver.call_self_foo_equals(42)
+    receiver.foo.should == 42
+  end
+end
+
+describe "Calling a private getter method" do
+  it "does not permit self as a receiver" do
+    module MethodSpecs
+      class PrivateGetter
+        attr_reader :foo
+        private :foo
+
+        def call_self_foo
+          self.foo
+        end
+
+        def call_self_foo_or_equals(value)
+          self.foo ||= 6
+        end
+      end
+    end
+
+    receiver = MethodSpecs::PrivateGetter.new
+    lambda { receiver.call_self_foo }.should raise_error(NoMethodError)
+    lambda { receiver.call_self_foo_or_equals(6) }.should raise_error(NoMethodError)
+  end
+end
+
+language_version __FILE__, "method"

Added: MacRuby/branches/experimental/spec/frozen/language/module_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/module_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/module_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+module LangModuleSpec
+  module Sub1; end
+end
+
+module LangModuleSpec::Sub2; end
+
+describe "module" do
+  it "has the right name" do
+    LangModuleSpec::Sub1.name.should == "LangModuleSpec::Sub1"
+    LangModuleSpec::Sub2.name.should == "LangModuleSpec::Sub2"
+  end
+
+  it "gets a name when assigned to a constant" do
+    m = Module.new
+    LangModuleSpec::Anon = Module.new
+
+    m.name.should == ""
+    LangModuleSpec::Anon.name.should == "LangModuleSpec::Anon"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/next_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/next_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/next_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,168 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+class NextSpecs
+  def self.yielding_method(expected)
+    yield.should == expected
+    :method_return_value
+  end
+end
+
+describe "The next statement" do
+  it "raises a LocalJumpError if used not within block or while/for loop" do
+    def bad_meth; next; end
+    lambda { bad_meth }.should raise_error(LocalJumpError)
+  end
+end
+
+describe "The next statement from within the block" do
+  it "ends block execution" do
+    a = []
+    lambda {
+      a << 1
+      next
+      a << 2
+    }.call
+    a.should == [1]
+  end
+
+  it "causes block to return nil if invoked without arguments" do
+    lambda { 123; next; 456 }.call.should == nil
+  end
+
+  it "causes block to return nil if invoked with an empty expression" do
+    lambda { next (); 456 }.call.should be_nil
+  end
+
+  it "returns the argument passed" do
+    lambda { 123; next 234; 345 }.call.should == 234
+  end
+
+  it "returns to the invoking method" do
+    NextSpecs.yielding_method(nil) { next }.should == :method_return_value
+  end
+
+  it "returns to the invoking method, with the specified value" do
+    NextSpecs.yielding_method(nil) {
+      next nil;
+      fail("next didn't end the block execution")
+    }.should == :method_return_value
+
+    NextSpecs.yielding_method(1) {
+      next 1
+      fail("next didn't end the block execution")
+    }.should == :method_return_value
+
+    NextSpecs.yielding_method([1, 2, 3]) {
+      next 1, 2, 3
+      fail("next didn't end the block execution")
+    }.should == :method_return_value
+  end
+
+  it "returns to the currently yielding method in case of chained calls" do
+    class ChainedNextTest
+      def self.meth_with_yield(&b)
+        yield.should == :next_return_value
+        :method_return_value
+      end
+      def self.invoking_method(&b)
+        meth_with_yield(&b)
+      end
+      def self.enclosing_method
+        invoking_method do
+          next :next_return_value
+          :wrong_return_value
+        end
+      end
+    end
+
+    ChainedNextTest.enclosing_method.should == :method_return_value
+  end
+
+end
+
+describe "Assignment via next" do
+  it "assigns objects" do
+    def r(val); a = yield(); val.should == a; end
+    r(nil){next}
+    r(nil){next nil}
+    r(1){next 1}
+    r([]){next []}
+    r([1]){next [1]}
+    r([nil]){next [nil]}
+    r([[]]){next [[]]}
+    r([]){next [*[]]}
+    r([1]){next [*[1]]}
+    r([1,2]){next [*[1,2]]}
+  end
+  
+  it "assigns splatted objects" do
+    def r(val); a = yield(); val.should == a; end
+    r(nil){next *nil}
+    r(1){next *1}
+    r(nil){next *[]}
+    r(1){next *[1]}
+    r(nil){next *[nil]}
+    r([]){next *[[]]}
+    r(nil){next *[*[]]}
+    r(1){next *[*[1]]}
+    r([1,2]){next *[*[1,2]]}
+  end
+  
+  it "assigns objects to a splatted reference" do
+    def r(val); *a = yield(); val.should == a; end
+    r([nil]){next}
+    r([nil]){next nil}
+    r([1]){next 1}
+    r([[]]){next []}
+    r([[1]]){next [1]}
+    r([[nil]]){next [nil]}
+    r([[[]]]){next [[]]}
+    r([[1,2]]){next [1,2]}
+    r([[]]){next [*[]]}
+    r([[1]]){next [*[1]]}
+    r([[1,2]]){next [*[1,2]]}
+  end
+  
+  it "assigns splatted objects to a splatted reference via a splatted yield" do
+    def r(val); *a = *yield(); val.should == a; end
+    r([nil]){next *nil}
+    r([1]){next *1}
+    r([nil]){next *[]}
+    r([1]){next *[1]}
+    r([nil]){next *[nil]}
+    r([]){next *[[]]}
+    r([1,2]){next *[1,2]}
+    r([nil]){next *[*[]]}
+    r([1]){next *[*[1]]}
+    r([1,2]){next *[*[1,2]]}
+  end
+  
+  it "assigns objects to multiple variables" do
+    def r(val); a,b,*c = yield(); val.should == [a,b,c]; end
+    r([nil,nil,[]]){next}
+    r([nil,nil,[]]){next nil}
+    r([1,nil,[]]){next 1}
+    r([nil,nil,[]]){next []}
+    r([1,nil,[]]){next [1]}
+    r([nil,nil,[]]){next [nil]}
+    r([[],nil,[]]){next [[]]}
+    r([1,2,[]]){next [1,2]}
+    r([nil,nil,[]]){next [*[]]}
+    r([1,nil,[]]){next [*[1]]}
+    r([1,2,[]]){next [*[1,2]]}
+  end
+
+  it "assigns splatted objects to multiple variables" do
+   def r(val); a,b,*c = *yield(); val.should == [a,b,c]; end
+   r([nil,nil,[]]){next *nil}
+   r([1,nil,[]]){next *1}
+   r([nil,nil,[]]){next *[]}
+   r([1,nil,[]]){next *[1]}
+   r([nil,nil,[]]){next *[nil]}
+   r([nil,nil,[]]){next *[[]]}
+   r([1,2,[]]){next *[1,2]}
+   r([nil,nil,[]]){next *[*[]]}
+   r([1,nil,[]]){next *[*[1]]}
+   r([1,2,[]]){next *[*[1,2]]}
+ end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/not_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/not_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/not_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/language/numbers_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/numbers_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/numbers_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,56 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe "Ruby numbers in various ways" do
+
+  it "the standard way" do
+    435.should == 435
+  end
+
+  it "with underscore separations" do
+    4_35.should == 435
+  end
+
+  it "with some decimals" do
+    4.35.should == 4.35
+  end
+  
+  it "with decimals but no integer part should be a SyntaxError" do
+    lambda { eval(".75")  }.should raise_error(SyntaxError)
+    lambda { eval("-.75") }.should raise_error(SyntaxError)
+  end
+
+  # TODO : find a better description
+  it "using the e expression" do
+    1.2e-3.should == 0.0012
+  end
+
+  it "the hexdecimal notation" do
+    0xffff.should == 65535
+  end
+
+  it "the binary notation" do
+    0b01011.should == 11
+  end
+
+  it "octal representation" do
+    0377.should == 255
+  end
+
+  ruby_version_is '' ... '1.9' do
+    it "character to numeric shortcut" do
+      ?z.should == 122
+    end
+
+    it "character with control character to numeric shortcut" do
+      # Control-Z
+      ?\C-z.should == 26
+
+      # Meta-Z
+      ?\M-z.should == 250
+
+      # Meta-Control-Z
+      ?\M-\C-z.should == 154
+    end
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/language/or_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/or_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/or_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,64 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe "The || statement" do
+  it "evaluates to true if any of its operands are true" do
+    if false || true || nil
+      x = true
+    end
+    x.should == true
+  end
+  
+  it "evaluated to false if all of its operands are false" do
+    if false || nil
+      x = true
+    end
+    x.should == nil
+  end
+  
+  it "is evaluated before assignment operators" do
+    x = nil || true
+    x.should == true
+  end
+  
+  it "has a lower precedence than the && operator" do
+    x = 1 || false && x = 2
+    x.should == 1
+  end
+
+  it "treats empty expressions as nil" do
+    (() || true).should be_true
+    (() || false).should be_false
+    (true || ()).should be_true
+    (false || ()).should be_nil
+    (() || ()).should be_nil
+  end
+end
+
+describe "The or statement" do
+  it "evaluates to true if any of its operands are true" do
+    x = nil
+    if false or true
+      x = true
+    end
+    x.should == true
+  end
+  
+  it "is evaluated after variables are assigned" do
+    x = nil or true
+    x.should == nil
+  end
+
+  it "has a lower precedence than the || operator" do
+    x,y = nil
+    x = true || false or y = 1
+    y.should == nil
+  end
+
+  it "treats empty expressions as nil" do
+    (() or true).should be_true
+    (() or false).should be_false
+    (true or ()).should be_true
+    (false or ()).should be_nil
+    (() or ()).should be_nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/order_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/order_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/order_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,77 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe "A method call" do
+  before :each do
+    @obj = Object.new
+    def @obj.foo0(&a)
+      [a ? a.call : nil]
+    end
+    def @obj.foo1(a, &b)
+      [a, b ? b.call : nil]
+    end
+    def @obj.foo2(a, b, &c)
+      [a, b, c ? c.call : nil]
+    end
+    def @obj.foo3(a, b, c, &d)
+      [a, b, c, d ? d.call : nil]
+    end
+    def @obj.foo4(a, b, c, d, &e)
+      [a, b, c, d, e ? e.call : nil]
+    end
+  end
+
+  it "evaluates the receiver first" do
+    (obj = @obj).foo1(obj = nil).should == [nil, nil]
+    (obj = @obj).foo2(obj = nil, obj = nil).should == [nil, nil, nil]
+    (obj = @obj).foo3(obj = nil, obj = nil, obj = nil).should == [nil, nil, nil, nil]
+    (obj = @obj).foo4(obj = nil, obj = nil, obj = nil, obj = nil).should == [nil, nil, nil, nil, nil]
+  end
+
+  it "evaluates arguments after receiver" do
+    a = 0
+    (a += 1; @obj).foo1(a).should == [1, nil]
+    (a += 1; @obj).foo2(a, a).should == [2, 2, nil]
+    (a += 1; @obj).foo3(a, a, a).should == [3, 3, 3, nil]
+    (a += 1; @obj).foo4(a, a, a, a).should == [4, 4, 4, 4, nil]
+    a.should == 4
+  end
+
+  it "evaluates arguments left-to-right" do
+    a = 0
+    @obj.foo1(a += 1).should == [1, nil]
+    @obj.foo2(a += 1, a += 1).should == [2, 3, nil]
+    @obj.foo3(a += 1, a += 1, a += 1).should == [4, 5, 6, nil]
+    @obj.foo4(a += 1, a += 1, a += 1, a += 1).should == [7, 8, 9, 10, nil]
+    a.should == 10
+  end
+
+  ruby_bug "redmine #1034", "1.8" do
+    it "evaluates block pass after arguments" do
+      a = 0
+      p = proc {true}
+      @obj.foo1(a += 1, &(a += 1; p)).should == [1, true]
+      @obj.foo2(a += 1, a += 1, &(a += 1; p)).should == [3, 4, true]
+      @obj.foo3(a += 1, a += 1, a += 1, &(a += 1; p)).should == [6, 7, 8, true]
+      @obj.foo4(a += 1, a += 1, a += 1, a += 1, &(a += 1; p)).should == [10, 11, 12, 13, true]
+      a.should == 14
+    end
+ 
+    it "evaluates block pass after receiver" do
+      p1 = proc {true}
+      p2 = proc {false}
+      p1.should_not == p2
+  
+      p = p1
+      (p = p2; @obj).foo0(&p).should == [false]
+      p = p1
+      (p = p2; @obj).foo1(1, &p).should == [1, false]
+      p = p1
+      (p = p2; @obj).foo2(1, 1, &p).should == [1, 1, false]
+      p = p1
+      (p = p2; @obj).foo3(1, 1, 1, &p).should == [1, 1, 1, false]
+      p = p1
+      (p = p2; @obj).foo4(1, 1, 1, 1, &p).should == [1, 1, 1, 1, false]
+      p = p1
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/precedence_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/precedence_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/precedence_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,479 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+# Specifying the behavior of operators in combination could
+# lead to combinatorial explosion. A better way seems to be
+# to use a technique from formal proofs that involve a set of
+# equivalent statements. Suppose you have statements A, B, C.
+# If they are claimed to be equivalent, this can be shown by
+# proving that A implies B, B implies C, and C implies A.
+# (Actually any closed circuit of implications.)
+#
+# Here, we can use a similar technique where we show starting
+# at the top that each level of operator has precedence over
+# the level below (as well as showing associativity within
+# the precedence level).
+
+=begin
+Excerpted from 'Programming Ruby: The Pragmatic Programmer's Guide'
+Second Edition by Dave Thomas, Chad Fowler, and Andy Hunt, page 324
+
+Table 22.4. Ruby operators (high to low precedence)
+Method   Operator                  Description
+-----------------------------------------------------------------------
+         :: .
+ x*      [ ] [ ]=                  Element reference, element set
+ x       **                        Exponentiation
+ x       ! ~ + -                   Not, complement, unary plus and minus
+                                   (method names for the last two are +@ and -@)
+ x       * / %                     Multiply, divide, and modulo
+ x       + -                       Plus and minus
+ x       >> <<                     Right and left shift
+ x       &                         “And” (bitwise for integers)
+ x       ^ |                       Exclusive “or” and regular “or” (bitwise for integers)
+ x       <= < > >=                 Comparison operators
+ x       <=> == === != =~ !~       Equality and pattern match operators (!=
+                                   and !~ may not be defined as methods)
+         &&                        Logical “and”
+         ||                        Logical “or”
+         .. ...                    Range (inclusive and exclusive)
+         ? :                       Ternary if-then-else
+         = %= /= -= += |= &=       Assignment
+         >>= <<= *= &&= ||= **=
+         defined?                  Check if symbol defined
+         not                       Logical negation
+         or and                    Logical composition
+         if unless while until     Expression modifiers
+         begin/end                 Block expression
+-----------------------------------------------------------------------
+
+* Operators marked with 'x' in the Method column are implemented as methods
+and can be overridden (except != and !~ as noted). (But see the specs
+below for implementations that define != and !~ as methods.)
+
+** These are not included in the excerpted table but are shown here for
+completeness.
+=end
+
+# -----------------------------------------------------------------------
+# It seems that this table is not correct as of MRI 1.8.6
+# The correct table derived from MRI's parse.y is as follows:
+#
+# Operator              Assoc    Description
+#---------------------------------------------------------------
+# ! ~ +                   >      Not, complement, unary plus
+# **                      >      Exponentiation
+# -                       >      Unary minus
+# * / %                   <      Multiply, divide, and modulo
+# + -                     <      Plus and minus
+# >> <<                   <      Right and left shift
+# &                       <      “And” (bitwise for integers)
+# ^ |                     <      Exclusive “or” and regular “or” (bitwise for integers)
+# <= < > >=               <      Comparison operators
+# <=> == === != =~ !~     no     Equality and pattern match operators (!=
+#                                and !~ may not be defined as methods)
+# &&                      <      Logical “and”
+# ||                      <      Logical “or”
+# .. ...                  no     Range (inclusive and exclusive)
+# ? :                     >      Ternary if-then-else
+# rescue                  <      Rescue modifier
+# = %= /= -= += |= &=     >      Assignment
+# >>= <<= *= &&= ||= **=
+# defined?                no     Check if symbol defined
+# not                     >      Logical negation
+# or and                  <      Logical composition
+# if unless while until   no     Expression modifiers
+# -----------------------------------------------------------------------
+#
+# [] and []= seem to fall out of here, as well as begin/end
+#
+
+# TODO: Resolve these two tables with actual specs. As the comment at the
+# top suggests, these specs need to be reorganized into a single describe
+# block for each operator. The describe block should include an example
+# for associativity (if relevant), an example for any short circuit behavior
+# (e.g. &&, ||, etc.) and an example block for each operator over which the
+# instant operator has immediately higher precedence.
+
+describe "Operators" do
+  it "! ~ + is right-associative" do
+    (!!true).should == true
+    (~~0).should == 0
+    (++2).should == 2
+  end
+
+  it "! ~ + have a higher precedence than **" do
+    class FalseClass; def **(a); 1000; end; end
+    (!0**2).should == 1000
+    class FalseClass; undef_method :**; end
+
+    class UnaryPlusTest; def +@; 50; end; end
+    a = UnaryPlusTest.new
+    (+a**2).should == 2500
+
+    (~0**2).should == 1
+  end
+
+  it "** is right-associative" do
+    (2**2**3).should == 256
+  end
+
+  it "** has higher precedence than unary minus" do
+    (-2**2).should == -4
+  end
+
+  it "unary minus is right-associative" do
+    (--2).should == 2
+  end
+
+  it "unary minus has higher precedence than * / %" do
+    class UnaryMinusTest; def -@; 50; end; end
+    b = UnaryMinusTest.new
+
+    (-b * 5).should == 250
+    (-b / 5).should == 10
+    (-b % 7).should == 1
+  end
+
+  it "* / % are left-associative" do
+    (2*1/2).should     == (2*1)/2
+    # Guard against the Mathn library
+    # TODO: Make these specs not rely on specific behaviour / result values
+    # by using mocks.
+    conflicts_with :Prime do
+      (2*1/2).should_not == 2*(1/2)
+    end
+
+    (10/7/5).should     == (10/7)/5
+    (10/7/5).should_not == 10/(7/5)
+
+    (101 % 55 % 7).should     == (101 % 55) % 7
+    (101 % 55 % 7).should_not == 101 % (55 % 7)
+
+    (50*20/7%42).should     == ((50*20)/7)%42
+    (50*20/7%42).should_not == 50*(20/(7%42))
+  end
+
+  it "* / % have higher precedence than + -" do
+    (2+2*2).should == 6
+    (1+10/5).should == 3
+    (2+10%5).should == 2
+
+    (2-2*2).should == -2
+    (1-10/5).should == -1
+    (10-10%4).should == 8
+  end
+
+  it "+ - are left-associative" do
+    (2-3-4).should == -5
+    (4-3+2).should == 3
+
+    class BinaryPlusTest < String; alias_method :plus, :+; def +(a); plus(a) + "!"; end; end
+    s = BinaryPlusTest.new("a")
+
+    (s+s+s).should == (s+s)+s
+    (s+s+s).should_not == s+(s+s)
+  end
+
+  it "+ - have higher precedence than >> <<" do
+    (2<<1+2).should == 16
+    (8>>1+2).should == 1
+    (4<<1-3).should == 1
+    (2>>1-3).should == 8
+  end
+
+  it ">> << are left-associative" do
+    (1 << 2 << 3).should == 32
+    (10 >> 1 >> 1).should == 2
+    (10 << 4 >> 1).should == 80
+  end
+
+  it ">> << have higher precedence than &" do
+    (4 & 2 << 1).should == 4
+    (2 & 4 >> 1).should == 2
+  end
+
+  it "& is left-associative" do
+    class BitwiseAndTest; def &(a); a+1; end; end
+    c = BitwiseAndTest.new
+
+    (c & 5 & 2).should     == (c & 5) & 2
+    (c & 5 & 2).should_not == c & (5 & 2)
+  end
+
+  it "& has higher precedence than ^ |" do
+    (8 ^ 16 & 16).should == 24
+    (8 | 16 & 16).should == 24
+  end
+
+  it "^ | are left-associative" do
+    class OrAndXorTest; def ^(a); a+10; end; def |(a); a-10; end; end
+    d = OrAndXorTest.new
+
+    (d ^ 13 ^ 16).should     == (d ^ 13) ^ 16
+    (d ^ 13 ^ 16).should_not == d ^ (13 ^ 16)
+
+    (d | 13 | 4).should     == (d | 13) | 4
+    (d | 13 | 4).should_not == d | (13 | 4)
+  end
+
+  it "^ | have higher precedence than <= < > >=" do
+    (10 <= 7 ^ 7).should == false
+    (10 < 7 ^ 7).should == false
+    (10 > 7 ^ 7).should == true
+    (10 >= 7 ^ 7).should == true
+    (10 <= 7 | 7).should == false
+    (10 < 7 | 7).should == false
+    (10 > 7 | 7).should == true
+    (10 >= 7 | 7).should == true
+  end
+
+  it "<= < > >= are left-associative" do
+    class ComparisonTest
+      def <=(a); 0; end;
+      def <(a);  0; end;
+      def >(a);  0; end;
+      def >=(a); 0; end;
+    end
+
+    e = ComparisonTest.new
+
+    (e <= 0 <= 1).should     == (e <= 0) <= 1
+    (e <= 0 <= 1).should_not == e <= (0 <= 1)
+
+    (e < 0 < 1).should     == (e < 0) < 1
+    (e < 0 < 1).should_not == e < (0 < 1)
+
+    (e >= 0 >= 1).should     == (e >= 0) >= 1
+    (e >= 0 >= 1).should_not == e >= (0 >= 1)
+
+    (e > 0 > 1).should     == (e > 0) > 1
+    (e > 0 > 1).should_not == e > (0 > 1)
+  end
+
+  it "<= < > >= have higher precedence than <=> == === != =~ !~" do
+    (1 <=> 5 <  1).should == nil
+    (1 <=> 5 <= 1).should == nil
+    (1 <=> 5 >  1).should == nil
+    (1 <=> 5 >= 1).should == nil
+
+    (1 == 5 <  1).should == false
+    (1 == 5 <= 1).should == false
+    (1 == 5 >  1).should == false
+    (1 == 5 >= 1).should == false
+
+    (1 === 5 <  1).should == false
+    (1 === 5 <= 1).should == false
+    (1 === 5 >  1).should == false
+    (1 === 5 >= 1).should == false
+
+    (1 != 5 <  1).should == true
+    (1 != 5 <= 1).should == true
+    (1 != 5 >  1).should == true
+    (1 != 5 >= 1).should == true
+
+    (1 =~ 5 <  1).should == false
+    (1 =~ 5 <= 1).should == false
+    (1 =~ 5 >  1).should == false
+    (1 =~ 5 >= 1).should == false
+
+    (1 !~ 5 <  1).should == true
+    (1 !~ 5 <= 1).should == true
+    (1 !~ 5 >  1).should == true
+    (1 !~ 5 >= 1).should == true
+  end
+
+  it "<=> == === != =~ !~ are non-associative" do
+    lambda { eval("1 <=> 2 <=> 3")  }.should raise_error(SyntaxError)
+    lambda { eval("1 == 2 == 3")  }.should raise_error(SyntaxError)
+    lambda { eval("1 === 2 === 3")  }.should raise_error(SyntaxError)
+    lambda { eval("1 != 2 != 3")  }.should raise_error(SyntaxError)
+    lambda { eval("1 =~ 2 =~ 3")  }.should raise_error(SyntaxError)
+    lambda { eval("1 !~ 2 !~ 3")  }.should raise_error(SyntaxError)
+  end
+
+  it "<=> == === != =~ !~ have higher precedence than &&" do
+    (false && 2 <=> 3).should == false
+    (false && 3 == false).should == false
+    (false && 3 === false).should == false
+    (false && 3 != true).should == false
+
+    class FalseClass; def =~(o); o == false; end; end
+    (false && true =~ false).should     == (false && (true =~ false))
+    (false && true =~ false).should_not == ((false && true) =~ false)
+    class FalseClass; undef_method :=~; end
+
+    (false && true !~ true).should == false
+  end
+
+  # XXX: figure out how to test it
+  # (a && b) && c equals to a && (b && c) for all a,b,c values I can imagine so far
+  it "&& is left-associative"
+
+  it "&& has higher precedence than ||" do
+    (true || false && false).should == true
+  end
+
+  # XXX: figure out how to test it
+  it "|| is left-associative"
+
+  it "|| has higher precedence than .. ..." do
+    (1..false||10).should == (1..10)
+    (1...false||10).should == (1...10)
+  end
+
+  it ".. ... are non-associative" do
+    lambda { eval("1..2..3")  }.should raise_error(SyntaxError)
+    lambda { eval("1...2...3")  }.should raise_error(SyntaxError)
+  end
+
+# XXX: this is commented now due to a bug in compiler, which cannot
+# distinguish between range and flip-flop operator so far. zenspider is
+# currently working on a new lexer, which will be able to do that.
+# As soon as it's done, these piece should be reenabled.
+#
+#  it ".. ... have higher precedence than ? :" do
+#    (1..2 ? 3 : 4).should == 3
+#    (1...2 ? 3 : 4).should == 3
+#  end
+
+  it "? : is right-associative" do
+    (true ? 2 : 3 ? 4 : 5).should == 2
+  end
+
+  def oops; raise end
+
+  it "? : has higher precedence than rescue" do
+
+    (true ? oops : 0 rescue 10).should == 10
+  end
+
+  # XXX: figure how to test it (problem similar to || associativity)
+  it "rescue is left-associative"
+
+  it "rescue has higher precedence than =" do
+    a = oops rescue 10
+    a.should == 10
+
+    # rescue doesn't have the same sense for %= /= and friends
+  end
+
+  it "= %= /= -= += |= &= >>= <<= *= &&= ||= **= are right-associative" do
+    a = b = 10
+    a.should == 10
+    b.should == 10
+
+    a = b = 10
+    a %= b %= 3
+    a.should == 0
+    b.should == 1
+
+    a = b = 10
+    a /= b /= 2
+    a.should == 2
+    b.should == 5
+
+    a = b = 10
+    a -= b -= 2
+    a.should == 2
+    b.should == 8
+
+    a = b = 10
+    a += b += 2
+    a.should == 22
+    b.should == 12
+
+    a,b = 32,64
+    a |= b |= 2
+    a.should == 98
+    b.should == 66
+
+    a,b = 25,13
+    a &= b &= 7
+    a.should == 1
+    b.should == 5
+
+    a,b=8,2
+    a >>= b >>= 1
+    a.should == 4
+    b.should == 1
+
+    a,b=8,2
+    a <<= b <<= 1
+    a.should == 128
+    b.should == 4
+
+    a,b=8,2
+    a *= b *= 2
+    a.should == 32
+    b.should == 4
+
+    a,b=10,20
+    a &&= b &&= false
+    a.should == false
+    b.should == false
+
+    a,b=nil,nil
+    a ||= b ||= 10
+    a.should == 10
+    b.should == 10
+
+    a,b=2,3
+    a **= b **= 2
+    a.should == 512
+    b.should == 9
+  end
+
+  it "= %= /= -= += |= &= >>= <<= *= &&= ||= **= have higher precedence than defined? operator" do
+    (defined? a =   10).should_not == nil
+    (defined? a %=  10).should_not == nil
+    (defined? a /=  10).should_not == nil
+    (defined? a -=  10).should_not == nil
+    (defined? a +=  10).should_not == nil
+    (defined? a |=  10).should_not == nil
+    (defined? a &=  10).should_not == nil
+    (defined? a >>= 10).should_not == nil
+    (defined? a <<= 10).should_not == nil
+    (defined? a *=  10).should_not == nil
+    (defined? a &&= 10).should_not == nil
+    (defined? a ||= 10).should_not == nil
+    (defined? a **= 10).should_not == nil
+  end
+
+  # XXX: figure out how to test it
+  it "defined? is non-associative"
+
+  it "defined? has higher precedence than not" do
+    # does it have sense?
+    (not defined? qqq).should == true
+  end
+
+  it "not is right-associative" do
+    (not not false).should == false
+    (not not 10).should == true
+  end
+
+  it "not has higher precedence than or/and" do
+    (not false and false).should == false
+    (not false or true).should == true
+  end
+
+  # XXX: figure out how to test it
+  it "or/and are left-associative"
+
+  it "or/and have higher precedence than if unless while until modifiers" do
+    (1 if 2 and 3).should == 1
+    (1 if 2 or 3).should == 1
+
+    (1 unless false and true).should == 1
+    (1 unless false or false).should == 1
+
+    (1 while true and false).should == nil    # would hang upon error
+    (1 while false or false).should == nil
+
+    ((raise until true and false) rescue 10).should == 10
+    (1 until false or true).should == nil    # would hang upon error
+  end
+
+  # XXX: it seems to me they are right-associative
+  it "if unless while until are non-associative"
+end

Added: MacRuby/branches/experimental/spec/frozen/language/predefined_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/predefined_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/predefined_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,503 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+require 'stringio'
+
+# The following tables are excerpted from Programming Ruby: The Pragmatic Programmer's Guide'
+# Second Edition by Dave Thomas, Chad Fowler, and Andy Hunt, page 319-22.
+# 
+# Entries marked [r/o] are read-only and an error will be raised of the program attempts to
+# modify them. Entries marked [thread] are thread local.
+
+=begin
+Exception Information 
+---------------------------------------------------------------------------------------------------
+
+$!               Exception       The exception object passed to raise. [thread] 
+$@               Array           The stack backtrace generated by the last exception. [thread] 
+=end
+
+=begin
+Pattern Matching Variables 
+---------------------------------------------------------------------------------------------------
+
+These variables (except $=) are set to nil after an unsuccessful pattern match.
+
+$&               String          The string matched (following a successful pattern match). This variable is 
+                                 local to the current scope. [r/o, thread] 
+$+               String          The contents of the highest-numbered group matched following a successful 
+                                 pattern match. Thus, in "cat" =~/(c|a)(t|z)/, $+ will be set to “t”. This 
+                                 variable is local to the current scope. [r/o, thread] 
+$`               String          The string preceding the match in a successful pattern match. This variable 
+                                 is local to the current scope. [r/o, thread] 
+$'               String          The string following the match in a successful pattern match. This variable 
+                                 is local to the current scope. [r/o, thread] 
+$=               Object          Deprecated.1.8 If set to any value apart from nil or false, all pattern matches 
+                                 will be case insensitive, string comparisons will ignore case, and string hash 
+                                 values will be case insensitive. 
+$1 to $9         String          The contents of successive groups matched in a successful pattern match. In 
+                                 "cat" =~/(c|a)(t|z)/, $1 will be set to “a” and $2 to “t”. This variable 
+                                 is local to the current scope. [r/o, thread] 
+$~               MatchData       An object that encapsulates the results of a successful pattern match. The 
+                                 variables $&, $`, $', and $1 to $9 are all derived from $~. Assigning to $~ 
+                                 changes the values of these derived variables. This variable is local to the 
+                                 current scope. [thread] 
+=end
+
+
+describe "Predefined global $~" do
+  it "is set to contain the MatchData object of the last match if successful" do
+    md = /foo/.match 'foo'
+    $~.class.should == MatchData
+    $~.object_id.should == md.object_id
+
+    /bar/ =~ 'bar'
+    $~.class.should == MatchData
+    $~.object_id.should_not == md.object_id
+  end   
+
+  it "is set to nil if the last match was unsuccessful" do
+    /foo/ =~ 'foo'
+    $~.nil?.should == false
+
+    /foo/ =~ 'bar'
+    $~.nil?.should == true
+  end
+
+  it "is set at the method-scoped level rather than block-scoped" do
+    obj = Object.new
+    def obj.foo; yield; end
+    def obj.foo2(&proc); proc.call; end
+
+    match = /foo/.match "foo"
+
+    obj.foo { match = /bar/.match("bar") }
+
+    $~.should == match
+
+    eval 'match = /baz/.match("baz")'
+
+    $~.should == match
+
+    obj.foo2 { match = /qux/.match("qux") }
+
+    $~.should == match
+  end
+
+  it "raises an error if assigned an object not nil or instanceof MatchData" do
+    lambda { $~ = nil }.should_not raise_error
+    lambda { $~ = /foo/.match("foo") }.should_not raise_error
+    lambda { $~ = Object.new }.should raise_error(TypeError)
+    lambda { $~ = 1 }.should raise_error(TypeError)
+  end
+end
+
+describe "Predefined global $&" do
+  it "is equivalent to MatchData#[0] on the last match $~" do
+    /foo/ =~ 'barfoobaz'
+    $&.should == $~[0]
+    $&.should == 'foo'
+  end
+end
+
+describe "Predefined global $`" do
+  it "is equivalent to MatchData#pre_match on the last match $~" do
+    /foo/ =~ 'barfoobaz'
+    $`.should == $~.pre_match
+    $`.should == 'bar'
+  end
+end
+
+describe "Predefined global $'" do
+  it "is equivalent to MatchData#post_match on the last match $~" do
+    /foo/ =~ 'barfoobaz'
+    $'.should == $~.post_match
+    $'.should == 'baz'
+  end
+end
+
+describe "Predefined global $+" do
+  it "is equivalent to $~.captures.last" do
+    /(f(o)o)/ =~ 'barfoobaz'
+    $+.should == $~.captures.last
+    $+.should == 'o'
+  end
+end
+
+describe "Predefined globals $1..N" do
+  it "are equivalent to $~[N]" do
+    /(f)(o)(o)/ =~ 'foo'
+    $1.should == $~[1]
+    $2.should == $~[2]
+    $3.should == $~[3]
+    $4.should == $~[4]
+
+    [$1, $2, $3, $4].should == ['f', 'o', 'o', nil]
+  end
+
+  it "are nil unless a match group occurs" do
+    def test(arg)
+      case arg
+      when /-(.)?/
+        $1
+      end
+    end
+    test("-").should == nil
+  end
+end
+
+describe "Predefined global $stdout" do
+  before(:each) do
+    @old_stdout = $stdout
+  end
+
+  after(:each) do
+    $stdout = @old_stdout
+  end
+
+  ruby_version_is "" ... "1.9" do
+    it "is the same as $defout" do
+      $stdout.should == $defout
+
+      $stdout = IOStub.new
+      $stdout.should == $defout
+    end
+  end
+
+  it "is the same as $DEFAULT_OUTPUT from 'English' library" do
+    require 'English'
+    $stdout.should == $DEFAULT_OUTPUT
+
+    $stdout = IOStub.new
+    $stdout.should == $DEFAULT_OUTPUT
+  end
+
+  it "raises TypeError error if assigned to nil" do
+    lambda { $stdout = nil }.should raise_error(TypeError)
+  end
+
+  it "raises TypeError error if assigned to object that doesn't respond to #write" do
+    obj = mock('object')
+    lambda { $stdout = obj }.should raise_error(TypeError)
+
+    obj.stub!(:write)
+    lambda { $stdout = obj }.should_not raise_error()
+  end
+end
+
+=begin
+Input/Output Variables 
+---------------------------------------------------------------------------------------------------
+
+$/               String          The input record separator (newline by default). This is the value that rou- 
+                                 tines such as Kernel#gets use to determine record boundaries. If set to 
+                                 nil, gets will read the entire file. 
+$-0              String          Synonym for $/. 
+$\               String          The string appended to the output of every call to methods such as 
+                                 Kernel#print and IO#write. The default value is nil. 
+$,               String          The separator string output between the parameters to methods such as 
+                                 Kernel#print and Array#join. Defaults to nil, which adds no text. 
+$.               Fixnum          The number of the last line read from the current input file. 
+$;               String          The default separator pattern used by String#split. May be set from the 
+                                 command line using the -F flag.
+$<               Object          An object that provides access to the concatenation of the contents of all 
+                                 the files given as command-line arguments or $stdin (in the case where 
+                                 there are no arguments). $< supports methods similar to a File object: 
+                                 binmode, close, closed?, each, each_byte, each_line, eof, eof?, 
+                                 file, filename, fileno, getc, gets, lineno, lineno=, path, pos, pos=, 
+                                 read, readchar, readline, readlines, rewind, seek, skip, tell, to_a, 
+                                 to_i, to_io, to_s, along with the methods in Enumerable. The method 
+                                 file returns a File object for the file currently being read. This may change 
+                                 as $< reads through the files on the command line. [r/o] 
+$>               IO              The destination of output for Kernel#print and Kernel#printf. The 
+                                 default value is $stdout. 
+$_               String          The last line read by Kernel#gets or Kernel#readline. Many string- 
+                                 related functions in the Kernel module operate on $_ by default. The vari- 
+                                 able is local to the current scope. [thread] 
+$-F              String          Synonym for $;. 
+$stderr          IO              The current standard error output. 
+$stdin           IO              The current standard input. 
+$stdout          IO              The current standard output. Assignment to $stdout is deprecated: use 
+                                 $stdout.reopen instead. 
+=end
+
+
+describe "Predefined global $_" do
+  it "is set to the last line read by e.g. StringIO#gets" do
+    stdin = StringIO.new("foo\nbar\n", "r")
+
+    read = stdin.gets
+    read.should == "foo\n"
+    $_.should == read
+
+    read = stdin.gets
+    read.should == "bar\n"
+    $_.should == read
+
+    read = stdin.gets
+    read.should == nil
+    $_.should == read
+  end
+
+  it "is set at the method-scoped level rather than block-scoped" do
+    obj = Object.new
+    def obj.foo; yield; end
+    def obj.foo2; yield; end
+
+    stdin = StringIO.new("foo\nbar\nbaz\nqux\n", "r")
+    match = stdin.gets
+
+    obj.foo { match = stdin.gets }
+
+    match.should == "bar\n"
+    $_.should == match
+
+    eval 'match = stdin.gets'
+
+    match.should == "baz\n"
+    $_.should == match
+
+    obj.foo2 { match = stdin.gets }
+
+    match.should == "qux\n"
+    $_.should == match
+  end
+
+  it "can be assigned any value" do
+    lambda { $_ = nil }.should_not raise_error
+    lambda { $_ = "foo" }.should_not raise_error
+    lambda { $_ = Object.new }.should_not raise_error
+    lambda { $_ = 1 }.should_not raise_error
+  end
+end
+
+=begin
+Execution Environment Variables 
+---------------------------------------------------------------------------------------------------
+
+$0               String          The name of the top-level Ruby program being executed. Typically this will 
+                                 be the program’s filename. On some operating systems, assigning to this 
+                                 variable will change the name of the process reported (for example) by the 
+                                 ps(1) command. 
+$*               Array           An array of strings containing the command-line options from the invoca- 
+                                 tion of the program. Options used by the Ruby interpreter will have been 
+                                 removed. [r/o] 
+$"               Array           An array containing the filenames of modules loaded by require. [r/o] 
+$$               Fixnum          The process number of the program being executed. [r/o] 
+$?               Process::Status The exit status of the last child process to terminate. [r/o, thread] 
+$:               Array           An array of strings, where each string specifies a directory to be searched for 
+                                 Ruby scripts and binary extensions used by the load and require methods. 
+                                 The initial value is the value of the arguments passed via the -I command- 
+                                 line option, followed by an installation-defined standard library location, fol- 
+                                 lowed by the current directory (“.”). This variable may be set from within a 
+                                 program to alter the default search path; typically, programs use $: << dir 
+                                 to append dir to the path. [r/o] 
+$-a              Object          True if the -a option is specified on the command line. [r/o]
+$-d              Object          Synonym for $DEBUG. 
+$DEBUG           Object          Set to true if the -d command-line option is specified. 
+__FILE__         String          The name of the current source file. [r/o] 
+$F               Array           The array that receives the split input line if the -a command-line option is 
+                                 used. 
+$FILENAME        String          The name of the current input file. Equivalent to $<.filename. [r/o] 
+$-i              String          If in-place edit mode is enabled (perhaps using the -i command-line 
+                                 option), $-i holds the extension used when creating the backup file. If you 
+                                 set a value into $-i, enables in-place edit mode.
+$-I              Array           Synonym for $:. [r/o] 
+$-K              String          Sets the multibyte coding system for strings and regular expressions. Equiv- 
+                                 alent to the -K command-line option.
+$-l              Object          Set to true if the -l option (which enables line-end processing) is present 
+                                 on the command line. [r/o] 
+__LINE__         String          The current line number in the source file. [r/o] 
+$LOAD_PATH       Array           A synonym for $:. [r/o] 
+$-p              Object          Set to true if the -p option (which puts an implicit while gets . . . end 
+                                 loop around your program) is present on the command line. [r/o] 
+$SAFE            Fixnum          The current safe level. This variable’s value may never be 
+                                 reduced by assignment. [thread] 
+$VERBOSE         Object          Set to true if the -v, --version, -W, or -w option is specified on the com- 
+                                 mand line. Set to false if no option, or -W1 is given. Set to nil if -W0 
+                                 was specified. Setting this option to true causes the interpreter and some 
+                                 library routines to report additional information. Setting to nil suppresses 
+                                 all warnings (including the output of Kernel.warn). 
+$-v              Object          Synonym for $VERBOSE. 
+$-w              Object          Synonym for $VERBOSE. 
+=end
+describe "Execution variable $:" do
+  it "is initialized to an array of strings" do
+    $:.is_a?(Array).should == true
+    ($:.length > 0).should == true
+  end
+
+  it "includes the current directory" do
+    $:.should include(".")
+  end
+
+  it "does not include on the taint check level > 1" do
+    begin
+      orig_opts, ENV['RUBYOPT'] = ENV['RUBYOPT'], '-T'
+      `#{RUBY_EXE} -e 'p $:.include?(".")'`.should == "false\n"
+    ensure
+      ENV['RUBYOPT'] = orig_opts
+    end
+  end
+
+  it "is the same object as $LOAD_PATH and $-I" do
+    $:.__id__.should == $LOAD_PATH.__id__
+    $:.__id__.should == $-I.__id__
+  end
+  
+  it "can be changed via <<" do
+    $: << "foo"
+    $:.should include("foo")
+  end
+end
+=begin
+Standard Objects 
+---------------------------------------------------------------------------------------------------
+
+ARGF             Object          A synonym for $<. 
+ARGV             Array           A synonym for $*. 
+ENV              Object          A hash-like object containing the program’s environment variables. An 
+                                 instance of class Object, ENV implements the full set of Hash methods. Used 
+                                 to query and set the value of an environment variable, as in ENV["PATH"] 
+                                 and ENV["term"]="ansi". 
+false            FalseClass      Singleton instance of class FalseClass. [r/o] 
+nil              NilClass        The singleton instance of class NilClass. The value of uninitialized 
+                                 instance and global variables. [r/o]
+self             Object          The receiver (object) of the current method. [r/o] 
+true             TrueClass       Singleton instance of class TrueClass. [r/o] 
+=end
+
+describe "The predefined standard objects" do
+  it "includes ARGF" do
+    Object.const_defined?(:ARGF).should == true
+  end
+  
+  it "includes ARGV" do
+    Object.const_defined?(:ARGV).should == true
+  end
+  
+  it "includes a hash-like object ENV" do
+    Object.const_defined?(:ENV).should == true
+    ENV.respond_to?(:[]).should == true
+  end
+end
+
+describe "The predefined standard object nil" do
+  it "is an instance of NilClass" do
+    nil.class.should == NilClass
+  end
+  
+  # this needs to be tested with a subprocess because
+  # MRI aborts reading in the file
+  it "raises a SyntaxError if assigned to"
+end
+
+describe "The predefined standard object true" do
+  it "is an instance of TrueClass" do
+    true.class.should == TrueClass
+  end
+  
+  # this needs to be tested with a subprocess because
+  # MRI aborts reading in the file
+  it "raises a SyntaxError if assigned to"
+end
+
+describe "The predefined standard object false" do
+  it "is an instance of FalseClass" do
+    false.class.should == FalseClass
+  end
+  
+  # this needs to be tested with a subprocess because
+  # MRI aborts reading in the file
+  it "raises a SyntaxError if assigned to"
+end
+
+=begin
+Global Constants 
+---------------------------------------------------------------------------------------------------
+
+The following constants are defined by the Ruby interpreter. 
+
+DATA                 IO          If the main program file contains the directive __END__, then 
+                                 the constant DATA will be initialized so that reading from it will 
+                                 return lines following __END__ from the source file. 
+FALSE                FalseClass  Synonym for false. 
+NIL                  NilClass    Synonym for nil. 
+RUBY_PLATFORM        String      The identifier of the platform running this program. This string 
+                                 is in the same form as the platform identifier used by the GNU 
+                                 configure utility (which is not a coincidence). 
+PLATFORM             String      Same as RUBY_PLATFORM (only in 1.8).
+RUBY_RELEASE_DATE    String      The date of this release. 
+RUBY_VERSION         String      The version number of the interpreter. 
+STDERR               IO          The actual standard error stream for the program. The initial 
+                                 value of $stderr. 
+STDIN                IO          The actual standard input stream for the program. The initial 
+                                 value of $stdin. 
+STDOUT               IO          The actual standard output stream for the program. The initial 
+                                 value of $stdout. 
+SCRIPT_LINES__       Hash        If a constant SCRIPT_LINES__ is defined and references a Hash, 
+                                 Ruby will store an entry containing the contents of each file it 
+                                 parses, with the file’s name as the key and an array of strings as 
+                                 the value.
+TOPLEVEL_BINDING     Binding     A Binding object representing the binding at Ruby’s top level— 
+                                 the level where programs are initially executed. 
+TRUE                 TrueClass   Synonym for true. 
+=end
+
+describe "The predefined global constants" do
+  it "includes DATA when main script contains __END__" do
+    ruby_exe(fixture(__FILE__, "predefined.rb")).chomp.should == "true"
+  end
+
+  it "does not include DATA when main script contains no __END__" do
+    ruby_exe("puts Object.const_defined?(:DATA)").chomp.should == 'false'
+  end
+
+  it "includes TRUE" do
+    Object.const_defined?(:TRUE).should == true
+    TRUE.should equal(true)
+  end
+  
+  it "includes FALSE" do
+    Object.const_defined?(:FALSE).should == true
+    FALSE.should equal(false)
+  end
+  
+  it "includes NIL" do
+    Object.const_defined?(:NIL).should == true
+    NIL.should equal(nil)
+  end
+  
+  it "includes STDIN" do
+    Object.const_defined?(:STDIN).should == true
+  end
+  
+  it "includes STDOUT" do
+    Object.const_defined?(:STDOUT).should == true
+  end
+  
+  it "includes STDERR" do
+    Object.const_defined?(:STDERR).should == true
+  end
+
+  it "includes RUBY_VERSION" do
+    Object.const_defined?(:RUBY_VERSION).should == true
+  end
+  
+  it "includes RUBY_RELEASE_DATE" do
+    Object.const_defined?(:RUBY_RELEASE_DATE).should == true
+  end
+  
+  it "includes RUBY_PLATFORM" do
+    Object.const_defined?(:RUBY_PLATFORM).should == true
+  end
+
+  ruby_version_is "" ... "1.9" do
+    it "includes PLATFORM" do
+      Object.const_defined?(:PLATFORM).should == true
+      RUBY_PLATFORM == PLATFORM
+    end
+  end
+
+  it "includes TOPLEVEL_BINDING" do
+    Object.const_defined?(:TOPLEVEL_BINDING).should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/private_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/private_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/private_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,60 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/private'
+
+describe "The private keyword" do
+  it "marks following methods as being private" do
+    a = Private::A.new
+    a.methods.should_not include("bar")
+    lambda { a.bar }.should raise_error(NoMethodError)
+
+    b = Private::B.new
+    b.methods.should_not include("bar")
+    lambda { b.bar }.should raise_error(NoMethodError)
+  end
+
+  it "is overridden when a new class is opened" do
+    c = Private::B::C.new
+    c.methods.should include("baz")
+    c.baz
+    Private::B::public_class_method1.should == 1
+    Private::B::public_class_method2.should == 2
+    lambda { Private::B::private_class_method1 }.should raise_error(NoMethodError)
+  end
+
+  it "is no longer in effect when the class is closed" do
+    b = Private::B.new
+    b.methods.should include("foo")
+    b.foo
+  end
+
+  it "changes visibility of previously called method" do
+    f = Private::F.new
+    f.foo
+    module Private
+      class F
+        private :foo
+      end
+    end
+    lambda { f.foo }.should raise_error(NoMethodError)
+  end
+
+  it "changes visiblity of previously called methods with same send/call site" do
+    g = Private::G.new
+    lambda {
+      2.times do
+        g.foo
+        module Private
+          class G
+            private :foo
+          end
+        end
+      end
+    }.should raise_error(NoMethodError)
+  end
+  
+  it "changes the visibility of the existing method in the subclass" do
+    Private::A.new.foo.should == 'foo'
+    lambda {Private::H.new.foo}.should raise_error(NoMethodError) 
+    Private::H.new.send(:foo).should == 'foo'
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/redo_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/redo_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/redo_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,68 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe "The redo statement" do
+  it "raises a LocalJumpError if used not within block or while/for loop" do
+    def bad_meth_redo; redo; end
+    lambda { bad_meth_redo() }.should raise_error(LocalJumpError)
+  end
+
+  it "restarts block execution if used within block" do
+    a = []
+    lambda {
+      a << 1
+      redo if a.size < 2
+      a << 2
+    }.call
+    a.should == [1, 1, 2]
+  end
+
+  it "re-executes the closest loop" do
+    exist = [2,3]
+    processed = []
+    order = []
+    [1,2,3,4].each do |x|
+      order << x
+      begin
+        processed << x
+        if(exist.include?(x))
+          raise StandardError, "included"
+        end
+      rescue StandardError => e
+        exist.delete(x)
+        redo
+      end
+    end
+    processed.should == [1,2,2,3,3,4]
+    exist.should == []
+    order.should == [1,2,2,3,3,4]
+  end
+
+  it "re-executes the last step in enumeration" do
+    list = []
+    [1,2,3].each do |x|
+      list << x
+      break if list.size == 6
+      redo if x == 3
+    end
+    list.should == [1,2,3,3,3,3]
+  end
+
+  # The #count method is on 1.9, but this causes SyntaxError,
+  # Invalid redo in 1.9
+  quarantine! do
+    it "triggers ensure block when re-executing a block" do
+      list = []
+      [1,2,3].each do |x|
+        list << x
+        begin
+          list << 10*x
+          # causes SyntaxError in 1.9
+          # redo if list.count(1) == 1
+        ensure
+          list << 100*x
+        end
+      end
+      list.should == [1,10,100,1,10,100,2,20,200,3,30,300]
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/regexp_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/regexp_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/regexp_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,705 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Literal Regexps" do
+  it "matches against $_ (last input) in a conditional if no explicit matchee provided" do
+    $_ = nil
+
+    (true if /foo/).should_not == true
+
+    $_ = "foo"
+
+    (true if /foo/).should == true
+  end
+
+  it "yields a Regexp" do
+    /Hello/.class.should == Regexp
+  end
+  
+  it "caches the Regexp object" do
+    rs = []
+    2.times do |i|
+      x = 1
+      rs << /foo/
+    end
+    rs[0].should equal(rs[1])
+  end
+
+  it "throws SyntaxError for malformed literals" do
+    lambda { eval('/(/') }.should raise_error(SyntaxError)
+  end
+
+  #############################################################################
+  # %r
+  #############################################################################
+
+  it "supports paired delimiters with %r" do    
+    LanguageSpecs.paired_delimiters.each do |p0, p1|
+      eval("%r#{p0} foo #{p1}").should == / foo /
+    end
+  end
+  
+  it "supports grouping constructs that are also paired delimiters" do    
+    LanguageSpecs.paired_delimiters.each do |p0, p1|
+      eval("%r#{p0} () [c]{1} #{p1}").should == / () [c]{1} /      
+    end
+  end
+  
+  it "allows second part of paired delimiters to be used as non-paired delimiters" do    
+    LanguageSpecs.paired_delimiters.each do |p0, p1|
+      eval("%r#{p1} foo #{p1}").should == / foo /
+    end
+  end
+  
+  it "disallows first part of paired delimiters to be used as non-paired delimiters" do    
+    LanguageSpecs.paired_delimiters.each do |p0, p1|
+      lambda { eval("%r#{p0} foo #{p0}") }.should raise_error(SyntaxError)
+    end
+  end
+  
+  it "supports non-paired delimiters delimiters with %r" do    
+    LanguageSpecs.non_paired_delimiters.each do |c|
+      eval("%r#{c} foo #{c}").should == / foo /
+    end
+  end
+  
+  it "disallows alphabets as non-paired delimiter with %r" do    
+    lambda { eval('%ra foo a') }.should raise_error(SyntaxError)
+  end
+  
+  it "disallows spaces after %r and delimiter" do    
+    lambda { eval('%r !foo!') }.should raise_error(SyntaxError)
+  end
+  
+  it "allows unescaped / to be used with %r" do
+    %r[/].to_s.should == /\//.to_s
+  end
+  
+  #############################################################################
+  # Substitution
+  #############################################################################
+  
+  it "allow substitution of strings" do
+    str = "foo|bar"
+    /#{str}/.should == /foo|bar/
+  end
+
+  it "allow substitution of literal regexps" do
+    re = /foo|bar/
+    /#{re}/.should == /(?-mix:foo|bar)/
+  end
+  
+  it "allow substitution of any class that responds to to_s" do
+    o = LanguageSpecs::ClassWith_to_s.new
+    /#{o}/.should == /class_with_to_s/
+  end
+  
+  it "throws NoMethodError on missing to_s" do
+    o = LanguageSpecs::ClassWithout_to_s.new
+    lambda { /#{o}/ }.should raise_error(NoMethodError)
+  end
+  
+  it "allows substitution which mixes modifiers" do
+    re = /foo/i
+    /#{re} bar/m.should == /(?i-mx:foo) bar/m
+  end
+  
+  it "allows substitution to interact with other Regexp constructs" do
+    str = "foo)|(bar"
+    /(#{str})/.should == /(foo)|(bar)/
+    
+    str = "a"
+    /[#{str}-z]/.should == /[a-z]/
+  end
+  
+  it "gives precedence to escape sequences over substitution" do
+    str = "J"
+    /\c#{str}/.to_s.should == '(?-mix:\c#' + '{str})'
+  end  
+
+  it "throws RegexpError for malformed substitution" do
+    s = ""
+    lambda { /(#{s}/ }.should raise_error(RegexpError)
+    s = "("
+    lambda { /#{s}/ }.should raise_error(RegexpError)
+  end
+
+  it "allows substituion in extended mode" do
+    var = "#comment\n  foo  #comment\n  |  bar"
+    (/#{var}/x =~ "foo").should == (/foo|bar/ =~ "foo")
+  end
+  
+  #############################################################################
+  # Specs for the matching semantics
+  #############################################################################
+    
+  it 'supports escape characters' do
+    /\t/.match("\t").to_a.should == ["\t"] # horizontal tab
+    /\v/.match("\v").to_a.should == ["\v"] # vertical tab
+    /\n/.match("\n").to_a.should == ["\n"] # newline
+    /\r/.match("\r").to_a.should == ["\r"] # return
+    /\f/.match("\f").to_a.should == ["\f"] # form feed
+    /\a/.match("\a").to_a.should == ["\a"] # bell
+    /\e/.match("\e").to_a.should == ["\e"] # escape
+
+    # \nnn         octal char            (encoded byte value)
+  end
+  
+  it 'supports quoting meta-characters via escape sequence' do
+    /\\/.match("\\").to_a.should == ["\\"]
+    /\//.match("/").to_a.should == ["/"]
+    # parenthesis, etc
+    /\(/.match("(").to_a.should == ["("]
+    /\)/.match(")").to_a.should == [")"]
+    /\[/.match("[").to_a.should == ["["]
+    /\]/.match("]").to_a.should == ["]"]
+    /\{/.match("{").to_a.should == ["{"]
+    /\}/.match("}").to_a.should == ["}"]
+    # alternation separator
+    /\|/.match("|").to_a.should == ["|"]
+    # quantifiers
+    /\?/.match("?").to_a.should == ["?"]
+    /\./.match(".").to_a.should == ["."]
+    /\*/.match("*").to_a.should == ["*"]
+    /\+/.match("+").to_a.should == ["+"]
+    # line anchors
+    /\^/.match("^").to_a.should == ["^"]
+    /\$/.match("$").to_a.should == ["$"]    
+  end
+  
+  it 'allows any character to be escaped' do
+    /\y/.match("y").to_a.should == ["y"]  
+  end
+  
+  it 'supports \x (hex characters)' do
+    /\xA/.match("\nxyz").to_a.should == ["\n"]
+    /\x0A/.match("\n").to_a.should == ["\n"]
+    /\xAA/.match("\nA").should be_nil
+    /\x0AA/.match("\nA").to_a.should == ["\nA"]
+    /\xAG/.match("\nG").to_a.should == ["\nG"]
+    # Non-matches
+    lambda { eval('/\xG/') }.should raise_error(SyntaxError)
+    
+    # \x{7HHHHHHH} wide hexadecimal char (character code point value)
+  end
+  
+  it 'supports \c (control characters)' do
+    #/\c \c@\c`/.match("\00\00\00").to_a.should == ["\00\00\00"]
+    /\c#\cc\cC/.match("\03\03\03").to_a.should == ["\03\03\03"]
+    /\c'\cG\cg/.match("\a\a\a").to_a.should == ["\a\a\a"]
+    /\c(\cH\ch/.match("\b\b\b").to_a.should == ["\b\b\b"]
+    /\c)\cI\ci/.match("\t\t\t").to_a.should == ["\t\t\t"]
+    /\c*\cJ\cj/.match("\n\n\n").to_a.should == ["\n\n\n"]
+    /\c+\cK\ck/.match("\v\v\v").to_a.should == ["\v\v\v"]
+    /\c,\cL\cl/.match("\f\f\f").to_a.should == ["\f\f\f"]
+    /\c-\cM\cm/.match("\r\r\r").to_a.should == ["\r\r\r"]
+    
+    /\cJ/.match("\r").should be_nil
+
+    # Parsing precedence
+    /\cJ+/.match("\n\n").to_a.should == ["\n\n"] # Quantifers apply to entire escape sequence
+    /\\cJ/.match("\\cJ").to_a.should == ["\\cJ"]
+    lambda { eval('/[abc\x]/') }.should raise_error(SyntaxError) # \x is treated as a escape sequence even inside a character class
+    # Syntax error
+    lambda { eval('/\c/') }.should raise_error(SyntaxError)
+
+    # \cx          control char          (character code point value)
+    # \C-x         control char          (character code point value)
+    # \M-x         meta  (x|0x80)        (character code point value)
+    # \M-\C-x      meta control char     (character code point value)
+  end
+  
+  it 'supports ^ (line start anchor)' do
+    # Basic matching
+    /^foo/.match("foo").to_a.should == ["foo"]
+    /^bar/.match("foo\nbar").to_a.should == ["bar"]
+    # Basic non-matching
+    /^foo/.match(" foo").should be_nil
+    /foo^/.match("foo\n\n\n").should be_nil
+    
+    # A bit advanced
+    /^^^foo/.match("foo").to_a.should == ["foo"]
+    (/^[^f]/ =~ "foo\n\n").should == "foo\n".size and $~.to_a.should == ["\n"]
+    (/($^)($^)/ =~ "foo\n\n").should == "foo\n".size and $~.to_a.should == ["", "", ""]
+
+    # Different start of line chars
+    /^bar/.match("foo\rbar").should be_nil
+    /^bar/.match("foo\0bar").should be_nil
+
+    # Trivial
+    /^/.match("foo").to_a.should == [""]
+
+    # Grouping
+    /(^foo)/.match("foo").to_a.should == ["foo", "foo"]
+    /(^)/.match("foo").to_a.should == ["", ""]
+    /(foo\n^)(^bar)/.match("foo\nbar").to_a.should == ["foo\nbar", "foo\n", "bar"]   
+  end
+  
+  it 'does not match ^ after trailing \n' do
+    /^(?!\A)/.match("foo\n").should be_nil # There is no (empty) line after a trailing \n
+  end
+
+  it 'supports $ (line end anchor)' do
+    # Basic  matching
+    /foo$/.match("foo").to_a.should == ["foo"]
+    /foo$/.match("foo\nbar").to_a.should == ["foo"]
+    # Basic non-matching
+    /foo$/.match("foo ").should be_nil
+    /$foo/.match("\n\n\nfoo").should be_nil
+
+    # A bit advanced
+    /foo$$$/.match("foo").to_a.should == ["foo"]
+    (/[^o]$/ =~ "foo\n\n").should == ("foo\n".size - 1) and $~.to_a.should == ["\n"]
+
+    # Different end of line chars
+    /foo$/.match("foo\r\nbar").should be_nil
+    /foo$/.match("foo\0bar").should be_nil
+
+    # Trivial
+    (/$/ =~ "foo").should == "foo".size and $~.to_a.should == [""]
+
+    # Grouping
+    /(foo$)/.match("foo").to_a.should == ["foo", "foo"]
+    (/($)/ =~ "foo").should == "foo".size and $~.to_a.should == ["", ""]
+    /(foo$)($\nbar)/.match("foo\nbar").to_a.should == ["foo\nbar", "foo", "\nbar"]
+  end
+  
+  it 'supports . (any character except line terminator)' do
+    # Basic matching
+    /./.match("foo").to_a.should == ["f"]
+    # Basic non-matching
+    /./.match("").should be_nil
+    /./.match("\n").should be_nil
+    /./.match("\0").to_a.should == ["\0"]
+  end
+  
+  it 'supports . with /m' do
+    # Basic matching
+    /./m.match("\n").to_a.should == ["\n"]
+  end
+  
+  it 'supports \w (word character)' do
+    /\w/.match("a").to_a.should == ["a"]
+    /\w/.match("1").to_a.should == ["1"]
+    /\w/.match("_").to_a.should == ["_"]
+    
+    # Non-matches
+    /\w/.match(LanguageSpecs.white_spaces).should be_nil
+    /\w/.match(LanguageSpecs.non_alphanum_non_space).should be_nil
+    /\w/.match("\0").should be_nil
+  end
+  
+  it 'supports \W (non-word character)' do
+    /\W+/.match(LanguageSpecs.white_spaces).to_a.should == [LanguageSpecs.white_spaces]
+    /\W+/.match(LanguageSpecs.non_alphanum_non_space).to_a.should == [LanguageSpecs.non_alphanum_non_space]
+    /\W/.match("\0").to_a.should == ["\0"]
+
+    # Non-matches
+    /\W/.match("a").should be_nil
+    /\W/.match("1").should be_nil
+    /\W/.match("_").should be_nil
+  end
+  
+  it 'supports \s (space character)' do
+    /\s+/.match(LanguageSpecs.white_spaces).to_a.should == [LanguageSpecs.white_spaces]
+    
+    # Non-matches
+    /\s/.match("a").should be_nil
+    /\s/.match("1").should be_nil
+    /\s/.match(LanguageSpecs.non_alphanum_non_space).should be_nil
+    /\s/.match("\0").should be_nil
+  end
+  
+  it 'supports \S (non-space character)' do    
+    /\S/.match("a").to_a.should == ["a"]
+    /\S/.match("1").to_a.should == ["1"]
+    /\S+/.match(LanguageSpecs.non_alphanum_non_space).to_a.should == [LanguageSpecs.non_alphanum_non_space]
+    /\S/.match("\0").to_a.should == ["\0"]
+
+    # Non-matches
+    /\S/.match(LanguageSpecs.white_spaces).should be_nil
+  end
+  
+  it 'supports \d (numeric digit)' do
+    /\d/.match("1").to_a.should == ["1"]
+    
+    # Non-matches
+    /\d/.match("a").should be_nil
+    /\d/.match(LanguageSpecs.white_spaces).should be_nil
+    /\d/.match(LanguageSpecs.non_alphanum_non_space).should be_nil
+    /\d/.match("\0").should be_nil
+  end
+  
+  it 'supports \D (non-digit)' do   
+    /\D/.match("a").to_a.should == ["a"]
+    /\D+/.match(LanguageSpecs.white_spaces).to_a.should == [LanguageSpecs.white_spaces]
+    /\D+/.match(LanguageSpecs.non_alphanum_non_space).to_a.should == [LanguageSpecs.non_alphanum_non_space]
+    /\D/.match("\0").to_a.should == ["\0"]
+
+    # Non-matches
+    /\D/.match("1").should be_nil
+  end
+  
+  it 'supports \A (string start anchor)' do
+    # Basic matching
+    /\Afoo/.match("foo").to_a.should == ["foo"]
+    # Basic non-matching
+    /\Abar/.match("foo\nbar").should be_nil
+    /\Afoo/.match(" foo").should be_nil
+    
+    # A bit advanced
+    /\A\A\Afoo/.match("foo").to_a.should == ["foo"]
+    /(\A\Z)(\A\Z)/.match("").to_a.should == ["", "", ""]
+
+    # Different start of line chars
+    /\Abar/.match("foo\0bar").should be_nil
+
+    # Grouping
+    /(\Afoo)/.match("foo").to_a.should == ["foo", "foo"]
+    /(\A)/.match("foo").to_a.should == ["", ""]
+  end
+  
+  it 'supports \Z (string end anchor, including before trailing \n)' do
+    # Basic matching
+    /foo\Z/.match("foo").to_a.should == ["foo"]
+    /foo\Z/.match("foo\n").to_a.should == ["foo"]
+    # Basic non-matching
+    /foo\Z/.match("foo\nbar").should be_nil
+    /foo\Z/.match("foo ").should be_nil
+    
+    # A bit advanced
+    /foo\Z\Z\Z/.match("foo\n").to_a.should == ["foo"]
+    (/($\Z)($\Z)/ =~ "foo\n").should == "foo".size and $~.to_a.should == ["", "", ""]
+    (/(\z\Z)(\z\Z)/ =~ "foo\n").should == "foo\n".size and $~.to_a.should == ["", "", ""]
+
+    # Different end of line chars
+    /foo\Z/.match("foo\0bar").should be_nil
+    /foo\Z/.match("foo\r\n").should be_nil
+
+    # Grouping
+    /(foo\Z)/.match("foo").to_a.should == ["foo", "foo"]
+    (/(\Z)/ =~ "foo").should == "foo".size and $~.to_a.should == ["", ""]
+  end
+  
+  it 'supports \z (string end anchor)' do
+    # Basic matching
+    /foo\z/.match("foo").to_a.should == ["foo"]
+    # Basic non-matching
+    /foo\z/.match("foo\nbar").should be_nil
+    /foo\z/.match("foo\n").should be_nil
+    /foo\z/.match("foo ").should be_nil
+    
+    # A bit advanced
+    /foo\z\z\z/.match("foo").to_a.should == ["foo"]
+    (/($\z)($\z)/ =~ "foo").should == "foo".size and $~.to_a.should == ["", "", ""]
+
+    # Different end of line chars
+    /foo\z/.match("foo\0bar").should be_nil
+    /foo\z/.match("foo\r\nbar").should be_nil
+
+    # Grouping
+    /(foo\z)/.match("foo").to_a.should == ["foo", "foo"]
+    (/(\z)/ =~ "foo").should == "foo".size and $~.to_a.should == ["", ""]
+  end
+  
+  it 'supports \b (word boundary)' do
+    # Basic matching
+    /foo\b/.match("foo").to_a.should == ["foo"]
+    /foo\b/.match("foo\n").to_a.should == ["foo"]
+    LanguageSpecs.white_spaces.scan(/./).each do |c|
+    /foo\b/.match("foo" + c).to_a.should == ["foo"]
+    end
+    LanguageSpecs.non_alphanum_non_space.scan(/./).each do |c|
+    /foo\b/.match("foo" + c).to_a.should == ["foo"]
+    end
+    /foo\b/.match("foo\0").to_a.should == ["foo"]
+    # Basic non-matching
+    /foo\b/.match("foobar").should be_nil
+    /foo\b/.match("foo123").should be_nil
+    /foo\b/.match("foo_").should be_nil
+  end
+  
+  it 'supports \B (non-word-boundary)' do
+    # Basic matching
+    /foo\B/.match("foobar").to_a.should == ["foo"]
+    /foo\B/.match("foo123").to_a.should == ["foo"]
+    /foo\B/.match("foo_").to_a.should == ["foo"]
+    # Basic non-matching
+    /foo\B/.match("foo").should be_nil
+    /foo\B/.match("foo\n").should be_nil
+    LanguageSpecs.white_spaces.scan(/./).each do |c|
+    /foo\B/.match("foo" + c).should be_nil
+    end
+    LanguageSpecs.non_alphanum_non_space.scan(/./).each do |c|
+    /foo\B/.match("foo" + c).should be_nil
+    end
+    /foo\B/.match("foo\0").should be_nil
+  end
+  
+  it 'supports [] (character class)' do
+    /[a-z]+/.match("fooBAR").to_a.should == ["foo"]
+    /[\b]/.match("\b").to_a.should == ["\b"] # \b inside character class is backspace
+  end
+  
+  it 'supports [[:alpha:][:digit:][:etc:]] (predefined character classes)' do
+    /[[:alnum:]]+/.match("a1").to_a.should == ["a1"]
+    /[[:alpha:]]+/.match("Aa1").to_a.should == ["Aa"]
+    /[[:blank:]]+/.match(LanguageSpecs.white_spaces).to_a.should == [LanguageSpecs.blanks]
+    # /[[:cntrl:]]/.match("").to_a.should == [""] # TODO: what should this match?
+    /[[:digit:]]/.match("1").to_a.should == ["1"]    
+    # /[[:graph:]]/.match("").to_a.should == [""] # TODO: what should this match?
+    /[[:lower:]]+/.match("Aa1").to_a.should == ["a"]
+    /[[:print:]]+/.match(LanguageSpecs.white_spaces).to_a.should == [" "]     # include all of multibyte encoded characters
+    /[[:punct:]]+/.match(LanguageSpecs.punctuations).to_a.should == [LanguageSpecs.punctuations]
+    /[[:space:]]+/.match(LanguageSpecs.white_spaces).to_a.should == [LanguageSpecs.white_spaces]
+    /[[:upper:]]+/.match("123ABCabc").to_a.should == ["ABC"]
+    /[[:xdigit:]]+/.match("xyz0123456789ABCDEFabcdefXYZ").to_a.should == ["0123456789ABCDEFabcdef"]
+    ruby_version_is "1.9" do
+    eval('/[[:ascii:]]/').match("a").to_a.should == ["a"]
+    end
+    
+    # Parsing
+    /[[:lower:][:digit:]A-C]+/.match("a1ABCDEF").to_a.should == ["a1ABC"] # can be composed with other constructs in the character class
+    /[^[:lower:]A-C]+/.match("abcABCDEF123def").to_a.should == ["DEF123"] # negated character class
+    /[:alnum:]+/.match("a:l:n:u:m").to_a.should == ["a:l:n:u:m"] # should behave like regular character class composed of the individual letters
+    /[\[:alnum:]+/.match("[:a:l:n:u:m").to_a.should == ["[:a:l:n:u:m"] # should behave like regular character class composed of the individual letters
+    lambda { eval('/[[:alpha:]-[:digit:]]/') }.should raise_error(SyntaxError) # can't use character class as a start value of range
+  end
+  
+  it 'supports ()' do
+    /(a)/.match("a").to_a.should == ["a", "a"]
+  end
+  
+  it 'supports * (0 or more of previous subexpression)' do
+    /a*/.match("aaa").to_a.should == ["aaa"]
+    /a*/.match("bbb").to_a.should == [""]
+    /<.*>/.match("<a>foo</a>").to_a.should == ["<a>foo</a>"] # it is greedy
+  end
+  
+  it 'supports *? (0 or more of previous subexpression - lazy)' do
+    /a*?/.match("aaa").to_a.should == [""]
+    /<.*?>/.match("<a>foo</a>").to_a.should == ["<a>"]
+  end
+  
+  it 'supports + (1 or more of previous subexpression)' do
+    /a+/.match("aaa").to_a.should == ["aaa"]
+    /a+/.match("bbb").should be_nil
+    /<.+>/.match("<a>foo</a>").to_a.should == ["<a>foo</a>"] # it is greedy
+  end
+  
+  it 'supports +? (0 or more of previous subexpression - lazy)' do
+    /a+?/.match("aaa").to_a.should == ["a"]
+    /<.+?>/.match("<a>foo</a>").to_a.should == ["<a>"]
+  end
+  
+  it 'supports {m,n} (m to n of previous subexpression)' do
+    /a{2,4}/.match("aaaaaa").to_a.should == ["aaaa"]
+    /<.{1,}>/.match("<a>foo</a>").to_a.should == ["<a>foo</a>"] # it is greedy
+  end
+  
+  it 'supports {m,n}? (m to n of previous subexpression) - lazy)' do
+    /<.{1,}?>/.match("<a>foo</a>").to_a.should == ["<a>"]
+    not_compliant_on :ironruby do # CLR issue
+    /.([0-9]){3,5}?foo/.match("9876543210foo").to_a.should == ["543210foo", "0"]
+    end
+  end
+  
+  it 'does not treat {m,n}+ as possessive' do
+    /foo(A{0,1}+)Abar/.match("fooAAAbar").to_a.should == ["fooAAAbar", "AA"]
+  end
+  
+  it 'supports ? (0 or 1 of previous subexpression)' do
+    /a?/.match("aaa").to_a.should == ["a"]
+    /a?/.match("bbb").to_a.should == [""]
+  end
+  
+  it 'supports | (alternations)' do
+    /a|b/.match("a").to_a.should == ["a"]
+  end
+  
+  it 'supports (?= ) (positive lookahead)' do
+    /foo.(?=bar)/.match("foo1 foo2bar").to_a.should == ["foo2"]
+  end
+  
+  it 'supports (?! ) (negative lookahead)' do
+    /foo.(?!bar)/.match("foo1bar foo2").to_a.should == ["foo2"]
+  end
+  
+  it 'supports (?> ) (embedded subexpression)' do
+    /(?>foo)(?>bar)/.match("foobar").to_a.should == ["foobar"]
+    /(?>foo*)obar/.match("foooooooobar").should be_nil # it is possesive
+  end
+  
+  it 'supports (?: ) (non-capturing group)' do
+    /(?:foo)(bar)/.match("foobar").to_a.should == ["foobar", "bar"]
+    # Parsing precedence
+    /(?:xdigit:)/.match("xdigit:").to_a.should == ["xdigit:"]
+  end
+  
+  it 'supports (?imx-imx) (inline modifiers)' do
+    /(?i)foo/.match("FOO").to_a.should == ["FOO"]
+    /foo(?i)/.match("FOO").should be_nil
+    # Interaction with /i
+    /(?-i)foo/i.match("FOO").should be_nil
+    /foo(?-i)/i.match("FOO").to_a.should == ["FOO"]
+    # Multiple uses
+    /foo (?i)bar (?-i)baz/.match("foo BAR baz").to_a.should == ["foo BAR baz"]
+    /foo (?i)bar (?-i)baz/.match("foo BAR BAZ").should be_nil
+    
+    /(?m)./.match("\n").to_a.should == ["\n"]
+    /.(?m)/.match("\n").should be_nil
+    # Interaction with /m
+    /(?-m)./m.match("\n").should be_nil
+    /.(?-m)/m.match("\n").to_a.should == ["\n"]
+    # Multiple uses
+    /. (?m). (?-m)./.match(". \n .").to_a.should == [". \n ."]
+    /. (?m). (?-m)./.match(". \n \n").should be_nil
+      
+    /(?x) foo /.match("foo").to_a.should == ["foo"]
+    / foo (?x)/.match("foo").should be_nil
+    # Interaction with /x
+    /(?-x) foo /x.match("foo").should be_nil
+    / foo (?-x)/x.match("foo").to_a.should == ["foo"]
+    # Multiple uses
+    /( foo )(?x)( bar )(?-x)( baz )/.match(" foo bar baz ").to_a.should == [" foo bar baz ", " foo ", "bar", " baz "]
+    /( foo )(?x)( bar )(?-x)( baz )/.match(" foo barbaz").should be_nil
+    
+    # Parsing
+    /(?i-i)foo/.match("FOO").should be_nil
+    /(?ii)foo/.match("FOO").to_a.should == ["FOO"]
+    /(?-)foo/.match("foo").to_a.should == ["foo"]
+    lambda { eval('/(?a)/') }.should raise_error(SyntaxError)
+    lambda { eval('/(?o)/') }.should raise_error(SyntaxError)
+  end
+  
+  it 'supports (?imx-imx:expr) (scoped inline modifiers)' do
+    /foo (?i:bar) baz/.match("foo BAR baz").to_a.should == ["foo BAR baz"]
+    /foo (?i:bar) baz/.match("foo BAR BAZ").should be_nil   
+    /foo (?-i:bar) baz/i.match("foo BAR BAZ").should be_nil
+
+    /. (?m:.) ./.match(". \n .").to_a.should == [". \n ."]
+    /. (?m:.) ./.match(". \n \n").should be_nil
+    /. (?-m:.) ./m.match("\n \n \n").should be_nil
+      
+    /( foo )(?x: bar )( baz )/.match(" foo bar baz ").to_a.should == [" foo bar baz ", " foo ", " baz "]
+    /( foo )(?x: bar )( baz )/.match(" foo barbaz").should be_nil
+    /( foo )(?-x: bar )( baz )/x.match("foo bar baz").to_a.should == ["foo bar baz", "foo", "baz"]
+    
+    # Parsing
+    /(?i-i:foo)/.match("FOO").should be_nil
+    /(?ii:foo)/.match("FOO").to_a.should == ["FOO"]
+    /(?-:)foo/.match("foo").to_a.should == ["foo"]
+    lambda { eval('/(?a:)/') }.should raise_error(SyntaxError)
+    lambda { eval('/(?o:)/') }.should raise_error(SyntaxError)
+  end
+  
+  it 'supports (?# )' do
+    /foo(?#comment)bar/.match("foobar").to_a.should == ["foobar"]
+    /foo(?#)bar/.match("foobar").to_a.should == ["foobar"]
+  end
+  
+  it 'supports \<n> (backreference to previous group match)' do
+    /(foo.)\1/.match("foo1foo1").to_a.should == ["foo1foo1", "foo1"]
+    /(foo.)\1/.match("foo1foo2").should be_nil
+  end
+  
+  not_compliant_on :ironruby do
+    it 'resets nested \<n> backreference before match of outer subexpression' do
+      /(a\1?){2}/.match("aaaa").to_a.should == ["aa", "a"]
+    end
+  end
+  
+  #############################################################################
+  # Modifiers
+  #############################################################################
+
+  it 'supports /i (case-insensitive)' do
+    /foo/i.match("FOO").to_a.should == ["FOO"]
+  end
+  
+  it 'supports /m (multiline)' do
+    /foo.bar/m.match("foo\nbar").to_a.should == ["foo\nbar"]
+    /foo.bar/.match("foo\nbar").should be_nil
+  end
+  
+  it 'supports /x (extended syntax)' do
+    /\d +/x.match("abc123").to_a.should == ["123"] # Quantifiers can be separated from the expression they apply to
+  end
+  
+  it 'supports /o (once)' do
+    2.times do |i|
+      /#{i}/o.should == /0/
+    end
+  end
+  
+  it 'invokes substitutions for /o only once' do
+    ScratchPad.record []
+    to_s_callback = Proc.new do
+      ScratchPad << :to_s_callback
+      "class_with_to_s"
+    end
+    o = LanguageSpecs::ClassWith_to_s.new(to_s_callback)
+    2.times { /#{o}/o }
+    ScratchPad.recorded.should == [:to_s_callback]
+  end
+  
+  it 'does not do thread synchronization for /o' do
+    ScratchPad.record []
+    
+    to_s_callback2 = Proc.new do
+      ScratchPad << :to_s_callback2
+      "class_with_to_s2"
+    end
+
+    to_s_callback1 = Proc.new do
+      ScratchPad << :to_s_callback1
+      t2 = Thread.new do
+        o2 = LanguageSpecs::ClassWith_to_s.new(to_s_callback2)
+        ScratchPad << LanguageSpecs.get_regexp_with_substitution(o2)
+      end
+      t2.join
+      "class_with_to_s1"
+    end
+    
+    o1 = LanguageSpecs::ClassWith_to_s.new(to_s_callback1)
+    ScratchPad << LanguageSpecs.get_regexp_with_substitution(o1)
+
+    ScratchPad.recorded.should == [:to_s_callback1, :to_s_callback2, /class_with_to_s2/, /class_with_to_s2/]
+  end
+  
+  it 'supports modifier combinations' do
+    /foo/imox.match("foo").to_a.should == ["foo"]
+    /foo/imoximox.match("foo").to_a.should == ["foo"]
+
+    lambda { eval('/foo/a') }.should raise_error(SyntaxError)
+  end
+  
+  #############################################################################
+  # Encodings
+  #############################################################################
+
+  not_compliant_on :ruby19 do
+    it 'supports /e (EUC encoding)' do
+      /./e.match("\303\251").to_a.should == ["\303\251"]
+    end
+    
+    it 'supports /n (Normal encoding)' do
+      /./n.match("\303\251").to_a.should == ["\303"]
+    end
+    
+    it 'supports /s (SJIS encoding)' do
+      /./s.match("\303\251").to_a.should == ["\303"]
+    end
+    
+    it 'supports /u (UTF8 encoding)' do
+      /./u.match("\303\251").to_a.should == ["\303\251"]
+    end
+    
+    it 'selects last of multiple encoding specifiers' do
+      /foo/ensuensuens.should == /foo/s
+    end
+  end
+  
+end
+
+language_version __FILE__, "regexp"

Added: MacRuby/branches/experimental/spec/frozen/language/rescue_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/rescue_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/rescue_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,72 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+class SpecificExampleException < StandardError
+end
+class OtherCustomException < StandardError
+end
+
+def exception_list
+  [SpecificExampleException, ZeroDivisionError]
+end
+describe "The rescue keyword" do
+  it "can be used to handle a specific exception" do
+    lambda do
+      begin
+        raise SpecificExampleException, "Raising this to be handled below"
+      rescue SpecificExampleException
+      end
+    end.should_not raise_error
+  end
+  
+  it "can capture the raised exception in a local variable" do
+    begin
+      raise SpecificExampleException, "some text"
+    rescue SpecificExampleException => e
+      e.message.should == "some text"
+    end
+  end
+  
+  it "can rescue multiple raised exceptions with a single rescue block" do
+    lambda do
+      [lambda{1/0}, lambda{raise SpecificExampleException}].each do |block|
+        begin
+          block.call
+        rescue SpecificExampleException, ZeroDivisionError
+        end
+      end
+    end.should_not raise_error
+  end
+  
+  it "can rescue a splatted list of exceptions" do
+    caught_it = false
+    begin
+      raise SpecificExampleException, "not important"
+    rescue *exception_list
+      caught_it = true
+    end
+    caught_it.should be_true
+    caught = []
+    lambda do
+      [lambda{1/0}, lambda{raise SpecificExampleException}].each do |block|
+        begin
+          block.call
+        rescue *exception_list
+          caught << $!
+        end
+      end
+    end.should_not raise_error    
+    caught.size.should == 2
+    exception_list.each do |exception_class|
+      caught.map{|e| e.class}.include?(exception_class).should be_true
+    end
+  end
+  
+  it "will only rescue the specified exceptions when doing a splat rescue" do
+    lambda do
+      begin
+        raise OtherCustomException, "not rescued!"
+      rescue *exception_list
+      end
+    end.should raise_error(OtherCustomException)
+  end
+  
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/language/retry_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/retry_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/retry_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,69 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe "The retry statement" do
+  it "raises a LocalJumpError if used outside of a block" do
+    def bad_meth_retry; retry; end
+    lambda { bad_meth_retry()      }.should raise_error(LocalJumpError)
+    lambda { lambda { retry }.call }.should raise_error(LocalJumpError)
+  end
+  
+  it "re-executes the closest block" do
+    retry_first = true
+    retry_second = true
+    results = []
+    begin
+      results << 1
+      raise
+    rescue
+      results << 2
+      if retry_first
+        results << 3
+        retry_first = false
+        retry
+      end
+      begin
+        results << 4
+        raise
+      rescue
+        results << 5
+        if retry_second
+          results << 6
+          retry_second = false
+          retry
+        end
+      end
+    end
+
+    results.should == [1, 2, 3, 1, 2, 4, 5, 6, 4, 5]
+  end
+
+  # block retry has been officially deprecated by matz and is unsupported in 1.9
+  ruby_version_is "" ... "1.9" do
+    not_compliant_on :rubinius do
+      it "re-executes the entire enumeration" do
+        list = []
+        [1,2,3].each do |x|
+          list << x
+          break if list.size == 6
+          retry if x == 3
+        end
+        list.should == [1,2,3,1,2,3]
+      end
+    end
+  end
+end
+
+describe "The retry keyword inside a begin block's rescue block" do
+  it "causes the begin block to be executed again" do
+    counter = 0
+    
+    begin
+      counter += 1
+      raise "An exception"
+    rescue
+      retry unless counter == 7
+    end
+    
+    counter.should == 7
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/return_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/return_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/return_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,245 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe "The return keyword" do
+  it "returns any object directly" do
+    def r; return 1; end
+    r().should == 1
+  end
+
+  it "returns an single element array directly" do
+    def r; return [1]; end
+    r().should == [1]
+  end
+
+  it "returns an multi element array directly" do
+    def r; return [1,2]; end
+    r().should == [1,2]
+  end
+
+  it "returns nil by default" do
+    def r; return; end
+    r().should be_nil
+  end
+
+
+  describe "in a Thread" do
+    it "raises a ThreadError if used to exit a thread" do
+      lambda { Thread.new { return }.join }.should raise_error(ThreadError)
+    end
+  end
+
+
+  describe "when passed a splat" do
+    it "returns nil when the ary is empty" do
+      def r; ary = []; return *ary; end
+      r.should be_nil
+    end
+
+    it "returns the first element when the array is size of 1" do
+      def r; ary = [1]; return *ary; end
+      r.should == 1
+    end
+
+    it "returns the whole array when size is greater than 1" do
+      def r; ary = [1,2]; return *ary; end
+      r.should == [1,2]
+
+      def r; ary = [1,2,3]; return *ary; end
+      r.should == [1,2,3]
+    end
+
+    it "returns a non-array when used as a splat" do
+      def r; value = 1; return *value; end
+      r.should == 1
+    end
+
+    it "calls 'to_a' on the splatted value first" do
+      def r
+        obj = Object.new
+        def obj.to_a
+          []
+        end
+
+        return *obj
+      end
+
+      r().should be_nil
+
+      def r
+        obj = Object.new
+        def obj.to_a
+          [1]
+        end
+
+        return *obj
+      end
+
+      r().should == 1
+
+      def r
+        obj = Object.new
+        def obj.to_a
+          [1,2]
+        end
+
+        return *obj
+      end
+
+      r().should == [1,2]
+    end
+
+    it "calls 'to_ary' on the splatted value first" do
+      def r
+        obj = Object.new
+        def obj.to_ary
+          []
+        end
+
+        return *obj
+      end
+
+      r().should be_nil
+
+      def r
+        obj = Object.new
+        def obj.to_ary
+          [1]
+        end
+
+        return *obj
+      end
+
+      r().should == 1
+
+      def r
+        obj = Object.new
+        def obj.to_ary
+          [1,2]
+        end
+
+        return *obj
+      end
+
+      r().should == [1,2]
+    end
+  end
+
+
+  describe "within a begin" do
+    it "executes ensure before returning from function" do
+      def f(a)
+        begin
+          return a
+        ensure
+          a << 1
+        end
+      end
+      f([]).should == [1]
+    end
+
+    it "executes return in ensure before returning from function" do
+      def f(a)
+        begin
+          return a
+        ensure
+          return [0]
+          a << 1
+        end
+      end
+      f([]).should == [0]
+    end
+
+    it "executes ensures in stack order before returning from function" do
+      def f(a)
+        begin
+          begin
+            return a
+          ensure
+            a << 2
+          end
+        ensure
+          a << 1
+        end
+      end
+      f([]).should == [2,1]
+    end
+
+    it "executes return at base of ensure stack" do
+      def f(a)
+        begin
+          begin
+            return a
+          ensure
+            a << 2
+            return 2
+          end
+        ensure
+          a << 1
+          return 1
+        end
+      end
+      a = []
+      f(a).should == 1
+      a.should == [2, 1]
+    end
+  end
+
+
+  describe "within a block" do
+    it "raises a LocalJumpError if there is no lexicaly enclosing method" do
+      def f; yield; end
+      lambda { f { return 5 } }.should raise_error(LocalJumpError)
+    end
+
+    it "causes lambda to return nil if invoked without any arguments" do
+      lambda { return; 456 }.call.should be_nil
+    end
+
+    it "causes lambda to return nil if invoked with an empty expression" do
+      lambda { return (); 456 }.call.should be_nil
+    end
+
+    it "causes lambda to return the value passed to return" do
+      lambda { return 123; 456 }.call.should == 123
+    end
+
+    it "causes the method that lexically encloses the block to return" do
+      def meth_with_yield
+        yield
+        fail("return returned to wrong location")
+      end
+
+      def enclosing_method
+        meth_with_yield do
+          return :return_value
+          fail("return didn't, well, return")
+        end
+        fail("return should not behave like break")
+      end
+
+      enclosing_method.should == :return_value
+    end
+
+    it "returns from the lexically enclosing method even in case of chained calls" do
+      class ChainedReturnTest
+        def self.meth_with_yield(&b)
+          yield
+          fail("returned from yield to wrong place")
+        end
+        def self.invoking_method(&b)
+          meth_with_yield(&b)
+          fail("returned from 'meth_with_yield' method to wrong place")
+        end
+        def self.enclosing_method
+          invoking_method do
+            return :return_value
+            fail("return didn't, well, return")
+          end
+          fail("return should not behave like break")
+        end
+      end
+
+      ChainedReturnTest.enclosing_method.should == :return_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/string_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/string_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/string_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,163 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+# Thanks http://www.zenspider.com/Languages/Ruby/QuickRef.html
+
+describe "Ruby character strings" do
+
+  before(:each) do
+    @ip = 'xxx' # used for interpolation
+  end
+
+  it "don't get interpolated when put in single quotes" do
+    '#{@ip}'.should == '#{@ip}'
+  end
+
+  it 'get interpolated with #{} when put in double quotes' do
+    "#{@ip}".should == 'xxx'
+  end
+
+  it "interpolate instance variables just with the # character" do
+    "#@ip".should == 'xxx'
+  end
+
+  it "interpolate global variables just with the # character" do
+    $ip = 'xxx'
+    "#$ip".should == 'xxx'
+  end
+
+  it "interpolate class variables just with the # character" do
+    @@ip = 'xxx'
+    "#@@ip".should == 'xxx'
+  end
+
+  it "allow underscore as part of a variable name in a simple interpolation" do
+    @my_ip = 'xxx'
+    "#@my_ip".should == 'xxx'
+  end
+
+  it "have characters [.(=?!# end simple # interpolation" do
+    "#@ip[".should == 'xxx['
+    "#@ip.".should == 'xxx.'
+    "#@ip(".should == 'xxx('
+    "#@ip=".should == 'xxx='
+    "#@ip?".should == 'xxx?'
+    "#@ip!".should == 'xxx!'
+    "#@ip#@ip".should == 'xxxxxx'
+  end
+
+  it "allow using non-alnum characters as string delimiters" do
+    %(hey #{@ip}).should == "hey xxx"
+    %[hey #{@ip}].should == "hey xxx"
+    %{hey #{@ip}}.should == "hey xxx"
+    %<hey #{@ip}>.should == "hey xxx"
+    %!hey #{@ip}!.should == "hey xxx"
+    %@hey #{@ip}@.should == "hey xxx"
+    %#hey hey#.should == "hey hey"
+    %%hey #{@ip}%.should == "hey xxx"
+    %^hey #{@ip}^.should == "hey xxx"
+    %&hey #{@ip}&.should == "hey xxx"
+    %*hey #{@ip}*.should == "hey xxx"
+    %-hey #{@ip}-.should == "hey xxx"
+    %_hey #{@ip}_.should == "hey xxx"
+    %=hey #{@ip}=.should == "hey xxx"
+    %+hey #{@ip}+.should == "hey xxx"
+    %~hey #{@ip}~.should == "hey xxx"
+    %:hey #{@ip}:.should == "hey xxx"
+    %;hey #{@ip};.should == "hey xxx"
+    %"hey #{@ip}".should == "hey xxx"
+    %|hey #{@ip}|.should == "hey xxx"
+    %?hey #{@ip}?.should == "hey xxx"
+    %/hey #{@ip}/.should == "hey xxx"
+    %,hey #{@ip},.should == "hey xxx"
+    %.hey #{@ip}..should == "hey xxx"
+    
+    # surprised? huh
+    %'hey #{@ip}'.should == "hey xxx"
+    %\hey #{@ip}\.should == "hey xxx"
+    %`hey #{@ip}`.should == "hey xxx"
+    %$hey #{@ip}$.should == "hey xxx"
+  end
+
+  it "using percent with 'q', stopping interpolation" do
+    %q(#{@ip}).should == '#{@ip}'
+  end
+
+  it "using percent with 'Q' to interpolate" do
+    %Q(#{@ip}).should == 'xxx'
+  end
+
+  # The backslashes :
+  #
+  # \t (tab), \n (newline), \r (carriage return), \f (form feed), \b
+  # (backspace), \a (bell), \e (escape), \s (whitespace), \nnn (octal),
+  # \xnn (hexadecimal), \cx (control x), \C-x (control x), \M-x (meta x),
+  # \M-\C-x (meta control x)
+  
+  it "backslashes follow the same rules as interpolation" do
+    "\t\n\r\f\b\a\e\s\075\x62\cx".should == "\t\n\r\f\b\a\e =b\030"
+    '\t\n\r\f\b\a\e =b\030'.should == "\\t\\n\\r\\f\\b\\a\\e =b\\030"
+  end
+
+  it "allow HEREDOC with <<identifier, interpolated" do
+    s = <<HERE
+foo bar#{@ip}
+HERE
+    s.should == "foo barxxx\n"
+  end
+  
+  it 'allow HEREDOC with <<"identifier", interpolated' do
+    s = <<"HERE"
+foo bar#{@ip}
+HERE
+    s.should == "foo barxxx\n"
+  end
+
+  it "allow HEREDOC with <<'identifier', no interpolation" do
+    s = <<'HERE'
+foo bar#{@ip}
+HERE
+    s.should == 'foo bar#{@ip}' + "\n"
+  end
+  
+  it "allow HEREDOC with <<-identifier, allowing to indent identifier, interpolated" do
+    s = <<-HERE
+    foo bar#{@ip}
+    HERE
+
+    s.should == "    foo barxxx\n"
+  end
+  
+  it 'allow HEREDOC with <<-"identifier", allowing to indent identifier, interpolated' do
+    s = <<-"HERE"
+    foo bar#{@ip}
+    HERE
+
+    s.should == "    foo barxxx\n"
+  end
+  
+  it "allow HEREDOC with <<-'identifier', allowing to indent identifier, no interpolation" do
+    s = <<-'HERE'
+    foo bar#{@ip}
+    HERE
+
+    s.should == '    foo bar#{@ip}' + "\n"
+  end
+
+
+  ruby_version_is '1.9' do
+    it "are produced from character shortcuts" do
+      ?z.should == 'z'
+    end
+
+    it "are produced from control character shortcuts" do
+      # Control-Z
+      ?\C-z.should == "\x1A"
+
+      # Meta-Z
+      ?\M-z.should == "\xFA"
+
+      # Meta-Control-Z
+      ?\M-\C-z.should == "\x9A"
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/super_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/super_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/super_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,76 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/super'
+
+describe "The super keyword" do
+  it "calls the method on the calling class" do
+    Super::S1::A.new.foo([]).should == ["A#foo","A#bar"]
+    Super::S1::A.new.bar([]).should == ["A#bar"]
+    Super::S1::B.new.foo([]).should == ["B#foo","A#foo","B#bar","A#bar"]
+    Super::S1::B.new.bar([]).should == ["B#bar","A#bar"]
+  end
+  
+  it "searches the full inheritence chain" do
+    Super::S2::B.new.foo([]).should == ["B#foo","A#baz"]
+    Super::S2::B.new.baz([]).should == ["A#baz"]
+    Super::S2::C.new.foo([]).should == ["B#foo","C#baz","A#baz"]
+    Super::S2::C.new.baz([]).should == ["C#baz","A#baz"]
+  end
+
+  it "searches class methods" do
+    Super::S3::A.new.foo([]).should == ["A#foo"]
+    Super::S3::A.foo([]).should == ["A::foo"]
+    Super::S3::A.bar([]).should == ["A::bar","A::foo"]
+    Super::S3::B.new.foo([]).should == ["A#foo"]
+    Super::S3::B.foo([]).should == ["B::foo","A::foo"]
+    Super::S3::B.bar([]).should == ["B::bar","A::bar","B::foo","A::foo"]
+  end
+
+  it "calls the method on the calling class including modules" do
+    Super::MS1::A.new.foo([]).should == ["ModA#foo","ModA#bar"]
+    Super::MS1::A.new.bar([]).should == ["ModA#bar"]
+    Super::MS1::B.new.foo([]).should == ["B#foo","ModA#foo","ModB#bar","ModA#bar"]
+    Super::MS1::B.new.bar([]).should == ["ModB#bar","ModA#bar"]
+  end
+  
+  it "searches the full inheritence chain including modules" do
+    Super::MS2::B.new.foo([]).should == ["ModB#foo","A#baz"]
+    Super::MS2::B.new.baz([]).should == ["A#baz"]
+    Super::MS2::C.new.baz([]).should == ["C#baz","A#baz"]
+    Super::MS2::C.new.foo([]).should == ["ModB#foo","C#baz","A#baz"]
+  end
+
+  it "searches class methods including modules" do
+    Super::MS3::A.new.foo([]).should == ["A#foo"]
+    Super::MS3::A.foo([]).should == ["ModA#foo"]
+    Super::MS3::A.bar([]).should == ["ModA#bar","ModA#foo"]
+    Super::MS3::B.new.foo([]).should == ["A#foo"]
+    Super::MS3::B.foo([]).should == ["B::foo","ModA#foo"]
+    Super::MS3::B.bar([]).should == ["B::bar","ModA#bar","B::foo","ModA#foo"]
+  end
+
+  it "calls the correct method when the method visibility is modified" do
+    Super::MS4::A.new.example.should == 5
+  end
+  
+  it "calls the correct method when the superclass argument list is different from the subclass" do
+    Super::S4::A.new.foo([]).should == ["A#foo"]
+    Super::S4::B.new.foo([],"test").should == ["B#foo(a,test)", "A#foo"]
+  end
+
+  it "raises an error error when super method does not exist" do
+    sup = Class.new
+    sub_normal = Class.new(sup) do
+      def foo
+        super()
+      end
+    end
+    sub_zsuper = Class.new(sup) do
+      def foo
+        super
+      end
+    end
+
+    lambda {sub_normal.new.foo}.should raise_error(NoMethodError, /super/)
+    lambda {sub_zsuper.new.foo}.should raise_error(NoMethodError, /super/)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/symbol_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/symbol_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/symbol_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,72 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe "A Symbol literal" do
+  it "is a ':' followed by any number of valid characters" do
+    a = :foo
+    a.should be_kind_of(Symbol)
+    a.inspect.should == ':foo'
+  end
+
+  it "is a ':' followed by any valid variable, method, or constant name" do
+    # Add more of these?
+    [ :Foo,
+      :foo,
+      :@foo,
+      :@@foo,
+      :$foo,
+      :_,
+      :~,
+      :- ,
+      :FOO,
+      :_Foo,
+      :&,
+      :_9
+    ].each { |s| s.should be_kind_of(Symbol) }
+  end
+
+  it "is a ':' followed by a single- or double-quoted string that may contain otherwise invalid characters" do
+    [ [:'foo bar',      ':"foo bar"'],
+      [:'++',           ':"++"'],
+      [:'9',            ':"9"'],
+      [:"foo #{1 + 1}", ':"foo 2"'],
+    ].each { |sym, str| 
+      sym.should be_kind_of(Symbol)
+      sym.inspect.should == str
+    }
+  end
+
+  it "may contain '::' in the string" do
+    :'Some::Class'.should be_kind_of(Symbol)
+  end
+
+  it "is converted to a literal, unquoted representation if the symbol contains only valid characters" do
+    a, b, c = :'foo', :'+', :'Foo__9'
+    a.class.should == Symbol
+    a.inspect.should == ':foo'
+    b.class.should == Symbol
+    b.inspect.should == ':+'
+    c.class.should == Symbol
+    c.inspect.should == ':Foo__9'
+  end
+
+  it "must not be an empty string" do
+    lambda { eval ":''" }.should raise_error(SyntaxError)
+  end
+
+  it "can be created by the %s-delimited expression" do
+    a, b = :'foo bar', %s{foo bar}
+    b.class.should == Symbol
+    b.inspect.should == ':"foo bar"'
+    b.should == a
+  end
+
+  it "is the same object when created from identical strings" do
+    var = "@@var"
+    [ [:symbol, :symbol],
+      [:'a string', :'a string'],
+      [:"#{var}", :"#{var}"]
+    ].each { |a, b|
+      a.should equal(b)
+    }
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/throw_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/throw_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/throw_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,70 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe "The throw keyword" do
+  it "abandons processing" do
+    i = 0
+    catch(:done) do
+      loop do
+        i += 1
+        throw :done if i > 4
+      end
+      i += 1
+    end    
+    i.should == 5
+  end
+  
+  it "supports a second parameter" do
+    msg = catch(:exit) do
+      throw :exit,:msg
+    end
+    msg.should == :msg
+  end
+
+  it "uses nil as a default second parameter" do
+    msg = catch(:exit) do
+      throw :exit
+    end
+    msg.should == nil
+  end
+
+  it "only allows symbols and strings as it's argument" do
+    lambda { throw 1 }.should raise_error(ArgumentError)    
+    lambda { throw Object.new }.should raise_error(TypeError)    
+  end
+
+  it "converts strings to a symbol" do
+    lambda { catch(:exit) { throw "exit" } }.should_not raise_error
+    a = "exit"
+    lambda { catch(:exit) { throw a } }.should_not raise_error
+  end
+    
+  it "unwinds stack from within a method" do
+    def throw_method(handler,val)
+      throw handler,val
+    end
+
+    catch(:exit) do
+      throw_method(:exit,5)
+    end.should == 5
+  end
+
+  it "unwinds stack from within a lambda" do
+    c = lambda { throw :foo, :msg }
+    catch(:foo) { c.call }.should == :msg
+  end
+  
+  it "raises a name error if outside of scope of a matching catch" do    
+    lambda { throw :test,5 }.should raise_error(NameError)
+    lambda { catch(:different) { throw :test,5 } }.should raise_error(NameError)
+  end
+
+  it "raises a ThreadError if used to exit a thread" do
+    lambda {
+      catch(:what) do
+        Thread.new do
+          throw :what
+        end.join
+      end
+    }.should raise_error(ThreadError)
+  end    
+end

Added: MacRuby/branches/experimental/spec/frozen/language/undef_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/undef_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/undef_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+class UndefSpecClass
+  def meth(other);other;end
+end
+
+describe "The undef keyword" do
+  it "undefines 'meth='" do
+    obj = UndefSpecClass.new
+    (obj.meth 5).should == 5
+    class UndefSpecClass
+      undef meth
+    end
+    lambda { obj.meth 5 }.should raise_error(NoMethodError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/unless_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/unless_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/unless_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,47 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe "The unless expression" do
+  it "evaluates the unless body when the expression is false" do
+    unless false
+      a = true
+    else
+      a = false
+    end
+    
+    a.should == true
+  end
+  
+  it "returns the last statement in the body" do
+    unless false
+      'foo'
+      'bar'
+      'baz'
+    end.should == 'baz'
+  end
+  
+  it "evaluates the else body when the expression is true" do
+    unless true
+      'foo'
+    else
+      'bar'
+    end.should == 'bar'
+  end
+  
+  it "takes an optional then after the expression" do
+    unless false then
+      'baz'
+    end.should == 'baz'
+  end
+  
+  it "does not return a value when the expression is true" do
+    unless true; end.should == nil
+  end
+
+  it "allows expression and body to be on one line (using ':')" do
+    unless false: 'foo'; else 'bar'; end.should == 'foo'
+  end
+  
+  it "allows expression and body to be on one line (using 'then')" do
+    unless false then 'foo'; else 'bar'; end.should == 'foo'
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/language/until_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/until_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/until_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,234 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+# until bool-expr [do]
+#   body
+# end
+# 
+# begin
+#   body
+# end until bool-expr
+# 
+# expr until bool-expr
+describe "The until expression" do
+  it "runs while the expression is false" do
+    i = 0
+    until i > 9
+      i += 1
+    end
+
+    i.should == 10
+  end
+  
+  it "optionally takes a 'do' after the expression" do
+    i = 0
+    until i > 9 do
+      i += 1
+    end
+    
+    i.should == 10
+  end
+  
+  it "allows body begin on the same line if do is used" do
+    i = 0
+    until i > 9 do i += 1
+    end
+    
+    i.should == 10
+  end
+  
+  it "executes code in containing variable scope" do
+    i = 0
+    until i == 1
+      a = 123
+      i = 1
+    end
+    
+    a.should == 123
+  end
+  
+  it "executes code in containing variable scope with 'do'" do
+    i = 0
+    until i == 1 do
+      a = 123
+      i = 1
+    end
+    
+    a.should == 123
+  end
+  
+  it "returns nil if ended when condition became true" do
+    i = 0
+    until i > 9
+      i += 1
+    end.should == nil
+  end
+
+  it "evaluates the body if expression is empty" do
+    a = []
+    until ()
+      a << :body_evaluated
+      break
+    end
+    a.should == [:body_evaluated]
+  end
+
+  it "stops running body if interrupted by break" do
+    i = 0
+    until i > 9
+      i += 1
+      break if i > 5
+    end
+    i.should == 6
+  end
+  
+  it "returns value passed to break if interrupted by break" do
+    until false
+      break 123
+    end.should == 123
+  end
+  
+  it "returns nil if interrupted by break with no arguments" do
+    until false
+      break
+    end.should == nil
+  end
+
+  it "skips to end of body with next" do
+    a = []
+    i = 0
+    until (i+=1)>=5
+      next if i==3
+      a << i
+    end
+    a.should == [1, 2, 4]
+  end
+
+  it "restarts the current iteration without reevaluating condition with redo" do
+    a = []
+    i = 0
+    j = 0
+    until (i+=1)>=3
+      a << i
+      j+=1
+      redo if j<3
+    end
+    a.should == [1, 1, 1, 2]
+  end
+end
+  
+describe "The until modifier" do
+  it "runs preceding statement while the condition is false" do
+    i = 0
+    i += 1 until i > 9
+    i.should == 10
+  end
+  
+  it "evaluates condition before statement execution" do
+    a = []
+    i = 0
+    a << i until (i+=1) >= 3
+    a.should == [1, 2]
+  end
+  
+  it "does not run preceding statement if the condition is true" do
+    i = 0
+    i += 1 until true
+    i.should == 0
+  end
+  
+  it "returns nil if ended when condition became true" do
+    i = 0
+    (i += 1 until i>9).should == nil
+  end
+  
+  it "returns value passed to break if interrupted by break" do
+    (break 123 until false).should == 123
+  end
+  
+  it "returns nil if interrupted by break with no arguments" do
+    (break until false).should == nil
+  end
+
+  it "skips to end of body with next" do
+    i = 0
+    j = 0
+    ((i+=1) == 3 ? next : j+=i) until i > 10
+    j.should == 63
+  end
+
+  it "restarts the current iteration without reevaluating condition with redo" do
+    i = 0
+    j = 0
+    (i+=1) == 4 ? redo : j+=i until (i+=1) > 10
+    j.should == 34
+  end
+end
+
+describe "The until modifier with begin .. end block" do
+  it "runs block while the expression is false" do
+    i = 0
+    begin
+      i += 1
+    end until i > 9
+    
+    i.should == 10
+  end
+  
+  it "stops running block if interrupted by break" do
+    i = 0
+    begin
+      i += 1
+      break if i > 5
+    end until i > 9
+    
+    i.should == 6
+  end
+  
+  it "returns value passed to break if interrupted by break" do
+    (begin; break 123; end until false).should == 123
+  end
+  
+  it "returns nil if interrupted by break with no arguments" do
+    (begin; break; end until false).should == nil
+  end
+  
+  it "runs block at least once (even if the expression is true)" do
+    i = 0
+    begin
+      i += 1
+    end until true
+    
+    i.should == 1
+  end
+
+  it "evaluates condition after block execution" do
+    a = []
+    i = 0
+    begin
+      a << i
+    end until (i+=1)>=5
+    a.should == [0, 1, 2, 3, 4]
+  end
+
+  it "skips to end of body with next" do
+    a = []
+    i = 0
+    begin
+      next if i==3
+      a << i
+    end until (i+=1)>=5
+    a.should == [0, 1, 2, 4]
+  end
+
+  it "restart the current iteration without reevaluting condition with redo" do
+    a = []
+    i = 0
+    j = 0
+    begin
+      a << i
+      j+=1
+      redo if j<3
+    end until (i+=1)>=3
+    a.should == [0, 0, 0, 1, 2]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/variables_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/variables_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/variables_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,964 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/variables'
+
+# TODO: partition these specs into distinct cases based on the
+# real parsed forms, not the superficial code forms.
+describe "Basic assignment" do
+  it "allows the rhs to be assigned to the lhs" do
+    a = nil;       a.should == nil
+    a = 1;         a.should == 1
+    a = [];        a.should == []
+    a = [1];       a.should == [1]
+    a = [nil];     a.should == [nil]
+    a = [[]];      a.should == [[]]
+    a = [1,2];     a.should == [1,2]
+    a = [*[]];     a.should == []
+    a = [*[1]];    a.should == [1]
+    a = [*[1,2]];  a.should == [1, 2]
+  end
+
+  it "assigns nil to lhs when rhs is an empty expression" do
+    a = ()
+    a.should be_nil
+
+    a = *()
+    a.should be_nil
+  end
+
+  it "allows the assignment of the rhs to the lhs using the rhs splat operator" do
+    a = *nil;      a.should == nil
+    a = *1;        a.should == 1
+    a = *[];       a.should == nil
+    a = *[1];      a.should == 1
+    a = *[nil];    a.should == nil
+    a = *[[]];     a.should == []
+    a = *[1,2];    a.should == [1,2]
+    a = *[*[]];    a.should == nil
+    a = *[*[1]];   a.should == 1
+    a = *[*[1,2]]; a.should == [1,2]
+  end
+
+  it "allows the assignment of the rhs to the lhs using the lhs splat operator" do
+    * = 1,2        # Valid syntax, but pretty useless! Nothing to test
+    *a = nil;      a.should == [nil]
+    *a = 1;        a.should == [1]
+    *a = [];       a.should == [[]]
+    *a = [1];      a.should == [[1]]
+    *a = [nil];    a.should == [[nil]]
+    *a = [[]];     a.should == [[[]]]
+    *a = [1,2];    a.should == [[1,2]]
+    *a = [*[]];    a.should == [[]]
+    *a = [*[1]];   a.should == [[1]]
+    *a = [*[1,2]]; a.should == [[1,2]]
+  end
+
+  it "allows the assignment of rhs to the lhs using the lhs and rhs splat operators simultaneously" do
+    *a = *nil;      a.should == [nil]
+    *a = *1;        a.should == [1]
+    *a = *[];       a.should == []
+    *a = *[1];      a.should == [1]
+    *a = *[nil];    a.should == [nil]
+    *a = *[[]];     a.should == [[]]
+    *a = *[1,2];    a.should == [1,2]
+    *a = *[*[]];    a.should == []
+    *a = *[*[1]];   a.should == [1]
+    *a = *[*[1,2]]; a.should == [1,2]
+  end
+
+  it "allows multiple values to be assigned" do
+    a,b,*c = nil;       [a,b,c].should == [nil, nil, []]
+    a,b,*c = 1;         [a,b,c].should == [1, nil, []]
+    a,b,*c = [];        [a,b,c].should == [nil, nil, []]
+    a,b,*c = [1];       [a,b,c].should == [1, nil, []]
+    a,b,*c = [nil];     [a,b,c].should == [nil, nil, []]
+    a,b,*c = [[]];      [a,b,c].should == [[], nil, []]
+    a,b,*c = [1,2];     [a,b,c].should == [1,2,[]]
+    a,b,*c = [*[]];     [a,b,c].should == [nil, nil, []]
+    a,b,*c = [*[1]];    [a,b,c].should == [1, nil, []]
+    a,b,*c = [*[1,2]];  [a,b,c].should == [1, 2, []]
+
+    a,b,*c = *nil;      [a,b,c].should == [nil, nil, []]
+    a,b,*c = *1;        [a,b,c].should == [1, nil, []]
+    a,b,*c = *[];       [a,b,c].should == [nil, nil, []]
+    a,b,*c = *[1];      [a,b,c].should == [1, nil, []]
+    a,b,*c = *[nil];    [a,b,c].should == [nil, nil, []]
+    a,b,*c = *[[]];     [a,b,c].should == [[], nil, []]
+    a,b,*c = *[1,2];    [a,b,c].should == [1,2,[]]
+    a,b,*c = *[*[]];    [a,b,c].should == [nil, nil, []]
+    a,b,*c = *[*[1]];   [a,b,c].should == [1, nil, []]
+    a,b,*c = *[*[1,2]]; [a,b,c].should == [1, 2, []]
+  end
+
+  it "supports the {|r,| } form of block assignment" do
+    f = lambda {|r,| r.should == []}
+    f.call([], *[])
+
+    f = lambda{|x,| x}
+    f.call(42).should == 42
+    f.call([42]).should == [42]
+    f.call([[42]]).should == [[42]]
+    f.call([42,55]).should == [42,55]
+  end
+
+  it "allows assignment through lambda" do
+    f = lambda {|r,*l| r.should == []; l.should == [1]}
+    f.call([], *[1])
+
+    f = lambda{|x| x}
+    f.call(42).should == 42
+    f.call([42]).should == [42]
+    f.call([[42]]).should == [[42]]
+    f.call([42,55]).should == [42,55]
+
+    f = lambda{|*x| x}
+    f.call(42).should == [42]
+    f.call([42]).should == [[42]]
+    f.call([[42]]).should == [[[42]]]
+    f.call([42,55]).should == [[42,55]]
+    f.call(42,55).should == [42,55]
+  end
+
+  it "allows chained assignment" do
+    (a = 1 + b = 2 + c = 4 + d = 8).should == 15
+    d.should == 8
+    c.should == 12
+    b.should == 14
+    a.should == 15
+  end
+end
+
+describe "Assignment using expansion" do
+  it "succeeds without conversion" do
+    *x = (1..7).to_a
+    x.should == [[1, 2, 3, 4, 5, 6, 7]]
+  end
+end
+
+describe "Assigning multiple values" do
+  it "allows parallel assignment" do
+    a, b = 1, 2
+    a.should == 1
+    b.should == 2
+
+    a, = 1,2
+    a.should == 1
+  end
+
+  it "allows safe parallel swapping" do
+    a, b = 1, 2
+    a, b = b, a
+    a.should == 2
+    b.should == 1
+  end
+
+  it "evaluates rhs left-to-right" do
+    a = VariablesSpecs::ParAsgn.new
+    d,e,f = a.inc, a.inc, a.inc
+    d.should == 1
+    e.should == 2
+    f.should == 3
+  end
+
+  it "supports parallel assignment to lhs args via object.method=" do
+    a = VariablesSpecs::ParAsgn.new
+    a.x,b = 1,2
+    a.x.should == 1
+    b.should == 2
+
+    c = VariablesSpecs::ParAsgn.new
+    c.x,a.x = a.x,b
+    c.x.should == 1
+    a.x.should == 2
+  end
+
+  it "supports parallel assignment to lhs args using []=" do
+    a = [1,2,3]
+    a[3],b = 4,5
+    a.should == [1,2,3,4]
+    b.should == 5
+  end
+
+  it "bundles remaining values to an array when using the splat operator" do
+    a, *b = 1, 2, 3
+    a.should == 1
+    b.should == [2, 3]
+
+    *a = 1, 2, 3
+    a.should == [1, 2, 3]
+
+    *a = 4
+    a.should == [4]
+
+    *a = nil
+    a.should == [nil]
+
+    a,=*[1]
+    a.should == 1
+    a,=*[[1]]
+    a.should == [1]
+    a,=*[[[1]]]
+    a.should == [[1]]
+  end
+
+  it "calls #to_ary on rhs arg if rhs has only a single arg" do
+    x = VariablesSpecs::ParAsgn.new
+    a,b,c = x
+    a.should == 1
+    b.should == 2
+    c.should == 3
+
+    a,b,c = x,5
+    a.should == x
+    b.should == 5
+    c.should == nil
+
+    a,b,c = 5,x
+    a.should == 5
+    b.should == x
+    c.should == nil
+
+    a,b,*c = x,5
+    a.should == x
+    b.should == 5
+    c.should == []
+
+    a,(*b),c = 5,x
+    a.should == 5
+    b.should == [x]
+    c.should == nil
+
+    a,(b,c) = 5,x
+    a.should == 5
+    b.should == 1
+    c.should == 2
+
+    a,(b,*c) = 5,x
+    a.should == 5
+    b.should == 1
+    c.should == [2,3,4]
+
+    a,(b,(*c)) = 5,x
+    a.should == 5
+    b.should == 1
+    c.should == [2]
+
+    a,(b,(*c),(*d)) = 5,x
+    a.should == 5
+    b.should == 1
+    c.should == [2]
+    d.should == [3]
+
+    a,(b,(*c),(d,*e)) = 5,x
+    a.should == 5
+    b.should == 1
+    c.should == [2]
+    d.should == 3
+    e.should == []
+  end
+
+  it "allows complex parallel assignment" do
+    a, (b, c), d = 1, [2, 3], 4
+    a.should == 1
+    b.should == 2
+    c.should == 3
+    d.should == 4
+
+    x, (y, z) = 1, 2, 3
+    [x,y,z].should == [1,2,nil]
+    x, (y, z) = 1, [2,3]
+    [x,y,z].should == [1,2,3]
+    x, (y, z) = 1, [2]
+    [x,y,z].should == [1,2,nil]
+
+    a,(b,c,*d),(e,f),*g = 0,[1,2,3,4],[5,6],7,8
+    a.should == 0
+    b.should == 1
+    c.should == 2
+    d.should == [3,4]
+    e.should == 5
+    f.should == 6
+    g.should == [7,8]
+
+    x = VariablesSpecs::ParAsgn.new
+    a,(b,c,*d),(e,f),*g = 0,x,[5,6],7,8
+    a.should == 0
+    b.should == 1
+    c.should == 2
+    d.should == [3,4]
+    e.should == 5
+    f.should == 6
+    g.should == [7,8]
+  end
+
+  it "allows a lhs arg to be used in another lhs args parallel assignment" do
+    c = [4,5,6]
+    a,b,c[a] = 1,2,3
+    a.should == 1
+    b.should == 2
+    c.should == [4,3,6]
+
+    c[a],b,a = 7,8,9
+    a.should == 9
+    b.should == 8
+    c.should == [4,7,6]
+  end
+end
+
+describe "Conditional assignment" do
+  it "assigns the lhs if previously unassigned" do
+    a=[]
+    a[0] ||= "bar"
+    a[0].should == "bar"
+
+    h={}
+    h["foo"] ||= "bar"
+    h["foo"].should == "bar"
+
+    h["foo".to_sym] ||= "bar"
+    h["foo".to_sym].should == "bar"
+
+    aa = 5
+    aa ||= 25
+    aa.should == 5
+
+    bb ||= 25
+    bb.should == 25
+
+    cc &&=33
+    cc.should == nil
+
+    cc = 5
+    cc &&=44
+    cc.should == 44
+  end
+
+  it "checks for class variable definition before fetching its value" do
+    class VariableSpecCVarSpec
+      @@cvarspec ||= 5
+      @@cvarspec.should == 5
+    end
+  end
+end
+
+describe "Operator assignment 'var op= expr'" do
+  it "is equivalent to 'var = var op expr'" do
+    x = 13
+    (x += 5).should == 18
+    x.should == 18
+
+    x = 17
+    (x -= 11).should == 6
+    x.should == 6
+
+    x = 2
+    (x *= 5).should == 10
+    x.should == 10
+
+    x = 36
+    (x /= 9).should == 4
+    x.should == 4
+
+    x = 23
+    (x %= 5).should == 3
+    x.should == 3
+    (x %= 3).should == 0
+    x.should == 0
+
+    x = 2
+    (x **= 3).should == 8
+    x.should == 8
+
+    x = 4
+    (x |= 3).should == 7
+    x.should == 7
+    (x |= 4).should == 7
+    x.should == 7
+
+    x = 6
+    (x &= 3).should == 2
+    x.should == 2
+    (x &= 4).should == 0
+    x.should == 0
+
+    # XOR
+    x = 2
+    (x ^= 3).should == 1
+    x.should == 1
+    (x ^= 4).should == 5
+    x.should == 5
+
+    # Bit-shift left
+    x = 17
+    (x <<= 3).should == 136
+    x.should == 136
+
+    # Bit-shift right
+    x = 5
+    (x >>= 1).should == 2
+    x.should == 2
+
+    x = nil
+    (x ||= 17).should == 17
+    x.should == 17
+    (x ||= 2).should == 17
+    x.should == 17
+
+    x = false
+    (x &&= true).should == false
+    x.should == false
+    (x &&= false).should == false
+    x.should == false
+    x = true
+    (x &&= true).should == true
+    x.should == true
+    (x &&= false).should == false
+    x.should == false
+  end
+
+  it "uses short-circuit arg evaluation for operators ||= and &&=" do
+    x = 8
+    y = VariablesSpecs::OpAsgn.new
+    (x ||= y.do_side_effect).should == 8
+    y.side_effect.should == nil
+
+    x = nil
+    (x &&= y.do_side_effect).should == nil
+    y.side_effect.should == nil
+
+    y.a = 5
+    (x ||= y.do_side_effect).should == 5
+    y.side_effect.should == true
+  end
+end
+
+describe "Operator assignment 'obj.meth op= expr'" do
+  it "is equivalent to 'obj.meth = obj.meth op expr'" do
+    @x = VariablesSpecs::OpAsgn.new
+    @x.a = 13
+    (@x.a += 5).should == 18
+    @x.a.should == 18
+
+    @x.a = 17
+    (@x.a -= 11).should == 6
+    @x.a.should == 6
+
+    @x.a = 2
+    (@x.a *= 5).should == 10
+    @x.a.should == 10
+
+    @x.a = 36
+    (@x.a /= 9).should == 4
+    @x.a.should == 4
+
+    @x.a = 23
+    (@x.a %= 5).should == 3
+    @x.a.should == 3
+    (@x.a %= 3).should == 0
+    @x.a.should == 0
+
+    @x.a = 2
+    (@x.a **= 3).should == 8
+    @x.a.should == 8
+
+    @x.a = 4
+    (@x.a |= 3).should == 7
+    @x.a.should == 7
+    (@x.a |= 4).should == 7
+    @x.a.should == 7
+
+    @x.a = 6
+    (@x.a &= 3).should == 2
+    @x.a.should == 2
+    (@x.a &= 4).should == 0
+    @x.a.should == 0
+
+    # XOR
+    @x.a = 2
+    (@x.a ^= 3).should == 1
+    @x.a.should == 1
+    (@x.a ^= 4).should == 5
+    @x.a.should == 5
+
+    @x.a = 17
+    (@x.a <<= 3).should == 136
+    @x.a.should == 136
+
+    @x.a = 5
+    (@x.a >>= 1).should == 2
+    @x.a.should == 2
+
+    @x.a = nil
+     (@x.a ||= 17).should == 17
+    @x.a.should == 17
+    (@x.a ||= 2).should == 17
+    @x.a.should == 17
+
+    @x.a = false
+    (@x.a &&= true).should == false
+    @x.a.should == false
+    (@x.a &&= false).should == false
+    @x.a.should == false
+    @x.a = true
+    (@x.a &&= true).should == true
+    @x.a.should == true
+    (@x.a &&= false).should == false
+    @x.a.should == false
+  end
+
+  it "uses short-circuit arg evaluation for operators ||= and &&=" do
+    x = 8
+    y = VariablesSpecs::OpAsgn.new
+    (x ||= y.do_side_effect).should == 8
+    y.side_effect.should == nil
+
+    x = nil
+    (x &&= y.do_side_effect).should == nil
+    y.side_effect.should == nil
+
+    y.a = 5
+    (x ||= y.do_side_effect).should == 5
+    y.side_effect.should == true
+  end
+
+  it "evaluates lhs one time" do
+    x = VariablesSpecs::OpAsgn.new
+    x.a = 5
+    (x.do_more_side_effects.a += 5).should == 15
+    x.a.should == 15
+
+    x.a = 5
+    (x.do_more_side_effects.a -= 4).should == 6
+    x.a.should == 6
+
+    x.a = 2
+    (x.do_more_side_effects.a *= 5).should == 35
+    x.a.should == 35
+
+    x.a = 31
+    (x.do_more_side_effects.a /= 9).should == 4
+    x.a.should == 4
+
+    x.a = 18
+    (x.do_more_side_effects.a %= 5).should == 3
+    x.a.should == 3
+
+    x.a = 0
+    (x.do_more_side_effects.a **= 3).should == 125
+    x.a.should == 125
+
+    x.a = -1
+    (x.do_more_side_effects.a |= 3).should == 7
+    x.a.should == 7
+
+    x.a = 1
+    (x.do_more_side_effects.a &= 3).should == 2
+    x.a.should == 2
+
+    # XOR
+    x.a = -3
+    (x.do_more_side_effects.a ^= 3).should == 1
+    x.a.should == 1
+
+    x.a = 12
+    (x.do_more_side_effects.a <<= 3).should == 136
+    x.a.should == 136
+
+    x.a = 0
+    (x.do_more_side_effects.a >>= 1).should == 2
+    x.a.should == 2
+
+    x.a = nil
+    x.b = 0
+    (x.do_bool_side_effects.a ||= 17).should == 17
+    x.a.should == 17
+    x.b.should == 1
+
+    x.a = false
+    x.b = 0
+    (x.do_bool_side_effects.a &&= true).should == false
+    x.a.should == false
+    x.b.should == 1
+    (x.do_bool_side_effects.a &&= false).should == false
+    x.a.should == false
+    x.b.should == 2
+    x.a = true
+    x.b = 0
+    (x.do_bool_side_effects.a &&= true).should == true
+    x.a.should == true
+    x.b.should == 1
+    (x.do_bool_side_effects.a &&= false).should == false
+    x.a.should == false
+    x.b.should == 2
+  end
+end
+
+describe "Operator assignment 'obj[idx] op= expr'" do
+  it "is equivalent to 'obj[idx] = obj[idx] op expr'" do
+    x = [2,13,7]
+    (x[1] += 5).should == 18
+    x.should == [2,18,7]
+
+    x = [17,6]
+    (x[0] -= 11).should == 6
+    x.should == [6,6]
+
+    x = [nil,2,28]
+    (x[2] *= 2).should == 56
+    x.should == [nil,2,56]
+
+    x = [3,9,36]
+    (x[2] /= x[1]).should == 4
+    x.should == [3,9,4]
+
+    x = [23,4]
+    (x[0] %= 5).should == 3
+    x.should == [3,4]
+    (x[0] %= 3).should == 0
+    x.should == [0,4]
+
+    x = [1,2,3]
+    (x[1] **= 3).should == 8
+    x.should == [1,8,3]
+
+    x = [4,5,nil]
+    (x[0] |= 3).should == 7
+    x.should == [7,5,nil]
+    (x[0] |= 4).should == 7
+    x.should == [7,5,nil]
+
+    x = [3,6,9]
+    (x[1] &= 3).should == 2
+    x.should == [3,2,9]
+    (x[1] &= 4).should == 0
+    x.should == [3,0,9]
+
+    # XOR
+    x = [0,1,2]
+    (x[2] ^= 3).should == 1
+    x.should == [0,1,1]
+    (x[2] ^= 4).should == 5
+    x.should == [0,1,5]
+
+    x = [17]
+    (x[0] <<= 3).should == 136
+    x.should == [136]
+
+    x = [nil,5,8]
+    (x[1] >>= 1).should == 2
+    x.should == [nil,2,8]
+
+    x = [1,nil,12]
+    (x[1] ||= 17).should == 17
+    x.should == [1,17,12]
+    (x[1] ||= 2).should == 17
+    x.should == [1,17,12]
+
+    x = [true, false, false]
+    (x[1] &&= true).should == false
+    x.should == [true, false, false]
+    (x[1] &&= false).should == false
+    x.should == [true, false, false]
+    (x[0] &&= true).should == true
+    x.should == [true, false, false]
+    (x[0] &&= false).should == false
+    x.should == [false, false, false]
+  end
+
+  it "uses short-circuit arg evaluation for operators ||= and &&=" do
+    x = 8
+    y = VariablesSpecs::OpAsgn.new
+    (x ||= y.do_side_effect).should == 8
+    y.side_effect.should == nil
+
+    x = nil
+    (x &&= y.do_side_effect).should == nil
+    y.side_effect.should == nil
+
+    y.a = 5
+    (x ||= y.do_side_effect).should == 5
+    y.side_effect.should == true
+  end
+
+  it "handles complex index (idx) arguments" do
+    x = [1,2,3,4]
+    (x[0,2] += [5]).should == [1,2,5]
+    x.should == [1,2,5,3,4]
+    (x[0,2] += [3,4]).should == [1,2,3,4]
+    x.should == [1,2,3,4,5,3,4]
+
+    (x[2..3] += [8]).should == [3,4,8]
+    x.should == [1,2,3,4,8,5,3,4]
+
+    y = VariablesSpecs::OpAsgn.new
+    y.a = 1
+    (x[y.do_side_effect] *= 2).should == 4
+    x.should == [1,4,3,4,8,5,3,4]
+
+    h = {'key1' => 23, 'key2' => 'val'}
+    (h['key1'] %= 5).should == 3
+    (h['key2'] += 'ue').should == 'value'
+    h.should == {'key1' => 3, 'key2' => 'value'}
+  end
+
+  it "returns result of rhs not result of []=" do
+    a = VariablesSpecs::Hashalike.new
+
+    (a[123] =   2).should == 2
+    (a[123] +=  2).should == 125
+    (a[123] -=  2).should == 121
+    (a[123] *=  2).should == 246
+    # Guard against the Mathn library
+    # TODO: Make these specs not rely on specific behaviour / result values
+    # by using mocks.
+    conflicts_with :Prime do
+      (a[123] /=  2).should == 61
+    end
+    (a[123] %=  2).should == 1
+    (a[123] **= 2).should == 15129
+    (a[123] |=  2).should == 123
+    (a[123] &=  2).should == 2
+    (a[123] ^=  2).should == 121
+    (a[123] <<= 2).should == 492
+    (a[123] >>= 2).should == 30
+    (a[123] ||= 2).should == 123
+    (a[nil] ||= 2).should == 2
+    (a[123] &&= 2).should == 2
+    (a[nil] &&= 2).should == nil
+  end
+end
+
+describe "Single assignment" do
+  it "Assignment does not modify the lhs, it reassigns its reference" do
+    a = 'Foobar'
+    b = a
+    b = 'Bazquux'
+    a.should == 'Foobar'
+    b.should == 'Bazquux'
+  end
+
+  it "Assignment does not copy the object being assigned, just creates a new reference to it" do
+    a = []
+    b = a
+    b << 1
+    a.should == [1]
+  end
+
+  it "If rhs has multiple arguments, lhs becomes an Array of them" do
+    a = 1, 2, 3
+    a.should == [1, 2, 3]
+
+    a = 1, (), 3
+    a.should == [1, nil, 3]
+  end
+end
+
+describe "Multiple assignment without grouping or splatting" do
+  it "An equal number of arguments on lhs and rhs assigns positionally" do
+    a, b, c, d = 1, 2, 3, 4
+    a.should == 1
+    b.should == 2
+    c.should == 3
+    d.should == 4
+  end
+
+  it "If rhs has too few arguments, the missing ones on lhs are assigned nil" do
+    a, b, c = 1, 2
+    a.should == 1
+    b.should == 2
+    c.should == nil
+  end
+
+  it "If rhs has too many arguments, the extra ones are silently not assigned anywhere" do
+    a, b = 1, 2, 3
+    a.should == 1
+    b.should == 2
+  end
+
+  it "The assignments are done in parallel so that lhs and rhs are independent of eachother without copying" do
+    o_of_a, o_of_b = mock('a'), mock('b')
+    a, b = o_of_a, o_of_b
+    a, b = b, a
+    a.should equal(o_of_b)
+    b.should equal(o_of_a)
+  end
+end
+
+describe "Multiple assignments with splats" do
+  it "* on the lhs has to be applied to the last parameter" do
+    lambda { eval 'a, *b, c = 1, 2, 3' }.should raise_error(SyntaxError)
+  end
+
+  it "* on the lhs collects all parameters from its position onwards as an Array or an empty Array" do
+    a, *b = 1, 2
+    c, *d = 1
+    e, *f = 1, 2, 3
+    g, *h = 1, [2, 3]
+    *i = 1, [2,3]
+    *j = [1,2,3]
+    *k = 1,2,3
+
+    a.should == 1
+    b.should == [2]
+    c.should == 1
+    d.should == []
+    e.should == 1
+    f.should == [2, 3]
+    g.should == 1
+    h.should == [[2, 3]]
+    i.should == [1, [2, 3]]
+    j.should == [[1,2,3]]
+    k.should == [1,2,3]
+  end
+end
+
+describe "Multiple assignments with grouping" do
+  it "A group on the lhs is considered one position and treats its corresponding rhs position like an Array" do
+    a, (b, c), d = 1, 2, 3, 4
+    e, (f, g), h = 1, [2, 3, 4], 5
+    i, (j, k), l = 1, 2, 3
+    a.should == 1
+    b.should == 2
+    c.should == nil
+    d.should == 3
+    e.should == 1
+    f.should == 2
+    g.should == 3
+    h.should == 5
+    i.should == 1
+    j.should == 2
+    k.should == nil
+    l.should == 3
+  end
+
+  it "supports multiple levels of nested groupings" do
+    a,(b,(c,d)) = 1,[2,[3,4]]
+    a.should == 1
+    b.should == 2
+    c.should == 3
+    d.should == 4
+
+    a,(b,(c,d)) = [1,[2,[3,4]]]
+    a.should == 1
+    b.should == 2
+    c.should == 3
+    d.should == 4
+
+    x = [1,[2,[3,4]]]
+    a,(b,(c,d)) = x
+    a.should == 1
+    b.should == 2
+    c.should == 3
+    d.should == 4
+  end
+
+  it "rhs cannot use parameter grouping, it is a syntax error" do
+    lambda { eval '(a, b) = (1, 2)' }.should raise_error(SyntaxError)
+  end
+end
+
+# TODO: merge the following two describe blocks and partition the specs
+# into distinct cases.
+describe "Multiple assignment" do
+  not_compliant_on :rubinius do
+    it "has the proper return value" do
+      (a,b,*c = *[5,6,7,8,9,10]).should == [5,6,7,8,9,10]
+      (d,e = VariablesSpecs.reverse_foo(4,3)).should == [3,4]
+      (f,g,h = VariablesSpecs.reverse_foo(6,7)).should == [7,6]
+      (i,*j = *[5,6,7]).should == [5,6,7]
+      (k,*l = [5,6,7]).should == [5,6,7]
+      a.should == 5
+      b.should == 6
+      c.should == [7,8,9,10]
+      d.should == 3
+      e.should == 4
+      f.should == 7
+      g.should == 6
+      h.should == nil
+      i.should == 5
+      j.should == [6,7]
+      k.should == 5
+      l.should == [6,7]
+    end
+  end
+
+  # TODO: write Rubinius versions
+end
+
+# For now, masgn is deliberately non-compliant with MRI wrt the return val from an masgn.
+# Rubinius returns true as the result of the assignment, but MRI returns an array
+# containing all the elements on the rhs. As this result is never used, the cost
+# of creating and then discarding this array is avoided
+describe "Multiple assignment, array-style" do
+  not_compliant_on :rubinius do
+    it "returns an array of all rhs values" do
+      (a,b = 5,6,7).should == [5,6,7]
+      a.should == 5
+      b.should == 6
+
+      (c,d,*e = 99,8).should == [99,8]
+      c.should == 99
+      d.should == 8
+      e.should == []
+
+      (f,g,h = 99,8).should == [99,8]
+      f.should == 99
+      g.should == 8
+      h.should == nil
+    end
+  end
+
+  deviates_on :rubinius do
+    it "returns true" do
+      (a,b = 5,6,7).should == true
+      a.should == 5
+      b.should == 6
+
+      (c,d,*e = 99,8).should == true
+      c.should == 99
+      d.should == 8
+      e.should == []
+
+      (f,g,h = 99,8).should == true
+      f.should == 99
+      g.should == 8
+      h.should == nil
+    end
+  end
+end
+
+describe "Scope of variables" do
+  it "instance variables not overwritten by local variable in each block" do
+
+    class ScopeVariables
+      attr_accessor :v
+
+      def initialize
+        @v = ['a', 'b', 'c']
+      end
+
+      def check_access
+        v.should == ['a', 'b', 'c']
+        self.v.should == ['a', 'b', 'c']
+      end
+
+      def check_local_variable
+        v = nil
+        self.v.should == ['a', 'b', 'c']
+      end
+
+      def check_each_block
+        self.v.each { |v|
+          # Don't actually do anything
+        }
+        self.v.should == ['a', 'b', 'c']
+        v.should == ['a', 'b', 'c']
+        self.v.object_id.should == v.object_id
+      end
+    end # Class ScopeVariables
+
+    instance = ScopeVariables.new()
+    instance.check_access
+    instance.check_local_variable
+    instance.check_each_block
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/versions/array_1.8.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/versions/array_1.8.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/versions/array_1.8.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+describe "The unpacking splat operator (*)" do
+  it "when applied to a non-Array value attempts to coerce it to Array if the object respond_to?(:to_ary)" do
+    obj = mock("pseudo-array")
+    obj.should_receive(:to_ary).and_return([2, 3, 4])
+    [1, *obj].should == [1, 2, 3, 4]
+  end
+
+  it "when applied to a non-Array value uses it unchanged if it does not respond_to?(:to_ary)" do
+    obj = Object.new
+    obj.should_not respond_to(:to_ary)
+    [1, *obj].should == [1, obj]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/versions/array_1.9.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/versions/array_1.9.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/versions/array_1.9.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+describe "Array literals" do
+  it "[] accepts a literal hash without curly braces as its last parameter" do
+    ["foo", "bar" => :baz].should == ["foo", {"bar" => :baz}]
+    [1, 2, 3 => 6, 4 => 24].should == [1, 2, {3 => 6, 4 => 24}]
+  end
+end
+
+describe "The unpacking splat operator (*)" do
+  it "when applied to a non-Array value attempts to coerce it to Array if the object respond_to?(:to_a)" do
+    obj = mock("pseudo-array")
+    obj.should_receive(:to_a).and_return([2, 3, 4])
+    [1, *obj].should == [1, 2, 3, 4]
+  end
+
+  it "when applied to a non-Array value uses it unchanged if it does not respond_to?(:to_a)" do
+    obj = Object.new
+    obj.should_not respond_to(:to_a)
+    [1, *obj].should == [1, obj]
+  end
+
+  it "can be used before other non-splat elements" do
+    a = [1, 2]
+    [0, *a, 3].should == [0, 1, 2, 3]
+  end
+
+  it "can be used multiple times in the same containing array" do
+    a = [1, 2]
+    b = [1, 0]
+    [*a, 3, *a, *b].should == [1, 2, 3, 1, 2, 1, 0]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/versions/method_1.8.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/versions/method_1.8.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/versions/method_1.8.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,61 @@
+describe "Calling a method" do
+  it "with lambda as block argument is ok" do
+    def foo(a,&b); [a,yield(b)] end
+
+    l = lambda { 300 }
+    foo(10, &l).should == [10,300]
+  end
+
+  it "allows to pass argument, a hash without curly braces and a block argument" do
+    def foo(a,b,&c); [a,b,yield(c)] end
+
+    foo(:abc, 'rbx' => 'cool', 'specs' => 'fail sometimes') { 500 }.should ==
+      [:abc, { 'rbx' => 'cool', 'specs' => 'fail sometimes'}, 500]
+    
+    foo(:abc, 'rbx' => 'cool', 'specs' => 'fail sometimes') do 500 end.should ==
+      [:abc, { 'rbx' => 'cool', 'specs' => 'fail sometimes'}, 500]
+
+    l = lambda { 500 }
+    
+    foo(:abc, 'rbx' => 'cool', 'specs' => 'fail sometimes', &l).should ==
+      [:abc, { 'rbx' => 'cool', 'specs' => 'fail sometimes'}, 500]
+  end
+
+  it "with ambiguous missing parens, arguments go with innermost call" do
+    def f(*a); a.length; end
+    
+    (f f 5, 6).should == 1
+
+    lambda { eval "f 4, f 5, 6" }.should raise_error(SyntaxError)
+
+    [f 5, 6].should == [2]
+    
+    (f (5+6)*7).should == 1
+    (f(5+6)*7).should == 7
+    
+    a, b = f 5, 6
+    a.should == 2
+    b.should == nil
+  end
+
+  it "with splat operator * and non-Array value attempts to coerce it to Array if the object respond_to?(:to_ary)" do
+    def fooP3(a,b,c); a+b+c end
+    def fooP4(a,b,c,d); a+b+c+d end
+
+    obj = "pseudo-array"
+    class << obj
+      def to_ary; [2,3,4] end
+    end
+    fooP3(*obj).should == 9
+    fooP4(1,*obj).should == 10
+  end
+
+  it "with splat operator * and non-Array value uses value unchanged if it does not respond_to?(:to_ary)" do
+    def fooP0R(*args); args.length end
+
+    obj = Object.new
+    obj.should_not respond_to(:to_ary)
+    fooP0R(*obj).should == 1
+    fooP0R(1,2,3,*obj).should == 4
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/versions/method_1.9.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/versions/method_1.9.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/versions/method_1.9.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,111 @@
+# FIXME: Add error case
+
+describe "Calling a method" do
+  it "works with required args after rest arguments" do
+    def fooP0RQ1(*r, q); [r, q]; end
+    fooP0RQ1(1).should == [[], 1]
+    fooP0RQ1(1,2).should == [[1], 2]
+    fooP0RQ1(1,2,3).should == [[1,2], 3]
+
+     def fooP1RQ1(a, *r, q); [a, r, q]; end
+     fooP1RQ1(1,2).should == [1, [], 2]
+     fooP1RQ1(1,2,3).should == [1, [2], 3]
+     fooP1RQ1(1,2,3,4).should == [1, [2, 3], 4]
+
+     def fooP1O1RQ1(a, b=9, *r, q); [a, b, r, q]; end
+     fooP1O1RQ1(1,2).should == [1, 9, [], 2]
+     fooP1O1RQ1(1,2,3).should == [1, 2, [], 3]
+     fooP1O1RQ1(1,2,3,4).should == [1, 2, [3], 4]
+  end
+
+  it "works with block arguments" do
+    def fooP0Q0B(&a); [a.(1)]; end
+    fooP0Q0B() { |z| z }.should == [1]
+    def fooP1Q0B(a, &b); [a, b.(2)]; end
+    fooP1Q0B(1) { |z| z }.should == [1, 2]
+    def fooP1O1Q0B(a, b=2, &c); [a, b, c.(3)]; end
+    fooP1O1Q0B(1) { |z| z }.should == [1, 2, 3]
+    def fooP1O1RQ0B(a, b=2, *c, &d); [a, b, c, d.(5)]; end
+    fooP1O1RQ0B(1, 2, 3, 4) { |z| z }.should == [1, 2, [3, 4], 5]
+  end
+
+#   it "with lambda as block argument is ok" do
+#     def foo(a,&b); [a,yield(b)] end
+
+#     l = lambda { 300 }
+#     foo(10, &l).should == [10,300]
+#   end
+
+#   it "allows to pass argument, a hash without curly braces and a block argument" do
+#     def foo(a,b,&c); [a,b,yield(c)] end
+
+#     foo(:abc, 'rbx' => 'cool', 'specs' => 'fail sometimes') { 500 }.should ==
+#       [:abc, { 'rbx' => 'cool', 'specs' => 'fail sometimes'}, 500]
+    
+#     foo(:abc, 'rbx' => 'cool', 'specs' => 'fail sometimes') do 500 end.should ==
+#       [:abc, { 'rbx' => 'cool', 'specs' => 'fail sometimes'}, 500]
+
+#     l = lambda { 500 }
+    
+#     foo(:abc, 'rbx' => 'cool', 'specs' => 'fail sometimes', &l).should ==
+#       [:abc, { 'rbx' => 'cool', 'specs' => 'fail sometimes'}, 500]
+#   end
+
+#  it "with ambiguous missing parens, arguments go with innermost call" do
+#    def f(*a); a.length; end
+    
+#    (f f 5, 6).should == 1
+
+#    lambda { eval "f 4, f 5, 6" }.should raise_error(SyntaxError)
+
+#    [f 5, 6].should == [2]
+    
+#    (f (5+6)*7).should == 1
+#    (f(5+6)*7).should == 7
+    
+#    a, b = f 5, 6
+#    a.should == 2
+#    b.should == nil
+#  end
+
+  it "with splat operator * and non-Array value attempts to coerce it to Array if the object respond_to?(:to_a)" do
+    def fooP3(a,b,c); a+b+c end
+    def fooP4(a,b,c,d); a+b+c+d end
+
+    obj = "pseudo-array"
+    class << obj
+      def to_a; [2,3,4] end
+    end
+    fooP3(*obj).should == 9
+    fooP4(1,*obj).should == 10
+  end
+
+  it "with splat operator * and non-Array value uses value unchanged if it does not respond_to?(:to_a)" do
+    def fooP0R(*args); args.length end
+
+    obj = Object.new
+    obj.should_not respond_to(:to_a)
+    fooP0R(*obj).should == 1
+    fooP0R(1,2,*obj,3).should == 4
+  end
+
+  it "accepts additional arguments after splat expansion" do
+    def fooP4(a,b,c,d); a+b+c+d end
+
+    a = [1,2]
+    fooP4(*a,3,4).should == 10
+    fooP4(0,*a,3).should == 6
+  end
+
+  it "accepts multiple splat expansions in the same argument list" do
+    def fooP0R(*args); args.length end
+
+    a = [1,2,3]
+    b = 7
+    c = "pseudo-array"
+    def c.to_a; [0,0] end
+    fooP0R(*a,*[4,5],6,*b).should == 7
+    fooP0R(*a,*a,*a).should == 9
+    fooP0R(0,*a,4,*5,6,7,*c,-1).should == 11
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/versions/regexp_1.9.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/versions/regexp_1.9.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/versions/regexp_1.9.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Literal Regexps" do
+  it 'supports (?<= ) (positive lookbehind)' do
+    /foo.(?<=\d)/.match("fooA foo1").to_a.should == ["foo1"]
+  end
+
+  it 'supports (?<! ) (negative lookbehind)' do
+    /foo.(?<!\d)/.match("foo1 fooA").to_a.should == ["fooA"]
+  end
+
+  it 'supports \g (named backreference)' do
+    /(?<foo>foo.)bar\g<foo>/.match("foo1barfoo2").to_a.should == ["foo1barfoo2", "foo2"]
+  end
+
+  it 'supports character class composition' do
+    /[a-z&&[^a-c]]+/.match("abcdef").to_a.should == ["def"]
+    /[a-z&&[^d-i&&[^d-f]]]+/.match("abcdefghi").to_a.should == ["abcdef"]
+  end
+
+  it 'supports possessive quantifiers' do
+    /fooA++bar/.match("fooAAAbar").to_a.should == ["fooAAAbar"]
+      
+    /fooA++Abar/.match("fooAAAbar").should be_nil
+    /fooA?+Abar/.match("fooAAAbar").should be_nil
+    /fooA*+Abar/.match("fooAAAbar").should be_nil
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/language/while_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/while_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/while_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,238 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+# while bool-expr [do]
+#   body
+# end
+#
+# begin
+#   body
+# end while bool-expr
+#
+# expr while bool-expr
+describe "The while expression" do
+  it "runs while the expression is true" do
+    i = 0
+    while i < 3
+      i += 1
+    end
+    i.should == 3
+  end
+  
+  it "optionally takes a 'do' after the expression" do
+    i = 0
+    while i < 3 do
+      i += 1
+    end
+    
+    i.should == 3
+  end
+  
+  it "allows body begin on the same line if do is used" do
+    i = 0
+    while i < 3 do i += 1
+    end
+    
+    i.should == 3
+  end
+  
+  it "executes code in containing variable scope" do
+    i = 0
+    while i != 1
+      a = 123
+      i = 1
+    end
+    
+    a.should == 123
+  end
+  
+  it "executes code in containing variable scope with 'do'" do
+    i = 0
+    while i != 1 do
+      a = 123
+      i = 1
+    end
+    
+    a.should == 123
+  end
+  
+  it "returns nil if ended when condition became false" do
+    i = 0
+    while i < 3
+      i += 1
+    end.should == nil
+  end
+
+  it "does not evaluate the body if expression is empty" do
+    a = []
+    while ()
+      a << :body_evaluated
+    end
+    a.should == []
+  end
+
+  it "stops running body if interrupted by break" do
+    i = 0
+    while i < 10
+      i += 1
+      break if i > 5
+    end
+    i.should == 6
+  end
+  
+  it "returns value passed to break if interrupted by break" do
+    while true
+      break 123
+    end.should == 123
+  end
+  
+  it "returns nil if interrupted by break with no arguments" do
+    while true
+      break
+    end.should == nil
+  end
+
+  it "skips to end of body with next" do
+    a = []
+    i = 0
+    while (i+=1)<5
+      next if i==3
+      a << i
+    end
+    a.should == [1, 2, 4]
+  end
+
+  it "restarts the current iteration without reevaluating condition with redo" do
+    a = []
+    i = 0
+    j = 0
+    while (i+=1)<3
+      a << i
+      j+=1
+      redo if j<3
+    end
+    a.should == [1, 1, 1, 2]
+  end
+end
+  
+describe "The while modifier" do
+  it "runs preceding statement while the condition is true" do
+    i = 0
+    i += 1 while i < 3
+    i.should == 3
+  end
+  
+  it "evaluates condition before statement execution" do
+    a = []
+    i = 0
+    a << i while (i+=1) < 3
+    a.should == [1, 2]
+  end
+  
+  it "does not run preceding statement if the condition is false" do
+    i = 0
+    i += 1 while false
+    i.should == 0
+  end
+
+  it "does not run preceding statement if the condition is empty" do
+    i = 0
+    i += 1 while ()
+    i.should == 0
+  end
+
+  it "returns nil if ended when condition became false" do
+    i = 0
+    (i += 1 while i<10).should == nil
+  end
+  
+  it "returns value passed to break if interrupted by break" do
+    (break 123 while true).should == 123
+  end
+  
+  it "returns nil if interrupted by break with no arguments" do
+    (break while true).should == nil
+  end
+
+  it "skips to end of body with next" do
+    i = 0
+    j = 0
+    ((i+=1) == 3 ? next : j+=i) while i <= 10
+    j.should == 63
+  end
+
+  it "restarts the current iteration without reevaluating condition with redo" do
+    i = 0
+    j = 0
+    (i+=1) == 4 ? redo : j+=i while (i+=1) <= 10
+    j.should == 34
+  end
+end
+
+describe "The while modifier with begin .. end block" do
+  it "runs block while the expression is true" do
+    i = 0
+    begin
+      i += 1
+    end while i < 3
+    
+    i.should == 3
+  end
+  
+  it "stops running block if interrupted by break" do
+    i = 0
+    begin
+      i += 1
+      break if i > 5
+    end while i < 10
+    
+    i.should == 6
+  end
+  
+  it "returns value passed to break if interrupted by break" do
+    (begin; break 123; end while true).should == 123
+  end
+  
+  it "returns nil if interrupted by break with no arguments" do
+    (begin; break; end while true).should == nil
+  end
+  
+  it "runs block at least once (even if the expression is false)" do
+    i = 0
+    begin
+      i += 1
+    end while false
+    
+    i.should == 1
+  end
+
+  it "evaluates condition after block execution" do
+    a = []
+    i = 0
+    begin
+      a << i
+    end while (i+=1)<5
+    a.should == [0, 1, 2, 3, 4]
+  end
+
+  it "skips to end of body with next" do
+    a = []
+    i = 0
+    begin
+      next if i==3
+      a << i
+    end while (i+=1)<5
+    a.should == [0, 1, 2, 4]
+  end
+
+  it "restarts the current iteration without reevaluting condition with redo" do
+    a = []
+    i = 0
+    j = 0
+    begin
+      a << i
+      j+=1
+      redo if j<3
+    end while (i+=1)<3
+    a.should == [0, 0, 0, 1, 2]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/language/yield_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/yield_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/yield_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,103 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/yield'
+
+describe "Assignment via yield" do
+
+  it "assigns objects to block variables" do
+    def f; yield nil; end;      f {|a| a.should == nil }
+    def f; yield 1; end;        f {|a| a.should == 1 }
+    def f; yield []; end;       f {|a| a.should == [] }
+    def f; yield [1]; end;      f {|a| a.should == [1] }
+    def f; yield [nil]; end;    f {|a| a.should == [nil] }
+    def f; yield [[]]; end;     f {|a| a.should == [[]] }
+    def f; yield [*[]]; end;    f {|a| a.should == [] }
+    def f; yield [*[1]]; end;   f {|a| a.should == [1] }
+    def f; yield [*[1,2]]; end; f {|a| a.should == [1,2] }
+  end
+
+  it "assigns splatted objects to block variables" do
+    def f; yield *1; end;       f {|a| a.should == 1 }
+  end
+
+  it "assigns splatted objects to block variables" do
+    def f; yield *nil; end;     f {|a| a.should == nil }
+    def f; yield *[1]; end;     f {|a| a.should == 1 }
+    def f; yield *[nil]; end;   f {|a| a.should == nil }
+    def f; yield *[[]]; end;    f {|a| a.should == [] }
+    def f; yield *[*[1]]; end;  f {|a| a.should == 1 }
+  end
+
+  it "assigns objects followed by splatted objects to block variables" do
+    def f; yield 1, *nil; end;     f {|a, b| b.should == nil }
+    def f; yield 1, *1; end;       f {|a, b| b.should == 1 }
+    def f; yield 1, *[1]; end;     f {|a, b| b.should == 1 }
+    def f; yield 1, *[nil]; end;   f {|a, b| b.should == nil }
+    def f; yield 1, *[[]]; end;    f {|a, b| b.should == [] }
+    def f; yield 1, *[*[1]]; end;  f {|a, b| b.should == 1 }
+  end
+
+  it "assigns objects to block variables that include the splat operator inside the block" do
+    def f; yield; end;          f {|*a| a.should == [] }
+    def f; yield nil; end;      f {|*a| a.should == [nil] }
+    def f; yield 1; end;        f {|*a| a.should == [1] }
+    def f; yield []; end;       f {|*a| a.should == [[]] }
+    def f; yield [1]; end;      f {|*a| a.should == [[1]] }
+    def f; yield [nil]; end;    f {|*a| a.should == [[nil]] }
+    def f; yield [[]]; end;     f {|*a| a.should == [[[]]] }
+    def f; yield [1,2]; end;    f {|*a| a.should == [[1,2]] }
+    def f; yield [*[]]; end;    f {|*a| a.should == [[]] }
+    def f; yield [*[1]]; end;   f {|*a| a.should == [[1]] }
+    def f; yield [*[1,2]]; end; f {|*a| a.should == [[1,2]] }
+  end
+
+  it "assigns objects to multiple block variables" do
+    def f; yield; end;          f {|a,b,*c| [a,b,c].should == [nil,nil,[]] }
+    def f; yield nil; end;      f {|a,b,*c| [a,b,c].should == [nil,nil,[]] }
+    def f; yield 1; end;        f {|a,b,*c| [a,b,c].should == [1,nil,[]] }
+    def f; yield []; end;       f {|a,b,*c| [a,b,c].should == [nil,nil,[]] }
+    def f; yield [1]; end;      f {|a,b,*c| [a,b,c].should == [1,nil,[]] }
+    def f; yield [nil]; end;    f {|a,b,*c| [a,b,c].should == [nil,nil,[]] }
+    def f; yield [[]]; end;     f {|a,b,*c| [a,b,c].should == [[],nil,[]] }
+    def f; yield [*[]]; end;    f {|a,b,*c| [a,b,c].should == [nil,nil,[]] }
+    def f; yield [*[1]]; end;   f {|a,b,*c| [a,b,c].should == [1,nil,[]] }
+    def f; yield [*[1,2]]; end; f {|a,b,*c| [a,b,c].should == [1,2,[]] }
+  end
+
+  it "assigns objects to splatted block variables that include the splat operator inside the block" do
+    def f; yield *1; end;        f {|*a| a.should == [1] }
+    def f; yield *[]; end;       f {|*a| a.should == [] }
+    def f; yield *[1]; end;      f {|*a| a.should == [1] }
+    def f; yield *[nil]; end;    f {|*a| a.should == [nil] }
+    def f; yield *[[]]; end;     f {|*a| a.should == [[]] }
+    def f; yield *[*[]]; end;    f {|*a| a.should == [] }
+    def f; yield *[*[1]]; end;   f {|*a| a.should == [1] }
+    def f; yield *[*[1,2]]; end; f {|*a| a.should == [1,2] }
+  end
+
+  it "assigns splatted objects to multiple block variables" do
+    def f; yield *nil; end;      f {|a,b,*c| [a,b,c].should == [nil,nil,[]] }
+    def f; yield *1; end;        f {|a,b,*c| [a,b,c].should == [1,nil,[]] }
+    def f; yield *[]; end;       f {|a,b,*c| [a,b,c].should == [nil,nil,[]] }
+    def f; yield *[1]; end;      f {|a,b,*c| [a,b,c].should == [1,nil,[]] }
+    def f; yield *[nil]; end;    f {|a,b,*c| [a,b,c].should == [nil,nil,[]] }
+    def f; yield *[*[]]; end;    f {|a,b,*c| [a,b,c].should == [nil,nil,[]] }
+    def f; yield *[*[1]]; end;   f {|a,b,*c| [a,b,c].should == [1,nil,[]] }
+    def f; yield *[*[1,2]]; end; f {|a,b,*c| [a,b,c].should == [1,2,[]] }
+  end
+
+  ruby_version_is "" ... "1.9" do
+    it "assigns objects to splatted block variables that include the splat operator inside the block" do
+      def f; yield *nil; end;      f {|*a| a.should == [nil] }
+    end
+
+    it "assigns splatted objects to multiple block variables" do
+      def f; yield *[[]]; end;     f {|a,b,*c| [a,b,c].should == [[],nil,[]] }
+    end
+  end
+end
+
+describe "The yield keyword" do
+  it "raises a LocalJumpError when invoked in a method not passed a block" do
+    lambda { YieldSpecs::no_block }.should raise_error(LocalJumpError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/abbrev/abbrev_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/abbrev/abbrev_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/abbrev/abbrev_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'abbrev'
+
+#test both Abbrev::abbrev and Array#abbrev in
+#the same manner, as they're more or less aliases
+#of one another
+
+[["Abbrev::abbrev", lambda {|a| Abbrev::abbrev(a)}],
+ ["Array#abbrev", lambda {|a| a.abbrev}]
+].each do |(name, func)|
+  
+  describe name do
+    it "returns a hash of all unambiguous abbreviations of the array of strings passed in" do
+      func.call(['ruby', 'rules']).should == {"rub" => "ruby",
+                                       "ruby" => "ruby",
+                                       "rul" => "rules",
+                                       "rule" => "rules",
+                                       "rules" => "rules"}
+      
+      func.call(["car", "cone"]).should == {"ca" => "car", 
+                                       "car" => "car", 
+                                       "co" => "cone", 
+                                       "con" => "cone", 
+                                       "cone" => "cone"}                         
+    end
+    
+    it "returns an empty hash when called on an empty array" do
+      func.call([]).should == {}
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/base64/b64encode_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/base64/b64encode_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/base64/b64encode_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+require 'base64'
+
+describe "Base64#b64encode" do
+  it "returns the Base64-encoded version of the given string with a newline at 60 characters" do
+    b64encoded_version = "Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMgdG8gbGVhcm4g\nUnVieQ==\n"
+    lambda {
+      Base64.b64encode("Now is the time for all good coders to learn Ruby").should == b64encoded_version
+    }.should output
+  end
+  
+  it "prints the Base64-encoded version of the given string with a newline after 60 characters" do
+    b64encoded_version ="Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMgdG8gbGVhcm4g\nUnVieQ==\n"
+    lambda {
+      Base64.b64encode("Now is the time for all good coders to learn Ruby")
+    }.should output(b64encoded_version)
+  end
+end
+
+describe "Base64#b64encode with length" do
+  it "returns the Base64-encoded version of the given string with a newline at 60 characters" do
+    b64encoded_version = "Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMgdG8gbGVhcm4g\nUnVieQ==\n"
+    lambda {
+      Base64.b64encode("Now is the time for all good coders to learn Ruby", 2).should == b64encoded_version
+    }.should output
+  end
+
+  it "prints the Base64-encoded version of the given stringwith a newline after length characters" do
+    lambda {
+      Base64.b64encode("hello", 2).should == "aGVsbG8=\n" 
+    }.should output("aG\nVs\nbG\n8=\n")
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/base64/decode64_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/base64/decode64_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/base64/decode64_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+require 'base64'
+
+describe "Base64#decode64" do
+  it "returns the Base64-decoded version of the given string" do
+    Base64.decode64("U2VuZCByZWluZm9yY2VtZW50cw==\n").should == "Send reinforcements"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/base64/decode_b_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/base64/decode_b_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/base64/decode_b_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+require 'base64'
+
+describe "Base64#decode_b" do
+  it "supports an encoding type of base64 and the charachter set SHIFT_JIS" do
+    Base64.decode_b("=?SHIFT_JIS?B?Zm9v?=").should == 'foo'
+  end
+  
+  it "supports an encoding type of base64 and the character set ISO-2022-JP" do
+    Base64.decode_b("=?ISO-2022-JP?B?Zm9v?=").should == 'foo'
+  end
+  
+  # mSpec doesn't have pending specs yet
+  # Waiting on Kconv implementation
+  # it "decodes MIME encoded string and convert halfwidth katakana to fullwidth katakana."
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/base64/encode64_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/base64/encode64_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/base64/encode64_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+require 'base64'
+
+describe "Base64#encode64" do
+  it "returns the Base64-encoded version of the given string" do
+    Base64.encode64("Now is the time for all good coders\nto learn Ruby").should ==
+      "Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMKdG8gbGVhcm4g\nUnVieQ==\n"
+  end
+  
+  it "returns the Base64-encoded version of the given string" do
+    Base64.encode64('Send reinforcements').should == "U2VuZCByZWluZm9yY2VtZW50cw==\n"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/abs_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/abs_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/abs_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,50 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#abs" do
+  before(:each) do
+    @one = BigDecimal("1")
+    @zero = BigDecimal("0")
+    @zero_pos = BigDecimal("+0")
+    @zero_neg = BigDecimal("-0")
+    @two = BigDecimal("2")
+    @three = BigDecimal("3")
+    @mixed = BigDecimal("1.23456789")
+    @nan = BigDecimal("NaN")
+    @infinity = BigDecimal("Infinity")
+    @infinity_minus = BigDecimal("-Infinity")
+    @one_minus = BigDecimal("-1")
+    @frac_1 = BigDecimal("1E-99999")
+    @frac_2 = BigDecimal("0.9E-99999")
+  end
+
+  it "returns the absolute value" do
+    pos_int = BigDecimal("2E5555")
+    neg_int = BigDecimal("-2E5555")
+    pos_frac = BigDecimal("2E-9999")
+    neg_frac = BigDecimal("-2E-9999")
+
+    pos_int.abs.should == pos_int
+    neg_int.abs.should == pos_int
+    pos_frac.abs.should == pos_frac
+    neg_frac.abs.should == pos_frac
+    @one.abs.should == 1
+    @two.abs.should == 2
+    @three.abs.should == 3
+    @mixed.abs.should == @mixed
+    @one_minus.abs.should == @one
+  end
+
+  it "properly handles special values" do
+    @infinity.abs.should == @infinity
+    @infinity_minus.abs.should == @infinity
+    @nan.abs.nan?.should == true # have to do it this way, since == doesn't work on NaN
+    @zero.abs.should == 0
+    @zero.abs.sign.should == BigDecimal::SIGN_POSITIVE_ZERO
+    @zero_pos.abs.should == 0
+    @zero_pos.abs.sign.should == BigDecimal::SIGN_POSITIVE_ZERO
+    @zero_neg.abs.should == 0
+    @zero_neg.abs.sign.should == BigDecimal::SIGN_POSITIVE_ZERO
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/add_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/add_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/add_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,179 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+require 'bigdecimal'
+
+describe "BigDecimal#add" do
+
+  before(:each) do
+    @one = BigDecimal("1")
+    @zero = BigDecimal("0")
+    @two = BigDecimal("2")
+    @three = BigDecimal("3")
+    @ten = BigDecimal("10")
+    @eleven = BigDecimal("11")
+    @nan = BigDecimal("NaN")
+    @infinity = BigDecimal("Infinity")
+    @infinity_minus = BigDecimal("-Infinity")
+    @one_minus = BigDecimal("-1")
+    @frac_1 = BigDecimal("1E-99999")
+    @frac_2 = BigDecimal("0.9E-99999")
+    @frac_3 = BigDecimal("12345E10")
+    @frac_4 = BigDecimal("98765E10")
+    @dot_ones = BigDecimal("0.1111111111")
+  end
+
+  it "returns a + b with given precision" do
+    # documentation states, that precision ist optional, but it ain't,
+    @two.add(@one, 1).should == @three
+    @one .add(@two, 1).should == @three
+    @one.add(@one_minus, 1).should == @zero
+    @ten.add(@one, 2).should == @eleven
+    @zero.add(@one, 1).should == @one
+    @frac_2.add(@frac_1, 10000).should == BigDecimal("1.9E-99999")
+    @frac_1.add(@frac_1, 10000).should == BigDecimal("2E-99999")
+    @frac_3.add(@frac_4, 0).should == BigDecimal("0.11111E16")
+    @frac_3.add(@frac_4, 1).should == BigDecimal("0.1E16")    
+    @frac_3.add(@frac_4, 2).should == BigDecimal("0.11E16")
+    @frac_3.add(@frac_4, 3).should == BigDecimal("0.111E16")
+    @frac_3.add(@frac_4, 4).should == BigDecimal("0.1111E16")
+    @frac_3.add(@frac_4, 5).should == BigDecimal("0.11111E16")
+    @frac_3.add(@frac_4, 6).should == BigDecimal("0.11111E16")
+  end
+
+  it "returns a + [Fixnum value] with given precision" do
+    (1..10).each {|precision|
+      @dot_ones.add(0, precision).should == BigDecimal("0." + "1" * precision)
+    }
+    BigDecimal("0.88").add(0, 1).should == BigDecimal("0.9")
+  end
+
+  it "returns a + [Bignum value] with given precision" do
+    bignum = 10000000000000000000
+    (1..20).each {|precision|
+      @dot_ones.add(bignum, precision).should == BigDecimal("0.1E20")
+    }
+    (21..30).each {|precision|
+      @dot_ones.add(bignum, precision).should == BigDecimal(
+        "0.10000000000000000000" + "1" * (precision - 20) + "E20")
+    }
+  end
+
+#  TODO:
+#  http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/17374
+#
+#  This doesn't work on MRI and looks like a bug to me:
+#  one can use BigDecimal + Float, but not Bigdecimal.add(Float)
+#
+#  it "returns a + [Float value] with given precision" do
+#    (1..10).each {|precision|
+#      @dot_ones.add(0.0, precision).should == BigDecimal("0." + "1" * precision)
+#    }
+#
+#    BigDecimal("0.88").add(0.0, 1).should == BigDecimal("0.9")
+#  end
+
+  it "favors the precision specified in the second argument over the global limit" do
+    BigDecimalSpecs::with_limit(1) do
+      BigDecimal('0.888').add(@zero, 3).should == BigDecimal('0.888')
+    end
+
+    BigDecimalSpecs::with_limit(2) do
+      BigDecimal('0.888').add(@zero, 1).should == BigDecimal('0.9')
+    end
+  end
+
+  it "uses the current rounding mode if rounding is needed" do
+    BigDecimalSpecs::with_rounding(BigDecimal::ROUND_UP) do
+      BigDecimal('0.111').add(@zero, 1).should == BigDecimal('0.2')
+      BigDecimal('-0.111').add(@zero, 1).should == BigDecimal('-0.2')
+    end
+    BigDecimalSpecs::with_rounding(BigDecimal::ROUND_DOWN) do
+      BigDecimal('0.999').add(@zero, 1).should == BigDecimal('0.9')
+      BigDecimal('-0.999').add(@zero, 1).should == BigDecimal('-0.9')
+    end
+    BigDecimalSpecs::with_rounding(BigDecimal::ROUND_HALF_UP) do
+      BigDecimal('0.85').add(@zero, 1).should == BigDecimal('0.9')
+      BigDecimal('-0.85').add(@zero, 1).should == BigDecimal('-0.9')
+    end
+    BigDecimalSpecs::with_rounding(BigDecimal::ROUND_HALF_DOWN) do
+      BigDecimal('0.85').add(@zero, 1).should == BigDecimal('0.8')
+      BigDecimal('-0.85').add(@zero, 1).should == BigDecimal('-0.8')
+    end
+    BigDecimalSpecs::with_rounding(BigDecimal::ROUND_HALF_EVEN) do
+      BigDecimal('0.75').add(@zero, 1).should == BigDecimal('0.8')
+      BigDecimal('0.85').add(@zero, 1).should == BigDecimal('0.8')
+      BigDecimal('-0.75').add(@zero, 1).should == BigDecimal('-0.8')
+      BigDecimal('-0.85').add(@zero, 1).should == BigDecimal('-0.8')
+    end
+    BigDecimalSpecs::with_rounding(BigDecimal::ROUND_CEILING) do
+      BigDecimal('0.85').add(@zero, 1).should == BigDecimal('0.9')
+      BigDecimal('-0.85').add(@zero, 1).should == BigDecimal('-0.8')
+    end
+    BigDecimalSpecs::with_rounding(BigDecimal::ROUND_FLOOR) do
+      BigDecimal('0.85').add(@zero, 1).should == BigDecimal('0.8')
+      BigDecimal('-0.85').add(@zero, 1).should == BigDecimal('-0.9')
+    end
+  end
+
+  it "uses the default ROUND_HALF_UP rounding if it wasn't explicitly changed" do
+    BigDecimal('0.85').add(@zero, 1).should == BigDecimal('0.9')
+    BigDecimal('-0.85').add(@zero, 1).should == BigDecimal('-0.9')
+  end
+
+  it "returns NaN if NaN is involved" do
+    @one.add(@nan, 10000).nan?.should == true
+    @nan.add(@one, 1).nan?.should == true
+  end
+
+  it "returns Infinity or -Infinity if these are involved" do
+    @zero.add(@infinity, 1).should == @infinity
+    @frac_2.add(@infinity, 1).should == @infinity
+    @one_minus.add(@infinity, 1).should == @infinity
+    @two.add(@infinity, 1).should == @infinity
+
+    @zero.add(@infinity_minus, 1).should == @infinity_minus
+    @frac_2.add(@infinity_minus, 1).should == @infinity_minus
+    @one_minus.add(@infinity_minus, 1).should == @infinity_minus
+    @two.add(@infinity_minus, 1).should == @infinity_minus
+
+    @infinity.add(@zero, 1).should == @infinity
+    @infinity.add(@frac_2, 1).should == @infinity
+    @infinity.add(@one_minus, 1).should == @infinity
+    @infinity.add(@two, 1).should == @infinity
+
+    @infinity_minus.add(@zero, 1).should == @infinity_minus
+    @infinity_minus.add(@frac_2, 1).should == @infinity_minus
+    @infinity_minus.add(@one_minus, 1).should == @infinity_minus
+    @infinity_minus.add(@two, 1).should == @infinity_minus
+
+    @infinity.add(@infinity, 10000).should == @infinity
+    @infinity_minus.add(@infinity_minus, 10000).should == @infinity_minus
+  end
+
+  it "returns NaN if Infinity + (- Infinity)" do
+    @infinity.add(@infinity_minus, 10000).nan?.should == true
+    @infinity_minus.add(@infinity, 10000).nan?.should == true
+  end
+
+  it "raises TypeError when adds nil" do
+    lambda {
+      @one.add(nil, 10)
+    }.should raise_error(TypeError)
+    lambda {
+      @one.add(nil, 0)
+    }.should raise_error(TypeError)
+  end
+
+  it "raises TypeError when precision parameter is nil" do
+    lambda {
+      @one.add(@one, nil)
+    }.should raise_error(TypeError)
+  end
+
+  it "raises ArgumentError when precision parameter is negative" do
+    lambda {
+      @one.add(@one, -10)
+    }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/case_compare_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/case_compare_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/case_compare_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/eql.rb'
+
+
+describe "BigDecimal#===" do
+  it_behaves_like(:bigdecimal_eql, :===)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/ceil_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/ceil_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/ceil_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,98 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#ceil" do
+  before(:each) do
+    @zero = BigDecimal("0")
+    @one = BigDecimal("1")
+    @three = BigDecimal("3")
+    @four = BigDecimal("4")
+    @mixed = BigDecimal("1.23456789")
+    @mixed_big = BigDecimal("1.23456789E100")
+    @pos_int = BigDecimal("2E5555")
+    @neg_int = BigDecimal("-2E5555")
+    @pos_frac = BigDecimal("2E-9999")
+    @neg_frac = BigDecimal("-2E-9999")
+
+    @infinity = BigDecimal("Infinity")
+    @infinity_neg = BigDecimal("-Infinity")
+    @nan = BigDecimal("NaN")
+    @zero_pos = BigDecimal("+0")
+    @zero_neg = BigDecimal("-0")
+  end
+  
+  it "returns a BigDecimal" do
+    @mixed.ceil.kind_of?(BigDecimal).should == true
+    @pos_int.ceil(2).kind_of?(BigDecimal).should == true
+  end
+
+  it "returns the smallest integer greater or equal to self, if n is unspecified" do
+    @pos_int.ceil.should == @pos_int
+    @neg_int.ceil.should == @neg_int
+    @pos_frac.ceil.should == BigDecimal("1")
+    @neg_frac.ceil.should == @zero
+    @infinity.ceil.should == @infinity
+    @infinity_neg.ceil.should == @infinity_neg
+    @nan.ceil.nan?.should == true
+    @zero.ceil.should == 0
+    @zero_pos.ceil.should == @zero_pos
+    @zero_neg.ceil.should == @zero_neg
+    
+
+    BigDecimal('2.3').ceil.should == 3
+    BigDecimal('2.5').ceil.should == 3
+    BigDecimal('2.9999').ceil.should == 3
+    BigDecimal('-2.3').ceil.should == -2
+    BigDecimal('-2.5').ceil.should == -2
+    BigDecimal('-2.9999').ceil.should == -2
+  end
+
+  it "returns n digits right of the decimal point if given n > 0" do
+    @mixed.ceil(1).should == BigDecimal("1.3")
+    @mixed.ceil(5).should == BigDecimal("1.23457")
+
+    BigDecimal("-0.03").ceil(1).should == BigDecimal("0")
+    BigDecimal("0.03").ceil(1).should == BigDecimal("0.1")
+
+    BigDecimal("23.45").ceil(0).should == BigDecimal('24')
+    BigDecimal("23.45").ceil(1).should == BigDecimal('23.5')
+    BigDecimal("23.45").ceil(2).should == BigDecimal('23.45')
+
+    BigDecimal("-23.45").ceil(0).should == BigDecimal('-23')
+    BigDecimal("-23.45").ceil(1).should == BigDecimal('-23.4')
+    BigDecimal("-23.45").ceil(2).should == BigDecimal('-23.45')
+
+    BigDecimal("2E-10").ceil(0).should == @one
+    BigDecimal("2E-10").ceil(9).should == BigDecimal('1E-9')
+    BigDecimal("2E-10").ceil(10).should == BigDecimal('2E-10')
+    BigDecimal("2E-10").ceil(11).should == BigDecimal('2E-10')
+
+    (1..10).each do |n|
+      # 0.4, 0.34, 0.334, etc.
+      (@one.div(@three,20)).ceil(n).should == BigDecimal("0.#{'3'*(n-1)}4")
+      # 1.4, 1.34, 1.334, etc.
+      (@four.div(@three,20)).ceil(n).should == BigDecimal("1.#{'3'*(n-1)}4")
+      (BigDecimal('31').div(@three,20)).ceil(n).should == BigDecimal("10.#{'3'*(n-1)}4")
+    end
+    (1..10).each do |n|
+      # -0.4, -0.34, -0.334, etc.
+      (- at one.div(@three,20)).ceil(n).should == BigDecimal("-0.#{'3'* n}")
+    end
+    (1..10).each do |n|
+      (@three.div(@one,20)).ceil(n).should == @three
+    end
+    (1..10).each do |n|
+      (- at three.div(@one,20)).ceil(n).should == - at three
+    end
+  end
+
+  it "sets n digits left of the decimal point to 0, if given n < 0" do
+    BigDecimal("13345.234").ceil(-2).should == BigDecimal("13400.0")
+    @mixed_big.ceil(-99).should == BigDecimal("0.13E101")
+    @mixed_big.ceil(-100).should == BigDecimal("0.2E101")
+    @mixed_big.ceil(-95).should == BigDecimal("0.123457E101")
+    BigDecimal("1E10").ceil(-30).should == BigDecimal('1E30')
+    BigDecimal("-1E10").ceil(-30).should == @zero
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/coerce_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/coerce_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/coerce_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#coerce" do
+
+  it "returns [other, self] both as BigDecimal" do
+    one = BigDecimal("1.0")
+    five_point_28 = BigDecimal("5.28")
+    zero_minus = BigDecimal("-0.0")
+    some_value = 32434234234234234234
+
+    BigDecimal("1.2").coerce(1).should == [one, BigDecimal("1.2")]
+    five_point_28.coerce(1.0).should == [one, BigDecimal("5.28")]
+    one.coerce(one).should == [one, one]
+    one.coerce(2.5).should == [2.5, one]
+    BigDecimal("1").coerce(3.14).should == [3.14, one]
+    a, b = zero_minus.coerce(some_value)
+    a.should == BigDecimal(some_value.to_s)
+    b.should == zero_minus
+    a, b = one.coerce(some_value)
+    a.should == BigDecimal(some_value.to_s)
+    b.to_f.should be_close(1.0, TOLERANCE) # can we take out the to_f once BigDecimal#- is implemented?
+    b.should == one
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/comparison_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/comparison_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/comparison_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,81 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#<=>" do
+  before(:each) do
+    @zero = BigDecimal("0")
+    @zero_pos = BigDecimal("+0")
+    @zero_neg = BigDecimal("-0")
+    @mixed = BigDecimal("1.23456789")
+    @mixed_big = BigDecimal("1.23456789E100")
+    @pos_int = BigDecimal("2E5555")
+    @neg_int = BigDecimal("-2E5555")
+    @pos_frac = BigDecimal("2E-9999")
+    @neg_frac = BigDecimal("-2E-9999")
+
+    @int_mock = mock('123')
+    class << @int_mock
+      def coerce(other)
+        return [other, BigDecimal('123')]
+      end
+      def >= (other)
+        BigDecimal('123') >= other
+      end
+    end
+
+    @values = [@mixed, @pos_int, @neg_int, @pos_frac, @neg_frac,
+      -2**32, -2**31, -2**30, -2**16, -2**8, -100, -10, -1,
+      @zero , 1, 2, 10, 2**8, 2**16, 2**32, @int_mock, @zero_pos, @zero_neg]
+
+    @infinity = BigDecimal("Infinity")
+    @infinity_neg = BigDecimal("-Infinity")
+    @nan = BigDecimal("NaN")
+  end
+
+
+  it "returns 0 if a == b" do
+    (@pos_int <=> @pos_int).should == 0
+    (@neg_int <=> @neg_int).should == 0
+    (@pos_frac <=> @pos_frac).should == 0
+    (@neg_frac <=> @neg_frac).should == 0
+    (@zero <=> @zero).should == 0
+    (@infinity <=> @infinity).should == 0
+    (@infinity_neg <=> @infinity_neg).should == 0
+  end
+
+  it "returns 1 if a > b" do
+    (@pos_int <=> @neg_int).should == 1
+    (@pos_frac <=> @neg_frac).should == 1
+    (@pos_frac <=> @zero).should == 1
+    @values.each { |val|
+      (@infinity <=> val).should == 1
+    }
+  end
+
+  it "returns -1 if a < b" do
+    (@zero <=> @pos_frac).should == -1
+    (@neg_int <=> @pos_frac).should == -1
+    (@pos_frac <=> @pos_int).should == -1
+    @values.each { |val|
+      (@infinity_neg <=> val).should == -1
+    }
+  end
+
+  it "returns nil if NaN is involved" do
+    @values += [@infinity, @infinity_neg, @nan]
+    @values << nil
+    @values << Object.new
+    @values.each { |val|
+      (@nan <=> val).should == nil
+    }
+  end
+  
+  it "returns nil if the argument is nil" do
+    (@zero <=> nil).should == nil
+    (@infinity <=> nil).should == nil
+    (@infinity_neg <=> nil).should == nil
+    (@mixed <=> nil).should == nil
+    (@pos_int <=> nil).should == nil
+    (@neg_frac <=> nil).should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/div_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/div_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/div_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,100 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/quo'
+require 'bigdecimal'
+
+describe "BigDecimal#div with precision set to 0" do
+  # TODO: figure out if there is a better way to do these
+  # shared specs rather than sending [0]. See other specs
+  # that share :bigdecimal_quo.
+  it_behaves_like :bigdecimal_quo, :div, [0]
+end
+
+describe "BigDecimal#div" do
+
+  before(:each) do
+    @one = BigDecimal("1")
+    @zero = BigDecimal("0")
+    @zero_plus = BigDecimal("+0")
+    @zero_minus = BigDecimal("-0")
+    @two = BigDecimal("2")
+    @three = BigDecimal("3")
+    @nan = BigDecimal("NaN")
+    @infinity = BigDecimal("Infinity")
+    @infinity_minus = BigDecimal("-Infinity")
+    @one_minus = BigDecimal("-1")
+    @frac_1 = BigDecimal("1E-99999")
+    @frac_2 = BigDecimal("0.9E-99999")
+  end
+
+  it "returns a / b with optional precision" do
+    @two.div(@one).should == @two
+    @one.div(@two).should == @zero
+    # ^^ is this really intended for a class with arbitrary precision?
+    @one.div(@two, 1).should == BigDecimal("0.5")
+    @one.div(@one_minus).should == @one_minus
+    @one_minus.div(@one_minus).should == @one
+    @frac_2.div(@frac_1, 1).should == BigDecimal("0.9")
+    @frac_1.div(@frac_1).should == @one
+
+    res = "0." + "3" * 1000
+    (1..100).each { |idx|
+      @one.div(@three, idx).to_s("F").should == "0." + res[2, idx]
+    }
+  end
+
+  it "returns NaN if NaN is involved" do
+    @one.div(@nan).nan?.should == true
+    @nan.div(@one).nan?.should == true
+  end
+
+  it "returns NaN if divided by Infinity and no precision given" do
+    @zero.div(@infinity).nan?.should == true
+    @frac_2.div(@infinity).nan?.should == true
+  end
+
+  it "returns 0 if divided by Infinity with given precision" do
+    @zero.div(@infinity, 0).should == 0
+    @frac_2.div(@infinity, 1).should == 0
+    @zero.div(@infinity, 100000).should == 0
+    @frac_2.div(@infinity, 100000).should == 0
+  end
+  
+  it "returns NaN if divided by zero and no precision given" do
+    @one.div(@zero).nan?.should == true
+    @one.div(@zero_plus).nan?.should == true
+    @one.div(@zero_minus).nan?.should == true
+  end
+
+  it "returns NaN if zero is divided by zero" do
+    @zero.div(@zero).nan?.should == true
+    @zero_minus.div(@zero_plus).nan?.should == true
+    @zero_plus.div(@zero_minus).nan?.should == true
+
+    @zero.div(@zero, 0).nan?.should == true
+    @zero_minus.div(@zero_plus, 0).nan?.should == true
+    @zero_plus.div(@zero_minus, 0).nan?.should == true
+
+    @zero.div(@zero, 10).nan?.should == true
+    @zero_minus.div(@zero_plus, 10).nan?.should == true
+    @zero_plus.div(@zero_minus, 10).nan?.should == true
+  end
+
+  it "returns NaN if (+|-) Infinity divided by 1 and no precision given" do
+    @infinity_minus.div(@one).nan?.should == true
+    @infinity.div(@one).nan?.should == true
+    @infinity_minus.div(@one_minus).nan?.should == true
+  end
+
+  it "returns (+|-)Infinity if (+|-)Infinity by 1 and precision given" do
+    @infinity_minus.div(@one, 0).should == @infinity_minus
+    @infinity.div(@one, 0).should == @infinity
+    @infinity_minus.div(@one_minus, 0).should == @infinity
+  end
+
+  it "returns NaN if Infinity / ((+|-) Infinity)" do
+    @infinity.div(@infinity_minus, 100000).nan?.should == true
+    @infinity_minus.div(@infinity, 1).nan?.should == true
+  end
+
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/divide_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/divide_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/divide_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/quo'
+require 'bigdecimal'
+
+describe "BigDecimal#/" do
+  it_behaves_like :bigdecimal_quo, :/, []
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/divmod_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/divmod_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/divmod_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,174 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/modulo'
+require 'bigdecimal'
+
+module DivmodSpecs
+  def self.check_both_nan(array)
+    array.length.should == 2
+    array[0].nan?.should == true
+    array[1].nan?.should == true
+  end
+  def self.check_both_bigdecimal(array)
+    array.length.should == 2
+    array[0].kind_of?(BigDecimal).should == true
+    array[1].kind_of?(BigDecimal).should == true
+  end
+end
+
+# TODO: figure out a way to do the shared specs with helpers instead
+# of spec'ing a method that does not really exist
+describe "BigDecimal#mod_part_of_divmod" do
+  # BigDecimal#divmod[1] behaves exactly like #modulo
+  before :all do
+    class BigDecimal
+      def mod_part_of_divmod(arg)
+        divmod(arg)[1]
+      end
+    end
+  end
+
+  after :all do
+    class BigDecimal
+      undef mod_part_of_divmod
+    end
+  end
+
+  it_behaves_like :bigdecimal_modulo, :mod_part_of_divmod
+
+  it "does NOT raise ZeroDivisionError if other is zero" do
+    bd6543 = BigDecimal.new("6543.21")
+    bd5667 = BigDecimal.new("5667.19")
+    a = BigDecimal("1.0000000000000000000000000000000000000000005")
+    b = BigDecimal("1.00000000000000000000000000000000000000000005")
+
+    bd5667.send(@method, 0).nan?.should == true
+    bd5667.send(@method, BigDecimal("0")).nan?.should == true
+    @zero.send(@method, @zero).nan?.should == true
+  end
+end
+
+describe "BigDecimal#divmod" do
+
+  before(:each) do
+    @a = BigDecimal("42.00000000000000000001")
+
+    @zero = BigDecimal("0")
+    @zero_pos = BigDecimal("+0")
+    @zero_neg = BigDecimal("-0")
+
+    @one = BigDecimal("1")
+    @mixed = BigDecimal("1.23456789")
+    @pos_int = BigDecimal("2E5555")
+    @neg_int = BigDecimal("-2E5555")
+    @pos_frac = BigDecimal("2E-9999")
+    @neg_frac = BigDecimal("-2E-9999")
+    @nan = BigDecimal("NaN")
+    @infinity = BigDecimal("Infinity")
+    @infinity_minus = BigDecimal("-Infinity")
+    @one_minus = BigDecimal("-1")
+    @frac_1 = BigDecimal("1E-99999")
+    @frac_2 = BigDecimal("0.9E-99999")
+
+    @special_vals = [@infinity, @infinity_minus, @nan]
+    @regular_vals = [
+      @one, @mixed, @pos_int, @neg_int, @pos_frac,
+      @neg_frac, @one_minus, @frac_1, @frac_2]
+    @zeroes = [@zero, @zero_pos, @zero_neg]
+  end
+
+  it "divides value, returns an array" do
+    res = @a.divmod(5)
+    res.kind_of?(Array).should == true
+  end
+
+  it "array contains quotient and modulus as BigDecimal" do
+    res = @a.divmod(5)
+    DivmodSpecs::check_both_bigdecimal(res)
+    res[0].should == BigDecimal('0.8E1')
+    res[1].should == BigDecimal('2.00000000000000000001')
+
+    BigDecimal('1').divmod(BigDecimal('2')).should == [0, 1]
+    BigDecimal('2').divmod(BigDecimal('1')).should == [2, 0]
+
+    BigDecimal('1').divmod(BigDecimal('-2')).should == [-1, -1]
+    BigDecimal('2').divmod(BigDecimal('-1')).should == [-2, 0]
+
+    BigDecimal('-1').divmod(BigDecimal('2')).should == [-1, 1]
+    BigDecimal('-2').divmod(BigDecimal('1')).should == [-2, 0]
+  end
+
+  it "Can be reversed with * and +" do
+    # Example taken from BigDecimal documentation
+    a = BigDecimal.new("42")
+    b = BigDecimal.new("9")
+    q, m = a.divmod(b)
+    c = q * b + m
+    a.should == c
+
+    values = [@one, @one_minus, BigDecimal('2'), BigDecimal('-2'),
+      BigDecimal('5'), BigDecimal('-5'), BigDecimal('10'), BigDecimal('-10'),
+      BigDecimal('20'), BigDecimal('-20'), BigDecimal('100'), BigDecimal('-100'),
+      BigDecimal('1.23456789E10'), BigDecimal('-1.23456789E10')
+    ]
+
+    # TODO: file MRI bug:
+    # BigDecimal('1').divmod(BigDecimal('3E-9'))[0] #=> 0.3E9,
+    # but really should be 0.333333333E9
+    ruby_bug "#206", "1.8" do #MRI's precision is very low in some cases
+      values << BigDecimal('1E-10')
+      values << BigDecimal('-1E-10')
+      values << BigDecimal('2E55')
+      values << BigDecimal('-2E55')
+      values << BigDecimal('2E-5555')
+      values << BigDecimal('-2E-5555')
+
+
+      values_and_zeroes = values + @zeroes
+      values_and_zeroes.each do |val1|
+        values.each do |val2|
+          res = val1.divmod(val2)
+          DivmodSpecs::check_both_bigdecimal(res)
+          res[0].should == ((val1/val2).floor)
+          res[1].should == (val1 - res[0] * val2)
+        end
+      end
+    end
+  end
+
+  it "properly handles special values" do
+    values = @special_vals + @zeroes
+    values.each do |val1|
+      values.each do |val2|
+        DivmodSpecs::check_both_nan(val1.divmod(val2))
+      end
+    end
+
+    @special_vals.each do |val1|
+      @regular_vals.each do |val2|
+        DivmodSpecs::check_both_nan(val1.divmod(val2))
+      end
+    end
+
+    @regular_vals.each do |val1|
+      @special_vals.each do |val2|
+        DivmodSpecs::check_both_nan(val1.divmod(val2))
+      end
+    end
+  end
+
+  it "returns an array of two NaNs if the argument is zero" do
+    values = @regular_vals + @special_vals
+    values.each do |val1|
+      @zeroes.each do |val2|
+        DivmodSpecs::check_both_nan(val1.divmod(val2))
+      end
+    end
+  end
+
+  it "raises TypeError if the argument cannot be coerced to BigDecimal" do
+    lambda {
+      @one.divmod('1')
+    }.should raise_error(TypeError)
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/double_fig_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/double_fig_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/double_fig_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal.double_fig" do
+  # The result depends on the CPU and OS
+  it "returns the number of digits a Float number is allowed to have" do
+    BigDecimal.double_fig.should_not == nil
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/eql_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/eql_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/eql_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/eql.rb'
+
+describe "BigDecimal#eql?" do
+  it_behaves_like(:bigdecimal_eql, :eql?)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/equal_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/equal_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/equal_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/eql.rb'
+
+
+describe "BigDecimal#==" do
+  it_behaves_like(:bigdecimal_eql, :==)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/exponent_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/exponent_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/exponent_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,38 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/power'
+require 'bigdecimal'
+
+describe "BigDecimal#**" do
+  it_behaves_like(:bigdecimal_power, :**)
+end
+
+describe "BigDecimal#exponent" do
+
+  it "returns an Integer" do
+    BigDecimal("2E100000000").exponent.kind_of?(Integer).should == true
+    BigDecimal("2E-999").exponent.kind_of?(Integer).should == true
+  end
+
+  it "is n if number can be represented as 0.xxx*10**n" do
+    BigDecimal("2E1000").exponent.should == 1001
+    BigDecimal("1234567E10").exponent.should == 17
+  end
+
+# commenting this spec out after discussion with Defiler, since it seems to be an MRI bug, not a real feature
+=begin
+  platform_is :wordsize => 32 do
+    # TODO: write specs for both 32 and 64 bit
+    it "returns 0 if exponent can't be represented as Fixnum" do
+      BigDecimal("2E1000000000000000").exponent.should == 0
+      BigDecimal("-5E-999999999999999").exponent.should == 0
+    end
+  end
+=end
+
+  it "returns 0 if self is 0" do
+    BigDecimal("0").exponent.should == 0
+    BigDecimal("+0").exponent.should == 0
+    BigDecimal("-0").exponent.should == 0
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/finite_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/finite_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/finite_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#finite?" do
+  before(:each) do
+    @one = BigDecimal("1")
+    @zero = BigDecimal("0")
+    @zero_pos = BigDecimal("+0")
+    @zero_neg = BigDecimal("-0")
+    @two = BigDecimal("2")
+    @three = BigDecimal("3")
+    @nan = BigDecimal("NaN")
+    @infinity = BigDecimal("Infinity")
+    @infinity_minus = BigDecimal("-Infinity")
+    @one_minus = BigDecimal("-1")
+    @frac_1 = BigDecimal("1E-99999")
+    @frac_2 = BigDecimal("0.9E-99999")
+    @big = BigDecimal("2E40001")
+    @finite_vals = [@one, @zero, @zero_pos, @zero_neg, @two,
+      @three, @frac_1, @frac_2, @big, @one_minus]
+  end
+
+  it "is false if Infinity or NaN" do
+    @infinity.finite?.should == false
+    @infinity_minus.finite?.should == false
+    @nan.finite?.should == false
+  end
+
+  it "returns true for finite values" do
+    @finite_vals.each do |val|
+      val.finite?.should == true
+    end
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/fix_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/fix_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/fix_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,57 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#fix" do
+    before(:each) do
+      @zero = BigDecimal("0")
+      @mixed = BigDecimal("1.23456789")
+      @pos_int = BigDecimal("2E5555")
+      @neg_int = BigDecimal("-2E5555")
+      @pos_frac = BigDecimal("2E-9999")
+      @neg_frac = BigDecimal("-2E-9999")
+
+      @infinity = BigDecimal("Infinity")
+      @infinity_neg = BigDecimal("-Infinity")
+      @nan = BigDecimal("NaN")
+      @zero_pos = BigDecimal("+0")
+      @zero_neg = BigDecimal("-0")
+    end
+
+  it "returns a BigDecimal" do
+    BigDecimal("2E100000000").fix.kind_of?(BigDecimal).should == true
+    BigDecimal("2E-999").kind_of?(BigDecimal).should == true
+  end
+
+  it "returns the integer part of the absolute value" do
+    a = BigDecimal("2E1000")
+    a.fix.should == a
+    b = BigDecimal("-2E1000")
+    b.fix.should == b
+    BigDecimal("0.123456789E5").fix.should == BigDecimal("0.12345E5")
+    BigDecimal("-0.123456789E5").fix.should == BigDecimal("-0.12345E5")
+  end
+
+  it "correctly handles special values" do
+    @infinity.fix.should == @infinity
+    @infinity_neg.fix.should == @infinity_neg
+    @nan.fix.nan?.should == true
+  end
+
+  it "returns 0 if the absolute value is < 1" do
+    BigDecimal("0.99999").fix.should == 0
+    BigDecimal("-0.99999").fix.should == 0
+    BigDecimal("0.000000001").fix.should == 0
+    BigDecimal("-0.00000001").fix.should == 0
+    BigDecimal("-1000000").fix.should_not == 0
+    @zero.fix.should == 0
+    @zero_pos.fix.should == @zero_pos
+    @zero_neg.fix.should == @zero_neg
+  end
+  
+  it "does not allow any arguments" do
+    lambda {
+      @mixed.fix(10)
+    }.should raise_error(ArgumentError)
+  end
+
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+module BigDecimalSpecs
+  # helper method to sure that the global limit is reset back
+  def self.with_limit(l)
+    old = BigDecimal.limit(l)
+    yield
+  ensure
+    BigDecimal.limit(old)
+  end
+
+  def self.with_rounding(r)
+    old = BigDecimal.mode(BigDecimal::ROUND_MODE)
+    BigDecimal.mode(BigDecimal::ROUND_MODE, r)
+    yield
+  ensure
+    BigDecimal.mode(BigDecimal::ROUND_MODE, old)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/floor_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/floor_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/floor_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,97 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#floor" do
+  before(:each) do
+    @one = BigDecimal("1")
+    @three = BigDecimal("3")
+    @four = BigDecimal("4")
+    @zero = BigDecimal("0")
+    @mixed = BigDecimal("1.23456789")
+    @mixed_big = BigDecimal("1.23456789E100")
+    @pos_int = BigDecimal("2E5555")
+    @neg_int = BigDecimal("-2E5555")
+    @pos_frac = BigDecimal("2E-9999")
+    @neg_frac = BigDecimal("-2E-9999")
+
+    @infinity = BigDecimal("Infinity")
+    @infinity_neg = BigDecimal("-Infinity")
+    @nan = BigDecimal("NaN")
+    @zero_pos = BigDecimal("+0")
+    @zero_neg = BigDecimal("-0")
+  end
+
+  it "returns the greatest integer smaller or equal to self" do
+    @pos_int.floor.should == @pos_int
+    @neg_int.floor.should == @neg_int
+    @pos_frac.floor.should == @zero
+    @neg_frac.floor.should == BigDecimal("-1")
+    @infinity.floor.should == @infinity
+    @infinity_neg.floor.should == @infinity_neg
+    @nan.floor.nan?.should == true
+    @zero.floor.should == 0
+    @zero_pos.floor.should == @zero_pos
+    @zero_neg.floor.should == @zero_neg
+
+    BigDecimal('2.3').floor.should == 2
+    BigDecimal('2.5').floor.should == 2
+    BigDecimal('2.9999').floor.should == 2
+    BigDecimal('-2.3').floor.should == -3
+    BigDecimal('-2.5').floor.should == -3
+    BigDecimal('-2.9999').floor.should == -3
+    BigDecimal('0.8').floor.should == 0
+    BigDecimal('-0.8').floor.should == -1
+  end
+
+  it "returns n digits right of the decimal point if given n > 0" do
+    @mixed.floor(1).should == BigDecimal("1.2")
+    @mixed.floor(5).should == BigDecimal("1.23456")
+
+    BigDecimal("-0.03").floor(1).should == BigDecimal("-0.1")
+    BigDecimal("0.03").floor(1).should == BigDecimal("0")
+
+    BigDecimal("23.45").floor(0).should == BigDecimal('23')
+    BigDecimal("23.45").floor(1).should == BigDecimal('23.4')
+    BigDecimal("23.45").floor(2).should == BigDecimal('23.45')
+
+    BigDecimal("-23.45").floor(0).should == BigDecimal('-24')
+    BigDecimal("-23.45").floor(1).should == BigDecimal('-23.5')
+    BigDecimal("-23.45").floor(2).should == BigDecimal('-23.45')
+
+    BigDecimal("2E-10").floor(0).should == @zero
+    BigDecimal("2E-10").floor(9).should == @zero
+    BigDecimal("2E-10").floor(10).should == BigDecimal('2E-10')
+    BigDecimal("2E-10").floor(11).should == BigDecimal('2E-10')
+
+    (1..10).each do |n|
+      # 0.3, 0.33, 0.333, etc.
+      (@one.div(@three,20)).floor(n).should == BigDecimal("0.#{'3'*n}")
+      # 1.3, 1.33, 1.333, etc.
+      (@four.div(@three,20)).floor(n).should == BigDecimal("1.#{'3'*n}")
+      (BigDecimal('31').div(@three,20)).floor(n).should == BigDecimal("10.#{'3'*n}")
+    end
+    (1..10).each do |n|
+      # -0.4, -0.34, -0.334, etc.
+      (- at one.div(@three,20)).floor(n).should == BigDecimal("-0.#{'3'*(n-1)}4")
+    end
+    (1..10).each do |n|
+      (@three.div(@one,20)).floor(n).should == @three
+    end
+    (1..10).each do |n|
+      (- at three.div(@one,20)).floor(n).should == - at three
+    end
+  end
+
+  it "sets n digits left of the decimal point to 0, if given n < 0" do
+    BigDecimal("13345.234").floor(-2).should == BigDecimal("13300.0")
+    @mixed_big.floor(-99).should == BigDecimal("0.12E101")
+    @mixed_big.floor(-100).should == BigDecimal("0.1E101")
+    @mixed_big.floor(-95).should == BigDecimal("0.123456E101")
+    (1..10).each do |n|
+      BigDecimal('1.8').floor(-n).should == @zero
+    end
+    BigDecimal("1E10").floor(-30).should == @zero
+    BigDecimal("-1E10").floor(-30).should == BigDecimal('-1E30')
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/frac_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/frac_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/frac_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,48 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#frac" do
+  before(:each) do
+    @zero = BigDecimal("0")
+    @mixed = BigDecimal("1.23456789")
+    @pos_int = BigDecimal("2E5555")
+    @neg_int = BigDecimal("-2E5555")
+    @pos_frac = BigDecimal("2E-9999")
+    @neg_frac = BigDecimal("-2E-9999")
+
+    @infinity = BigDecimal("Infinity")
+    @infinity_neg = BigDecimal("-Infinity")
+    @nan = BigDecimal("NaN")
+    @zero_pos = BigDecimal("+0")
+    @zero_neg = BigDecimal("-0")
+  end
+
+  it "returns a BigDecimal" do
+    @pos_int.frac.kind_of?(BigDecimal).should == true
+    @neg_int.frac.kind_of?(BigDecimal).should == true
+    @pos_frac.kind_of?(BigDecimal).should == true
+    @neg_frac.kind_of?(BigDecimal).should == true
+  end
+
+  it "returns the fractional part of the absolute value" do
+    @mixed.frac.should == BigDecimal("0.23456789")
+    @pos_frac.frac.should == @pos_frac
+    @neg_frac.frac.should == @neg_frac
+  end
+
+  it "returns 0 if the value is 0" do
+    @zero.frac.should == @zero
+  end
+
+  it "returns 0 if the value is an integer" do
+    @pos_int.frac.should == @zero
+    @neg_int.frac.should == @zero
+  end
+
+  it "correctly handles special values" do
+    @infinity.frac.should == @infinity
+    @infinity_neg.frac.should == @infinity_neg
+    @nan.frac.nan?.should == true
+  end
+
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/gt_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/gt_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/gt_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,91 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#>" do
+  before(:each) do
+    @zero = BigDecimal("0")
+    @zero_pos = BigDecimal("+0")
+    @zero_neg = BigDecimal("-0")
+    @mixed = BigDecimal("1.23456789")
+    @pos_int = BigDecimal("2E5555")
+    @neg_int = BigDecimal("-2E5555")
+    @pos_frac = BigDecimal("2E-9999")
+    @neg_frac = BigDecimal("-2E-9999")
+
+    @int_mock = mock('123')
+    class << @int_mock
+      def coerce(other)
+        return [other, BigDecimal('123')]
+      end
+      def > (other)
+        BigDecimal('123') > other
+      end
+    end
+
+    @values = [@mixed, @pos_int, @neg_int, @pos_frac, @neg_frac,
+      -2**32, -2**31, -2**30, -2**16, -2**8, -100, -10, -1,
+      @zero , 1, 2, 10, 2**8, 2**16, 2**32, @int_mock, @zero_pos, @zero_neg]
+
+    @infinity = BigDecimal("Infinity")
+    @infinity_neg = BigDecimal("-Infinity")
+    @nan = BigDecimal("NaN")
+  end
+
+  it "returns true if a > b" do
+    one = BigDecimal("1")
+    two = BigDecimal("2")
+
+    frac_1 = BigDecimal("1E-99999")
+    frac_2 = BigDecimal("0.9E-99999")
+    (@zero > one).should == false
+    (two > @zero).should == true
+    (frac_2 > frac_1).should == false
+
+    (@neg_int > @pos_int).should == false
+    (@pos_int > @neg_int).should == true
+    (@neg_int > @pos_frac).should == false
+    (@pos_frac > @neg_int).should == true
+    (@zero > @zero_pos).should == false
+    (@zero > @zero_neg).should == false
+    (@zero_neg > @zero_pos).should == false
+    (@zero_pos > @zero_neg).should == false
+  end
+
+  it "properly handles infinity values" do
+    @values.each { |val|
+      (val > @infinity).should == false
+      (@infinity > val).should == true
+      (val > @infinity_neg).should == true
+      (@infinity_neg > val).should == false
+    }
+    (@infinity > @infinity).should == false
+    (@infinity_neg > @infinity_neg).should == false
+    (@infinity > @infinity_neg).should == true
+    (@infinity_neg > @infinity).should == false
+  end
+
+  it "properly handles NaN values" do
+    @values += [@infinity, @infinity_neg, @nan]
+    @values << nil
+    @values << Object.new
+    @values.each { |val|
+      (@nan > val).should == nil
+    }
+
+    lambda { 10 > @nan }.should raise_error(ArgumentError)
+    (10.5 > @nan).should == false
+
+    (@infinity > @nan).should == nil
+    (@infinity_neg > @nan).should == nil
+    (@zero > @nan).should == nil
+  end
+
+  it "returns nil if the argument is nil" do
+    (@zero > nil).should == nil
+    (@infinity > nil).should == nil
+    (@infinity_neg > nil).should == nil
+    (@mixed > nil).should == nil
+    (@pos_int > nil).should == nil
+    (@neg_frac > nil).should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/gte_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/gte_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/gte_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,95 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#>=" do
+  before(:each) do
+    @zero = BigDecimal("0")
+    @zero_pos = BigDecimal("+0")
+    @zero_neg = BigDecimal("-0")
+    @mixed = BigDecimal("1.23456789")
+    @pos_int = BigDecimal("2E5555")
+    @neg_int = BigDecimal("-2E5555")
+    @pos_frac = BigDecimal("2E-9999")
+    @neg_frac = BigDecimal("-2E-9999")
+
+    @int_mock = mock('123')
+    class << @int_mock
+      def coerce(other)
+        return [other, BigDecimal('123')]
+      end
+      def >= (other)
+        BigDecimal('123') >= other
+      end
+    end
+
+    @values = [@mixed, @pos_int, @neg_int, @pos_frac, @neg_frac,
+      -2**32, -2**31, -2**30, -2**16, -2**8, -100, -10, -1,
+      @zero , 1, 2, 10, 2**8, 2**16, 2**32, @int_mock, @zero_pos, @zero_neg]
+
+    @infinity = BigDecimal("Infinity")
+    @infinity_neg = BigDecimal("-Infinity")
+    @nan = BigDecimal("NaN")
+  end
+
+  it "returns true if a >= b" do
+    one = BigDecimal("1")
+    two = BigDecimal("2")
+
+    frac_1 = BigDecimal("1E-99999")
+    frac_2 = BigDecimal("0.9E-99999")
+
+    (@zero >= one).should == false
+    (two >= @zero).should == true
+
+    (frac_2 >= frac_1).should == false
+    (two >= two).should == true
+    (frac_1 >= frac_1).should == true
+
+    (@neg_int >= @pos_int).should == false
+    (@pos_int >= @neg_int).should == true
+    (@neg_int >= @pos_frac).should == false
+    (@pos_frac >= @neg_int).should == true
+    (@zero >= @zero_pos).should == true
+    (@zero >= @zero_neg).should == true
+    (@zero_neg >= @zero_pos).should == true
+    (@zero_pos >= @zero_neg).should == true
+  end
+
+  it "properly handles infinity values" do
+    @values.each { |val|
+      (val >= @infinity).should == false
+      (@infinity >= val).should == true
+      (val >= @infinity_neg).should == true
+      (@infinity_neg >= val).should == false
+    }
+    (@infinity >= @infinity).should == true
+    (@infinity_neg >= @infinity_neg).should == true
+    (@infinity >= @infinity_neg).should == true
+    (@infinity_neg >= @infinity).should == false
+  end
+
+  it "properly handles NaN values" do
+    @values += [@infinity, @infinity_neg, @nan]
+    @values << nil
+    @values << Object.new
+    @values.each { |val|
+      (@nan >= val).should == nil
+    }
+
+    lambda { 10 >= @nan }.should raise_error(ArgumentError)
+    (10.5 >= @nan).should == false
+
+    (@infinity >= @nan).should == nil
+    (@infinity_neg >= @nan).should == nil
+    (@zero >= @nan).should == nil
+  end
+
+  it "returns nil if the argument is nil" do
+    (@zero >= nil).should == nil
+    (@infinity >= nil).should == nil
+    (@infinity_neg >= nil).should == nil
+    (@mixed >= nil).should == nil
+    (@pos_int >= nil).should == nil
+    (@neg_frac >= nil).should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/induced_from_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/induced_from_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/induced_from_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal.induced_from" do
+  it "returns the passed argument when passed a BigDecimal" do
+    BigDecimal.induced_from(BigDecimal("5")).should == BigDecimal("5")
+    BigDecimal.induced_from(BigDecimal("-5")).should == BigDecimal("-5")
+    BigDecimal.induced_from(BigDecimal("Infinity")).should == BigDecimal("Infinity")
+  end
+
+  it "converts passed Fixnums to BigDecimal" do
+    BigDecimal.induced_from(5).should == BigDecimal("5")
+    BigDecimal.induced_from(-5).should == BigDecimal("-5")
+    BigDecimal.induced_from(0).should == BigDecimal("0")
+  end
+  
+  it "converts passed Bignums to BigDecimal" do
+    BigDecimal.induced_from(bignum_value).should == BigDecimal(bignum_value.to_s)
+    BigDecimal.induced_from(-bignum_value).should == BigDecimal((-bignum_value).to_s)
+  end
+
+  it "does not try to convert non-Integers to Integer using #to_i" do
+    obj = mock("Not converted to Integer")
+    obj.should_not_receive(:to_i)
+    lambda { BigDecimal.induced_from(obj) }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError when passed a non-Integer" do
+    lambda { BigDecimal.induced_from(2.0) }.should raise_error(TypeError)
+    lambda { BigDecimal.induced_from("2") }.should raise_error(TypeError)
+    lambda { BigDecimal.induced_from(:symbol) }.should raise_error(TypeError)
+    lambda { BigDecimal.induced_from(nil) }.should raise_error(TypeError)
+    lambda { BigDecimal.induced_from(Object.new) }.should raise_error(TypeError)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/infinite_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/infinite_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/infinite_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#infinite?" do
+
+  it "returns 1 if self is Infinity" do
+    # documentation says returns true.
+    BigDecimal("Infinity").infinite?.should == 1
+  end
+  
+  it "returns -1 if self is -Infinity" do
+    # This is how MRI behaves.
+    BigDecimal("-Infinity").infinite?.should == -1
+  end
+
+  it "returns not true otherwise" do
+    # If nil or false is not really specified in documentation.
+    e2_plus = BigDecimal("2E40001")
+    e3_minus = BigDecimal("3E-20001")
+    really_small_zero = BigDecimal("0E-200000000")
+    really_big_zero = BigDecimal("0E200000000000")
+    e3_minus.infinite?.should == nil
+    e2_plus.infinite?.should == nil
+    really_small_zero.infinite?.should == nil
+    really_big_zero.infinite?.should == nil
+    BigDecimal("0.000000000000000000000000").infinite?.should == nil
+  end
+
+  it "returns not true if self is NaN" do
+    # NaN is a special value which is neither finite nor infinite.
+    nan = BigDecimal("NaN")
+    nan.infinite?.should == nil
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,41 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#inspect" do
+
+  before(:each) do
+    @bigdec = BigDecimal.new("1234.5678")
+  end
+
+  it "returns String" do
+    @bigdec.inspect.kind_of?(String).should == true
+  end
+
+  it "returns String starting with #" do
+    @bigdec.inspect[0].should == 35
+  end
+
+  it "encloses information in angle brackets" do
+    @bigdec.inspect.should =~ /^.<.*>$/
+  end
+
+  it "is comma separated list of three items" do
+    @bigdec.inspect.should =~ /...*,.*,.*/
+  end
+
+  it "value after first comma is value as string" do
+    @bigdec.inspect.split(",")[1].should == "\'0.12345678E4\'"
+  end
+
+  it "last part is number of significant digits" do
+    signific_string = "#{@bigdec.precs[0]}(#{@bigdec.precs[1]})"
+    @bigdec.inspect.split(",")[2].should == signific_string + ">"
+  end
+
+  it "looks like this" do
+    regex = /^\#\<BigDecimal\:.*,'0\.12345678E4',[0-9]+\([0-9]+\)>$/
+    @bigdec.inspect.should =~ regex
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/limit_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/limit_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/limit_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,30 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require 'bigdecimal'
+
+describe "BigDecimal.limit" do
+  it "returns the value before set if the passed argument is nil or is not specified" do
+    old = BigDecimal.limit
+    BigDecimal.limit.should == 0
+    BigDecimal.limit(10).should == 0
+    BigDecimal.limit.should == 10
+    BigDecimal.limit(old)
+  end
+
+  it "use the global limit if no precision is specified" do
+    BigDecimalSpecs::with_limit(0) do
+      (BigDecimal('0.888') + BigDecimal('0')).should == BigDecimal('0.888')
+      (BigDecimal('0.888') * BigDecimal('3')).should == BigDecimal('2.664')
+    end
+
+    BigDecimalSpecs::with_limit(1) do
+      (BigDecimal('0.888') + BigDecimal('0')).should == BigDecimal('0.9')
+      (BigDecimal('0.888') * BigDecimal('3')).should == BigDecimal('3')
+    end
+
+    BigDecimalSpecs::with_limit(2) do
+      (BigDecimal('0.888') + BigDecimal('0')).should == BigDecimal('0.89')
+      (BigDecimal('0.888') * BigDecimal('3')).should == BigDecimal('2.7')
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/lt_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/lt_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/lt_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,89 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#<" do
+  before(:each) do
+    @zero = BigDecimal("0")
+    @zero_pos = BigDecimal("+0")
+    @zero_neg = BigDecimal("-0")
+    @mixed = BigDecimal("1.23456789")
+    @pos_int = BigDecimal("2E5555")
+    @neg_int = BigDecimal("-2E5555")
+    @pos_frac = BigDecimal("2E-9999")
+    @neg_frac = BigDecimal("-2E-9999")
+
+    @int_mock = mock('123')
+    class << @int_mock
+      def coerce(other)
+        return [other, BigDecimal('123')]
+      end
+      def < (other)
+        BigDecimal('123') < other
+      end
+    end
+
+    @values = [@mixed, @pos_int, @neg_int, @pos_frac, @neg_frac,
+      -2**32, -2**31, -2**30, -2**16, -2**8, -100, -10, -1,
+      @zero , 1, 2, 10, 2**8, 2**16, 2**32, @int_mock, @zero_pos, @zero_neg]
+
+    @infinity = BigDecimal("Infinity")
+    @infinity_neg = BigDecimal("-Infinity")
+    @nan = BigDecimal("NaN")
+  end
+  
+  it "returns true if a < b" do
+    one = BigDecimal("1")
+    two = BigDecimal("2")
+    frac_1 = BigDecimal("1E-99999")
+    frac_2 = BigDecimal("0.9E-99999")
+    (@zero < one).should == true
+    (two < @zero).should == false
+    (frac_2 < frac_1).should == true
+    (@neg_int < @pos_int).should == true
+    (@pos_int < @neg_int).should == false
+    (@neg_int < @pos_frac).should == true
+    (@pos_frac < @neg_int).should == false
+    (@zero < @zero_pos).should == false
+    (@zero < @zero_neg).should == false
+    (@zero_neg < @zero_pos).should == false
+    (@zero_pos < @zero_neg).should == false
+  end
+
+  it "properly handles infinity values" do
+    @values.each { |val|
+      (val < @infinity).should == true
+      (@infinity < val).should == false
+      (val < @infinity_neg).should == false
+      (@infinity_neg < val).should == true
+    }
+    (@infinity < @infinity).should == false
+    (@infinity_neg < @infinity_neg).should == false
+    (@infinity < @infinity_neg).should == false
+    (@infinity_neg < @infinity).should == true
+  end
+
+  it "properly handles NaN values" do
+    @values += [@infinity, @infinity_neg, @nan]
+    @values << nil
+    @values << Object.new
+    @values.each { |val|
+      (@nan < val).should == nil
+    }
+
+    lambda { 10 < @nan }.should raise_error(ArgumentError)
+    (10.5 < @nan).should == false
+
+    (@infinity < @nan).should == nil
+    (@infinity_neg < @nan).should == nil
+    (@zero < @nan).should == nil
+  end
+
+  it "returns nil if the argument is nil" do
+    (@zero < nil).should == nil
+    (@infinity < nil).should == nil
+    (@infinity_neg < nil).should == nil
+    (@mixed < nil).should == nil
+    (@pos_int < nil).should == nil
+    (@neg_frac < nil).should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/lte_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/lte_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/lte_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,95 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#<=" do
+  before(:each) do
+    @zero = BigDecimal("0")
+    @zero_pos = BigDecimal("+0")
+    @zero_neg = BigDecimal("-0")
+    @mixed = BigDecimal("1.23456789")
+    @pos_int = BigDecimal("2E5555")
+    @neg_int = BigDecimal("-2E5555")
+    @pos_frac = BigDecimal("2E-9999")
+    @neg_frac = BigDecimal("-2E-9999")
+
+    @int_mock = mock('123')
+    class << @int_mock
+      def coerce(other)
+        return [other, BigDecimal('123')]
+      end
+      def <= (other)
+        BigDecimal('123') <= other
+      end
+    end
+
+    @values = [@mixed, @pos_int, @neg_int, @pos_frac, @neg_frac,
+      -2**32, -2**31, -2**30, -2**16, -2**8, -100, -10, -1,
+      @zero , 1, 2, 10, 2**8, 2**16, 2**32, @int_mock, @zero_pos, @zero_neg]
+
+    @infinity = BigDecimal("Infinity")
+    @infinity_neg = BigDecimal("-Infinity")
+    @nan = BigDecimal("NaN")
+  end
+
+  it "returns true if a <= b" do
+    one = BigDecimal("1")
+    two = BigDecimal("2")
+
+    frac_1 = BigDecimal("1E-99999")
+    frac_2 = BigDecimal("0.9E-99999")
+
+    (@zero <= one).should == true
+    (two <= @zero).should == false
+
+    (frac_2 <= frac_1).should == true
+    (two <= two).should == true
+    (frac_1 <= frac_1).should == true
+
+    (@neg_int <= @pos_int).should == true
+    (@pos_int <= @neg_int).should == false
+    (@neg_int <= @pos_frac).should == true
+    (@pos_frac <= @neg_int).should == false
+    (@zero <= @zero_pos).should == true
+    (@zero <= @zero_neg).should == true
+    (@zero_neg <= @zero_pos).should == true
+    (@zero_pos <= @zero_neg).should == true
+  end
+
+  it "properly handles infinity values" do
+    @values.each { |val|
+      (val <= @infinity).should == true
+      (@infinity <= val).should == false
+      (val <= @infinity_neg).should == false
+      (@infinity_neg <= val).should == true
+    }
+    (@infinity <= @infinity).should == true
+    (@infinity_neg <= @infinity_neg).should == true
+    (@infinity <= @infinity_neg).should == false
+    (@infinity_neg <= @infinity).should == true
+  end
+
+  it "properly handles NaN values" do
+    @values += [@infinity, @infinity_neg, @nan]
+    @values << nil
+    @values << Object.new
+    @values.each { |val|
+      (@nan <= val).should == nil
+    }
+
+    lambda { 10 <= @nan }.should raise_error(ArgumentError)
+    (10.5 <= @nan).should == false
+
+    (@infinity <= @nan).should == nil
+    (@infinity_neg <= @nan).should == nil
+    (@zero <= @nan).should == nil
+  end
+
+  it "returns nil if the argument is nil" do
+    (@zero <= nil).should == nil
+    (@infinity <= nil).should == nil
+    (@infinity_neg <= nil).should == nil
+    (@mixed <= nil).should == nil
+    (@pos_int <= nil).should == nil
+    (@neg_frac <= nil).should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/minus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/minus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/minus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,58 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#-" do
+
+  before(:each) do
+    @one = BigDecimal("1")
+    @zero = BigDecimal("0")
+    @two = BigDecimal("2")
+    @nan = BigDecimal("NaN")
+    @infinity = BigDecimal("Infinity")
+    @infinity_minus = BigDecimal("-Infinity")
+    @one_minus = BigDecimal("-1")
+    @frac_1 = BigDecimal("1E-99999")
+    @frac_2 = BigDecimal("0.9E-99999")
+  end
+
+  it "returns a - b" do
+    (@two - @one).should == @one
+    (@one - @two).should == @one_minus
+    (@one - @one_minus).should == @two
+    (@frac_2 - @frac_1).should == BigDecimal("-0.1E-99999")
+    (@two - @two).should == @zero
+    (@frac_1 - @frac_1).should == @zero
+    (BigDecimal('1.23456789') - BigDecimal('1.2')).should == BigDecimal("0.03456789")
+  end
+
+  it "returns NaN if NaN is involved" do
+    (@one - @nan).nan?.should == true
+    (@nan - @one).nan?.should == true
+    (@nan - @nan).nan?.should == true
+    (@nan - @infinity).nan?.should == true
+    (@nan - @infinity_minus).nan?.should == true
+    (@infinity - @nan).nan?.should == true
+    (@infinity_minus - @nan).nan?.should == true
+  end
+
+  it "returns NaN both operands are infinite with the same sign" do
+    (@infinity - @infinity).nan?.should == true
+    (@infinity_minus - @infinity_minus).nan?.should == true
+  end
+
+  it "returns Infinity or -Infinity if these are involved" do
+    (@infinity - @infinity_minus).should == @infinity
+    (@infinity_minus - @infinity).should == @infinity_minus
+
+    (@infinity - @zero).should == @infinity
+    (@infinity - @frac_2).should == @infinity
+    (@infinity - @two).should == @infinity
+    (@infinity - @one_minus).should == @infinity
+ 
+    (@zero - @infinity).should == @infinity_minus
+    (@frac_2 - @infinity).should == @infinity_minus
+    (@two - @infinity).should == @infinity_minus
+    (@one_minus - @infinity).should == @infinity_minus
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/mode_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/mode_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/mode_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal.mode" do
+  #the default value of BigDecimal exception constants is false
+  after :all do
+    BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false)
+    BigDecimal.mode(BigDecimal::EXCEPTION_INFINITY, false)
+    BigDecimal.mode(BigDecimal::EXCEPTION_UNDERFLOW, false)
+    BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false)
+    BigDecimal.mode(BigDecimal::EXCEPTION_ZERODIVIDE, false)
+  end
+
+  it "returns the appropriate value and continue the computation if the flag is false" do
+    BigDecimal("NaN").add(BigDecimal("1"),0).nan?.should == true
+    BigDecimal("0").add(BigDecimal("Infinity"),0).should == BigDecimal("Infinity")
+    BigDecimal("1").quo(BigDecimal("0")).should == BigDecimal("Infinity")
+    BigDecimal("1E11111111111111111111").zero?.should == true
+    (BigDecimal("1E11111111111")*BigDecimal("1E11111111111")).zero?.should == true
+  end
+
+  it "raise an exception if the flag is true" do
+    BigDecimal::mode(BigDecimal::EXCEPTION_NaN, true)
+    lambda { BigDecimal("NaN").add(BigDecimal("1"),0) }.should raise_error(FloatDomainError)
+    BigDecimal::mode(BigDecimal::EXCEPTION_INFINITY, true)
+    lambda { BigDecimal("0").add(BigDecimal("Infinity"),0) }.should raise_error(FloatDomainError)
+    BigDecimal::mode(BigDecimal::EXCEPTION_ZERODIVIDE, true)
+    lambda { BigDecimal("1").quo(BigDecimal("0")) }.should raise_error(FloatDomainError)
+    BigDecimal::mode(BigDecimal::EXCEPTION_OVERFLOW, true)
+    lambda { BigDecimal("1E11111111111111111111") }.should raise_error(FloatDomainError)
+    lambda { (BigDecimal("1E11111111111")*BigDecimal("1E11111111111")) }.should raise_error(FloatDomainError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/modulo_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/modulo_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/modulo_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/modulo'
+
+describe "BigDecimal#%" do
+  it_behaves_like(:bigdecimal_modulo, :%)
+  it_behaves_like(:bigdecimal_modulo_zerodivisionerror, :%)
+end
+
+describe "BigDecimal#modulo" do
+  it_behaves_like(:bigdecimal_modulo, :modulo)
+  it_behaves_like(:bigdecimal_modulo_zerodivisionerror, :modulo)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/mult_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/mult_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/mult_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/mult'
+require 'bigdecimal'
+
+describe "BigDecimal#mult" do
+  it_behaves_like :bigdecimal_mult, :mult, [10]
+end
+
+describe "BigDecimal#mult" do
+  before :each do
+    @one = BigDecimal "1"
+    @e3_minus = BigDecimal "3E-20001"
+    @e = BigDecimal "1.00000000000000000000123456789"
+    @tolerance = @e.sub @one, 1000
+    @tolerance2 = BigDecimal "30001E-20005"
+
+  end
+
+  it "multiply self with other with (optional) precision" do
+    @e.mult(@one, 1).should be_close(@one, @tolerance)
+    @e3_minus.mult(@one, 1).should be_close(0, @tolerance2)
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/multiply_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/multiply_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/multiply_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/mult'
+require 'bigdecimal'
+
+describe "BigDecimal#*" do
+  it_behaves_like :bigdecimal_mult, :*, []
+end
+
+describe "BigDecimal#*" do
+  before(:each) do
+    @e3_minus = BigDecimal("3E-20001")
+    @e3_plus = BigDecimal("3E20001")
+    @e = BigDecimal("1.00000000000000000000123456789")
+    @one = BigDecimal("1")
+  end
+
+  it "multiply self with other" do
+    (@one * @one).should == @one
+    (@e3_minus * @e3_plus).should == BigDecimal("9")
+    # Can't do this till we implement **
+    # (@e3_minus * @e3_minus).should == @e3_minus ** 2
+    # So let's rewrite it as:
+    (@e3_minus * @e3_minus).should == BigDecimal("9E-40002")
+    (@e * @one).should == @e
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/nan_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/nan_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/nan_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#nan?" do
+
+  it "returns true if self is not a number" do
+    BigDecimal("NaN").nan?.should == true
+  end
+
+  it "returns false if self is not a NaN" do
+    BigDecimal("Infinity").nan?.should == false
+    BigDecimal("-Infinity").nan?.should == false
+    BigDecimal("0").nan?.should == false
+    BigDecimal("+0").nan?.should == false
+    BigDecimal("-0").nan?.should == false
+    BigDecimal("2E40001").nan?.should == false
+    BigDecimal("3E-20001").nan?.should == false
+    BigDecimal("0E-200000000").nan?.should == false
+    BigDecimal("0E200000000000").nan?.should == false
+    BigDecimal("0.000000000000000000000000").nan?.should == false
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,99 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal.new" do
+
+  it "creates a new object of class BigDecimal" do
+    BigDecimal.new("3.14159").class.should == BigDecimal
+    (0..9).each {|i|
+      BigDecimal.new("1#{i}").should == 10 + i
+      BigDecimal.new("-1#{i}").should == -10 - i
+      BigDecimal.new("1E#{i}").should == 10**i
+      BigDecimal.new("1000000E-#{i}").should == 10**(6-i)
+    }
+    (1..9).each {|i|
+      BigDecimal.new("100.#{i}").to_s.should == "0.100#{i}E3"
+      BigDecimal.new("-100.#{i}").to_s.should == "-0.100#{i}E3"
+    }
+  end
+
+  it "Number of significant digits >= given precision" do
+    pi_string = "3.1415923"
+    BigDecimal.new("3.1415923", 10).precs[1].should >= 10
+  end
+
+  it "determines precision from initial value" do
+    pi_string = "3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593014782083152134043"
+    BigDecimal.new(pi_string).precs[1].should >= pi_string.size-1
+  end
+
+  it "ignores leading whitespace" do
+    BigDecimal.new("  \t\n \r1234").should == BigDecimal.new("1234")
+    BigDecimal.new("  \t\n \rNaN   \n").nan?.should == true
+    BigDecimal.new("  \t\n \rInfinity   \n").infinite?.should == 1
+    BigDecimal.new("  \t\n \r-Infinity   \n").infinite?.should == -1
+    BigDecimal.new("  \t\n \r-\t\t\tInfinity   \n").should == 0.0
+  end
+
+  it "ignores trailing garbage" do
+    BigDecimal.new("123E45ruby").should == BigDecimal.new("123E45")
+    BigDecimal.new("123x45").should == BigDecimal.new("123")
+    BigDecimal.new("123.4%E5").should == BigDecimal.new("123.4")
+    BigDecimal.new("1E2E3E4E5E").should == BigDecimal.new("100")
+  end
+
+  it "treats invalid strings as 0.0" do
+    BigDecimal.new("ruby").should == BigDecimal.new("0.0")
+  end
+
+  it "allows omitting the integer part" do
+    BigDecimal.new(".123").should == BigDecimal.new("0.123")
+    ruby_version_is "1.8.6.5000" do
+    BigDecimal.new("-.123").should == BigDecimal.new("-0.123")
+  end
+  end
+
+  it "allows for underscores in all parts" do
+    reference = BigDecimal.new("12345.67E89")
+
+    BigDecimal.new("12_345.67E89").should == reference
+    BigDecimal.new("1_2_3_4_5_._6____7_E89").should == reference
+    BigDecimal.new("12345_.67E_8__9_").should == reference
+  end
+
+  it "accepts NaN and [+-]Infinity" do
+    BigDecimal.new("NaN").nan?.should == true
+
+    pos_inf = BigDecimal.new("Infinity")
+    pos_inf.finite?.should == false
+    pos_inf.should > 0
+    pos_inf.should == BigDecimal.new("+Infinity")
+
+    neg_inf = BigDecimal.new("-Infinity")
+    neg_inf.finite?.should == false
+    neg_inf.should < 0
+  end
+
+  it "allows for [eEdD] as exponent separator" do
+    reference = BigDecimal.new("12345.67E89")
+
+    BigDecimal.new("12345.67e89").should == reference
+    BigDecimal.new("12345.67E89").should == reference
+    BigDecimal.new("12345.67d89").should == reference
+    BigDecimal.new("12345.67D89").should == reference
+  end
+
+  it "allows for varying signs" do
+    reference = BigDecimal.new("123.456E1")
+
+    BigDecimal.new("+123.456E1").should == reference
+    BigDecimal.new("-123.456E1").should == -reference
+    BigDecimal.new("123.456E+1").should == reference
+    BigDecimal.new("12345.6E-1").should == reference
+    BigDecimal.new("+123.456E+1").should == reference
+    BigDecimal.new("+12345.6E-1").should == reference
+    BigDecimal.new("-123.456E+1").should == -reference
+    BigDecimal.new("-12345.6E-1").should == -reference
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/nonzero_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/nonzero_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/nonzero_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#nonzero?" do
+
+  it "returns self if self doesn't equal zero" do
+    # documentation says, it returns true. (04/10/08)
+    e2_plus = BigDecimal("2E40001")
+    e3_minus = BigDecimal("3E-20001")
+    infinity = BigDecimal("Infinity")
+    infinity_minus = BigDecimal("-Infinity")
+    nan = BigDecimal("NaN")
+    infinity.nonzero?.should equal(infinity)
+    infinity_minus.nonzero?.should equal(infinity_minus)
+    nan.nonzero?.should equal(nan)
+    e3_minus.nonzero?.should equal(e3_minus)
+    e2_plus.nonzero?.should equal(e2_plus)
+  end
+
+  it "returns nil otherwise" do
+    # documentation states, it should return false. (04/10/08)
+    really_small_zero = BigDecimal("0E-200000000")
+    really_big_zero = BigDecimal("0E200000000000")
+    really_small_zero.nonzero?.should == nil
+    really_big_zero.nonzero?.should == nil
+    BigDecimal("0.000000000000000000000000").nonzero?.should == nil
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/plus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/plus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/plus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,50 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#+" do
+
+  before(:each) do
+    @one = BigDecimal("1")
+    @zero = BigDecimal("0")
+    @two = BigDecimal("2")
+    @three = BigDecimal("3")
+    @ten = BigDecimal("10")
+    @eleven = BigDecimal("11")
+    @nan = BigDecimal("NaN")
+    @infinity = BigDecimal("Infinity")
+    @infinity_minus = BigDecimal("-Infinity")
+    @one_minus = BigDecimal("-1")
+    @frac_1 = BigDecimal("1E-99999")
+    @frac_2 = BigDecimal("0.9E-99999")
+  end
+
+  it "returns a + b" do
+
+    (@two + @one).should == @three
+    (@one + @two).should == @three
+    (@one + @one_minus).should == @zero
+    (@zero + @one).should == @one
+    (@ten + @one).should == @eleven
+    (@frac_1 + @frac_2).should == BigDecimal("1.9E-99999")
+    (@frac_2 + @frac_1).should == BigDecimal("1.9E-99999")
+    (@frac_1 + @frac_1).should == BigDecimal("2E-99999")
+# can't do it this way because * isn't implemented yet
+#    (@frac_1 + @frac_1).should == 2 * @frac_1
+  end
+
+  it "returns NaN if NaN is involved" do
+    (@one + @nan).nan?.should == true
+    (@nan + @one).nan?.should == true
+  end
+
+  it "returns Infinity or -Infinity if these are involved" do
+    (@zero + @infinity).should == @infinity
+    (@frac_2 + @infinity).should == @infinity
+    (@two + @infinity_minus).should == @infinity_minus
+  end
+
+  it "returns NaN if Infinity + (- Infinity)" do
+    (@infinity + @infinity_minus).nan?.should == true
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/power_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/power_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/power_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/power'
+
+describe "BigDecimal#power" do
+  it_behaves_like(:bigdecimal_power, :power)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/precs_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/precs_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/precs_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,49 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#precs" do
+
+  before(:each) do
+    @infinity = BigDecimal("Infinity")
+    @infinity_neg = BigDecimal("-Infinity")
+    @nan = BigDecimal("NaN")
+    @zero = BigDecimal("0")
+    @zero_neg = BigDecimal("-0")
+
+    @arr = [BigDecimal("2E40001"), BigDecimal("3E-20001"),\
+            @infinity, @infinity_neg, @nan, @zero, @zero_neg]
+    @precision = BigDecimal::BASE.to_s.length - 1
+  end
+
+  it "returns array of two values" do
+    @arr.each do |x|
+      x.precs.kind_of?(Array).should == true
+      x.precs.size.should == 2
+    end
+  end
+
+  it "returns Integers as array values" do
+    @arr.each do |x|
+      x.precs[0].kind_of?(Integer).should == true
+      x.precs[1].kind_of?(Integer).should == true
+    end
+  end
+
+  it "returns the current value of significant digits as the first value" do
+    BigDecimal("3.14159").precs[0].should >= 6
+    BigDecimal('1').precs[0].should == BigDecimal('1' + '0' * 100).precs[0]
+    [@infinity, @infinity_neg, @nan, @zero, @zero_neg].each do |value|
+      value.precs[0].size.should <= @precision
+    end
+  end
+
+  it "returns the maximum number of significant digits as the second value" do
+    BigDecimal("3.14159").precs[1].should >= 6
+    BigDecimal('1').precs[1].size.should <= @precision
+    BigDecimal('1' + '0' * 100).precs[1] >= 101
+    [@infinity, @infinity_neg, @nan, @zero, @zero_neg].each do |value|
+      value.precs[1].size.should <= @precision
+    end
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/quo_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/quo_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/quo_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/quo'
+require 'bigdecimal'
+
+describe "BigDecimal#quo" do
+  it_behaves_like :bigdecimal_quo, :quo, []
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/remainder_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/remainder_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/remainder_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,86 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#remainder" do
+
+  before(:each) do
+    @zero = BigDecimal("0")
+    @one = BigDecimal("0")
+    @mixed = BigDecimal("1.23456789")
+    @pos_int = BigDecimal("2E5555")
+    @neg_int = BigDecimal("-2E5555")
+    @pos_frac = BigDecimal("2E-9999")
+    @neg_frac = BigDecimal("-2E-9999")
+    @nan = BigDecimal("NaN")
+    @infinity = BigDecimal("Infinity")
+    @infinity_minus = BigDecimal("-Infinity")
+    @one_minus = BigDecimal("-1")
+    @frac_1 = BigDecimal("1E-99999")
+    @frac_2 = BigDecimal("0.9E-99999")
+  end
+
+  it "it equals modulo, if both values are of same sign" do
+    BigDecimal('1234567890123456789012345679').remainder(BigDecimal('1')).should == @zero
+    BigDecimal('123456789').remainder(BigDecimal('333333333333333333333333333E-50')).should == BigDecimal('0.12233333333333333333345679E-24')
+
+    @mixed.remainder(@pos_frac).should == @mixed % @pos_frac
+    @pos_int.remainder(@pos_frac).should == @pos_int % @pos_frac
+    @neg_frac.remainder(@neg_int).should == @neg_frac % @neg_int
+    @neg_int.remainder(@neg_frac).should == @neg_int % @neg_frac
+  end
+
+  ruby_bug "Bug #585", "1.8" do
+    it "it is the modulus minus the value divided by, if values have opposite sign" do
+      @mixed.remainder(@neg_frac).should == (@mixed % @neg_frac) - @neg_frac
+      @pos_int.remainder(@neg_frac).should == (@pos_int % @neg_frac) - @neg_frac
+      @neg_frac.remainder(@pos_int).should == (@neg_frac % @pos_int) - @pos_int
+      @neg_int.remainder(@pos_frac).should == (@neg_int % @pos_frac) - @pos_frac
+    end
+  end
+
+  it "returns NaN used with zero" do
+    @mixed.remainder(@zero).nan?.should == true
+    @zero.remainder(@zero).nan?.should == true
+  end
+
+  it "returns zero if used on zero" do
+    @zero.remainder(@mixed).should == @zero
+  end
+  
+  it "returns NaN if NaN is involved" do
+    @nan.remainder(@nan).nan?.should == true
+    @nan.remainder(@one).nan?.should == true
+    @one.remainder(@nan).nan?.should == true
+    @infinity.remainder(@nan).nan?.should == true
+    @nan.remainder(@infinity).nan?.should == true
+  end
+
+  it "returns NaN if Infinity is involved" do
+    @infinity.remainder(@infinity).nan?.should == true
+    @infinity.remainder(@one).nan?.should == true
+    @infinity.remainder(@mixed).nan?.should == true
+    @infinity.remainder(@one_minus).nan?.should == true
+    @infinity.remainder(@frac_1).nan?.should == true
+    @one.remainder(@infinity).nan?.should == true
+
+    @infinity_minus.remainder(@infinity_minus).nan?.should == true
+    @infinity_minus.remainder(@one).nan?.should == true
+    @one.remainder(@infinity_minus).nan?.should == true
+    @frac_2.remainder(@infinity_minus).nan?.should == true
+
+    @infinity.remainder(@infinity_minus).nan?.should == true
+    @infinity_minus.remainder(@infinity).nan?.should == true
+  end
+  
+  it "coerces arguments to BigDecimal if possible" do
+    @one.remainder(2).should == @one
+  end
+
+
+  it "raises TypeError if the argument cannot be coerced to BigDecimal" do
+    lambda {
+      @one.remainder('2')
+    }.should raise_error(TypeError)
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/shared/eql.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/shared/eql.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/shared/eql.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,55 @@
+require 'bigdecimal'
+
+describe :bigdecimal_eql, :shared => true do
+  before(:each) do
+    @bg6543_21 = BigDecimal.new("6543.21")
+    @bg5667_19 = BigDecimal.new("5667.19")
+    @a = BigDecimal("1.0000000000000000000000000000000000000000005")
+    @b = BigDecimal("1.00000000000000000000000000000000000000000005")
+    @bigint = BigDecimal("1000.0")
+    @nan = BigDecimal("NaN")
+    @infinity = BigDecimal("Infinity")
+    @infinity_minus = BigDecimal("-Infinity")
+  end
+
+  it "test for equality" do
+    @bg6543_21.send(@method, @bg6543_21).should == true
+    @a.send(@method, @a).should == true
+    @a.send(@method, @b).should == false
+    @bg6543_21.send(@method, @a).should == false
+    @bigint.send(@method, 1000).should == true
+  end
+
+  it "NaN is never equal to any number" do
+    @nan.send(@method, @nan).should_not == true
+    @a.send(@method, @nan).should_not == true
+    @nan.send(@method, @a).should_not == true
+    @nan.send(@method, @infinity).should_not == true
+    @nan.send(@method, @infinity_minus).should_not == true
+    @infinity.send(@method, @nan).should_not == true
+    @infinity_minus.send(@method, @nan).should_not == true
+  end
+
+  it "returns true for infinity values with the same sign" do
+    @infinity.send(@method, @infinity).should == true
+    @infinity.send(@method, BigDecimal("Infinity")).should == true
+    BigDecimal("Infinity").send(@method, @infinity).should == true
+
+    @infinity_minus.send(@method, @infinity_minus).should == true
+    @infinity_minus.send(@method, BigDecimal("-Infinity")).should == true
+    BigDecimal("-Infinity").send(@method, @infinity_minus).should == true
+  end
+
+  it "does not return true for infinity values with different signs" do
+    @infinity.send(@method, @infinity_minus).should_not == true
+    @infinity_minus.send(@method, @infinity).should_not == true
+  end
+
+  it "does not return true when ininite value compared to finite one" do
+    @infinity.send(@method, @a).should_not == true
+    @infinity_minus.send(@method, @a).should_not == true
+
+    @a.send(@method, @infinity).should_not == true
+    @a.send(@method, @infinity_minus).should_not == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/shared/modulo.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/shared/modulo.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/shared/modulo.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,116 @@
+require 'bigdecimal'
+
+describe :bigdecimal_modulo, :shared => true do
+  before(:each) do
+    @one = BigDecimal("1")
+    @zero = BigDecimal("0")
+    @zero_pos = BigDecimal("+0")
+    @zero_neg = BigDecimal("-0")
+    @two = BigDecimal("2")
+    @three = BigDecimal("3")
+    @mixed = BigDecimal("1.23456789")
+    @nan = BigDecimal("NaN")
+    @infinity = BigDecimal("Infinity")
+    @infinity_minus = BigDecimal("-Infinity")
+    @one_minus = BigDecimal("-1")
+    @frac_1 = BigDecimal("1E-9999")
+    @frac_2 = BigDecimal("0.9E-9999")
+  end
+
+  it "returns self modulo other" do
+    bd6543 = BigDecimal.new("6543.21")
+    bd5667 = BigDecimal.new("5667.19")
+    a = BigDecimal("1.0000000000000000000000000000000000000000005")
+    b = BigDecimal("1.00000000000000000000000000000000000000000005")
+
+    bd6543.send(@method, 137).should == BigDecimal("104.21")
+    bd5667.send(@method, bignum_value).should == 5667.19
+    bd6543.send(@method, BigDecimal("137.24")).should == BigDecimal("92.93")
+    bd6543.send(@method, 137).should be_close(6543.21.%(137), TOLERANCE)
+    bd6543.send(@method, 137).should == bd6543 % 137
+    bd5667.send(@method, bignum_value).should be_close(5667.19.%(0xffffffff), TOLERANCE)
+    bd5667.send(@method, bignum_value).should == bd5667.%(0xffffffff)
+    bd6543.send(@method, 137.24).should be_close(6543.21.%(137.24), TOLERANCE)
+    a.send(@method, b).should == BigDecimal("0.45E-42")
+    @zero.send(@method, @one).should == @zero
+    @zero.send(@method, @one_minus).should == @zero
+    @two.send(@method, @one).should == @zero
+    @one.send(@method, @two).should == @one
+    @frac_1.send(@method, @one).should == @frac_1
+    @frac_2.send(@method, @one).should == @frac_2
+    @one_minus.send(@method, @one_minus).should == @zero
+    @one_minus.send(@method, @one).should == @zero
+    @one_minus.send(@method, @two).should == @one
+    @one.send(@method, - at two).should == - at one
+
+    @one_minus.modulo(BigDecimal('0.9')).should == BigDecimal('0.8')
+    @one.modulo(BigDecimal('-0.9')).should == BigDecimal('-0.8')
+
+    @one_minus.modulo(BigDecimal('0.8')).should == BigDecimal('0.6')
+    @one.modulo(BigDecimal('-0.8')).should == BigDecimal('-0.6')
+
+    @one_minus.modulo(BigDecimal('0.6')).should == BigDecimal('0.2')
+    @one.modulo(BigDecimal('-0.6')).should == BigDecimal('-0.2')
+
+    @one_minus.modulo(BigDecimal('0.5')).should == @zero
+    @one.modulo(BigDecimal('-0.5')).should == @zero
+    @one_minus.modulo(BigDecimal('-0.5')).should == @zero
+
+    @one_minus.modulo(BigDecimal('0.4')).should == BigDecimal('0.2')
+    @one.modulo(BigDecimal('-0.4')).should == BigDecimal('-0.2')
+
+    @one_minus.modulo(BigDecimal('0.3')).should == BigDecimal('0.2')
+    @one_minus.modulo(BigDecimal('0.2')).should == @zero
+  end
+
+  it "returns a [Float value] when the argument is Float" do
+    @two.send(@method, 2.0).should == 0.0
+    @one.send(@method, 2.0).should == 1.0
+    res = @two.send(@method, 5.0)
+    res.kind_of?(Float).should == true
+  end
+
+  it "returns NaN if NaN is involved" do
+    @nan.send(@method, @nan).nan?.should == true
+    @nan.send(@method, @one).nan?.should == true
+    @one.send(@method, @nan).nan?.should == true
+    @infinity.send(@method, @nan).nan?.should == true
+    @nan.send(@method, @infinity).nan?.should == true
+  end
+
+  it "returns NaN if Infinity is involved" do
+    @infinity.send(@method, @infinity).nan?.should == true
+    @infinity.send(@method, @one).nan?.should == true
+    @infinity.send(@method, @mixed).nan?.should == true
+    @infinity.send(@method, @one_minus).nan?.should == true
+    @infinity.send(@method, @frac_1).nan?.should == true
+    @one.send(@method, @infinity).nan?.should == true
+
+    @infinity_minus.send(@method, @infinity_minus).nan?.should == true
+    @infinity_minus.send(@method, @one).nan?.should == true
+    @one.send(@method, @infinity_minus).nan?.should == true
+    @frac_2.send(@method, @infinity_minus).nan?.should == true
+
+    @infinity.send(@method, @infinity_minus).nan?.should == true
+    @infinity_minus.send(@method, @infinity).nan?.should == true
+  end
+  
+  it "raises TypeError if the argument cannot be coerced to BigDecimal" do
+    lambda {
+      @one.send(@method, '2')
+    }.should raise_error(TypeError)
+  end
+end
+
+describe :bigdecimal_modulo_zerodivisionerror, :shared => true do
+  it "does NOT raise ZeroDivisionError if other is zero" do
+    bd6543 = BigDecimal.new("6543.21")
+    bd5667 = BigDecimal.new("5667.19")
+    a = BigDecimal("1.0000000000000000000000000000000000000000005")
+    b = BigDecimal("1.00000000000000000000000000000000000000000005")
+
+    bd5667.send(@method, 0).nan?.should == true
+    bd5667.send(@method, BigDecimal("0")).nan?.should == true
+    @zero.send(@method, @zero).nan?.should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/shared/mult.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/shared/mult.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/shared/mult.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,97 @@
+require 'bigdecimal'
+
+describe :bigdecimal_mult, :shared => true do
+  before :each do
+    @zero = BigDecimal "0"
+    @zero_pos = BigDecimal "+0"
+    @zero_neg = BigDecimal "-0"
+
+    @one = BigDecimal "1"
+    @mixed = BigDecimal "1.23456789"
+    @pos_int = BigDecimal "2E5555"
+    @neg_int = BigDecimal "-2E5555"
+    @pos_frac = BigDecimal "2E-9999"
+    @neg_frac = BigDecimal "-2E-9999"
+    @nan = BigDecimal "NaN"
+    @infinity = BigDecimal "Infinity"
+    @infinity_minus = BigDecimal "-Infinity"
+    @one_minus = BigDecimal "-1"
+    @frac_1 = BigDecimal "1E-99999"
+    @frac_2 = BigDecimal "0.9E-99999"
+
+    @e3_minus = BigDecimal "3E-20001"
+    @e = BigDecimal "1.00000000000000000000123456789"
+    @tolerance = @e.sub @one, 1000
+    @tolerance2 = BigDecimal "30001E-20005"
+
+    @special_vals = [@infinity, @infinity_minus, @nan]
+    @regular_vals = [ @one, @mixed, @pos_int, @neg_int,
+                      @pos_frac, @neg_frac, @one_minus,
+                      @frac_1, @frac_2
+                    ]
+    @zeroes = [@zero, @zero_pos, @zero_neg]
+  end
+
+  it "returns zero of appropriate sign if self or argument is zero" do
+    @zero.send(@method, @zero, *@object).sign.should == BigDecimal::SIGN_POSITIVE_ZERO
+    @zero_neg.send(@method, @zero_neg, *@object).sign.should == BigDecimal::SIGN_POSITIVE_ZERO
+    @zero.send(@method, @zero_neg, *@object).sign.should == BigDecimal::SIGN_NEGATIVE_ZERO
+    @zero_neg.send(@method, @zero, *@object).sign.should == BigDecimal::SIGN_NEGATIVE_ZERO
+
+    @one.send(@method, @zero, *@object).sign.should == BigDecimal::SIGN_POSITIVE_ZERO
+    @one.send(@method, @zero_neg, *@object).sign.should == BigDecimal::SIGN_NEGATIVE_ZERO
+
+    @zero.send(@method, @one, *@object).sign.should == BigDecimal::SIGN_POSITIVE_ZERO
+    @zero.send(@method, @one_minus, *@object).sign.should == BigDecimal::SIGN_NEGATIVE_ZERO
+    @zero_neg.send(@method, @one_minus, *@object).sign.should == BigDecimal::SIGN_POSITIVE_ZERO
+    @zero_neg.send(@method, @one, *@object).sign.should == BigDecimal::SIGN_NEGATIVE_ZERO
+  end
+
+  it "returns NaN if NaN is involved" do
+    values = @regular_vals + @zeroes
+
+    values.each do |val|
+      @nan.send(@method, val, *@object).nan?.should == true
+      val.send(@method, @nan, *@object).nan?.should == true
+    end
+  end
+
+  it "returns zero if self or argument is zero" do
+    values = @regular_vals + @zeroes
+
+    values.each do |val|
+      @zeroes.each do |zero|
+        zero.send(@method, val, *@object).should == 0
+        zero.send(@method, val, *@object).zero?.should == true
+        val.send(@method, zero, *@object).should == 0
+        val.send(@method, zero, *@object).zero?.should == true
+      end
+    end
+  end
+
+  it "returns infinite value if self or argument is infinite" do
+    values = @regular_vals
+    infs = [@infinity, @infinity_minus]
+
+    values.each do |val|
+      infs.each do |inf|
+        inf.send(@method, val, *@object).finite?.should == false
+        val.send(@method, inf, *@object).finite?.should == false
+      end
+    end
+
+    @infinity.send(@method, @infinity, *@object).infinite?.should == 1
+    @infinity_minus.send(@method, @infinity_minus, *@object).infinite?.should == 1
+    @infinity.send(@method, @infinity_minus, *@object).infinite?.should == -1
+    @infinity_minus.send(@method, @infinity, *@object).infinite?.should == -1
+    @infinity.send(@method, @one, *@object).infinite?.should == 1
+    @infinity_minus.send(@method, @one, *@object).infinite?.should == -1
+  end
+
+  it "returns NaN if the result is undefined" do
+    @zero.send(@method, @infinity, *@object).nan?.should == true
+    @zero.send(@method, @infinity_minus, *@object).nan?.should == true
+    @infinity.send(@method, @zero, *@object).nan?.should == true
+    @infinity_minus.send(@method, @zero, *@object).nan?.should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/shared/power.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/shared/power.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/shared/power.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,66 @@
+require 'bigdecimal'
+
+describe :bigdecimal_power, :shared => true do
+  it "powers of self" do
+    e3_minus = BigDecimal("3E-20001")
+    e3_minus_power_2 = BigDecimal("9E-40002")
+    e3_plus = BigDecimal("3E20001")
+    e2_plus = BigDecimal("2E40001")
+    e5_minus = BigDecimal("5E-40002")
+    e = BigDecimal("1.00000000000000000000123456789")
+    one = BigDecimal("1")
+    ten = BigDecimal("10")
+    # The tolerance is dependent upon the size of BASE_FIG
+    tolerance = BigDecimal("1E-70")
+    ten_powers = BigDecimal("1E10000")
+    pi = BigDecimal("3.14159265358979")
+    e3_minus.send(@method, 2).should == e3_minus_power_2
+    e3_plus.send(@method, 0).should == 1
+    e3_minus.send(@method, 1).should == e3_minus
+    e2_plus.send(@method, -1).should == e5_minus
+    e2_plus.send(@method, -1).should == e5_minus.power(1)
+    (e2_plus.send(@method, -1) * e5_minus.send(@method, -1)).should == 1
+    e.send(@method, 2).should == e * e
+    e.send(@method, -1).should be_close(one.div(e, 120), tolerance)
+    ten.send(@method, 10000).should == ten_powers
+    pi.send(@method, 10).should be_close(Math::PI ** 10, TOLERANCE)
+  end
+
+  it "powers of 1 equal 1" do
+    one = BigDecimal("1")
+    one.send(@method, 0).should == 1
+    one.send(@method, 1).should == 1
+    one.send(@method, 10).should == 1
+    one.send(@method, -10).should == 1
+  end
+
+  it "0 to power of 0 is 1" do
+    zero = BigDecimal("0")
+    zero.send(@method, 0).should == 1
+  end
+
+  it "0 to powers < 0 is Infinity" do
+    zero = BigDecimal("0")
+    infinity = BigDecimal("Infinity")
+    zero.send(@method, -10).should == infinity
+    zero.send(@method, -1).should == infinity
+  end
+
+  it "other powers of 0 are 0" do
+    zero = BigDecimal("0")
+    zero.send(@method, 1).should == 0
+    zero.send(@method, 10).should == 0
+  end
+
+  it "returns NaN if self is NaN" do
+    BigDecimal("NaN").send(@method, -5).nan?.should == true
+    BigDecimal("NaN").send(@method, 5).nan?.should == true
+  end
+
+  it "returns NaN if self is infinite" do
+    BigDecimal("Infinity").send(@method, -5).nan?.should == true
+    BigDecimal("-Infinity").send(@method, -5).nan?.should == true
+    BigDecimal("Infinity").send(@method, 5).nan?.should == true
+    BigDecimal("-Infinity").send(@method, 5).nan?.should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/shared/quo.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/shared/quo.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/shared/quo.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,64 @@
+require 'bigdecimal'
+
+describe :bigdecimal_quo, :shared => true do
+  before(:each) do
+    @one = BigDecimal("1")
+    @zero = BigDecimal("0")
+    @zero_plus = BigDecimal("+0")
+    @zero_minus = BigDecimal("-0")
+    @two = BigDecimal("2")
+    @three = BigDecimal("3")
+    @eleven = BigDecimal("11")
+    @nan = BigDecimal("NaN")
+    @infinity = BigDecimal("Infinity")
+    @infinity_minus = BigDecimal("-Infinity")
+    @one_minus = BigDecimal("-1")
+    @frac_1 = BigDecimal("1E-99999")
+    @frac_2 = BigDecimal("0.9E-99999")
+  end
+
+  it "returns a / b" do
+    @two.send(@method, @one, *@object).should == @two
+    @one.send(@method, @two, *@object).should == BigDecimal("0.5")
+    @eleven.send(@method, @three, *@object).should be_close(@three + (@two / @three), TOLERANCE)
+    @one.send(@method, @one_minus, *@object).should == @one_minus
+    @one_minus.send(@method, @one_minus, *@object).should == @one
+    @frac_2.send(@method, @frac_1, *@object).should == BigDecimal("0.9")
+    @frac_1.send(@method, @frac_1, *@object).should == @one
+    @one.send(@method, BigDecimal('-2E5555'), *@object).should == BigDecimal('-0.5E-5555')
+    @one.send(@method, BigDecimal('2E-5555'), *@object).should == BigDecimal('0.5E5555')
+  end
+
+  it "returns NaN if NaN is involved" do
+    @one.send(@method, @nan, *@object).nan?.should == true
+    @nan.send(@method , at one).nan?.should == true
+  end
+
+  it "returns 0 if divided by Infinity" do
+    @zero.send(@method, @infinity, *@object).should == 0
+    @frac_2.send(@method, @infinity, *@object).should == 0
+  end
+
+  it "returns (+|-) Infinity if (+|-) Infinity divided by one" do
+    @infinity_minus.send(@method, @one, *@object).should == @infinity_minus
+    @infinity.send(@method, @one, *@object).should == @infinity
+    @infinity_minus.send(@method, @one_minus, *@object).should == @infinity
+  end
+
+  it "returns NaN if Infinity / ((+|-) Infinity)" do
+    @infinity.send(@method, @infinity_minus, *@object).nan?.should == true
+    @infinity_minus.send(@method, @infinity, *@object).nan?.should == true
+  end
+
+  it "returns (+|-) Infinity if divided by zero" do
+    @one.send(@method, @zero, *@object).should == @infinity
+    @one.send(@method, @zero_plus, *@object).should == @infinity
+    @one.send(@method, @zero_minus, *@object).should == @infinity_minus
+  end
+
+  it "returns NaN if zero is divided by zero" do
+    @zero.send(@method, @zero, *@object).nan?.should == true
+    @zero_minus.send(@method, @zero_plus, *@object).nan?.should == true
+    @zero_plus.send(@method, @zero_minus, *@object).nan?.should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/shared/to_int.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/shared/to_int.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/shared/to_int.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require 'bigdecimal'
+
+describe :bigdecimal_to_int , :shared => true do
+  it "returns nil if BigDecimal is infinity or NaN" do
+    BigDecimal("Infinity").send(@method).should == nil
+    BigDecimal("NaN").send(@method).should == nil
+  end
+
+  it "returns Integer or Bignum otherwise" do
+    BigDecimal("3E-20001").send(@method).should == 0
+    BigDecimal("2E4000").send(@method).should == 2 * 10 ** 4000
+    BigDecimal("2").send(@method).should == 2
+    BigDecimal("2E10").send(@method).should == 20000000000
+    BigDecimal("3.14159").send(@method).should == 3
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/sign_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/sign_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/sign_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,47 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#sign" do
+
+  it "BigDecimal defines several constants for signs" do
+    # are these really correct?
+    BigDecimal::SIGN_POSITIVE_INFINITE.should == 3
+    BigDecimal::SIGN_NEGATIVE_INFINITE.should == -3
+    BigDecimal::SIGN_POSITIVE_ZERO.should == 1
+    BigDecimal::SIGN_NEGATIVE_ZERO.should == -1
+    BigDecimal::SIGN_POSITIVE_FINITE.should == 2
+    BigDecimal::SIGN_NEGATIVE_FINITE.should == -2
+  end
+
+  it "returns positive value if BigDecimal greater than 0" do
+    BigDecimal("1").sign.should  == BigDecimal::SIGN_POSITIVE_FINITE
+    BigDecimal("1E-20000000").sign.should == BigDecimal::SIGN_POSITIVE_FINITE
+    BigDecimal("1E200000000").sign.should == BigDecimal::SIGN_POSITIVE_FINITE
+    BigDecimal("Infinity").sign.should == BigDecimal::SIGN_POSITIVE_INFINITE
+  end
+
+  it "returns negative value if BigDecimal less than 0" do
+    BigDecimal("-1").sign.should == BigDecimal::SIGN_NEGATIVE_FINITE
+    BigDecimal("-1E-9990000").sign.should == BigDecimal::SIGN_NEGATIVE_FINITE
+    BigDecimal("-1E20000000").sign.should == BigDecimal::SIGN_NEGATIVE_FINITE
+    BigDecimal("-Infinity").sign.should == BigDecimal::SIGN_NEGATIVE_INFINITE
+  end
+
+  it "returns positive zero if BigDecimal equals positve zero" do
+    BigDecimal("0").sign.should == BigDecimal::SIGN_POSITIVE_ZERO
+    BigDecimal("0E-200000000").sign.should ==  BigDecimal::SIGN_POSITIVE_ZERO
+    BigDecimal("0E200000000").sign.should ==  BigDecimal::SIGN_POSITIVE_ZERO
+  end
+
+  it "returns negative zero if BigDecimal equals negative zero" do
+    BigDecimal("-0").sign.should == BigDecimal::SIGN_NEGATIVE_ZERO
+    BigDecimal("-0E-200000000").sign.should == BigDecimal::SIGN_NEGATIVE_ZERO
+    BigDecimal("-0E200000000").sign.should == BigDecimal::SIGN_NEGATIVE_ZERO
+  end
+
+  it "returns BigDecimal::SIGN_NaN if BigDecimal is NaN" do
+    BigDecimal("NaN").sign.should == BigDecimal::SIGN_NaN
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/split_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/split_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/split_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,88 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#split" do
+
+  before(:each) do
+    @arr = BigDecimal("0.314159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593014782083152134043E1").split
+    @arr_neg = BigDecimal("-0.314159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593014782083152134043E1").split
+    @digits = "922337203685477580810101333333333333333333333333333"
+    @arr_big = BigDecimal("00#{@digits}000").split
+    @arr_big_neg = BigDecimal("-00#{@digits}000").split
+    @huge = BigDecimal('100000000000000000000000000000000000000000001E90000000').split
+
+    @infinity = BigDecimal("Infinity")
+    @infinity_neg = BigDecimal("-Infinity")
+    @nan = BigDecimal("NaN")
+    @zero = BigDecimal("0")
+    @zero_neg = BigDecimal("-0")
+  end
+
+  it "splits BigDecimal in an array with four values" do
+    @arr.size.should == 4
+  end
+
+  it "First value: 1 for numbers > 0" do
+    @arr[0].should == 1
+    @arr_big[0].should == 1
+    @zero.split[0].should == 1
+    @huge[0].should == 1
+    BigDecimal("+0").split[0].should == 1
+    BigDecimal("1E400").split[0].should == 1
+    @infinity.split[0].should == 1
+  end
+
+  it "First value: -1 for numbers < 0" do
+    @arr_neg[0].should == -1
+    @arr_big_neg[0].should == -1
+    @zero_neg.split[0].should == -1
+    BigDecimal("-1E400").split[0].should == -1
+    @infinity_neg.split[0].should == -1
+  end
+
+  it "First value: 0 if BigDecimal is NaN" do
+    BigDecimal("NaN").split[0].should == 0
+  end
+
+  it "Second value: a string with the significant digits" do
+    string = "314159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593014782083152134043"
+    @arr[1].should == string
+    @arr_big[1].should == @digits
+    @arr_big_neg[1].should == @digits
+    @huge[1].should == "100000000000000000000000000000000000000000001"
+    @infinity.split[1].should == @infinity.to_s
+    @nan.split[1].should == @nan.to_s
+    @infinity_neg.split[1].should == @infinity.to_s
+    @zero.split[1].should == "0"
+    BigDecimal("-0").split[1].should == "0"
+  end
+
+  it "Third value: the base (currently always ten)" do
+   @arr[2].should == 10
+   @arr_neg[2].should == 10
+   @arr_big[2].should == 10
+   @arr_big_neg[2].should == 10
+   @huge[2].should == 10
+   @infinity.split[2].should == 10
+   @nan.split[2].should == 10
+   @infinity_neg.split[2].should == 10
+   @zero.split[2].should == 10
+   @zero_neg.split[2].should == 10
+  end
+
+  it "Fourth value: The exponent" do
+    @arr[3].should == 1
+    @arr_neg[3].should == 1
+    @arr_big[3].should == 54
+    @arr_big_neg[3].should == 54
+    @huge[3].should == 90000045
+    @infinity.split[3].should == 0
+    @nan.split[3].should == 0
+    @infinity_neg.split[3].should == 0
+    @zero.split[3].should == 0
+    @zero_neg.split[3].should == 0
+  end
+
+end
+
+

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/sqrt_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/sqrt_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/sqrt_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,76 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require 'bigdecimal'
+
+describe "BigDecimal#sqrt" do
+  before(:each) do
+    @one = BigDecimal("1")
+    @zero = BigDecimal("0")
+    @zero_pos = BigDecimal("+0")
+    @zero_neg = BigDecimal("-0")
+    @two = BigDecimal("2")
+    @three = BigDecimal("3")
+    @nan = BigDecimal("NaN")
+    @infinity = BigDecimal("Infinity")
+    @infinity_minus = BigDecimal("-Infinity")
+    @one_minus = BigDecimal("-1")
+    @frac_1 = BigDecimal("1E-99999")
+    @frac_2 = BigDecimal("0.9E-99999")
+  end
+
+  it "returns sqrt of self with at least the given precision" do
+    string = "1.41421356237309504880168872420969807856967187537694807317667973799073247846210703885038753432764157"
+    (1..99).each { |idx|
+      @two.sqrt(idx).should be_close(BigDecimal(string), BigDecimal("1E-#{idx-1}"))
+    }
+    sqrt_3 = "1.732050807568877293527446341505872366942805253810380628055806979451933016908800037081146186757248575"
+    (1..99).each { |idx|
+      @three.sqrt(idx).should be_close(BigDecimal(sqrt_3), BigDecimal("1E-#{idx-1}"))
+    }
+    BigDecimal('121').sqrt(5).should be_close(11, 0.00001)
+    @frac_2.sqrt(1).to_s.should == "0.3E-49999"
+  end
+
+  it "requires a single fixnum argument" do
+    lambda {
+      @one.sqrt
+    }.should raise_error(ArgumentError)
+    lambda {
+      @one.sqrt(-1)
+    }.should raise_error(ArgumentError)
+    lambda {
+      @one.sqrt(1, 1)
+    }.should raise_error(ArgumentError)
+    lambda {
+      @one.sqrt(nil)
+    }.should raise_error(TypeError)
+    lambda {
+      @one.sqrt("stuff")
+    }.should raise_error(TypeError)
+    lambda {
+      @one.sqrt(Object.new)
+    }.should raise_error(TypeError)
+    @one.sqrt(1).should == 1
+    @one.sqrt(0).should == 1
+  end
+
+  it "raises FloatDomainError on negative values" do
+    lambda {
+      BigDecimal('-1').sqrt(10)
+    }.should raise_error(FloatDomainError)
+  end
+
+  it "properly handles special values" do
+    @infinity.sqrt(1).should == @infinity
+    lambda {
+      @infinity_minus.sqrt(1)
+    }.should raise_error(FloatDomainError)
+    lambda {
+      @nan.sqrt(1)
+    }.should raise_error(FloatDomainError)
+    @zero.sqrt(1).should == 0
+    @zero_pos.sqrt(1).should == 0
+    @zero_neg.sqrt(1).should == 0
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/sub_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/sub_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/sub_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,53 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#sub" do
+
+  before(:each) do
+    @one = BigDecimal("1")
+    @zero = BigDecimal("0")
+    @two = BigDecimal("2")
+    @nan = BigDecimal("NaN")
+    @infinity = BigDecimal("Infinity")
+    @infinity_minus = BigDecimal("-Infinity")
+    @one_minus = BigDecimal("-1")
+    @frac_1 = BigDecimal("1E-99999")
+    @frac_2 = BigDecimal("0.9E-99999")
+  end
+
+  it "returns a - b with given precision" do
+    # documentation states, that precision is optional
+    # but implementation raises ArgumentError if not given.
+
+    @two.sub(@one, 1).should == @one
+    @one.sub(@two, 1).should == @one_minus
+    @one.sub(@one_minus, 1).should == @two
+    @frac_2.sub(@frac_1, 1000000).should == BigDecimal("-0.1E-99999")
+    @frac_2.sub(@frac_1, 1).should == BigDecimal("-0.1E-99999")
+    # the above two examples puzzle me.
+    in_arow_one = BigDecimal("1.23456789")
+    in_arow_two = BigDecimal("1.2345678")
+    in_arow_one.sub(in_arow_two, 10).should == BigDecimal("0.9E-7")
+    @two.sub(@two,1).should == @zero
+    @frac_1.sub(@frac_1, 1000000).should == @zero
+  end
+
+  it "returns NaN if NaN is involved" do
+    @one.sub(@nan, 1).nan?.should == true
+    @nan.sub(@one, 1).nan?.should == true
+  end
+  
+  it "returns NaN if both values are infinite with the same signs" do
+    @infinity.sub(@infinity, 1).nan?.should == true
+    @infinity_minus.sub(@infinity_minus, 1).nan?.should == true
+  end
+
+  it "returns Infinity or -Infinity if these are involved" do
+    @infinity.sub(@infinity_minus, 1).should == @infinity
+    @infinity_minus.sub(@infinity, 1).should == @infinity_minus
+    @zero.sub(@infinity, 1).should == @infinity_minus
+    @frac_2.sub( @infinity, 1).should == @infinity_minus
+    @two.sub(@infinity, 1).should == @infinity_minus
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/to_f_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/to_f_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/to_f_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,52 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#to_f" do
+  before(:each) do
+    @one = BigDecimal("1")
+    @zero = BigDecimal("0")
+    @zero_pos = BigDecimal("+0")
+    @zero_neg = BigDecimal("-0")
+    @two = BigDecimal("2")
+    @three = BigDecimal("3")
+    @nan = BigDecimal("NaN")
+    @infinity = BigDecimal("Infinity")
+    @infinity_minus = BigDecimal("-Infinity")
+    @one_minus = BigDecimal("-1")
+    @frac_1 = BigDecimal("1E-99999")
+    @frac_2 = BigDecimal("0.9E-99999")
+    @vals = [@one, @zero, @two, @three, @frac_1, @frac_2]
+    @spec_vals = [@zero_pos, @zero_neg, @nan, @infinity, @infinity_minus]
+  end
+
+  it "returns number of type float" do
+    BigDecimal("3.14159").to_f.class.should == Float
+    @vals.each { |val| val.to_f.class.should == Float }
+    @spec_vals.each { |val| val.to_f.class.should == Float }
+  end
+
+  it "Floating point rounding occurs" do
+    bigdec = BigDecimal("3.141592653589793238462643383279502884197169399375")
+    bigdec.to_f.should be_close(3.14159265358979, TOLERANCE)
+    @one.to_f.should == 1.0
+    @two.to_f.should == 2.0
+    @three.to_f.should be_close(3.0, TOLERANCE)
+    @one_minus.to_f.should == -1.0
+  end
+  
+  it "properly handles special values" do
+    @zero.to_f.should == 0
+    @zero.to_f.to_s.should == "0.0"
+
+    @nan.to_f.nan?.should == true
+
+    @infinity.to_f.infinite?.should == 1
+    @infinity_minus.to_f.infinite?.should == -1
+  end
+
+  it "remembers negative zero when converted to float" do
+    @zero_neg.to_f.should == 0
+    @zero_neg.to_f.to_s.should == "-0.0"
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/to_i_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/to_i_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/to_i_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/to_int'
+require 'bigdecimal'
+
+describe "BigDecimal#to_i" do
+    it_behaves_like(:bigdecimal_to_int, :to_i)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/to_int_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/to_int_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/to_int_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/to_int'
+require 'bigdecimal'
+
+
+describe "BigDecimal#to_int" do
+  it_behaves_like(:bigdecimal_to_int, :to_int)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,72 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#to_s" do
+
+  before(:each) do
+    @bigdec_str = "3.14159265358979323846264338327950288419716939937"
+    @bigneg_str = "-3.1415926535897932384626433832795028841971693993"
+    @bigdec = BigDecimal(@bigdec_str)
+    @bigneg = BigDecimal(@bigneg_str)
+  end
+
+  it "return type is of class String" do
+    @bigdec.to_s.kind_of?(String).should == true
+    @bigneg.to_s.kind_of?(String).should == true
+  end
+
+  it "the default format looks like 0.xxxxEnn" do
+    @bigdec.to_s.should  =~ /^0\.[0-9]*E[0-9]*$/
+  end
+
+  it "takes an optional argument" do
+    lambda {@bigdec.to_s("F")}.should_not raise_error()
+  end
+
+  it "starts with + if + is supplied and value is positive" do
+    @bigdec.to_s("+").should =~ /^\+.*/
+    @bigneg.to_s("+").should_not =~ /^\+.*/
+  end
+
+  it "inserts a space every n chars, if integer n is supplied" do
+    str =\
+      "0.314 159 265 358 979 323 846 264 338 327 950 288 419 716 939 937E1"
+    @bigdec.to_s(3).should == str
+    str1 = '-123.45678 90123 45678 9'
+    BigDecimal.new("-123.45678901234567890").to_s('5F').should ==  str1
+    # trailing zeroes removed
+    BigDecimal.new("1.00000000000").to_s('1F').should == "1.0"
+    # 0 is treated as no spaces
+    BigDecimal.new("1.2345").to_s('0F').should == "1.2345"
+  end
+
+  it "can return a leading space for values > 0" do
+    @bigdec.to_s(" F").should =~ /\ .*/
+    @bigneg.to_s(" F").should_not =~ /\ .*/
+  end
+
+  it "removes trailing spaces in floating point notation" do
+    BigDecimal.new('-123.45678901234567890').to_s('F').should == "-123.4567890123456789"
+    BigDecimal.new('1.2500').to_s('F').should == "1.25"
+    BigDecimal.new('0000.00000').to_s('F').should == "0.0"
+    BigDecimal.new('-00.000010000').to_s('F').should == "-0.00001"
+    BigDecimal.new("5.00000E-2").to_s("F").should == "0.05"
+
+    BigDecimal.new("500000").to_s("F").should == "500000.0"
+    BigDecimal.new("5E2").to_s("F").should == "500.0"
+    BigDecimal.new("-5E100").to_s("F").should == "-5" + "0" * 100 + ".0"
+  end
+
+  it "can use engineering notation" do
+    @bigdec.to_s("E").should =~ /^0\.[0-9]*E[0-9]*$/
+  end
+
+  it "can use conventional floating point notation" do
+    @bigdec.to_s("F").should == @bigdec_str
+    @bigneg.to_s("F").should == @bigneg_str
+    str2 = "+123.45678901 23456789"
+    BigDecimal.new('123.45678901234567890').to_s('+8F').should == str2
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/truncate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/truncate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/truncate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,78 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#truncate" do
+
+  before(:each) do
+      @arr = ['3.14159', '8.7', "0.314159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593014782083152134043E1"]
+      @big = BigDecimal("123456.789")
+      @nan = BigDecimal('NaN')
+      @infinity = BigDecimal('Infinity')
+      @infinity_negative = BigDecimal('-Infinity')
+  end
+
+  it "returns value of type Bigdecimal." do
+    @arr.each do |x|
+      BigDecimal(x).truncate.kind_of?(BigDecimal).should == true
+    end
+  end
+
+  it "returns the integer part as a BigDecimal if no precision given" do
+    BigDecimal(@arr[0]).truncate.should == 3
+    BigDecimal(@arr[1]).truncate.should == 8
+    BigDecimal(@arr[2]).truncate.should == 3
+    BigDecimal('0').truncate.should == 0
+    BigDecimal('0.1').truncate.should == 0
+    BigDecimal('-0.1').truncate.should == 0
+    BigDecimal('1.5').truncate.should == 1
+    BigDecimal('-1.5').truncate.should == -1
+    BigDecimal('1E10').truncate.should == BigDecimal('1E10')
+    BigDecimal('-1E10').truncate.should == BigDecimal('-1E10')
+    BigDecimal('1.8888E10').truncate.should == BigDecimal('1.8888E10')
+    BigDecimal('-1E-1').truncate.should == 0
+  end
+
+  it "returns value of given precision otherwise" do
+    BigDecimal('-1.55').truncate(1).should == BigDecimal('-1.5')
+    BigDecimal('1.55').truncate(1).should == BigDecimal('1.5')
+    BigDecimal(@arr[0]).truncate(2).should == BigDecimal("3.14")
+    BigDecimal('123.456').truncate(2).should == BigDecimal("123.45")
+    BigDecimal('123.456789').truncate(4).should == BigDecimal("123.4567")
+    BigDecimal('0.456789').truncate(10).should == BigDecimal("0.456789")
+    BigDecimal('-1E-1').truncate(1).should == BigDecimal('-0.1')
+    BigDecimal('-1E-1').truncate(2).should == BigDecimal('-0.1E0')
+    BigDecimal('-1E-1').truncate.should == BigDecimal('0')
+    BigDecimal('-1E-1').truncate(0).should == BigDecimal('0')
+    BigDecimal('-1E-1').truncate(-1).should == BigDecimal('0')
+    BigDecimal('-1E-1').truncate(-2).should == BigDecimal('0')
+
+    BigDecimal(@arr[1]).truncate(1).should == BigDecimal("8.7")
+    BigDecimal(@arr[2]).truncate(100).should == BigDecimal(\
+      "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679")
+  end
+
+  it "sets n digits left of the decimal point to 0, if given n < 0" do
+    @big.truncate(-1).should == BigDecimal("123450.0")
+    @big.truncate(-2).should == BigDecimal("123400.0")
+    BigDecimal(@arr[2]).truncate(-1).should == 0
+  end
+
+  it "returns NaN if self is NaN" do
+    @nan.truncate(-1).nan?.should == true
+    @nan.truncate(+1).nan?.should == true
+    @nan.truncate(0).nan?.should == true
+    @nan.truncate.nan?.should == true
+  end
+
+  it "returns Infinity if self is infinite" do
+    @infinity.truncate(-1).should == @infinity
+    @infinity.truncate(+1).should == @infinity
+    @infinity.truncate(0).should == @infinity
+    @infinity.truncate.should == @infinity
+
+    @infinity_negative.truncate(-1).should == @infinity_negative
+    @infinity_negative.truncate(+1).should == @infinity_negative
+    @infinity_negative.truncate(0).should == @infinity_negative
+    @infinity_negative.truncate.should == @infinity_negative
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/uminus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/uminus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/uminus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,58 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#-@" do
+  before(:each) do
+    @one = BigDecimal("1")
+    @zero = BigDecimal("0")
+    @zero_pos = BigDecimal("+0")
+    @zero_neg = BigDecimal("-0")
+    @nan = BigDecimal("NaN")
+    @infinity = BigDecimal("Infinity")
+    @infinity_minus = BigDecimal("-Infinity")
+    @one_minus = BigDecimal("-1")
+    @frac_1 = BigDecimal("1E-99999")
+    @frac_2 = BigDecimal("0.9E-99999")
+    @big = BigDecimal("333E99999")
+    @big_neg = BigDecimal("-333E99999")
+    @values = [@one, @zero, @zero_pos, @zero_neg, @infinity,
+      @infinity_minus, @one_minus, @frac_1, @frac_2, @big, @big_neg]
+  end
+
+  it "negates self" do
+    @one.send(:-@).should == @one_minus
+    @one_minus.send(:-@).should == @one
+    @frac_1.send(:-@).should == BigDecimal("-1E-99999")
+    @frac_2.send(:-@).should == BigDecimal("-0.9E-99999")
+    @big.send(:-@).should == @big_neg
+    @big_neg.send(:-@).should == @big
+    BigDecimal("2.221").send(:-@).should == BigDecimal("-2.221")
+    BigDecimal("2E10000").send(:-@).should == BigDecimal("-2E10000")
+    some_number = BigDecimal("2455999221.5512")
+    some_number_neg = BigDecimal("-2455999221.5512")
+    some_number.send(:-@).should == some_number_neg
+    (-BigDecimal("-5.5")).should == BigDecimal("5.5")
+    another_number = BigDecimal("-8.551551551551551551")
+    another_number_pos = BigDecimal("8.551551551551551551")
+    another_number.send(:-@).should == another_number_pos
+    @values.each do |val|
+      (val.send(:-@).send(:-@)).should == val
+    end
+  end
+
+  it "properly handles special values" do
+    @infinity.send(:-@).should == @infinity_minus
+    @infinity_minus.send(:-@).should == @infinity
+    @infinity.send(:-@).infinite?.should == -1
+    @infinity_minus.send(:-@).infinite?.should == 1
+
+    @zero.send(:-@).should == @zero
+    @zero.send(:-@).sign.should == -1
+    @zero_pos.send(:-@).should == @zero
+    @zero_pos.send(:-@).sign.should == -1
+    @zero_neg.send(:-@).should == @zero
+    @zero_neg.send(:-@).sign.should == 1
+
+    @nan.send(:-@).nan?.should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/uplus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/uplus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/uplus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#+@" do 
+  it "returns the same value with same sign (twos complement)" do
+    first = BigDecimal("34.56")
+    first.send(:+@).should == first
+    second = BigDecimal("-34.56")
+    second.send(:+@).should == second
+    third = BigDecimal("0.0")
+    third.send(:+@).should == third
+    fourth = BigDecimal("2E1000000")
+    fourth.send(:+@).should == fourth
+    fifth = BigDecimal("123456789E-1000000")
+    fifth.send(:+@).should == fifth
+  end
+end
+
+
+

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/ver_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/ver_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/ver_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal.ver" do
+
+  it "returns the Version number" do
+    lambda {BigDecimal.ver }.should_not raise_error()
+    BigDecimal.ver.should_not == nil
+  end
+
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/bigdecimal/zero_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/bigdecimal/zero_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/bigdecimal/zero_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'bigdecimal'
+
+describe "BigDecimal#zero?" do
+
+  it "returns true if self does equal zero" do
+    really_small_zero = BigDecimal("0E-200000000")
+    really_big_zero = BigDecimal("0E200000000000")
+    really_small_zero.zero?.should == true
+    really_big_zero.zero?.should == true
+    BigDecimal("0.000000000000000000000000").zero?.should == true
+    BigDecimal("0").zero?.should == true
+    BigDecimal("0E0").zero?.should == true
+    BigDecimal("+0").zero?.should == true
+    BigDecimal("-0").zero?.should == true
+  end
+
+  it "returns false otherwise" do
+    BigDecimal("0000000001").zero?.should == false
+    BigDecimal("2E40001").zero?.should == false
+    BigDecimal("3E-20001").zero?.should == false
+    BigDecimal("Infinity").zero?.should == false
+    BigDecimal("-Infinity").zero?.should == false
+    BigDecimal("NaN").zero?.should == false
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/domain_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/domain_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/domain_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::Cookie#domain" do
+  it "returns self's domain" do
+    cookie = CGI::Cookie.new("test-cookie")
+    cookie.domain.should be_nil
+    
+    cookie = CGI::Cookie.new("name" => "test-cookie", "domain" => "example.com")
+    cookie.domain.should == "example.com"
+  end
+end
+
+describe "CGI::Cookie#domain=" do
+  it "sets self's domain" do
+    cookie = CGI::Cookie.new("test-cookie")
+    cookie.domain = "test.com"
+    cookie.domain.should == "test.com"
+    
+    cookie.domain = "example.com"
+    cookie.domain.should == "example.com"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/expires_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/expires_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/expires_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::Cookie#expires" do
+  it "returns self's expiration date" do
+    cookie = CGI::Cookie.new("test-cookie")
+    cookie.expires.should be_nil
+    
+    cookie = CGI::Cookie.new("name" => "test-cookie", "expires" => Time.at(1196524602))
+    cookie.expires.should == Time.at(1196524602)
+  end
+end
+
+describe "CGI::Cookie#expires=" do
+  it "sets self's expiration date" do
+    cookie = CGI::Cookie.new("test-cookie")
+    cookie.expires = Time.at(1196524602)
+    cookie.expires.should == Time.at(1196524602)
+    
+    cookie.expires = Time.at(1196525000)
+    cookie.expires.should == Time.at(1196525000)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,147 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::Cookie#initialize when passed String" do
+  before(:each) do
+    @cookie = CGI::Cookie.allocate
+  end
+  
+  it "sets the self's name to the passed String" do
+    @cookie.send(:initialize, "test-cookie")
+    @cookie.name.should == "test-cookie"
+  end
+  
+  it "sets the self's value to an empty Array" do
+    @cookie.send(:initialize, "test-cookie")
+    @cookie.value.should == []
+  end
+  
+  it "sets self to a non-secure cookie" do
+    @cookie.send(:initialize, "test")
+    @cookie.secure.should be_false
+  end
+  
+  it "does set self's path to an empty String when ENV[\"SCRIPT_NAME\"] is not set" do
+    @cookie.send(:initialize, "test-cookie")
+    @cookie.path.should == ""
+  end
+
+  it "does set self's path based on ENV[\"SCRIPT_NAME\"] when ENV[\"SCRIPT_NAME\"] is set" do
+    old_script_name = ENV["SCRIPT_NAME"]
+
+    begin
+      ENV["SCRIPT_NAME"] = "some/path/script.rb"
+      @cookie.send(:initialize, "test-cookie")
+      @cookie.path.should == "some/path/"
+
+      ENV["SCRIPT_NAME"] = "script.rb"
+      @cookie.send(:initialize, "test-cookie")
+      @cookie.path.should == ""
+
+      ENV["SCRIPT_NAME"] = nil
+      @cookie.send(:initialize, "test-cookie")
+      @cookie.path.should == ""
+    ensure
+      ENV["SCRIPT_NAME"] = old_script_name
+    end
+  end
+  
+  it "does not set self's expiration date" do
+    @cookie.expires.should be_nil
+  end
+  
+  it "does not set self's domain" do
+    @cookie.domain.should be_nil
+  end
+end
+
+describe "CGI::Cookie#initialize when passed Hash" do
+  before(:each) do
+    @cookie = CGI::Cookie.allocate
+  end
+  
+  it "sets self's contents based on the passed Hash" do
+    @cookie.send(:initialize,
+      'name'    => 'test-cookie',
+      'value'   => ["one", "two", "three"],
+      'path'    => 'some/path/',
+      'domain'  => 'example.com',
+      'expires' => Time.at(1196524602),
+      'secure'  => true)
+    
+    @cookie.name.should == "test-cookie"
+    @cookie.value.should == ["one", "two", "three"]
+    @cookie.path.should == "some/path/"
+    @cookie.domain.should == "example.com"
+    @cookie.expires.should == Time.at(1196524602)
+    @cookie.secure.should be_true
+  end
+
+  it "does set self's path based on ENV[\"SCRIPT_NAME\"] when the Hash has no 'path' entry" do
+    old_script_name = ENV["SCRIPT_NAME"]
+
+    begin
+      ENV["SCRIPT_NAME"] = "some/path/script.rb"
+      @cookie.send(:initialize, 'name' => 'test-cookie')
+      @cookie.path.should == "some/path/"
+
+      ENV["SCRIPT_NAME"] = "script.rb"
+      @cookie.send(:initialize, 'name' => 'test-cookie')
+      @cookie.path.should == ""
+
+      ENV["SCRIPT_NAME"] = nil
+      @cookie.send(:initialize, 'name' => 'test-cookie')
+      @cookie.path.should == ""
+    ensure
+      ENV["SCRIPT_NAME"] = old_script_name
+    end
+  end
+  
+  it "tries to convert the Hash's 'value' to an Array using #Array" do
+    obj = mock("Converted To Array")
+    obj.should_receive(:to_ary).and_return(["1", "2", "3"])
+    @cookie.send(:initialize,
+      'name'  => 'test-cookie',
+      'value' => obj)
+    @cookie.value.should == [ "1", "2", "3" ]
+
+    obj = mock("Converted To Array")
+    obj.should_receive(:to_a).and_return(["one", "two", "three"])
+    @cookie.send(:initialize,
+      'name'  => 'test-cookie',
+      'value' => obj)
+    @cookie.value.should == [ "one", "two", "three" ]
+
+    obj = mock("Put into an Array")
+    @cookie.send(:initialize,
+      'name'  => 'test-cookie',
+      'value' => obj)
+    @cookie.value.should == [ obj ]
+  end
+
+  it "raises a ArgumentError when the passed Hash has no 'name' entry" do
+    lambda { @cookie.send(:initialize, {}) }.should raise_error(ArgumentError)
+    lambda { @cookie.send(:initialize, "value" => "test") }.should raise_error(ArgumentError)
+  end
+end
+
+describe "CGI::Cookie#initialize when passed String, values ..." do
+  before(:each) do
+    @cookie = CGI::Cookie.allocate
+  end
+  
+  it "sets the self's name to the passed String" do
+    @cookie.send(:initialize, "test-cookie", "one", "two", "three")
+    @cookie.name.should == "test-cookie"
+  end
+  
+  it "sets the self's value to an Array containing all passed values" do
+    @cookie.send(:initialize, "test-cookie", "one", "two", "three")
+    @cookie.value.should == ["one", "two", "three"]
+  end
+  
+  it "sets self to a non-secure cookie" do
+    @cookie.send(:initialize, "test", "one", "two", "three")
+    @cookie.secure.should be_false
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/name_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/name_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/name_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::Cookie#name" do
+  it "returns self's name" do
+    cookie = CGI::Cookie.new("test-cookie")
+    cookie.name.should == "test-cookie"
+    
+    cookie = CGI::Cookie.new("name" => "another cookie")
+    cookie.name.should == "another cookie"
+  end
+end
+
+describe "CGI::Cookie#name=" do
+  it "sets self's expiration date" do
+    cookie = CGI::Cookie.new("test-cookie")
+    cookie.name = "another name"
+    cookie.name.should == "another name"
+    
+    cookie.name = "and one more"
+    cookie.name.should == "and one more"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/parse_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/parse_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/parse_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::Cookie.parse" do
+  it "parses a raw cookie string into a hash of Cookies" do
+    expected = { "test-cookie" => ["one", "two", "three"] }
+    CGI::Cookie.parse("test-cookie=one&two&three").should == expected
+    
+    expected = { "second cookie" => ["three", "four"], "first cookie" => ["one", "two"] }
+    CGI::Cookie.parse("first cookie=one&two;second cookie=three&four").should == expected
+  end
+  
+  it "unescapes the Cookie values" do
+    cookie = "test-cookie=+%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D%7E"
+    expected = { "test-cookie" => [ " !\"\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ] }
+    CGI::Cookie.parse(cookie).should == expected
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/path_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/path_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/path_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::Cookie#path" do
+  it "returns self's path" do
+    cookie = CGI::Cookie.new("test-cookie")
+    cookie.path.should == ""
+    
+    cookie = CGI::Cookie.new("name" => "test-cookie", "path" => "/some/path/")
+    cookie.path.should == "/some/path/"
+  end
+end
+
+describe "CGI::Cookie#path=" do
+  it "sets self's path" do
+    cookie = CGI::Cookie.new("test-cookie")
+    cookie.path = "/some/path/"
+    cookie.path.should == "/some/path/"
+    
+    cookie.path = "/another/path/"
+    cookie.path.should == "/another/path/"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/secure_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/secure_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/secure_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,70 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::Cookie#secure" do
+  before(:each) do
+    @cookie = CGI::Cookie.new("test-cookie")
+  end
+  
+  it "returns whether self is a secure cookie or not" do
+    @cookie.secure = true
+    @cookie.secure.should be_true
+    
+    @cookie.secure = false
+    @cookie.secure.should be_false
+  end
+end
+
+describe "CGI::Cookie#secure= when passed true" do
+  before(:each) do
+    @cookie = CGI::Cookie.new("test-cookie")
+  end
+  
+  it "returns true" do
+    (@cookie.secure = true).should be_true
+  end
+  
+  it "sets self to a secure cookie" do
+    @cookie.secure = true
+    @cookie.secure.should be_true
+  end
+end
+
+describe "CGI::Cookie#secure= when passed false" do
+  before(:each) do
+    @cookie = CGI::Cookie.new("test-cookie")
+  end
+
+  it "returns false" do
+    (@cookie.secure = false).should be_false
+  end
+  
+  it "sets self to a non-secure cookie" do
+    @cookie.secure = false
+    @cookie.secure.should be_false
+  end
+end
+
+describe "CGI::Cookie#secure= when passed Object" do
+  before(:each) do
+    @cookie = CGI::Cookie.new("test-cookie")
+  end
+
+  it "does not change self's secure value" do
+    @cookie.secure = false
+    
+    @cookie.secure = Object.new
+    @cookie.secure.should be_false
+    
+    @cookie.secure = "Test"
+    @cookie.secure.should be_false
+
+    @cookie.secure = true
+    
+    @cookie.secure = Object.new
+    @cookie.secure.should be_true
+    
+    @cookie.secure = "Test"
+    @cookie.secure.should be_true
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::Cookie#to_s" do
+  it "returns a String representation of self" do
+    cookie = CGI::Cookie.new("test-cookie")
+    cookie.to_s.should == "test-cookie=; path="
+    
+    cookie = CGI::Cookie.new("test-cookie", "value")
+    cookie.to_s.should == "test-cookie=value; path="
+    
+    cookie = CGI::Cookie.new("test-cookie", "one", "two", "three")
+    cookie.to_s.should == "test-cookie=one&two&three; path="
+
+    cookie = CGI::Cookie.new(
+      'name'    => 'test-cookie',
+      'value'   => ["one", "two", "three"],
+      'path'    => 'some/path/',
+      'domain'  => 'example.com',
+      'expires' => Time.at(1196524602),
+      'secure'  => true)
+    cookie.to_s.should == "test-cookie=one&two&three; domain=example.com; path=some/path/; expires=Sat, 01 Dec 2007 15:56:42 GMT; secure"
+  end
+  
+  it "escapes the self's values" do
+    cookie = CGI::Cookie.new("test-cookie", " !\"\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~")
+    cookie.to_s.should == "test-cookie=+%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D%7E; path="
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/cookie/value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,56 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::Cookie#value" do
+  it "returns self's value" do
+    cookie = CGI::Cookie.new("test-cookie")
+    cookie.value.should == []
+
+    cookie = CGI::Cookie.new("test-cookie", "one")
+    cookie.value.should == ["one"]
+    
+    cookie = CGI::Cookie.new("test-cookie", "one", "two", "three")
+    cookie.value.should == ["one", "two", "three"]
+    
+    cookie = CGI::Cookie.new("name" => "test-cookie", "value" => ["one", "two", "three"])
+    cookie.value.should == ["one", "two", "three"]
+  end
+end
+
+describe "CGI::Cookie#value=" do
+  before(:each) do
+    @cookie = CGI::Cookie.new("test-cookie")
+  end
+  
+  it "sets self's value" do
+    @cookie.value = ["one"]
+    @cookie.value.should == ["one"]
+    
+    @cookie.value = ["one", "two", "three"]
+    @cookie.value.should == ["one", "two", "three"]
+  end
+  
+  ruby_bug "http://redmine.ruby-lang.org/issues/show/229", "1.8.7" do
+    it "automatically converts the passed Object to an Array using #Array" do
+      @cookie.value = "test"
+      @cookie.value.should == ["test"]
+      
+      obj = mock("to_a")
+      obj.should_receive(:to_a).and_return(["1", "2"])
+      @cookie.value = obj
+      @cookie.value.should == ["1", "2"]
+
+      obj = mock("to_ary")
+      obj.should_receive(:to_ary).and_return(["1", "2"])
+      @cookie.value = obj
+      @cookie.value.should == ["1", "2"]
+    end
+    
+    it "does keep self and the values in sync" do
+      @cookie.value = ["one", "two", "three"]
+      @cookie[0].should == "one"
+      @cookie[1].should == "two"
+      @cookie[2].should == "three"
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/escapeElement_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/escapeElement_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/escapeElement_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'cgi'
+
+describe "CGI.escapeElement when passed String, elements, ..." do
+  it "escapes only the tags of the passed elements in the passed String" do
+    res = CGI.escapeElement('<BR><A HREF="url"></A>', "A", "IMG")
+    res.should == "<BR>&lt;A HREF=&quot;url&quot;&gt;&lt;/A&gt;"
+    
+    res = CGI.escapeElement('<BR><A HREF="url"></A>', ["A", "IMG"])
+    res.should == "<BR>&lt;A HREF=&quot;url&quot;&gt;&lt;/A&gt;"
+  end
+  
+  it "is case-insensitive" do
+    res = CGI.escapeElement('<BR><A HREF="url"></A>', "a", "img")
+    res.should == '<BR>&lt;A HREF=&quot;url&quot;&gt;&lt;/A&gt;'
+
+    res = CGI.escapeElement('<br><a href="url"></a>', "A", "IMG")
+    res.should == '<br>&lt;a href=&quot;url&quot;&gt;&lt;/a&gt;'
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/escapeHTML_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/escapeHTML_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/escapeHTML_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'cgi'
+
+describe "CGI.escapeHTML" do
+  it "escapes special HTML characters (&\"<>) in the passed argument" do
+    CGI.escapeHTML('& < > "').should == '&amp; &lt; &gt; &quot;'
+  end
+  
+  it "does not escape any other characters" do
+    chars = " !\#$%'()*+,-./0123456789:;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
+    CGI.escapeHTML(chars).should == chars
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/escape_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/escape_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/escape_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'cgi'
+
+describe "CGI.escape" do
+  it "url-encodes the passed argument" do
+    input    = " !\"\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
+    expected = "+%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D%7E"
+    CGI.escape(input).should == expected
+    
+    input = "http://ja.wikipedia.org/wiki/\343\203\255\343\203\240\343\202\271\343\202\253\343\203\273\343\203\221\343\203\255\343\203\273\343\202\246\343\203\253\343\203\273\343\203\251\343\203\224\343\203\245\343\202\277"
+    expected = 'http%3A%2F%2Fja.wikipedia.org%2Fwiki%2F%E3%83%AD%E3%83%A0%E3%82%B9%E3%82%AB%E3%83%BB%E3%83%91%E3%83%AD%E3%83%BB%E3%82%A6%E3%83%AB%E3%83%BB%E3%83%A9%E3%83%94%E3%83%A5%E3%82%BF'
+    CGI.escape(input).should == expected
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/header_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/header_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/header_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,110 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'cgi'
+
+describe "CGI#header when passed no arguments" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+
+  
+  it "returns a HTML header specifiying the Content-Type as text/html" do
+    @cgi.header.should == "Content-Type: text/html\r\n\r\n"
+  end
+
+  it "includes Cookies in the @output_cookies field" do
+    @cgi.instance_variable_set(:@output_cookies, ["multiple", "cookies"])
+    @cgi.header.should == "Content-Type: text/html\r\nSet-Cookie: multiple\r\nSet-Cookie: cookies\r\n\r\n" 
+  end
+end
+
+describe "CGI#header when passed String" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+
+  
+  it "returns a HTML header specifiying the Content-Type as the passed String's content" do
+    @cgi.header("text/plain").should == "Content-Type: text/plain\r\n\r\n"
+  end
+
+  it "includes Cookies in the @output_cookies field" do
+    @cgi.instance_variable_set(:@output_cookies, ["multiple", "cookies"])
+    @cgi.header("text/plain").should == "Content-Type: text/plain\r\nSet-Cookie: multiple\r\nSet-Cookie: cookies\r\n\r\n" 
+  end
+end
+
+describe "CGI#header when passed Hash" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+
+
+  it "returns a HTML header based on the Hash's key/value pairs" do
+    header = @cgi.header("type" => "text/plain")
+    header.should == "Content-Type: text/plain\r\n\r\n"
+    
+    header = @cgi.header("type" => "text/plain", "charset" => "UTF-8")
+    header.should == "Content-Type: text/plain; charset=UTF-8\r\n\r\n"
+    
+    header = @cgi.header("nph" => true)
+    header.should include("HTTP/1.0 200 OK\r\n")
+    header.should include("Date: ")
+    header.should include("Server: ")
+    header.should include("Connection: close\r\n")
+    header.should include("Content-Type: text/html\r\n")
+    
+    header = @cgi.header("status" => "OK")
+    header.should == "Status: 200 OK\r\nContent-Type: text/html\r\n\r\n"
+
+    header = @cgi.header("status" => "PARTIAL_CONTENT")
+    header.should == "Status: 206 Partial Content\r\nContent-Type: text/html\r\n\r\n"
+
+    header = @cgi.header("status" => "MULTIPLE_CHOICES")
+    header.should == "Status: 300 Multiple Choices\r\nContent-Type: text/html\r\n\r\n"
+  
+    header = @cgi.header("server" => "Server Software used")
+    header.should == "Server: Server Software used\r\nContent-Type: text/html\r\n\r\n"
+  
+    header = @cgi.header("connection" => "connection type")
+    header.should == "Connection: connection type\r\nContent-Type: text/html\r\n\r\n"
+  
+    header = @cgi.header("length" => 103)
+    header.should == "Content-Type: text/html\r\nContent-Length: 103\r\n\r\n"
+
+    header = @cgi.header("language" => "ja")
+    header.should == "Content-Type: text/html\r\nContent-Language: ja\r\n\r\n"
+
+    header = @cgi.header("expires" => Time.at(0))
+    header.should == "Content-Type: text/html\r\nExpires: Thu, 01 Jan 1970 00:00:00 GMT\r\n\r\n"
+
+    header = @cgi.header("cookie" => "my cookie's content")
+    header.should == "Content-Type: text/html\r\nSet-Cookie: my cookie's content\r\n\r\n"
+
+    header = @cgi.header("cookie" => ["multiple", "cookies"])
+    header.should == "Content-Type: text/html\r\nSet-Cookie: multiple\r\nSet-Cookie: cookies\r\n\r\n"
+  end
+  
+  it "includes Cookies in the @output_cookies field" do
+    @cgi.instance_variable_set(:@output_cookies, ["multiple", "cookies"])
+    @cgi.header({}).should == "Content-Type: text/html\r\nSet-Cookie: multiple\r\nSet-Cookie: cookies\r\n\r\n" 
+  end
+  
+  it "returns a HTML header specifiying the Content-Type as text/html when passed an empty Hash" do
+    @cgi.header({}).should == "Content-Type: text/html\r\n\r\n"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/html3/doctype_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/html3/doctype_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/html3/doctype_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::Html3#doctype" do
+  before(:each) do
+    @html = Object.new
+    @html.extend(CGI::Html3)
+  end
+  
+  it "returns the doctype declaration for HTML3" do
+    @html.doctype.should == '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">'
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/html3/element_init_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/html3/element_init_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/html3/element_init_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::Html3#element_init" do
+  before(:each) do
+    @html = Object.new
+    @html.extend(CGI::Html3)
+  end
+
+  it "initializes the HTML Generation methods for HTML3" do
+    @html.respond_to?("a").should be_false
+    @html.element_init
+    @html.respond_to?("a").should be_true
+    
+    @html.a.should == "<A></A>"
+    @html.a { "link text" }.should == "<A>link text</A>"
+    
+    @html.br.should == "<BR>"
+    
+    @html.html.should == "<HTML>"
+    @html.html { "html body" }.should == "<HTML>html body</HTML>"
+  end
+
+  it "should extend self with CGI::TagMaker" do
+    @html.should_not be_kind_of(CGI::TagMaker)
+    @html.element_init
+    @html.should be_kind_of(CGI::TagMaker)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/html4/doctype_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/html4/doctype_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/html4/doctype_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::Html4#doctype" do
+  before(:each) do
+    @html = Object.new
+    @html.extend(CGI::Html4)
+  end
+  
+  it "returns the doctype declaration for HTML4" do
+    @html.doctype.should == '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">'
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/html4/element_init_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/html4/element_init_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/html4/element_init_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::Html4#element_init" do
+  before(:each) do
+    @html = Object.new
+    @html.extend(CGI::Html4)
+  end
+
+  it "initializes the HTML Generation methods for HTML4" do
+    @html.respond_to?("a").should be_false
+    @html.element_init
+    @html.respond_to?("a").should be_true
+    
+    @html.a.should == "<A></A>"
+    @html.a { "link text" }.should == "<A>link text</A>"
+    
+    @html.br.should == "<BR>"
+    
+    @html.html.should == "<HTML>"
+    @html.html { "html body" }.should == "<HTML>html body</HTML>"
+  end
+
+  it "should extend self with CGI::TagMaker" do
+    @html.should_not be_kind_of(CGI::TagMaker)
+    @html.element_init
+    @html.should be_kind_of(CGI::TagMaker)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/html4fr/doctype_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/html4fr/doctype_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/html4fr/doctype_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::Html4Fr#doctype" do
+  before(:each) do
+    @html = Object.new
+    @html.extend(CGI::Html4Fr)
+  end
+  
+  it "returns the doctype declaration for the Frameset version of HTML4" do
+    @html.doctype.should == '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">'
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/html4fr/element_init_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/html4fr/element_init_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/html4fr/element_init_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::Html4Fr#element_init" do
+  before(:each) do
+    @html = Object.new
+    @html.extend(CGI::Html4)
+    @html.element_init
+    
+    @html.extend(CGI::Html4Fr)
+  end
+
+  it "initializes the HTML Generation methods for the Frameset version of HTML4" do
+    @html.respond_to?("frameset").should be_false
+    @html.element_init
+    @html.respond_to?("frameset").should be_true
+    
+    @html.frameset.should == "<FRAMESET></FRAMESET>"
+    @html.frameset { "link text" }.should == "<FRAMESET>link text</FRAMESET>"
+    
+    @html.frame.should == "<FRAME>"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/html4tr/doctype_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/html4tr/doctype_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/html4tr/doctype_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::Html4Tr#doctype" do
+  before(:each) do
+    @html = Object.new
+    @html.extend(CGI::Html4Tr)
+  end
+  
+  it "returns the doctype declaration for the Transitional version of HTML4" do
+    @html.doctype.should == '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/html4tr/element_init_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/html4tr/element_init_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/html4tr/element_init_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::Html4Tr#element_init" do
+  before(:each) do
+    @html = Object.new
+    @html.extend(CGI::Html4Tr)
+  end
+
+  it "initializes the HTML Generation methods for HTML4" do
+    @html.respond_to?("a").should be_false
+    @html.element_init
+    @html.respond_to?("a").should be_true
+    
+    @html.a.should == "<A></A>"
+    @html.a { "link text" }.should == "<A>link text</A>"
+    
+    @html.br.should == "<BR>"
+    
+    @html.html.should == "<HTML>"
+    @html.html { "html body" }.should == "<HTML>html body</HTML>"
+  end
+
+  it "should extend self with CGI::TagMaker" do
+    @html.should_not be_kind_of(CGI::TagMaker)
+    @html.element_init
+    @html.should be_kind_of(CGI::TagMaker)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/a_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/a_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/a_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/fixtures/common"
+
+describe "CGI::HtmlExtension#a" do
+  before(:each) do
+    @html = CGISpecs::HtmlExtension.new
+  end
+  
+  describe "when passed a String" do
+    it "returns an 'a'-element, using the passed String as the 'href'-attribute" do
+      output = @html.a("http://www.example.com")
+      output.should equal_element("A", "HREF" => "http://www.example.com")
+    end
+  
+    it "includes the passed block's return value when passed a block" do
+      output = @html.a("http://www.example.com") { "Example" }
+      output.should equal_element("A", { "HREF" => "http://www.example.com" }, "Example")
+    end
+  end
+  
+  describe "when passed a Hash" do
+    it "returns an 'a'-element, using the passed Hash for attributes" do
+      attributes = {"HREF" => "http://www.example.com", "TARGET" => "_top"}
+      @html.a(attributes).should equal_element("A", attributes)
+    end
+
+    it "includes the passed block's return value when passed a block" do
+      attributes = {"HREF" => "http://www.example.com", "TARGET" => "_top"}
+      @html.a(attributes) { "Example" }.should equal_element("A", attributes, "Example")
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/base_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/base_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/base_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/fixtures/common"
+
+describe "CGI::HtmlExtension#base" do
+  before(:each) do
+    @html = CGISpecs::HtmlExtension.new
+  end
+  
+  describe "when bassed a String" do
+    it "returns a 'base'-element, using the passed String as the 'href'-attribute" do
+      output = @html.base("http://www.example.com")
+      output.should equal_element("BASE", {"HREF" => "http://www.example.com"}, nil, :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.base("http://www.example.com") { "Example" }
+      output.should equal_element("BASE", {"HREF" => "http://www.example.com"}, nil, :not_closed => true)
+    end
+  end
+  
+  describe "when passed a Hash" do
+    it "returns a 'base'-element, using the passed Hash for attributes" do
+      output = @html.base("HREF" => "http://www.example.com", "ID" => "test")
+      output.should equal_element("BASE", {"HREF" => "http://www.example.com", "ID" => "test"}, nil, :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.base("HREF" => "http://www.example.com", "ID" => "test") { "Example" }
+      output.should equal_element("BASE", {"HREF" => "http://www.example.com", "ID" => "test"}, nil, :not_closed => true)
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/blockquote_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/blockquote_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/blockquote_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/fixtures/common"
+
+describe "CGI::HtmlExtension#blockquote" do
+  before(:each) do
+    @html = CGISpecs::HtmlExtension.new
+  end
+  
+  describe "when passed a String" do
+    it "returns a 'blockquote'-element, using the passed String for the 'cite'-attribute" do
+      output = @html.blockquote("http://www.example.com/quotes/foo.html")
+      output.should equal_element("BLOCKQUOTE", "CITE" => "http://www.example.com/quotes/foo.html")
+    end
+
+    it "includes the passed block's return value when passed a block" do
+      output = @html.blockquote("http://www.example.com/quotes/foo.html") { "Foo!" }
+      output.should equal_element("BLOCKQUOTE", { "CITE" => "http://www.example.com/quotes/foo.html" }, "Foo!")
+    end
+  end
+  
+  describe "when passed a Hash" do
+    it "returns a 'blockquote'-element, using the passed Hash for attributes" do
+      output = @html.blockquote("CITE" => "http://www.example.com/quotes/foo.html", "ID" => "test")
+      output.should equal_element("BLOCKQUOTE", "CITE" => "http://www.example.com/quotes/foo.html", "ID" => "test")
+    end
+
+    it "includes the passed block's return value when passed a block" do
+      output = @html.blockquote("CITE" => "http://www.example.com/quotes/foo.html", "ID" => "test") { "Foo!" }
+      output.should equal_element("BLOCKQUOTE", {"CITE" => "http://www.example.com/quotes/foo.html", "ID" => "test"}, "Foo!")
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/caption_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/caption_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/caption_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/fixtures/common"
+
+describe "CGI::HtmlExtension#caption" do
+  before(:each) do
+    @html = CGISpecs::HtmlExtension.new
+  end
+  
+  describe "when passed a String" do
+    it "returns a 'caption'-element, using the passed String for the 'align'-attribute" do
+      output = @html.caption("left")
+      output.should equal_element("CAPTION", "ALIGN" => "left")
+    end
+  
+    it "includes the passed block's return value when passed a block" do
+      output = @html.caption("left") { "Capital Cities" }
+      output.should equal_element("CAPTION", {"ALIGN" => "left"}, "Capital Cities")
+    end
+  end
+  
+  describe "when passed a Hash" do
+    it "returns a 'caption'-element, using the passed Hash for attributes" do
+      output = @html.caption("ALIGN" => "left", "ID" => "test")
+      output.should equal_element("CAPTION", "ALIGN" => "left", "ID" => "test")
+    end
+  
+    it "includes the passed block's return value when passed a block" do
+      output = @html.caption("ALIGN" => "left", "ID" => "test") { "Capital Cities" }
+      output.should equal_element("CAPTION", {"ALIGN" => "left", "ID" => "test"}, "Capital Cities")
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/checkbox_group_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/checkbox_group_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/checkbox_group_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,79 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/fixtures/common"
+
+describe "CGI::HtmlExtension#checkbox_group" do
+  before(:each) do
+    @html = CGISpecs::HtmlExtension.new
+  end
+
+  describe "when passed name, values ..." do
+    it "returns a sequence of 'checkbox'-elements with the passed name and the passed values" do
+      output = CGISpecs.split(@html.checkbox_group("test", "foo", "bar", "baz"))
+      output[0].should equal_element("INPUT", {"NAME" => "test", "TYPE" => "checkbox", "VALUE" => "foo"}, "foo", :not_closed => true)
+      output[1].should equal_element("INPUT", {"NAME" => "test", "TYPE" => "checkbox", "VALUE" => "bar"}, "bar", :not_closed => true)
+      output[2].should equal_element("INPUT", {"NAME" => "test", "TYPE" => "checkbox", "VALUE" => "baz"}, "baz", :not_closed => true)
+    end
+
+    it "allows passing a value inside an Array" do
+      output = CGISpecs.split(@html.checkbox_group("test", ["foo"], "bar", ["baz"]))
+      output[0].should equal_element("INPUT", {"NAME" => "test", "TYPE" => "checkbox", "VALUE" => "foo"}, "foo", :not_closed => true)
+      output[1].should equal_element("INPUT", {"NAME" => "test", "TYPE" => "checkbox", "VALUE" => "bar"}, "bar", :not_closed => true)
+      output[2].should equal_element("INPUT", {"NAME" => "test", "TYPE" => "checkbox", "VALUE" => "baz"}, "baz", :not_closed => true)
+    end
+
+    it "allows passing a value as an Array containing the value and the checked state or a label" do
+      output = CGISpecs.split(@html.checkbox_group("test", ["foo"], ["bar", true], ["baz", "label for baz"]))
+      output[0].should equal_element("INPUT", {"NAME" => "test", "TYPE" => "checkbox", "VALUE" => "foo"}, "foo", :not_closed => true)
+      output[1].should equal_element("INPUT", {"CHECKED" => true, "NAME" => "test", "TYPE" => "checkbox", "VALUE" => "bar"}, "bar", :not_closed => true)
+      output[2].should equal_element("INPUT", {"NAME" => "test", "TYPE" => "checkbox", "VALUE" => "baz"}, "label for baz", :not_closed => true)
+    end
+
+    # TODO: CGI does not like passing false instead of true.
+    ruby_bug "http://redmine.ruby-lang.org/issues/show/443", "1.8.7" do
+      it "allows passing a value as an Array containing the value, a label and the checked state" do
+        output = CGISpecs.split(@html.checkbox_group("test", ["foo", "label for foo", true], ["bar", "label for bar", false], ["baz", "label for baz", true]))
+        output[0].should equal_element("INPUT", {"CHECKED" => true, "NAME" => "test", "TYPE" => "checkbox", "VALUE" => "foo"}, "label for foo", :not_closed => true)
+        output[1].should equal_element("INPUT", {"NAME" => "test", "TYPE" => "checkbox", "VALUE" => "bar"}, "label for bar", :not_closed => true)
+        output[2].should equal_element("INPUT", {"CHECKED" => true, "NAME" => "test", "TYPE" => "checkbox", "VALUE" => "baz"}, "label for baz", :not_closed => true)
+      end
+    end
+
+    it "returns an empty String when passed no values" do
+      @html.checkbox_group("test").should == ""
+    end
+
+    it "ignores a passed block" do
+      output = CGISpecs.split(@html.checkbox_group("test", "foo", "bar", "baz") { "test" })
+      output[0].should equal_element("INPUT", {"NAME" => "test", "TYPE" => "checkbox", "VALUE" => "foo"}, "foo", :not_closed => true)
+      output[1].should equal_element("INPUT", {"NAME" => "test", "TYPE" => "checkbox", "VALUE" => "bar"}, "bar", :not_closed => true)
+      output[2].should equal_element("INPUT", {"NAME" => "test", "TYPE" => "checkbox", "VALUE" => "baz"}, "baz", :not_closed => true)
+    end
+  end
+
+  describe "when passed Hash" do
+    it "uses the passed Hash to generate the checkbox sequence" do
+      output = CGISpecs.split(@html.checkbox_group("NAME" => "name", "VALUES" => ["foo", "bar", "baz"]))
+      output[0].should equal_element("INPUT", {"NAME" => "name", "TYPE" => "checkbox", "VALUE" => "foo"}, "foo", :not_closed => true)
+      output[1].should equal_element("INPUT", {"NAME" => "name", "TYPE" => "checkbox", "VALUE" => "bar"}, "bar", :not_closed => true)
+      output[2].should equal_element("INPUT", {"NAME" => "name", "TYPE" => "checkbox", "VALUE" => "baz"}, "baz", :not_closed => true)
+
+      output = CGISpecs.split(@html.checkbox_group("NAME" => "name", "VALUES" => [["foo"], ["bar", true], "baz"]))
+      output[0].should equal_element("INPUT", {"NAME" => "name", "TYPE" => "checkbox", "VALUE" => "foo"}, "foo", :not_closed => true)
+      output[1].should equal_element("INPUT", {"CHECKED" => true, "NAME" => "name", "TYPE" => "checkbox", "VALUE" => "bar"}, "bar", :not_closed => true)
+      output[2].should equal_element("INPUT", {"NAME" => "name", "TYPE" => "checkbox", "VALUE" => "baz"}, "baz", :not_closed => true)
+
+      output = CGISpecs.split(@html.checkbox_group("NAME" => "name", "VALUES" => [["1", "Foo"], ["2", "Bar", true], "Baz"]))
+      output[0].should equal_element("INPUT", {"NAME" => "name", "TYPE" => "checkbox", "VALUE" => "1"}, "Foo", :not_closed => true)
+      output[1].should equal_element("INPUT", {"CHECKED" => true, "NAME" => "name", "TYPE" => "checkbox", "VALUE" => "2"}, "Bar", :not_closed => true)
+      output[2].should equal_element("INPUT", {"NAME" => "name", "TYPE" => "checkbox", "VALUE" => "Baz"}, "Baz", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = CGISpecs.split(@html.checkbox_group("NAME" => "name", "VALUES" => ["foo", "bar", "baz"]) { "test" })
+      output[0].should equal_element("INPUT", {"NAME" => "name", "TYPE" => "checkbox", "VALUE" => "foo"}, "foo", :not_closed => true)
+      output[1].should equal_element("INPUT", {"NAME" => "name", "TYPE" => "checkbox", "VALUE" => "bar"}, "bar", :not_closed => true)
+      output[2].should equal_element("INPUT", {"NAME" => "name", "TYPE" => "checkbox", "VALUE" => "baz"}, "baz", :not_closed => true)
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/checkbox_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/checkbox_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/checkbox_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,77 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/fixtures/common"
+
+describe "CGI::HtmlExtension#checkbox" do
+  before(:each) do
+    @html = CGISpecs::HtmlExtension.new
+  end
+
+  describe "when passed no arguments" do
+    it "returns a checkbox-'input'-element without a name" do
+      output = @html.checkbox
+      output.should equal_element("INPUT", {"NAME" => "", "TYPE" => "checkbox"}, "", :not_closed => true)
+    end
+    
+    it "ignores a passed block" do
+      output = @html.checkbox { "test" }
+      output.should equal_element("INPUT", {"NAME" => "", "TYPE" => "checkbox"}, "", :not_closed => true)
+    end
+  end
+  
+  describe "when passed name" do
+    it "returns a checkbox-'input'-element with the passed name" do
+      output = @html.checkbox("test")
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "checkbox"}, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.checkbox("test") { "test" }
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "checkbox"}, "", :not_closed => true)
+    end
+  end
+
+  describe "CGI::HtmlExtension#checkbox when passed name, value" do
+    it "returns a checkbox-'input'-element with the passed name and value" do
+      output = @html.checkbox("test", "test-value")
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "checkbox", "VALUE" => "test-value"}, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.checkbox("test", "test-value") { "test" }
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "checkbox", "VALUE" => "test-value"}, "", :not_closed => true)
+    end
+  end
+
+  describe "when passed name, value, checked" do
+    it "returns a checked checkbox-'input'-element with the passed name and value when checked is true" do
+      output = @html.checkbox("test", "test-value", true)
+      output.should equal_element("INPUT", {"CHECKED" => true, "NAME" => "test", "TYPE" => "checkbox", "VALUE" => "test-value"}, "", :not_closed => true)
+      
+      output = @html.checkbox("test", "test-value", false)
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "checkbox", "VALUE" => "test-value"}, "", :not_closed => true)
+      
+      output = @html.checkbox("test", "test-value", nil)
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "checkbox", "VALUE" => "test-value"}, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.checkbox("test", "test-value", nil) { "test" }
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "checkbox", "VALUE" => "test-value"}, "", :not_closed => true)
+    end
+  end
+
+  describe "when passed Hash" do
+    it "returns a checkbox-'input'-element using the passed Hash for attributes" do
+      attributes = {"NAME" => "test", "VALUE" => "test-value", "CHECKED" => true}
+      output = @html.checkbox(attributes)
+      output.should equal_element("INPUT", attributes, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      attributes = {"NAME" => "test", "VALUE" => "test-value", "CHECKED" => true}
+      output = @html.checkbox(attributes) { "test" }
+      output.should equal_element("INPUT", attributes, "", :not_closed => true)
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/file_field_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/file_field_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/file_field_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,74 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/fixtures/common"
+
+describe "CGI::HtmlExtension#file_field" do
+  before(:each) do
+    @html = CGISpecs::HtmlExtension.new
+  end
+  
+  describe "when passed no arguments" do
+    it "returns a file-'input'-element without a name and a size of 20" do
+      output = @html.file_field
+      output.should equal_element("INPUT", {"SIZE" => 20, "NAME" => "", "TYPE" => "file"}, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.file_field { "test" }
+      output.should equal_element("INPUT", {"SIZE" => 20, "NAME" => "", "TYPE" => "file"}, "", :not_closed => true)
+    end
+  end
+  
+  describe "when passed name" do
+    it "returns a checkbox-'input'-element with the passed name" do
+      output = @html.file_field("Example")
+      output.should equal_element("INPUT", {"SIZE" => 20, "NAME" => "Example", "TYPE" => "file"}, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.file_field("Example") { "test" }
+      output.should equal_element("INPUT", {"SIZE" => 20, "NAME" => "Example", "TYPE" => "file"}, "", :not_closed => true)
+    end
+  end
+  
+  describe "when passed name, size" do
+    it "returns a checkbox-'input'-element with the passed name and size" do
+      output = @html.file_field("Example", 40)
+      output.should equal_element("INPUT", {"SIZE" => 40, "NAME" => "Example", "TYPE" => "file"}, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.file_field("Example", 40) { "test" }
+      output.should equal_element("INPUT", {"SIZE" => 40, "NAME" => "Example", "TYPE" => "file"}, "", :not_closed => true)
+    end
+  end
+  
+  describe "when passed name, size, maxlength" do
+    it "returns a checkbox-'input'-element with the passed name, size and maxlength" do
+      output = @html.file_field("Example", 40, 100)
+      output.should equal_element("INPUT", {"SIZE" => 40, "NAME" => "Example", "TYPE" => "file", "MAXLENGTH" => 100}, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.file_field("Example", 40, 100) { "test" }
+      output.should equal_element("INPUT", {"SIZE" => 40, "NAME" => "Example", "TYPE" => "file", "MAXLENGTH" => 100}, "", :not_closed => true)
+    end
+  end
+  
+  describe "when passed a Hash" do
+    ruby_bug "http://redmine.ruby-lang.org/issues/show/255", "1.8.7" do
+      it "returns a file-'input'-element using the passed Hash for attributes" do
+        output = @html.file_field("NAME" => "test", "SIZE" => 40)
+        output.should equal_element("INPUT", {"NAME" => "test", "SIZE" => 40}, "", :not_closed => true)
+        
+        output = @html.file_field("NAME" => "test", "MAXLENGTH" => 100)
+        output.should equal_element("INPUT", {"NAME" => "test", "MAXLENGTH" => 100}, "", :not_closed => true)
+      end
+
+      it "ignores a passed block" do
+        output = @html.file_field("NAME" => "test", "SIZE" => 40) { "test" }
+        output.should equal_element("INPUT", {"NAME" => "test", "SIZE" => 40}, "", :not_closed => true)
+      end
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/fixtures/common.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/fixtures/common.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/fixtures/common.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+module CGISpecs
+  class HtmlExtension
+    def initialize
+      self.extend(CGI::Html4)
+      self.element_init
+      self.extend(CGI::HtmlExtension)
+    end
+  end
+  
+  def self.split(string)
+    string.split("<").reject { |x| x.empty? }.map { |x| "<#{x}" }
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/form_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/form_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/form_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,58 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/fixtures/common"
+
+describe "CGI::HtmlExtension#form" do
+  before(:each) do
+    @html = CGISpecs::HtmlExtension.new
+    @html.stub!(:script_name).and_return("/path/to/some/script")
+  end
+  
+  describe "when passed no arguments" do
+    it "returns a 'form'-element" do
+      output = @html.form
+      output.should equal_element("FORM", {"ENCTYPE" => "application/x-www-form-urlencoded", "METHOD" => "post", "ACTION" => "/path/to/some/script"}, "")
+    end
+
+    it "includes the return value of the passed block when passed a block" do
+      output = @html.form { "test" }
+      output.should equal_element("FORM", {"ENCTYPE" => "application/x-www-form-urlencoded", "METHOD" => "post", "ACTION" => "/path/to/some/script"}, "test")
+    end
+  end
+
+  describe "when passed method" do
+    it "returns a 'form'-element with the passed method" do
+      output = @html.form("get")
+      output.should equal_element("FORM", {"ENCTYPE" => "application/x-www-form-urlencoded", "METHOD" => "get", "ACTION" => "/path/to/some/script"}, "")
+    end
+
+    it "includes the return value of the passed block when passed a block" do
+      output = @html.form("get") { "test" }
+      output.should equal_element("FORM", {"ENCTYPE" => "application/x-www-form-urlencoded", "METHOD" => "get", "ACTION" => "/path/to/some/script"}, "test")
+    end
+  end
+
+  describe "when passed method, action" do
+    it "returns a 'form'-element with the passed method and the passed action" do
+      output = @html.form("get", "/some/other/script")
+      output.should equal_element("FORM", {"ENCTYPE" => "application/x-www-form-urlencoded", "METHOD" => "get", "ACTION" => "/some/other/script"}, "")
+    end
+
+    it "includes the return value of the passed block when passed a block" do
+      output = @html.form("get", "/some/other/script") { "test" }
+      output.should equal_element("FORM", {"ENCTYPE" => "application/x-www-form-urlencoded", "METHOD" => "get", "ACTION" => "/some/other/script"}, "test")
+    end
+  end
+
+  describe "when passed method, action, enctype" do
+    it "returns a 'form'-element with the passed method, action and enctype" do
+      output = @html.form("get", "/some/other/script", "multipart/form-data")
+      output.should equal_element("FORM", {"ENCTYPE" => "multipart/form-data", "METHOD" => "get", "ACTION" => "/some/other/script"}, "")
+    end
+
+    it "includes the return value of the passed block when passed a block" do
+      output = @html.form("get", "/some/other/script", "multipart/form-data") { "test" }
+      output.should equal_element("FORM", {"ENCTYPE" => "multipart/form-data", "METHOD" => "get", "ACTION" => "/some/other/script"}, "test")
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/hidden_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/hidden_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/hidden_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,59 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/fixtures/common"
+
+describe "CGI::HtmlExtension#hidden" do
+  before(:each) do
+    @html = CGISpecs::HtmlExtension.new
+  end
+
+  describe "when passed no arguments" do
+    it "returns an hidden-'input'-element without a name" do
+      output = @html.hidden
+      output.should equal_element("INPUT", {"NAME" => "", "TYPE" => "hidden"}, "", :not_closed => true)
+    end
+  
+    it "ignores a passed block" do
+      output = @html.hidden { "test" }
+      output.should equal_element("INPUT", {"NAME" => "", "TYPE" => "hidden"}, "", :not_closed => true)
+    end
+  end
+
+  describe "when passed name" do
+    it "returns an hidden-'input'-element with the passed name" do
+      output = @html.hidden("test")
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "hidden"}, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.hidden("test") { "test" }
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "hidden"}, "", :not_closed => true)
+    end
+  end
+
+  describe "when passed name, value" do
+    it "returns an hidden-'input'-element with the passed name and value" do
+      output = @html.hidden("test", "some value")
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "hidden", "VALUE" => "some value"}, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.hidden("test", "some value") { "test" }
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "hidden", "VALUE" => "some value"}, "", :not_closed => true)
+    end
+  end
+
+  describe "when passed Hash" do
+    it "returns a checkbox-'input'-element using the passed Hash for attributes" do
+      attributes = { "NAME" => "test", "VALUE" => "some value" }
+      output = @html.hidden("test", "some value")
+      output.should equal_element("INPUT", attributes, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      attributes = { "NAME" => "test", "VALUE" => "some value" }
+      output = @html.hidden("test", "some value") { "test" }
+      output.should equal_element("INPUT", attributes, "", :not_closed => true)
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/html_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/html_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/html_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,46 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/fixtures/common"
+
+describe "CGI::HtmlExtension#html" do
+  before(:each) do
+    @html = CGISpecs::HtmlExtension.new
+    @html.stub!(:doctype).and_return("<!DOCTYPE SUPA-FUNKAY-RUBYSPEC-DOCTYPE>")
+  end
+
+  describe "when passed no arguments" do
+    it "returns a self's doctype and an 'html'-element" do
+      expected = '<!DOCTYPE SUPA-FUNKAY-RUBYSPEC-DOCTYPE><HTML>'
+      @html.html.should == expected
+    end
+  
+    it "includes the passed block when passed a block" do
+      expected = '<!DOCTYPE SUPA-FUNKAY-RUBYSPEC-DOCTYPE><HTML>test</HTML>'
+      @html.html { "test" }.should == expected
+    end
+  end
+
+  describe "when passed 'PRETTY'" do
+    it "returns pretty output when the passed String is 'PRETTY" do
+      expected = "<!DOCTYPE SUPA-FUNKAY-RUBYSPEC-DOCTYPE>\n<HTML>\n"
+      @html.html("PRETTY").should == expected
+    end
+
+    it "includes the passed block when passed a block" do
+      expected = "<!DOCTYPE SUPA-FUNKAY-RUBYSPEC-DOCTYPE>\n<HTML>\n  test\n</HTML>\n"
+      @html.html("PRETTY") { "test" }.should == expected
+    end
+  end
+
+  describe "when passed a Hash" do
+    it "returns an 'html'-element using the passed Hash for attributes" do
+      expected = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><HTML BLA="TEST">'
+      @html.html("DOCTYPE" => '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">', "BLA" => "TEST").should == expected
+    end
+
+    it "omits the doctype when the Hash contains a 'DOCTYPE' entry that's false or nil" do
+      @html.html("DOCTYPE" => false).should == "<HTML>"
+      @html.html("DOCTYPE" => nil).should == "<HTML>"
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/image_button_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/image_button_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/image_button_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,69 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/fixtures/common"
+
+describe "CGI::HtmlExtension#image_button" do
+  before(:each) do
+    @html = CGISpecs::HtmlExtension.new
+  end
+
+  describe "when passed no arguments" do
+    it "returns an image-'input'-element without a source image" do
+      output = @html.image_button
+      output.should equal_element("INPUT", {"SRC" => "", "TYPE" => "image"}, "", :not_closed => true)
+    end
+    
+    it "ignores a passed block" do
+      output = @html.image_button { "test" }
+      output.should equal_element("INPUT", {"SRC" => "", "TYPE" => "image"}, "", :not_closed => true)
+    end
+  end
+
+  describe "when passed src" do
+    it "returns an image-'input'-element with the passed src" do
+      output = @html.image_button("/path/to/image.png")
+      output.should equal_element("INPUT", {"SRC" => "/path/to/image.png", "TYPE" => "image"}, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.image_button("/path/to/image.png") { "test" }
+      output.should equal_element("INPUT", {"SRC" => "/path/to/image.png", "TYPE" => "image"}, "", :not_closed => true)
+    end
+  end
+
+  describe "when passed src, name" do
+    it "returns an image-'input'-element with the passed src and name" do
+      output = @html.image_button("/path/to/image.png", "test")
+      output.should equal_element("INPUT", {"SRC" => "/path/to/image.png", "TYPE" => "image", "NAME" => "test"}, "", :not_closed => true)
+    end
+    
+    it "ignores a passed block" do
+      output = @html.image_button("/path/to/image.png", "test") { "test" }
+      output.should equal_element("INPUT", {"SRC" => "/path/to/image.png", "TYPE" => "image", "NAME" => "test"}, "", :not_closed => true)
+    end
+  end
+
+  describe "when passed src, name, alt" do
+    it "returns an image-'input'-element with the passed src, name and alt" do
+      output = @html.image_button("/path/to/image.png", "test", "alternative")
+      output.should equal_element("INPUT", {"SRC" => "/path/to/image.png", "TYPE" => "image", "NAME" => "test", "ALT" => "alternative"}, "", :not_closed => true)
+    end
+    
+    it "ignores a passed block" do
+      output = @html.image_button("/path/to/image.png", "test", "alternative") { "test" }
+      output.should equal_element("INPUT", {"SRC" => "/path/to/image.png", "TYPE" => "image", "NAME" => "test", "ALT" => "alternative"}, "", :not_closed => true)
+    end
+  end
+
+  describe "when passed Hash" do
+    it "returns a image-'input'-element using the passed Hash for attributes" do
+      output = @html.image_button("NAME" => "test", "VALUE" => "test-value")
+      output.should equal_element("INPUT", {"SRC" => "", "TYPE" => "image", "NAME" => "test", "VALUE" => "test-value"}, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.image_button("NAME" => "test", "VALUE" => "test-value") { "test" }
+      output.should equal_element("INPUT", {"SRC" => "", "TYPE" => "image", "NAME" => "test", "VALUE" => "test-value"}, "", :not_closed => true)
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/img_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/img_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/img_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,85 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/fixtures/common"
+
+describe "CGI::HtmlExtension#img" do
+  before(:each) do
+    @html = CGISpecs::HtmlExtension.new
+  end
+  
+  describe "when passed no arguments" do
+    it "returns an 'img'-element without an src-url or alt-text" do
+      output = @html.img
+      output.should equal_element("IMG", { "SRC" => "", "ALT" => "" }, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.img { "test" }
+      output.should equal_element("IMG", { "SRC" => "", "ALT" => "" }, "", :not_closed => true)
+    end
+  end
+  
+  describe "when passed src" do
+    it "returns an 'img'-element with the passed src-url" do
+      output = @html.img("/path/to/some/image.png")
+      output.should equal_element("IMG", { "SRC" => "/path/to/some/image.png", "ALT" => "" }, "", :not_closed => true)
+    end
+    
+    it "ignores a passed block" do
+      output = @html.img("/path/to/some/image.png")
+      output.should equal_element("IMG", { "SRC" => "/path/to/some/image.png", "ALT" => "" }, "", :not_closed => true)
+    end
+  end
+  
+  describe "when passed src, alt" do
+    it "returns an 'img'-element with the passed src-url and the passed alt-text" do
+      output = @html.img("/path/to/some/image.png", "Alternative")
+      output.should equal_element("IMG", { "SRC" => "/path/to/some/image.png", "ALT" => "Alternative" }, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.img("/path/to/some/image.png", "Alternative") { "test" }
+      output.should equal_element("IMG", { "SRC" => "/path/to/some/image.png", "ALT" => "Alternative" }, "", :not_closed => true)
+    end
+  end
+  
+  describe "when passed src, alt, width" do
+    it "returns an 'img'-element with the passed src-url, the passed alt-text and the passed width" do
+      output = @html.img("/path/to/some/image.png", "Alternative", 40)
+      output.should equal_element("IMG", { "SRC" => "/path/to/some/image.png", "ALT" => "Alternative", "WIDTH" => "40" }, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.img("/path/to/some/image.png", "Alternative", 40) { "test" }
+      output.should equal_element("IMG", { "SRC" => "/path/to/some/image.png", "ALT" => "Alternative", "WIDTH" => "40" }, "", :not_closed => true)
+    end
+  end
+  
+  describe "when passed src, alt, width, height" do
+    it "returns an 'img'-element with the passed src-url, the passed alt-text, the passed width and the passed height" do
+      output = @html.img("/path/to/some/image.png", "Alternative", 40, 60)
+      output.should equal_element("IMG", { "SRC" => "/path/to/some/image.png", "ALT" => "Alternative", "WIDTH" => "40", "HEIGHT" => "60" }, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.img { "test" }
+      output.should equal_element("IMG", { "SRC" => "", "ALT" => "" }, "", :not_closed => true)
+    end
+  end
+  
+  describe "when passed Hash" do
+    ruby_bug "http://redmine.ruby-lang.org/issues/show/255", "1.8.7" do
+      it "returns an 'img'-element with the passed Hash as attributes" do
+        attributes = { "SRC" => "src", "ALT" => "alt", "WIDTH" => 100, "HEIGHT" => 50 }
+        output = @html.img(attributes)
+        output.should equal_element("IMG", attributes, "", :not_closed => true)
+      end
+
+      it "ignores a passed block" do
+        attributes = { "SRC" => "src", "ALT" => "alt", "WIDTH" => 100, "HEIGHT" => 50 }
+        output = @html.img(attributes) { "test" }
+        output.should equal_element("IMG", attributes, "", :not_closed => true)
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/multipart_form_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/multipart_form_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/multipart_form_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,64 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/fixtures/common"
+
+describe "CGI::HtmlExtension#multipart_form" do
+  before(:each) do
+    @html = CGISpecs::HtmlExtension.new
+    @html.stub!(:script_name).and_return("/path/to/some/script.rb")
+  end
+
+  describe "when passed no arguments" do
+    it "returns a 'form'-element with it's enctype set to multipart" do
+      output = @html.multipart_form
+      output.should equal_element("FORM", { "ENCTYPE" => "multipart/form-data", "METHOD" => "post" }, "")
+    end
+
+    it "includes the return value of the passed block when passed a block" do
+      output = @html.multipart_form { "test" }
+      output.should equal_element("FORM", { "ENCTYPE" => "multipart/form-data", "METHOD" => "post" }, "test")
+    end
+  end
+  
+  describe "when passed action" do
+    it "returns a 'form'-element with the passed action" do
+      output = @html.multipart_form("/some/other/script.rb")
+      output.should equal_element("FORM", { "ENCTYPE" => "multipart/form-data", "METHOD" => "post", "ACTION" => "/some/other/script.rb" }, "")
+    end
+
+    it "includes the return value of the passed block when passed a block" do
+      output = @html.multipart_form("/some/other/script.rb") { "test" }
+      output.should equal_element("FORM", { "ENCTYPE" => "multipart/form-data", "METHOD" => "post", "ACTION" => "/some/other/script.rb" }, "test")
+    end
+  end
+  
+  describe "when passed action, enctype" do
+    it "returns a 'form'-element with the passed action and enctype" do
+      output = @html.multipart_form("/some/other/script.rb", "application/x-www-form-urlencoded")
+      output.should equal_element("FORM", { "ENCTYPE" => "application/x-www-form-urlencoded", "METHOD" => "post", "ACTION" => "/some/other/script.rb" }, "")
+    end
+
+    it "includes the return value of the passed block when passed a block" do
+      output = @html.multipart_form("/some/other/script.rb", "application/x-www-form-urlencoded") { "test" }
+      output.should equal_element("FORM", { "ENCTYPE" => "application/x-www-form-urlencoded", "METHOD" => "post", "ACTION" => "/some/other/script.rb" }, "test")
+    end
+  end
+  
+  describe "when passed Hash" do
+    it "returns a 'form'-element with the passed Hash as attributes" do
+      output = @html.multipart_form("ID" => "test")
+      output.should equal_element("FORM", { "ENCTYPE" => "multipart/form-data", "METHOD" => "post", "ID" => "test" }, "")
+
+      output = @html.multipart_form("ID" => "test", "ENCTYPE" => "application/x-www-form-urlencoded", "METHOD" => "get")
+      output.should equal_element("FORM", { "ENCTYPE" => "application/x-www-form-urlencoded", "METHOD" => "get", "ID" => "test" }, "")
+    end
+
+    it "includes the return value of the passed block when passed a block" do
+      output = @html.multipart_form("ID" => "test") { "test" }
+      output.should equal_element("FORM", { "ENCTYPE" => "multipart/form-data", "METHOD" => "post", "ID" => "test" }, "test")
+
+      output = @html.multipart_form("ID" => "test", "ENCTYPE" => "application/x-www-form-urlencoded", "METHOD" => "get") { "test" }
+      output.should equal_element("FORM", { "ENCTYPE" => "application/x-www-form-urlencoded", "METHOD" => "get", "ID" => "test" }, "test")
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/password_field_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/password_field_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/password_field_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,84 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/fixtures/common"
+
+describe "CGI::HtmlExtension#password_field" do
+  before(:each) do
+    @html = CGISpecs::HtmlExtension.new
+  end
+
+  describe "when passed no arguments" do
+    it "returns an password-'input'-element without a name" do
+      output = @html.password_field
+      output.should equal_element("INPUT", {"NAME" => "", "TYPE" => "password", "SIZE" => "40"}, "", :not_closed => true)
+    end
+  
+    it "ignores a passed block" do
+      output = @html.password_field { "test" }
+      output.should equal_element("INPUT", {"NAME" => "", "TYPE" => "password", "SIZE" => "40"}, "", :not_closed => true)
+    end
+  end
+
+  describe "when passed name" do
+    it "returns an password-'input'-element with the passed name" do
+      output = @html.password_field("test")
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "password", "SIZE" => "40"}, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.password_field("test") { "test" }
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "password", "SIZE" => "40"}, "", :not_closed => true)
+    end
+  end
+
+  describe "when passed name, value" do
+    it "returns an password-'input'-element with the passed name and value" do
+      output = @html.password_field("test", "some value")
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "password", "VALUE" => "some value", "SIZE" => "40"}, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.password_field("test", "some value") { "test" }
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "password", "VALUE" => "some value", "SIZE" => "40"}, "", :not_closed => true)
+    end
+  end
+
+  describe "when passed name, value, size" do
+    it "returns an password-'input'-element with the passed name, value and size" do
+      output = @html.password_field("test", "some value", 60)
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "password", "VALUE" => "some value", "SIZE" => "60"}, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.password_field("test", "some value", 60) { "test" }
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "password", "VALUE" => "some value", "SIZE" => "60"}, "", :not_closed => true)
+    end
+  end
+
+  describe "when passed name, value, size, maxlength" do
+    it "returns an password-'input'-element with the passed name, value, size and maxlength" do
+      output = @html.password_field("test", "some value", 60, 12)
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "password", "VALUE" => "some value", "SIZE" => "60", "MAXLENGTH" => 12}, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.password_field("test", "some value", 60, 12) { "test" }
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "password", "VALUE" => "some value", "SIZE" => "60", "MAXLENGTH" => 12}, "", :not_closed => true)
+    end
+  end
+
+  describe "when passed Hash" do
+    it "returns a checkbox-'input'-element using the passed Hash for attributes" do
+      output = @html.password_field("NAME" => "test", "VALUE" => "some value")
+      output.should equal_element("INPUT", { "NAME" => "test", "VALUE" => "some value", "TYPE" => "password" }, "", :not_closed => true)
+
+      output = @html.password_field("TYPE" => "hidden")
+      output.should equal_element("INPUT", {"TYPE" => "password"}, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.password_field("NAME" => "test", "VALUE" => "some value") { "test" }
+      output.should equal_element("INPUT", { "NAME" => "test", "VALUE" => "some value", "TYPE" => "password" }, "", :not_closed => true)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/popup_menu_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/popup_menu_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/popup_menu_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/fixtures/common"
+require File.dirname(__FILE__) + "/shared/popup_menu"
+
+describe "CGI::HtmlExtension#popup_menu" do
+  it_behaves_like :cgi_htmlextension_popup_menu, :popup_menu
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/radio_button_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/radio_button_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/radio_button_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,77 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/fixtures/common"
+
+describe "CGI::HtmlExtension#radio_button" do
+  before(:each) do
+    @html = CGISpecs::HtmlExtension.new
+  end
+
+  describe "when passed no arguments" do
+    it "returns a radio-'input'-element without a name" do
+      output = @html.radio_button
+      output.should equal_element("INPUT", {"NAME" => "", "TYPE" => "radio"}, "", :not_closed => true)
+    end
+    
+    it "ignores a passed block" do
+      output = @html.radio_button { "test" }
+      output.should equal_element("INPUT", {"NAME" => "", "TYPE" => "radio"}, "", :not_closed => true)
+    end
+  end
+  
+  describe "when passed name" do
+    it "returns a radio-'input'-element with the passed name" do
+      output = @html.radio_button("test")
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "radio"}, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.radio_button("test") { "test" }
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "radio"}, "", :not_closed => true)
+    end
+  end
+
+  describe "CGI::HtmlExtension#checkbox when passed name, value" do
+    it "returns a radio-'input'-element with the passed name and value" do
+      output = @html.radio_button("test", "test-value")
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "radio", "VALUE" => "test-value"}, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.radio_button("test", "test-value") { "test" }
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "radio", "VALUE" => "test-value"}, "", :not_closed => true)
+    end
+  end
+
+  describe "when passed name, value, checked" do
+    it "returns a checked radio-'input'-element with the passed name and value when checked is true" do
+      output = @html.radio_button("test", "test-value", true)
+      output.should equal_element("INPUT", {"CHECKED" => true, "NAME" => "test", "TYPE" => "radio", "VALUE" => "test-value"}, "", :not_closed => true)
+      
+      output = @html.radio_button("test", "test-value", false)
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "radio", "VALUE" => "test-value"}, "", :not_closed => true)
+      
+      output = @html.radio_button("test", "test-value", nil)
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "radio", "VALUE" => "test-value"}, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.radio_button("test", "test-value", nil) { "test" }
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "radio", "VALUE" => "test-value"}, "", :not_closed => true)
+    end
+  end
+
+  describe "when passed Hash" do
+    it "returns a radio-'input'-element using the passed Hash for attributes" do
+      attributes = {"NAME" => "test", "VALUE" => "test-value", "CHECKED" => true}
+      output = @html.radio_button(attributes)
+      output.should equal_element("INPUT", attributes, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      attributes = {"NAME" => "test", "VALUE" => "test-value", "CHECKED" => true}
+      output = @html.radio_button(attributes) { "test" }
+      output.should equal_element("INPUT", attributes, "", :not_closed => true)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/radio_group_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/radio_group_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/radio_group_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,79 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/fixtures/common"
+
+describe "CGI::HtmlExtension#radio_group" do
+  before(:each) do
+    @html = CGISpecs::HtmlExtension.new
+  end
+
+  describe "when passed name, values ..." do
+    it "returns a sequence of 'radio'-elements with the passed name and the passed values" do
+      output = CGISpecs.split(@html.radio_group("test", "foo", "bar", "baz"))
+      output[0].should equal_element("INPUT", {"NAME" => "test", "TYPE" => "radio", "VALUE" => "foo"}, "foo", :not_closed => true)
+      output[1].should equal_element("INPUT", {"NAME" => "test", "TYPE" => "radio", "VALUE" => "bar"}, "bar", :not_closed => true)
+      output[2].should equal_element("INPUT", {"NAME" => "test", "TYPE" => "radio", "VALUE" => "baz"}, "baz", :not_closed => true)
+    end
+
+    it "allows passing a value inside an Array" do
+      output = CGISpecs.split(@html.radio_group("test", ["foo"], "bar", ["baz"]))
+      output[0].should equal_element("INPUT", {"NAME" => "test", "TYPE" => "radio", "VALUE" => "foo"}, "foo", :not_closed => true)
+      output[1].should equal_element("INPUT", {"NAME" => "test", "TYPE" => "radio", "VALUE" => "bar"}, "bar", :not_closed => true)
+      output[2].should equal_element("INPUT", {"NAME" => "test", "TYPE" => "radio", "VALUE" => "baz"}, "baz", :not_closed => true)
+    end
+
+    it "allows passing a value as an Array containing the value and the checked state or a label" do
+      output = CGISpecs.split(@html.radio_group("test", ["foo"], ["bar", true], ["baz", "label for baz"]))
+      output[0].should equal_element("INPUT", {"NAME" => "test", "TYPE" => "radio", "VALUE" => "foo"}, "foo", :not_closed => true)
+      output[1].should equal_element("INPUT", {"CHECKED" => true, "NAME" => "test", "TYPE" => "radio", "VALUE" => "bar"}, "bar", :not_closed => true)
+      output[2].should equal_element("INPUT", {"NAME" => "test", "TYPE" => "radio", "VALUE" => "baz"}, "label for baz", :not_closed => true)
+    end
+
+    # TODO: CGI does not like passing false instead of true.
+    ruby_bug "http://redmine.ruby-lang.org/issues/show/444", "1.8.7" do
+      it "allows passing a value as an Array containing the value, a label and the checked state" do
+        output = CGISpecs.split(@html.radio_group("test", ["foo", "label for foo", true], ["bar", "label for bar", false], ["baz", "label for baz", true]))
+        output[0].should equal_element("INPUT", {"CHECKED" => true, "NAME" => "test", "TYPE" => "radio", "VALUE" => "foo"}, "label for foo", :not_closed => true)
+        output[1].should equal_element("INPUT", {"NAME" => "test", "TYPE" => "radio", "VALUE" => "bar"}, "label for bar", :not_closed => true)
+        output[2].should equal_element("INPUT", {"CHECKED" => true, "NAME" => "test", "TYPE" => "radio", "VALUE" => "baz"}, "label for baz", :not_closed => true)
+      end
+    end
+
+    it "returns an empty String when passed no values" do
+      @html.radio_group("test").should == ""
+    end
+
+    it "ignores a passed block" do
+      output = CGISpecs.split(@html.radio_group("test", "foo", "bar", "baz") { "test" })
+      output[0].should equal_element("INPUT", {"NAME" => "test", "TYPE" => "radio", "VALUE" => "foo"}, "foo", :not_closed => true)
+      output[1].should equal_element("INPUT", {"NAME" => "test", "TYPE" => "radio", "VALUE" => "bar"}, "bar", :not_closed => true)
+      output[2].should equal_element("INPUT", {"NAME" => "test", "TYPE" => "radio", "VALUE" => "baz"}, "baz", :not_closed => true)
+    end
+  end
+
+  describe "when passed Hash" do
+    it "uses the passed Hash to generate the radio sequence" do
+      output = CGISpecs.split(@html.radio_group("NAME" => "name", "VALUES" => ["foo", "bar", "baz"]))
+      output[0].should equal_element("INPUT", {"NAME" => "name", "TYPE" => "radio", "VALUE" => "foo"}, "foo", :not_closed => true)
+      output[1].should equal_element("INPUT", {"NAME" => "name", "TYPE" => "radio", "VALUE" => "bar"}, "bar", :not_closed => true)
+      output[2].should equal_element("INPUT", {"NAME" => "name", "TYPE" => "radio", "VALUE" => "baz"}, "baz", :not_closed => true)
+
+      output = CGISpecs.split(@html.radio_group("NAME" => "name", "VALUES" => [["foo"], ["bar", true], "baz"]))
+      output[0].should equal_element("INPUT", {"NAME" => "name", "TYPE" => "radio", "VALUE" => "foo"}, "foo", :not_closed => true)
+      output[1].should equal_element("INPUT", {"CHECKED" => true, "NAME" => "name", "TYPE" => "radio", "VALUE" => "bar"}, "bar", :not_closed => true)
+      output[2].should equal_element("INPUT", {"NAME" => "name", "TYPE" => "radio", "VALUE" => "baz"}, "baz", :not_closed => true)
+
+      output = CGISpecs.split(@html.radio_group("NAME" => "name", "VALUES" => [["1", "Foo"], ["2", "Bar", true], "Baz"]))
+      output[0].should equal_element("INPUT", {"NAME" => "name", "TYPE" => "radio", "VALUE" => "1"}, "Foo", :not_closed => true)
+      output[1].should equal_element("INPUT", {"CHECKED" => true, "NAME" => "name", "TYPE" => "radio", "VALUE" => "2"}, "Bar", :not_closed => true)
+      output[2].should equal_element("INPUT", {"NAME" => "name", "TYPE" => "radio", "VALUE" => "Baz"}, "Baz", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = CGISpecs.split(@html.radio_group("NAME" => "name", "VALUES" => ["foo", "bar", "baz"]) { "test" })
+      output[0].should equal_element("INPUT", {"NAME" => "name", "TYPE" => "radio", "VALUE" => "foo"}, "foo", :not_closed => true)
+      output[1].should equal_element("INPUT", {"NAME" => "name", "TYPE" => "radio", "VALUE" => "bar"}, "bar", :not_closed => true)
+      output[2].should equal_element("INPUT", {"NAME" => "name", "TYPE" => "radio", "VALUE" => "baz"}, "baz", :not_closed => true)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/reset_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/reset_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/reset_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,57 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/fixtures/common"
+
+describe "CGI::HtmlExtension#reset" do
+  before(:each) do
+    @html = CGISpecs::HtmlExtension.new
+  end
+
+  describe "when passed no arguments" do
+    it "returns a reset-'input'-element" do
+      output = @html.reset
+      output.should equal_element("INPUT", {"TYPE" => "reset"}, "", :not_closed => true)
+    end
+  
+    it "ignores a passed block" do
+      output = @html.reset { "test" }
+      output.should equal_element("INPUT", {"TYPE" => "reset"}, "", :not_closed => true)
+    end
+  end
+
+  describe "when passed value" do
+    it "returns a reset-'input'-element with the passed value" do
+      output = @html.reset("Example")
+      output.should equal_element("INPUT", {"TYPE" => "reset", "VALUE" => "Example"}, "", :not_closed => true)
+    end
+  
+    it "ignores a passed block" do
+      output = @html.reset("Example") { "test" }
+      output.should equal_element("INPUT", {"TYPE" => "reset", "VALUE" => "Example"}, "", :not_closed => true)
+    end
+  end
+
+  describe "when passed value, name" do
+    it "returns a reset-'input'-element with the passed value and the passed name" do
+      output = @html.reset("Example", "test-name")
+      output.should equal_element("INPUT", {"TYPE" => "reset", "VALUE" => "Example", "NAME" => "test-name"}, "", :not_closed => true)
+    end
+  
+    it "ignores a passed block" do
+      output = @html.reset("Example", "test-name") { "test" }
+      output.should equal_element("INPUT", {"TYPE" => "reset", "VALUE" => "Example", "NAME" => "test-name"}, "", :not_closed => true)
+    end
+  end
+
+  describe "when passed Hash" do
+    it "returns a reset-'input'-element with the passed value" do
+      output = @html.reset("Example")
+      output.should equal_element("INPUT", {"TYPE" => "reset", "VALUE" => "Example"}, "", :not_closed => true)
+    end
+  
+    it "ignores a passed block" do
+      output = @html.reset("Example") { "test" }
+      output.should equal_element("INPUT", {"TYPE" => "reset", "VALUE" => "Example"}, "", :not_closed => true)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/scrolling_list_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/scrolling_list_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/scrolling_list_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/shared/popup_menu"
+
+describe "CGI::HtmlExtension#scrolling_list" do
+  it_behaves_like :cgi_htmlextension_popup_menu, :scrolling_list
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/shared/popup_menu.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/shared/popup_menu.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/shared/popup_menu.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,94 @@
+describe :cgi_htmlextension_popup_menu, :shared => true do
+  before(:each) do
+    @html = CGISpecs::HtmlExtension.new
+  end
+  
+  describe "when passed no arguments" do
+    it "returns an empty 'select'-element without a name" do
+      output = @html.send(@method)
+      output.should equal_element("SELECT", {"NAME" => ""}, "")
+    end
+
+    it "ignores a passed block" do
+      output = @html.send(@method) { "test" }
+      output.should equal_element("SELECT", {"NAME" => ""}, "")
+    end
+  end
+  
+  describe "when passed name, values ..." do
+    it "returns a 'select'-element with the passed name containing 'option'-elements based on the passed values" do
+      content = @html.option("VALUE" => "foo") { "foo" }
+      content << @html.option("VALUE" => "bar") { "bar" }
+      content << @html.option("VALUE" => "baz") { "baz" }
+
+      output = @html.send(@method, "test", "foo", "bar", "baz")
+      output.should equal_element("SELECT", {"NAME" => "test"}, content)
+    end
+    
+    it "allows passing values inside of arrays" do
+      content = @html.option("VALUE" => "foo") { "foo" }
+      content << @html.option("VALUE" => "bar") { "bar" }
+      content << @html.option("VALUE" => "baz") { "baz" }
+
+      output = @html.send(@method, "test", ["foo"], ["bar"], ["baz"])
+      output.should equal_element("SELECT", {"NAME" => "test"}, content)
+    end
+
+    it "allows passing a value as an Array containing the value and the select state or a label" do
+      content = @html.option("VALUE" => "foo") { "foo" }
+      content << @html.option("VALUE" => "bar", "SELECTED" => true) { "bar" }
+      content << @html.option("VALUE" => "baz") { "baz" }
+
+      output = @html.send(@method, "test", ["foo"], ["bar", true], "baz")
+      output.should equal_element("SELECT", {"NAME" => "test"}, content)
+    end
+    
+    it "allows passing a value as an Array containing the value, a label and the select state" do
+      content = @html.option("VALUE" => "1") { "Foo" }
+      content << @html.option("VALUE" => "2", "SELECTED" => true) { "Bar" }
+      content << @html.option("VALUE" => "Baz") { "Baz" }
+
+      output = @html.send(@method, "test", ["1", "Foo"], ["2", "Bar", true], "Baz")
+      output.should equal_element("SELECT", {"NAME" => "test"}, content)
+    end
+    
+    it "ignores a passed block" do
+      content = @html.option("VALUE" => "foo") { "foo" }
+      content << @html.option("VALUE" => "bar") { "bar" }
+      content << @html.option("VALUE" => "baz") { "baz" }
+
+      output = @html.send(@method, "test", "foo", "bar", "baz") { "woot" }
+      output.should equal_element("SELECT", {"NAME" => "test"}, content)
+    end
+  end
+  
+  describe "when passed a Hash" do
+    it "uses the passed Hash to generate the 'select'-element and the 'option'-elements" do
+      attributes = {
+        "NAME"   => "test", "SIZE" => 2, "MULTIPLE" => true,
+        "VALUES" => [["1", "Foo"], ["2", "Bar", true], "Baz"]
+      }
+      
+      content = @html.option("VALUE" => "1") { "Foo" }
+      content << @html.option("VALUE" => "2", "SELECTED" => true) { "Bar" }
+      content << @html.option("VALUE" => "Baz") { "Baz" }
+      
+      output = @html.send(@method, attributes)
+      output.should equal_element("SELECT", {"NAME" => "test", "SIZE" => 2, "MULTIPLE" => true}, content)
+    end
+    
+    it "ignores a passed block" do
+      attributes = {
+        "NAME"   => "test", "SIZE" => 2, "MULTIPLE" => true,
+        "VALUES" => [["1", "Foo"], ["2", "Bar", true], "Baz"]
+      }
+      
+      content = @html.option("VALUE" => "1") { "Foo" }
+      content << @html.option("VALUE" => "2", "SELECTED" => true) { "Bar" }
+      content << @html.option("VALUE" => "Baz") { "Baz" }
+      
+      output = @html.send(@method, attributes) { "testing" }
+      output.should equal_element("SELECT", {"NAME" => "test", "SIZE" => 2, "MULTIPLE" => true}, content)
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/submit_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/submit_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/submit_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,57 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/fixtures/common"
+
+describe "CGI::HtmlExtension#submit" do
+  before(:each) do
+    @html = CGISpecs::HtmlExtension.new
+  end
+
+  describe "when passed no arguments" do
+    it "returns a submit-'input'-element" do
+      output = @html.submit
+      output.should equal_element("INPUT", {"TYPE" => "submit"}, "", :not_closed => true)
+    end
+  
+    it "ignores a passed block" do
+      output = @html.submit { "test" }
+      output.should equal_element("INPUT", {"TYPE" => "submit"}, "", :not_closed => true)
+    end
+  end
+
+  describe "when passed value" do
+    it "returns a submit-'input'-element with the passed value" do
+      output = @html.submit("Example")
+      output.should equal_element("INPUT", {"TYPE" => "submit", "VALUE" => "Example"}, "", :not_closed => true)
+    end
+  
+    it "ignores a passed block" do
+      output = @html.submit("Example") { "test" }
+      output.should equal_element("INPUT", {"TYPE" => "submit", "VALUE" => "Example"}, "", :not_closed => true)
+    end
+  end
+
+  describe "when passed value, name" do
+    it "returns a submit-'input'-element with the passed value and the passed name" do
+      output = @html.submit("Example", "test-name")
+      output.should equal_element("INPUT", {"TYPE" => "submit", "VALUE" => "Example", "NAME" => "test-name"}, "", :not_closed => true)
+    end
+  
+    it "ignores a passed block" do
+      output = @html.submit("Example", "test-name") { "test" }
+      output.should equal_element("INPUT", {"TYPE" => "submit", "VALUE" => "Example", "NAME" => "test-name"}, "", :not_closed => true)
+    end
+  end
+
+  describe "when passed Hash" do
+    it "returns a submit-'input'-element with the passed value" do
+      output = @html.submit("Example")
+      output.should equal_element("INPUT", {"TYPE" => "submit", "VALUE" => "Example"}, "", :not_closed => true)
+    end
+  
+    it "ignores a passed block" do
+      output = @html.submit("Example") { "test" }
+      output.should equal_element("INPUT", {"TYPE" => "submit", "VALUE" => "Example"}, "", :not_closed => true)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/text_field_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/text_field_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/text_field_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,84 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/fixtures/common"
+
+describe "CGI::HtmlExtension#text_field" do
+  before(:each) do
+    @html = CGISpecs::HtmlExtension.new
+  end
+
+  describe "when passed no arguments" do
+    it "returns an text-'input'-element without a name" do
+      output = @html.text_field
+      output.should equal_element("INPUT", {"NAME" => "", "TYPE" => "text", "SIZE" => "40"}, "", :not_closed => true)
+    end
+  
+    it "ignores a passed block" do
+      output = @html.text_field { "test" }
+      output.should equal_element("INPUT", {"NAME" => "", "TYPE" => "text", "SIZE" => "40"}, "", :not_closed => true)
+    end
+  end
+
+  describe "when passed name" do
+    it "returns an text-'input'-element with the passed name" do
+      output = @html.text_field("test")
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "text", "SIZE" => "40"}, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.text_field("test") { "test" }
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "text", "SIZE" => "40"}, "", :not_closed => true)
+    end
+  end
+
+  describe "when passed name, value" do
+    it "returns an text-'input'-element with the passed name and value" do
+      output = @html.text_field("test", "some value")
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "text", "VALUE" => "some value", "SIZE" => "40"}, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.text_field("test", "some value") { "test" }
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "text", "VALUE" => "some value", "SIZE" => "40"}, "", :not_closed => true)
+    end
+  end
+
+  describe "when passed name, value, size" do
+    it "returns an text-'input'-element with the passed name, value and size" do
+      output = @html.text_field("test", "some value", 60)
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "text", "VALUE" => "some value", "SIZE" => "60"}, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.text_field("test", "some value", 60) { "test" }
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "text", "VALUE" => "some value", "SIZE" => "60"}, "", :not_closed => true)
+    end
+  end
+
+  describe "when passed name, value, size, maxlength" do
+    it "returns an text-'input'-element with the passed name, value, size and maxlength" do
+      output = @html.text_field("test", "some value", 60, 12)
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "text", "VALUE" => "some value", "SIZE" => "60", "MAXLENGTH" => 12}, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.text_field("test", "some value", 60, 12) { "test" }
+      output.should equal_element("INPUT", {"NAME" => "test", "TYPE" => "text", "VALUE" => "some value", "SIZE" => "60", "MAXLENGTH" => 12}, "", :not_closed => true)
+    end
+  end
+
+  describe "when passed Hash" do
+    it "returns a checkbox-'input'-element using the passed Hash for attributes" do
+      output = @html.text_field("NAME" => "test", "VALUE" => "some value")
+      output.should equal_element("INPUT", { "NAME" => "test", "VALUE" => "some value", "TYPE" => "text" }, "", :not_closed => true)
+
+      output = @html.text_field("TYPE" => "hidden")
+      output.should equal_element("INPUT", {"TYPE" => "text"}, "", :not_closed => true)
+    end
+
+    it "ignores a passed block" do
+      output = @html.text_field("NAME" => "test", "VALUE" => "some value") { "test" }
+      output.should equal_element("INPUT", { "NAME" => "test", "VALUE" => "some value", "TYPE" => "text" }, "", :not_closed => true)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/textarea_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/textarea_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/htmlextension/textarea_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,73 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/fixtures/common"
+
+describe "CGI::HtmlExtension#textarea" do
+  before(:each) do
+    @html = CGISpecs::HtmlExtension.new
+  end
+
+  describe "when passed no arguments" do
+    it "returns an 'textarea'-element without a name" do
+      output = @html.textarea
+      output.should equal_element("TEXTAREA", {"NAME" => "", "COLS" => "70", "ROWS" => "10"}, "")
+    end
+  
+    it "includes the return value of the passed block when passed a block" do
+      output = @html.textarea { "Example" }
+      output.should equal_element("TEXTAREA", {"NAME" => "", "COLS" => "70", "ROWS" => "10"}, "Example")
+    end
+  end
+
+  describe "when passed name" do
+    it "returns an 'textarea'-element with the passed name" do
+      output = @html.textarea("test")
+      output.should equal_element("TEXTAREA", {"NAME" => "test", "COLS" => "70", "ROWS" => "10"}, "")
+    end
+
+    it "includes the return value of the passed block when passed a block" do
+      output = @html.textarea("test") { "Example" }
+      output.should equal_element("TEXTAREA", {"NAME" => "test", "COLS" => "70", "ROWS" => "10"}, "Example")
+    end
+  end
+
+  describe "when passed name, cols" do
+    it "returns an 'textarea'-element with the passed name and the passed amount of columns" do
+      output = @html.textarea("test", 40)
+      output.should equal_element("TEXTAREA", {"NAME" => "test", "COLS" => "40", "ROWS" => "10"}, "")
+    end
+
+    it "includes the return value of the passed block when passed a block" do
+      output = @html.textarea("test", 40) { "Example" }
+      output.should equal_element("TEXTAREA", {"NAME" => "test", "COLS" => "40", "ROWS" => "10"}, "Example")
+    end
+  end
+
+  describe "when passed name, cols, rows" do
+    it "returns an 'textarea'-element with the passed name, the passed amount of columns and the passed number of rows" do
+      output = @html.textarea("test", 40, 5)
+      output.should equal_element("TEXTAREA", {"NAME" => "test", "COLS" => "40", "ROWS" => "5"}, "")
+    end
+
+    it "includes the return value of the passed block when passed a block" do
+      output = @html.textarea("test", 40, 5) { "Example" }
+      output.should equal_element("TEXTAREA", {"NAME" => "test", "COLS" => "40", "ROWS" => "5"}, "Example")
+    end
+  end
+  
+  describe "when passed Hash" do
+    it "should use the passed Hash as attributes" do
+      @html.textarea("ID" => "test").should == '<TEXTAREA ID="test"></TEXTAREA>' 
+      
+      attributes = {"ID" => "test-id", "NAME" => "test-name"}
+      output = @html.textarea(attributes)
+      output.should equal_element("TEXTAREA", attributes, "")
+    end
+    
+    it "includes the return value of the passed block when passed a block" do
+      attributes = {"ID" => "test-id", "NAME" => "test-name"}
+      output = @html.textarea(attributes) { "test" }
+      output.should equal_element("TEXTAREA", attributes, "test")
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,170 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'cgi'
+
+describe "CGI#initialize" do
+  it "is private" do
+    CGI.should have_private_instance_method(:initialize)
+  end
+end
+
+describe "CGI#initialize when passed no arguments" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.allocate
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+
+  it "extends self with CGI::QueryExtension" do
+    @cgi.send(:initialize)
+    @cgi.should be_kind_of(CGI::QueryExtension)
+  end
+
+  it "does not extend self with CGI::HtmlExtension" do
+    @cgi.send(:initialize)
+    @cgi.should_not be_kind_of(CGI::HtmlExtension)
+  end
+  
+  it "does not extend self with any of the other HTML modules" do
+    @cgi.send(:initialize)
+    @cgi.should_not be_kind_of(CGI::Html3)
+    @cgi.should_not be_kind_of(CGI::HtmlExtension)
+    @cgi.should_not be_kind_of(CGI::Html4)
+    @cgi.should_not be_kind_of(CGI::Html4Tr)
+    @cgi.should_not be_kind_of(CGI::Html4Fr)
+  end
+  
+  it "sets #cookies based on ENV['HTTP_COOKIE']" do
+    begin
+      old_env, ENV["HTTP_COOKIE"] = ENV["HTTP_COOKIE"], "test=test yay"
+      @cgi.send(:initialize)
+      @cgi.cookies.should == { "test"=>[ "test yay" ] }
+    ensure
+      ENV["HTTP_COOKIE"] = old_env
+    end
+  end
+
+  it "sets #params based on ENV['QUERY_STRING'] when ENV['REQUEST_METHOD'] is GET" do
+    begin
+      old_env_query, ENV["QUERY_STRING"] = ENV["QUERY_STRING"], "?test=a&test2=b"
+      old_env_method, ENV["REQUEST_METHOD"] = ENV["REQUEST_METHOD"], "GET"
+      @cgi.send(:initialize)
+      @cgi.params.should == { "test2" => ["b"], "?test" => ["a"] }
+    ensure
+      ENV["QUERY_STRING"] = old_env_query
+      ENV["REQUEST_METHOD"] = old_env_method
+    end
+  end
+
+  it "sets #params based on ENV['QUERY_STRING'] when ENV['REQUEST_METHOD'] is HEAD" do
+    begin
+      old_env_query, ENV["QUERY_STRING"] = ENV["QUERY_STRING"], "?test=a&test2=b"
+      old_env_method, ENV["REQUEST_METHOD"] = ENV["REQUEST_METHOD"], "HEAD"
+      @cgi.send(:initialize)
+      @cgi.params.should == { "test2" => ["b"], "?test" => ["a"] }
+    ensure
+      ENV["QUERY_STRING"] = old_env_query
+      ENV["REQUEST_METHOD"] = old_env_method
+    end
+  end
+end
+
+describe "CGI#initialize when passed type" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.allocate
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+
+
+  it "extends self with CGI::QueryExtension" do
+    @cgi.send(:initialize, "test")
+    @cgi.should be_kind_of(CGI::QueryExtension)
+  end
+
+  it "extends self with CGI::QueryExtension, CGI::Html3 and CGI::HtmlExtension when the passed type is 'html3'" do
+    @cgi.send(:initialize, "html3")
+    @cgi.should be_kind_of(CGI::Html3)
+    @cgi.should be_kind_of(CGI::HtmlExtension)
+    @cgi.should be_kind_of(CGI::QueryExtension)
+    
+    @cgi.should_not be_kind_of(CGI::Html4)
+    @cgi.should_not be_kind_of(CGI::Html4Tr)
+    @cgi.should_not be_kind_of(CGI::Html4Fr)
+  end
+  
+  it "extends self with CGI::QueryExtension, CGI::Html4 and CGI::HtmlExtension when the passed type is 'html4'" do
+    @cgi.send(:initialize, "html4")
+    @cgi.should be_kind_of(CGI::Html4)
+    @cgi.should be_kind_of(CGI::HtmlExtension)
+    @cgi.should be_kind_of(CGI::QueryExtension)
+    
+    @cgi.should_not be_kind_of(CGI::Html3)
+    @cgi.should_not be_kind_of(CGI::Html4Tr)
+    @cgi.should_not be_kind_of(CGI::Html4Fr)
+  end
+
+  it "extends self with CGI::QueryExtension, CGI::Html4Tr and CGI::HtmlExtension when the passed type is 'html4Tr'" do
+    @cgi.send(:initialize, "html4Tr")
+    @cgi.should be_kind_of(CGI::Html4Tr)
+    @cgi.should be_kind_of(CGI::HtmlExtension)
+    @cgi.should be_kind_of(CGI::QueryExtension)
+    
+    @cgi.should_not be_kind_of(CGI::Html3)
+    @cgi.should_not be_kind_of(CGI::Html4)
+    @cgi.should_not be_kind_of(CGI::Html4Fr)
+  end
+  
+  it "extends self with CGI::QueryExtension, CGI::Html4Tr, CGI::Html4Fr and CGI::HtmlExtension when the passed type is 'html4Fr'" do
+    @cgi.send(:initialize, "html4Fr")
+    @cgi.should be_kind_of(CGI::Html4Tr)
+    @cgi.should be_kind_of(CGI::Html4Fr)
+    @cgi.should be_kind_of(CGI::HtmlExtension)
+    @cgi.should be_kind_of(CGI::QueryExtension)
+    
+    @cgi.should_not be_kind_of(CGI::Html3)
+    @cgi.should_not be_kind_of(CGI::Html4)
+  end
+end
+
+describe "CGI#initialize when CGI_PARAMS is set" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.allocate
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+
+
+  it "prints out a warning" do
+    begin
+      CGI_PARAMS = { "test" => "test" }
+      CGI_COOKIES = [ "cookie!" ]
+      lambda { @cgi.send(:initialize) }.should complain("do not use CGI_PARAMS and CGI_COOKIES\n")
+    ensure
+      Object.send(:remove_const, :CGI_PARAMS)
+      Object.send(:remove_const, :CGI_COOKIES)
+    end
+  end
+
+  it "sets #cookies and #params to the contents of CGI_PARAMS and CGI_COOKIES" do
+    begin
+      CGI_PARAMS = { "test" => "test" }
+      CGI_COOKIES = [ "cookie!" ]
+      
+      @cgi.send(:initialize)
+      @cgi.params.should == CGI_PARAMS
+      @cgi.cookies.should == CGI_COOKIES
+    ensure
+      Object.send(:remove_const, :CGI_PARAMS)
+      Object.send(:remove_const, :CGI_COOKIES)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/out_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/out_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/out_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,51 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'cgi'
+
+describe "CGI#out" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+    $stdout, @old_stdout = IOStub.new, $stdout
+  end
+
+  after(:each) do
+    $stdout = @old_stdout
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "it writes a HTMl header based on the passed argument to $stdout" do
+    @cgi.out { "" }
+    $stdout.should == "Content-Type: text/html\r\nContent-Length: 0\r\n\r\n"
+  end
+  
+  it "appends the block's return value to the HTML header" do
+    @cgi.out { "test!" }
+    $stdout.should == "Content-Type: text/html\r\nContent-Length: 5\r\n\r\ntest!"
+  end
+
+  it "automatically sets the Content-Length Header based on the block's return value" do
+    @cgi.out { "0123456789" }
+    $stdout.should == "Content-Type: text/html\r\nContent-Length: 10\r\n\r\n0123456789"
+  end
+
+  it "includes Cookies in the @output_cookies field" do
+    @cgi.instance_variable_set(:@output_cookies, ["multiple", "cookies"])
+    @cgi.out { "" }
+    $stdout.should == "Content-Type: text/html\r\nContent-Length: 0\r\nSet-Cookie: multiple\r\nSet-Cookie: cookies\r\n\r\n"
+  end
+end
+
+describe "CGI#out when passed no block" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+
+  it "raises a LocalJumpError" do
+    lambda { @cgi.out }.should raise_error(LocalJumpError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/parse_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/parse_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/parse_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'cgi'
+
+describe "CGI.parse when passed String" do
+  it "parses a HTTP Query String into a Hash" do
+    CGI.parse("test=test&a=b").should == { "a" => ["b"], "test" => ["test"] }
+    CGI.parse("test=1,2,3").should == { "test" => ["1,2,3"] }
+    CGI.parse("test=a&a=&b=").should == { "test" => ["a"], "a" => [""], "b" => [""] }
+  end
+
+  it "allows passing multiple values for one key" do
+    CGI.parse("test=1&test=2&test=3").should == { "test" => ["1", "2", "3"] }
+    CGI.parse("test[]=1&test[]=2&test[]=3").should == { "test[]" => [ "1", "2", "3" ] }
+  end
+  
+  it "unescapes keys and values" do
+    CGI.parse("hello%3F=hello%21").should == { "hello?" => ["hello!"] }
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/pretty_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/pretty_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/pretty_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'cgi'
+
+describe "CGI.pretty when passed html" do
+  it "indents the passed html String with two spaces" do
+    CGI.pretty("<HTML><BODY></BODY></HTML>").should == <<-EOS
+<HTML>
+  <BODY>
+  </BODY>
+</HTML>
+EOS
+  end
+end
+
+describe "CGI.pretty when passed html, indentation_unit" do
+  it "indents the passed html String with the passed indentation_unit" do
+    CGI.pretty("<HTML><BODY></BODY></HTML>", "\t").should == <<-EOS
+<HTML>
+\t<BODY>
+\t</BODY>
+</HTML>
+EOS
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/print_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/print_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/print_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'cgi'
+
+describe "CGI#print" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+
+  it "passes all arguments to $stdout.print" do
+    $stdout.should_receive(:print).with("test")
+    @cgi.print("test")
+    
+    $stdout.should_receive(:print).with("one", "two", "three", ["four", "five"])
+    @cgi.print("one", "two", "three", ["four", "five"])
+  end
+  
+  it "returns the result of calling $stdout.print" do
+    $stdout.should_receive(:print).with("test").and_return(:expected)
+    @cgi.print("test").should == :expected
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/accept_charset_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/accept_charset_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/accept_charset_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#accept_charset" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['HTTP_ACCEPT_CHARSET']" do
+    old_value, ENV['HTTP_ACCEPT_CHARSET'] = ENV['HTTP_ACCEPT_CHARSET'], "ISO-8859-1,utf-8;q=0.7,*;q=0.7"
+    begin
+      @cgi.accept_charset.should == "ISO-8859-1,utf-8;q=0.7,*;q=0.7"
+    ensure
+      ENV['HTTP_ACCEPT_CHARSET'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/accept_encoding_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/accept_encoding_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/accept_encoding_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#accept_encoding" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['HTTP_ACCEPT_ENCODING']" do
+    old_value, ENV['HTTP_ACCEPT_ENCODING'] = ENV['HTTP_ACCEPT_ENCODING'], "gzip,deflate"
+    begin
+      @cgi.accept_encoding.should == "gzip,deflate"
+    ensure
+      ENV['HTTP_ACCEPT_ENCODING'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/accept_language_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/accept_language_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/accept_language_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#accept_language" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['HTTP_ACCEPT_LANGUAGE']" do
+    old_value, ENV['HTTP_ACCEPT_LANGUAGE'] = ENV['HTTP_ACCEPT_LANGUAGE'], "en-us,en;q=0.5"
+    begin
+      @cgi.accept_language.should == "en-us,en;q=0.5"
+    ensure
+      ENV['HTTP_ACCEPT_LANGUAGE'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/accept_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/accept_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/accept_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#accept" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['HTTP_ACCEPT']" do
+    old_value, ENV['HTTP_ACCEPT'] = ENV['HTTP_ACCEPT'], "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"
+    begin
+      @cgi.accept.should == "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"
+    ensure
+      ENV['HTTP_ACCEPT'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/auth_type_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/auth_type_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/auth_type_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#auth_type" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['AUTH_TYPE']" do
+    old_value, ENV['AUTH_TYPE'] = ENV['AUTH_TYPE'], "Basic"
+    begin
+      @cgi.auth_type.should == "Basic"
+    ensure
+      ENV['AUTH_TYPE'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/cache_control_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/cache_control_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/cache_control_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#cache_control" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['HTTP_CACHE_CONTROL']" do
+    old_value, ENV['HTTP_CACHE_CONTROL'] = ENV['HTTP_CACHE_CONTROL'], "no-cache"
+    begin
+      @cgi.cache_control.should == "no-cache"
+    ensure
+      ENV['HTTP_CACHE_CONTROL'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/content_length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/content_length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/content_length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#content_length" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['CONTENT_LENGTH'] as Integer" do
+    old_value = ENV['CONTENT_LENGTH']
+    begin
+      ENV['CONTENT_LENGTH'] = nil
+      @cgi.content_length.should be_nil
+
+      ENV['CONTENT_LENGTH'] = "100"
+      @cgi.content_length.should eql(100)
+    ensure
+      ENV['CONTENT_LENGTH'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/content_type_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/content_type_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/content_type_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#content_type" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['CONTENT_TYPE']" do
+    old_value, ENV['CONTENT_TYPE'] = ENV['CONTENT_TYPE'], "text/html"
+    begin
+      @cgi.content_type.should == "text/html"
+    ensure
+      ENV['CONTENT_TYPE'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/cookies_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/cookies_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/cookies_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#cookies" do
+  it "needs to be reviewed for spec completeness"
+end
+
+describe "CGI::QueryExtension#cookies=" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/element_reference_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/element_reference_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/element_reference_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#[]" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    ENV['QUERY_STRING'], @old_query_string = "one=a&two=b&two=c", ENV['QUERY_STRING']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+    ENV['QUERY_STRING']   = @old_query_string
+  end
+  
+  it "it returns the value for the parameter with the given key" do
+    @cgi["one"].should == "a"
+  end
+  
+  it "only returns the first value for parameters with multiple values" do
+    @cgi["two"].should == "b"
+  end
+  
+  it "returns a String that was extended with CGI::QueryExtension::Value" do
+    @cgi["one"].should be_kind_of(String)
+    @cgi["one"].should be_kind_of(CGI::QueryExtension::Value)
+  end
+
+  it "sets the other values in the returned value" do
+    @cgi["one"].to_a.should == ["a"]
+    @cgi["two"].to_a.should == ["b", "c"]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/from_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/from_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/from_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#from" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['HTTP_FROM']" do
+    old_value, ENV['HTTP_FROM'] = ENV['HTTP_FROM'], "googlebot(at)googlebot.com"
+    begin
+      @cgi.from.should == "googlebot(at)googlebot.com"
+    ensure
+      ENV['HTTP_FROM'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/gateway_interface_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/gateway_interface_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/gateway_interface_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#gateway_interface" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['GATEWAY_INTERFACE']" do
+    old_value, ENV['GATEWAY_INTERFACE'] = ENV['GATEWAY_INTERFACE'], "CGI/1.1"
+    begin
+      @cgi.gateway_interface.should == "CGI/1.1"
+    ensure
+      ENV['GATEWAY_INTERFACE'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/has_key_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/has_key_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/has_key_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/shared/has_key"
+
+describe "CGI::QueryExtension#has_key?" do
+  it_behaves_like :cgi_query_extension_has_key_p, :has_key?
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/host_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/host_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/host_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#host" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['HTTP_HOST']" do
+    old_value, ENV['HTTP_HOST'] = ENV['HTTP_HOST'], "localhost"
+    begin
+      @cgi.host.should == "localhost"
+    ensure
+      ENV['HTTP_HOST'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/include_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/include_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/include_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/shared/has_key"
+
+describe "CGI::QueryExtension#include?" do
+  it_behaves_like :cgi_query_extension_has_key_p, :include?
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/key_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/key_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/key_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/shared/has_key"
+
+describe "CGI::QueryExtension#key?" do
+  it_behaves_like :cgi_query_extension_has_key_p, :key?
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/keys_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/keys_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/keys_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#keys" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    ENV['QUERY_STRING'], @old_query_string = "one=a&two=b", ENV['QUERY_STRING']
+    
+    @cgi = CGI.new
+  end
+
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+    ENV['QUERY_STRING']   = @old_query_string
+  end
+
+  it "returns all parameter keys as an Array" do
+    @cgi.keys.sort.should == ["one", "two"]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/multipart_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/multipart_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/multipart_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,40 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+require "stringio"
+
+describe "CGI::QueryExtension#multipart?" do
+  before(:each) do
+    @old_stdin = $stdin
+    
+    @old_request_method = ENV['REQUEST_METHOD']
+    @old_content_type = ENV['CONTENT_TYPE']
+    @old_content_length = ENV['CONTENT_LENGTH']
+    
+    ENV['REQUEST_METHOD'] = "POST"
+    ENV["CONTENT_TYPE"] = "multipart/form-data; boundary=---------------------------1137522503144128232716531729"
+    ENV["CONTENT_LENGTH"] = "222"
+    
+    $stdin = StringIO.new <<-EOS
+-----------------------------1137522503144128232716531729\r
+Content-Disposition: form-data; name="file"; filename=""\r
+Content-Type: application/octet-stream\r
+\r
+\r
+-----------------------------1137522503144128232716531729--\r
+EOS
+
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    $stdin = @old_stdin
+  
+    ENV['REQUEST_METHOD'] = @old_request_method
+    ENV['CONTENT_TYPE'] = @old_content_type
+    ENV['CONTENT_LENGTH'] = @old_content_length
+  end
+  
+  it "returns true if the current Request is a multipart request" do
+    @cgi.multipart?.should be_true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/negotiate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/negotiate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/negotiate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#negotiate" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['HTTP_NEGOTIATE']" do
+    old_value, ENV['HTTP_NEGOTIATE'] = ENV['HTTP_NEGOTIATE'], "trans"
+    begin
+      @cgi.negotiate.should == "trans"
+    ensure
+      ENV['HTTP_NEGOTIATE'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/params_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/params_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/params_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,37 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#params" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    ENV['QUERY_STRING'], @old_query_string = "one=a&two=b&two=c&three", ENV['QUERY_STRING']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['QUERY_STRING'] = @old_query_string
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns the parsed HTTP Query Params" do
+    @cgi.params.should == {"three"=>[nil], "two"=>["b", "c"], "one"=>["a"]}
+  end
+end
+
+describe "CGI::QueryExtension#params=" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+
+  it "sets the HTTP Query Params to the passed argument" do
+    @cgi.params.should == {}
+    
+    @cgi.params = {"one"=>["a"], "two"=>["b", "c"]}
+    @cgi.params.should == {"one"=>["a"], "two"=>["b", "c"]}
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/path_info_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/path_info_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/path_info_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#path_info" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['PATH_INFO']" do
+    old_value, ENV['PATH_INFO'] = ENV['PATH_INFO'], "/test/path"
+    begin
+      @cgi.path_info.should == "/test/path"
+    ensure
+      ENV['PATH_INFO'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/path_translated_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/path_translated_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/path_translated_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#path_translated" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['PATH_TRANSLATED']" do
+    old_value, ENV['PATH_TRANSLATED'] = ENV['PATH_TRANSLATED'], "/full/path/to/dir"
+    begin
+      @cgi.path_translated.should == "/full/path/to/dir"
+    ensure
+      ENV['PATH_TRANSLATED'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/pragma_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/pragma_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/pragma_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#pragma" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['HTTP_PRAGMA']" do
+    old_value, ENV['HTTP_PRAGMA'] = ENV['HTTP_PRAGMA'], "no-cache"
+    begin
+      @cgi.pragma.should == "no-cache"
+    ensure
+      ENV['HTTP_PRAGMA'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/query_string_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/query_string_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/query_string_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#query_string" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['QUERY_STRING']" do
+    old_value, ENV['QUERY_STRING'] = ENV['QUERY_STRING'], "one=a&two=b"
+    begin
+      @cgi.query_string.should == "one=a&two=b"
+    ensure
+      ENV['QUERY_STRING'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/raw_cookie2_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/raw_cookie2_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/raw_cookie2_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#raw_cookie2" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['HTTP_COOKIE2']" do
+    old_value, ENV['HTTP_COOKIE2'] = ENV['HTTP_COOKIE2'], "some_cookie=data"
+    begin
+      @cgi.raw_cookie2.should == "some_cookie=data"
+    ensure
+      ENV['HTTP_COOKIE2'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/raw_cookie_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/raw_cookie_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/raw_cookie_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#raw_cookie" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['HTTP_COOKIE']" do
+    old_value, ENV['HTTP_COOKIE'] = ENV['HTTP_COOKIE'], "some_cookie=data"
+    begin
+      @cgi.raw_cookie.should == "some_cookie=data"
+    ensure
+      ENV['HTTP_COOKIE'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/referer_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/referer_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/referer_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#referer" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['HTTP_REFERER']" do
+    old_value, ENV['HTTP_REFERER'] = ENV['HTTP_REFERER'], "example.com"
+    begin
+      @cgi.referer.should == "example.com"
+    ensure
+      ENV['HTTP_REFERER'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/remote_addr_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/remote_addr_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/remote_addr_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#remote_addr" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['REMOTE_ADDR']" do
+    old_value, ENV['REMOTE_ADDR'] = ENV['REMOTE_ADDR'], "127.0.0.1"
+    begin
+      @cgi.remote_addr.should == "127.0.0.1"
+    ensure
+      ENV['REMOTE_ADDR'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/remote_host_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/remote_host_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/remote_host_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#remote_host" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['REMOTE_HOST']" do
+    old_value, ENV['REMOTE_HOST'] = ENV['REMOTE_HOST'], "test.host"
+    begin
+      @cgi.remote_host.should == "test.host"
+    ensure
+      ENV['REMOTE_HOST'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/remote_ident_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/remote_ident_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/remote_ident_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#remote_ident" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['REMOTE_IDENT']" do
+    old_value, ENV['REMOTE_IDENT'] = ENV['REMOTE_IDENT'], "no-idea-what-this-is-for"
+    begin
+      @cgi.remote_ident.should == "no-idea-what-this-is-for"
+    ensure
+      ENV['REMOTE_IDENT'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/remote_user_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/remote_user_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/remote_user_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#remote_user" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['REMOTE_USER']" do
+    old_value, ENV['REMOTE_USER'] = ENV['REMOTE_USER'], "username"
+    begin
+      @cgi.remote_user.should == "username"
+    ensure
+      ENV['REMOTE_USER'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/request_method_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/request_method_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/request_method_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#request_method" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['REQUEST_METHOD']" do
+    old_value, ENV['REQUEST_METHOD'] = ENV['REQUEST_METHOD'], "GET"
+    begin
+      @cgi.request_method.should == "GET"
+    ensure
+      ENV['REQUEST_METHOD'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/script_name_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/script_name_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/script_name_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#script_name" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['SCRIPT_NAME']" do
+    old_value, ENV['SCRIPT_NAME'] = ENV['SCRIPT_NAME'], "/path/to/script.rb"
+    begin
+      @cgi.script_name.should == "/path/to/script.rb"
+    ensure
+      ENV['SCRIPT_NAME'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/server_name_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/server_name_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/server_name_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#server_name" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['SERVER_NAME']" do
+    old_value, ENV['SERVER_NAME'] = ENV['SERVER_NAME'], "localhost"
+    begin
+      @cgi.server_name.should == "localhost"
+    ensure
+      ENV['SERVER_NAME'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/server_port_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/server_port_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/server_port_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#server_port" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+
+  it "returns ENV['SERVER_PORT'] as Integer" do
+    old_value = ENV['SERVER_PORT']
+    begin
+      ENV['SERVER_PORT'] = nil
+      @cgi.server_port.should be_nil
+
+      ENV['SERVER_PORT'] = "3000"
+      @cgi.server_port.should eql(3000)
+    ensure
+      ENV['SERVER_PORT'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/server_protocol_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/server_protocol_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/server_protocol_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#server_protocol" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['SERVER_PROTOCOL']" do
+    old_value, ENV['SERVER_PROTOCOL'] = ENV['SERVER_PROTOCOL'], "HTTP/1.1"
+    begin
+      @cgi.server_protocol.should == "HTTP/1.1"
+    ensure
+      ENV['SERVER_PROTOCOL'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/server_software_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/server_software_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/server_software_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#server_software" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['SERVER_SOFTWARE']" do
+    old_value, ENV['SERVER_SOFTWARE'] = ENV['SERVER_SOFTWARE'], "Server/1.0.0"
+    begin
+      @cgi.server_software.should == "Server/1.0.0"
+    ensure
+      ENV['SERVER_SOFTWARE'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/shared/has_key.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/shared/has_key.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/shared/has_key.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+describe :cgi_query_extension_has_key_p, :shared => true do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    ENV['QUERY_STRING'], @old_query_string = "one=a&two=b", ENV['QUERY_STRING']
+
+    @cgi = CGI.new
+  end
+
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+    ENV['QUERY_STRING']   = @old_query_string
+  end
+
+  it "returns true when the passed key exists in the HTTP Query" do
+    @cgi.send(@method, "one").should be_true
+    @cgi.send(@method, "two").should be_true
+    @cgi.send(@method, "three").should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/user_agent_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/user_agent_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/user_agent_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension#user_agent" do
+  before(:each) do
+    ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
+    @cgi = CGI.new
+  end
+  
+  after(:each) do
+    ENV['REQUEST_METHOD'] = @old_request_method
+  end
+  
+  it "returns ENV['HTTP_USER_AGENT']" do
+    old_value, ENV['HTTP_USER_AGENT'] = ENV['HTTP_USER_AGENT'], "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_2; de-de) AppleWebKit/527+ (KHTML, like Gecko) Version/3.1 Safari/525.13"
+    begin
+      @cgi.user_agent.should == "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_2; de-de) AppleWebKit/527+ (KHTML, like Gecko) Version/3.1 Safari/525.13"
+    ensure
+      ENV['HTTP_USER_AGENT'] = old_value
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/element_reference_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/element_reference_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/element_reference_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension::Value#[] when passed index" do
+  before(:each) do
+    @value = "some value"
+    @value.extend(CGI::QueryExtension::Value)
+    @value.set_params(["some value", "other value", "third value"])
+  end
+
+  it "returns the alternative value with the passed index" do
+    @value[0].should == "some value"
+    @value[1].should == "other value"
+    @value[2].should == "third value"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/first_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/first_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/first_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/shared/first"
+
+describe "CGI::QueryExtension::Value#first" do
+  it_behaves_like :cgi_query_extension_value_first, :first
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/last_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/last_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/last_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/shared/first"
+
+describe "CGI::QueryExtension::Value#last" do
+  it_behaves_like :cgi_query_extension_value_first, :last
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/set_params_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/set_params_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/set_params_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'cgi'
+
+describe "CGI::QueryExtension::Value#set_params" do
+  before(:each) do
+    @value = "some value"
+    @value.extend(CGI::QueryExtension::Value)
+  end
+
+  it "sets alternative params" do
+    @value.set_params(["some value", "other value", "third value"])
+    @value.to_a.should == ["some value", "other value", "third value"]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/shared/first.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/shared/first.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/shared/first.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+describe :cgi_query_extension_value_first, :shared => true do
+  before(:each) do
+    @value = "some value"
+    @value.extend(CGI::QueryExtension::Value)
+  end
+
+  it "returns self" do
+    @value.send(@method).should equal(@value)
+  end
+
+  it "outputs a warning" do
+    expected_warning = /#{Regexp.quote("CAUTION! cgi['key'] == cgi.params['key'][0]; if want Array, use cgi.params['key']")}/
+    lambda { @value.send(@method) }.should complain(expected_warning)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/shared/to_a.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/shared/to_a.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/shared/to_a.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+describe :cgi_query_extension_value_to_a, :shared => true do
+  before(:each) do
+    @value = "some value"
+    @value.extend(CGI::QueryExtension::Value)
+  end
+
+  it "returns an Array containing self" do
+    @value.send(@method).should == [@value]
+  end
+end
+
+describe :cgi_query_extension_value_to_a_alternate_self, :shared => true do
+  before(:each) do
+    @value = "some value"
+    @value.extend(CGI::QueryExtension::Value)
+    @value.set_params(["some value", "other value", "third value"])
+  end
+
+  it "returns an array containing the alternative values" do
+    @value.send(@method).should == ["some value", "other value", "third value"]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/to_a_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/to_a_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/to_a_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/shared/to_a"
+
+describe "CGI::QueryExtension::Value#to_a" do
+  it_behaves_like :cgi_query_extension_value_to_a, :to_a
+end
+
+describe "CGI::QueryExtension::Value#to_a when alternative values for self are set" do
+  it_behaves_like :cgi_query_extension_value_to_a_alternate_self, :to_a
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/to_ary_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/to_ary_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/queryextension/value/to_ary_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'cgi'
+require File.dirname(__FILE__) + "/shared/to_a"
+
+describe "CGI::QueryExtension::Value#to_ary" do
+  it_behaves_like :cgi_query_extension_value_to_a, :to_ary
+end
+
+describe "CGI::QueryExtension::Value#to_ary when alternative values for self are set" do
+  it_behaves_like :cgi_query_extension_value_to_a_alternate_self, :to_a
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/rfc1123_date_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/rfc1123_date_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/rfc1123_date_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'cgi'
+
+describe "CGI.rfc1123_date when passsed Time" do
+  it "returns the passed Time formatted in RFC1123 ('Sat, 01 Dec 2007 15:56:42 GMT')" do
+    input = Time.at(1196524602)
+    expected = 'Sat, 01 Dec 2007 15:56:42 GMT'
+    CGI.rfc1123_date(input).should == expected
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/tagmaker/nOE_element_def_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/tagmaker/nOE_element_def_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/tagmaker/nOE_element_def_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,37 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::TagMaker#nOE_element_def when passed element" do
+  before(:each) do
+    @obj = Object.new
+    @obj.extend(CGI::TagMaker)
+  end
+
+  it "returns code for the passed element" do
+    @obj.nOE_element_def("BR").should == <<-EOS
+          "<BR" + attributes.collect{|name, value|
+            next unless value
+            " " + CGI::escapeHTML(name) +
+            if true == value
+              ""
+            else
+              \'="\' + CGI::escapeHTML(value) + \'"\'
+            end
+          }.to_s + ">"
+EOS
+  end
+
+  it "automatically converts the tag to capital letters" do
+    @obj.nOE_element_def("br").should == <<-EOS
+          "<BR" + attributes.collect{|name, value|
+            next unless value
+            " " + CGI::escapeHTML(name) +
+            if true == value
+              ""
+            else
+              \'="\' + CGI::escapeHTML(value) + \'"\'
+            end
+          }.to_s + ">"
+EOS
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/tagmaker/nO_element_def_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/tagmaker/nO_element_def_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/tagmaker/nO_element_def_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,48 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::TagMaker#nO_element_def when passed element" do
+  before(:each) do
+    @obj = Object.new
+    @obj.extend(CGI::TagMaker)
+  end
+
+  it "returns code for the passed element with optional start/end tags" do
+    @obj.nO_element_def("P").should == <<-EOS
+          "<P" + attributes.collect{|name, value|
+            next unless value
+            " " + CGI::escapeHTML(name) +
+            if true == value
+              ""
+            else
+              \'="\' + CGI::escapeHTML(value) + \'"\'
+            end
+          }.to_s + ">" +
+          if block_given?
+            yield.to_s + "</P>"
+          else
+            ""
+          end
+EOS
+  end
+
+  it "automatically converts the element tag to capital letters" do
+    @obj.nO_element_def("p").should == <<-EOS
+          "<P" + attributes.collect{|name, value|
+            next unless value
+            " " + CGI::escapeHTML(name) +
+            if true == value
+              ""
+            else
+              \'="\' + CGI::escapeHTML(value) + \'"\'
+            end
+          }.to_s + ">" +
+          if block_given?
+            yield.to_s + "</P>"
+          else
+            ""
+          end
+EOS
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/tagmaker/nn_element_def_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/tagmaker/nn_element_def_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/tagmaker/nn_element_def_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,49 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'cgi'
+
+describe "CGI::TagMaker#nn_element_def when passed element" do
+  before(:each) do
+    @obj = Object.new
+    @obj.extend(CGI::TagMaker)
+  end
+  
+  it "returns code for the passed element with required start and end tags" do
+    @obj.nn_element_def("A").should == <<-EOS
+          "<A" + attributes.collect{|name, value|
+            next unless value
+            " " + CGI::escapeHTML(name) +
+            if true == value
+              ""
+            else
+              \'="\' + CGI::escapeHTML(value) + \'"\'
+            end
+          }.to_s + ">" +
+          if block_given?
+            yield.to_s
+          else
+            ""
+          end +
+          "</A>"
+EOS
+  end
+
+  it "automatically converts the element tag to capital letters" do
+    @obj.nn_element_def("a").should == <<-EOS
+          "<A" + attributes.collect{|name, value|
+            next unless value
+            " " + CGI::escapeHTML(name) +
+            if true == value
+              ""
+            else
+              \'="\' + CGI::escapeHTML(value) + \'"\'
+            end
+          }.to_s + ">" +
+          if block_given?
+            yield.to_s
+          else
+            ""
+          end +
+          "</A>"
+EOS
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/unescapeElement_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/unescapeElement_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/unescapeElement_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'cgi'
+
+describe "CGI.unescapeElement when passed String, elements, ..." do
+  it "unescapes only the tags of the passed elements in the passed String" do
+    res = CGI.unescapeElement("&lt;BR&gt;&lt;A HREF=&quot;url&quot;&gt;&lt;/A&gt;", "A", "IMG")
+    res.should == '&lt;BR&gt;<A HREF="url"></A>'
+    
+    res = CGI.unescapeElement('&lt;BR&gt;&lt;A HREF=&quot;url&quot;&gt;&lt;/A&gt;', ["A", "IMG"])
+    res.should == '&lt;BR&gt;<A HREF="url"></A>'
+  end
+
+  it "is case-insensitive" do
+    res = CGI.unescapeElement("&lt;BR&gt;&lt;A HREF=&quot;url&quot;&gt;&lt;/A&gt;", "a", "img")
+    res.should == '&lt;BR&gt;<A HREF="url"></A>'
+
+    res = CGI.unescapeElement("&lt;br&gt;&lt;a href=&quot;url&quot;&gt;&lt;/a&gt;", "A", "IMG")
+    res.should == '&lt;br&gt;<a href="url"></a>'
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/unescapeHTML_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/unescapeHTML_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/unescapeHTML_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'cgi'
+
+describe "CGI.unescapeHTML" do
+  it "unescapes '&amp; &lt; &gt; &quot;' to '& < > \"'" do
+    input = '&amp; &lt; &gt; &quot;'
+    expected = '& < > "'
+    CGI::unescapeHTML(input).should == expected
+  end
+
+  it "doesn't unescape other html entities such as '&copy;' or '&heart'" do
+    input = '&copy;&heart;'
+    expected = input
+    CGI::unescapeHTML(input).should == expected
+  end
+
+  it "unescapes '&#99' format entities" do
+    input = '&#34;&#38;&#39;&#60;&#62;'
+    expected = '"&\'<>'
+    CGI::unescapeHTML(input).should == expected
+  end
+
+  it "unescapes '&#x9999' format entities" do
+    input = '&#x0022;&#x0026;&#x0027;&#x003c;&#x003E;'
+    expected = '"&\'<>'
+    CGI::unescapeHTML(input).should == expected
+  end
+
+  it "leaves invalid formatted strings" do
+    input = '&&lt;&amp&gt;&quot&abcdefghijklmn'
+    expected = '&<&amp>&quot&abcdefghijklmn'
+    CGI::unescapeHTML(input).should == expected
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/cgi/unescape_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/cgi/unescape_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/cgi/unescape_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'cgi'
+
+describe "CGI.unescape" do
+  it "url-decodes the passed argument" do
+    input    = "+%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D%7E"
+    expected = " !\"\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
+    CGI.unescape(input).should == expected
+    
+    input    = 'http%3A%2F%2Fja.wikipedia.org%2Fwiki%2F%E3%83%AD%E3%83%A0%E3%82%B9%E3%82%AB%E3%83%BB%E3%83%91%E3%83%AD%E3%83%BB%E3%82%A6%E3%83%AB%E3%83%BB%E3%83%A9%E3%83%94%E3%83%A5%E3%82%BF'
+    expected = "http://ja.wikipedia.org/wiki/\343\203\255\343\203\240\343\202\271\343\202\253\343\203\273\343\203\221\343\203\255\343\203\273\343\202\246\343\203\253\343\203\273\343\203\251\343\203\224\343\203\245\343\202\277"
+    CGI.unescape(input).should == expected
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/Complex_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/Complex_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/Complex_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,53 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'complex'
+
+describe "Complex when passed [Complex, Complex]" do
+  it "returns a new Complex number based on the two given numbers" do
+    Complex(Complex(3, 4), Complex(5, 6)).should == Complex.new(3 - 6, 4 + 5)
+    Complex(Complex(1.5, 2), Complex(-5, 6.3)).should == Complex.new(1.5 - 6.3, 2 - 5)
+  end
+end
+
+describe "Complex when passed [Complex]" do
+  it "returns the passed Complex number" do
+    Complex(Complex(1, 2)).should == Complex(1, 2)
+    Complex(Complex(-3.4, bignum_value)).should == Complex(-3.4, bignum_value)
+  end
+end
+
+describe "Complex when passed [Integer, Integer]" do
+  it "returns a new Complex number" do
+    Complex(1, 2).should == Complex.new(1, 2)
+    Complex(-3, -5).should == Complex.new(-3, -5)
+    Complex(3.5, -4.5).should == Complex.new(3.5, -4.5)
+    Complex(bignum_value, 30).should == Complex.new(bignum_value, 30)
+  end
+end
+
+describe "Complex when passed [Integer]" do
+  it "returns a new Complex number with 0 as the imaginary component" do
+    # Guard against the Mathn library
+    conflicts_with :Prime do
+      Complex(1).should eql(Complex.new(1, 0))
+      Complex(-3).should eql(Complex.new(-3, 0))
+      Complex(-4.5).should eql(Complex.new(-4.5, 0))
+      Complex(bignum_value).should eql(Complex.new(bignum_value, 0))
+    end
+  end
+  
+  it "returns the passed Integer when Complex::Unify is defined" do
+    # Guard against the Mathn library
+    conflicts_with :Prime do
+      begin
+        Complex::Unify = true
+      
+        Complex(1).should eql(1)
+        Complex(-3).should eql(-3)
+        Complex(-4.5).should eql(-4.5)
+        Complex(bignum_value).should eql(bignum_value)
+      ensure
+        Complex.send :remove_const, :Unify
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/abs2_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/abs2_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/abs2_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'complex'
+
+describe "Complex#abs2" do
+  it "returns the sum of the squares of the real and imaginary parts" do
+    Complex(1, -2).abs2.should == 1 + 4
+    Complex(-0.1, 0.2).abs2.should be_close(0.01 + 0.04, TOLERANCE)
+    # Guard against Mathn library
+    conflicts_with :Prime do
+      Complex(0).abs2.should == 0
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/abs_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/abs_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/abs_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'complex'
+
+describe "Complex#abs" do
+  it "returns the modulus: |a + bi| = \xC3((a ^ 2) + (b ^ 2))" do
+    Complex(0, 0).abs.should == 0
+    Complex(3, 4).abs.should == 5 # well-known integer case
+    Complex(-3, 4).abs.should == 5
+    Complex(1, -1).abs.should be_close(Math.sqrt(2), TOLERANCE)
+    Complex(6.5, 0).abs.should be_close(6.5, TOLERANCE)
+    Complex(0, -7.2).abs.should be_close(7.2, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/angle_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/angle_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/angle_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/arg.rb'
+
+describe "Complex#angle" do
+  it_behaves_like(:complex_arg, :angle)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/arg_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/arg_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/arg_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/arg.rb'
+
+describe "Complex#arg" do
+  it_behaves_like(:complex_arg, :arg)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/coerce_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/coerce_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/coerce_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,43 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'complex'
+require "rational"
+
+describe "Complex#coerce" do
+  before(:each) do
+    @one = Complex.new!(1)
+  end
+  
+  it "returns an array containing other and self as Complex when other is an Integer" do
+    result = @one.coerce(2)
+    result.should == [2, 1]
+    result.first.should be_kind_of(Complex)
+    result.last.should be_kind_of(Complex)
+  end
+
+  it "returns an array containing other and self as Complex when other is a Float" do
+    result = @one.coerce(20.5)
+    result.should == [20.5, 1]
+    result.first.should be_kind_of(Complex)
+    result.last.should be_kind_of(Complex)
+  end
+
+  it "returns an array containing other and self as Complex when other is a Bignum" do
+    result = @one.coerce(4294967296)
+    result.should == [4294967296, 1]
+    result.first.should be_kind_of(Complex)
+    result.last.should be_kind_of(Complex)
+  end
+
+  it "returns an array containing other and self as Complex when other is a Rational" do
+    result = @one.coerce(Rational(5,6))
+    result.should == [Rational(5,6), 1]
+    result.first.should be_kind_of(Complex)
+    result.last.should be_kind_of(Complex)
+  end
+
+  it "raises a TypeError when other is a String" do
+    lambda { @one.coerce("20") }.should raise_error(TypeError)
+    lambda { @one.coerce(nil)   }.should raise_error(TypeError)
+    lambda { @one.coerce(false) }.should raise_error(TypeError)    
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/complex/comparison_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/comparison_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/comparison_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'complex'
+
+describe "Complex#<=>" do
+  it "compares the absolute values of self and other" do
+    (Complex(1, 2) <=> Complex(2, 1)).should == 0
+    (Complex(-3, -10) <=> Complex(2, 1)).should > 0
+    (Complex(3, 5) <=> Complex(100.0, -190.5)).should < 0
+    
+    (Complex(3, 4) <=> 5).should == 0
+    (Complex(3, 4) <=> -5).should == 0
+    (Complex(-3, -4) <=> -5).should == 0
+    
+    (Complex(3, 4) <=> 6).should < 0
+    (Complex(3, 4) <=> -4).should > 0
+
+    (Complex(3, 4) <=> 6.0).should < 0
+    (Complex(3, 4) <=> -4.0).should > 0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/conj_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/conj_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/conj_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/conjugate.rb'
+
+describe "Complex#conj" do
+  it_behaves_like(:complex_conjugate, :conj)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/conjugate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/conjugate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/conjugate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/conjugate.rb'
+
+describe "Complex#conjugate" do
+  it_behaves_like(:complex_conjugate, :conjugate)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/denominator_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/denominator_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/denominator_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'complex'
+
+# FIXME:
+# Complex#denominator requires the rational library,
+# as Integer#denominator is defined by it.
+# I think this method is pretty buggy, as there is no
+# denominator for Floats and rational might not always
+# be loaded, both resulting in a method missing exception.
+# Also, the documentation for Complex#denominator does
+# not mention a dependency for rational.
+require "rational"
+
+describe "Complex#denominator" do
+  it "returns the least common multiple denominator of the real and imaginary parts" do
+    Complex(3, 4).denominator.should == 1
+    Complex(3, bignum_value).denominator.should == 1
+
+    Complex(3, Rational(3,4)).denominator.should == 4
+
+    Complex(Rational(4,8), Rational(3,4)).denominator.should == 4
+    Complex(Rational(3,8), Rational(3,4)).denominator.should == 8
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/complex/divide_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/divide_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/divide_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,55 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'complex'
+
+describe "Complex#/ with Complex" do
+  it "divides according to the usual rule for complex numbers" do
+    a = Complex((1 * 10) - (2 * 20), (1 * 20) + (2 * 10))
+    b = Complex(1, 2)
+    (a / b).should == Complex(10, 20)
+
+    c = Complex((1.5 * 100.2) - (2.1 * -30.3), (1.5 * -30.3) + (2.1 * 100.2))
+    d = Complex(1.5, 2.1)
+    # remember the floating-point arithmetic
+    (c / d).should be_close(Complex(100.2, -30.3), TOLERANCE)
+  end
+end
+
+describe "Complex#/ with Fixnum" do
+  it "divides both parts of the Complex number" do
+    (Complex(20, 40) / 2).should == Complex(10, 20)
+    (Complex(30, 30) / 10).should == Complex(3, 3)
+  end
+  
+  it "raises a ZeroDivisionError when given zero" do
+    lambda { Complex(20, 40) / 0 }.should raise_error(ZeroDivisionError)
+  end
+end
+
+describe "Complex#/ with Bignum" do
+  it "divides both parts of the Complex number" do
+    (Complex(20, 40) / 2).should == Complex(10, 20)
+    (Complex(15, 16) / 2.0).should be_close(Complex(7.5, 8), TOLERANCE)
+  end
+end
+
+describe "Complex#/ with Float" do
+  it "divides both parts of the Complex number" do
+    (Complex(3, 9) / 1.5).should == Complex(2, 6)
+    (Complex(15, 16) / 2.0).should be_close(Complex(7.5, 8), TOLERANCE)
+  end
+
+  it "returns Complex(Infinity, Infinity) when given zero" do
+    (Complex(20, 40) / 0.0).inspect.should == "Complex(Infinity, Infinity)"
+    (Complex(-20, -40) / 0.0).inspect.should == "Complex(-Infinity, -Infinity)"
+  end
+end
+
+describe "Complex#/ with Object" do
+  it "tries to coerce self into other" do
+    value = Complex(3, 9)
+    
+    obj = mock("Object")
+    obj.should_receive(:coerce).with(value).and_return([4, 2])
+    (value / obj).should == 2
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/complex/equal_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/equal_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/equal_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,63 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'complex'
+
+describe "Complex#== with Complex" do
+  it "returns true when self and other have numerical equality" do
+    Complex(1, 2).should == Complex(1, 2)
+    Complex(3, 9).should == Complex(3, 9)
+    Complex(-3, -9).should == Complex(-3, -9)
+    
+    Complex(1, 2).should_not == Complex(3, 4)
+    Complex(3, 9).should_not == Complex(9, 3)
+
+    Complex(1.0, 2.0).should == Complex(1, 2)
+    Complex(3.0, 9.0).should_not == Complex(9.0, 3.0)
+    
+    Complex(1.5, 2.5).should == Complex(1.5, 2.5)
+    Complex(1.5, 2.5).should == Complex(1.5, 2.5)
+    Complex(-1.5, 2.5).should == Complex(-1.5, 2.5)
+
+    Complex(1.5, 2.5).should_not == Complex(2.5, 1.5)
+    Complex(3.75, 2.5).should_not == Complex(1.5, 2.5)
+
+    Complex(bignum_value, 2.5).should == Complex(bignum_value, 2.5)
+    Complex(3.75, bignum_value).should_not == Complex(1.5, bignum_value)
+  end
+end
+
+describe "Complex#== with Numeric" do
+  it "returns true when self's imaginery part is 0 and the real part and other have numerical equality" do
+    Complex(3, 0).should == 3
+    Complex(-3, 0).should == -3
+    
+    Complex(3.5, 0).should == 3.5
+    Complex(-3.5, 0).should == -3.5
+    
+    Complex(bignum_value, 0).should == bignum_value
+    Complex(-bignum_value, 0).should == -bignum_value
+    
+    Complex(3.0, 0).should == 3
+    Complex(-3.0, 0).should == -3
+
+    Complex(3, 0).should_not == 4
+    Complex(-3, 0).should_not == -4
+    
+    Complex(3.5, 0).should_not == -4.5
+    Complex(-3.5, 0).should_not == 2.5
+    
+    Complex(bignum_value, 0).should_not == bignum_value(10)
+    Complex(-bignum_value, 0).should_not == -bignum_value(20)
+  end
+end
+
+describe "Complex#== with Object" do
+  # Fixnum#==, Float#== and Bignum#== only return booleans - Bug?
+  it "calls other#== with self" do
+    value = Complex(3, 0)
+    
+    obj = mock("Object")
+    obj.should_receive(:==).with(value).and_return(:expected)
+    
+    (value == obj).should == :expected
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/complex/exponent_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/exponent_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/exponent_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,54 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require "complex"
+require "rational"
+
+describe "Complex#** when given 0" do
+  it "returns Complex(1)" do
+    (Complex(3, 4) ** 0).should eql(Complex(1))
+    (Complex(10, 20) ** 0.0).should eql(Complex(1))
+  end
+end
+
+describe "Complex#** with Complex" do
+  it "returns self raised to the given power" do
+    (Complex(2, 1) ** Complex(2, 1)).should be_close(Complex(-0.504824688978319, 3.10414407699553), TOLERANCE)
+    (Complex(2, 1) ** Complex(3, 4)).should be_close(Complex(-0.179174656916581, -1.74071656397662), TOLERANCE)
+    
+    (Complex(2, 1) ** Complex(-2, -1)).should be_close(Complex(-0.051041070450869, -0.313849223270419), TOLERANCE)
+    (Complex(-2, -1) ** Complex(2, 1)).should be_close(Complex(-11.6819929610857, 71.8320439736158), TOLERANCE)
+  end
+end
+
+describe "Complex#** with Integer" do
+  it "returns self raised to the given power" do
+    (Complex(2, 1) ** 2).should == Complex(3, 4)
+    (Complex(3, 4) ** 2).should == Complex(-7, 24)
+    (Complex(3, 4) ** -2).should be_close(Complex(-0.0112, -0.0384), TOLERANCE)
+
+    
+    (Complex(2, 1) ** 2.5).should be_close(Complex(2.99179707178602, 6.85206901006896), TOLERANCE)
+    (Complex(3, 4) ** 2.5).should be_close(Complex(-38.0, 41.0), TOLERANCE)
+    (Complex(3, 4) ** -2.5).should be_close(Complex(-0.01216, -0.01312), TOLERANCE)
+
+    # NOTE: Takes way too long...
+    #(Complex(2, 1) ** bignum_value)
+  end
+end
+
+describe "Complex#** with Rational" do
+  it "returns self raised to the given power" do
+    (Complex(2, 1) ** Rational(3, 4)).should be_close(Complex(1.71913265276568, 0.623124744394697), TOLERANCE)
+    (Complex(2, 1) ** Rational(4, 3)).should be_close(Complex(2.3828547125173, 1.69466313833091), TOLERANCE)
+    (Complex(2, 1) ** Rational(-4, 3)).should be_close(Complex(0.278700377879388, -0.198209003071003), TOLERANCE)
+  end
+end
+
+describe "Complex#** with Object" do
+  it "tries to coerce self into other" do
+    value = Complex(3, 9)
+    
+    obj = mock("Object")
+    obj.should_receive(:coerce).with(value).and_return([2, 5])
+    (value ** obj).should == 2 ** 5
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/complex/generic_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/generic_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/generic_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'complex'
+require "rational"
+
+describe "Complex.generic?" do
+  it "returns true when given an Integer, Float or Rational" do
+    Complex.generic?(1).should == true
+    Complex.generic?(-1).should == true
+
+    Complex.generic?(20.3).should == true
+    Complex.generic?(-20.3).should == true
+
+    Complex.generic?(bignum_value).should == true
+    Complex.generic?(-bignum_value).should == true
+
+    Complex.generic?(Rational(3, 4)).should == true
+    Complex.generic?(-Rational(3, 4)).should == true
+    
+    Complex.generic?(:symbol).should == false
+    Complex.generic?("string").should == false
+    Complex.generic?(mock("Object")).should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/hash_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/hash_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/hash_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'complex'
+
+describe "Complex#hash" do
+  # NOTE:
+  # Complex(2, 1).hash == Complex(1, 2).hash
+  # This can result in Bugs when using hash and
+  # other stuff that relies on #hash
+  it "should be static" do
+    Complex(1).hash.should    == Complex(1).hash
+    Complex(1, 0).hash.should == Complex(1).hash
+    Complex(1, 1).hash.should == Complex(1, 1).hash
+    
+    Complex(1, 2).hash.should_not == Complex(1, 1).hash
+    Complex(2, 1).hash.should_not == Complex(1, 1).hash
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/imag_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/imag_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/imag_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/image'
+require 'complex'
+
+describe "Complex#imag" do
+  it_behaves_like(:complex_image, :imag)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/image_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/image_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/image_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/image'
+require 'complex'
+
+describe "Complex#image" do
+  it_behaves_like(:complex_image, :image)
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/complex/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'complex'
+
+describe "Complex#inspect" do
+  it %{returns "Complex(real, image)"} do
+    # Guard against the Mathn library
+    conflicts_with :Prime do
+      Complex(1).inspect.should == "Complex(1, 0)"
+      Complex(7).inspect.should == "Complex(7, 0)"
+    end
+
+    Complex(-1, 4).inspect.should == "Complex(-1, 4)"
+    Complex(-7, 6.7).inspect.should == "Complex(-7, 6.7)"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/acos_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/acos_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/acos_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/acos'
+
+describe "Math#acos" do
+  it_behaves_like :complex_math_acos, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:acos)
+  end
+end
+
+describe "Math#acos!" do
+  it_behaves_like :complex_math_acos_bang, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:acos!)
+  end
+end
+
+describe "Math.acos" do
+  it_behaves_like :complex_math_acos, :_, Math
+end
+
+describe "Math.acos!" do
+  it_behaves_like :complex_math_acos_bang, :_, Math
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/acosh_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/acosh_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/acosh_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/acosh'
+
+describe "Math#acosh" do
+  it_behaves_like :complex_math_acosh, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:acosh)
+  end
+end
+
+describe "Math#acosh!" do
+  it_behaves_like :complex_math_acosh_bang, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:acosh!)
+  end
+end
+
+describe "Math.acosh" do
+  it_behaves_like :complex_math_acosh, :_, Math
+end
+
+describe "Math.acosh!" do
+  it_behaves_like :complex_math_acosh_bang, :_, Math
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/asin_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/asin_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/asin_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/asin'
+
+describe "Math#asin" do
+  it_behaves_like :complex_math_asin, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:asin)
+  end
+end
+
+describe "Math#asin!" do
+  it_behaves_like :complex_math_asin_bang, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:asin!)
+  end
+end
+
+describe "Math.asin" do
+  it_behaves_like :complex_math_asin, :_, Math
+end
+
+describe "Math.asin!" do
+  it_behaves_like :complex_math_asin_bang, :_, Math
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/asinh_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/asinh_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/asinh_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/asinh'
+
+describe "Math#asinh" do
+  it_behaves_like :complex_math_asinh, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:asinh)
+  end
+end
+
+describe "Math#asinh!" do
+  it_behaves_like :complex_math_asinh_bang, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:asinh!)
+  end
+end
+
+describe "Math.asinh" do
+  it_behaves_like :complex_math_asinh, :_, Math
+end
+
+describe "Math.asinh!" do
+  it_behaves_like :complex_math_asinh_bang, :_, Math
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/atan2_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/atan2_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/atan2_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/atan2'
+
+describe "Math#atan2" do
+  it_behaves_like :complex_math_atan2, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:atan2)
+  end
+end
+
+describe "Math#atan2!" do
+  it_behaves_like :complex_math_atan2_bang, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:atan2!)
+  end
+end
+
+describe "Math.atan2" do
+  it_behaves_like :complex_math_atan2, :_, Math
+end
+
+describe "Math.atan2!" do
+  it_behaves_like :complex_math_atan2_bang, :_, Math
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/atan_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/atan_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/atan_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/atan'
+
+describe "Math#atan" do
+  it_behaves_like :complex_math_atan, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:atan)
+  end
+end
+
+describe "Math#atan!" do
+  it_behaves_like :complex_math_atan_bang, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:atan!)
+  end
+end
+
+describe "Math.atan" do
+  it_behaves_like :complex_math_atan, :_, Math
+end
+
+describe "Math.atan!" do
+  it_behaves_like :complex_math_atan_bang, :_, Math
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/atanh_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/atanh_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/atanh_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/atanh'
+
+describe "Math#atanh" do
+  it_behaves_like :complex_math_atanh, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:atanh)
+  end
+end
+
+describe "Math#atanh!" do
+  it_behaves_like :complex_math_atanh_bang, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:atanh!)
+  end
+end
+
+describe "Math.atanh" do
+  it_behaves_like :complex_math_atanh, :_, Math
+end
+
+describe "Math.atanh!" do
+  it_behaves_like :complex_math_atanh_bang, :_, Math
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/cos_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/cos_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/cos_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/cos'
+
+describe "Math#cos" do
+  it_behaves_like :complex_math_cos, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:cos)
+  end
+end
+
+describe "Math#cos!" do
+  it_behaves_like :complex_math_cos_bang, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:cos!)
+  end
+end
+
+describe "Math.cos" do
+  it_behaves_like :complex_math_cos, :_, Math
+end
+
+describe "Math.cos!" do
+  it_behaves_like :complex_math_cos_bang, :_, Math
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/cosh_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/cosh_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/cosh_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/cosh'
+
+describe "Math#cosh" do
+  it_behaves_like :complex_math_cosh, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:cosh)
+  end
+end
+
+describe "Math#cosh!" do
+  it_behaves_like :complex_math_cosh_bang, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:cosh!)
+  end
+end
+
+describe "Math.cosh" do
+  it_behaves_like :complex_math_cosh, :_, Math
+end
+
+describe "Math.cosh!" do
+  it_behaves_like :complex_math_cosh_bang, :_, Math
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/exp_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/exp_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/exp_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/exp'
+
+describe "Math#exp" do
+  it_behaves_like :complex_math_exp, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:exp)
+  end
+end
+
+describe "Math#exp!" do
+  it_behaves_like :complex_math_exp_bang, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:exp!)
+  end
+end
+
+describe "Math.exp" do
+  it_behaves_like :complex_math_exp, :_, Math
+end
+
+describe "Math.exp!" do
+  it_behaves_like :complex_math_exp_bang, :_, Math
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+class IncludesMath
+  include Math
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/log10_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/log10_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/log10_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/log10'
+
+describe "Math#log10" do
+  it_behaves_like :complex_math_log10, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:log10)
+  end
+end
+
+describe "Math#log10!" do
+  it_behaves_like :complex_math_log10_bang, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:log10!)
+  end
+end
+
+describe "Math.log10" do
+  it_behaves_like :complex_math_log10, :_, Math
+end
+
+describe "Math.log10!" do
+  it_behaves_like :complex_math_log10_bang, :_, Math
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/log_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/log_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/log_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/log'
+
+describe "Math#log" do
+  it_behaves_like :complex_math_log, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:log)
+  end
+end
+
+describe "Math#log!" do
+  it_behaves_like :complex_math_log_bang, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:log!)
+  end
+end
+
+describe "Math.log" do
+  it_behaves_like :complex_math_log, :_, Math
+end
+
+describe "Math.log!" do
+  it_behaves_like :complex_math_log_bang, :_, Math
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/acos.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/acos.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/acos.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,42 @@
+require 'complex'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe :complex_math_acos, :shared => true do
+  it "returns the arccosine of the passed argument" do
+    @object.send(:acos, 1).should be_close(0.0, TOLERANCE)
+    @object.send(:acos, 0).should be_close(1.5707963267949, TOLERANCE)
+    @object.send(:acos, -1).should be_close(Math::PI,TOLERANCE)
+  end
+
+  it "returns the arccosine for Complex numbers" do
+    @object.send(:acos, Complex(3, 4)).should be_close(Complex(0.93681246115572, -2.30550903124348), TOLERANCE)
+  end
+
+  it "returns the arccosine for numbers greater than 1.0 as a Complex number" do
+    @object.send(:acos, 1.0001).should be_close(Complex(0.0, 0.0141420177752494), TOLERANCE)
+  end
+
+  it "returns the arccosine for numbers less than -1.0 as a Complex number" do
+    @object.send(:acos, -1.0001).should be_close(Complex(3.14159265358979, -0.0141420177752495), TOLERANCE)
+  end
+end
+
+describe :complex_math_acos_bang, :shared => true do
+  it "returns the arccosine of the argument" do
+    @object.send(:acos!, 1).should be_close(0.0, TOLERANCE)
+    @object.send(:acos!, 0).should be_close(1.5707963267949, TOLERANCE)
+    @object.send(:acos!, -1).should be_close(Math::PI,TOLERANCE)
+  end
+
+  it "raises a TypeError when passed a Complex number" do
+    lambda { @object.send(:acos!, Complex(4, 5)) }.should raise_error(TypeError)
+  end
+
+  it "raises an Errno::EDOM for numbers greater than 1.0" do
+    lambda { @object.send(:acos!, 1.0001) }.should raise_error(Errno::EDOM)
+  end
+
+  it "raises an Errno::EDOM for numbers less than -1.0" do
+    lambda { @object.send(:acos!, -1.0001) }.should raise_error(Errno::EDOM)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/acosh.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/acosh.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/acosh.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,36 @@
+require 'complex'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe :complex_math_acosh, :shared => true do
+  it "returns the principle value of the inverse hyperbolic cosine of the argument" do
+    @object.send(:acosh, 14.2).should be_close(3.345146999647, TOLERANCE)
+    @object.send(:acosh, 1.0).should be_close(0.0, TOLERANCE)
+  end
+
+  it "returns the principle value of the inverse hyperbolic cosine for numbers less than 1.0 as a Complex number" do
+    @object.send(:acosh, 1.0 - TOLERANCE).should be_close(Complex(0.0, 0.00774598605746135), TOLERANCE)
+    @object.send(:acosh, 0).should be_close(Complex(0.0, 1.5707963267949), TOLERANCE)
+    @object.send(:acosh, -1.0).should be_close(Complex(0.0, 3.14159265358979), TOLERANCE)
+  end
+
+  it "returns the principle value of the inverse hyperbolic cosine for Complex numbers" do
+    @object.send(:acosh, Complex(3, 4)).should be_close(Complex(2.30550903124348, 0.93681246115572), TOLERANCE)
+  end
+end
+
+describe :complex_math_acosh_bang, :shared => true do
+  it "returns the principle value of the inverse hyperbolic cosine of the argument" do
+    @object.send(:acosh!, 14.2).should be_close(3.345146999647, TOLERANCE)
+    @object.send(:acosh!, 1.0).should be_close(0.0, TOLERANCE)
+  end
+
+  it "raises Errno::EDOM for numbers less than 1.0" do
+    lambda { @object.send(:acosh!, 1.0 - TOLERANCE) }.should raise_error(Errno::EDOM)
+    lambda { @object.send(:acosh!, 0) }.should raise_error(Errno::EDOM)
+    lambda { @object.send(:acosh!, -1.0) }.should raise_error(Errno::EDOM)
+  end
+
+  it "raises a TypeError when passed a Complex number" do
+    lambda { @object.send(:acosh!, Complex(4, 5)) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/asin.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/asin.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/asin.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,48 @@
+require 'complex'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe :complex_math_asin, :shared => true do
+  it "returns the arcsine of the argument" do
+    @object.send(:asin, 1).should be_close(Math::PI/2, TOLERANCE)
+    @object.send(:asin, 0).should be_close(0.0, TOLERANCE)
+    @object.send(:asin, -1).should be_close(-Math::PI/2, TOLERANCE)
+    @object.send(:asin, 0.25).should be_close(0.252680255142079, TOLERANCE)
+    @object.send(:asin, 0.50).should be_close(0.523598775598299, TOLERANCE)
+    @object.send(:asin, 0.75).should be_close(0.8480620789814816,TOLERANCE)
+  end
+
+  it "returns the arcsine for Complex numbers" do
+    @object.send(:asin, Complex(3, 4)).should be_close(Complex(0.633983865639174, 2.30550903124347), TOLERANCE)
+  end
+
+  it "returns a Complex number when the argument is greater than 1.0" do
+    @object.send(:asin, 1.0001).should be_close(Complex(1.5707963267949, -0.0141420177752494), TOLERANCE)
+  end
+
+  it "returns a Complex number when the argument is less than -1.0" do
+    @object.send(:asin, -1.0001).should be_close(Complex(-1.5707963267949, 0.0141420177752494), TOLERANCE)
+  end
+end
+
+describe :complex_math_asin_bang, :shared => true do
+  it "returns the arcsine of the argument" do
+    @object.send(:asin!, 1).should be_close(Math::PI/2, TOLERANCE)
+    @object.send(:asin!, 0).should be_close(0.0, TOLERANCE)
+    @object.send(:asin!, -1).should be_close(-Math::PI/2, TOLERANCE)
+    @object.send(:asin!, 0.25).should be_close(0.252680255142079, TOLERANCE)
+    @object.send(:asin!, 0.50).should be_close(0.523598775598299, TOLERANCE)
+    @object.send(:asin!, 0.75).should be_close(0.8480620789814816,TOLERANCE)
+  end
+
+  it "raises an Errno::EDOM if the argument is greater than 1.0" do
+    lambda { @object.send(:asin!, 1.0001) }.should raise_error( Errno::EDOM)
+  end
+
+  it "raises an Errno::EDOM if the argument is less than -1.0" do
+    lambda { @object.send(:asin!, -1.0001) }.should raise_error( Errno::EDOM)
+  end
+
+  it "raises a TypeError when passed a Complex number" do
+    lambda { @object.send(:asin!, Complex(4, 5)) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/asinh.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/asinh.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/asinh.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require 'complex'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe :complex_math_asinh, :shared => true do
+  it "returns the inverse hyperbolic sin of the argument" do
+    @object.send(:asinh, 1.5).should be_close(1.19476321728711, TOLERANCE)
+    @object.send(:asinh, -2.97).should be_close(-1.8089166921397, TOLERANCE)
+    @object.send(:asinh, 0.0).should == 0.0
+    @object.send(:asinh, -0.0).should == -0.0
+    @object.send(:asinh, 1.05367e-08).should be_close(1.05367e-08, TOLERANCE)
+    @object.send(:asinh, -1.05367e-08).should be_close(-1.05367e-08, TOLERANCE)
+  end
+
+  it "returns the inverse hyperbolic sin for Complex numbers" do
+    @object.send(:asinh, Complex(3, 4)).should be_close(Complex(2.29991404087927, 0.917616853351479), TOLERANCE)
+    @object.send(:asinh, Complex(3.5, -4)).should be_close(Complex(2.36263337274419, -0.843166327537659), TOLERANCE)
+  end
+end
+
+describe :complex_math_asinh_bang, :shared => true do
+  it "returns the inverse hyperbolic sin of the argument" do
+    @object.send(:asinh!, 1.5).should be_close(1.19476321728711, TOLERANCE)
+    @object.send(:asinh!, -2.97).should be_close(-1.8089166921397, TOLERANCE)
+    @object.send(:asinh!, 0.0).should == 0.0
+    @object.send(:asinh!, -0.0).should == -0.0
+    @object.send(:asinh!, 1.05367e-08).should be_close(1.05367e-08, TOLERANCE)
+    @object.send(:asinh!, -1.05367e-08).should be_close(-1.05367e-08, TOLERANCE)
+  end
+
+  it "raises a TypeError when passed a Complex number" do
+    lambda { @object.send(:asinh!, Complex(4, 5)) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/atan.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/atan.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/atan.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require 'complex'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe :complex_math_atan, :shared => true do
+  it "returns the arctangent of the argument" do
+    @object.send(:atan, 1).should be_close(Math::PI/4, TOLERANCE)
+    @object.send(:atan, 0).should be_close(0.0, TOLERANCE)
+    @object.send(:atan, -1).should be_close(-Math::PI/4, TOLERANCE)
+    @object.send(:atan, 0.25).should be_close(0.244978663126864, TOLERANCE)
+    @object.send(:atan, 0.50).should be_close(0.463647609000806, TOLERANCE)
+    @object.send(:atan, 0.75).should be_close(0.643501108793284, TOLERANCE)
+  end
+
+  it "returns the arctangent for Complex numbers" do
+    @object.send(:atan, Complex(3, 4)).should be_close(Complex(1.44830699523146, 0.158997191679999), TOLERANCE)
+    @object.send(:atan, Complex(3.5, -4)).should be_close(Complex(1.44507428165589, -0.140323762363786), TOLERANCE)
+  end
+end
+
+describe :complex_math_atan_bang, :shared => true do
+  it "returns the arctangent of the argument" do
+    @object.send(:atan!, 1).should be_close(Math::PI/4, TOLERANCE)
+    @object.send(:atan!, 0).should be_close(0.0, TOLERANCE)
+    @object.send(:atan!, -1).should be_close(-Math::PI/4, TOLERANCE)
+    @object.send(:atan!, 0.25).should be_close(0.244978663126864, TOLERANCE)
+    @object.send(:atan!, 0.50).should be_close(0.463647609000806, TOLERANCE)
+    @object.send(:atan!, 0.75).should be_close(0.643501108793284, TOLERANCE)
+  end
+
+  it "raises a TypeError when passed a Complex number" do
+    lambda { @object.send(:atan!, Complex(4, 5)) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/atan2.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/atan2.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/atan2.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+require 'complex'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe :complex_math_atan2, :shared => true do
+  it "returns the arc tangent of the passed arguments" do
+    @object.send(:atan2, 4.2, 0.3).should be_close(1.49948886200961, TOLERANCE)
+    @object.send(:atan2, 0.0, 1.0).should be_close(0.0, TOLERANCE)
+    @object.send(:atan2, -9.1, 3.2).should be_close(-1.23265379809025, TOLERANCE)
+    @object.send(:atan2, 7.22, -3.3).should be_close(1.99950888779256, TOLERANCE)
+  end
+
+  it "returns the arc tangent for two Complex numbers" do
+    Math.atan2(Complex(3, 4), Complex(3.5, -4)).should be_close(Complex(-0.641757436698881, 1.10829873031207), TOLERANCE)
+  end
+
+  it "returns the arc tangeng for Complex and real numbers" do
+    Math.atan2(Complex(3, 4), -7).should be_close(Complex(2.61576754731561, -0.494290673139855), TOLERANCE)
+    Math.atan2(5, Complex(3.5, -4)).should be_close(Complex(0.739102348493673, 0.487821626522923), TOLERANCE)
+  end
+end
+
+describe :complex_math_atan2_bang, :shared => true do
+  it "returns the arc tangent of the passed arguments" do
+    @object.send(:atan2!, 4.2, 0.3).should be_close(1.49948886200961, TOLERANCE)
+    @object.send(:atan2!, 0.0, 1.0).should be_close(0.0, TOLERANCE)
+    @object.send(:atan2!, -9.1, 3.2).should be_close(-1.23265379809025, TOLERANCE)
+    @object.send(:atan2!, 7.22, -3.3).should be_close(1.99950888779256, TOLERANCE)
+  end
+
+  it "raises a TypeError when passed a Complex number" do
+    lambda { @object.send(:atan2!, Complex(4, 5), Complex(4, 5)) }.should raise_error(TypeError)
+    lambda { @object.send(:atan2!, 4, Complex(4, 5)) }.should raise_error(TypeError)
+    lambda { @object.send(:atan2!, Complex(4, 5), 5) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/atanh.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/atanh.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/atanh.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,92 @@
+require 'complex'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe :complex_math_atanh, :shared => true do
+  it "returns the inverse hyperbolic tangent of the argument" do
+    @object.send(:atanh, 0.0).should == 0.0
+    @object.send(:atanh, -0.0).should == -0.0
+    @object.send(:atanh, 0.5).should be_close(0.549306144334055, TOLERANCE)
+    @object.send(:atanh, -0.2).should be_close(-0.202732554054082, TOLERANCE)
+  end
+
+  platform_is :darwin, :freebsd, :java do
+    it "returns Infinity for 1.0" do
+      @object.send(:atanh, 1.0).infinite?.should == 1
+    end
+
+    it "returns -Infinity for -1.0" do
+      @object.send(:atanh, -1.0).infinite?.should == -1
+    end
+  end
+
+  platform_is :windows, :linux, :openbsd do
+    # jruby is cross-platform and behaves as :darwin above
+    not_compliant_on :jruby do
+      it "raises an Errno::EDOM if x = 1.0" do
+        lambda { @object.send(:atanh, 1.0) }.should raise_error(Errno::EDOM)
+      end
+
+      it "raises an Errno::EDOM if x = -1.0" do
+        lambda { @object.send(:atanh, -1.0) }.should raise_error(Errno::EDOM)
+      end
+    end
+  end
+
+  it "returns the inverse hyperbolic tangent as a Complex number for arguments greater than 1.0" do
+    @object.send(:atanh, 1.0 + TOLERANCE).should be_close(Complex(5.55373767837521, 1.5707963267949), TOLERANCE)
+    @object.send(:atanh, 10).should be_close(Complex(0.100335347731076, 1.5707963267949), TOLERANCE)
+  end
+
+  it "returns the inverse hyperbolic tangent as a Complex number for arguments greater than 1.0" do
+    @object.send(:atanh, -1.0 - TOLERANCE).should be_close(Complex(-5.55373767837521, 1.5707963267949), TOLERANCE)
+    @object.send(:atanh, 10).should be_close(Complex(0.100335347731076, 1.5707963267949), TOLERANCE)
+  end
+
+  it "returns the inverse hyperbolic tangent for Complex numbers" do
+    @object.send(:atanh, Complex(3, 4)).should be_close(Complex(0.117500907311434, 1.40992104959658), TOLERANCE)
+  end
+end
+
+describe :complex_math_atanh_bang, :shared => true do
+  it "returns the inverse hyperbolic tangent of the argument" do
+    @object.send(:atanh!, 0.0).should == 0.0
+    @object.send(:atanh!, -0.0).should == -0.0
+    @object.send(:atanh!, 0.5).should be_close(0.549306144334055, TOLERANCE)
+    @object.send(:atanh!, -0.2).should be_close(-0.202732554054082, TOLERANCE)
+  end
+
+  platform_is :darwin, :freebsd, :java do
+    it "returns Infinity for 1.0" do
+      @object.send(:atanh!, 1.0).infinite?.should == 1
+    end
+
+    it "returns -Infinity for -1.0" do
+      @object.send(:atanh!, -1.0).infinite?.should == -1
+    end
+  end
+
+  platform_is :windows, :linux, :openbsd do
+    # jruby is cross-platform and behaves as :darwin above
+    not_compliant_on :jruby do
+      it "raises an Errno::EDOM if x = 1.0" do
+        lambda { @object.send(:atanh!, 1.0) }.should raise_error(Errno::EDOM)
+      end
+
+      it "raises an Errno::EDOM if x = -1.0" do
+        lambda { @object.send(:atanh!, -1.0) }.should raise_error(Errno::EDOM)
+      end
+    end
+  end
+
+  it "raises an Errno::EDOM for arguments greater than 1.0" do
+    lambda { @object.send(:atanh!, 1.0 + TOLERANCE)  }.should raise_error(Errno::EDOM)
+  end
+
+  it "raises an Errno::EDOM for arguments less than -1.0" do
+    lambda { @object.send(:atanh!, -1.0 - TOLERANCE) }.should raise_error(Errno::EDOM)
+  end
+
+  it "raises a TypeError when passed a Complex number" do
+    lambda { @object.send(:atanh!, Complex(4, 5)) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/cos.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/cos.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/cos.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require 'complex'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe :complex_math_cos, :shared => true do
+  it "returns the cosine of the argument expressed in radians" do
+    @object.send(:cos, Math::PI).should be_close(-1.0, TOLERANCE)
+    @object.send(:cos, 0).should be_close(1.0, TOLERANCE)
+    @object.send(:cos, Math::PI/2).should be_close(0.0, TOLERANCE)
+    @object.send(:cos, 3*Math::PI/2).should be_close(0.0, TOLERANCE)
+    @object.send(:cos, 2*Math::PI).should be_close(1.0, TOLERANCE)
+  end
+
+  it "returns the cosine for Complex numbers" do
+    @object.send(:cos, Complex(0, Math::PI)).should be_close(Complex(11.5919532755215, 0.0), TOLERANCE)
+    @object.send(:cos, Complex(3, 4)).should be_close(Complex(-27.0349456030742, -3.85115333481178), TOLERANCE)
+  end
+end
+
+describe :complex_math_cos_bang, :shared => true do
+  it "returns the cosine of the argument expressed in radians" do
+    @object.send(:cos!, Math::PI).should be_close(-1.0, TOLERANCE)
+    @object.send(:cos!, 0).should be_close(1.0, TOLERANCE)
+    @object.send(:cos!, Math::PI/2).should be_close(0.0, TOLERANCE)
+    @object.send(:cos!, 3*Math::PI/2).should be_close(0.0, TOLERANCE)
+    @object.send(:cos!, 2*Math::PI).should be_close(1.0, TOLERANCE)
+  end
+
+  it "raises a TypeError when passed a Complex number" do
+    lambda { @object.send(:cos!, Complex(3, 4)) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/cosh.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/cosh.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/cosh.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require 'complex'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe :complex_math_cosh, :shared => true do
+  it "returns the hyperbolic cosine of the passed argument" do
+    @object.send(:cosh, 0.0).should == 1.0
+    @object.send(:cosh, -0.0).should == 1.0
+    @object.send(:cosh, 1.5).should be_close(2.35240961524325, TOLERANCE)
+    @object.send(:cosh, -2.99).should be_close(9.96798496414416, TOLERANCE)
+  end
+
+  it "returns the hyperbolic cosine for Complex numbers" do
+    @object.send(:cosh, Complex(0, Math::PI)).should be_close(Complex(-1.0, 0.0), TOLERANCE)
+    @object.send(:cosh, Complex(3, 4)).should be_close(Complex(-6.58066304055116, -7.58155274274654), TOLERANCE)
+  end
+end
+
+describe :complex_math_cosh_bang, :shared => true do
+  it "returns the hyperbolic cosine of the passed argument" do
+    @object.send(:cosh!, 0.0).should == 1.0
+    @object.send(:cosh!, -0.0).should == 1.0
+    @object.send(:cosh!, 1.5).should be_close(2.35240961524325, TOLERANCE)
+    @object.send(:cosh!, -2.99).should be_close(9.96798496414416, TOLERANCE)
+  end
+
+  it "raises a TypeError when passed a Complex number" do
+    lambda { @object.send(:cosh!, Complex(4, 5)) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/exp.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/exp.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/exp.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require 'complex'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe :complex_math_exp, :shared => true do
+  it "returns the base-e exponential of the passed argument" do
+    @object.send(:exp, 0.0).should == 1.0
+    @object.send(:exp, -0.0).should == 1.0
+    @object.send(:exp, -1.8).should be_close(0.165298888221587, TOLERANCE)
+    @object.send(:exp, 1.25).should be_close(3.49034295746184, TOLERANCE)
+  end
+
+  it "returns the base-e exponential for Complex numbers" do
+    @object.send(:exp, Complex(0, 0)).should == Complex(1.0, 0.0)
+    @object.send(:exp, Complex(1, 3)).should be_close(Complex(-2.69107861381979, 0.383603953541131), TOLERANCE)
+  end
+end
+
+describe :complex_math_exp_bang, :shared => true do
+  it "returns the base-e exponential of the passed argument" do
+    @object.send(:exp!, 0.0).should == 1.0
+    @object.send(:exp!, -0.0).should == 1.0
+    @object.send(:exp!, -1.8).should be_close(0.165298888221587, TOLERANCE)
+    @object.send(:exp!, 1.25).should be_close(3.49034295746184, TOLERANCE)
+  end
+
+  it "raises a TypeError when passed a Complex number" do
+    lambda { @object.send(:exp!, Complex(1, 3)) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/log.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/log.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/log.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,40 @@
+require 'complex'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe :complex_math_log, :shared => true do
+  it "returns the natural logarithm of the passed argument" do
+    @object.send(:log, 0.0001).should be_close(-9.21034037197618, TOLERANCE)
+    @object.send(:log, 0.000000000001e-15).should be_close(-62.1697975108392, TOLERANCE)
+    @object.send(:log, 1).should be_close(0.0, TOLERANCE)
+    @object.send(:log, 10).should be_close( 2.30258509299405, TOLERANCE)
+    @object.send(:log, 10e15).should be_close(36.8413614879047, TOLERANCE)
+  end
+
+  it "returns the natural logarithm for Complex numbers" do
+    @object.send(:log, Complex(3, 4)).should be_close(Complex(1.6094379124341, 0.927295218001612), TOLERANCE)
+    @object.send(:log, Complex(-3, 4)).should be_close(Complex(1.6094379124341, 2.21429743558818), TOLERANCE)
+  end
+
+  it "returns the natural logarithm for negative numbers as a Complex number" do
+    @object.send(:log, -10).should be_close(Complex(2.30258509299405, 3.14159265358979), TOLERANCE)
+    @object.send(:log, -20).should be_close(Complex(2.99573227355399, 3.14159265358979), TOLERANCE)
+  end
+end
+
+describe :complex_math_log_bang, :shared => true do
+  it "returns the natural logarithm of the argument" do
+    @object.send(:log!, 0.0001).should be_close(-9.21034037197618, TOLERANCE)
+    @object.send(:log!, 0.000000000001e-15).should be_close(-62.1697975108392, TOLERANCE)
+    @object.send(:log!, 1).should be_close(0.0, TOLERANCE)
+    @object.send(:log!, 10).should be_close( 2.30258509299405, TOLERANCE)
+    @object.send(:log!, 10e15).should be_close(36.8413614879047, TOLERANCE)
+  end
+
+  it "raises an Errno::EDOM if the argument is less than 0" do
+    lambda { @object.send(:log!, -10) }.should raise_error(Errno::EDOM)
+  end
+
+  it "raises a TypeError when passed a Complex number" do
+    lambda { @object.send(:log!, Complex(4, 5)) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/log10.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/log10.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/log10.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,42 @@
+require 'complex'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe :complex_math_log10, :shared => true do
+  it "returns the base-10 logarithm of the passed argument" do
+    @object.send(:log10, 0.0001).should be_close(-4.0, TOLERANCE)
+    @object.send(:log10, 0.000000000001e-15).should be_close(-27.0, TOLERANCE)
+    @object.send(:log10, 1).should be_close(0.0, TOLERANCE)
+    @object.send(:log10, 10).should be_close(1.0, TOLERANCE)
+    @object.send(:log10, 10e15).should be_close(16.0, TOLERANCE)
+  end
+
+  it "returns the base-10 logarithm for Complex numbers" do
+    @object.send(:log10, Complex(3, 4)).should be_close(Complex(0.698970004336019, 0.402719196273373), TOLERANCE)
+    @object.send(:log10, Complex(-3, 4)).should be_close(Complex(0.698970004336019, 0.961657157568468), TOLERANCE)
+  end
+
+  # BUG: does not work correctly, because Math#log10
+  # does not check for negative values
+  #it "returns the base-10 logarithm for negative numbers as a Complex number" do
+  #  @object.send(:log10, -10).should be_close(Complex(2.30258509299405, 3.14159265358979), TOLERANCE)
+  #  @object.send(:log10, -20).should be_close(Complex(2.99573227355399, 3.14159265358979), TOLERANCE)
+  #end
+end
+
+describe :complex_math_log10_bang, :shared => true do
+  it "returns the base-10 logarithm of the argument" do
+    @object.send(:log10!, 0.0001).should be_close(-4.0, TOLERANCE)
+    @object.send(:log10!, 0.000000000001e-15).should be_close(-27.0, TOLERANCE)
+    @object.send(:log10!, 1).should be_close(0.0, TOLERANCE)
+    @object.send(:log10!, 10).should be_close(1.0, TOLERANCE)
+    @object.send(:log10!, 10e15).should be_close(16.0, TOLERANCE)
+  end
+
+  it "raises an Errno::EDOM when the passed argument is negative" do
+    lambda { @object.send(:log10!, -10) }.should raise_error(Errno::EDOM)
+  end
+
+  it "raises a TypeError when passed a Complex number" do
+    lambda { @object.send(:log10!, Complex(4, 5)) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/sin.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/sin.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/sin.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require 'complex'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe :complex_math_sin, :shared => true do
+  it "returns the sine of the passed argument expressed in radians" do
+    @object.send(:sin, Math::PI).should be_close(0.0, TOLERANCE)
+    @object.send(:sin, 0).should be_close(0.0, TOLERANCE)
+    @object.send(:sin, Math::PI/2).should be_close(1.0, TOLERANCE)
+    @object.send(:sin, 3*Math::PI/2).should be_close(-1.0, TOLERANCE)
+    @object.send(:sin, 2*Math::PI).should be_close(0.0, TOLERANCE)
+  end
+
+  it "returns the sine for Complex numbers" do
+    @object.send(:sin, Complex(0, Math::PI)).should be_close(Complex(0.0, 11.5487393572577), TOLERANCE)
+    @object.send(:sin, Complex(3, 4)).should be_close(Complex(3.85373803791938, -27.0168132580039), TOLERANCE)
+  end
+end
+
+describe :complex_math_sin_bang, :shared => true do
+  it "returns the sine of the passed argument expressed in radians" do
+    @object.send(:sin!, Math::PI).should be_close(0.0, TOLERANCE)
+    @object.send(:sin!, 0).should be_close(0.0, TOLERANCE)
+    @object.send(:sin!, Math::PI/2).should be_close(1.0, TOLERANCE)
+    @object.send(:sin!, 3*Math::PI/2).should be_close(-1.0, TOLERANCE)
+    @object.send(:sin!, 2*Math::PI).should be_close(0.0, TOLERANCE)
+  end
+
+  it "raises a TypeError when passed a Complex number" do
+    lambda { @object.send(:sin!, Complex(4, 5)) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/sinh.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/sinh.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/sinh.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require 'complex'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe :complex_math_sinh, :shared => true do
+  it "returns the hyperbolic sin of the argument" do
+    @object.send(:sinh, 0.0).should == 0.0
+    @object.send(:sinh, -0.0).should == 0.0
+    @object.send(:sinh, 1.5).should be_close(2.12927945509482, TOLERANCE)
+    @object.send(:sinh, -2.8).should be_close(-8.19191835423591, TOLERANCE)
+  end
+
+  it "returns the hyperbolic sin for Complex numbers" do
+    @object.send(:sinh, Complex(0, Math::PI)).should be_close(Complex(-0.0, 1.22464679914735e-16), TOLERANCE)
+    @object.send(:sinh, Complex(3, 4)).should be_close(Complex(-6.548120040911, -7.61923172032141), TOLERANCE)
+  end
+end
+
+describe :complex_math_sinh_bang, :shared => true do
+  it "returns the hyperbolic sin of the argument" do
+    @object.send(:sinh!, 0.0).should == 0.0
+    @object.send(:sinh!, -0.0).should == 0.0
+    @object.send(:sinh!, 1.5).should be_close(2.12927945509482, TOLERANCE)
+    @object.send(:sinh!, -2.8).should be_close(-8.19191835423591, TOLERANCE)
+  end
+
+  it "raises a TypeError when passed a Complex number" do
+    lambda { @object.send(:sinh!, Complex(4, 5)) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/sqrt.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/sqrt.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/sqrt.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+require 'complex'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe :complex_math_sqrt, :shared => true do
+  it "returns the square root for positive numbers" do
+    @object.send(:sqrt, 4).should == 2
+    @object.send(:sqrt, 19.36).should == 4.4
+  end
+
+  it "returns the square root for negative numbers" do
+    @object.send(:sqrt, -4).should == Complex(0, 2.0)
+    @object.send(:sqrt, -19.36).should == Complex(0, 4.4)
+  end
+
+  it "returns the square root for Complex numbers" do
+    @object.send(:sqrt, Complex(4, 5)).should be_close(Complex(2.2806933416653, 1.09615788950152), TOLERANCE)
+    @object.send(:sqrt, Complex(4, -5)).should be_close(Complex(2.2806933416653, -1.09615788950152), TOLERANCE)
+  end
+end
+
+describe :complex_math_sqrt_bang, :shared => true do
+  it "returns the square root for positive numbers" do
+    @object.send(:sqrt!, 4).should == 2
+    @object.send(:sqrt!, 19.36).should == 4.4
+  end
+
+  it "raises Errno::EDOM when the passed argument is negative" do
+    lambda { @object.send(:sqrt!, -4) }.should raise_error(Errno::EDOM)
+    lambda { @object.send(:sqrt!, -19.36) }.should raise_error(Errno::EDOM)
+  end
+
+  it "raises a TypeError when passed a Complex number" do
+    lambda { @object.send(:sqrt!, Complex(4, 5)) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/tan.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/tan.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/tan.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require 'complex'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe :complex_math_tan, :shared => true do
+  it "returns the tangent of the argument" do
+    @object.send(:tan, 0.0).should == 0.0
+    @object.send(:tan, -0.0).should == -0.0
+    @object.send(:tan, 4.22).should be_close(1.86406937682395, TOLERANCE)
+    @object.send(:tan, -9.65).should be_close(-0.229109052606441, TOLERANCE)
+  end
+
+  it "returns the tangent for Complex numbers" do
+    @object.send(:tan, Complex(0, Math::PI)).should be_close(Complex(0.0, 0.99627207622075), TOLERANCE)
+    @object.send(:tan, Complex(3, 4)).should be_close(Complex(-0.000187346204629452, 0.999355987381473), TOLERANCE)
+  end
+end
+
+describe :complex_math_tan_bang, :shared => true do
+  it "returns the tangent of the argument" do
+    @object.send(:tan!, 0.0).should == 0.0
+    @object.send(:tan!, -0.0).should == -0.0
+    @object.send(:tan!, 4.22).should be_close(1.86406937682395, TOLERANCE)
+    @object.send(:tan!, -9.65).should be_close(-0.229109052606441, TOLERANCE)
+  end
+
+  it "raises a TypeError when passed a Complex number" do
+    lambda { @object.send(:tan!, Complex(4, 5)) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/tanh.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/tanh.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/tanh.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require 'complex'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe :complex_math_tanh, :shared => true do
+  it "returns the hyperbolic tangent of the argument" do
+    @object.send(:tanh, 0.0).should == 0.0
+    @object.send(:tanh, -0.0).should == -0.0
+    @object.send(:tanh, 1.0/0.0).should == 1.0
+    @object.send(:tanh, 1.0/-0.0).should == -1.0
+    @object.send(:tanh, 2.5).should be_close(0.98661429815143, TOLERANCE)
+    @object.send(:tanh, -4.892).should be_close(-0.999887314427707, TOLERANCE)
+  end
+
+  it "returns the hyperbolic tangent for Complex numbers" do
+    @object.send(:tanh, Complex(0, Math::PI)).should be_close(Complex(0.0, -1.22464679914735e-16), TOLERANCE)
+    @object.send(:tanh, Complex(3, 4)).should be_close(Complex(1.00070953606723, 0.00490825806749599), TOLERANCE)
+  end
+end
+
+describe :complex_math_tanh_bang, :shared => true do
+  it "returns the hyperbolic tangent of the argument" do
+    @object.send(:tanh!, 0.0).should == 0.0
+    @object.send(:tanh!, -0.0).should == -0.0
+    @object.send(:tanh!, 1.0/0.0).should == 1.0
+    @object.send(:tanh!, 1.0/-0.0).should == -1.0
+    @object.send(:tanh!, 2.5).should be_close(0.98661429815143, TOLERANCE)
+    @object.send(:tanh!, -4.892).should be_close(-0.999887314427707, TOLERANCE)
+  end
+
+  it "raises a TypeError when passed a Complex number" do
+    lambda { @object.send(:tanh!, Complex(4, 5)) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/sin_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/sin_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/sin_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/sin'
+
+describe "Math#sin" do
+  it_behaves_like :complex_math_sin, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:sin)
+  end
+end
+
+describe "Math#sin!" do
+  it_behaves_like :complex_math_sin_bang, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:sin!)
+  end
+end
+
+describe "Math.sin" do
+  it_behaves_like :complex_math_sin, :_, Math
+end
+
+describe "Math.sin!" do
+  it_behaves_like :complex_math_sin_bang, :_, Math
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/sinh_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/sinh_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/sinh_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/sinh'
+
+describe "Math#sinh" do
+  it_behaves_like :complex_math_sinh, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:sinh)
+  end
+end
+
+describe "Math#sinh!" do
+  it_behaves_like :complex_math_sinh_bang, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:sinh!)
+  end
+end
+
+describe "Math.sinh" do
+  it_behaves_like :complex_math_sinh, :_, Math
+end
+
+describe "Math.sinh!" do
+  it_behaves_like :complex_math_sinh_bang, :_, Math
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/sqrt_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/sqrt_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/sqrt_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/sqrt'
+
+describe "Math#sqrt" do
+  it_behaves_like :complex_math_sqrt, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:sqrt)
+  end
+end
+
+describe "Math#sqrt!" do
+  it_behaves_like :complex_math_sqrt_bang, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:sqrt!)
+  end
+end
+
+describe "Math.sqrt" do
+  it_behaves_like :complex_math_sqrt, :_, Math
+end
+
+describe "Math.sqrt!" do
+  it_behaves_like :complex_math_sqrt_bang, :_, Math
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/tan_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/tan_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/tan_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/tan'
+
+describe "Math#tan" do
+  it_behaves_like :complex_math_tan, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:tan)
+  end
+end
+
+describe "Math#tan!" do
+  it_behaves_like :complex_math_tan_bang, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:tan!)
+  end
+end
+
+describe "Math.tan" do
+  it_behaves_like :complex_math_tan, :_, Math
+end
+
+describe "Math.tan!" do
+  it_behaves_like :complex_math_tan_bang, :_, Math
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/math/tanh_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/tanh_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/tanh_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/tanh'
+
+describe "Math#tanh" do
+  it_behaves_like :complex_math_tanh, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:tanh)
+  end
+end
+
+describe "Math#tanh!" do
+  it_behaves_like :complex_math_tanh_bang, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:tanh!)
+  end
+end
+
+describe "Math.tanh" do
+  it_behaves_like :complex_math_tanh, :_, Math
+end
+
+describe "Math.tanh!" do
+  it_behaves_like :complex_math_tanh_bang, :_, Math
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/minus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/minus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/minus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'complex'
+
+describe "Complex#- with Complex" do
+  it "subtracts both the real and imaginary components" do
+    (Complex(1, 2) - Complex(10, 20)).should == Complex(1 - 10, 2 - 20)
+    (Complex(1.5, 2.1) - Complex(100.2, -30.3)).should == Complex(1.5 - 100.2, 2.1 - (-30.3))
+  end
+end
+
+describe "Complex#- with Integer" do
+  it "subtracts the real number from the real component of self" do
+    (Complex(1, 2) - 50).should == Complex(-49, 2)
+    (Complex(1, 2) - 50.5).should == Complex(-49.5, 2)
+  end
+end
+
+describe "Complex#- with Object" do
+  it "tries to coerce self into other" do
+    value = Complex(3, 9)
+    
+    obj = mock("Object")
+    obj.should_receive(:coerce).with(value).and_return([2, 5])
+    (value - obj).should == 2 - 5
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/complex/modulo_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/modulo_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/modulo_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'complex'
+
+describe "Complex#% with Complex" do
+  it "returns the remainder from complex division" do
+    (Complex(13, 44) % Complex(5, 20)).should == Complex(13 % 5, 44 % 20)
+    (Complex(13.5, 44.5) % Complex(5.5, 20.5)).should == Complex(13.5 % 5.5, 44.5 % 20.5)
+  end
+end
+
+describe "Complex#% with Integer" do
+  it "returns the remainder from dividing both parts of self by the given Integer" do
+    (Complex(21, 42) % 10).should == Complex(21 % 10, 42 % 10)
+    (Complex(15.5, 16.5) % 2.0).should be_close(Complex(15.5 % 2, 16.5 % 2), TOLERANCE)
+  end
+end
+
+describe "Complex#% with Object" do
+  it "tries to coerce self into other" do
+    value = Complex(3, 9)
+    
+    obj = mock("Object")
+    obj.should_receive(:coerce).with(value).and_return([2, 5])
+    (value % obj).should == 2 % 5
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/complex/multiply_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/multiply_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/multiply_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'complex'
+
+describe "Complex#* with Complex" do
+  it "multiplies according to the usual rule for complex numbers: (a + bi) * (c + di) = ac - bd + (ad + bc)i" do
+    (Complex(1, 2) * Complex(10, 20)).should == Complex((1 * 10) - (2 * 20), (1 * 20) + (2 * 10))
+    (Complex(1.5, 2.1) * Complex(100.2, -30.3)).should == Complex((1.5 * 100.2) - (2.1 * -30.3), (1.5 * -30.3) + (2.1 * 100.2))
+  end
+end
+
+describe "Complex#* with Integer" do
+  it "multiplies both parts of self by the given Integer" do
+    (Complex(3, 2) * 50).should == Complex(150, 100)
+    (Complex(-3, 2) * 50.5).should == Complex(-151.5, 101)
+  end
+end
+
+describe "Complex#* with Object" do
+  it "tries to coerce self into other" do
+    value = Complex(3, 9)
+    
+    obj = mock("Object")
+    obj.should_receive(:coerce).with(value).and_return([2, 5])
+    (value * obj).should == 2 * 5
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/complex/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,39 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'complex'
+
+describe "Complex.new" do
+  it "returns a new Complex number" do
+    Complex.new(1, 2).class.should == Complex
+  end
+  
+  it "raises a TypeError when one of the given arguments is not Numeric" do
+    lambda { Complex.new(1, "foo") }.should raise_error(TypeError)
+    lambda { Complex.new("bar", 2) }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError when one of the given arguments is a Complex" do
+    lambda { Complex.new(Complex(1), "foo") }.should raise_error(TypeError)
+    lambda { Complex.new("bar", Complex(3, 5)) }.should raise_error(TypeError)
+  end
+end
+
+describe "Complex.new!" do
+  it "returns a new Complex number" do
+    Complex.new(1, 2).class.should == Complex
+  end
+  
+  it "defaults to 0 for the imaginery part" do
+    a = Complex.new!(3)
+    a.image.should == 0
+  end
+  
+  it "raises a TypeError when one of the given arguments is not Numeric" do
+    lambda { Complex.new(1, "foo") }.should raise_error(TypeError)
+    lambda { Complex.new("bar", 2) }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError when one of the given arguments is a Complex" do
+    lambda { Complex.new(Complex(1), "foo") }.should raise_error(TypeError)
+    lambda { Complex.new("bar", Complex(3, 5)) }.should raise_error(TypeError)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/complex/numerator_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/numerator_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/numerator_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'complex'
+# Depends on Rational to be loaded.
+require "rational"
+
+describe "Complex#numerator" do
+  it "returns self's numerator" do
+    Complex(2).numerator.should    == Complex(2)
+    Complex(3, 4).numerator.should == Complex(3, 4)
+    
+    Complex(Rational(3, 4), Rational(3, 4)).numerator.should == Complex(3, 3)
+    Complex(Rational(7, 4), Rational(8, 4)).numerator.should == Complex(7, 8)
+
+    Complex(Rational(7, 8), Rational(8, 4)).numerator.should == Complex(7, 16)
+    Complex(Rational(7, 4), Rational(8, 8)).numerator.should == Complex(7, 4)
+    
+    # NOTE:
+    # Bug? - Fails with a MethodMissingError
+    # (undefined method `denominator' for 3.5:Float)
+    # Complex(3.5, 3.7).numerator
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/numeric/angle_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/numeric/angle_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/numeric/angle_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/arg'
+require 'complex'
+
+describe "Numeric#angle" do
+  it_behaves_like :numeric_arg, :angle
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/complex/numeric/arg_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/numeric/arg_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/numeric/arg_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/arg'
+require 'complex'
+
+describe "Numeric#arg" do
+  it_behaves_like :numeric_arg, :arg
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/complex/numeric/conj_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/numeric/conj_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/numeric/conj_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/conjugate'
+require 'complex'
+
+describe "Numeric#conj" do
+  it_behaves_like :numeric_conjugate, :conj
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/complex/numeric/conjugate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/numeric/conjugate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/numeric/conjugate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/conjugate'
+require 'complex'
+
+describe "Numeric#conjugate" do
+  it_behaves_like :numeric_conjugate, :conjugate
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/complex/numeric/im_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/numeric/im_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/numeric/im_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'complex'
+
+describe "Numeric#im" do
+  it "returns a new Complex number with self as the imaginary component" do
+    20.im.should == Complex(0, 20)
+    (-4.5).im.should == Complex(0, -4.5)
+    bignum_value.im.should == Complex(0, bignum_value)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/complex/numeric/imag_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/numeric/imag_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/numeric/imag_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/image'
+require 'complex'
+
+describe "Numeric#imag" do
+  it_behaves_like :numeric_image, :imag
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/complex/numeric/image_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/numeric/image_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/numeric/image_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/image'
+require 'complex'
+
+describe "Numeric#image" do
+  it_behaves_like :numeric_image, :image
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/complex/numeric/polar_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/numeric/polar_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/numeric/polar_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'complex'
+
+describe "Numeric#polar" do
+  it "returns self's absolute value and self's argument" do
+    5.polar.should == [5, 0]
+    (-5).polar.should == [5, Math::PI]
+    
+    4.5.polar.should == [4.5, 0]
+    (-4.5).polar.should == [4.5, Math::PI]
+
+    bignum_value.polar.should == [bignum_value, 0]
+    (-bignum_value).polar.should == [bignum_value, Math::PI]
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/complex/numeric/real_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/numeric/real_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/numeric/real_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'complex'
+
+describe "Numeric#real" do
+  it "returns self" do
+    20.real.should == 20
+    (-4.5).real.should == -4.5
+    bignum_value.real.should == bignum_value
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/complex/numeric/shared/arg.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/numeric/shared/arg.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/numeric/shared/arg.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require 'complex'
+
+describe :numeric_arg, :shared => true do
+  it "returns 0 if self is greater than or equal to 0" do
+    0.send(@method).should == 0
+    0.0.send(@method).should == 0
+    (-0).send(@method).should == 0
+
+    20.send(@method).should == 0
+    4.5.send(@method).should == 0
+    bignum_value.send(@method).should == 0
+  end
+
+  it "returns Math::PI if self is greater than or equal to 0" do
+    (-20).send(@method).should == Math::PI
+    (-4.5).send(@method).should == Math::PI
+    (-bignum_value).send(@method).should == Math::PI
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/numeric/shared/conjugate.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/numeric/shared/conjugate.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/numeric/shared/conjugate.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require 'complex'
+
+describe :numeric_conjugate, :shared => true do
+  it "returns self" do
+    20.send(@method).should == 20
+    (-4.5).send(@method).should == -4.5
+    bignum_value.send(@method).should == bignum_value
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/numeric/shared/image.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/numeric/shared/image.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/numeric/shared/image.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require 'complex'
+
+describe :numeric_image, :shared => true do
+  it "returns 0" do
+    20.send(@method).should == 0
+    (-4.5).send(@method).should == 0
+    bignum_value.send(@method).should == 0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/plus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/plus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/plus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'complex'
+
+describe "Complex#+ with Complex" do
+  it "adds both the real and imaginary components" do
+    (Complex(1, 2) + Complex(10, 20)).should == Complex(1 + 10, 2 + 20)
+    (Complex(1.5, 2.1) + Complex(100.2, -30.3)).should == Complex(1.5 + 100.2, 2.1 + (-30.3))
+  end
+end
+
+describe "Complex#+ with Integer" do
+  it "adds the real number to the real component of self" do
+    (Complex(1, 2) + 50).should == Complex(51, 2)
+    (Complex(1, 2) + 50.5).should == Complex(51.5, 2)
+  end
+end
+
+describe "Complex#+ with Object" do
+  it "tries to coerce self into other" do
+    value = Complex(3, 9)
+    
+    obj = mock("Object")
+    obj.should_receive(:coerce).with(value).and_return([2, 5])
+    (value + obj).should == 2 + 5
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/complex/polar_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/polar_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/polar_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'complex'
+
+describe "Complex.polar" do
+  it "returns a complex number in terms of radius and angle" do
+    Complex.polar(50, 60).should be_close(Complex(-47.6206490207578, -15.2405310551108), TOLERANCE)
+    Complex.polar(-10, -20).should be_close(Complex(-4.08082061813392, 9.12945250727628), TOLERANCE)
+  end
+end
+
+describe "Complex#polar" do
+  it "returns the absolute value and the argument" do
+    a = Complex(3, 4)
+    a.polar.size.should == 2
+    a.polar.first.should == 5.0
+    a.polar.last.should be_close(0.927295218001612, TOLERANCE)
+
+    b = Complex(-3.5, 4.7)
+    b.polar.size.should == 2
+    b.polar.first.should be_close(5.86003412959345, TOLERANCE)
+    b.polar.last.should be_close(2.21088447955664, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/real_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/real_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/real_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'complex'
+
+describe "Complex#real" do
+  it "returns the real part of self" do
+    Complex(1, 0).real.should == 1
+    Complex(2, 1).real.should == 2
+    Complex(6.7, 8.9).real.should == 6.7
+    Complex(bignum_value, 3).real.should == bignum_value
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/shared/arg.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/shared/arg.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/shared/arg.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require 'complex'
+
+describe :complex_arg, :shared => true do
+  it "returns the argument -- i.e., the angle from (1, 0) in the complex plane" do
+    TwoPi = 2 * Math::PI
+    (Complex(1, 0).send(@method) % TwoPi).should be_close(0, TOLERANCE)
+    (Complex(0, 2).send(@method) % TwoPi).should be_close(Math::PI * 0.5, TOLERANCE)
+    (Complex(-100, 0).send(@method) % TwoPi).should be_close(Math::PI, TOLERANCE)
+    (Complex(0, -75.3).send(@method) % TwoPi).should be_close(Math::PI * 1.5, TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/shared/conjugate.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/shared/conjugate.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/shared/conjugate.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require 'complex'
+
+describe :complex_conjugate, :shared => true do
+  it "returns the complex conjugate: conj a + bi = a - bi" do
+    Complex(3, 5).send(@method).should == Complex(3, -5)
+    Complex(3, -5).send(@method).should == Complex(3, 5)
+    Complex(-3.0, 5.2).send(@method).should be_close(Complex(-3.0, -5.2), TOLERANCE)
+    Complex(3.0, -5.2).send(@method).should be_close(Complex(3.0, 5.2), TOLERANCE)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/shared/image.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/shared/image.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/shared/image.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require 'complex'
+
+describe :complex_image, :shared => true do
+  it "returns the imaginary part of self" do
+    Complex(1, 0).send(@method).should == 0
+    Complex(2, 1).send(@method).should == 1
+    Complex(6.7, 8.9).send(@method).should == 8.9
+    Complex(1, bignum_value).send(@method).should == bignum_value
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/complex/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'complex'
+
+describe "Complex#to_s when self's real component is 0" do
+  it "returns only the imaginary component as String" do
+    Complex(0, 5).to_s.should == "5i"
+    Complex(0, -3.2).to_s.should == "-3.2i"
+  end
+end
+
+describe "Complex#to_s" do
+  it "returns self as String" do
+    Complex(1, 5).to_s.should == "1+5i"
+    Complex(-2.5, 1.5).to_s.should == "-2.5+1.5i"
+    
+    Complex(1, -5).to_s.should == "1-5i"
+    Complex(-2.5, -1.5).to_s.should == "-2.5-1.5i"
+
+    # Guard against the Mathn library
+    conflicts_with :Prime do
+      Complex(1, 0).to_s.should == "1+0i"
+      Complex(1, -0).to_s.should == "1+0i"
+
+      # This is a bit weird, but it's what MRI does
+      Complex(1, 0.0).to_s.should == "1+0.0i"
+      Complex(1, -0.0).to_s.should == "1+0.0i"
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/conditionvariable/broadcast_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/conditionvariable/broadcast_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/conditionvariable/broadcast_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,62 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'thread'
+
+describe "ConditionVariable#broadcast" do
+  it "should return self if nothing to broadcast to" do
+    cv = ConditionVariable.new
+    cv.broadcast.should == cv
+  end
+
+  it "should return self if something is waiting for a broadcast" do
+    m = Mutex.new
+    cv = ConditionVariable.new
+    th = Thread.new do
+      m.synchronize do
+        cv.wait(m)
+      end
+    end
+
+    # ensures that th grabs m before current thread
+    Thread.pass until th.status == "sleep"
+
+    m.synchronize { cv.broadcast }.should == cv
+
+    th.join
+  end
+
+  it "releases all threads waiting in line for this resource" do
+    m = Mutex.new
+    cv = ConditionVariable.new
+    threads = []
+    r1 = []
+    r2 = []
+
+    # large number to attempt to cause race conditions
+    100.times do |i|
+      threads << Thread.new(i) do |tid|
+        m.synchronize do
+          r1 << tid
+          cv.wait(m)
+          r2 << tid
+        end
+      end
+    end
+
+    # wait for all threads to acquire the mutex the first time
+    Thread.pass until m.synchronize { r1.size == threads.size }
+    # wait until all threads are sleeping (ie waiting)
+    Thread.pass until threads.all? {|th| th.status == "sleep" }
+
+    r2.should be_empty
+    m.synchronize do
+      cv.broadcast
+    end
+
+    threads.each {|t| t.join }
+
+    # ensure that all threads that enter cv.wait are released
+    r2.sort.should == r1.sort
+    # note that order is not specified as broadcast results in a race
+    # condition on regaining the lock m
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/conditionvariable/signal_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/conditionvariable/signal_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/conditionvariable/signal_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,64 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'thread'
+
+describe "ConditionVariable#signal" do
+  it "should return self if nothing to signal" do
+    cv = ConditionVariable.new
+    cv.signal.should == cv
+  end
+
+  it "should return self if something is waiting for a signal" do
+    m = Mutex.new
+    cv = ConditionVariable.new
+    th = Thread.new do
+      m.synchronize do
+        cv.wait(m)
+      end
+    end
+
+    # ensures that th grabs m before current thread
+    Thread.pass until th.status == "sleep"
+
+    m.synchronize { cv.signal }.should == cv
+
+    th.join
+  end
+
+  it "releases the first thread waiting in line for this resource" do
+    m = Mutex.new
+    cv = ConditionVariable.new
+    threads = []
+    r1 = []
+    r2 = []
+
+    # large number to attempt to cause race conditions
+    100.times do |i|
+      threads << Thread.new(i) do |tid|
+        m.synchronize do
+          r1 << tid
+          cv.wait(m)
+          r2 << tid
+        end
+      end
+    end
+
+    # wait for all threads to acquire the mutex the first time
+    Thread.pass until m.synchronize { r1.size == threads.size }
+    # wait until all threads are sleeping (ie waiting)
+    Thread.pass until threads.all? {|th| th.status == "sleep" }
+
+    r2.should be_empty
+    100.times do |i|
+      m.synchronize do
+        cv.signal
+      end
+      Thread.pass until r2.size == i+1
+    end
+
+    threads.each {|t| t.join }
+
+    # ensure that all the threads that went into the cv.wait are
+    # released in the same order
+    r2.should == r1
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/conditionvariable/wait_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/conditionvariable/wait_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/conditionvariable/wait_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'thread'
+
+describe "ConditionVariable#wait" do
+  it "should return self" do
+    m = Mutex.new
+    cv = ConditionVariable.new
+
+    th = Thread.new do
+      m.synchronize do
+        cv.wait(m).should == cv
+      end
+    end
+
+    # ensures that th grabs m before current thread
+    Thread.pass until th.status == "sleep"
+
+    m.synchronize { cv.signal }
+    th.join
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/basicwriter/close_on_terminate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/basicwriter/close_on_terminate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/basicwriter/close_on_terminate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::BasicWriter#close_on_terminate" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/basicwriter/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/basicwriter/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/basicwriter/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::BasicWriter#initialize" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/basicwriter/terminate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/basicwriter/terminate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/basicwriter/terminate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::BasicWriter#terminate" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/cell/data_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/cell/data_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/cell/data_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::Cell#data" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/cell/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/cell/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/cell/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::Cell#initialize" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/fixtures/one_line.csv
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/fixtures/one_line.csv	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/fixtures/one_line.csv	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+1,2
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/csv/foreach_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/foreach_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/foreach_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'csv'
+
+describe "CSV.foreach" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/generate_line_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/generate_line_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/generate_line_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,30 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'csv'
+
+describe "CSV.generate_line" do
+
+  it "generates an empty string" do
+    result = CSV::generate_line([]) 
+    result.should == ""
+  end
+ 
+  it "generates the string 'foo,bar'" do
+    result = CSV::generate_line(["foo", "bar"])
+    result.should == "foo,bar"
+  end
+
+  it "generates the string 'foo;bar'" do
+    result = CSV::generate_line(["foo", "bar"], ?;)
+    result.should == "foo;bar"
+  end
+
+  it "generates the string 'foo,,bar'" do
+    result = CSV::generate_line(["foo", nil, "bar"])
+    result.should == "foo,,bar"
+  end
+
+  it "generates the string 'foo;;bar'" do
+    result = CSV::generate_line(["foo", nil, "bar"], ?;)
+    result.should == "foo;;bar"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/generate_row_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/generate_row_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/generate_row_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'csv'
+
+describe "CSV.generate_row" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/generate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/generate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/generate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,44 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'csv'
+require 'tempfile'
+
+describe "CSV.generate" do
+  
+  before :each do
+    @outfile_name = tmp("generate_test_#{$$}.csv")  
+  end
+ 
+  it "creates a BasicWriter" do
+    writer = CSV::generate(@outfile_name)
+    writer.should be_kind_of(CSV::BasicWriter)
+    writer.close
+  end
+
+  it "accepts a field separator" do
+    writer = CSV::generate(@outfile_name, ",")
+    writer.should be_kind_of(CSV::BasicWriter)
+    writer.close
+  end
+
+  it "accepts a row separator" do
+    writer = CSV::generate(@outfile_name, ".")
+    writer.should be_kind_of(CSV::BasicWriter)
+    writer.close
+  end
+  
+  it "creates a BasicWriter to use in a block" do
+    CSV::generate(@outfile_name) do |writer|
+      writer.should be_kind_of(CSV::BasicWriter)
+    end
+  end
+
+  it "creates a BasicWriter with ; as the separator inside the block" do
+    CSV::generate(@outfile_name, ?;) do |writer|
+      writer.should be_kind_of(CSV::BasicWriter)
+    end
+  end
+
+  after :each do
+    File.unlink(@outfile_name)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/iobuf/close_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/iobuf/close_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/iobuf/close_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::IOBuf#close" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/iobuf/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/iobuf/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/iobuf/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::IOBuf#initialize" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/iobuf/read_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/iobuf/read_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/iobuf/read_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::IOBuf#read" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/iobuf/terminate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/iobuf/terminate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/iobuf/terminate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::IOBuf#terminate" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/ioreader/close_on_terminate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/ioreader/close_on_terminate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/ioreader/close_on_terminate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::IOReader#close_on_terminate" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/ioreader/get_row_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/ioreader/get_row_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/ioreader/get_row_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::IOReader#get_row" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/ioreader/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/ioreader/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/ioreader/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::IOReader#initialize" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/ioreader/terminate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/ioreader/terminate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/ioreader/terminate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::IOReader#terminate" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/open_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/open_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/open_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'csv'
+
+describe "CSV.open" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/parse_line_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/parse_line_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/parse_line_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,81 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'csv'
+
+describe "CSV.parse_line" do
+  
+  it "parses '' into []" do
+    result = CSV::parse ''
+    result.should be_kind_of(Array)
+    result.should == []
+  end
+
+  it "parses '\n' into [[nil]]" do
+    result = CSV::parse "\n"
+    result.should == [[nil]]
+  end
+ 
+  it "parses 'foo' into [['foo']]" do
+    result = CSV::parse 'foo'
+    result.should == [['foo']]
+  end
+
+  it "parses 'foo,bar,baz' into [['foo','bar','baz']]" do
+    result = CSV::parse 'foo,bar,baz'
+    result.should == [['foo','bar','baz']]
+  end
+
+  it "parses 'foo,baz' into [[foo,nil,baz]]" do
+    result = CSV::parse 'foo,,baz'
+    result.should == [['foo',nil,'baz']]
+  end
+
+  it "parses '\nfoo' into [[nil],['foo']]" do
+    result = CSV::parse "\nfoo"
+    result.should == [[nil],['foo']]
+  end
+
+  it "parses 'foo\n' into [['foo']]" do
+    result = CSV::parse "foo\n"
+    result.should == [['foo']]
+  end
+
+  it "parses 'foo\nbar' into [['foo'],['bar']]" do 
+    result = CSV::parse "foo\nbar"
+    result.should == [['foo'],['bar']]
+  end
+
+  it "parses 'foo,bar\nbaz,quz' into [['foo','bar'],['baz','quz']]" do
+    result = CSV::parse "foo,bar\nbaz,quz"
+    result.should == [['foo','bar'],['baz','quz']]
+  end
+
+  it "parses 'foo,bar'\nbaz' into [['foo','bar'],['baz']]" do
+    result = CSV::parse "foo,bar\nbaz"
+    result.should == [['foo','bar'],['baz']]
+  end
+
+  it "parses 'foo\nbar,baz' into [['foo'],['bar','baz']]" do
+    result = CSV::parse "foo\nbar,baz"
+    result.should == [['foo'],['bar','baz']]
+  end
+
+  it "parses '\n\nbar' into [[nil],[nil],'bar']]" do
+    result = CSV::parse "\n\nbar"
+    result.should == [[nil],[nil],['bar']]
+  end
+
+  it "parses 'foo' into [['foo']] with a separator of ;" do
+    result = CSV::parse "foo", ?;
+    result.should == [['foo']]
+  end
+
+  it "parses 'foo;bar' into [['foo','bar']] with a separator of ;" do
+    result = CSV::parse "foo;bar", ?;
+    result.should == [['foo','bar']]
+  end
+
+  it "parses 'foo;bar\nbaz;quz' into [['foo','bar'],['baz','quz']] with a separator of ;" do
+    result = CSV::parse "foo;bar\nbaz;quz", ?;
+    result.should == [['foo','bar'],['baz','quz']]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/parse_row_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/parse_row_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/parse_row_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'csv'
+
+describe "CSV.parse_row" do
+  
+  it "parses 'foo\nbar' one row at a time" do
+    parse_me = "foo\nbar"
+    
+    parsed_row = []
+    parsed_count, next_row_index = CSV::parse_row parse_me, 0, parsed_row
+    parsed_count.should == 1
+    next_row_index.should == 4
+    parsed_row.should == ['foo']
+    
+    parsed_row = []
+    parsed_count, next_row_index = CSV::parse_row parse_me, next_row_index, parsed_row 
+    parsed_count.should == 1
+    next_row_index.should == 7
+    parsed_row.should == ['bar']
+
+    parsed_row = []
+    parsed_count, next_row_index = CSV::parse_row parse_me, next_row_index, parsed_row
+    parsed_count.should == 0
+    next_row_index.should == 0
+    parsed_row.should == []
+  end  
+  
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/parse_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/parse_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/parse_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'csv'
+
+describe "CSV.parse" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/read_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/read_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/read_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'csv'
+
+describe "CSV.read" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/reader/close_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/reader/close_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/reader/close_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::Reader#close" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/reader/create_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/reader/create_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/reader/create_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::Reader.create" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/reader/each_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/reader/each_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/reader/each_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::Reader#each" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/reader/get_row_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/reader/get_row_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/reader/get_row_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::Reader#get_row" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/reader/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/reader/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/reader/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::Reader#initialize" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/reader/parse_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/reader/parse_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/reader/parse_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::Reader.parse" do
+
+  it "processes empty input without calling block" do
+    empty_input = mock('empty file')
+    empty_input.should_receive(:read).once.and_return(nil)
+    CSV::Reader.parse(empty_input) do |row|
+      Expectation.fail_with('block should not be executed', 'but executed')
+    end
+  end
+
+  it "calls block once for one row of input" do
+    input_stream = File.open(File.dirname(__FILE__) + '/../fixtures/one_line.csv', 'rb')
+    count = 0
+    CSV::Reader.parse(input_stream) do |row|
+      count += 1
+    end
+    count.should == 1
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/reader/shift_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/reader/shift_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/reader/shift_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::Reader#shift" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/reader/terminate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/reader/terminate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/reader/terminate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::Reader#terminate" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/readlines_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/readlines_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/readlines_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'csv'
+
+describe "CSV.readlines" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/add_buf_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/add_buf_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/add_buf_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::StreamBuf#add_buf" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/buf_size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/buf_size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/buf_size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::StreamBuf#buf_size" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/drop_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/drop_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/drop_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::StreamBuf#drop" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/element_reference_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/element_reference_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/element_reference_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::StreamBuf#[]" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/get_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/get_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/get_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::StreamBuf#get" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/idx_is_eos_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/idx_is_eos_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/idx_is_eos_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::StreamBuf#idx_is_eos?" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::StreamBuf#initialize" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/is_eos_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/is_eos_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/is_eos_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::StreamBuf#is_eos?" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/read_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/read_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/read_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::StreamBuf#read" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/rel_buf_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/rel_buf_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/rel_buf_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::StreamBuf#rel_buf" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/terminate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/terminate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/streambuf/terminate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::StreamBuf#terminate" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/stringreader/get_row_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/stringreader/get_row_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/stringreader/get_row_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::StringReader#get_row" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/stringreader/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/stringreader/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/stringreader/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::StringReader#initialize" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/writer/add_row_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/writer/add_row_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/writer/add_row_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::Writer#add_row" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/writer/append_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/writer/append_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/writer/append_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::Writer#<<" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/writer/close_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/writer/close_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/writer/close_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::Writer#close" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/writer/create_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/writer/create_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/writer/create_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::Writer.create" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/writer/generate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/writer/generate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/writer/generate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::Writer.generate" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/writer/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/writer/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/writer/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::Writer#initialize" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/csv/writer/terminate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/csv/writer/terminate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/csv/writer/terminate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'csv'
+
+describe "CSV::Writer#terminate" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/date/accessor_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/accessor_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/accessor_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,91 @@
+require 'date' 
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Date#ajd" do
+  it "should be able to determine the Astronomical Julian day for a date" do
+    Date.civil(2007, 1, 17).ajd.should == 4908235.to_r / 2
+  end
+end
+
+describe "Date#amjd" do
+  it "should be able to determine the Astronomical Modified Julian day for a date" do
+    Date.civil(2007, 1, 17).amjd.should == 54117
+  end
+end
+
+describe "Date#day_fraction" do
+  it "should be able to determine the day fraction for a date" do
+    Date.civil(2007, 1, 17).day_fraction.should == 0
+  end
+end
+
+describe "Date#mjd" do
+  it "should be able to determine the Modified Julian day for a date" do
+    Date.civil(2007, 1, 17).mjd.should == 54117
+  end 
+end
+
+describe "Date#ld" do
+  it "should be able to determine the Modified Julian day for a date" do
+    Date.civil(2007, 1, 17).ld.should == 154958
+  end 
+end
+
+describe "Date#year" do
+  it "should be able to determine the year for a date" do
+    Date.civil(2007, 1, 17).year.should == 2007
+  end 
+end
+
+describe "Date#yday" do
+  it "should be able to determine the year for a date" do
+    Date.civil(2007,  1, 17).yday.should == 17
+    Date.civil(2008, 10, 28).yday.should == 302
+  end 
+end
+
+describe "Date#mon" do
+  it "should be able to determine the month for a date" do
+    Date.civil(2007,  1, 17).mon.should == 1
+    Date.civil(2008, 10, 28).mon.should == 10
+  end 
+end
+
+describe "Date#mday" do
+  it "should be able to determine the day of the month for a date" do
+    Date.civil(2007,  1, 17).mday.should == 17
+    Date.civil(2008, 10, 28).mday.should == 28
+  end
+end
+
+describe "Date#wday" do
+  it "should be able to determine the week day for a date" do
+    Date.civil(2007,  1, 17).wday.should == 3
+    Date.civil(2008, 10, 26).wday.should == 0
+  end
+end
+
+describe "Date#cwyear" do
+  it "should be able to determine the commercial year for a date" do
+    Date.civil(2007,  1, 17).cwyear.should == 2007
+    Date.civil(2008, 10, 28).cwyear.should == 2008
+    Date.civil(2007, 12, 31).cwyear.should == 2008
+    Date.civil(2010,  1,  1).cwyear.should == 2009
+  end
+end
+
+describe "Date#cweek" do
+  it "should be able to determine the commercial week for a date" do
+    Date.civil(2007,  1, 17).cweek.should == 3
+    Date.civil(2008, 10, 28).cweek.should == 44
+    Date.civil(2007, 12, 31).cweek.should == 1
+    Date.civil(2010,  1,  1).cweek.should == 53
+  end
+end
+
+describe "Date#cwday" do
+  it "should be able to determine the commercial week day for a date" do
+    Date.civil(2007,  1, 17).cwday.should == 3
+    Date.civil(2008, 10, 26).cwday.should == 7
+  end  
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/date/add_month_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/add_month_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/add_month_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require 'date' 
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Date#>>" do
+
+  it "should add a number of months to a Date" do
+    d = Date.civil(2007,2,27) >> 10
+    d.should == Date.civil(2007, 12, 27)
+  end
+
+
+  it "should result in the last day of a month if the day doesn't exist" do
+    d = Date.civil(2008,3,31) >> 1
+    d.should == Date.civil(2008, 4, 30)
+  end
+
+  it "should raise an error on non numeric parameters" do
+    lambda { Date.civil(2007,2,27) >> :hello }.should raise_error(TypeError)
+    lambda { Date.civil(2007,2,27) >> "hello" }.should raise_error(TypeError)
+    lambda { Date.civil(2007,2,27) >> Date.new }.should raise_error(TypeError)
+    lambda { Date.civil(2007,2,27) >> Object.new }.should raise_error(TypeError)
+  end
+  
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/date/add_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/add_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/add_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require 'date' 
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Date#+" do
+
+  it "should add a number of days to a Date" do
+    d = Date.civil(2007,2,27) + 10
+    d.should == Date.civil(2007, 3, 9)
+  end
+  
+  it "should add a negative number of days to a Date" do
+    d = Date.civil(2007,2,27).+(-10)
+    d.should == Date.civil(2007, 2, 17)
+  end
+
+  it "should raise an error on non numeric parameters" do
+    lambda { Date.civil(2007,2,27) + :hello }.should raise_error(TypeError)
+    lambda { Date.civil(2007,2,27) + "hello" }.should raise_error(TypeError)
+    lambda { Date.civil(2007,2,27) + Date.new }.should raise_error(TypeError)
+    lambda { Date.civil(2007,2,27) + Object.new }.should raise_error(TypeError)
+  end
+  
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/date/boat_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/boat_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/boat_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require 'date' 
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Date#<=>" do
+
+  it "should be able to compare two same dates" do
+    (Date.civil(2000, 04, 06) <=> Date.civil(2000, 04, 06)).should == 0
+  end
+
+  it "should be able to compute the difference between two dates" do
+    (Date.civil(2000, 04, 05) <=> Date.civil(2000, 04, 06)).should == -1
+    (Date.civil(2001, 04, 05) <=> Date.civil(2000, 04, 06)).should == 1
+  end
+
+  it "should be able to compare to another numeric" do
+    (Date.civil(2000, 04, 05) <=> Date.civil(2000, 04, 06).jd).should == -1
+    (Date.civil(2001, 04, 05) <=> Date.civil(2000, 04, 06).jd).should == 1
+  end
+
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/date/civil_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/civil_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/civil_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+require 'date' 
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/civil'
+
+describe "Date#civil" do
+
+  it_behaves_like(:date_civil, :civil)
+
+end
+
+describe "Date#valid_civil?" do
+
+  it "should be able to determine if a date is valid" do
+    Date.valid_civil?(1582, 10, 14).should == nil
+    Date.valid_civil?(1582, 10, 15).should == Date.civil(1582, 10, 15).jd
+    Date.valid_civil?(1582, 10, 14, Date::ENGLAND).should_not == nil
+    Date.valid_civil?(1582, 10, 14, Date::ENGLAND).should == Date.civil(1582, 10, 14, Date::ENGLAND).jd
+  end
+  
+  it "should be able to handle negative months and days" do
+    Date.valid_civil?(1582, -3, -18).should == nil
+    Date.valid_civil?(1582, -3, -17).should == Date.civil(1582, 10, 15).jd
+    
+    Date.valid_civil?(2007, -11, -10).should == Date.civil(2007, 2, 19).jd
+    Date.valid_civil?(2008, -11, -10).should == Date.civil(2008, 2, 20).jd
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/date/commercial_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/commercial_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/commercial_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require 'date' 
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/commercial'
+
+describe "Date#commercial" do
+
+  it_behaves_like(:date_commercial, :commercial)
+
+end
+
+describe "Date#valid_commercial?" do
+
+  it "should be able to determine if the date is a valid commercial date" do
+    Date.valid_commercial?(1582, 41, 4).should == nil
+    Date.valid_commercial?(1582, 41, 5).should == Date.civil(1582, 10, 15).jd
+    # valid_commercial? can't handle dates before the Gregorian calendar
+    Date.valid_commercial?(1582, 41, 4, Date::ENGLAND).should == nil
+    Date.valid_commercial?(1752, 37, 4, Date::ENGLAND).should == Date.civil(1752, 9, 14, Date::ENGLAND).jd
+  end
+
+  it "should be able to handle negative week and day numbers" do
+    Date.valid_commercial?(1582, -12, -4).should == nil
+    Date.valid_commercial?(1582, -12, -3).should == Date.civil(1582, 10, 15).jd
+    
+    Date.valid_commercial?(2007, -44, -2).should == Date.civil(2007, 3, 3).jd
+    Date.valid_commercial?(2008, -44, -2).should == Date.civil(2008, 3, 1).jd
+  end
+
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/date/constants_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/constants_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/constants_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,41 @@
+require 'date' 
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Date constants" do
+
+  it "should define ITALY" do
+    Date::ITALY.should == 2299161 # 1582-10-15
+  end
+
+  it "should define ENGLAND" do
+    Date::ENGLAND.should == 2361222 # 1752-09-14
+  end
+  
+  # Fixes in 1.8.7
+  ruby_bug "#", "1.8.6" do
+    it "should define JULIAN" do
+      (Date::JULIAN <=> Date::Infinity.new).should == 0
+    end
+  end
+
+  # Fixed in 1.8.7
+  ruby_bug "#", "1.8.6" do
+    it "should define GREGORIAN" do
+      (Date::GREGORIAN <=> -Date::Infinity.new).should == 0
+    end
+  end
+
+  it "should define MONTHNAMES" do
+    Date::MONTHNAMES.should == [nil] + %w(January February March April May June July
+                                          August September October November December)
+  end
+  
+  it "should define DAYNAMES" do
+    Date::DAYNAMES.should == %w(Sunday Monday Tuesday Wednesday Thursday Friday Saturday)
+  end
+  
+  it "should define ABBR_MONTHNAMES" do
+    Date::ABBR_DAYNAMES.should == %w(Sun Mon Tue Wed Thu Fri Sat)
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/date/conversions_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/conversions_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/conversions_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,153 @@
+require 'date' 
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+
+describe "Date#new_start" do
+  it "should convert a date object into another with a new calendar reform" do
+    Date.civil(1582, 10, 14, Date::ENGLAND).new_start.should == Date.civil(1582, 10, 24)
+    Date.civil(1582, 10,  4, Date::ENGLAND).new_start.should == Date.civil(1582, 10,  4)
+    Date.civil(1582, 10, 15).new_start(Date::ENGLAND).should == Date.civil(1582, 10,  5, Date::ENGLAND)
+    Date.civil(1752,  9, 14).new_start(Date::ENGLAND).should == Date.civil(1752,  9, 14, Date::ENGLAND)
+    Date.civil(1752,  9, 13).new_start(Date::ENGLAND).should == Date.civil(1752,  9,  2, Date::ENGLAND)
+  end
+end
+
+describe "Date#italy" do
+  it "should convert a date object into another with the Italian calendar reform" do
+    Date.civil(1582, 10, 14, Date::ENGLAND).italy.should == Date.civil(1582, 10, 24)
+    Date.civil(1582, 10,  4, Date::ENGLAND).italy.should == Date.civil(1582, 10,  4)
+  end
+end
+
+describe "Date#england" do
+  it "should convert a date object into another with the English calendar reform" do
+    Date.civil(1582, 10, 15).england.should == Date.civil(1582, 10,  5, Date::ENGLAND)
+    Date.civil(1752,  9, 14).england.should == Date.civil(1752,  9, 14, Date::ENGLAND)
+    Date.civil(1752,  9, 13).england.should == Date.civil(1752,  9,  2, Date::ENGLAND)
+  end
+end
+
+describe "Date#julian" do
+  it "should convert a date object into another with the Julian calendar" do
+    Date.civil(1582, 10, 15).julian.should == Date.civil(1582, 10,  5, Date::JULIAN)
+    Date.civil(1752,  9, 14).julian.should == Date.civil(1752,  9,  3, Date::JULIAN)
+    Date.civil(1752,  9, 13).julian.should == Date.civil(1752,  9,  2, Date::JULIAN)
+  end
+end
+
+describe "Date#gregorian" do
+  it "should convert a date object into another with the Gregorian calendar" do
+    Date.civil(1582, 10,  4).gregorian.should == Date.civil(1582, 10, 14, Date::GREGORIAN)
+    Date.civil(1752,  9, 14).gregorian.should == Date.civil(1752,  9, 14, Date::GREGORIAN)
+  end
+end
+
+describe "Date#ordinal_to_jd" do
+  it "should convert an ordinal date (year-day) to a Julian day number" do
+    Date.ordinal_to_jd(2007, 55).should == 2454156
+  end
+end
+
+describe "Date#jd_to_ordinal" do
+  it "should convert a Julian day number into an ordinal date" do
+    Date.jd_to_ordinal(2454156).should == [2007, 55]
+  end
+end
+
+describe "Date#civil_to_jd" do
+  it "should convert a civil date into a Julian day number" do
+    Date.civil_to_jd(2007, 2, 24).should == 2454156
+  end
+end
+
+describe "Date#jd_to_civil" do
+  it "should convert a Julian day into a civil date" do
+    Date.jd_to_civil(2454156).should == [2007, 2, 24]
+  end
+end
+
+describe "Date#commercial_to_jd" do
+  it "should convert a commercial date (year - week - day of week) into a Julian day number" do
+    Date.commercial_to_jd(2007, 45, 1).should == 2454410
+  end
+end
+
+describe "Date#jd_to_commercial" do
+  it "should convert a Julian day number into a commercial date" do
+    Date.jd_to_commercial(2454410).should == [2007, 45, 1]
+  end
+end
+
+describe "Date#ajd_to_jd" do
+  it "should convert a Astronomical Julian day number into a Julian day number" do
+    Date.ajd_to_jd(2454410).should == [2454410, Rational(1,2)]
+    Date.ajd_to_jd(2454410, 1.to_r / 2).should == [2454411, 0]
+  end
+end
+
+describe "Date#jd_to_ajd" do
+  it "should convert a Julian day number into a Astronomical Julian day number" do
+    Date.jd_to_ajd(2454410, 0).should == 2454410 - Rational(1, 2)
+    Date.jd_to_ajd(2454410, 1.to_r / 2).should == 2454410
+  end
+end
+
+describe "Date#day_fraction_to_time" do
+  it "should be able to convert a day fraction into time" do
+    Date.day_fraction_to_time(2).should == [48, 0, 0, 0]
+    Date.day_fraction_to_time(1).should == [24, 0, 0, 0]
+    Date.day_fraction_to_time(1.to_r / 2).should == [12, 0, 0, 0]
+    Date.day_fraction_to_time(1.to_r / 7).should == [3, 25, 42, 1.to_r / 100800]
+  end
+end
+
+describe "Date#time_to_day_fraction" do
+  it "should be able to convert a time into a day fraction" do
+    Date.time_to_day_fraction(48, 0, 0).should == 2
+    Date.time_to_day_fraction(24, 0, 0).should == 1
+    Date.time_to_day_fraction(12, 0, 0).should == 1.to_r / 2
+    Date.time_to_day_fraction(10, 20, 10).should == 10.to_r / 24 + 20.to_r / (24 * 60) + 10.to_r / (24 * 60 * 60)
+  end
+end
+
+describe "Date#amjd_to_ajd" do
+  it "shoud be able to convert Astronomical Modified Julian day numbers into Astronomical Julian day numbers" do
+    Date.amjd_to_ajd(10).should == 10 + 2400000 + 1.to_r / 2
+  end
+end
+
+describe "Date#ajd_to_amjd" do
+  it "shoud be able to convert Astronomical Julian day numbers into Astronomical Modified Julian day numbers" do
+    Date.ajd_to_amjd(10000010).should == 10000010 - 2400000 - 1.to_r / 2
+  end
+end
+
+describe "Date#mjd_to_jd" do
+  it "shoud be able to convert Modified Julian day numbers into Julian day numbers" do
+    Date.mjd_to_jd(2000).should == 2000 + 2400001
+  end
+end
+
+describe "Date#jd_to_mjd" do
+  it "shoud be able to convert Julian day numbers into Modified Julian day numbers" do
+    Date.jd_to_mjd(2500000).should == 2500000 - 2400001
+  end
+end
+
+describe "Date#ld_to_jd" do
+  it "should be able to convert the number of days since the Gregorian calendar in Italy into Julian day numbers" do
+    Date.ld_to_jd(450000).should == 450000 + 2299160
+  end
+end
+
+describe "Date#jd_to_ld" do
+  it "should be able to convert Julian day numbers into the number of days since the Gregorian calendar in Italy" do
+    Date.jd_to_ld(2450000).should == 2450000 - 2299160
+  end
+end
+
+describe "Date#jd_to_wday" do
+  it "should be able to convert a Julian day number into a week day number" do
+    Date.jd_to_wday(2454482).should == 3
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/date/downto_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/downto_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/downto_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require 'date' 
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Date#downto" do
+
+  it "should be able to step backward in time" do
+    ds    = Date.civil(2000, 4, 14)
+    de    = Date.civil(2000, 3, 29)
+    count = 0
+    ds.step(de, -1) do |d|
+      d.should <= ds
+      d.should >= de
+      count += 1
+    end
+    count.should == 17
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/date/eql_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/eql_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/eql_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require 'date' 
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Date#eql?" do
+  it "should be able determine equality between date objects" do
+    Date.civil(2007, 10, 11).should eql(Date.civil(2007, 10, 11))
+    Date.civil(2007, 10, 11).should eql(Date.civil(2007, 10, 12) - 1)
+    Date.civil(2007, 10, 11).should_not eql(Date.civil(2007, 10, 12))
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/date/gregorian_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/gregorian_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/gregorian_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+require 'date' 
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Date#gregorian?" do
+
+  it "should mark a day before the calendar reform as Julian" do
+    Date.civil(1007, 2, 27).gregorian?.should == false
+    Date.civil(1907, 2, 27, Date.civil(2000, 1, 1).jd).gregorian?.should == false
+  end
+  
+  it "should mark a day after the calendar reform as Julian" do
+    Date.civil(2007, 2, 27).gregorian?.should == true
+    Date.civil(1007, 2, 27, Date.civil(1000, 1, 1).jd).gregorian?.should == true
+  end
+  
+end
+
+describe "Date#gregorian_leap?" do
+
+  it "should be able to determine whether a year is a leap year in the Gregorian calendar" do
+    Date.gregorian_leap?(1900).should == false
+    Date.gregorian_leap?(1999).should == false
+    Date.gregorian_leap?(2000).should == true
+    Date.gregorian_leap?(2002).should == false
+    Date.gregorian_leap?(2004).should == true
+  end
+
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/date/hash_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/hash_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/hash_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require 'date' 
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Date#hash" do
+  
+  it "should be able determine the hash value for a date" do
+    Date.civil(2004, 7, 12).respond_to?(:hash).should == true
+  end
+  
+  it "should be the case that the same date results in the same hash" do 
+    Date.civil(2004, 7, 12).hash.should == Date.civil(2004, 7, 12).hash
+  end
+  
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/date/infinity_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/infinity_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/infinity_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,77 @@
+require 'date' 
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Date::Infinity" do
+
+  it "should be able to check whether Infinity is zero" do
+    i = Date::Infinity.new
+    i.zero?.should == false
+  end
+
+  it "should be able to check whether Infinity is finite" do
+    i1 = Date::Infinity.new
+    i1.finite?.should == false
+    i2 = Date::Infinity.new(-1)
+    i2.finite?.should == false
+    i3 = Date::Infinity.new(0)
+    i3.finite?.should == false
+  end
+
+  it "should be able to check whether Infinity is infinite" do
+    i1 = Date::Infinity.new
+    i1.infinite?.should == 1
+    i2 = Date::Infinity.new(-1)
+    i2.infinite?.should == -1
+    i3 = Date::Infinity.new(0)
+    i3.infinite?.should == nil
+  end
+
+  it "should be able to check whether Infinity is not a number" do
+    i1 = Date::Infinity.new
+    i1.nan?.should == false
+    i2 = Date::Infinity.new(-1)
+    i2.nan?.should == false
+    i3 = Date::Infinity.new(0)
+    i3.nan?.should == true
+  end
+
+  # These checks fail on MRI because of a bug in Date::Infinity#<=>
+  # Fixed in 1.8.7
+  ruby_bug "#", "1.8.6" do
+    it "should be able to compare Infinity objects" do
+      i1 = Date::Infinity.new
+      i2 = Date::Infinity.new(-1)
+      i3 = Date::Infinity.new(0)
+      i4 = Date::Infinity.new
+      (i4 <=> i1).should == 0
+      (i3 <=> i1).should == -1
+      (i2 <=> i1).should == -1
+      (i3 <=> i2).should == 1
+    end
+  end
+
+  # Also fails because of the same bug as the previous spec
+  # Fixed in 1.8.7
+  ruby_bug "#", "1.8.6" do
+    it "should be able to return plus Infinity for abs" do
+      i1 = Date::Infinity.new
+      i2 = Date::Infinity.new(-1)
+      i3 = Date::Infinity.new(0)
+      (i2.abs <=> i1).should == 0
+      (i3.abs <=> i1).should == 0
+    end
+  end
+  
+  ruby_bug "#222", "1.8.6" do
+    it "should be able to use -@ and +@ for Date::Infinity" do
+      (Date::Infinity.new <=> +Date::Infinity.new).should == 0
+      (Date::Infinity.new(-1) <=> -Date::Infinity.new).should == 0
+    end
+  end
+  
+  it "should be able to coerce a Date::Infinity object" do
+    Date::Infinity.new.coerce(1).should == [-1, 1]
+    Date::Infinity.new(0).coerce(2).should == [0, 0]
+    Date::Infinity.new(-1).coerce(1.5).should == [1, -1]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/date/julian_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/julian_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/julian_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,52 @@
+require 'date' 
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Date#jd" do
+
+  it "should be able to construct a Date object based on the Julian day" do
+    Date.jd(2454482).should == Date.civil(2008, 1, 16)
+  end
+
+  it "should be able to determine the Julian day for a Date object" do
+    Date.civil(2008, 1, 16).jd.should == 2454482
+  end
+  
+end
+
+describe "Date#julian?" do
+
+  it "should mark a day before the calendar reform as Julian" do
+    Date.civil(1007, 2, 27).julian?.should == true
+    Date.civil(1907, 2, 27, Date.civil(2000, 1, 1).jd).julian?.should == true
+  end
+  
+  it "should mark a day after the calendar reform as Julian" do
+    Date.civil(2007, 2, 27).julian?.should == false
+    Date.civil(1007, 2, 27, Date.civil(1000, 1, 1).jd).julian?.should == false
+  end
+  
+end
+
+describe "Date#julian_leap?" do
+
+  it "should be able to determine whether a year is a leap year in the Julian calendar" do
+    Date.julian_leap?(1900).should == true
+    Date.julian_leap?(1999).should == false
+    Date.julian_leap?(2000).should == true
+    Date.julian_leap?(2002).should == false
+    Date.julian_leap?(2004).should == true
+  end
+
+end
+
+describe "Date#valid_jd?" do
+
+  it "should be able to determine if a day number is a valid Julian day number, true for all numbers" do
+    # This might need to check the type of the jd parameter. Date.valid_jd?(:number) is of course
+    # bogus but returns itself with the current implementation
+    Date.valid_jd?(-100).should == -100
+    Date.valid_jd?(0).should    ==    0
+    Date.valid_jd?(100).should  ==  100
+  end
+
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/date/minus_month_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/minus_month_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/minus_month_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require 'date' 
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Date#<<" do
+
+  it "should substract a number of months from a date" do
+    d = Date.civil(2007,2,27) << 10
+    d.should == Date.civil(2006, 4, 27)
+  end
+
+  it "should result in the last day of a month if the day doesn't exist" do
+    d = Date.civil(2008,3,31) << 1
+    d.should == Date.civil(2008, 2, 29)
+  end
+
+  it "should raise an error on non numeric parameters" do
+    lambda { Date.civil(2007,2,27) << :hello }.should raise_error(NoMethodError)
+    lambda { Date.civil(2007,2,27) << "hello" }.should raise_error(NoMethodError)
+    lambda { Date.civil(2007,2,27) << Date.new }.should raise_error(NoMethodError)
+    lambda { Date.civil(2007,2,27) << Object.new }.should raise_error(NoMethodError)
+  end
+  
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/date/minus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/minus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/minus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,30 @@
+require 'date' 
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Date#-" do
+
+  it "should substract a number of days from a Date" do
+    d = Date.civil(2007, 5 ,2) - 13
+    d.should == Date.civil(2007, 4, 19)
+  end
+  
+  it "should substract a negative number of days from a Date" do
+    d = Date.civil(2007, 4, 19).-(-13)
+    d.should == Date.civil(2007, 5 ,2) 
+  end
+
+  it "should be able to compute the different between two dates" do
+    (Date.civil(2007,2,27) - Date.civil(2007,2,27)).should == 0
+    (Date.civil(2007,2,27) - Date.civil(2007,2,26)).should == 1
+    (Date.civil(2006,2,27) - Date.civil(2007,2,27)).should == -365
+    (Date.civil(2008,2,27) - Date.civil(2007,2,27)).should == 365
+    
+  end
+
+  it "should raise an error on non numeric parameters" do
+    lambda { Date.civil(2007,2,27) - :hello }.should raise_error(TypeError)
+    lambda { Date.civil(2007,2,27) - "hello" }.should raise_error(TypeError)
+    lambda { Date.civil(2007,2,27) - Object.new }.should raise_error(TypeError)
+  end
+  
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/date/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require 'date' 
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/civil'
+
+describe "Date#new" do
+
+  it_behaves_like(:date_civil, :new)
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/date/neww_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/neww_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/neww_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require 'date' 
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/commercial'
+
+describe "Date#neww" do
+
+  it_behaves_like(:date_commercial, :neww)
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/date/ordinal_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/ordinal_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/ordinal_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require 'date' 
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/commercial'
+
+describe "Date#ordinal" do
+
+  it "should be able to construct a Date object from an ordinal date" do
+    lambda { Date.ordinal(1582, 287) }.should raise_error(ArgumentError)
+    Date.ordinal(1582, 288).should == Date.civil(1582, 10, 15)
+    Date.ordinal(1582, 287, Date::ENGLAND).should == Date.civil(1582, 10, 14, Date::ENGLAND)
+  end
+
+end
+
+describe "Date#valid_ordinal?" do
+
+  it "should be able to determine if the date is a valid ordinal date" do
+    Date.valid_ordinal?(1582, 287).should == nil
+    Date.valid_ordinal?(1582, 288).should == Date.civil(1582, 10, 15).jd
+    Date.valid_ordinal?(1582, 287, Date::ENGLAND).should_not == nil
+    Date.valid_ordinal?(1582, 287, Date::ENGLAND).should == Date.civil(1582, 10, 14, Date::ENGLAND).jd
+  end
+
+  it "should be able to handle negative day numbers" do
+    Date.valid_ordinal?(1582, -79).should == nil
+    Date.valid_ordinal?(2007, -100).should == Date.valid_ordinal?(2007, 266)
+  end
+
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/date/parse_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/parse_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/parse_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,149 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/parse'
+require File.dirname(__FILE__) + '/shared/parse_us'
+require File.dirname(__FILE__) + '/shared/parse_eu'
+require 'date'
+
+describe "Date#parse" do
+  # The space separator is also different, doesn't work for only numbers
+  it "can parse a day name into a Date object" do
+    d = Date.parse("friday")
+    d.should == Date.commercial(d.cwyear, d.cweek, 5)
+  end
+
+  it "can parse a month name into a Date object" do
+    d = Date.parse("october")
+    d.should == Date.civil(Date.today.year, 10)
+  end
+
+  it "can parse a month day into a Date object" do
+    d = Date.parse("5th")
+    d.should == Date.civil(Date.today.year, Date.today.month, 5)
+  end
+
+  # Specs using numbers
+  it "can't handle a single digit" do
+    lambda{ Date.parse("1") }.should raise_error(ArgumentError)
+  end
+
+  it "can handle DD as month day number" do
+    d = Date.parse("10")
+    d.should == Date.civil(Date.today.year, Date.today.month, 10)
+  end
+
+  it "can handle DDD as year day number" do
+    d = Date.parse("100")
+    if Date.gregorian_leap?(Date.today.year)
+      d.should == Date.civil(Date.today.year, 4, 9)
+    else
+      d.should == Date.civil(Date.today.year, 4, 10)
+    end
+  end
+
+  it "can handle MMDD as month and day" do
+    d = Date.parse("1108")
+    d.should == Date.civil(Date.today.year, 11, 8)
+  end
+
+  it "can handle YYDDD as year and day number" do
+    d = Date.parse("10100")
+    d.should == Date.civil(10, 4, 10)
+  end
+
+  it "can handle YYMMDD as year month and day" do
+    d = Date.parse("201023")
+    d.should == Date.civil(20, 10, 23)
+  end
+
+  it "can handle YYYYDDD as year and day number" do
+    d = Date.parse("1910100")
+    d.should == Date.civil(1910, 4, 10)
+  end
+
+  it "can handle YYYYMMDD as year and day number" do
+    d = Date.parse("19101101")
+    d.should == Date.civil(1910, 11, 1)
+  end
+end
+
+describe "Date#parse with '.' separator" do
+  before :all do
+    @sep = '.'
+  end
+
+  it_should_behave_like "date_parse"
+end
+
+describe "Date#parse with '/' separator" do
+  before :all do
+    @sep = '/'
+  end
+
+  it_should_behave_like "date_parse"
+end
+
+describe "Date#parse with ' ' separator" do
+  before :all do
+    @sep = ' '
+  end
+
+  it_should_behave_like "date_parse"
+end
+
+describe "Date#parse with '/' separator US-style" do
+  before :all do
+    @sep = '/'
+  end
+
+  it_should_behave_like "date_parse_us"
+end
+
+ruby_version_is "" ... "1.8.7" do
+  describe "Date#parse with '.' separator US-style" do
+    before :all do
+      @sep = '.'
+    end
+
+    it_should_behave_like "date_parse_us"
+  end
+end
+
+describe "Date#parse with '-' separator EU-style" do
+  before :all do
+    @sep = '-'
+  end
+
+  it_should_behave_like "date_parse_eu"
+end
+
+ruby_version_is "1.8.7" do
+  describe "Date#parse(.)" do
+    it "parses a YYYY.MM.DD string into a Date object" do
+      d = Date.parse("2007.10.01")
+      d.year.should  == 2007
+      d.month.should == 10
+      d.day.should   == 1
+    end
+
+    it "parses a DD.MM.YYYY string into a Date object" do
+      d = Date.parse("10.01.2007")
+      d.year.should  == 2007
+      d.month.should == 1
+      d.day.should   == 10
+    end
+
+    it "parses a YY.MM.DD string into a Date object" do
+      d = Date.parse("10.01.07")
+      d.year.should  == 10
+      d.month.should == 1
+      d.day.should   == 7
+    end
+
+    it "parses a YY.MM.DD string into a Date object using the year digits as 20XX" do
+      d = Date.parse("10.01.07", true)
+      d.year.should  == 2010
+      d.month.should == 1
+      d.day.should   == 7
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/date/relationship_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/relationship_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/relationship_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require 'date' 
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Date#===" do
+
+  it "should be able to compare two same dates" do
+    (Date.civil(2000, 04, 06) <=> Date.civil(2000, 04, 06)).should == 0
+  end
+
+  it "should be able to compute the difference between two dates" do
+    (Date.civil(2000, 04, 05) <=> Date.civil(2000, 04, 06)).should == -1
+    (Date.civil(2001, 04, 05) <=> Date.civil(2000, 04, 06)).should == 1
+  end
+
+  it "should be able to compare to another numeric" do
+    (Date.civil(2000, 04, 05) <=> Date.civil(2000, 04, 06).jd).should == -1
+    (Date.civil(2001, 04, 05) <=> Date.civil(2000, 04, 06).jd).should == 1
+  end
+
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/date/shared/civil.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/shared/civil.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/shared/civil.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,66 @@
+describe :date_civil, :shared => true do
+  it "creates a Date for -4712 by default" do
+    # the #chomp calls are necessary because of RSpec
+    d = Date.send(@method)
+    d.year.should    == -4712
+    d.month.should   == 1
+    d.day.should     == 1
+    d.julian?.should == true
+    d.jd.should      == 0
+  end
+
+  it "creates a date with arguments" do
+    d = Date.send(@method, 2000, 3, 5)
+    d.year.should    == 2000
+    d.month.should   == 3
+    d.day.should     == 5
+    d.julian?.should == false
+    d.jd.should      == 2451609
+
+    # Should also work with years far in the past and future
+
+    d = Date.send(@method, -9000, 7, 5)
+    d.year.should    == -9000
+    d.month.should   == 7
+    d.day.should     == 5
+    d.julian?.should == true
+    d.jd.should      == -1566006
+  
+    d = Date.send(@method, 9000, 10, 14)
+    d.year.should    == 9000
+    d.month.should   == 10
+    d.day.should     == 14
+    d.julian?.should == false
+    d.jd.should      == 5008529
+  
+  end
+
+  it "doesn't create dates for invalid arguments" do
+    lambda { Date.send(@method, 2000, 13, 31) }.should raise_error(ArgumentError)
+    lambda { Date.send(@method, 2000, 12, 32) }.should raise_error(ArgumentError)
+    lambda { Date.send(@method, 2000,  2, 30) }.should raise_error(ArgumentError)
+    lambda { Date.send(@method, 1900,  2, 29) }.should raise_error(ArgumentError)
+    lambda { Date.send(@method, 2000,  2, 29) }.should_not raise_error(ArgumentError)
+  
+    lambda { Date.send(@method, 1582, 10, 14) }.should raise_error(ArgumentError)
+    lambda { Date.send(@method, 1582, 10, 15) }.should_not raise_error(ArgumentError)
+  
+  end
+
+  it "creats a Date for different calendar reform dates" do
+    d1 = Date.send(@method, 1582, 10, 4)
+    d1.succ.day.should == 15
+  
+    d2 = Date.send(@method, 1582, 10, 4, Date::ENGLAND)
+    d2.succ.day.should == 5
+  
+    # Choose an arbitrary reform date
+    r  = Date.send(@method, 2000, 2, 3)
+  
+    d3 = Date.send(@method, 2000, 2, 3, r.jd)
+    (d3 - 1).day.should == 20
+    (d3 - 1).month.should == 1
+
+    lambda { Date.send(@method, 2000, 2, 2, r.jd) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/date/shared/commercial.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/shared/commercial.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/shared/commercial.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,39 @@
+describe :date_commercial, :shared => true do
+  it "creates a Date for the day of Julian calendar reform in Italy by default" do
+    d = Date.send(@method)
+    d.year.should  == 1582
+    d.month.should == 10
+    d.day.should   == 15
+  end
+
+  it "Creates a Date for the friday in the year and week given" do
+    d = Date.send(@method, 2000, 1)
+    d.year.should  == 2000
+    d.month.should == 1
+    d.day.should   == 7
+    d.cwday.should == 5
+  end
+
+  it "Creates a Date for the correct day given the year, week and day number" do
+    d = Date.send(@method, 2004, 1, 1)
+    d.year.should   == 2003
+    d.month.should  == 12
+    d.day.should    == 29
+    d.cwday.should  == 1
+    d.cweek.should  == 1
+    d.cwyear.should == 2004
+  end
+
+  it "creates only Date objects for valid weeks" do
+    lambda { Date.send(@method, 2004, 53, 1) }.should_not raise_error(ArgumentError)
+    lambda { Date.send(@method, 2004, 53, 0) }.should raise_error(ArgumentError)
+    lambda { Date.send(@method, 2004, 53, 8) }.should raise_error(ArgumentError)
+    lambda { Date.send(@method, 2004, 54, 1) }.should raise_error(ArgumentError)
+    lambda { Date.send(@method, 2004,  0, 1) }.should raise_error(ArgumentError)
+
+    lambda { Date.send(@method, 2003, 52, 1) }.should_not raise_error(ArgumentError)
+    lambda { Date.send(@method, 2003, 53, 1) }.should raise_error(ArgumentError)
+    lambda { Date.send(@method, 2003, 52, 0) }.should raise_error(ArgumentError)
+    lambda { Date.send(@method, 2003, 52, 8) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/date/shared/parse.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/shared/parse.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/shared/parse.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,54 @@
+describe :date_parse, :shared => true do
+  it "can parse a mmm-YYYY string into a Date object" do
+    d = Date.parse("feb#{@sep}2008")
+    d.year.should  == 2008
+    d.month.should == 2
+    d.day.should   == 1
+  end
+
+  it "can parse a 'DD mmm YYYY' string into a Date object" do
+    d = Date.parse("23#{@sep}feb#{@sep}2008")
+    d.year.should  == 2008
+    d.month.should == 2
+    d.day.should   == 23
+  end
+
+  it "can parse a 'mmm DD YYYY' string into a Date object" do
+    d = Date.parse("23#{@sep}feb#{@sep}2008")
+    d.year.should  == 2008
+    d.month.should == 2
+    d.day.should   == 23
+  end
+
+  it "can parse a 'YYYY mmm DD' string into a Date object" do
+    d = Date.parse("2008#{@sep}feb#{@sep}23")
+    d.year.should  == 2008
+    d.month.should == 2
+    d.day.should   == 23
+  end
+
+  it "can parse a month name and day into a Date object" do
+    d = Date.parse("november#{@sep}5th")
+    d.should == Date.civil(Date.today.year, 11, 5)
+  end
+
+  it "can parse a month name, day and year into a Date object" do
+    d = Date.parse("november#{@sep}5th#{@sep}2005")
+    d.should == Date.civil(2005, 11, 5)
+  end
+
+  it "can parse a year, month name and day into a Date object" do
+    d = Date.parse("2005#{@sep}november#{@sep}5th")
+    d.should == Date.civil(2005, 11, 5)
+  end
+
+  it "can parse a year, day and month name into a Date object" do
+    d = Date.parse("5th#{@sep}november#{@sep}2005")
+    d.should == Date.civil(2005, 11, 5)
+  end
+
+  it "can handle negative year numbers" do
+    d = Date.parse("5th#{@sep}november#{@sep}-2005")
+    d.should == Date.civil(-2005, 11, 5)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/date/shared/parse_eu.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/shared/parse_eu.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/shared/parse_eu.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,30 @@
+describe :date_parse_eu, :shared => true do
+  # The - separator let's it work like European format, so it as a different spec
+  it "can parse a YYYY-MM-DD string into a Date object" do
+    d = Date.parse("2007#{@sep}10#{@sep}01")
+    d.year.should  == 2007
+    d.month.should == 10
+    d.day.should   == 1
+  end
+
+  it "can parse a MM-DD-YYYY string into a Date object" do
+    d = Date.parse("10#{@sep}01#{@sep}2007")
+    d.year.should  == 2007
+    d.month.should == 1
+    d.day.should   == 10
+  end
+
+  it "can parse a MM-DD-YY string into a Date object" do
+    d = Date.parse("10#{@sep}01#{@sep}07")
+    d.year.should  == 10
+    d.month.should == 1
+    d.day.should   == 7
+  end
+
+  it "can parse a MM-DD-YY string into a Date object using the year digits as 20XX" do
+    d = Date.parse("10#{@sep}01#{@sep}07", true)
+    d.year.should  == 2010
+    d.month.should == 1
+    d.day.should   == 7
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/date/shared/parse_us.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/shared/parse_us.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/shared/parse_us.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+describe :date_parse_us, :shared => true do
+  it "parses a YYYY#{@sep}MM#{@sep}DD string into a Date object" do
+    d = Date.parse("2007#{@sep}10#{@sep}01")
+    d.year.should  == 2007
+    d.month.should == 10
+    d.day.should   == 1
+  end
+
+  it "parses a MM#{@sep}DD#{@sep}YYYY string into a Date object" do
+    d = Date.parse("10#{@sep}01#{@sep}2007")
+    d.year.should  == 2007
+    d.month.should == 10
+    d.day.should   == 1
+  end
+
+  it "parses a MM#{@sep}DD#{@sep}YY string into a Date object" do
+    d = Date.parse("10#{@sep}01#{@sep}07")
+    d.year.should  == 7
+    d.month.should == 10
+    d.day.should   == 1
+  end
+
+  it "parses a MM#{@sep}DD#{@sep}YY string into a Date object using the year digits as 20XX" do
+    d = Date.parse("10#{@sep}01#{@sep}07", true)
+    d.year.should  == 2007
+    d.month.should == 10
+    d.day.should   == 1
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/date/step_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/step_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/step_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,56 @@
+require 'date' 
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Date#step" do
+  
+  it "should be able to step forward in time" do
+    ds    = Date.civil(2008, 10, 11)
+    de    = Date.civil(2008,  9, 29)
+    count = 0
+    de.step(ds) do |d|
+      d.should <= ds
+      d.should >= de
+      count += 1
+    end
+    count.should == 13
+
+    count = 0
+    de.step(ds, 5) do |d|
+      d.should <= ds
+      d.should >= de
+      count += 1
+    end
+    count.should == 3
+
+    count = 0
+    ds.step(de) do |d|; count += 1; end
+    count.should == 0
+
+  end
+  
+  it "should be able to step backward in time" do
+    ds    = Date.civil(2000, 4, 14)
+    de    = Date.civil(2000, 3, 29)
+    count = 0
+    ds.step(de, -1) do |d|
+      d.should <= ds
+      d.should >= de
+      count += 1
+    end
+    count.should == 17
+
+    count = 0
+    ds.step(de, -5) do |d|
+      d.should <= ds
+      d.should >= de
+      count += 1
+    end
+    count.should == 4
+
+    count = 0
+    de.step(ds, -1) do |d|; count += 1; end
+    count.should == 0
+    
+  end
+  
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/date/strftime_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/strftime_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/strftime_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,205 @@
+require 'date' 
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Date#strftime" do
+
+  it "should be able to print the date" do
+    Date.civil(2000, 4, 6).strftime.should == "2000-04-06"
+    Date.civil(2000, 4, 6).strftime.should == Date.civil(2000, 4, 6).to_s
+  end
+
+  it "should be able to print the full day name" do
+    Date.civil(2000, 4, 6).strftime("%A").should == "Thursday"
+  end
+
+  it "should be able to print the short day name" do
+    Date.civil(2000, 4, 6).strftime("%a").should == "Thu"
+  end
+
+  it "should be able to print the full month name" do
+    Date.civil(2000, 4, 6).strftime("%B").should == "April"
+  end
+
+  it "should be able to print the short month name" do
+    Date.civil(2000, 4, 6).strftime("%b").should == "Apr"
+    Date.civil(2000, 4, 6).strftime("%h").should == "Apr"
+    Date.civil(2000, 4, 6).strftime("%b").should == Date.civil(2000, 4, 6).strftime("%h")
+  end
+
+  it "should be able to print the century" do
+    Date.civil(2000, 4, 6).strftime("%C").should == "20"
+  end
+
+  it "should be able to print the month day with leading zeroes" do
+    Date.civil(2000, 4, 6).strftime("%d").should == "06"
+  end
+
+  it "should be able to print the month day with leading spaces" do
+    Date.civil(2000, 4, 6).strftime("%e").should == " 6"
+  end
+
+  it "should be able to print the commercial year with leading zeroes" do
+    Date.civil(2000, 4, 6).strftime("%G").should == "2000"
+    Date.civil( 200, 4, 6).strftime("%G").should == "0200"
+  end
+
+  it "should be able to print the commercial year with only two digits" do
+    Date.civil(2000, 4, 6).strftime("%g").should == "00"
+    Date.civil( 200, 4, 6).strftime("%g").should == "00"
+  end
+
+  it "should be able to print the hour with leading zeroes (hour is always 00)" do
+    Date.civil(2000, 4, 6).strftime("%H").should == "00"
+  end
+
+  it "should be able to print the hour in 12 hour notation with leading zeroes" do
+    Date.civil(2000, 4, 6).strftime("%I").should == "12"
+  end
+
+  it "should be able to print the year day with leading zeroes" do
+    Date.civil(2000, 4, 6).strftime("%j").should == "097"
+  end
+
+  it "should be able to print the hour in 24 hour notation with leading spaces" do
+    Date.civil(2000, 4, 6).strftime("%k").should == " 0"
+  end
+
+  it "should be able to print the hour in 12 hour notation with leading spaces" do
+    Date.civil(2000, 4, 6).strftime("%l").should == "12"
+  end
+  
+  it "should be able to print the minutes with leading zeroes" do
+    Date.civil(2000, 4, 6).strftime("%M").should == "00"
+  end
+
+  it "should be able to print the month with leading zeroes" do
+    Date.civil(2000, 4, 6).strftime("%m").should == "04"
+  end
+
+  it "should be able to add a newline" do
+    Date.civil(2000, 4, 6).strftime("%n").should == "\n"
+  end
+
+  it "should be able to show AM/PM" do
+    Date.civil(2000, 4, 6).strftime("%P").should == "am"
+  end
+
+  it "should be able to show am/pm" do
+    Date.civil(2000, 4, 6).strftime("%p").should == "AM"
+  end
+
+  it "should be able to show the number of seconds with leading zeroes" do
+    Date.civil(2000, 4, 6).strftime("%S").should == "00"
+  end
+
+  it "should be able to show the number of seconds with leading zeroes" do
+    Date.civil(2000, 4, 6).strftime("%S").should == "00"
+  end
+
+  it "should be able to show the number of seconds since the unix epoch" do
+    Date.civil(2000, 4, 6).strftime("%s").should == "954979200"
+  end
+  
+  it "should be able to add a tab" do
+    Date.civil(2000, 4, 6).strftime("%t").should == "\t"
+  end
+
+  it "should be able to show the week number with the week starting on sunday and monday" do
+    Date.civil(2000, 4, 6).strftime("%U").should == "14"
+    Date.civil(2000, 4, 6).strftime("%W").should == "14"
+    Date.civil(2000, 4, 6).strftime("%U").should == Date.civil(2000, 4, 6).strftime("%W")
+    Date.civil(2000, 4, 9).strftime("%U").should == "15"
+    Date.civil(2000, 4, 9).strftime("%W").should == "14"
+    Date.civil(2000, 4, 9).strftime("%U").should_not == Date.civil(2000, 4, 9).strftime("%W")
+  end
+  
+  it "should be able to show the commercial week day" do
+    Date.civil(2000, 4,  9).strftime("%u").should == "7"
+    Date.civil(2000, 4, 10).strftime("%u").should == "1"
+  end
+
+  it "should be able to show the commercial week" do
+    Date.civil(2000, 4,  9).strftime("%V").should == "14"
+    Date.civil(2000, 4, 10).strftime("%V").should == "15"
+  end
+  
+  it "should be able to show the week day" do
+    Date.civil(2000, 4,  9).strftime("%w").should == "0"
+    Date.civil(2000, 4, 10).strftime("%w").should == "1"
+  end
+
+  it "should be able to show the year in YYYY format" do
+    Date.civil(2000, 4,  9).strftime("%Y").should == "2000"
+  end
+
+  it "should be able to show the year in YY format" do
+    Date.civil(2000, 4,  9).strftime("%y").should == "00"
+  end
+
+  it "should be able to show the timezone of the date with a : separator" do
+    Date.civil(2000, 4,  9).strftime("%Z").should == "+00:00"
+  end
+
+  it "should be able to show the timezone of the date with a : separator" do
+    Date.civil(2000, 4,  9).strftime("%z").should == "+0000"
+  end
+
+  it "should be able to escape the % character" do
+    Date.civil(2000, 4,  9).strftime("%%").should == "%"
+  end
+  
+  ############################
+  # Specs that combine stuff #
+  ############################
+
+  it "should be able to print the date in full" do
+    Date.civil(2000, 4, 6).strftime("%c").should == "Thu Apr  6 00:00:00 2000"
+    Date.civil(2000, 4, 6).strftime("%c").should == Date.civil(2000, 4, 6).strftime('%a %b %e %H:%M:%S %Y')
+  end
+
+  it "should be able to print the date with slashes" do
+    Date.civil(2000, 4, 6).strftime("%D").should == "04/06/00"
+    Date.civil(2000, 4, 6).strftime("%D").should == Date.civil(2000, 4, 6).strftime('%m/%d/%y')  
+  end
+
+  it "should be able to print the date as YYYY-MM-DD" do
+    Date.civil(2000, 4, 6).strftime("%F").should == "2000-04-06"
+    Date.civil(2000, 4, 6).strftime("%F").should == Date.civil(2000, 4, 6).strftime('%Y-%m-%d')
+  end
+
+  it "should be able to show HH:MM" do
+    Date.civil(2000, 4, 6).strftime("%R").should == "00:00"
+    Date.civil(2000, 4, 6).strftime("%R").should == Date.civil(2000, 4, 6).strftime('%H:%M')
+  end
+
+  it "should be able to show HH:MM:SS AM/PM" do
+    Date.civil(2000, 4, 6).strftime("%r").should == "12:00:00 AM"
+    Date.civil(2000, 4, 6).strftime("%r").should == Date.civil(2000, 4, 6).strftime('%I:%M:%S %p')
+  end
+
+  it "should be able to show HH:MM:SS" do
+    Date.civil(2000, 4, 6).strftime("%T").should == "00:00:00"
+    Date.civil(2000, 4, 6).strftime("%T").should == Date.civil(2000, 4, 6).strftime('%H:%M:%S')
+  end
+  
+  it "should be able to show the commercial week" do
+    Date.civil(2000, 4,  9).strftime("%v").should == " 9-Apr-2000"
+    Date.civil(2000, 4,  9).strftime("%v").should == Date.civil(2000, 4,  9).strftime('%e-%b-%Y')
+  end
+  
+  it "should be able to show HH:MM:SS" do
+    Date.civil(2000, 4, 6).strftime("%X").should == "00:00:00"
+    Date.civil(2000, 4, 6).strftime("%X").should == Date.civil(2000, 4, 6).strftime('%H:%M:%S')
+  end
+
+  it "should be able to show MM/DD/YY" do
+    Date.civil(2000, 4, 6).strftime("%x").should == "04/06/00"
+    Date.civil(2000, 4, 6).strftime("%x").should == Date.civil(2000, 4, 6).strftime('%m/%d/%y')
+  end
+  
+  it "should be able to show a full notation" do
+    Date.civil(2000, 4,  9).strftime("%+").should == "Sun Apr  9 00:00:00 +00:00 2000"
+    Date.civil(2000, 4,  9).strftime("%+").should == Date.civil(2000, 4,  9).strftime('%a %b %e %H:%M:%S %Z %Y')
+  end
+
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/date/strptime_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/strptime_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/strptime_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,143 @@
+require 'date' 
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Date#strftime" do
+
+  it "should be able to parse without arguments" do
+    Date.strptime.should == Date.civil(-4712, 1, 1)
+  end
+
+  it "should be able to parse the default date format" do
+    Date.strptime("2000-04-06").should == Date.civil(2000, 4, 6)
+    Date.civil(2000, 4, 6).strftime.should == Date.civil(2000, 4, 6).to_s
+  end
+
+  it "should be able to parse the full day name" do
+    d = Date.today
+    # strptime assumed week that start on sunday, not monday
+    week = d.cweek
+    week += 1 if d.cwday == 7
+    Date.strptime("Thursday", "%A").should == Date.commercial(d.cwyear, week, 4)
+  end
+
+  it "should be able to parse the short day name" do
+    d = Date.today
+    # strptime assumed week that start on sunday, not monday
+    week = d.cweek
+    week += 1 if d.cwday == 7
+    Date.strptime("Thu", "%a").should == Date.commercial(d.cwyear, week, 4)
+  end
+
+  it "should be able to parse the full month name" do
+    d = Date.today
+    Date.strptime("April", "%B").should == Date.civil(d.year, 4, 1)
+  end
+
+  it "should be able to parse the short month name" do
+    d = Date.today
+    Date.strptime("Apr", "%b").should == Date.civil(d.year, 4, 1)
+    Date.strptime("Apr", "%h").should == Date.civil(d.year, 4, 1)
+  end
+
+  it "should be able to parse the century" do
+    Date.strptime("06 20", "%y %C").should == Date.civil(2006, 1, 1)
+  end
+
+  it "should be able to parse the month day with leading zeroes" do
+    d = Date.today
+    Date.strptime("06", "%d").should == Date.civil(d.year, d.month, 6)
+  end
+
+  it "should be able to parse the month day with leading spaces" do
+    d = Date.today
+    Date.strptime(" 6", "%e").should == Date.civil(d.year, d.month, 6)
+  end
+
+  it "should be able to parse the commercial year with leading zeroes" do
+    Date.strptime("2000", "%G").should == Date.civil(2000,  1,  3)
+    Date.strptime("2002", "%G").should == Date.civil(2001, 12, 31)
+  end
+
+  it "should be able to parse the commercial year with only two digits" do
+    Date.strptime("68", "%g").should == Date.civil(2068,  1,  2)
+    Date.strptime("69", "%g").should == Date.civil(1968, 12, 30)
+  end
+
+  it "should be able to parse the year day with leading zeroes" do
+    d = Date.today
+    if Date.gregorian_leap?(Date.today.year)
+      Date.strptime("097", "%j").should == Date.civil(d.year, 4, 6)
+    else
+      Date.strptime("097", "%j").should == Date.civil(d.year, 4, 7)
+    end
+  end
+
+  it "should be able to parse the month with leading zeroes" do
+    d = Date.today
+    Date.strptime("04", "%m").should == Date.civil(d.year, 4, 1)
+  end
+
+  it "should be able to show the week number with the week starting on sunday and monday" do
+    d = Date.today
+    Date.strptime("14", "%U").should == Date.commercial(d.cwyear, 14, 7)
+    Date.strptime("14", "%W").should == Date.commercial(d.cwyear, 15, 7)
+  end
+  
+  it "should be able to show the commercial week day" do
+    Date.strptime("2008 1", "%G %u").should == Date.civil(2007, 12, 31)
+  end
+
+  it "should be able to show the commercial week" do
+    d = Date.commercial(Date.today.year,1,1)
+    Date.strptime("1", "%V").should == d
+    Date.strptime("15", "%V").should == Date.commercial(d.cwyear, 15, 1)
+  end
+  
+  it "should be able to show the week day" do
+    d = Date.today
+    Date.strptime("2007 4", "%Y %w").should == Date.civil(2007, 1, 4)
+  end
+
+  it "should be able to show the year in YYYY format" do
+    Date.strptime("2007", "%Y").should == Date.civil(2007, 1, 1)
+  end
+
+  it "should be able to show the year in YY format" do
+    Date.strptime("00", "%y").should == Date.civil(2000, 1, 1)
+  end
+
+  ############################
+  # Specs that combine stuff #
+  ############################
+
+  it "should be able to parse the date in full" do
+    Date.strptime("Thu Apr  6 00:00:00 2000", "%c").should == Date.civil(2000, 4, 6)
+    Date.strptime("Thu Apr  6 00:00:00 2000", "%a %b %e %H:%M:%S %Y").should == Date.civil(2000, 4, 6)
+  end
+
+  it "should be able to parse the date with slashes" do
+    Date.strptime("04/06/00", "%D").should == Date.civil(2000, 4, 6)
+    Date.strptime("04/06/00", "%m/%d/%y").should == Date.civil(2000, 4, 6)
+  end
+
+  it "should be able to parse the date as YYYY-MM-DD" do
+    Date.strptime("2000-04-06", "%F").should == Date.civil(2000, 4, 6)
+    Date.strptime("2000-04-06", "%Y-%m-%d").should == Date.civil(2000, 4, 6)
+  end
+
+  it "should be able to show the commercial week" do
+    Date.strptime(" 9-Apr-2000", "%v").should == Date.civil(2000, 4, 9)
+    Date.strptime(" 9-Apr-2000", "%e-%b-%Y").should == Date.civil(2000, 4, 9)
+  end
+  
+  it "should be able to show MM/DD/YY" do
+    Date.strptime("04/06/00", "%x").should == Date.civil(2000, 4, 6)
+    Date.strptime("04/06/00", "%m/%d/%y").should == Date.civil(2000, 4, 6)
+  end
+  
+  it "should be able to show a full notation" do
+    Date.strptime("Sun Apr  9 00:00:00 +00:00 2000", "%+").should == Date.civil(2000, 4, 9)
+    Date.strptime("Sun Apr  9 00:00:00 +00:00 2000", "%a %b %e %H:%M:%S %Z %Y").should == Date.civil(2000, 4, 9)
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/date/upto_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/date/upto_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/date/upto_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require 'date' 
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Date#upto" do
+  
+  it "should be able to step forward in time" do
+    ds    = Date.civil(2008, 10, 11)
+    de    = Date.civil(2008,  9, 29)
+    count = 0
+    de.upto(ds) do |d|
+      d.should <= ds
+      d.should >= de
+      count += 1
+    end
+    count.should == 13
+  end
+
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/digest/md5/append_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/md5/append_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/md5/append_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+require File.dirname(__FILE__) + '/shared/update'
+
+describe "Digest::MD5#<<" do
+ it_behaves_like(:md5_update, :<<)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/md5/block_length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/md5/block_length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/md5/block_length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::MD5#block_length" do
+
+  it 'returns the length of digest block' do
+    cur_digest = Digest::MD5.new
+    cur_digest.block_length.should == MD5Constants::BlockLength
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/md5/digest_bang_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/md5/digest_bang_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/md5/digest_bang_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::MD5#digest!" do
+
+  it 'returns a digest and can digest!' do
+    cur_digest = Digest::MD5.new
+    cur_digest << MD5Constants::Contents
+    cur_digest.digest!().should == MD5Constants::Digest
+    cur_digest.digest().should == MD5Constants::BlankDigest
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/md5/digest_length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/md5/digest_length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/md5/digest_length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::MD5#digest_length" do
+
+  it 'returns the length of computed digests' do
+    cur_digest = Digest::MD5.new
+    cur_digest.digest_length.should == MD5Constants::DigestLength
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/md5/digest_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/md5/digest_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/md5/digest_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::MD5#digest" do
+
+  it 'returns a digest' do
+    cur_digest = Digest::MD5.new
+    cur_digest.digest().should == MD5Constants::BlankDigest
+
+    # add something to check that the state is reset later
+    cur_digest << "test"
+
+    cur_digest.digest(MD5Constants::Contents).should == MD5Constants::Digest
+    # second invocation is intentional, to make sure there are no side-effects
+    cur_digest.digest(MD5Constants::Contents).should == MD5Constants::Digest
+
+    # after all is done, verify that the digest is in the original, blank state
+    cur_digest.digest.should == MD5Constants::BlankDigest
+  end
+
+end
+
+describe "Digest::MD5.digest" do
+
+  it 'returns a digest' do
+    Digest::MD5.digest(MD5Constants::Contents).should == MD5Constants::Digest
+    # second invocation is intentional, to make sure there are no side-effects
+    Digest::MD5.digest(MD5Constants::Contents).should == MD5Constants::Digest
+    Digest::MD5.digest("").should == MD5Constants::BlankDigest
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/md5/equal_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/md5/equal_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/md5/equal_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,37 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::MD5#==" do
+
+  it 'should be equal to itself' do
+    cur_digest = Digest::MD5.new
+    cur_digest.should == cur_digest
+  end
+
+  it 'should be equal to string representing its hexdigest' do
+    cur_digest = Digest::MD5.new
+    cur_digest.should == MD5Constants::BlankHexdigest
+  end
+
+  it 'should be equal to appropriate object that responds to to_str' do
+    # blank digest
+    cur_digest = Digest::MD5.new
+    (obj = mock(MD5Constants::BlankHexdigest)).should_receive(:to_str).and_return(MD5Constants::BlankHexdigest)
+    cur_digest.should == obj
+
+    # non-blank digest
+    cur_digest = Digest::MD5.new
+    cur_digest << "test"
+    d_value = cur_digest.hexdigest
+    (obj = mock(d_value)).should_receive(:to_str).and_return(d_value)
+    cur_digest.should == obj
+  end
+
+  it 'should be equal for same digest different object' do
+    cur_digest = Digest::MD5.new
+    cur_digest2 = Digest::MD5.new
+    cur_digest.should == cur_digest2
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/md5/hexdigest_bang_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/md5/hexdigest_bang_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/md5/hexdigest_bang_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::MD5#hexdigest!" do
+
+  it 'returns a hexdigest and resets the state' do
+    cur_digest = Digest::MD5.new
+
+    cur_digest << MD5Constants::Contents
+    cur_digest.hexdigest!.should == MD5Constants::Hexdigest
+    cur_digest.hexdigest.should == MD5Constants::BlankHexdigest
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/md5/hexdigest_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/md5/hexdigest_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/md5/hexdigest_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::MD5#hexdigest" do
+
+  it 'returns a hexdigest' do
+    cur_digest = Digest::MD5.new
+    cur_digest.hexdigest.should == MD5Constants::BlankHexdigest
+
+    # add something to check that the state is reset later
+    cur_digest << "test"
+
+    cur_digest.hexdigest(MD5Constants::Contents).should == MD5Constants::Hexdigest
+    # second invocation is intentional, to make sure there are no side-effects
+    cur_digest.hexdigest(MD5Constants::Contents).should == MD5Constants::Hexdigest
+
+    # after all is done, verify that the digest is in the original, blank state
+    cur_digest.hexdigest.should == MD5Constants::BlankHexdigest
+  end
+
+end
+
+describe "Digest::MD5.hexdigest" do
+
+  it 'returns a hexdigest' do
+    Digest::MD5.hexdigest(MD5Constants::Contents).should == MD5Constants::Hexdigest
+    # second invocation is intentional, to make sure there are no side-effects
+    Digest::MD5.hexdigest(MD5Constants::Contents).should == MD5Constants::Hexdigest
+    Digest::MD5.hexdigest("").should == MD5Constants::BlankHexdigest
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/md5/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/md5/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/md5/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::MD5#inspect" do
+
+  it 'returns a Ruby object representation' do
+    cur_digest = Digest::MD5.new
+    cur_digest.inspect.should == "#<#{MD5Constants::Klass}: #{cur_digest.hexdigest()}>"
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/md5/length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/md5/length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/md5/length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+require File.dirname(__FILE__) + '/shared/length'
+
+describe "Digest::MD5#length" do
+  it_behaves_like :md5_length, :length
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/md5/reset_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/md5/reset_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/md5/reset_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::MD5#reset" do
+
+  it 'can returns digest state to initial conditions' do
+    cur_digest = Digest::MD5.new
+    cur_digest.update MD5Constants::Contents
+    cur_digest.digest().should_not == MD5Constants::BlankDigest
+    cur_digest.reset
+    cur_digest.digest().should == MD5Constants::BlankDigest
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/md5/shared/constants.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/md5/shared/constants.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/md5/shared/constants.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require 'digest/md5'
+
+module MD5Constants
+
+  Contents = "Ipsum is simply dummy text of the printing and typesetting industry. \nLorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. \nIt has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. \nIt was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
+  
+  Klass          = ::Digest::MD5
+  BlockLength    = 64
+  DigestLength   = 16
+  BlankDigest    = "\324\035\214\331\217\000\262\004\351\200\t\230\354\370B~"
+  Digest         = "\2473\267qw\276\364\343\345\320\304\350\313\314\217n"
+  BlankHexdigest = "d41d8cd98f00b204e9800998ecf8427e"
+  Hexdigest      = "a733b77177bef4e3e5d0c4e8cbcc8f6e"
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/md5/shared/length.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/md5/shared/length.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/md5/shared/length.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+describe :md5_length, :shared => true do
+  it 'returns the length of the digest' do
+    cur_digest = Digest::MD5.new
+    cur_digest.send(@method).should == MD5Constants::BlankDigest.size
+    cur_digest << MD5Constants::Contents
+    cur_digest.send(@method).should == MD5Constants::Digest.size
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/md5/shared/sample.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/md5/shared/sample.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/md5/shared/sample.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require 'digest/md5'
+
+module MD5Constants
+
+  Contents = "Ipsum is simply dummy text of the printing and typesetting industry. \nLorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. \nIt has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. \nIt was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
+  
+  Klass          = ::Digest::MD5
+  BlockLength    = 64
+  DigestLength   = 16
+  BlankDigest    = "\324\035\214\331\217\000\262\004\351\200\t\230\354\370B~"
+  Digest         = "\2473\267qw\276\364\343\345\320\304\350\313\314\217n"
+  BlankHexdigest = "d41d8cd98f00b204e9800998ecf8427e"
+  Hexdigest      = "a733b77177bef4e3e5d0c4e8cbcc8f6e"
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/md5/shared/update.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/md5/shared/update.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/md5/shared/update.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+describe :md5_update, :shared => true do
+  it 'can update' do
+    cur_digest = Digest::MD5.new
+    cur_digest.send @method, MD5Constants::Contents
+    cur_digest.digest.should == MD5Constants::Digest
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/md5/size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/md5/size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/md5/size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+require File.dirname(__FILE__) + '/shared/length'
+
+describe "Digest::MD5#size" do
+  it_behaves_like :md5_length, :size
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/md5/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/md5/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/md5/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+require 'digest/md5'
+
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::MD5#to_s" do
+
+  it 'returns a hexdigest' do
+    cur_digest = Digest::MD5.new
+    cur_digest.to_s.should == MD5Constants::BlankHexdigest
+  end
+
+  it 'does not change the internal state' do
+    cur_digest = Digest::MD5.new
+    cur_digest.to_s.should == MD5Constants::BlankHexdigest
+    cur_digest.to_s.should == MD5Constants::BlankHexdigest
+
+    cur_digest << MD5Constants::Contents
+    cur_digest.to_s.should == MD5Constants::Hexdigest
+    cur_digest.to_s.should == MD5Constants::Hexdigest
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/md5/update_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/md5/update_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/md5/update_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+require File.dirname(__FILE__) + '/shared/update'
+
+describe "Digest::MD5#update" do
+  it_behaves_like :md5_update, :update
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha1/digest_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha1/digest_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha1/digest_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA1#digest" do
+
+  it 'returns a digest' do
+    cur_digest = Digest::SHA1.new
+    cur_digest.digest().should == SHA1Constants::BlankDigest
+    cur_digest.digest(SHA1Constants::Contents).should == SHA1Constants::Digest
+  end
+
+end
+
+describe "Digest::SHA1.digest" do
+
+  it 'returns a digest' do
+    Digest::SHA1.digest(SHA1Constants::Contents).should == SHA1Constants::Digest
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha1/shared/constants.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha1/shared/constants.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha1/shared/constants.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require 'digest/sha1'
+
+module SHA1Constants
+
+  Contents = "Ipsum is simply dummy text of the printing and typesetting industry. \nLorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. \nIt has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. \nIt was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
+  
+  Klass          = ::Digest::SHA1
+  BlockLength    = 64
+  DigestLength   = 20
+  BlankDigest    = "\3329\243\356^kK\r2U\277\357\225`\030\220\257\330\a\t"
+  Digest         = "X!\255b\323\035\352\314a|q\344+\376\317\361V9\324\343"
+  BlankHexdigest = "da39a3ee5e6b4b0d3255bfef95601890afd80709"
+  Hexdigest      = "e907d2ba21c6c74bc0efd76e44d11fb9bbb7a75e"
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha256/append_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha256/append_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha256/append_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+require File.dirname(__FILE__) + '/shared/update'
+
+describe "Digest::SHA256#<<" do
+ it_behaves_like(:sha256_update, :<<)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha256/block_length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha256/block_length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha256/block_length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA256#block_length" do
+
+  it 'returns the length of digest block' do
+    cur_digest = Digest::SHA256.new
+    cur_digest.block_length.should == SHA256Constants::BlockLength
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha256/digest_bang_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha256/digest_bang_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha256/digest_bang_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA256#digest!" do
+
+  it 'returns a digest and can digest!' do
+    cur_digest = Digest::SHA256.new
+    cur_digest << SHA256Constants::Contents
+    cur_digest.digest!().should == SHA256Constants::Digest
+    cur_digest.digest().should == SHA256Constants::BlankDigest
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha256/digest_length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha256/digest_length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha256/digest_length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA256#digest_length" do
+
+  it 'returns the length of computed digests' do
+    cur_digest = Digest::SHA256.new
+    cur_digest.digest_length.should == SHA256Constants::DigestLength
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha256/digest_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha256/digest_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha256/digest_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA256#digest" do
+
+  it 'returns a digest' do
+    cur_digest = Digest::SHA256.new
+    cur_digest.digest().should == SHA256Constants::BlankDigest
+
+    # add something to check that the state is reset later
+    cur_digest << "test"
+
+    cur_digest.digest(SHA256Constants::Contents).should == SHA256Constants::Digest
+    # second invocation is intentional, to make sure there are no side-effects
+    cur_digest.digest(SHA256Constants::Contents).should == SHA256Constants::Digest
+
+    # after all is done, verify that the digest is in the original, blank state
+    cur_digest.digest.should == SHA256Constants::BlankDigest
+  end
+
+end
+
+describe "Digest::SHA256.digest" do
+
+  it 'returns a digest' do
+    Digest::SHA256.digest(SHA256Constants::Contents).should == SHA256Constants::Digest
+    # second invocation is intentional, to make sure there are no side-effects
+    Digest::SHA256.digest(SHA256Constants::Contents).should == SHA256Constants::Digest
+    Digest::SHA256.digest("").should == SHA256Constants::BlankDigest
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha256/equal_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha256/equal_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha256/equal_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,37 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA256#==" do
+
+  it 'should be equal to itself' do
+    cur_digest = Digest::SHA256.new
+    cur_digest.should == cur_digest
+  end
+
+  it 'should be equal to string representing its hexdigest' do
+    cur_digest = Digest::SHA256.new
+    cur_digest.should == SHA256Constants::BlankHexdigest
+  end
+
+  it 'should be equal to appropriate object that responds to to_str' do
+    # blank digest
+    cur_digest = Digest::SHA256.new
+    (obj = mock(SHA256Constants::BlankHexdigest)).should_receive(:to_str).and_return(SHA256Constants::BlankHexdigest)
+    cur_digest.should == obj
+
+    # non-blank digest
+    cur_digest = Digest::SHA256.new
+    cur_digest << "test"
+    d_value = cur_digest.hexdigest
+    (obj = mock(d_value)).should_receive(:to_str).and_return(d_value)
+    cur_digest.should == obj
+  end
+
+  it 'should be equal for same digest different object' do
+    cur_digest = Digest::SHA256.new
+    cur_digest2 = Digest::SHA256.new
+    cur_digest.should == cur_digest2
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha256/hexdigest_bang_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha256/hexdigest_bang_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha256/hexdigest_bang_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA256#hexdigest!" do
+
+  it 'returns a hexdigest and resets the state' do
+    cur_digest = Digest::SHA256.new
+
+    cur_digest << SHA256Constants::Contents
+    cur_digest.hexdigest!.should == SHA256Constants::Hexdigest
+    cur_digest.hexdigest.should == SHA256Constants::BlankHexdigest
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha256/hexdigest_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha256/hexdigest_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha256/hexdigest_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA256#hexdigest" do
+
+  it 'returns a hexdigest' do
+    cur_digest = Digest::SHA256.new
+    cur_digest.hexdigest.should == SHA256Constants::BlankHexdigest
+
+    # add something to check that the state is reset later
+    cur_digest << "test"
+
+    cur_digest.hexdigest(SHA256Constants::Contents).should == SHA256Constants::Hexdigest
+    # second invocation is intentional, to make sure there are no side-effects
+    cur_digest.hexdigest(SHA256Constants::Contents).should == SHA256Constants::Hexdigest
+
+    # after all is done, verify that the digest is in the original, blank state
+    cur_digest.hexdigest.should == SHA256Constants::BlankHexdigest
+  end
+
+end
+
+describe "Digest::SHA256.hexdigest" do
+
+  it 'returns a hexdigest' do
+    Digest::SHA256.hexdigest(SHA256Constants::Contents).should == SHA256Constants::Hexdigest
+    # second invocation is intentional, to make sure there are no side-effects
+    Digest::SHA256.hexdigest(SHA256Constants::Contents).should == SHA256Constants::Hexdigest
+    Digest::SHA256.hexdigest("").should == SHA256Constants::BlankHexdigest
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha256/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha256/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha256/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA256#inspect" do
+
+  it 'returns a Ruby object representation' do
+    cur_digest = Digest::SHA256.new
+    cur_digest.inspect.should == "#<#{SHA256Constants::Klass}: #{cur_digest.hexdigest()}>"
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha256/length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha256/length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha256/length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+require File.dirname(__FILE__) + '/shared/length'
+
+describe "Digest::SHA256#length" do
+  it_behaves_like :sha256_length, :length
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha256/reset_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha256/reset_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha256/reset_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA256#reset" do
+
+  it 'can returns digest state to initial conditions' do
+    cur_digest = Digest::SHA256.new
+    cur_digest.update SHA256Constants::Contents
+    cur_digest.digest().should_not == SHA256Constants::BlankDigest
+    cur_digest.reset
+    cur_digest.digest().should == SHA256Constants::BlankDigest
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha256/shared/constants.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha256/shared/constants.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha256/shared/constants.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require 'digest/sha2'
+
+module SHA256Constants
+
+  Contents = "Ipsum is simply dummy text of the printing and typesetting industry. \nLorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. \nIt has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. \nIt was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
+  
+  Klass          = ::Digest::SHA256
+  BlockLength    = 64
+  DigestLength   = 32
+  BlankDigest    = "\343\260\304B\230\374\034\024\232\373\364\310\231o\271$'\256A\344d\233\223L\244\225\231\exR\270U"
+  Digest         = "\230b\265\344_\337\357\337\242\004\314\311A\211jb\350\373\254\370\365M\230B\002\372\020j\as\270\376"
+  BlankHexdigest = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
+  Hexdigest      = "9862b5e45fdfefdfa204ccc941896a62e8fbacf8f54d984202fa106a0773b8fe"
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha256/shared/length.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha256/shared/length.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha256/shared/length.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+describe :sha256_length, :shared => true do
+  it 'returns the length of the digest' do
+    cur_digest = Digest::SHA256.new
+    cur_digest.send(@method).should == SHA256Constants::BlankDigest.size
+    cur_digest << SHA256Constants::Contents
+    cur_digest.send(@method).should == SHA256Constants::Digest.size
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha256/shared/update.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha256/shared/update.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha256/shared/update.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+describe :sha256_update, :shared => true do
+  it 'can update' do
+    cur_digest = Digest::SHA256.new
+    cur_digest.send @method, SHA256Constants::Contents
+    cur_digest.digest.should == SHA256Constants::Digest
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha256/size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha256/size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha256/size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+require File.dirname(__FILE__) + '/shared/length'
+
+describe "Digest::SHA256#size" do
+  it_behaves_like :sha256_length, :size
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha256/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha256/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha256/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA256#to_s" do
+
+  it 'returns a hexdigest' do
+    cur_digest = Digest::SHA256.new
+    cur_digest.to_s.should == SHA256Constants::BlankHexdigest
+  end
+
+  it 'does not change the internal state' do
+    cur_digest = Digest::SHA256.new
+    cur_digest.to_s.should == SHA256Constants::BlankHexdigest
+    cur_digest.to_s.should == SHA256Constants::BlankHexdigest
+
+    cur_digest << SHA256Constants::Contents
+    cur_digest.to_s.should == SHA256Constants::Hexdigest
+    cur_digest.to_s.should == SHA256Constants::Hexdigest
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha256/update_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha256/update_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha256/update_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+require File.dirname(__FILE__) + '/shared/update'
+
+describe "Digest::SHA256#update" do
+  it_behaves_like :sha256_update, :update
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha384/append_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha384/append_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha384/append_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+require File.dirname(__FILE__) + '/shared/update'
+
+describe "Digest::SHA384#<<" do
+ it_behaves_like(:sha384_update, :<<)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha384/block_length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha384/block_length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha384/block_length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA384#block_length" do
+
+  it 'returns the length of digest block' do
+    cur_digest = Digest::SHA384.new
+    cur_digest.block_length.should == SHA384Constants::BlockLength
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha384/digest_bang_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha384/digest_bang_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha384/digest_bang_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA384#digest!" do
+
+  it 'returns a digest and can digest!' do
+    cur_digest = Digest::SHA384.new
+    cur_digest << SHA384Constants::Contents
+    cur_digest.digest!().should == SHA384Constants::Digest
+    cur_digest.digest().should == SHA384Constants::BlankDigest
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha384/digest_length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha384/digest_length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha384/digest_length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA384#digest_length" do
+
+  it 'returns the length of computed digests' do
+    cur_digest = Digest::SHA384.new
+    cur_digest.digest_length.should == SHA384Constants::DigestLength
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha384/digest_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha384/digest_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha384/digest_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA384#digest" do
+
+  it 'returns a digest' do
+    cur_digest = Digest::SHA384.new
+    cur_digest.digest().should == SHA384Constants::BlankDigest
+
+    # add something to check that the state is reset later
+    cur_digest << "test"
+
+    cur_digest.digest(SHA384Constants::Contents).should == SHA384Constants::Digest
+    # second invocation is intentional, to make sure there are no side-effects
+    cur_digest.digest(SHA384Constants::Contents).should == SHA384Constants::Digest
+
+    # after all is done, verify that the digest is in the original, blank state
+    cur_digest.digest.should == SHA384Constants::BlankDigest
+  end
+
+end
+
+describe "Digest::SHA384.digest" do
+
+  it 'returns a digest' do
+    Digest::SHA384.digest(SHA384Constants::Contents).should == SHA384Constants::Digest
+    # second invocation is intentional, to make sure there are no side-effects
+    Digest::SHA384.digest(SHA384Constants::Contents).should == SHA384Constants::Digest
+    Digest::SHA384.digest("").should == SHA384Constants::BlankDigest
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha384/equal_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha384/equal_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha384/equal_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,37 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA384#==" do
+
+  it 'should be equal to itself' do
+    cur_digest = Digest::SHA384.new
+    cur_digest.should == cur_digest
+  end
+
+  it 'should be equal to string representing its hexdigest' do
+    cur_digest = Digest::SHA384.new
+    cur_digest.should == SHA384Constants::BlankHexdigest
+  end
+
+  it 'should be equal to appropriate object that responds to to_str' do
+    # blank digest
+    cur_digest = Digest::SHA384.new
+    (obj = mock(SHA384Constants::BlankHexdigest)).should_receive(:to_str).and_return(SHA384Constants::BlankHexdigest)
+    cur_digest.should == obj
+
+    # non-blank digest
+    cur_digest = Digest::SHA384.new
+    cur_digest << "test"
+    d_value = cur_digest.hexdigest
+    (obj = mock(d_value)).should_receive(:to_str).and_return(d_value)
+    cur_digest.should == obj
+  end
+
+  it 'should be equal for same digest different object' do
+    cur_digest = Digest::SHA384.new
+    cur_digest2 = Digest::SHA384.new
+    cur_digest.should == cur_digest2
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha384/hexdigest_bang_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha384/hexdigest_bang_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha384/hexdigest_bang_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA384#hexdigest!" do
+
+  it 'returns a hexdigest and resets the state' do
+    cur_digest = Digest::SHA384.new
+
+    cur_digest << SHA384Constants::Contents
+    cur_digest.hexdigest!.should == SHA384Constants::Hexdigest
+    cur_digest.hexdigest.should == SHA384Constants::BlankHexdigest
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha384/hexdigest_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha384/hexdigest_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha384/hexdigest_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA384#hexdigest" do
+
+  it 'returns a hexdigest' do
+    cur_digest = Digest::SHA384.new
+    cur_digest.hexdigest.should == SHA384Constants::BlankHexdigest
+
+    # add something to check that the state is reset later
+    cur_digest << "test"
+
+    cur_digest.hexdigest(SHA384Constants::Contents).should == SHA384Constants::Hexdigest
+    # second invocation is intentional, to make sure there are no side-effects
+    cur_digest.hexdigest(SHA384Constants::Contents).should == SHA384Constants::Hexdigest
+
+    # after all is done, verify that the digest is in the original, blank state
+    cur_digest.hexdigest.should == SHA384Constants::BlankHexdigest
+  end
+
+end
+
+describe "Digest::SHA384.hexdigest" do
+
+  it 'returns a hexdigest' do
+    Digest::SHA384.hexdigest(SHA384Constants::Contents).should == SHA384Constants::Hexdigest
+    # second invocation is intentional, to make sure there are no side-effects
+    Digest::SHA384.hexdigest(SHA384Constants::Contents).should == SHA384Constants::Hexdigest
+    Digest::SHA384.hexdigest("").should == SHA384Constants::BlankHexdigest
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha384/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha384/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha384/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA384#inspect" do
+
+  it 'returns a Ruby object representation' do
+    cur_digest = Digest::SHA384.new
+    cur_digest.inspect.should == "#<#{SHA384Constants::Klass}: #{cur_digest.hexdigest()}>"
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha384/length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha384/length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha384/length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+require File.dirname(__FILE__) + '/shared/length'
+
+describe "Digest::SHA384#length" do
+  it_behaves_like :sha384_length, :length
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha384/reset_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha384/reset_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha384/reset_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA384#reset" do
+
+  it 'can returns digest state to initial conditions' do
+    cur_digest = Digest::SHA384.new
+    cur_digest.update SHA384Constants::Contents
+    cur_digest.digest().should_not == SHA384Constants::BlankDigest
+    cur_digest.reset
+    cur_digest.digest().should == SHA384Constants::BlankDigest
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha384/shared/constants.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha384/shared/constants.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha384/shared/constants.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require 'digest/sha2'
+
+module SHA384Constants
+
+  Contents = "Ipsum is simply dummy text of the printing and typesetting industry. \nLorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. \nIt has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. \nIt was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
+  
+  
+  Klass          = ::Digest::SHA384
+  BlockLength    = 128
+  DigestLength   = 48
+  BlankDigest    = "8\260`\247Q\254\2268L\3312~\261\261\343j!\375\267\021\024\276\aCL\f\307\277c\366\341\332'N\336\277\347oe\373\325\032\322\361H\230\271["
+  Digest         = "B&\266:\314\216z\361!TD\001{`\355\323\320MW%\270\272\0034n\034\026g\a\217\"\333s\202\275\002Y*\217]\207u\f\034\244\231\266f"
+  BlankHexdigest = "38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b"
+  Hexdigest      = "4226b63acc8e7af1215444017b60edd3d04d5725b8ba03346e1c1667078f22db7382bd02592a8f5d87750c1ca499b666"
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha384/shared/length.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha384/shared/length.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha384/shared/length.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+describe :sha384_length, :shared => true do
+  it 'returns the length of the digest' do
+    cur_digest = Digest::SHA384.new
+    cur_digest.send(@method).should == SHA384Constants::BlankDigest.size
+    cur_digest << SHA384Constants::Contents
+    cur_digest.send(@method).should == SHA384Constants::Digest.size
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha384/shared/update.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha384/shared/update.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha384/shared/update.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+describe :sha384_update, :shared => true do
+  it 'can update' do
+    cur_digest = Digest::SHA384.new
+    cur_digest.send @method, SHA384Constants::Contents
+    cur_digest.digest.should == SHA384Constants::Digest
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha384/size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha384/size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha384/size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+require File.dirname(__FILE__) + '/shared/length'
+
+describe "Digest::SHA384#size" do
+  it_behaves_like :sha384_length, :size
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha384/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha384/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha384/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA384#to_s" do
+
+  it 'returns a hexdigest' do
+    cur_digest = Digest::SHA384.new
+    cur_digest.to_s.should == SHA384Constants::BlankHexdigest
+  end
+
+  it 'does not change the internal state' do
+    cur_digest = Digest::SHA384.new
+    cur_digest.to_s.should == SHA384Constants::BlankHexdigest
+    cur_digest.to_s.should == SHA384Constants::BlankHexdigest
+
+    cur_digest << SHA384Constants::Contents
+    cur_digest.to_s.should == SHA384Constants::Hexdigest
+    cur_digest.to_s.should == SHA384Constants::Hexdigest
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha384/update_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha384/update_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha384/update_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+require File.dirname(__FILE__) + '/shared/update'
+
+describe "Digest::SHA384#update" do
+  it_behaves_like :sha384_update, :update
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha512/append_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha512/append_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha512/append_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+require File.dirname(__FILE__) + '/shared/update'
+
+describe "Digest::SHA512#<<" do
+ it_behaves_like(:sha512_update, :<<)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha512/block_length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha512/block_length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha512/block_length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA512#block_length" do
+
+  it 'returns the length of digest block' do
+    cur_digest = Digest::SHA512.new
+    cur_digest.block_length.should == SHA512Constants::BlockLength
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha512/digest_bang_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha512/digest_bang_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha512/digest_bang_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA512#digest!" do
+
+  it 'returns a digest and can digest!' do
+    cur_digest = Digest::SHA512.new
+    cur_digest << SHA512Constants::Contents
+    cur_digest.digest!().should == SHA512Constants::Digest
+    cur_digest.digest().should == SHA512Constants::BlankDigest
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha512/digest_length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha512/digest_length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha512/digest_length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA512#digest_length" do
+
+  it 'returns the length of computed digests' do
+    cur_digest = Digest::SHA512.new
+    cur_digest.digest_length.should == SHA512Constants::DigestLength
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha512/digest_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha512/digest_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha512/digest_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA512#digest" do
+
+  it 'returns a digest' do
+    cur_digest = Digest::SHA512.new
+    cur_digest.digest().should == SHA512Constants::BlankDigest
+
+    # add something to check that the state is reset later
+    cur_digest << "test"
+
+    cur_digest.digest(SHA512Constants::Contents).should == SHA512Constants::Digest
+    # second invocation is intentional, to make sure there are no side-effects
+    cur_digest.digest(SHA512Constants::Contents).should == SHA512Constants::Digest
+
+    # after all is done, verify that the digest is in the original, blank state
+    cur_digest.digest.should == SHA512Constants::BlankDigest
+  end
+
+end
+
+describe "Digest::SHA512.digest" do
+
+  it 'returns a digest' do
+    Digest::SHA512.digest(SHA512Constants::Contents).should == SHA512Constants::Digest
+    # second invocation is intentional, to make sure there are no side-effects
+    Digest::SHA512.digest(SHA512Constants::Contents).should == SHA512Constants::Digest
+    Digest::SHA512.digest("").should == SHA512Constants::BlankDigest
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha512/equal_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha512/equal_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha512/equal_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,37 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA512#==" do
+
+  it 'should be equal to itself' do
+    cur_digest = Digest::SHA512.new
+    cur_digest.should == cur_digest
+  end
+
+  it 'should be equal to string representing its hexdigest' do
+    cur_digest = Digest::SHA512.new
+    cur_digest.should == SHA512Constants::BlankHexdigest
+  end
+
+  it 'should be equal to appropriate object that responds to to_str' do
+    # blank digest
+    cur_digest = Digest::SHA512.new
+    (obj = mock(SHA512Constants::BlankHexdigest)).should_receive(:to_str).and_return(SHA512Constants::BlankHexdigest)
+    cur_digest.should == obj
+
+    # non-blank digest
+    cur_digest = Digest::SHA512.new
+    cur_digest << "test"
+    d_value = cur_digest.hexdigest
+    (obj = mock(d_value)).should_receive(:to_str).and_return(d_value)
+    cur_digest.should == obj
+  end
+
+  it 'should be equal for same digest different object' do
+    cur_digest = Digest::SHA512.new
+    cur_digest2 = Digest::SHA512.new
+    cur_digest.should == cur_digest2
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha512/hexdigest_bang_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha512/hexdigest_bang_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha512/hexdigest_bang_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA512#hexdigest!" do
+
+  it 'returns a hexdigest and resets the state' do
+    cur_digest = Digest::SHA512.new
+
+    cur_digest << SHA512Constants::Contents
+    cur_digest.hexdigest!.should == SHA512Constants::Hexdigest
+    cur_digest.hexdigest.should == SHA512Constants::BlankHexdigest
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha512/hexdigest_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha512/hexdigest_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha512/hexdigest_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA512#hexdigest" do
+
+  it 'returns a hexdigest' do
+    cur_digest = Digest::SHA512.new
+    cur_digest.hexdigest.should == SHA512Constants::BlankHexdigest
+
+    # add something to check that the state is reset later
+    cur_digest << "test"
+
+    cur_digest.hexdigest(SHA512Constants::Contents).should == SHA512Constants::Hexdigest
+    # second invocation is intentional, to make sure there are no side-effects
+    cur_digest.hexdigest(SHA512Constants::Contents).should == SHA512Constants::Hexdigest
+
+    # after all is done, verify that the digest is in the original, blank state
+    cur_digest.hexdigest.should == SHA512Constants::BlankHexdigest
+  end
+
+end
+
+describe "Digest::SHA512.hexdigest" do
+
+  it 'returns a hexdigest' do
+    Digest::SHA512.hexdigest(SHA512Constants::Contents).should == SHA512Constants::Hexdigest
+    # second invocation is intentional, to make sure there are no side-effects
+    Digest::SHA512.hexdigest(SHA512Constants::Contents).should == SHA512Constants::Hexdigest
+    Digest::SHA512.hexdigest("").should == SHA512Constants::BlankHexdigest
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha512/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha512/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha512/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA512#inspect" do
+
+  it 'returns a Ruby object representation' do
+    cur_digest = Digest::SHA512.new
+    cur_digest.inspect.should == "#<#{SHA512Constants::Klass}: #{cur_digest.hexdigest()}>"
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha512/length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha512/length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha512/length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+require File.dirname(__FILE__) + '/shared/length'
+
+describe "Digest::SHA512#length" do
+  it_behaves_like :sha512_length, :length
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha512/reset_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha512/reset_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha512/reset_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA512#reset" do
+
+  it 'can returns digest state to initial conditions' do
+    cur_digest = Digest::SHA512.new
+    cur_digest.update SHA512Constants::Contents
+    cur_digest.digest().should_not == SHA512Constants::BlankDigest
+    cur_digest.reset
+    cur_digest.digest().should == SHA512Constants::BlankDigest
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha512/shared/constants.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha512/shared/constants.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha512/shared/constants.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require 'digest/sha2'
+
+module SHA512Constants
+
+  Contents = "Ipsum is simply dummy text of the printing and typesetting industry. \nLorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. \nIt has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. \nIt was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
+  
+  Klass          = ::Digest::SHA512
+  BlockLength    = 128
+  DigestLength   = 64
+  BlankDigest    = "\317\203\3415~\357\270\275\361T(P\326m\200\a\326 \344\005\vW\025\334\203\364\251!\323l\351\316G\320\321<]\205\362\260\377\203\030\322\207~\354/c\2711\275GAz\201\24582z\371'\332>"
+  Digest         = "\241\231\232\365\002z\241\331\242\310=\367F\272\004\326\331g\315n\251Q\222\250\374E\257\254=\325\225\003SM\350\244\234\220\233=\031\230A;\000\203\233\340\323t\333\271\222w\266\307\2678\344\255j\003\216\300"
+  BlankHexdigest = "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e"
+  Hexdigest      = "a1999af5027aa1d9a2c83df746ba04d6d967cd6ea95192a8fc45afac3dd59503534de8a49c909b3d1998413b00839be0d374dbb99277b6c7b738e4ad6a038ec0"
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha512/shared/length.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha512/shared/length.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha512/shared/length.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+describe :sha512_length, :shared => true do
+  it 'returns the length of the digest' do
+    cur_digest = Digest::SHA512.new
+    cur_digest.send(@method).should == SHA512Constants::BlankDigest.size
+    cur_digest << SHA512Constants::Contents
+    cur_digest.send(@method).should == SHA512Constants::Digest.size
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha512/shared/update.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha512/shared/update.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha512/shared/update.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+describe :sha512_update, :shared => true do
+  it 'can update' do
+    cur_digest = Digest::SHA512.new
+    cur_digest.send @method, SHA512Constants::Contents
+    cur_digest.digest.should == SHA512Constants::Digest
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha512/size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha512/size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha512/size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+require File.dirname(__FILE__) + '/shared/length'
+
+describe "Digest::SHA512#size" do
+  it_behaves_like :sha512_length, :size
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha512/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha512/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha512/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+
+describe "Digest::SHA512#to_s" do
+
+  it 'returns a hexdigest' do
+    cur_digest = Digest::SHA512.new
+    cur_digest.to_s.should == SHA512Constants::BlankHexdigest
+  end
+
+  it 'does not change the internal state' do
+    cur_digest = Digest::SHA512.new
+    cur_digest.to_s.should == SHA512Constants::BlankHexdigest
+    cur_digest.to_s.should == SHA512Constants::BlankHexdigest
+
+    cur_digest << SHA512Constants::Contents
+    cur_digest.to_s.should == SHA512Constants::Hexdigest
+    cur_digest.to_s.should == SHA512Constants::Hexdigest
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/digest/sha512/update_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/digest/sha512/update_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/digest/sha512/update_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+require File.dirname(__FILE__) + '/shared/update'
+
+describe "Digest::SHA512#update" do
+  it_behaves_like :sha512_update, :update
+end

Added: MacRuby/branches/experimental/spec/frozen/library/drb/config_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/config_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/config_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/current_server_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/current_server_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/current_server_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/__drbref_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/__drbref_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/__drbref_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/__drburi_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/__drburi_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/__drburi_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/_dump_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/_dump_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/_dump_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/_load_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/_load_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/_load_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/eql_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/eql_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/eql_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/equal_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/equal_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/equal_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/hash_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/hash_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/hash_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/method_missing_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/method_missing_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/method_missing_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/new_with_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/new_with_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/new_with_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/new_with_uri_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/new_with_uri_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/new_with_uri_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/prepare_backtrace_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/prepare_backtrace_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/prepare_backtrace_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/pretty_print_cycle_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/pretty_print_cycle_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/pretty_print_cycle_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/pretty_print_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/pretty_print_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/pretty_print_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/respond_to_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/respond_to_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/respond_to_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/with_friend_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/with_friend_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/drbobject/with_friend_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/fetch_server_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/fetch_server_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/fetch_server_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/fixtures/test_server.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/fixtures/test_server.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/fixtures/test_server.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+class TestServer
+  def add(*args)
+    args.inject {|n,v| n+v}
+  end
+  def add_yield(x)        
+    return (yield x)+1
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/drb/front_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/front_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/front_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/here_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/here_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/here_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/install_acl_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/install_acl_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/install_acl_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/install_id_conv_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/install_id_conv_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/install_id_conv_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/primary_server_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/primary_server_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/primary_server_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/regist_server_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/regist_server_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/regist_server_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/remove_server_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/remove_server_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/remove_server_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/start_service_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/start_service_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/start_service_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,37 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/test_server'
+require 'drb'
+
+describe "DRb.start_service" do
+  before :all do
+    @port = 9001 + (Process.pid & 7 )
+  end
+
+  before :each do
+    @url = "druby://localhost:#{@port}"
+    @port += 1
+  end
+
+  it "should run a basic remote call" do    
+    lambda { DRb.current_server }.should raise_error(DRb::DRbServerNotFound)
+    server = DRb.start_service(@url, TestServer.new)
+    DRb.current_server.should == server
+    obj = DRbObject.new(nil, @url)
+    obj.add(1,2,3).should == 6
+    DRb.stop_service
+    lambda { DRb.current_server }.should raise_error(DRb::DRbServerNotFound)
+  end
+
+  it "should run a basic remote call passing a block" do
+    lambda { DRb.current_server }.should raise_error(DRb::DRbServerNotFound)
+    server = DRb.start_service(@url, TestServer.new)
+    DRb.current_server.should == server
+    obj = DRbObject.new(nil, @url)
+    obj.add_yield(2) do |i|
+      i.should == 2
+      i+1
+    end.should == 4
+    DRb.stop_service
+    lambda { DRb.current_server }.should raise_error(DRb::DRbServerNotFound)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/drb/stop_service_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/stop_service_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/stop_service_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "DRb.stop_service" do
+  before :all do
+    # for concurrent processes
+    @port = 9001 + (Process.pid & 7 )
+  end
+
+  before :each do
+    # because each spec needs it's own port since DRb is broken that way as exhibited below
+    @url = "druby://localhost:#{@port}"
+    @port += 1
+  end
+
+  it "should correctly clear the port so a new server can start" do
+    10.times do
+      server = nil
+      lambda { server = DRb.start_service(@url, TestServer.new) }.should_not raise_error
+      DRb.current_server.should == server
+      lambda { DRb.stop_service }.should_not raise_error
+    end
+  end  
+end

Added: MacRuby/branches/experimental/spec/frozen/library/drb/thread_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/thread_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/thread_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/to_id_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/to_id_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/to_id_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/to_obj_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/to_obj_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/to_obj_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/drb/uri_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/drb/uri_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/drb/uri_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/enumerator/each_cons_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/enumerator/each_cons_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/enumerator/each_cons_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require 'enumerator'
+
+describe "Enumerator#each_cons" do
+  it "iterates the block for each array of n consecutive elements" do
+    a = []
+    EnumSpecs::Numerous.new.each_cons(4) { |e| a << e }
+    a.should == [[2, 5, 3, 6], [5, 3, 6, 1], [3, 6, 1, 4]]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/enumerator/each_slice_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/enumerator/each_slice_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/enumerator/each_slice_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require 'enumerator'
+
+describe "Enumerator#each_slice" do
+  it "iterates the block for each slice of n elements" do
+    a = []
+    EnumSpecs::Numerous.new.each_slice(3) { |e| a << e }
+    a.should == [[2, 5, 3], [6, 1, 4]]
+  end  
+end

Added: MacRuby/branches/experimental/spec/frozen/library/enumerator/enum_cons_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/enumerator/enum_cons_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/enumerator/enum_cons_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require 'enumerator'
+
+describe "Enumerator#enum_cons" do  
+  it "returns an enumerator of the receiver with iteration of each_cons for each array of n concecutive elements" do
+    a = []
+    enum = EnumSpecs::Numerous.new.enum_cons(3)
+    enum.each {|x| a << x}
+    enum.kind_of?(Enumerable::Enumerator).should == true
+    a.should == [[2, 5, 3], [5, 3, 6], [3, 6, 1], [6, 1, 4]]
+  end  
+end

Added: MacRuby/branches/experimental/spec/frozen/library/enumerator/enum_slice_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/enumerator/enum_slice_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/enumerator/enum_slice_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require 'enumerator'
+
+describe "Enumerator#enum_slice" do
+  it "returns an enumerator of the receiver with iteration of each_slice for each slice of n elements" do
+    a = []
+    enum = EnumSpecs::Numerous.new.enum_slice(4)
+    enum.kind_of?(Enumerable::Enumerator).should == true
+    enum.each { |e| a << e }
+    a.should == [[2, 5, 3, 6], [1, 4]]
+  end  
+end

Added: MacRuby/branches/experimental/spec/frozen/library/enumerator/enum_with_index_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/enumerator/enum_with_index_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/enumerator/enum_with_index_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require 'enumerator'
+
+describe "Enumerator#enum_with_index" do
+  it "returns an enumerator of the receiver with an iteration of each_with_index" do
+    a = []
+    enum = EnumSpecs::Numerous.new.enum_with_index
+    enum.kind_of?(Enumerable::Enumerator).should == true
+    enum.each { |e| a << e }
+    a.should == [[2, 0], [5, 1], [3, 2], [6, 3], [1, 4], [4, 5]]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/enumerator/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/enumerator/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/enumerator/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+module EnumSpecs
+  class Numerous
+    include Enumerable
+    
+    def initialize(*list)
+      @list = list.empty? ? [2, 5, 3, 6, 1, 4] : list
+    end
+    
+    def each
+      @list.each { |i| yield i }
+    end 
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/enumerator/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/enumerator/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/enumerator/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'enumerator'
+
+describe "Enumerator.new" do
+  it "creates a new custom enumerator with the given object, iterator and arguments" do
+    enum = Enumerable::Enumerator.new(1, :upto, 3)
+    enum.kind_of?(Enumerable::Enumerator).should == true
+  end
+
+  it "creates a new custom enumerator that responds to #each" do
+    enum = Enumerable::Enumerator.new(1, :upto, 3)
+    enum.respond_to?(:each).should == true
+  end
+
+  it "creates a new custom enumerator that runs correctly" do
+    Enumerable::Enumerator.new(1, :upto, 3).map{|x|x}.should == [1,2,3]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/erb/def_class_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/erb/def_class_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/erb/def_class_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require 'erb'
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe 'ERB#def_class' do
+
+  it "return an unnamed class which has instance method to render eRuby script" do
+    input = <<'END'
+ at arg1=<%=@arg1.inspect%>
+ at arg2=<%=@arg2.inspect%>
+END
+    expected = <<'END'
+ at arg1="foo"
+ at arg2=123
+END
+    class MyClass1ForErb_
+      def initialize(arg1, arg2)
+        @arg1 = arg1;  @arg2 = arg2
+      end
+    end
+    filename = 'example.rhtml'
+    #erb = ERB.new(File.read(filename))
+    erb = ERB.new(input)
+    erb.filename = filename
+    MyClass1ForErb = erb.def_class(MyClass1ForErb_, 'render()')
+    MyClass1ForErb.method_defined?(:render).should == true
+    MyClass1ForErb.new('foo', 123).render().should == expected
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/erb/def_method_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/erb/def_method_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/erb/def_method_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require 'erb'
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe 'ERB#def_method' do
+
+  it "define module's instance method to render eRuby file" do
+    input = <<'END'
+arg1=<%= arg1.inspect %>
+arg2=<%= arg2.inspect %>
+END
+    expected = <<'END'
+arg1="foo"
+arg2=123
+END
+    #
+    filename = 'example.rhtml'   # 'arg1' and 'arg2' are used in example.rhtml
+    #erb = ERB.new(File.read(filename))
+    erb = ERB.new(input)
+    class MyClass0ForErb
+    end
+    erb.def_method(MyClass0ForErb, 'render(arg1, arg2)', filename)
+    MyClass0ForErb.method_defined?(:render)
+    MyClass0ForErb.new.render('foo', 123).should == expected
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/erb/def_module_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/erb/def_module_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/erb/def_module_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require 'erb'
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe 'ERB#def_module' do
+
+  it "return unnamed module which has instance method to render eRuby" do
+    input = <<'END'
+arg1=<%= arg1.inspect %>
+arg2=<%= arg2.inspect %>
+END
+    expected = <<'END'
+arg1="foo"
+arg2=123
+END
+    filename = 'example.rhtml'
+    #erb = ERB.new(File.read(filename))
+    erb = ERB.new(input)
+    erb.filename = filename
+    MyModule2ForErb = erb.def_module('render(arg1, arg2)')
+    MyModule2ForErb.method_defined?(':render')
+    class MyClass2ForErb
+      include MyModule2ForErb
+    end
+    MyClass2ForErb.new.render('foo', 123).should == expected
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/erb/defmethod/def_erb_method_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/erb/defmethod/def_erb_method_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/erb/defmethod/def_erb_method_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,62 @@
+require 'erb'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe 'ERB::DefMethod.def_erb_method' do
+
+
+  input = <<'END'
+<% for item in @items %>
+<b><%= item %></b>
+<% end %>
+END
+
+
+  it "define method to render eRuby file as an instance method of current module" do
+    expected = <<'END'
+
+<b>10</b>
+
+<b>20</b>
+
+<b>30</b>
+
+END
+    #
+    begin
+      File.open('_example.rhtml', 'w') {|f| f.write(input) }
+      class MyClass3ForEruby
+        extend ERB::DefMethod
+        def_erb_method('render()', '_example.rhtml')
+        def initialize(items)
+          @items = items
+        end
+      end
+      MyClass3ForEruby.new([10,20,30]).render().should == expected
+    ensure
+      File.unlink('_example.rhtml')
+    end
+
+  end
+
+
+  it "define method to render eRuby object as an instance method of current module" do
+    expected = <<'END'
+<b>10</b>
+<b>20</b>
+<b>30</b>
+END
+    #
+    MY_INPUT4_FOR_ERB = input
+    class MyClass4ForErb
+      extend ERB::DefMethod
+      erb = ERB.new(MY_INPUT4_FOR_ERB, nil, '<>')
+      def_erb_method('render()', erb)
+      def initialize(items)
+        @items = items
+      end
+    end
+    MyClass4ForErb.new([10,20,30]).render().should == expected
+  end
+
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/erb/filename_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/erb/filename_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/erb/filename_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,54 @@
+require 'erb'
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ERB#filename" do
+  # TODO: why does this fail on rubinius?
+  it "raises an exception if there are errors processing content" do
+    filename = 'foobar.rhtml'
+    erb = ERB.new('<% if true %>')   # will raise SyntaxError
+    erb.filename = filename
+    lambda {
+      begin
+        erb.result(binding)
+      rescue Exception => e
+        @ex = e
+        raise e
+      end
+    }.should raise_error(SyntaxError)
+    expected = filename
+
+    @ex.message =~ /^(.*?):(\d+): /
+    $1.should == expected
+    $2.to_i.should == 1
+
+    # TODO: why is this different on rubinius?
+    extended_on :rubinius do
+      @ex.file.should == expected
+      @ex.line.should == 1
+    end
+  end
+
+  # TODO: why does this fail on rubinius?
+  it "uses '(erb)' as filename when filename is not set" do
+    erb = ERB.new('<% if true %>')   # will raise SyntaxError
+    lambda {
+      begin
+        erb.result(binding)
+      rescue Exception => e
+        @ex = e
+        raise e
+      end
+    }.should raise_error(SyntaxError)
+    expected = '(erb)'
+
+    @ex.message =~ /^(.*?):(\d+): /
+    $1.should == expected
+    $2.to_i.should == 1
+
+    # TODO: why is this different on rubinius?
+    extended_on :rubinius do
+      @ex.file.should == expected
+      @ex.line.should == 1
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/erb/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/erb/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/erb/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,137 @@
+require 'erb'
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ERB.new" do
+  before :each do
+    @eruby_str = <<'END'
+<ul>
+<% list = [1,2,3] %>
+<% for item in list %>
+<% if item %>
+<li><%= item %></li>
+<% end %>
+<% end %>
+</ul>
+END
+
+    @eruby_str2 = <<'END'
+<ul>
+% list = [1,2,3]
+%for item in list
+%  if item
+  <li><%= item %>
+  <% end %>
+<% end %>
+</ul>
+%%%
+END
+
+  end
+
+  it "compiles eRuby script into ruby code when trim mode is 0 or not specified" do
+    expected = "<ul>\n\n\n\n<li>1</li>\n\n\n\n<li>2</li>\n\n\n\n<li>3</li>\n\n\n</ul>\n"
+    [0, '', nil].each do |trim_mode|
+      ERB.new(@eruby_str, nil, trim_mode).result.should == expected
+    end
+  end
+
+  it 'remove "\n" when trim_mode is 1 or \'>\'' do
+    expected = "<ul>\n<li>1</li>\n<li>2</li>\n<li>3</li>\n</ul>\n"
+    [1, '>'].each do |trim_mode|
+      ERB.new(@eruby_str, nil, trim_mode).result.should == expected
+    end
+  end
+
+  it 'remove spaces at beginning of line and "\n" when trim_mode is 2 or \'<>\'' do
+    expected = "<ul>\n<li>1</li>\n<li>2</li>\n<li>3</li>\n</ul>\n"
+    [2, '<>'].each do |trim_mode|
+      ERB.new(@eruby_str, nil, trim_mode).result.should == expected
+    end
+  end
+
+  it "removes spaces around '<%- -%>' when trim_mode is '-'" do
+    expected = "<ul>\n  <li>1  <li>2  <li>3</ul>\n"
+    input = <<'END'
+<ul>
+<%- for item in list -%>
+  <%- if item -%>
+  <li><%= item -%>
+  <%- end -%>
+<%- end -%>
+</ul>
+END
+
+    ERB.new(input, nil, '-').result.should == expected
+  end
+
+
+  it "not support '<%-= expr %> even when trim_mode is '-'" do
+
+    input = <<'END'
+<p>
+  <%= expr -%>
+  <%-= expr -%>
+</p>
+END
+
+    lambda { ERB.new(input, nil, '-').result }.should raise_error
+  end
+
+  ruby_bug "#213", "1.8.7" do 
+    it "regards lines starting with '%' as '<% ... %>' when trim_mode is '%'" do
+      expected = "<ul>\n  <li>1\n  \n  <li>2\n  \n  <li>3\n  \n\n</ul>\n%%\n"
+      ERB.new(@eruby_str2, nil, "%").result.should == expected
+    end
+  end
+  it "regards lines starting with '%' as '<% ... %>' and remove \"\\n\" when trim_mode is '%>'" do
+    expected = "<ul>\n  <li>1    <li>2    <li>3  </ul>\n%%\n"
+    ERB.new(@eruby_str2, nil, '%>').result.should == expected
+  end
+
+
+  it "regard lines starting with '%' as '<% ... %>' and remove \"\\n\" when trim_mode is '%<>'" do
+    expected = "<ul>\n  <li>1\n  \n  <li>2\n  \n  <li>3\n  \n</ul>\n%%\n"
+    ERB.new(@eruby_str2, nil, '%<>').result.should == expected
+  end
+
+
+  it "regard lines starting with '%' as '<% ... %>' and spaces around '<%- -%>' when trim_mode is '%-'" do
+
+    expected = "<ul>\n<li>1</li>\n<li>2</li>\n</ul>\n%%\n"
+    input = <<'END'
+<ul>
+%list = [1,2]
+%for item in list
+<li><%= item %></li>
+<% end %></ul>
+%%%
+END
+
+    trim_mode = '%-'
+    ERB.new(input, nil, '%-').result.should == expected
+  end
+
+  it "accepts a safe level as second argument" do
+    input = "<b><%=- 2+2 %>"
+    safe_level = 3
+    lambda { ERB.new(input, safe_level).result }.should_not raise_error
+  end
+
+  it "changes '_erbout' variable name in the produced source" do
+    input = @eruby_str
+    match_erbout = ERB.new(input, nil, nil).src
+    match_buf = ERB.new(input, nil, nil, 'buf').src
+    match_erbout.gsub("_erbout", "buf").should == match_buf
+  end
+
+
+  it "ignores '<%# ... %>'" do
+    input = <<'END'
+<%# for item in list %>
+<b><%#= item %></b>
+<%# end %>
+END
+    ERB.new(input).result.should == "\n<b></b>\n\n"
+    ERB.new(input, nil, '<>').result.should == "<b></b>\n"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/erb/result_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/erb/result_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/erb/result_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,102 @@
+require 'erb'
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ERB#result" do
+
+
+  it "return the result of compiled ruby code" do
+    input = <<'END'
+<ul>
+<% for item in list %>
+  <li><%= item %>
+<% end %>
+</ul>
+END
+    expected = <<'END'
+<ul>
+
+  <li>AAA
+
+  <li>BBB
+
+  <li>CCC
+
+</ul>
+END
+    erb = ERB.new(input)
+    list = %w[AAA BBB CCC]
+    actual = erb.result(binding)
+    actual.should == expected
+  end
+
+
+  it "share local variables" do
+    input = "<% var = 456 %>"
+    expected = 456
+    var = 123
+    ERB.new(input).result(binding)
+    var.should == expected
+  end
+
+
+  it "is not able to h() or u() unless including ERB::Util" do
+    input = "<%=h '<>' %>"
+    lambda { 
+      ERB.new(input).result()
+    }.should raise_error(NameError)
+  end
+
+
+  it "is able to h() or u() if ERB::Util is included" do
+    class MyERB1
+      include ERB::Util
+      def main
+        input = "<%=h '<>' %>"
+        return ERB.new(input).result(binding)
+      end
+    end
+    expected = '&lt;&gt;'
+    actual = MyERB1.new.main()
+    actual.should == expected
+  end
+
+
+  it "use TOPLEVEL_BINDING if binding is not passed" do
+    class MyERB2
+      include ERB::Util
+      def main1
+        #input = "<%= binding.to_s %>"
+        input = "<%= _xxx_var_ %>"
+        return ERB.new(input).result()
+      end
+      def main2
+        input = "<%=h '<>' %>"
+        return ERB.new(input).result()
+      end
+    end
+
+    eval '_xxx_var_ = 123', TOPLEVEL_BINDING
+    expected = '123'
+    MyERB2.new.main1().should == expected
+
+    lambda {
+      actual = MyERB2.new.main2()
+    }.should raise_error(NameError)
+  end
+
+
+  #--
+  #it "does not change current $SAFE even if safe_level is specifiled at ERB#initialize" do
+  #  input = "$SAFE=<%=$SAFE.inspect%>"
+  #  expected = "$SAFE=2"
+  #  safe_level = 2
+  #  erb = ERB.new(input, safe_level)
+  #  curr_safe_level = $SAFE
+  #  erb.result(binding()).should == expected
+  #  $SAFE.should == curr_safe_level    # BUG: $SAFE will be changed in current Rubinius
+  #end
+  #++
+
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/erb/run_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/erb/run_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/erb/run_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,97 @@
+require 'erb'
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ERB#run" do
+  # TODO: what is this? why does it not use
+  # lambda { ... }.should output
+  def _steal_stdout
+    orig = $stdout
+    s = ''
+    def s.write(arg); self << arg.to_s; end
+    $stdout = s
+    begin
+      yield
+    ensure
+      $stdout = orig
+    end
+    return s
+  end
+
+  it "print the result of compiled ruby code" do
+    input = <<END
+<ul>
+<% for item in list %>
+  <li><%= item %>
+<% end %>
+</ul>
+END
+    expected = <<END
+<ul>
+
+  <li>AAA
+
+  <li>BBB
+
+  <li>CCC
+
+</ul>
+END
+    erb = ERB.new(input)
+    list = %w[AAA BBB CCC]
+    actual = _steal_stdout { erb.run(binding) }
+    actual.should == expected
+  end
+
+  it "share local variables" do
+    input = "<% var = 456 %>"
+    expected = 456
+    var = 123
+    _steal_stdout { ERB.new(input).run(binding) }
+    var.should == expected
+  end
+
+  it "is not able to h() or u() unless including ERB::Util" do
+    input = "<%=h '<>' %>"
+    lambda {
+      _steal_stdout { ERB.new(input).run() }
+    }.should raise_error(NameError)
+  end
+
+  it "is able to h() or u() if ERB::Util is included" do
+    class MyERB1
+      include ERB::Util
+      def main
+        input = "<%=h '<>' %>"
+        ERB.new(input).run(binding)
+      end
+    end
+    expected = '&lt;&gt;'
+    actual = _steal_stdout { MyERB1.new.main() }
+    actual.should == expected
+  end
+
+  it "use TOPLEVEL_BINDING if binding is not passed" do
+    class MyERB2
+      include ERB::Util
+      def main1
+        #input = "<%= binding.to_s %>"
+        input = "<%= _xxx_var_ %>"
+        return ERB.new(input).run()
+      end
+      def main2
+        input = "<%=h '<>' %>"
+        return ERB.new(input).run()
+      end
+    end
+
+    eval '_xxx_var_ = 123', TOPLEVEL_BINDING
+    expected = '123'
+    actual = _steal_stdout { MyERB2.new.main1() }
+    actual.should == expected
+
+    lambda {
+      _steal_stdout { MyERB2.new.main2() }
+    }.should raise_error(NameError)
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/erb/src_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/erb/src_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/erb/src_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,53 @@
+require 'erb'
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "ERB#src" do
+
+  ruby_version_is "" ... "1.8.7" do
+    it "returns the compiled ruby code" do
+      input = <<'END'
+<ul>
+<% for item in list %>
+<li><%= item %></li>
+<% end %>
+</ul>
+END
+      expected = <<'END'
+_erbout = ''; _erbout.concat "<ul>\n"
+ for item in list ; _erbout.concat "\n"
+_erbout.concat "<li>"; _erbout.concat(( item ).to_s); _erbout.concat "</li>\n"
+ end ; _erbout.concat "\n"
+_erbout.concat "</ul>\n"
+_erbout
+END
+
+      expected.chomp!
+      ERB.new(input).src.should == expected
+    end
+  end
+
+  ruby_version_is "1.8.7" do
+    it "returns the compiled ruby code" do
+      input = <<'END'
+<ul>
+<% for item in list %>
+<li><%= item %></li>
+<% end %>
+</ul>
+END
+
+      expected = <<EOS
+_erbout = ''; _erbout.concat "<ul>\\n"
+;  for item in list ; _erbout.concat "\\n<li>"
+; _erbout.concat(( item ).to_s); _erbout.concat "</li>\\n"
+;  end ; _erbout.concat "\\n</ul>\\n"
+
+; _erbout
+EOS
+
+      expected.chomp!
+      ERB.new(input).src.should == expected
+    end
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/erb/util/h_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/erb/util/h_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/erb/util/h_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require 'erb'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/html_escape'
+
+describe "ERB::Util.h" do
+  it_behaves_like :erb_util_html_escape, :h
+end

Added: MacRuby/branches/experimental/spec/frozen/library/erb/util/html_escape_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/erb/util/html_escape_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/erb/util/html_escape_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require 'erb'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/html_escape'
+
+describe "ERB::Util.html_escape" do
+  it_behaves_like :erb_util_html_escape, :html_escape
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/erb/util/shared/html_escape.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/erb/util/shared/html_escape.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/erb/util/shared/html_escape.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,37 @@
+describe :erb_util_html_escape, :shared => true do
+  it "escape '& < > \"' to '&amp; &lt; &gt; &quot;" do
+    input = '& < > "'
+    expected = '&amp; &lt; &gt; &quot;'
+    ERB::Util.__send__(@method, input).should == expected
+  end
+
+  it "not escape characters except '& < > \"'" do
+    input = (0x20..0x7E).to_a.collect {|ch| ch.chr}.join('')
+    expected = input.gsub(/&/,'&amp;').gsub(/</,'&lt;').gsub(/>/,'&gt;').gsub(/"/,'&quot;')
+    ERB::Util.__send__(@method, input).should == expected
+  end
+
+  it "return empty string when argument is nil" do
+    input = nil
+    expected = ''
+    ERB::Util.__send__(@method, input).should == expected
+  end
+
+  it "returns string when argument is number" do
+    input = 123
+    expected = '123'
+    ERB::Util.__send__(@method, input).should == expected
+    input = 3.14159
+    expected = '3.14159'
+    ERB::Util.__send__(@method, input).should == expected
+  end
+
+  it "returns string when argument is boolean" do
+    input = true
+    expected = 'true'
+    ERB::Util.__send__(@method, input).should == expected
+    input = false
+    expected = 'false'
+    ERB::Util.__send__(@method, input).should == expected
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/erb/util/shared/url_encode.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/erb/util/shared/url_encode.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/erb/util/shared/url_encode.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,38 @@
+describe :erb_util_url_encode, :shared => true do
+  it "encode characters" do
+    #input  = (0x20..0x7E).to_a.collect{|ch| ch.chr}.join
+    input    = " !\"\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
+    expected = "%20%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D%7E"
+    ERB::Util.__send__(@method, input).should == expected
+  end
+
+  it "encode unicode string" do
+    input = "http://ja.wikipedia.org/wiki/\343\203\255\343\203\240\343\202\271\343\202\253\343\203\273\343\203\221\343\203\255\343\203\273\343\202\246\343\203\253\343\203\273\343\203\251\343\203\224\343\203\245\343\202\277"
+    expected = 'http%3A%2F%2Fja.wikipedia.org%2Fwiki%2F%E3%83%AD%E3%83%A0%E3%82%B9%E3%82%AB%E3%83%BB%E3%83%91%E3%83%AD%E3%83%BB%E3%82%A6%E3%83%AB%E3%83%BB%E3%83%A9%E3%83%94%E3%83%A5%E3%82%BF'
+    ERB::Util.__send__(@method, input).should == expected
+  end
+
+  it "returns empty string when argument is nil" do
+    input = nil
+    expected = ''
+    ERB::Util.__send__(@method, input).should == expected
+  end
+
+  it "returns string when argument is number" do
+    input = 123
+    expected = '123'
+    ERB::Util.__send__(@method, input).should == expected
+    input = 3.14159
+    expected = '3.14159'
+    ERB::Util.__send__(@method, input).should == expected
+  end
+
+  it "returns string when argument is boolean" do
+    input = true
+    expected = 'true'
+    ERB::Util.__send__(@method, input).should == expected
+    input = false
+    expected = 'false'
+    ERB::Util.__send__(@method, input).should == expected
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/erb/util/u_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/erb/util/u_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/erb/util/u_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require 'erb'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/url_encode'
+
+describe "ERB::Util.u" do
+  it_behaves_like :erb_util_url_encode, :u
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/erb/util/url_encode_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/erb/util/url_encode_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/erb/util/url_encode_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require 'erb'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/url_encode'
+
+describe "ERB::Util.url_encode" do
+  it_behaves_like :erb_util_url_encode, :url_encode
+end

Added: MacRuby/branches/experimental/spec/frozen/library/etc/endgrent_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/etc/endgrent_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/etc/endgrent_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/windows'
+require 'etc'
+
+describe "Etc.endgrent" do
+  it_behaves_like(:etc_on_windows, :endgrent)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/etc/endpwent_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/etc/endpwent_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/etc/endpwent_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/windows'
+require 'etc'
+
+describe "Etc.endpwent" do
+  it_behaves_like(:etc_on_windows, :endpwent)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/etc/getgrent_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/etc/getgrent_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/etc/getgrent_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/windows'
+require 'etc'
+
+describe "Etc.getgrent" do
+  it_behaves_like(:etc_on_windows, :getgrent)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/etc/getgrgid_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/etc/getgrgid_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/etc/getgrgid_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,79 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'etc'
+
+platform_is :windows do
+  describe "Etc.getgrgid" do
+    it "returns nil" do
+      Etc.getgrgid(1).should == nil
+      Etc.getgrgid(nil).should == nil
+      Etc.getgrgid('nil').should == nil
+    end
+  end
+end
+
+# TODO: verify these on non-windows, non-darwin OS
+platform_is_not :windows do
+  describe "Etc.getgrgid" do
+    before(:all) do
+      @gid = `id -g`.strip.to_i
+      @name = `id -gn`.strip
+    end
+
+    ruby_version_is "" ... "1.9" do
+      it "returns a Struct::Group struct instance for the given user" do
+        gr = Etc.getgrgid(@gid)
+
+        gr.is_a?(Struct::Group).should == true
+        gr.gid.should == @gid
+        gr.name.should == @name
+      end
+
+      it "returns the Struct::Group for a given gid if it exists" do
+        grp = Etc.getgrgid(@gid)
+        grp.should be_kind_of(Struct::Group)
+        grp.gid.should == @gid
+        grp.name.should == @name
+      end
+    end
+
+    ruby_version_is "1.9" do
+      it "returns a Etc::Group struct instance for the given user" do
+        gr = Etc.getgrgid(@gid)
+
+        gr.is_a?(Etc::Group).should == true
+        gr.gid.should == @gid
+        gr.name.should == @name
+      end
+
+      it "returns the Etc::Group for a given gid if it exists" do
+        grp = Etc.getgrgid(@gid)
+        grp.should be_kind_of(Etc::Group)
+        grp.gid.should == @gid
+        grp.name.should == @name
+      end
+
+      it "uses Process.gid as the default value for the argument" do
+        gr = Etc.getgrgid
+
+        gr.gid.should == @gid
+        gr.name.should == @name
+      end
+    end
+
+    it "returns the Group for a given gid if it exists" do
+      grp = Etc.getgrgid(@gid)
+      grp.should be_kind_of(Struct::Group)
+      grp.gid.should == @gid
+      grp.name.should == @name
+    end
+
+    it "raises if the group does not exist" do
+      lambda { Etc.getgrgid(9876)}.should raise_error(ArgumentError)
+    end
+
+    it "raises a TypeError if not passed an Integer" do
+      lambda { Etc.getgrgid("foo") }.should raise_error(TypeError)
+      lambda { Etc.getgrgid(nil)   }.should raise_error(TypeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/etc/getgrnam_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/etc/getgrnam_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/etc/getgrnam_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,37 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'etc'
+
+platform_is :windows do
+  describe "Etc.getgrnam" do
+    it "returns nil" do
+      Etc.getgrnam(1).should == nil
+      Etc.getgrnam(nil).should == nil
+      Etc.getgrnam('nil').should == nil
+    end
+  end
+end
+
+platform_is_not :windows do
+  describe "Etc.getgrnam" do
+    ruby_version_is "" ... "1.9" do
+      it "returns a Struct::Group struct instance for the given group" do
+        gr = Etc.getgrnam("daemon")
+        gr.is_a?(Struct::Group).should == true
+      end
+    end
+
+    ruby_version_is "1.9" do
+      it "returns a Etc::Group struct instance for the given group" do
+        gr = Etc.getgrnam("daemon")
+        gr.is_a?(Etc::Group).should == true
+      end
+    end
+
+    it "only accepts strings as argument" do
+      lambda {
+        Etc.getgrnam(123)
+        Etc.getgrnam(nil)
+      }.should raise_error(TypeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/etc/getlogin_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/etc/getlogin_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/etc/getlogin_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'etc'
+
+describe "Etc.getlogin" do
+  it "returns the name of the user who runs this process" do
+    Etc.getlogin.should == username
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/etc/getpwent_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/etc/getpwent_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/etc/getpwent_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/windows'
+require 'etc'
+
+describe "Etc.getpwent" do
+  it_behaves_like(:etc_on_windows, :getpwent)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/etc/getpwnam_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/etc/getpwnam_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/etc/getpwnam_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,37 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'etc'
+
+platform_is :windows do
+  describe "Etc.getpwnam" do
+    it "returns nil" do
+      Etc.getpwnam(1).should == nil
+      Etc.getpwnam(nil).should == nil
+      Etc.getpwnam('nil').should == nil
+    end
+  end
+end
+
+platform_is_not :windows do
+  describe "Etc.getpwnam" do
+    ruby_version_is "" ... "1.9" do
+      it "returns a Passwd struct instance for the given user" do
+        pw = Etc.getpwnam(`whoami`.strip)
+        pw.is_a?(Struct::Passwd).should == true
+      end
+    end
+
+    ruby_version_is "1.9" do
+      it "returns a Etc::Passwd struct instance for the given user" do
+        pw = Etc.getpwnam(`whoami`.strip)
+        pw.is_a?(Etc::Passwd).should == true
+      end
+    end
+
+    it "only accepts strings as argument" do
+      lambda {
+        Etc.getpwnam(123)
+        Etc.getpwnam(nil)
+      }.should raise_error(TypeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/etc/getpwuid_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/etc/getpwuid_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/etc/getpwuid_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,44 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'etc'
+
+platform_is :windows do
+  describe "Etc.getpwuid" do
+    it "returns nil" do
+      Etc.getpwuid(1).should == nil
+      Etc.getpwuid(nil).should == nil
+      Etc.getpwuid('nil').should == nil
+    end
+  end
+end
+
+platform_is_not :windows do
+  describe "Etc.getpwuid" do
+    before :all do
+      @pw = Etc.getpwuid(`id -u`.strip.to_i)
+    end
+
+    ruby_version_is "" ... "1.9" do
+      it "returns a Struct::Passwd struct instance for the given user" do
+        @pw.is_a?(Struct::Passwd).should == true
+      end
+    end
+
+    ruby_version_is "1.9" do
+      it "returns a Etc::Passwd struct instance for the given user" do
+        @pw.is_a?(Etc::Passwd).should == true
+      end
+
+      it "uses Process.uid as the default value for the argument" do
+        pw = Etc.getpwuid
+        pw.should == @pw
+      end
+    end
+
+    it "only accepts integers as argument" do
+      lambda {
+        Etc.getpwuid("foo")
+        Etc.getpwuid(nil)
+      }.should raise_error(TypeError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/etc/group_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/etc/group_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/etc/group_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/windows'
+require 'etc'
+
+describe "Etc.group" do
+  it_behaves_like(:etc_on_windows, :group)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/etc/passwd_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/etc/passwd_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/etc/passwd_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'etc'

Added: MacRuby/branches/experimental/spec/frozen/library/etc/setgrent_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/etc/setgrent_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/etc/setgrent_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'etc'

Added: MacRuby/branches/experimental/spec/frozen/library/etc/setpwent_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/etc/setpwent_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/etc/setpwent_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'etc'

Added: MacRuby/branches/experimental/spec/frozen/library/etc/shared/windows.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/etc/shared/windows.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/etc/shared/windows.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+describe :etc_on_windows, :shared => true do
+  platform_is :windows do
+    it "returns nil" do
+      Etc.send(@method).should == nil
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/ftools/catname_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/ftools/catname_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/ftools/catname_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'ftools'
+
+describe "File.catname" do
+  it "returns the 2nd arg if it's not a directory" do
+    File.catname("blah", "/etc/passwd").should == "/etc/passwd"
+  end
+  
+  it "uses File.join with the args" do
+    File.catname("passwd", ".").should == "./passwd"
+  end
+  
+  it "uses File.basename on the 1st arg before joining" do
+    File.catname("etc/passwd", ".").should == "./passwd"
+  end  
+end

Added: MacRuby/branches/experimental/spec/frozen/library/ftools/chmod_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/ftools/chmod_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/ftools/chmod_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'ftools'
+
+describe "File.chmod" do
+  before(:each) do
+    (1..2).each do |n|
+      system "echo 'hello rubinius' > chmod_test_#{n}"
+      system "chmod 0777 chmod_test_#{n}"
+    end
+  end
+  
+  after(:each) do
+    (1..2).each { |n| File.unlink "chmod_test_#{n}" rescue nil }
+  end
+  
+  it "changes the mode to 1st arg for files in 2nd arg" do
+    `ls -l chmod_test_1`.should =~ /^-rwxrwxrwx /
+    `ls -l chmod_test_2`.should =~ /^-rwxrwxrwx /
+    File.chmod 0644, "chmod_test_1", "chmod_test_2"
+    `ls -l chmod_test_1`.should =~ /^-rw-r--r-- /
+    `ls -l chmod_test_2`.should =~ /^-rw-r--r-- /
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/ftools/compare_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/ftools/compare_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/ftools/compare_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'ftools'
+
+describe "File.compare" do
+  before(:each) do
+    (1..3).to_a.each do |n|
+      if n == 3
+        system "echo 'hello mri' > compare_test_#{n}"
+      else
+        system "echo 'hello rubinius' > compare_test_#{n}"
+      end
+      system "chmod a+x compare_test_#{n}"
+    end
+  end
+  
+  after(:each) do
+    (1..3).to_a.each { |n| File.unlink "compare_test_#{n}" }
+  end
+  
+  it "compares the file at 1st arg to the file at 2nd arg" do
+    File.compare("compare_test_1", "compare_test_2").should == true
+    File.compare("compare_test_2", "compare_test_1").should == true
+    
+    File.compare("compare_test_1", "compare_test_3").should == false
+    File.compare("compare_test_2", "compare_test_3").should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/ftools/copy_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/ftools/copy_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/ftools/copy_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'ftools'
+
+describe "File.copy" do
+  before(:each) do
+    system "echo 'hello rubinius' > copy_test"
+    system "chmod a+x copy_test"
+  end
+  
+  after(:each) do
+    File.unlink "copy_test"
+    File.unlink "copy_test_dest" rescue nil
+  end
+  
+  it "copies the file at 1st arg to the file at 2nd arg" do
+    File.copy("copy_test", "copy_test_dest")
+    fd = File.open("copy_test_dest")
+    data = fd.read
+    data.should == "hello rubinius\n"
+    fd.close
+    
+    omode = File.stat("copy_test").mode
+    mode = File.stat("copy_test_dest").mode
+    
+    omode.should == mode
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/ftools/install_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/ftools/install_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/ftools/install_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'ftools'
+
+describe "File.install" do
+  before(:each) do
+    system "echo 'hello rubinius' > install_test_1"
+    system "chmod 0777 install_test_1"
+  end
+  
+  after(:each) do
+    (1..2).each { |n| File.unlink "install_test_#{n}" rescue nil }
+  end
+  
+  it "changes the mode to 1st arg for files in 2nd arg" do
+    `ls -l install_test_1`.should =~ /^-rwxrwxrwx /
+    File.install "install_test_1", "install_test_2", 0644
+    `ls -l install_test_2`.should =~ /^-rw-r--r-- /
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/ftools/makedirs_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/ftools/makedirs_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/ftools/makedirs_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'ftools'
+
+describe "File.makedirs" do
+  before(:each) do
+  end
+  
+  after(:each) do
+    FileUtils.rm_rf("makedirs_test")
+    flunk if File.exist?("makedirs_test")
+  end
+  
+  it "creates the dirs from arg" do
+    File.exist?("makedirs_test").should == false
+    File.makedirs("makedirs_test/second_dir")
+    File.exist?("makedirs_test").should == true
+    File.directory?("makedirs_test").should == true
+    File.exist?("makedirs_test/second_dir").should == true
+    File.directory?("makedirs_test/second_dir").should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/ftools/move_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/ftools/move_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/ftools/move_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'ftools'
+
+describe "File.move" do
+  before(:each) do
+    system "echo 'hello rubinius' > move_test"
+    system "chmod a+x move_test"
+  end
+  
+  after(:each) do
+    File.unlink "move_test_dest"
+    File.unlink "move_test" rescue nil
+  end
+  
+  it "moves the file at 1st arg to the file at 2nd arg" do
+    omode = File.stat("move_test").mode
+    File.move("move_test", "move_test_dest")
+    fd = File.open("move_test_dest")
+    data = fd.read
+    data.should == "hello rubinius\n"
+    fd.close
+    mode = File.stat("move_test_dest").mode
+    
+    omode.should == mode
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/ftools/safe_unlink_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/ftools/safe_unlink_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/ftools/safe_unlink_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'ftools'
+
+describe "File.safe_unlink" do
+  before(:each) do
+    (1..2).each do |n|
+      system "echo 'hello rubinius' > safe_unlink_test_#{n}"
+      system "chmod 0777 safe_unlink_test_#{n}"
+    end
+  end
+  
+  after(:each) do
+    (1..2).each { |n| File.unlink "safe_unlink_test_#{n}" rescue nil }
+  end
+  
+  it "deletes the files in arg and returns an array of files deleted" do
+    File.exist?("safe_unlink_test_1").should == true
+    File.exist?("safe_unlink_test_2").should == true
+    File.safe_unlink("safe_unlink_test_1", "safe_unlink_test_2").should == ["safe_unlink_test_1", "safe_unlink_test_2"]
+    File.exist?("safe_unlink_test_1").should == false
+    File.exist?("safe_unlink_test_2").should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/ftools/syscopy_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/ftools/syscopy_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/ftools/syscopy_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'ftools'
+
+describe "File.syscopy" do
+  before(:each) do
+    system "echo 'hello rubinius' > syscopy_test"
+    system "chmod a+x syscopy_test"
+  end
+  
+  after(:each) do
+    File.unlink "syscopy_test"
+    File.unlink "syscopy_test_dest" rescue nil
+  end
+  
+  it "copies the file at 1st arg to the file at 2nd arg" do
+    File.syscopy("syscopy_test", "syscopy_test_dest")
+    fd = File.open("syscopy_test_dest")
+    data = fd.read
+    data.should == "hello rubinius\n"
+    fd.close
+    
+    omode = File.stat("syscopy_test").mode
+    mode = File.stat("syscopy_test_dest").mode
+    
+    omode.should == mode
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/generator/each_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/generator/each_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/generator/each_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+
+describe "Generator#each" do
+  it "enumerates the elements" do
+    g = GeneratorSpecs.four_elems
+    result = []
+
+    g.each { |element|
+      result << element
+    }
+
+    result.should == ['A', 'B', 'C', 'Z']
+  end
+
+  it "rewinds the generator and only then enumerates the elements" do
+    g = GeneratorSpecs.four_elems
+    g.next; g.next
+    result = []
+
+    g.each { |element|
+      result << element
+    }
+
+    result.should == ['A', 'B', 'C', 'Z']
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/generator/fixtures/common.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/generator/fixtures/common.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/generator/fixtures/common.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+not_supported_on :ironruby do
+  require 'generator'
+end
+
+module GeneratorSpecs
+  def self.empty
+    Generator.new([])
+  end
+
+  def self.one_elem
+    Generator.new([1])
+  end
+
+  def self.two_elems
+    Generator.new([1, 2])
+  end
+
+  def self.four_elems
+    Generator.new(['A', 'B', 'C', 'Z'])
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/generator/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/generator/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/generator/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'generator'
+
+describe "Generator.new" do
+  it "creates a new generator from an Enumerable object" do
+    g = Generator.new(['A', 'B', 'C', 'Z'])
+    g.should_not == nil
+    g.kind_of?(Generator).should == true
+  end
+
+  it "creates a new generator from a block" do
+    g = Generator.new { |g|
+      for i in 'A'..'C'
+        g.yield i
+      end
+      g.yield 'Z'
+    }
+
+    g.should_not == nil
+    g.kind_of?(Generator).should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/generator/next_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/generator/next_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/generator/next_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,74 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+
+describe "Generator#next?" do
+  it "returns false for empty generator" do
+    GeneratorSpecs.empty.next?.should == false
+  end
+
+  it "returns true for non-empty generator" do
+    g = Generator.new([1])
+    g.next?.should == true
+
+    GeneratorSpecs.two_elems.next?.should == true
+
+    g = Generator.new(['A', 'B', 'C', 'D', 'E', 'F'])
+    g.next?.should == true
+  end
+
+  it "returns true if the generator has not reached the end yet" do
+    g = GeneratorSpecs.two_elems
+    g.next
+    g.next?.should == true
+  end
+
+  it "returns false if the generator has reached the end" do
+    g = GeneratorSpecs.two_elems
+    g.next
+    g.next
+    g.next?.should == false
+  end
+
+  it "returns false if end? returns true" do
+    g = GeneratorSpecs.two_elems
+    def g.end?; true end
+    g.next?.should == false
+  end
+end
+
+describe "Generator#next" do
+  it "raises an EOFError on empty generator" do
+    lambda { GeneratorSpecs.empty.next }.should raise_error(EOFError)
+  end
+
+  it "raises an EOFError if no elements available" do
+    g = GeneratorSpecs.two_elems
+    g.next;
+    g.next
+    lambda { g.next }.should raise_error(EOFError)
+  end
+
+  it "raises an EOFError if end? returns true" do
+    g = GeneratorSpecs.two_elems
+    def g.end?; true end
+    lambda { g.next }.should raise_error(EOFError)
+  end
+
+  it "returns the element at the current position and moves forward" do
+    g = GeneratorSpecs.two_elems
+    g.index.should == 0
+    g.next.should == 1
+    g.index.should == 1
+  end
+
+  it "subsequent calls should return all elements in proper order" do
+    g = GeneratorSpecs.four_elems
+
+    result = []
+    while g.next?
+      result << g.next
+    end
+
+    result.should == ['A', 'B', 'C', 'Z']
+  end 
+end

Added: MacRuby/branches/experimental/spec/frozen/library/generator/rewind_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/generator/rewind_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/generator/rewind_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+
+describe "Generator#rewind" do
+  it "does nothing for empty generator" do
+    g = GeneratorSpecs.empty
+    g.index.should == 0
+    g.rewind
+    g.index.should == 0
+  end
+
+  it "rewinds the generator" do
+    g = GeneratorSpecs.two_elems
+    orig = g.next
+    g.index.should == 1
+    g.rewind
+    g.index.should == 0
+    g.next.should == orig
+  end
+
+  it "rewinds the previously finished generator" do
+    g = GeneratorSpecs.two_elems
+    g.next; g.next
+    g.rewind
+    g.end?.should == false
+    g.next?.should == true
+    g.next.should == 1
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/getoptlong/each_option_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/getoptlong/each_option_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/getoptlong/each_option_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'getoptlong'
+require File.dirname(__FILE__) + '/shared/each'
+
+describe "GetoptLong#each_option" do
+  it_behaves_like(:getoptlong_each, :each_option)
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/getoptlong/each_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/getoptlong/each_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/getoptlong/each_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'getoptlong'
+require File.dirname(__FILE__) + '/shared/each'
+
+describe "GetoptLong#each" do
+  it_behaves_like(:getoptlong_each, :each)
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/getoptlong/error_message_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/getoptlong/error_message_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/getoptlong/error_message_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'getoptlong'
+
+describe "GetoptLong#error_message" do
+  before :each do
+    @stderr = $stderr
+    @argv = ARGV
+  end
+
+  after :each do
+    $stderr = @stderr
+    ARGV = @argv
+  end
+
+  it "returns nil if no error occurred" do
+    opts = GetoptLong.new
+    opts.error_message.should == nil
+  end
+
+  it "returns the error message of the last error that occurred" do
+    begin
+      $stderr = IOStub.new
+      ARGV = []
+
+      opts = GetoptLong.new
+      opts.get
+      opts.ordering = GetoptLong::PERMUTE
+    rescue ArgumentError
+      opts.error_message.should == "argument error"
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/getoptlong/get_option_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/getoptlong/get_option_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/getoptlong/get_option_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'getoptlong'
+require File.dirname(__FILE__) + '/shared/get'
+
+describe "GetoptLong#get_option" do
+  it_behaves_like(:getoptlong_get, :get_option)
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/getoptlong/get_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/getoptlong/get_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/getoptlong/get_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'getoptlong'
+require File.dirname(__FILE__) + '/shared/get'
+
+describe "GetoptLong#get" do
+  it_behaves_like(:getoptlong_get, :get)
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/getoptlong/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/getoptlong/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/getoptlong/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'getoptlong'
+
+describe "GetoptLong#initialize" do
+  it "sets ordering to REQUIRE_ORDER if ENV['POSIXLY_CORRECT'] is set" do
+    begin
+      old_env_value = ENV["POSIXLY_CORRECT"]
+      ENV["POSIXLY_CORRECT"] = ""
+      
+      opt = GetoptLong.new
+      opt.ordering.should == GetoptLong::REQUIRE_ORDER
+    ensure
+      ENV["POSIXLY_CORRECT"] = old_env_value
+    end
+  end
+  
+  it "sets ordering to PERMUTE if ENV['POSIXLY_CORRECT'] is not set" do
+    begin
+      old_env_value = ENV["POSIXLY_CORRECT"]
+      ENV["POSIXLY_CORRECT"] = nil
+      
+      opt = GetoptLong.new
+      opt.ordering.should == GetoptLong::PERMUTE
+    ensure
+      ENV["POSIXLY_CORRECT"] = old_env_value
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/getoptlong/ordering_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/getoptlong/ordering_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/getoptlong/ordering_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,45 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'getoptlong'
+
+describe "GetoptLong#ordering=" do
+  it "raises an ArgumentError if called after processing has started" do
+    begin
+      s = $stderr
+      $stderr = IOStub.new
+      old_argv = ARGV
+      ARGV = [ "--size", "10k", "--verbose" ]
+      
+      opts = GetoptLong.new([ '--size', GetoptLong::REQUIRED_ARGUMENT ],
+        [ '--verbose', GetoptLong::NO_ARGUMENT ])
+      opts.get
+      
+      lambda {
+        opts.ordering = GetoptLong::PERMUTE
+      }.should raise_error(ArgumentError)
+    ensure
+      ARGV = old_argv
+      $stderr = s
+    end
+  end
+
+  it "raises an ArgumentError if given an invalid value" do
+    opts = GetoptLong.new
+    
+    lambda {
+      opts.ordering = 12345
+    }.should raise_error(ArgumentError)
+  end
+  
+  it "does not allow changing ordering to PERMUTE if ENV['POSIXLY_CORRECT'] is set" do
+    begin
+      old_env_value = ENV['POSIXLY_CORRECT']
+      ENV['POSIXLY_CORRECT'] = ""
+      
+      opts = GetoptLong.new
+      opts.ordering = GetoptLong::PERMUTE
+      opts.ordering.should == GetoptLong::REQUIRE_ORDER
+    ensure
+      ENV['POSIXLY_CORRECT'] = old_env_value
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/getoptlong/set_options_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/getoptlong/set_options_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/getoptlong/set_options_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,92 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'getoptlong'
+
+describe "GetoptLong#set_options" do
+  before :each do
+    @argv = ARGV
+    ARGV = []
+    @opts = GetoptLong.new
+  end
+
+  after :each do
+    ARGV = @argv
+  end
+
+  it "allows setting command line options" do
+    ARGV = ["--size", "10k", "-v", "arg1", "arg2"]
+
+    @opts.set_options(
+      ["--size", GetoptLong::REQUIRED_ARGUMENT],
+      ["--verbose", "-v", GetoptLong::NO_ARGUMENT]
+    )
+
+    @opts.get.should == ["--size", "10k"]
+    @opts.get.should == ["--verbose", ""]
+    @opts.get.should == nil
+  end
+
+  it "discards previously defined command line options" do
+    ARGV = ["--size", "10k", "-v", "arg1", "arg2"]
+
+    @opts.set_options(
+      ["--size", GetoptLong::REQUIRED_ARGUMENT],
+      ["--verbose", "-v", GetoptLong::NO_ARGUMENT]
+    )
+
+    @opts.set_options(
+      ["-s", "--size", GetoptLong::REQUIRED_ARGUMENT],
+      ["-v", GetoptLong::NO_ARGUMENT]
+    )
+
+    @opts.get.should == ["-s", "10k"]
+    @opts.get.should == ["-v", ""]
+    @opts.get.should == nil
+  end
+
+  it "raises an ArgumentError if too many argument flags where given" do
+    lambda {
+      @opts.set_options(["--size", GetoptLong::NO_ARGUMENT, GetoptLong::REQUIRED_ARGUMENT])
+    }.should raise_error(ArgumentError)
+  end
+
+  it "raises a RuntimeError if processing has already started" do
+    @opts.get
+    lambda {
+      @opts.set_options()
+    }.should raise_error(RuntimeError)
+  end
+
+  it "raises an ArgumentError if no argument flag was given" do
+    lambda {
+      @opts.set_options(["--size"])
+    }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError if one of the given arguments is not an Array" do
+    lambda {
+      @opts.set_options(
+        ["--size", GetoptLong::REQUIRED_ARGUMENT],
+        "test")
+    }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError if the same option is given twice" do
+    lambda {
+      @opts.set_options(
+        ["--size", GetoptLong::NO_ARGUMENT],
+        ["--size", GetoptLong::OPTIONAL_ARGUMENT])
+    }.should raise_error(ArgumentError)
+
+    lambda {
+      @opts.set_options(
+        ["--size", GetoptLong::NO_ARGUMENT],
+        ["-s", "--size", GetoptLong::OPTIONAL_ARGUMENT])
+    }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError if the given option is invalid" do
+    lambda {
+      @opts.set_options(["-size", GetoptLong::NO_ARGUMENT])
+    }.should raise_error(ArgumentError)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/getoptlong/shared/each.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/getoptlong/shared/each.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/getoptlong/shared/each.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+describe :getoptlong_each, :shared => true do
+  before(:each) do
+    @opts = GetoptLong.new(
+      [ '--size', '-s',             GetoptLong::REQUIRED_ARGUMENT ],
+      [ '--verbose', '-v',          GetoptLong::NO_ARGUMENT ],
+      [ '--query', '-q',            GetoptLong::NO_ARGUMENT ],
+      [ '--check', '--valid', '-c', GetoptLong::NO_ARGUMENT ]
+    )
+  end
+
+  it "passes each argument/value pair to the block" do
+    begin
+      old_argv = ARGV
+      ARGV = [ "--size", "10k", "-v", "-q", "a.txt", "b.txt" ]
+
+      pairs = []
+      @opts.send(@method) { |arg, val| pairs << [ arg, val ] }
+      pairs.should == [ [ "--size", "10k" ], [ "--verbose", "" ], [ "--query", ""] ]
+    ensure
+      ARGV = old_argv
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/getoptlong/shared/get.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/getoptlong/shared/get.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/getoptlong/shared/get.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,77 @@
+describe :getoptlong_get, :shared => true do
+  before(:each) do
+    @opts = GetoptLong.new(
+      [ '--size', '-s',             GetoptLong::REQUIRED_ARGUMENT ],
+      [ '--verbose', '-v',          GetoptLong::NO_ARGUMENT ],
+      [ '--query', '-q',            GetoptLong::NO_ARGUMENT ],
+      [ '--check', '--valid', '-c', GetoptLong::NO_ARGUMENT ]
+    )
+  end
+
+  it "returns the next option name and its argument as an Array" do
+    begin
+      old_argv = ARGV
+      ARGV = [ "--size", "10k", "-v", "-q", "a.txt", "b.txt" ]
+
+      @opts.send(@method).should == [ "--size", "10k" ]
+      @opts.send(@method).should == [ "--verbose", "" ]
+      @opts.send(@method).should == [ "--query", ""]
+      @opts.send(@method).should == nil
+    ensure
+      ARGV = old_argv
+    end
+  end
+
+  it "shifts ARGV on each call" do
+    begin
+      old_argv = ARGV
+      ARGV = [ "--size", "10k", "-v", "-q", "a.txt", "b.txt" ]
+
+      @opts.send(@method)
+      ARGV.should == [ "-v", "-q", "a.txt", "b.txt" ]
+
+      @opts.send(@method)
+      ARGV.should == [ "-q", "a.txt", "b.txt" ]
+
+      @opts.send(@method)
+      ARGV.should == [ "a.txt", "b.txt" ]
+
+      @opts.send(@method)
+      ARGV.should == [ "a.txt", "b.txt" ]
+    ensure
+      ARGV = old_argv
+    end
+  end
+
+  it "terminates processing when encountering '--'" do
+    begin
+      old_argv = ARGV
+      ARGV = [ "--size", "10k", "--", "-v", "-q", "a.txt", "b.txt" ]
+
+      @opts.send(@method)
+      ARGV.should == ["--", "-v", "-q", "a.txt", "b.txt"]
+
+      @opts.send(@method)
+      ARGV.should ==  ["-v", "-q", "a.txt", "b.txt"]
+
+      @opts.send(@method)
+      ARGV.should ==  ["-v", "-q", "a.txt", "b.txt"]
+    ensure
+      ARGV = old_argv
+    end
+  end
+
+  it "raises a if an argument was required, but none given" do
+    begin
+      s = $stderr
+      $stderr = IOStub.new
+      old_argv = ARGV
+      ARGV = [ "--size" ]
+
+      lambda { @opts.send(@method) }.should raise_error(GetoptLong::MissingArgument)
+    ensure
+      ARGV = old_argv
+      $stderr = s
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/getoptlong/terminate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/getoptlong/terminate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/getoptlong/terminate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'getoptlong'
+
+describe "GetoptLong#terminate" do
+  before(:each) do
+    @opts = GetoptLong.new(
+      [ '--size', '-s',             GetoptLong::REQUIRED_ARGUMENT ],
+      [ '--verbose', '-v',          GetoptLong::NO_ARGUMENT ],
+      [ '--query', '-q',            GetoptLong::NO_ARGUMENT ],
+      [ '--check', '--valid', '-c', GetoptLong::NO_ARGUMENT ]
+    )
+  end
+  
+  it "terminates option proccessing" do
+    begin
+      old_argv = ARGV
+      ARGV = [ "--size", "10k", "-v", "-q", "a.txt", "b.txt" ]
+    
+      @opts.get.should == [ "--size", "10k" ]
+      @opts.terminate
+      @opts.get.should == nil
+    ensure
+      ARGV = old_argv
+    end
+  end
+  
+  it "returns self when option processsing is terminated" do
+    @opts.terminate.should == @opts
+  end
+  
+  it "returns nil when option processing was already terminated" do
+    @opts.terminate
+    @opts.terminate.should == nil
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/getoptlong/terminated_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/getoptlong/terminated_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/getoptlong/terminated_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'getoptlong'
+
+describe "GetoptLong#terminated?" do
+  it "returns true if option processing has terminated" do
+    begin
+      old_argv_value = ARGV
+      ARGV = [ "--size", "10k" ]
+      opts = GetoptLong.new(["--size", GetoptLong::REQUIRED_ARGUMENT])
+      opts.terminated?.should == false
+      
+      opts.get.should == ["--size", "10k"]
+      opts.terminated?.should == false
+      
+      opts.get.should == nil
+      opts.terminated?.should == true
+    ensure
+      ARGV = old_argv_value
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/iconv/charset_map_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/iconv/charset_map_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/iconv/charset_map_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'iconv'
+
+describe "Iconv.charset_map" do
+  it "acts as a map" do
+    Iconv.charset_map.respond_to?(:[]).should be_true
+    Iconv.charset_map.respond_to?(:include?).should be_true
+    Iconv.charset_map.respond_to?(:to_hash).should be_true
+
+    Iconv.charset_map.include?("x-nonexistent-encoding").should be_false
+  end
+
+#  it "maps from canonical name to system dependent name" do
+#  end
+
+  it "returns nil when given an unknown encoding name" do
+    Iconv.charset_map["x-nonexistent-encoding"].should be_nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/iconv/close_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/iconv/close_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/iconv/close_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'iconv'
+
+describe "Iconv#close" do
+  it "ignores multiple calls" do
+    conv1 = Iconv.new("us-ascii", "us-ascii")
+    conv1.close.should == ""
+    conv1.close.should be_nil
+  end
+
+  it "does not raise an exception if called inside an .open block" do
+    Iconv.open "us-ascii", "us-ascii" do |conv2|
+      conv2.close.should == ""
+    end
+  end
+
+  it "returns a string containing the byte sequence to change the output buffer to its initial shift state" do
+    Iconv.open "ISO-2022-JP", "UTF-8" do |cd|
+      cd.iconv("\343\201\262")
+      cd.close.should == "\e(B"
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/iconv/conv_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/iconv/conv_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/iconv/conv_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/initialize_exceptions'
+require 'iconv'
+
+describe "Iconv.conv" do
+  it_behaves_like :iconv_initialize_exceptions, :conv, "test"
+
+  it "acts exactly as if opening a converter and invoking #iconv once" do
+    Iconv.conv("utf-8", "iso-8859-1", "expos\xe9").should == "expos\xc3\xa9"
+
+    stringlike = mock("string-like")
+    stringlike.should_receive(:to_str).and_return("cacha\xc3\xa7a")
+    Iconv.conv("iso-8859-1", "utf-8", stringlike).should == "cacha\xe7a"
+
+    Iconv.conv("utf-16", "us-ascii", "a").should equal_utf16("\xfe\xff\0a")
+    # each call is completely independent; never retain context!
+    Iconv.conv("utf-16", "us-ascii", "b").should equal_utf16("\xfe\xff\0b")
+
+    Iconv.conv("us-ascii", "iso-8859-1", nil).should == ""
+
+    Iconv.conv("utf-16", "utf-8", "").should == ""
+
+    lambda { Iconv.conv("us-ascii", "us-ascii", "test\xa9") }.should raise_error(Iconv::IllegalSequence)
+
+    lambda { Iconv.conv("utf-8", "utf-8", "euro \xe2") }.should raise_error(Iconv::InvalidCharacter)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/iconv/failure/failed_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/iconv/failure/failed_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/iconv/failure/failed_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,52 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'iconv'
+
+describe "Iconv::Failure#failed" do
+  it "returns a substring of the original string passed to Iconv that starts at the character which caused the exception" do
+    lambda {
+      begin
+        Iconv.open "us-ascii", "us-ascii" do |conv|
+          conv.iconv "test \xff test \xff"
+        end
+      rescue Iconv::Failure => e
+        @ex = e
+        raise e
+      end
+    }.should raise_error(Iconv::Failure)
+    @ex.failed.should == "\xff test \xff"
+
+    lambda {
+      begin
+        Iconv.open "utf-8", "utf-8" do |conv|
+          conv.iconv "test \xe2\x82"
+        end
+      rescue Iconv::Failure => e
+        @ex = e
+        raise e
+      end
+    }.should raise_error(Iconv::Failure)
+    @ex.failed.should == "\xe2\x82"
+  end
+
+  it "for Iconv.iconv and Iconv.conv returns an array containing a single element when instantiated" do
+    lambda {
+      begin
+        Iconv.iconv("us-ascii", "us-ascii", "test \xff test")
+      rescue Iconv::Failure => e
+        @ex = e
+        raise e
+      end
+    }.should raise_error(Iconv::Failure)
+    @ex.failed.should == ["\xff test"]
+
+    lambda {
+      begin
+        Iconv.conv("us-ascii", "us-ascii", "test \xff test")
+      rescue Iconv::Failure => e
+        @ex = e
+        raise e
+      end
+    }.should raise_error(Iconv::Failure)
+    @ex.failed.should == ["\xff test"]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/iconv/failure/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/iconv/failure/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/iconv/failure/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'iconv'
+
+describe "Iconv::Failure#inspect" do
+  it "includes information on the exception class name, #succes and #failed" do
+    lambda {
+      begin
+        Iconv.open "utf-8", "utf-8" do |conv|
+          conv.iconv "testing string \x80 until an error occurred"
+        end
+      rescue Iconv::Failure => e
+        @ex = e
+        raise e
+      end
+    }.should raise_error(Iconv::Failure)
+    inspection = @ex.inspect
+    inspection.should include(@ex.class.to_s)
+    inspection.should include(@ex.success.inspect)
+    inspection.should include(@ex.failed.inspect)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/iconv/failure/success_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/iconv/failure/success_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/iconv/failure/success_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,50 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'iconv'
+
+describe "Iconv::Failure#success" do
+  it "for Iconv#iconv and Iconv.conv returns the substring of the original string passed which was translated successfully until the exception ocurred" do
+    lambda {
+      begin
+        Iconv.open "us-ascii", "us-ascii" do |conv|
+          conv.iconv "test \xff test \xff"
+        end
+      rescue Iconv::Failure => e
+        @ex = e
+        raise e
+      end
+    }.should raise_error(Iconv::Failure)
+    @ex.success.should == "test "
+
+    lambda {
+      begin
+        Iconv.conv "utf-8", "utf-8", "\xe2\x82"
+      rescue Iconv::Failure => e
+        @ex = e
+        raise e
+      end
+    }.should raise_error(Iconv::Failure)
+    @ex.success.should == ""
+  end
+
+  it "for Iconv.iconv returns an array containing all the strings that were translated successfully until the exception ocurred, in order" do
+    lambda {
+      begin
+        Iconv.iconv("us-ascii", "us-ascii", "\xfferror")
+      rescue Iconv::Failure => e
+        @ex = e
+        raise e
+      end
+    }.should raise_error(Iconv::Failure)
+    @ex.success.should == [""]
+
+    lambda {
+      begin
+        Iconv.iconv("us-ascii", "us-ascii", "test", "testing", "until\xfferror")
+      rescue Iconv::Failure => e
+        @ex = e
+        raise e
+      end
+    }.should raise_error(Iconv::Failure)
+    @ex.success.should == ["test", "testing", "until"]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/iconv/failure_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/iconv/failure_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/iconv/failure_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'iconv'
+
+describe "Iconv::Failure" do
+  it "is a module" do
+  	Iconv::Failure.should be_kind_of(Module)
+  	Iconv::Failure.should_not be_kind_of(Class)
+  end
+
+  it "is included by Iconv::InvalidEncoding" do
+    Iconv::Failure.should be_ancestor_of(Iconv::InvalidEncoding)
+  end
+
+  it "is included by Iconv::IllegalSequence" do
+    Iconv::Failure.should be_ancestor_of(Iconv::IllegalSequence)
+  end
+
+  it "is included by Iconv::InvalidCharacter" do
+    Iconv::Failure.should be_ancestor_of(Iconv::InvalidCharacter)
+  end
+
+  it "is included by Iconv::OutOfRange" do
+    Iconv::Failure.should be_ancestor_of(Iconv::OutOfRange)
+  end
+
+  it "is included by Iconv::BrokenLibrary" do
+    Iconv::Failure.should be_ancestor_of(Iconv::BrokenLibrary)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/iconv/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/iconv/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/iconv/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require 'iconv'
+
+module IconvSpecs
+  class IconvSubclass < Iconv
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/iconv/iconv_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/iconv/iconv_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/iconv/iconv_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,180 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/initialize_exceptions'
+require 'iconv'
+
+# These specs assume the Iconv implementation supports at least
+# the following encodings:
+#   us-ascii, utf-8, utf-16, utf-16be, utf-16le, iso-8859-1
+
+describe "Iconv#iconv" do
+  it "raises an ArgumentError when called on a closed converter" do
+    conv = Iconv.new("us-ascii", "us-ascii")
+    conv.close
+    lambda { conv.iconv("test") }.should raise_error(ArgumentError)
+  end
+
+  it "when given a string or string-like parameter returns a converted version of it" do
+    Iconv.open "utf-8", "iso-8859-1" do |conv|
+      conv.iconv("expos\xe9").should == "expos\xc3\xa9"
+
+      stringlike = mock("string-like")
+      stringlike.should_receive(:to_str).and_return("r\xe9sum\xe9")
+      conv.iconv(stringlike).should == "r\xc3\xa9sum\xc3\xa9"
+    end
+  end
+
+  it "keeps context between calls" do
+    Iconv.open "utf-16", "us-ascii" do |conv|
+      # BOM for first call of utf-16
+      conv.iconv("a").should equal_utf16("\xfe\xff\0a")
+      # no BOM for consecutive calls
+      conv.iconv("a").should equal_utf16("\0a")
+    end
+  end
+
+  it "when given a negative start position counts from the end of string" do
+    Iconv.open "us-ascii", "us-ascii" do |conv|
+      conv.iconv("testing", -7, 4).should == "test"
+      conv.iconv("testing", -3, 7).should == "ing"
+    end
+  end
+
+  it "when the end parameter is omitted or nil goes until the end of the string" do
+    Iconv.open "us-ascii", "us-ascii" do |conv|
+      conv.iconv("testing", 0).should == "testing"
+      conv.iconv("testing", 4).should == "ing"
+      conv.iconv("testing", 4, nil).should == "ing"
+      conv.iconv("testing", -3).should == "ing"
+      conv.iconv("testing", -4, nil).should == "ting"
+    end
+  end
+
+  ruby_bug "[ruby-core:17092]", "1.8.6.258" do
+    it "when given a positive length" do
+      Iconv.open "us-ascii", "us-ascii" do |conv|
+        conv.iconv("testing", 0, 4).should == "test"
+        conv.iconv("testing", 4, 6).should == "ing"
+        conv.iconv("substring", -6, 6).should == "string"
+      end
+    end
+
+    it "when given a negative length" do
+      Iconv.open "us-ascii", "us-ascii" do |conv|
+        conv.iconv("testing", 0, -1).should == "testing"
+        conv.iconv("testing", 2, -4).should == "sting"
+        conv.iconv("substring", -6, -4).should == "string"
+      end
+    end
+  end
+
+  it "raises Iconv::IllegalSequence when faced with an invalid byte for the source encoding" do
+    Iconv.open "utf-8", "utf-8" do |conv|
+      lambda { conv.iconv("test\x80") }.should raise_error(Iconv::IllegalSequence)
+    end
+  end
+
+  it "raises Iconv::IllegalSequence when a character cannot be represented on the target encoding" do
+    Iconv.open "us-ascii", "utf-8" do |conv|
+      lambda { conv.iconv("euro \xe2\x82\xac") }.should raise_error(Iconv::IllegalSequence)
+    end
+  end
+
+  it "raises Iconv::InvalidCharacter when an incomplete character or shift sequence happens at the end of the input buffer" do
+    Iconv.open "utf-8", "utf-8" do |conv|
+      lambda { conv.iconv("euro \xe2") }.should raise_error(Iconv::InvalidCharacter)
+      lambda { conv.iconv("euro \xe2\x82") }.should raise_error(Iconv::InvalidCharacter)
+    end
+    Iconv.open "utf-16be", "utf-16be" do |conv|
+      lambda { conv.iconv("a") }.should raise_error(Iconv::InvalidCharacter)
+    end
+  end
+
+  ruby_bug "#17910", "1.8.6.114" do
+    it "sanitizes invalid upper bounds" do
+      Iconv.open "us-ascii", "us-ascii" do |conv|
+        conv.iconv("testing", 0, 99).should == "testing"
+        conv.iconv("testing", 10, 12).should == ""
+      end
+    end
+  end
+
+  it "returns a blank string on invalid lower bounds" do
+    Iconv.open "us-ascii", "us-ascii" do |conv|
+      conv.iconv("testing", -10, -8).should == ""
+      conv.iconv("testing", -8).should == ""
+      conv.iconv("testing", -9, 5).should == ""
+    end
+  end
+end
+
+describe "Iconv.iconv" do
+  it "converts a series of strings with a single converter" do
+    Iconv.iconv("utf-16be", "us-ascii", "abc", "de").should == ["\0a\0b\0c", "\0d\0e"]
+    # BOM only on first string
+    Iconv.iconv("utf-16", "utf-8", "abc", "de").should equal_utf16(["\xfe\xff\0a\0b\0c", "\0d\0e"])
+  end
+
+  it "returns an empty array when given no strings to convert" do
+    Iconv.iconv("us-ascii", "utf-8").should == []
+  end
+
+  it_behaves_like :iconv_initialize_exceptions, :iconv, "test"
+end
+
+describe "The 'utf-8' encoder" do
+  it "emits proper representations for characters outside the Basic Multilingual Plane" do
+    Iconv.iconv("utf-8", "utf-16be", "\xd8\x40\xdc\x00").should == ["\xf0\xa0\x80\x80"]
+  end
+end
+
+describe "The 'utf-16' encoder" do
+
+  ruby_version_is "".."1.8.6p230" do
+    it "emits an empty string when the source input is empty" do
+      Iconv.iconv("utf-16", "us-ascii", "", "").should == ["", ""]
+      Iconv.open "utf-16", "utf-8" do |conv|
+        conv.iconv("").should == ""
+        conv.iconv("test", 1, 1).should == ""
+        conv.iconv("test", 3, -3).should == ""
+        conv.iconv("test", 1, -4).should == ""
+      end
+    end
+  end
+
+  ruby_version_is "1.8.6p238".."1.9" do
+    it "emits an empty string when the source input is empty" do
+      Iconv.iconv("utf-16", "us-ascii", "", "").should == ["", ""]
+      Iconv.open "utf-16", "utf-8" do |conv|
+        conv.iconv("").should == ""
+        conv.iconv("test", 1, 0).should == ""
+      end
+    end
+  end
+
+  it "emits a byte-order mark on first non-empty output" do
+    Iconv.iconv("utf-16", "us-ascii", "a").should equal_utf16(["\xfe\xff\0a"])
+    Iconv.iconv("utf-16", "utf-16", "\x80\x80", "\x81\x81").should equal_utf16(["\xfe\xff\x80\x80", "\x81\x81"])
+  end
+end
+
+describe "The 'utf-16be' decoder" do
+  it "does not emit a byte-order mark" do
+    Iconv.iconv("utf-16be", "utf-8", "ab").should == ["\0a\0b"]
+  end
+
+  it "treats possible byte-order marks as regular characters" do
+    Iconv.iconv("utf-8", "utf-16be", "\xfe\xff\0a").should == ["\xef\xbb\xbfa"]
+    Iconv.iconv("utf-8", "utf-16be", "\xff\xfe\0a").should == ["\xef\xbf\xbea"]
+  end
+end
+
+describe "The 'utf-16le' decoder" do
+  it "does not emit a byte-order mark" do
+    Iconv.iconv("utf-16le", "utf-8", "ab").should == ["a\0b\0"]
+  end
+
+  it "treats possible byte-order marks as regular characters" do
+    Iconv.iconv("utf-8", "utf-16le", "\xfe\xff\0a").should == ["\xef\xbf\xbe\xe6\x84\x80"]
+    Iconv.iconv("utf-8", "utf-16le", "\xff\xfe\0a").should == ["\xef\xbb\xbf\xe6\x84\x80"]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/iconv/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/iconv/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/iconv/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/new'
+require 'iconv'
+
+describe "Iconv.new" do
+  it_behaves_like :iconv_new, :new
+end

Added: MacRuby/branches/experimental/spec/frozen/library/iconv/open_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/iconv/open_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/iconv/open_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/new'
+require 'iconv'
+
+describe "Iconv.open" do
+  it_behaves_like :iconv_new, :open
+
+  it "with a block invokes the block exactly once" do
+    count = 0
+    Iconv.open "us-ascii", "us-ascii" do
+      count += 1
+    end
+    count.should == 1
+  end
+
+  it "with a block yields the converter" do
+    Iconv.open "us-ascii", "us-ascii" do |conv|
+      conv.should be_kind_of(Iconv)
+    end
+  end
+
+  it "with a block returns the result of the block" do
+    Iconv.open("us-ascii", "us-ascii") { "block return value" }.should == "block return value"
+  end
+
+  # not testable with the current API:
+  # it "with a block always closes the converter when exiting the block"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/iconv/shared/initialize_exceptions.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/iconv/shared/initialize_exceptions.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/iconv/shared/initialize_exceptions.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+describe :iconv_initialize_exceptions, :shared => true do
+  it "raises a TypeError when encoding names are not Strings or string-compatible" do
+    lambda { Iconv.send @method, Object.new, "us-ascii", @object }.should raise_error(TypeError)
+    lambda { Iconv.send @method, "us-ascii", Object.new, @object }.should raise_error(TypeError)
+  end
+
+  it "raises an Iconv::InvalidEncoding exception when an encoding cannot be found" do
+    lambda {
+      Iconv.send @method, "x-nonexistent-encoding", "us-ascii", @object
+    }.should raise_error(Iconv::InvalidEncoding)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/iconv/shared/new.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/iconv/shared/new.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/iconv/shared/new.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/initialize_exceptions.rb'
+require File.dirname(__FILE__) + '/../fixtures/classes.rb'
+
+describe :iconv_new, :shared => true do
+  it "creates a new encoding converter" do
+    obj = Iconv.send(@method, "us-ascii", "us-ascii")
+    begin
+      obj.should be_kind_of(Iconv)
+    ensure
+      obj.close
+    end
+  end
+
+  it "when called from a subclass of Iconv instantiates an object of that class" do
+    obj = IconvSpecs::IconvSubclass.send(@method, "us-ascii", "us-ascii")
+    begin
+      obj.class.should == IconvSpecs::IconvSubclass
+    ensure
+      obj.close
+    end
+  end
+
+  it "raises a TypeError when encoding names are not Strings or string-compatible" do
+    lambda { Iconv.send @method, Object.new, "us-ascii" }.should raise_error(TypeError)
+    lambda { Iconv.send @method, "us-ascii", Object.new }.should raise_error(TypeError)
+  end
+
+  it "raises an Iconv::InvalidEncoding exception when an encoding cannot be found" do
+    lambda {
+      Iconv.send @method, "x-nonexistent-encoding", "us-ascii"
+    }.should raise_error(Iconv::InvalidEncoding)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/ipaddr/hton_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/ipaddr/hton_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/ipaddr/hton_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,30 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'ipaddr'
+
+describe 'IPAddr#hton' do
+
+  it 'should be able to convert IPAddr to network byte order' do
+    addr = ''
+    IPAddr.new("1234:5678:9abc:def0:1234:5678:9abc:def0").hton.each_byte do |c|
+      addr += sprintf("%02x", c)
+    end
+    addr.should == "123456789abcdef0123456789abcdef0"
+    addr = ''
+    IPAddr.new("123.45.67.89").hton.each_byte do |c|
+      addr += sprintf("%02x", c)
+    end
+    addr.should == sprintf("%02x%02x%02x%02x", 123, 45, 67, 89)
+  end
+
+end
+
+describe 'IPAddr#new_ntoh' do
+  
+  it "should be able to create a new IPAddr using hton notation" do
+    a = IPAddr.new("3ffe:505:2::")
+    IPAddr.new_ntoh(a.hton).to_s.should == "3ffe:505:2::"
+    a = IPAddr.new("192.168.2.1")
+    IPAddr.new_ntoh(a.hton).to_s.should == "192.168.2.1"
+  end
+
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/ipaddr/ipv4_conversion_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/ipaddr/ipv4_conversion_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/ipaddr/ipv4_conversion_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,46 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'ipaddr'
+
+describe 'IPAddr#ipv4_compat' do
+
+  it 'should ipv4_compat?' do
+    a = IPAddr.new("::192.168.1.2")
+    a.to_s.should == "::192.168.1.2"
+    a.to_string.should == "0000:0000:0000:0000:0000:0000:c0a8:0102"
+    a.family.should == Socket::AF_INET6
+    a.ipv4_compat?.should == true
+    b = a.native
+    b.to_s.should == "192.168.1.2"
+    b.family.should == Socket::AF_INET
+    b.ipv4_compat?.should == false
+
+    a = IPAddr.new("192.168.1.2")
+    b = a.ipv4_compat
+    b.to_s.should == "::192.168.1.2"
+    b.family.should == Socket::AF_INET6
+  end
+
+end
+
+describe 'IPAddr#ipv4_mapped' do
+
+  it 'should ipv4_mapped' do
+    a = IPAddr.new("::ffff:192.168.1.2")
+    a.to_s.should == "::ffff:192.168.1.2"
+    a.to_string.should == "0000:0000:0000:0000:0000:ffff:c0a8:0102"
+    a.family.should == Socket::AF_INET6
+    a.ipv4_mapped?.should == true
+    b = a.native
+    b.to_s.should == "192.168.1.2"
+    b.family.should == Socket::AF_INET
+    b.ipv4_mapped?.should == false
+
+    a = IPAddr.new("192.168.1.2")
+    b = a.ipv4_mapped
+    b.to_s.should == "::ffff:192.168.1.2"
+    b.family.should == Socket::AF_INET6
+  end
+
+end
+
+

Added: MacRuby/branches/experimental/spec/frozen/library/ipaddr/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/ipaddr/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/ipaddr/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,87 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'ipaddr'
+
+describe "IPAddr#new" do
+  it 'it should initialize IPAddr' do
+    lambda{ IPAddr.new("3FFE:505:ffff::/48") }.should_not raise_error
+    lambda{ IPAddr.new("0:0:0:1::")          }.should_not raise_error
+    lambda{ IPAddr.new("2001:200:300::/48")  }.should_not raise_error
+  end
+
+  it 'it should initialize IPAddr ipv6 address with short notation' do
+    a = IPAddr.new
+    a.to_s.should == "::"
+    a.to_string.should == "0000:0000:0000:0000:0000:0000:0000:0000"
+    a.family.should == Socket::AF_INET6
+  end
+
+  it 'it should initialize IPAddr ipv6 address with long notation' do
+    a = IPAddr.new("0123:4567:89ab:cdef:0ABC:DEF0:1234:5678")
+    a.to_s.should == "123:4567:89ab:cdef:abc:def0:1234:5678"
+    a.to_string.should == "0123:4567:89ab:cdef:0abc:def0:1234:5678"
+    a.family.should == Socket::AF_INET6
+  end
+
+  it 'it should initialize IPAddr ipv6 address with / subnet notation' do
+    a = IPAddr.new("3ffe:505:2::/48")
+    a.to_s.should == "3ffe:505:2::"
+    a.to_string.should == "3ffe:0505:0002:0000:0000:0000:0000:0000"
+    a.family.should == Socket::AF_INET6
+    a.ipv4?.should == false
+    a.ipv6?.should == true
+    a.inspect.should == "#<IPAddr: IPv6:3ffe:0505:0002:0000:0000:0000:0000:0000/ffff:ffff:ffff:0000:0000:0000:0000:0000>"
+  end
+
+  it 'it should initialize IPAddr ipv6 address with mask subnet notation' do
+    a = IPAddr.new("3ffe:505:2::/ffff:ffff:ffff::")
+    a.to_s.should == "3ffe:505:2::"
+    a.to_string.should == "3ffe:0505:0002:0000:0000:0000:0000:0000"
+    a.family.should == Socket::AF_INET6
+  end
+
+  it 'it should initialize IPAddr ipv4 address with all zeroes' do
+    a = IPAddr.new("0.0.0.0")
+    a.to_s.should == "0.0.0.0"
+    a.to_string.should == "0.0.0.0"
+    a.family.should == Socket::AF_INET
+  end
+
+  it 'it should initialize IPAddr ipv4 address' do
+    a = IPAddr.new("192.168.1.2")
+    a.to_s.should == "192.168.1.2"
+    a.to_string.should == "192.168.1.2"
+    a.family.should == Socket::AF_INET
+    a.ipv4?.should == true
+    a.ipv6?.should == false
+  end
+
+  it 'it should initialize IPAddr ipv4 address with / subnet notation' do
+    a = IPAddr.new("192.168.1.2/24")
+    a.to_s.should == "192.168.1.0"
+    a.to_string.should == "192.168.1.0"
+    a.family.should == Socket::AF_INET
+    a.inspect.should == "#<IPAddr: IPv4:192.168.1.0/255.255.255.0>"
+  end
+
+  it 'it should initialize IPAddr ipv4 address wuth subnet mask' do
+    a = IPAddr.new("192.168.1.2/255.255.255.0")
+    a.to_s.should == "192.168.1.0"
+    a.to_string.should == "192.168.1.0"
+    a.family.should == Socket::AF_INET
+  end
+
+  it 'it should raise errors on incorrect IPAddr strings' do
+    [
+      ["fe80::1%fxp0"],
+      ["::1/255.255.255.0"],
+      ["::1:192.168.1.2/120"],
+      [IPAddr.new("::1").to_i],
+      ["::ffff:192.168.1.2/120", Socket::AF_INET],
+      ["[192.168.1.2]/120"],
+    ].each { |args|
+      lambda{
+        IPAddr.new(*args)
+      }.should raise_error(ArgumentError)
+    }
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/ipaddr/operator_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/ipaddr/operator_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/ipaddr/operator_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,80 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'ipaddr'
+
+describe 'IPAddr Operator' do
+  IN6MASK32  = "ffff:ffff::"
+  IN6MASK128 = "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"
+
+  before do
+    @in6_addr_any = IPAddr.new()
+    @a = IPAddr.new("3ffe:505:2::/48")
+    @b = IPAddr.new("0:0:0:1::")
+    @c = IPAddr.new(IN6MASK32)
+  end
+
+  it 'should be able to bitwise or' do
+    (@a | @b).to_s.should == "3ffe:505:2:1::"
+    a = @a
+    a |= @b
+    a.to_s.should == "3ffe:505:2:1::"
+    @a.to_s.should == "3ffe:505:2::"
+    (@a | 0x00000000000000010000000000000000).to_s.should == "3ffe:505:2:1::"
+  end
+
+  it 'should be able to bitwise and' do
+    (@a & @c).to_s.should == "3ffe:505::"
+    a = @a
+    a &= @c
+    a.to_s.should == "3ffe:505::"
+    @a.to_s.should == "3ffe:505:2::"
+    (@a & 0xffffffff000000000000000000000000).to_s.should == "3ffe:505::"
+  end
+
+  it 'should be able to bitshift right' do
+    (@a >> 16).to_s.should == "0:3ffe:505:2::"
+    a = @a
+    a >>= 16
+    a.to_s.should == "0:3ffe:505:2::"
+    @a.to_s.should == "3ffe:505:2::"
+  end
+
+  it 'should be able to bitshift left' do
+    (@a << 16).to_s.should == "505:2::"
+    a = @a
+    a <<= 16
+    a.to_s.should == "505:2::"
+    @a.to_s.should == "3ffe:505:2::"
+  end
+
+  it 'should be able to invert' do
+    a = ~@in6_addr_any
+    a.to_s.should == IN6MASK128
+    @in6_addr_any.to_s.should == "::"
+  end
+
+  it 'should be able to test for equality' do
+    @a.should == IPAddr.new("3ffe:505:2::")
+    @a.should_not == IPAddr.new("3ffe:505:3::")
+  end
+
+  it 'should be able to set a mask' do
+    a = @a.mask(32)
+    a.to_s.should == "3ffe:505::"
+    @a.to_s.should == "3ffe:505:2::"
+  end
+
+  it 'should be able to check whether an addres is included in a range' do
+    @a.should include(IPAddr.new("3ffe:505:2::"))
+    @a.should include(IPAddr.new("3ffe:505:2::1"))
+    @a.should_not include(IPAddr.new("3ffe:505:3::"))
+    net1 = IPAddr.new("192.168.2.0/24")
+    net1.should include(IPAddr.new("192.168.2.0"))
+    net1.should include(IPAddr.new("192.168.2.255"))
+    net1.should_not include(IPAddr.new("192.168.3.0"))
+    # test with integer parameter
+    int = (192 << 24) + (168 << 16) + (2 << 8) + 13
+
+    net1.should include(int)
+    net1.should_not include(int+255)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/ipaddr/reverse_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/ipaddr/reverse_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/ipaddr/reverse_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'ipaddr'
+
+describe "IPAddr#reverse" do
+  it 'should be able to generate the reverse DNS lookup entry' do
+    IPAddr.new("3ffe:505:2::f").reverse.should == "f.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.0.5.0.5.0.e.f.f.3.ip6.arpa"
+    IPAddr.new("192.168.2.1").reverse.should == "1.2.168.192.in-addr.arpa"
+  end
+end
+
+describe "IPAddr#ip6_arpa" do
+  it 'should be able to convert an IPv6 address into the reverse DNS lookup representation according to RFC3172' do
+    IPAddr.new("3ffe:505:2::f").ip6_arpa.should == "f.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.0.5.0.5.0.e.f.f.3.ip6.arpa"
+    lambda{
+      IPAddr.new("192.168.2.1").ip6_arpa
+    }.should raise_error(ArgumentError)
+  end
+end
+
+describe "IPAddr#ip6_int" do
+  it 'should be able to convert an IPv6 address into the reverse DNS lookup representation according to RFC1886' do
+    IPAddr.new("3ffe:505:2::f").ip6_int.should == "f.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.0.5.0.5.0.e.f.f.3.ip6.int"
+    lambda{
+      IPAddr.new("192.168.2.1").ip6_int
+    }.should raise_error(ArgumentError)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/ipaddr/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/ipaddr/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/ipaddr/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'ipaddr'
+
+describe "IPAddr#to_s" do
+
+  it 'it should display IPAddr using short notation' do
+    IPAddr.new("0:0:0:1::").to_s.should == "0:0:0:1::"
+    IPAddr.new("2001:200:300::/48").to_s.should == "2001:200:300::"
+    IPAddr.new("[2001:200:300::]/48").to_s.should == "2001:200:300::"
+    IPAddr.new("3ffe:505:2::1").to_s.should == "3ffe:505:2::1"
+  end
+
+end
+
+describe "IPAddr#to_string" do
+
+  it "should be able to display an IPAddr using full notation" do
+    IPAddr.new("3ffe:505:2::1").to_string.should == "3ffe:0505:0002:0000:0000:0000:0000:0001"
+  end
+
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/logger/application/level_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/logger/application/level_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/logger/application/level_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,39 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/common'
+
+describe "Logger::Application#level=" do
+  before :each do
+    @file_path = tmp("test_log.log")
+    @log_file = File.open(@file_path, "w+")
+    @app = LoggerSpecs::TestApp.new("TestApp", @log_file)
+
+  end
+
+  after :each do
+    @log_file.close unless @log_file.closed?
+    File.unlink(@file_path) if File.exists?(@file_path)
+  end
+
+  it "sets the logging threshold" do
+    @app.level = Logger::ERROR
+    @app.start
+    @app.log(Logger::WARN, "Don't show me")
+    @app.log(Logger::ERROR, "Show me")
+    @log_file.rewind
+    messages = @log_file.readlines
+    messages.length.should == 1
+    LoggerSpecs::strip_date(messages.first).should == "ERROR -- TestApp: Show me\n"
+  end
+
+  it "can set the threshold to unknown values" do
+    @app.level = 10
+    @app.start
+    @app.log(Logger::INFO,  "Info message")
+    @app.log(Logger::DEBUG, "Debug message")
+    @app.log(Logger::WARN,  "Warn message")
+    @app.log(Logger::ERROR, "Error message")
+    @app.log(Logger::FATAL, "Fatal message")
+    @log_file.rewind
+    @log_file.readlines.should be_empty
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/logger/application/log_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/logger/application/log_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/logger/application/log_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,72 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/common'
+
+describe "Logger::Application#log" do
+  before :each do
+    @file_path = tmp("test_log.log")
+    @log_file = File.open(@file_path, "w+")
+    @app = LoggerSpecs::TestApp.new("TestApp", @log_file)
+    @app.start
+  end
+
+  after :each do
+    @log_file.close unless @log_file.closed?
+    File.unlink(@file_path) if File.exists?(@file_path)
+  end
+
+  it "logs a message" do
+    @app.log(Logger::WARN, "Test message")
+    @log_file.rewind
+    message = @log_file.readlines.last
+    LoggerSpecs::strip_date(message).should == "WARN -- TestApp: Test message\n"
+  end
+
+  it "receives a severity" do
+    @app.log(Logger::INFO,  "Info message")
+    @app.log(Logger::DEBUG, "Debug message")
+    @app.log(Logger::WARN,  "Warn message")
+    @app.log(Logger::ERROR, "Error message")
+    @app.log(Logger::FATAL, "Fatal message")
+    @log_file.rewind
+    messages = @log_file.readlines[3..-1] # remove default messages
+
+    LoggerSpecs::strip_date(messages[0]).should == "INFO -- TestApp: Info message\n"
+    LoggerSpecs::strip_date(messages[1]).should == "DEBUG -- TestApp: Debug message\n"
+    LoggerSpecs::strip_date(messages[2]).should == "WARN -- TestApp: Warn message\n"
+    LoggerSpecs::strip_date(messages[3]).should == "ERROR -- TestApp: Error message\n"
+    LoggerSpecs::strip_date(messages[4]).should == "FATAL -- TestApp: Fatal message\n"
+  end
+
+  it "uses app name for Application Name" do
+    @app.log(Logger::INFO,  "Info message")
+    @log_file.rewind
+    test_message = @log_file.readlines.last
+    Regexp.new(/TestApp/).should =~ LoggerSpecs::strip_date(test_message)
+  end
+
+  it "receives a block and calls it if message is nil" do
+    temp = 0
+    @app.log(Logger::INFO, nil) { temp = 1 }
+    temp.should == 1
+  end
+end
+
+describe "Logger::Application#log=" do
+  before :each do
+    @file_path = tmp("test_log.log")
+    @log_file = File.open(@file_path, "w+")
+    @app = LoggerSpecs::TestApp.new("TestApp", @log_file)
+    @app.start
+  end
+
+  after :all do
+    File.unlink(@file_path) if File.exists?(@file_path)
+  end
+
+  it "sets the log device" do
+    regex = /STDERR Message/
+    @app.log = STDERR
+    lambda { @app.log(Logger::WARN, "STDERR Message") }.should output_to_fd(regex, STDERR)
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/logger/application/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/logger/application/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/logger/application/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,40 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/common'
+
+describe "Logger::Application.new" do
+  before :each do
+    @file_path = tmp("test_log.log")
+    @log_file = File.open(@file_path, "w+")
+  end
+
+  after :each do
+    @log_file.close unless @log_file.closed?
+    File.unlink(@file_path) if File.exists?(@file_path)
+  end
+
+  it "starts the logger on a new application" do
+    LoggerSpecs::TestApp.new("TestApp", @log_file).start
+    @log_file.rewind            # go back to the beginning to read the contents
+
+    first, second, third = @log_file.readlines
+    LoggerSpecs::strip_date(first).should  == "INFO -- TestApp: Start of TestApp.\n"
+    LoggerSpecs::strip_date(second).should == "WARN -- TestApp: Test log message\n"
+    LoggerSpecs::strip_date(third).should  == "INFO -- TestApp: End of TestApp. (status: true)\n"
+  end
+
+  it "defaults application name to ''" do
+    LoggerSpecs::TestApp.new(nil, @log_file).start
+    @log_file.rewind
+
+    first, second, third =  @log_file.readlines
+    LoggerSpecs::strip_date(first).should  == "INFO -- : Start of .\n"
+    LoggerSpecs::strip_date(second).should == "WARN -- : Test log message\n"
+    LoggerSpecs::strip_date(third).should  == "INFO -- : End of . (status: true)\n"
+  end
+
+  it "defaults logs to STDERR" do
+    regex = /INFO.*WARN.*INFO.*/m
+    lambda { LoggerSpecs::TestApp.new(nil, nil).start }.should output_to_fd(regex, STDERR)
+    @log_file.rewind
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/logger/application/set_log_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/logger/application/set_log_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/logger/application/set_log_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/common'
+
+describe "Logger::Application#set_log"do
+  before :each do
+    @file_path = tmp("test_log.log")
+    @log_file = File.open(@file_path, "w+")
+    @app = LoggerSpecs::TestApp.new("TestApp", @log_file)
+  end
+
+  after :each do
+    @log_file.close unless @log_file.closed?
+    File.unlink(@file_path) if File.exists?(@file_path)
+  end
+
+  it "sets the log device for the logger" do
+    regex = /STDERR Message/
+    @app.set_log(STDERR)
+    lambda { @app.log(Logger::WARN, "STDERR Message") }.should output_to_fd(regex, STDERR)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/logger/application/start_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/logger/application/start_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/logger/application/start_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/common'
+
+describe "Logger::Application#start" do
+  before :each do
+    @file_path = tmp("test_log.log")
+    @log_file = File.open(@file_path, "w+")
+    @app = LoggerSpecs::TestApp.new("TestApp", @log_file)
+  end
+
+  after :each do
+    @log_file.close unless @log_file.closed?
+    File.unlink(@file_path) if File.exists?(@file_path)
+  end
+
+
+  it "starts the application logging start/end messages" do
+    @app.start
+    @log_file.rewind
+    app_start, discard, app_end  = @log_file.readlines
+    LoggerSpecs::strip_date(app_start).should == "INFO -- TestApp: Start of TestApp.\n"
+    LoggerSpecs::strip_date(app_end).should   == "INFO -- TestApp: End of TestApp. (status: true)\n"
+  end
+
+  it "returns the status code" do
+    code = @app.start
+    @log_file.rewind
+    app_end  = @log_file.readlines.last
+    /true/.should =~ LoggerSpecs::strip_date(app_end)
+    code.should == true
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/logger/device/close_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/logger/device/close_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/logger/device/close_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/common'
+
+describe "Logger::LogDevice#close" do
+  before :each do
+    @file_path = tmp("test_log.log")
+    @log_file = File.open(@file_path, "w+")
+
+    # Avoid testing this with STDERR, we don't want to be closing that.
+    @device = Logger::LogDevice.new(@log_file)
+  end
+
+  after :each do
+    @log_file.close unless @log_file.closed?
+    File.unlink(@file_path) if File.exists?(@file_path)
+  end
+
+  it "closes the LogDevice's stream" do
+    @device.close
+    lambda { @device.write("Test") }.should raise_error
+  end
+
+  it "raises an error if it's already closed" do
+    @device.close
+    lambda { @device.close}.should raise_error
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/logger/device/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/logger/device/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/logger/device/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,47 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/common'
+
+describe "Logger::LogDevice#new" do
+  before :each do
+    @file_path = tmp("test_log.log")
+    @log_file = File.open(@file_path, "w+")
+  end
+
+  after :each do
+    @log_file.close unless @log_file.closed?
+    File.unlink(@file_path) if File.exists?(@file_path)
+  end
+
+  it "creates a new log device" do
+    l = Logger::LogDevice.new(@log_file)
+    l.dev.should be_kind_of(File)
+  end
+
+  it "receives an IO object to log there as first argument" do
+    @log_file.should be_kind_of(IO)
+    l = Logger::LogDevice.new(@log_file)
+    l.write("foo")
+    @log_file.rewind
+    @log_file.readlines.first.should == "foo"
+  end
+
+  it "creates a File if the IO object does not exist" do
+    path = tmp("test_logger_file")
+    l = Logger::LogDevice.new(path)
+    l.write("Test message")
+    l.close
+
+    File.exist?(path).should be_true
+    File.open(path) do |f|
+      f.readlines.should_not be_empty
+    end
+
+    File.unlink(path)
+  end
+
+  it "receives options via a hash as second argument" do
+    lambda { Logger::LogDevice.new(STDERR,
+                                   { :shift_age => 8, :shift_size => 10
+                                   })}.should_not raise_error
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/logger/device/write_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/logger/device/write_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/logger/device/write_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,42 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/common'
+
+describe "Logger::LogDevice#write" do
+  before  :each do
+    @file_path = tmp("test_log.log")
+    @log_file = File.open(@file_path, "w+")
+    # Avoid testing this with STDERR, we don't want to be closing that.
+    @device = Logger::LogDevice.new(@log_file)
+  end
+
+  after :each do
+    @log_file.close unless @log_file.closed?
+    File.unlink(@file_path) if File.exists?(@file_path)
+  end
+
+  it "writes a message to the device" do
+    @device.write "This is a test message"
+    @log_file.rewind
+    @log_file.readlines.first.should == "This is a test message"
+  end
+
+  it "can create a file and writes empty message" do
+    path = tmp("you_should_not_see_me")
+    logdevice = Logger::LogDevice.new(path)
+    logdevice.write("")
+    logdevice.close
+
+    File.open(path) do |f|
+      messages = f.readlines
+      messages.size.should == 1
+      messages.first.should =~ /#.*/    # only a comment
+    end
+
+    File.unlink(path)
+  end
+
+  it "fails if the device is already closed" do
+    @device.close
+    lambda { @device.write "foo" }.should raise_error
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/logger/fixtures/common.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/logger/fixtures/common.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/logger/fixtures/common.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require 'logger'
+
+module LoggerSpecs
+
+  def self.strip_date(str)
+    str.gsub(/[A-Z].*\[.*\]/, "").lstrip
+  end
+  class TestApp < Logger::Application
+    def initialize(appname, log_file=nil)
+      super(appname)
+      self.set_log(log_file) if log_file
+    end
+
+    def run
+      log(WARN, "Test log message")
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/logger/logger/add_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/logger/logger/add_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/logger/logger/add_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,80 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/common'
+
+describe "Logger#add" do
+  before :each do
+    @path = tmp("test_log.log")
+    @log_file = File.open(@path, "w+")
+    @logger = Logger.new(@path)
+  end
+
+  after :each do
+    @log_file.close unless @log_file.closed?
+    File.unlink(@path) if File.exists?(@path)
+  end
+
+  it "writes a new message to the logger" do
+    @logger.add(Logger::WARN, "Test")
+    @log_file.rewind
+    message = @log_file.readlines.last
+    LoggerSpecs::strip_date(message).should == "WARN -- : Test\n"
+  end
+
+  it "receives a severity" do
+    @logger.log(Logger::INFO,  "Info message")
+    @logger.log(Logger::DEBUG, "Debug message")
+    @logger.log(Logger::WARN,  "Warn message")
+    @logger.log(Logger::ERROR, "Error message")
+    @logger.log(Logger::FATAL, "Fatal message")
+
+    @log_file.rewind
+
+    info, debug, warn, error, fatal = @log_file.readlines
+
+    LoggerSpecs::strip_date(info).should == "INFO -- : Info message\n"
+    LoggerSpecs::strip_date(debug).should == "DEBUG -- : Debug message\n"
+    LoggerSpecs::strip_date(warn).should == "WARN -- : Warn message\n"
+    LoggerSpecs::strip_date(error).should == "ERROR -- : Error message\n"
+    LoggerSpecs::strip_date(fatal).should == "FATAL -- : Fatal message\n"
+  end
+
+  it "receives a message" do
+    @logger.log(nil, "test")
+    @log_file.rewind
+    LoggerSpecs::strip_date(@log_file.readline).should == "ANY -- : test\n"
+  end
+
+  it "receives a program name" do
+    @logger.log(nil, "test", "TestApp")
+    @log_file.rewind
+    LoggerSpecs::strip_date(@log_file.readline).should == "ANY -- TestApp: test\n"
+  end
+
+  it "receives a block" do
+    lambda {
+      @logger.log(nil, "test", "TestApp") do
+        1+1
+      end
+    }.should_not raise_error
+  end
+
+  it "calls the block if message is nil" do
+    temp = 0
+    lambda {
+      @logger.log(nil, nil, "TestApp") do
+        temp = 1+1
+      end
+    }.should_not raise_error
+    temp.should == 2
+  end
+
+  it "ignores the block if the message is not nil" do
+    temp = 0
+    lambda {
+      @logger.log(nil, "not nil", "TestApp") do
+        temp = 1+1
+      end
+    }.should_not raise_error
+    temp.should == 0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/logger/logger/close_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/logger/logger/close_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/logger/logger/close_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/common'
+
+describe "Logger#close" do
+  before :each do
+    @path = tmp("test_log.log")
+    @log_file = File.open(@path, "w+")
+    @logger = Logger.new(@path)
+  end
+
+  after :each do
+    @log_file.close unless @log_file.closed?
+    File.unlink(@path) if File.exists?(@path)
+  end
+
+  it "closes the logging device" do
+    @logger.close
+    lambda { @logger.add(nil, "Foo") }.should raise_error(IOError)
+  end
+
+  it "fails when called on a closed device" do
+    @logger.close
+    lambda { @logger.close }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/logger/logger/datetime_format_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/logger/logger/datetime_format_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/logger/logger/datetime_format_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,59 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/common'
+
+describe "Logger#datetime_format" do
+  before :each do
+    @path = tmp("test_log.log")
+    @log_file = File.open(@path, "w+")
+    @logger = Logger.new(@path)
+  end
+
+  after :each do
+    @log_file.close unless @log_file.closed?
+    File.unlink(@path) if File.exists?(@path)
+  end
+
+  it "returns the date format used for the logs" do
+    format = "%Y-%d"
+    @logger.datetime_format = format
+    @logger.datetime_format.should == format
+  end
+
+  it "returns nil logger is using the default date format" do
+    @logger.datetime_format.should == nil
+  end
+end
+
+describe "Logger#datetime_format=" do
+  before :each do
+    @path = tmp("test_log.log")
+    @log_file = File.open(@path, "w+")
+    @logger = Logger.new(@path)
+  end
+
+  after :each do
+    @log_file.close unless @log_file.closed?
+    File.unlink(@path) if File.exists?(@path)
+  end
+
+  it "sets the date format for the logs" do
+    format = "%Y"
+    @logger.datetime_format = "%Y"
+    @logger.datetime_format.should == "%Y"
+    @logger.add(Logger::WARN, "Test message")
+    @log_file.rewind
+
+    regex = /2[0-9]{3}.*Test message/
+    @log_file.readlines.first.should =~ regex
+  end
+
+  it "follows the Time#strftime format" do
+    lambda { @logger.datetime_format = "%Y-%m" }.should_not raise_error
+
+    regex = /\d{4}-\d{2}-\d{2}oo-\w+ar/
+    @logger.datetime_format = "%Foo-%Bar"
+    @logger.add(nil, "Test message")
+    @log_file.rewind
+    @log_file.readlines.first.should =~ regex
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/logger/logger/debug_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/logger/logger/debug_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/logger/logger/debug_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,50 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/common'
+
+describe "Logger#debug?" do
+  before :each do
+    @path = tmp("test_log.log")
+    @log_file = File.open(@path, "w+")
+    @logger = Logger.new(@path)
+  end
+
+  after :each do
+    @log_file.close unless @log_file.closed?
+    File.unlink(@path) if File.exists?(@path)
+  end
+
+  it "returns true if severity level allows debug messages" do
+    @logger.level = Logger::DEBUG
+    @logger.debug?.should == true
+  end
+  
+  it "returns false if severity level does not allow debug messages" do
+    @logger.level = Logger::WARN
+    @logger.debug?.should == false
+  end
+end
+
+describe "Logger#debug" do
+  before :each do
+    @path = tmp("test_log.log")
+    @log_file = File.open(@path, "w+")
+    @logger = Logger.new(@path)
+  end
+
+  after :each do
+    @log_file.close unless @log_file.closed?
+    File.unlink(@path) if File.exists?(@path)
+  end
+
+  it "logs a DEBUG message" do
+    @logger.debug("test")
+    @log_file.rewind
+    LoggerSpecs::strip_date(@log_file.readlines.first).should == "DEBUG -- : test\n"
+  end
+
+  it "accepts an application name with a block" do
+    @logger.debug("MyApp") { "Test message" }
+    @log_file.rewind
+    LoggerSpecs::strip_date(@log_file.readlines.first).should == "DEBUG -- MyApp: Test message\n"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/logger/logger/error_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/logger/logger/error_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/logger/logger/error_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,51 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/common'
+
+describe "Logger#error?" do
+  before :each do
+    @path = tmp("test_log.log")
+    @log_file = File.open(@path, "w+")
+    @logger = Logger.new(@path)
+  end
+
+  after :each do
+    @log_file.close unless @log_file.closed?
+    File.unlink(@path) if File.exists?(@path)
+  end
+
+  it "returns true if severity level allows printing errors" do
+    @logger.level = Logger::INFO
+    @logger.error?.should == true
+  end
+  
+  it "returns false if severity level does not allow errors" do
+    @logger.level = Logger::FATAL
+    @logger.error?.should == false
+  end
+end
+
+describe "Logger#error" do
+  before :each do
+    @path = tmp("test_log.log")
+    @log_file = File.open(@path, "w+")
+    @logger = Logger.new(@path)
+  end
+
+  after :each do
+    @log_file.close unless @log_file.closed?
+    File.unlink(@path) if File.exists?(@path)
+  end
+
+  it "logs a ERROR message" do
+    @logger.error("test")
+    @log_file.rewind
+    LoggerSpecs::strip_date(@log_file.readlines.first).should == "ERROR -- : test\n"
+  end
+
+  it "accepts an application name with a block" do
+    @logger.error("MyApp") { "Test message" }
+    @log_file.rewind
+    LoggerSpecs::strip_date(@log_file.readlines.first).should == "ERROR -- MyApp: Test message\n"
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/logger/logger/fatal_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/logger/logger/fatal_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/logger/logger/fatal_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,51 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/common'
+
+describe "Logger#fatal?" do
+  before :each do
+    @path = tmp("test_log.log")
+    @log_file = File.open(@path, "w+")
+    @logger = Logger.new(@path)
+  end
+
+  after :each do
+    @log_file.close unless @log_file.closed?
+    File.unlink(@path) if File.exists?(@path)
+  end
+
+  it "returns true if severity level allows fatal messages" do
+    @logger.level = Logger::FATAL
+    @logger.fatal?.should == true
+  end
+  
+  it "returns false if severity level does not allow fatal messages" do
+    @logger.level = Logger::UNKNOWN
+    @logger.fatal?.should == false
+  end
+end
+
+describe "Logger#fatal" do
+  before :each do
+    @path = tmp("test_log.log")
+    @log_file = File.open(@path, "w+")
+    @logger = Logger.new(@path)
+  end
+
+  after :each do
+    @log_file.close unless @log_file.closed?
+    File.unlink(@path) if File.exists?(@path)
+  end
+
+  it "logs a FATAL message" do
+    @logger.fatal("test")
+    @log_file.rewind
+    LoggerSpecs::strip_date(@log_file.readlines.first).should == "FATAL -- : test\n"
+  end
+
+  it "accepts an application name with a block" do
+    @logger.fatal("MyApp") { "Test message" }
+    @log_file.rewind
+    LoggerSpecs::strip_date(@log_file.readlines.first).should == "FATAL -- MyApp: Test message\n"
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/logger/logger/info_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/logger/logger/info_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/logger/logger/info_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,51 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/common'
+
+describe "Logger#info?" do
+  before :each do
+    @path = tmp("test_log.log")
+    @log_file = File.open(@path, "w+")
+    @logger = Logger.new(@path)
+  end
+
+  after :each do
+    @log_file.close unless @log_file.closed?
+    File.unlink(@path) if File.exists?(@path)
+  end
+
+  it "returns true if severity level allows info messages" do
+    @logger.level = Logger::INFO
+    @logger.info?.should == true
+  end
+  
+  it "returns false if severity level does not allow info messages" do
+    @logger.level = Logger::FATAL
+    @logger.info?.should == false
+  end
+end
+
+describe "Logger#info" do
+  before :each do
+    @path = tmp("test_log.log")
+    @log_file = File.open(@path, "w+")
+    @logger = Logger.new(@path)
+  end
+
+  after :each do
+    @log_file.close unless @log_file.closed?
+    File.unlink(@path) if File.exists?(@path)
+  end
+
+  it "logs a INFO message" do
+    @logger.info("test")
+    @log_file.rewind
+    LoggerSpecs::strip_date(@log_file.readlines.first).should == "INFO -- : test\n"
+  end
+
+  it "accepts an application name with a block" do
+    @logger.info("MyApp") { "Test message" }
+    @log_file.rewind
+    LoggerSpecs::strip_date(@log_file.readlines.first).should == "INFO -- MyApp: Test message\n"
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/logger/logger/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/logger/logger/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/logger/logger/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,58 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/common'
+
+describe "Logger#new" do
+
+  before :each do
+    @file_path = tmp("test_log.log")
+    @log_file = File.open(@file_path, "w+")
+  end
+
+  after :each do
+    @log_file.close unless @log_file.closed?
+    File.unlink(@file_path) if File.exists?(@file_path)
+  end
+
+   it "creates a new logger object" do
+     l = Logger.new(STDERR)
+     lambda { l.add(Logger::WARN, "Foo") }.should output_to_fd(/Foo/, STDERR)
+   end
+
+   it "receives a logging device as first argument" do
+     l = Logger.new(@log_file)
+     l.add(Logger::WARN, "Test message")
+
+     @log_file.rewind
+     LoggerSpecs::strip_date(@log_file.readline).should == "WARN -- : Test message\n"
+   end
+
+  it "receives a frequency rotation as second argument" do
+     lambda { Logger.new(@log_file, "daily")}.should_not raise_error
+     lambda { Logger.new(@log_file, "weekly")}.should_not raise_error
+     lambda { Logger.new(@log_file, "monthly")}.should_not raise_error
+  end
+  
+  it "also receives a number of log files to keep as second argument" do
+    lambda { Logger.new(@log_file, 1)}.should_not raise_error
+  end
+
+  it "receivs a maximum logfile size as third argument" do
+    # This should create 2 small log files, logfile_test and logfile_test.0
+    # in /tmp, each one with a different message.
+    path = tmp("logfile_test.log")
+
+    l = Logger.new(path, 2, 5)
+    l.add Logger::WARN, "foo"
+    l.add Logger::WARN, "bar"
+
+    File.exists?(path).should be_true
+    File.exists?(path + ".0").should be_true 
+
+    # first line will be a comment so we'll have to skip it.
+    LoggerSpecs::strip_date(File.open(path + ".0").readlines.last).should == "WARN -- : foo\n"
+    LoggerSpecs::strip_date(File.open(path).readlines.last).should == "WARN -- : bar\n"
+
+    File.unlink(path)
+    File.unlink(path + ".0")
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/logger/logger/unknown_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/logger/logger/unknown_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/logger/logger/unknown_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/common'
+
+describe "Logger#unknown" do
+  before :each do
+    @path = tmp("test_log.log")
+    @log_file = File.open(@path, "w+")
+    @logger = Logger.new(@path)
+  end
+
+  after :each do
+    @log_file.close unless @log_file.closed?
+    File.unlink(@path) if File.exists?(@path)
+  end
+
+  it "logs a message with unknown severity" do
+    @logger.unknown "Test"
+    @log_file.rewind
+    LoggerSpecs::strip_date(@log_file.readlines.first).should == "ANY -- : Test\n"
+  end
+
+  it "defaults the priority value to 5 and text value to ANY" do
+    @logger.unknown "Test"
+    @log_file.rewind
+    message = LoggerSpecs::strip_date(@log_file.readlines.first)[0..2]
+    message.should == "ANY"
+    Logger::UNKNOWN.should == 5
+  end
+
+  it "receives empty messages" do
+    lambda { @logger.unknown("") }.should_not raise_error
+    @log_file.rewind
+    message = LoggerSpecs::strip_date(@log_file.readlines.first).should ==  "ANY -- : \n"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/logger/logger/warn_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/logger/logger/warn_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/logger/logger/warn_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,51 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/common'
+
+describe "Logger#warn?" do
+  before :each do
+    @path = tmp("test_log.log")
+    @log_file = File.open(@path, "w+")
+    @logger = Logger.new(@path)
+  end
+
+  after :each do
+    @log_file.close unless @log_file.closed?
+    File.unlink(@path) if File.exists?(@path)
+  end
+
+  it "returns true if severity level allows printing warn messages" do
+    @logger.level = Logger::WARN
+    @logger.warn?.should == true
+  end
+  
+  it "returns false if severity level does not allow printing warn messages" do
+    @logger.level = Logger::FATAL
+    @logger.warn?.should == false
+  end
+end
+
+describe "Logger#warn" do
+  before :each do
+    @path = tmp("test_log.log")
+    @log_file = File.open(@path, "w+")
+    @logger = Logger.new(@path)
+  end
+
+  after :each do
+    @log_file.close unless @log_file.closed?
+    File.unlink(@path) if File.exists?(@path)
+  end
+
+  it "logs a WARN message" do
+    @logger.warn("test")
+    @log_file.rewind
+    LoggerSpecs::strip_date(@log_file.readlines.first).should == "WARN -- : test\n"
+  end
+
+  it "accepts an application name with a block" do
+    @logger.warn("MyApp") { "Test message" }
+    @log_file.rewind
+    LoggerSpecs::strip_date(@log_file.readlines.first).should == "WARN -- MyApp: Test message\n"
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/logger/severity_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/logger/severity_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/logger/severity_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'logger'
+
+describe "Logger::Severity" do
+  it "defines Logger severity constants" do
+    Logger::DEBUG.should == 0
+    Logger::INFO.should == 1
+    Logger::WARN.should == 2
+    Logger::ERROR.should == 3
+    Logger::FATAL.should == 4
+    Logger::UNKNOWN.should == 5
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/mathn/integer/from_prime_division_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/mathn/integer/from_prime_division_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/mathn/integer/from_prime_division_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'mathn'
+
+describe "Integer::from_prime_division" do
+  it "Reverse a prime factorization of an integer" do
+    Integer.from_prime_division([[2, 1], [3, 2], [7, 1]]).should == 126
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/mathn/integer/gcd2_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/mathn/integer/gcd2_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/mathn/integer/gcd2_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'mathn'
+
+describe "Integer#gcd2" do
+  it "Returns the greatest common divisor of the two numbers" do
+    15.gcd2(5).should == 5
+    15.gcd2(-6).should == 3
+    -23.gcd2(19).should == 1
+    -10.gcd2(-2).should == 2
+  end
+
+  it "raises a ZeroDivisionError when is called on zero" do
+    lambda { 0.gcd2(2) }.should raise_error(ZeroDivisionError)
+    lambda { 2.gcd2(0) }.should raise_error(ZeroDivisionError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/mathn/integer/prime_division_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/mathn/integer/prime_division_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/mathn/integer/prime_division_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'mathn'
+
+describe "Integer#prime_division" do
+  it "Performs a prime factorization of an integer" do
+    100.prime_division.should == [[2, 2], [5, 2]]
+    -26.prime_division.should == [[2, 1]]
+  end
+
+  it "raises a ZeroDivisionError when is called on zero" do
+    lambda { 0.prime_division }.should raise_error(ZeroDivisionError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/mathn/math/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/mathn/math/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/mathn/math/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+class IncludesMath
+  include Math
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/mathn/math/rsqrt_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/mathn/math/rsqrt_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/mathn/math/rsqrt_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/rsqrt'
+
+describe "Math#rsqrt" do
+  it_behaves_like :mathn_math_rsqrt, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:rsqrt)
+  end
+end
+
+describe "Math.rsqrt" do
+  it_behaves_like :mathn_math_rsqrt, :_, Math
+end

Added: MacRuby/branches/experimental/spec/frozen/library/mathn/math/shared/rsqrt.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/mathn/math/shared/rsqrt.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/mathn/math/shared/rsqrt.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../fixtures/classes'
+require 'mathn'
+
+describe :mathn_math_rsqrt, :shared => true do
+  it "returns the square root for Rational numbers" do
+    @object.send(:rsqrt, Rational(9, 25)).should == Rational(3, 5)
+    @object.send(:rsqrt, 16/64).should == Rational(1, 2)
+  end
+
+  it "returns the square root for positive numbers" do
+    @object.send(:rsqrt, 1).should == 1
+    @object.send(:rsqrt, 4.0).should == 2.0
+    @object.send(:rsqrt, 12.34).should == Math.sqrt!(12.34)
+  end
+
+  it "raises an Errno::EDOM if the argument is a negative number" do
+    lambda { @object.send(:rsqrt, -1) }.should raise_error(Errno::EDOM)
+    lambda { @object.send(:rsqrt, -4.0) }.should raise_error(Errno::EDOM)
+    lambda { @object.send(:rsqrt, -16/64) }.should raise_error(Errno::EDOM)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/mathn/math/shared/sqrt.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/mathn/math/shared/sqrt.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/mathn/math/shared/sqrt.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../fixtures/classes'
+require 'mathn'
+
+describe :mathn_math_sqrt, :shared => true do
+  it "returns the square root for Rational numbers" do
+    @object.send(:sqrt, Rational(9, 25)).should == Rational(3, 5)
+    @object.send(:sqrt, 16/64).should == Rational(1, 2)
+  end
+
+  it "returns the square root for Complex numbers" do
+    @object.send(:sqrt, Complex(1, 0)).should == 1
+  end
+
+  it "returns the square root for positive numbers" do
+    @object.send(:sqrt, 1).should == 1
+    @object.send(:sqrt, 4.0).should == 2.0
+    @object.send(:sqrt, 12.34).should == Math.sqrt!(12.34)
+  end
+
+  it "returns the square root for negative numbers" do
+    @object.send(:sqrt, -9).should == Complex(0, 3)
+    @object.send(:sqrt, -5.29).should == Complex(0, 2.3)
+    @object.send(:sqrt, -16/64).should == Complex(0, 1/2)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/mathn/math/sqrt_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/mathn/math/sqrt_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/mathn/math/sqrt_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/sqrt'
+
+describe "Math#rsqrt" do
+  it_behaves_like :mathn_math_sqrt, :_, IncludesMath.new
+
+  it "should be private" do
+    IncludesMath.should have_private_instance_method(:sqrt)
+  end
+end
+
+describe "Math.rsqrt" do
+  it_behaves_like :mathn_math_sqrt, :_, Math
+end

Added: MacRuby/branches/experimental/spec/frozen/library/mathn/prime/each_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/mathn/prime/each_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/mathn/prime/each_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require'mathn'
+
+describe "Prime#each" do
+  it "enumerates the elements" do
+    primes = Prime.new
+    result = []
+
+    primes.each { |p|
+      result << p
+      break if p > 10
+    }
+
+    result.should == [2, 3, 5, 7, 11]
+  end
+
+  it "don't rewind the generator, each loop start at the current value" do
+    primes = Prime.new
+    primes.next
+    result = []
+
+    primes.each { |p|
+      result << p
+      break if p > 10
+    }
+
+    result.should == [3, 5, 7, 11]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/mathn/prime/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/mathn/prime/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/mathn/prime/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'mathn'
+
+describe "Prime.new" do
+  it "returns a new Prime number" do
+    Prime.new.class.should == Prime
+  end
+   
+  it "raises a TypeError when is called with some arguments" do
+    lambda { Prime.new(1) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/mathn/prime/next_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/mathn/prime/next_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/mathn/prime/next_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'mathn'
+
+describe "Prime#next" do
+  it "returns the element at the current position and moves forward" do
+    p = Prime.new
+    p.next.should == 2
+    p.next.should == 3
+    p.next.next.should == 6
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/mathn/rational/exponent_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/mathn/rational/exponent_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/mathn/rational/exponent_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,69 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'mathn'
+
+describe "Rational#** when passed [Rational]" do
+  it "returns Rational.new!(1, 1) when the passed argument is 0" do
+    (Rational.new!(3, 4) ** Rational.new!(0, 3)).should == Rational.new!(1,1)
+    (Rational.new!(-3, 4) ** Rational.new!(0, 3)).should == Rational.new!(1,1)
+    (Rational.new!(3, -4) ** Rational.new!(0, 3)).should == Rational.new!(1,1)
+    (Rational.new!(3, 4) ** Rational.new!(0, -3)).should == Rational.new!(1,1)
+  end
+
+  it "returns Rational.new!(1, 1) when self is 1" do
+    (Rational.new!(1,1) ** Rational.new!(2, 3)).should == Rational.new!(1,1)
+    (Rational.new!(1,1) ** Rational.new!(-2, 3)).should == Rational.new!(1,1)
+    (Rational.new!(1,1) ** Rational.new!(2, -3)).should == Rational.new!(1,1)
+    (Rational.new!(1,1) ** Rational.new!(-2, -3)).should == Rational.new!(1,1)
+  end
+
+  it "returns Rational.new!(0, 1) when self is 0" do
+    (Rational.new!(0,1) ** Rational.new!(2, 3)).should == Rational.new!(0,1)
+    (Rational.new!(0,1) ** Rational.new!(-2, 3)).should == Rational.new!(0,1)
+    (Rational.new!(0,1) ** Rational.new!(2, -3)).should == Rational.new!(0,1)
+    (Rational.new!(0,1) ** Rational.new!(-2, -3)).should == Rational.new!(0,1)
+  end
+
+  it "returns a Complex number when self is negative" do
+    (Rational.new!(-1,2) ** Rational.new!(2, 3)).should be_close(Complex(-0.314980262473718, 0.545561817985861), TOLERANCE)
+    (Rational.new!(-1,2) ** Rational.new!(-2, 3)).should be_close(Complex(-0.793700525984099, -1.3747296369986), TOLERANCE)
+    (Rational.new!(-1,2) ** Rational.new!(2, -3)).should be_close(Complex(-0.793700525984099, -1.3747296369986), TOLERANCE)
+  end
+end
+
+describe "Rational#** when passed [Integer]" do
+  it "returns the Rational value of self raised to the passed argument" do
+    (Rational.new!(3, 4) ** 4).should == Rational.new!(81, 256)
+    (Rational.new!(3, 4) ** -4).should == Rational.new!(256, 81)
+    (Rational.new!(-3, 4) ** -4).should == Rational.new!(256, 81)
+    (Rational.new!(3, -4) ** -4).should == Rational.new!(256, 81)
+  end
+  
+  it "returns Rational.new!(1, 1) when the passed argument is 0" do
+    (Rational.new!(3, 4) ** 0).should == Rational.new!(1, 1)
+    (Rational.new!(-3, 4) ** 0).should == Rational.new!(1, 1)
+    (Rational.new!(3, -4) ** 0).should == Rational.new!(1, 1)
+
+    (Rational.new!(bignum_value, 4) ** 0).should == Rational.new!(1, 1)
+    (Rational.new!(3, -bignum_value) ** 0).should == Rational.new!(1, 1)
+  end
+end
+
+describe "Rational#** when passed [Float]" do
+  it "returns self converted to Float and raised to the passed argument" do
+    (Rational.new!(3, 1) ** 3.0).should == 27.0
+    (Rational.new!(3, 1) ** 1.5).should be_close(5.19615242270663, TOLERANCE)
+    (Rational.new!(3, 1) ** -1.5).should be_close(0.192450089729875, TOLERANCE)
+  end
+  
+  it "returns 1.0 when the passed argument is 0" do
+    (Rational.new!(3, 4) ** 0.0).should == 1.0
+    (Rational.new!(-3, 4) ** 0.0).should == 1.0
+    (Rational.new!(-3, 4) ** 0.0).should == 1.0
+  end
+  
+  it "returns NaN if self is negative and the passed argument is not 0" do
+    (Rational.new!(-3, 2) ** 1.5).nan?.should be_true
+    (Rational.new!(3, -2) ** 1.5).nan?.should be_true
+    (Rational.new!(3, -2) ** -1.5).nan?.should be_true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/mathn/rational/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/mathn/rational/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/mathn/rational/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'mathn'
+
+describe "Rational#inspect" do
+  it "returns a string representation of self" do
+    Rational.new!(3, 4).inspect.should == "3/4"
+    Rational.new!(-5, 8).inspect.should == "-5/8"
+    Rational.new!(-1, -2).inspect.should == "1/2"
+    Rational.new!(0, 2).inspect.should == "0/2"
+    Rational.new!(bignum_value, 1).inspect.should == "#{bignum_value}/1"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/mathn/rational/power2_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/mathn/rational/power2_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/mathn/rational/power2_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,78 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'mathn'
+
+describe "Rational#power2 when passed [Rational]" do
+  ruby_bug "#175", "1.8.7" do
+    it "returns Rational.new!(1, 1) when the passed argument is 0" do
+      (Rational.new!(3, 4).power2(Rational.new!(0, 3))).should == Rational.new!(1, 1)
+      (Rational.new!(-3, 4).power2(Rational.new!(0, 3))).should == Rational.new!(1, 1)
+      (Rational.new!(3, -4).power2(Rational.new!(0, 3))).should == Rational.new!(1, 1)
+      (Rational.new!(3, 4).power2(Rational.new!(0, -3))).should == Rational.new!(1, 1)
+    end
+  end
+
+  it "returns Rational.new!(1, 1) when self is 1" do
+    (Rational.new!(1,1).power2(Rational.new!(2, 3))).should == Rational.new!(1, 1)
+    (Rational.new!(1,1).power2(Rational.new!(-2, 3))).should == Rational.new!(1, 1)
+    (Rational.new!(1,1).power2(Rational.new!(2, -3))).should == Rational.new!(1, 1)
+    (Rational.new!(1,1).power2(Rational.new!(-2, -3))).should == Rational.new!(1, 1)
+  end
+ 
+  it "returns Rational.new!(0, 1) when self is 0" do
+    (Rational.new!(0,1).power2(Rational.new!(2, 3))).should == Rational.new!(0, 1)
+    (Rational.new!(0,1).power2(Rational.new!(-2, 3))).should == Rational.new!(0, 1)
+    (Rational.new!(0,1).power2(Rational.new!(2, -3))).should == Rational.new!(0, 1)
+    (Rational.new!(0,1).power2(Rational.new!(-2, -3))).should == Rational.new!(0, 1)
+  end
+
+  ruby_bug "#175", "1.8.7" do
+    it "returns the Rational value of self raised to the passed argument" do
+      (Rational.new!(1, 4).power2(Rational.new!(1, 2))).should == Rational.new!(1, 2)
+      (Rational.new!(1, 4).power2(Rational.new!(1, -2))).should == Rational.new!(2, 1)
+    end
+  end
+
+  it "returns a Complex number when self is negative" do
+    (Rational.new!(-1,2).power2(Rational.new!(2, 3))).should be_close(Complex(-0.314980262473718, 0.545561817985861), TOLERANCE)
+    (Rational.new!(-1,2).power2(Rational.new!(-2, 3))).should be_close(Complex(-0.793700525984099, -1.3747296369986), TOLERANCE)
+    (Rational.new!(-1,2).power2(Rational.new!(2, -3))).should be_close(Complex(-0.793700525984099, -1.3747296369986), TOLERANCE)
+  end
+end
+
+describe "Rational#power2 when passed [Integer]" do
+  it "returns the Rational value of self raised to the passed argument" do
+    (Rational.new!(3, 4).power2(4)).should == Rational.new!(81, 256)
+    (Rational.new!(3, 4).power2(-4)).should == Rational.new!(256, 81)
+    (Rational.new!(-3, 4).power2(-4)).should == Rational.new!(256, 81)
+    (Rational.new!(3, -4).power2(-4)).should == Rational.new!(256, 81)
+  end
+  
+  it "returns Rational.new!(1, 1) when the passed argument is 0" do
+    (Rational.new!(3, 4).power2(0)).should == Rational.new!(1, 1)
+    (Rational.new!(-3, 4).power2(0)).should == Rational.new!(1, 1)
+    (Rational.new!(3, -4).power2(0)).should == Rational.new!(1, 1)
+
+    (Rational.new!(bignum_value, 100).power2(0)).should == Rational.new!(1, 1)
+    (Rational.new!(3, -bignum_value).power2(0)).should == Rational.new!(1, 1)
+  end
+end
+
+describe "Rational#power2 when passed [Float]" do
+  it "returns self converted to Float and raised to the passed argument" do
+    (Rational.new!(3, 2).power2(3.0)).should == 3.375
+    (Rational.new!(3, 2).power2(1.5)).should be_close(1.83711730708738, TOLERANCE)
+    (Rational.new!(3, 2).power2(-1.5)).should be_close(0.544331053951817, TOLERANCE)
+  end
+  
+  it "returns 1.0 when the passed argument is 0" do
+    (Rational.new!(3, 4).power2(0.0)).should == 1.0
+    (Rational.new!(-3, 4).power2(0.0)).should == 1.0
+    (Rational.new!(-3, 4).power2(0.0)).should == 1.0
+  end
+  
+  it "returns NaN if self is negative and the passed argument is not 0" do
+    (Rational.new!(-3, 2).power2(1.5)).nan?.should be_true
+    (Rational.new!(3, -2).power2(1.5)).nan?.should be_true
+    (Rational.new!(3, -2).power2(-1.5)).nan?.should be_true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/Fail_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/Fail_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/Fail_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#Fail" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/I_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/I_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/I_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/identity'
+
+describe "Matrix.I" do
+  it_behaves_like(:matrix_identity, :I)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/Raise_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/Raise_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/Raise_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#Raise" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/clone_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/clone_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/clone_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,38 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#clone" do
+  before(:each) do
+    @a = Matrix[[1, 2], [3, 4], [5, 6]]
+  end
+  
+  it "returns a shallow copy of the matrix" do
+    b = @a.clone
+    @a.should_not equal(b)
+    b.class.should == Matrix
+    b.should == @a
+    0.upto(@a.row_size - 1) do |i|
+      @a.row(i).should_not equal(b.row(i))
+    end
+  end
+  
+  before(:each) do
+    @a = Matrix[[1, 2], [3, 4], [5, 6]]
+  end
+  
+quarantine! do # The test fails on MRI 1.8.6 pl 111, pl 114, MRI 1.8.7, JRuby
+  it "returns a copy of the matrix, but with all the references different" do
+    b = @a.clone
+    b.class.should == Matrix
+    b.should == @a
+    b.should_not === @a
+    0.upto(@a.row_size - 1) do |i|
+      0.upto(@a.column_size - 1) do |j|
+        b[i, j].should == @a[i, j]
+        b[i, j].should_not === @a[i, j]
+      end
+    end
+  end
+end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/coerce_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/coerce_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/coerce_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#coerce" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/collect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/collect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/collect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/collect'
+require 'matrix'
+
+describe "Matrix#collect" do
+  it_behaves_like(:collect, :collect)
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/column_size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/column_size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/column_size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#column_size" do
+  it "returns the number of elements in a column" do
+    data =  [[1,2]]
+    Matrix[ *data ].column_size.should == 2
+  end
+
+  it "raises an exception on an empty Matrix" do
+    # Note that MRI raises NoMethodError because #size is called
+    # on nil. This appears to be more of an "oops" rather than
+    # an aspect of the interface. We don't spec the exception class.
+    lambda{ Matrix[].column_size }.should raise_error
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/column_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/column_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/column_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#column" do
+  before :all do
+    @data =  [[1,2],[1,2]]
+  end
+
+  it "returns a Vector when called without a block" do
+    Matrix[ *@data ].column(1).should == Vector[2,2]
+  end
+
+  it "yields each element in the column to the block" do
+    Matrix[ *@data ].column(1) do |n|
+      n.should == 2
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/column_vector_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/column_vector_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/column_vector_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix.column_vector" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/column_vectors_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/column_vectors_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/column_vectors_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#column_vectors" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/columns_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/columns_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/columns_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix.columns" do
+  before :each do
+    @a = [1, 2]
+    @b = [3, 4]
+    @m = Matrix.columns([@a, @b])
+  end
+  
+  it "creates a matrix from argument columns" do
+    @m.column(0).to_a.should == @a
+    @m.column(1).to_a.should == @b
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/compare_by_row_vectors_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/compare_by_row_vectors_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/compare_by_row_vectors_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#compare_by_row_vectors" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/det_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/det_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/det_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#det" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/determinant_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/determinant_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/determinant_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#determinant" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/diagonal_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/diagonal_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/diagonal_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix.diagonal" do
+  before(:each) do
+    @m = Matrix.diagonal(10, 11, 12, 13, 14)
+  end
+  
+  it "returns an object of type Matrix" do
+    @m.class.should == Matrix
+  end
+  
+  it "sets the diagonal to the arguments" do
+    (0..4).each do |i|
+      @m[i, i].should == i + 10
+    end
+  end
+  
+  it "fills all non-diagonal cells with 0" do
+    (0..4).each do |i|
+      (0..4).each do |j|
+        if i != j
+          @m[i, j].should == 0
+        end
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/divide_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/divide_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/divide_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,41 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#/" do
+  before :each do
+    @a = Matrix[ [1, 2], [3, 4] ]
+    @b = Matrix[ [4, 5], [6, 7] ]
+    @c = Matrix[ [1.2, 2.4], [3.6, 4.8] ]
+  end
+
+  conflicts_with :Prime do
+    it "returns the result of dividing self by another Matrix" do
+      (@a / @b).should == Matrix[ [-2, 0], [-4, 0] ]
+      ((@a / @b) / @b).should == Matrix[ [0,0], [0,0] ]
+    end
+  end
+
+  conflicts_with :Prime do
+    it "returns the result of dividing self by a Fixnum" do
+      (@a / 2).should == Matrix[ [0, 1], [1, 2] ]
+    end
+  end
+
+  conflicts_with :Prime do
+    it "returns the result of dividing self by a Bignum" do
+      (@a / bignum_value).should == Matrix[ [0, 0], [0, 0] ]
+    end
+  end
+
+  it "returns the result of dividing self by a Float" do
+    (@c / 1.2).should == Matrix[ [1, 2], [3, 4] ]
+  end
+
+  it "raises a Matrix::ErrDimensionMismatch if the matrices are different sizes" do
+    lambda { @a / Matrix[ 1 ] }.should raise_error(Matrix::ErrDimensionMismatch)
+  end
+
+  it "returns an instance of Matrix" do
+    (@a /@b).should be_kind_of(Matrix)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/element_reference_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/element_reference_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/element_reference_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix.[]" do
+  # Matrix.[] is really a constructor, not an element reference function...
+
+  before(:each) do
+    @a = [1, 2, 3]
+    @b = [4, 5, 6]
+    @c = [7, 8, 9]
+    @m = Matrix[@a, @b, @c]
+  end
+  
+  it "returns an object of type Matrix" do
+    @m.class.should == Matrix
+  end
+  
+  it "makes each argument into a row" do
+    @m.row(0).to_a.should == @a
+    @m.row(1).to_a.should == @b
+    @m.row(2).to_a.should == @c
+  end
+end
+
+describe "Matrix#[]" do
+  it "returns element at (i, j)" do
+    m = Matrix[[0, 1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11]]
+    (0..3).each do |i|
+      (0..2).each do |j|
+        m[i, j].should == (i * 3) + j
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/eql_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/eql_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/eql_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+require File.dirname(__FILE__) + '/../../fixtures/matrix'
+
+describe "Matrix#eql?" do
+  before do
+    @matrix = Matrix[ [1, 2, 3, 4, 5], [2, 3, 4, 5, 6] ]
+  end
+
+  it "returns true for self" do
+    @matrix.eql?(@matrix).should be_true
+  end
+
+  ruby_bug("[ruby-dev:36298]", "1.8.7") do
+    it "returns true when the each corresponding elements are equal in the sense of Object#eql?" do
+      @matrix.eql?(Matrix[ [1, 2, 3, 4, 5], [2, 3, 4, 5, 6] ]).should be_true
+
+      num1, num2 = TrivialField.new, TrivialField.new
+      Matrix[[num1]].eql?(Matrix[[num2]]).should be_true
+    end
+
+    it "returns false when there are a pair corresponding elements which are not equal in the sense of Object#eql?" do
+      @matrix.eql?(Matrix[ [1, 2, 3, 4, 5.0], [2, 3, 4, 5, 6] ]).should be_false
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/equal_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/equal_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/equal_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#==" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/exponent_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/exponent_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/exponent_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#**" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/hash_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/hash_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/hash_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#hash" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/identity_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/identity_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/identity_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/identity'
+
+describe "Matrix.identity" do
+  it_behaves_like(:matrix_identity, :identity)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/included_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/included_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/included_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix.included" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/init_rows_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/init_rows_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/init_rows_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#init_rows" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#initialize" do
+  it "is private" do
+    Matrix[].private_methods.should include("initialize")
+  end
+
+  it "returns an instance of Matrix" do
+    Matrix[].should be_kind_of(Matrix)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#inspect" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/inv_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/inv_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/inv_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#inv" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/inverse_from_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/inverse_from_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/inverse_from_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#inverse_from" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/inverse_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/inverse_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/inverse_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#inverse" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/map_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/map_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/map_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/collect'
+require 'matrix'
+
+describe "Matrix#map" do
+  it_behaves_like(:collect, :map)
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/minor_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/minor_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/minor_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#minor" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/minus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/minus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/minus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,39 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#-" do
+  before :each do
+    @a = Matrix[ [1, 2], [3, 4] ]
+    @b = Matrix[ [4, 5], [6, 7] ]
+  end
+
+  it "returns the result of subtracting the corresponding elements of other from self" do
+    (@a - @b).should == Matrix[ [-3,-3], [-3,-3] ]
+  end
+
+  it "returns an instance of Matrix" do
+    (@a - @b).should be_kind_of(Matrix)
+  end
+
+  it "raises a Matrix::ErrDimensionMismatch if the matrices are different sizes" do
+    lambda { @a - Matrix[ 1 ] }.should raise_error(Matrix::ErrDimensionMismatch)
+  end
+
+  it "raises a ExceptionForMatrix::ErrOperationNotDefined if other is a Numeric Type" do
+    lambda { @a - 2            }.should raise_error(ExceptionForMatrix::ErrOperationNotDefined)
+    lambda { @a - 1.2          }.should raise_error(ExceptionForMatrix::ErrOperationNotDefined)
+    lambda { @a - bignum_value }.should raise_error(ExceptionForMatrix::ErrOperationNotDefined)
+  end
+
+  it "raises an exception if other is not a Matrix" do
+    # Note that MRI raises NoMethodError because #coerce is called
+    # on objects that don't provide it. This appears to be more of
+    # an "oops" rather than an aspect of the interface. We don't
+    # spec the exception class.
+
+    lambda { @a - nil        }.should raise_error
+    lambda { @a - "a"        }.should raise_error
+    lambda { @a - [ [1, 2] ] }.should raise_error
+    lambda { @a - Object.new }.should raise_error
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/multiply_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/multiply_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/multiply_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,36 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#*" do
+  before :each do
+    @a = Matrix[ [1, 2], [3, 4] ]
+    @b = Matrix[ [4, 5], [6, 7] ]
+  end
+
+  it "returns the result of multiplying the corresponding elements of self and a Matrix" do
+    (@a * @b).should == Matrix[ [16,19], [36,43] ]
+  end
+
+  it "returns the result of multiplying the corresponding elements of self and a Vector" do
+    (@a * Vector[1,2]).should == Vector[5, 11]
+  end
+
+  it "returns the result of multiplying the elements of self and a Fixnum" do
+    (@a * 2).should == Matrix[ [2, 4], [6, 8] ]
+  end
+
+  it "returns the result of multiplying the elements of self and a Bignum" do
+    (@a * bignum_value).should == Matrix[
+      [9223372036854775808, 18446744073709551616],
+      [27670116110564327424, 36893488147419103232]
+    ]
+  end
+
+  it "returns the result of multiplying the elements of self and a Float" do
+    (@a * 2.0).should == Matrix[ [2.0, 4.0], [6.0, 8.0] ]
+  end
+
+  it "raises a Matrix::ErrDimensionMismatch if the matrices are different sizes" do
+    lambda { @a * Matrix[ 1 ] }.should raise_error(Matrix::ErrDimensionMismatch)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#new" do
+  
+  it "should a Matrix" do
+    lambda { Matrix.new }.should raise_error
+  end
+  
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/plus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/plus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/plus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,39 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#+" do
+  before :each do
+    @a = Matrix[ [1,2], [3,4] ]
+    @b = Matrix[ [4,5], [6,7] ]
+  end
+
+  it "returns the result of adding the corresponding elements of self and other" do
+    (@a + @b).should == Matrix[ [5,7], [9,11] ]
+  end
+
+  it "returns an instance of Matrix" do
+    (@a + @b).should be_kind_of(Matrix)
+  end
+
+  it "raises a Matrix::ErrDimensionMismatch if the matrices are different sizes" do
+    lambda { @a + Matrix[ 1 ] }.should raise_error(Matrix::ErrDimensionMismatch)
+  end
+
+  it "raises a ExceptionForMatrix::ErrOperationNotDefined if other is a Numeric Type" do
+    lambda { @a + 2            }.should raise_error(ExceptionForMatrix::ErrOperationNotDefined)
+    lambda { @a + 1.2          }.should raise_error(ExceptionForMatrix::ErrOperationNotDefined)
+    lambda { @a + bignum_value }.should raise_error(ExceptionForMatrix::ErrOperationNotDefined)
+  end
+
+  it "raises an exception if other is not a Matrix" do
+    # Note that MRI raises NoMethodError because #coerce is called
+    # on objects that don't provide it. This appears to be more of
+    # an "oops" rather than an aspect of the interface. We don't
+    # spec the exception class.
+
+    lambda { @a + nil        }.should raise_error
+    lambda { @a + "a"        }.should raise_error
+    lambda { @a + [ [1, 2] ] }.should raise_error
+    lambda { @a + Object.new }.should raise_error
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/rank_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/rank_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/rank_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#rank" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/regular_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/regular_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/regular_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#regular?" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/row_size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/row_size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/row_size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#row_size" do
+  it "returns the number of elements in a row" do
+    data =  [[1,2], [3, 4]]
+    Matrix[ *data ].row_size.should == 2
+  end
+
+  it "returns 0 for an empty Matrix" do
+    Matrix[].row_size.should == 0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/row_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/row_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/row_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#row" do
+  before :all do
+    @data = [ [1, 2], [1, 2] ]
+  end
+
+  it "returns a Vector when called without a block" do
+    Matrix[ *@data ].row(0).should == Vector[1,2]
+  end
+
+  it "returns an Array when called with a block" do
+    Matrix[ *@data ].row(0) { |x| x }.should == [1, 2]
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/row_vector_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/row_vector_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/row_vector_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix.row_vector" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/row_vectors_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/row_vectors_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/row_vectors_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#row_vectors" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/rows_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/rows_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/rows_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix.rows" do
+  before :each do
+    @a = [1, 2]
+    @b = [3, 4]
+    @m = Matrix.rows([@a, @b])
+  end
+
+  it "returns a Matrix" do
+    @m.class.should == Matrix
+  end
+
+  it "creates a matrix from argument rows" do
+    @m.row(0).to_a.should == @a
+    @m.row(1).to_a.should == @b
+  end
+
+  it "copies the original rows by default" do
+    @a << 3
+    @b << 6
+    @m.row(0).should_not equal(@a)
+    @m.row(1).should_not equal(@b)
+  end
+
+  it "references the original rows if copy is false" do
+    @m_ref = Matrix.rows([@a, @b], false)
+    @a << 3
+    @b << 6
+    @m_ref.row(0).to_a.should == @a
+    @m_ref.row(1).to_a.should == @b
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/Fail_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/Fail_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/Fail_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'matrix'
+
+describe "Matrix::Scalar#Fail" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/Raise_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/Raise_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/Raise_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'matrix'
+
+describe "Matrix::Scalar#Raise" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/divide_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/divide_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/divide_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'matrix'
+
+describe "Matrix::Scalar#/" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/exponent_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/exponent_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/exponent_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'matrix'
+
+describe "Matrix::Scalar#**" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/included_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/included_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/included_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'matrix'
+
+describe "Matrix::Scalar.included" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'matrix'
+
+describe "Matrix::Scalar#initialize" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/minus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/minus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/minus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'matrix'
+
+describe "Matrix::Scalar#-" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/multiply_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/multiply_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/multiply_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'matrix'
+
+describe "Matrix::Scalar#*" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/plus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/plus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/scalar/plus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'matrix'
+
+describe "Matrix::Scalar#+" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/scalar_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/scalar_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/scalar_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,67 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix.scalar" do
+  
+  before(:each) do
+    @side = 3
+    @value = 8
+    @a = Matrix.scalar(@side, @value)
+  end
+  
+  it "returns a Matrix" do
+    @a.class.should == Matrix
+  end
+  
+  it "returns a n x n matrix" do
+    @a.row_size.should == @side
+    @a.column_size.should == @side
+  end
+  
+  it "initializes diagonal to value" do
+    (0... at a.row_size).each do |i|
+      @a[i, i].should == @value
+    end
+  end
+  
+  it "initializes all non-diagonal values to 0" do
+    (0... at a.row_size).each do |i|
+      (0... at a.column_size).each do |j|
+        if i != j
+          @a[i, j].should == 0
+        end
+      end
+    end
+  end
+  
+  before(:each) do
+    @side = 3
+    @value = 8
+    @a = Matrix.scalar(@side, @value)
+  end
+  
+  it "returns a Matrix" do
+    @a.class.should == Matrix
+  end
+  
+  it "returns a square matrix, where the first argument specifies the side of the square" do
+    @a.row_size.should == @side
+    @a.column_size.should == @side
+  end
+  
+  it "puts the second argument in all diagonal values" do
+    (0... at a.row_size).each do |i|
+      @a[i, i].should == @value
+    end
+  end
+  
+  it "fills all values not on the main diagonal with 0" do
+    (0... at a.row_size).each do |i|
+      (0... at a.column_size).each do |j|
+        if i != j
+          @a[i, j].should == 0
+        end
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/shared/collect.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/shared/collect.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/shared/collect.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+describe :collect, :shared => true do
+  before :all do
+    @data = [ [1, 2], [1, 2] ]
+  end
+
+  it "returns an instance of Matrix" do
+    Matrix[ *@data ].send(@method){|n| n * 2 }.should be_kind_of(Matrix)
+  end
+
+  it "returns a Matrix where each element is the result of the block" do
+    Matrix[ *@data ].send(@method) { |n| n * 2 }.should == Matrix[ [2, 4], [2, 4] ]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/shared/identity.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/shared/identity.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/shared/identity.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require 'matrix'
+
+describe :matrix_identity, :shared => true do
+  it "returns a Matrix" do
+    Matrix.send(@method, 2).class.should == Matrix
+  end
+
+  it "returns a n x n identity matrix" do
+    Matrix.send(@method, 3).should == Matrix.scalar(3, 1)
+    Matrix.send(@method, 100).should == Matrix.scalar(100, 1)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/shared/transpose.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/shared/transpose.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/shared/transpose.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require 'matrix'
+
+describe :matrix_transpose, :shared => true do
+  it "returns a transposed matrix" do
+    Matrix[[1, 2], [3, 4], [5, 6]].transpose.should == Matrix[[1, 3, 5], [2, 4, 6]]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/singular_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/singular_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/singular_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#singular?" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/square_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/square_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/square_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#square?" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/t_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/t_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/t_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/transpose'
+
+describe "Matrix#transpose" do
+  it_behaves_like(:matrix_transpose, :t)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/to_a_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/to_a_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/to_a_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#to_a" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#to_s" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/tr_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/tr_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/tr_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#tr" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/trace_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/trace_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/trace_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix#trace" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/transpose_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/transpose_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/transpose_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/transpose'
+
+describe "Matrix#transpose" do
+  it_behaves_like(:matrix_transpose, :transpose)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/unit_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/unit_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/unit_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/identity'
+
+describe "Matrix.unit" do
+  it_behaves_like(:matrix_identity, :unit)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/vector/eql_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/vector/eql_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/vector/eql_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'matrix'
+require File.dirname(__FILE__) + '/../../../fixtures/matrix'
+
+describe "Vector#eql?" do
+  before do
+    @vector = Vector[1, 2, 3, 4, 5]
+  end
+
+  it "returns true for self" do
+    @vector.eql?(@vector).should be_true
+  end
+
+  ruby_bug("[ruby-dev:36298]", "1.8.7") do
+    it "returns true when the each corresponding elements are equal in the sense of Object#eql?" do
+      @vector.eql?(Vector[1, 2, 3, 4, 5]).should be_true
+
+      num1, num2 = TrivialField.new, TrivialField.new
+      Vector[num1].eql?(Vector[num2]).should be_true
+    end
+
+    it "returns false when there are a pair corresponding elements which are not equal in the sense of Object#eql?" do
+      @vector.eql?(Vector[1, 2, 3, 4, 5.0]).should be_false
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/matrix/zero_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/matrix/zero_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/matrix/zero_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,54 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'matrix'
+
+describe "Matrix.zero" do
+  it "returns an object of type Matrix" do
+    Matrix.zero(3).class.should == Matrix
+  end
+  
+  it "creates a n x n matrix" do
+    m3 = Matrix.zero(3)
+    m3.row_size.should == 3
+    m3.column_size.should == 3
+    
+    m8 = Matrix.zero(8)
+    m8.row_size.should == 8
+    m8.column_size.should == 8
+  end
+  
+  it "initializes all cells to 0" do
+    size = 10 
+    m = Matrix.zero(size)
+    
+    (0...size).each do |i|
+      (0...size).each do |j|
+        m[i, j].should == 0
+      end
+    end
+  end
+  
+  it "returns an object of type Matrix" do
+    Matrix.zero(3).class.should == Matrix
+  end
+  
+  it "creates a square matrix with size given by the argument" do
+    m3 = Matrix.zero(3)
+    m3.row_size.should == 3
+    m3.column_size.should == 3
+    
+    m8 = Matrix.zero(8)
+    m8.row_size.should == 8
+    m8.column_size.should == 8
+  end
+  
+  it "initializes all cells to 0" do
+    size = 10 # arbitrary value
+    m = Matrix.zero(size)
+    
+    (0...size).each do |i|
+      (0...size).each do |j|
+        m[i, j].should == 0
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/mutex/lock_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/mutex/lock_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/mutex/lock_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'thread'
+
+describe "Mutex#lock" do
+  it "should return self" do
+    m = Mutex.new
+    m.lock.should == m
+    m.unlock
+  end
+
+  it "should wait if the lock is not available" do
+    m = Mutex.new
+
+    m.lock
+    v = 0
+
+    th = Thread.new do
+      m.lock
+      v = 1
+    end
+
+    Thread.pass until th.status == "sleep"
+
+    v.should == 0
+    m.unlock
+    th.join
+    v.should == 1
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/mutex/locked_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/mutex/locked_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/mutex/locked_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'thread'
+
+describe "Mutex#locked?" do
+  it "should return true if locked" do
+    m = Mutex.new
+    m.lock
+    m.locked?.should be_true
+  end
+
+  it "should return false if unlocked" do
+    m = Mutex.new
+    m.locked?.should be_false
+  end
+
+  it "should return the status of the lock" do
+    m1 = Mutex.new
+    m2 = Mutex.new
+
+    m2.lock # hold th with only m1 locked
+
+    th = Thread.new do
+      m1.lock
+      m2.lock
+    end
+
+    Thread.pass until th.status == "sleep"
+
+    m1.locked?.should be_true
+    m2.unlock # release th
+    th.join
+    m1.locked?.should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/mutex/synchronize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/mutex/synchronize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/mutex/synchronize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'thread'
+
+describe "Mutex#synchronize" do
+  it "wraps the lock/unlock pair in an ensure" do
+    m1 = Mutex.new
+    m2 = Mutex.new
+    m2.lock
+
+    th = Thread.new do
+      lambda do
+        m1.synchronize do
+          m2.lock
+          raise Exception
+        end
+      end.should raise_error(Exception)
+    end
+
+    Thread.pass until th.status == "sleep"
+
+    m1.locked?.should be_true
+    m2.unlock
+    th.join
+    m1.locked?.should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/mutex/try_lock_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/mutex/try_lock_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/mutex/try_lock_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'thread'
+
+describe "Mutex#try_lock" do
+  it "should return true if lock can be aquired immediately" do
+    m = Mutex.new
+    m.try_lock.should be_true
+  end
+
+  it "should return false if lock can not be aquired immediately" do
+    m1 = Mutex.new
+    m2 = Mutex.new
+
+    m2.lock
+    th = Thread.new do
+      m1.lock
+      m2.lock
+    end
+
+    Thread.pass until th.status == "sleep"
+
+    # th owns m1 so try_lock should return false
+    m1.try_lock.should be_false
+    m2.unlock
+    th.join
+    # once th is finished m1 should be released
+    m1.try_lock.should be_true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/mutex/unlock_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/mutex/unlock_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/mutex/unlock_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'thread'
+
+describe "Mutex#unlock" do
+  it "should raise ThreadError unless Mutex is locked" do
+    mutex = Mutex.new
+    lambda { mutex.unlock }.should raise_error(ThreadError)
+  end
+
+  it "should raise ThreadError unless thread owns Mutex" do
+    mutex = Mutex.new
+    wait = Mutex.new
+    wait.lock
+    th = Thread.new do
+      mutex.lock
+      wait.lock
+    end
+
+    # avoid race on mutex.lock
+    Thread.pass until th.status == "sleep"
+
+    lambda { mutex.unlock }.should raise_error(ThreadError)
+
+    wait.unlock
+    th.join
+  end
+
+  it "should return nil if successful" do
+    mutex = Mutex.new
+    mutex.lock
+    mutex.unlock.should.be_nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/FTPError_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/FTPError_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/FTPError_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'net/ftp'
+
+describe "Net::FTPError" do
+  it "is an Exception" do
+    Net::FTPError.should < Exception
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/FTPPermError_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/FTPPermError_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/FTPPermError_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'net/ftp'
+
+describe "Net::FTPPermError" do
+  it "is an Exception" do
+    Net::FTPPermError.should < Exception
+  end
+  
+  it "is a subclass of Net::FTPError" do
+    Net::FTPPermError.should < Net::FTPError
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/FTPProtoError_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/FTPProtoError_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/FTPProtoError_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'net/ftp'
+
+describe "Net::FTPProtoError" do
+  it "is an Exception" do
+    Net::FTPProtoError.should < Exception
+  end
+  
+  it "is a subclass of Net::FTPError" do
+    Net::FTPPermError.should < Net::FTPError
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/FTPReplyError_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/FTPReplyError_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/FTPReplyError_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'net/ftp'
+
+describe "Net::FTPReplyError" do
+  it "is an Exception" do
+    Net::FTPReplyError.should < Exception
+  end
+  
+  it "is a subclass of Net::FTPError" do
+    Net::FTPPermError.should < Net::FTPError
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/FTPTempError_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/FTPTempError_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/FTPTempError_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'net/ftp'
+
+describe "Net::FTPTempError" do
+  it "is an Exception" do
+    Net::FTPTempError.should < Exception
+  end
+  
+  it "is a subclass of Net::FTPError" do
+    Net::FTPPermError.should < Net::FTPError
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/abort_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/abort_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/abort_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,62 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#abort" do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+
+  it "sends the ABOR command to the server" do
+    lambda { @ftp.abort }.should_not raise_error
+  end
+  
+  it "ignores the response" do
+    @ftp.abort
+    @ftp.last_response.should == "220 Dummy FTP Server ready!\n"
+  end
+  
+  it "returns the full response" do
+    @ftp.abort.should == "226 Closing data connection. (ABOR)\n"
+  end
+  
+  it "does not raise any error when the response code is 225" do
+    @server.should_receive(:abor).and_respond("225 Data connection open; no transfer in progress.")
+    lambda { @ftp.abort }.should_not raise_error
+  end
+  
+  it "does not raise any error when the response code is 226" do
+    @server.should_receive(:abor).and_respond("226 Closing data connection.")
+    lambda { @ftp.abort }.should_not raise_error
+  end
+  
+  it "raises a Net::FTPProtoError when the response code is 500" do
+    @server.should_receive(:abor).and_respond("500 Syntax error, command unrecognized.")
+    lambda { @ftp.abort }.should raise_error(Net::FTPProtoError)
+  end
+  
+  it "raises a Net::FTPProtoError when the response code is 501" do
+    @server.should_receive(:abor).and_respond("501 Syntax error in parameters or arguments.")
+    lambda { @ftp.abort }.should raise_error(Net::FTPProtoError)
+  end
+  
+  it "raises a Net::FTPProtoError when the response code is 502" do
+    @server.should_receive(:abor).and_respond("502 Command not implemented.")
+    lambda { @ftp.abort }.should raise_error(Net::FTPProtoError)
+  end
+  
+  it "raises a Net::FTPProtoError when the response code is 421" do
+    @server.should_receive(:abor).and_respond("421 Service not available, closing control connection.")
+    lambda { @ftp.abort }.should raise_error(Net::FTPProtoError)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/acct_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/acct_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/acct_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,58 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#acct" do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+
+  it "writes the ACCT command to the server" do
+    @ftp.acct("my_account")
+    @ftp.last_response.should == "230 User 'my_account' logged in, proceed. (ACCT)\n"
+  end
+  
+  it "returns nil" do
+    @ftp.acct("my_account").should == nil
+  end
+  
+  it "does not raise any error when the response code is 230" do
+    @server.should_receive(:acct).and_respond("230 User logged in, proceed.")
+    lambda { @ftp.acct("my_account") }.should_not raise_error
+  end
+  
+  it "raises a Net::FTPPermError when the response code is 530" do
+    @server.should_receive(:acct).and_respond("530 Not logged in.")
+    lambda { @ftp.acct("my_account") }.should raise_error(Net::FTPPermError)
+  end
+  
+  it "raises a Net::FTPPermError when the response code is 500" do
+    @server.should_receive(:acct).and_respond("500 Syntax error, command unrecognized.")
+    lambda { @ftp.acct("my_account") }.should raise_error(Net::FTPPermError)
+  end
+  
+  it "raises a Net::FTPPermError when the response code is 501" do
+    @server.should_receive(:acct).and_respond("501 Syntax error in parameters or arguments.")
+    lambda { @ftp.acct("my_account") }.should raise_error(Net::FTPPermError)
+  end
+  
+  it "raises a Net::FTPPermError when the response code is 503" do
+    @server.should_receive(:acct).and_respond("503 Bad sequence of commands.")
+    lambda { @ftp.acct("my_account") }.should raise_error(Net::FTPPermError)
+  end
+  
+  it "raises a Net::FTPTempError when the response code is 421" do
+    @server.should_receive(:acct).and_respond("421 Service not available, closing control connection.")
+    lambda { @ftp.acct("my_account") }.should raise_error(Net::FTPTempError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/binary_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/binary_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/binary_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+
+describe "Net::FTP#binary" do
+  it "returns true when self is in binary mode" do
+    ftp = Net::FTP.new
+    ftp.binary.should be_true
+    
+    ftp.binary = false
+    ftp.binary.should be_false
+  end
+end
+
+describe "Net::FTP#binary=" do
+  it "sets self to binary mode when passed true" do
+    ftp = Net::FTP.new
+    
+    ftp.binary = true
+    ftp.binary.should be_true
+    
+    ftp.binary = false
+    ftp.binary.should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/chdir_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/chdir_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/chdir_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,101 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#chdir" do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+  
+  describe "when switching to the parent directory" do
+    it "sends the 'CDUP' command to the server" do
+      @ftp.chdir("..")
+      @ftp.last_response.should == "200 Command okay. (CDUP)\n"
+    end
+    
+    it "returns nil" do
+      @ftp.chdir("..").should be_nil
+    end
+
+    ruby_bug "http://redmine.ruby-lang.org/issues/show/384", "1.8.7" do
+      it "does not raise a Net::FTPPermError when the response code is 500" do
+        @server.should_receive(:cdup).and_respond("500 Syntax error, command unrecognized.")
+        lambda { @ftp.chdir("..") }.should_not raise_error(Net::FTPPermError)
+      end
+
+      it "raises a Net::FTPPermError when the response code is 501" do
+        @server.should_receive(:cdup).and_respond("501 Syntax error in parameters or arguments.")
+        lambda { @ftp.chdir("..") }.should raise_error(Net::FTPPermError)
+      end
+
+      it "raises a Net::FTPPermError when the response code is 502" do
+        @server.should_receive(:cdup).and_respond("502 Command not implemented.")
+        lambda { @ftp.chdir("..") }.should raise_error(Net::FTPPermError)
+      end
+
+      it "raises a Net::FTPTempError when the response code is 421" do
+        @server.should_receive(:cdup).and_respond("421 Service not available, closing control connection.")
+        lambda { @ftp.chdir("..") }.should raise_error(Net::FTPTempError)
+      end
+
+      it "raises a Net::FTPPermError when the response code is 530" do
+        @server.should_receive(:cdup).and_respond("530 Not logged in.")
+        lambda { @ftp.chdir("..") }.should raise_error(Net::FTPPermError)
+      end
+
+      it "raises a Net::FTPPermError when the response code is 550" do
+        @server.should_receive(:cdup).and_respond("550 Requested action not taken.")
+        lambda { @ftp.chdir("..") }.should raise_error(Net::FTPPermError)
+      end
+    end
+  end
+
+  it "writes the 'CWD' command with the passed directory to the socket" do
+    @ftp.chdir("test")
+    @ftp.last_response.should == "200 Command okay. (CWD test)\n"
+  end
+  
+  it "returns nil" do
+    @ftp.chdir("test").should be_nil
+  end
+
+  it "raises a Net::FTPPermError when the response code is 500" do
+    @server.should_receive(:cwd).and_respond("500 Syntax error, command unrecognized.")
+    lambda { @ftp.chdir("test") }.should raise_error(Net::FTPPermError)
+  end
+
+  it "raises a Net::FTPPermError when the response code is 501" do
+    @server.should_receive(:cwd).and_respond("501 Syntax error in parameters or arguments.")
+    lambda { @ftp.chdir("test") }.should raise_error(Net::FTPPermError)
+  end
+
+  it "raises a Net::FTPPermError when the response code is 502" do
+    @server.should_receive(:cwd).and_respond("502 Command not implemented.")
+    lambda { @ftp.chdir("test") }.should raise_error(Net::FTPPermError)
+  end
+
+  it "raises a Net::FTPTempError when the response code is 421" do
+    @server.should_receive(:cwd).and_respond("421 Service not available, closing control connection.")
+    lambda { @ftp.chdir("test") }.should raise_error(Net::FTPTempError)
+  end
+
+  it "raises a Net::FTPPermError when the response code is 530" do
+    @server.should_receive(:cwd).and_respond("530 Not logged in.")
+    lambda { @ftp.chdir("test") }.should raise_error(Net::FTPPermError)
+  end
+
+  it "raises a Net::FTPPermError when the response code is 550" do
+    @server.should_receive(:cwd).and_respond("550 Requested action not taken.")
+    lambda { @ftp.chdir("test") }.should raise_error(Net::FTPPermError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/close_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/close_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/close_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+
+describe "Net::FTP#close" do
+  before(:each) do
+    @socket = mock("Socket")
+    @socket.stub!(:closed?).and_return(false)
+
+    @ftp = Net::FTP.new
+    @ftp.instance_variable_set(:@sock, @socket)
+  end
+
+  it "closes the socket" do
+    @socket.should_receive(:close)
+    @ftp.close.should be_nil
+  end
+  
+  it "does not try to close the socket if it has already been closed" do
+    @socket.should_receive(:closed?).and_return(true)
+    @socket.should_not_receive(:close)
+    @ftp.close.should be_nil
+  end
+  
+  it "does not try to close the socket if it is nil" do
+    @ftp.instance_variable_set(:@sock, nil)
+    @ftp.close.should be_nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/closed_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/closed_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/closed_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+
+describe "Net::FTP#closed?" do
+  before(:each) do
+    @socket = mock("Socket")
+
+    @ftp = Net::FTP.new
+    @ftp.instance_variable_set(:@sock, @socket)
+  end
+
+  it "returns true when the socket is closed" do
+    @socket.should_receive(:closed?).and_return(true)
+    @ftp.closed?.should be_true
+  end
+  
+  it "returns true when the socket is nil" do
+    @ftp.instance_variable_set(:@sock, nil)
+    @ftp.closed?.should be_true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/connect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/connect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/connect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,49 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+# TODO: Add specs for using the SOCKSSocket
+describe "Net::FTP#connect" do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+  end
+
+  after(:each) do
+    @server.connect_message = nil
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+  
+  it "tries to connect to the FTP Server on the given host and port" do
+    lambda { @ftp.connect("localhost", 9921) }.should_not raise_error
+  end
+  
+  it "returns nil" do
+    @ftp.connect("localhost", 9921).should be_nil
+  end
+  
+  it "prints a small debug line when in debug mode" do
+    @ftp.debug_mode = true
+    lambda { @ftp.connect("localhost", 9921) }.should output(/#{"connect: localhost, 9921\\nget: 220 Dummy FTP Server ready!"}/)
+    @ftp.debug_mode = false
+  end
+
+  it "does not raise any error when the response code is 220" do
+    @server.connect_message = "220 Dummy FTP Server ready!"
+    lambda { @ftp.connect("localhost", 9921) }.should_not raise_error
+  end
+
+  it "raises a Net::FTPReplyError when the response code is 120" do
+    @server.connect_message = "120 Service ready in nnn minutes."
+    lambda { @ftp.connect("localhost", 9921) }.should raise_error(Net::FTPReplyError)
+  end
+
+  it "raises a Net::FTPTempError when the response code is 421" do
+    @server.connect_message = "421 Service not available, closing control connection."
+    lambda { @ftp.connect("localhost", 9921) }.should raise_error(Net::FTPTempError)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/debug_mode_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/debug_mode_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/debug_mode_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+
+describe "Net::FTP#debug_mode" do
+  it "returns true when self is in debug mode" do
+    ftp = Net::FTP.new
+    ftp.debug_mode.should be_false
+    
+    ftp.debug_mode = true
+    ftp.debug_mode.should be_true
+  end
+end
+
+describe "Net::FTP#debug_mode=" do
+  it "sets self into debug mode when passed true" do
+    ftp = Net::FTP.new
+    ftp.debug_mode = true
+    ftp.debug_mode.should be_true
+    
+    ftp.debug_mode = false
+    ftp.debug_mode.should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/delete_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/delete_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/delete_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,59 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#delete" do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+  
+  it "sends the DELE command with the passed filename to the server" do
+    @ftp.delete("test.file")
+    @ftp.last_response.should == "250 Requested file action okay, completed. (DELE test.file)\n"
+  end
+
+  it "raises a Net::FTPTempError when the response code is 450" do
+    @server.should_receive(:dele).and_respond("450 Requested file action not taken.")
+    lambda { @ftp.delete("test.file") }.should raise_error(Net::FTPTempError)
+  end
+
+  it "raises a Net::FTPPermError when the response code is 550" do
+    @server.should_receive(:dele).and_respond("550 Requested action not taken.")
+    lambda { @ftp.delete("test.file") }.should raise_error(Net::FTPPermError)
+  end
+
+  it "raises a Net::FTPPermError when the response code is 500" do
+    @server.should_receive(:dele).and_respond("500 Syntax error, command unrecognized.")
+    lambda { @ftp.delete("test.file") }.should raise_error(Net::FTPPermError)
+  end
+  
+  it "raises a Net::FTPPermError when the response code is 501" do
+    @server.should_receive(:dele).and_respond("501 Syntax error in parameters or arguments.")
+    lambda { @ftp.delete("test.file") }.should raise_error(Net::FTPPermError)
+  end
+
+  it "raises a Net::FTPPermError when the response code is 502" do
+    @server.should_receive(:dele).and_respond("502 Command not implemented.")
+    lambda { @ftp.delete("test.file") }.should raise_error(Net::FTPPermError)
+  end
+
+  it "raises a Net::FTPTempError when the response code is 421" do
+    @server.should_receive(:dele).and_respond("421 Service not available, closing control connection.")
+    lambda { @ftp.delete("test.file") }.should raise_error(Net::FTPTempError)
+  end
+
+  it "raises a Net::FTPPermError when the response code is 530" do
+    @server.should_receive(:dele).and_respond("530 Not logged in.")
+    lambda { @ftp.delete("test.file") }.should raise_error(Net::FTPPermError)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/dir_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/dir_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/dir_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+require File.dirname(__FILE__) + '/shared/list'
+
+describe "Net::FTP#dir" do
+  it_behaves_like :net_ftp_list, :dir
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/fixtures/putbinaryfile
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/fixtures/putbinaryfile	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/fixtures/putbinaryfile	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+This is an example file
+which is going to be transmitted
+using #putbinaryfile.
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/fixtures/puttextfile
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/fixtures/puttextfile	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/fixtures/puttextfile	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+This is an example file
+which is going to be transmitted
+using #puttextfile.
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/fixtures/server.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/fixtures/server.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/fixtures/server.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,249 @@
+module NetFTPSpecs
+  class DummyFTP
+    attr_accessor :connect_message
+    
+    def initialize(port = 9921) 
+      @server = TCPServer.new("localhost", port)
+      
+      @handlers = {}
+      @commands = []
+      @connect_message = nil
+    end
+    
+    def serve_once
+      @thread = Thread.new do
+        @socket = @server.accept
+        handle_request
+        @socket.close
+      end
+    end
+  
+    def handle_request
+      # Send out the welcome message.
+      response @connect_message || "220 Dummy FTP Server ready!"
+    
+      begin
+        loop do
+          command = @socket.recv(1024)
+          break if command.nil?
+
+          command, argument = command.chomp.split(" ", 2)
+
+          if command == "QUIT"
+            self.response("221 OK, bye")
+            break
+          elsif proc_handler = @handlers[command.downcase.to_sym]
+            if argument.nil?
+              proc_handler.call(self)
+            else
+              proc_handler.call(self, argument)
+            end
+          else
+            if argument.nil?
+              self.send(command.downcase.to_sym)
+            else
+              self.send(command.downcase.to_sym, argument)
+            end
+          end
+        end
+      rescue => e
+        self.error_response("Exception: #{e} #{e.backtrace.inspect}")
+      end
+    end
+  
+    def error_response(text)
+      self.response("451 #{text}")
+    end
+  
+    def response(text)
+      @socket.puts(text) unless @socket.closed?
+    end
+  
+    def stop
+      @datasocket.close unless @datasocket.nil? || @datasocket.closed?
+      @server.close
+      @thread.join
+    end
+    
+    
+    ## 
+    def handle(sym, &block)
+      @handlers[sym] = block
+    end
+    
+    def should_receive(method)
+      @handler_for = method
+      self
+    end
+  
+    def and_respond(text)
+      @handlers[@handler_for] = lambda { |s, *args| s.response(text) }
+    end
+    
+    ##
+    # FTP methods
+    ##
+    
+    def abor
+      self.response("226 Closing data connection. (ABOR)")
+    end
+    
+    def acct(account)
+      self.response("230 User '#{account}' logged in, proceed. (ACCT)")
+    end
+    
+    def cdup
+      self.response("200 Command okay. (CDUP)")
+    end
+    
+    def cwd(dir)
+      self.response("200 Command okay. (CWD #{dir})")
+    end
+    
+    def dele(file)
+      self.response("250 Requested file action okay, completed. (DELE #{file})")
+    end
+    
+    def eprt(arg)
+      _, _, host, port = arg.split("|")
+      
+      @datasocket = TCPSocket.new(host, port)
+      self.response("200 port opened")
+    end
+    
+    def help(param = :default)
+      if param == :default
+        self.response("211 System status, or system help reply. (HELP)")
+      else
+        self.response("211 System status, or system help reply. (HELP #{param})")
+      end
+    end
+    
+    def list(folder)
+      self.response("150 opening ASCII connection for file list")
+      @datasocket.puts("-rw-r--r--  1 spec  staff  507 17 Jul 18:41 last_response_code.rb")
+      @datasocket.puts("-rw-r--r--  1 spec  staff   50 17 Jul 18:41 list.rb")
+      @datasocket.puts("-rw-r--r--  1 spec  staff   48 17 Jul 18:41 pwd.rb")
+      @datasocket.close()
+      self.response("226 transfer complete (LIST #{folder})")
+    end
+    
+    def mdtm(filename)
+      self.response("213 19980705132316")
+    end
+    
+    def mkd(foldername)
+      self.response(%Q{257 "#{foldername.gsub('"', '""')}" created.})
+    end
+    
+    def nlst(folder = nil)
+      self.response("150 opening ASCII connection for file list")
+      @datasocket.puts("last_response_code.rb")
+      @datasocket.puts("list.rb")
+      @datasocket.puts("pwd.rb")
+      @datasocket.close()
+      self.response("226 transfer complete (NLST#{folder ? " #{folder}" : ""})")
+    end
+    
+    def noop
+      self.response("200 Command okay. (NOOP)")
+    end
+    
+    def pass(password)
+      self.response("230 User logged in, proceed. (PASS #{password})")
+    end
+    
+    def port(arg)
+      nums = arg.split(",")
+      
+      port = nums[4].to_i * 256 + nums[5].to_i
+      host = nums[0..3].join(".")
+      
+      @datasocket = TCPSocket.new(host, port)
+      self.response("200 port opened")
+    end
+    
+    def pwd
+      self.response('257 "/some/dir/" - current directory')
+    end
+    
+    def retr(file)
+      self.response("125 Data transfer starting")
+      if @restart_at && @restart_at == 20
+        @datasocket.puts("of the file named '#{file}'.")
+        @restart_at = nil
+      else
+        @datasocket.puts("This is the content")
+        @datasocket.puts("of the file named '#{file}'.")
+      end
+      @datasocket.close()
+      self.response("226 Closing data connection. (RETR #{file})")
+    end
+    
+    def rest(at_bytes)
+      @restart_at = at_bytes.to_i
+      self.response("350 Requested file action pending further information. (REST)")
+    end
+    
+    def rmd(folder)
+      self.response("250 Requested file action okay, completed. (RMD #{folder})")
+    end
+    
+    def rnfr(from)
+      @rename_from = from
+      self.response("350 Requested file action pending further information.")
+    end
+    
+    def rnto(to)
+      self.response("250 Requested file action okay, completed. (Renamed #{@rename_from} to #{to})")
+      @rename_from = nil
+    end
+    
+    def site(param)
+      self.response("200 Command okay. (SITE #{param})")
+    end
+    
+    def size(filename)
+      if filename == "binary"
+        self.response("213 24")
+      else
+        self.response("213 1024")
+      end
+    end
+    
+    def stat
+      self.response("211 System status, or system help reply. (STAT)")
+    end
+    
+    def stor(file)
+      tmp_file = tmp("#{file}file")
+      
+      self.response("125 Data transfer starting.")
+
+      mode = @restart_at ? "a" : "w"
+
+      File.open(tmp_file, mode) do |f|
+        loop do
+          data = @datasocket.recv(1024)
+          break if !data || data.empty?
+          f << data
+        end
+      end
+
+      #@datasocket.close()
+      self.response("200 OK, Data received. (STOR #{file})")
+    end
+    
+    def syst
+      self.response("215 FTP Dummy Server (SYST)")
+    end
+    
+    def type(type)
+      self.response("200 TYPE switched to #{type}")
+    end
+    
+    def user(name)
+      self.response("230 User logged in, proceed. (USER #{name})")
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/get_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/get_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/get_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+require File.dirname(__FILE__) + "/shared/gettextfile"
+require File.dirname(__FILE__) + "/shared/getbinaryfile"
+
+describe "Net::FTP#get (binary mode)" do
+  before(:each) do
+    @binary_mode = true
+  end
+  
+  it_behaves_like :net_ftp_getbinaryfile, :get
+end
+
+describe "Net::FTP#get (text mode)" do
+  before(:each) do
+    @binary_mode = false
+  end
+  
+  it_behaves_like :net_ftp_gettextfile, :get
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/getbinaryfile_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/getbinaryfile_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/getbinaryfile_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+require File.dirname(__FILE__) + "/shared/getbinaryfile"
+
+describe "Net::FTP#getbinaryfile" do
+  it_behaves_like :net_ftp_getbinaryfile, :getbinaryfile
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/getdir_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/getdir_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/getdir_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/shared/pwd"
+
+describe "Net::FTP#getdir" do
+  it_behaves_like :net_ftp_pwd, :getdir
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/gettextfile_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/gettextfile_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/gettextfile_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+require File.dirname(__FILE__) + "/shared/gettextfile"
+
+describe "Net::FTP#gettextfile" do
+  it_behaves_like :net_ftp_gettextfile, :gettextfile
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/help_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/help_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/help_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,66 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#help" do
+  def with_connection
+    yield
+  end
+  
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+
+  it "writes the HELP command to the server" do
+    @ftp.help
+    @ftp.last_response.should == "211 System status, or system help reply. (HELP)\n"
+  end
+  
+  it "returns the server's response" do
+    @ftp.help.should == "211 System status, or system help reply. (HELP)\n"
+  end
+
+  it "writes the HELP command with an optional parameter to the socket" do
+    @ftp.help("some parameter").should == "211 System status, or system help reply. (HELP some parameter)\n"
+  end
+
+  it "does not raise any error when the response code is 211" do
+    @server.should_receive(:help).and_respond("211 System status, or system help reply.")
+    lambda { @ftp.help }.should_not raise_error
+  end
+
+  it "does not raise any error when the response code is 214" do
+    @server.should_receive(:help).and_respond("214 Help message.")
+    lambda { @ftp.help }.should_not raise_error
+  end
+
+  it "raises a Net::FTPPermError when the response code is 500" do
+    @server.should_receive(:help).and_respond("500 Syntax error, command unrecognized.")
+    lambda { @ftp.help }.should raise_error(Net::FTPPermError)
+  end
+
+  it "raises a Net::FTPPermError when the response code is 501" do
+    @server.should_receive(:help).and_respond("501 Syntax error in parameters or arguments.")
+    lambda { @ftp.help }.should raise_error(Net::FTPPermError)
+  end
+
+  it "raises a Net::FTPPermError when the response code is 502" do
+    @server.should_receive(:help).and_respond("502 Command not implemented.")
+    lambda { @ftp.help }.should raise_error(Net::FTPPermError)
+  end
+
+  it "raises a Net::FTPTempError when the response code is 421" do
+    @server.should_receive(:help).and_respond("421 Service not available, closing control connection.")
+    lambda { @ftp.help }.should raise_error(Net::FTPTempError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,87 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+
+describe "Net::FTP#initialize" do
+  before(:each) do
+    @ftp = Net::FTP.allocate
+    @ftp.stub!(:connect)
+  end
+  
+  it "is private" do
+    @ftp.private_methods.should include("initialize")
+  end
+  
+  it "sets self into binary mode" do
+    @ftp.binary.should be_nil
+    @ftp.send(:initialize)
+    @ftp.binary.should be_true
+  end
+  
+  it "sets self into active mode" do
+    @ftp.passive.should be_nil
+    @ftp.send(:initialize)
+    @ftp.passive.should be_false
+  end
+  
+  it "sets self into non-debug mode" do
+    @ftp.debug_mode.should be_nil
+    @ftp.send(:initialize)
+    @ftp.debug_mode.should be_false
+  end
+  
+  it "sets self to not resume file uploads/downloads" do
+    @ftp.resume.should be_nil
+    @ftp.send(:initialize)
+    @ftp.resume.should be_false
+  end
+  
+  describe "when passed no arguments" do
+    it "does not try to connect" do
+      @ftp.should_not_receive(:connect)
+      @ftp.send(:initialize)
+    end
+  end
+  
+  describe "when passed host" do
+    it "tries to connect to the passed host" do
+      @ftp.should_receive(:connect).with("localhost")
+      @ftp.send(:initialize, "localhost")
+    end
+  end
+  
+  describe "when passed host, user" do
+    it "tries to connect to the passed host" do
+      @ftp.should_receive(:connect).with("localhost")
+      @ftp.send(:initialize, "localhost")
+    end
+    
+    it "tries to login with the passed username" do
+      @ftp.should_receive(:login).with("rubyspec", nil, nil)
+      @ftp.send(:initialize, "localhost", "rubyspec")
+    end
+  end
+
+  describe "when passed host, user, password" do
+    it "tries to connect to the passed host" do
+      @ftp.should_receive(:connect).with("localhost")
+      @ftp.send(:initialize, "localhost")
+    end
+    
+    it "tries to login with the passed username and password" do
+      @ftp.should_receive(:login).with("rubyspec", "rocks", nil)
+      @ftp.send(:initialize, "localhost", "rubyspec", "rocks")
+    end
+  end
+
+  describe "when passed host, user" do
+    it "tries to connect to the passed host" do
+      @ftp.should_receive(:connect).with("localhost")
+      @ftp.send(:initialize, "localhost")
+    end
+    
+    it "tries to login with the passed username, password and account" do
+      @ftp.should_receive(:login).with("rubyspec", "rocks", "account")
+      @ftp.send(:initialize, "localhost", "rubyspec", "rocks", "account")
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/last_response_code_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/last_response_code_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/last_response_code_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/shared/last_response_code"
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#last_response_code" do
+  it_behaves_like :net_ftp_last_response_code, :last_response_code
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/last_response_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/last_response_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/last_response_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#last_response" do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+
+  it "returns the last response" do
+    @ftp.last_response.should == "220 Dummy FTP Server ready!\n"
+    @ftp.help
+    @ftp.last_response.should == "211 System status, or system help reply. (HELP)\n"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/lastresp_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/lastresp_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/lastresp_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/shared/last_response_code"
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#lastresp" do
+  it_behaves_like :net_ftp_last_response_code, :lastresp
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/list_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/list_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/list_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+require File.dirname(__FILE__) + '/shared/list'
+
+describe "Net::FTP#list" do
+  it_behaves_like :net_ftp_list, :list
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/login_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/login_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/login_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,206 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#login" do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+
+  describe "when passed no arguments" do
+    it "sends the USER command with 'anonymous' as name to the server" do
+      @ftp.login
+      @ftp.last_response.should == "230 User logged in, proceed. (USER anonymous)\n"
+    end
+    
+    it "sends the current username + hostname as a password when required" do
+      passhost = Socket.gethostname
+      if not passhost.index(".")
+        passhost = Socket.gethostbyname(passhost)[0]
+      end
+      pass = ENV["USER"] + "@" + passhost 
+      @server.should_receive(:user).and_respond("331 User name okay, need password.")
+      @ftp.login
+      @ftp.last_response.should == "230 User logged in, proceed. (PASS #{pass})\n"
+    end
+    
+    ruby_bug "http://redmine.ruby-lang.org/issues/show/385", "1.8.7" do
+      it "raises a Net::FTPReplyError when the server requests an account" do
+        @server.should_receive(:user).and_respond("331 User name okay, need password.")
+        @server.should_receive(:pass).and_respond("332 Need account for login.")
+        lambda { @ftp.login }.should raise_error(Net::FTPReplyError)
+      end
+    end
+  end
+  
+  describe "when passed name" do
+    it "sends the USER command with the passed name to the server" do
+      @ftp.login("rubyspec")
+      @ftp.last_response.should == "230 User logged in, proceed. (USER rubyspec)\n"
+    end
+    
+    ruby_bug "http://redmine.ruby-lang.org/issues/show/385", "1.8.7" do
+      it "raises a Net::FTPReplyError when the server requests a password, but none was given" do
+        @server.should_receive(:user).and_respond("331 User name okay, need password.")
+        lambda { @ftp.login("rubyspec") }.should raise_error(Net::FTPReplyError)
+      end
+
+      it "raises a Net::FTPReplyError when the server requests an account, but none was given" do
+        @server.should_receive(:user).and_respond("331 User name okay, need password.")
+        @server.should_receive(:pass).and_respond("332 Need account for login.")
+        lambda { @ftp.login("rubyspec") }.should raise_error(Net::FTPReplyError)
+      end
+    end
+  end
+  
+  describe "when passed name, password" do
+    it "sends the USER command with the passed name to the server" do
+      @ftp.login("rubyspec", "rocks")
+      @ftp.last_response.should == "230 User logged in, proceed. (USER rubyspec)\n"
+    end
+    
+    it "sends the passed password when required" do
+      @server.should_receive(:user).and_respond("331 User name okay, need password.")
+      @ftp.login("rubyspec", "rocks")
+      @ftp.last_response.should == "230 User logged in, proceed. (PASS rocks)\n"
+    end
+    
+    ruby_bug "http://redmine.ruby-lang.org/issues/show/385", "1.8.7" do
+      it "raises a Net::FTPReplyError when the server requests an account" do
+        @server.should_receive(:user).and_respond("331 User name okay, need password.")
+        @server.should_receive(:pass).and_respond("332 Need account for login.")
+        lambda { @ftp.login("rubyspec", "rocks") }.should raise_error(Net::FTPReplyError)
+      end
+    end
+  end
+  
+  describe "when passed name, password, account" do
+    it "sends the USER command with the passed name to the server" do
+      @ftp.login("rubyspec", "rocks", "account")
+      @ftp.last_response.should == "230 User logged in, proceed. (USER rubyspec)\n"
+    end
+    
+    it "sends the passed password when required" do
+      @server.should_receive(:user).and_respond("331 User name okay, need password.")
+      @ftp.login("rubyspec", "rocks", "account")
+      @ftp.last_response.should == "230 User logged in, proceed. (PASS rocks)\n"
+    end
+    
+    it "sends the passed account when required" do
+      @server.should_receive(:user).and_respond("331 User name okay, need password.")
+      @server.should_receive(:pass).and_respond("332 Need account for login.")
+      @ftp.login("rubyspec", "rocks", "account")
+      @ftp.last_response.should == "230 User 'account' logged in, proceed. (ACCT)\n"
+    end
+  end
+  
+  describe "when the USER command fails" do
+    it "raises a Net::FTPPermError when the response code is 500" do
+      @server.should_receive(:user).and_respond("500 Syntax error, command unrecognized.")
+      lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 501" do
+      @server.should_receive(:user).and_respond("501 Syntax error in parameters or arguments.")
+      lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPPermError when the response code is 502" do
+      @server.should_receive(:user).and_respond("502 Command not implemented.")
+      lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPTempError when the response code is 421" do
+      @server.should_receive(:user).and_respond("421 Service not available, closing control connection.")
+      lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPTempError)
+    end
+
+    it "raises a Net::FTPPermError when the response code is 530" do
+      @server.should_receive(:user).and_respond("530 Not logged in.")
+      lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError)
+    end
+  end
+  
+  describe "when the PASS command fails" do
+    before(:each) do
+      @server.should_receive(:user).and_respond("331 User name okay, need password.")
+    end
+    
+    it "does not raise an Error when the response code is 202" do
+      @server.should_receive(:pass).and_respond("202 Command not implemented, superfluous at this site.")
+      lambda { @ftp.login("rubyspec", "rocks", "account") }.should_not raise_error
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 500" do
+      @server.should_receive(:pass).and_respond("500 Syntax error, command unrecognized.")
+      lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 501" do
+      @server.should_receive(:pass).and_respond("501 Syntax error in parameters or arguments.")
+      lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPPermError when the response code is 502" do
+      @server.should_receive(:pass).and_respond("502 Command not implemented.")
+      lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPTempError when the response code is 421" do
+      @server.should_receive(:pass).and_respond("421 Service not available, closing control connection.")
+      lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPTempError)
+    end
+
+    it "raises a Net::FTPPermError when the response code is 530" do
+      @server.should_receive(:pass).and_respond("530 Not logged in.")
+      lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError)
+    end
+  end
+  
+  describe "when the ACCT command fails" do
+    before(:each) do
+      @server.should_receive(:user).and_respond("331 User name okay, need password.")
+      @server.should_receive(:pass).and_respond("332 Need account for login.")
+    end
+    
+    it "does not raise an Error when the response code is 202" do
+      @server.should_receive(:acct).and_respond("202 Command not implemented, superfluous at this site.")
+      lambda { @ftp.login("rubyspec", "rocks", "account") }.should_not raise_error
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 500" do
+      @server.should_receive(:acct).and_respond("500 Syntax error, command unrecognized.")
+      lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 501" do
+      @server.should_receive(:acct).and_respond("501 Syntax error in parameters or arguments.")
+      lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPPermError when the response code is 502" do
+      @server.should_receive(:acct).and_respond("502 Command not implemented.")
+      lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPTempError when the response code is 421" do
+      @server.should_receive(:acct).and_respond("421 Service not available, closing control connection.")
+      lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPTempError)
+    end
+
+    it "raises a Net::FTPPermError when the response code is 530" do
+      @server.should_receive(:acct).and_respond("530 Not logged in.")
+      lambda { @ftp.login("rubyspec", "rocks", "account") }.should raise_error(Net::FTPPermError)
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/ls_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/ls_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/ls_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+require File.dirname(__FILE__) + '/shared/list'
+
+describe "Net::FTP#ls" do
+  it_behaves_like :net_ftp_list, :ls
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/mdtm_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/mdtm_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/mdtm_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,38 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#mdtm" do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+
+  it "sends the MDTM with the passed filename command to the server" do
+    @ftp.mdtm("test.file")
+    @ftp.last_response.should == "213 19980705132316\n"
+  end
+  
+  it "returns the last modification time of the passed file" do
+    @ftp.mdtm("test.file").should == "19980705132316"
+  end
+  
+  it "raises a Net::FTPPermError when the response code is 550" do
+    @server.should_receive(:mdtm).and_respond("550 Requested action not taken.")
+    lambda { @ftp.mdtm("test.file") }.should raise_error(Net::FTPPermError)
+  end
+  
+  it "raises a Net::FTPTempError when the response code is 421" do
+    @server.should_receive(:mdtm).and_respond("421 Service not available, closing control connection.")
+    lambda { @ftp.mdtm("test.file") }.should raise_error(Net::FTPTempError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/mkdir_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/mkdir_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/mkdir_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,61 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#mkdir" do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+
+  it "sends the MKD command with the passed pathname to the server" do
+    @ftp.mkdir("test.folder")
+    @ftp.last_response.should == %{257 "test.folder" created.\n}
+  end
+  
+  it "returns the path to the newly created directory" do
+    @ftp.mkdir("test.folder").should == "test.folder"
+    @ftp.mkdir("/absolute/path/to/test.folder").should == "/absolute/path/to/test.folder"
+    @ftp.mkdir("relative/path/to/test.folder").should == "relative/path/to/test.folder"
+    @ftp.mkdir('/usr/dm/foo"bar').should == '/usr/dm/foo"bar'
+  end
+  
+  it "raises a Net::FTPPermError when the response code is 500" do
+    @server.should_receive(:mkd).and_respond("500 Syntax error, command unrecognized.")
+    lambda { @ftp.mkdir("test.folder") }.should raise_error(Net::FTPPermError)
+  end
+  
+  it "raises a Net::FTPPermError when the response code is 501" do
+    @server.should_receive(:mkd).and_respond("501 Syntax error in parameters or arguments.")
+    lambda { @ftp.mkdir("test.folder") }.should raise_error(Net::FTPPermError)
+  end
+  
+  it "raises a Net::FTPPermError when the response code is 502" do
+    @server.should_receive(:mkd).and_respond("502 Command not implemented.")
+    lambda { @ftp.mkdir("test.folder") }.should raise_error(Net::FTPPermError)
+  end
+  
+  it "raises a Net::FTPTempError when the response code is 421" do
+    @server.should_receive(:mkd).and_respond("421 Service not available, closing control connection.")
+    lambda { @ftp.mkdir("test.folder") }.should raise_error(Net::FTPTempError)
+  end
+
+  it "raises a Net::FTPPermError when the response code is 530" do
+    @server.should_receive(:mkd).and_respond("530 Not logged in.")
+    lambda { @ftp.mkdir("test.folder") }.should raise_error(Net::FTPPermError)
+  end
+  
+  it "raises a Net::FTPPermError when the response code is 550" do
+    @server.should_receive(:mkd).and_respond("550 Requested action not taken.")
+    lambda { @ftp.mkdir("test.folder") }.should raise_error(Net::FTPPermError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/mtime_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/mtime_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/mtime_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,50 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#mtime" do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+
+  it "sends the MDTM with the passed filename command to the server" do
+    @ftp.mtime("test.file")
+    @ftp.last_response.should == "213 19980705132316\n"
+  end
+
+  describe "when passed filename" do
+    it "returns the last modification time of the passed file as a Time object in the local time" do
+      @ftp.mtime("test.file").should == Time.gm("1998", "07", "05", "13", "23", "16")
+    end
+  end
+  
+  describe "when passed filename, local_time" do
+    it "returns the last modification time as a Time object in UTC when local_time is true" do
+      @ftp.mtime("test.file", true).should == Time.local("1998", "07", "05", "13", "23", "16")
+    end
+
+    it "returns the last modification time as a Time object in the local time when local_time is false" do
+      @ftp.mtime("test.file", false).should == Time.gm("1998", "07", "05", "13", "23", "16")
+    end
+  end
+  
+  it "raises a Net::FTPPermError when the response code is 550" do
+    @server.should_receive(:mdtm).and_respond("550 Requested action not taken.")
+    lambda { @ftp.mtime("test.file") }.should raise_error(Net::FTPPermError)
+  end
+  
+  it "raises a Net::FTPTempError when the response code is 421" do
+    @server.should_receive(:mdtm).and_respond("421 Service not available, closing control connection.")
+    lambda { @ftp.mtime("test.file") }.should raise_error(Net::FTPTempError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/nlst_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/nlst_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/nlst_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,119 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#nlst" do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.passive = false
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+  
+  describe "when passed no arguments" do
+    it "returns an Array containing a list of files in the current dir" do
+      @ftp.nlst.should == ["last_response_code.rb", "list.rb", "pwd.rb"]
+      @ftp.last_response.should == "226 transfer complete (NLST)\n"
+    end
+  end
+  
+  describe "when passed dir" do
+    it "returns an Array containing a list of files in the passed dir" do
+      @ftp.nlst("test.folder").should == ["last_response_code.rb", "list.rb", "pwd.rb"]
+      @ftp.last_response.should == "226 transfer complete (NLST test.folder)\n"
+    end
+  end
+  
+  describe "when the NLST command fails" do
+    it "raises a Net::FTPTempError when the response code is 450" do
+      @server.should_receive(:nlst).and_respond("450 Requested file action not taken..")
+      lambda { @ftp.nlst }.should raise_error(Net::FTPTempError)
+    end
+
+    it "raises a Net::FTPPermError when the response code is 500" do
+      @server.should_receive(:nlst).and_respond("500 Syntax error, command unrecognized.")
+      lambda { @ftp.nlst }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPPermError when the response code is 501" do
+      @server.should_receive(:nlst).and_respond("501 Syntax error, command unrecognized.")
+      lambda { @ftp.nlst }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPPermError when the response code is 502" do
+      @server.should_receive(:nlst).and_respond("502 Command not implemented.")
+      lambda { @ftp.nlst }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPTempError when the response code is 421" do
+      @server.should_receive(:nlst).and_respond("421 Service not available, closing control connection.")
+      lambda { @ftp.nlst }.should raise_error(Net::FTPTempError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 530" do
+      @server.should_receive(:nlst).and_respond("530 Not logged in.")
+      lambda { @ftp.nlst }.should raise_error(Net::FTPPermError)
+    end
+  end
+  
+  describe "when switching type fails" do
+    it "raises a Net::FTPPermError when the response code is 500" do
+      @server.should_receive(:type).and_respond("500 Syntax error, command unrecognized.")
+      lambda { @ftp.nlst }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 501" do
+      @server.should_receive(:type).and_respond("501 Syntax error in parameters or arguments.")
+      lambda { @ftp.nlst }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 504" do
+      @server.should_receive(:type).and_respond("504 Command not implemented for that parameter.")
+      lambda { @ftp.nlst }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPTempError when the response code is 421" do
+      @server.should_receive(:type).and_respond("421 Service not available, closing control connection.")
+      lambda { @ftp.nlst }.should raise_error(Net::FTPTempError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 530" do
+      @server.should_receive(:type).and_respond("530 Not logged in.")
+      lambda { @ftp.nlst }.should raise_error(Net::FTPPermError)
+    end
+  end
+  
+  describe "when opening the data port fails" do
+    it "raises a Net::FTPPermError when the response code is 500" do
+      @server.should_receive(:eprt).and_respond("500 Syntax error, command unrecognized.")
+      @server.should_receive(:port).and_respond("500 Syntax error, command unrecognized.")
+      lambda { @ftp.nlst }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPPermError when the response code is 501" do
+      @server.should_receive(:eprt).and_respond("501 Syntax error in parameters or arguments.")
+      @server.should_receive(:port).and_respond("501 Syntax error in parameters or arguments.")
+      lambda { @ftp.nlst }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPTempError when the response code is 421" do
+      @server.should_receive(:eprt).and_respond("421 Service not available, closing control connection.")
+      @server.should_receive(:port).and_respond("421 Service not available, closing control connection.")
+      lambda { @ftp.nlst }.should raise_error(Net::FTPTempError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 530" do
+      @server.should_receive(:eprt).and_respond("530 Not logged in.")
+      @server.should_receive(:port).and_respond("530 Not logged in.")
+      lambda { @ftp.nlst }.should raise_error(Net::FTPPermError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/noop_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/noop_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/noop_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,38 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#noop" do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+
+  it "sends the NOOP command to the server" do
+    @ftp.noop
+    @ftp.last_response.should == "200 Command okay. (NOOP)\n"
+  end
+  
+  it "returns nil" do
+    @ftp.noop.should be_nil
+  end
+  
+  it "raises a Net::FTPPermError when the response code is 500" do
+    @server.should_receive(:noop).and_respond("500 Syntax error, command unrecognized.")
+    lambda { @ftp.noop }.should raise_error(Net::FTPPermError)
+  end
+
+  it "raises a Net::FTPTempError when the response code is 421" do
+    @server.should_receive(:noop).and_respond("421 Service not available, closing control connection.")
+    lambda { @ftp.noop }.should raise_error(Net::FTPTempError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/open_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/open_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/open_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,55 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+
+describe "Net::FTP.open" do
+  before(:each) do
+    @ftp = mock("Net::FTP instance")
+    Net::FTP.stub!(:new).and_return(@ftp)
+  end
+  
+  describe "when passed no block" do
+    it "returns a new Net::FTP instance" do
+      Net::FTP.open("localhost").should equal(@ftp)
+    end
+    
+    it "passes the passed arguments down to Net::FTP.new" do
+      Net::FTP.should_receive(:new).with("localhost", "user", "password", "account")
+      Net::FTP.open("localhost", "user", "password", "account")
+    end
+  end
+  
+  describe "when passed a block" do
+    before(:each) do
+      @ftp.stub!(:close)
+    end
+    
+    it "yields a new Net::FTP instance to the passed block" do
+      yielded = false
+      Net::FTP.open("localhost") do |ftp|
+        yielded = true
+        ftp.should equal(@ftp)
+      end
+      yielded.should be_true
+    end
+    
+    it "closes the Net::FTP instance after yielding" do
+      Net::FTP.open("localhost") do |ftp|
+        ftp.should_receive(:close)
+      end
+    end
+    
+    it "closes the Net::FTP instance even if an exception is raised while yielding" do
+      begin
+        Net::FTP.open("localhost") do |ftp|
+          ftp.should_receive(:close)
+          raise ArgumentError, "some exception"
+        end
+      rescue ArgumentError
+      end
+    end
+    
+    it "returns the block's return value" do
+      Net::FTP.open("localhost") { :test }.should == :test
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/passive_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/passive_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/passive_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+
+describe "Net::FTP#passive" do
+  it "returns true when self is in passive mode" do
+    ftp = Net::FTP.new
+    ftp.passive.should be_false
+    
+    ftp.passive = true
+    ftp.passive.should be_true
+  end
+end
+
+describe "Net::FTP#passive=" do
+  it "sets self to passive mode when passed true" do
+    ftp = Net::FTP.new
+    
+    ftp.passive = true
+    ftp.passive.should be_true
+    
+    ftp.passive = false
+    ftp.passive.should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/put_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/put_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/put_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+require File.dirname(__FILE__) + "/shared/puttextfile"
+require File.dirname(__FILE__) + "/shared/putbinaryfile"
+
+describe "Net::FTP#put (binary mode)" do
+  before(:each) do
+    @binary_mode = true
+  end
+  
+  it_behaves_like :net_ftp_putbinaryfile, :put
+end
+
+describe "Net::FTP#put (text mode)" do
+  before(:each) do
+    @binary_mode = false
+  end
+  
+  it_behaves_like :net_ftp_puttextfile, :put
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/putbinaryfile_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/putbinaryfile_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/putbinaryfile_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+require File.dirname(__FILE__) + "/shared/putbinaryfile"
+
+describe "Net::FTP#putbinaryfile" do
+  it_behaves_like :net_ftp_putbinaryfile, :putbinaryfile
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/puttextfile_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/puttextfile_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/puttextfile_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+require File.dirname(__FILE__) + "/shared/puttextfile"
+
+describe "Net::FTP#puttextfile" do
+  it_behaves_like :net_ftp_puttextfile, :puttextfile
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/pwd_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/pwd_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/pwd_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,53 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#pwd" do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+
+  it "sends the PWD command to the server" do
+    @ftp.pwd
+    @ftp.last_response.should == "257 \"/some/dir/\" - current directory\n"
+  end
+  
+  it "returns the current directory" do
+    @ftp.pwd.should == "/some/dir/"
+  end
+  
+  it "raises a Net::FTPPermError when the response code is 500" do
+    @server.should_receive(:pwd).and_respond("500 Syntax error, command unrecognized.")
+    lambda { @ftp.pwd }.should raise_error(Net::FTPPermError)
+  end
+
+  it "raises a Net::FTPPermError when the response code is 501" do
+    @server.should_receive(:pwd).and_respond("501 Syntax error in parameters or arguments.")
+    lambda { @ftp.pwd }.should raise_error(Net::FTPPermError)
+  end
+  
+  it "raises a Net::FTPPermError when the response code is 502" do
+    @server.should_receive(:pwd).and_respond("502 Command not implemented.")
+    lambda { @ftp.pwd }.should raise_error(Net::FTPPermError)
+  end
+  
+  it "raises a Net::FTPTempError when the response code is 421" do
+    @server.should_receive(:pwd).and_respond("421 Service not available, closing control connection.")
+    lambda { @ftp.pwd }.should raise_error(Net::FTPTempError)
+  end
+  
+  it "raises a Net::FTPPermError when the response code is 550" do
+    @server.should_receive(:pwd).and_respond("550 Requested action not taken.")
+    lambda { @ftp.pwd }.should raise_error(Net::FTPPermError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/quit_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/quit_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/quit_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#quit" do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+
+  it "sends the QUIT command to the server" do
+    @ftp.quit
+    @ftp.last_response.should == "221 OK, bye\n"
+  end
+  
+  it "does not close the socket automagically" do
+    @ftp.quit
+    @ftp.closed?.should be_false
+  end
+  
+  it "returns nil" do
+    @ftp.quit.should be_nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/rename_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/rename_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/rename_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,94 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#rename" do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+
+  describe "when passed from_name, to_name" do
+    it "sends the RNFR command with the passed from_name and the RNTO command with the passed to_name to the server" do
+      @ftp.rename("from.file", "to.file")
+      @ftp.last_response.should == "250 Requested file action okay, completed. (Renamed from.file to to.file)\n"
+    end
+  
+    it "returns something" do
+      @ftp.rename("from.file", "to.file").should be_nil
+    end
+  end
+
+  describe "when the RNFR command fails" do
+    it "raises a Net::FTPTempError when the response code is 450" do
+      @server.should_receive(:rnfr).and_respond("450 Requested file action not taken.")
+      lambda { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPTempError)
+    end
+  
+    it "raises a Net::FTPPermError when the response code is 550" do
+      @server.should_receive(:rnfr).and_respond("550 Requested action not taken.")
+      lambda { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPPermError)
+    end
+  
+    it "raises a Net::FTPPermError when the response code is 501" do
+      @server.should_receive(:rnfr).and_respond("501 Syntax error in parameters or arguments.")
+      lambda { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPPermError)
+    end
+  
+    it "raises a Net::FTPPermError when the response code is 502" do
+      @server.should_receive(:rnfr).and_respond("502 Command not implemented.")
+      lambda { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPPermError)
+    end
+  
+    it "raises a Net::FTPTempError when the response code is 421" do
+      @server.should_receive(:rnfr).and_respond("421 Service not available, closing control connection.")
+      lambda { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPTempError)
+    end
+  
+    it "raises a Net::FTPPermError when the response code is 530" do
+      @server.should_receive(:rnfr).and_respond("530 Not logged in.")
+      lambda { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPPermError)
+    end
+  end
+  
+  describe "when the RNTO command fails" do
+    it "raises a Net::FTPPermError when the response code is 532" do
+      @server.should_receive(:rnfr).and_respond("532 Need account for storing files.")
+      lambda { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 553" do
+      @server.should_receive(:rnto).and_respond("553 Requested action not taken.")
+      lambda { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPPermError when the response code is 501" do
+      @server.should_receive(:rnto).and_respond("501 Syntax error in parameters or arguments.")
+      lambda { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPPermError when the response code is 502" do
+      @server.should_receive(:rnto).and_respond("502 Command not implemented.")
+      lambda { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPTempError when the response code is 421" do
+      @server.should_receive(:rnto).and_respond("421 Service not available, closing control connection.")
+      lambda { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPTempError)
+    end
+
+    it "raises a Net::FTPPermError when the response code is 530" do
+      @server.should_receive(:rnto).and_respond("530 Not logged in.")
+      lambda { @ftp.rename("from.file", "to.file") }.should raise_error(Net::FTPPermError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/resume_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/resume_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/resume_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+
+describe "Net::FTP#resume" do
+  it "returns true when self is set to resume uploads/downloads" do
+    ftp = Net::FTP.new
+    ftp.resume.should be_false
+    
+    ftp.resume = true
+    ftp.resume.should be_true
+  end
+end
+
+describe "Net::FTP#resume=" do
+  it "sets self to resume uploads/downloads when set to true" do
+    ftp = Net::FTP.new
+    ftp.resume = true
+    ftp.resume.should be_true
+    
+    ftp.resume = false
+    ftp.resume.should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/retrbinary_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/retrbinary_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/retrbinary_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,30 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#retrbinary" do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+  
+  it "sends the passed command to the server" do
+    @ftp.retrbinary("RETR test", 4096) {}
+    @ftp.last_response.should == "226 Closing data connection. (RETR test)\n"
+  end
+  
+  it "yields the received content as binary blocks of the passed size" do
+    res = []
+    @ftp.retrbinary("RETR test", 10) { |bin| res << bin }
+    res.should == [ "This is th", "e content\n", "of the fil", "e named 't", "est'.\n" ]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/retrlines_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/retrlines_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/retrlines_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#retrlines" do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+
+  it "sends the passed command over the socket" do
+    @ftp.retrlines("LIST test.dir") {}
+    @ftp.last_response.should == "226 transfer complete (LIST test.dir)\n"
+  end
+
+  it "yields each received line to the passed block" do
+    res = []
+    @ftp.retrlines("LIST test.dir") { |x| res << x }
+    res.should == [
+      "-rw-r--r--  1 spec  staff  507 17 Jul 18:41 last_response_code.rb",
+      "-rw-r--r--  1 spec  staff   50 17 Jul 18:41 list.rb",
+      "-rw-r--r--  1 spec  staff   48 17 Jul 18:41 pwd.rb"
+    ]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/return_code_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/return_code_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/return_code_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+
+describe "Net::FTP#return_code" do
+  before(:each) do
+    @ftp = Net::FTP.new
+  end
+  
+  it "outputs a warning and returns a newline" do
+    lambda do
+      @ftp.return_code.should == "\n"
+    end.should complain("warning: Net::FTP#return_code is obsolete and do nothing\n")
+  end
+end
+
+describe "Net::FTP#return_code=" do
+  before(:each) do
+    @ftp = Net::FTP.new
+  end
+
+  it "outputs a warning" do
+    lambda { @ftp.return_code = 123 }.should complain("warning: Net::FTP#return_code= is obsolete and do nothing\n")
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/rmdir_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/rmdir_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/rmdir_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,58 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#rmdir" do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+
+  it "sends the RMD command with the passed pathname to the server" do
+    @ftp.rmdir("test.folder")
+    @ftp.last_response.should == "250 Requested file action okay, completed. (RMD test.folder)\n"
+  end
+  
+  it "returns nil" do
+    @ftp.rmdir("test.folder").should be_nil
+  end
+  
+  it "raises a Net::FTPPermError when the response code is 500" do
+    @server.should_receive(:rmd).and_respond("500 Syntax error, command unrecognized.")
+    lambda { @ftp.rmdir("test.folder") }.should raise_error(Net::FTPPermError)
+  end
+  
+  it "raises a Net::FTPPermError when the response code is 501" do
+    @server.should_receive(:rmd).and_respond("501 Syntax error in parameters or arguments.")
+    lambda { @ftp.rmdir("test.folder") }.should raise_error(Net::FTPPermError)
+  end
+  
+  it "raises a Net::FTPPermError when the response code is 502" do
+    @server.should_receive(:rmd).and_respond("502 Command not implemented.")
+    lambda { @ftp.rmdir("test.folder") }.should raise_error(Net::FTPPermError)
+  end
+  
+  it "raises a Net::FTPTempError when the response code is 421" do
+    @server.should_receive(:rmd).and_respond("421 Service not available, closing control connection.")
+    lambda { @ftp.rmdir("test.folder") }.should raise_error(Net::FTPTempError)
+  end
+
+  it "raises a Net::FTPPermError when the response code is 530" do
+    @server.should_receive(:rmd).and_respond("530 Not logged in.")
+    lambda { @ftp.rmdir("test.folder") }.should raise_error(Net::FTPPermError)
+  end
+  
+  it "raises a Net::FTPPermError when the response code is 550" do
+    @server.should_receive(:rmd).and_respond("550 Requested action not taken.")
+    lambda { @ftp.rmdir("test.folder") }.should raise_error(Net::FTPPermError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/sendcmd_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/sendcmd_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/sendcmd_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,54 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#sendcmd" do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+  
+  it "sends the passed command to the server" do
+    @ftp.sendcmd("HELP")
+    @ftp.last_response.should == "211 System status, or system help reply. (HELP)\n"
+  end
+  
+  it "returns the server's response" do
+    @ftp.sendcmd("HELP").should == "211 System status, or system help reply. (HELP)\n"
+  end
+  
+  it "raises no error when the response code is 1xx, 2xx or 3xx" do
+    @server.should_receive(:help).and_respond("120 Service ready in nnn minutes.")
+    lambda { @ftp.sendcmd("HELP") }.should_not raise_error
+
+    @server.should_receive(:help).and_respond("200 Command okay.")
+    lambda { @ftp.sendcmd("HELP") }.should_not raise_error
+
+    @server.should_receive(:help).and_respond("350 Requested file action pending further information.")
+    lambda { @ftp.sendcmd("HELP") }.should_not raise_error
+  end
+  
+  it "raises a Net::FTPTempError when the response code is 4xx" do
+    @server.should_receive(:help).and_respond("421 Service not available, closing control connection.")
+    lambda { @ftp.sendcmd("HELP") }.should raise_error(Net::FTPTempError)
+  end
+
+  it "raises a Net::FTPPermError when the response code is 5xx" do
+    @server.should_receive(:help).and_respond("500 Syntax error, command unrecognized.")
+    lambda { @ftp.sendcmd("HELP") }.should raise_error(Net::FTPPermError)
+  end
+
+  it "raises a Net::FTPProtoError when the response code is not between 1xx-5xx" do
+    @server.should_receive(:help).and_respond("999 Invalid response.")
+    lambda { @ftp.sendcmd("HELP") }.should raise_error(Net::FTPProtoError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/set_socket_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/set_socket_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/set_socket_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+
+describe "Net::FTP#set_socket" do
+  # TODO: I won't spec this method, as it is not used
+  #       anywhere and it should be private anyway.
+  #it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/getbinaryfile.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/getbinaryfile.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/getbinaryfile.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,175 @@
+describe :net_ftp_getbinaryfile, :shared => :true do
+  before(:each) do
+    @fixture_file = File.dirname(__FILE__) + "/../fixtures/getbinaryfile"
+    @tmp_file = tmp("getbinaryfile")
+    
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+    @ftp.binary = @binary_mode
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+  
+  it "sends the RETR command to the server" do
+    @ftp.send(@method, "test", @tmp_file)
+    @ftp.last_response.should == "226 Closing data connection. (RETR test)\n"
+  end
+  
+  it "returns nil" do
+    @ftp.send(@method, "test", @tmp_file).should be_nil
+  end
+  
+  it "saves the contents of the passed remote file to the passed local file" do
+    @ftp.send(@method, "test", @tmp_file)
+    File.read(@tmp_file).should == "This is the content\nof the file named 'test'.\n"
+  end
+  
+  describe "when passed a block" do
+    it "yields the received content as binary blocks of the passed size" do
+      res = []
+      @ftp.send(@method, "test", @tmp_file, 10) { |bin| res << bin }
+      res.should == [ "This is th", "e content\n", "of the fil", "e named 't", "est'.\n" ]
+    end
+  end
+  
+  describe "when resuming an existing file" do
+    before(:each) do
+      @tmp_file = tmp("getbinaryfile_resume")
+      
+      File.open(@tmp_file, "w") do |f|
+        f << "This is the content\n"
+      end
+      
+      @ftp.resume = true
+    end
+    
+    it "saves the remaining content of the passed remote file to the passed local file" do
+      @ftp.send(@method, "test", @tmp_file)
+      File.read(@tmp_file).should == "This is the content\nof the file named 'test'.\n"
+    end
+    
+    describe "and the REST command fails" do
+      it "raises a Net::FTPProtoError when the response code is 550" do
+        @server.should_receive(:rest).and_respond("Requested action not taken.")
+        lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPProtoError)
+      end
+
+      it "raises a Net::FTPPermError when the response code is 500" do
+        @server.should_receive(:rest).and_respond("500 Syntax error, command unrecognized.")
+        lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError)
+      end
+
+      it "raises a Net::FTPPermError when the response code is 501" do
+        @server.should_receive(:rest).and_respond("501 Syntax error, command unrecognized.")
+        lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError)
+      end
+
+      it "raises a Net::FTPPermError when the response code is 502" do
+        @server.should_receive(:rest).and_respond("502 Command not implemented.")
+        lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError)
+      end
+      
+      it "raises a Net::FTPTempError when the response code is 421" do
+        @server.should_receive(:rest).and_respond("421 Service not available, closing control connection.")
+        lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPTempError)
+      end
+
+      it "raises a Net::FTPPermError when the response code is 530" do
+        @server.should_receive(:rest).and_respond("530 Not logged in.")
+        lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError)
+      end
+    end
+  end
+
+  describe "when the RETR command fails" do
+    it "raises a Net::FTPTempError when the response code is 450" do
+      @server.should_receive(:retr).and_respond("450 Requested file action not taken.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPTempError)
+    end
+  
+    it "raises a Net::FTPProtoError when the response code is 550" do
+      @server.should_receive(:retr).and_respond("Requested action not taken.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPProtoError)
+    end
+
+    it "raises a Net::FTPPermError when the response code is 500" do
+      @server.should_receive(:retr).and_respond("500 Syntax error, command unrecognized.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPPermError when the response code is 501" do
+      @server.should_receive(:retr).and_respond("501 Syntax error, command unrecognized.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPTempError when the response code is 421" do
+      @server.should_receive(:retr).and_respond("421 Service not available, closing control connection.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPTempError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 530" do
+      @server.should_receive(:retr).and_respond("530 Not logged in.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError)
+    end
+  end
+  
+  describe "when switching type fails" do
+    it "raises a Net::FTPPermError when the response code is 500" do
+      @server.should_receive(:type).and_respond("500 Syntax error, command unrecognized.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 501" do
+      @server.should_receive(:type).and_respond("501 Syntax error in parameters or arguments.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 504" do
+      @server.should_receive(:type).and_respond("504 Command not implemented for that parameter.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPTempError when the response code is 421" do
+      @server.should_receive(:type).and_respond("421 Service not available, closing control connection.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPTempError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 530" do
+      @server.should_receive(:type).and_respond("530 Not logged in.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError)
+    end
+  end
+  
+  describe "when opening the data port fails" do
+    it "raises a Net::FTPPermError when the response code is 500" do
+      @server.should_receive(:eprt).and_respond("500 Syntax error, command unrecognized.")
+      @server.should_receive(:port).and_respond("500 Syntax error, command unrecognized.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPPermError when the response code is 501" do
+      @server.should_receive(:eprt).and_respond("501 Syntax error in parameters or arguments.")
+      @server.should_receive(:port).and_respond("501 Syntax error in parameters or arguments.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPTempError when the response code is 421" do
+      @server.should_receive(:eprt).and_respond("421 Service not available, closing control connection.")
+      @server.should_receive(:port).and_respond("421 Service not available, closing control connection.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPTempError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 530" do
+      @server.should_receive(:eprt).and_respond("530 Not logged in.")
+      @server.should_receive(:port).and_respond("530 Not logged in.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError)
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/gettextfile.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/gettextfile.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/gettextfile.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,125 @@
+describe :net_ftp_gettextfile, :shared => :true do
+  before(:each) do
+    @tmp_file = tmp("gettextfile")
+    
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+    @ftp.binary = @binary_mode
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+  
+  it "sends the RETR command to the server" do
+    @ftp.send(@method, "test", @tmp_file)
+    @ftp.last_response.should == "226 Closing data connection. (RETR test)\n"
+  end
+  
+  it "returns nil" do
+    @ftp.send(@method, "test", @tmp_file).should be_nil
+  end
+  
+  it "saves the contents of the passed remote file to the passed local file" do
+    @ftp.send(@method, "test", @tmp_file)
+    File.read(@tmp_file).should == "This is the content\nof the file named 'test'.\n"
+  end
+  
+  describe "when passed a block" do
+    it "yields each line of the retrieved file to the passed block" do
+      res = []
+      @ftp.send(@method, "test", @tmp_file) { |line| res << line }
+      res.should == [ "This is the content", "of the file named 'test'."]
+    end
+  end
+
+  describe "when the RETR command fails" do
+    it "raises a Net::FTPTempError when the response code is 450" do
+      @server.should_receive(:retr).and_respond("450 Requested file action not taken.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPTempError)
+    end
+  
+    it "raises a Net::FTPProtoError when the response code is 550" do
+      @server.should_receive(:retr).and_respond("Requested action not taken.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPProtoError)
+    end
+
+    it "raises a Net::FTPPermError when the response code is 500" do
+      @server.should_receive(:retr).and_respond("500 Syntax error, command unrecognized.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPPermError when the response code is 501" do
+      @server.should_receive(:retr).and_respond("501 Syntax error, command unrecognized.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPTempError when the response code is 421" do
+      @server.should_receive(:retr).and_respond("421 Service not available, closing control connection.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPTempError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 530" do
+      @server.should_receive(:retr).and_respond("530 Not logged in.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError)
+    end
+  end
+  
+  describe "when switching type fails" do
+    it "raises a Net::FTPPermError when the response code is 500" do
+      @server.should_receive(:type).and_respond("500 Syntax error, command unrecognized.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 501" do
+      @server.should_receive(:type).and_respond("501 Syntax error in parameters or arguments.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 504" do
+      @server.should_receive(:type).and_respond("504 Command not implemented for that parameter.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPTempError when the response code is 421" do
+      @server.should_receive(:type).and_respond("421 Service not available, closing control connection.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPTempError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 530" do
+      @server.should_receive(:type).and_respond("530 Not logged in.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError)
+    end
+  end
+  
+  describe "when opening the data port fails" do
+    it "raises a Net::FTPPermError when the response code is 500" do
+      @server.should_receive(:eprt).and_respond("500 Syntax error, command unrecognized.")
+      @server.should_receive(:port).and_respond("500 Syntax error, command unrecognized.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPPermError when the response code is 501" do
+      @server.should_receive(:eprt).and_respond("501 Syntax error in parameters or arguments.")
+      @server.should_receive(:port).and_respond("501 Syntax error in parameters or arguments.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPTempError when the response code is 421" do
+      @server.should_receive(:eprt).and_respond("421 Service not available, closing control connection.")
+      @server.should_receive(:port).and_respond("421 Service not available, closing control connection.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPTempError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 530" do
+      @server.should_receive(:eprt).and_respond("530 Not logged in.")
+      @server.should_receive(:port).and_respond("530 Not logged in.")
+      lambda { @ftp.send(@method, "test", @tmp_file) }.should raise_error(Net::FTPPermError)
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/last_response_code.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/last_response_code.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/last_response_code.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+describe :net_ftp_last_response_code, :shared => true do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+
+  it "returns the response code for the last response" do
+    @server.should_receive(:help).and_respond("200 Command okay.")
+    @ftp.help
+    @ftp.send(@method).should == "200"
+
+    @server.should_receive(:help).and_respond("212 Directory status.")
+    @ftp.help
+    @ftp.send(@method).should == "212"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/list.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/list.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/list.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,131 @@
+describe :net_ftp_list, :shared => true do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.passive = false
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+  
+  describe "when passed a block" do
+    it "yields each file in the list of files in the passed dir" do
+      expected = [
+        "-rw-r--r--  1 spec  staff  507 17 Jul 18:41 last_response_code.rb",
+        "-rw-r--r--  1 spec  staff   50 17 Jul 18:41 list.rb",
+        "-rw-r--r--  1 spec  staff   48 17 Jul 18:41 pwd.rb"
+      ]
+      
+      res = []
+      @ftp.send(@method, "test.folder") { |line| res << line}
+      res.should == expected
+      
+      @ftp.last_response.should == "226 transfer complete (LIST test.folder)\n"
+    end
+  end
+  
+  describe "when passed no block" do
+    it "returns an Array containing a list of files in the passed dir" do
+      expected = [
+        "-rw-r--r--  1 spec  staff  507 17 Jul 18:41 last_response_code.rb",
+        "-rw-r--r--  1 spec  staff   50 17 Jul 18:41 list.rb",
+        "-rw-r--r--  1 spec  staff   48 17 Jul 18:41 pwd.rb"
+      ]
+      
+      @ftp.send(@method, "test.folder").should == expected
+      
+      @ftp.last_response.should == "226 transfer complete (LIST test.folder)\n"
+    end
+  end
+  
+  describe "when the LIST command fails" do
+    it "raises a Net::FTPTempError when the response code is 450" do
+      @server.should_receive(:list).and_respond("450 Requested file action not taken..")
+      lambda { @ftp.send(@method) }.should raise_error(Net::FTPTempError)
+    end
+
+    it "raises a Net::FTPPermError when the response code is 500" do
+      @server.should_receive(:list).and_respond("500 Syntax error, command unrecognized.")
+      lambda { @ftp.send(@method) }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPPermError when the response code is 501" do
+      @server.should_receive(:list).and_respond("501 Syntax error, command unrecognized.")
+      lambda { @ftp.send(@method) }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPPermError when the response code is 502" do
+      @server.should_receive(:list).and_respond("502 Command not implemented.")
+      lambda { @ftp.send(@method) }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPTempError when the response code is 421" do
+      @server.should_receive(:list).and_respond("421 Service not available, closing control connection.")
+      lambda { @ftp.send(@method) }.should raise_error(Net::FTPTempError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 530" do
+      @server.should_receive(:list).and_respond("530 Not logged in.")
+      lambda { @ftp.send(@method) }.should raise_error(Net::FTPPermError)
+    end
+  end
+  
+  describe "when switching type fails" do
+    it "raises a Net::FTPPermError when the response code is 500" do
+      @server.should_receive(:type).and_respond("500 Syntax error, command unrecognized.")
+      lambda { @ftp.send(@method) }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 501" do
+      @server.should_receive(:type).and_respond("501 Syntax error in parameters or arguments.")
+      lambda { @ftp.send(@method) }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 504" do
+      @server.should_receive(:type).and_respond("504 Command not implemented for that parameter.")
+      lambda { @ftp.send(@method) }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPTempError when the response code is 421" do
+      @server.should_receive(:type).and_respond("421 Service not available, closing control connection.")
+      lambda { @ftp.send(@method) }.should raise_error(Net::FTPTempError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 530" do
+      @server.should_receive(:type).and_respond("530 Not logged in.")
+      lambda { @ftp.send(@method) }.should raise_error(Net::FTPPermError)
+    end
+  end
+  
+  describe "when opening the data port fails" do
+    it "raises a Net::FTPPermError when the response code is 500" do
+      @server.should_receive(:eprt).and_respond("500 Syntax error, command unrecognized.")
+      @server.should_receive(:port).and_respond("500 Syntax error, command unrecognized.")
+      lambda { @ftp.send(@method) }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPPermError when the response code is 501" do
+      @server.should_receive(:eprt).and_respond("501 Syntax error in parameters or arguments.")
+      @server.should_receive(:port).and_respond("501 Syntax error in parameters or arguments.")
+      lambda { @ftp.send(@method) }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPTempError when the response code is 421" do
+      @server.should_receive(:eprt).and_respond("421 Service not available, closing control connection.")
+      @server.should_receive(:port).and_respond("421 Service not available, closing control connection.")
+      lambda { @ftp.send(@method) }.should raise_error(Net::FTPTempError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 530" do
+      @server.should_receive(:eprt).and_respond("530 Not logged in.")
+      @server.should_receive(:port).and_respond("530 Not logged in.")
+      lambda { @ftp.send(@method) }.should raise_error(Net::FTPPermError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/putbinaryfile.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/putbinaryfile.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/putbinaryfile.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,192 @@
+describe :net_ftp_putbinaryfile, :shared => :true do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @local_fixture_file  = File.dirname(__FILE__) + "/../fixtures/putbinaryfile"
+    @remote_tmp_file = tmp("binaryfile")
+    
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+    @ftp.binary = @binary_mode
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+
+  it "sends the STOR command to the server" do
+    @ftp.send(@method, @local_fixture_file, "binary")
+    @ftp.last_response.should == "200 OK, Data received. (STOR binary)\n"
+  end
+  
+  it "sends the contents of the passed local_file, without modifications" do
+    @ftp.send(@method, @local_fixture_file, "binary")
+    
+    remote_lines = File.readlines(@remote_tmp_file)
+    local_lines  = File.readlines(@local_fixture_file)
+    
+    remote_lines.should == local_lines
+  end
+
+  it "returns nil" do
+    @ftp.send(@method, @local_fixture_file, "binary").should be_nil
+  end
+  
+  describe "when passed a block" do
+    it "yields the transmitted content as binary blocks of the passed size" do
+      res = []
+      @ftp.send(@method, @local_fixture_file, "binary", 10) { |x| res << x }
+      res.should == [
+        "This is an", " example f",
+        "ile\nwhich ", "is going t",
+        "o be trans", "mitted\nusi",
+        "ng #putbin", "aryfile."
+      ]
+    end
+  end
+
+  describe "when resuming an existing file" do
+    before(:each) do
+      File.open(@remote_tmp_file, "w") do |f|
+        f << "This is an example file\n"
+      end
+      
+      @ftp.resume = true
+    end
+    
+    it "sends the remaining content of the passed local_file to the passed remote_file" do
+      @ftp.send(@method, @local_fixture_file, "binary")
+      File.read(@remote_tmp_file).should == File.read(@local_fixture_file)
+    end
+    
+    describe "and the REST command fails" do
+      it "raises a Net::FTPProtoError when the response code is 550" do
+        @server.should_receive(:rest).and_respond("Requested action not taken.")
+        lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPProtoError)
+      end
+
+      it "raises a Net::FTPPermError when the response code is 500" do
+        @server.should_receive(:rest).and_respond("500 Syntax error, command unrecognized.")
+        lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError)
+      end
+
+      it "raises a Net::FTPPermError when the response code is 501" do
+        @server.should_receive(:rest).and_respond("501 Syntax error, command unrecognized.")
+        lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError)
+      end
+
+      it "raises a Net::FTPPermError when the response code is 502" do
+        @server.should_receive(:rest).and_respond("502 Command not implemented.")
+        lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError)
+      end
+      
+      it "raises a Net::FTPTempError when the response code is 421" do
+        @server.should_receive(:rest).and_respond("421 Service not available, closing control connection.")
+        lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPTempError)
+      end
+
+      it "raises a Net::FTPPermError when the response code is 530" do
+        @server.should_receive(:rest).and_respond("530 Not logged in.")
+        lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError)
+      end
+    end
+  end
+
+  describe "when the STOR command fails" do
+    it "raises a Net::FTPPermError when the response code is 532" do
+      @server.should_receive(:stor).and_respond("532 Need account for storing files.")
+      lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPTempError when the response code is 450" do
+      @server.should_receive(:stor).and_respond("450 Requested file action not taken.")
+      lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPTempError)
+    end
+    
+    it "raises a Net::FTPTempError when the response code is 452" do
+      @server.should_receive(:stor).and_respond("452 Requested action not taken.")
+      lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPTempError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 553" do
+      @server.should_receive(:stor).and_respond("553 Requested action not taken.")
+      lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 500" do
+      @server.should_receive(:stor).and_respond("500 Syntax error, command unrecognized.")
+      lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 501" do
+      @server.should_receive(:stor).and_respond("501 Syntax error in parameters or arguments.")
+      lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPTempError when the response code is 421" do
+      @server.should_receive(:stor).and_respond("421 Service not available, closing control connection.")
+      lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPTempError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 530" do
+      @server.should_receive(:stor).and_respond("530 Not logged in.")
+      lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError)
+    end
+  end
+
+  describe "when switching type fails" do
+    it "raises a Net::FTPPermError when the response code is 500" do
+      @server.should_receive(:type).and_respond("500 Syntax error, command unrecognized.")
+      lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 501" do
+      @server.should_receive(:type).and_respond("501 Syntax error in parameters or arguments.")
+      lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 504" do
+      @server.should_receive(:type).and_respond("504 Command not implemented for that parameter.")
+      lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPTempError when the response code is 421" do
+      @server.should_receive(:type).and_respond("421 Service not available, closing control connection.")
+      lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPTempError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 530" do
+      @server.should_receive(:type).and_respond("530 Not logged in.")
+      lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError)
+    end
+  end
+  
+  describe "when opening the data port fails" do
+    it "raises a Net::FTPPermError when the response code is 500" do
+      @server.should_receive(:eprt).and_respond("500 Syntax error, command unrecognized.")
+      @server.should_receive(:port).and_respond("500 Syntax error, command unrecognized.")
+      lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPPermError when the response code is 501" do
+      @server.should_receive(:eprt).and_respond("501 Syntax error in parameters or arguments.")
+      @server.should_receive(:port).and_respond("501 Syntax error in parameters or arguments.")
+      lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPTempError when the response code is 421" do
+      @server.should_receive(:eprt).and_respond("421 Service not available, closing control connection.")
+      @server.should_receive(:port).and_respond("421 Service not available, closing control connection.")
+      lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPTempError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 530" do
+      @server.should_receive(:eprt).and_respond("530 Not logged in.")
+      @server.should_receive(:port).and_respond("530 Not logged in.")
+      lambda { @ftp.send(@method, @local_fixture_file, "binary") }.should raise_error(Net::FTPPermError)
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/puttextfile.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/puttextfile.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/puttextfile.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,149 @@
+describe :net_ftp_puttextfile, :shared => true do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @local_fixture_file  = File.dirname(__FILE__) + "/../fixtures/puttextfile"
+    @remote_tmp_file = tmp("textfile")
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+    @ftp.binary = @binary_mode
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+
+  after :all do
+    File.unlink(tmp("textfile")) if File.exists?(tmp("textfile"))
+  end
+
+  it "sends the STOR command to the server" do
+    @ftp.send(@method, @local_fixture_file, "text")
+    @ftp.last_response.should == "200 OK, Data received. (STOR text)\n"
+  end
+  
+  it "sends the contents of the passed local_file, using \\r\\n as the newline separator" do
+    @ftp.send(@method, @local_fixture_file, "text")
+    
+    remote_lines = File.readlines(@remote_tmp_file)
+    local_lines  = File.readlines(@local_fixture_file)
+    
+    remote_lines.should_not == local_lines
+    remote_lines.should == local_lines.map { |l| l.chomp + "\r\n" }
+  end
+
+  it "returns nil" do
+    @ftp.send(@method, @local_fixture_file, "text").should be_nil
+  end
+  
+  describe "when passed a block" do
+    it "yields each transmitted line" do
+      res = []
+      @ftp.send(@method, @local_fixture_file, "text") { |x| res << x }
+      res.should == [
+        "This is an example file\r\n",
+        "which is going to be transmitted\r\n",
+        "using #puttextfile.\r\n"
+      ]
+    end
+  end
+
+  describe "when the STOR command fails" do
+    it "raises a Net::FTPPermError when the response code is 532" do
+      @server.should_receive(:stor).and_respond("532 Need account for storing files.")
+      lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPTempError when the response code is 450" do
+      @server.should_receive(:stor).and_respond("450 Requested file action not taken.")
+      lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPTempError)
+    end
+    
+    it "raises a Net::FTPTempError when the response code is 452" do
+      @server.should_receive(:stor).and_respond("452 Requested action not taken.")
+      lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPTempError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 553" do
+      @server.should_receive(:stor).and_respond("553 Requested action not taken.")
+      lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 500" do
+      @server.should_receive(:stor).and_respond("500 Syntax error, command unrecognized.")
+      lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 501" do
+      @server.should_receive(:stor).and_respond("501 Syntax error in parameters or arguments.")
+      lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPTempError when the response code is 421" do
+      @server.should_receive(:stor).and_respond("421 Service not available, closing control connection.")
+      lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPTempError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 530" do
+      @server.should_receive(:stor).and_respond("530 Not logged in.")
+      lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError)
+    end
+  end
+
+  describe "when switching type fails" do
+    it "raises a Net::FTPPermError when the response code is 500" do
+      @server.should_receive(:type).and_respond("500 Syntax error, command unrecognized.")
+      lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 501" do
+      @server.should_receive(:type).and_respond("501 Syntax error in parameters or arguments.")
+      lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 504" do
+      @server.should_receive(:type).and_respond("504 Command not implemented for that parameter.")
+      lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError)
+    end
+    
+    it "raises a Net::FTPTempError when the response code is 421" do
+      @server.should_receive(:type).and_respond("421 Service not available, closing control connection.")
+      lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPTempError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 530" do
+      @server.should_receive(:type).and_respond("530 Not logged in.")
+      lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError)
+    end
+  end
+  
+  describe "when opening the data port fails" do
+    it "raises a Net::FTPPermError when the response code is 500" do
+      @server.should_receive(:eprt).and_respond("500 Syntax error, command unrecognized.")
+      @server.should_receive(:port).and_respond("500 Syntax error, command unrecognized.")
+      lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPPermError when the response code is 501" do
+      @server.should_receive(:eprt).and_respond("501 Syntax error in parameters or arguments.")
+      @server.should_receive(:port).and_respond("501 Syntax error in parameters or arguments.")
+      lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError)
+    end
+
+    it "raises a Net::FTPTempError when the response code is 421" do
+      @server.should_receive(:eprt).and_respond("421 Service not available, closing control connection.")
+      @server.should_receive(:port).and_respond("421 Service not available, closing control connection.")
+      lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPTempError)
+    end
+    
+    it "raises a Net::FTPPermError when the response code is 530" do
+      @server.should_receive(:eprt).and_respond("530 Not logged in.")
+      @server.should_receive(:port).and_respond("530 Not logged in.")
+      lambda { @ftp.send(@method, @local_fixture_file, "text") }.should raise_error(Net::FTPPermError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/pwd.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/pwd.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/shared/pwd.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+describe :net_ftp_pwd, :shared => true do
+  
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/site_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/site_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/site_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,53 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#site" do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+  
+  it "sends the SITE command with the passed argument to the server" do
+    @ftp.site("param")
+    @ftp.last_response.should == "200 Command okay. (SITE param)\n"
+  end
+  
+  it "returns nil" do
+    @ftp.site("param").should be_nil
+  end
+  
+  it "does not raise an error when the response code is 202" do
+    @server.should_receive(:site).and_respond("202 Command not implemented, superfluous at this site.")
+    lambda { @ftp.site("param") }.should_not raise_error
+  end
+
+  it "raises a Net::FTPPermError when the response code is 500" do
+    @server.should_receive(:site).and_respond("500 Syntax error, command unrecognized.")
+    lambda { @ftp.site("param") }.should raise_error(Net::FTPPermError)
+  end
+
+  it "raises a Net::FTPPermError when the response code is 501" do
+    @server.should_receive(:site).and_respond("501 Syntax error in parameters or arguments.")
+    lambda { @ftp.site("param") }.should raise_error(Net::FTPPermError)
+  end
+
+  it "raises a Net::FTPTempError when the response code is 421" do
+    @server.should_receive(:site).and_respond("421 Service not available, closing control connection.")
+    lambda { @ftp.site("param") }.should raise_error(Net::FTPTempError)
+  end
+
+  it "raises a Net::FTPPermError when the response code is 530" do
+    @server.should_receive(:site).and_respond("530 Requested action not taken.")
+    lambda { @ftp.site("param") }.should raise_error(Net::FTPPermError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,48 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#size" do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+  
+  it "sends the SIZE command to the server" do
+    @ftp.size("test.file")
+    @ftp.last_response.should == "213 1024\n"
+  end
+  
+  it "returns the size of the passed file as Integer" do
+    @ftp.size("test.file").should eql(1024)
+  end
+
+  it "raises a Net::FTPPermError when the response code is 500" do
+    @server.should_receive(:size).and_respond("500 Syntax error, command unrecognized.")
+    lambda { @ftp.size("test.file") }.should raise_error(Net::FTPPermError)
+  end
+
+  it "raises a Net::FTPPermError when the response code is 501" do
+    @server.should_receive(:size).and_respond("501 Syntax error in parameters or arguments.")
+    lambda { @ftp.size("test.file") }.should raise_error(Net::FTPPermError)
+  end
+
+  it "raises a Net::FTPTempError when the response code is 421" do
+    @server.should_receive(:size).and_respond("421 Service not available, closing control connection.")
+    lambda { @ftp.size("test.file") }.should raise_error(Net::FTPTempError)
+  end
+
+  it "raises a Net::FTPPermError when the response code is 550" do
+    @server.should_receive(:size).and_respond("550 Requested action not taken.")
+    lambda { @ftp.size("test.file") }.should raise_error(Net::FTPPermError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/status_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/status_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/status_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,63 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#status" do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+
+  it "sends the STAT command to the server" do
+    @ftp.status
+    @ftp.last_response.should == "211 System status, or system help reply. (STAT)\n"
+  end
+  
+  it "returns the received information" do
+    @ftp.status.should == "211 System status, or system help reply. (STAT)\n"
+  end
+
+  it "does not raise an error when the response code is 212" do
+    @server.should_receive(:stat).and_respond("212 Directory status.")
+    lambda { @ftp.status }.should_not raise_error
+  end
+  
+  it "does not raise an error when the response code is 213" do
+    @server.should_receive(:stat).and_respond("213 File status.")
+    lambda { @ftp.status }.should_not raise_error
+  end
+
+  it "raises a Net::FTPPermError when the response code is 500" do
+    @server.should_receive(:stat).and_respond("500 Syntax error, command unrecognized.")
+    lambda { @ftp.status }.should raise_error(Net::FTPPermError)
+  end
+
+  it "raises a Net::FTPPermError when the response code is 501" do
+    @server.should_receive(:stat).and_respond("501 Syntax error in parameters or arguments.")
+    lambda { @ftp.status }.should raise_error(Net::FTPPermError)
+  end
+
+  it "raises a Net::FTPPermError when the response code is 502" do
+    @server.should_receive(:stat).and_respond("502 Command not implemented.")
+    lambda { @ftp.status }.should raise_error(Net::FTPPermError)
+  end
+
+  it "raises a Net::FTPTempError when the response code is 421" do
+    @server.should_receive(:stat).and_respond("421 Service not available, closing control connection.")
+    lambda { @ftp.status }.should raise_error(Net::FTPTempError)
+  end
+  
+  it "raises a Net::FTPPermError when the response code is 530" do
+    @server.should_receive(:stat).and_respond("530 Requested action not taken.")
+    lambda { @ftp.status }.should raise_error(Net::FTPPermError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/storbinary_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/storbinary_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/storbinary_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,45 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#storbinary" do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @local_fixture_file  = File.dirname(__FILE__) + "/fixtures/putbinaryfile"
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+  
+  it "sends the passed command and the passed File object's content to the server" do
+    File.open(@local_fixture_file) do |f|
+      f.binmode
+      
+      @ftp.storbinary("STOR binary", f, 4096) {}
+      @ftp.last_response.should == "200 OK, Data received. (STOR binary)\n"
+    end
+  end
+
+  it "yields the transmitted content as binary blocks of the passed size" do
+    File.open(@local_fixture_file) do |f|
+      f.binmode
+
+      res = []
+      @ftp.storbinary("STOR binary", f, 10) { |x| res << x }
+      res.should == [
+        "This is an", " example f",
+        "ile\nwhich ", "is going t",
+        "o be trans", "mitted\nusi",
+        "ng #putbin", "aryfile."
+      ]
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/storlines_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/storlines_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/storlines_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,40 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#storlines" do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @local_fixture_file  = File.dirname(__FILE__) + "/fixtures/puttextfile"
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+  
+  it "sends the passed command and the passed File object's content to the server" do
+    File.open(@local_fixture_file) do |f|
+      @ftp.storlines("STOR text", f) {}
+      @ftp.last_response.should == "200 OK, Data received. (STOR text)\n"
+    end
+  end
+
+  it "yields each line of the transmitted content" do
+    File.open(@local_fixture_file) do |f|
+      res = []
+      @ftp.storlines("STOR text", f) { |x| res << x }
+      res.should == [
+        "This is an example file\r\n",
+        "which is going to be transmitted\r\n",
+        "using #puttextfile.\r\n"
+      ]
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/system_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/system_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/system_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,48 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#system" do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+
+  it "sends the SYST command to the server" do
+    @ftp.system
+    @ftp.last_response.should == "215 FTP Dummy Server (SYST)\n"
+  end
+  
+  it "returns the received information" do
+    @ftp.system.should == "FTP Dummy Server (SYST)\n"
+  end
+
+  it "raises a Net::FTPPermError when the response code is 500" do
+    @server.should_receive(:syst).and_respond("500 Syntax error, command unrecognized.")
+    lambda { @ftp.system }.should raise_error(Net::FTPPermError)
+  end
+
+  it "raises a Net::FTPPermError when the response code is 501" do
+    @server.should_receive(:syst).and_respond("501 Syntax error in parameters or arguments.")
+    lambda { @ftp.system }.should raise_error(Net::FTPPermError)
+  end
+
+  it "raises a Net::FTPPermError when the response code is 502" do
+    @server.should_receive(:syst).and_respond("502 Command not implemented.")
+    lambda { @ftp.system }.should raise_error(Net::FTPPermError)
+  end
+
+  it "raises a Net::FTPTempError when the response code is 421" do
+    @server.should_receive(:syst).and_respond("421 Service not available, closing control connection.")
+    lambda { @ftp.system }.should raise_error(Net::FTPTempError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/voidcmd_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/voidcmd_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/voidcmd_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,54 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#voidcmd" do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+  
+  it "sends the passed command to the server" do
+    @server.should_receive(:help).and_respond("2xx Does not raise.")
+    lambda { @ftp.voidcmd("HELP") }.should_not raise_error
+  end
+  
+  it "returns nil" do
+    @server.should_receive(:help).and_respond("2xx Does not raise.")
+    @ftp.voidcmd("HELP").should be_nil
+  end
+
+  it "raises a Net::FTPReplyError when the response code is 1xx" do
+    @server.should_receive(:help).and_respond("1xx Does raise a Net::FTPReplyError.")
+    lambda { @ftp.voidcmd("HELP")  }.should raise_error(Net::FTPReplyError)
+  end
+
+  it "raises a Net::FTPReplyError when the response code is 3xx" do
+    @server.should_receive(:help).and_respond("3xx Does raise a Net::FTPReplyError.")
+    lambda { @ftp.voidcmd("HELP") }.should raise_error(Net::FTPReplyError)
+  end
+
+  it "raises a Net::FTPTempError when the response code is 4xx" do
+    @server.should_receive(:help).and_respond("4xx Does raise a Net::FTPTempError.")
+    lambda { @ftp.voidcmd("HELP") }.should raise_error(Net::FTPTempError)
+  end
+
+  it "raises a Net::FTPPermError when the response code is 5xx" do
+    @server.should_receive(:help).and_respond("5xx Does raise a Net::FTPPermError.")
+    lambda { @ftp.voidcmd("HELP") }.should raise_error(Net::FTPPermError)
+  end
+
+  it "raises a Net::FTPProtoError when the response code is not valid" do
+    @server.should_receive(:help).and_respond("999 Does raise a Net::FTPProtoError.")
+    lambda { @ftp.voidcmd("HELP") }.should raise_error(Net::FTPProtoError)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/ftp/welcome_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/ftp/welcome_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/ftp/welcome_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/ftp'
+require File.dirname(__FILE__) + "/fixtures/server"
+
+describe "Net::FTP#welcome" do
+  before(:each) do
+    @server = NetFTPSpecs::DummyFTP.new
+    @server.serve_once
+
+    @ftp = Net::FTP.new
+    @ftp.connect("localhost", 9921)
+  end
+
+  after(:each) do
+    @ftp.quit rescue nil
+    @ftp.close
+    @server.stop
+  end
+  
+  it "returns the server's welcome message" do
+    @ftp.welcome.should be_nil
+    @ftp.login
+    @ftp.welcome.should == "230 User logged in, proceed. (USER anonymous)\n"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/HTTPBadResponse_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/HTTPBadResponse_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/HTTPBadResponse_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPBadResponse" do
+  it "is a subclass of StandardError" do
+    Net::HTTPBadResponse.should < StandardError
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/HTTPError_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/HTTPError_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/HTTPError_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPError" do
+  it "is a subclass of Net::ProtocolError" do
+    Net::HTTPError.should < Net::ProtocolError
+  end
+  
+  it "includes the Net::HTTPExceptions module" do
+    Net::HTTPError.should < Net::HTTPExceptions
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/HTTPFatalError_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/HTTPFatalError_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/HTTPFatalError_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPFatalError" do
+  it "is a subclass of Net::ProtoFatalError" do
+    Net::HTTPFatalError.should < Net::ProtoFatalError
+  end
+  
+  it "includes the Net::HTTPExceptions module" do
+    Net::HTTPFatalError.should < Net::HTTPExceptions
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/HTTPHeaderSyntaxError_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/HTTPHeaderSyntaxError_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/HTTPHeaderSyntaxError_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPHeaderSyntaxError" do
+  it "is a subclass of StandardError" do
+    Net::HTTPHeaderSyntaxError.should < StandardError
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/HTTPRetriableError_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/HTTPRetriableError_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/HTTPRetriableError_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPRetriableError" do
+  it "is a subclass of Net::ProtoRetriableError" do
+    Net::HTTPRetriableError.should < Net::ProtoRetriableError
+  end
+  
+  it "includes the Net::HTTPExceptions module" do
+    Net::HTTPRetriableError.should < Net::HTTPExceptions
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/HTTPServerException_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/HTTPServerException_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/HTTPServerException_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPServerException" do
+  it "is a subclass of Net::ProtoServerError" do
+    Net::HTTPServerException.should < Net::ProtoServerError
+  end
+  
+  it "includes the Net::HTTPExceptions module" do
+    Net::HTTPServerException.should < Net::HTTPExceptions
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/Proxy_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/Proxy_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/Proxy_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTP.Proxy" do
+  it "returns a new subclass of Net::HTTP" do
+    Net::HTTP.Proxy("localhost").should < Net::HTTP
+  end
+  
+  it "returns Net::HTTP when the passed address is nil" do
+    Net::HTTP.Proxy(nil).should == Net::HTTP
+  end
+  
+  it "sets the returned subclasses' proxy options based on the passed arguments" do
+    http_with_proxy = Net::HTTP.Proxy("localhost", 1234, "rspec", "rocks")
+    http_with_proxy.proxy_address.should == "localhost"
+    http_with_proxy.proxy_port.should eql(1234)
+    http_with_proxy.proxy_user.should == "rspec"
+    http_with_proxy.proxy_pass.should == "rocks"
+  end
+end
+
+describe "Net::HTTP#proxy?" do
+  describe "when self is no proxy class instance" do
+    it "returns false" do
+      Net::HTTP.new("localhost", 3333).proxy?.should be_false
+    end
+  end
+
+  describe "when self is a proxy class instance" do
+    it "returns false" do
+      http_with_proxy = Net::HTTP.Proxy("localhost", 1234, "rspec", "rocks")
+      http_with_proxy.new("localhost", 3333).proxy?.should be_true
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/active_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/active_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/active_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + '/fixtures/http_server'
+require File.dirname(__FILE__) + '/shared/started'
+
+describe "Net::HTTP#active?" do
+  it_behaves_like :net_http_started_p, :active?
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/address_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/address_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/address_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTP#address" do
+  it "returns the current host name" do
+    net = Net::HTTP.new("localhost")
+    net.address.should == "localhost"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/close_on_empty_response_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/close_on_empty_response_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/close_on_empty_response_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTP#close_on_empty_response" do
+  it "needs to be reviewed for spec completeness"
+end
+
+describe "Net::HTTP#close_on_empty_response=" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/copy_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/copy_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/copy_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + '/fixtures/http_server'
+
+describe "Net::HTTP#copy" do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+  
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+  
+  before(:each) do
+    @http = Net::HTTP.start("localhost", 3333)
+  end
+  
+  it "sends a COPY request to the passed path and returns the response" do
+    response = @http.copy("/request")
+    response.should be_kind_of(Net::HTTPResponse)
+    response.body.should == "Request type: COPY"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/default_port_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/default_port_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/default_port_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTP.default_port" do
+  it "returns 80" do
+    Net::HTTP.http_default_port.should eql(80)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/delete_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/delete_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/delete_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + '/fixtures/http_server'
+
+describe "Net::HTTP#delete" do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+  
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+  
+  before(:each) do
+    @http = Net::HTTP.start("localhost", 3333)
+  end
+  
+  it "sends a DELETE request to the passed path and returns the response" do
+    response = @http.delete("/request")
+    response.should be_kind_of(Net::HTTPResponse)
+    response.body.should == "Request type: DELETE"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/finish_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/finish_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/finish_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + '/fixtures/http_server'
+
+describe "Net::HTTP#finish" do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+  
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+
+  before(:each) do
+    @http = Net::HTTP.new("localhost", 3333)
+  end
+
+  describe "when self has been started" do
+    it "closes the tcp connection" do
+      @http.start
+      @http.finish
+      @http.started?.should be_false
+    end
+  end
+
+  describe "when self has not been started yet" do
+    it "raises an IOError" do
+      lambda { @http.finish }.should raise_error(IOError)
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/fixtures/http_server.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/fixtures/http_server.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/fixtures/http_server.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,80 @@
+require 'webrick'
+require 'webrick/httpservlet/abstract'
+
+module NetHTTPSpecs
+ class NullWriter
+    def <<(s) end
+    def puts(*args) end
+    def print(*args) end
+    def printf(*args) end
+  end
+  
+  class RequestServlet < WEBrick::HTTPServlet::AbstractServlet
+    def do_GET(req, res)
+      res.content_type = "text/plain"
+      res.body = "Request type: #{req.request_method}"
+    end
+    
+    %w{ do_HEAD do_POST do_PUT do_PROPPATCH do_LOCK do_UNLOCK
+        do_OPTIONS do_PROPFIND do_DELETE do_MOVE do_COPY
+        do_MKCOL do_TRACE }.each do |method|
+      alias_method method.to_sym, :do_GET
+    end
+  end
+
+  class RequestBodyServlet < WEBrick::HTTPServlet::AbstractServlet
+    def do_GET(req, res)
+      res.content_type = "text/plain"
+      res.body = req.body
+    end
+    
+    %w{ do_HEAD do_POST do_PUT do_PROPPATCH do_LOCK do_UNLOCK
+        do_OPTIONS do_PROPFIND do_DELETE do_MOVE do_COPY
+        do_MKCOL do_TRACE }.each do |method|
+      alias_method method.to_sym, :do_GET
+    end
+  end
+
+  class RequestHeaderServlet < WEBrick::HTTPServlet::AbstractServlet
+    def do_GET(req, res)
+      res.content_type = "text/plain"
+      res.body = req.header.inspect
+    end
+    
+    %w{ do_HEAD do_POST do_PUT do_PROPPATCH do_LOCK do_UNLOCK
+        do_OPTIONS do_PROPFIND do_DELETE do_MOVE do_COPY
+        do_MKCOL do_TRACE }.each do |method|
+      alias_method method.to_sym, :do_GET
+    end
+  end
+  
+  class << self
+    def start_server
+      server_config = {
+        :BindAddress => "0.0.0.0",
+        :Port => 3333,
+        :Logger => WEBrick::Log.new(NullWriter.new),
+        :AccessLog => [],
+        :ShutdownSocketWithoutClose => true,
+        :ServerType => Thread }
+      
+      @server = WEBrick::HTTPServer.new(server_config)
+
+      @server.mount_proc('/') do |req, res|
+        res.content_type = "text/plain"
+        res.body = "This is the index page."
+      end
+      @server.mount('/request', RequestServlet)
+      @server.mount("/request/body", RequestBodyServlet)
+      @server.mount("/request/header", RequestHeaderServlet)
+      
+      @server.start
+      Thread.pass until @server.status == :Running
+    end
+    
+    def stop_server
+      @server.shutdown
+      Thread.pass until @server.status == :Stop
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/get2_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/get2_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/get2_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/http_server"
+require File.dirname(__FILE__) + "/shared/request_get"
+
+describe "Net::HTTP#get2" do
+  it_behaves_like :net_ftp_request_get, :get2
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/get_print_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/get_print_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/get_print_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + '/fixtures/http_server'
+
+describe "Net::HTTP.get_print" do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+  
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+
+  describe "when passed URI" do
+    it "it prints the body of the specified uri to $stdout" do
+      lambda do
+        Net::HTTP.get_print URI.parse('http://localhost:3333/')
+      end.should output(/This is the index page\./)
+    end
+  end
+
+  describe "when passed host, path, port" do
+    it "it prints the body of the specified uri to $stdout" do
+      lambda do
+        Net::HTTP.get_print 'localhost', "/", 3333
+      end.should output(/This is the index page\./)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/get_response_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/get_response_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/get_response_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + '/fixtures/http_server'
+
+describe "Net::HTTP.get_response" do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+  
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+  
+  describe "when passed URI" do
+    it "returns the response for the specified uri" do
+      res = Net::HTTP.get_response(URI.parse('http://localhost:3333/'))
+      res.content_type.should == "text/plain"
+      res.body.should == "This is the index page."
+    end
+  end
+  
+  describe "when passed host, path, port" do
+    it "returns the response for the specified host-path-combination" do
+      res = Net::HTTP.get_response('localhost', "/", 3333)
+      res.content_type.should == "text/plain"
+      res.body.should == "This is the index page."
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/get_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/get_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/get_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,50 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + '/fixtures/http_server'
+
+describe "Net::HTTP.get when passed URI" do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+  
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+  
+  describe "when passed URI" do
+    it "returns the body of the specified uri" do
+      Net::HTTP.get(URI.parse('http://localhost:3333/')).should == "This is the index page."
+    end
+  end
+  
+  describe "when passed host, path, port" do
+    it "returns the body of the specified host-path-combination" do
+      Net::HTTP.get('localhost', "/", 3333).should == "This is the index page."
+    end
+  end
+
+  describe "when passed path in version 1.1 mode" do
+    before(:each) do
+      Net::HTTP.version_1_1
+      @http = Net::HTTP.start("localhost", 3333)
+    end
+
+    after(:each) do
+      Net::HTTP.version_1_2
+    end
+
+    it "returns the response and the body for the passed path" do
+      response, body = @http.get("/")
+      response.should be_kind_of(Net::HTTPResponse)
+
+      body.should == "This is the index page."
+      response.body.should == "This is the index page."
+    end
+
+    it "yields each read part of the body to the passed block when passed a block" do
+      buf = ""
+      @http.get("/") { |s| buf << s }
+      buf.should == "This is the index page."
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/head2_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/head2_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/head2_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/http_server"
+require File.dirname(__FILE__) + "/shared/request_head"
+
+describe "Net::HTTP#head2" do
+  it_behaves_like :net_ftp_request_head, :head2
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/head_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/head_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/head_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + '/fixtures/http_server'
+
+describe "Net::HTTP#head" do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+  
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+  
+  before(:each) do
+    @http = Net::HTTP.start("localhost", 3333)
+  end
+  
+  it "sends a HEAD request to the passed path and returns the response" do
+    response = @http.head("/request")
+    # HEAD requests have no responses
+    response.body.should be_nil
+  end
+
+  it "returns a Net::HTTPResponse" do
+    @http.head("/request").should be_kind_of(Net::HTTPResponse)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/http_default_port_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/http_default_port_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/http_default_port_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTP.http_default_port" do
+  it "returns 80" do
+    Net::HTTP.http_default_port.should eql(80)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/https_default_port_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/https_default_port_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/https_default_port_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTP.https_default_port" do
+  it "returns 443" do
+    Net::HTTP.https_default_port.should eql(443)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,46 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTP#initialize" do
+  it "is private" do
+    Net::HTTP.should have_private_instance_method(:initialize)
+  end
+  
+  describe "when passed address" do
+    before(:each) do
+      @net = Net::HTTP.allocate
+      @net.send(:initialize, "localhost")
+    end
+
+    it "sets the new Net::HTTP instance's address to the passed address" do
+      @net.address.should == "localhost"
+    end
+
+    it "sets the new Net::HTTP instance's port to the default HTTP port" do
+      @net.port.should eql(Net::HTTP.default_port)
+    end
+
+    it "does not start the new Net::HTTP instance" do
+      @net.started?.should be_false
+    end
+  end
+  
+  describe "when passed address, port" do
+    before(:each) do
+      @net = Net::HTTP.allocate
+      @net.send(:initialize, "localhost", 3333)
+    end
+
+    it "sets the new Net::HTTP instance's address to the passed address" do
+      @net.address.should == "localhost"
+    end
+
+    it "sets the new Net::HTTP instance's port to the passed port" do
+      @net.port.should eql(3333)
+    end
+
+    it "does not start the new Net::HTTP instance" do
+      @net.started?.should be_false
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + '/fixtures/http_server'
+
+describe "Net::HTTP#inspect" do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+  
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+
+  before(:each) do
+    @net = Net::HTTP.new("localhost", 3333)
+  end
+  
+  it "returns a String representation of self" do
+    net = Net::HTTP.new("localhost", 3333)
+    net.inspect.should be_kind_of(String)
+    net.inspect.should == "#<Net::HTTP localhost:3333 open=false>"
+    
+    net.start
+    net.inspect.should == "#<Net::HTTP localhost:3333 open=true>"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/is_version_1_1_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/is_version_1_1_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/is_version_1_1_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + '/shared/version_1_1'
+
+describe "Net::HTTP.is_version_1_1?" do
+  it_behaves_like :net_http_version_1_1_p, :is_version_1_1?
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/is_version_1_2_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/is_version_1_2_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/is_version_1_2_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + '/shared/version_1_2'
+
+describe "Net::HTTP.is_version_1_2?" do
+  it_behaves_like :net_http_version_1_2_p, :is_version_1_2?
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/lock_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/lock_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/lock_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + '/fixtures/http_server'
+
+describe "Net::HTTP#lock" do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+  
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+  
+  before(:each) do
+    @http = Net::HTTP.start("localhost", 3333)
+  end
+  
+  it "sends a LOCK request to the passed path and returns the response" do
+    response = @http.lock("/request", "test=test")
+    response.should be_kind_of(Net::HTTPResponse)
+    response.body.should == "Request type: LOCK"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/mkcol_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/mkcol_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/mkcol_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + '/fixtures/http_server'
+
+describe "Net::HTTP#mkcol" do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+  
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+  
+  before(:each) do
+    @http = Net::HTTP.start("localhost", 3333)
+  end
+  
+  it "sends a MKCOL request to the passed path and returns the response" do
+    response = @http.mkcol("/request")
+    response.should be_kind_of(Net::HTTPResponse)
+    response.body.should == "Request type: MKCOL"
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/move_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/move_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/move_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + '/fixtures/http_server'
+
+describe "Net::HTTP#head" do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+  
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+  
+  before(:each) do
+    @http = Net::HTTP.start("localhost", 3333)
+  end
+  
+  it "sends a MOVE request to the passed path and returns the response" do
+    response = @http.move("/request")
+    # HEAD requests have no responses
+    response.body.should == "Request type: MOVE"
+  end
+
+  it "returns a Net::HTTPResponse" do
+    @http.move("/request").should be_kind_of(Net::HTTPResponse)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,86 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTP.new" do
+  describe "when passed address" do
+    before(:each) do
+      @http = Net::HTTP.new("localhost")
+    end
+    
+    it "returns a Net::HTTP instance" do
+      @http.proxy?.should be_false
+      @http.instance_of?(Net::HTTP).should be_true
+    end
+
+    it "sets the new Net::HTTP instance's address to the passed address" do
+      @http.address.should == "localhost"
+    end
+
+    it "sets the new Net::HTTP instance's port to the default HTTP port" do
+      @http.port.should eql(Net::HTTP.default_port)
+    end
+
+    it "does not start the new Net::HTTP instance" do
+      @http.started?.should be_false
+    end
+  end
+  
+  describe "when passed address, port" do
+    before(:each) do
+      @http = Net::HTTP.new("localhost", 3333)
+    end
+    
+    it "returns a Net::HTTP instance" do
+      @http.proxy?.should be_false
+      @http.instance_of?(Net::HTTP).should be_true
+    end
+
+    it "sets the new Net::HTTP instance's address to the passed address" do
+      @http.address.should == "localhost"
+    end
+
+    it "sets the new Net::HTTP instance's port to the passed port" do
+      @http.port.should eql(3333)
+    end
+
+    it "does not start the new Net::HTTP instance" do
+      @http.started?.should be_false
+    end
+  end
+  
+  describe "when passed address, port, *proxy_options" do
+    it "returns a Net::HTTP instance" do
+      http = Net::HTTP.new("localhost", 3333, "localhost")
+      http.proxy?.should be_true
+      http.instance_of?(Net::HTTP).should be_false
+      http.should be_kind_of(Net::HTTP)
+    end
+    
+    it "correctly sets the passed Proxy options" do
+      http = Net::HTTP.new("localhost", 3333, "localhost")
+      http.proxy_address.should == "localhost"
+      http.proxy_port.should eql(80)
+      http.proxy_user.should be_nil
+      http.proxy_pass.should be_nil
+
+      http = Net::HTTP.new("localhost", 3333, "localhost", 1234)
+      http.proxy_address.should == "localhost"
+      http.proxy_port.should eql(1234)
+      http.proxy_user.should be_nil
+      http.proxy_pass.should be_nil
+      
+      http = Net::HTTP.new("localhost", 3333, "localhost", 1234, "rubyspec")
+      http.proxy_address.should == "localhost"
+      http.proxy_port.should eql(1234)
+      http.proxy_user.should == "rubyspec"
+      http.proxy_pass.should be_nil
+      
+      http = Net::HTTP.new("localhost", 3333, "localhost", 1234, "rubyspec", "rocks")
+      http.proxy_address.should == "localhost"
+      http.proxy_port.should eql(1234)
+      http.proxy_user.should == "rubyspec"
+      http.proxy_pass.should == "rocks"
+    end
+  end
+  
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/newobj_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/newobj_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/newobj_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,48 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTP.newobj" do
+  before(:each) do
+    @net = Net::HTTP.newobj("localhost")
+  end
+  
+  describe "when passed address" do
+    it "returns a new Net::HTTP instance" do
+      @net.should be_kind_of(Net::HTTP)
+    end
+
+    it "sets the new Net::HTTP instance's address to the passed address" do
+      @net.address.should == "localhost"
+    end
+
+    it "sets the new Net::HTTP instance's port to the default HTTP port" do
+      @net.port.should eql(Net::HTTP.default_port)
+    end
+
+    it "does not start the new Net::HTTP instance" do
+      @net.started?.should be_false
+    end
+  end
+
+  describe "when passed address, port" do
+    before(:each) do
+      @net = Net::HTTP.newobj("localhost", 3333)
+    end
+
+    it "returns a new Net::HTTP instance" do
+      @net.should be_kind_of(Net::HTTP)
+    end
+
+    it "sets the new Net::HTTP instance's address to the passed address" do
+      @net.address.should == "localhost"
+    end
+
+    it "sets the new Net::HTTP instance's port to the passed port" do
+      @net.port.should eql(3333)
+    end
+
+    it "does not start the new Net::HTTP instance" do
+      @net.started?.should be_false
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/open_timeout_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/open_timeout_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/open_timeout_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTP#open_timeout" do
+  it "returns the seconds to wait till the connection is open" do
+    net = Net::HTTP.new("localhost")
+    net.open_timeout.should be_nil
+    net.open_timeout = 10
+    net.open_timeout.should eql(10)
+  end
+end
+
+describe "Net::HTTP#open_timeout=" do
+  it "sets the seconds to wait till the connection is open" do
+    net = Net::HTTP.new("localhost")
+    net.open_timeout = 10
+    net.open_timeout.should eql(10)
+  end
+  
+  it "returns the newly set value" do
+    net = Net::HTTP.new("localhost")
+    (net.open_timeout = 10).should eql(10)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/options_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/options_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/options_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/http_server"
+
+describe "Net::HTTP#options" do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+  
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+  
+  before(:each) do
+    @http = Net::HTTP.start("localhost", 3333)
+  end
+  
+  it "sends an options request to the passed path and returns the response" do
+    response = @http.options("/request")
+    # OPTIONS responses have no bodies
+    response.body.should be_nil
+  end
+  
+  it "returns a Net::HTTPResponse" do
+    @http.options("/request").should be_kind_of(Net::HTTPResponse)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/port_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/port_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/port_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTP#port" do
+  it "returns the current port number" do
+    net = Net::HTTP.new("localhost", 3333)
+    net.port.should eql(3333)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/post2_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/post2_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/post2_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/shared/request_post"
+
+describe "Net::HTTP#post2" do
+  it_behaves_like :net_ftp_request_post, :post2
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/post_form_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/post_form_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/post_form_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + '/fixtures/http_server'
+
+describe "Net::HTTP.post_form when passed URI" do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+  
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+  
+  it "POSTs the passed form data to the given uri" do
+    uri = URI.parse('http://localhost:3333/request/body')
+    data = { :test => :data }
+    
+    res = Net::HTTP.post_form(uri, data)
+    res.body.should == "test=data"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/post_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/post_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/post_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,40 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/http_server"
+
+describe "Net::HTTP#post" do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+  
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+  
+  before(:each) do
+    @http = Net::HTTP.start("localhost", 3333)
+  end
+  
+  it "sends an post request to the passed path and returns the response" do
+    response = @http.post("/request", "test=test")
+    response.body.should == "Request type: POST"
+  end
+  
+  it "returns a Net::HTTPResponse" do
+    @http.post("/request", "test=test").should be_kind_of(Net::HTTPResponse)
+  end
+  
+  describe "when passed a block" do
+    it "yields fragments of the response body to the passed block" do
+      str = ""
+      @http.post("/request", "test=test") do |res|
+        str << res
+      end
+      str.should == "Request type: POST"
+    end
+    
+    it "returns a Net::HTTPResponse" do
+      @http.post("/request", "test=test") {}.should be_kind_of(Net::HTTPResponse)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/propfind_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/propfind_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/propfind_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/http_server"
+
+describe "Net::HTTP#propfind" do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+  
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+  
+  before(:each) do
+    @http = Net::HTTP.start("localhost", 3333)
+  end
+  
+  it "sends an propfind request to the passed path and returns the response" do
+    response = @http.propfind("/request", "test=test")
+    response.body.should == "Request type: PROPFIND"
+  end
+  
+  it "returns a Net::HTTPResponse" do
+    @http.propfind("/request", "test=test").should be_kind_of(Net::HTTPResponse)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/proppatch_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/proppatch_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/proppatch_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/http_server"
+
+describe "Net::HTTP#proppatch" do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+  
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+  
+  before(:each) do
+    @http = Net::HTTP.start("localhost", 3333)
+  end
+  
+  it "sends an proppatch request to the passed path and returns the response" do
+    response = @http.proppatch("/request", "test=test")
+    response.body.should == "Request type: PROPPATCH"
+  end
+  
+  it "returns a Net::HTTPResponse" do
+    @http.proppatch("/request", "test=test").should be_kind_of(Net::HTTPResponse)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/proxy_address_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/proxy_address_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/proxy_address_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTP.proxy_address" do
+  describe "when self is no proxy class" do
+    it "returns nil" do
+      Net::HTTP.proxy_address.should be_nil
+    end
+  end
+
+  describe "when self is a proxy class" do
+    it "returns the address for self's proxy connection" do
+      Net::HTTP.Proxy("localhost", 1234, "rspec", "rocks").proxy_address.should == "localhost"
+    end
+  end
+end
+
+describe "Net::HTTP#proxy_address" do
+  describe "when self is no proxy class instance" do
+    it "returns nil" do
+      Net::HTTP.new("localhost", 3333).proxy_address.should be_nil
+    end
+  end
+
+  describe "when self is a proxy class instance" do
+    it "returns the password for self's proxy connection" do
+      http_with_proxy = Net::HTTP.Proxy("localhost", 1234, "rspec", "rocks")
+      http_with_proxy.new("localhost", 3333).proxy_address.should == "localhost"
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/proxy_class_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/proxy_class_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/proxy_class_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTP.proxy_class?" do
+  it "returns true if sels is a class created with Net::HTTP.Proxy" do
+    Net::HTTP.proxy_class?.should be_false
+    Net::HTTP.Proxy("localhost").proxy_class?.should be_true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/proxy_pass_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/proxy_pass_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/proxy_pass_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,39 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTP.proxy_pass" do
+  describe "when self is no proxy class" do
+    it "returns nil" do
+      Net::HTTP.proxy_pass.should be_nil
+    end
+  end
+
+  describe "when self is a proxy class" do
+    it "returns nil if no password was set for self's proxy connection" do
+      Net::HTTP.Proxy("localhost").proxy_pass.should be_nil      
+    end
+    
+    it "returns the password for self's proxy connection" do
+      Net::HTTP.Proxy("localhost", 1234, "rspec", "rocks").proxy_pass.should == "rocks"
+    end
+  end
+end
+
+describe "Net::HTTP#proxy_pass" do
+  describe "when self is no proxy class instance" do
+    it "returns nil" do
+      Net::HTTP.new("localhost", 3333).proxy_pass.should be_nil
+    end
+  end
+
+  describe "when self is a proxy class instance" do
+    it "returns nil if no password was set for self's proxy connection" do
+      Net::HTTP.Proxy("localhost").new("localhost", 3333).proxy_pass.should be_nil      
+    end
+    
+    it "returns the password for self's proxy connection" do
+      http_with_proxy = Net::HTTP.Proxy("localhost", 1234, "rspec", "rocks")
+      http_with_proxy.new("localhost", 3333).proxy_pass.should == "rocks"
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/proxy_port_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/proxy_port_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/proxy_port_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,39 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTP.proxy_port" do
+  describe "when self is no proxy class" do
+    it "returns nil" do
+      Net::HTTP.proxy_port.should be_nil
+    end
+  end
+
+  describe "when self is a proxy class" do
+    it "returns 80 if no port was set for self's proxy connection" do
+      Net::HTTP.Proxy("localhost").proxy_port.should eql(80)    
+    end
+    
+    it "returns the port for self's proxy connection" do
+      Net::HTTP.Proxy("localhost", 1234, "rspec", "rocks").proxy_port.should eql(1234)
+    end
+  end
+end
+
+describe "Net::HTTP#proxy_port" do
+  describe "when self is no proxy class instance" do
+    it "returns nil" do
+      Net::HTTP.new("localhost", 3333).proxy_port.should be_nil
+    end
+  end
+
+  describe "when self is a proxy class instance" do
+    it "returns 80 if no port was set for self's proxy connection" do
+      Net::HTTP.Proxy("localhost").new("localhost", 3333).proxy_port.should eql(80)     
+    end
+    
+    it "returns the port for self's proxy connection" do
+      http_with_proxy = Net::HTTP.Proxy("localhost", 1234, "rspec", "rocks")
+      http_with_proxy.new("localhost", 3333).proxy_port.should eql(1234)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/proxy_user_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/proxy_user_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/proxy_user_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,39 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTP.proxy_user" do
+  describe "when self is no proxy class" do
+    it "returns nil" do
+      Net::HTTP.proxy_user.should be_nil
+    end
+  end
+
+  describe "when self is a proxy class" do
+    it "returns nil if no username was set for self's proxy connection" do
+      Net::HTTP.Proxy("localhost").proxy_user.should be_nil      
+    end
+    
+    it "returns the username for self's proxy connection" do
+      Net::HTTP.Proxy("localhost", 1234, "rspec", "rocks").proxy_user.should == "rspec"
+    end
+  end
+end
+
+describe "Net::HTTP#proxy_user" do
+  describe "when self is no proxy class instance" do
+    it "returns nil" do
+      Net::HTTP.new("localhost", 3333).proxy_user.should be_nil
+    end
+  end
+
+  describe "when self is a proxy class instance" do
+    it "returns nil if no username was set for self's proxy connection" do
+      Net::HTTP.Proxy("localhost").new("localhost", 3333).proxy_user.should be_nil      
+    end
+    
+    it "returns the username for self's proxy connection" do
+      http_with_proxy = Net::HTTP.Proxy("localhost", 1234, "rspec", "rocks")
+      http_with_proxy.new("localhost", 3333).proxy_user.should == "rspec"
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/put2_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/put2_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/put2_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/shared/request_put"
+
+describe "Net::HTTP#put2" do
+  it_behaves_like :net_ftp_request_put, :put2
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/put_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/put_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/put_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/http_server"
+
+describe "Net::HTTP#put" do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+  
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+  
+  before(:each) do
+    @http = Net::HTTP.start("localhost", 3333)
+  end
+  
+  it "sends an put request to the passed path and returns the response" do
+    response = @http.put("/request", "test=test")
+    response.body.should == "Request type: PUT"
+  end
+  
+  it "returns a Net::HTTPResponse" do
+    @http.put("/request", "test=test").should be_kind_of(Net::HTTPResponse)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/read_timeout_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/read_timeout_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/read_timeout_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTP#read_timeout" do
+  it "returns the seconds to wait until reading one block" do
+    net = Net::HTTP.new("localhost")
+    net.read_timeout.should eql(60)
+    net.read_timeout = 10
+    net.read_timeout.should eql(10)
+  end
+end
+
+describe "Net::HTTP#read_timeout=" do
+  it "sets the seconds to wait till the connection is open" do
+    net = Net::HTTP.new("localhost")
+    net.read_timeout = 10
+    net.read_timeout.should eql(10)
+  end
+  
+  it "returns the newly set value" do
+    net = Net::HTTP.new("localhost")
+    (net.read_timeout = 10).should eql(10)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/request_get_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/request_get_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/request_get_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/http_server"
+require File.dirname(__FILE__) + "/shared/request_get"
+
+describe "Net::HTTP#request_get" do
+  it_behaves_like :net_ftp_request_get, :get2
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/request_head_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/request_head_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/request_head_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/http_server"
+require File.dirname(__FILE__) + "/shared/request_head"
+
+describe "Net::HTTP#request_head" do
+  it_behaves_like :net_ftp_request_head, :request_head
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/request_post_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/request_post_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/request_post_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/http_server"
+require File.dirname(__FILE__) + "/shared/request_post"
+
+describe "Net::HTTP#request_post" do
+  it_behaves_like :net_ftp_request_post, :request_post
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/request_put_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/request_put_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/request_put_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/http_server"
+require File.dirname(__FILE__) + "/shared/request_put"
+
+describe "Net::HTTP#request_put" do
+  it_behaves_like :net_ftp_request_put, :request_put
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/request_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/request_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/request_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,111 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/http_server"
+
+describe "Net::HTTP#request" do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+  
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+  
+  before(:each) do
+    @http = Net::HTTP.start("localhost", 3333)
+  end
+  
+  describe "when passed request_object" do
+    it "makes a HTTP Request based on the passed request_object" do
+      response = @http.request(Net::HTTP::Get.new("/request"), "test=test")
+      response.body.should == "Request type: GET"
+
+      response = @http.request(Net::HTTP::Head.new("/request"), "test=test")
+      response.body.should be_nil
+
+      response = @http.request(Net::HTTP::Post.new("/request"), "test=test")
+      response.body.should == "Request type: POST"
+
+      response = @http.request(Net::HTTP::Put.new("/request"), "test=test")
+      response.body.should == "Request type: PUT"
+
+      response = @http.request(Net::HTTP::Proppatch.new("/request"), "test=test")
+      response.body.should == "Request type: PROPPATCH"
+
+      response = @http.request(Net::HTTP::Lock.new("/request"), "test=test")
+      response.body.should == "Request type: LOCK"
+
+      response = @http.request(Net::HTTP::Unlock.new("/request"), "test=test")
+      response.body.should == "Request type: UNLOCK"
+
+      # TODO: Does not work?
+      #response = @http.request(Net::HTTP::Options.new("/request"), "test=test")
+      #response.body.should be_nil
+
+      response = @http.request(Net::HTTP::Propfind.new("/request"), "test=test")
+      response.body.should == "Request type: PROPFIND"
+
+      response = @http.request(Net::HTTP::Delete.new("/request"), "test=test")
+      response.body.should == "Request type: DELETE"
+
+      response = @http.request(Net::HTTP::Move.new("/request"), "test=test")
+      response.body.should == "Request type: MOVE"
+
+      response = @http.request(Net::HTTP::Copy.new("/request"), "test=test")
+      response.body.should == "Request type: COPY"
+
+      response = @http.request(Net::HTTP::Mkcol.new("/request"), "test=test")
+      response.body.should == "Request type: MKCOL"
+
+      response = @http.request(Net::HTTP::Trace.new("/request"), "test=test")
+      response.body.should == "Request type: TRACE"
+    end
+  end
+  
+  describe "when passed request_object and request_body" do
+    it "sends the passed request_body when making the HTTP Request" do
+      response = @http.request(Net::HTTP::Get.new("/request/body"), "test=test")
+      response.body.should == "test=test"
+
+      response = @http.request(Net::HTTP::Head.new("/request/body"), "test=test")
+      response.body.should be_nil
+
+      response = @http.request(Net::HTTP::Post.new("/request/body"), "test=test")
+      response.body.should == "test=test"
+
+      response = @http.request(Net::HTTP::Put.new("/request/body"), "test=test")
+      response.body.should == "test=test"
+
+      response = @http.request(Net::HTTP::Proppatch.new("/request/body"), "test=test")
+      response.body.should == "test=test"
+
+      response = @http.request(Net::HTTP::Lock.new("/request/body"), "test=test")
+      response.body.should == "test=test"
+
+      response = @http.request(Net::HTTP::Unlock.new("/request/body"), "test=test")
+      response.body.should == "test=test"
+
+      # TODO: Does not work?
+      #response = @http.request(Net::HTTP::Options.new("/request/body"), "test=test")
+      #response.body.should be_nil
+
+      response = @http.request(Net::HTTP::Propfind.new("/request/body"), "test=test")
+      response.body.should == "test=test"
+
+      response = @http.request(Net::HTTP::Delete.new("/request/body"), "test=test")
+      response.body.should == "test=test"
+
+      response = @http.request(Net::HTTP::Move.new("/request/body"), "test=test")
+      response.body.should == "test=test"
+
+      response = @http.request(Net::HTTP::Copy.new("/request/body"), "test=test")
+      response.body.should == "test=test"
+
+      response = @http.request(Net::HTTP::Mkcol.new("/request/body"), "test=test")
+      response.body.should == "test=test"
+
+      response = @http.request(Net::HTTP::Trace.new("/request/body"), "test=test")
+      response.body.should == "test=test"
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/request_types_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/request_types_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/request_types_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,254 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTP::Get" do
+  it "is a subclass of Net::HTTPRequest" do
+    Net::HTTP::Get.should < Net::HTTPRequest
+  end
+  
+  it "represents the 'GET'-Request-Method" do
+    Net::HTTP::Get::METHOD.should == "GET"
+  end
+  
+  it "has no Request Body" do
+    Net::HTTP::Get::REQUEST_HAS_BODY.should be_false
+  end
+  
+  it "has a Respone Body" do
+    Net::HTTP::Get::RESPONSE_HAS_BODY.should be_true
+  end
+end
+
+describe "Net::HTTP::Head" do
+  it "is a subclass of Net::HTTPRequest" do
+    Net::HTTP::Head.should < Net::HTTPRequest
+  end
+  
+  it "represents the 'HEAD'-Request-Method" do
+    Net::HTTP::Head::METHOD.should == "HEAD"
+  end
+  
+  it "has no Request Body" do
+    Net::HTTP::Head::REQUEST_HAS_BODY.should be_false
+  end
+  
+  it "has no Respone Body" do
+    Net::HTTP::Head::RESPONSE_HAS_BODY.should be_false
+  end
+end
+
+describe "Net::HTTP::Post" do
+  it "is a subclass of Net::HTTPRequest" do
+    Net::HTTP::Post.should < Net::HTTPRequest
+  end
+  
+  it "represents the 'POST'-Request-Method" do
+    Net::HTTP::Post::METHOD.should == "POST"
+  end
+  
+  it "has a Request Body" do
+    Net::HTTP::Post::REQUEST_HAS_BODY.should be_true
+  end
+  
+  it "has a Respone Body" do
+    Net::HTTP::Post::RESPONSE_HAS_BODY.should be_true
+  end
+end
+
+describe "Net::HTTP::Put" do
+  it "is a subclass of Net::HTTPRequest" do
+    Net::HTTP::Put.should < Net::HTTPRequest
+  end
+  
+  it "represents the 'PUT'-Request-Method" do
+    Net::HTTP::Put::METHOD.should == "PUT"
+  end
+  
+  it "has a Request Body" do
+    Net::HTTP::Put::REQUEST_HAS_BODY.should be_true
+  end
+  
+  it "has a Respone Body" do
+    Net::HTTP::Put::RESPONSE_HAS_BODY.should be_true
+  end
+end
+
+describe "Net::HTTP::Delete" do
+  it "is a subclass of Net::HTTPRequest" do
+    Net::HTTP::Delete.should < Net::HTTPRequest
+  end
+  
+  it "represents the 'DELETE'-Request-Method" do
+    Net::HTTP::Delete::METHOD.should == "DELETE"
+  end
+  
+  it "has no Request Body" do
+    Net::HTTP::Delete::REQUEST_HAS_BODY.should be_false
+  end
+  
+  it "has a Respone Body" do
+    Net::HTTP::Delete::RESPONSE_HAS_BODY.should be_true
+  end
+end
+
+describe "Net::HTTP::Options" do
+  it "is a subclass of Net::HTTPRequest" do
+    Net::HTTP::Options.should < Net::HTTPRequest
+  end
+  
+  it "represents the 'OPTIONS'-Request-Method" do
+    Net::HTTP::Options::METHOD.should == "OPTIONS"
+  end
+  
+  it "has no Request Body" do
+    Net::HTTP::Options::REQUEST_HAS_BODY.should be_false
+  end
+  
+  it "has no Respone Body" do
+    Net::HTTP::Options::RESPONSE_HAS_BODY.should be_false
+  end
+end
+
+describe "Net::HTTP::Trace" do
+  it "is a subclass of Net::HTTPRequest" do
+    Net::HTTP::Trace.should < Net::HTTPRequest
+  end
+  
+  it "represents the 'TRACE'-Request-Method" do
+    Net::HTTP::Trace::METHOD.should == "TRACE"
+  end
+  
+  it "has no Request Body" do
+    Net::HTTP::Trace::REQUEST_HAS_BODY.should be_false
+  end
+  
+  it "has a Respone Body" do
+    Net::HTTP::Trace::RESPONSE_HAS_BODY.should be_true
+  end
+end
+
+describe "Net::HTTP::Propfind" do
+  it "is a subclass of Net::HTTPRequest" do
+    Net::HTTP::Propfind.should < Net::HTTPRequest
+  end
+  
+  it "represents the 'PROPFIND'-Request-Method" do
+    Net::HTTP::Propfind::METHOD.should == "PROPFIND"
+  end
+  
+  it "has a Request Body" do
+    Net::HTTP::Propfind::REQUEST_HAS_BODY.should be_true
+  end
+  
+  it "has a Respone Body" do
+    Net::HTTP::Propfind::RESPONSE_HAS_BODY.should be_true
+  end
+end
+
+describe "Net::HTTP::Proppatch" do
+  it "is a subclass of Net::HTTPRequest" do
+    Net::HTTP::Proppatch.should < Net::HTTPRequest
+  end
+  
+  it "represents the 'PROPPATCH'-Request-Method" do
+    Net::HTTP::Proppatch::METHOD.should == "PROPPATCH"
+  end
+  
+  it "has a Request Body" do
+    Net::HTTP::Proppatch::REQUEST_HAS_BODY.should be_true
+  end
+  
+  it "has a Respone Body" do
+    Net::HTTP::Proppatch::RESPONSE_HAS_BODY.should be_true
+  end
+end
+
+describe "Net::HTTP::Mkcol" do
+  it "is a subclass of Net::HTTPRequest" do
+    Net::HTTP::Mkcol.should < Net::HTTPRequest
+  end
+  
+  it "represents the 'MKCOL'-Request-Method" do
+    Net::HTTP::Mkcol::METHOD.should == "MKCOL"
+  end
+  
+  it "has a Request Body" do
+    Net::HTTP::Mkcol::REQUEST_HAS_BODY.should be_true
+  end
+  
+  it "has a Respone Body" do
+    Net::HTTP::Mkcol::RESPONSE_HAS_BODY.should be_true
+  end
+end
+
+describe "Net::HTTP::Copy" do
+  it "is a subclass of Net::HTTPRequest" do
+    Net::HTTP::Copy.should < Net::HTTPRequest
+  end
+  
+  it "represents the 'COPY'-Request-Method" do
+    Net::HTTP::Copy::METHOD.should == "COPY"
+  end
+  
+  it "has no Request Body" do
+    Net::HTTP::Copy::REQUEST_HAS_BODY.should be_false
+  end
+  
+  it "has a Respone Body" do
+    Net::HTTP::Copy::RESPONSE_HAS_BODY.should be_true
+  end
+end
+
+describe "Net::HTTP::Move" do
+  it "is a subclass of Net::HTTPRequest" do
+    Net::HTTP::Move.should < Net::HTTPRequest
+  end
+  
+  it "represents the 'MOVE'-Request-Method" do
+    Net::HTTP::Move::METHOD.should == "MOVE"
+  end
+  
+  it "has no Request Body" do
+    Net::HTTP::Move::REQUEST_HAS_BODY.should be_false
+  end
+  
+  it "has a Respone Body" do
+    Net::HTTP::Move::RESPONSE_HAS_BODY.should be_true
+  end
+end
+
+describe "Net::HTTP::Lock" do
+  it "is a subclass of Net::HTTPRequest" do
+    Net::HTTP::Lock.should < Net::HTTPRequest
+  end
+  
+  it "represents the 'LOCK'-Request-Method" do
+    Net::HTTP::Lock::METHOD.should == "LOCK"
+  end
+  
+  it "has a Request Body" do
+    Net::HTTP::Lock::REQUEST_HAS_BODY.should be_true
+  end
+  
+  it "has a Respone Body" do
+    Net::HTTP::Lock::RESPONSE_HAS_BODY.should be_true
+  end
+end
+
+describe "Net::HTTP::Unlock" do
+  it "is a subclass of Net::HTTPRequest" do
+    Net::HTTP::Unlock.should < Net::HTTPRequest
+  end
+  
+  it "represents the 'UNLOCK'-Request-Method" do
+    Net::HTTP::Unlock::METHOD.should == "UNLOCK"
+  end
+  
+  it "has a Request Body" do
+    Net::HTTP::Unlock::REQUEST_HAS_BODY.should be_true
+  end
+  
+  it "has a Respone Body" do
+    Net::HTTP::Unlock::RESPONSE_HAS_BODY.should be_true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/send_request_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/send_request_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/send_request_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,120 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/http_server"
+
+describe "Net::HTTP#send_request" do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+  
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+  
+  before(:each) do
+    @http = Net::HTTP.start("localhost", 3333)
+  end
+  
+  # TODO: Does only work with GET and POST requests
+  describe "when passed type, path" do
+    it "sends a HTTP Request of the passed type to the passed path" do
+      response = @http.send_request("GET", "/request")
+      response.body.should == "Request type: GET"
+
+      # response = @http.send_request("HEAD", "/request")
+      # response.body.should be_nil
+      
+      response = @http.send_request("POST", "/request")
+      response.body.should == "Request type: POST"
+
+      # response = @http.send_request("PUT", "/request")
+      # response.body.should == "Request type: PUT"
+
+      # response = @http.send_request("DELETE", "/request")
+      # response.body.should == "Request type: DELETE"
+
+      # response = @http.send_request("PROPGET", "/request")
+      # response.body.should == "Request type: DELETE"
+
+      # response = @http.send_request("PROPSET", "/request")
+      # response.body.should == "Request type: DELETE"
+
+      # response = @http.send_request("OPTIONS", "/request")
+      # response.body.should be_nil
+
+      # response = @http.send_request("LOCK", "/request")
+      # response.body.should == "Request type: LOCK
+
+      # response = @http.send_request("UNLOCK", "/request")
+      # response.body.should == "Request type: UNLOCK
+    end
+  end
+
+  describe "when passed type, path, body" do
+    it "sends a HTTP Request with the passed body" do
+      response = @http.send_request("GET", "/request/body", "test=test")
+      response.body.should == "test=test"
+
+      # response = @http.send_request("HEAD", "/request/body", "test=test")
+      # response.body.should be_nil
+      
+      response = @http.send_request("POST", "/request/body", "test=test")
+      response.body.should == "test=test"
+
+      # response = @http.send_request("PUT", "/request/body", "test=test")
+      # response.body.should == "test=test"
+
+      # response = @http.send_request("DELETE", "/request/body", "test=test")
+      # response.body.should == "test=test"
+
+      # response = @http.send_request("PROPGET", "/request/body", "test=test")
+      # response.body.should == "test=test"
+
+      # response = @http.send_request("PROPSET", "/request/body", "test=test")
+      # response.body.should == "test=test"
+
+      # response = @http.send_request("OPTIONS", "/request/body", "test=test")
+      # response.body.should be_nil
+
+      # response = @http.send_request("LOCK", "/request/body", "test=test")
+      # response.body.should == "test=test"
+
+      # response = @http.send_request("UNLOCK", "/request/body", "test=test")
+      # response.body.should == "test=test"
+    end
+  end
+
+  describe "when passed type, path, body, headers" do
+    it "sends a HTTP Request with the passed headers" do
+      response = @http.send_request("GET", "/request/header", "test=test", "referer" => "http://www.rubyspec.org")
+      response.body.should include('"referer"=>["http://www.rubyspec.org"]')
+
+      # response = @http.send_request("HEAD", "/request/header", "test=test", "referer" => "http://www.rubyspec.org")
+      # response.body.should be_nil
+      
+      response = @http.send_request("POST", "/request/header", "test=test", "referer" => "http://www.rubyspec.org")
+      response.body.should include('"referer"=>["http://www.rubyspec.org"]')
+
+      # response = @http.send_request("PUT", "/request/header", "test=test", "referer" => "http://www.rubyspec.org")
+      # response.body.should include('"referer"=>["http://www.rubyspec.org"]')
+
+      # response = @http.send_request("DELETE", "/request/header", "test=test", "referer" => "http://www.rubyspec.org")
+      # response.body.should include('"referer"=>["http://www.rubyspec.org"]')
+
+      # response = @http.send_request("PROPGET", "/request/header", "test=test", "referer" => "http://www.rubyspec.org")
+      # response.body.should include('"referer"=>["http://www.rubyspec.org"]')
+
+      # response = @http.send_request("PROPSET", "/request/header", "test=test", "referer" => "http://www.rubyspec.org")
+      # response.body.should include('"referer"=>["http://www.rubyspec.org"]')
+
+      # response = @http.send_request("OPTIONS", "/request/body", "test=test", "referer" => "http://www.rubyspec.org")
+      # response.body.should be_nil
+
+      # response = @http.send_request("LOCK", "/request/header", "test=test", "referer" => "http://www.rubyspec.org")
+      # response.body.should include('"referer"=>["http://www.rubyspec.org"]')
+
+      # response = @http.send_request("UNLOCK", "/request/header", "test=test", "referer" => "http://www.rubyspec.org")
+      # response.body.should include('"referer"=>["http://www.rubyspec.org"]')
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/set_debug_output_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/set_debug_output_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/set_debug_output_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require "stringio"
+require File.dirname(__FILE__) + '/fixtures/http_server'
+
+describe "Net::HTTP#set_debug_output when passed io" do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+  
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+
+  before(:each) do
+    @http = Net::HTTP.new("localhost", 3333)
+  end
+  
+  it "sets the passed io as output stream for debugging" do
+    io = StringIO.new
+    
+    @http.set_debug_output(io)
+    @http.start
+    io.string.should_not be_empty
+    size = io.string.size
+    
+    @http.get("/")
+    io.string.size.should > size
+  end
+  
+  it "outputs a warning when the connection has already been started" do
+    @http.start
+    lambda { @http.set_debug_output(StringIO.new) }.should complain("Net::HTTP#set_debug_output called after HTTP started\n")
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/request_get.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/request_get.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/request_get.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,45 @@
+describe :net_ftp_request_get, :shared => true do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+  
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+  
+  before(:each) do
+    @http = Net::HTTP.start("localhost", 3333)
+  end
+  
+  describe "when passed no block" do
+    it "sends a GET request to the passed path and returns the response" do
+      response = @http.send(@method, "/request")
+      response.body.should == "Request type: GET"
+    end
+    
+    it "returns a Net::HTTPResponse object" do
+      response = @http.send(@method, "/request")
+      response.should be_kind_of(Net::HTTPResponse)
+    end
+  end
+  
+  describe "when passed a block" do
+    it "sends a GET request to the passed path and returns the response" do
+      response = @http.send(@method, "/request") {}
+      response.body.should == "Request type: GET"
+    end
+    
+    it "yields the response to the passed block" do
+      yielded = false
+      @http.send(@method, "/request") do |response|
+        response.body.should == "Request type: GET"
+      end
+      yielded = true
+    end
+    
+    it "returns a Net::HTTPResponse object" do
+      response = @http.send(@method, "/request") {}
+      response.should be_kind_of(Net::HTTPResponse)
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/request_head.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/request_head.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/request_head.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,45 @@
+describe :net_ftp_request_head, :shared => true do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+  
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+  
+  before(:each) do
+    @http = Net::HTTP.start("localhost", 3333)
+  end
+  
+  describe "when passed no block" do
+    it "sends a head request to the passed path and returns the response" do
+      response = @http.send(@method, "/request")
+      response.body.should be_nil
+    end
+    
+    it "returns a Net::HTTPResponse object" do
+      response = @http.send(@method, "/request")
+      response.should be_kind_of(Net::HTTPResponse)
+    end
+  end
+  
+  describe "when passed a block" do
+    it "sends a head request to the passed path and returns the response" do
+      response = @http.send(@method, "/request") {}
+      response.body.should be_nil
+    end
+    
+    it "yields the response to the passed block" do
+      yielded = false
+      @http.send(@method, "/request") do |response|
+        response.body.should be_nil
+      end
+      yielded = true
+    end
+    
+    it "returns a Net::HTTPResponse object" do
+      response = @http.send(@method, "/request") {}
+      response.should be_kind_of(Net::HTTPResponse)
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/request_post.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/request_post.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/request_post.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,45 @@
+describe :net_ftp_request_post, :shared => true do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+  
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+  
+  before(:each) do
+    @http = Net::HTTP.start("localhost", 3333)
+  end
+  
+  describe "when passed no block" do
+    it "sends a post request to the passed path and returns the response" do
+      response = @http.send(@method, "/request", "test=test")
+      response.body.should == "Request type: POST"
+    end
+    
+    it "returns a Net::HTTPResponse object" do
+      response = @http.send(@method, "/request", "test=test")
+      response.should be_kind_of(Net::HTTPResponse)
+    end
+  end
+  
+  describe "when passed a block" do
+    it "sends a post request to the passed path and returns the response" do
+      response = @http.send(@method, "/request", "test=test") {}
+      response.body.should == "Request type: POST"
+    end
+    
+    it "yields the response to the passed block" do
+      yielded = false
+      @http.send(@method, "/request", "test=test") do |response|
+        response.body.should == "Request type: POST"
+      end
+      yielded = true
+    end
+    
+    it "returns a Net::HTTPResponse object" do
+      response = @http.send(@method, "/request", "test=test") {}
+      response.should be_kind_of(Net::HTTPResponse)
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/request_put.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/request_put.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/request_put.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,45 @@
+describe :net_ftp_request_put, :shared => true do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+  
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+  
+  before(:each) do
+    @http = Net::HTTP.start("localhost", 3333)
+  end
+  
+  describe "when passed no block" do
+    it "sends a put request to the passed path and returns the response" do
+      response = @http.send(@method, "/request", "test=test")
+      response.body.should == "Request type: PUT"
+    end
+    
+    it "returns a Net::HTTPResponse object" do
+      response = @http.send(@method, "/request", "test=test")
+      response.should be_kind_of(Net::HTTPResponse)
+    end
+  end
+  
+  describe "when passed a block" do
+    it "sends a put request to the passed path and returns the response" do
+      response = @http.send(@method, "/request", "test=test") {}
+      response.body.should == "Request type: PUT"
+    end
+    
+    it "yields the response to the passed block" do
+      yielded = false
+      @http.send(@method, "/request", "test=test") do |response|
+        response.body.should == "Request type: PUT"
+      end
+      yielded = true
+    end
+    
+    it "returns a Net::HTTPResponse object" do
+      response = @http.send(@method, "/request", "test=test") {}
+      response.should be_kind_of(Net::HTTPResponse)
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/started.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/started.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/started.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+describe :net_http_started_p, :shared => true do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+
+  before(:each) do
+    @net = Net::HTTP.new("localhost", 3333)
+  end
+
+  it "returns true when self has been started" do
+    @net.start
+    @net.send(@method).should be_true
+  end
+
+  it "returns false when self has not been started yet" do
+    @net.send(@method).should be_false
+  end
+
+  it "returns false when self has been stopped again" do
+    @net.start
+    @net.finish
+    @net.send(@method).should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/version_1_1.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/version_1_1.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/version_1_1.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+describe :net_http_version_1_1_p, :shared => true do
+  it "returns the state of net/http 1.1 features" do
+    Net::HTTP.version_1_2
+    Net::HTTP.send(@method).should be_false
+    Net::HTTP.version_1_1
+    Net::HTTP.send(@method).should be_true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/version_1_2.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/version_1_2.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/shared/version_1_2.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+describe :net_http_version_1_2_p, :shared => true do
+  it "returns the state of net/http 1.2 features" do
+    Net::HTTP.version_1_1
+    Net::HTTP.send(@method).should be_false
+    Net::HTTP.version_1_2
+    Net::HTTP.send(@method).should be_true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/socket_type_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/socket_type_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/socket_type_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTP.socket_type" do
+  it "returns BufferedIO" do
+    Net::HTTP.socket_type.should == Net::BufferedIO
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/start_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/start_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/start_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,103 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + '/fixtures/http_server'
+
+describe "Net::HTTP.start" do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+  
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+
+  it "returns a new Net::HTTP object for the passed address and port" do
+    net = Net::HTTP.start("localhost", 3333)
+    net.should be_kind_of(Net::HTTP)
+    net.address.should == "localhost"
+    net.port.should == 3333
+  end
+  
+  it "opens the tcp connection" do
+    Net::HTTP.start("localhost", 3333).started?.should be_true
+  end
+  
+  describe "when passed a block" do
+    it "returns the blocks return value" do
+      Net::HTTP.start("localhost", 3333) { :test }.should == :test
+    end
+
+    it "yields the new Net::HTTP object to the block" do
+      yielded = false
+      Net::HTTP.start("localhost", 3333) do |net|
+        yielded = true
+        net.should be_kind_of(Net::HTTP)
+      end
+      yielded.should be_true
+    end
+
+    it "opens the tcp connection before yielding" do
+      Net::HTTP.start("localhost", 3333) { |http| http.started?.should be_true }
+    end
+
+    it "closes the tcp connection after yielding" do
+      net = nil
+      Net::HTTP.start("localhost", 3333) { |x| net = x }
+      net.started?.should be_false
+    end
+  end
+end
+
+describe "Net::HTTP#start" do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+
+  before(:each) do
+    @http = Net::HTTP.new("localhost", 3333)
+  end
+
+  it "returns self" do
+    @http.start.should equal(@http)
+  end
+
+  it "opens the tcp connection" do
+    @http.start
+    @http.started?.should be_true
+  end
+  
+  describe "when self has already been started" do
+    it "raises an IOError" do
+      @http.start
+      lambda { @http.start }.should raise_error(IOError)
+    end
+  end
+
+  describe "when passed a block" do
+    it "returns the blocks return value" do
+      @http.start { :test }.should == :test
+    end
+
+    it "yields the new Net::HTTP object to the block" do
+      yielded = false
+      @http.start do |http|
+        yielded = true
+        http.should equal(@http)
+      end
+      yielded.should be_true
+    end
+
+    it "opens the tcp connection before yielding" do
+      @http.start { |http| http.started?.should be_true }
+    end
+
+    it "closes the tcp connection after yielding" do
+      @http.start { }
+      @http.started?.should be_false
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/started_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/started_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/started_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + '/fixtures/http_server'
+require File.dirname(__FILE__) + '/shared/started'
+
+describe "Net::HTTP#started?" do
+  it_behaves_like :net_http_started_p, :started?
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/trace_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/trace_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/trace_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + '/fixtures/http_server'
+
+describe "Net::HTTP#trace" do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+  
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+  
+  before(:each) do
+    @http = Net::HTTP.start("localhost", 3333)
+  end
+  
+  it "sends a TRACE request to the passed path and returns the response" do
+    response = @http.trace("/request")
+    response.body.should == "Request type: TRACE"
+  end
+  
+  it "returns a Net::HTTPResponse" do
+    @http.trace("/request").should be_kind_of(Net::HTTPResponse)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/unlock_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/unlock_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/unlock_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/http_server"
+
+describe "Net::HTTP#unlock" do
+  before(:all) do
+    NetHTTPSpecs.start_server
+  end
+  
+  after(:all) do
+    NetHTTPSpecs.stop_server
+  end
+  
+  before(:each) do
+    @http = Net::HTTP.start("localhost", 3333)
+  end
+  
+  it "sends an UNLOCK request to the passed path and returns the response" do
+    response = @http.unlock("/request", "test=test")
+    response.body.should == "Request type: UNLOCK"
+  end
+  
+  it "returns a Net::HTTPResponse" do
+    @http.unlock("/request", "test=test").should be_kind_of(Net::HTTPResponse)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/use_ssl_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/use_ssl_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/use_ssl_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTP#use_ssl?" do
+  it "returns false" do
+    http = Net::HTTP.new("localhost")
+    http.use_ssl?.should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/version_1_1_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/version_1_1_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/version_1_1_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + '/shared/version_1_1'
+
+describe "Net::HTTP.version_1_1" do
+  it "turns on net/http 1.1 features" do
+    Net::HTTP.version_1_1
+    
+    Net::HTTP.version_1_1?.should be_true
+    Net::HTTP.version_1_2?.should be_false
+  end
+  
+  it "returns false" do
+    Net::HTTP.version_1_1.should be_false
+  end
+end
+
+describe "Net::HTTP.version_1_1?" do
+  it_behaves_like :net_http_version_1_1_p, :version_1_1?
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/http/version_1_2_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/http/version_1_2_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/http/version_1_2_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + '/shared/version_1_2'
+
+describe "Net::HTTP.version_1_2" do
+  it "turns on net/http 1.2 features" do
+    Net::HTTP.version_1_2
+    
+    Net::HTTP.version_1_2?.should be_true
+    Net::HTTP.version_1_1?.should be_false
+  end
+  
+  it "returns true" do
+    Net::HTTP.version_1_2.should be_true
+  end
+end
+
+describe "Net::HTTP.version_1_2?" do
+  it_behaves_like :net_http_version_1_2_p, :version_1_2?
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpexceptions/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpexceptions/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpexceptions/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+module NetHTTPExceptionsSpecs
+  class Simple < StandardError
+    include Net::HTTPExceptions
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpexceptions/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpexceptions/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpexceptions/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Net::HTTPExceptions#initialize when passed message, response" do
+  before(:each) do
+    @exception = NetHTTPExceptionsSpecs::Simple.new("error message", "a http response")
+  end
+  
+  it "calls super with the passed message" do
+    @exception.message.should == "error message"
+  end
+  
+  it "sets self's response to the passed response" do
+    @exception.response.should == "a http response"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpexceptions/response_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpexceptions/response_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpexceptions/response_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Net::HTTPExceptions#response" do
+  it "returns self's response" do
+    exception = NetHTTPExceptionsSpecs::Simple.new("error message", "a http response")
+    exception.response.should == "a http response"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/body_exist_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/body_exist_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/body_exist_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPGenericRequest#body_exist?" do
+  it "returns true when the response is expected to have a body" do
+    request = Net::HTTPGenericRequest.new("POST", true, true, "/some/path")
+    request.body_exist?.should be_true
+
+    request = Net::HTTPGenericRequest.new("POST", true, false, "/some/path")
+    request.body_exist?.should be_false
+  end
+
+  # TODO: Doesn't work?!
+  #
+  # describe "when $VERBOSE is true" do
+  #   it "emits a warning" do
+  #     old_verbose, $VERBOSE = $VERBOSE, true
+  #     
+  #     begin
+  #       request = Net::HTTPGenericRequest.new("POST", true, false, "/some/path")
+  #       lambda { request.body_exist? }.should complain("")
+  #     ensure
+  #       $VERBOSE = old_verbose
+  #     end
+  #   end
+  # end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/body_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/body_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/body_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,30 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require "stringio"
+
+describe "Net::HTTPGenericRequest#body" do
+  it "returns self's request body" do
+    request = Net::HTTPGenericRequest.new("POST", true, true, "/some/path")
+    request.body.should be_nil
+    
+    request.body = "Some Content"
+    request.body.should == "Some Content"
+  end
+end
+
+describe "Net::HTTPGenericRequest#body=" do
+  before(:each) do
+    @request = Net::HTTPGenericRequest.new("POST", true, true, "/some/path")
+  end
+
+  it "sets self's body content to the passed String" do
+    @request.body = "Some Content"
+    @request.body.should == "Some Content"
+  end
+  
+  it "sets self's body stream to nil" do
+    @request.body_stream = StringIO.new("")
+    @request.body = "Some Content"
+    @request.body_stream.should be_nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/body_stream_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/body_stream_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/body_stream_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require "stringio"
+
+describe "Net::HTTPGenericRequest#body_stream" do
+  it "returns self's body stream Object" do
+    request = Net::HTTPGenericRequest.new("POST", true, true, "/some/path")
+    request.body_stream.should be_nil
+    
+    stream = StringIO.new("test")
+    request.body_stream = stream
+    request.body_stream.should equal(stream)
+  end
+end
+
+describe "Net::HTTPGenericRequest#body_stream=" do
+  before(:each) do
+    @request = Net::HTTPGenericRequest.new("POST", true, true, "/some/path")
+    @stream = StringIO.new("test")
+  end
+
+  it "sets self's body stream to the passed Object" do
+    @request.body_stream = @stream
+    @request.body_stream.should equal(@stream)
+  end
+  
+  it "sets self's body to nil" do
+    @request.body = "Some Content"
+    @request.body_stream = @stream
+    @request.body.should be_nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/exec_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/exec_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/exec_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,76 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require "stringio"
+
+describe "Net::HTTPGenericRequest#exec wehn passed socket, version, path" do
+  it "executes the request over the passed socket to the passed path using the passed HTTP version" do
+    request = Net::HTTPGenericRequest.new("POST", true, true, "/some/path")
+    socket = StringIO.new("")
+    
+    request.exec(socket, "1.1", "/some/path")
+    socket.string.should == "POST /some/path HTTP/1.1\r\nAccept: */*\r\n\r\n"
+
+    request = Net::HTTPGenericRequest.new("GET", true, true, "/some/path", "Content-Type" => "text/html")
+    socket = StringIO.new("")
+
+    request.exec(socket, "1.0", "/some/other/path")
+    socket.string.should == "GET /some/other/path HTTP/1.0\r\nAccept: */*\r\nContent-Type: text/html\r\n\r\n"
+  end
+  
+  describe "when a request body is set" do
+    it "sets the 'Content-Type' header to 'application/x-www-form-urlencoded' unless the 'Content-Type' header is supplied" do
+      request = Net::HTTPGenericRequest.new("POST", true, true, "/some/path")
+      request.body = "Some Content"
+      socket = StringIO.new("")
+
+      request.exec(socket, "1.1", "/some/other/path")
+      socket.string.should == "POST /some/other/path HTTP/1.1\r\nAccept: */*\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: 12\r\n\r\nSome Content"
+    end
+
+    it "correctly sets the 'Content-Length' header and includes the body" do
+      request = Net::HTTPGenericRequest.new("POST", true, true, "/some/path", "Content-Type" => "text/html")
+      request.body = "Some Content"
+      socket = StringIO.new("")
+
+      request.exec(socket, "1.1", "/some/other/path")
+      socket.string.should == "POST /some/other/path HTTP/1.1\r\nAccept: */*\r\nContent-Type: text/html\r\nContent-Length: 12\r\n\r\nSome Content"
+    end
+  end
+  
+  describe "when a body stream is set" do
+    it "sets the 'Content-Type' header to 'application/x-www-form-urlencoded' unless the 'Content-Type' header is supplied" do
+      request = Net::HTTPGenericRequest.new("POST", true, true, "/some/path", "Content-Length" => "10")
+      request.body_stream = StringIO.new("a" * 20)
+      socket = StringIO.new("")
+
+      request.exec(socket, "1.1", "/some/other/path")
+      socket.string.should == "POST /some/other/path HTTP/1.1\r\nAccept: */*\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: 10\r\n\r\naaaaaaaaaaaaaaaaaaaa"
+    end
+
+    it "sends the whole stream, regardless of the 'Content-Length' header" do
+      request = Net::HTTPGenericRequest.new("POST", true, true, "/some/path", "Content-Type" => "text/html", "Content-Length" => "10")
+      request.body_stream = StringIO.new("a" * 20)
+      socket = StringIO.new("")
+
+      request.exec(socket, "1.1", "/some/other/path")
+      socket.string.should == "POST /some/other/path HTTP/1.1\r\nAccept: */*\r\nContent-Type: text/html\r\nContent-Length: 10\r\n\r\naaaaaaaaaaaaaaaaaaaa"
+    end
+    
+    it "sends the request in chunks of 1024 bytes when 'Transfer-Encoding' is set to 'chunked'" do
+      request = Net::HTTPGenericRequest.new("POST", true, true, "/some/path", "Content-Type" => "text/html", "Transfer-Encoding" => "chunked")
+      request.body_stream = StringIO.new("a" * 1024 * 2)
+      socket = StringIO.new("")
+
+      request.exec(socket, "1.1", "/some/other/path")
+      socket.string.should == "POST /some/other/path HTTP/1.1\r\nAccept: */*\r\nContent-Type: text/html\r\nTransfer-Encoding: chunked\r\n\r\n400\r\n#{'a' * 1024}\r\n400\r\n#{'a' * 1024}\r\n0\r\n\r\n"
+    end
+
+    it "raises an ArgumentError when the 'Content-Length' is not set or 'Transfer-Encoding' is not set to 'chunked'" do
+      request = Net::HTTPGenericRequest.new("POST", true, true, "/some/path", "Content-Type" => "text/html")
+      request.body_stream = StringIO.new("Some Content")
+      socket = StringIO.new("")
+
+      lambda { request.exec(socket, "1.1", "/some/other/path") }.should raise_error(ArgumentError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPGenericRequest#inspect" do
+  it "returns a String representation of self" do
+    request = Net::HTTPGenericRequest.new("POST", true, true, "/some/path")
+    request.inspect.should == "#<Net::HTTPGenericRequest POST>"
+
+    request = Net::HTTPGenericRequest.new("GET", false, true, "/some/path")
+    request.inspect.should == "#<Net::HTTPGenericRequest GET>"
+
+    request = Net::HTTPGenericRequest.new("BLA", true, true, "/some/path")
+    request.inspect.should == "#<Net::HTTPGenericRequest BLA>"
+
+    # Subclasses
+    request = Net::HTTP::Get.new("/some/path")
+    request.inspect.should == "#<Net::HTTP::Get GET>"
+
+    request = Net::HTTP::Post.new("/some/path")
+    request.inspect.should == "#<Net::HTTP::Post POST>"
+
+    request = Net::HTTP::Trace.new("/some/path")
+    request.inspect.should == "#<Net::HTTP::Trace TRACE>"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/method_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/method_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/method_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPGenericRequest#method" do
+  it "returns self's request method" do
+    request = Net::HTTPGenericRequest.new("POST", true, true, "/some/path")
+    request.method.should == "POST"
+
+    request = Net::HTTPGenericRequest.new("GET", false, true, "/some/path")
+    request.method.should == "GET"
+
+    request = Net::HTTPGenericRequest.new("BLA", true, true, "/some/path")
+    request.method.should == "BLA"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/path_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/path_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/path_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPGenericRequest#path" do
+  it "returns self's request path" do
+    request = Net::HTTPGenericRequest.new("POST", true, true, "/some/path")
+    request.path.should == "/some/path"
+
+    request = Net::HTTPGenericRequest.new("POST", true, true, "/some/other/path")
+    request.path.should == "/some/other/path"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/request_body_permitted_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/request_body_permitted_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/request_body_permitted_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPGenericRequest#request_body_permitted?" do
+  it "returns true when the request is expected to have a body" do
+    request = Net::HTTPGenericRequest.new("POST", true, true, "/some/path")
+    request.request_body_permitted?.should be_true
+
+    request = Net::HTTPGenericRequest.new("POST", false, true, "/some/path")
+    request.request_body_permitted?.should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/response_body_permitted_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/response_body_permitted_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/response_body_permitted_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPGenericRequest#response_body_permitted?" do
+  it "returns true when the response is expected to have a body" do
+    request = Net::HTTPGenericRequest.new("POST", true, true, "/some/path")
+    request.response_body_permitted?.should be_true
+
+    request = Net::HTTPGenericRequest.new("POST", true, false, "/some/path")
+    request.response_body_permitted?.should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/set_body_internal_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/set_body_internal_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpgenericrequest/set_body_internal_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPGenericRequest#set_body_internal when passed string" do
+  before(:each) do
+    @request = Net::HTTPGenericRequest.new("POST", true, true, "/some/path")
+  end
+
+  it "sets self's body to the passed string" do
+    @request.set_body_internal("Some Content")
+    @request.body.should == "Some Content"
+  end
+  
+  it "raises an ArgumentError when the body or body_stream of self have already been set" do
+    @request.body = "Some Content"
+    lambda { @request.set_body_internal("Some other Content") }.should raise_error(ArgumentError)
+    
+    @request.body_stream = "Some Content"
+    lambda { @request.set_body_internal("Some other Content") }.should raise_error(ArgumentError)    
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/add_field_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/add_field_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/add_field_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+
+describe "Net::HTTPHeader#add_field when passed key, value" do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+  end
+
+  it "adds the passed value to the header entry with the passed key" do
+    @headers.add_field("My-Header", "a")
+    @headers.get_fields("My-Header").should == ["a"]
+
+    @headers.add_field("My-Header", "b")
+    @headers.get_fields("My-Header").should == ["a", "b"]
+
+    @headers.add_field("My-Header", "c")
+    @headers.get_fields("My-Header").should == ["a", "b", "c"]
+  end
+  
+  it "is case-insensitive" do
+    @headers.add_field("My-Header", "a")
+    @headers.get_fields("My-Header").should == ["a"]
+
+    @headers.add_field("my-header", "b")
+    @headers.get_fields("My-Header").should == ["a", "b"]
+
+    @headers.add_field("MY-HEADER", "c")
+    @headers.get_fields("My-Header").should == ["a", "b", "c"]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/basic_auth_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/basic_auth_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/basic_auth_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+
+describe "Net::HTTPHeader#basic_auth when passed account, password" do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+  end
+
+  it "sets the 'Authorization' Header entry for basic authorization" do
+    @headers.basic_auth("rubyspec", "rocks")
+    @headers["Authorization"].should == "Basic cnVieXNwZWM6cm9ja3M="
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/canonical_each_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/canonical_each_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/canonical_each_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+require File.dirname(__FILE__) + "/shared/each_capitalized"
+
+describe "Net::HTTPHeader#canonical_each" do
+  it_behaves_like :net_httpheader_each_capitalized, :canonical_each
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/chunked_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/chunked_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/chunked_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+
+describe "Net::HTTPHeader#chunked?" do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+  end
+  
+  it "returns true if the 'Transfer-Encoding' header entry is set to chunked" do
+    @headers.chunked?.should be_false
+    
+    @headers["Transfer-Encoding"] = "bla"
+    @headers.chunked?.should be_false
+    
+    @headers["Transfer-Encoding"] = "blachunkedbla"
+    @headers.chunked?.should be_false
+    
+    @headers["Transfer-Encoding"] = "chunked"
+    @headers.chunked?.should be_true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/content_length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/content_length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/content_length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,54 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+
+describe "Net::HTTPHeader#content_length" do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+  end
+
+  it "returns nil if no 'Content-Length' header entry is set" do
+    @headers.content_length.should be_nil
+  end
+
+  it "raises a Net::HTTPHeaderSyntaxError when the 'Content-Length' header entry has an invalid format" do
+    @headers["Content-Length"] = "invalid"
+    lambda { @headers.content_length }.should raise_error(Net::HTTPHeaderSyntaxError)
+  end
+  
+  it "returns the value of the 'Content-Length' header entry as an Integer" do
+    @headers["Content-Length"] = "123"
+    @headers.content_length.should eql(123)
+  
+    @headers["Content-Length"] = "123valid"
+    @headers.content_length.should eql(123)
+
+    @headers["Content-Length"] = "valid123"
+    @headers.content_length.should eql(123)
+  end
+end
+
+describe "Net::HTTPHeader#content_length=" do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+  end
+
+  it "removes the 'Content-Length' entry if passed false or nil" do
+    @headers["Content-Length"] = "123"
+    @headers.content_length = nil
+    @headers["Content-Lenght"].should be_nil
+  end
+  
+  it "sets the 'Content-Length' entry to the passed value" do
+    @headers.content_length = "123"
+    @headers["Content-Length"].should == "123"
+  
+    @headers.content_length = "123valid"
+    @headers["Content-Length"].should == "123"
+  end
+
+  it "sets the 'Content-Length' entry to 0 if the passed value is not valid" do
+    @headers.content_length = "invalid123"
+    @headers["Content-Length"].should == "0"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/content_range_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/content_range_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/content_range_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+
+describe "Net::HTTPHeader#content_range" do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+  end
+
+  it "returns a Range object that represents the 'Content-Range' header entry" do
+    @headers["Content-Range"] = "bytes 0-499/1234"
+    @headers.content_range.should == (0..500)
+    
+    @headers["Content-Range"] = "bytes 500-1233/1234"
+    @headers.content_range.should == (500..1234)
+  end
+  
+  it "returns nil when there is no 'Content-Range' header entry" do
+    @headers.content_range.should be_nil
+  end
+  
+  it "raises a Net::HTTPHeaderSyntaxError when the 'Content-Range' has an invalid format" do
+    @headers["Content-Range"] = "invalid"
+    lambda { @headers.content_range }.should raise_error(Net::HTTPHeaderSyntaxError)
+
+    @headers["Content-Range"] = "bytes 123-abc"
+    lambda { @headers.content_range }.should raise_error(Net::HTTPHeaderSyntaxError)
+
+    @headers["Content-Range"] = "bytes abc-123"
+    lambda { @headers.content_range }.should raise_error(Net::HTTPHeaderSyntaxError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/content_type_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/content_type_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/content_type_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+require File.dirname(__FILE__) + "/shared/set_content_type"
+
+describe "Net::HTTPHeader#content_type" do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+  end
+
+  it "returns the content type string, as per 'Content-Type' header entry" do
+    @headers["Content-Type"] = "text/html"
+    @headers.content_type.should == "text/html"
+    
+    @headers["Content-Type"] = "text/html;charset=utf-8"
+    @headers.content_type.should == "text/html"    
+  end
+  
+  it "returns nil if the 'Content-Type' header entry does not exist" do
+    @headers.content_type.should be_nil
+  end
+end
+
+describe "Net::HTTPHeader#content_type=" do
+  it_behaves_like :net_httpheader_set_content_type, :content_type=
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/delete_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/delete_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/delete_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,30 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+
+describe "Net::HTTPHeader#delete when passed key" do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+  end
+
+  it "removes the header entry with the passed key" do
+    @headers["My-Header"] = "test"
+    @headers.delete("My-Header")
+    
+    @headers["My-Header"].should be_nil
+    @headers.size.should eql(0)
+  end
+  
+  it "returns the removed values" do
+    @headers["My-Header"] = "test"
+    @headers.delete("My-Header").should == ["test"]
+  end
+  
+  it "is case-insensitive" do
+    @headers["My-Header"] = "test"
+    @headers.delete("my-header")
+    
+    @headers["My-Header"].should be_nil
+    @headers.size.should eql(0)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_capitalized_name_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_capitalized_name_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_capitalized_name_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,45 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+
+describe "Net::HTTPHeader#each_capitalized_name" do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+    @headers["My-Header"] = "test"
+    @headers.add_field("My-Other-Header", "a")
+    @headers.add_field("My-Other-Header", "b")
+  end
+  
+  describe "when passed a block" do
+    it "yields each header key to the passed block (keys capitalized)" do
+      res = []
+      @headers.each_capitalized_name do |key|
+        res << key
+      end
+      res.should == ["My-Header", "My-Other-Header"]
+    end
+  end
+
+  describe "when passed no block" do
+    ruby_version_is "" ... "1.8.7" do
+      it "raises a LocalJumpError" do
+        lambda { @headers.each_capitalized_name }.should raise_error(LocalJumpError)
+      end
+    end
+
+    ruby_version_is "1.8.7" do
+      ruby_bug "http://redmine.ruby-lang.org/issues/show/447", "1.8.7" do
+        it "returns an Enumerable::Enumerator" do
+          enumerator = @headers.each_capitalized_name
+          enumerator.should be_kind_of(Enumerable::Enumerator)
+      
+          res = []
+          enumerator.each do |key|
+            res << key
+          end
+          res.should == ["My-Header", "My-Other-Header"]
+        end
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_capitalized_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_capitalized_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_capitalized_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+require File.dirname(__FILE__) + "/shared/each_capitalized"
+
+describe "Net::HTTPHeader#each_capitalized" do
+  it_behaves_like :net_httpheader_each_capitalized, :each_capitalized
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_header_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_header_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_header_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+require File.dirname(__FILE__) + "/shared/each_header"
+
+describe "Net::HTTPHeader#each_header" do
+  it_behaves_like :net_httpheader_each_header, :each_header
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_key_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_key_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_key_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+require File.dirname(__FILE__) + "/shared/each_name"
+
+describe "Net::HTTPHeader#each_key" do
+  it_behaves_like :net_httpheader_each_name, :each_key
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_name_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_name_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_name_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+require File.dirname(__FILE__) + "/shared/each_name"
+
+describe "Net::HTTPHeader#each_name" do
+  it_behaves_like :net_httpheader_each_name, :each_name
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+require File.dirname(__FILE__) + "/shared/each_header"
+
+describe "Net::HTTPHeader#each" do
+  it_behaves_like :net_httpheader_each_header, :each
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/each_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,46 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+
+describe "Net::HTTPHeader#each_value" do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+    @headers["My-Header"] = "test"
+    @headers.add_field("My-Other-Header", "a")
+    @headers.add_field("My-Other-Header", "b")
+  end
+  
+  describe "when passed a block" do
+    it "yields each header entry's joined values" do
+      res = []
+      @headers.each_value do |value|
+        res << value
+      end
+      res.should == ["test", "a, b"]
+    end
+  end
+
+  describe "when passed no block" do
+    ruby_version_is "" ... "1.8.7" do
+      it "raises a LocalJumpError" do
+        lambda { @headers.each_value }.should raise_error(LocalJumpError)
+      end
+    end
+
+    # TODO: This should return an Enumerator and not raise an Error
+    ruby_version_is "1.8.7" do
+      ruby_bug "http://redmine.ruby-lang.org/issues/show/447", "1.8.7" do
+        it "returns an Enumerable::Enumerator" do
+          enumerator = @headers.each_value
+          enumerator.should be_kind_of(Enumerable::Enumerator)
+      
+          res = []
+          enumerator.each do |key|
+            res << key
+          end
+          res.should == ["test", "a, b"]
+        end
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/element_reference_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/element_reference_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/element_reference_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,39 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+
+describe "Net::HTTPHeader#[] when passed key" do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+  end
+
+  it "returns the value of the header entry with the passed key" do
+    @headers["My-Header"] = "test"
+    @headers["My-Header"].should == "test"
+    @headers["My-Other-Header"] = "another test"
+    @headers["My-Other-Header"].should == "another test"
+  end
+  
+  it "is case-insensitive" do
+    @headers["My-Header"] = "test"
+
+    @headers['My-Header'].should == "test"
+    @headers['my-Header'].should == "test"
+    @headers['My-header'].should == "test"
+    @headers['my-header'].should == "test"
+    @headers['MY-HEADER'].should == "test"
+  end
+  
+  it "returns multi-element values joined together" do
+    @headers["My-Header"] = "test"
+    @headers.add_field("My-Header", "another test")
+    @headers.add_field("My-Header", "and one more")
+    
+    @headers["My-Header"].should == "test, another test, and one more"
+  end
+  
+  it "returns nil for non-existing entries" do
+    @headers["My-Header"].should be_nil
+    @headers["My-Other-Header"].should be_nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/element_set_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/element_set_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/element_set_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,41 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+
+describe "Net::HTTPHeader#[]= when passed key, value" do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+  end
+
+  it "sets the header entry with the passed key to the passed value" do
+    @headers["My-Header"] = "test"
+    @headers["My-Header"].should == "test"
+
+    @headers["My-Header"] = "overwritten"
+    @headers["My-Header"].should == "overwritten"
+
+    @headers["My-Other-Header"] = "another test"
+    @headers["My-Other-Header"].should == "another test"
+  end
+  
+  it "is case-insensitive" do
+    @headers['My-Header'] = "test"
+    @headers['my-Header'] = "another test"
+    @headers['My-header'] = "and one more test"
+    @headers['my-header'] = "and another one"
+    @headers['MY-HEADER'] = "last one"
+    
+    @headers["My-Header"].should == "last one"
+    @headers.size.should eql(1)
+  end
+  
+  it "removes the header entry with the passed key when the value is false or nil" do
+    @headers['My-Header'] = "test"
+    @headers['My-Header'] = nil
+    @headers['My-Header'].should be_nil
+
+    @headers['My-Header'] = "test"
+    @headers['My-Header'] = false
+    @headers['My-Header'].should be_nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/fetch_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/fetch_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/fetch_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,69 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+
+describe "Net::HTTPHeader#fetch" do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+  end
+  
+  describe "when passed key" do
+    it "returns the header entry for the passed key" do
+      @headers["My-Header"] = "test"
+      @headers.fetch("My-Header").should == "test"
+
+      @headers.add_field("My-Other-Header", "a")
+      @headers.add_field("My-Other-Header", "b")
+      @headers.add_field("My-Other-Header", "c")
+      @headers.fetch("My-Other-Header").should == "a, b, c"
+    end
+    
+    it "is case-insensitive" do
+      @headers["My-Header"] = "test"
+      @headers.fetch("my-header").should == "test"
+      @headers.fetch("MY-HEADER").should == "test"
+    end
+
+    it "returns nil when there is no entry for the passed key" do
+      lambda { @headers.fetch("my-header") }.should raise_error(IndexError)
+    end
+  end
+  
+  describe "when passed key, default" do
+    it "returns the header entry for the passed key" do
+      @headers["My-Header"] = "test"
+      @headers.fetch("My-Header", "bla").should == "test"
+
+      @headers.add_field("My-Other-Header", "a")
+      @headers.add_field("My-Other-Header", "b")
+      @headers.add_field("My-Other-Header", "c")
+      @headers.fetch("My-Other-Header", "bla").should == "a, b, c"
+    end
+
+    # TODO: This raises a NoMethodError: undefined method `join' for "bla":String
+    ruby_bug "http://redmine.ruby-lang.org/issues/show/445", "1.8.7" do
+      it "returns the default value when there is no entry for the passed key" do
+        @headers.fetch("My-Header", "bla").should == "bla"
+      end
+    end
+  end
+
+  describe "when passed key and block" do
+    it "returns the header entry for the passed key" do
+      @headers["My-Header"] = "test"
+      @headers.fetch("My-Header") {}.should == "test"
+
+      @headers.add_field("My-Other-Header", "a")
+      @headers.add_field("My-Other-Header", "b")
+      @headers.add_field("My-Other-Header", "c")
+      @headers.fetch("My-Other-Header", "bla") {}.should == "a, b, c"
+    end
+    
+    # TODO: This raises a NoMethodError: undefined method `join' for "redaeh-ym":String
+    ruby_bug "http://redmine.ruby-lang.org/issues/show/445", "1.8.7" do
+      it "yieldsand returns the block's return value when there is no entry for the passed key" do
+        @headers.fetch("My-Header") { |key| key.reverse }.should == "redaeh-ym"
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+module NetHTTPHeaderSpecs
+  class Example
+    include Net::HTTPHeader
+    
+    attr_accessor :body
+    
+    def initialize
+      initialize_http_header({})
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/form_data_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/form_data_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/form_data_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+require File.dirname(__FILE__) + "/shared/set_form_data"
+
+describe "Net::HTTPHeader#form_data=" do
+  it_behaves_like :net_httpheader_set_form_data, :form_data=
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/get_fields_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/get_fields_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/get_fields_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,39 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+
+describe "Net::HTTPHeader#get_fields when passed key" do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+  end
+
+  it "returns an Array containing the values of the header entry with the passed key" do
+    @headers["My-Header"] = "a"
+    @headers.get_fields("My-Header").should == ["a"]
+
+    @headers.add_field("My-Header", "b")
+    @headers.get_fields("My-Header").should == ["a", "b"]
+  end
+  
+  it "returns a copy of the header entry values" do
+    @headers["My-Header"] = "a"
+    
+    @headers.get_fields("My-Header").clear
+    @headers.get_fields("My-Header").should == ["a"]
+
+    @headers.get_fields("My-Header") << "b"
+    @headers.get_fields("My-Header").should == ["a"]
+  end
+
+  it "returns nil for non-existing header entries" do
+    @headers.get_fields("My-Header").should be_nil
+    @headers.get_fields("My-Other-header").should be_nil
+  end
+
+  it "is case-insensitive" do
+    @headers["My-Header"] = "test"
+    @headers.get_fields("My-Header").should == ["test"]
+    @headers.get_fields("my-header").should == ["test"]
+    @headers.get_fields("MY-HEADER").should == ["test"]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/initialize_http_header_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/initialize_http_header_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/initialize_http_header_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+
+describe "Net::HTTPHeader#initialize_http_header when passed Hash" do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.allocate
+  end
+
+  it "initializes the HTTP Header using the passed Hash" do
+    @headers.initialize_http_header("My-Header" => "test", "My-Other-Header" => "another test")
+    @headers["My-Header"].should == "test"
+    @headers["My-Other-Header"].should == "another test"
+  end
+
+  # TODO: Doesn't work, but works in IRB. No idea what's up here.
+  #
+  # it "complains about duplicate keys when in verbose mode" do
+  #   old_verbose, $VERBOSE = $VERBOSE, true
+  #   
+  #   begin
+  #     lambda do
+  #       @headers.initialize_http_header("My-Header" => "test", "my-header" => "another test")
+  #     end.should complain("net/http: warning: duplicated HTTP header: My-Header\n")
+  #   ensure
+  #     $VERBOSE = old_verbose
+  #   end
+  # end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/key_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/key_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/key_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+
+describe "Net::HTTPHeader#key? when passed key" do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+  end
+
+  it "returns true if the header entry with the passed key exists" do
+    @headers.key?("My-Header").should be_false
+    @headers["My-Header"] = "test"
+    @headers.key?("My-Header").should be_true
+  end
+  
+  it "is case-insensitive" do
+    @headers["My-Header"] = "test"
+    @headers.key?("my-header").should be_true
+    @headers.key?("MY-HEADER").should be_true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+require File.dirname(__FILE__) + "/shared/size"
+
+describe "Net::HTTPHeader#length" do
+  it_behaves_like :net_httpheader_size, :length
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/main_type_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/main_type_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/main_type_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+
+describe "Net::HTTPHeader#main_type" do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+  end
+  
+  it "returns the 'main-content-type', as per 'Content-Type' header entry" do
+    @headers["Content-Type"] = "text/html"
+    @headers.main_type.should == "text"
+    
+    @headers["Content-Type"] = "application/pdf"
+    @headers.main_type.should == "application"
+    
+    @headers["Content-Type"] = "text/html;charset=utf-8"
+    @headers.main_type.should == "text"
+  end
+
+  it "returns nil if the 'Content-Type' header entry does not exist" do
+    @headers.main_type.should be_nil
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/proxy_basic_auth_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/proxy_basic_auth_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/proxy_basic_auth_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+
+describe "Net::HTTPHeader#proxy_basic_auth when passed account, password" do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+  end
+
+  it "sets the 'Proxy-Authorization' Header entry for basic authorization" do
+    @headers.proxy_basic_auth("rubyspec", "rocks")
+    @headers["Proxy-Authorization"].should == "Basic cnVieXNwZWM6cm9ja3M="
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/range_length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/range_length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/range_length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+
+describe "Net::HTTPHeader#range_length" do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+  end
+
+  it "returns the length of the Range represented by the 'Content-Range' header entry" do
+    @headers["Content-Range"] = "bytes 0-499/1234"
+    @headers.range_length.should eql(500)
+    
+    @headers["Content-Range"] = "bytes 500-1233/1234"
+    @headers.range_length.should eql(734)
+  end
+  
+  it "returns nil when there is no 'Content-Range' header entry" do
+    @headers.range_length.should be_nil
+  end
+  
+  it "raises a Net::HTTPHeaderSyntaxError when the 'Content-Range' has an invalid format" do
+    @headers["Content-Range"] = "invalid"
+    lambda { @headers.range_length }.should raise_error(Net::HTTPHeaderSyntaxError)
+
+    @headers["Content-Range"] = "bytes 123-abc"
+    lambda { @headers.range_length }.should raise_error(Net::HTTPHeaderSyntaxError)
+
+    @headers["Content-Range"] = "bytes abc-123"
+    lambda { @headers.range_length }.should raise_error(Net::HTTPHeaderSyntaxError)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/range_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/range_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/range_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,48 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+require File.dirname(__FILE__) + "/shared/set_range"
+
+describe "Net::HTTPHeader#range" do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+  end
+
+  it "returns a Range object that represents the 'Range' header entry" do
+    @headers["Range"] = "bytes=0-499"
+    @headers.range.should == [0..499]
+    
+    @headers["Range"] = "bytes=500-1233"
+    @headers.range.should == [500..1233]
+
+    @headers["Range"] = "bytes=10-"
+    @headers.range.should == [10..-1]
+
+    @headers["Range"] = "bytes=-10"
+    @headers.range.should == [-10..-1]
+  end
+  
+  it "returns nil when there is no 'Range' header entry" do
+    @headers.range.should be_nil
+  end
+  
+  it "raises a Net::HTTPHeaderSyntaxError when the 'Range' has an invalid format" do
+    @headers["Range"] = "invalid"
+    lambda { @headers.range }.should raise_error(Net::HTTPHeaderSyntaxError)
+
+    @headers["Range"] = "bytes 123-abc"
+    lambda { @headers.range }.should raise_error(Net::HTTPHeaderSyntaxError)
+
+    @headers["Range"] = "bytes abc-123"
+    lambda { @headers.range }.should raise_error(Net::HTTPHeaderSyntaxError)
+  end
+  
+  it "raises a Net::HTTPHeaderSyntaxError when the 'Range' was not specified" do
+    @headers["Range"] = "bytes=-"
+    lambda { @headers.range }.should raise_error(Net::HTTPHeaderSyntaxError)
+  end
+end
+
+describe "Net::HTTPHeader#range=" do
+  it_behaves_like :net_httpheader_set_range, :range=
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/set_content_type_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/set_content_type_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/set_content_type_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+require File.dirname(__FILE__) + "/shared/set_content_type"
+
+describe "Net::HTTPHeader#set_content_type" do
+  it_behaves_like :net_httpheader_set_content_type, :set_content_type
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/set_form_data_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/set_form_data_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/set_form_data_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+require File.dirname(__FILE__) + "/shared/set_form_data"
+
+describe "Net::HTTPHeader#set_form_data" do
+  it_behaves_like :net_httpheader_set_form_data, :set_form_data
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/set_range_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/set_range_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/set_range_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+require File.dirname(__FILE__) + "/shared/set_range"
+
+describe "Net::HTTPHeader#set_range" do
+  it_behaves_like :net_httpheader_set_range, :set_range
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/each_capitalized.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/each_capitalized.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/each_capitalized.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,42 @@
+describe :net_httpheader_each_capitalized, :shared => true do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+    @headers["my-header"] = "test"
+    @headers.add_field("my-Other-Header", "a")
+    @headers.add_field("My-Other-header", "b")
+  end
+  
+  describe "when passed a block" do
+    it "yields each header entry to the passed block (capitalized keys, values joined)" do
+      res = []
+      @headers.send(@method) do |key, value|
+        res << [key, value]
+      end
+      res.should == [["My-Header", "test"], ["My-Other-Header", "a, b"]]
+    end
+  end
+
+  describe "when passed no block" do
+    ruby_version_is "" ... "1.8.7" do
+      it "raises a LocalJumpError" do
+        lambda { @headers.send(@method) }.should raise_error(LocalJumpError)
+      end
+    end
+
+    # TODO: This should return an Enumerator and not raise an Error
+    ruby_version_is "1.8.7" do
+      ruby_bug "http://redmine.ruby-lang.org/issues/show/447", "1.8.7" do
+        it "returns an Enumerable::Enumerator" do
+          enumerator = @headers.send(@method)
+          enumerator.should be_kind_of(Enumerable::Enumerator)
+    
+          res = []
+          enumerator.each do |key|
+            res << key
+          end
+          res.should == [["My-Header", "test"], ["My-Other-Header", "a, b"]]
+        end
+      end
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/each_header.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/each_header.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/each_header.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,42 @@
+describe :net_httpheader_each_header, :shared => true do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+    @headers["My-Header"] = "test"
+    @headers.add_field("My-Other-Header", "a")
+    @headers.add_field("My-Other-Header", "b")
+  end
+  
+  describe "when passed a block" do
+    it "yields each header entry to the passed block (keys in lower case, values joined)" do
+      res = []
+      @headers.send(@method) do |key, value|
+        res << [key, value]
+      end
+      res.should == [["my-header", "test"], ["my-other-header", "a, b"]]
+    end
+  end
+
+  describe "when passed no block" do
+    ruby_version_is "" ... "1.8.7" do
+      it "raises a LocalJumpError" do
+        lambda { @headers.send(@method) }.should raise_error(LocalJumpError)
+      end
+    end
+
+    # TODO: This should return an Enumerator and not raise an Error
+    ruby_version_is "1.8.7" do
+      ruby_bug "http://redmine.ruby-lang.org/issues/show/447", "1.8.7" do
+        it "returns an Enumerable::Enumerator" do
+          enumerator = @headers.send(@method)
+          enumerator.should be_kind_of(Enumerable::Enumerator)
+      
+          res = []
+          enumerator.each do |key|
+            res << key
+          end
+          res.should == [["my-header", "test"], ["my-other-header", "a, b"]]
+        end
+      end
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/each_name.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/each_name.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/each_name.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,39 @@
+describe :net_httpheader_each_name, :shared => true do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+    @headers["My-Header"] = "test"
+    @headers.add_field("My-Other-Header", "a")
+    @headers.add_field("My-Other-Header", "b")
+  end
+  
+  describe "when passed a block" do
+    it "yields each header key to the passed block (keys in lower case)" do
+      res = []
+      @headers.send(@method) do |key|
+        res << key
+      end
+      res.should == ["my-header", "my-other-header"]
+    end
+  end
+
+  describe "when passed no block" do
+    ruby_version_is "" ... "1.8.7" do
+      it "raises a LocalJumpError" do
+        lambda { @headers.send(@method) }.should raise_error(LocalJumpError)
+      end
+    end
+
+    ruby_version_is "1.8.7" do
+      it "returns an Enumerable::Enumerator" do
+        enumerator = @headers.send(@method)
+        enumerator.should be_kind_of(Enumerable::Enumerator)
+      
+        res = []
+        enumerator.each do |key|
+          res << key
+        end
+        res.should == ["my-header", "my-other-header"]
+      end
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/set_content_type.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/set_content_type.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/set_content_type.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+describe :net_httpheader_set_content_type, :shared => true do
+  describe "when passed type, params" do
+    before(:each) do
+      @headers = NetHTTPHeaderSpecs::Example.new
+    end
+
+    it "sets the 'Content-Type' header entry based on the passed type and params" do
+      @headers.send(@method, "text/html")
+      @headers["Content-Type"].should == "text/html"
+
+      @headers.send(@method, "text/html", "charset" => "utf-8")
+      @headers["Content-Type"].should == "text/html; charset=utf-8"
+
+      @headers.send(@method, "text/html", "charset" => "utf-8", "rubyspec" => "rocks")
+      @headers["Content-Type"].should == "text/html; charset=utf-8; rubyspec=rocks"
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/set_form_data.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/set_form_data.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/set_form_data.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+describe :net_httpheader_set_form_data, :shared => true do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+  end
+
+  describe "when passed params" do
+    it "automatically set the 'Content-Type' to 'application/x-www-form-urlencoded'" do
+      @headers.send(@method, "cmd" => "search", "q" => "ruby", "max" => "50")
+      @headers["Content-Type"].should == "application/x-www-form-urlencoded"
+    end
+    
+    it "sets self's body based on the passed form parameters" do
+      @headers.send(@method, "cmd" => "search", "q" => "ruby", "max" => "50")
+      @headers.body.split("&").should == ["max=50", "cmd=search", "q=ruby"]
+    end
+  end
+
+  describe "when passed params, separator" do
+    it "sets self's body based on the passed form parameters and the passed separator" do
+      @headers.send(@method, {"cmd" => "search", "q" => "ruby", "max" => "50"}, "&")
+      @headers.body.split("&").should == ["max=50", "cmd=search", "q=ruby"]
+
+      @headers.send(@method, {"cmd" => "search", "q" => "ruby", "max" => "50"}, ";")
+      @headers.body.split(";").should == ["max=50", "cmd=search", "q=ruby"]
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/set_range.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/set_range.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/set_range.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,89 @@
+describe :net_httpheader_set_range, :shared => true do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+  end
+  
+  describe "when passed nil" do
+    it "returns nil" do
+      @headers.send(@method, nil).should be_nil
+    end
+    
+    it "deletes the 'Range' header entry" do
+      @headers["Range"] = "bytes 0-499/1234"
+      @headers.send(@method, nil)
+      @headers["Range"].should be_nil
+    end
+  end
+  
+  describe "when passed Numeric" do
+    it "sets the 'Range' header entry based on the passed Numeric" do
+      @headers.send(@method, 10)
+      @headers["Range"].should == "bytes=0-9"
+
+      @headers.send(@method, -10)
+      @headers["Range"].should == "bytes=-10"
+
+      @headers.send(@method, 10.9)
+      @headers["Range"].should == "bytes=0-9"
+    end
+  end
+  
+  describe "when passed Range" do
+    it "sets the 'Range' header entry based on the passed Range" do
+      @headers.send(@method, 10..200)
+      @headers["Range"].should == "bytes=10-200"
+
+      @headers.send(@method, 1..5)
+      @headers["Range"].should == "bytes=1-5"
+
+      @headers.send(@method, 1...5)
+      @headers["Range"].should == "bytes=1-4"
+
+      @headers.send(@method, 234..567)
+      @headers["Range"].should == "bytes=234-567"
+
+      @headers.send(@method, -5..-1)
+      @headers["Range"].should == "bytes=-5"
+
+      @headers.send(@method, 1..-1)
+      @headers["Range"].should == "bytes=1-"
+    end
+    
+    it "raises a Net::HTTPHeaderSyntaxError when the first Range element is negative" do
+      lambda { @headers.send(@method, -10..5) }.should raise_error(Net::HTTPHeaderSyntaxError)
+    end
+
+    it "raises a Net::HTTPHeaderSyntaxError when the last Range element is negative" do
+      lambda { @headers.send(@method, 10..-5) }.should raise_error(Net::HTTPHeaderSyntaxError)
+    end
+
+    it "raises a Net::HTTPHeaderSyntaxError when the last Range element is smaller than the first" do
+      lambda { @headers.send(@method, 10..5) }.should raise_error(Net::HTTPHeaderSyntaxError)
+    end
+  end
+  
+  describe "when passed start, end" do
+    it "sets the 'Range' header entry based on the passed start and length values" do
+      @headers.send(@method, 10, 200)
+      @headers["Range"].should == "bytes=10-209"
+
+      @headers.send(@method, 1, 5)
+      @headers["Range"].should == "bytes=1-5"
+
+      @headers.send(@method, 234, 567)
+      @headers["Range"].should == "bytes=234-800"
+    end
+
+    it "raises a Net::HTTPHeaderSyntaxError when start is negative" do
+      lambda { @headers.send(@method, -10, 5) }.should raise_error(Net::HTTPHeaderSyntaxError)
+    end
+
+    it "raises a Net::HTTPHeaderSyntaxError when start + length is negative" do
+      lambda { @headers.send(@method, 10, -15) }.should raise_error(Net::HTTPHeaderSyntaxError)
+    end
+
+    it "raises a Net::HTTPHeaderSyntaxError when length is negative" do
+      lambda { @headers.send(@method, 10, -4) }.should raise_error(Net::HTTPHeaderSyntaxError)
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/size.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/size.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/shared/size.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+describe :net_httpheader_size, :shared => true do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+  end
+  
+  it "returns the number of header entries in self" do
+    @headers.send(@method).should eql(0)
+    
+    @headers["a"] = "b"
+    @headers.send(@method).should eql(1)
+    
+    @headers["b"] = "b"
+    @headers.send(@method).should eql(2)
+    
+    @headers["c"] = "c"
+    @headers.send(@method).should eql(3)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+require File.dirname(__FILE__) + "/shared/size"
+
+describe "Net::HTTPHeader#size" do
+  it_behaves_like :net_httpheader_size, :size
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/sub_type_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/sub_type_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/sub_type_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+
+describe "Net::HTTPHeader#sub_type" do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+  end
+  
+  it "returns the 'sub-content-type', as per 'Content-Type' header entry" do
+    @headers["Content-Type"] = "text/html"
+    @headers.sub_type.should == "html"
+    
+    @headers["Content-Type"] = "application/pdf"
+    @headers.sub_type.should == "pdf"
+    
+    @headers["Content-Type"] = "text/html;charset=utf-8"
+    @headers.sub_type.should == "html"
+  end
+  
+  it "returns nil if no 'sub-content-type' is set" do
+    @headers["Content-Type"] = "text"
+    @headers.sub_type.should be_nil
+    
+    @headers["Content-Type"] = "text;charset=utf-8"
+    @headers.sub_type.should be_nil
+  end
+  
+  it "returns nil if the 'Content-Type' header entry does not exist" do
+    @headers.sub_type.should be_nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/to_hash_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/to_hash_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/to_hash_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+
+describe "Net::HTTPHeader#to_hash" do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+  end
+  
+  it "returns a Hash representing all Header entries (keys in lower case, values as arrays)" do
+    @headers.to_hash.should == {}
+
+    @headers["My-Header"] = "test"
+    @headers.to_hash.should == { "my-header" => ["test"] }
+    
+    @headers.add_field("My-Header", "another test")
+    @headers.to_hash.should == { "my-header" => ["test", "another test"] }
+  end
+  
+  it "does not allow modifying the headers from the returned hash" do
+    @headers.to_hash["my-header"] = ["test"]
+    @headers.to_hash.should == {}
+    @headers.key?("my-header").should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/type_params_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/type_params_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpheader/type_params_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/fixtures/classes"
+
+describe "Net::HTTPHeader#type_params" do
+  before(:each) do
+    @headers = NetHTTPHeaderSpecs::Example.new
+  end
+
+  it "returns additional 'Content-Type' information as a Hash" do
+    @headers["Content-Type"] = "text/html;charset=utf-8"
+    @headers.type_params.should == {"charset" => "utf-8"}
+
+    @headers["Content-Type"] = "text/html; charset=utf-8; rubyspec=rocks"
+    @headers.type_params.should == {"charset" => "utf-8", "rubyspec" => "rocks"}
+  end
+  
+  it "returns an empty Hash when no additional 'Content-Type' information is set" do
+    @headers.type_params.should == {}
+
+    @headers["Content-Type"] = "text/html"
+    @headers.type_params.should == {}
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httprequest/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httprequest/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httprequest/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,45 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+module NetHTTPRequestSpecs
+  class TestRequest < Net::HTTPRequest
+    METHOD = "TEST"
+    REQUEST_HAS_BODY  = false
+    RESPONSE_HAS_BODY = true
+  end
+end
+
+describe "Net::HTTPRequest#initialize" do
+  before(:each) do
+    @req = NetHTTPRequestSpecs::TestRequest.allocate
+  end
+  
+  it "uses the METHOD constants to set the request method" do
+    @req.send(:initialize, "/some/path")
+    @req.method.should == "TEST"
+  end
+  
+  it "uses the REQUEST_HAS_BODY to set whether the Request has a body or not" do
+    @req.send(:initialize, "/some/path")
+    @req.request_body_permitted?.should be_false
+  end
+  
+  it "uses the RESPONSE_HAS_BODY to set whether the Response can have a body or not" do
+    @req.send(:initialize, "/some/path")
+    @req.response_body_permitted?.should be_true
+  end
+  
+  describe "when passed path" do
+    it "sets self's path to the passed path" do
+      @req.send(:initialize, "/some/path")
+      @req.path.should == "/some/path"
+    end
+  end
+  
+  describe "when passed path, headers" do
+    it "uses the passed headers Hash to initialize self's header entries" do
+      @req.send(:initialize, "/some/path", "Content-Type" => "text/html")
+      @req["Content-Type"].should == "text/html"
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/body_permitted_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/body_permitted_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/body_permitted_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPResponse.body_permitted?" do
+  it "returns true if this response type can have a response body" do
+    Net::HTTPUnknownResponse.body_permitted?.should == true
+    Net::HTTPInformation.body_permitted?.should == false
+    Net::HTTPSuccess.body_permitted?.should == true
+    Net::HTTPRedirection.body_permitted?.should == true
+    Net::HTTPClientError.body_permitted?.should == true
+    Net::HTTPServerError.body_permitted?.should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/body_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/body_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/body_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/shared/body"
+
+describe "Net::HTTPResponse#body" do
+  it_behaves_like :net_httpresponse_body, :body
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/code_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/code_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/code_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPResponse#code" do
+  it "returns the result code string" do
+    res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
+    res.code.should == "???"
+
+    res = Net::HTTPInformation.new("1.0", "1xx", "test response")
+    res.code.should == "1xx"
+    
+    res = Net::HTTPSuccess.new("1.0", "2xx", "test response")
+    res.code.should == "2xx"
+    
+    res = Net::HTTPRedirection.new("1.0", "3xx", "test response")
+    res.code.should == "3xx"
+    
+    res = Net::HTTPClientError.new("1.0", "4xx", "test response")
+    res.code.should == "4xx"
+    
+    res = Net::HTTPServerError.new("1.0", "5xx", "test response")
+    res.code.should == "5xx"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/code_type_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/code_type_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/code_type_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPResponse#code_type" do
+  it "returns self's class" do
+    res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
+    res.code_type.should == Net::HTTPUnknownResponse
+
+    res = Net::HTTPInformation.new("1.0", "1xx", "test response")
+    res.code_type.should == Net::HTTPInformation
+    
+    res = Net::HTTPSuccess.new("1.0", "2xx", "test response")
+    res.code_type.should == Net::HTTPSuccess
+    
+    res = Net::HTTPRedirection.new("1.0", "3xx", "test response")
+    res.code_type.should == Net::HTTPRedirection
+    
+    res = Net::HTTPClientError.new("1.0", "4xx", "test response")
+    res.code_type.should == Net::HTTPClientError
+    
+    res = Net::HTTPServerError.new("1.0", "5xx", "test response")
+    res.code_type.should == Net::HTTPServerError
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/entity_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/entity_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/entity_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require File.dirname(__FILE__) + "/shared/body"
+
+describe "Net::HTTPResponse#entity" do
+  it_behaves_like :net_httpresponse_body, :entity
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/error_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/error_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/error_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPResponse#error!" do
+  it "raises self's class 'EXCEPTION_TYPE' Exception" do
+    res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
+    lambda { res.error! }.should raise_error(Net::HTTPError)
+
+    res = Net::HTTPInformation.new("1.0", "1xx", "test response")
+    lambda { res.error! }.should raise_error(Net::HTTPError)
+    
+    res = Net::HTTPSuccess.new("1.0", "2xx", "test response")
+    lambda { res.error! }.should raise_error(Net::HTTPError)
+    
+    res = Net::HTTPRedirection.new("1.0", "3xx", "test response")
+    lambda { res.error! }.should raise_error(Net::HTTPRetriableError)
+    
+    res = Net::HTTPClientError.new("1.0", "4xx", "test response")
+    lambda { res.error! }.should raise_error(Net::HTTPServerException)
+    
+    res = Net::HTTPServerError.new("1.0", "5xx", "test response")
+    lambda { res.error! }.should raise_error(Net::HTTPFatalError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/error_type_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/error_type_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/error_type_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPResponse#error_type" do
+  it "returns self's class 'EXCEPTION_TYPE' constant" do
+    res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
+    res.error_type.should == Net::HTTPError
+
+    res = Net::HTTPInformation.new("1.0", "1xx", "test response")
+    res.error_type.should == Net::HTTPError
+    
+    res = Net::HTTPSuccess.new("1.0", "2xx", "test response")
+    res.error_type.should == Net::HTTPError
+    
+    res = Net::HTTPRedirection.new("1.0", "3xx", "test response")
+    res.error_type.should == Net::HTTPRetriableError
+    
+    res = Net::HTTPClientError.new("1.0", "4xx", "test response")
+    res.error_type.should == Net::HTTPServerException
+    
+    res = Net::HTTPServerError.new("1.0", "5xx", "test response")
+    res.error_type.should == Net::HTTPFatalError
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/exception_type_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/exception_type_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/exception_type_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPResponse.exception_type" do
+  it "returns self's 'EXCEPTION_TYPE' constant" do
+    Net::HTTPUnknownResponse.exception_type.should == Net::HTTPError
+    Net::HTTPInformation.exception_type.should == Net::HTTPError
+    Net::HTTPSuccess.exception_type.should == Net::HTTPError
+    Net::HTTPRedirection.exception_type.should == Net::HTTPRetriableError
+    Net::HTTPClientError.exception_type.should == Net::HTTPServerException
+    Net::HTTPServerError.exception_type.should == Net::HTTPFatalError
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/header_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/header_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/header_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPResponse#header" do
+  it "returns self" do
+    res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
+    res.response.should equal(res)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/http_version_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/http_version_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/http_version_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPResponse#http_version" do
+  it "returns self's http version" do
+    res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
+    res.http_version.should == "1.0"
+
+    res = Net::HTTPUnknownResponse.new("1.1", "???", "test response")
+    res.http_version.should == "1.1"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPResponse#initialize when passed http_version, response_code, response_message" do
+  it "sets self http_version, response_code and response_message to the passed values" do
+    res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
+    res.http_version.should == "1.0"
+    res.code.should == "???"
+    res.message.should == "test response"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require "stringio"
+
+describe "Net::HTTPResponse#inspect" do
+  it "returns a String representation of self" do
+    res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
+    res.inspect.should == "#<Net::HTTPUnknownResponse ??? test response readbody=false>"
+
+    res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
+    socket = Net::BufferedIO.new(StringIO.new("test body"))
+    res.reading_body(socket, true) {}
+    res.inspect.should == "#<Net::HTTPUnknownResponse ??? test response readbody=true>"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/message_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/message_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/message_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPResponse#message" do
+  it "returns self's response message" do
+    res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
+    res.message.should == "test response"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/msg_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/msg_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/msg_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPResponse#msg" do
+  it "returns self's response message" do
+    res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
+    res.message.should == "test response"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/read_body_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/read_body_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/read_body_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,86 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPResponse#read_body" do
+  before(:each) do
+    @res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
+    @socket = Net::BufferedIO.new(StringIO.new("test body"))
+  end
+  
+  describe "when passed no arguments" do
+    it "returns the read body" do
+      @res.reading_body(@socket, true) do
+        @res.read_body.should == "test body"
+      end
+    end
+    
+    it "returns the previously read body if called a second time" do
+      @res.reading_body(@socket, true) do
+        @res.read_body.should equal(@res.read_body)
+      end
+    end
+  end
+  
+  describe "when passed a buffer" do
+    it "reads the body to the passed buffer" do
+      @res.reading_body(@socket, true) do
+        buffer = ""
+        @res.read_body(buffer)
+        buffer.should == "test body"
+      end
+    end
+    
+    it "returns the passed buffer" do
+      @res.reading_body(@socket, true) do
+        buffer = ""
+        @res.read_body(buffer).should equal(buffer)
+      end
+    end
+    
+    it "raises an IOError if called a second time" do
+      @res.reading_body(@socket, true) do
+        @res.read_body("")
+        lambda { @res.read_body("") }.should raise_error(IOError)
+      end
+    end
+  end
+  
+  describe "when passed a block" do
+    it "reads the body and yields it to the passed block (in chunks)" do
+      @res.reading_body(@socket, true) do
+        yielded = false
+        
+        buffer = ""
+        @res.read_body do |body|
+          yielded = true
+          buffer << body
+        end
+
+        yielded.should be_true
+        buffer.should == "test body"
+      end
+    end
+    
+    it "returns the ReadAdapter" do
+      @res.reading_body(@socket, true) do
+        @res.read_body { nil }.should be_kind_of(Net::ReadAdapter)
+      end
+    end
+    
+    it "raises an IOError if called a second time" do
+      @res.reading_body(@socket, true) do
+        @res.read_body {}
+        lambda { @res.read_body {} }.should raise_error(IOError)
+      end
+    end
+  end
+  
+  describe "when passed buffer and block" do
+    it "rauses an ArgumentError" do
+      @res.reading_body(@socket, true) do
+        lambda { @res.read_body("") {} }.should raise_error(ArgumentError)
+      end
+    end
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/read_header_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/read_header_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/read_header_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPResponse#read_header" do
+  it "returns self" do
+    res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
+    res.response.should equal(res)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/read_new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/read_new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/read_new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPResponse.read_new" do
+  it "creates a HTTPResponse object based on the response read from the passed socket" do
+    socket = Net::BufferedIO.new(StringIO.new(<<EOS))
+HTTP/1.1 200 OK
+Content-Type: text/html; charset=utf-8
+
+test-body
+EOS
+    response = Net::HTTPResponse.read_new(socket)
+    
+    response.should be_kind_of(Net::HTTPOK)
+    response.code.should == "200"
+    response["Content-Type"].should == "text/html; charset=utf-8"
+    
+    response.reading_body(socket, true) do
+      response.body.should == "test-body\n"
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/reading_body_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/reading_body_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/reading_body_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,58 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require "stringio"
+
+describe "Net::HTTPResponse#reading_body" do
+  before(:each) do
+    @res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
+    @socket = Net::BufferedIO.new(StringIO.new("test body"))
+  end
+
+  describe "when body_allowed is true" do
+    it "reads and returns the response body for self from the passed socket" do
+      @res.reading_body(@socket, true) {}.should == "test body"
+      @res.body.should == "test body"
+    end
+    
+    it "yields the passed block before reading the body" do
+      yielded = false
+      
+      @res.reading_body(@socket, true) do 
+        @res.inspect.should == "#<Net::HTTPUnknownResponse ??? test response readbody=false>"
+        yielded = true
+      end
+      
+      yielded.should be_true
+    end
+    
+    describe "but the response type is not allowed to have a body" do
+      before(:each) do
+        @res = Net::HTTPInformation.new("1.0", "???", "test response")
+      end
+
+      it "returns nil" do
+        @res.reading_body(@socket, false) {}.should be_nil
+        @res.body.should be_nil
+      end
+
+      it "yields the passed block" do
+        yielded = false
+        @res.reading_body(@socket, true) { yielded = true }
+        yielded.should be_true
+      end
+    end
+  end
+  
+  describe "when body_allowed is false" do
+    it "returns nil" do
+      @res.reading_body(@socket, false) {}.should be_nil
+      @res.body.should be_nil
+    end
+
+    it "yields the passed block" do
+      yielded = false
+      @res.reading_body(@socket, true) { yielded = true }
+      yielded.should be_true
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/response_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/response_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/response_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPResponse#response" do
+  it "returns self" do
+    res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
+    res.response.should equal(res)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/shared/body.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/shared/body.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/shared/body.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+describe :net_httpresponse_body, :shared => true do
+  before(:each) do
+    @res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
+    @socket = Net::BufferedIO.new(StringIO.new("test body"))
+  end
+  
+  it "returns the read body" do
+    @res.reading_body(@socket, true) do
+      @res.send(@method).should == "test body"
+    end
+  end
+  
+  it "returns the previously read body if called a second time" do
+    @res.reading_body(@socket, true) do
+      @res.send(@method).should equal(@res.send(@method))
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/to_ary_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/to_ary_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/to_ary_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+require "stringio"
+
+describe "Net::HTTPResponse#to_ary" do
+  before(:each) do
+    @res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
+    
+    socket = Net::BufferedIO.new(StringIO.new("test body"))
+    @res.reading_body(socket, true) {}
+  end
+  
+  it "returns an Array containing a duplicate of self and self's body" do
+    ary = @res.to_ary
+    ary.size.should == 2
+    
+    ary[0].inspect.should == @res.inspect
+    ary[1].should == "test body"
+  end
+  
+  it "removes #to_ary from the duplicate of self" do
+    @res.to_ary[0].respond_to?(:to_ary).should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/http/httpresponse/value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPResponse#value" do
+  it "raises an HTTP error for non 2xx HTTP Responses" do
+    res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
+    lambda { res.value }.should raise_error(Net::HTTPError)
+
+    res = Net::HTTPInformation.new("1.0", "1xx", "test response")
+    lambda { res.value }.should raise_error(Net::HTTPError)
+
+    res = Net::HTTPSuccess.new("1.0", "2xx", "test response")
+    lambda { res.value }.should_not raise_error(Net::HTTPError)
+
+    res = Net::HTTPRedirection.new("1.0", "3xx", "test response")
+    lambda { res.value }.should raise_error(Net::HTTPRetriableError)
+
+    res = Net::HTTPClientError.new("1.0", "4xx", "test response")
+    lambda { res.value }.should raise_error(Net::HTTPServerException)
+
+    res = Net::HTTPServerError.new("1.0", "5xx", "test response")
+    lambda { res.value }.should raise_error(Net::HTTPFatalError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/telnet/binmode_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/telnet/binmode_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/telnet/binmode_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,142 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/telnet'
+
+describe "Net::Telnet#binmode when passed no arguments or nil" do
+  before(:each) do
+    @socket = mock("Telnet Socket")
+    def @socket.kind_of?(klass)
+      klass == IO
+    end
+    @telnet = Net::Telnet.new("Proxy" => @socket)
+  end
+  
+  it "returns the current Binmode value" do
+    @telnet.binmode.should be_false
+    @telnet.binmode(nil).should be_false
+    @telnet.binmode = true
+    @telnet.binmode.should be_true
+    @telnet.binmode.should be_true
+  end
+end
+
+describe "Net::Telnet#binmode when passed [true]" do
+  before(:each) do
+    @socket = mock("Telnet Socket")
+    def @socket.kind_of?(klass)
+      klass == IO
+    end
+    @telnet = Net::Telnet.new("Proxy" => @socket)
+  end
+  
+  it "returns true" do
+    @telnet.binmode(true).should be_true
+  end
+  
+  it "sets the Binmode to true" do
+    @telnet.binmode(true)
+    @telnet.binmode.should be_true
+  end
+end
+
+describe "Net::Telnet#binmode when passed [false]" do
+  before(:each) do
+    @socket = mock("Telnet Socket")
+    def @socket.kind_of?(klass)
+      klass == IO
+    end
+    @telnet = Net::Telnet.new("Proxy" => @socket)
+  end
+  
+  it "returns false" do
+    @telnet.binmode(false).should be_false
+  end
+  
+  it "sets the Binmode to false" do
+    @telnet.binmode(false)
+    @telnet.binmode.should be_false
+  end
+end
+
+
+describe "Net::Telnet#binmode when passed [Object]" do
+  before(:each) do
+    @socket = mock("Telnet Socket")
+    def @socket.kind_of?(klass)
+      klass == IO
+    end
+    @telnet = Net::Telnet.new("Proxy" => @socket)
+  end
+  
+  it "raises an ArgumentError" do
+    lambda { @telnet.binmode(Object.new) }.should raise_error(ArgumentError)
+    lambda { @telnet.binmode("") }.should raise_error(ArgumentError)
+    lambda { @telnet.binmode(:sym) }.should raise_error(ArgumentError)
+  end
+  
+  it "does not change the Binmode" do
+    mode = @telnet.binmode
+    @telnet.binmode(Object.new) rescue nil
+    @telnet.binmode.should == mode
+  end
+end
+
+describe "Net::Telnet#binmode= when passed [true]" do
+  before(:each) do
+    @socket = mock("Telnet Socket")
+    def @socket.kind_of?(klass)
+      klass == IO
+    end
+    @telnet = Net::Telnet.new("Proxy" => @socket)
+  end
+  
+  it "returns true" do
+    (@telnet.binmode = true).should be_true
+  end
+  
+  it "sets the Binmode to true" do
+    @telnet.binmode = true
+    @telnet.binmode.should be_true
+  end
+end
+
+describe "Net::Telnet#binmode= when passed [false]" do
+  before(:each) do
+    @socket = mock("Telnet Socket")
+    def @socket.kind_of?(klass)
+      klass == IO
+    end
+    @telnet = Net::Telnet.new("Proxy" => @socket)
+  end
+  
+  it "returns false" do
+    (@telnet.binmode = false).should be_false
+  end
+  
+  it "sets the Binmode to false" do
+    @telnet.binmode = false
+    @telnet.binmode.should be_false
+  end
+end
+
+describe "Net::Telnet#binmode when passed [Object]" do
+  before(:each) do
+    @socket = mock("Telnet Socket")
+    def @socket.kind_of?(klass)
+      klass == IO
+    end
+    @telnet = Net::Telnet.new("Proxy" => @socket)
+  end
+  
+  it "raises an ArgumentError" do
+    lambda { @telnet.binmode = Object.new }.should raise_error(ArgumentError)
+    lambda { @telnet.binmode = "" }.should raise_error(ArgumentError)
+    lambda { @telnet.binmode = nil }.should raise_error(ArgumentError)
+    lambda { @telnet.binmode = :sym }.should raise_error(ArgumentError)
+  end
+  
+  it "does not change the Binmode" do
+    @telnet.binmode = true
+    (@telnet.binmode = Object.new) rescue nil
+    @telnet.binmode.should be_true
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/net/telnet/cmd_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/telnet/cmd_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/telnet/cmd_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/telnet'
+
+describe "Net::Telnet#cmd" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/telnet/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/telnet/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/telnet/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/telnet'
+
+describe "Net::Telnet#initialize" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/telnet/login_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/telnet/login_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/telnet/login_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/telnet'
+
+describe "Net::Telnet#login" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/telnet/preprocess_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/telnet/preprocess_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/telnet/preprocess_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/telnet'
+
+describe "Net::Telnet#preprocess" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/telnet/print_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/telnet/print_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/telnet/print_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/telnet'
+
+describe "Net::Telnet#print" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/telnet/puts_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/telnet/puts_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/telnet/puts_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/telnet'
+
+describe "Net::Telnet#puts" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/telnet/sock_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/telnet/sock_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/telnet/sock_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/telnet'
+
+describe "Net::Telnet#sock" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/telnet/telnetmode_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/telnet/telnetmode_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/telnet/telnetmode_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/telnet'
+
+describe "Net::Telnet#telnetmode" do
+  it "needs to be reviewed for spec completeness"
+end
+
+describe "Net::Telnet#telnetmode=" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/telnet/waitfor_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/telnet/waitfor_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/telnet/waitfor_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/telnet'
+
+describe "Net::Telnet#waitfor" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/net/telnet/write_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/net/telnet/write_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/net/telnet/write_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'net/telnet'
+
+describe "Net::Telnet#write" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/observer/add_observer_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/observer/add_observer_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/observer/add_observer_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Observer#add_observer" do
+
+  before(:each) do
+    @observable = ObservableSpecs.new
+    @observer = ObserverCallbackSpecs.new
+  end
+
+  it "adds the observer" do
+    @observer.value.should == nil
+    @observable.changed
+    @observable.notify_observers("test")
+    @observer.value.should == nil
+
+    @observable.add_observer(@observer)
+    @observable.changed
+    @observable.notify_observers("test2")
+    @observer.value.should == "test2"
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/observer/count_observers_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/observer/count_observers_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/observer/count_observers_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Observer#count_observers" do
+  before(:each) do
+    @observable = ObservableSpecs.new
+    @observer = ObserverCallbackSpecs.new
+  end
+
+  it "counts the observers" do
+    @observable.count_observers.should == 0
+    @observable.add_observer(@observer)
+    @observable.count_observers.should == 1
+    @observable.add_observer(@observer)
+    @observable.count_observers.should == 2
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/observer/delete_observer_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/observer/delete_observer_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/observer/delete_observer_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Observer#delete_observer" do
+  before(:each) do
+    @observable = ObservableSpecs.new
+    @observer = ObserverCallbackSpecs.new
+  end
+
+  it "deletes the observer" do
+    @observable.add_observer(@observer)
+    @observable.delete_observer(@observer)
+
+    @observable.changed
+    @observable.notify_observers("test")
+    @observer.value.should == nil
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/observer/delete_observers_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/observer/delete_observers_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/observer/delete_observers_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Observer#delete_observers" do
+  before(:each) do
+    @observable = ObservableSpecs.new
+    @observer = ObserverCallbackSpecs.new
+  end
+
+  it "deletes the observers" do
+    @observable.add_observer(@observer)
+    @observable.delete_observers
+
+    @observable.changed
+    @observable.notify_observers("test")
+    @observer.value.should == nil
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/observer/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/observer/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/observer/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require 'observer'
+
+class ObserverCallbackSpecs
+  attr_reader :value
+ 
+  def initialize
+    @value = nil
+  end
+
+  def update(value)
+    @value = value
+  end
+end
+
+class ObservableSpecs
+  include Observable
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/observer/notify_observers_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/observer/notify_observers_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/observer/notify_observers_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Observer#notify_observers" do
+
+  before(:each) do
+    @observable = ObservableSpecs.new
+    @observer = ObserverCallbackSpecs.new
+    @observable.add_observer(@observer)
+  end
+
+  it "must call changed before notifying observers" do
+    @observer.value.should == nil
+    @observable.notify_observers("test")
+    @observer.value.should == nil
+  end
+
+  it "verifies observer responds to update" do
+    lambda {
+      @observable.add_observer(@observable)
+    }.should raise_error(NoMethodError)
+  end
+
+  it "receives the callback" do
+    @observer.value.should == nil
+    @observable.changed
+    @observable.notify_observers("test")
+    @observer.value.should == "test"
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/openssl/cipher_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/openssl/cipher_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/openssl/cipher_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/constants'
+require 'openssl'
+
+describe "OpenSSL::Cipher's CipherError" do
+  ruby_version_is "" ... "1.8.7" do
+    it "exists under OpenSSL namespace" do
+      OpenSSL.should have_constant :CipherError
+    end
+  end
+
+  ruby_version_is "1.8.7" do
+    it "exists under OpenSSL::Cipher namespace" do
+      OpenSSL::Cipher.should have_constant :CipherError
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/openssl/hmac/digest_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/openssl/hmac/digest_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/openssl/hmac/digest_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../shared/constants'
+require 'openssl'
+
+describe "OpenSSL::HMAC.digest" do
+  include HMACConstants
+  it 'returns an SHA1 digest' do
+    cur_digest = OpenSSL::Digest::Digest.new('SHA1')
+    cur_digest.digest.should == HMACConstants::BlankSHA1Digest
+    digest = OpenSSL::HMAC.digest(cur_digest,
+                                        HMACConstants::Key,
+                                        HMACConstants::Contents)
+    digest.should == HMACConstants::SHA1Digest
+  end
+end
+
+# Should add in similar specs for MD5, RIPEMD160, and SHA256

Added: MacRuby/branches/experimental/spec/frozen/library/openssl/hmac/hexdigest_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/openssl/hmac/hexdigest_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/openssl/hmac/hexdigest_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../shared/constants'
+require 'openssl'
+
+describe "OpenSSL::HMAC.hexdigest" do
+  include HMACConstants
+  it 'returns an SHA1 hex digest' do
+    cur_digest = OpenSSL::Digest::Digest.new('SHA1')
+    cur_digest.hexdigest.should == HMACConstants::BlankSHA1HexDigest
+    hexdigest = OpenSSL::HMAC.hexdigest(cur_digest,
+                                        HMACConstants::Key,
+                                        HMACConstants::Contents)
+    hexdigest.should == HMACConstants::SHA1Hexdigest
+  end
+end
+
+# Should add in similar specs for MD5, RIPEMD160, and SHA256

Added: MacRuby/branches/experimental/spec/frozen/library/openssl/random/pseudo_bytes_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/openssl/random/pseudo_bytes_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/openssl/random/pseudo_bytes_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/random_bytes.rb'
+
+describe "OpenSSL::Random#pseudo_bytes" do
+  it_behaves_like :openssl_random_bytes, :pseudo_bytes
+end

Added: MacRuby/branches/experimental/spec/frozen/library/openssl/random/random_bytes_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/openssl/random/random_bytes_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/openssl/random/random_bytes_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/random_bytes.rb'
+
+describe "OpenSSL::Random#random_bytes" do
+  it_behaves_like :openssl_random_bytes, :random_bytes
+end

Added: MacRuby/branches/experimental/spec/frozen/library/openssl/random/shared/random_bytes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/openssl/random/shared/random_bytes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/openssl/random/shared/random_bytes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'openssl'
+
+describe :openssl_random_bytes, :shared => true do |cmd|
+  it "generates a random binary string of specified length" do
+    (1..64).each do |idx|
+      bytes = OpenSSL::Random.pseudo_bytes(idx)
+      bytes.class.should == String
+      bytes.length.should == idx
+    end
+  end
+
+  it "generates different binary strings with subsequent invocations" do
+    # quick and dirty check, but good enough
+    values = []
+    256.times do
+      val = OpenSSL::Random.pseudo_bytes(16)
+      # make sure the random bytes are not repeating
+      values.include?(val).should == false
+      values << val
+    end
+  end
+
+  it "raises ArgumentError on negative arguments" do
+    lambda {
+      OpenSSL::Random.pseudo_bytes(-1)
+    }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/openssl/shared/constants.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/openssl/shared/constants.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/openssl/shared/constants.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+module HMACConstants
+
+  Contents = "Ipsum is simply dummy text of the printing and typesetting industry. \nLorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. \nIt has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. \nIt was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
+  Key                = 'sekrit'
+  
+  BlankSHA1Digest    = "\3329\243\356^kK\r2U\277\357\225`\030\220\257\330\a\t"
+  SHA1Digest         = "\236\022\323\341\037\236\262n\344\t\372:\004J\242\330\257\270\363\264"
+  BlankSHA1HexDigest = "da39a3ee5e6b4b0d3255bfef95601890afd80709"
+  SHA1Hexdigest      = "9e12d3e11f9eb26ee409fa3a044aa2d8afb8f3b4"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/openstruct/delete_field_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/openstruct/delete_field_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/openstruct/delete_field_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'ostruct'
+
+describe "OpenStruct#delete_field" do
+  before :each do
+    @os = OpenStruct.new(:name => "John Smith", :age => 70, :pension => 300)
+  end
+  
+  it "removes the named field from self's method/value table" do
+    @os.delete_field(:name)
+    @os.send(:table)[:name].should be_nil
+  end
+  
+  it "does not remove the accessor methods" do
+    @os.delete_field(:name)
+    @os.respond_to?(:name).should be_true
+    @os.respond_to?(:name=).should be_true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/openstruct/equal_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/openstruct/equal_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/openstruct/equal_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require "ostruct"
+require File.dirname(__FILE__) + "/fixtures/classes"
+
+describe "OpenStruct#==" do
+  before(:each) do
+    @os = OpenStruct.new(:name => "John")
+  end
+  
+  it "returns false when the passed argument is no OpenStruct" do
+    (@os == Object.new).should be_false
+    (@os == "Test").should be_false
+    (@os == 10).should be_false
+    (@os == :sym).should be_false
+  end
+  
+  it "returns true when self and other are equal method/value wise" do
+    (@os == @os).should be_true
+    (@os == OpenStruct.new(:name => "John")).should be_true
+    (@os == OpenStructSpecs::OpenStructSub.new(:name => "John")).should be_true
+
+    (@os == OpenStruct.new(:name => "Jonny")).should be_false
+    (@os == OpenStructSpecs::OpenStructSub.new(:name => "Jonny")).should be_false
+
+    (@os == OpenStruct.new(:name => "John", :age => 20)).should be_false
+    (@os == OpenStructSpecs::OpenStructSub.new(:name => "John", :age => 20)).should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/openstruct/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/openstruct/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/openstruct/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+module OpenStructSpecs
+  class OpenStructSub < OpenStruct
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/openstruct/frozen_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/openstruct/frozen_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/openstruct/frozen_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,40 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'ostruct'
+
+describe "OpenStruct.new when frozen" do
+  before :each do
+    @os = OpenStruct.new(:name => "John Smith", :age => 70, :pension => 300).freeze
+  end
+  #
+  # method_missing case handled in method_missing_spec.rb
+  #
+  it "is still readable" do
+    @os.age.should eql(70)
+    @os.pension.should eql(300)
+    @os.name.should == "John Smith"
+  end
+
+  ruby_bug "#1219", "1.9.1" do
+    it "is not writeable" do
+      lambda{ @os.age = 42 }.should raise_error( TypeError )
+    end
+
+    it "cannot create new fields" do
+      lambda{ @os.state = :new }.should raise_error( TypeError )
+    end
+
+    it "creates a frozen clone" do
+      f = @os.clone
+      f.age.should == 70
+      lambda{ f.age = 0 }.should raise_error( TypeError )
+      lambda{ f.state = :newer }.should raise_error( TypeError )
+    end
+  end # ruby_bug
+
+  it "creates an unfrozen dup" do
+    d = @os.dup
+    d.age.should == 70
+    d.age = 42
+    d.age.should == 42
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/openstruct/initialize_copy_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/openstruct/initialize_copy_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/openstruct/initialize_copy_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require "ostruct"
+
+describe "OpenStruct#initialize_copy" do
+  it "is private" do
+    OpenStruct.should have_private_instance_method(:initialize_copy)
+  end
+  
+  it "creates an independent method/value table for self" do
+    # Yes, I'm using #dup here...
+    os = OpenStruct.new("age" => 20, "name" => "John")
+    dup = os.dup
+    
+    dup.age = 30
+    dup.age.should eql(30)
+    os.age.should eql(20)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/openstruct/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/openstruct/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/openstruct/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'ostruct'
+
+describe "OpenStruct#initialize" do
+  it "is private" do
+    OpenStruct.should have_private_instance_method(:initialize)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/openstruct/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/openstruct/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/openstruct/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'ostruct'
+require File.dirname(__FILE__) + "/fixtures/classes"
+require File.dirname(__FILE__) + "/shared/inspect"
+
+describe "OpenStruct#inspect" do
+  it_behaves_like :ostruct_inspect, :inspect
+end

Added: MacRuby/branches/experimental/spec/frozen/library/openstruct/marshal_dump_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/openstruct/marshal_dump_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/openstruct/marshal_dump_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require "ostruct"
+
+describe "OpenStruct#marshal_dump" do
+  it "returns the method/value table" do
+    os = OpenStruct.new("age" => 20, "name" => "John")
+    os.marshal_dump.should == { :age => 20, :name => "John" }
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/openstruct/marshal_load_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/openstruct/marshal_load_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/openstruct/marshal_load_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require "ostruct"
+
+describe "OpenStruct#marshal_load when passed [Hash]" do
+  it "defines methods based on the passed Hash" do
+    os = OpenStruct.new
+    os.marshal_load(:age => 20, :name => "John")
+    
+    os.age.should eql(20)
+    os.name.should == "John"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/openstruct/method_missing_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/openstruct/method_missing_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/openstruct/method_missing_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,47 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require "ostruct"
+
+describe "OpenStruct#method_missing when called with a method name ending in '='" do
+  before(:each) do
+    @os = OpenStruct.new
+  end
+
+  it "raises an ArgumentError when not passed any additional arguments" do
+    lambda { @os.method_missing(:test=) }.should raise_error(ArgumentError)
+  end
+
+  it "raises a TypeError when self is frozen" do
+    @os.freeze
+    lambda { @os.method_missing(:test=, "test") }.should raise_error(TypeError)
+  end
+
+  it "creates accessor methods" do
+    @os.method_missing(:test=, "test")
+    @os.respond_to?(:test=).should be_true
+    @os.respond_to?(:test).should be_true
+
+    @os.test.should == "test"
+    @os.test = "changed"
+    @os.test.should == "changed"
+  end
+
+  it "updates the method/value table with the passed method/value" do
+    @os.method_missing(:test=, "test")
+    @os.send(:table)[:test].should == "test"
+  end
+end
+
+describe "OpenStruct#method_missing when passed additional arguments" do
+  it "raises a NoMethodError" do
+    os = OpenStruct.new
+    lambda { os.method_missing(:test, 1, 2, 3) }.should raise_error(NoMethodError)
+  end
+end
+
+describe "OpenStruct#method_missing when not passed any additional arguments" do
+  it "returns the value for the passed method from the method/value table" do
+    os = OpenStruct.new(:age => 20)
+    os.method_missing(:age).should eql(20)
+    os.method_missing(:name).should be_nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/openstruct/new_ostruct_member_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/openstruct/new_ostruct_member_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/openstruct/new_ostruct_member_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,30 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require "ostruct"
+
+describe "OpenStruct#new_ostruct_member when passed [method_name]" do
+  before(:each) do
+    @os = OpenStruct.new
+    @os.instance_variable_set(:@table, :age => 20)
+  end
+  
+  it "creates an attribute reader method for the passed method_name" do
+    @os.new_ostruct_member(:age)
+    @os.age.should eql(20)
+  end
+  
+  it "creates an attribute writer method for the passed method_name" do
+    @os.new_ostruct_member(:age)
+    @os.age = 30
+    @os.age.should eql(30)
+  end
+  
+  it "does not allow overwriting existing methods" do
+    def @os.age
+      10
+    end
+    
+    @os.new_ostruct_member(:age)
+    @os.age.should == 10
+    @os.respond_to?(:age=).should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/openstruct/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/openstruct/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/openstruct/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'ostruct'
+
+describe "OpenStruct.new when passed [Hash]" do
+  before :each do
+    @os = OpenStruct.new(:name => "John Smith", :age => 70, :pension => 300)
+  end
+  
+  it "creates an attribute for each key of the passed Hash" do
+    @os.age.should eql(70)
+    @os.pension.should eql(300)
+    @os.name.should == "John Smith"
+  end
+end
+
+describe "OpenStruct.new when passed no arguments" do
+  it "returns a new OpenStruct Object without any attributes" do
+    OpenStruct.new.to_s.should == "#<OpenStruct>"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/openstruct/shared/inspect.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/openstruct/shared/inspect.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/openstruct/shared/inspect.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+describe :ostruct_inspect, :shared => true do
+  it "returns a String representation of self" do
+    os = OpenStruct.new(:name => "John Smith")
+    os.send(@method).should == "#<OpenStruct name=\"John Smith\">"
+
+    os = OpenStruct.new(:age => 20, :name => "John Smith")
+    os.send(@method).should be_kind_of(String)
+  end
+
+  it "correctly handles self-referential OpenStructs" do
+    os = OpenStruct.new
+    os.self = os
+    os.send(@method).should == "#<OpenStruct self=#<OpenStruct ...>>"
+  end
+
+  it "correctly handles OpenStruct subclasses" do
+    os = OpenStructSpecs::OpenStructSub.new(:name => "John Smith")
+    os.send(@method).should == "#<OpenStructSpecs::OpenStructSub name=\"John Smith\">"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/openstruct/table_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/openstruct/table_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/openstruct/table_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'ostruct'
+
+describe "OpenStruct#table" do
+  before(:each) do
+    @os = OpenStruct.new("age" => 20, "name" => "John")
+  end
+  
+  it "is protected" do
+    @os.protected_methods.should include("table")
+  end
+  
+  it "returns self's method/value table" do
+    @os.send(:table).should == { :age => 20, :name => "John" }
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/openstruct/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/openstruct/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/openstruct/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'ostruct'
+require File.dirname(__FILE__) + "/fixtures/classes"
+require File.dirname(__FILE__) + "/shared/inspect"
+
+describe "OpenStruct#to_s" do
+  it_behaves_like :ostruct_inspect, :to_s
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/parsedate/parsedate.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/parsedate/parsedate.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/parsedate/parsedate.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,95 @@
+require File.dirname(__FILE__) + "/../../spec_helper"
+require "parsedate"
+
+describe "ParseDate.parsedate" do
+  it "returns Array of 8 nils given an empty String" do
+    ParseDate.parsedate("").should == [nil] * 8
+  end
+
+  it "raises TypeError given nil" do
+    lambda { ParseDate.parsedate(nil) }.should raise_error(TypeError)
+  end
+
+  it "raises NoMethodError given Time" do
+    lambda { ParseDate.parsedate(Time.now) }.should raise_error(NoMethodError)
+  end
+
+  it "returns Array with weekday number, given a full day name" do
+    ParseDate.parsedate("Sunday").should == [nil] * 7 + [0]
+  end
+
+  it "returns Array with weekday number, given a 3 letter day name" do
+    ParseDate.parsedate("mon").should == [nil] * 7 + [1]
+  end
+
+  it "returns Array with weekday number, given a String containing a word starting with day" do
+    ParseDate.parsedate("ignore friday monday ignore").should == [nil] * 7 + [5]
+    ParseDate.parsedate("ignorefriday").should == [nil] * 8
+    ParseDate.parsedate("fridayignore").should == [nil] * 7 + [5]
+    # friday, not monday!
+    ParseDate.parsedate("friends on monday").should == [nil] * 7 + [5]
+  end
+
+  it "returns Array of 8 nils, given a single digit String" do
+    ParseDate.parsedate("8").should == [nil] * 8
+  end
+
+  it "returns Array with day set, given a String of 2 digits" do
+    ParseDate.parsedate("08").should == [nil, nil] + [8] + [nil] * 5
+    ParseDate.parsedate("99").should == [nil, nil] + [99] + [nil] * 5
+  end
+
+  it "returns Array of 8 nils, given a String of 3 digits" do
+    ParseDate.parsedate("100").should == [nil] * 8
+  end
+
+  it "returns Array with month and day set, given a String of 4 digits" do
+    ParseDate.parsedate("1050").should == [nil] + [10,50] + [nil] * 5
+  end
+
+  it "returns Array with year set, given a String of 5 digits" do
+    ParseDate.parsedate("10500").should == [10] + [nil] * 7
+  end
+
+  it "returns Array with date fields set, given a String of 6 digits" do
+    ParseDate.parsedate("105070").should == [10, 50, 70] + [nil] * 5
+  end
+
+  it "returns Array with 4-digit year set, given a String of 7 digits" do
+    ParseDate.parsedate("1050701").should == [1050] + [nil] * 7
+  end
+
+  it "returns Array with date fields set, given a String of 8 digits" do
+    ParseDate.parsedate("10507011").should == [1050, 70, 11] + [nil] * 5
+  end
+
+  it "returns Array of 8 nils, given a odd-sized String of 9 or more digits" do
+    ParseDate.parsedate("123456789").should == [nil] * 8
+    ParseDate.parsedate("12345678901").should == [nil] * 8
+  end
+
+  it "returns Array with date & hour fields set, given a String of 10 digits" do
+    ParseDate.parsedate("1234567890").should == [1234, 56, 78, 90] + [nil] * 4
+  end
+
+  it "returns Array with date, hour & minute fields set, given a String of 12 digits" do
+    ParseDate.parsedate("123456789012").should == [1234, 56, 78, 90, 12] + [nil] * 3
+  end
+
+  it "returns Array with date & time fields set, given a String of 14 digits" do
+    ParseDate.parsedate("12345678901234").should == [1234, 56, 78, 90, 12, 34, nil, nil]
+  end
+
+  it "returns Array with year and month set, given a String like nn-nn" do
+    ParseDate.parsedate("08-09").should == [8,9] + [nil] * 6
+    ParseDate.parsedate("08-09",true).should == [2008,9] + [nil] * 6
+  end
+
+  it "returns Array with day and hour set, given a String like n-nn" do
+    ParseDate.parsedate("8-09").should == [nil,nil] + [9,8] + [nil] * 4
+  end
+  
+  it "returns Array with day and timezone set, given a String like nn-n" do
+    ParseDate.parsedate("08-9").should == [nil,nil,8,nil,nil,nil,"-9",nil]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/pathname/absolute_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/pathname/absolute_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/pathname/absolute_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'pathname'
+
+describe "Pathname#absolute?" do
+
+  it "should return true for the root directory" do
+    Pathname.new('/').absolute?.should == true
+  end
+
+  it "should return true for a dir starting with a slash" do
+    Pathname.new('/usr/local/bin').absolute?.should == true
+  end
+
+  it "should return false for a dir not starting with a slash" do
+    Pathname.new('fish').absolute?.should == false
+  end
+
+  it "should return false for a dir not starting with a slash" do
+    Pathname.new('fish/dog/cow').absolute?.should == false
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/pathname/equal_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/pathname/equal_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/pathname/equal_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'pathname'
+
+describe "Pathname#==" do
+
+  it "returns true when identical paths are used" do
+    (Pathname.new('') == Pathname.new('')).should == true
+  end
+
+  it "returns true when identical paths are used" do
+    (Pathname.new('') == Pathname.new('/usr/local/bin')).should == false
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/pathname/hash_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/pathname/hash_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/pathname/hash_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'pathname'
+
+describe "Pathname#hash" do
+
+  it "should equal the hash of the pathname" do
+    Pathname.new('/usr/local/bin/').hash.should == '/usr/local/bin/'.hash
+  end
+
+  it "should not equal the hash of a different pathname" do
+    Pathname.new('/usr/local/bin/').hash.should_not == '/usr/bin/'.hash
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/pathname/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/pathname/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/pathname/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'pathname'
+
+describe "Pathname.new" do
+  it "returns a new Pathname Object with 1 argument" do
+    Pathname.new('').class.should == Pathname
+  end
+
+  it "raises an ArgumentError when called with \0" do
+    lambda { Pathname.new("\0")}.should raise_error(ArgumentError)
+  end
+
+  it "is tainted if path is tainted" do
+    path = '/usr/local/bin'.taint
+    Pathname.new(path).tainted?.should == true
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/pathname/parent_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/pathname/parent_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/pathname/parent_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'pathname'
+
+describe "Pathname#parent" do
+
+  it "should have parent of root as root" do
+    Pathname.new('/').parent.to_s.should == '/'
+  end
+
+  it "should have parent of /usr/ as root" do
+    Pathname.new('/usr/').parent.to_s.should == '/'
+  end
+
+  it "should have parent of /usr/local as root" do
+    Pathname.new('/usr/local').parent.to_s.should == '/usr'
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/pathname/relative_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/pathname/relative_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/pathname/relative_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'pathname'
+
+describe "Pathname#relative?" do
+
+  it "should return false for the root directory" do
+    Pathname.new('/').relative?.should == false
+  end
+
+  it "should return false for a dir starting with a slash" do
+    Pathname.new('/usr/local/bin').relative?.should == false
+  end
+
+  it "should return true for a dir not starting with a slash" do
+    Pathname.new('fish').relative?.should == true
+  end
+
+  it "should return true for a dir not starting with a slash" do
+    Pathname.new('fish/dog/cow').relative?.should == true
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/pathname/root_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/pathname/root_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/pathname/root_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'pathname'
+
+describe "Pathname#root?" do
+
+  it "should return true for root directories" do
+    Pathname.new('/').root?.should == true
+  end
+
+  it "should return false for empty string" do
+    Pathname.new('').root?.should == false
+  end
+
+  it "should return false for a top level directory" do
+    Pathname.new('/usr').root?.should == false
+  end
+
+  it "should return false for a top level with .. appended directory" do
+    Pathname.new('/usr/..').root?.should == false
+  end
+
+  it "should return false for a directory below top level" do
+    Pathname.new('/usr/local/bin/').root?.should == false
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/pathname/sub_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/pathname/sub_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/pathname/sub_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'pathname'
+
+describe "Pathname#sub" do
+
+  it "should replace the pattern with rest" do
+    Pathname.new('/usr/local/bin/').sub(/local/, 'fish').to_s.should == '/usr/fish/bin/'
+  end
+
+  it "should return a new object" do
+    p = Pathname.new('/usr/local/bin/')
+    p.sub(/local/, 'fish').should_not == p
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/ping/pingecho_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/ping/pingecho_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/ping/pingecho_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'ping'
+
+describe "Ping.pingecho" do
+
+  it "responds to pingecho method" do
+    Ping.should respond_to(:pingecho)
+  end
+
+  it "pings a host using the correct number of arguments" do
+    Ping.pingecho('127.0.0.1', 10, 7).should be_true
+    Ping.pingecho('127.0.0.1', 10).should be_true
+    Ping.pingecho('127.0.0.1').should be_true
+  end
+
+  it "raises ArgumentError for wrong number of arguments" do
+    lambda { Ping.pingecho }.should raise_error(ArgumentError)
+    lambda { Ping.pingecho 'one', 'two', 'three', 'four' }.should raise_error(ArgumentError)
+  end
+
+  it "returns false for invalid parameters" do
+    Ping.pingecho('127.0.0.1', 5, 'invalid port').should be_false
+    Ping.pingecho('127.0.0.1', 'invalid timeout').should be_false
+    Ping.pingecho(123).should be_false
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/prime/each_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/prime/each_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/prime/each_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,103 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/each'
+require 'timeout'
+
+# force reload for Prime::method_added and Prime::instance
+Object.send(:remove_const, :Prime) if defined?(Prime)
+load 'prime.rb'
+
+describe "Prime.each" do
+  it_behaves_like :prime_each, :each, Prime
+end
+
+describe "Prime#each" do
+  it_behaves_like :prime_each, :each, Prime.instance
+end
+
+describe "Prime#each", "when an instance created via Prime.new" do
+  before(:all) do
+    @enough_seconds = 3
+    @primes = [
+      2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37,
+      41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83,
+      89, 97
+    ].freeze
+  end
+
+  before do
+    @ps = Prime.new
+  end
+
+  it "iterates the given block over all prime numbers" do
+    enumerated = []
+    @ps.each do |prime|
+      break if prime >= 100
+      enumerated << prime
+    end
+    enumerated.should == @primes
+  end
+
+  it "infinitely iterates the given block passing a prime" do
+    lambda {
+      Timeout.timeout(@enough_seconds) {
+        @ps.each {|prime| 
+          primality = (2..Math.sqrt(prime)).all?{|n| prime%n != 0 }
+          primality.should be_true
+        }
+      }
+    }.should raise_error(Timeout::Error)
+  end
+
+  it "raises a ArgumentError when is called with some argumetns" do
+    lambda { 
+      @ps.each(100) do |prime|
+        # do something
+      end
+    }.should raise_error(ArgumentError)
+  end
+
+  it "passes a prime to the given block ascendently" do
+    prev = 1
+    @ps.each do |prime|
+      break if prime >= 10000
+      prime.should > prev
+      prev = prime
+    end
+  end
+
+  it "returns an evaluated value of the given block" do
+    expected = Object.new
+    Prime.new.each{ break expected }.should equal?(expected)
+  end
+
+  it "returns an enumerator (or a compatible object) if no block given" do
+    obj = @ps.each
+    obj.should be_kind_of(Enumerable)
+    obj.should respond_to(:with_index)
+    obj.should respond_to(:with_object)
+    obj.should respond_to(:next)
+    obj.should respond_to(:rewind)
+  end
+
+  it "raises an ArgumentError if no block given and is called with some arguments" do
+    lambda { @ps.each(100) }.should raise_error(ArgumentError)
+  end
+
+  it "does not rewind the generator, each loop start at the current value" do
+    @ps.next
+
+    result = []
+    @ps.each do |p|
+      result << p
+      break if p > 10
+    end
+    result.should == [3, 5, 7, 11]
+
+    result = []
+    @ps.each do |p|
+      result << p
+      break if p > 20
+    end
+    result.should == [13, 17, 19, 23]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/prime/instance_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/prime/instance_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/prime/instance_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'prime'
+
+describe "Prime.instance" do
+  it "returns a object representing the set of prime numbers" do
+    Prime.instance.class.should == Prime
+  end
+
+  it "returns a object with no obsolete features" do
+    Prime.instance.should_not be_kind_of(Prime::OldCompatibility)
+    Prime.instance.should_not respond_to(:succ)
+    Prime.instance.should_not respond_to(:next)
+  end
+
+  it "does not complain anything" do
+    lambda { Prime.instance }.should_not complain
+  end
+   
+  it "raises a ArgumentError when is called with some arguments" do
+    lambda { Prime.instance(1) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/prime/int_from_prime_division_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/prime/int_from_prime_division_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/prime/int_from_prime_division_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'prime'
+
+describe "Prime.int_from_prime_division" do
+  it "returns the product of the given factorization" do
+    Prime.int_from_prime_division([[2,3], [3,3], [5,3], [7,3], [11,3], [13,3], [17,3]]).
+      should == 2**3 * 3**3 * 5**3 * 7**3 * 11**3 * 13**3 * 17**3
+  end
+
+  it "returns 1 for an empty factorization" do
+    Prime.int_from_prime_division([]).should == 1
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/prime/integer/each_prime_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/prime/integer/each_prime_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/prime/integer/each_prime_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'prime'
+
+describe "Integer.each_prime" do
+  it "is transferred to Prime.each" do
+    Prime.should_receive(:each).with(100).and_yield(2).and_yield(3).and_yield(5)
+    yielded = []
+    Integer.each_prime(100) do |prime|
+      yielded << prime
+    end
+    yielded.should == [2,3,5]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/prime/integer/from_prime_division_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/prime/integer/from_prime_division_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/prime/integer/from_prime_division_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'prime'
+
+describe "Integer.from_prime_division" do
+  it "returns the product of the given factorization" do
+    Integer.from_prime_division([[2,3], [3,3], [5,3], [7,3], [11,3], [13,3], [17,3]]).
+      should == 2**3 * 3**3 * 5**3 * 7**3 * 11**3 * 13**3 * 17**3
+  end
+
+  it "returns 1 for an empty factorization" do
+    Integer.from_prime_division([]).should == 1
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/prime/integer/prime_division_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/prime/integer/prime_division_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/prime/integer/prime_division_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'prime'
+
+describe "Integer#prime_division" do
+  it "returns an array of a prime factor and a corresponding exponent" do
+    (2*3*5*7*11*13*17).prime_division.should == 
+      [[2,1], [3,1], [5,1], [7,1], [11,1], [13,1], [17,1]]
+  end
+
+  it "returns an empty array for 1" do
+    1.prime_division.should == []
+  end
+  it "returns an empty array for -1" do
+    -1.prime_division.should == []
+  end
+  it "raises ZeroDivisionError for 0" do
+    lambda { 0.prime_division }.should raise_error(ZeroDivisionError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/prime/integer/prime_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/prime/integer/prime_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/prime/integer/prime_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'prime'
+
+describe "Integer#prime?" do
+  it "returns a true value for prime numbers" do
+    2.prime?.should be_true
+    3.prime?.should be_true
+    (2**31-1).prime?.should be_true  # 8th Mersenne prime (M8)
+  end
+
+  it "returns a false value for composite numbers" do
+    4.prime?.should be_false
+    15.prime?.should be_false
+    (2**32-1).prime?.should be_false
+    ( (2**17-1)*(2**19-1) ).prime?.should be_false  # M6*M7
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/prime/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/prime/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/prime/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'prime'
+
+describe "Prime.new" do
+  it "returns a new object representing the set of prime numbers" do
+    Prime.new.class.should == Prime
+  end
+
+  it "returns a object with obsolete featrues" do
+    Prime.new.should be_kind_of(Prime::OldCompatibility)
+    Prime.new.should respond_to(:succ)
+    Prime.new.should respond_to(:next)
+  end
+
+  it "complains that the method is obsolete" do
+    lambda { Prime.new }.should complain(/obsolete.*use.*Prime::instance/)
+  end
+   
+  it "raises a ArgumentError when is called with some arguments" do
+    lambda { Prime.new(1) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/prime/next_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/prime/next_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/prime/next_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/next'
+require 'prime'
+
+describe "Prime#next" do
+  it_behaves_like :prime_next, :next
+end
+
+

Added: MacRuby/branches/experimental/spec/frozen/library/prime/prime_division_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/prime/prime_division_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/prime/prime_division_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'prime'
+
+describe "Prime.prime_division" do
+  it "returns an array of a prime factor and a corresponding exponent" do
+    Prime.prime_division(2*3*5*7*11*13*17).should ==
+      [[2,1], [3,1], [5,1], [7,1], [11,1], [13,1], [17,1]]
+  end
+
+  it "returns an empty array for 1" do
+    Prime.prime_division(1).should == []
+  end
+  it "returns an empty array for -1" do
+    Prime.prime_division(-1).should == []
+  end
+  it "raises ZeroDivisionError for 0" do
+    lambda { Prime.prime_division(0) }.should raise_error(ZeroDivisionError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/prime/prime_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/prime/prime_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/prime/prime_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'prime'
+
+describe "Prime#prime?" do
+  it "returns a true value for prime numbers" do
+    Prime.prime?(2).should be_true
+    Prime.prime?(3).should be_true
+    Prime.prime?(2**31-1).should be_true  # 8th Mersenne prime (M8)
+  end
+
+  it "returns a false value for composite numbers" do
+    Prime.prime?(4).should be_false
+    Prime.prime?(15).should be_false
+    Prime.prime?(2**32-1).should be_false
+    Prime.prime?( (2**17-1)*(2**19-1) ).should be_false  # M6*M7
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/prime/shared/each.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/prime/shared/each.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/prime/shared/each.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,145 @@
+describe :prime_each, :shared => true do
+  before(:all) do
+    @enough_seconds = 3
+    @primes = [
+      2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37,
+      41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83,
+      89, 97
+    ]
+  end
+
+  it "iterates the given block over all prime numbers" do
+    enumerated = []
+    @object.each do |prime|
+      break if prime >= 100
+      enumerated << prime
+    end
+    enumerated.should == @primes
+  end
+
+  it "infinitely iterates the given block passing a prime" do
+    lambda {
+      Timeout.timeout(@enough_seconds) {
+        @object.each {|prime| 
+          primality = (2..Math.sqrt(prime)).all?{|n| prime%n != 0 }
+          primality.should be_true
+        }
+      }
+    }.should raise_error(Timeout::Error)
+  end
+
+  it "passes a prime to the given block ascendently" do
+    prev = 1
+    @object.each do |prime|
+      break if prime >= 10000
+      prime.should > prev
+      prev = prime
+    end
+  end
+
+  it "returns the last evaluated value of the given block" do
+    expected = Object.new
+    @object.each{ break expected }.should equal(expected)
+  end
+
+
+  it "iterates the given block over all prime numbers which are equal to or less than the first argument" do
+    enumerated = []
+    @object.each(100) do |prime|
+      enumerated << prime
+    end
+    enumerated.should == @primes
+  end
+
+  it "returns the last evaluated value of the given block" do
+    expected = Object.new
+    @object.each(5){ expected }.should equal(expected)
+  end
+
+  it "returns nil when no prime number is enumerated" do
+    obj = Object.new
+    @object.each(1){ obj }.should equal(nil)
+  end
+
+  it "takes a pseudo-prime generator as the second argument" do
+    generator = mock('very bad pseudo-prime generator')
+    generator.should_receive(:upper_bound=).with(100)
+    generator.should_receive(:each).and_yield(2).and_yield(3).and_yield(4).and_yield(5).and_yield(6)
+
+    enumerated = []
+    @object.each(100, generator) do |prime| 
+      enumerated << prime
+    end
+    enumerated.should == [2, 3, 4, 5, 6]
+  end
+
+
+  it "returns an enumerator (or compatible object) if no block given" do
+    obj = @object.each
+    obj.should be_kind_of(Enumerable)
+    obj.should respond_to(:with_index)
+    obj.should respond_to(:with_object)
+    obj.should respond_to(:next)
+    obj.should respond_to(:rewind)
+  end
+
+  it "returns an enumerator which remembers the given upper bound" do
+    enum = @object.each(100)
+    enumerated = []
+    lambda {
+      Timeout.timeout(@enough_seconds) {
+        enum.each do |p| 
+          enumerated << p
+        end
+      }
+    }.should_not raise_error(Timeout::Error)
+    enumerated.should == @primes
+  end
+
+  it "returns an enumerator which independently enumerates" do
+    enum1 = @object.each(10)
+    enum2 = @object.each(10)
+
+    enum1.next.should == 2
+    enum1.next.should == 3
+    enum1.next.should == 5
+    enum2.next.should == 2
+    enum1.next.should == 7
+    enum2.next.should == 3
+  end
+
+  it "returns an enumerator which can be rewinded via #rewind" do
+    enum = @object.each(10)
+
+    enum.next.should == 2
+    enum.next.should == 3
+    enum.rewind
+    enum.next.should == 2
+  end
+
+  it "starts from 2 regardless of the prior #each" do
+    @object.each do |p|
+      break p > 10
+    end
+
+    prime = nil
+    @object.each do |p|
+      prime = p
+      break
+    end
+    prime.should == 2
+  end
+
+  it "starts from 2 regardless of the prior Prime.each.next" do
+    enum = @object.each(100)
+    enum.next.should == 2
+    enum.next.should == 3
+
+    prime = nil
+    @object.each do |p|
+      prime = p
+      break
+    end
+    prime.should == 2
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/prime/shared/next.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/prime/shared/next.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/prime/shared/next.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require 'stringio'
+
+describe :prime_next, :shared => true do
+  before(:all) do
+    @orig_stderr = $stderr
+    $stderr = StringIO.new('', 'w') # suppress warning
+  end
+  after(:all) do
+    $stderr = @orig_stderr
+  end
+
+  it "returns the element at the current position and moves forward" do
+    p = Prime.new
+    p.next.should == 2
+    p.next.should == 3
+    p.next.next.should == 6
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/prime/succ_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/prime/succ_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/prime/succ_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/next'
+require 'prime'
+
+describe "Prime#succ" do
+  it_behaves_like :prime_next, :succ
+end
+
+

Added: MacRuby/branches/experimental/spec/frozen/library/queue/append_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/queue/append_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/queue/append_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__)+'/../../spec_helper'
+require 'thread'
+require File.dirname(__FILE__)+'/shared/enque'
+
+describe "Queue#<<" do
+  it_behaves_like :queue_enq, :<<
+end

Added: MacRuby/branches/experimental/spec/frozen/library/queue/clear_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/queue/clear_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/queue/clear_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) +'/../../spec_helper'
+require 'thread'
+
+describe "Queue#clear" do
+  it "removes all objects from the queue" do
+    queue = Queue.new
+    queue << Object.new
+    queue << 1
+    queue.empty?.should be_false
+    queue.clear
+    queue.empty?.should be_true
+  end
+
+  # TODO: test for atomicity of Queue#clear
+end

Added: MacRuby/branches/experimental/spec/frozen/library/queue/deq_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/queue/deq_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/queue/deq_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__)+'/../../spec_helper'
+require 'thread'
+require File.dirname(__FILE__)+'/shared/deque'
+
+describe "Queue#deq" do
+  it_behaves_like :queue_deq, :deq
+end

Added: MacRuby/branches/experimental/spec/frozen/library/queue/empty_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/queue/empty_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/queue/empty_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) +'/../../spec_helper'
+require 'thread'
+
+describe "Queue#empty?" do
+  it "returns true on an empty Queue" do
+    queue = Queue.new
+    queue.empty?.should be_true
+  end
+
+  it "returns false when Queue is not empty" do
+    queue = Queue.new
+    queue << Object.new
+    queue.empty?.should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/queue/enq_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/queue/enq_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/queue/enq_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__)+'/../../spec_helper'
+require 'thread'
+require File.dirname(__FILE__)+'/shared/enque'
+
+describe "Queue#enq" do
+  it_behaves_like :queue_enq, :enq
+end

Added: MacRuby/branches/experimental/spec/frozen/library/queue/length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/queue/length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/queue/length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__)+'/../../spec_helper'
+require 'thread'
+require File.dirname(__FILE__)+'/shared/length'
+
+describe "Queue#length" do
+  it_behaves_like :queue_length, :length
+end

Added: MacRuby/branches/experimental/spec/frozen/library/queue/num_waiting_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/queue/num_waiting_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/queue/num_waiting_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) +'/../../spec_helper'
+require 'thread'
+
+describe "Queue#num_waiting" do
+  it "reports the number of threads waiting on the Queue" do
+    q = Queue.new
+    threads = []
+
+    5.times do |i|
+      q.num_waiting.should == i
+      threads << Thread.new { q.deq }
+    end
+
+    threads.each { q.enq Object.new }
+    threads.each {|t| t.join }
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/queue/pop_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/queue/pop_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/queue/pop_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__)+'/../../spec_helper'
+require 'thread'
+require File.dirname(__FILE__)+'/shared/deque'
+
+describe "Queue#pop" do
+  it_behaves_like :queue_deq, :pop
+end

Added: MacRuby/branches/experimental/spec/frozen/library/queue/push_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/queue/push_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/queue/push_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__)+'/../../spec_helper'
+require 'thread'
+require File.dirname(__FILE__)+'/shared/enque'
+
+describe "Queue#push" do
+  it_behaves_like :queue_enq, :push
+end

Added: MacRuby/branches/experimental/spec/frozen/library/queue/shared/deque.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/queue/shared/deque.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/queue/shared/deque.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,37 @@
+describe :queue_deq, :shared => true do
+  it "removes an item from the Queue" do
+    q = Queue.new
+    q << Object.new
+    q.size.should == 1
+    q.send(@method)
+    q.size.should == 0
+  end
+
+  it "returns items in the order they were added" do
+    q = Queue.new
+    q << 1
+    q << 2
+    q.send(@method).should == 1
+    q.send(@method).should == 2
+  end
+
+  it "blocks the thread until there are items in the queue" do
+    q = Queue.new
+    v = 0
+
+    th = Thread.new do
+      q.send(@method)
+      v = 1
+    end
+
+    v.should == 0
+    q << Object.new
+    th.join
+    v.should == 1
+  end
+
+  it "raises a ThreadError if Queue is empty" do
+    q = Queue.new
+    lambda { q.send(@method,true) }.should raise_error(ThreadError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/queue/shared/enque.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/queue/shared/enque.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/queue/shared/enque.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+describe :queue_enq, :shared => true do
+  it "adds an element to the Queue" do
+    q = Queue.new
+    q.size.should == 0
+    q.send(@method, Object.new)
+    q.size.should == 1
+    q.send(@method, Object.new)
+    q.size.should == 2
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/queue/shared/length.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/queue/shared/length.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/queue/shared/length.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+describe :queue_length, :shared => true do
+  it "returns the number of elements" do
+    q = Queue.new
+    q.send(@method).should == 0
+    q << Object.new
+    q << Object.new
+    q.send(@method).should == 2
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/queue/shift_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/queue/shift_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/queue/shift_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__)+'/../../spec_helper'
+require 'thread'
+require File.dirname(__FILE__)+'/shared/deque'
+
+describe "Queue#shift" do
+  it_behaves_like :queue_deq, :shift
+end

Added: MacRuby/branches/experimental/spec/frozen/library/queue/size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/queue/size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/queue/size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) +'/../../spec_helper'
+require 'thread'
+require File.dirname(__FILE__)+'/shared/length'
+
+describe "Queue#size" do
+  it_behaves_like :queue_length, :size
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rational/Rational_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rational/Rational_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rational/Rational_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,41 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'rational'
+
+describe "Rational when passed Integer, Integer" do
+  it "returns a new Rational number" do
+    Rational(1, 2).should == Rational.new!(1, 2)
+    Rational(-3, -5).should == Rational.new!(-3, -5)
+    Rational(bignum_value, 3).should == Rational.new!(bignum_value, 3)
+  end
+
+  it "automatically reduces the Rational" do
+    Rational(2, 4).should == Rational.new!(1, 2)
+    Rational(3, 9).should == Rational.new!(1, 3)
+  end
+end
+
+
+# Guard against the Mathn library
+conflicts_with :Prime do
+  describe "Rational when passed Integer" do
+    it "returns a new Rational number with 1 as the denominator" do
+      Rational(1).should eql(Rational.new!(1, 1))
+      Rational(-3).should eql(Rational.new!(-3, 1))
+      Rational(bignum_value).should eql(Rational.new!(bignum_value, 1))
+    end
+  end
+
+  describe "Rational when passed Integer and Rational::Unify is defined" do
+    after :each do
+      Rational.send :remove_const, :Unify
+    end
+
+    it "returns the passed Integer when Rational::Unify is defined" do
+      Rational::Unify = true
+
+      Rational(1).should eql(1)
+      Rational(-3).should eql(-3)
+      Rational(bignum_value).should eql(bignum_value)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rational/abs_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rational/abs_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rational/abs_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'rational'
+
+describe "Rational#abs" do
+  it "returns self's absolute value" do
+    Rational(3, 4).abs.should == Rational(3, 4)
+    Rational(-3, 4).abs.should == Rational(3, 4)
+    Rational(3, -4).abs.should == Rational(3, 4)
+    
+    Rational(bignum_value, -bignum_value).abs.should == Rational(bignum_value, bignum_value)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rational/coerce_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rational/coerce_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rational/coerce_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,38 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'rational'
+
+describe "Rational#coerce when passed [Rational]" do
+  it "returns the passed argument, self as Floats" do
+    result = Rational(3, 4).coerce(1.0)
+    result.should == [1.0, 0.75]
+    result.first.is_a?(Float).should be_true
+    result.last.is_a?(Float).should be_true
+  end
+end
+
+describe "Rational#coerce when passed [Rational]" do
+  it "returns the passed argument, self as Rationals" do
+    result = Rational(3, 4).coerce(10)
+    result.should == [Rational(10, 1), Rational(3, 4)]
+    result.first.is_a?(Rational).should be_true
+    result.last.is_a?(Rational).should be_true
+  end
+end
+
+describe "Rational#coerce" do
+  it "does try to convert the passed argument into a Float (using #to_f)" do
+    obj = mock("something")
+    obj.should_receive(:to_f).and_return(1.1)
+    Rational(3, 4).coerce(obj)
+  end
+  
+  it "returns the passed argument, self converted to Floats" do
+    obj = mock("something")
+    obj.should_receive(:to_f).and_return(1.1)
+    
+    result = Rational(3, 4).coerce(obj)
+    result.should == [1.1, 0.75]
+    result.first.is_a?(Float).should be_true
+    result.last.is_a?(Float).should be_true
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/rational/comparison_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rational/comparison_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rational/comparison_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,86 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'rational'
+
+describe "Rational#<=> when passed [Rational]" do
+  it "returns 1 when self is greater than the passed argument" do
+    (Rational(4, 4) <=> Rational(3, 4)).should equal(1)
+    (Rational(-3, 4) <=> Rational(-4, 4)).should equal(1)
+  end
+  
+  it "returns 0 when self is equal to the passed argument" do
+    (Rational(4, 4) <=> Rational(4, 4)).should equal(0)
+    (Rational(-3, 4) <=> Rational(-3, 4)).should equal(0)
+  end
+  
+  it "returns -1 when self is less than the passed argument" do
+    (Rational(3, 4) <=> Rational(4, 4)).should equal(-1)
+    (Rational(-4, 4) <=> Rational(-3, 4)).should equal(-1)
+  end
+end
+
+describe "Rational#<=> when passed [Integer]" do
+  it "returns 1 when self is greater than the passed argument" do
+    (Rational(4, 4) <=> 0).should equal(1)
+    (Rational(4, 4) <=> -10).should equal(1)
+    (Rational(-3, 4) <=> -1).should equal(1)
+  end
+  
+  it "returns 0 when self is equal to the passed argument" do
+    (Rational(4, 4) <=> 1).should equal(0)
+    (Rational(-8, 4) <=> -2).should equal(0)
+  end
+  
+  it "returns -1 when self is less than the passed argument" do
+    (Rational(3, 4) <=> 1).should equal(-1)
+    (Rational(-4, 4) <=> 0).should equal(-1)
+  end
+end
+
+describe "Rational#<=> when passed [Float]" do
+  it "returns 1 when self is greater than the passed argument" do
+    (Rational(4, 4) <=> 0.5).should equal(1)
+    (Rational(4, 4) <=> -1.5).should equal(1)
+    (Rational(-3, 4) <=> -0.8).should equal(1)
+  end
+  
+  it "returns 0 when self is equal to the passed argument" do
+    (Rational(4, 4) <=> 1.0).should equal(0)
+    (Rational(-6, 4) <=> -1.5).should equal(0)
+  end
+  
+  it "returns -1 when self is less than the passed argument" do
+    (Rational(3, 4) <=> 1.2).should equal(-1)
+    (Rational(-4, 4) <=> 0.5).should equal(-1)
+  end
+end
+
+describe "Rational#<=> when passed an Object that responds to #coerce" do
+  it "calls #coerce on the passed argument with self" do
+    rational = Rational(3, 4)
+        
+    obj = mock("Object")
+    obj.should_receive(:coerce).with(rational).and_return([1, 2])
+    
+    rational <=> obj
+  end
+  
+  it "calls #<=> on the coerced Rational with the coerced Object" do
+    rational = Rational(3, 4)
+
+    coerced_rational = mock("Coerced Rational")
+    coerced_rational.should_receive(:<=>).and_return(:result)
+    
+    coerced_obj = mock("Coerced Object")
+    
+    obj = mock("Object")
+    obj.should_receive(:coerce).and_return([coerced_rational, coerced_obj])
+
+    (rational <=> obj).should == :result
+  end
+end
+
+describe "Rational#<=>" do
+  it "returns nil" do
+    (Rational <=> mock("Object")).should be_nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rational/denominator_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rational/denominator_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rational/denominator_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'rational'
+
+describe "Rational#denominator" do
+  it "returns the denominator" do
+    Rational(3, 4).denominator.should equal(4)
+    Rational(3, -4).denominator.should equal(4)
+    
+    Rational(1, bignum_value).denominator.should == bignum_value
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rational/divide_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rational/divide_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rational/divide_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,72 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'rational'
+
+describe "Rational#/ when passed [Rational]" do
+  it "returns self divided by other as a Rational" do
+    (Rational(3, 4) / Rational(3, 4)).should eql(Rational(1, 1))
+    (Rational(2, 4) / Rational(1, 4)).should eql(Rational(2, 1))
+    
+    (Rational(2, 4) / 2).should == Rational(1, 4)
+    (Rational(6, 7) / -2).should == Rational(-3, 7)
+  end
+  
+  it "raises a ZeroDivisionError when passed a Rational with a numerator of 0" do
+    lambda { Rational(3, 4) / Rational(0, 1) }.should raise_error(ZeroDivisionError)
+  end
+end
+
+describe "Rational#/ when passed [Integer]" do
+  it "returns self divided by other as a Rational" do
+    (Rational(3, 4) / 2).should eql(Rational(3, 8))
+    (Rational(2, 4) / 2).should eql(Rational(1, 4))
+    (Rational(6, 7) / -2).should eql(Rational(-3, 7))
+  end
+  
+  it "raises a ZeroDivisionError when passed 0" do
+    lambda { Rational(3, 4) / 0 }.should raise_error(ZeroDivisionError)
+  end
+end
+
+describe "Raional#/ when passed [Float]" do
+  it "returns self divided by other as a Float" do
+    (Rational(3, 4) / 0.75).should eql(1.0)
+    (Rational(3, 4) / 0.25).should eql(3.0)
+    (Rational(3, 4) / 0.3).should eql(2.5)
+    
+    (Rational(-3, 4) / 0.3).should eql(-2.5)
+    (Rational(3, -4) / 0.3).should eql(-2.5)
+    (Rational(3, 4) / -0.3).should eql(-2.5)
+  end
+  
+  it "returns infinity when passed 0" do
+    (Rational(3, 4) / 0.0).infinite?.should eql(1)
+    (Rational(-3, -4) / 0.0).infinite?.should eql(1)
+    
+    (Rational(-3, 4) / 0.0).infinite?.should eql(-1)
+    (Rational(3, -4) / 0.0).infinite?.should eql(-1)
+  end
+end
+
+describe "Rational#/" do
+  it "calls #coerce on the passed argument with self" do
+    rational = Rational(3, 4)
+    obj = mock("Object")
+    obj.should_receive(:coerce).with(rational).and_return([1, 2])
+    
+    rational / obj
+  end
+
+  it "calls #/ on the coerced Rational with the coerced Object" do
+    rational = Rational(3, 4)
+
+    coerced_rational = mock("Coerced Rational")
+    coerced_rational.should_receive(:/).and_return(:result)
+    
+    coerced_obj = mock("Coerced Object")
+    
+    obj = mock("Object")
+    obj.should_receive(:coerce).and_return([coerced_rational, coerced_obj])
+
+    (rational / obj).should == :result
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/rational/divmod_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rational/divmod_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rational/divmod_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,45 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'rational'
+
+describe "Rational#divmod when passed [Rational]" do
+  it "returns the quotient as Integer and the remainder as Rational" do
+    Rational(7, 4).divmod(Rational(1, 2)).should eql([3, Rational(1, 4)])
+    Rational(7, 4).divmod(Rational(-1, 2)).should eql([-4, Rational(-1, 4)])
+    Rational(0, 4).divmod(Rational(4, 3)).should eql([0, Rational(0, 1)])
+    
+    Rational(bignum_value, 4).divmod(Rational(4, 3)).should eql([1729382256910270464, Rational(0, 1)])
+  end
+
+  it "raises a ZeroDivisonError when passed a Rational with a numerator of 0" do
+    lambda { Rational(7, 4).divmod(Rational(0, 3)) }.should raise_error(ZeroDivisionError)
+  end
+end
+
+describe "Rational#divmod when passed [Integer]" do
+  it "returns the quotient as Integer and the remainder as Rational" do
+    Rational(7, 4).divmod(2).should eql([0, Rational(7, 4)])
+    Rational(7, 4).divmod(-2).should eql([-1, Rational(-1, 4)])
+
+    Rational(bignum_value, 4).divmod(3).should == [768614336404564650, Rational(2, 1)]
+  end
+
+  it "raises a ZeroDivisionError when passed 0" do
+    lambda { Rational(7, 4).divmod(0) }.should raise_error(ZeroDivisionError)
+  end
+end
+
+describe "Rational#divmod when passed [Float]" do
+  it "returns the quotient as Integer and the remainder as Float" do
+    Rational(7, 4).divmod(0.5).should eql([3, 0.25])
+  end
+
+  ruby_bug "#", "1.8.6" do # Fixed at MRI 1.8.7
+    it "returns the quotient as Integer and the remainder as Float" do
+      Rational(7, 4).divmod(-0.5).should eql([-4, -0.25])
+    end
+  end
+  
+  it "raises a FloatDomainError when passed 0" do
+    lambda { Rational(7, 4).divmod(0.0) }.should raise_error(FloatDomainError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rational/equal_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rational/equal_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rational/equal_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,52 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'rational'
+
+describe "Rational#== when passed [Rational]" do
+  it "returns true if self has the same numerator and denominator as the passed argument" do
+    (Rational(3, 4) == Rational(3, 4)).should be_true
+    (Rational(-3, -4) == Rational(3, 4)).should be_true
+    (Rational(-4, 5) == Rational(4, -5)).should be_true
+    
+    (Rational(bignum_value, 3) == Rational(bignum_value, 3)).should be_true
+    (Rational(-bignum_value, 3) == Rational(bignum_value, -3)).should be_true
+  end
+  
+  it "returns false if self has different numerator/denominator but the same numerical value as the passed argument" do
+    (Rational(3, 4) == Rational.new!(6, 8)).should be_false
+    (Rational(-3, 4) == Rational.new!(-6, 8)).should be_false
+  end
+end
+
+describe "Rational#== when passed [Integer]" do
+  it "returns true if self has the passed argument as numerator and a denominator of 1" do
+    # Rational(x, y) reduces x and y automatically
+    (Rational(4, 2) == 2).should be_true
+    (Rational(-4, 2) == -2).should be_true
+    (Rational(4, -2) == -2).should be_true
+
+    (Rational.new!(4, 2) == 2).should be_false
+    (Rational.new!(9, 3) == 3).should be_false
+  end
+end
+
+describe "Rational#== when passed [Float]" do
+  it "converts self to a Float and compares it with the passed argument" do
+    (Rational(3, 4) == 0.75).should be_true
+    (Rational(4, 2) == 2.0).should be_true
+    (Rational(-4, 2) == -2.0).should be_true
+    (Rational(4, -2) == -2.0).should be_true
+
+    # This is inconsistent to behaviour when passed Integers or Rationals
+    (Rational.new!(4, 2) == 2.0).should be_true
+    (Rational.new!(9, 3) == 3.0).should be_true
+  end
+end
+
+describe "Rational#==" do
+  it "returns the result of calling #== with self on the passed argument" do
+    obj = mock("Object")
+    obj.should_receive(:==).and_return(:result)
+    
+    (Rational(3, 4) == obj).should == :result
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/rational/exponent_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rational/exponent_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rational/exponent_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,95 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'rational'
+
+describe "Rational#** when passed [Rational]" do
+  conflicts_with :Prime do
+    it "converts self to a Float and returns it raised to the passed argument" do
+      (Rational(3, 4) ** Rational(4, 3)).should be_close(0.681420222312052, TOLERANCE)
+      (Rational(3, 4) ** Rational(-4, 3)).should be_close(1.46752322173095, TOLERANCE)
+      (Rational(3, 4) ** Rational(4, -3)).should be_close(1.46752322173095, TOLERANCE)
+
+      (Rational(3, 4) ** Rational(0, 3)).should eql(1.0)
+      (Rational(-3, 4) ** Rational(0, 3)).should eql(1.0)
+      (Rational(3, -4) ** Rational(0, 3)).should eql(1.0)
+      (Rational(3, 4) ** Rational(0, -3)).should eql(1.0)
+
+      (Rational(bignum_value, 4) ** Rational(0, 3)).should eql(1.0)
+      (Rational(3, -bignum_value) ** Rational(0, 3)).should eql(1.0)
+      (Rational(3, 4) ** Rational(0, bignum_value)).should eql(1.0)
+      (Rational(3, 4) ** Rational(0, -bignum_value)).should eql(1.0)
+    end
+
+    it "returns NaN when self is negative and the passed argument is not 0" do
+      (Rational(-3, 4) ** Rational(-4, 3)).nan?.should be_true
+    end
+  end
+end
+
+describe "Rational#** when passed [Integer]" do
+  it "returns the Rational value of self raised to the passed argument" do
+    (Rational(3, 4) ** 4).should == Rational(81, 256)
+    (Rational(3, 4) ** -4).should == Rational(256, 81)
+    (Rational(-3, 4) ** -4).should == Rational(256, 81)
+    (Rational(3, -4) ** -4).should == Rational(256, 81)
+
+    (Rational(bignum_value, 4) ** 4).should == Rational(28269553036454149273332760011886696253239742350009903329945699220681916416, 1)
+    (Rational(3, bignum_value) ** -4).should == Rational(7237005577332262213973186563042994240829374041602535252466099000494570602496, 81)
+    (Rational(-bignum_value, 4) ** -4).should == Rational(1, 28269553036454149273332760011886696253239742350009903329945699220681916416)
+    (Rational(3, -bignum_value) ** -4).should == Rational(7237005577332262213973186563042994240829374041602535252466099000494570602496, 81)
+  end
+  
+  conflicts_with :Prime do
+    it "returns Rational(1, 1) when the passed argument is 0" do
+      (Rational(3, 4) ** 0).should eql(Rational(1, 1))
+      (Rational(-3, 4) ** 0).should eql(Rational(1, 1))
+      (Rational(3, -4) ** 0).should eql(Rational(1, 1))
+
+      (Rational(bignum_value, 4) ** 0).should eql(Rational(1, 1))
+      (Rational(3, -bignum_value) ** 0).should eql(Rational(1, 1))
+    end
+  end
+end
+
+describe "Rational#** when passed [Float]" do
+  it "returns self converted to Float and raised to the passed argument" do
+    (Rational(3, 1) ** 3.0).should eql(27.0)
+    (Rational(3, 1) ** 1.5).should be_close(5.19615242270663, TOLERANCE)
+    (Rational(3, 1) ** -1.5).should be_close(0.192450089729875, TOLERANCE)
+  end
+  
+  it "returns 1.0 when the passed argument is 0" do
+    (Rational(3, 4) ** 0.0).should eql(1.0)
+    (Rational(-3, 4) ** 0.0).should eql(1.0)
+    (Rational(-3, 4) ** 0.0).should eql(1.0)
+  end
+  
+  it "returns NaN if self is negative and the passed argument is not 0" do
+    (Rational(-3, 2) ** 1.5).nan?.should be_true
+    (Rational(3, -2) ** 1.5).nan?.should be_true
+    (Rational(3, -2) ** -1.5).nan?.should be_true
+  end
+end
+
+describe "Rational#**" do
+  it "calls #coerce on the passed argument with self" do
+    rational = Rational(3, 4)
+    obj = mock("Object")
+    obj.should_receive(:coerce).with(rational).and_return([1, 2])
+    
+    rational ** obj
+  end
+
+  it "calls #** on the coerced Rational with the coerced Object" do
+    rational = Rational(3, 4)
+
+    coerced_rational = mock("Coerced Rational")
+    coerced_rational.should_receive(:**).and_return(:result)
+    
+    coerced_obj = mock("Coerced Object")
+    
+    obj = mock("Object")
+    obj.should_receive(:coerce).and_return([coerced_rational, coerced_obj])
+
+    (rational ** obj).should == :result
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rational/hash_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rational/hash_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rational/hash_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'rational'
+
+describe "Rational#hash" do
+  # BUG: Rational(2, 3).hash == Rational(3, 2).hash
+  it "is static" do
+    Rational(2, 3).hash.should == Rational(2, 3).hash
+    Rational(2, 4).hash.should_not == Rational(2, 3).hash
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rational/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rational/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rational/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'rational'
+
+describe "Rational#initialize" do
+  before(:each) do
+    @rational = Rational.allocate
+  end
+  
+  it "turns around the numerators and denominators signs around when the denominator is negative" do
+    @rational.send(:initialize, 1, -2)
+    @rational.numerator.should == -1
+    @rational.denominator.should == 2
+  end
+
+  # I think this should work (at least Rational#initialize seems to be intended for this)
+  # it "tries to convert the passed numerator and denominator to Integers using #to_i" do
+  #   @rational.send(:initialize, "1", "2")
+  #   @rational.numerator.should == "1"
+  #   @rational.denominator.should == "2"
+  # end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rational/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rational/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rational/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'rational'
+
+describe "Rational#inspect" do
+  conflicts_with :Prime do
+    it "returns a reconstructable string representation of self" do
+      Rational(3, 4).inspect.should == "Rational(3, 4)"
+      Rational(-5, 8).inspect.should == "Rational(-5, 8)"
+      Rational(-1, -2).inspect.should == "Rational(1, 2)"
+      Rational(bignum_value, 1).inspect.should == "Rational(#{bignum_value}, 1)"
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rational/minus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rational/minus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rational/minus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,49 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'rational'
+
+describe "Rational#- when passed [Rational]" do
+  it "returns the result of substracting other from self as a Rational" do
+    (Rational(3, 4) - Rational(0, 1)).should eql(Rational(3, 4))
+    (Rational(3, 4) - Rational(1, 4)).should eql(Rational(1, 2))
+
+    (Rational(3, 4) - Rational(2, 1)).should eql(Rational(-5, 4))
+  end
+end
+
+describe "Rational#- when passed [Integer]" do
+  it "returns the result of substracting other from self as a Rational" do
+    (Rational(3, 4) - 1).should eql(Rational(-1, 4))
+    (Rational(3, 4) - 2).should eql(Rational(-5, 4))
+  end
+end
+
+describe "Rational#- when passed [Float]" do
+  it "returns the result of substracting other from self as a Float" do
+    (Rational(3, 4) - 0.2).should eql(0.55)
+    (Rational(3, 4) - 2.5).should eql(-1.75)
+  end
+end
+
+describe "Rational#-" do
+  it "calls #coerce on the passed argument with self" do
+    rational = Rational(3, 4)
+    obj = mock("Object")
+    obj.should_receive(:coerce).with(rational).and_return([1, 2])
+    
+    rational - obj
+  end
+
+  it "calls #- on the coerced Rational with the coerced Object" do
+    rational = Rational(3, 4)
+
+    coerced_rational = mock("Coerced Rational")
+    coerced_rational.should_receive(:-).and_return(:result)
+    
+    coerced_obj = mock("Coerced Object")
+    
+    obj = mock("Object")
+    obj.should_receive(:coerce).and_return([coerced_rational, coerced_obj])
+
+    (rational - obj).should == :result
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/rational/modulo_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rational/modulo_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rational/modulo_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'rational'
+
+describe "Rational#%" do
+  it "returns the remainder when this value is divided by other" do
+    (Rational(2, 3) % Rational(2, 3)).should == Rational(0, 1)
+    (Rational(4, 3) % Rational(2, 3)).should == Rational(0, 1)
+    (Rational(2, -3) % Rational(-2, 3)).should == Rational(0, 1)
+    (Rational(0, -1) % -1).should == Rational(0, 1)
+
+    (Rational(7, 4) % Rational(1, 2)).should == Rational(1, 4)
+    (Rational(7, 4) % 1).should == Rational(3, 4)
+    (Rational(7, 4) % Rational(1, 7)).should == Rational(1, 28)
+
+    (Rational(3, 4) % -1).should == Rational(-1, 4)
+    (Rational(1, -5) % -1).should == Rational(-1, 5)
+  end
+
+  it "returns a Float value when the argument is Float" do
+    (Rational(7, 4) % 1.0).should be_kind_of(Float)
+    (Rational(7, 4) % 1.0).should == 0.75
+    (Rational(7, 4) % 0.26).should be_close(0.19, 0.0001)
+  end
+
+  it "raises ZeroDivisionError on zero denominator" do
+    lambda { Rational(3, 5) % Rational(0, 1) }.should raise_error(ZeroDivisionError)
+    lambda { Rational(0, 1) % Rational(0, 1) }.should raise_error(ZeroDivisionError)
+    lambda { Rational(3, 5) % 0 }.should raise_error(ZeroDivisionError)
+  end
+
+  it "raises FloatDomainError when the argument is 0.0" do
+    lambda { Rational(3, 5) % 0.0 }.should raise_error(FloatDomainError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rational/multiply_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rational/multiply_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rational/multiply_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,63 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'rational'
+
+describe "Rational#* when passed [Rational]" do
+  it "returns self divided by other as a Rational" do
+    (Rational(3, 4) * Rational(3, 4)).should eql(Rational(9, 16))
+    (Rational(2, 4) * Rational(1, 4)).should eql(Rational(1, 8))
+
+    (Rational(3, 4) * Rational(0, 1)).should eql(Rational(0, 4))
+  end
+end
+
+describe "Rational#* when passed [Integer]" do
+  it "returns self divided by other as a Rational" do
+    (Rational(3, 4) * 2).should eql(Rational(3, 2))
+    (Rational(2, 4) * 2).should eql(Rational(1, 1))
+    (Rational(6, 7) * -2).should eql(Rational(-12, 7))
+
+    (Rational(3, 4) * 0).should eql(Rational(0, 4))
+  end
+end
+
+describe "Raional#/ when passed [Float]" do
+  it "returns self divided by other as a Float" do
+    (Rational(3, 4) * 0.75).should eql(0.5625)
+    (Rational(3, 4) * 0.25).should eql(0.1875)
+    (Rational(3, 4) * 0.3).should be_close(0.225, TOLERANCE)
+    
+    (Rational(-3, 4) * 0.3).should be_close(-0.225, TOLERANCE)
+    (Rational(3, -4) * 0.3).should be_close(-0.225, TOLERANCE)
+    (Rational(3, 4) * -0.3).should be_close(-0.225, TOLERANCE)
+
+    (Rational(3, 4) * 0.0).should eql(0.0)
+    (Rational(-3, -4) * 0.0).should eql(0.0)
+    
+    (Rational(-3, 4) * 0.0).should eql(0.0)
+    (Rational(3, -4) * 0.0).should eql(0.0)
+  end
+end
+
+describe "Rational#*" do
+  it "calls #coerce on the passed argument with self" do
+    rational = Rational(3, 4)
+    obj = mock("Object")
+    obj.should_receive(:coerce).with(rational).and_return([1, 2])
+    
+    rational * obj
+  end
+
+  it "calls #* on the coerced Rational with the coerced Object" do
+    rational = Rational(3, 4)
+
+    coerced_rational = mock("Coerced Rational")
+    coerced_rational.should_receive(:*).and_return(:result)
+    
+    coerced_obj = mock("Coerced Object")
+    
+    obj = mock("Object")
+    obj.should_receive(:coerce).and_return([coerced_rational, coerced_obj])
+
+    (rational * obj).should == :result
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/rational/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rational/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rational/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'rational'
+
+describe "Rational.new" do
+  it "is private" do
+    Rational.private_methods.should include("new")
+  end
+end
+
+describe "Rational.new!" do
+  it "returns a Rational with the passed numerator and denominator not reduced to their lowest terms" do
+    Rational.new!(2, 4).should_not eql(Rational(1, 4))
+    Rational.new!(6, 8).should_not eql(Rational(3, 4))
+    Rational.new!(-5, 10).should_not eql(Rational(-1, 2))
+  end
+  
+  it "does not check for divisions by 0" do
+    lambda { Rational.new!(4, 0) }.should_not raise_error(ZeroDivisionError)
+    lambda { Rational.new!(0, 0) }.should_not raise_error(ZeroDivisionError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rational/numerator_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rational/numerator_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rational/numerator_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'rational'
+
+describe "Rational#numerator" do
+  it "returns the numerator" do
+    Rational(3, 4).numerator.should equal(3)
+    Rational(3, -4).numerator.should equal(-3)
+    
+    Rational(bignum_value, 1).numerator.should == bignum_value
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rational/plus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rational/plus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rational/plus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,49 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'rational'
+
+describe "Rational#+ when passed [Rational]" do
+  it "returns the result of substracting other from self as a Rational" do
+    (Rational(3, 4) + Rational(0, 1)).should eql(Rational(3, 4))
+    (Rational(3, 4) + Rational(1, 4)).should eql(Rational(1, 1))
+
+    (Rational(3, 4) + Rational(2, 1)).should eql(Rational(11, 4))
+  end
+end
+
+describe "Rational#+ when passed [Integer]" do
+  it "returns the result of substracting other from self as a Rational" do
+    (Rational(3, 4) + 1).should eql(Rational(7, 4))
+    (Rational(3, 4) + 2).should eql(Rational(11, 4))
+  end
+end
+
+describe "Rational#+ when passed [Float]" do
+  it "returns the result of substracting other from self as a Float" do
+    (Rational(3, 4) + 0.2).should eql(0.95)
+    (Rational(3, 4) + 2.5).should eql(3.25)
+  end
+end
+
+describe "Rational#+" do
+  it "calls #coerce on the passed argument with self" do
+    rational = Rational(3, 4)
+    obj = mock("Object")
+    obj.should_receive(:coerce).with(rational).and_return([1, 2])
+    
+    rational + obj
+  end
+
+  it "calls #+ on the coerced Rational with the coerced Object" do
+    rational = Rational(3, 4)
+
+    coerced_rational = mock("Coerced Rational")
+    coerced_rational.should_receive(:+).and_return(:result)
+    
+    coerced_obj = mock("Coerced Object")
+    
+    obj = mock("Object")
+    obj.should_receive(:coerce).and_return([coerced_rational, coerced_obj])
+
+    (rational + obj).should == :result
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/rational/reduce_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rational/reduce_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rational/reduce_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'rational'
+
+describe "Rational.reduce when Unify is defined" do
+  # This is not consistent with the Complex library, Complex checks
+  # Complex::Unify and not the top-level Unify.
+  it "returns an Integer when the reduced denominator is 1" do
+    begin
+      Unify = true
+      
+      Rational.reduce(3, 1).should eql(3)
+      Rational.reduce(5, 1).should eql(5)
+      Rational.reduce(4, 2).should eql(2)
+      Rational.reduce(-9, 3).should eql(-3)
+    ensure
+      Object.send :remove_const, :Unify
+    end
+  end
+end
+
+describe "Rational.reduce" do
+  it "returns a new Rational with the passed numerator and denominator reduced to their lowest terms" do
+    Rational(6, 8).should eql(Rational(3, 4))
+    Rational(-5, 10).should eql(Rational(-1, 2))
+  end
+  
+  it "raises a ZeroDivisionError when the passed denominator is 0" do
+    lambda { Rational.reduce(4, 0) }.should raise_error(ZeroDivisionError)
+    lambda { Rational.reduce(-1, 0) }.should raise_error(ZeroDivisionError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rational/to_f_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rational/to_f_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rational/to_f_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'rational'
+
+describe "Rational#to_f" do
+  it "returns self converted to a Float" do
+    Rational(3, 4).to_f.should eql(0.75)
+    Rational(3, -4).to_f.should eql(-0.75)
+    Rational(-1, 4).to_f.should eql(-0.25)
+    Rational(-1, -4).to_f.should eql(0.25)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rational/to_i_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rational/to_i_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rational/to_i_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'rational'
+
+describe "Rational#to_i" do
+  it "converts self to an Integer by truncation" do
+    Rational(7, 4).to_i.should eql(1)
+    Rational(11, 4).to_i.should eql(2)
+  end
+
+  ruby_bug "#", "1.8.6" do
+    it "converts self to an Integer by truncation" do
+      Rational(-7, 4).to_i.should eql(-1)
+    end
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rational/to_r_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rational/to_r_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rational/to_r_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'rational'
+
+describe "Rational#to_r" do
+  conflicts_with :Prime do
+    it "returns self" do
+      a = Rational(3, 4)
+      a.to_r.should equal(a)
+
+      a = Rational(bignum_value, 4)
+      a.to_r.should equal(a)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rational/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rational/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rational/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'rational'
+
+describe "Rational#to_s" do
+  it "returns a string representation of self" do
+    Rational(1, 1).to_s.should == "1"
+    Rational(2, 1).to_s.should == "2"
+    Rational(1, 2).to_s.should == "1/2"
+    Rational(-1, 3).to_s.should == "-1/3"
+    Rational(1, -3).to_s.should == "-1/3"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/readline/basic_quote_characters_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/readline/basic_quote_characters_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/readline/basic_quote_characters_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+process_is_foreground do
+
+  not_supported_on :ironruby do
+    require 'readline'
+    describe "Readline.basic_quote_characters" do
+      it "needs to be reviewed for spec completeness"
+    end
+
+    describe "Readline.basic_quote_characters=" do
+      it "needs to be reviewed for spec completeness"
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/readline/basic_word_break_characters_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/readline/basic_word_break_characters_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/readline/basic_word_break_characters_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+process_is_foreground do
+
+  not_supported_on :ironruby do
+    require 'readline'
+    describe "Readline.basic_word_break_characters" do
+      it "needs to be reviewed for spec completeness"
+    end
+
+    describe "Readline.basic_word_break_characters=" do
+      it "needs to be reviewed for spec completeness"
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/readline/completer_quote_characters_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/readline/completer_quote_characters_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/readline/completer_quote_characters_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+process_is_foreground do
+
+  not_supported_on :ironruby do
+    require 'readline'
+    describe "Readline.completer_quote_characters" do
+      it "needs to be reviewed for spec completeness"
+    end
+
+    describe "Readline.completer_quote_characters=" do
+      it "needs to be reviewed for spec completeness"
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/readline/completer_word_break_characters_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/readline/completer_word_break_characters_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/readline/completer_word_break_characters_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+process_is_foreground do
+
+  not_supported_on :ironruby do
+    require 'readline'
+    describe "Readline.completer_word_break_characters" do
+      it "needs to be reviewed for spec completeness"
+    end
+
+    describe "Readline.completer_word_break_characters=" do
+      it "needs to be reviewed for spec completeness"
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/readline/completion_append_character_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/readline/completion_append_character_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/readline/completion_append_character_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+process_is_foreground do
+
+  not_supported_on :ironruby do
+    require 'readline'
+    describe "Readline.completion_append_character" do
+      it "needs to be reviewed for spec completeness"
+    end
+
+    describe "Readline.completion_append_character=" do
+      it "needs to be reviewed for spec completeness"
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/readline/completion_case_fold_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/readline/completion_case_fold_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/readline/completion_case_fold_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+process_is_foreground do
+
+  not_supported_on :ironruby do
+    require 'readline'
+    describe "Readline.completion_case_fold" do
+      it "needs to be reviewed for spec completeness"
+    end
+
+    describe "Readline.completion_case_fold=" do
+      it "needs to be reviewed for spec completeness"
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/readline/completion_proc_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/readline/completion_proc_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/readline/completion_proc_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+process_is_foreground do
+
+  not_supported_on :ironruby do
+    require 'readline'
+    describe "Readline.completion_proc" do
+      it "needs to be reviewed for spec completeness"
+    end
+
+    describe "Readline.completion_proc=" do
+      it "needs to be reviewed for spec completeness"
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/readline/constants_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/readline/constants_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/readline/constants_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+process_is_foreground do
+
+  not_supported_on :ironruby do
+    require 'readline'
+    # Note: additional specs for HISTORY are in 'history' subdir.
+    describe "Readline::HISTORY" do
+      it "is defined" do
+        Readline.const_defined?(:HISTORY).should == true
+      end
+    end
+
+    describe "Readline::VERSION" do
+      it "is defined and is a non-empty String" do
+        Readline.const_defined?(:VERSION).should == true
+        Readline::VERSION.should be_kind_of(String)
+        Readline::VERSION.should_not be_empty
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/readline/emacs_editing_mode_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/readline/emacs_editing_mode_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/readline/emacs_editing_mode_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+process_is_foreground do
+
+  not_supported_on :ironruby do
+    require 'readline'
+    describe "Readline.emacs_editing_mode" do
+      it "needs to be reviewed for spec completeness"
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/readline/filename_quote_characters_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/readline/filename_quote_characters_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/readline/filename_quote_characters_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+process_is_foreground do
+
+  not_supported_on :ironruby do
+    require 'readline'
+    describe "Readline.filename_quote_characters" do
+      it "needs to be reviewed for spec completeness"
+    end
+
+    describe "Readline.filename_quote_characters=" do
+      it "needs to be reviewed for spec completeness"
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/readline/history/append_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/readline/history/append_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/readline/history/append_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+process_is_foreground do
+
+  not_supported_on :ironruby do
+    require 'readline'
+    describe "Readline::HISTORY.<<" do
+      it "appends the given Object to the history" do
+        Readline::HISTORY << "1"
+        Readline::HISTORY.size.should == 1
+
+        Readline::HISTORY << "2"
+        Readline::HISTORY.size.should == 2
+
+        Readline::HISTORY.pop.should == "2"
+        Readline::HISTORY.pop.should == "1"
+      end
+
+      it "tries to convert the passed Object to a String using #to_str" do
+        obj = mock("Converted to String")
+        obj.should_receive(:to_str).and_return("converted")
+
+        Readline::HISTORY << obj
+        Readline::HISTORY.pop.should == "converted"
+      end
+
+      it "raises a TypeError when the passed Object can't be converted to a String" do
+        lambda { Readline::HISTORY << mock("Object") }.should raise_error(TypeError)
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/readline/history/delete_at_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/readline/history/delete_at_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/readline/history/delete_at_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,49 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+process_is_foreground do
+
+  not_supported_on :ironruby do
+    require 'readline'
+    describe "Readline::HISTORY.delete_at" do
+      it "deletes and returns the history entry at the specified index" do
+        Readline::HISTORY.push("1", "2", "3")
+
+        Readline::HISTORY.delete_at(1).should == "2"
+        Readline::HISTORY.size.should == 2
+
+        Readline::HISTORY.delete_at(1).should == "3"
+        Readline::HISTORY.size.should == 1
+
+        Readline::HISTORY.delete_at(0).should == "1"
+        Readline::HISTORY.size.should == 0
+
+
+        Readline::HISTORY.push("1", "2", "3", "4")
+
+        Readline::HISTORY.delete_at(-2).should == "3"
+        Readline::HISTORY.size.should == 3
+
+        Readline::HISTORY.delete_at(-2).should == "2"
+        Readline::HISTORY.size.should == 2
+
+        Readline::HISTORY.delete_at(0).should == "1"
+        Readline::HISTORY.size.should == 1
+
+        Readline::HISTORY.delete_at(0).should == "4"
+        Readline::HISTORY.size.should == 0
+      end
+
+      it "raises an IndexError when the given index is greater than the history size" do
+        lambda { Readline::HISTORY.delete_at(10) }.should raise_error(IndexError)
+        lambda { Readline::HISTORY.delete_at(-10) }.should raise_error(IndexError)
+      end
+
+      it "taints the returned strings" do
+        Readline::HISTORY.push("1", "2", "3")
+        Readline::HISTORY.delete_at(0).tainted?.should be_true
+        Readline::HISTORY.delete_at(0).tainted?.should be_true
+        Readline::HISTORY.delete_at(0).tainted?.should be_true
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/readline/history/each_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/readline/history/each_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/readline/history/each_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+process_is_foreground do
+
+  not_supported_on :ironruby do
+    require 'readline'
+    describe "Readline::HISTORY.each" do
+      before(:each) do
+        Readline::HISTORY.push("1", "2", "3")
+      end
+
+      after(:each) do
+        Readline::HISTORY.pop
+        Readline::HISTORY.pop
+        Readline::HISTORY.pop
+      end
+
+      it "yields each item in the history" do
+        result = []
+        Readline::HISTORY.each do |x|
+          result << x
+        end
+        result.should == ["1", "2", "3"]
+      end
+
+      it "yields tainted Objects" do
+        Readline::HISTORY.each do |x|
+          x.tainted?.should be_true
+        end
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/readline/history/element_reference_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/readline/history/element_reference_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/readline/history/element_reference_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,44 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+process_is_foreground do
+
+  not_supported_on :ironruby do
+    require 'readline'
+    describe "Readline::HISTORY.[]" do
+      before(:each) do
+        Readline::HISTORY.push("1", "2", "3")
+      end
+
+      after(:each) do
+        Readline::HISTORY.pop
+        Readline::HISTORY.pop
+        Readline::HISTORY.pop
+      end
+
+      it "returns tainted objects" do
+        Readline::HISTORY[0].tainted?.should be_true
+        Readline::HISTORY[1].tainted?.should be_true
+      end
+
+      it "returns the history item at the passed index" do
+        Readline::HISTORY[0].should == "1"
+        Readline::HISTORY[1].should == "2"
+        Readline::HISTORY[2].should == "3"
+
+        Readline::HISTORY[-1].should == "3"
+        Readline::HISTORY[-2].should == "2"
+        Readline::HISTORY[-3].should == "1"
+      end
+
+      it "raises an IndexError when there is no item at the passed index" do
+        lambda { Readline::HISTORY[-10] }.should raise_error(IndexError)
+        lambda { Readline::HISTORY[-9] }.should raise_error(IndexError)
+        lambda { Readline::HISTORY[-8] }.should raise_error(IndexError)
+
+        lambda { Readline::HISTORY[8] }.should raise_error(IndexError)
+        lambda { Readline::HISTORY[9] }.should raise_error(IndexError)
+        lambda { Readline::HISTORY[10] }.should raise_error(IndexError)
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/readline/history/element_set_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/readline/history/element_set_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/readline/history/element_set_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,39 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+process_is_foreground do
+
+  not_supported_on :ironruby do
+    require 'readline'
+    describe "Readline::HISTORY.[]=" do
+      before(:each) do
+        Readline::HISTORY.push("1", "2", "3")
+      end
+
+      after(:each) do
+        Readline::HISTORY.pop
+        Readline::HISTORY.pop
+        Readline::HISTORY.pop
+      end
+
+      it "returns the new value for the passed index" do
+        (Readline::HISTORY[1] = "second test").should == "second test"
+      end
+
+      it "raises an IndexError when there is no item at the passed positive index" do
+        lambda { Readline::HISTORY[10] = "test" }.should raise_error(IndexError)
+      end
+
+      it "sets the item at the given index" do
+        Readline::HISTORY[0] = "test"
+        Readline::HISTORY[0].should == "test"
+
+        Readline::HISTORY[1] = "second test"
+        Readline::HISTORY[1].should == "second test"
+      end
+
+      it "raises an IndexError when there is no item at the passed negative index" do
+        lambda { Readline::HISTORY[10] = "test" }.should raise_error(IndexError)
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/readline/history/empty_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/readline/history/empty_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/readline/history/empty_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+process_is_foreground do
+
+  not_supported_on :ironruby do
+    require 'readline'
+    describe "Readline::HISTORY.empty?" do
+      it "returns true when the history is empty" do
+        Readline::HISTORY.should be_empty
+        Readline::HISTORY.push("test")
+        Readline::HISTORY.should_not be_empty
+        Readline::HISTORY.pop
+        Readline::HISTORY.should be_empty
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/readline/history/history_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/readline/history/history_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/readline/history/history_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+process_is_foreground do
+
+  not_supported_on :ironruby do
+    require 'readline'
+    describe "Readline::HISTORY" do
+      it "is extended with the Enumerable module" do
+        Readline::HISTORY.should be_kind_of(Enumerable)
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/readline/history/length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/readline/history/length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/readline/history/length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+process_is_foreground do
+
+  not_supported_on :ironruby do
+    require 'readline'
+    require File.dirname(__FILE__) + '/shared/size'
+
+    describe "Readline::HISTORY.length" do
+      it_behaves_like :readline_history_size, :length
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/readline/history/pop_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/readline/history/pop_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/readline/history/pop_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+process_is_foreground do
+
+  not_supported_on :ironruby do
+    require 'readline'
+    describe "Readline::HISTORY.pop" do
+      it "returns nil when the history is empty" do
+        Readline::HISTORY.pop.should be_nil
+      end
+
+      it "returns and removes the last item from the history" do
+        Readline::HISTORY.push("1", "2", "3")
+        Readline::HISTORY.size.should == 3
+
+        Readline::HISTORY.pop.should == "3"
+        Readline::HISTORY.size.should == 2
+
+        Readline::HISTORY.pop.should == "2"
+        Readline::HISTORY.size.should == 1
+
+        Readline::HISTORY.pop.should == "1"
+        Readline::HISTORY.size.should == 0
+      end
+
+      it "taints the returned strings" do
+        Readline::HISTORY.push("1", "2", "3")
+        Readline::HISTORY.pop.tainted?.should be_true
+        Readline::HISTORY.pop.tainted?.should be_true
+        Readline::HISTORY.pop.tainted?.should be_true
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/readline/history/push_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/readline/history/push_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/readline/history/push_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,30 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+process_is_foreground do
+
+  not_supported_on :ironruby do
+    require 'readline'
+    describe "Readline::HISTORY.push" do
+      it "pushes all passed Objects into the history" do
+        Readline::HISTORY.push("1", "2", "3")
+        Readline::HISTORY.size.should == 3
+
+        Readline::HISTORY.pop.should == "3"
+        Readline::HISTORY.pop.should == "2"
+        Readline::HISTORY.pop.should == "1"
+      end
+
+      it "tries to convert the passed Object to a String using #to_str" do
+        obj = mock("Converted to String")
+        obj.should_receive(:to_str).and_return("converted")
+
+        Readline::HISTORY.push(obj)
+        Readline::HISTORY.pop.should == "converted"
+      end
+
+      it "raises a TypeError when the passed Object can't be converted to a String" do
+        lambda { Readline::HISTORY.push(mock("Object")) }.should raise_error(TypeError)
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/readline/history/shared/size.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/readline/history/shared/size.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/readline/history/shared/size.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+describe :readline_history_size, :shared => true do
+  it "returns the size of the history" do
+    Readline::HISTORY.send(@method).should == 0
+    Readline::HISTORY.push("1", "2", "")
+    Readline::HISTORY.send(@method).should == 3
+
+    Readline::HISTORY.pop
+    Readline::HISTORY.send(@method).should == 2
+
+    Readline::HISTORY.pop
+    Readline::HISTORY.pop
+    Readline::HISTORY.send(@method).should == 0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/readline/history/shift_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/readline/history/shift_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/readline/history/shift_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+process_is_foreground do
+
+  not_supported_on :ironruby do
+    require 'readline'
+    describe "Readline::HISTORY.shift" do
+      it "returns nil when the history is empty" do
+        Readline::HISTORY.shift.should be_nil
+      end
+
+      it "returns and removes the first item from the history" do
+        Readline::HISTORY.push("1", "2", "3")
+        Readline::HISTORY.size.should == 3
+
+        Readline::HISTORY.shift.should == "1"
+        Readline::HISTORY.size.should == 2
+
+        Readline::HISTORY.shift.should == "2"
+        Readline::HISTORY.size.should == 1
+
+        Readline::HISTORY.shift.should == "3"
+        Readline::HISTORY.size.should == 0
+      end
+
+      it "taints the returned strings" do
+        Readline::HISTORY.push("1", "2", "3")
+        Readline::HISTORY.shift.tainted?.should be_true
+        Readline::HISTORY.shift.tainted?.should be_true
+        Readline::HISTORY.shift.tainted?.should be_true
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/readline/history/size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/readline/history/size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/readline/history/size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+process_is_foreground do
+
+  not_supported_on :ironruby do
+    require 'readline'
+    require File.dirname(__FILE__) + '/shared/size'
+
+    describe "Readline::HISTORY.size" do
+      it_behaves_like :readline_history_size, :size
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/readline/history/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/readline/history/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/readline/history/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+process_is_foreground do
+
+  not_supported_on :ironruby do
+    require 'readline'
+    describe "Readline::HISTORY.to_s" do
+      it "returns 'HISTORY'" do
+        Readline::HISTORY.to_s.should == "HISTORY"
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/readline/readline_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/readline/readline_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/readline/readline_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+process_is_foreground do
+
+  not_supported_on :ironruby do
+    require 'readline'
+    describe "Readline#readline" do
+      it "needs to be reviewed for spec completeness"
+    end
+
+    describe "Readline.readline" do
+      it "needs to be reviewed for spec completeness"
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/readline/vi_editing_mode_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/readline/vi_editing_mode_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/readline/vi_editing_mode_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+process_is_foreground do
+
+  not_supported_on :ironruby do
+    require 'readline'
+    describe "Readline.vi_editing_mode" do
+      it "needs to be reviewed for spec completeness"
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/resolv/get_address_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/resolv/get_address_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/resolv/get_address_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'socket'
+
+describe "Resolv#getaddress" do
+  before(:all) do
+    require 'resolv'
+  end
+
+  it 'resolves localhost' do
+
+    localhost = Socket.getaddrinfo("127.0.0.1", nil)[0][2]
+
+    lambda {
+      address = Resolv.getaddress(localhost)
+    }.should_not raise_error(Resolv::ResolvError)
+
+    lambda {
+      address = Resolv.getaddress("should.raise.error")
+    }.should raise_error(Resolv::ResolvError)
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/resolv/get_addresses_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/resolv/get_addresses_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/resolv/get_addresses_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'socket'
+
+describe "Resolv#getaddresses" do
+  before(:all) do
+    require 'resolv'
+  end
+
+  it 'resolves localhost' do
+    localhost = Socket.getaddrinfo("127.0.0.1", nil)[0][2]
+
+    addresses = nil
+
+    lambda {
+      addresses = Resolv.getaddresses(localhost)
+    }.should_not raise_error(Resolv::ResolvError)
+    
+    addresses.should_not == nil
+    addresses.size.should > 0
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/resolv/get_name_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/resolv/get_name_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/resolv/get_name_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Resolv#getname" do
+  before(:all) do
+    require 'resolv'
+  end
+
+  it 'resolves 127.0.0.1' do
+    lambda {
+      Resolv.getname("127.0.0.1")
+    }.should_not raise_error(Resolv::ResolvError)
+    lambda {
+      Resolv.getname("should.raise.error")
+    }.should raise_error(Resolv::ResolvError)
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/resolv/get_names_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/resolv/get_names_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/resolv/get_names_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe "Resolv#getnames" do
+  before(:all) do
+    require 'resolv'
+  end
+
+  it 'resolves 127.0.0.1' do
+    names = nil
+    lambda {
+      names = Resolv.getnames("127.0.0.1")
+    }.should_not raise_error(Resolv::ResolvError)
+    names.should_not == nil
+    names.size.should > 0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/clone_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/clone_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/clone_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Attribute#clone" do
+  it "returns a copy of this Attribute" do
+    orig = REXML::Attribute.new("name", "value&&")
+    orig.should == orig.clone
+    orig.clone.to_s.should == orig.to_s
+    orig.clone.to_string.should == orig.to_string
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/element_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/element_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/element_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Attribute#element" do
+  it "returns the parent element" do
+    e = REXML::Element.new "root"
+
+    REXML::Attribute.new("name", "value", e).element.should == e
+    REXML::Attribute.new("name", "default_constructor").element.should == nil
+  end
+end
+
+describe "REXML::Attribute#element=" do
+  it "sets the parent element" do
+    e = REXML::Element.new "root"
+    f = REXML::Element.new "temp"
+    a = REXML::Attribute.new("name", "value", e)
+    a.element.should == e
+
+    a.element = f
+    a.element.should == f
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/equal_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/equal_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/equal_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Attribute#==" do
+  it "returns true if other has equal name and value" do
+    a1 = REXML::Attribute.new("foo", "bar")
+    a1.should == a1.clone
+
+    a2 = REXML::Attribute.new("foo", "bar")
+    a1.should == a2
+
+    a3 = REXML::Attribute.new("foo", "bla")
+    a1.should_not == a3
+
+    a4 = REXML::Attribute.new("baz", "bar")
+    a1.should_not == a4
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/hash_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/hash_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/hash_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Attribute#hash" do
+  # These are not really complete, any idea on how to make them more
+  # "testable" will be appreciated.
+  it "returns a hashcode made of the name and value of self" do
+    a = REXML::Attribute.new("name", "value")
+    a.hash.should be_kind_of(Numeric)
+    b = REXML::Attribute.new(a)
+    a.hash.should == b.hash
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Attribute#initialize" do
+  before :each do
+    @e = REXML::Element.new "root"
+    @name = REXML::Attribute.new("name", "Nicko")
+    @e.add_attribute @name
+  end
+
+  it "receives two strings for name and value" do
+    @e.attributes["name"].should == "Nicko"
+    @e.add_attribute REXML::Attribute.new("last_name", nil)
+    @e.attributes["last_name"].should == ""
+  end
+
+  it "receives an Attribute and clones it" do
+    copy = REXML::Attribute.new(@name)
+    copy.should == @name
+  end
+
+  it "recives a parent node" do
+    last_name = REXML::Attribute.new("last_name", "McBrain", @e)
+    last_name.element.should == @e
+
+    last_name = REXML::Attribute.new(@name, @e)
+    last_name.element.should == @e
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Attribute#inspect" do
+  it "returns the name and value as a string" do
+    a = REXML::Attribute.new("my_name", "my_value")
+    a.inspect.should == "my_name='my_value'"
+  end
+
+  it "accepts attributes with no value" do
+    a = REXML::Attribute.new("my_name")
+    a.inspect.should == "my_name=''"
+  end
+
+  it "does not escape text" do
+    a = REXML::Attribute.new("&&", "<>")
+    a.inspect.should == "&&='<>'"
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/namespace_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/namespace_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/namespace_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Attribute#namespace" do
+  it "returns the namespace url" do
+    e = REXML::Element.new("root")
+    e.add_attribute REXML::Attribute.new("xmlns:ns", "http://some_uri")
+    e.namespace("ns").should == "http://some_uri"
+  end
+
+  it "returns nil if namespace is not defined" do
+    e = REXML::Element.new("root")
+    e.add_attribute REXML::Attribute.new("test", "value") 
+    e.namespace("test").should == nil
+    e.namespace("ns").should == nil
+  end
+
+  it "defaults arg to nil" do
+    e = REXML::Element.new("root")
+    e.add_attribute REXML::Attribute.new("xmlns:ns", "http://some_uri")
+    e.namespace.should == ""
+    e.namespace("ns").should == "http://some_uri"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/node_type_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/node_type_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/node_type_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Attribute#node_type" do
+  it "always returns :attribute" do
+    attr = REXML::Attribute.new("foo", "bar")
+    attr.node_type.should == :attribute
+    REXML::Attribute.new(attr).node_type.should == :attribute
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/prefix_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/prefix_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/prefix_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Attribute#prefix" do
+  it "returns the namespace of the Attribute" do
+    ans = REXML::Attribute.new("ns:someattr", "some_value")
+    out = REXML::Attribute.new("out:something", "some_other_value")
+
+    ans.prefix.should == "ns"
+    out.prefix.should == "out"
+  end
+
+  it "returns an empty string for Attributes with no prefixes" do
+    attr = REXML::Attribute.new("foo", "bar")
+
+    attr.prefix.should == ""
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/remove_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/remove_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/remove_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Attribute#remove" do
+  before :each do
+    @e = REXML::Element.new "Root"
+    @attr = REXML::Attribute.new("foo", "bar")
+  end
+
+  it "deletes this Attribute from parent" do
+    @e.add_attribute(@attr)
+    @e.attributes["foo"].should_not == nil
+    @attr.remove
+    @e.attributes["foo"].should == nil
+  end
+
+  it "does not anything if element has no parent" do
+    lambda {@attr.remove}.should_not raise_error(Exception)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Attribute#to_s" do
+  it "returns the value of the Attribute" do
+    REXML::Attribute.new("name", "some_value").to_s.should == "some_value"
+  end
+
+  it "returns the escaped value if it was created from Attribute" do
+    orig = REXML::Attribute.new("name", "<&>")
+    copy =  REXML::Attribute.new(orig)
+    copy.to_s.should == "&lt;&amp;&gt;"
+  end 
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/to_string_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/to_string_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/to_string_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Attribute#to_string" do
+  it "returns the attribute as XML" do
+    attr = REXML::Attribute.new("name", "value")
+    attr_empty = REXML::Attribute.new("name")
+    attr_ns = REXML::Attribute.new("xmlns:ns", "http://uri")
+
+    attr.to_string.should == "name='value'"
+    attr_empty.to_string.should == "name=''"
+    attr_ns.to_string.should == "xmlns:ns='http://uri'"
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Attribute#value" do
+  it "returns the value of the Attribute unnormalized" do
+    attr = REXML::Attribute.new("name", "value")
+    attr_ents = REXML::Attribute.new("name", "<&>")
+    attr_empty = REXML::Attribute.new("name")
+
+    attr.value.should == "value"
+    attr_ents.value.should == "<&>"
+    attr_empty.value.should == ""
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/write_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/write_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/write_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Attribute#write" do
+  before :each do
+    @attr = REXML::Attribute.new("name", "Charlotte")
+    @s = ""
+  end
+
+  it "writes the name and value to output" do
+    @attr.write(@s)
+    @s.should == "name='Charlotte'"
+  end
+
+  it "currently ignores the second argument" do
+    @attr.write(@s, 3)
+    @s.should == "name='Charlotte'"
+    
+    @s = ""
+    @attr.write(@s, "foo")
+    @s.should == "name='Charlotte'"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/xpath_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/xpath_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attribute/xpath_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Attribute#xpath" do
+
+  before :each do
+    @e = REXML::Element.new "root"
+    @attr = REXML::Attribute.new("year", "1989")
+  end
+
+  it "returns the path for Attribute" do
+    @e.add_attribute @attr
+    @attr.xpath.should == "root/@year"
+  end
+
+  it "raises an error if attribute has no parent" do
+    lambda { @attr.xpath }.should raise_error(Exception)
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/add_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/add_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/add_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/add'
+require 'rexml/document'
+
+describe "REXML::Attributes#add" do
+ it_behaves_like :rexml_attribute_add, :add
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/append_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/append_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/append_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/add'
+require 'rexml/document'
+
+describe "REXML::Attributes#<<" do
+ it_behaves_like :rexml_attribute_add, :<<
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/delete_all_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/delete_all_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/delete_all_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Attributes#delete_all" do
+  before :each do
+    @e = REXML::Element.new("root")
+  end
+
+  it "deletes all attributes that match name" do
+    uri = REXML::Attribute.new("uri", "http://something")
+    @e.attributes << uri
+    @e.attributes.delete_all("uri")
+    @e.attributes.should be_empty
+    @e.attributes["uri"].should == nil
+  end
+
+  it "deletes all attributes that match name with a namespace" do
+    ns_uri = REXML::Attribute.new("xmlns:uri", "http://something_here_too")
+    @e.attributes << ns_uri
+    @e.attributes.delete_all("xmlns:uri")
+    @e.attributes.should be_empty
+    @e.attributes["xmlns:uri"].should == nil
+  end
+
+  it "returns the removed attribute" do
+    uri = REXML::Attribute.new("uri", "http://something_here_too")
+    @e.attributes << uri
+    attrs = @e.attributes.delete_all("uri")
+    attrs.first.should == uri
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/delete_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/delete_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/delete_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Attributes#delete" do
+  before :each do
+    @e = REXML::Element.new("root")
+    @name = REXML::Attribute.new("name", "Pepe")
+  end
+
+  it "takes an attribute name and deletes the attribute" do
+    @e.attributes.delete("name")
+    @e.attributes["name"].should be_nil
+    @e.attributes.should be_empty    
+  end
+
+  it "takes an Attribute and deletes it" do
+    @e.attributes.delete(@name)
+    @e.attributes["name"].should be_nil
+    @e.attributes.should be_empty    
+  end
+
+  it "returns the element with the attribute removed" do
+    ret_val = @e.attributes.delete(@name)
+    ret_val.should == @e
+    ret_val.attributes.should be_empty
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/each_attribute_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/each_attribute_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/each_attribute_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Attributes#each_attribute" do
+  it "iterates over the attributes yielding actual Attribute objects" do
+    e = REXML::Element.new("root")
+    name = REXML::Attribute.new("name", "Joe")
+    ns_uri = REXML::Attribute.new("xmlns:ns", "http://some_uri")
+    e.add_attribute name
+    e.add_attribute ns_uri
+
+    attributes = []
+
+    e.attributes.each_attribute do |attr|
+      attributes << attr 
+    end
+
+    attributes.first.should == name
+    attributes.last.should == ns_uri
+  end
+end
+
+
+

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/each_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/each_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/each_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Attributes#each" do
+  before :each do
+    @e = REXML::Element.new("root")
+    @name = REXML::Attribute.new("name", "Joe")
+    @ns_uri = REXML::Attribute.new("xmlns:ns", "http://some_uri")
+    @e.add_attribute @name
+    @e.add_attribute @ns_uri
+  end
+
+  it "iterates over the attributes yielding expanded-name/value" do
+    attributes = []
+    @e.attributes.each do |attr|
+      attr.should be_kind_of(Array)
+      attributes << attr
+    end
+    attributes.first.should == ["name", "Joe"]
+    attributes.last.should == ["xmlns:ns", "http://some_uri"]
+  end
+end
+
+

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/element_reference_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/element_reference_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/element_reference_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Attributes#[]" do
+  before :each do
+    @e = REXML::Element.new("root")
+    @lang = REXML::Attribute.new("language", "english")
+    @e.attributes << @lang
+  end
+
+  it "returns the value of an attribute" do
+    @e.attributes["language"].should == "english"
+  end
+
+  it "returns nil if the attribute does not exist" do
+    @e.attributes["chunky bacon"].should == nil
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/element_set_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/element_set_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/element_set_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Attributes#[]=" do
+  before :each do
+    @e = REXML::Element.new("song")
+    @name = REXML::Attribute.new("name", "Holy Smoke!")
+    @e.attributes << @name
+  end
+
+  it "sets an attribute" do
+    @e.attributes["author"] = "_why's foxes"
+    @e.attributes["author"].should == "_why's foxes"
+  end
+
+  it "overwrites an existing attribute" do
+    @e.attributes["name"] = "Chunky Bacon"
+    @e.attributes["name"].should == "Chunky Bacon"
+  end
+
+  it "deletes an attribute is value is nil" do
+    @e.attributes["name"] = nil
+    @e.attributes.length.should == 0
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/get_attribute_ns_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/get_attribute_ns_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/get_attribute_ns_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Attributes#get_attribute_ns" do
+  it "returns an attribute by name and namespace" do
+    e = REXML::Element.new("root")
+    attr = REXML::Attribute.new("xmlns:ns", "http://some_url")
+    e.attributes << attr
+    attr.prefix.should == "xmlns"
+    # This might be a bug in Attribute, commenting until those specs
+    # are ready
+    # e.attributes.get_attribute_ns(attr.prefix, "name").should == "http://some_url" 
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/get_attribute_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/get_attribute_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/get_attribute_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Attributes#get_attribute" do
+  before :each do
+    @e = REXML::Element.new("root")
+    @name = REXML::Attribute.new("name", "Dave")
+    @e.attributes << @name
+  end
+
+  it "fetches an attributes" do
+    @e.attributes.get_attribute("name").should == @name
+  end
+
+  it "fetches an namespaced attribute" do
+    ns_name = REXML::Attribute.new("im:name", "Murray")
+    @e.attributes << ns_name
+    @e.attributes.get_attribute("name").should == @name
+    @e.attributes.get_attribute("im:name").should == ns_name
+  end
+  
+  it "returns an Attribute" do
+    @e.attributes.get_attribute("name").should be_kind_of(REXML::Attribute)
+  end
+
+  it "returns nil if it attribute does not exist" do
+    @e.attributes.get_attribute("fake").should be_nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Attributes#initialize" do
+  it "is auto initialized by Element" do
+    e = REXML::Element.new "root"
+    e.attributes.should be_kind_of(REXML::Attributes)
+
+    e.attributes << REXML::Attribute.new("name", "Paul")
+    e.attributes["name"].should == "Paul"
+  end
+
+  it "receives a parent node" do
+    e = REXML::Element.new "root"
+    a = REXML::Attributes.new(e)
+    e.attributes << REXML::Attribute.new("name", "Vic")
+    e.attributes["name"].should == "Vic"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/length'
+require 'rexml/document'
+
+describe "REXML::Attributes#length" do
+ it_behaves_like :rexml_attribute_length, :length
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/namespaces_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/namespaces_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/namespaces_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Attributes#namespaces" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/prefixes_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/prefixes_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/prefixes_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Attributes#prefixes" do
+  before :each do
+    @e = REXML::Element.new("root")
+    a1 = REXML::Attribute.new("xmlns:a", "bar")
+    a2 = REXML::Attribute.new("xmlns:b", "bla")
+    a3 = REXML::Attribute.new("xmlns:c", "baz")
+    @e.attributes << a1
+    @e.attributes << a2
+    @e.attributes << a3
+
+    @e.attributes << REXML::Attribute.new("xmlns", "foo")
+  end
+
+  it "returns an array with the prefixes of each attribute" do
+    @e.attributes.prefixes.should == ["a", "b", "c"]
+  end
+
+  it "does not include the default namespace" do
+    @e.attributes.prefixes.include?("xmlns").should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/shared/add.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/shared/add.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/shared/add.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+describe :rexml_attribute_add, :shared => true do
+  before :each do
+    @e = REXML::Element.new("root")
+    @attr = REXML::Attributes.new(@e)
+    @name = REXML::Attribute.new("name", "Joe")
+  end
+
+  it "adds an attribute" do
+    @attr.send(@method, @name)
+    @attr["name"].should == "Joe"
+  end
+
+  it "replaces an existing attribute" do
+    @attr.send(@method, REXML::Attribute.new("name", "Bruce"))
+    @attr["name"].should == "Bruce"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/shared/length.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/shared/length.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/shared/length.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require 'rexml/document'
+
+describe :rexml_attribute_length, :shared => true do
+  it "returns the number of attributes" do
+    e = REXML::Element.new("root")
+    e.attributes.send(@method).should == 0
+
+    e.attributes << REXML::Attribute.new("name", "John")
+    e.attributes << REXML::Attribute.new("another_name", "Leo")
+    e.attributes.send(@method).should == 2
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/length'
+require 'rexml/document'
+
+describe "REXML::Attributes#size" do
+ it_behaves_like :rexml_attribute_length, :size
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/to_a_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/to_a_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/attributes/to_a_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Attributes#to_a" do
+  it "returns an array with the attributes" do
+    e = REXML::Element.new("root")
+    name = REXML::Attribute.new("name", "Dave")
+    last = REXML::Attribute.new("last_name", "Murray")
+
+    e.attributes << name
+    e.attributes << last
+
+    e.attributes.to_a.should == [name, last]
+  end
+
+  it "returns an empty array if it has no attributes" do
+    REXML::Element.new("root").attributes.to_a.should == []
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/cdata/clone_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/cdata/clone_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/cdata/clone_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::CData#clone" do
+  it "makes a copy of itself" do
+    c = REXML::CData.new("some text")
+    c.clone.to_s.should == c.to_s
+    c.clone.should == c
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/cdata/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/cdata/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/cdata/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::CData#initialize" do
+  it "creates a new CData object" do
+    c = REXML::CData.new("some    text")
+    c = REXML::CData.new("some    text")
+    c.should be_kind_of(REXML::CData)
+    c.should be_kind_of(REXML::Text)
+  end
+
+  it "respects whitespace if whitespace is true" do
+    c = REXML::CData.new("whitespace     test", true)    
+    c1 = REXML::CData.new("whitespace     test", false)    
+
+    c.to_s.should == "whitespace     test"
+    c1.to_s.should == "whitespace test"
+  end
+
+  it "receives parent as third argument" do
+    e = REXML::Element.new("root")
+    c = REXML::CData.new("test", true, e)
+    e.to_s.should == "<root><![CDATA[test]]></root>"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/cdata/shared/to_s.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/cdata/shared/to_s.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/cdata/shared/to_s.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+describe :rexml_cdata_to_s, :shared => true do
+  it "returns the contents of the CData" do
+    c = REXML::CData.new("some text")
+    c.send(@method).should == "some text"
+  end
+
+  it "does not escape text" do
+    c1 = REXML::CData.new("some& text\n")
+    c1.send(@method).should == "some& text\n"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/cdata/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/cdata/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/cdata/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/to_s'
+require 'rexml/document'
+
+describe "REXML::CData#to_s" do
+  it_behaves_like :rexml_cdata_to_s, :to_s
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/cdata/value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/cdata/value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/cdata/value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/to_s'
+require 'rexml/document'
+
+describe "REXML::CData#value" do
+  it_behaves_like :rexml_cdata_to_s, :value
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/document/add_element_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/document/add_element_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/document/add_element_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Document#add_element" do
+  it "adds arg1 with attributes arg2 as root node" do
+    d = REXML::Document.new
+    e = REXML::Element.new("root")
+    d.add_element e
+    d.root.should == e
+  end
+
+  it "sets arg2 as arg1's attributes" do
+    d = REXML::Document.new
+    e = REXML::Element.new("root")
+    attr = {"foo" => "bar"}
+    d.add_element(e,attr)
+    d.root.attributes["foo"].should == attr["foo"]
+  end
+  
+  it "accepts a node name as arg1 and adds it as root" do
+    d = REXML::Document.new
+    d.add_element "foo"
+    d.root.name.should == "foo"
+  end
+
+  it "sets arg1's context to the root's context" do
+    d = REXML::Document.new("", {"foo" => "bar"})
+    d.add_element "foo"
+    d.root.context.should == d.context
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/document/add_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/document/add_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/document/add_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,61 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+# This spec defines Document#add and Document#<<
+
+describe :rexml_document_add, :shared => true do
+  before :each do
+    @doc  = REXML::Document.new("<root/>")
+    @decl = REXML::XMLDecl.new("1.0")
+  end
+
+  it "sets document's XML declaration" do
+    @doc.send(@method, @decl)
+    @doc.xml_decl.should == @decl
+  end
+
+  it "inserts XML declaration as first node" do
+    @doc.send(@method, @decl)
+    @doc.children[0].version.should == "1.0"
+  end
+
+  it "overwrites existing XML declaration" do
+    @doc.send(@method, @decl)
+    @doc.send(@method, REXML::XMLDecl.new("2.0"))
+    @doc.xml_decl.version.should == "2.0"
+  end
+
+  it "sets document DocType" do
+    @doc.send(@method, REXML::DocType.new("transitional"))
+    @doc.doctype.name.should == "transitional"
+  end
+
+  ruby_bug "#19058", "1.8" do
+    # MRI 1.8.x and 1.9 bug. A patch has been submitted.
+    # http://rubyforge.org/tracker/index.php?func=detail&aid=19058&group_id=426&atid=1698
+    it "overwrites existing DocType" do
+      @doc.send(@method, REXML::DocType.new("transitional"))
+      @doc.send(@method, REXML::DocType.new("strict"))
+      @doc.doctype.name.should == "strict"
+    end
+  end
+
+  it "adds root node unless it exists" do
+    d = REXML::Document.new("")
+    elem = REXML::Element.new "root"
+    d.send(@method, elem)
+    d.root.should == elem
+  end
+
+  it "refuses to add second root" do
+    lambda { @doc.send(@method, REXML::Element.new("foo")) }.should raise_error(RuntimeError)
+  end
+end
+
+describe "REXML::Document#add" do
+  it_behaves_like(:rexml_document_add, :add)
+end
+
+describe "REXML::Document#<<" do
+  it_behaves_like(:rexml_document_add, :<<)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/document/clone_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/document/clone_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/document/clone_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+# According to the MRI documentation (http://www.ruby-doc.org/stdlib/libdoc/rexml/rdoc/index.html),
+# clone's behavior "should be obvious". Apparently "obvious" means cloning
+# only the attributes and the context of the document, not its children.
+describe "REXML::Document#clone" do
+  it "clones document attributes" do
+    d = REXML::Document.new("foo")
+    d.attributes["foo"] = "bar"
+    e = d.clone
+    e.attributes.should == d.attributes
+  end
+
+  it "clones document context" do
+    d = REXML::Document.new("foo", {"foo" => "bar"})
+    e = d.clone
+    e.context.should == d.context
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/document/doctype_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/document/doctype_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/document/doctype_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Document#doctype" do
+  it "returns the doctype" do
+    d = REXML::Document.new
+    dt = REXML::DocType.new("foo")
+    d.add dt
+    d.doctype.should == dt
+  end
+
+  it "returns nil if there's no doctype" do
+    REXML::Document.new.doctype.should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/document/encoding_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/document/encoding_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/document/encoding_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Document#encoding" do
+  before :each do
+    @doc = REXML::Document.new
+  end
+  
+  it "returns encoding from XML declaration" do    
+    @doc.add REXML::XMLDecl.new(nil, "UTF-16", nil)
+    @doc.encoding.should == "UTF-16"
+  end
+
+  it "returns encoding from XML declaration (for UTF-16 as well)" do
+    @doc.add REXML::XMLDecl.new("1.0", "UTF-8", nil)
+    @doc.encoding.should == "UTF-8"
+  end
+
+  it "uses UTF-8 as default encoding" do
+    @doc.encoding.should == "UTF-8"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/document/expanded_name_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/document/expanded_name_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/document/expanded_name_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe :document_expanded_name, :shared => true do
+  it "returns an empty string for root" do # root nodes have no expanded name
+    REXML::Document.new.send(@method).should == ""
+  end
+end
+
+describe "REXML::Document#expanded_name" do
+  it_behaves_like(:document_expanded_name, :expanded_name)
+end
+
+describe "REXML::Document#name" do
+  it_behaves_like(:document_expanded_name, :name)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/document/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/document/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/document/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,38 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Document#new" do
+
+  it "initializes context of {} unless specified" do
+    d = REXML::Document.new("<foo />")
+    d.context.should == {}
+  end
+
+  it "has empty attributes if source is nil" do
+    d = REXML::Document.new(nil)
+    d.elements.should be_empty
+  end
+
+  it "can use other document context" do
+    s = REXML::Document.new("")
+    d = REXML::Document.new(s)
+    d.context.should == s.context
+  end
+
+  it "clones source attributes" do
+    s = REXML::Document.new("<root />")
+    s.attributes["some_attr"] = "some_val"
+    d = REXML::Document.new(s)
+    d.attributes.should == s.attributes
+  end
+
+  ruby_bug "#", "1.8.6.111" do
+    it "raises an error if source is not a Document, String or IO" do
+      lambda {s = REXML::Document.new(3)}.should raise_error(RuntimeError)
+    end
+  end
+
+  it "does not perform XML validation" do
+    REXML::Document.new("Invalid document").should be_kind_of(REXML::Document)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/document/node_type_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/document/node_type_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/document/node_type_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Document#node_type" do 
+  it "returns :document" do
+    REXML::Document.new.node_type.should == :document
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/document/root_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/document/root_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/document/root_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Document#root" do 
+  it "returns document root tag name" do
+    REXML::Document.new("<foo/>").root.name.should == "foo"
+  end
+
+  it "returns nil if there is not root" do
+    REXML::Document.new.root.should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/document/stand_alone_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/document/stand_alone_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/document/stand_alone_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Document#stand_alone?" do 
+  it "returns the XMLDecl standalone value" do
+    d = REXML::Document.new
+    decl = REXML::XMLDecl.new("1.0", "UTF-8", "yes")
+    d.add decl
+    d.stand_alone?.should == "yes"
+  end
+
+  # According to the docs this should return the default XMLDecl but that
+  # will carry some more problems when printing the document. Currently, it
+  # returns nil. See http://www.ruby-forum.com/topic/146812#650061
+  it "returns the default value when no XML declaration present" do
+    REXML::Document.new.stand_alone?.should == nil
+  end
+  
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/document/version_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/document/version_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/document/version_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Document#version" do
+  it "returns XML version from declaration" do
+    d = REXML::Document.new
+    d.add REXML::XMLDecl.new("1.1")
+    d.version.should == "1.1"
+  end
+
+  it "returns the default version when declaration is not present" do
+    REXML::Document.new.version.should == REXML::XMLDecl::DEFAULT_VERSION
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/document/write_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/document/write_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/document/write_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,39 @@
+require 'rexml/document'
+require 'rexml/formatters/transitive'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+# Maybe this can be cleaned
+describe "REXML::Document#write" do
+  before :each do
+    @d      = REXML::Document.new
+    city    = REXML::Element.new "Springfield"
+    street  = REXML::Element.new "EvergreenTerrace"
+    address = REXML::Element.new "House742"
+    @d << city << street << address
+    @str = ""
+  end
+
+  it "returns document source as string" do
+    @d.write(@str)
+    @str.should == "<Springfield><EvergreenTerrace><House742/></EvergreenTerrace></Springfield>"
+  end
+
+  it "returns document indented" do
+    @d.write(@str, 2)
+    @str.should =~ /\s*<Springfield>\s*<EvergreenTerrace>\s*<House742\/>\s*<\/EvergreenTerrace>\s*<\/Springfield>/
+  end
+
+  # REXML in 1.8 is screwed up:
+  # Document#write uses wrong arity for Formatters::Transitive#initialize
+  ruby_bug "REXMLTracker#162", "1.8" do
+    it "returns document with transitive support" do
+      @d.write(@str, 2, true)
+      @str.should =~  "\s*<Springfield\s*><EvergreenTerrace\s*><House742\s*\/><\/EvergreenTerrace\s*><\/Springfield\s*>"
+    end
+  end
+
+  it "returns document with support for IE" do
+    @d.write(@str, -1, false, true)
+    @str.should ==  "<Springfield><EvergreenTerrace><House742 /></EvergreenTerrace></Springfield>"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/document/xml_decl_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/document/xml_decl_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/document/xml_decl_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Document#xml_decl" do 
+  it "returns XML declaration of the document" do
+    d = REXML::Document.new
+    decl = REXML::XMLDecl.new("1.0", "UTF-16", "yes")
+    d.add decl
+    d.xml_decl.should == decl
+  end
+
+  it "returns default XML declaration unless present" do
+    REXML::Document.new.xml_decl.should == REXML::XMLDecl.new
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/add_attribute_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/add_attribute_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/add_attribute_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,41 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#add_attribute" do
+  before :each do
+    @person = REXML::Element.new "person"
+    @person.attributes["name"] = "Bill"
+  end
+  
+  it "adds a new attribute" do
+    @person.add_attribute("age", "17")
+    @person.attributes["age"].should == "17"
+  end
+
+  it "overwrites an existing attribute" do
+    @person.add_attribute("name", "Bill")
+    @person.attributes["name"].should == "Bill"
+  end
+  
+  it "accepts a pair of strings" do
+    @person.add_attribute("male", "true")
+    @person.attributes["male"].should == "true"
+  end
+
+  it "accepts an Attribute for key" do
+    attr = REXML::Attribute.new("male", "true")
+    @person.add_attribute attr
+    @person.attributes["male"].should == "true"
+  end
+
+  it "ignores value if key is an Attribute" do
+    attr = REXML::Attribute.new("male", "true")
+    @person.add_attribute(attr, "false")
+    @person.attributes["male"].should == "true"
+  end
+
+ it "returns the attribute added" do
+    attr = REXML::Attribute.new("name", "Tony")
+    @person.add_attribute(attr).should == attr
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/add_attributes_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/add_attributes_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/add_attributes_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#add_attribute" do
+  before :each do
+    @person = REXML::Element.new "person"
+    @person.attributes["name"] = "Bill"
+  end
+
+  it "adds multiple attributes from a hash" do
+    @person.add_attributes({"name" => "Joe", "age" => "27"})
+    @person.attributes["name"].should == "Joe"
+    @person.attributes["age"].should == "27"
+  end
+
+  it "adds multiple attributes from an array" do
+    attrs =  { "name" => "Joe", "age" => "27"}
+    @person.add_attributes attrs.to_a
+    @person.attributes["name"].should == "Joe"
+    @person.attributes["age"].should == "27"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/add_element_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/add_element_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/add_element_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,39 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+
+describe "REXML::Element#add_element" do
+  before :each do
+    @root = REXML::Element.new("root")
+  end
+  
+  it "adds a child without attributes" do
+    name = REXML::Element.new("name")
+    @root.add_element name
+    @root.elements["name"].name.should == name.name
+    @root.elements["name"].attributes.should == name.attributes
+    @root.elements["name"].context.should == name.context
+  end
+
+  it "adds a child with attributes" do
+    person = REXML::Element.new("person")
+    @root.add_element(person, {"name" => "Madonna"})
+    @root.elements["person"].name.should == person.name
+    @root.elements["person"].attributes.should == person.attributes
+    @root.elements["person"].context.should == person.context
+  end
+
+  it "adds a child with name" do
+    @root.add_element "name"
+    @root.elements["name"].name.should == "name"
+    @root.elements["name"].attributes.should == {}
+    @root.elements["name"].context.should == nil
+  end
+
+  it "returns the added child" do
+    name = @root.add_element "name"
+    @root.elements["name"].name.should == name.name
+    @root.elements["name"].attributes.should == name.attributes
+    @root.elements["name"].context.should == name.context
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/add_namespace_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/add_namespace_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/add_namespace_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#add_namespace" do
+  before :each do
+    @elem = REXML::Element.new("person")
+  end
+
+  it "adds a namespace to element" do 
+    @elem.add_namespace("foo", "bar")
+    @elem.namespace("foo").should == "bar"
+  end
+
+  it "accepts a prefix string as prefix" do
+    @elem.add_namespace("xmlns:foo", "bar")
+    @elem.namespace("foo").should == "bar"
+  end
+
+  it "uses prefix as URI if uri is nil" do
+    @elem.add_namespace("some_uri", nil)
+    @elem.namespace.should == "some_uri"
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/add_text_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/add_text_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/add_text_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#add_namespace" do
+  before :each do
+    @name = REXML::Element.new "Name"
+  end
+
+  it "adds text to an element" do
+    @name.add_text "Ringo"
+    @name.to_s.should == "<Name>Ringo</Name>"
+  end
+
+  it "accepts a Text" do
+    @name.add_text(REXML::Text.new("Ringo"))
+    @name.to_s.should == "<Name>Ringo</Name>"
+  end
+
+  it "joins the new text with the old one" do
+    @name.add_text "Ringo"
+    @name.add_text " Starr"
+    @name.to_s.should == "<Name>Ringo Starr</Name>" 
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/attribute_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/attribute_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/attribute_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#attribute" do
+  it "returns an attribute by name" do
+    person = REXML::Element.new "Person"
+    attribute = REXML::Attribute.new("drink", "coffee")
+    person.add_attribute(attribute)
+    person.attribute("drink").should == attribute
+  end
+
+  it "supports attributes inside namespaces" do
+    e = REXML::Element.new("element")
+    e.add_attributes({"xmlns:ns", "http://some_uri"})
+    e.attribute("ns", "ns").to_s.should == "http://some_uri"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/attributes_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/attributes_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/attributes_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#attributes" do
+  it "returns element's Attributes" do
+    p = REXML::Element.new "Person"
+
+    name = REXML::Attribute.new("name", "John")
+    attrs = REXML::Attributes.new(p)
+    attrs.add name
+
+    p.add_attribute name
+    p.attributes.should == attrs
+  end
+
+  it "returns an empty hash if element has no attributes" do
+    REXML::Element.new("Person").attributes.should == {}
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/cdatas_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/cdatas_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/cdatas_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#cdatas" do
+  before :each do 
+    @e = REXML::Element.new("Root")
+  end
+
+  it "returns the array of children cdatas" do
+    c = REXML::CData.new("Primary")
+    d = REXML::CData.new("Secondary")
+    @e << c
+    @e << d
+    @e.cdatas.should == [c, d]
+  end
+
+  it "freezes the returned array" do
+    @e.cdatas.frozen?.should == true
+  end
+
+  it "returns an empty array if element has no cdata" do
+    @e.cdatas.should == []
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/clone_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/clone_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/clone_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#clone" do
+  before :each do
+    @e = REXML::Element.new "a"
+  end
+  it "creates a copy of element" do
+    @e.clone.to_s.should == @e.to_s
+  end
+
+  it "copies the attributes" do
+    @e.add_attribute("foo", "bar")
+    @e.clone.to_s.should == @e.to_s
+  end
+
+  it "does not copy the text" do
+    @e.add_text "some text..."
+    @e.clone.to_s.should_not == @e
+    @e.clone.to_s.should == "<a/>"
+  end
+
+  it "does not copy the child elements" do
+    b = REXML::Element.new "b"
+    @e << b
+    @e.clone.should_not == @e
+    @e.clone.to_s.should == "<a/>"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/comments_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/comments_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/comments_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#comments" do
+  before :each do
+    @e = REXML::Element.new "root"
+    @c1 = REXML::Comment.new "this is a comment"
+    @c2 = REXML::Comment.new "this is another comment"
+    @e << @c1
+    @e << @c2
+  end
+
+  it "returns the array of comments" do
+    @e.comments.should == [@c1, @c2]
+  end
+
+  it "returns a frozen object" do
+    comment = REXML::Comment.new "The insertion should fail"
+    @e.comments.frozen?.should == true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/delete_attribute_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/delete_attribute_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/delete_attribute_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,39 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#delete_attribute" do
+  before :each do
+    @e = REXML::Element.new("Person")
+    @attr = REXML::Attribute.new("name", "Sean")
+    @e.add_attribute(@attr)
+  end
+
+  it "deletes an attribute from the element" do
+    @e.delete_attribute("name")
+    @e.attributes["name"].should be_nil
+  end
+
+#  Bug was filled with a patch in Ruby's tracker #20298
+  quarantine! do
+    it "receives an Attribute" do
+      @e.add_attribute(@attr)
+      @e.delete_attribute(@attr)
+      @e.attributes["name"].should be_nil
+    end
+  end
+
+  # Docs say that it returns the removed attribute but then examples
+  # show it returns the element with the attribute removed.
+  # Also fixed in #20298
+  it "returns the element with the attribute removed" do
+    elem = @e.delete_attribute("name")
+    elem.attributes.should be_empty
+    elem.to_s.should eql("<Person/>")
+  end
+
+  it "returns nil if the attribute does not exist" do
+    @e.delete_attribute("name")
+    at = @e.delete_attribute("name")
+    at.should be_nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/delete_element_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/delete_element_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/delete_element_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,51 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#delete_element" do
+  before :each do
+    @root = REXML::Element.new("root")
+  end
+  
+  it "deletes the child element" do
+    node = REXML::Element.new("some_node")
+    @root.add_element node
+    @root.delete_element node
+    @root.elements.size.should == 0
+  end
+  
+  it "deletes a child via XPath" do
+    @root.add_element "some_node"
+    @root.delete_element "some_node"
+    @root.elements.size.should == 0
+  end
+
+  it "deletes the child at index" do
+    @root.add_element "some_node"
+    @root.delete_element 1
+    @root.elements.size.should == 0
+  end
+
+  # According to the docs this should return the deleted element
+  # but it won't if it's an Element.
+  ruby_bug "REXMLTracker#161", "1.8" do
+    it "deletes Element and returns it" do
+      node = REXML::Element.new("some_node")
+      @root.add_element node
+      del_node = @root.delete_element node
+      del_node.should == node
+    end
+  end
+
+  # Note how passing the string will return the removed element
+  # but passing the Element as above won't.
+  it "deletes an element and returns it" do
+    node = REXML::Element.new("some_node")
+    @root.add_element node
+    del_node = @root.delete_element "some_node"
+    del_node.should == node
+  end
+
+  it "returns nil unless element exists" do
+    @root.delete_element("something").should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/delete_namespace_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/delete_namespace_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/delete_namespace_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#delete_namespace" do
+
+  before :each do
+    @doc = REXML::Document.new "<a xmlns:foo='bar' xmlns='twiddle'/>"
+  end
+
+  it "deletes a namespace from the element" do
+    @doc.root.delete_namespace 'foo'
+    @doc.root.namespace("foo").should be_nil
+    @doc.root.to_s.should == "<a xmlns='twiddle'/>"
+  end
+  
+  it "deletes default namespace when called with no args" do
+    @doc.root.delete_namespace
+    @doc.root.namespace.should be_empty
+    @doc.root.to_s.should == "<a xmlns:foo='bar'/>"
+  end
+
+  it "returns the element" do
+    @doc.root.delete_namespace.should == @doc.root
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/document_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/document_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/document_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#document" do
+
+  it "returns the element's document" do
+    d = REXML::Document.new("<root><elem/></root>")
+    d << REXML::XMLDecl.new
+    d.root.document.should == d
+    d.root.document.to_s.should == d.to_s
+  end
+
+  it "returns nil if it belongs to no document" do
+    REXML::Element.new("standalone").document.should be_nil
+  end
+end
+
+

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/each_element_with_attribute_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/each_element_with_attribute_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/each_element_with_attribute_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#each_element_with_attributes" do
+  before :each do
+    @document = REXML::Element.new("people")
+    @father = REXML::Element.new("Person")
+    @father.attributes["name"] = "Joe"
+    @son = REXML::Element.new("Child")
+    @son.attributes["name"] = "Fred"
+    @document.root << @father
+    @document.root << @son
+    @childs = []
+  end
+  
+  it "returns childs with attribute" do
+    @document.each_element_with_attribute("name") { |elem| @childs << elem }
+    @childs[0].should == @father
+    @childs[1].should == @son
+  end
+  
+  it "takes attribute value as second argument" do
+    @document.each_element_with_attribute("name", "Fred"){ |elem| elem.should == @son }
+  end
+  
+  it "takes max number of childs as third argument" do
+    @document.each_element_with_attribute("name", nil, 1) { |elem| @childs << elem }
+    @childs.size.should == 1
+    @childs[0].should == @father
+  end
+  
+  it "takes XPath filter as fourth argument" do
+    @document.each_element_with_attribute("name", nil, 0, "Child"){ |elem| elem.should == @son}
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/each_element_with_text_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/each_element_with_text_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/each_element_with_text_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#each_element_with_text" do
+  before :each do
+    @document = REXML::Element.new("people")
+    
+    @joe = REXML::Element.new("Person")
+    @joe.text = "Joe"
+    @fred = REXML::Element.new("Person")
+    @fred.text = "Fred"
+    @another = REXML::Element.new("AnotherPerson")
+    @another.text = "Fred"
+    @document.root << @joe
+    @document.root << @fred
+    @document.root << @another
+    @childs = []
+  end
+  
+  it "returns childs with text" do
+    @document.each_element_with_text("Joe"){|c| c.should == @joe}
+  end
+  
+  it "takes max as second argument" do
+    @document.each_element_with_text("Fred", 1){ |c| c.should == @fred}
+  end
+  
+  it "takes XPath filter as third argument" do
+    @document.each_element_with_text("Fred", 0, "Person"){ |c| c.should == @fred}
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/get_text_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/get_text_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/get_text_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#get_text" do
+  before :each do
+    @doc = REXML::Document.new "<p>some text<b>this is bold!</b> more text</p>"
+  end
+
+  it "returns the first text child node" do
+    @doc.root.get_text.value.should == "some text"
+    @doc.root.get_text.should be_kind_of(REXML::Text)
+  end
+
+  it "returns text from an element matching path" do
+    @doc.root.get_text("b").value.should == "this is bold!"
+    @doc.root.get_text("b").should be_kind_of(REXML::Text)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/has_attributes_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/has_attributes_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/has_attributes_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#has_attributes?" do
+  before :each do
+    @e = REXML::Element.new("test_elem")
+  end  
+
+  it "returns true when element has any attributes" do
+    @e.add_attribute("name", "Joe")
+    @e.has_attributes?.should be_true
+  end
+
+  it "returns false if element has no attributes" do
+    @e.has_attributes?.should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/has_elements_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/has_elements_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/has_elements_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#has_elements?" do
+  before :each do
+    @e = REXML::Element.new("root")
+  end
+
+  it "returns true if element has child elements" do
+    child = REXML::Element.new("child")
+    @e << child
+    @e.has_elements?.should be_true
+  end
+
+  it "returns false if element doesn't have child elements" do
+    @e.has_elements?.should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/has_text_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/has_text_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/has_text_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#has_text?" do
+  
+  it "returns true if element has a Text child" do
+    e = REXML::Element.new("Person")
+    e.text = "My text"
+    e.has_text?.should be_true
+  end
+
+  it "returns false if it has no Text childs" do
+    e = REXML::Element.new("Person")
+    e.has_text?.should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#inspect" do
+
+  before :each do
+    @name = REXML::Element.new "name"
+  end
+
+  it "returns the node as a string" do
+    @name.inspect.should == "<name/>"
+  end
+
+  it "inserts '...' if the node has children" do
+    e = REXML::Element.new "last_name"
+    @name << e
+    @name.inspect.should == "<name> ... </>"
+    # This might make more sense but differs from MRI's default behavior
+    # @name.inspect.should == "<name> ... </name>" 
+  end
+
+  it "inserts the attributes in the string" do
+    @name.add_attribute "language"
+    @name.attributes["language"] = "english"
+    @name.inspect.should == "<name language='english'/>"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/instructions_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/instructions_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/instructions_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#instructions" do
+  before :each do
+    @elem = REXML::Element.new("root")
+  end
+  it "returns the Instruction children nodes" do
+    inst = REXML::Instruction.new("xml-stylesheet", "href='headlines.css'")
+    @elem << inst
+    @elem.instructions.first.should == inst
+  end
+  
+  it "returns an empty array if it has no Instruction children" do
+    @elem.instructions.should be_empty
+  end
+
+  it "freezes the returned array" do
+    @elem.instructions.frozen?.should be_true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/namespace_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/namespace_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/namespace_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#namespace" do
+  before :each do
+    @doc = REXML::Document.new("<a xmlns='1' xmlns:y='2'><b/><c xmlns:z='3'/></a>")
+    @elem = @doc.elements["//b"]
+  end
+
+  it "returns the default namespace" do
+    @elem.namespace.should == "1"
+  end
+
+  it "accepts a namespace prefix" do
+    @elem.namespace("y").should == "2"
+    @doc.elements["//c"].namespace("z").should == "3"
+  end
+
+  it "returns an empty String if default namespace is not defined" do
+    e = REXML::Document.new("<a/>")
+    e.root.namespace.should be_empty
+  end
+
+  it "returns nil if namespace is not defined" do
+    @elem.namespace("z").should be_nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/namespaces_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/namespaces_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/namespaces_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#namespaces" do
+  before :each do
+    doc = REXML::Document.new("<a xmlns='1' xmlns:y='2'><b/><c xmlns:z='3'/></a>")
+    @elem = doc.elements["//c"]
+  end
+
+  it "returns a hash of the namespaces" do
+    ns = {"y"=>"2", "z"=>"3", "xmlns"=>"1"}
+    @elem.namespaces.keys.sort.should == ns.keys.sort
+    @elem.namespaces.values.sort.should == ns.values.sort
+  end
+
+  it "returns an empty hash if no namespaces exist" do
+    e = REXML::Element.new "element"
+    e.namespaces.kind_of?(Hash).should == true
+    e.namespaces.should be_empty
+  end
+
+  it "uses namespace prefixes as keys" do
+    prefixes = ["y", "z", "xmlns"]
+    @elem.namespaces.keys.sort.should == prefixes.sort
+  end
+
+  it "uses namespace values as the hash values" do
+    values = ["2", "3", "1"]
+    @elem.namespaces.values.sort.should == values.sort
+  end
+  
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#new" do
+
+  it "creates element from tag name" do
+    REXML::Element.new("foo").name.should == "foo"
+  end
+
+  it "creates element with default attributes" do
+    e = REXML::Element.new
+    e.name.should == REXML::Element::UNDEFINED
+    e.context.should == nil
+    e.parent.should == nil
+  end
+
+  it "creates element from another element" do
+    e = REXML::Element.new "foo"
+    f = REXML::Element.new e
+    e.name.should == f.name
+    e.context.should == f.context
+    e.parent.should == f.parent
+  end
+  
+  it "takes parent as second argument" do
+    parent = REXML::Element.new "foo"
+    child = REXML::Element.new "bar", parent
+    child.parent.should == parent
+  end
+
+  it "takes context as third argument" do
+    context = {"some_key" => "some_value"}
+    REXML::Element.new("foo", nil, context).context.should == context
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/next_element_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/next_element_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/next_element_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#next_element" do
+  before :each do 
+    @a = REXML::Element.new "a"
+    @b = REXML::Element.new "b"
+    @c = REXML::Element.new "c"
+    @a.root << @b
+    @a.root << @c
+  end
+  it "returns next existing element" do
+    @a.elements["b"].next_element.should == @c
+  end
+
+  it "returns nil on last element" do
+    @a.elements["c"].next_element.should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/node_type_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/node_type_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/node_type_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#node_type" do
+  it "returns :element" do
+    REXML::Element.new("MyElem").node_type.should == :element
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/prefixes_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/prefixes_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/prefixes_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#prefixes" do
+  before :each do
+    doc = REXML::Document.new("<a xmlns='1' xmlns:y='2'><b/><c xmlns:z='3'/></a>")
+    @elem = doc.elements["//c"]
+  end
+
+  it "returns an array of the prefixes of the namespaces" do
+    @elem.prefixes.should == ["y", "z"]
+  end
+
+  it "does not include the default namespace" do
+    @elem.prefixes.include?("xmlns").should == false
+  end
+  
+  it "returns an empty array if no namespace was defined" do
+    doc = REXML::Document.new "<root><something/></root>"
+    root = doc.elements["//root"]
+    root.prefixes.should == []
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/previous_element_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/previous_element_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/previous_element_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#previous_element" do
+  before :each do 
+    @a = REXML::Element.new "a"
+    @b = REXML::Element.new "b"
+    @c = REXML::Element.new "c"
+    @a.root << @b
+    @a.root << @c
+  end
+
+  it "returns previous element" do
+    @a.elements["c"].previous_element.should == @b
+  end
+
+  it "returns nil on first element" do
+    @a.elements["b"].previous_element.should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/raw_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/raw_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/raw_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#raw" do
+  it "returns true if raw mode is set to all" do
+    REXML::Element.new("MyElem", nil, {:raw => :all}).raw.should == true
+  end
+  
+  it "returns true if raw mode is set to expanded_name" do
+    REXML::Element.new("MyElem", nil, {:raw => "MyElem"}).raw.should == true
+  end
+
+  it "returns false if raw mode is not set" do
+    REXML::Element.new("MyElem", nil, {:raw => ""}).raw.should == false
+  end
+
+  it "returns false if raw is not :all or expanded_name" do
+    REXML::Element.new("MyElem", nil, {:raw => "Something"}).raw.should == false
+  end
+
+  it "returns nil if context is not set" do
+    REXML::Element.new("MyElem").raw.should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/root_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/root_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/root_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Element#root" do
+  before :each do
+    @doc  = REXML::Document.new 
+    @root = REXML::Element.new "root"
+    @node = REXML::Element.new "node"
+    @doc << @root << @node
+  end
+
+  it "returns first child on documents" do
+    @doc.root.should == @root
+  end
+
+  it "returns self on root nodes" do
+    @root.root.should == @root
+  end
+
+  it "returns parent's root on child nodes" do
+    @node.root.should == @root
+  end
+
+  it "returns self on standalone nodes" do
+    e = REXML::Element.new "Elem"         # Note that it doesn't have a parent node
+    e.root.should == e
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/text_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/text_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/text_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,46 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#text" do
+  before :each do
+    @e = REXML::Element.new "name"
+    @e.text = "John"
+  end
+
+  it "returns the text node of element" do
+    @e.text.should == "John"
+  end
+
+  it "returns the text node value" do
+    t = REXML::Text.new "Joe"
+    @e.text = t
+    @e.text.should == "Joe"
+    @e.text.should_not == t
+  end
+  
+  it "returns nil if no text is attached" do
+    elem = REXML::Element.new "name"
+    elem.text.should == nil
+  end
+end
+
+describe "REXML::Element#text=" do
+  before :each do
+    @e = REXML::Element.new "name"
+    @e.text = "John"
+  end
+
+  it "sets the text node" do
+    @e.to_s.should == "<name>John</name>"
+  end
+
+  it "replaces existing text" do 
+    @e.text = "Joe"
+    @e.to_s.should == "<name>Joe</name>"
+  end
+
+  it "receives nil as an argument" do
+    @e.text = nil
+    @e.to_s.should == "<name/>"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/texts_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/texts_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/texts_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#texts" do
+
+  it "returns an array of the Text children" do
+    e = REXML::Element.new("root")
+    e.add_text "First"
+    e.add_text "Second"
+    e.texts.should == ["FirstSecond"]
+  end
+
+  it "returns an empty array if it has no Text children" do
+    REXML::Element.new("root").texts.should == []
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/element/whitespace_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/element/whitespace_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/element/whitespace_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe "REXML::Element#whitespace" do
+  it "returns true if whitespace is respected in the element" do
+    e = REXML::Element.new("root")
+    e.whitespace.should be_true
+
+    e = REXML::Element.new("root", nil, :respect_whitespace => :all)
+    e.whitespace.should be_true
+
+    e = REXML::Element.new("root", nil, :respect_whitespace => ["root"])
+    e.whitespace.should be_true
+  end
+
+  it "returns false if whitespace is ignored inside element" do
+    e = REXML::Element.new("root", nil, :compress_whitespace => :all)
+    e.whitespace.should be_false
+
+    e = REXML::Element.new("root", nil, :compress_whitespace => ["root"])
+    e.whitespace.should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/node/each_recursive_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/node/each_recursive_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/node/each_recursive_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Node#each_recursive" do
+  before :each do
+    @doc = REXML::Document.new
+    @doc << REXML::XMLDecl.new
+    @root = REXML::Element.new "root"
+    @child1 = REXML::Element.new "child1"
+    @child2 = REXML::Element.new "child2"
+    @root << @child1
+    @root << @child2
+    @doc << @root
+  end
+
+  it "visits all subnodes of self" do
+    nodes = []
+    @doc.each_recursive { |node| nodes << node}
+    nodes.should == [@root, @child1, @child2]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/node/find_first_recursive_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/node/find_first_recursive_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/node/find_first_recursive_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Node#find_first_recursive" do
+  before :each do
+    @e = REXML::Element.new("root")
+    @node1 = REXML::Element.new("node")
+    @node2 = REXML::Element.new("another node")
+    @subnode = REXML::Element.new("another node")
+    @node1 << @subnode
+    @e << @node1
+    @e << @node2
+  end
+
+  it "finds the first element that matches block" do
+    found = @e.find_first_recursive { |n| n.to_s == "<node><another node/></node>"}
+    found.should == @node1
+  end
+
+  it "visits the nodes in preorder" do
+    found = @e.find_first_recursive { |n| n.to_s == "<another node/>"}
+    found.should == @subnode
+    found.should_not == @node2
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/node/index_in_parent_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/node/index_in_parent_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/node/index_in_parent_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Node#index_in_parent" do
+  it "returns the index (starting from 1) of self in parent" do
+    e = REXML::Element.new("root")
+    node1 = REXML::Element.new("node")
+    node2 = REXML::Element.new("another node")
+    e << node1
+    e << node2
+
+    node1.index_in_parent.should == 1
+    node2.index_in_parent.should == 2
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/node/next_sibling_node_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/node/next_sibling_node_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/node/next_sibling_node_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Node#next_sibling_node" do
+  before :each do
+    @e = REXML::Element.new("root")
+    @node1 = REXML::Element.new("node")
+    @node2 = REXML::Element.new("another node")
+    @e << @node1
+    @e << @node2
+  end
+
+  it "returns the next child node in parent" do
+    @node1.next_sibling_node.should == @node2
+  end
+
+  it "returns nil if there are no more child nodes next" do
+    @node2.next_sibling_node.should == nil
+    @e.next_sibling_node.should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/node/parent_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/node/parent_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/node/parent_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Node#parent?" do
+  it "returns true for Elements" do
+    e = REXML::Element.new("foo")
+    e.parent?.should == true
+  end
+
+  it "returns true for Documents" do
+    e = REXML::Document.new
+    e.parent?.should == true
+  end
+
+  # This includes attributes, CDatas and declarations.
+  it "returns false for Texts" do
+    e = REXML::Text.new("foo")
+    e.parent?.should == false
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/node/previous_sibling_node_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/node/previous_sibling_node_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/node/previous_sibling_node_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Node#previous_sibling_node" do
+  before :each do
+    @e = REXML::Element.new("root")
+    @node1 = REXML::Element.new("node")
+    @node2 = REXML::Element.new("another node")
+    @e << @node1
+    @e << @node2
+  end
+
+  it "returns the previous child node in parent" do
+    @node2.previous_sibling_node.should == @node1
+  end
+
+  it "returns nil if there are no more child nodes before" do
+    @node1.previous_sibling_node.should == nil
+    @e.previous_sibling_node.should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/shared/each_element.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/shared/each_element.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/shared/each_element.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,36 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe :rexml_each_element, :shared => true do
+  before :each do
+    @e = REXML::Element.new "root"
+    s1 = REXML::Element.new "node1"
+    s2 = REXML::Element.new "node2"
+    s3 = REXML::Element.new "node3"
+    s4 = REXML::Element.new "sub_node"
+    @e << s1
+    @e << s2
+    @e << s3
+    @e << s4
+  end
+
+  it "iterates through element" do
+    str = ""
+      @e.send(@method) { |elem| str << elem.name << " " }
+    str.should == "node1 node2 node3 sub_node "
+  end
+
+  it "iterates through element filtering with XPath" do
+    str = ""
+     @e.send(@method, "/*"){ |e| str << e.name << " "}
+     str.should == "node1 node2 node3 sub_node "
+  end
+end
+
+describe "REXML::Element#each_element" do
+ it_behaves_like :rexml_each_element, :each_element
+end
+
+describe "REXML::Elements#each" do
+  it_behaves_like :rexml_each_element, :each
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/shared/elements_to_a.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/shared/elements_to_a.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/shared/elements_to_a.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,36 @@
+require 'rexml/document'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe :rexml_elements_to_a, :shared => true do
+  before :each do
+    @e = REXML::Element.new "root"
+    @first = REXML::Element.new("FirstChild")
+    @second = REXML::Element.new("SecondChild")
+    @e << @first
+    @e << @second
+  end
+
+  it "returns elements that match xpath" do
+    @e.elements.send(@method, "FirstChild").first.should == @first
+  end
+
+  # According to the docs REXML::Element#get_elements is an alias for
+  # REXML::Elements.to_a. Implementation wise there's a difference, get_elements
+  # always needs the first param (even if it's nil).
+  # A patch was submitted:
+  # http://rubyforge.org/tracker/index.php?func=detail&aid=19354&group_id=426&atid=1698
+  ruby_bug "#", "1.8.6.114" do
+    it "returns all childs if xpath is nil" do
+      @e.elements.send(@method).should == [@first, @second]
+    end
+  end
+
+end
+
+describe "REXML::REXML::Elements#to_a" do
+  it_behaves_like :rexml_elements_to_a, :to_a
+end
+
+describe "REXML::REXML::Element#get_elements" do
+  it_behaves_like :rexml_elements_to_a, :get_elements
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/text/append_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/text/append_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/text/append_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Text#<<" do
+  it "appends a string to this text node" do
+    text = REXML::Text.new("foo")
+    text << "bar"
+    text.should == "foobar"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/text/clone_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/text/clone_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/text/clone_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Text#clone" do
+  it "creates a copy of this node" do
+    text = REXML::Text.new("foo")
+    text.clone.should == "foo"
+    text.clone.should == text
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/text/comparison_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/text/comparison_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/text/comparison_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Text#<=>" do
+  before :each do
+    @first = REXML::Text.new("abc")
+    @last = REXML::Text.new("def")
+  end
+
+  it "returns -1 if lvalue is less than rvalue" do
+    val = @first <=> @last
+    val.should == -1
+  end
+
+  it "returns -1 if lvalue is greater than rvalue" do
+    val = @last <=> @first 
+    val.should == 1
+  end
+
+  it "returns 0 if both values are equal" do
+    tmp = REXML::Text.new("tmp")
+    val = tmp <=> tmp
+    val.should == 0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/text/empty_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/text/empty_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/text/empty_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Text#empty?" do
+  it "returns true if the text is empty" do
+    REXML::Text.new("").empty?.should == true
+  end
+
+  it "returns false if the text is not empty" do
+    REXML::Text.new("some_text").empty?.should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/text/indent_text_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/text/indent_text_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/text/indent_text_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Text#indent_text" do
+  before :each do
+    @t = REXML::Text.new("")
+  end
+  it "indents a string with default parameters" do
+    @t.indent_text("foo").should == "\tfoo"
+  end
+
+  it "accepts a custom indentation level as second argument" do
+    @t.indent_text("foo", 2, "\t", true).should == "\t\tfoo"
+  end
+
+  it "accepts a custom separator as third argument" do
+    @t.indent_text("foo", 1, "\n", true).should == "\nfoo"
+  end
+
+  it "accepts a fourth parameter to skip the first line" do
+    @t.indent_text("foo", 1, "\t", false).should == "foo"
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/text/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/text/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/text/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Text#inspect" do
+  it "inspects the string attribute as a string" do
+    REXML::Text.new("a text").inspect.should == "a text".inspect
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/text/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/text/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/text/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,54 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Text.new" do
+
+  it "creates a Text child node with no parent" do
+    t = REXML::Text.new("test")
+    t.should be_kind_of(REXML::Child)
+    t.should == "test"
+    t.parent.should == nil
+  end
+
+  it "respects whitespace if second argument is true" do
+    t = REXML::Text.new("testing   whitespace", true)
+    t.should == "testing   whitespace"
+    t = REXML::Text.new("   ", true)
+    t.should == "   "
+  end
+
+  it "receives a parent as third argument" do
+    e = REXML::Element.new("root")
+    t = REXML::Text.new("test", false, e)
+    t.parent.should == e
+    e.to_s.should == "<root>test</root>"
+  end
+
+  it "expects escaped text if raw is true" do
+    t = REXML::Text.new("&lt;&amp;&gt;", false, nil, true)
+    t.should == "&lt;&amp;&gt;"
+
+    lambda{ REXML::Text.new("<&>", false, nil, true)}.should raise_error(Exception)
+  end
+
+  it "uses raw value of the parent if raw is nil" do
+    e1 = REXML::Element.new("root", nil, { :raw => :all})
+    lambda {REXML::Text.new("<&>", false, e1)}.should raise_error(Exception)
+    
+    e2 = REXML::Element.new("root", nil, { :raw => []})
+    e2.raw.should be_false
+    t1 = REXML::Text.new("<&>", false, e2)
+    t1.should == "&lt;&amp;&gt;"
+  end
+
+  it "escapes the values if raw is false" do
+    t = REXML::Text.new("<&>", false, nil, false)
+    t.should == "&lt;&amp;&gt;"
+  end
+
+   it "can detect illegal expressions from a regex if raw is true" do
+    lambda{ REXML::Text.new("test text", false, nil, true, nil, /text/)}.should raise_error(Exception)
+    lambda{ REXML::Text.new("test", false, nil, true, nil, /text/)}.should_not raise_error(Exception)
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/text/node_type_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/text/node_type_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/text/node_type_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Text#node_type" do
+  it "returns :text" do
+    REXML::Text.new("test").node_type.should == :text
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/text/normalize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/text/normalize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/text/normalize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Text.normalize" do
+  it "escapes a string with <, >, &, ' and \" " do 
+    REXML::Text.normalize("< > & \" '").should == "&lt; &gt; &amp; &quot; &apos;"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/text/read_with_substitution_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/text/read_with_substitution_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/text/read_with_substitution_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Text.read_with_substitution" do
+  it "reads a text and escapes entities" do
+    REXML::Text.read_with_substitution("&lt; &gt; &amp; &quot; &apos;").should == "< > & \" '"
+  end
+
+  it "accepts an regex for invalid expressions and raises an error if text matches" do
+    lambda {REXML::Text.read_with_substitution("this is illegal", /illegal/)}.should raise_error(Exception)
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/text/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/text/to_s_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/text/to_s_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Text#to_s" do
+  it "returns the string of this Text node" do
+    u = REXML::Text.new("sean russell", false, nil, true)
+    u.to_s.should == "sean russell"
+
+    t = REXML::Text.new("some test text")
+    t.to_s.should == "some test text"
+  end
+
+  it "escapes the text" do
+    t = REXML::Text.new("& < >")
+    t.to_s.should == "&amp; &lt; &gt;"
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/text/unnormalize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/text/unnormalize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/text/unnormalize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Text.unnormalize" do
+  it "unescapes a string with the values defined in SETUTITSBUS" do 
+    REXML::Text.unnormalize("&lt; &gt; &amp; &quot; &apos;").should == "< > & \" '"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/text/value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/text/value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/text/value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,37 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Text#value" do
+  it "returns the text value of this node" do
+    REXML::Text.new("test").value.should == "test"
+  end
+
+  it "does not escape entities" do
+    REXML::Text.new("& \"").value.should == "& \""
+  end
+
+  it "follows the respect_whitespace attribute" do
+    REXML::Text.new("test     bar", false).value.should == "test bar"
+    REXML::Text.new("test     bar", true).value.should == "test     bar"
+  end
+
+  it "ignores the raw attribute" do
+    REXML::Text.new("sean russell", false, nil, true).value.should == "sean russell"
+  end
+end
+
+describe "REXML::Text#value=" do
+  before :each do
+    @t = REXML::Text.new("new")    
+  end
+
+  it "sets the text of the node" do
+    @t.value = "another text"
+    @t.to_s.should == "another text"
+  end
+
+  it "escapes entities" do
+    @t.value = "<a>"
+    @t.to_s.should == "&lt;a&gt;"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/text/wrap_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/text/wrap_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/text/wrap_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Text#wrap" do
+  before :each do
+    @t = REXML::Text.new("abc def")    
+  end
+
+  it "wraps the text at width" do
+    @t.wrap("abc def", 3, false).should == "abc\ndef"
+  end
+
+  it "returns the string if width is greater than the size of the string" do
+    @t.wrap("abc def", 10, false).should == "abc def"
+  end
+
+  it "takes a newline at the beginning option as the third parameter"do
+    @t.wrap("abc def", 3, true).should == "\nabc\ndef"
+  end
+end
+ 

Added: MacRuby/branches/experimental/spec/frozen/library/rexml/text/write_with_substitution_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/rexml/text/write_with_substitution_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/rexml/text/write_with_substitution_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'rexml/document'
+
+describe "REXML::Text#write_with_substitution" do
+  before :each do
+    @t = REXML::Text.new("test")
+    @f = tmp("rexml_spec")
+    @file = File.open(@f, "w+")
+  end
+
+  after :each do
+    @file.close
+    File.delete(@f) if File.exists?(@f)
+  end
+
+  it "writes out the input to a String" do
+    s = ""
+    @t.write_with_substitution(s, "some text")
+    s.should == "some text"
+  end
+
+  it "writes out the input to an IO" do
+    @t.write_with_substitution(@file, "some text")
+    @file.rewind
+    @file.gets.should == "some text"
+  end
+
+  it "escapes characters" do
+    @t.write_with_substitution(@file, "& < >")
+    @file.rewind
+    @file.gets.should == "&amp; &lt; &gt;"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/scanf/io/block_scanf_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/scanf/io/block_scanf_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/scanf/io/block_scanf_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/block_scanf.rb'
+require 'scanf'
+
+describe "IO#block_scanf" do
+  it_behaves_like(:scanf_io_block_scanf, :block_scanf)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/scanf/io/fixtures/date.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/scanf/io/fixtures/date.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/scanf/io/fixtures/date.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+Beethoven  1770
+Bach       1685
+Handel     1685
+

Added: MacRuby/branches/experimental/spec/frozen/library/scanf/io/fixtures/helloworld.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/scanf/io/fixtures/helloworld.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/scanf/io/fixtures/helloworld.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+hello world
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/scanf/io/scanf_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/scanf/io/scanf_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/scanf/io/scanf_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/block_scanf.rb'
+require 'scanf'
+
+describe "IO#scanf" do
+  before :each do
+    @hw = File.open(File.dirname(__FILE__) + '/fixtures/helloworld.txt', 'r')
+    @data = File.open(File.dirname(__FILE__) + '/fixtures/date.txt', 'r')
+  end
+
+  after :each do
+    @hw.close unless @hw.closed?
+    @data.close unless @data.closed?
+  end
+
+  it "returns an array containing the input converted in the specified type" do
+    @hw.scanf("%s%s").should == ["hello", "world"]
+    @data.scanf("%s%d").should == ["Beethoven", 1770]
+  end
+  
+  it "returns an array containing the input converted in the specified type with given maximum field width" do
+    @hw.scanf("%2s").should == ["he"]
+    @data.scanf("%2c").should == ["Be"]
+  end
+
+  it "returns an empty array when a wrong specifier is passed" do
+    @hw.scanf("%a").should == []
+    @hw.scanf("%1").should == []
+    @data.scanf("abc").should == []
+  end
+end
+
+describe "IO#scanf with block" do
+  it_behaves_like(:scanf_io_block_scanf, :scanf)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/scanf/io/shared/block_scanf.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/scanf/io/shared/block_scanf.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/scanf/io/shared/block_scanf.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+require 'scanf'
+
+describe :scanf_io_block_scanf, :shared => true do
+  before :each do
+    @data= File.open(File.dirname(__FILE__) + '/../fixtures/date.txt', 'r')
+  end
+
+  after :each do
+    @data.close unless @data.closed?
+  end
+
+  it "passes each match to the block as an array" do
+    res = @data.send(@method, "%s%d") { |name, year| "#{name} was born in #{year}." }
+    res.should == ["Beethoven was born in 1770.", "Bach was born in 1685.", "Handel was born in 1685."]
+  end
+
+  it "keeps scanning the input and cycling back to the beginning of the input string" do
+    a = []
+    @data.send(@method, "%s"){|w| a << w}
+    a.should == [["Beethoven"], ["1770"], ["Bach"], ["1685"], ["Handel"], ["1685"]]
+  end
+
+  it "returns an empty array when a wrong specifier is passed" do
+    a = []
+    @data.send(@method, "%z"){|w| a << w}
+    a.empty?.should be_true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/scanf/string/block_scanf_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/scanf/string/block_scanf_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/scanf/string/block_scanf_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/block_scanf.rb'
+require 'scanf'
+
+describe "String#block_scanf" do
+  it_behaves_like(:scanf_string_block_scanf, :block_scanf)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/scanf/string/scanf_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/scanf/string/scanf_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/scanf/string/scanf_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,53 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/block_scanf.rb'
+require 'scanf'
+
+describe "String#scanf" do
+  it "returns an array containing the input converted in the specified type" do
+    "hello world".scanf("%s").should == ["hello"]
+    "hello world".scanf("%s%d").should == ["hello"]
+    "hello world".scanf("%s%c").should == ["hello", " "]
+    "hello world".scanf("%c%s").should == ["h", "ello"]
+    "hello world".scanf("%s%s").should == ["hello", "world"]
+    "hello world".scanf("%c").should == ["h"]
+    "123".scanf("%s").should == ["123"]
+    "123".scanf("%c").should == ["1"]
+    "123".scanf("%d").should == [123]
+    "123".scanf("%u").should == [123]
+    "123".scanf("%o").should == [83]
+    "123".scanf("%x").should == [291]
+    "123".scanf("%i").should == [123]
+    "0123".scanf("%i").should == [83]
+    "123".scanf("%f").should == [123.0]
+    "0X123".scanf("%i").should == [291]
+    "0x123".scanf("%i").should == [291]
+  end
+  
+  it "returns an array containing the input converted in the specified type with given maximum field width" do
+    "hello world".scanf("%2s").should == ["he"]
+    "hello world".scanf("%2c").should == ["he"]
+    "123".scanf("%2s").should == ["12"]
+    "123".scanf("%2c").should == ["12"]
+    "123".scanf("%2d").should == [12]
+    "123".scanf("%2u").should == [12]
+    "123".scanf("%2o").should == [10]
+    "123".scanf("%2x").should == [18]
+    "123".scanf("%2i").should == [12]
+    "0123".scanf("%2i").should == [1]
+    "123".scanf("%2f").should == [12.0]
+    "0X123".scanf("%2i").should == [0]
+    "0X123".scanf("%3i").should == [1]
+    "0X123".scanf("%4i").should == [18]
+  end
+
+  it "returns an empty array when a wrong specifier is passed" do
+    "hello world".scanf("%a").should == []
+    "123".scanf("%1").should == []
+    "123".scanf("abc").should == []
+    "123".scanf(:d).should == []
+  end
+end
+
+describe "String#scanf with block" do
+  it_behaves_like(:scanf_string_block_scanf, :scanf)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/scanf/string/shared/block_scanf.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/scanf/string/shared/block_scanf.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/scanf/string/shared/block_scanf.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require 'scanf'
+
+describe :scanf_string_block_scanf, :shared => true do
+  it "passes each match to the block as an array" do
+    a = []
+    "hello world".send(@method, "%s%s"){|w| a << w}
+    a.should == [["hello", "world"]]
+  end
+
+  it "keeps scanning the input and cycling back to the beginning of the input string" do
+    a = []
+    "hello world".send(@method, "%s"){|w| a << w}
+    a.should == [["hello"], ["world"]]
+
+    s = []
+    str = "123 abc 456 def 789 ghi" 
+    s = str.send(@method, "%d%s"){|num,str| [num * 2, str.upcase]}
+    s.should == [[246, "ABC"], [912, "DEF"], [1578, "GHI"]]
+  end
+
+  it "returns an empty array when a wrong specifier is passed" do
+    a = []
+    "hello world".send(@method, "%z"){|w| a << w}
+    a.empty?.should be_true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/securerandom/base64_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/securerandom/base64_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/securerandom/base64_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,56 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+ruby_version_is "1.8.7" do
+  require 'securerandom'
+
+  describe "SecureRandom.base64" do
+    it "generates a random base64 string out of specified number of random bytes" do
+      (16..128).each do |idx|
+        base64 = SecureRandom.base64(idx)
+        base64.class.should == String
+        base64.length.should < 2 * idx
+      end
+      
+      base64 = SecureRandom.base64(16.5)
+      base64.class.should == String
+      base64.length.should < 2 * 16
+    end
+
+    it "returns an empty string when argument is 0" do
+      SecureRandom.base64(0).should == ""
+    end
+
+    it "generates different base64 strings with subsequent invocations" do
+      # quick and dirty check, but good enough
+      values = []
+      256.times do
+        base64 = SecureRandom.base64
+        # make sure the random values are not repeating
+        values.include?(base64).should == false
+        values << base64
+      end
+    end
+
+    it "generates a random base64 string out of 32 random bytes" do
+      SecureRandom.base64.class.should == String
+      SecureRandom.base64.length.should < 32 * 2
+    end
+
+    it "treats nil agrument as default one and generates a random base64 string" do
+      SecureRandom.base64(nil).class.should == String
+      SecureRandom.base64(nil).length.should < 32 * 2
+    end
+
+    it "raises ArgumentError on negative arguments" do
+      lambda {
+        SecureRandom.base64(-1)
+      }.should raise_error(ArgumentError)
+    end
+
+    it "tries to convert the passed argument to an Integer using #to_int" do
+      obj = mock("to_int")
+      obj.should_receive(:to_int).and_return(5)
+      SecureRandom.base64(obj).size.should < 10
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/securerandom/hex_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/securerandom/hex_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/securerandom/hex_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,56 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+ruby_version_is "1.8.7" do
+  require 'securerandom'
+
+  describe "SecureRandom.hex" do
+    it "generates a random hex string of length twice the specified argement" do
+      (1..64).each do |idx|
+        hex = SecureRandom.hex(idx)
+        hex.class.should == String
+        hex.length.should == 2 * idx
+      end
+      
+      base64 = SecureRandom.hex(5.5)
+      base64.class.should == String
+      base64.length.should eql(10)
+    end
+
+    it "returns an empty string when argument is 0" do
+      SecureRandom.hex(0).should == ""
+    end
+
+    it "generates different hex strings with subsequent invocations" do
+      # quick and dirty check, but good enough
+      values = []
+      256.times do
+        hex = SecureRandom.hex
+        # make sure the random values are not repeating
+        values.include?(hex).should == false
+        values << hex
+      end
+    end
+
+    it "generates a random hex string of length 32 if no argument is provided" do
+      SecureRandom.hex.class.should == String
+      SecureRandom.hex.length.should == 32
+    end
+
+    it "treats nil agrument as default one and generates a random hex string of length 32" do
+      SecureRandom.hex(nil).class.should == String
+      SecureRandom.hex(nil).length.should == 32
+    end
+
+    it "raises ArgumentError on negative arguments" do
+      lambda {
+        SecureRandom.hex(-1)
+      }.should raise_error(ArgumentError)
+    end
+
+    it "tries to convert the passed argument to an Integer using #to_int" do
+      obj = mock("to_int")
+      obj.should_receive(:to_int).and_return(5)
+      SecureRandom.hex(obj).size.should eql(10)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/securerandom/random_bytes_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/securerandom/random_bytes_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/securerandom/random_bytes_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,52 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+ruby_version_is "1.8.7" do
+  require 'securerandom'
+
+  describe "SecureRandom.random_bytes" do
+    it "generates a random binary string of length 16 if no argument is provided" do
+      bytes = SecureRandom.random_bytes
+      bytes.class.should == String
+      bytes.length.should == 16
+    end
+
+    it "generates a random binary string of length 16 if argument is nil" do
+      bytes = SecureRandom.random_bytes(nil)
+      bytes.class.should == String
+      bytes.length.should == 16
+    end
+
+    it "generates a random binary string of specified length" do
+      (1..64).each do |idx|
+        bytes = SecureRandom.random_bytes(idx)
+        bytes.class.should == String
+        bytes.length.should == idx
+      end
+
+      SecureRandom.random_bytes(2.2).length.should eql(2)
+    end
+
+    it "generates different binary strings with subsequent invocations" do
+      # quick and dirty check, but good enough
+      values = []
+      256.times do
+        val = SecureRandom.random_bytes
+        # make sure the random bytes are not repeating
+        values.include?(val).should == false
+        values << val
+      end
+    end
+
+    it "raises ArgumentError on negative arguments" do
+      lambda {
+        SecureRandom.random_bytes(-1)
+      }.should raise_error(ArgumentError)
+    end
+
+    it "tries to convert the passed argument to an Integer using #to_int" do
+      obj = mock("to_int")
+      obj.should_receive(:to_int).and_return(5)
+      SecureRandom.random_bytes(obj).size.should eql(5)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/securerandom/random_number_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/securerandom/random_number_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/securerandom/random_number_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,49 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+ruby_version_is "1.8.7" do
+  require 'securerandom'
+
+  describe "SecureRandom.random_number" do
+    it "generates a random positive number smaller then the positive integer argument" do
+      (1..64).each do |idx|
+        num = SecureRandom.random_number(idx)
+        num.class.should == Fixnum
+        (0 <= num).should == true
+        (num < idx).should == true
+      end
+    end
+
+    it "generates a random float number between 0.0 and 1.0 if no argument provided" do
+      64.times do
+        num = SecureRandom.random_number
+        num.class.should == Float
+        (0.0 <= num).should == true
+        (num < 1.0).should == true
+      end
+    end
+    
+    it "generates a random float number between 0.0 and 1.0 if argument is negative" do
+      num = SecureRandom.random_number(-10)
+      num.class.should == Float
+      (0.0 <= num).should == true
+      (num < 1.0).should == true
+    end
+
+    it "generates different float numbers with subsequent invocations" do
+      # quick and dirty check, but good enough
+      values = []
+      256.times do
+        val = SecureRandom.random_number
+        # make sure the random values are not repeating
+        values.include?(val).should == false
+        values << val
+      end
+    end
+
+    it "raises ArgumentError if the argument is non-numeric" do
+      lambda {
+        SecureRandom.random_number(Object.new)
+      }.should raise_error(ArgumentError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/add_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/add_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/add_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+require File.dirname(__FILE__) + '/shared/add'
+
+describe "Set#add" do
+  it_behaves_like :set_add, :add
+end
+
+describe "Set#add?" do
+  before :each do
+    @set = Set.new
+  end
+
+  it "adds the passed Object to self" do
+    @set.add?("cat")
+    @set.should include("cat")
+  end
+
+  it "returns self when the Object has not yet been added to self" do
+    @set.add?("cat").should equal(@set)
+  end
+
+  it "returns nil when the Object has already been added to self" do
+    @set.add?("cat")
+    @set.add?("cat").should be_nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/append_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/append_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/append_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+require File.dirname(__FILE__) + '/shared/add'
+
+describe "Set#<<" do
+  it_behaves_like :set_add, :<<
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/classify_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/classify_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/classify_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+describe "Set#classify" do
+  before(:each) do
+    @set = Set["one", "two", "three", "four"]
+  end
+
+  it "yields each Object in self" do
+    res = []
+    @set.classify { |x| res << x }
+    res.sort.should == ["one", "two", "three", "four"].sort
+  end
+
+  ruby_version_is "" ... "1.8.8" do
+    it "raises a LocalJumpError when passed no block" do
+      lambda { @set.classify }.should raise_error(LocalJumpError)
+    end
+  end
+  
+  ruby_version_is "1.8.8" do
+    it "returns an Enumerator when passed no block" do
+      enum = @set.classify
+      enum.should be_kind_of(Enumerable::Enumerator)
+      
+      classified = enum.each { |x| x.length }
+      classified.should == { 3 => Set["one", "two"], 4 => Set["four"], 5 => Set["three"] }
+    end
+  end
+
+  it "classifies the Objects in self based on the block's return value" do
+    classified = @set.classify { |x| x.length }
+    classified.should == { 3 => Set["one", "two"], 4 => Set["four"], 5 => Set["three"] }
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/clear_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/clear_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/clear_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+describe "Set#clear" do
+  before(:each) do
+    @set = Set["one", "two", "three", "four"]
+  end
+
+  it "removes all elements from self" do
+    @set.clear
+    @set.should be_empty
+  end
+
+  it "returns self" do
+    @set.clear.should equal(@set)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/collect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/collect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/collect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+require File.dirname(__FILE__) + '/shared/collect'
+
+describe "Set#collect!" do
+  it_behaves_like :set_collect_bang, :collect!
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/constructor_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/constructor_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/constructor_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+describe "Set[]" do
+  it "returns a new Set populated with the passed Objects" do
+    set = Set[1, 2, 3]
+
+    set.instance_of?(Set).should be_true
+    set.size.should eql(3)
+
+    set.should include(1)
+    set.should include(2)
+    set.should include(3)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/delete_if_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/delete_if_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/delete_if_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,46 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+describe "Set#delete_if" do
+  before(:each) do
+    @set = Set["one", "two", "three"]
+  end
+
+  it "yields every element of self" do
+    ret = []
+    @set.delete_if { |x| ret << x }
+    ret.sort.should == ["one", "two", "three"].sort
+  end
+
+  it "deletes every element from self for which the passed block returns true" do
+    @set.delete_if { |x| x.size == 3 }
+    @set.size.should eql(1)
+
+    @set.should_not include("one")
+    @set.should_not include("two")
+    @set.should include("three")
+  end
+
+  it "returns self" do
+    @set.delete_if { |x| x }.should equal(@set)
+  end
+
+  ruby_version_is "" ... "1.8.8" do
+    it "raises a LocalJumpError when passed no block" do
+      lambda { @set.delete_if }.should raise_error(LocalJumpError)
+    end
+  end
+  
+  ruby_version_is "1.8.8" do
+    it "returns an Enumerator when passed no block" do
+      enum = @set.delete_if
+      enum.should be_kind_of(Enumerable::Enumerator)
+      
+      enum.each { |x| x.size == 3 }
+      
+      @set.should_not include("one")
+      @set.should_not include("two")
+      @set.should include("three")
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/delete_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/delete_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/delete_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,37 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+describe "Set#delete" do
+  before(:each) do
+    @set = Set["a", "b", "c"]
+  end
+  
+  it "deletes the passed Object from self" do
+    @set.delete("a")
+    @set.should_not include("a")
+  end
+
+  it "returns self" do
+    @set.delete("a").should equal(@set)
+    @set.delete("x").should equal(@set)
+  end
+end
+
+describe "Set#delete?" do
+  before(:each) do
+    @set = Set["a", "b", "c"]
+  end
+  
+  it "deletes the passed Object from self" do
+    @set.delete?("a")
+    @set.should_not include("a")
+  end
+  
+  it "returns self when the passed Object is in self" do
+    @set.delete?("a").should equal(@set)
+  end
+  
+  it "returns nil when the passed Object is not in self" do
+    @set.delete?("x").should be_nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/difference_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/difference_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/difference_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+require File.dirname(__FILE__) + '/shared/difference'
+
+describe "Set#difference" do
+  it_behaves_like :set_difference, :difference
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/divide_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/divide_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/divide_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+describe "Set#divide" do
+  it "divides self into a set of subsets based on the blocks return values" do
+    set = Set["one", "two", "three", "four", "five"].divide { |x| x.length }
+    set.map { |x| x.to_a.sort }.sort.should == [["five", "four"], ["one", "two"], ["three"]]
+  end
+  
+  it "yields each Object to the block" do
+    ret = []
+    Set["one", "two", "three", "four", "five"].divide { |x| ret << x }
+    ret.sort.should == ["five", "four", "one", "three", "two"]
+  end
+  
+  # BUG: Does not raise a LocalJumpError, but a NoMethodError
+  #
+  # it "raises a LocalJumpError when not passed a block" do
+  #   lambda { Set[1].divide }.should raise_error(LocalJumpError)
+  # end
+end
+
+describe "Set#divide when passed a block with an arity of 2" do
+  it "divides self into a set of subsets based on the blocks return values" do
+    set = Set[1, 3, 4, 6, 9, 10, 11].divide { |x, y| (x - y).abs == 1 }
+    set.map{ |x| x.to_a.sort }.sort.should == [[1], [3, 4], [6], [9, 10, 11]]
+  end
+  
+  it "yields each two Object to the block" do
+    ret = []
+    Set[1, 2].divide { |x, y| ret << [x, y] }
+    ret.should == [[1, 1], [1, 2], [2, 1], [2, 2]]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/each_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/each_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/each_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+describe "Set#each" do
+  before(:each) do
+    @set = Set[1, 2, 3]
+  end
+  
+  it "yields each Object in self" do
+    ret = []
+    @set.each { |x| ret << x }
+    ret.sort.should == [1, 2, 3]
+  end
+  
+  it "returns self" do
+    @set.each { |x| x }.should equal(@set)
+  end
+  
+  ruby_version_is "1.8.7" do
+    it "returns an Enumerator when not passed a block" do
+      enum = @set.each
+      
+      ret = []
+      enum.each { |x| ret << x }
+      ret.sort.should == [1, 2, 3]
+    end
+  end
+  
+  ruby_version_is "" ... "1.8.7" do
+    it "raises a LocalJumpError when not passed a block" do
+      lambda { @set.each }.should raise_error(LocalJumpError)
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/set/empty_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/empty_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/empty_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+describe "Set#empty?" do
+  it "returns true if self is empty" do
+    Set[].empty?.should be_true
+    Set[1].empty?.should be_false
+    Set[1,2,3].empty?.should be_false
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/set/enumerable/to_set_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/enumerable/to_set_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/enumerable/to_set_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+describe "Emumerable#to_set" do
+  it "returns a new Set created from self" do
+    [1, 2, 3].to_set.should == Set[1, 2, 3]
+    {:a => 1, :b => 2}.to_set.should == Set[[:b, 2], [:a, 1]]
+  end
+  
+  it "allows passing an alternate class for Set" do
+    sorted_set = [1, 2, 3].to_set(SortedSet)
+    sorted_set.should == SortedSet[1, 2, 3]
+    sorted_set.instance_of?(SortedSet).should == true
+  end
+  
+  it "passes down passed blocks" do
+    [1, 2, 3].to_set { |x| x * x }.should == Set[1, 4, 9]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/eql_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/eql_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/eql_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+ruby_version_is "1.8.7" do
+  describe "Set#eql?" do
+    it "returns true when the passed argument is a Set and contains the same elements" do
+      Set[].should eql(Set[])
+      Set[1, 2, 3].should eql(Set[1, 2, 3])
+      Set[1, 2, 3].should eql(Set[3, 2, 1])
+      Set["a", :b, ?c].should eql(Set[?c, :b, "a"])
+
+      Set[1, 2, 3].should_not eql(Set[1.0, 2, 3])
+      Set[1, 2, 3].should_not eql(Set[2, 3])
+      Set[1, 2, 3].should_not eql(Set[])
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/set/equal_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/equal_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/equal_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,38 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+describe "Set#==" do
+  it "returns true when the passed Object is a Set and self and the Object contain the same elements" do
+    Set[].should == Set[]
+    Set[1, 2, 3].should == Set[1, 2, 3]
+    Set["1", "2", "3"].should == Set["1", "2", "3"]
+    
+    Set[1, 2, 3].should_not == Set[1.0, 2, 3]
+    Set[1, 2, 3].should_not == [1, 2, 3]
+  end
+  
+  it "does not depend on the order of the elements" do
+    Set[1, 2, 3].should == Set[3, 2, 1]
+    Set[:a, "b", ?c].should == Set[?c, "b", :a]
+  end
+  
+  ruby_version_is "" ... "1.8.7" do
+    it "does depend on the order of nested Sets" do
+      Set[Set[1], Set[2], Set[3]].should_not == Set[Set[3], Set[2], Set[1]]
+
+      set1 = Set[Set["a", "b"], Set["c", "d"], Set["e", "f"]]
+      set2 = Set[Set["c", "d"], Set["a", "b"], Set["e", "f"]]
+      set1.should_not == set2
+    end
+  end
+  
+  ruby_version_is "1.8.7" do
+    it "does not depend on the order of nested Sets" do
+      Set[Set[1], Set[2], Set[3]].should == Set[Set[3], Set[2], Set[1]]
+
+      set1 = Set[Set["a", "b"], Set["c", "d"], Set["e", "f"]]
+      set2 = Set[Set["c", "d"], Set["a", "b"], Set["e", "f"]]
+      set1.should == set2
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/exclusion_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/exclusion_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/exclusion_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+describe "Set#^" do
+  before :each do
+    @set = Set[1, 2, 3, 4]
+  end
+  
+  it "returns a new Set containing elements that are not in both self and the passed Enumberable" do
+    (@set ^ Set[3, 4, 5]).should == Set[1, 2, 5]
+    (@set ^ [3, 4, 5]).should == Set[1, 2, 5]
+  end
+  
+  it "raises an ArgumentError when passed a non-Enumerable" do
+    lambda { @set ^ 3 }.should raise_error(ArgumentError)
+    lambda { @set ^ Object.new }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/flatten_merge_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/flatten_merge_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/flatten_merge_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+describe "Set#flatten_merge" do
+  it "is protected" do
+    Set[].protected_methods.should include("flatten_merge")
+  end
+  
+  it "flattens the passed Set and merges it into self" do
+    set1 = Set[1, 2]
+    set2 = Set[3, 4, Set[5, 6]]
+    
+    set1.send(:flatten_merge, set2).should == Set[1, 2, 3, 4, 5, 6]
+  end
+  
+  it "raises an ArgumentError when trying to flatten a recursive Set" do
+    set1 = Set[1, 2, 3]
+    set2 = Set[5, 6, 7]
+    set2 << set2
+    
+    lambda { set1.send(:flatten_merge, set2) }.should raise_error(ArgumentError)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/set/flatten_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/flatten_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/flatten_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,40 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+describe "Set#flatten" do
+  it "returns a copy of self with each included Set flattened" do
+    set = Set[1, 2, Set[3, 4, Set[5, 6, Set[7, 8]]], 9, 10]
+    flattened_set = set.flatten
+    
+    flattened_set.should_not equal(set)
+    flattened_set.should == Set[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+  end
+  
+  it "raises an ArgumentError when self is recursive" do
+    (set = Set[]) << set
+    lambda { set.flatten }.should raise_error(ArgumentError)
+  end
+end
+
+describe "Set#flatten!" do
+  it "flattens self" do
+    set = Set[1, 2, Set[3, 4, Set[5, 6, Set[7, 8]]], 9, 10]
+    set.flatten!
+    set.should == Set[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+  end
+  
+  it "returns self when self was modified" do
+    set = Set[1, 2, Set[3, 4]]
+    set.flatten!.should equal(set)
+  end
+  
+  it "returns nil when self was not modified" do
+    set = Set[1, 2, 3, 4]
+    set.flatten!.should be_nil
+  end
+  
+  it "raises an ArgumentError when self is recursive" do
+    (set = Set[]) << set
+    lambda { set.flatten! }.should raise_error(ArgumentError)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/set/hash_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/hash_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/hash_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+ruby_version_is "1.8.7" do
+  describe "Set#hash" do
+    it "should be static" do
+      Set[].hash.should == Set[].hash
+      Set[1, 2, 3].hash.should == Set[1, 2, 3].hash
+      Set[:a, "b", ?c].hash.should == Set[?c, "b", :a].hash
+    
+      Set[].hash.should_not == Set[1, 2, 3].hash
+      Set[1, 2, 3].hash.should_not == Set[:a, "b", ?c].hash
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/include_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/include_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/include_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/include'
+require 'set'
+
+describe "Set#include?" do
+  it_behaves_like :set_include, :include?
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/initialize_copy_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/initialize_copy_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/initialize_copy_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+describe "Set#initialize_copy" do
+  before(:each) do
+    @set = Set[1, 2, 3]
+  end
+  
+  it "is private" do
+    @set.private_methods.should include("initialize_copy")
+  end
+  
+  it "replaces all elements of self with the elements of the passed Set" do
+    other = Set["1", "2", "3"]
+    @set.send(:initialize_copy, other)
+    @set.should == Set["1", "2", "3"]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+describe "Set#initialize" do
+  it "is private" do
+    Set[].private_methods.should include("initialize")
+  end
+  
+  it "adds all elements of the passed Enumerable to self" do
+    s = Set.new([1, 2, 3])
+    s.size.should eql(3)
+    s.should include(1)
+    s.should include(2)
+    s.should include(3)
+  end
+  
+  it "preprocesses all elements by a passed block before adding to self" do
+    s = Set.new([1, 2, 3]) { |x| x * x }
+    s.size.should eql(3)
+    s.should include(1)
+    s.should include(4)
+    s.should include(9)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+describe "Set#inspect" do
+  it "returns a String representation of self" do
+    Set[].inspect.should be_kind_of(String)
+    Set[nil, false, true].inspect.should be_kind_of(String)
+    Set[1, 2, 3].inspect.should be_kind_of(String)
+    Set["1", "2", "3"].inspect.should be_kind_of(String)
+    Set[:a, "b", Set[?c]].inspect.should be_kind_of(String)
+  end
+  
+  it "correctly handles self-references" do
+    (set = Set[]) << set
+    set.inspect.should be_kind_of(String)
+    set.inspect.should include("#<Set: {...}>")
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/intersection_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/intersection_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/intersection_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/intersection'
+require 'set'
+
+describe "Set#intersection" do
+  it_behaves_like :set_intersection, :intersection
+end
+
+describe "Set#&" do
+  it_behaves_like :set_intersection, :&
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/length'
+require 'set'
+
+describe "Set#length" do
+  it_behaves_like :set_length, :length
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/map_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/map_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/map_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+require File.dirname(__FILE__) + '/shared/collect'
+
+describe "Set#map!" do
+  it_behaves_like :set_collect_bang, :map!
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/member_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/member_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/member_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/include'
+require 'set'
+
+describe "Set#member?" do
+  it_behaves_like :set_include, :member?
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/merge_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/merge_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/merge_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+describe "Set#merge" do
+  it "adds the elements of the passed Enumerable to self" do
+    Set[:a, :b].merge(Set[:b, :c, :d]).should == Set[:a, :b, :c, :d]
+    Set[1, 2].merge([3, 4]).should == Set[1, 2, 3, 4]
+  end
+  
+  it "returns self" do
+    set = Set[1, 2]
+    set.merge([3, 4]).should equal(set)
+  end
+  
+  it "raises an ArgumentError when passed a non-Enumerable" do
+    lambda { Set[1, 2].merge(1) }.should raise_error(ArgumentError)
+    lambda { Set[1, 2].merge(Object.new) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/minus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/minus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/minus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+require File.dirname(__FILE__) + '/shared/difference'
+
+describe "Set#-" do
+  it_behaves_like :set_difference, :-
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/plus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/plus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/plus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/union'
+require 'set'
+
+describe "Set#+" do
+  it_behaves_like :set_union, :+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/pretty_print_cycle_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/pretty_print_cycle_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/pretty_print_cycle_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+describe "Set#pretty_print_cycle" do
+  it "passes the 'pretty print' representation of a self-referencing Set to the pretty print writer" do
+    pp = mock("PrettyPrint")
+    pp.should_receive(:text).with("#<Set: {...}>")
+    Set[1, 2, 3].pretty_print_cycle(pp)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/pretty_print_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/pretty_print_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/pretty_print_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+describe "Set#pretty_print" do
+  it "passes the 'pretty print' representation of self to the pretty print writer" do
+    pp = mock("PrettyPrint")
+    set = Set[1, 2, 3]
+
+    pp.should_receive(:text).with("#<Set: {")
+    pp.should_receive(:text).with("}>")
+    
+    pp.should_receive(:nest).with(1).and_yield
+    pp.should_receive(:seplist).with(set)
+    
+    set.pretty_print(pp)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/proper_subset_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/proper_subset_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/proper_subset_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+describe "Set#proper_subset?" do
+  before(:each) do
+    @set = Set[1, 2, 3, 4]
+  end
+
+  it "returns true if passed a Set that self is a proper subset of" do
+    Set[].proper_subset?(@set).should be_true
+    Set[].proper_subset?(Set[1, 2, 3]).should be_true
+    Set[].proper_subset?(Set["a", :b, ?c]).should be_true
+
+    Set[1, 2, 3].proper_subset?(@set).should be_true
+    Set[1, 3].proper_subset?(@set).should be_true
+    Set[1, 2].proper_subset?(@set).should be_true
+    Set[1].proper_subset?(@set).should be_true
+    
+    Set[5].proper_subset?(@set).should be_false
+    Set[1, 5].proper_subset?(@set).should be_false
+    Set[nil].proper_subset?(@set).should be_false
+    Set["test"].proper_subset?(@set).should be_false
+    
+    @set.proper_subset?(@set).should be_false
+    Set[].proper_subset?(Set[]).should be_false
+  end
+  
+  it "raises an ArgumentError when passed a non-Set" do
+    lambda { Set[].proper_subset?([]) }.should raise_error(ArgumentError)
+    lambda { Set[].proper_subset?(1) }.should raise_error(ArgumentError)
+    lambda { Set[].proper_subset?("test") }.should raise_error(ArgumentError)
+    lambda { Set[].proper_subset?(Object.new) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/proper_superset_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/proper_superset_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/proper_superset_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+describe "Set#proper_superset?" do
+  before(:each) do
+    @set = Set[1, 2, 3, 4]
+  end
+
+  it "returns true if passed a Set that self is a proper superset of" do
+    @set.proper_superset?(Set[]).should be_true
+    Set[1, 2, 3].proper_superset?(Set[]).should be_true
+    Set["a", :b, ?c].proper_superset?(Set[]).should be_true
+
+    @set.proper_superset?(Set[1, 2, 3]).should be_true
+    @set.proper_superset?(Set[1, 3]).should be_true
+    @set.proper_superset?(Set[1, 2]).should be_true
+    @set.proper_superset?(Set[1]).should be_true
+    
+    @set.proper_superset?(Set[5]).should be_false
+    @set.proper_superset?(Set[1, 5]).should be_false
+    @set.proper_superset?(Set[nil]).should be_false
+    @set.proper_superset?(Set["test"]).should be_false
+    
+    @set.proper_superset?(@set).should be_false
+    Set[].proper_superset?(Set[]).should be_false
+  end
+  
+  it "raises an ArgumentError when passed a non-Set" do
+    lambda { Set[].proper_superset?([]) }.should raise_error(ArgumentError)
+    lambda { Set[].proper_superset?(1) }.should raise_error(ArgumentError)
+    lambda { Set[].proper_superset?("test") }.should raise_error(ArgumentError)
+    lambda { Set[].proper_superset?(Object.new) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/reject_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/reject_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/reject_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,50 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+describe "Set#reject!" do
+  before(:each) do
+    @set = Set["one", "two", "three"]
+  end
+  
+  it "yields every element of self" do
+    ret = []
+    @set.reject! { |x| ret << x }
+    ret.sort.should == ["one", "two", "three"].sort
+  end
+  
+  it "deletes every element from self for which the passed block returns true" do
+    @set.reject! { |x| x.size == 3 }
+    @set.size.should eql(1)
+    
+    @set.should_not include("one")
+    @set.should_not include("two")
+    @set.should include("three")
+  end
+  
+  it "returns self when self was modified" do
+    @set.reject! { |x| true }.should equal(@set)
+  end
+
+  it "returns nil when self was not modified" do
+    @set.reject! { |x| false }.should be_nil
+  end
+  
+  ruby_version_is "" ... "1.8.8" do
+    it "raises a LocalJumpError when passed no block" do
+      lambda { @set.reject! }.should raise_error(LocalJumpError)
+    end
+  end
+  
+  ruby_version_is "1.8.8" do
+    it "returns an Enumerator when passed no block" do
+      enum = @set.reject!
+      enum.should be_kind_of(Enumerable::Enumerator)
+      
+      enum.each { |x| x.size == 3 }
+      
+      @set.should_not include("one")
+      @set.should_not include("two")
+      @set.should include("three")
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/replace_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/replace_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/replace_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+describe "Set#replace" do
+  before :each do
+    @set = Set[:a, :b, :c]
+  end
+  
+  it "replaces the contents with other and returns self" do
+    @set.replace(Set[1, 2, 3]).should == @set
+    @set.should == Set[1, 2, 3]
+  end
+  
+  it "accepts any enumerable as other" do
+    @set.replace([1, 2, 3]).should == Set[1, 2, 3]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/shared/add.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/shared/add.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/shared/add.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+describe :set_add, :shared => true do
+  before :each do
+    @set = Set.new
+  end
+
+  it "adds the passed Object to self" do
+    @set.send(@method, "dog")
+    @set.should include("dog")
+  end
+
+  it "returns self" do
+    @set.send(@method, "dog").should equal(@set)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/shared/collect.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/shared/collect.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/shared/collect.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+describe :set_collect_bang, :shared => true do
+  before(:each) do
+    @set = Set[1, 2, 3, 4, 5]
+  end
+
+  it "yields each Object in self" do
+    res = []
+    @set.send(@method) { |x| res << x }
+    res.sort.should == [1, 2, 3, 4, 5].sort
+  end
+
+  it "returns self" do
+    @set.send(@method) { |x| x }.should equal(@set)
+  end
+
+  it "replaces self with the return values of the block" do
+    @set.send(@method) { |x| x * 2 }
+    @set.should == Set[2, 4, 6, 8, 10]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/shared/difference.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/shared/difference.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/shared/difference.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+describe :set_difference, :shared => true do
+  before :each do
+    @set = Set[:a, :b, :c]
+  end
+
+  it "returns a new Set containting self's elements excluding the elements in the passed Enumerable" do
+    @set.send(@method, Set[:a, :b]).should == Set[:c]
+    @set.send(@method, [:b, :c]).should == Set[:a]
+  end
+
+  it "raises an ArgumentError when passed a non-Enumerable" do
+    lambda { @set.send(@method, 1) }.should raise_error(ArgumentError)
+    lambda { @set.send(@method, Object.new) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/shared/include.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/shared/include.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/shared/include.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+describe :set_include, :shared => true do
+  it "returns true when self contains the passed Object" do
+    set = Set[:a, :b, :c]
+    set.send(@method, :a).should be_true
+    set.send(@method, :e).should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/shared/intersection.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/shared/intersection.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/shared/intersection.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+describe :set_intersection, :shared => true do
+  before :each do
+    @set = Set[:a, :b, :c]
+  end
+
+  it "returns a new Set containing only elements shared by self and the passed Enumerable" do
+    @set.send(@method, Set[:b, :c, :d, :e]).should == Set[:b, :c]
+    @set.send(@method, [:b, :c, :d]).should == Set[:b, :c]
+  end
+
+  it "raises an ArgumentError when passed a non-Enumerable" do
+    lambda { @set.send(@method, 1) }.should raise_error(ArgumentError)
+    lambda { @set.send(@method, Object.new) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/shared/length.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/shared/length.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/shared/length.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+describe :set_length, :shared => true do
+  it "returns the number of elements in the set" do
+    set = Set[:a, :b, :c]
+    set.send(@method).should == 3
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/shared/union.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/shared/union.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/shared/union.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+describe :set_union, :shared => true do
+  before :each do
+    @set = Set[:a, :b, :c]
+  end
+
+  it "returns a new Set containing all elements of self and the passed Enumerable" do
+    @set.send(@method, Set[:b, :d, :e]).should == Set[:a, :b, :c, :d, :e]
+    @set.send(@method, [:b, :e]).should == Set[:a, :b, :c, :e]
+  end
+
+  it "raises an ArgumentError when passed a non-Enumerable" do
+    lambda { @set.send(@method, 1) }.should raise_error(ArgumentError)
+    lambda { @set.send(@method, Object.new) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/length'
+require 'set'
+
+describe "Set#size" do
+  it_behaves_like :set_length, :size
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/add_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/add_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/add_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+require File.dirname(__FILE__) + '/shared/add'
+
+describe "SortedSet#add" do
+  it_behaves_like :sorted_set_add, :add
+end
+
+describe "SortedSet#add?" do
+  before :each do
+    @set = SortedSet.new
+  end
+
+  it "adds the passed Object to self" do
+    @set.add?("cat")
+    @set.should include("cat")
+  end
+
+  it "returns self when the Object has not yet been added to self" do
+    @set.add?("cat").should equal(@set)
+  end
+
+  it "returns nil when the Object has already been added to self" do
+    @set.add?("cat")
+    @set.add?("cat").should be_nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/append_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/append_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/append_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+require File.dirname(__FILE__) + '/shared/add'
+
+describe "SortedSet#<<" do
+  it_behaves_like :sorted_set_add, :<<
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/classify_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/classify_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/classify_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+describe "SortedSet#classify" do
+  before(:each) do
+    @set = SortedSet["one", "two", "three", "four"]
+  end
+
+  it "yields each Object in self in sorted order" do
+    res = []
+    @set.classify { |x| res << x }
+    res.should == ["one", "two", "three", "four"].sort
+  end
+
+  ruby_version_is "" ... "1.8.8" do
+    it "raises a LocalJumpError when passed no block" do
+      lambda { @set.classify }.should raise_error(LocalJumpError)
+    end
+  end
+  
+  ruby_version_is "1.8.8" do
+    it "returns an Enumerator when passed no block" do
+      enum = @set.classify
+      enum.should be_kind_of(Enumerable::Enumerator)
+      
+      classified = enum.each { |x| x.length }
+      classified.should == { 3 => SortedSet["one", "two"], 4 => SortedSet["four"], 5 => SortedSet["three"] }
+    end
+  end
+
+  it "classifies the Objects in self based on the block's return value" do
+    classified = @set.classify { |x| x.length }
+    classified.should == { 3 => SortedSet["one", "two"], 4 => SortedSet["four"], 5 => SortedSet["three"] }
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/clear_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/clear_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/clear_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+describe "SortedSet#clear" do
+  before(:each) do
+    @set = SortedSet["one", "two", "three", "four"]
+  end
+
+  it "removes all elements from self" do
+    @set.clear
+    @set.should be_empty
+  end
+
+  it "returns self" do
+    @set.clear.should equal(@set)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/collect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/collect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/collect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+require File.dirname(__FILE__) + '/shared/collect'
+
+describe "SortedSet#collect!" do
+  it_behaves_like :sorted_set_collect_bang, :collect!
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/constructor_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/constructor_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/constructor_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+describe "SortedSet[]" do
+  it "returns a new SortedSet populated with the passed Objects" do
+    set = SortedSet[1, 2, 3]
+
+    set.instance_of?(SortedSet).should be_true
+    set.size.should eql(3)
+
+    set.should include(1)
+    set.should include(2)
+    set.should include(3)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/delete_if_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/delete_if_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/delete_if_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,48 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+describe "SortedSet#delete_if" do
+  before(:each) do
+    @set = SortedSet["one", "two", "three"]
+  end
+
+  ruby_bug "http://redmine.ruby-lang.org/projects/ruby-18/issues/show?id=115", "1.8.7.7" do
+    it "yields each Object in self in sorted order" do
+      ret = []
+      @set.delete_if { |x| ret << x }
+      ret.should == ["one", "two", "three"].sort
+    end
+  end
+
+  it "deletes every element from self for which the passed block returns true" do
+    @set.delete_if { |x| x.size == 3 }
+    @set.size.should eql(1)
+
+    @set.should_not include("one")
+    @set.should_not include("two")
+    @set.should include("three")
+  end
+
+  it "returns self" do
+    @set.delete_if { |x| x }.should equal(@set)
+  end
+
+  ruby_version_is "" ... "1.8.8" do
+    it "raises a LocalJumpError when passed no block" do
+      lambda { @set.delete_if }.should raise_error(LocalJumpError)
+    end
+  end
+  
+  ruby_version_is "1.8.8" do
+    it "returns an Enumerator when passed no block" do
+      enum = @set.delete_if
+      enum.should be_kind_of(Enumerable::Enumerator)
+      
+      enum.each { |x| x.size == 3 }
+      
+      @set.should_not include("one")
+      @set.should_not include("two")
+      @set.should include("three")
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/delete_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/delete_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/delete_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,37 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+describe "SortedSet#delete" do
+  before(:each) do
+    @set = SortedSet["a", "b", "c"]
+  end
+  
+  it "deletes the passed Object from self" do
+    @set.delete("a")
+    @set.should_not include("a")
+  end
+
+  it "returns self" do
+    @set.delete("a").should equal(@set)
+    @set.delete("x").should equal(@set)
+  end
+end
+
+describe "SortedSet#delete?" do
+  before(:each) do
+    @set = SortedSet["a", "b", "c"]
+  end
+  
+  it "deletes the passed Object from self" do
+    @set.delete?("a")
+    @set.should_not include("a")
+  end
+  
+  it "returns self when the passed Object is in self" do
+    @set.delete?("a").should equal(@set)
+  end
+  
+  it "returns nil when the passed Object is not in self" do
+    @set.delete?("x").should be_nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/difference_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/difference_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/difference_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+require File.dirname(__FILE__) + '/shared/difference'
+
+describe "SortedSet#difference" do
+  it_behaves_like :sorted_set_difference, :difference
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/divide_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/divide_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/divide_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+describe "SortedSet#divide" do
+  it "divides self into a set of subsets based on the blocks return values" do
+    set = SortedSet["one", "two", "three", "four", "five"].divide { |x| x.length }
+    set.map { |x| x.to_a }.to_a.sort.should == [["five", "four"], ["one", "two"], ["three"]]
+  end
+  
+  it "yields each Object in self in sorted order" do
+    ret = []
+    SortedSet["one", "two", "three", "four", "five"].divide { |x| ret << x }
+    ret.should == ["one", "two", "three", "four", "five"].sort
+  end
+  
+  # BUG: Does not raise a LocalJumpError, but a NoMethodError
+  #
+  # it "raises a LocalJumpError when not passed a block" do
+  #   lambda { SortedSet[1].divide }.should raise_error(LocalJumpError)
+  # end
+end
+
+describe "SortedSet#divide when passed a block with an arity of 2" do
+  it "divides self into a set of subsets based on the blocks return values" do
+    set = SortedSet[1, 3, 4, 6, 9, 10, 11].divide { |x, y| (x - y).abs == 1 }
+    set.map { |x| x.to_a }.to_a.sort.should == [[1], [3, 4], [6], [9, 10, 11]]
+  end
+  
+  it "yields each two Objects to the block" do
+    ret = []
+    SortedSet[1, 2].divide { |x, y| ret << [x, y] }
+    ret.should == [[1, 1], [1, 2], [2, 1], [2, 2]]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/each_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/each_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/each_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,36 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+describe "SortedSet#each" do
+  before(:each) do
+    @set = SortedSet[1, 2, 3]
+  end
+  
+  it "yields each Object in self in sorted order" do
+    ret = []
+    SortedSet["one", "two", "three"].each { |x| ret << x }
+    ret.should == ["one", "two", "three"].sort
+  end
+  
+  ruby_bug "http://redmine.ruby-lang.org/issues/show/116", "1.8.7.7" do
+    it "returns self" do
+      @set.each { |x| x }.should equal(@set)
+    end
+  end
+  
+  ruby_version_is "1.8.7" do
+    it "returns an Enumerator when not passed a block" do
+      enum = @set.each
+      
+      ret = []
+      enum.each { |x| ret << x }
+      ret.sort.should == [1, 2, 3]
+    end
+  end
+  
+  ruby_version_is "" ... "1.8.7" do
+    it "raises a LocalJumpError when not passed a block" do
+      lambda { @set.each }.should raise_error(LocalJumpError)
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/empty_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/empty_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/empty_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+describe "SortedSet#empty?" do
+  it "returns true if self is empty" do
+    SortedSet[].empty?.should be_true
+    SortedSet[1].empty?.should be_false
+    SortedSet[1,2,3].empty?.should be_false
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/eql_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/eql_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/eql_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+ruby_version_is "1.8.7" do
+  describe "SortedSet#eql?" do
+    it "returns true when the passed argument is a SortedSet and contains the same elements" do
+      SortedSet[].should eql(SortedSet[])
+      SortedSet[1, 2, 3].should eql(SortedSet[1, 2, 3])
+      SortedSet[1, 2, 3].should eql(SortedSet[3, 2, 1])
+
+#      SortedSet["a", :b, ?c].should eql(SortedSet[?c, :b, "a"])
+
+      SortedSet[1, 2, 3].should_not eql(SortedSet[1.0, 2, 3])
+      SortedSet[1, 2, 3].should_not eql(SortedSet[2, 3])
+      SortedSet[1, 2, 3].should_not eql(SortedSet[])
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/equal_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/equal_value_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/equal_value_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+describe "SortedSet#==" do
+  it "returns true when the passed Object is a SortedSet and self and the Object contain the same elements" do
+    SortedSet[].should == SortedSet[]
+    SortedSet[1, 2, 3].should == SortedSet[1, 2, 3]
+    SortedSet["1", "2", "3"].should == SortedSet["1", "2", "3"]
+    
+    SortedSet[1, 2, 3].should_not == SortedSet[1.0, 2, 3]
+    SortedSet[1, 2, 3].should_not == [1, 2, 3]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/exclusion_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/exclusion_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/exclusion_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+describe "SortedSet#^" do
+  before :each do
+    @set = SortedSet[1, 2, 3, 4]
+  end
+  
+  it "returns a new SortedSet containing elements that are not in both self and the passed Enumberable" do
+    (@set ^ SortedSet[3, 4, 5]).should == SortedSet[1, 2, 5]
+    (@set ^ [3, 4, 5]).should == SortedSet[1, 2, 5]
+  end
+  
+  it "raises an ArgumentError when passed a non-Enumerable" do
+    lambda { @set ^ 3 }.should raise_error(ArgumentError)
+    lambda { @set ^ Object.new }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/flatten_merge_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/flatten_merge_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/flatten_merge_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+describe "SortedSet#flatten_merge" do
+  it "is protected" do
+    SortedSet[].protected_methods.should include("flatten_merge")
+  end
+  
+  ruby_bug "http://redmine.ruby-lang.org/projects/ruby-18/issues/show?id=117", "1.8.7" do
+    it "flattens the passed SortedSet and merges it into self" do
+      set1 = SortedSet[1, 2]
+      set2 = SortedSet[3, 4, SortedSet[5, 6]]
+    
+      set1.send(:flatten_merge, set2).should == SortedSet[1, 2, 3, 4, 5, 6]
+    end
+  
+    it "raises an ArgumentError when trying to flatten a recursive SortedSet" do
+      set1 = SortedSet[1, 2, 3]
+      set2 = SortedSet[5, 6, 7]
+      set2 << set2
+    
+      lambda { set1.send(:flatten_merge, set2) }.should raise_error(ArgumentError)
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/flatten_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/flatten_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/flatten_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+describe "SortedSet#flatten" do
+  ruby_bug "http://redmine.ruby-lang.org/projects/ruby-18/issues/show?id=117", "1.8.7" do
+    it "returns a copy of self with each included SortedSet flattened" do
+      set = SortedSet[1, 2, SortedSet[3, 4, SortedSet[5, 6, SortedSet[7, 8]]], 9, 10]
+      flattened_set = set.flatten
+    
+      flattened_set.should_not equal(set)
+      flattened_set.should == SortedSet[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+    end
+  end
+end
+
+describe "SortedSet#flatten!" do
+  ruby_bug "http://redmine.ruby-lang.org/projects/ruby-18/issues/show?id=117", "1.8.7" do
+    it "flattens self" do
+      set = SortedSet[1, 2, SortedSet[3, 4, SortedSet[5, 6, SortedSet[7, 8]]], 9, 10]
+      set.flatten!
+      set.should == SortedSet[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+    end
+  
+    it "returns self when self was modified" do
+      set = SortedSet[1, 2, SortedSet[3, 4]]
+      set.flatten!.should equal(set)
+    end
+  end
+  
+  it "returns nil when self was not modified" do
+    set = SortedSet[1, 2, 3, 4]
+    set.flatten!.should be_nil
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/hash_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/hash_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/hash_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+ruby_version_is "1.8.7" do
+  describe "SortedSet#hash" do
+    it "should be static" do
+      SortedSet[].hash.should == SortedSet[].hash
+      SortedSet[1, 2, 3].hash.should == SortedSet[1, 2, 3].hash
+      SortedSet["a", "b", "c"].hash.should == SortedSet["c", "b", "a"].hash
+    
+      SortedSet[].hash.should_not == SortedSet[1, 2, 3].hash
+      SortedSet[1, 2, 3].hash.should_not == SortedSet["a", "b", "c"].hash
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/include_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/include_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/include_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/include'
+require 'set'
+
+describe "SortedSet#include?" do
+  it_behaves_like :sorted_set_include, :include?
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/initialize_copy_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/initialize_copy_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/initialize_copy_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+describe "SortedSet#initialize_copy" do
+  before(:each) do
+    @set = SortedSet[1, 2, 3]
+  end
+  
+  it "is private" do
+    @set.private_methods.should include("initialize_copy")
+  end
+  
+  it "replaces all elements of self with the elements of the passed SortedSet" do
+    other = SortedSet["1", "2", "3"]
+    @set.send(:initialize_copy, other)
+    @set.should == SortedSet["1", "2", "3"]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+describe "SortedSet#initialize" do
+  it "is private" do
+    SortedSet[].private_methods.should include("initialize")
+  end
+  
+  it "adds all elements of the passed Enumerable to self" do
+    s = SortedSet.new([1, 2, 3])
+    s.size.should eql(3)
+    s.should include(1)
+    s.should include(2)
+    s.should include(3)
+  end
+  
+  it "preprocesses all elements by a passed block before adding to self" do
+    s = SortedSet.new([1, 2, 3]) { |x| x * x }
+    s.size.should eql(3)
+    s.should include(1)
+    s.should include(4)
+    s.should include(9)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+describe "SortedSet#inspect" do
+  it "returns a String representation of self" do
+    SortedSet[].inspect.should be_kind_of(String)
+    SortedSet[1, 2, 3].inspect.should be_kind_of(String)
+    SortedSet["1", "2", "3"].inspect.should be_kind_of(String)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/intersection_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/intersection_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/intersection_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/intersection'
+require 'set'
+
+describe "SortedSet#intersection" do
+  it_behaves_like :sorted_set_intersection, :intersection
+end
+
+describe "SortedSet#&" do
+  it_behaves_like :sorted_set_intersection, :&
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/length'
+require 'set'
+
+describe "SortedSet#length" do
+  it_behaves_like :sorted_set_length, :length
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/map_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/map_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/map_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+require File.dirname(__FILE__) + '/shared/collect'
+
+describe "SortedSet#map!" do
+  it_behaves_like :sorted_set_collect_bang, :map!
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/member_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/member_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/member_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/include'
+require 'set'
+
+describe "SortedSet#member?" do
+  it_behaves_like :sorted_set_include, :member?
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/merge_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/merge_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/merge_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+describe "SortedSet#merge" do
+  it "adds the elements of the passed Enumerable to self" do
+    SortedSet["a", "b"].merge(SortedSet["b", "c", "d"]).should == SortedSet["a", "b", "c", "d"]
+    SortedSet[1, 2].merge([3, 4]).should == SortedSet[1, 2, 3, 4]
+  end
+  
+  it "returns self" do
+    set = SortedSet[1, 2]
+    set.merge([3, 4]).should equal(set)
+  end
+  
+  it "raises an ArgumentError when passed a non-Enumerable" do
+    lambda { SortedSet[1, 2].merge(1) }.should raise_error(ArgumentError)
+    lambda { SortedSet[1, 2].merge(Object.new) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/minus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/minus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/minus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+require File.dirname(__FILE__) + '/shared/difference'
+
+describe "SortedSet#-" do
+  it_behaves_like :sorted_set_difference, :-
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/plus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/plus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/plus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/union'
+require 'set'
+
+describe "SortedSet#+" do
+  it_behaves_like :sorted_set_union, :+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/pretty_print_cycle_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/pretty_print_cycle_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/pretty_print_cycle_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+describe "SortedSet#pretty_print_cycle" do
+  it "passes the 'pretty print' representation of a self-referencing SortedSet to the pretty print writer" do
+    pp = mock("PrettyPrint")
+    pp.should_receive(:text).with("#<SortedSet: {...}>")
+    SortedSet[1, 2, 3].pretty_print_cycle(pp)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/pretty_print_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/pretty_print_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/pretty_print_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+describe "SortedSet#pretty_print" do
+  it "passes the 'pretty print' representation of self to the pretty print writer" do
+    pp = mock("PrettyPrint")
+    set = SortedSet[1, 2, 3]
+
+    pp.should_receive(:text).with("#<SortedSet: {")
+    pp.should_receive(:text).with("}>")
+    
+    pp.should_receive(:nest).with(1).and_yield
+    pp.should_receive(:seplist).with(set)
+    
+    set.pretty_print(pp)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/proper_subset_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/proper_subset_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/proper_subset_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+describe "SortedSet#proper_subset?" do
+  before(:each) do
+    @set = SortedSet[1, 2, 3, 4]
+  end
+
+  it "returns true if passed a SortedSet that self is a proper subset of" do
+    SortedSet[].proper_subset?(@set).should be_true
+    SortedSet[].proper_subset?(SortedSet[1, 2, 3]).should be_true
+    SortedSet[].proper_subset?(SortedSet["a", "b", "c"]).should be_true
+
+    SortedSet[1, 2, 3].proper_subset?(@set).should be_true
+    SortedSet[1, 3].proper_subset?(@set).should be_true
+    SortedSet[1, 2].proper_subset?(@set).should be_true
+    SortedSet[1].proper_subset?(@set).should be_true
+    
+    SortedSet[5].proper_subset?(@set).should be_false
+    SortedSet[1, 5].proper_subset?(@set).should be_false
+    SortedSet["test"].proper_subset?(@set).should be_false
+    
+    @set.proper_subset?(@set).should be_false
+    SortedSet[].proper_subset?(SortedSet[]).should be_false
+  end
+  
+  it "raises an ArgumentError when passed a non-SortedSet" do
+    lambda { SortedSet[].proper_subset?([]) }.should raise_error(ArgumentError)
+    lambda { SortedSet[].proper_subset?(1) }.should raise_error(ArgumentError)
+    lambda { SortedSet[].proper_subset?("test") }.should raise_error(ArgumentError)
+    lambda { SortedSet[].proper_subset?(Object.new) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/proper_superset_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/proper_superset_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/proper_superset_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+describe "SortedSet#proper_superset?" do
+  before(:each) do
+    @set = SortedSet[1, 2, 3, 4]
+  end
+
+  it "returns true if passed a SortedSet that self is a proper superset of" do
+    @set.proper_superset?(SortedSet[]).should be_true
+    SortedSet[1, 2, 3].proper_superset?(SortedSet[]).should be_true
+    SortedSet["a", "b", "c"].proper_superset?(SortedSet[]).should be_true
+
+    @set.proper_superset?(SortedSet[1, 2, 3]).should be_true
+    @set.proper_superset?(SortedSet[1, 3]).should be_true
+    @set.proper_superset?(SortedSet[1, 2]).should be_true
+    @set.proper_superset?(SortedSet[1]).should be_true
+    
+    @set.proper_superset?(SortedSet[5]).should be_false
+    @set.proper_superset?(SortedSet[1, 5]).should be_false
+    @set.proper_superset?(SortedSet["test"]).should be_false
+    
+    @set.proper_superset?(@set).should be_false
+    SortedSet[].proper_superset?(SortedSet[]).should be_false
+  end
+  
+  it "raises an ArgumentError when passed a non-SortedSet" do
+    lambda { SortedSet[].proper_superset?([]) }.should raise_error(ArgumentError)
+    lambda { SortedSet[].proper_superset?(1) }.should raise_error(ArgumentError)
+    lambda { SortedSet[].proper_superset?("test") }.should raise_error(ArgumentError)
+    lambda { SortedSet[].proper_superset?(Object.new) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/reject_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/reject_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/reject_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,52 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+describe "SortedSet#reject!" do
+  before(:each) do
+    @set = SortedSet["one", "two", "three"]
+  end
+  
+  ruby_bug "http://redmine.ruby-lang.org/issues/show/115", "1.8.7.7" do
+    it "yields each Object in self in sorted order" do
+      res = []
+      @set.reject! { |x| res << x }
+      res.should == ["one", "two", "three"].sort
+    end
+  end
+  
+  it "deletes every element from self for which the passed block returns true" do
+    @set.reject! { |x| x.size == 3 }
+    @set.size.should eql(1)
+    
+    @set.should_not include("one")
+    @set.should_not include("two")
+    @set.should include("three")
+  end
+  
+  it "returns self when self was modified" do
+    @set.reject! { |x| true }.should equal(@set)
+  end
+
+  it "returns nil when self was not modified" do
+    @set.reject! { |x| false }.should be_nil
+  end
+
+  ruby_version_is "" ... "1.8.8" do
+    it "raises a LocalJumpError when passed no block" do
+      lambda { @set.reject! }.should raise_error(LocalJumpError)
+    end
+  end
+  
+  ruby_version_is "1.8.8" do
+    it "returns an Enumerator when passed no block" do
+      enum = @set.reject!
+      enum.should be_kind_of(Enumerable::Enumerator)
+      
+      enum.each { |x| x.size == 3 }
+      
+      @set.should_not include("one")
+      @set.should_not include("two")
+      @set.should include("three")
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/replace_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/replace_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/replace_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+describe "SortedSet#replace" do
+  before :each do
+    @set = SortedSet["a", "b", "c"]
+  end
+  
+  it "replaces the contents with other and returns self" do
+    @set.replace(SortedSet[1, 2, 3]).should == @set
+    @set.should == SortedSet[1, 2, 3]
+  end
+  
+  it "accepts any enumerable as other" do
+    @set.replace([1, 2, 3]).should == SortedSet[1, 2, 3]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/add.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/add.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/add.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+describe :sorted_set_add, :shared => true do
+  before :each do
+    @set = SortedSet.new
+  end
+
+  it "adds the passed Object to self" do
+    @set.send(@method, "dog")
+    @set.should include("dog")
+  end
+
+  it "returns self" do
+    @set.send(@method, "dog").should equal(@set)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/collect.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/collect.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/collect.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+describe :sorted_set_collect_bang, :shared => true do
+  before(:each) do
+    @set = SortedSet[1, 2, 3, 4, 5]
+  end
+
+  it "yields each Object in self in sorted order" do
+    res = []
+    SortedSet["one", "two", "three"].send(@method) { |x| res << x; x }
+    res.should == ["one", "two", "three"].sort
+  end
+
+  it "returns self" do
+    @set.send(@method) { |x| x }.should equal(@set)
+  end
+
+  it "replaces self with the return values of the block" do
+    @set.send(@method) { |x| x * 2 }
+    @set.should == SortedSet[2, 4, 6, 8, 10]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/difference.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/difference.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/difference.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+describe :sorted_set_difference, :shared => true do
+  before :each do
+    @set = SortedSet["a", "b", "c"]
+  end
+
+  it "returns a new SortedSet containting self's elements excluding the elements in the passed Enumerable" do
+    @set.send(@method, SortedSet["a", "b"]).should == SortedSet["c"]
+    @set.send(@method, ["b", "c"]).should == SortedSet["a"]
+  end
+
+  it "raises an ArgumentError when passed a non-Enumerable" do
+    lambda { @set.send(@method, 1) }.should raise_error(ArgumentError)
+    lambda { @set.send(@method, Object.new) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/include.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/include.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/include.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+describe :sorted_set_include, :shared => true do
+  it "returns true when self contains the passed Object" do
+    set = SortedSet["a", "b", "c"]
+    set.send(@method, "a").should be_true
+    set.send(@method, "e").should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/intersection.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/intersection.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/intersection.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+describe :sorted_set_intersection, :shared => true do
+  before :each do
+    @set = SortedSet["a", "b", "c"]
+  end
+
+  it "returns a new SortedSet containing only elements shared by self and the passed Enumerable" do
+    @set.send(@method, SortedSet["b", "c", "d", "e"]).should == SortedSet["b", "c"]
+    @set.send(@method, ["b", "c", "d"]).should == SortedSet["b", "c"]
+  end
+
+  it "raises an ArgumentError when passed a non-Enumerable" do
+    lambda { @set.send(@method, 1) }.should raise_error(ArgumentError)
+    lambda { @set.send(@method, Object.new) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/length.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/length.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/length.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+describe :sorted_set_length, :shared => true do
+  it "returns the number of elements in the set" do
+    set = SortedSet["a", "b", "c"]
+    set.send(@method).should == 3
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/union.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/union.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/shared/union.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+describe :sorted_set_union, :shared => true do
+  before :each do
+    @set = SortedSet["a", "b", "c"]
+  end
+
+  it "returns a new SortedSet containing all elements of self and the passed Enumerable" do
+    @set.send(@method, SortedSet["b", "d", "e"]).should == SortedSet["a", "b", "c", "d", "e"]
+    @set.send(@method, ["b", "e"]).should == SortedSet["a", "b", "c", "e"]
+  end
+
+  it "raises an ArgumentError when passed a non-Enumerable" do
+    lambda { @set.send(@method, 1) }.should raise_error(ArgumentError)
+    lambda { @set.send(@method, Object.new) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/length'
+require 'set'
+
+describe "SortedSet#size" do
+  it_behaves_like :sorted_set_length, :size
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/subset_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/subset_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/subset_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+describe "SortedSet#subset?" do
+  before(:each) do
+    @set = SortedSet[1, 2, 3, 4]
+  end
+
+  it "returns true if passed a SortedSet that is equal to self or self is a subset of" do
+    @set.subset?(@set).should be_true
+    SortedSet[].subset?(SortedSet[]).should be_true
+
+    SortedSet[].subset?(@set).should be_true
+    SortedSet[].subset?(SortedSet[1, 2, 3]).should be_true
+    SortedSet[].subset?(SortedSet["a", "b", "c"]).should be_true
+
+    SortedSet[1, 2, 3].subset?(@set).should be_true
+    SortedSet[1, 3].subset?(@set).should be_true
+    SortedSet[1, 2].subset?(@set).should be_true
+    SortedSet[1].subset?(@set).should be_true
+    
+    SortedSet[5].subset?(@set).should be_false
+    SortedSet[1, 5].subset?(@set).should be_false
+    SortedSet["test"].subset?(@set).should be_false
+  end
+  
+  it "raises an ArgumentError when passed a non-SortedSet" do
+    lambda { SortedSet[].subset?([]) }.should raise_error(ArgumentError)
+    lambda { SortedSet[].subset?(1) }.should raise_error(ArgumentError)
+    lambda { SortedSet[].subset?("test") }.should raise_error(ArgumentError)
+    lambda { SortedSet[].subset?(Object.new) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/subtract_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/subtract_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/subtract_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+describe "SortedSet#subtract" do
+  before :each do
+    @set = SortedSet["a", "b", "c"]
+  end
+  
+  it "deletes any elements contained in other and returns self" do
+    @set.subtract(SortedSet["b", "c"]).should == @set
+    @set.should == SortedSet["a"]
+  end
+  
+  it "accepts any enumerable as other" do
+    @set.subtract(["c"]).should == SortedSet["a", "b"]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/superset_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/superset_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/superset_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+describe "SortedSet#superset?" do
+  before(:each) do
+    @set = SortedSet[1, 2, 3, 4]
+  end
+
+  it "returns true if passed a SortedSet that equals self or self is a proper superset of" do
+    @set.superset?(@set).should be_true
+    SortedSet[].superset?(SortedSet[]).should be_true
+
+    @set.superset?(SortedSet[]).should be_true
+    SortedSet[1, 2, 3].superset?(SortedSet[]).should be_true
+    SortedSet["a", "b", "c"].superset?(SortedSet[]).should be_true
+
+    @set.superset?(SortedSet[1, 2, 3]).should be_true
+    @set.superset?(SortedSet[1, 3]).should be_true
+    @set.superset?(SortedSet[1, 2]).should be_true
+    @set.superset?(SortedSet[1]).should be_true
+    
+    @set.superset?(SortedSet[5]).should be_false
+    @set.superset?(SortedSet[1, 5]).should be_false
+    @set.superset?(SortedSet["test"]).should be_false
+  end
+  
+  it "raises an ArgumentError when passed a non-SortedSet" do
+    lambda { SortedSet[].superset?([]) }.should raise_error(ArgumentError)
+    lambda { SortedSet[].superset?(1) }.should raise_error(ArgumentError)
+    lambda { SortedSet[].superset?("test") }.should raise_error(ArgumentError)
+    lambda { SortedSet[].superset?(Object.new) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/to_a_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/to_a_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/to_a_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'set'
+
+describe "SortedSet#to_a" do
+  it "returns an array containing elements of self" do
+    SortedSet[1, 2, 3].to_a.sort.should == [1, 2, 3]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/sortedset/union_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/sortedset/union_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/sortedset/union_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/union'
+require 'set'
+
+describe "SortedSet#union" do
+  it_behaves_like :sorted_set_union, :union
+end
+
+describe "SortedSet#|" do
+  it_behaves_like :sorted_set_union, :|
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/subset_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/subset_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/subset_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+describe "Set#subset?" do
+  before(:each) do
+    @set = Set[1, 2, 3, 4]
+  end
+
+  it "returns true if passed a Set that is equal to self or self is a subset of" do
+    @set.subset?(@set).should be_true
+    Set[].subset?(Set[]).should be_true
+
+    Set[].subset?(@set).should be_true
+    Set[].subset?(Set[1, 2, 3]).should be_true
+    Set[].subset?(Set["a", :b, ?c]).should be_true
+
+    Set[1, 2, 3].subset?(@set).should be_true
+    Set[1, 3].subset?(@set).should be_true
+    Set[1, 2].subset?(@set).should be_true
+    Set[1].subset?(@set).should be_true
+    
+    Set[5].subset?(@set).should be_false
+    Set[1, 5].subset?(@set).should be_false
+    Set[nil].subset?(@set).should be_false
+    Set["test"].subset?(@set).should be_false
+  end
+  
+  it "raises an ArgumentError when passed a non-Set" do
+    lambda { Set[].subset?([]) }.should raise_error(ArgumentError)
+    lambda { Set[].subset?(1) }.should raise_error(ArgumentError)
+    lambda { Set[].subset?("test") }.should raise_error(ArgumentError)
+    lambda { Set[].subset?(Object.new) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/subtract_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/subtract_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/subtract_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+describe "Set#subtract" do
+  before :each do
+    @set = Set[:a, :b, :c]
+  end
+  
+  it "deletes any elements contained in other and returns self" do
+    @set.subtract(Set[:b, :c]).should == @set
+    @set.should == Set[:a]
+  end
+  
+  it "accepts any enumerable as other" do
+    @set.subtract([:c]).should == Set[:a, :b]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/superset_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/superset_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/superset_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+describe "Set#superset?" do
+  before(:each) do
+    @set = Set[1, 2, 3, 4]
+  end
+
+  it "returns true if passed a Set that equals self or self is a proper superset of" do
+    @set.superset?(@set).should be_true
+    Set[].superset?(Set[]).should be_true
+
+    @set.superset?(Set[]).should be_true
+    Set[1, 2, 3].superset?(Set[]).should be_true
+    Set["a", :b, ?c].superset?(Set[]).should be_true
+
+    @set.superset?(Set[1, 2, 3]).should be_true
+    @set.superset?(Set[1, 3]).should be_true
+    @set.superset?(Set[1, 2]).should be_true
+    @set.superset?(Set[1]).should be_true
+    
+    @set.superset?(Set[5]).should be_false
+    @set.superset?(Set[1, 5]).should be_false
+    @set.superset?(Set[nil]).should be_false
+    @set.superset?(Set["test"]).should be_false
+  end
+  
+  it "raises an ArgumentError when passed a non-Set" do
+    lambda { Set[].superset?([]) }.should raise_error(ArgumentError)
+    lambda { Set[].superset?(1) }.should raise_error(ArgumentError)
+    lambda { Set[].superset?("test") }.should raise_error(ArgumentError)
+    lambda { Set[].superset?(Object.new) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/to_a_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/to_a_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/to_a_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'set'
+
+describe "Set#to_a" do
+  it "returns an array containing elements of self" do
+    Set[1, 2, 3].to_a.sort.should == [1, 2, 3]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/set/union_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/set/union_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/set/union_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/union'
+require 'set'
+
+describe "Set#union" do
+  it_behaves_like :set_union, :union
+end
+
+describe "Set#|" do
+  it_behaves_like :set_union, :|
+end

Added: MacRuby/branches/experimental/spec/frozen/library/shellwords/shellwords_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/shellwords/shellwords_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/shellwords/shellwords_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'shellwords'
+include Shellwords
+
+describe "Shellwords#shellwords" do
+  it "honors quoted strings" do
+    shellwords('a "b b" a').should == ['a', 'b b', 'a']
+  end
+
+  it "honors escaped double quotes" do
+    shellwords('a "\"b\" c" d').should == ['a', '"b" c', 'd']
+  end
+
+  it "honors escaped single quotes" do
+    shellwords("a \"'b' c\" d").should == ['a', "'b' c", 'd']
+  end
+
+  it "raises ArgumentError when double quoted strings are misquoted" do
+    lambda { shellwords('a "b c d e') }.should raise_error(ArgumentError)
+  end
+
+  it "raises ArgumentError when single quoted strings are misquoted" do
+    lambda { shellwords("a 'b c d e") }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/singleton/allocate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/singleton/allocate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/singleton/allocate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Singleton.allocate" do
+  it "is a private method" do
+    lambda { SingletonSpecs::MyClass.allocate }.should raise_error(NoMethodError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/singleton/clone_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/singleton/clone_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/singleton/clone_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Singleton#clone" do
+  it "is prevented" do
+    lambda { SingletonSpecs::MyClass.instance.clone }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/singleton/dump_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/singleton/dump_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/singleton/dump_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Singleton#_dump" do
+
+  it "returns an empty string" do
+    SingletonSpecs::MyClass.instance.send(:_dump).should == ""
+  end
+  
+  it "returns an empty string from a singleton subclass" do
+    SingletonSpecs::MyClassChild.instance.send(:_dump).should == ""
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/singleton/dup_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/singleton/dup_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/singleton/dup_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Singleton#dup" do
+  it "is prevented" do
+    lambda { SingletonSpecs::MyClass.instance.dup }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/singleton/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/singleton/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/singleton/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require 'singleton'
+
+module SingletonSpecs
+  class MyClass
+    attr_accessor :data
+    include Singleton
+  end
+
+  class NewSpec
+    include Singleton
+  end
+  
+  class MyClassChild < MyClass
+  end
+  
+  class NotInstantiated < MyClass
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/singleton/instance_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/singleton/instance_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/singleton/instance_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,30 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Singleton.instance" do
+  it "returns an instance of the singleton class" do
+    SingletonSpecs::MyClass.instance.should be_kind_of(SingletonSpecs::MyClass)
+  end
+  
+  it "returns the same instance for multiple calls to instance" do
+    SingletonSpecs::MyClass.instance.should equal(SingletonSpecs::MyClass.instance)
+  end
+  
+  it "returns an instance of the singleton's subclasses" do
+    SingletonSpecs::MyClassChild.instance.should be_kind_of(SingletonSpecs::MyClassChild)
+  end
+  
+  it "returns the same instance for multiple class to instance on subclasses" do
+    SingletonSpecs::MyClassChild.instance.should equal(SingletonSpecs::MyClassChild.instance)
+  end
+  
+  it "returns an instance of the singleton's clone" do
+    klone = SingletonSpecs::MyClassChild.clone
+    klone.instance.should be_kind_of(klone)
+  end
+  
+  it "returns the same instance for multiple class to instance on clones" do
+    klone = SingletonSpecs::MyClassChild.clone
+    klone.instance.should equal(klone.instance)
+  end  
+end

Added: MacRuby/branches/experimental/spec/frozen/library/singleton/instantiate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/singleton/instantiate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/singleton/instantiate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Singleton._instantiate?" do
+
+  it "is private" do
+    lambda { SingletonSpecs::MyClass._instantiate? }.should raise_error(NoMethodError)
+  end
+
+  ruby_version_is "" ... "1.9" do
+    # JRuby doesn't support "_instantiate?" intentionally (JRUBY-2239)
+    not_compliant_on :jruby do
+      it "returns nil until it is instantiated" do
+        SingletonSpecs::NotInstantiated.send(:_instantiate?).should == nil
+        SingletonSpecs::NotInstantiated.instance
+        inst = SingletonSpecs::NotInstantiated.send(:_instantiate?)
+        inst.should eql(SingletonSpecs::NotInstantiated.instance)
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/singleton/load_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/singleton/load_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/singleton/load_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+# TODO: change to a.should be_equal(b)
+# TODO: write spec for cloning classes and calling private methods
+# TODO: write spec for private_methods not showing up via extended
+describe "Singleton._load" do
+  ruby_version_is "1.8.7".."1.9" do
+    it "returns the singleton instance for anything passed in" do
+      klass = SingletonSpecs::MyClass
+      klass._load("").should equal(klass.instance)
+      klass._load("42").should equal(klass.instance)
+      klass._load(42).should equal(klass.instance)
+    end
+
+    it "returns the singleton instance for anything passed in to subclass" do
+      subklass = SingletonSpecs::MyClassChild
+      subklass._load("").should equal(subklass.instance)
+      subklass._load("42").should equal(subklass.instance)
+      subklass._load(42).should equal(subklass.instance)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/singleton/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/singleton/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/singleton/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Singleton.new" do
+  it "is a private method" do
+    lambda { SingletonSpecs::NewSpec.new }.should raise_error(NoMethodError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/close_read_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/close_read_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/close_read_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "Socket::BasicSocket#close_read" do
+  before :each do
+    @server = TCPServer.new(SocketSpecs.port)    
+  end
+
+  after :each do
+    @server.close unless @server.closed?
+  end
+
+  it "closes the reading end of the socket" do
+    @server.close_read
+    lambda { @server.read }.should raise_error(IOError)
+  end
+
+  it "it works on sockets with closed ends" do
+    @server.close_read
+    lambda { @server.close_read }.should_not raise_error(Exception)
+    lambda { @server.read }.should raise_error(IOError)
+  end
+
+  it "does not close the socket" do
+    @server.close_read
+    @server.closed?.should be_false
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/close_write_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/close_write_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/close_write_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "Socket::BasicSocket#close_write" do
+  before :each do
+    @server = TCPServer.new(SocketSpecs.port)    
+  end
+
+  after :each do
+    @server.close unless @server.closed?
+  end
+
+  it "closes the writing end of the socket" do
+    @server.close_write
+    lambda { @server.write("foo") }.should raise_error(IOError)
+  end
+
+  it "works on sockets with closed write ends" do
+    @server.close_write
+    lambda { @server.close_write }.should_not raise_error(Exception)
+    lambda { @server.write("foo") }.should raise_error(IOError)
+  end
+
+  it "does not close the socket" do
+    @server.close_write
+    @server.closed?.should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/do_not_reverse_lookup_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/do_not_reverse_lookup_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/do_not_reverse_lookup_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,60 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+ruby_version_is ""..."1.9" do
+  describe "BasicSocket.do_not_reverse_lookup" do
+    before(:each) do
+      @server = TCPServer.new('127.0.0.1', SocketSpecs.port)
+      @socket = TCPSocket.new('127.0.0.1', SocketSpecs.port)
+    end
+    
+    after(:each) do
+      @socket.close unless @socket.closed?
+      @server.close unless @server.closed?
+    end
+
+    it "causes 'peeraddr' to avoid name lookups" do
+      BasicSocket.do_not_reverse_lookup = true
+      @socket.peeraddr.should == ["AF_INET", SocketSpecs.port, "127.0.0.1", "127.0.0.1"]
+    end
+
+    it "looks for hostnames when set to false" do
+      BasicSocket.do_not_reverse_lookup = false
+      @socket.peeraddr[2].should == SocketSpecs.hostname
+    end
+
+    it "looks for numeric addresses when set to true" do
+      BasicSocket.do_not_reverse_lookup = true
+      @socket.peeraddr[2].should == "127.0.0.1"
+    end
+  end
+end
+
+ruby_version_is "1.9" do
+  describe "BasicSocket.do_not_reverse_lookup" do
+    before(:each) do
+      @server = TCPServer.new('127.0.0.1', SocketSpecs.port)
+      @socket = TCPSocket.new('127.0.0.1', SocketSpecs.port)
+    end
+    
+    after(:each) do
+      @server.close unless @server.closed?
+      @socket.close unless @socket.closed?
+    end
+
+    it "causes 'peeraddr' to avoid name lookups" do
+      @socket.do_not_reverse_lookup = true
+      @socket.peeraddr.should == ["AF_INET", SocketSpecs.port, "127.0.0.1", "127.0.0.1"]
+    end
+
+    it "looks for hostnames when set to false" do
+      @socket.do_not_reverse_lookup = false
+      @socket.peeraddr[2].should == SocketSpecs.hostname
+    end
+
+    it "looks for numeric addresses when set to true" do
+      @socket.do_not_reverse_lookup = true
+      @socket.peeraddr[2].should == "127.0.0.1"
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/for_fd_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/for_fd_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/for_fd_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'

Added: MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/getpeername_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/getpeername_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/getpeername_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "Socket::BasicSocket#getpeername" do
+
+  before :each do
+    @server = TCPServer.new("127.0.0.1", SocketSpecs.port)
+    @client = TCPSocket.new("127.0.0.1", SocketSpecs.port)
+  end
+
+  after :each do
+    @server.close unless @server.closed?
+    @client.close unless @client.closed?
+  end
+
+  not_compliant_on :jruby do
+    it "returns the sockaddr of the other end of the connection" do
+      server_sockaddr = Socket.pack_sockaddr_in(SocketSpecs.port, "127.0.0.1")
+      @client.getpeername.should == server_sockaddr
+    end
+  end
+
+  deviates_on :jruby do
+    it "returns the sockaddr of the other end of the connection" do
+      @client.getpeername.should == "/127.0.0.1:#{SocketSpecs.port}"
+    end
+  end
+
+  # Catch general exceptions to prevent NotImplementedError
+  it "raises an error if socket's not connected" do
+    lambda { @server.getpeername }.should raise_error(Exception)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/getsockname_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/getsockname_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/getsockname_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "Socket::BasicSocket#getsockname" do
+  after :each do
+    @socket.closed?.should be_false
+    @socket.close
+  end
+
+  it "returns the sockaddr associacted with the socket" do
+    @socket = TCPServer.new("127.0.0.1", SocketSpecs.port)
+    sockaddr = Socket.unpack_sockaddr_in(@socket.getsockname)
+    sockaddr.should == [SocketSpecs.port, "127.0.0.1"]
+ end
+
+  it "works on sockets listening in ipaddr_any" do
+    @socket = TCPServer.new(SocketSpecs.port)
+    sockaddr = Socket.unpack_sockaddr_in(@socket.getsockname)
+    ["::", "0.0.0.0"].include?(sockaddr[1]).should be_true
+    sockaddr[0].should == SocketSpecs.port
+  end
+
+  it "returns empty sockaddr for unbinded sockets" do
+    @socket = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
+    sockaddr = Socket.unpack_sockaddr_in(@socket.getsockname)
+    sockaddr.should == [0, "0.0.0.0"]
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/getsockopt_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/getsockopt_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/getsockopt_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "BasicSocket#getsockopt" do
+  before(:each) do
+    @sock = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
+  end
+
+  after :each do
+    @sock.closed?.should be_false
+    @sock.close
+  end
+  
+  it "gets a socket option" do
+    n = @sock.getsockopt(Socket::SOL_SOCKET, Socket::SO_TYPE)
+    n.should == [Socket::SOCK_STREAM].pack("i")
+  end
+
+  it "raises a SystemCallError with an invalid socket option" do
+    lambda { @sock.getsockopt Socket::SOL_SOCKET, -1 }.should raise_error(Errno::ENOPROTOOPT)
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/recv_nonblock_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/recv_nonblock_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/recv_nonblock_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../shared/recv_nonblock'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "Socket::BasicSocket#recv_nonblock" do
+  it_behaves_like :socket_recv_nonblock, :recv_nonblock
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/recv_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/recv_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/recv_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,48 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "BasicSocket#recv" do
+
+  before :each do
+    @server = TCPServer.new('127.0.0.1', SocketSpecs.port)
+  end
+
+  after :each do
+    @server.closed?.should be_false
+    @server.close
+  end
+
+  it "receives a specified number of bytes of a message from another socket"  do
+    data = ""
+    t = Thread.new do
+      client = @server.accept
+      data = client.recv(10)
+      client.close
+    end
+    Thread.pass until t.status == "sleep" or t.status == nil
+    t.status.should_not be_nil
+
+    socket = TCPSocket.new('127.0.0.1', SocketSpecs.port)
+    socket.send('hello', 0)
+    socket.close
+
+    t.join
+    data.should == 'hello'
+  end
+
+  it "accepts flags to specify unusual receiving behaviour" do
+    data = ""
+    t = Thread.new do
+      client = @server.accept
+      data = client.recv(10)    # in-band data (TCP), doesn't receive the flag.
+      client.close
+    end
+    Thread.pass until t.status == "sleep" or t.status == nil
+    t.status.should_not be_nil
+    
+    socket = TCPSocket.new('127.0.0.1', SocketSpecs.port)
+    socket.send('helloU', Socket::MSG_OOB)
+    t.join
+    data.should == 'hello'
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/send_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/send_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/send_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,69 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "BasicSocket#send" do
+  before :each do
+    @server = TCPServer.new('127.0.0.1', SocketSpecs.port)
+    @socket = TCPSocket.new('127.0.0.1', SocketSpecs.port)
+  end
+
+  after :each do
+    @server.closed?.should be_false
+    @socket.closed?.should be_false
+
+    @server.close
+    @socket.close
+  end
+
+   it "sends a message to another socket and returns the number of bytes sent" do
+     data = nil
+     t = Thread.new do
+       client = @server.accept
+       data = client.recv(5)
+       client.close
+     end
+     Thread.pass until t.status == "sleep" or t.status == nil
+     t.status.should_not be_nil
+
+     @socket.send('hello', 0).should == 5
+
+     t.join
+     data.should == 'hello'
+   end
+
+   it "accepts flags to specify unusual sending behaviour" do
+     data = nil
+     peek_data = nil
+     t = Thread.new do
+       client = @server.accept
+       peek_data = client.recv(6, Socket::MSG_PEEK)
+       data = client.recv(6)
+       client.close
+     end
+     Thread.pass until t.status == "sleep" or t.status == nil
+     t.status.should_not be_nil
+
+     @socket.send('helloU', Socket::MSG_PEEK | Socket::MSG_OOB).should == 6
+
+     t.join
+     peek_data.should == "hello"
+     data.should == 'hello'
+   end
+
+  it "accepts a sockaddr as recipient address" do
+     data = nil
+     t = Thread.new do
+       client = @server.accept
+       data = client.recv(5)
+       client.close
+     end
+     Thread.pass until t.status == "sleep" or t.status == nil
+     t.status.should_not be_nil
+
+     sockaddr = Socket.pack_sockaddr_in(SocketSpecs.port, "127.0.0.1")
+     @socket.send('hello', 0, sockaddr).should == 5
+
+     t.join
+     data.should == 'hello'
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/setsockopt_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/setsockopt_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/setsockopt_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "BasicSocket#setsockopt" do
+  
+  before(:each) do
+    @sock = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
+  end
+
+  after :each do
+    @sock.close unless @sock.closed?
+  end
+  
+  it "sets the socket linger to 0" do
+    linger = [0, 0].pack("ii")
+    @sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_LINGER, linger).should == 0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/shutdown_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/shutdown_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/basicsocket/shutdown_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "Socket::BasicSocket#shutdown" do
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/constants/constants_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/constants/constants_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/constants/constants_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,64 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+include Socket::Constants
+
+describe "Socket::Constants" do
+  it "defines socket types" do
+    consts = ["SOCK_DGRAM", "SOCK_RAW", "SOCK_RDM", "SOCK_SEQPACKET", "SOCK_STREAM"]
+    consts.each do |c|
+      Socket::Constants.constants.include?(c).should be_true
+    end
+  end
+
+  it "defines protocol families" do
+    consts = ["PF_INET6", "PF_INET", "PF_IPX", "PF_UNIX", "PF_UNSPEC"] 
+    consts.each do |c|
+      Socket::Constants.constants.include?(c).should be_true
+    end
+  end
+
+  it "defines address families" do
+    consts = ["AF_INET6", "AF_INET", "AF_IPX", "AF_UNIX", "AF_UNSPEC"] 
+    consts.each do |c|
+      Socket::Constants.constants.include?(c).should be_true
+    end
+  end
+
+  it "defines send/receive options" do
+    consts = ["MSG_DONTROUTE", "MSG_OOB", "MSG_PEEK"]     
+    consts.each do |c|
+      Socket::Constants.constants.include?(c).should be_true
+    end
+  end
+
+  it "defines socket level options" do
+    consts = ["SOL_SOCKET"]
+    consts.each do |c|
+      Socket::Constants.constants.include?(c).should be_true
+    end
+  end
+
+  it "defines socket options" do
+    consts = ["SO_BROADCAST", "SO_DEBUG", "SO_DONTROUTE", "SO_ERROR", "SO_KEEPALIVE", "SO_LINGER", 
+              "SO_OOBINLINE", "SO_RCVBUF", "SO_REUSEADDR", "SO_SNDBUF", "SO_TYPE"]  
+    consts.each do |c|
+      Socket::Constants.constants.include?(c).should be_true
+    end
+
+  end
+
+  it "defines multicast options" do
+    consts = ["IP_ADD_MEMBERSHIP", "IP_DEFAULT_MULTICAST_LOOP", "IP_DEFAULT_MULTICAST_TTL", 
+              "IP_MAX_MEMBERSHIPS", "IP_MULTICAST_LOOP", "IP_MULTICAST_TTL"]
+    consts.each do |c|
+      Socket::Constants.constants.include?(c).should be_true
+    end
+  end
+
+  it "defines TCP options" do
+    consts = ["TCP_MAXSEG", "TCP_NODELAY"]
+    consts.each do |c|
+      Socket::Constants.constants.include?(c).should be_true
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require 'socket'
+
+module SocketSpecs
+  # helper to get the hostname associated to 127.0.0.1
+  def self.hostname
+    # Calculate each time, without caching, since the result might
+    # depend on things like do_not_reverse_lookup mode, which is
+    # changing from test to test
+    Socket.getaddrinfo("127.0.0.1", nil)[0][2]
+  end
+
+  def self.hostnamev6
+    Socket.getaddrinfo("::1", nil)[0][2]
+  end
+  
+  def self.port
+    40001
+  end
+
+  def self.sockaddr_in(port, host)
+    Socket::SockAddr_In.new(Socket.sockaddr_in(port, host))
+  end
+
+  def self.socket_path
+    "/tmp/unix_server_spec.socket"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/ipsocket/addr_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/ipsocket/addr_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/ipsocket/addr_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,55 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "Socket::IPSocket#addr" do
+
+  before :each do
+    @socket = TCPServer.new("127.0.0.1", SocketSpecs.port)
+  end
+
+  after :each do
+    @socket.close unless @socket.closed?
+    BasicSocket.do_not_reverse_lookup = false
+  end
+
+  ruby_version_is ""..."1.9" do
+    it "returns an array with the socket's information" do
+      BasicSocket.do_not_reverse_lookup = false
+
+      addrinfo = @socket.addr
+      addrinfo[0].should == "AF_INET"
+      addrinfo[1].should == SocketSpecs.port
+      addrinfo[2].should == SocketSpecs.hostname
+      addrinfo[3].should == "127.0.0.1"
+    end
+
+    it "returns an address in the array if do_not_reverse_lookup is true" do
+      BasicSocket.do_not_reverse_lookup = true
+      addrinfo = @socket.addr
+      addrinfo[0].should == "AF_INET"
+      addrinfo[1].should == SocketSpecs.port
+      addrinfo[2].should == "127.0.0.1"
+      addrinfo[3].should == "127.0.0.1"
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "returns an array with the socket's information" do
+      @socket.do_not_reverse_lookup = false
+      addrinfo = @socket.addr
+      addrinfo[0].should == "AF_INET"
+      addrinfo[1].should == SocketSpecs.port
+      addrinfo[2].should == SocketSpecs.hostname
+      addrinfo[3].should == "127.0.0.1"
+    end
+
+    it "returns an address in the array if do_not_reverse_lookup is true" do
+      @socket.do_not_reverse_lookup = true
+      addrinfo = @socket.addr
+      addrinfo[0].should == "AF_INET"
+      addrinfo[1].should == SocketSpecs.port
+      addrinfo[2].should == "127.0.0.1"
+      addrinfo[3].should == "127.0.0.1"
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/ipsocket/getaddress_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/ipsocket/getaddress_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/ipsocket/getaddress_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "Socket::IPSocket#getaddress" do
+
+  it "returns the IP address of hostname" do
+    addr_local = IPSocket.getaddress(SocketSpecs.hostname)
+    ["127.0.0.1", "::1"].include?(addr_local).should == true
+  end
+
+  it "returns the IP address when passed an IP" do
+    IPSocket.getaddress("127.0.0.1").should == "127.0.0.1"
+    IPSocket.getaddress("0.0.0.0").should == "0.0.0.0"
+  end
+
+  it "raises an error on unknown hostnames" do
+    lambda { IPSocket.getaddress("foobard") }.should raise_error(SocketError)
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/ipsocket/peeraddr_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/ipsocket/peeraddr_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/ipsocket/peeraddr_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,62 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "Socket::IPSocket#peeraddr" do
+  before :each do
+    @server = TCPServer.new("127.0.0.1", SocketSpecs.port)
+    @client = TCPSocket.new("127.0.0.1", SocketSpecs.port)
+  end
+
+  after :each do
+    @server.close unless @server.closed?
+    @client.close unless @client.closed?
+    BasicSocket.do_not_reverse_lookup = false
+  end
+
+  it "raises error if socket is not connected" do
+    lambda { @server.peeraddr }.should raise_error
+  end
+  
+
+  ruby_version_is ""..."1.9" do
+
+    it "returns an array of information on the peer" do
+      BasicSocket.do_not_reverse_lookup = false
+      addrinfo = @client.peeraddr
+      addrinfo[0].should == "AF_INET"
+      addrinfo[1].should == SocketSpecs.port
+      addrinfo[2].should == SocketSpecs.hostname
+      addrinfo[3].should == "127.0.0.1"
+    end
+
+    it "returns an IP instead of hostname if do_not_reverse_lookup is true" do
+      BasicSocket.do_not_reverse_lookup = true
+      addrinfo = @client.peeraddr
+      addrinfo[0].should == "AF_INET"
+      addrinfo[1].should == SocketSpecs.port
+      addrinfo[2].should == "127.0.0.1"
+      addrinfo[3].should == "127.0.0.1"
+    end
+  end
+
+  ruby_version_is "1.9" do
+
+    it "returns an array of information on the peer" do
+      @client.do_not_reverse_lookup = false
+      addrinfo = @client.peeraddr
+      addrinfo[0].should == "AF_INET"
+      addrinfo[1].should == SocketSpecs.port
+      addrinfo[2].should == SocketSpecs.hostname
+      addrinfo[3].should == "127.0.0.1"
+    end
+
+    it "returns an IP instead of hostname if do_not_reverse_lookup is true" do
+      @client.do_not_reverse_lookup = true
+      addrinfo = @client.peeraddr
+      addrinfo[0].should == "AF_INET"
+      addrinfo[1].should == SocketSpecs.port
+      addrinfo[2].should == "127.0.0.1"
+      addrinfo[3].should == "127.0.0.1"
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/ipsocket/recvfrom_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/ipsocket/recvfrom_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/ipsocket/recvfrom_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,61 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "Socket::IPSocket#recvfrom" do
+
+  before :each do
+    @server = TCPServer.new("127.0.0.1", SocketSpecs.port)
+    @client = TCPSocket.new("127.0.0.1", SocketSpecs.port)
+  end
+
+  after :each do
+    @server.close unless @server.closed?
+    @client.close unless @client.closed?
+  end
+  
+  it "reads data from the connection" do
+    data = nil
+    t = Thread.new do
+      client = @server.accept
+      data = client.recvfrom(6)
+      client.close
+    end
+
+    @client.send('hello', 0)
+    t.join
+
+    data.first.should == 'hello'
+  end
+
+  it "reads up to len bytes" do
+    data = nil
+    t = Thread.new do
+      client = @server.accept
+      data = client.recvfrom(3)
+      client.close
+    end
+
+    @client.send('hello', 0)
+    t.join
+
+    data.first.should == 'hel'
+  end
+
+  it "returns an array with the data and connection info" do
+    data = nil
+    t = Thread.new do
+      client = @server.accept
+      data = client.recvfrom(3)
+      client.close
+    end
+
+    @client.send('hello', 0)
+    t.join
+
+    data.size.should == 2
+    data.first.should == "hel"
+    # This does not apply to every platform, dependant on recvfrom(2)
+    # data.last.should == nil
+  end
+  
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/shared/pack_sockaddr.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/shared/pack_sockaddr.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/shared/pack_sockaddr.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+describe :socket_pack_sockaddr_in, :shared => true do
+  it "packs and unpacks" do
+    sockaddr_in = Socket.pack_sockaddr_in 0, nil
+    port, addr = Socket.unpack_sockaddr_in(sockaddr_in)
+    ["127.0.0.1", "::1"].include?(addr).should == true
+    port.should == 0
+
+    sockaddr_in = Socket.pack_sockaddr_in 0, ''
+    Socket.unpack_sockaddr_in(sockaddr_in).should == [0, '0.0.0.0']
+
+    sockaddr_in = Socket.pack_sockaddr_in 80, '127.0.0.1'
+    Socket.unpack_sockaddr_in(sockaddr_in).should == [80, '127.0.0.1']
+  end
+end
+
+describe :socket_pack_sockaddr_un, :shared => true do
+  not_supported_on :jruby, :windows do
+    it "packs and unpacks" do
+      sockaddr_un = Socket.pack_sockaddr_un '/tmp/s'
+      Socket.unpack_sockaddr_un(sockaddr_un).should == '/tmp/s'
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/shared/recv_nonblock.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/shared/recv_nonblock.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/shared/recv_nonblock.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,33 @@
+describe :socket_recv_nonblock, :shared => true do
+  not_supported_on :jruby do
+    before :each do
+      @s1 = Socket.new(Socket::AF_INET, Socket::SOCK_DGRAM, 0)
+      @s2 = Socket.new(Socket::AF_INET, Socket::SOCK_DGRAM, 0)
+    end
+
+    after :each do
+      @s1.close unless @s1.closed?
+      @s2.close unless @s2.closed?
+    end
+
+    it "raises EAGAIN if there's no data available" do
+      @s1.bind(Socket.pack_sockaddr_in(SocketSpecs.port, "127.0.0.1"))
+      lambda { @s1.recv_nonblock(5)}.should raise_error(Errno::EAGAIN)
+    end
+
+    it "receives data after it's ready" do
+      @s1.bind(Socket.pack_sockaddr_in(SocketSpecs.port, "127.0.0.1"))
+      @s2.send("aaa", 0, @s1.getsockname)
+      IO.select([@s1], nil, nil, 2)
+      @s1.recv_nonblock(5).should == "aaa"
+    end
+
+    it "does not block if there's no data available" do
+      @s1.bind(Socket.pack_sockaddr_in(SocketSpecs.port, "127.0.0.1"))
+      @s2.send("a", 0, @s1.getsockname)
+      IO.select([@s1], nil, nil, 2)
+      @s1.recv_nonblock(1).should == "a"
+      lambda { @s1.recv_nonblock(5)}.should raise_error(Errno::EAGAIN)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/shared/socketpair.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/shared/socketpair.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/shared/socketpair.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+describe :socket_socketpair, :shared => true do
+  not_supported_on :jruby, :windows do
+    it "ensures the returned sockets are connected" do
+      s1, s2 = Socket.socketpair(Socket::AF_UNIX, 1, 0)
+      s1.puts("test")
+      s2.gets.should == "test\n"
+      s1.close 
+      s2.close
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/socket/accept_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/socket/accept_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/socket/accept_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'

Added: MacRuby/branches/experimental/spec/frozen/library/socket/socket/bind_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/socket/bind_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/socket/bind_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,30 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+include Socket::Constants
+
+describe "Socket#bind" do
+
+  before :each do
+    @sock = Socket.new(AF_INET, SOCK_DGRAM, 0);    
+    @sockaddr = Socket.pack_sockaddr_in(SocketSpecs.port, "127.0.0.1");
+  end
+
+  after :each do
+    @sock.closed?.should be_false
+    @sock.close
+  end                           
+
+  it "binds to a port" do
+    lambda { @sock.bind(@sockaddr) }.should_not raise_error
+  end
+  
+  it "raises an error if we try to bind to an already bound port" do
+    @sock.bind(@sockaddr);
+
+    sock2 = Socket.new(AF_INET, SOCK_DGRAM, 0);
+    lambda { sock2.bind(@sockaddr) }.should raise_error;
+
+    sock2.close unless sock2.closed?
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/socket/connect_nonblock_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/socket/connect_nonblock_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/socket/connect_nonblock_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'

Added: MacRuby/branches/experimental/spec/frozen/library/socket/socket/connect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/socket/connect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/socket/connect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'

Added: MacRuby/branches/experimental/spec/frozen/library/socket/socket/for_fd_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/socket/for_fd_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/socket/for_fd_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+require 'socket'
+
+describe "Socket#for_fd given a file descriptor" do
+  it "adopts that descriptor into a new Socket object" do
+    server = TCPServer.new("0.0.0.0", SocketSpecs.port)
+    client = TCPSocket.open("0.0.0.0", SocketSpecs.port)
+
+    new_sock = Socket.for_fd(client.fileno)
+    
+    # TODO: RSpec uses #send internally when calling #should == something
+    # but as Socket#send does not do what RSpex expects it to do,
+    # it fails horriby. RSpec should be using #__send__ 
+    new_sock.should_not be_nil
+    new_sock.class.should == Socket
+    new_sock.fileno.should == client.fileno
+
+    new_sock.write("foo")
+    client.write("bar")
+    host = server.accept
+    host.read(3).should == "foo"
+    host.read(3).should == "bar"
+
+    server.close unless server.closed?
+    client.close unless server.closed?
+    new_sock.close unless new_sock.closed?
+  end
+
+  it "raises error for a bad descriptor" do
+    lambda { Socket.for_fd(9999999) }.should raise_error
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/socket/socket/getaddrinfo_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/socket/getaddrinfo_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/socket/getaddrinfo_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,108 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+require 'socket'
+
+describe "Socket#getaddrinfo" do
+  before :each do
+    BasicSocket.do_not_reverse_lookup = false
+  end
+
+  after :each do
+    BasicSocket.do_not_reverse_lookup = false
+  end
+
+  it "gets the address information" do
+    BasicSocket.do_not_reverse_lookup = true
+    expected = []
+    # The check for AP_INET6's class is needed because ipaddr.rb adds
+    # fake AP_INET6 even in case when IPv6 is not really supported.
+    # Without such check, this test might fail when ipaddr was required
+    # by some other specs.
+    if (Socket.constants.include? 'AF_INET6') &&
+        (Socket::AF_INET6.class != Object) then
+      expected.concat [
+        ['AF_INET6', 80, SocketSpecs.hostname, '::1', Socket::AF_INET6,
+          Socket::SOCK_DGRAM, Socket::IPPROTO_UDP],
+        ['AF_INET6', 80, SocketSpecs.hostname, '::1', Socket::AF_INET6,
+          Socket::SOCK_STREAM, Socket::IPPROTO_TCP],
+        ['AF_INET6', 80, SocketSpecs.hostname, '::1', Socket::AF_INET6,
+          Socket::SOCK_DGRAM, Socket::IPPROTO_UDP],
+        ['AF_INET6', 80, SocketSpecs.hostname, '::1', Socket::AF_INET6,
+          Socket::SOCK_STREAM, Socket::IPPROTO_TCP],
+        ['AF_INET6', 80, SocketSpecs.hostname, 'fe80::1%lo0', Socket::AF_INET6,
+          Socket::SOCK_DGRAM, Socket::IPPROTO_UDP],
+        ['AF_INET6', 80, SocketSpecs.hostname, 'fe80::1%lo0', Socket::AF_INET6,
+          Socket::SOCK_STREAM, Socket::IPPROTO_TCP],
+        ['AF_INET6', 80, SocketSpecs.hostname, 'fe80::1%lo0', Socket::AF_INET6,
+          Socket::SOCK_DGRAM, Socket::IPPROTO_UDP],
+        ['AF_INET6', 80, SocketSpecs.hostname, 'fe80::1%lo0', Socket::AF_INET6,
+          Socket::SOCK_STREAM, Socket::IPPROTO_TCP],
+      ]
+    end
+
+    expected.concat [
+      ['AF_INET', 80, SocketSpecs.hostname, '127.0.0.1', Socket::AF_INET,
+        Socket::SOCK_DGRAM, Socket::IPPROTO_UDP],
+      ['AF_INET', 80, SocketSpecs.hostname, '127.0.0.1', Socket::AF_INET,
+        Socket::SOCK_STREAM, Socket::IPPROTO_TCP],
+    ]
+
+    addrinfo = Socket.getaddrinfo SocketSpecs.hostname, 'http'
+    addrinfo.each { |a| expected.should include(a) }
+  end
+
+   # #getaddrinfo will return a INADDR_ANY address (0.0.0.0
+   # or "::") if it's a passive socket. In the case of non-passive
+   # sockets (AI_PASSIVE not set) it should return the loopback
+   # address (127.0.0.1 or "::1".
+
+   it "accepts empty addresses for IPv4 passive sockets" do
+     res = Socket::getaddrinfo(nil, "http",
+                               Socket::AF_INET,
+                               Socket::SOCK_STREAM,
+                               Socket::IPPROTO_TCP,
+                               Socket::AI_PASSIVE)
+
+     expected = [["AF_INET", 80, "0.0.0.0", "0.0.0.0", Socket::AF_INET, Socket::SOCK_STREAM, Socket::IPPROTO_TCP]]
+     res.should == expected
+   end
+
+   it "accepts empty addresses for IPv4 non-passive sockets" do
+    BasicSocket.do_not_reverse_lookup = true
+     res = Socket::getaddrinfo(nil, "http",
+                               Socket::AF_INET,
+                               Socket::SOCK_STREAM,
+                               Socket::IPPROTO_TCP,
+                               0)
+
+     expected = [["AF_INET", 80, "127.0.0.1", "127.0.0.1", Socket::AF_INET, Socket::SOCK_STREAM, Socket::IPPROTO_TCP]]
+     res.should == expected
+   end
+
+
+   it "accepts empty addresses for IPv6 passive sockets" do
+     BasicSocket.do_not_reverse_lookup = true
+     res = Socket::getaddrinfo(nil, "http",
+                               Socket::AF_INET6,
+                               Socket::SOCK_STREAM,
+                               Socket::IPPROTO_TCP,
+                               Socket::AI_PASSIVE)
+
+     expected = [["AF_INET6", 80, "::", "::", Socket::AF_INET6, Socket::SOCK_STREAM, Socket::IPPROTO_TCP]]
+     res.should == expected
+   end
+
+   it "accepts empty addresses for IPv6 non-passive sockets" do
+     BasicSocket.do_not_reverse_lookup = true
+     res = Socket::getaddrinfo(nil, "http",
+                               Socket::AF_INET6,
+                               Socket::SOCK_STREAM,
+                               Socket::IPPROTO_TCP,
+                               0)
+
+     expected = [["AF_INET6", 80, "::1", "::1", Socket::AF_INET6, Socket::SOCK_STREAM, Socket::IPPROTO_TCP]]
+     res.should == expected
+   end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/socket/socket/gethostbyaddr_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/socket/gethostbyaddr_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/socket/gethostbyaddr_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'

Added: MacRuby/branches/experimental/spec/frozen/library/socket/socket/gethostbyname_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/socket/gethostbyname_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/socket/gethostbyname_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+require 'socket'
+
+describe "Socket#gethostbyname" do
+  it "returns broadcast address info for '<broadcast>'" do
+    addr = Socket.gethostbyname('<broadcast>');
+    addr.should == ["255.255.255.255", [], 2, "\377\377\377\377"]
+  end
+
+  it "returns broadcast address info for '<any>'" do
+    addr = Socket.gethostbyname('<any>');
+    addr.should == ["0.0.0.0", [], 2, "\000\000\000\000"]
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/socket/socket/gethostname_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/socket/gethostname_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/socket/gethostname_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "Socket.gethostname" do
+  # This currently works in Unix and Windows. Feel free to add guards
+  # for other platforms.
+  it "returns the host name" do
+    Socket.gethostname.should == `hostname`.strip
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/socket/getnameinfo_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/socket/getnameinfo_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/socket/getnameinfo_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'

Added: MacRuby/branches/experimental/spec/frozen/library/socket/socket/getservbyname_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/socket/getservbyname_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/socket/getservbyname_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "Socket#getservbyname" do
+
+  it "identifies service ports " do
+    Socket.getservbyname('http').should == 80
+    Socket.getservbyname('http', 'tcp').should == 80
+    Socket.getservbyname('domain', 'udp').should == 53
+    Socket.getservbyname('daytime').should == 13
+  end
+
+  it "raises a SocketError when the service or port is invalid" do
+    lambda { Socket.getservbyname('invalid') }.should raise_error(SocketError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/socket/listen_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/socket/listen_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/socket/listen_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+include Socket::Constants
+
+describe "Socket#listen" do
+  before :each do
+    @socket = Socket.new(AF_INET, SOCK_STREAM, 0)
+  end
+
+  after :each do
+    @socket.closed?.should be_false
+    @socket.close
+  end
+
+  it "verifies we can listen for incoming connections" do
+    sockaddr = Socket.pack_sockaddr_in(SocketSpecs.port, "127.0.0.1")
+    @socket.setsockopt(Socket::SOL_SOCKET, Socket::SO_REUSEADDR, true)
+    @socket.bind(sockaddr)
+    @socket.listen(1).should == 0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/socket/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/socket/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/socket/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'

Added: MacRuby/branches/experimental/spec/frozen/library/socket/socket/pack_sockaddr_in_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/socket/pack_sockaddr_in_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/socket/pack_sockaddr_in_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+require File.dirname(__FILE__) + '/../shared/pack_sockaddr'
+
+describe "Socket#pack_sockaddr_in" do
+  it_behaves_like :socket_pack_sockaddr_in, :pack_sockaddr_in
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/socket/pack_sockaddr_un_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/socket/pack_sockaddr_un_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/socket/pack_sockaddr_un_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+require File.dirname(__FILE__) + '/../shared/pack_sockaddr'
+
+describe "Socket#pack_sockaddr_un" do
+  it_behaves_like :socket_pack_sockaddr_un, :pack_sockaddr_un
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/socket/pair_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/socket/pair_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/socket/pair_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+require File.dirname(__FILE__) + '/../shared/socketpair'
+
+describe "Socket#pair" do
+  it_behaves_like :socket_socketpair, :pair
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/socket/recvfrom_nonblock_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/socket/recvfrom_nonblock_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/socket/recvfrom_nonblock_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'

Added: MacRuby/branches/experimental/spec/frozen/library/socket/socket/recvfrom_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/socket/recvfrom_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/socket/recvfrom_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'

Added: MacRuby/branches/experimental/spec/frozen/library/socket/socket/sockaddr_in_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/socket/sockaddr_in_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/socket/sockaddr_in_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+require File.dirname(__FILE__) + '/../shared/pack_sockaddr'
+
+describe "Socket#sockaddr_in" do
+  it_behaves_like :socket_pack_sockaddr_in, :sockaddr_in
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/socket/sockaddr_un_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/socket/sockaddr_un_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/socket/sockaddr_un_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+require File.dirname(__FILE__) + '/../shared/pack_sockaddr'
+
+describe "Socket#sockaddr_un" do
+  it_behaves_like :socket_pack_sockaddr_un, :sockaddr_un
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/socket/socket_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/socket/socket_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/socket/socket_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,38 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "Socket" do
+  it "inherits from BasicSocket and IO" do
+    Socket.superclass.should == BasicSocket
+    BasicSocket.superclass.should == IO
+  end
+end
+
+describe "The socket class hierarchy" do
+  it "has an IPSocket in parallel to Socket" do
+    Socket.ancestors.include?(IPSocket).should == false
+    IPSocket.ancestors.include?(Socket).should == false
+    IPSocket.superclass.should == BasicSocket
+  end
+
+  it "has TCPSocket and UDPSocket subclasses of IPSocket" do
+    TCPSocket.superclass.should == IPSocket
+    UDPSocket.superclass.should == IPSocket
+  end
+
+  not_supported_on :jruby, :windows do
+    it "has a UNIXSocket in parallel to Socket" do
+      Socket.ancestors.include?(UNIXSocket).should == false
+      UNIXSocket.ancestors.include?(Socket).should == false
+      UNIXSocket.superclass.should == BasicSocket
+    end
+  end
+end
+
+not_supported_on :jruby, :windows do
+  describe "Server class hierarchy" do
+    it "contains UNIXServer" do
+      UNIXServer.superclass.should == UNIXSocket
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/socket/socketpair_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/socket/socketpair_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/socket/socketpair_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+require File.dirname(__FILE__) + '/../shared/socketpair'
+
+describe "Socket#socketpair" do
+  it_behaves_like :socket_socketpair, :socketpair
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/socket/sysaccept_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/socket/sysaccept_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/socket/sysaccept_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'

Added: MacRuby/branches/experimental/spec/frozen/library/socket/socket/unpack_sockaddr_in_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/socket/unpack_sockaddr_in_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/socket/unpack_sockaddr_in_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'socket'
+
+describe "Socket#unpack_sockaddr_in" do
+
+  it "decodes the host name and port number of a packed sockaddr_in" do
+    sockaddr = Socket.sockaddr_in SocketSpecs.port, '127.0.0.1'
+    Socket.unpack_sockaddr_in(sockaddr).should == [SocketSpecs.port, '127.0.0.1']
+  end
+
+  it "raises an ArgumentError when the sin_family is not AF_INET" do
+    sockaddr = Socket.sockaddr_un '/tmp/x'
+    lambda { Socket.unpack_sockaddr_in sockaddr }.should raise_error(ArgumentError)
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/socket/unpack_sockaddr_un_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/socket/unpack_sockaddr_un_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/socket/unpack_sockaddr_un_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'

Added: MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/accept_nonblock_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/accept_nonblock_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/accept_nonblock_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,30 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "Socket::TCPServer.accept_nonblock" do
+  before :each do
+    @server =  TCPServer.new("127.0.0.1", SocketSpecs.port)
+  end
+
+  after :each do
+    @server.close
+  end
+
+  it "accepts non blocking connections" do
+    @server.listen(5)
+    lambda { @server.accept_nonblock}.should raise_error(Errno::EAGAIN)
+
+    c = TCPSocket.new("127.0.0.1", SocketSpecs.port)
+    s = @server.accept_nonblock
+
+    # commenting while we get some input on the current JRuby situation
+    #    port, address = Socket.unpack_sockaddr_in(s.getsockname)
+
+    #    port.should == SocketSpecs.port
+    #    address.should == "127.0.0.1"
+    s.should be_kind_of(TCPSocket)
+    
+    c.close 
+    s.close 
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/accept_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/accept_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/accept_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,59 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+
+describe "TCPServer#accept" do
+  before :each do
+    @server = TCPServer.new("127.0.0.1", SocketSpecs.port)
+  end
+
+  after :each do
+    @server.close unless @server.closed?
+  end
+
+  it "accepts a connection and returns a TCPSocket" do
+    data = nil
+    t = Thread.new do
+      client = @server.accept
+      client.should be_kind_of(TCPSocket)
+      data = client.read(5)
+      client << "goodbye"
+      client.close
+    end
+    Thread.pass until t.status == "sleep"
+    
+    socket = TCPSocket.new('127.0.0.1', SocketSpecs.port)
+    socket.write('hello')
+    socket.read.should == 'goodbye'
+    t.join
+    data.should == 'hello'
+    socket.close
+  end
+
+  it "can be interrupted by Thread#kill" do
+    t = Thread.new { @server.accept }
+
+    Thread.pass until t.status == "sleep"
+
+    # kill thread, ensure it dies in a reasonable amount of time
+    t.kill
+    a = 1
+    while a < 1000
+      break unless t.alive?
+      Thread.pass
+      a += 1
+    end
+    a.should < 1000
+  end
+
+  it "can be interrupted by Thread#raise" do
+    t = Thread.new { @server.accept }
+
+    Thread.pass until t.status == "sleep"
+
+    # raise in thread, ensure the raise happens
+    ex = Exception.new
+    t.raise ex
+    lambda { t.join }.should raise_error(Exception)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/listen_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/listen_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/listen_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'

Added: MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,47 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "TCPServer.new" do
+  after(:each) do
+    @server.close if @server && !@server.closed?
+  end
+
+  it "binds to a host and a port" do
+    @server = TCPServer.new('127.0.0.1', SocketSpecs.port)
+    addr = @server.addr
+    addr[0].should == 'AF_INET'
+    addr[1].should be_kind_of(Fixnum)
+    # on some platforms (Mac), MRI
+    # returns comma at the end.
+    addr[2].should =~ /^#{SocketSpecs.hostname}\b/
+    addr[3].should == '127.0.0.1'
+  end
+
+  it "binds to localhost and a port with either IPv4 or IPv6" do
+    @server = TCPServer.new(SocketSpecs.hostname, SocketSpecs.port)
+    addr = @server.addr
+    if addr[0] == 'AF_INET'
+      addr[1].should be_kind_of(Fixnum)
+      addr[2].should =~ /^#{SocketSpecs.hostname}\b/
+      addr[3].should == '127.0.0.1'
+    else
+      addr[1].should be_kind_of(Fixnum)
+      addr[2].should =~ /^#{SocketSpecs.hostnamev6}\b/
+      addr[3].should == '::1'
+    end
+  end
+
+  it "coerces port to string, then determines port from that number or service name" do
+    t = Object.new
+    lambda { TCPServer.new(SocketSpecs.hostname, t) }.should raise_error(TypeError)
+
+    def t.to_str; SocketSpecs.port.to_s; end
+    
+    @server = TCPServer.new(SocketSpecs.hostname, t)
+    addr = @server.addr
+    addr[1].should == SocketSpecs.port
+
+    # TODO: This should also accept strings like 'https', but I don't know how to
+    # pick such a service port that will be able to reliably bind...
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/output_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/output_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/output_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "TCPServer#<<" do
+  after(:each) do
+    @server.close if @server
+    @socket.close if @socket
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/readpartial_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/readpartial_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/readpartial_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "TCPServer#readpartial" do
+  after(:each) do
+    @server.close if @server
+    @socket.close if @socket
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/sysaccept_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/sysaccept_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/tcpserver/sysaccept_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'

Added: MacRuby/branches/experimental/spec/frozen/library/socket/tcpsocket/gethostbyname_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/tcpsocket/gethostbyname_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/tcpsocket/gethostbyname_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,63 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+# TODO: verify these for windows
+describe "TCPSocket#gethostbyname" do
+  before :each do
+    @host_info = TCPSocket.gethostbyname(SocketSpecs.hostname)
+  end
+
+  it "returns an array elements of information on the hostname" do
+    @host_info.should be_kind_of(Array)
+  end
+
+  platform_is_not :windows do
+    it "returns the canonical name as first value" do
+    @host_info[0].should == SocketSpecs.hostname
+    end
+
+    not_compliant_on :jruby do
+      it "returns the address type as the third value" do
+        address_type = @host_info[2]
+        [Socket::AF_INET, Socket::AF_INET6].include?(address_type).should be_true
+      end
+
+      it "returns the IP address as the fourth value" do
+        ip = @host_info[3]
+        ["127.0.0.1", "::1"].include?(ip).should be_true
+      end
+    end
+
+    deviates_on :jruby do
+      it "returns the address type as the third value" do
+        address_type = @host_info[2]
+        [Socket::AF_INET, Socket::AF_INET6].include?(address_type).should be_true
+      end
+
+      it "returns the IP address as the fourth value" do
+        ip = @host_info[3]
+        ["127.0.0.1", "::1"].include?(ip).should be_true
+      end
+    end
+  end
+
+  platform_is :windows do
+    it "returns the canonical name as first value" do
+      host = "#{ENV['COMPUTERNAME'].downcase}"
+      host << ".#{ENV['USERDNSDOMAIN'].downcase}" if ENV['USERDNSDOMAIN']
+      @host_info[0].should == host
+    end
+
+    it "returns the address type as the third value" do
+      @host_info[2].should == Socket::AF_INET
+    end
+
+    it "returns the IP address as the fourth value" do
+      @host_info[3].should == "127.0.0.1"
+    end
+  end
+
+  it "returns any aliases to the address as second value" do
+    @host_info[1].should be_kind_of(Array)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/tcpsocket/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/tcpsocket/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/tcpsocket/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+require File.dirname(__FILE__) + '/shared/new'
+
+describe "TCPSocket.new" do
+  it_behaves_like :tcpsocket_new, :new
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/tcpsocket/open_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/tcpsocket/open_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/tcpsocket/open_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+require File.dirname(__FILE__) + '/shared/new'
+
+describe "TCPSocket.open" do
+  it_behaves_like :tcpsocket_new, :open
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/tcpsocket/shared/new.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/tcpsocket/shared/new.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/tcpsocket/shared/new.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,51 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require File.dirname(__FILE__) + '/../../fixtures/classes'
+
+describe :tcpsocket_new, :shared => true do
+  before :each do
+    @hostname = Socket.getaddrinfo("127.0.0.1", nil)[0][2]
+  end
+  it "requires a hostname and a port as arguments" do
+    lambda { TCPSocket.new }.should raise_error(ArgumentError)
+  end
+
+  it "refuses the connection when there is no server to connect to" do
+    lambda { TCPSocket.new('127.0.0.1', SocketSpecs.port) }.should raise_error(Errno::ECONNREFUSED)
+  end
+
+  it "connects to a listening server" do
+    thread = Thread.new do
+      server = TCPServer.new(SocketSpecs.port)
+      server.accept
+      server.close
+    end
+    Thread.pass until thread.status == 'sleep' or thread.status == nil
+    thread.status.should_not be_nil
+    lambda {
+      sock = TCPSocket.new(@hostname, SocketSpecs.port)
+      sock.close
+    }.should_not raise_error(Errno::ECONNREFUSED)
+    thread.join
+  end
+
+  it "has an address once it has connected to a listening server" do
+    thread = Thread.new do
+      server = TCPServer.new('127.0.0.1', SocketSpecs.port)
+      server.accept
+      server.close
+    end
+    Thread.pass until thread.status == 'sleep' or thread.status == nil
+    thread.status.should_not be_nil
+    sock = TCPSocket.new('127.0.0.1', SocketSpecs.port)
+    sock.addr[0].should == "AF_INET"
+    sock.addr[1].should be_kind_of(Fixnum)
+    # on some platforms (Mac), MRI
+    # returns comma at the end. Other
+    # platforms such as OpenBSD setup the
+    # localhost as localhost.domain.com
+    sock.addr[2].should =~ /^#{@hostname}/
+    sock.addr[3].should == "127.0.0.1"
+    sock.close
+    thread.join
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/udpsocket/bind_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/udpsocket/bind_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/udpsocket/bind_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "UDPSocket.bind" do
+  
+  before :each do
+    @socket = UDPSocket.new
+  end
+
+  after :each do
+    @socket.close unless @socket.closed?
+  end
+
+  it "binds the socket to a port" do
+    @socket.bind(SocketSpecs.hostname, SocketSpecs.port)
+
+    lambda { @socket.bind(SocketSpecs.hostname, SocketSpecs.port) }.should raise_error
+  end
+
+  it "receives a hostname and a port" do
+    @socket.bind(SocketSpecs.hostname, SocketSpecs.port)
+    
+    port, host = Socket.unpack_sockaddr_in(@socket.getsockname)
+    
+    host.should == "127.0.0.1"
+    port.should == SocketSpecs.port
+  end
+
+  it "binds to INADDR_ANY if the hostname is empty" do
+    @socket.bind("", SocketSpecs.port)
+    port, host = Socket.unpack_sockaddr_in(@socket.getsockname)
+    host.should == "0.0.0.0"    
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/udpsocket/connect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/udpsocket/connect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/udpsocket/connect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'

Added: MacRuby/branches/experimental/spec/frozen/library/socket/udpsocket/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/udpsocket/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/udpsocket/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'

Added: MacRuby/branches/experimental/spec/frozen/library/socket/udpsocket/open_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/udpsocket/open_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/udpsocket/open_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "UDPSocket.open" do
+  after(:each) do
+    @socket.close if @socket && !@socket.closed?
+  end
+
+  it "allows calls to open without arguments" do
+    @socket = UDPSocket.open
+    @socket.should be_kind_of(UDPSocket)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/udpsocket/recvfrom_nonblock_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/udpsocket/recvfrom_nonblock_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/udpsocket/recvfrom_nonblock_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'

Added: MacRuby/branches/experimental/spec/frozen/library/socket/udpsocket/send_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/udpsocket/send_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/udpsocket/send_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,46 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "UDPSocket.send" do
+  before :each do
+    @ready = false
+    @server_thread = Thread.new do
+      @server = UDPSocket.open
+      @server.bind(nil, SocketSpecs.port)
+      @ready = true
+      begin
+        @msg = @server.recvfrom_nonblock(64)
+      rescue Errno::EAGAIN
+        IO.select([@server])
+        retry
+      end
+      @server.close
+    end
+    Thread.pass while @server_thread.status and !@ready
+  end
+  
+  it "sends data in ad hoc mode" do
+    @socket = UDPSocket.open
+    @socket.send("ad hoc", 0, SocketSpecs.hostname,SocketSpecs.port)
+    @socket.close
+    @server_thread.join
+      
+    @msg[0].should == "ad hoc"
+    @msg[1][0].should == "AF_INET"
+    @msg[1][1].should be_kind_of(Fixnum)
+    @msg[1][3].should == "127.0.0.1"
+  end
+
+  it "sends data in connection mode" do
+    @socket = UDPSocket.open
+    @socket.connect(SocketSpecs.hostname,SocketSpecs.port)
+    @socket.send("connection-based", 0)
+    @socket.close
+    @server_thread.join
+    
+    @msg[0].should == "connection-based"
+    @msg[1][0].should == "AF_INET"
+    @msg[1][1].should be_kind_of(Fixnum)
+    @msg[1][3].should == "127.0.0.1"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/unixserver/accept_nonblock_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/unixserver/accept_nonblock_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/unixserver/accept_nonblock_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "UNIXSocket#recvfrom" do
+
+  platform_is_not :windows do
+    before :each do
+      @path = SocketSpecs.socket_path
+
+      @server = UNIXServer.open(@path)
+      @client = UNIXSocket.open(@path)
+      @socket = @server.accept_nonblock
+      @client.send("foobar", 0)
+    end
+
+    after :each do
+      @socket.close
+      @client.close
+      @server.close
+      File.unlink(@path) if File.exists?(@path)
+    end
+
+    it "accepts a connection in a non-blocking way" do
+      data = @socket.recvfrom(6).first
+      data.should == "foobar"
+    end
+
+    it "returns a UNIXSocket" do
+      @socket.should be_kind_of(UNIXSocket)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/unixserver/accept_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/unixserver/accept_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/unixserver/accept_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,63 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+platform_is_not :windows do
+  describe "UNIXServer#accept" do
+    before :each do
+      FileUtils.rm(SocketSpecs.socket_path, :force => true)
+    end
+
+    after :all do
+      FileUtils.rm(SocketSpecs.socket_path, :force => true)
+    end
+
+    it "accepts what is written by the client" do
+      server = UNIXServer.open(SocketSpecs.socket_path)
+      client = UNIXSocket.open(SocketSpecs.socket_path)
+
+      client.send('hello', 0)
+
+      sock = server.accept
+      data, info = sock.recvfrom(5)
+
+      data.should == 'hello'
+
+      server.close
+      client.close
+      sock.close
+    end
+
+    it "can be interrupted by Thread#kill" do
+      server = UNIXServer.new(SocketSpecs.socket_path)
+      t = Thread.new {
+        server.accept
+      }
+      Thread.pass until t.status == "sleep"
+
+      # kill thread, ensure it dies in a reasonable amount of time
+      t.kill
+      a = 1
+      while a < 1000
+        break unless t.alive?
+        Thread.pass
+        a += 1
+      end
+      a.should < 1000
+      server.close
+    end
+
+    it "can be interrupted by Thread#raise" do
+      server = UNIXServer.new(SocketSpecs.socket_path)
+      t = Thread.new {
+        server.accept
+      }
+      Thread.pass until t.status == "sleep"
+
+      # raise in thread, ensure the raise happens
+      ex = Exception.new
+      t.raise ex
+      lambda { t.join }.should raise_error(Exception)
+      server.close
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/unixserver/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/unixserver/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/unixserver/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/new'
+
+describe "UNIXServer.new" do
+  it_behaves_like :unixserver_new, :new
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/unixserver/open_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/unixserver/open_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/unixserver/open_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/new'
+
+describe "UNIXServer.open" do
+  it_behaves_like :unixserver_new, :open
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/unixserver/shared/new.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/unixserver/shared/new.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/unixserver/shared/new.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+require File.dirname(__FILE__) + '/../../fixtures/classes'
+require 'tempfile'
+
+describe :unixserver_new, :shared => true do
+  platform_is_not :windows do
+    it "creates a new UNIXServer" do
+      path = tmp("unixserver_spec")
+      File.unlink(path) if File.exists?(path)
+      unix = UNIXServer.new(path)
+      unix.path.should == path
+      unix.addr.should == ["AF_UNIX", path]
+      File.unlink(path)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/addr_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/addr_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/addr_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,36 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "UNIXSocket#addr" do
+
+  platform_is_not :windows do
+    before :all do
+      @path = SocketSpecs.socket_path
+      @server = UNIXServer.open(@path)
+      @client = UNIXSocket.open(@path)
+    end
+
+    after :all do
+      @client.close
+      @server.close
+      File.unlink(@path) if File.exists?(@path)
+    end
+
+    it "returns the address family of this socket in an array" do
+      @client.addr[0].should == "AF_UNIX"
+    end
+
+    it "returns the path of the socket in an array if it's a server" do
+      @server.addr[1].should == @path
+    end
+
+    it "returns an empty string for path if it's a client" do
+      @client.addr[1].should == ""
+    end
+
+    it "returns an array" do
+      @client.addr.should be_kind_of(Array)
+    end
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/new'
+
+describe "UNIXSocket.new" do
+  it_behaves_like :unixsocket_new, :new
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/open_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/open_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/open_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/shared/new'
+
+describe "UNIXSocket.open" do
+  it_behaves_like :unixsocket_new, :open
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/pair_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/pair_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/pair_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,36 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "UNIXSocket#pair" do
+  platform_is_not :windows do
+
+    before :each do
+      @s1, @s2 = UNIXSocket.pair
+    end
+
+    after :each do
+      @s1.close
+      @s2.close
+    end
+
+    it "returns a pair of connected sockets" do
+      @s1.puts "foo"
+      @s2.gets.should == "foo\n"
+    end
+
+    it "returns sockets with no name" do
+      @s1.path.should == @s2.path
+      @s1.path.should == ""
+    end
+
+    it "returns sockets with no address" do
+      @s1.addr.should == ["AF_UNIX", ""]
+      @s2.addr.should == ["AF_UNIX", ""]
+    end
+
+    it "returns sockets with no peeraddr" do
+      @s1.peeraddr.should == ["AF_UNIX", ""]
+      @s2.peeraddr.should == ["AF_UNIX", ""]
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/path_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/path_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/path_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "UNIXSocket#path" do
+
+  platform_is_not :windows do
+    before :all do
+      @path = SocketSpecs.socket_path
+      @server = UNIXServer.open(@path)
+      @client = UNIXSocket.open(@path)
+    end
+
+    after :all do
+      @client.close
+      @server.close
+      File.unlink(@path) if File.exists?(@path)
+    end
+
+    it "returns the path of the socket if it's a server" do
+      @server.path.should == @path
+    end
+
+    it "returns an empty string for path if it's a client" do
+      @client.path.should == ""
+    end
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/peeraddr_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/peeraddr_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/peeraddr_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "UNIXSocket#peeraddr" do
+
+  platform_is_not :windows do
+    before :all do
+      @path = SocketSpecs.socket_path
+      @server = UNIXServer.open(@path)
+      @client = UNIXSocket.open(@path)
+    end
+
+    after :all do
+      @client.close
+      @server.close
+      File.unlink(@path) if File.exists?(@path)
+    end
+
+    it "returns the address familly and path of the server end of the connection" do
+      @client.peeraddr.should == ["AF_UNIX", @path]
+    end
+
+    it "raises an error in server sockets" do
+      lambda { @server.peeraddr }.should raise_error
+    end
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/recvfrom_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/recvfrom_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/recvfrom_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,47 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.dirname(__FILE__) + '/../fixtures/classes'
+
+describe "UNIXSocket#recvfrom" do
+
+  platform_is_not :windows do
+    before :each do
+      @path = SocketSpecs.socket_path
+      @server = UNIXServer.open(@path)
+      @client = UNIXSocket.open(@path)
+    end
+
+    after :each do
+      @client.close
+      @server.close
+      File.unlink(@path) if File.exists?(@path)
+    end
+
+    it "receives len bytes from sock" do
+      @client.send("foobar", 0)
+      sock = @server.accept
+      sock.recvfrom(6).first.should == "foobar"
+      sock.close
+    end
+
+    it "returns an array with data and information on the sender" do
+      @client.send("foobar", 0)
+      sock = @server.accept
+      data = sock.recvfrom(6)
+      data.first.should == "foobar"
+      data.last.should == ["AF_UNIX", ""]
+      sock.close
+    end
+
+    it "uses different message options" do
+      @client.send("foobar", Socket::MSG_PEEK)
+      sock = @server.accept
+      peek_data = sock.recvfrom(6, Socket::MSG_PEEK) # Does not retrieve the message
+      real_data = sock.recvfrom(6)
+
+      real_data.should == peek_data
+      peek_data.should == ["foobar", ["AF_UNIX", ""]]
+      sock.close
+    end
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/shared/new.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/shared/new.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/socket/unixsocket/shared/new.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+require File.dirname(__FILE__) + '/../../../../spec_helper'
+
+describe :unixsocket_new, :shared => true do
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/append_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/append_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/append_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,84 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "StringIO#<< when passed [Object]" do
+  before(:each) do
+    @io = StringIO.new("example")
+  end
+  
+  it "returns self" do
+    (@io << "just testing").should equal(@io)
+  end
+
+  it "writes the passed argument onto self" do
+    (@io << "just testing")
+    @io.string.should == "just testing"
+    (@io << " and more testing")
+    @io.string.should == "just testing and more testing"
+  end
+  
+  it "writes the passed argument at the current position" do
+    @io.pos = 5
+    @io << "<test>"
+    @io.string.should == "examp<test>"
+  end
+  
+  it "pads self with \\000 when the current position is after the end" do
+    @io.pos = 15
+    @io << "just testing"
+    @io.string.should == "example\000\000\000\000\000\000\000\000just testing"
+  end
+  
+  it "taints self's String when the passed argument is tainted" do
+    (@io << "test".taint)
+    @io.string.tainted?.should be_true
+  end
+  
+  it "does not taint self when the passed argument is tainted" do
+    (@io << "test".taint)
+    @io.tainted?.should be_false
+  end
+  
+  it "updates self's position" do
+    @io << "test"
+    @io.pos.should eql(4)
+  end
+  
+  it "tries to convert the passed argument to a String using #to_s" do
+    obj = mock("to_s")
+    obj.should_receive(:to_s).and_return("Test")
+    
+    (@io << obj).string.should == "Testple"
+  end
+end
+
+describe "StringIO#<< when self is not writable" do
+  it "raises an IOError" do
+    io = StringIO.new("test", "r")
+    lambda { io << "test" }.should raise_error(IOError)
+
+    io = StringIO.new("test")
+    io.close_write
+    lambda { io << "test" }.should raise_error(IOError)
+  end
+end
+
+describe "StringIO#<< when in append mode" do
+  before(:each) do
+    @io = StringIO.new("example", "a")
+  end
+
+  it "appends the passed argument to the end of self, ignoring current position" do
+    (@io << ", just testing")
+    @io.string.should == "example, just testing"
+    
+    @io.pos = 3
+    (@io << " and more testing")
+    @io.string.should == "example, just testing and more testing"
+  end
+  
+  it "correctly updates self's position" do
+    @io << ", testing"
+    @io.pos.should eql(16)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/binmode_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/binmode_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/binmode_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "StringIO#binmode" do
+  it "returns self" do
+    io = StringIO.new("example")
+    io.binmode.should equal(io)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/bytes_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/bytes_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/bytes_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'stringio'
+require File.dirname(__FILE__) + "/shared/each_byte"
+
+ruby_version_is "1.8.7" do
+  describe "StringIO#bytes" do
+    it_behaves_like :stringio_each_byte, :bytes
+  end
+
+  describe "StringIO#bytes when self is not readable" do
+    it_behaves_like :stringio_each_byte_not_readable, :bytes
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/chars_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/chars_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/chars_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'stringio'
+require File.dirname(__FILE__) + "/shared/each_char"
+
+ruby_version_is "1.8.7" do
+  describe "StringIO#chars" do
+    it_behaves_like :stringio_each_char, :chars
+  end
+
+  describe "StringIO#chars when self is not readable" do
+    it_behaves_like :stringio_each_char_not_readable, :chars
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/close_read_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/close_read_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/close_read_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "StringIO#close_read" do
+  before(:each) do
+    @io = StringIO.new("example")
+  end
+
+  it "returns nil" do
+    @io.close_read.should be_nil
+  end
+
+  it "prevents further reading" do
+    @io.close_read
+    lambda { @io.read(1) }.should raise_error(IOError)
+  end
+
+  it "allows further writing" do
+    @io.close_read
+    @io.write("x").should == 1
+  end
+
+  it "raises an IOError when in write-only mode" do
+    io = StringIO.new("example", "w")
+    lambda { io.close_read }.should raise_error(IOError)
+
+    io = StringIO.new("example")
+    io.close_read
+    lambda { io.close_read }.should raise_error(IOError)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/close_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/close_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/close_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "StringIO#close" do
+  before(:each) do
+    @io = StringIOSpecs.build
+  end
+  
+  it "returns nil" do
+    @io.close.should be_nil
+  end
+  
+  it "prevents further reading and/or writing" do
+    @io.close
+    lambda { @io.read(1) }.should raise_error(IOError)
+    lambda { @io.write('x') }.should raise_error(IOError)
+  end
+
+  it "raises an IOError when self was already closed" do
+    @io.close
+    lambda { @io.close }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/close_write_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/close_write_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/close_write_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "StringIO#close_write" do
+  before(:each) do
+    @io = StringIO.new("example")
+  end
+
+  it "returns nil" do
+    @io.close_write.should be_nil
+  end
+
+  it "prevents further writing" do
+    @io.close_write
+    lambda { @io.write('x') }.should raise_error(IOError)
+  end
+
+  it "allows further reading" do
+    @io.close_write
+    @io.read(1).should == 'e'
+  end
+
+  it "raises an IOError when in read-only mode" do
+    io = StringIO.new("example", "r")
+    lambda { io.close_write }.should raise_error(IOError)
+
+    io = StringIO.new("example")
+    io.close_write
+    lambda { io.close_write }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/closed_read_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/closed_read_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/closed_read_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "StringIO#closed_read?" do
+  it "returns true if self is not readable" do
+    io = StringIO.new("example", "r+")
+    io.close_write
+    io.closed_read?.should be_false
+    io.close_read
+    io.closed_read?.should be_true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/closed_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/closed_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/closed_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "StringIO#closed?" do
+  it "returns true if self is completely closed" do
+    io = StringIO.new("example", "r+")
+    io.close_read
+    io.closed?.should be_false
+    io.close_write
+    io.closed?.should be_true
+
+    io = StringIO.new("example", "r+")
+    io.close
+    io.closed?.should be_true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/closed_write_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/closed_write_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/closed_write_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "StringIO#closed_write?" do
+  it "returns true if self is not writable" do
+    io = StringIO.new("example", "r+")
+    io.close_read
+    io.closed_write?.should be_false
+    io.close_write
+    io.closed_write?.should be_true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/each_byte_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/each_byte_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/each_byte_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'stringio'
+require File.dirname(__FILE__) + "/shared/each_byte"
+
+describe "StringIO#each_byte" do
+  it_behaves_like :stringio_each_byte, :each_byte
+end
+
+describe "StringIO#each_byte when self is not readable" do
+  it_behaves_like :stringio_each_byte_not_readable, :each_byte
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/each_char_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/each_char_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/each_char_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'stringio'
+require File.dirname(__FILE__) + "/shared/each_char"
+
+ruby_version_is "1.8.7" do
+  describe "StringIO#each_char" do
+    it_behaves_like :stringio_each_char, :each_char
+  end
+
+  describe "StringIO#each_char when self is not readable" do
+    it_behaves_like :stringio_each_char_not_readable, :chars
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/each_line_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/each_line_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/each_line_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/each'
+
+describe "StringIO#each_line when passed a separator" do
+  it_behaves_like :stringio_each_separator, :each_line
+end
+
+describe "StringIO#each_line when passed no arguments" do
+  it_behaves_like :stringio_each_no_arguments, :each_line
+end
+
+describe "StringIO#each_line when self is not readable" do
+  it_behaves_like :stringio_each_not_readable, :each_line
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/each_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/each_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/each_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/each'
+
+describe "StringIO#each when passed a separator" do
+  it_behaves_like :stringio_each_separator, :each
+end
+
+describe "StringIO#each when passed no arguments" do
+  it_behaves_like :stringio_each_no_arguments, :each
+end
+
+describe "StringIO#each when self is not readable" do
+  it_behaves_like :stringio_each_not_readable, :each
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/eof_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/eof_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/eof_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/eof'
+
+describe "StringIO#eof?" do
+  it_behaves_like :stringio_eof, :eof?
+end
+
+describe "StringIO#eof" do
+  it_behaves_like :stringio_eof, :eof
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/fcntl_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/fcntl_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/fcntl_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "StringIO#fcntl" do
+  it "raises a NotImplementedError" do
+    lambda { StringIO.new("boom").fcntl }.should raise_error(NotImplementedError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/fileno_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/fileno_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/fileno_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/each'
+
+describe "StringIO#fileno" do
+  it "returns nil" do
+    StringIO.new("nuffin").fileno.should be_nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require 'stringio'
+
+class StringSubclass < String; end
+
+module StringIOSpecs
+  def self.build
+  str = <<-EOS
+    each
+    peach
+    pear
+    plum
+  EOS
+    StringIO.new(str)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/flush_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/flush_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/flush_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "StringIO#flush" do
+  it "returns self" do
+    io = StringIO.new("flush")
+    io.flush.should equal(io)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/fsync_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/fsync_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/fsync_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "StringIO#fsync" do
+  it "returns zero" do
+    io = StringIO.new("fsync")
+    io.fsync.should eql(0)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/getbyte_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/getbyte_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/getbyte_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'stringio'
+require File.dirname(__FILE__) + '/shared/getc'
+
+ruby_version_is "1.8.7" do
+  describe "StringIO#getbyte" do
+    it_behaves_like :stringio_getc, :getbyte
+  end
+
+  describe "StringIO#getbyte when self is not readable" do
+    it_behaves_like :stringio_getc_not_readable, :getbyte
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/getc_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/getc_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/getc_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'stringio'
+require File.dirname(__FILE__) + '/shared/getc'
+
+describe "StringIO#getc" do
+  it_behaves_like :stringio_getc, :getc
+end
+
+describe "StringIO#getc when self is not readable" do
+  it_behaves_like :stringio_getc_not_readable, :getc
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/gets_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/gets_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/gets_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,126 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require "stringio"
+
+describe "StringIO#gets when passed [separator]" do
+  before(:each) do
+    @io = StringIO.new("this>is>an>example")
+  end
+
+  it "returns the data read till the next occurence of the passed separator" do
+    @io.gets(">").should == "this>"
+    @io.gets(">").should == "is>"
+    @io.gets(">").should == "an>"
+    @io.gets(">").should == "example"
+  end
+
+  it "sets $_ to the read content" do
+    @io.gets(">")
+    $_.should == "this>"
+    @io.gets(">")
+    $_.should == "is>"
+    @io.gets(">")
+    $_.should == "an>"
+    @io.gets(">")
+    $_.should == "example"
+    @io.gets(">")
+    $_.should be_nil
+  end
+
+  it "updates self's lineno by one" do
+    @io.gets(">")
+    @io.lineno.should eql(1)
+    
+    @io.gets(">")
+    @io.lineno.should eql(2)
+    
+    @io.gets(">")
+    @io.lineno.should eql(3)
+  end
+  
+  it "returns the next paragraph when the passed separator is an empty String" do
+    io = StringIO.new("this is\n\nan example")
+    io.gets("").should == "this is\n"
+    io.gets("").should == "an example"
+  end
+  
+  it "returns the remaining content starting at the current position when passed nil" do
+    io = StringIO.new("this is\n\nan example")
+    io.pos = 5
+    io.gets(nil).should == "is\n\nan example"
+  end
+
+  it "tries to convert the passed separator to a String using #to_str" do
+    obj = mock('to_str')
+    obj.should_receive(:to_str).and_return(">")
+    @io.gets(obj).should == "this>"
+  end
+end
+
+describe "StringIO#gets when passed no argument" do
+  before(:each) do
+    @io = StringIO.new("this is\nan example\nfor StringIO#gets")
+  end
+  
+  it "returns the data read till the next occurence of $/ or till eof" do
+    @io.gets.should == "this is\n"
+    
+    begin
+      old_sep, $/ = $/, " "
+      @io.gets.should == "an "
+      @io.gets.should == "example\nfor "
+      @io.gets.should == "StringIO#gets"
+    ensure
+      $/ = old_sep
+    end
+  end
+
+  it "sets $_ to the read content" do
+    @io.gets
+    $_.should == "this is\n"
+    @io.gets
+    $_.should == "an example\n"
+    @io.gets
+    $_.should == "for StringIO#gets"
+    @io.gets
+    $_.should be_nil
+  end
+
+  it "updates self's position" do
+    @io.gets
+    @io.pos.should eql(8)
+    
+    @io.gets
+    @io.pos.should eql(19)
+
+    @io.gets
+    @io.pos.should eql(36)
+  end
+  
+  it "updates self's lineno" do
+    @io.gets
+    @io.lineno.should eql(1)
+    
+    @io.gets
+    @io.lineno.should eql(2)
+    
+    @io.gets
+    @io.lineno.should eql(3)
+  end
+
+  it "returns nil if self is at the end" do
+    @io.pos = 36
+    @io.gets.should be_nil
+    @io.gets.should be_nil
+  end
+end
+
+describe "StringIO#gets when in write-only mode" do
+  it "raises an IOError" do
+    io = StringIO.new("xyz", "w")
+    lambda { io.gets }.should raise_error(IOError)
+
+    io = StringIO.new("xyz")
+    io.close_read
+    lambda { io.gets }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/initialize_copy_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/initialize_copy_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/initialize_copy_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,81 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'stringio'
+
+describe "StringIO#initialize_copy" do
+  before(:each) do
+    @io      = StringIO.new("StringIO example")
+    @orig_io = StringIO.new("Original StringIO")
+  end
+  
+  it "is private" do
+    @io.private_methods.should include("initialize_copy")
+  end
+  
+  it "returns self" do
+    @io.send(:initialize_copy, @orig_io).should equal(@io)
+  end
+
+  it "tries to convert the passed argument to a StringIO using #to_strio" do
+    obj = mock('to_strio')
+    obj.should_receive(:to_strio).and_return(StringIO.new("converted"))
+    @io.send(:initialize_copy, obj)
+    @io.string.should == "converted"
+  end
+
+  it "copies the passed StringIO's content to self" do
+    @io.send(:initialize_copy, @orig_io)
+    @io.string.should == "Original StringIO"
+  end
+  
+  it "copies the passed StringIO's position to self" do
+    @orig_io.pos = 5
+    @io.send(:initialize_copy, @orig_io)
+    @io.pos.should eql(5)
+  end
+
+  it "taints self when the passed StringIO is tainted" do
+    @orig_io.taint
+    @io.send(:initialize_copy, @orig_io)
+    @io.tainted?.should be_true
+  end
+  
+  it "copies the passed StringIO's mode to self" do
+    orig_io = StringIO.new("read-only", "r")
+    @io.send(:initialize_copy, orig_io)
+    @io.closed_read?.should be_false
+    @io.closed_write?.should be_true
+
+    orig_io = StringIO.new("write-only", "w")
+    @io.send(:initialize_copy, orig_io)
+    @io.closed_read?.should be_true
+    @io.closed_write?.should be_false
+
+    orig_io = StringIO.new("read-write", "r+")
+    @io.send(:initialize_copy, orig_io)
+    @io.closed_read?.should be_false
+    @io.closed_write?.should be_false
+
+    orig_io = StringIO.new("read-write", "w+")
+    @io.send(:initialize_copy, orig_io)
+    @io.closed_read?.should be_false
+    @io.closed_write?.should be_false
+  end
+  
+  it "copies the passed StringIO's append mode" do
+    orig_io = StringIO.new("read-write", "a")
+    @io.send(:initialize_copy, orig_io)
+    
+    @io.pos = 0
+    @io << " test"
+    
+    @io.string.should == "read-write test"
+  end
+
+  it "does not truncate self's content when the copied StringIO was in truncate mode" do
+    orig_io = StringIO.new("original StringIO", "w+")
+    orig_io.write("not truncated") # make sure the content is not empty
+    
+    @io.send(:initialize_copy, orig_io)
+    @io.string.should == "not truncated"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,185 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'stringio'
+
+describe "StringIO#initialize when passed [Object, mode]" do
+  before(:each) do
+    @io = StringIO.allocate
+  end
+
+  it "uses the passed Object as the StringIO backend" do
+    @io.send(:initialize, str = "example", "r")
+    @io.string.should equal(str)
+  end
+
+  it "sets the mode based on the passed mode" do
+    io = StringIO.allocate
+    io.send(:initialize, "example", "r")
+    io.closed_read?.should be_false
+    io.closed_write?.should be_true
+
+    io = StringIO.allocate
+    io.send(:initialize, "example", "rb")
+    io.closed_read?.should be_false
+    io.closed_write?.should be_true
+
+    io = StringIO.allocate
+    io.send(:initialize, "example", "r+")
+    io.closed_read?.should be_false
+    io.closed_write?.should be_false
+
+    io = StringIO.allocate
+    io.send(:initialize, "example", "rb+")
+    io.closed_read?.should be_false
+    io.closed_write?.should be_false
+
+    io = StringIO.allocate
+    io.send(:initialize, "example", "w")
+    io.closed_read?.should be_true
+    io.closed_write?.should be_false
+
+    io = StringIO.allocate
+    io.send(:initialize, "example", "wb")
+    io.closed_read?.should be_true
+    io.closed_write?.should be_false
+
+    io = StringIO.allocate
+    io.send(:initialize, "example", "w+")
+    io.closed_read?.should be_false
+    io.closed_write?.should be_false
+
+    io = StringIO.allocate
+    io.send(:initialize, "example", "wb+")
+    io.closed_read?.should be_false
+    io.closed_write?.should be_false
+
+    io = StringIO.allocate
+    io.send(:initialize, "example", "a")
+    io.closed_read?.should be_true
+    io.closed_write?.should be_false
+
+    io = StringIO.allocate
+    io.send(:initialize, "example", "ab")
+    io.closed_read?.should be_true
+    io.closed_write?.should be_false
+
+    io = StringIO.allocate
+    io.send(:initialize, "example", "a+")
+    io.closed_read?.should be_false
+    io.closed_write?.should be_false
+
+    io = StringIO.allocate
+    io.send(:initialize, "example", "ab+")
+    io.closed_read?.should be_false
+    io.closed_write?.should be_false
+  end
+
+  it "allows passing the mode as an Integer" do
+    io = StringIO.allocate
+    io.send(:initialize, "example", IO::RDONLY)
+    io.closed_read?.should be_false
+    io.closed_write?.should be_true
+
+    io = StringIO.allocate
+    io.send(:initialize, "example", IO::RDWR)
+    io.closed_read?.should be_false
+    io.closed_write?.should be_false
+
+    io = StringIO.allocate
+    io.send(:initialize, "example", IO::WRONLY)
+    io.closed_read?.should be_true
+    io.closed_write?.should be_false
+
+    io = StringIO.allocate
+    io.send(:initialize, "example", IO::WRONLY | IO::TRUNC)
+    io.closed_read?.should be_true
+    io.closed_write?.should be_false
+
+    io = StringIO.allocate
+    io.send(:initialize, "example", IO::RDWR | IO::TRUNC)
+    io.closed_read?.should be_false
+    io.closed_write?.should be_false
+
+    io = StringIO.allocate
+    io.send(:initialize, "example", IO::WRONLY | IO::APPEND)
+    io.closed_read?.should be_true
+    io.closed_write?.should be_false
+
+    io = StringIO.allocate
+    io.send(:initialize, "example", IO::RDWR | IO::APPEND)
+    io.closed_read?.should be_false
+    io.closed_write?.should be_false
+  end
+
+  it "raises a TypeError when passed a frozen String in truncate mode as StringIO backend" do
+    io = StringIO.allocate
+    lambda { io.send(:initialize, "example".freeze, IO::TRUNC) }.should raise_error(TypeError)
+  end
+
+  it "tries to convert the passed mode to a String using #to_str" do
+    obj = mock('to_str')
+    obj.should_receive(:to_str).and_return("r")
+    @io.send(:initialize, "example", obj)
+
+    @io.closed_read?.should be_false
+    @io.closed_write?.should be_true
+  end
+
+  it "raises an Errno::EACCES error when passed a frozen string with a write-mode" do
+    (str = "example").freeze
+    lambda { @io.send(:initialize, str, "r+") }.should raise_error(Errno::EACCES)
+    lambda { @io.send(:initialize, str, "w") }.should raise_error(Errno::EACCES)
+    lambda { @io.send(:initialize, str, "a") }.should raise_error(Errno::EACCES)
+  end
+end
+
+describe "StringIO#initialize when passed [Object]" do
+  before(:each) do
+    @io = StringIO.allocate
+  end
+
+  it "uses the passed Object as the StringIO backend" do
+    @io.send(:initialize, str = "example")
+    @io.string.should equal(str)
+  end
+
+  it "sets the mode to read-write" do
+    @io.send(:initialize, "example")
+    @io.closed_read?.should be_false
+    @io.closed_write?.should be_false
+  end
+
+  it "tries to convert the passed Object to a String using #to_str" do
+    obj = mock('to_str')
+    obj.should_receive(:to_str).and_return("example")
+    @io.send(:initialize, obj)
+    @io.string.should == "example"
+  end
+
+  it "automatically sets the mode to read-only when passed a frozen string" do
+    (str = "example").freeze
+    @io.send(:initialize, str)
+    @io.closed_read?.should be_false
+    @io.closed_write?.should be_true
+  end
+end
+
+describe "StringIO#initialize when passed no arguments" do
+  before(:each) do
+    @io = StringIO.allocate
+  end
+
+  it "is private" do
+    @io.private_methods.should include("initialize")
+  end
+
+  it "sets the mode to read-write" do
+    @io.send(:initialize, "example")
+    @io.closed_read?.should be_false
+    @io.closed_write?.should be_false
+  end
+
+  it "uses an empty String as the StringIO backend" do
+    @io.send(:initialize)
+    @io.string.should == ""
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/isatty_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/isatty_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/isatty_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/isatty'
+
+describe "StringIO#tty?" do
+  it_behaves_like :stringio_isatty, :isatty
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/length'
+
+describe "StringIO#length" do
+  it_behaves_like :stringio_length, :length
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/lineno_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/lineno_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/lineno_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,30 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require "stringio"
+
+describe "StringIO#lineno" do
+  before(:each) do
+    @io = StringIO.new("this\nis\nan\nexample")
+  end
+
+  it "returns the number of lines read" do
+    @io.gets
+    @io.gets
+    @io.gets
+    @io.lineno.should eql(3)
+  end
+end
+
+describe "StringIO#lineno=" do
+  before(:each) do
+    @io = StringIO.new("this\nis\nan\nexample")
+  end
+
+  it "sets the current line number, but has no impact on the position" do
+    @io.lineno = 3
+    @io.pos.should eql(0)
+    
+    @io.gets.should == "this\n"
+    @io.lineno.should eql(4)
+    @io.pos.should eql(5)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/lines_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/lines_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/lines_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'stringio'
+require File.dirname(__FILE__) + '/shared/each'
+
+ruby_version_is "1.8.7" do
+  describe "StringIO#lines when passed a separator" do
+    it_behaves_like :stringio_each_separator, :lines
+  end
+
+  describe "StringIO#lines when passed no arguments" do
+    it_behaves_like :stringio_each_no_arguments, :lines
+  end
+
+  describe "StringIO#lines when self is not readable" do
+    it_behaves_like :stringio_each_not_readable, :lines
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/open_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/open_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/open_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,208 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'stringio'
+
+describe "StringIO.open when passed [Object, mode]" do
+  it "uses the passed Object as the StringIO backend" do
+    io = StringIO.open(str = "example", "r")
+    io.string.should equal(str)
+  end
+
+  it "returns the blocks return value when yielding" do
+    ret = StringIO.open("example", "r") { :test }
+    ret.should equal(:test)
+  end
+
+  it "yields self to the passed block" do
+    io = nil
+    StringIO.open("example", "r") { |strio| io = strio }
+    io.should be_kind_of(StringIO)
+  end
+
+  it "closes self after yielding" do
+    io = nil
+    StringIO.open("example", "r") { |strio| io = strio }
+    io.closed?.should be_true
+  end
+
+  it "even closes self when an exception is raised while yielding" do
+    io = nil
+    begin
+      StringIO.open("example", "r") do |strio|
+        io = strio
+        raise "Error"
+      end
+    rescue
+    end
+    io.closed?.should be_true
+  end
+
+  it "sets self's string to nil after yielding" do
+    io = nil
+    StringIO.open("example", "r") { |strio| io = strio }
+    io.string.should be_nil
+  end
+
+  it "even sets self's string to nil when an exception is raised while yielding" do
+    io = nil
+    begin
+      StringIO.open("example", "r") do |strio|
+        io = strio
+        raise "Error"
+      end
+    rescue
+    end
+    io.string.should be_nil
+  end
+
+  it "sets the mode based on the passed mode" do
+    io = StringIO.open("example", "r")
+    io.closed_read?.should be_false
+    io.closed_write?.should be_true
+
+    io = StringIO.open("example", "rb")
+    io.closed_read?.should be_false
+    io.closed_write?.should be_true
+
+    io = StringIO.open("example", "r+")
+    io.closed_read?.should be_false
+    io.closed_write?.should be_false
+
+    io = StringIO.open("example", "rb+")
+    io.closed_read?.should be_false
+    io.closed_write?.should be_false
+
+    io = StringIO.open("example", "w")
+    io.closed_read?.should be_true
+    io.closed_write?.should be_false
+
+    io = StringIO.open("example", "wb")
+    io.closed_read?.should be_true
+    io.closed_write?.should be_false
+
+    io = StringIO.open("example", "w+")
+    io.closed_read?.should be_false
+    io.closed_write?.should be_false
+
+    io = StringIO.open("example", "wb+")
+    io.closed_read?.should be_false
+    io.closed_write?.should be_false
+
+    io = StringIO.open("example", "a")
+    io.closed_read?.should be_true
+    io.closed_write?.should be_false
+
+    io = StringIO.open("example", "ab")
+    io.closed_read?.should be_true
+    io.closed_write?.should be_false
+
+    io = StringIO.open("example", "a+")
+    io.closed_read?.should be_false
+    io.closed_write?.should be_false
+
+    io = StringIO.open("example", "ab+")
+    io.closed_read?.should be_false
+    io.closed_write?.should be_false
+  end
+
+  it "allows passing the mode as an Integer" do
+    io = StringIO.open("example", IO::RDONLY)
+    io.closed_read?.should be_false
+    io.closed_write?.should be_true
+
+    io = StringIO.open("example", IO::RDWR)
+    io.closed_read?.should be_false
+    io.closed_write?.should be_false
+
+    io = StringIO.open("example", IO::WRONLY)
+    io.closed_read?.should be_true
+    io.closed_write?.should be_false
+
+    io = StringIO.open("example", IO::WRONLY | IO::TRUNC)
+    io.closed_read?.should be_true
+    io.closed_write?.should be_false
+
+    io = StringIO.open("example", IO::RDWR | IO::TRUNC)
+    io.closed_read?.should be_false
+    io.closed_write?.should be_false
+
+    io = StringIO.open("example", IO::WRONLY | IO::APPEND)
+    io.closed_read?.should be_true
+    io.closed_write?.should be_false
+
+    io = StringIO.open("example", IO::RDWR | IO::APPEND)
+    io.closed_read?.should be_false
+    io.closed_write?.should be_false
+  end
+
+  it "raises a TypeError when passed a frozen String in truncate mode as StringIO backend" do
+    lambda { StringIO.open("example".freeze, IO::TRUNC) }.should raise_error(TypeError)
+  end
+
+  it "tries to convert the passed mode to a String using #to_str" do
+    obj = mock('to_str')
+    obj.should_receive(:to_str).and_return("r")
+    io = StringIO.open("example", obj)
+
+    io.closed_read?.should be_false
+    io.closed_write?.should be_true
+  end
+
+  it "raises an Errno::EACCES error when passed a frozen string with a write-mode" do
+    (str = "example").freeze
+    lambda { io = StringIO.open(str, "r+") }.should raise_error(Errno::EACCES)
+    lambda { io = StringIO.open(str, "w") }.should raise_error(Errno::EACCES)
+    lambda { io = StringIO.open(str, "a") }.should raise_error(Errno::EACCES)
+  end
+end
+
+describe "StringIO.open when passed [Object]" do
+  it "uses the passed Object as the StringIO backend" do
+    io = StringIO.open(str = "example")
+    io.string.should equal(str)
+  end
+
+  it "yields self to the passed block" do
+    io = nil
+    ret = StringIO.open("example") { |strio| io = strio }
+    io.should equal(ret)
+  end
+
+  it "sets the mode to read-write" do
+    io = StringIO.open("example")
+    io.closed_read?.should be_false
+    io.closed_write?.should be_false
+  end
+
+  it "tries to convert the passed Object to a String using #to_str" do
+    obj = mock('to_str')
+    obj.should_receive(:to_str).and_return("example")
+    io = StringIO.open(obj)
+    io.string.should == "example"
+  end
+
+  it "automatically sets the mode to read-only when passed a frozen string" do
+    (str = "example").freeze
+    io = StringIO.open(str)
+    io.closed_read?.should be_false
+    io.closed_write?.should be_true
+  end
+end
+
+describe "StringIO.open when passed no arguments" do
+  it "yields self to the passed block" do
+    io = nil
+    ret = StringIO.open { |strio| io = strio }
+    io.should equal(ret)
+  end
+
+  it "sets the mode to read-write" do
+    io = StringIO.open
+    io.closed_read?.should be_false
+    io.closed_write?.should be_false
+  end
+
+  it "uses an empty String as the StringIO backend" do
+    StringIO.open.string.should == ""
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/path_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/path_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/path_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "StringIO#path" do
+  it "returns nil" do
+    StringIO.new("path").path.should be_nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/pid_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/pid_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/pid_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "StringIO#pid" do
+  it "returns nil" do
+    StringIO.new("pid").pid.should be_nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/pos_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/pos_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/pos_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/tell'
+
+describe "StringIO#pos" do
+  it_behaves_like :stringio_tell, :pos
+end
+
+describe "StringIO#pos=" do
+  before(:each) do
+    @io = StringIOSpecs.build
+  end
+
+  it "updates the current byte offset" do
+    @io.pos = 26
+    @io.read(1).should == "r"
+  end
+
+  it "raises an EINVAL if given a negative argument" do
+    lambda { @io.pos = -10 }.should  raise_error(Errno::EINVAL)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/print_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/print_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/print_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,100 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "StringIO#print" do
+  before(:each) do
+    @io = StringIO.new('example')
+  end
+
+  it "prints $_ when passed no arguments" do
+    $_ = nil
+    @io.print
+    @io.string.should == "nilmple"
+
+    $_ = "blah"
+    @io.print
+    @io.string.should == "nilblah"
+  end
+
+  it "prints the passed arguments to self" do
+    @io.print(5, 6, 7, 8)
+    @io.string.should == "5678ple"
+  end
+  
+  it "tries to convert the passed Object to a String using #to_s" do
+    obj = mock("to_s")
+    obj.should_receive(:to_s).and_return("to_s")
+    @io.print(obj)
+    @io.string.should == "to_sple"
+  end
+  
+  it "returns nil" do
+    @io.print(1, 2, 3).should be_nil
+  end
+
+  it "pads self with \\000 when the current position is after the end" do
+    @io.pos = 10
+    @io.print(1, 2, 3)
+    @io.string.should == "example\000\000\000123"
+  end
+
+  it "honors the output record separator global" do
+    old_rs, $\ = $\, 'x'
+    
+    begin
+      @io.print(5, 6, 7, 8)
+      @io.string.should == '5678xle'
+    ensure
+      $\ = old_rs
+    end
+  end
+  
+  it "updates the current position" do
+    @io.print(1, 2, 3)
+    @io.pos.should eql(3)
+    
+    @io.print(1, 2, 3)
+    @io.pos.should eql(6)
+  end
+  
+  it "correctly updates the current position when honoring the output record separator global" do
+    old_rs, $\ = $\, 'x'
+    
+    begin
+      @io.print(5, 6, 7, 8)
+      @io.pos.should eql(5)
+    ensure
+      $\ = old_rs
+    end
+  end
+end
+
+describe "StringIO#print when in append mode" do
+  before(:each) do
+    @io = StringIO.new("example", "a")
+  end
+
+  it "appends the passed argument to the end of self" do
+    @io.print(", just testing")
+    @io.string.should == "example, just testing"
+    
+    @io.print(" and more testing")
+    @io.string.should == "example, just testing and more testing"
+  end
+
+  it "correctly updates self's position" do
+    @io.print(", testing")
+    @io.pos.should eql(16)
+  end
+end
+
+describe "StringIO#print when self is not writable" do
+  it "raises an IOError" do
+    io = StringIO.new("test", "r")
+    lambda { io.print("test") }.should raise_error(IOError)
+
+    io = StringIO.new("test")
+    io.close_write
+    lambda { io.print("test") }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/printf_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/printf_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/printf_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,61 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "StringIO#printf" do
+  before(:each) do
+    @io = StringIO.new('example')
+  end
+
+  it "returns nil" do
+    @io.printf("%d %04x", 123, 123).should be_nil
+  end
+
+  it "pads self with \\000 when the current position is after the end" do
+    @io.pos = 10
+    @io.printf("%d", 123)
+    @io.string.should == "example\000\000\000123"
+  end
+
+  it "performs format conversion" do
+    @io.printf("%d %04x", 123, 123)
+    @io.string.should == "123 007b"
+  end
+  
+  it "updates the current position" do
+    @io.printf("%d %04x", 123, 123)
+    @io.pos.should eql(8)
+    
+    @io.printf("%d %04x", 123, 123)
+    @io.pos.should eql(16)
+   end
+end
+
+describe "StringIO#printf when in append mode" do
+  before(:each) do
+    @io = StringIO.new("example", "a")
+  end
+
+  it "appends the passed argument to the end of self" do
+    @io.printf("%d %04x", 123, 123)
+    @io.string.should == "example123 007b"
+    
+    @io.printf("%d %04x", 123, 123)
+    @io.string.should == "example123 007b123 007b"
+  end
+
+  it "correctly updates self's position" do
+    @io.printf("%d %04x", 123, 123)
+    @io.pos.should eql(15)
+  end
+end
+
+describe "StringIO#printf when self is not writable" do
+  it "raises an IOError" do
+    io = StringIO.new("test", "r")
+    lambda { io.printf("test") }.should raise_error(IOError)
+
+    io = StringIO.new("test")
+    io.close_write
+    lambda { io.printf("test") }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/putc_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/putc_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/putc_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,88 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "StringIO#putc when passed [String]" do
+  before(:each) do
+    @io = StringIO.new('example')
+  end
+  
+  it "overwrites the character at the current position" do
+    @io.putc("t")
+    @io.string.should == "txample"
+    
+    @io.pos = 3
+    @io.putc("t")
+    @io.string.should == "txatple"
+  end
+  
+  it "only writes the first character from the passed String" do
+    @io.putc("test")
+    @io.string.should == "txample"
+  end
+  
+  it "returns the passed String" do
+    str = "test"
+    @io.putc(str).should equal(str)
+  end
+
+  it "correctly updates the current position" do
+    @io.putc("t")
+    @io.pos.should == 1
+    
+    @io.putc("test")
+    @io.pos.should == 2
+    
+    @io.putc("t")
+    @io.pos.should == 3
+  end
+end
+
+describe "StringIO#putc when passed [Object]" do
+  before(:each) do
+    @io = StringIO.new('example')
+  end
+
+  it "it writes the passed Integer % 256 to self" do
+    @io.putc(333) # 333 % 256 == ?M
+    @io.string.should == "Mxample"
+    
+    @io.putc(-450) # -450 % 256 == ?>
+    @io.string.should == "M>ample"
+  end
+
+  it "pads self with \\000 when the current position is after the end" do
+    @io.pos = 10
+    @io.putc(?A)
+    @io.string.should == "example\000\000\000A"
+  end
+
+  it "tries to convert the passed argument to an Integer using #to_int" do
+    obj = mock('to_int')
+    obj.should_receive(:to_int).and_return(?t)
+    @io.putc(obj)
+    @io.string.should == "txample"
+  end
+
+  it "raises a TypeError when the passed argument can't be coerced to Integer" do
+    lambda { @io.putc(Object.new) }.should raise_error(TypeError)
+  end
+end
+
+describe "StringIO#putc when in append mode" do
+  it "appends to the end of self" do
+    io = StringIO.new("test", "a")
+    io.putc(?t)
+    io.string.should == "testt"
+  end
+end
+
+describe "StringIO#putc when self is not writable" do
+  it "raises an IOError" do
+    io = StringIO.new("test", "r")
+    lambda { io.putc(?a) }.should raise_error(IOError)
+
+    io = StringIO.new("test")
+    io.close_write
+    lambda { io.putc("t") }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/puts_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/puts_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/puts_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,142 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "StringIO#puts when passed [Array, ...]" do
+  before(:each) do
+    @io = StringIO.new
+  end
+  
+  it "writes each element of the passed Array to self, separated by a newline" do
+    @io.puts([1, 2, 3, 4])
+    @io.string.should == "1\n2\n3\n4\n"
+  
+    @io.puts([1, 2], [3, 4])
+    @io.string.should == "1\n2\n3\n4\n1\n2\n3\n4\n"
+  end
+  
+  it "flattens nested Arrays" do
+    @io.puts([1, [2, [3, [4]]]])
+    @io.string.should == "1\n2\n3\n4\n"
+  end
+  
+  it "handles self-recursive arrays correctly" do
+    (ary = [5])
+    ary << ary
+    @io.puts(ary)
+    @io.string.should == "5\n[...]\n"
+  end
+
+  it "does not honor the global output record separator $\\" do
+    begin
+      old_rs, $\ = $\, "test"
+      @io.puts([1, 2, 3, 4])
+      @io.string.should == "1\n2\n3\n4\n"
+    ensure
+      $\ = old_rs
+    end
+  end
+  
+  it "first tries to convert each Array element to an Array using #to_ary" do
+    obj = mock("Object")
+    obj.should_receive(:to_ary).and_return(["to_ary"])
+    @io.puts([obj])
+    @io.string.should == "to_ary\n"
+  end
+  
+  it "then tries to convert each Array element to a String using #to_s" do
+    obj = mock("Object")
+    obj.should_receive(:to_s).and_return("to_s")
+    @io.puts([obj])
+    @io.string.should == "to_s\n"
+  end
+end
+
+describe "StringIO#puts when passed [Object, ...]" do
+  before(:each) do
+    @io = StringIO.new
+  end
+
+  it "does not honor the global output record separator $\\" do
+    begin
+      old_rs, $\ = $\, "test"
+      @io.puts(1, 2, 3, 4)
+      @io.string.should == "1\n2\n3\n4\n"
+    ensure
+      $\ = old_rs
+    end
+  end
+
+  it "does not put a \\n after each Objects that end in a newline" do
+    @io.puts("1\n", "2\n", "3\n")
+    @io.string.should == "1\n2\n3\n"
+  end
+  
+  it "first tries to convert each Object to an Array using #to_ary" do
+    obj = mock("Object")
+    obj.should_receive(:to_ary).and_return(["to_ary"])
+    @io.puts(obj)
+    @io.string.should == "to_ary\n"
+  end
+  
+  it "then tries to convert each Object to a String using #to_s" do
+    obj = mock("Object")
+    obj.should_receive(:to_s).and_return("to_s")
+    @io.puts(obj)
+    @io.string.should == "to_s\n"
+  end
+end
+
+describe "StringIO#puts when passed no arguments" do
+  before(:each) do
+    @io = StringIO.new
+  end
+
+  it "returns nil" do
+    @io.puts.should be_nil
+  end
+
+  it "prints a newline" do
+    @io.puts
+    @io.string.should == "\n"
+  end
+  
+  it "does not honor the global output record separator $\\" do
+    begin
+      old_rs, $\ = $\, "test"
+      @io.puts
+      @io.string.should == "\n"
+    ensure
+      $\ = old_rs
+    end
+  end
+end
+
+describe "StringIO#puts when in append mode" do
+  before(:each) do
+    @io = StringIO.new("example", "a")
+  end
+
+  it "appends the passed argument to the end of self" do
+    @io.puts(", just testing")
+    @io.string.should == "example, just testing\n"
+    
+    @io.puts(" and more testing")
+    @io.string.should == "example, just testing\n and more testing\n"
+  end
+
+  it "correctly updates self's position" do
+    @io.puts(", testing")
+    @io.pos.should eql(17)
+  end
+end
+
+describe "StringIO#puts when self is not writable" do
+  it "raises an IOError" do
+    io = StringIO.new("test", "r")
+    lambda { io.puts }.should raise_error(IOError)
+
+    io = StringIO.new("test")
+    io.close_write
+    lambda { io.puts }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/read_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/read_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/read_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require "stringio"
+require File.dirname(__FILE__) + '/shared/read'
+
+describe "StringIO#read when passed length, buffer" do
+  it_behaves_like :stringio_read, :read
+end
+
+describe "StringIO#read when passed [length]" do
+  it_behaves_like :stringio_read_length, :read
+end
+
+describe "StringIO#read when passed no arguments" do
+  it_behaves_like :stringio_read_no_arguments, :read
+end
+
+describe "StringIO#read when self is not readable" do
+  it_behaves_like :stringio_read_not_readable, :read
+end
+
+describe "StringIO#read when passed [length]" do
+  before(:each) do
+    @io = StringIO.new("example")
+  end
+  
+  it "returns nil when self's position is at the end" do
+    @io.pos = 7
+    @io.read(10).should be_nil
+  end
+
+  it "returns an empty String when length is 0" do
+    @io.read(0).should == ""
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/readbyte_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/readbyte_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/readbyte_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'stringio'
+require File.dirname(__FILE__) + "/shared/readchar"
+
+ruby_version_is "1.8.7" do
+  describe "StringIO#readbyte" do
+    it_behaves_like :stringio_readchar, :readbyte
+  end
+
+  describe "StringIO#readbyte when self is not readable" do
+    it_behaves_like :stringio_readchar_not_readable, :readbyte
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/readchar_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/readchar_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/readchar_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'stringio'
+require File.dirname(__FILE__) + "/shared/readchar"
+
+describe "StringIO#readchar" do
+  it_behaves_like :stringio_readchar, :readchar
+end
+
+describe "StringIO#readchar when self is not readable" do
+  it_behaves_like :stringio_readchar_not_readable, :readchar
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/readline_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/readline_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/readline_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,126 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+
+describe "StringIO#readline when passed [separator]" do
+  before(:each) do
+    @io = StringIO.new("this>is>an>example")
+  end
+
+  it "returns the data read till the next occurence of the passed separator" do
+    @io.readline(">").should == "this>"
+    @io.readline(">").should == "is>"
+    @io.readline(">").should == "an>"
+    @io.readline(">").should == "example"
+  end
+  
+  ruby_bug "http://redmine.ruby-lang.org/issues/show/159", "1.8.7.17" do
+    it "sets $_ to the read content" do
+      @io.readline(">")
+      $_.should == "this>"
+      @io.readline(">")
+      $_.should == "is>"
+      @io.readline(">")
+      $_.should == "an>"
+      @io.readline(">")
+      $_.should == "example"
+    end
+  end
+
+  it "updates self's lineno by one" do
+    @io.readline(">")
+    @io.lineno.should eql(1)
+    
+    @io.readline(">")
+    @io.lineno.should eql(2)
+    
+    @io.readline(">")
+    @io.lineno.should eql(3)
+  end
+  
+  it "returns the next paragraph when the passed separator is an empty String" do
+    io = StringIO.new("this is\n\nan example")
+    io.readline("").should == "this is\n"
+    io.readline("").should == "an example"
+  end
+  
+  it "returns the remaining content starting at the current position when passed nil" do
+    io = StringIO.new("this is\n\nan example")
+    io.pos = 5
+    io.readline(nil).should == "is\n\nan example"
+  end
+
+  it "tries to convert the passed separator to a String using #to_str" do
+    obj = mock('to_str')
+    obj.should_receive(:to_str).and_return(">")
+    @io.readline(obj).should == "this>"
+  end
+end
+
+describe "StringIO#readline when passed no argument" do
+  before(:each) do
+    @io = StringIO.new("this is\nan example\nfor StringIO#readline")
+  end
+  
+  it "returns the data read till the next occurence of $/ or till eof" do
+    @io.readline.should == "this is\n"
+    
+    begin
+      old_sep, $/ = $/, " "
+      @io.readline.should == "an "
+      @io.readline.should == "example\nfor "
+      @io.readline.should == "StringIO#readline"
+    ensure
+      $/ = old_sep
+    end
+  end
+
+  ruby_bug "http://redmine.ruby-lang.org/issues/show/159", "1.8.7.17" do
+    it "sets $_ to the read content" do
+      @io.readline
+      $_.should == "this is\n"
+      @io.readline
+      $_.should == "an example\n"
+      @io.readline
+      $_.should == "for StringIO#readline"
+    end
+  end
+
+  it "updates self's position" do
+    @io.readline
+    @io.pos.should eql(8)
+    
+    @io.readline
+    @io.pos.should eql(19)
+
+    @io.readline
+    @io.pos.should eql(40)
+  end
+  
+  it "updates self's lineno" do
+    @io.readline
+    @io.lineno.should eql(1)
+    
+    @io.readline
+    @io.lineno.should eql(2)
+    
+    @io.readline
+    @io.lineno.should eql(3)
+  end
+
+  it "raises an IOError if self is at the end" do
+    @io.pos = 40
+    lambda { @io.readline }.should raise_error(IOError)
+  end
+end
+
+describe "StringIO#readline when in write-only mode" do
+  it "raises an IOError" do
+    io = StringIO.new("xyz", "w")
+    lambda { io.readline }.should raise_error(IOError)
+
+    io = StringIO.new("xyz")
+    io.close_read
+    lambda { io.readline }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/readlines_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/readlines_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/readlines_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,92 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "StringIO#readlines when passed [separator]" do
+  before(:each) do
+    @io = StringIO.new("this>is>an>example")
+  end
+
+  it "returns an Array containing lines based on the passed separator" do
+    @io.readlines(">").should == ["this>", "is>", "an>", "example"]
+  end
+
+  it "updates self's position based on the number of read bytes" do
+    @io.readlines(">")
+    @io.pos.should eql(18)
+  end
+
+  it "updates self's lineno based on the number of read lines" do
+    @io.readlines(">")
+    @io.lineno.should eql(4)
+  end
+
+  it "does not change $_" do
+    $_ = "test"
+    @io.readlines(">")
+    $_.should == "test"
+  end
+
+  it "returns an Array containing all paragraphs when the passed separator is an empty String" do
+    io = StringIO.new("this is\n\nan example")
+    io.readlines("").should == ["this is\n", "an example"]
+  end
+  
+  it "returns the remaining content as one line starting at the current position when passed nil" do
+    io = StringIO.new("this is\n\nan example")
+    io.pos = 5
+    io.readlines(nil).should == ["is\n\nan example"]
+  end
+
+  it "tries to convert the passed separator to a String using #to_str" do
+    obj = mock('to_str')
+    obj.stub!(:to_str).and_return(">")
+    @io.readlines(obj).should == ["this>", "is>", "an>", "example"]
+  end
+end
+
+describe "StringIO#readlines when passed no argument" do
+  before(:each) do
+    @io = StringIO.new("this is\nan example\nfor StringIO#readlines")
+  end
+  
+  it "returns an Array containing lines based on $/" do
+    begin
+      old_sep, $/ = $/, " "
+      @io.readlines.should == ["this ", "is\nan ", "example\nfor ", "StringIO#readlines"]
+    ensure
+      $/ = old_sep
+    end
+  end
+  
+  it "updates self's position based on the number of read bytes" do
+    @io.readlines
+    @io.pos.should eql(41)
+  end
+  
+  it "updates self's lineno based on the number of read lines" do
+    @io.readlines
+    @io.lineno.should eql(3)
+  end
+
+  it "does not change $_" do
+    $_ = "test"
+    @io.readlines(">")
+    $_.should == "test"
+  end
+  
+  it "returns an empty Array when self is at the end" do
+    @io.pos = 41
+    @io.readlines.should == []
+  end
+end
+
+describe "StringIO#readlines when in write-only mode" do
+  it "raises an IOError" do
+    io = StringIO.new("xyz", "w")
+    lambda { io.readlines }.should raise_error(IOError)
+
+    io = StringIO.new("xyz")
+    io.close_read
+    lambda { io.readlines }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/reopen_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/reopen_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/reopen_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,296 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "StringIO#reopen when passed [Object, Integer]" do
+  before(:each) do
+    @io = StringIO.new("example")
+  end
+
+  it "reopens self with the passed Object in the passed mode" do
+    @io.reopen("reopened", IO::RDONLY)
+    @io.closed_read?.should be_false
+    @io.closed_write?.should be_true
+    @io.string.should == "reopened"
+
+    @io.reopen("reopened, twice", IO::WRONLY)
+    @io.closed_read?.should be_true
+    @io.closed_write?.should be_false
+    @io.string.should == "reopened, twice"
+
+    @io.reopen("reopened, another time", IO::RDWR)
+    @io.closed_read?.should be_false
+    @io.closed_write?.should be_false
+    @io.string.should == "reopened, another time"
+  end
+
+  # NOTE: WEIRD!
+  it "does not taint self when the passed Object was tainted" do
+    @io.reopen("reopened".taint, IO::RDONLY)
+    @io.tainted?.should be_false
+
+    @io.reopen("reopened".taint, IO::WRONLY)
+    @io.tainted?.should be_false
+  end
+
+  it "tries to convert the passed Object to a String using #to_str" do
+    obj = mock("to_str")
+    obj.should_receive(:to_str).and_return("to_str")
+    @io.reopen(obj, IO::RDWR)
+    @io.string.should == "to_str"
+  end
+
+  it "raises a TypeError when the passed Object can't be converted to a String" do
+    lambda { @io.reopen(Object.new, IO::RDWR) }.should raise_error(TypeError)
+  end
+
+  it "raises an Errno::EACCES when trying to reopen self with a frozen String in write-mode" do
+    lambda { @io.reopen("burn".freeze, IO::WRONLY) }.should raise_error(Errno::EACCES)
+    lambda { @io.reopen("burn".freeze, IO::WRONLY | IO::APPEND) }.should raise_error(Errno::EACCES)
+  end
+
+  it "raises a TypeError when trying to reopen self with a frozen String in truncate-mode" do
+    lambda { @io.reopen("burn".freeze, IO::RDONLY | IO::TRUNC) }.should raise_error(TypeError)
+  end
+
+  it "does not raise IOError when passed a frozen String in read-mode" do
+    @io.reopen("burn".freeze, IO::RDONLY)
+    @io.string.should == "burn"
+  end
+end
+
+describe "StringIO#reopen when passed [Object, Object]" do
+  before(:each) do
+    @io = StringIO.new("example")
+  end
+
+  it "reopens self with the passed Object in the passed mode" do
+    @io.reopen("reopened", "r")
+    @io.closed_read?.should be_false
+    @io.closed_write?.should be_true
+    @io.string.should == "reopened"
+
+    @io.reopen("reopened, twice", "r+")
+    @io.closed_read?.should be_false
+    @io.closed_write?.should be_false
+    @io.string.should == "reopened, twice"
+
+    @io.reopen("reopened, another", "w+")
+    @io.closed_read?.should be_false
+    @io.closed_write?.should be_false
+    @io.string.should == ""
+
+    @io.reopen("reopened, another time", "r+")
+    @io.closed_read?.should be_false
+    @io.closed_write?.should be_false
+    @io.string.should == "reopened, another time"
+  end
+
+  it "truncates the passed String when opened in truncate mode" do
+    @io.reopen(str = "reopened", "w")
+    str.should == ""
+  end
+
+  # NOTE: WEIRD!
+  it "does not taint self when the passed Object was tainted" do
+    @io.reopen("reopened".taint, "r")
+    @io.tainted?.should be_false
+
+    @io.reopen("reopened".taint, "w")
+    @io.tainted?.should be_false
+  end
+
+  it "tries to convert the passed Object to a String using #to_str" do
+    obj = mock("to_str")
+    obj.should_receive(:to_str).and_return("to_str")
+    @io.reopen(obj, "r")
+    @io.string.should == "to_str"
+  end
+
+  it "raises a TypeError when the passed Object can't be converted to a String using #to_str" do
+    lambda { @io.reopen(Object.new, "r") }.should raise_error(TypeError)
+  end
+
+  ruby_bug "#", "1.8.7" do
+    it "resets self's position to 0" do
+      @io.read(5)
+      @io.reopen("reopened")
+      @io.pos.should eql(0)
+    end
+
+    it "resets self's line number to 0" do
+      @io.gets
+      @io.reopen("reopened")
+      @io.lineno.should eql(0)
+    end
+  end
+
+  it "tries to convert the passed mode Object to an Integer using #to_str" do
+    obj = mock("to_str")
+    obj.should_receive(:to_str).and_return("r")
+    @io.reopen("reopened", obj)
+    @io.closed_read?.should be_false
+    @io.closed_write?.should be_true
+    @io.string.should == "reopened"
+  end
+
+  it "raises an Errno::EACCES error when trying to reopen self with a frozen String in write-mode" do
+    lambda { @io.reopen("burn".freeze, 'w') }.should raise_error(Errno::EACCES)
+    lambda { @io.reopen("burn".freeze, 'w+') }.should raise_error(Errno::EACCES)
+    lambda { @io.reopen("burn".freeze, 'a') }.should raise_error(Errno::EACCES)
+    lambda { @io.reopen("burn".freeze, "r+") }.should raise_error(Errno::EACCES)
+  end
+
+  it "does not raise IOError if a frozen string is passed in read mode" do
+    @io.reopen("burn".freeze, "r")
+    @io.string.should == "burn"
+  end
+end
+
+describe "StringIO#reopen when passed [String]" do
+  before(:each) do
+    @io = StringIO.new("example")
+  end
+
+  it "reopens self with the passed String in read-write mode" do
+    @io.close
+
+    @io.reopen("reopened")
+
+    @io.closed_write?.should be_false
+    @io.closed_read?.should be_false
+
+    @io.string.should == "reopened"
+  end
+
+  # NOTE: WEIRD!
+  it "does not taint self when the passed Object was tainted" do
+    @io.reopen("reopened".taint)
+    @io.tainted?.should be_false
+  end
+
+  ruby_bug "#", "1.8.7" do
+    it "resets self's position to 0" do
+      @io.read(5)
+      @io.reopen("reopened")
+      @io.pos.should eql(0)
+    end
+
+    it "resets self's line number to 0" do
+      @io.gets
+      @io.reopen("reopened")
+      @io.lineno.should eql(0)
+    end
+  end
+end
+
+describe "StringIO#reopen when passed [Object]" do
+  before(:each) do
+    @io = StringIO.new("example")
+  end
+
+  it "raises a TypeError when passed an Object that can't be converted to a StringIO" do
+    lambda { @io.reopen(Object.new) }.should raise_error(TypeError)
+  end
+
+  it "does not try to convert the passed Object to a String using #to_str" do
+    obj = mock("not to_str")
+    obj.should_not_receive(:to_str)
+    lambda { @io.reopen(obj) }.should raise_error(TypeError)
+  end
+
+  it "tries to convert the passed Object to a StringIO using #to_strio" do
+    obj = mock("to_strio")
+    obj.should_receive(:to_strio).and_return(StringIO.new("to_strio"))
+    @io.reopen(obj)
+    @io.string.should == "to_strio"
+  end
+
+  # NOTE: WEIRD!
+  it "taints self when the passed Object was tainted" do
+    @io.reopen(StringIO.new("reopened").taint)
+    @io.tainted?.should be_true
+  end
+end
+
+describe "StringIO#reopen when passed no arguments" do
+  before(:each) do
+    @io = StringIO.new("example\nsecond line")
+  end
+
+  it "resets self's mode to read-write" do
+    @io.close
+    @io.reopen
+    @io.closed_read?.should be_false
+    @io.closed_write?.should be_false
+  end
+
+  ruby_bug "#", "1.8.7" do
+    it "resets self's position to 0" do
+      @io.read(5)
+      @io.reopen
+      @io.pos.should eql(0)
+    end
+
+    it "resets self's line number to 0" do
+      @io.gets
+      @io.reopen
+      @io.lineno.should eql(0)
+    end
+  end
+end
+
+# NOTE: Some reopen specs disabled due to MRI bugs. See:
+# http://rubyforge.org/tracker/index.php?func=detail&aid=13919&group_id=426&atid=1698
+# for details.
+describe "StringIO#reopen" do
+  before(:each) do
+    @io = StringIO.new('hello','a')
+  end
+
+  # TODO: find out if this is really a bug
+  ruby_bug "#", "1.8.6.114" do
+    it "reopens a stream when given a String argument" do
+      @io.reopen('goodbye').should == @io
+      @io.string.should == 'goodbye'
+      @io << 'x'
+      @io.string.should == 'xoodbye'
+    end
+
+    it "reopens a stream in append mode when flagged as such" do
+      @io.reopen('goodbye', 'a').should == @io
+      @io.string.should == 'goodbye'
+      @io << 'x'
+      @io.string.should == 'goodbyex'
+    end
+
+    it "reopens and truncate when reopened in write mode" do
+      @io.reopen('goodbye', 'wb').should == @io
+      @io.string.should == ''
+      @io << 'x'
+      @io.string.should == 'x'
+    end
+
+    it "truncates the given string, not a copy" do
+      str = 'goodbye'
+      @io.reopen(str, 'w')
+      @io.string.should == ''
+      str.should == ''
+    end
+  end
+
+  it "taints self if the provided StringIO argument is tainted" do
+    new_io = StringIO.new("tainted")
+    new_io.taint
+    @io.reopen(new_io)
+    @io.tainted?.should == true
+  end
+
+  it "does not truncate the content even when the StringIO argument is in the truncate mode" do
+    orig_io = StringIO.new("Original StringIO", IO::RDWR|IO::TRUNC)
+    orig_io.write("BLAH") # make sure the content is not empty
+
+    @io.reopen(orig_io)
+    @io.string.should == "BLAH"
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/rewind_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/rewind_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/rewind_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "StringIO#rewind" do
+  before(:each) do
+    @io = StringIO.new("hello\nworld")
+    @io.pos = 3
+    @io.lineno = 1
+  end
+  
+  it "returns 0" do
+    @io.rewind.should eql(0)
+  end
+
+  it "resets the position" do
+    @io.rewind
+    @io.pos.should == 0
+  end
+
+  it "resets the line number" do
+    @io.rewind
+    @io.lineno.should == 0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/seek_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/seek_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/seek_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,69 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "StringIO#seek" do
+  before(:each) do
+    @io = StringIO.new("12345678")
+  end
+  
+  it "seeks from the current position when whence is IO::SEEK_CUR" do
+    @io.pos = 1
+    @io.seek(1, IO::SEEK_CUR)
+    @io.pos.should eql(2)
+    
+    @io.seek(-1, IO::SEEK_CUR)
+    @io.pos.should eql(1)
+  end
+
+  it "seeks from the end of self when whence is IO::SEEK_END" do
+    @io.seek(3, IO::SEEK_END)
+    @io.pos.should eql(11) # Outside of the StringIO's content
+    
+    @io.seek(-2, IO::SEEK_END)
+    @io.pos.should eql(6)
+  end
+
+  it "seeks to an absolute position when whence is IO::SEEK_SET" do
+    @io.seek(5, IO::SEEK_SET)
+    @io.pos.should == 5
+    
+    @io.pos = 3
+    @io.seek(5, IO::SEEK_SET)
+    @io.pos.should == 5
+  end
+  
+  it "raises an Errno::EINVAL error on negative amounts when whence is IO::SEEK_SET" do
+    lambda { @io.seek(-5, IO::SEEK_SET) }.should raise_error(Errno::EINVAL)
+  end
+
+  it "tries to convert the passed Object to a String using #to_int" do
+    obj = mock("to_int")
+    obj.should_receive(:to_int).and_return(2)
+    @io.seek(obj)
+    @io.pos.should eql(2)
+  end
+  
+  it "raises a TypeError when the passed Object can't be converted to an Integer" do
+    lambda { @io.seek(Object.new) }.should raise_error(TypeError)
+  end
+end
+
+describe "StringIO#seek when self is closed" do
+  before(:each) do
+    @io = StringIO.new("example")
+    @io.close
+  end
+  
+  ruby_version_is "" ... "1.8.7" do
+    it "does not raise an IOError" do
+      @io.seek(5)
+      @io.pos.should eql(5)
+    end
+  end
+  
+  ruby_version_is "1.8.7" do
+    it "raises an IOError" do
+      lambda { @io.seek(5) }.should raise_error(IOError)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/shared/each.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/shared/each.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/shared/each.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,113 @@
+describe :stringio_each_separator, :shared => true do
+  before(:each) do
+    @io = StringIO.new("a b c d e\n1 2 3 4 5")
+  end
+
+  it "uses the passed argument as the line separator" do
+    seen = []
+    @io.send(@method, " ") {|s| seen << s}
+    seen.should == ["a ", "b ", "c ", "d ", "e\n1 ", "2 ", "3 ", "4 ", "5"]
+  end
+
+  it "does not change $_" do
+    $_ = "test"
+    @io.send(@method, " ") { |s| s}
+    $_.should == "test"
+  end
+
+  it "returns self" do
+    @io.send(@method) {|l| l }.should equal(@io)
+  end
+
+  it "tries to convert the passed separator to a String using #to_str" do
+    obj = mock("to_str")
+    obj.stub!(:to_str).and_return(" ")
+
+    seen = []
+    @io.send(@method, obj) { |l| seen << l }
+    seen.should == ["a ", "b ", "c ", "d ", "e\n1 ", "2 ", "3 ", "4 ", "5"]
+  end
+
+  it "yields self's content starting from the current position when the passed separator is nil" do
+    seen = []
+    io = StringIO.new("1 2 1 2 1 2")
+    io.pos = 2
+    io.send(@method, nil) {|s| seen << s}
+    seen.should == ["2 1 2 1 2"]
+  end
+
+  it "yields each paragraph when passed an empty String as separator" do
+    seen = []
+    io = StringIO.new("para1\n\npara2\n\n\npara3")
+    io.send(@method, "") {|s| seen << s}
+    seen.should == ["para1\n", "para2\n", "para3"]
+  end
+end
+
+describe :stringio_each_no_arguments, :shared => true do
+  before(:each) do
+    @io = StringIO.new("a b c d e\n1 2 3 4 5")
+  end
+
+  it "yields each line to the passed block" do
+    seen = []
+    @io.send(@method) {|s| seen << s }
+    seen.should == ["a b c d e\n", "1 2 3 4 5"]
+  end
+
+  it "yields each line starting from the current position" do
+    seen = []
+    @io.pos = 4
+    @io.send(@method) {|s| seen << s }
+    seen.should == ["c d e\n", "1 2 3 4 5"]
+  end
+
+  it "does not change $_" do
+    $_ = "test"
+    @io.send(@method) { |s| s}
+    $_.should == "test"
+  end
+
+  it "uses $/ as the default line separator" do
+    seen = []
+    begin
+      old_rs, $/ = $/, " "
+      @io.send(@method) {|s| seen << s }
+      seen.should eql(["a ", "b ", "c ", "d ", "e\n1 ", "2 ", "3 ", "4 ", "5"])
+    ensure
+      $/ = old_rs
+    end
+  end
+
+  it "returns self" do
+    @io.send(@method) {|l| l }.should equal(@io)
+  end
+
+  ruby_version_is "" ... "1.8.7" do
+    it "yields a LocalJumpError when passed no block" do
+      lambda { @io.send(@method) }.should raise_error(LocalJumpError)
+    end
+  end
+
+  ruby_version_is "1.8.7" do
+    it "returns an Enumerator when passed no block" do
+      enum = @io.send(@method)
+      enum.instance_of?(Enumerable::Enumerator).should be_true
+
+      seen = []
+      enum.each { |b| seen << b }
+      seen.should == ["a b c d e\n", "1 2 3 4 5"]
+    end
+  end
+end
+
+describe :stringio_each_not_readable, :shared => true do
+  it "raises an IOError" do
+    io = StringIO.new("a b c d e", "w")
+    lambda { io.send(@method) { |b| b } }.should raise_error(IOError)
+
+    io = StringIO.new("a b c d e")
+    io.close_read
+    lambda { io.send(@method) { |b| b } }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/shared/each_byte.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/shared/each_byte.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/shared/each_byte.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,60 @@
+describe :stringio_each_byte, :shared => true do
+  before(:each) do
+    @io = StringIO.new("xyz")
+  end
+
+  it "yields each character code in turn" do
+    seen = []
+    @io.send(@method) { |b| seen << b }
+    seen.should == [120, 121, 122]
+  end
+
+  it "updates the position before each yield" do
+    seen = []
+    @io.send(@method) { |b| seen << @io.pos }
+    seen.should == [1, 2, 3]
+  end
+
+  it "does not yield if the current position is out of bounds" do
+    @io.pos = 1000
+    seen = nil
+    @io.send(@method) { |b| seen = b }
+    seen.should be_nil
+  end
+
+  ruby_version_is "" ... "1.8.7" do
+    it "returns nil" do
+      @io.send(@method) {}.should be_nil
+    end
+
+    it "yields a LocalJumpError when passed no block" do
+      lambda { @io.send(@method) }.should raise_error(LocalJumpError)
+    end
+  end
+
+  ruby_version_is "1.8.7" do
+    it "returns self" do
+      @io.send(@method) {}.should equal(@io)
+    end
+
+    it "returns an Enumerator when passed no block" do
+      enum = @io.send(@method)
+      enum.instance_of?(Enumerable::Enumerator).should be_true
+
+      seen = []
+      enum.each { |b| seen << b }
+      seen.should == [120, 121, 122]
+    end
+  end
+end
+
+describe :stringio_each_byte_not_readable, :shared => true do
+  it "raises an IOError" do
+    io = StringIO.new("xyz", "w")
+    lambda { io.send(@method) { |b| b } }.should raise_error(IOError)
+
+    io = StringIO.new("xyz")
+    io.close_read
+    lambda { io.send(@method) { |b| b } }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/shared/each_char.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/shared/each_char.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/shared/each_char.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,49 @@
+describe :stringio_each_char, :shared => true do
+  before(:each) do
+    old_kcode, $KCODE = "UTF-8", $KCODE
+    @io = StringIO.new("xyz äöü")
+    $KCODE = old_kcode
+  end
+
+  it "yields each character code in turn" do
+    seen = []
+    @io.send(@method) { |c| seen << c }
+    seen.should == ["x", "y", "z", " ", "ä", "ö", "ü"]
+  end
+
+  ruby_version_is "" ... "1.8.7" do
+    it "returns nil" do
+      @io.send(@method) {}.should be_nil
+    end
+
+    it "yields a LocalJumpError when passed no block" do
+      lambda { @io.send(@method) }.should raise_error(LocalJumpError)
+    end
+  end
+
+  ruby_version_is "1.8.7" do
+    it "returns self" do
+      @io.send(@method) {}.should equal(@io)
+    end
+
+    it "returns an Enumerator when passed no block" do
+      enum = @io.send(@method)
+      enum.instance_of?(Enumerable::Enumerator).should be_true
+
+      seen = []
+      enum.each { |c| seen << c }
+      seen.should == ["x", "y", "z", " ", "ä", "ö", "ü"]
+    end
+  end
+end
+
+describe :stringio_each_char_not_readable, :shared => true do
+  it "raises an IOError" do
+    io = StringIO.new("xyz", "w")
+    lambda { io.send(@method) { |b| b } }.should raise_error(IOError)
+
+    io = StringIO.new("xyz")
+    io.close_read
+    lambda { io.send(@method) { |b| b } }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/shared/eof.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/shared/eof.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/shared/eof.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+describe :stringio_eof, :shared => true do
+  before(:each) do
+    @io = StringIO.new("eof")
+  end
+
+  it "returns true when self's position is greater than or equal to self's size" do
+    @io.pos = 3
+    @io.send(@method).should be_true
+
+    @io.pos = 6
+    @io.send(@method).should be_true
+  end
+
+  it "returns false when self's position is less than self's size" do
+    @io.pos = 0
+    @io.send(@method).should be_false
+
+    @io.pos = 1
+    @io.send(@method).should be_false
+
+    @io.pos = 2
+    @io.send(@method).should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/shared/getc.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/shared/getc.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/shared/getc.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,49 @@
+describe :stringio_getc, :shared => true do
+  before(:each) do
+    @io = StringIO.new("example")
+  end
+
+  it "increases self's position by one" do
+    @io.send(@method)
+    @io.pos.should eql(1)
+
+    @io.send(@method)
+    @io.pos.should eql(2)
+
+    @io.send(@method)
+    @io.pos.should eql(3)
+  end
+
+  it "returns the 8-bit byte at the current position" do
+    @io.send(@method).should == ?e
+    @io.send(@method).should == ?x
+    @io.send(@method).should == ?a
+  end
+
+  it "returns nil when called at the end of self" do
+    @io.pos = 7
+    @io.send(@method).should be_nil
+    @io.send(@method).should be_nil
+    @io.send(@method).should be_nil
+  end
+
+  it "does not increase self's position when called at the end of file" do
+    @io.pos = 7
+    @io.send(@method)
+    @io.pos.should eql(7)
+
+    @io.send(@method)
+    @io.pos.should eql(7)
+  end
+end
+
+describe :stringio_getc_not_readable, :shared => true do
+  it "raises an IOError" do
+    io = StringIO.new("xyz", "w")
+    lambda { io.send(@method) }.should raise_error(IOError)
+
+    io = StringIO.new("xyz")
+    io.close_read
+    lambda { io.send(@method) }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/shared/isatty.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/shared/isatty.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/shared/isatty.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+describe :stringio_isatty, :shared => true do
+  it "returns false" do
+    StringIO.new('tty').send(@method).should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/shared/length.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/shared/length.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/shared/length.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+describe :stringio_length, :shared => true do
+  it "returns the length of the wrapped string" do
+    StringIO.new("example").send(@method).should == 7
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/shared/read.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/shared/read.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/shared/read.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,99 @@
+describe :stringio_read, :shared => true do
+  before(:each) do
+    @io = StringIO.new("example")
+  end
+
+  it "returns the passed buffer String" do
+    # Note: Rubinius bug:
+    # @io.send(@method, 7, buffer = "").should equal(buffer)
+    ret = @io.send(@method, 7, buffer = "")
+    ret.should equal(buffer)
+  end
+
+  it "reads length bytes and writes them to the buffer String" do
+    @io.send(@method, 7, buffer = "")
+    buffer.should == "example"
+  end
+
+  it "tries to convert the passed buffer Object to a String using #to_str" do
+    obj = mock("to_str")
+    obj.should_receive(:to_str).and_return(buffer = "")
+
+    @io.send(@method, 7, obj)
+    buffer.should == "example"
+  end
+
+  it "raises a TypeError when the passed buffer Object can't be converted to a String" do
+    lambda { @io.send(@method, 7, Object.new) }.should raise_error(TypeError)
+  end
+
+  it "raises an error when passed a frozen String as buffer" do
+    lambda { @io.send(@method, 7, "".freeze) }.should raise_error(TypeError)
+  end
+end
+
+describe :stringio_read_length, :shared => true do
+  before(:each) do
+    @io = StringIO.new("example")
+  end
+
+  it "reads length bytes from the current position and returns them" do
+    @io.pos = 3
+    @io.send(@method, 4).should == "mple"
+  end
+
+  it "reads at most the whole content" do
+    @io.send(@method, 999).should == "example"
+  end
+
+  it "correctly updates the position" do
+    @io.send(@method, 3)
+    @io.pos.should eql(3)
+
+    @io.send(@method, 999)
+    @io.pos.should eql(7)
+  end
+
+  it "tries to convert the passed length to an Integer using #to_int" do
+    obj = mock("to_int")
+    obj.should_receive(:to_int).and_return(7)
+    @io.send(@method, obj).should == "example"
+  end
+
+  it "raises a TypeError when the passed length can't be converted to an Integer" do
+    lambda { @io.send(@method, Object.new) }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError when the passed length is negative" do
+    lambda { @io.send(@method, -2) }.should raise_error(ArgumentError)
+  end
+end
+
+describe :stringio_read_no_arguments, :shared => true do
+  before(:each) do
+    @io = StringIO.new("example")
+  end
+
+  it "reads the whole content starting from the current position" do
+    @io.send(@method).should == "example"
+
+    @io.pos = 3
+    @io.send(@method).should == "mple"
+  end
+
+  it "correctly updates the current position" do
+    @io.send(@method)
+    @io.pos.should eql(7)
+  end
+end
+
+describe :stringio_read_not_readable, :shared => true do
+  it "raises an IOError" do
+    io = StringIO.new("test", "w")
+    lambda { io.send(@method) }.should raise_error(IOError)
+
+    io = StringIO.new("test")
+    io.close_read
+    lambda { io.send(@method) }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/shared/readchar.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/shared/readchar.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/shared/readchar.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,36 @@
+describe :stringio_readchar, :shared => true do
+  before(:each) do
+    @io = StringIO.new("example")
+  end
+
+  it "reads the next 8-bit byte from self's current position" do
+    @io.send(@method).should == ?e
+
+    @io.pos = 4
+    @io.send(@method).should == ?p
+  end
+
+  it "correctly updates the current position" do
+    @io.send(@method)
+    @io.pos.should == 1
+
+    @io.send(@method)
+    @io.pos.should == 2
+  end
+
+  it "raises an EOFError when self is at the end" do
+    @io.pos = 7
+    lambda { @io.send(@method) }.should raise_error(EOFError)
+  end
+end
+
+describe :stringio_readchar_not_readable, :shared => true do
+  it "raises an IOError" do
+    io = StringIO.new("a b c d e", "w")
+    lambda { io.send(@method) }.should raise_error(IOError)
+
+    io = StringIO.new("a b c d e")
+    io.close_read
+    lambda { io.send(@method) }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/shared/tell.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/shared/tell.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/shared/tell.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+describe :stringio_tell, :shared => true do
+  before(:each) do
+    @io = StringIOSpecs.build
+  end
+
+  it "returns the current byte offset" do
+    @io.getc
+    @io.send(@method).should == 1
+    @io.read(7)
+    @io.send(@method).should == 8
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/shared/write.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/shared/write.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/shared/write.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,87 @@
+describe :stringio_write, :shared => true do
+  before(:each) do
+    @io = StringIO.new('12345')
+  end
+
+  it "tries to convert the passed Object to a String using #to_s" do
+    obj = mock("to_s")
+    obj.should_receive(:to_s).and_return("to_s")
+    @io.send(@method, obj)
+    @io.string.should == "to_s5"
+  end
+end
+
+describe :stringio_write_string, :shared => true do
+  before(:each) do
+    @io = StringIO.new('12345')
+  end
+
+  # TODO: RDoc says that #write appends at the current position.
+  it "writes the passed String at the current buffer position" do
+    @io.pos = 2
+    @io.send(@method, 'x').should == 1
+    @io.string.should == '12x45'
+    @io.send(@method, 7).should == 1
+    @io.string.should == '12x75'
+  end
+
+  it "pads self with \\000 when the current position is after the end" do
+    @io.pos = 8
+    @io.send(@method, 'x')
+    @io.string.should == "12345\000\000\000x"
+    @io.send(@method, 9)
+    @io.string.should == "12345\000\000\000x9"
+  end
+
+  it "returns the number of bytes written" do
+    @io.send(@method, '').should == 0
+    @io.send(@method, nil).should == 0
+    str = "1" * 100
+    @io.send(@method, str).should == 100
+  end
+
+  it "updates self's position" do
+    @io.send(@method, 'test')
+    @io.pos.should eql(4)
+  end
+
+  it "taints self's String when the passed argument is tainted" do
+    @io.send(@method, "test".taint)
+    @io.string.tainted?.should be_true
+  end
+
+  it "does not taint self when the passed argument is tainted" do
+    @io.send(@method, "test".taint)
+    @io.tainted?.should be_false
+  end
+end
+
+describe :stringio_write_not_writable, :shared => true do
+  it "raises an IOError" do
+    io = StringIO.new("test", "r")
+    lambda { io.send(@method, "test") }.should raise_error(IOError)
+
+    io = StringIO.new("test")
+    io.close_write
+    lambda { io.send(@method, "test") }.should raise_error(IOError)
+  end
+end
+
+describe :stringio_write_append, :shared => true do
+  before(:each) do
+    @io = StringIO.new("example", "a")
+  end
+
+  it "appends the passed argument to the end of self" do
+    @io.send(@method, ", just testing")
+    @io.string.should == "example, just testing"
+
+    @io.send(@method, " and more testing")
+    @io.string.should == "example, just testing and more testing"
+  end
+
+  it "correctly updates self's position" do
+    @io.send(@method, ", testing")
+    @io.pos.should eql(16)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/length'
+
+describe "StringIO#size" do
+  it_behaves_like :stringio_length, :size
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/string_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/string_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/string_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,50 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "StringIO#string" do
+  it "returns the underlying string" do
+    io = StringIO.new(str = "hello")
+    io.string.should equal(str)
+  end
+end
+
+describe "StringIO#string=" do
+  before(:each) do
+    @io = StringIO.new("example\nstring")
+  end
+
+  it "returns the passed String" do
+    str = "test"
+    (@io.string = str).should equal(str)
+  end
+  
+  it "changes the underlying string" do
+    str = "hello"
+    @io.string = str
+    @io.string.should equal(str)
+  end
+
+  it "resets the position" do
+    @io.pos = 1
+    @io.string = "other"
+    @io.pos.should eql(0)
+  end
+
+  it "resets the line number" do
+    @io.lineno = 1
+    @io.string = "other"
+    @io.lineno.should eql(0)
+  end
+
+  it "tries to convert the passed Object to a String using #to_str" do
+    obj = mock("to_str")
+    obj.should_receive(:to_str).and_return("to_str")
+    
+    @io.string = obj
+    @io.string.should == "to_str"
+  end
+
+  it "raises a TypeError when the passed Object can't be converted to an Integer" do
+    lambda { @io.seek(Object.new) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/stringio_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/stringio_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/stringio_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require "stringio"
+
+describe "StringIO" do
+  it "should include the Enumerable module" do
+    StringIO.should include(Enumerable)
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/sync_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/sync_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/sync_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "StringIO#sync" do
+  it "returns true" do
+    StringIO.new('').sync.should be_true
+  end
+end
+
+describe "StringIO#sync=" do
+  before(:each) do
+    @io = StringIO.new('')
+  end
+
+  it "does not change 'sync' status" do
+    @io.sync = false
+    @io.sync.should be_true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/sysread_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/sysread_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/sysread_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,37 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require "stringio"
+require File.dirname(__FILE__) + '/shared/read'
+
+describe "StringIO#sysread when passed length, buffer" do
+  it_behaves_like :stringio_read, :sysread
+end
+
+describe "StringIO#sysread when passed [length]" do
+  it_behaves_like :stringio_read_length, :sysread
+end
+
+describe "StringIO#sysread when passed no arguments" do
+  it_behaves_like :stringio_read_no_arguments, :sysread
+end
+
+describe "StringIO#sysread when self is not readable" do
+  it_behaves_like :stringio_read_not_readable, :sysread
+end
+
+
+describe "StringIO#sysread when passed [length]" do
+  before(:each) do
+    @io = StringIO.new("example")
+  end
+  
+  it "raises an EOFError when self's position is at the end" do
+    @io.pos = 7
+    lambda { @io.sysread(10) }.should raise_error(EOFError)
+  end
+
+  ruby_bug "http://redmine.ruby-lang.org/projects/ruby-18/issues/show?id=156", "1.8.7" do
+    it "returns an empty String when length is 0" do
+      @io.sysread(0).should == ""
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/syswrite_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/syswrite_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/syswrite_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/write'
+
+describe "StringIO#syswrite when passed [Object]" do
+  it_behaves_like :stringio_write, :syswrite
+end
+
+describe "StringIO#syswrite when passed [String]" do
+  it_behaves_like :stringio_write_string, :syswrite
+end
+
+describe "StringIO#syswrite when self is not writable" do
+  it_behaves_like :stringio_write_not_writable, :syswrite
+end
+
+describe "StringIO#syswrite when in append mode" do
+  it_behaves_like :stringio_write_append, :syswrite
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/tell_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/tell_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/tell_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/tell'
+
+describe "StringIO#tell" do
+  it_behaves_like :stringio_tell, :tell
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/truncate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/truncate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/truncate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,70 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require "stringio"
+
+describe "StringIO#truncate when passed [length]" do
+  before(:each) do
+    @io = StringIO.new('123456789')
+  end
+  
+  # TODO: Report to Ruby-Core: The RDoc says it always returns 0
+  it "returns the passed length" do
+    @io.truncate(4).should eql(4)
+    @io.truncate(10).should eql(10)
+  end
+  
+  it "truncated the underlying string down to the passed length" do
+    @io.truncate(4)
+    @io.string.should == "1234"
+  end
+  
+  it "does not create a copy of the underlying string" do
+    io = StringIO.new(str = "123456789")
+    io.truncate(4)
+    io.string.should equal(str)
+  end
+  
+  it "does not change the position" do
+    @io.pos = 7
+    @io.truncate(4)
+    @io.pos.should eql(7)
+  end
+
+  it "can grow a string to a larger size, padding it with \\000" do
+    @io.truncate(12)
+    @io.string.should == "123456789\000\000\000"
+  end
+
+  it "raises an Errno::EINVAL when the passed length is negative" do
+    lambda { @io.truncate(-1) }.should raise_error(Errno::EINVAL)
+    lambda { @io.truncate(-10) }.should raise_error(Errno::EINVAL)
+  end
+
+  it "tries to convert the passed length to an Integer using #to_int" do
+    obj = mock("to_int")
+    obj.should_receive(:to_int).and_return(4)
+    
+    @io.truncate(obj)
+    @io.string.should == "1234"
+  end
+
+  it "returns the passed length Object, NOT the result of #to_int" do
+    obj = mock("to_int")
+    obj.should_receive(:to_int).and_return(4)
+    @io.truncate(obj).should equal(obj)
+  end
+
+  it "raises a TypeError when the passed length can't be converted to an Integer" do
+    lambda { @io.truncate(Object.new) }.should raise_error(TypeError)
+  end
+end
+
+describe "StringIO#truncate when self is not writable" do
+  it "raises an IOError" do
+    io = StringIO.new("test", "r")
+    lambda { io.truncate(2) }.should raise_error(IOError)
+
+    io = StringIO.new("test")
+    io.close_write
+    lambda { io.truncate(2) }.should raise_error(IOError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/tty_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/tty_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/tty_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/isatty'
+
+describe "StringIO#tty?" do
+  it_behaves_like :stringio_isatty, :tty?
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/ungetc_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/ungetc_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/ungetc_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,80 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "StringIO#ungetc when passed [char]" do
+  before(:each) do
+    @io = StringIO.new('1234')
+  end
+
+  it "writes the passed char before the current position" do
+    @io.pos = 1
+    @io.ungetc(?A)
+    @io.string.should == 'A234'
+  end
+  
+  it "returns nil" do
+    @io.pos = 1
+    @io.ungetc(?A).should be_nil
+  end
+
+  it "decreases the current position by one" do
+    @io.pos = 2
+    @io.ungetc(?A)
+    @io.pos.should eql(1)
+  end
+
+  it "pads with \\000 when the current position is after the end" do
+    @io.pos = 15
+    @io.ungetc(?A)
+    @io.string.should == "1234\000\000\000\000\000\000\000\000\000\000A"
+  end
+
+  it "does nothing when at the beginning of self" do
+    @io.ungetc(65)
+    @io.string.should == '1234'
+  end
+
+  it "tries to convert the passed length to an Integer using #to_int" do
+    obj = mock("to_int")
+    obj.should_receive(:to_int).and_return(?A)
+
+    @io.pos = 1
+    @io.ungetc(obj)
+    @io.string.should == "A234"
+  end
+
+  it "raises a TypeError when the passed length can't be converted to an Integer" do
+    lambda { @io.ungetc(Object.new) }.should raise_error(TypeError)
+    lambda { @io.ungetc("A") }.should raise_error(TypeError)
+  end
+end
+
+describe "StringIO#ungetc when self is not readable" do
+  it "raises an IOError" do
+    io = StringIO.new("test", "w")
+    io.pos = 1
+    lambda { io.ungetc(?A) }.should raise_error(IOError)
+
+    io = StringIO.new("test")
+    io.pos = 1
+    io.close_read
+    lambda { io.ungetc(?A) }.should raise_error(IOError)
+  end
+end
+
+# Note: This is incorrect.
+#
+# describe "StringIO#ungetc when self is not writable" do
+#   ruby_bug "#", "1.8.7.17" do
+#     it "raises an IOError" do
+#       io = StringIO.new("test", "r")
+#       io.pos = 1
+#       lambda { io.ungetc(?A) }.should raise_error(IOError)
+# 
+#       io = StringIO.new("test")
+#       io.pos = 1
+#       io.close_write
+#       lambda { io.ungetc(?A) }.should raise_error(IOError)
+#     end
+#   end
+# end

Added: MacRuby/branches/experimental/spec/frozen/library/stringio/write_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/write_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/write_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/write'
+
+describe "StringIO#write when passed [Object]" do
+  it_behaves_like :stringio_write, :write
+end
+
+describe "StringIO#write when passed [String]" do
+  it_behaves_like :stringio_write_string, :write
+end
+
+describe "StringIO#write when self is not writable" do
+  it_behaves_like :stringio_write_not_writable, :write
+end
+
+describe "StringIO#write when in append mode" do
+  it_behaves_like :stringio_write_append, :write
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/append_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/append_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/append_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/concat.rb'
+require 'strscan'
+
+describe "StringScanner#<<" do
+  it_behaves_like :strscan_concat, :<<
+end
+
+describe "StringScanner#<< when passed a Fixnum" do
+  it_behaves_like :strscan_concat_fixnum, :<<
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/beginning_of_line_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/beginning_of_line_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/beginning_of_line_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/bol.rb'
+require 'strscan'
+
+describe "StringScanner#beginning_of_line?" do
+  it_behaves_like(:strscan_bol, :beginning_of_line?)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/bol_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/bol_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/bol_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/bol.rb'
+require 'strscan'
+
+describe "StringScanner#bol?" do
+  it_behaves_like(:strscan_bol, :bol?)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/check_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/check_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/check_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'strscan'
+
+describe "StringScanner#check" do
+  before :each do
+    @s = StringScanner.new("This is a test")
+  end
+
+  it "returns the value that scan would return, without advancing the scan pointer" do
+    @s.check(/This/).should == "This"
+    @s.matched.should == "This"
+    @s.pos.should == 0
+    @s.check(/is/).should == nil
+    @s.matched.should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/check_until_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/check_until_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/check_until_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'strscan'
+
+describe "StringScanner#check_until" do
+  before :each do
+    @s = StringScanner.new("This is a test")
+  end
+
+  it "returns the same value of scan_until, but don't advances the scan pointer" do
+    @s.check_until(/a/).should == "This is a"
+    @s.pos.should == 0
+    @s.matched.should == "a"
+    @s.check_until(/test/).should == "This is a test"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/clear_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/clear_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/clear_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/terminate.rb'
+require 'strscan'
+
+describe "StringScanner#clear" do
+  it_behaves_like(:strscan_terminate, :clear)
+
+  it "warns in verbose mode that the method is obsolete" do
+    s = StringScanner.new("abc")
+    begin
+      old = $VERBOSE
+      lambda {
+        $VERBOSE = true
+        s.clear
+      }.should complain(/clear.*obsolete.*terminate/)
+
+      lambda {
+        $VERBOSE = false
+        s.clear
+      }.should_not complain
+    ensure
+      $VERBOSE = old
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/concat_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/concat_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/concat_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/concat.rb'
+require 'strscan'
+
+describe "StringScanner#concat" do
+  it_behaves_like(:strscan_concat, :concat)
+end
+
+describe "StringScanner#concat when passed a Fixnum" do
+  it_behaves_like(:strscan_concat_fixnum, :concat)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/dup_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/dup_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/dup_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'strscan'
+
+describe "StringScanner#dup" do
+  before :each do
+    @s = StringScanner.new("This is a test")
+    @d = @s.dup
+  end
+
+  it "returns a new StringScanner duplicated from the original" do    
+    @d.should be_kind_of(StringScanner)
+    @d.inspect.should == @s.inspect
+    @d.string.should == @s.string
+    @d.eos?.should == @s.eos?
+    @d.matched?.should == @s.matched?
+    @d.pos.should == @s.pos
+  end
+end 

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/element_reference_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/element_reference_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/element_reference_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,45 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'strscan'
+
+describe "StringScanner#[]" do
+  before :each do
+    @s = StringScanner.new("Fri Jun 13 2008 22:43")
+  end
+
+  it "returns the n-th subgroup in the most recent match" do
+    @s.scan(/(\w+) (\w+) (\d+) /)
+    @s[0].should == "Fri Jun 13 "
+    @s[1].should == "Fri"
+    @s[2].should == "Jun"
+    @s[3].should == "13"
+    @s[-3].should == "Fri"
+    @s[-2].should == "Jun"
+    @s[-1].should == "13"
+  end
+
+  it "returns nil if index is outside of self" do
+    @s.scan(/(\w+) (\w+) (\d+) /)
+    @s[5].should == nil
+    @s[-5].should == nil
+  end
+
+  it "calls to_int on the given index" do
+    @s.scan(/(\w+) (\w+) (\d+) /)
+    @s[0.5].should == "Fri Jun 13 "
+  end
+
+  it "raises a TypeError if the given index is nil" do
+    @s.scan(/(\w+) (\w+) (\d+) /)
+    lambda { @s[nil]}.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError when a String is as argument" do
+    @s.scan(/(\w+) (\w+) (\d+) /)
+    lambda { @s["Fri"]}.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError when a Range is as argument" do
+    @s.scan(/(\w+) (\w+) (\d+) /)
+    lambda { @s[0..2]}.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/empty_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/empty_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/empty_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/eos.rb'
+require 'strscan'
+
+describe "StringScanner#empty?" do
+  it_behaves_like(:strscan_eos, :empty?)
+
+  it "warns in verbose mode that the method is obsolete" do
+    s = StringScanner.new("abc")
+    begin
+      old = $VERBOSE
+      lambda {
+        $VERBOSE = true
+        s.empty?
+      }.should complain(/empty?.*obsolete.*eos?/)
+
+      lambda {
+        $VERBOSE = false
+        s.empty?
+      }.should_not complain
+    ensure
+      $VERBOSE = old
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/eos_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/eos_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/eos_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/eos.rb'
+require 'strscan'
+
+describe "StringScanner#eos?" do
+  it_behaves_like(:strscan_eos, :eos?)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/exist_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/exist_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/exist_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'strscan'
+
+describe "StringScanner#exist?" do
+  before :each do
+    @s = StringScanner.new("This is a test")
+  end
+
+  it "returns the index of the first occurrence of the given pattern" do
+    @s.exist?(/s/).should == 4
+    @s.scan /This is/
+    @s.exist?(/s/).should == 6
+  end
+
+  it "returns 0 if the pattern is empty" do
+    @s.exist?(//).should == 0
+  end
+
+  it "returns nil if the pattern isn't found in the string" do
+    @s.exist?(/S/).should == nil
+    @s.scan /This is/
+    @s.exist?(/i/).should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/get_byte_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/get_byte_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/get_byte_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/get_byte'
+require 'strscan'
+
+describe "StringScanner#get_byte" do
+  it_behaves_like :strscan_get_byte, :get_byte
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/getbyte_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/getbyte_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/getbyte_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/get_byte'
+require 'strscan'
+
+describe "StringScanner#getbyte" do
+  it_behaves_like :strscan_get_byte, :getbyte
+
+  it "warns in verbose mode that the method is obsolete" do
+    s = StringScanner.new("abc")
+    begin
+      old = $VERBOSE
+      lambda {
+        $VERBOSE = true
+        s.getbyte
+      }.should complain(/getbyte.*obsolete.*get_byte/)
+
+      lambda {
+        $VERBOSE = false
+        s.getbyte
+      }.should_not complain
+    ensure
+      $VERBOSE = old
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/getch_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/getch_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/getch_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,41 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'strscan'
+
+describe "StringScanner#getch" do
+  it "scans one character and returns it" do
+    s = StringScanner.new('abc')
+    s.getch.should == "a"
+    s.getch.should == "b"
+    s.getch.should == "c"
+  end
+
+  it "is multi-byte character sensitive" do
+    begin
+        old, $KCODE = $KCODE, 'EUC'
+        s = StringScanner.new("\244\242")
+        s.getch.should == "\244\242" # Japanese hira-kana "A" in EUC-JP
+    ensure
+      $KCODE = old
+    end
+  end
+
+  it "returns nil at the end of the string" do
+    # empty string case
+    s = StringScanner.new('')
+    s.getch.should == nil
+    s.getch.should == nil
+
+    # non-empty string case
+    s = StringScanner.new('a')
+    s.getch # skip one
+    s.getch.should == nil
+  end
+
+  it "does not accept any arguments" do
+    s = StringScanner.new('abc')
+    lambda {
+      s.getch(5)
+    }.should raise_error(ArgumentError, /wrong .* arguments/)
+  end
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/initialize_copy_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/initialize_copy_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/initialize_copy_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,36 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'strscan'
+
+describe "StringScanner#initialize_copy" do
+  before(:each) do
+    @s      = StringScanner.new("StringScanner example")
+    @orig_s = StringScanner.new("Original StringScanner")
+  end
+
+  it "is a private method" do
+    @s.private_methods.should include("initialize")
+  end
+
+  it "copies the passed StringScanner's content to self" do
+    @s.send(:initialize_copy, @orig_s)
+    @s.string.should == "Original StringScanner"
+  end
+
+  it "copies the passed StringSCanner's position to self" do
+    @orig_s.pos = 5
+    @s.send(:initialize_copy, @orig_s)
+    @s.pos.should eql(5)
+  end
+
+  it "does not taint self when the passed StringScanner is tainted" do
+    @orig_s.taint
+    @s.send(:initialize_copy, @orig_s)
+    @s.tainted?.should be_false
+  end
+
+  it "copies the passed StringScanner scan pointer to self" do
+    @orig_s.terminate
+    @s.send(:initialize_copy, @orig_s)
+    @s.eos?.should be_true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'strscan'
+
+describe "StringScanner#initialize" do
+  before :each do
+    @s = StringScanner.new("This is a test")
+  end
+
+  it "is a private method" do
+    @s.private_methods.should include("initialize")
+  end
+
+  it "returns an instance of StringScanner" do
+    @s.should be_kind_of(StringScanner)
+    @s.tainted?.should be_false
+    @s.eos?.should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'strscan'
+
+describe "StringScanner#inspect" do
+  before :each do
+    @s = StringScanner.new("This is a test")
+  end
+
+  it "returns a String object" do
+    @s.inspect.should be_kind_of(String)
+  end
+
+  it "returns a string that represents the StringScanner object" do
+    @s.inspect.should == "#<StringScanner 0/14 @ \"This ...\">"
+    @s.scan_until /is/
+    @s.inspect.should == "#<StringScanner 4/14 \"This\" @ \" is a...\">"
+    @s.terminate
+    @s.inspect.should == "#<StringScanner fin>"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/match_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/match_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/match_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'strscan'
+
+describe "StringScanner#match?" do
+  before :each do
+    @s = StringScanner.new("This is a test")
+  end
+
+  it "returns the length of the match and the scan pointer is not advanced" do
+    @s.match?(/\w+/).should == 4
+    @s.match?(/\w+/).should == 4
+    @s.pos.should == 0
+  end
+
+  it "returns nil if there's no match" do
+    @s.match?(/\d+/).should == nil
+    @s.match?(/\s+/).should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/matched_size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/matched_size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/matched_size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/matched_size.rb'
+require 'strscan'
+
+describe "StringScanner#matched_size" do
+  it_behaves_like(:strscan_matched_size, :matched_size)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/matched_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/matched_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/matched_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,38 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'strscan'
+
+describe "StringScanner#matched" do
+  before :each do
+    @s = StringScanner.new("This is a test")
+  end
+
+  it "returns the last matched string" do
+    @s.match?(/\w+/)
+    @s.matched.should == "This"
+    @s.getch
+    @s.matched.should == "T"
+    @s.get_byte
+    @s.matched.should == "h"
+  end
+
+  it "returns nil if there's no match" do
+    @s.match?(/\d+/)
+    @s.matched.should == nil
+  end
+end
+
+describe "StringScanner#matched?" do
+  before :each do
+    @s = StringScanner.new("This is a test")
+  end
+
+  it "returns true if the last match was successful" do
+    @s.match?(/\w+/)
+    @s.matched?.should be_true
+  end
+
+  it "returns false if there's no match" do
+    @s.match?(/\d+/)
+    @s.matched?.should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/matchedsize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/matchedsize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/matchedsize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/matched_size.rb'
+require 'strscan'
+
+describe "StringScanner#matchedsize" do
+  it_behaves_like(:strscan_matched_size, :matchedsize)
+
+  it "warns in verbose mode that the method is obsolete" do
+    s = StringScanner.new("abc")
+    begin
+      old = $VERBOSE
+      lambda {
+        $VERBOSE = true
+        s.matchedsize
+      }.should complain(/matchedsize.*obsolete.*matched_size/)
+
+      lambda {
+        $VERBOSE = false
+        s.matchedsize
+      }.should_not complain
+    ensure
+      $VERBOSE = old
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/must_C_version_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/must_C_version_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/must_C_version_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'strscan'
+
+describe "StringScanner.must_C_version" do
+  it "returns self" do
+     StringScanner.must_C_version.should == StringScanner
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/peek_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/peek_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/peek_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/peek.rb'
+require 'strscan'
+
+describe "StringScanner#peek" do
+  it_behaves_like(:strscan_peek, :peek)
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/peep_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/peep_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/peep_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/peek.rb'
+require 'strscan'
+
+describe "StringScanner#peep" do
+  it_behaves_like(:strscan_peek, :peep)
+
+  it "warns in verbose mode that the method is obsolete" do
+    s = StringScanner.new("abc")
+    begin
+      old = $VERBOSE
+      lambda {
+        $VERBOSE = true
+        s.peep(1)
+      }.should complain(/peep.*obsolete.*peek/)
+
+      lambda {
+        $VERBOSE = false
+        s.peep(1)
+      }.should_not complain
+    ensure
+      $VERBOSE = old
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/pointer_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/pointer_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/pointer_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/pos.rb'
+require 'strscan'
+
+describe "StringScanner#pointer" do
+  it_behaves_like(:strscan_pos, :pointer)
+end
+
+describe "StringScanner#pointer=" do
+  it_behaves_like(:strscan_pos_set, :pointer=)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/pos_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/pos_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/pos_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/pos.rb'
+require 'strscan'
+
+describe "StringScanner#pos" do
+  it_behaves_like(:strscan_pos, :pos)
+end
+
+describe "StringScanner#pos=" do
+  it_behaves_like(:strscan_pos_set, :pos=)
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/post_match_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/post_match_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/post_match_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'strscan'
+
+describe "StringScanner#post_match" do
+  before :each do
+    @s = StringScanner.new("This is a test")
+  end
+
+  it "returns the post-match (in the regular expression sense) of the last scan" do
+    @s.post_match.should == nil
+    @s.scan(/\w+\s/)
+    @s.post_match.should == "is a test"
+    @s.getch
+    @s.post_match.should == "s a test"
+    @s.get_byte
+    @s.post_match.should == " a test"
+    @s.get_byte
+    @s.post_match.should == "a test"
+  end
+
+  it "returns nil if there's no match" do
+    @s.scan(/\s+/)
+    @s.post_match.should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/pre_match_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/pre_match_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/pre_match_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'strscan'
+
+describe "StringScanner#pre_match" do
+  before :each do
+    @s = StringScanner.new("This is a test")
+  end
+
+  it "returns the pre-match (in the regular expression sense) of the last scan" do
+    @s.pre_match.should == nil
+    @s.scan(/\w+\s/)
+    @s.pre_match.should == ""
+    @s.getch
+    @s.pre_match.should == "This "
+    @s.get_byte
+    @s.pre_match.should == "This i"
+    @s.get_byte
+    @s.pre_match.should == "This is"
+  end
+
+  it "returns nil if there's no match" do
+    @s.scan(/\s+/)
+    @s.pre_match.should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/reset_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/reset_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/reset_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'strscan'
+
+describe "StringScanner#reset" do
+  before :each do
+    @s = StringScanner.new("This is a test")
+  end
+
+  it "reset the scan pointer and clear matching data" do
+    @s.scan(/This/)
+    @s.reset
+    @s.pos.should == 0
+    @s.matched.should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/rest_size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/rest_size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/rest_size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/rest_size.rb'
+require 'strscan'
+
+describe "StringScanner#rest_size" do
+  it_behaves_like(:strscan_rest_size, :rest_size)
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/rest_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/rest_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/rest_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,44 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'strscan'
+
+describe "StringScanner#rest" do
+  before :each do
+    @s = StringScanner.new("This is a test")
+  end
+
+  it "returns the rest of the string" do
+    @s.scan(/This\s+/)
+    @s.rest.should == "is a test"
+  end
+
+  it "returns self in the reset position" do
+    @s.reset
+    @s.rest.should == @s.string
+  end
+
+  it "returns an empty string in the terminate position" do
+    @s.terminate
+    @s.rest.should == ""
+  end
+end
+
+describe "StringScanner#rest?" do
+  before :each do
+    @s = StringScanner.new("This is a test")
+  end
+
+  it "returns true if there is more data in the string" do
+    @s.rest?.should be_true  
+    @s.scan(/This/)
+    @s.rest?.should be_true
+  end
+
+  it "returns false if there is no more data in the string" do
+    @s.terminate
+    @s.rest?.should be_false
+  end
+
+  it "is the opposite of eos?" do
+    @s.rest?.should_not == @s.eos?
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/restsize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/restsize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/restsize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/rest_size.rb'
+require 'strscan'
+
+describe "StringScanner#restsize" do
+  it_behaves_like(:strscan_rest_size, :restsize)
+
+  it "warns in verbose mode that the method is obsolete" do
+    s = StringScanner.new("abc")
+    begin
+      old = $VERBOSE
+      lambda {
+        $VERBOSE = true
+        s.restsize
+      }.should complain(/restsize.*obsolete.*rest_size/)
+
+      lambda {
+        $VERBOSE = false
+        s.restsize
+      }.should_not complain
+    ensure
+      $VERBOSE = old
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/scan_full_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/scan_full_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/scan_full_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,30 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'strscan'
+
+describe "StringScanner#scan_full" do
+  before :each do
+    @s = StringScanner.new("This is a test")
+  end
+
+  it "returns the number of bytes advanced" do
+    orig_pos = @s.pos
+    @s.scan_full(/This/, false, false).should == 4
+    @s.pos.should == orig_pos
+  end
+
+  it "returns the number of bytes advanced and advances the scan pointer if the second argument is true" do
+    @s.scan_full(/This/, true, false).should == 4
+    @s.pos.should == 4
+  end
+
+  it "returns the matched string if the third argument is true" do
+    orig_pos = @s.pos
+    @s.scan_full(/This/, false, true).should == "This"
+    @s.pos.should == orig_pos
+  end
+
+  it "returns the matched string if the third argument is true and advances the scan pointer if the second argument is true" do
+    @s.scan_full(/This/, true, true).should == "This"
+    @s.pos.should == 4
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/scan_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/scan_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/scan_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'strscan'
+
+describe "StringScanner#scan" do
+  before :each do
+    @s = StringScanner.new("This is a test")
+  end
+
+  it "returns the matched string" do
+    @s.scan(/\w+/).should == "This"
+    @s.scan(/.../).should == " is"
+    @s.scan(//).should == ""
+    @s.scan(/\s+/).should == " "
+  end
+
+  it "returns nil if there's no match" do
+    @s.scan(/\d/).should == nil
+  end
+
+  it "raises a TypeError if pattern isn't a Regexp and can't be converted to a String" do
+    lambda { @s.scan(5)         }.should raise_error(TypeError)
+    lambda { @s.scan(:test)     }.should raise_error(TypeError)
+    lambda { @s.scan(mock('x')) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/scan_until_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/scan_until_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/scan_until_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'strscan'
+
+describe "StringScanner#scan_until" do
+  before :each do
+    @s = StringScanner.new("This is a test")
+  end
+
+  it "returns the substring up to and including the end of the match" do
+   @s.scan_until(/a/).should == "This is a"
+   @s.pre_match.should == "This is "
+   @s.post_match.should == " test"
+  end
+
+  it "returns nil if there's no match" do
+    @s.scan_until(/\d/).should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/search_full_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/search_full_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/search_full_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,30 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'strscan'
+
+describe "StringScanner#search_full" do
+  before :each do
+    @s = StringScanner.new("This is a test")
+  end
+
+  it "returns the number of bytes advanced" do
+    orig_pos = @s.pos
+    @s.search_full(/This/, false, false).should == 4
+    @s.pos.should == orig_pos
+  end
+
+  it "returns the number of bytes advanced and advances the scan pointer if the second argument is true" do
+    @s.search_full(/This/, true, false).should == 4
+    @s.pos.should == 4
+  end
+
+  it "returns the matched string if the third argument is true" do
+    orig_pos = @s.pos
+    @s.search_full(/This/, false, true).should == "This"
+    @s.pos.should == orig_pos
+  end
+
+  it "returns the matched string if the third argument is true and advances the scan pointer if the second argument is true" do
+    @s.search_full(/This/, true, true).should == "This"
+    @s.pos.should == 4
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/bol.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/bol.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/bol.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+describe :strscan_bol, :shared => true do
+  it "returns true if the scan pointer is at the beginning of the line, false otherwise" do
+    s = StringScanner.new("This is a test")
+    s.send(@method).should be_true
+    s.scan(/This/)
+    s.send(@method).should be_false
+    s.terminate
+    s.send(@method).should be_false
+
+    s = StringScanner.new("hello\nworld")
+    s.bol?.should be_true
+    s.scan(/\w+/)
+    s.bol?.should be_false
+    s.scan(/\n/)
+    s.bol?.should be_true
+    s.unscan
+    s.bol?.should be_false
+  end
+
+  it "returns true if the scan pointer is at the end of the line of an empty string." do
+    s = StringScanner.new('')
+    s.terminate
+    s.send(@method).should be_true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/concat.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/concat.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/concat.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,30 @@
+describe :strscan_concat, :shared => true do
+  it "concatenates the given argument to self and returns self" do
+    s = StringScanner.new("hello ")
+    s.send(@method, 'world').should == s
+    s.string.should == "hello world"
+    s.eos?.should be_false
+  end
+
+  it "raises a TypeError if the given argument can't be converted to a String" do
+    lambda { a = StringScanner.new('hello').send(@method, :world)    }.should raise_error(TypeError)
+    lambda { a = StringScanner.new('hello').send(@method, mock('x')) }.should raise_error(TypeError)
+  end
+end
+
+describe :strscan_concat_fixnum, :shared => true do
+  it "raises a TypeError" do
+    a = StringScanner.new("hello world")
+    lambda { a.send(@method, 333) }.should raise_error(TypeError)
+    b = StringScanner.new("")
+    lambda { b.send(@method, (256 * 3 + 64)) }.should raise_error(TypeError)
+    lambda { b.send(@method, -200)           }.should raise_error(TypeError)
+  end
+
+  it "doesn't call to_int on the argument" do
+    x = mock('x')
+    x.should_not_receive(:to_int)
+
+    lambda { "".send(@method, x) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/eos.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/eos.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/eos.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+describe :strscan_eos, :shared => true do
+  before :each do
+    @s = StringScanner.new("This is a test")
+  end
+
+  it "Returns true if the scan pointer is at the end of the string" do
+    @s.terminate
+    @s.send(@method).should be_true
+
+    s = StringScanner.new('')
+    s.send(@method).should be_true
+  end
+
+  it "Returns false if the scan pointer is not at the end of the string" do
+    @s.send(@method).should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/get_byte.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/get_byte.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/get_byte.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+describe :strscan_get_byte, :shared => true do
+  it "scans one byte and returns it" do
+    s = StringScanner.new('abc5.')
+    s.send(@method).should == 'a'
+    s.send(@method).should == 'b'
+    s.send(@method).should == 'c'
+    s.send(@method).should == '5'
+    s.send(@method).should == '.'
+  end
+
+  it "is not multi-byte character sensitive" do
+    s = StringScanner.new("\244\242")
+    s.send(@method).should == "\244"
+    s.send(@method).should == "\242"
+  end
+
+  it "returns nil at the end of the string" do
+    # empty string case
+    s = StringScanner.new('')
+    s.send(@method).should == nil
+    s.send(@method).should == nil
+
+    # non-empty string case
+    s = StringScanner.new('a')
+    s.send(@method) # skip one
+    s.send(@method).should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/matched_size.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/matched_size.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/matched_size.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+describe :strscan_matched_size, :shared => true do
+  before :each do
+    @s = StringScanner.new("This is a test")
+  end
+
+ it "returns the size of the most recent match" do
+    @s.check /This/
+    @s.send(@method).should == 4
+    @s.send(@method).should == 4
+    @s.scan //
+    @s.send(@method).should == 0
+  end
+
+  it "returns nil if there was no recent match" do
+    @s.send(@method).should == nil
+    @s.check /\d+/
+    @s.send(@method).should == nil
+    @s.terminate
+    @s.send(@method).should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/peek.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/peek.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/peek.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+describe :strscan_peek, :shared => true do
+  before :each do
+    @s = StringScanner.new('This is a test')
+  end
+
+  it "returns at most the specified number of characters from the current position" do
+    @s.send(@method, 4).should == "This"
+    @s.pos.should == 0
+    @s.pos = 5
+    @s.send(@method, 2).should == "is"
+    @s.send(@method, 1000).should == "is a test"
+  end
+
+  it "returns an empty string when the passed argument is zero" do
+    @s.send(@method, 0).should == ""
+  end
+
+  it "raises a ArgumentError when the passed argument is negative" do
+    lambda { @s.send(@method, -2) }.should raise_error(ArgumentError)
+  end
+
+  it "raises a RangeError when the passed argument is a Bignum" do
+    lambda { @s.send(@method, bignum_value) }.should raise_error(RangeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/pos.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/pos.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/pos.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,40 @@
+describe :strscan_pos, :shared => true do
+  before :each do
+    @s = StringScanner.new("This is a test")
+  end
+
+  it "returns the position of the scan pointer" do
+    @s.send(@method).should == 0
+    @s.scan_until /This is/
+    @s.send(@method).should == 7
+    @s.get_byte
+    @s.send(@method).should == 8
+    @s.terminate
+    @s.send(@method).should == 14
+  end
+
+  it "returns 0 in the reset position" do
+    @s.reset
+    @s.send(@method).should == 0
+  end
+
+  it "returns the length of the string in the terminate position" do
+    @s.terminate
+    @s.send(@method).should == @s.string.length
+  end
+end
+
+describe :strscan_pos_set, :shared => true do
+  before :each do
+    @s = StringScanner.new("This is a test")
+  end
+
+  it "modify the scan pointer" do
+    @s.send(@method, 5)
+    @s.rest.should == "is a test"
+  end
+
+  it "raises a RangeError when the passed argument is out of range" do
+    lambda { @s.send(@method, 20) }.should raise_error(RangeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/rest_size.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/rest_size.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/rest_size.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+describe :strscan_rest_size, :shared => true do
+  before :each do
+    @s = StringScanner.new('This is a test')
+  end
+
+  it "Returns the length of the rest of the string" do
+    @s.send(@method).should == 14
+    @s.scan(/This/)
+    @s.send(@method).should == 10
+    @s.terminate
+    @s.send(@method).should == 0
+  end
+
+  it "is equivalent to rest.size" do
+    @s.scan(/This/)
+    @s.send(@method).should == @s.rest.size
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/terminate.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/terminate.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/terminate.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+describe :strscan_terminate, :shared => true do
+  it "set the scan pointer to the end of the string and clear matching data." do
+    s = StringScanner.new('This is a test')
+    s.send(@method)
+    s.bol?.should be_false
+    s.eos?.should be_true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/skip_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/skip_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/skip_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'strscan'
+
+describe "StringScanner#skip" do
+  before :each do
+    @s = StringScanner.new("This is a test")
+  end
+
+  it "returns length of the match" do
+    @s.skip(/\w+/).should == 4    
+    @s.skip(/\s+\w+/).should == 3
+  end
+
+  it "returns nil if there's no match" do
+    @s.skip(/\s+/).should == nil
+    @s.skip(/\d+/).should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/skip_until_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/skip_until_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/skip_until_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'strscan'
+
+describe "StringScanner#skip_until" do
+  before :each do
+    @s = StringScanner.new("This is a test")
+  end
+
+  it "returns the number of bytes advanced and advances the scan pointer until pattern is matched and consumed" do
+    @s.skip_until(/a/).should == 9
+    @s.pos.should == 9
+    @s.matched.should == "a"
+  end
+
+  it "returns nil if no match was found" do
+    @s.skip_until(/d+/).should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/string_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/string_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/string_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'strscan'
+
+describe "StringScanner#string" do
+  before :each do
+    @s = StringScanner.new("This is a test")
+  end
+
+  it "returns the string being scanned" do
+    @s.string.should == "This is a test"
+    @s << " case"
+    @s.string.should == "This is a test case"
+  end
+end
+
+describe "StringScanner#string=" do
+  before :each do
+    @s = StringScanner.new("This is a test")
+  end
+
+  it "changes the string being scanned to the argument and resets the scanner" do
+    @s.string = "Hello world"
+    @s.string.should == "Hello world"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/terminate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/terminate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/terminate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/terminate.rb'
+require 'strscan'
+
+describe "StringScanner#terminate" do
+    it_behaves_like(:strscan_terminate, :terminate)
+end

Added: MacRuby/branches/experimental/spec/frozen/library/stringscanner/unscan_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/unscan_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/unscan_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'strscan'
+
+describe "StringScanner#unscan" do
+  before :each do
+    @s = StringScanner.new("This is a test")
+  end
+
+  it "set the scan pointer to the previous position" do
+    @s.scan(/This/)
+    @s.unscan
+    @s.matched.should == nil
+    @s.pos.should == 0
+  end
+
+  it "remember only one previous position" do
+    pos1 = @s.pos
+    @s.scan(/This/)
+    pos2 = @s.pos
+    @s.scan(/ is/)
+    @s.unscan
+    @s.pos.should == pos2
+  end
+
+  it "raises a ScanError when the previous match had failed" do
+    lambda { @s.unscan }.should raise_error(ScanError)
+    lambda { @s.scan(/\d/); @s.unscan }.should raise_error(ScanError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/syslog/alert_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/syslog/alert_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/syslog/alert_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/log'
+require 'syslog'
+
+describe "Syslog.alert" do
+  it_behaves_like :syslog_log, :alert
+end

Added: MacRuby/branches/experimental/spec/frozen/library/syslog/close_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/syslog/close_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/syslog/close_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,55 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'syslog'
+
+describe "Syslog.close" do
+  platform_is_not :windows do
+
+    before :each do
+      Syslog.opened?.should be_false
+    end
+
+    after :each do
+      Syslog.opened?.should be_false
+    end
+
+    it "closes the log" do
+      Syslog.opened?.should be_false
+      Syslog.open
+      Syslog.opened?.should be_true
+      Syslog.close
+      Syslog.opened?.should be_false
+    end
+
+    it "raises a RuntimeError if the log's already closed" do
+      lambda { Syslog.close }.should raise_error(RuntimeError)
+    end
+
+    it "it does not work inside blocks" do
+      lambda {
+        Syslog.open { |s| s.close }
+      }.should raise_error(RuntimeError)
+      Syslog.opened?.should == false
+    end
+
+    it "sets the identity to nil" do
+      Syslog.open("rubyspec")
+      Syslog.ident.should == "rubyspec"
+      Syslog.close
+      Syslog.ident.should be_nil
+    end
+
+    it "sets the options to nil" do
+      Syslog.open("rubyspec", Syslog::LOG_PID)
+      Syslog.options.should == Syslog::LOG_PID
+      Syslog.close
+      Syslog.options.should == nil
+    end
+
+    it "sets the facility to nil" do
+      Syslog.open
+      Syslog.facility.should == 8
+      Syslog.close
+      Syslog.facility.should == nil
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/syslog/constants_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/syslog/constants_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/syslog/constants_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,51 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'syslog'
+
+describe "Syslog::Constants" do
+  platform_is_not :windows do
+
+    before :all do
+
+    @constants = %w(LOG_AUTHPRIV LOG_USER LOG_LOCAL2 LOG_NOTICE LOG_NDELAY
+                    LOG_SYSLOG LOG_ALERT LOG_FTP LOG_LOCAL5 LOG_ERR LOG_AUTH
+                    LOG_LOCAL1 LOG_ODELAY LOG_NEWS LOG_DAEMON LOG_LOCAL4
+                    LOG_CRIT LOG_INFO LOG_PERROR LOG_LOCAL0 LOG_CONS LOG_LPR
+                    LOG_LOCAL7 LOG_WARNING LOG_CRON LOG_LOCAL3 LOG_EMERG
+                    LOG_NOWAIT LOG_UUCP LOG_PID LOG_KERN LOG_MAIL LOG_LOCAL6
+                    LOG_DEBUG)
+    end
+
+    it 'includes the Syslog constants' do
+      @constants.each do |c|
+        Syslog::Constants.constants.include?(c).should be_true
+      end
+    end
+
+  end
+
+  # The masks are defined in <syslog.h>
+
+  describe "Syslog::Constants.LOG_MASK" do
+    it "returns the mask value for a priority" do
+      Syslog::Constants.LOG_MASK(Syslog::LOG_DEBUG).should == 128
+      Syslog::Constants.LOG_MASK(Syslog::LOG_WARNING).should == 16
+    end
+
+    it "works on undefined constants" do
+      Syslog::Constants.LOG_MASK(1337).should == 33554432
+      Syslog::Constants.LOG_MASK(7331).should == 8
+    end
+  end
+
+  describe "Syslog::Constants.LOG_UPTO" do
+    it "returns a mask for the priorities up to a given argument" do
+      Syslog::Constants.LOG_UPTO(Syslog::LOG_ALERT).should == 3
+      Syslog::Constants.LOG_UPTO(Syslog::LOG_DEBUG).should == 255
+    end
+
+    it "works on undefined constants" do
+      Syslog::Constants.LOG_UPTO(1337).should == 67108863
+    end
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/syslog/crit_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/syslog/crit_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/syslog/crit_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/log'
+require 'syslog'
+
+describe "Syslog.crit" do
+  it_behaves_like :syslog_log, :crit
+end

Added: MacRuby/branches/experimental/spec/frozen/library/syslog/debug_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/syslog/debug_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/syslog/debug_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/log'
+require 'syslog'
+
+describe "Syslog.debug" do
+  it_behaves_like :syslog_log, :debug
+end

Added: MacRuby/branches/experimental/spec/frozen/library/syslog/emerg_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/syslog/emerg_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/syslog/emerg_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/log'
+require 'syslog'
+
+describe "Syslog.emerg" do
+  # Some way needs do be found to prevent this spec
+  # from causing output on all open terminals. If this
+  # is not possible, this spec may need a special guard
+  # that only runs when requested.
+  quarantine! do
+    it_behaves_like :syslog_log, :emerg
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/syslog/err_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/syslog/err_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/syslog/err_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/log'
+require 'syslog'
+
+describe "Syslog.err" do
+  it_behaves_like :syslog_log, :err
+end

Added: MacRuby/branches/experimental/spec/frozen/library/syslog/facility_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/syslog/facility_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/syslog/facility_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,45 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'syslog'
+
+describe "Syslog.facility" do
+  platform_is_not :windows do
+
+    before :each do
+      Syslog.opened?.should be_false
+    end
+
+    after :each do
+      Syslog.opened?.should be_false
+    end
+
+    it "returns the logging facility" do
+      Syslog.open("rubyspec", 3, Syslog::LOG_MAIL)
+      Syslog.facility.should == Syslog::LOG_MAIL
+      Syslog.close
+    end
+
+    it "returns nil if the log is closed" do
+      Syslog.opened?.should be_false
+      Syslog.facility.should == nil
+    end
+
+    it "defaults to LOG_USER" do
+      Syslog.open
+      Syslog.facility.should == Syslog::LOG_USER
+      Syslog.close
+    end
+
+    it "resets after each open call" do
+      Syslog.open
+      Syslog.facility.should == Syslog::LOG_USER
+
+      Syslog.open!("rubyspec", 3, Syslog::LOG_MAIL)
+      Syslog.facility.should == Syslog::LOG_MAIL
+      Syslog.close
+
+      Syslog.open
+      Syslog.facility.should == Syslog::LOG_USER
+      Syslog.close
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/syslog/ident_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/syslog/ident_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/syslog/ident_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'syslog'
+
+describe "Syslog.ident" do
+  platform_is_not :windows do
+
+    before :each do
+      Syslog.opened?.should be_false
+    end
+
+    after :each do
+      Syslog.opened?.should be_false
+    end
+
+    it "returns the logging identity" do
+      Syslog.open("rubyspec")
+      Syslog.ident.should == "rubyspec"
+      Syslog.close
+    end
+
+    it "returns nil if the log is closed" do
+      Syslog.opened?.should == false
+      Syslog.ident.should == nil
+    end
+
+    it "defaults to $0" do
+      Syslog.open
+      Syslog.ident.should == $0
+      Syslog.close
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/syslog/info_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/syslog/info_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/syslog/info_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/log'
+require 'syslog'
+
+describe "Syslog.info" do
+  it_behaves_like :syslog_log, :info
+end

Added: MacRuby/branches/experimental/spec/frozen/library/syslog/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/syslog/inspect_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/syslog/inspect_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,36 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'syslog'
+
+describe "Syslog.inspect" do
+  platform_is_not :windows do
+
+    before :each do
+      Syslog.opened?.should be_false
+    end
+
+    after :each do
+      Syslog.opened?.should be_false
+    end
+
+    it "returns a string a closed log" do
+      Syslog.inspect.should == "<#Syslog: opened=false>"
+    end
+
+    it "returns a string for an opened log" do
+      Syslog.open
+      Syslog.inspect.should =~ /<#Syslog: opened=true.*/
+      Syslog.close
+    end
+
+    it "includes the ident, options, facility and mask" do
+      Syslog.open("rubyspec", Syslog::LOG_PID, Syslog::LOG_USER)
+      inspect_str = Syslog.inspect.split ", "
+      inspect_str[0].should == "<#Syslog: opened=true"
+      inspect_str[1].should == "ident=\"rubyspec\""
+      inspect_str[2].should == "options=#{Syslog::LOG_PID}"
+      inspect_str[3].should == "facility=#{Syslog::LOG_USER}"
+      inspect_str[4].should == "mask=255>"
+      Syslog.close
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/syslog/instance_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/syslog/instance_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/syslog/instance_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'syslog'
+
+describe "Syslog.instance" do
+  platform_is_not :windows do
+    it "returns the module" do
+      Syslog.instance.should == Syslog
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/syslog/log_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/syslog/log_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/syslog/log_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,53 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'syslog'
+
+describe "Syslog.log" do
+  platform_is_not :windows do
+
+    before :each do
+      Syslog.opened?.should be_false
+    end
+
+    after :each do
+      Syslog.opened?.should be_false
+    end
+
+    it "receives a priority as first argument" do
+      lambda {
+        Syslog.open("rubyspec", Syslog::LOG_PERROR) do |s|
+          s.log(Syslog::LOG_ALERT, "Hello")
+          s.log(Syslog::LOG_CRIT, "World")
+        end
+      }.should output_to_fd("rubyspec: Hello\nrubyspec: World\n", $stderr)
+    end
+
+    it "accepts undefined priorites" do
+      lambda {
+        Syslog.open("rubyspec", Syslog::LOG_PERROR) do |s|
+          s.log(1337, "Hello")
+        end
+        # use a regex since it'll output unknown facility/priority messages
+      }.should output_to_fd(/rubyspec: Hello/, $stderr)
+    end
+
+    it "fails with TypeError on nil log messages" do
+      Syslog.open do |s|
+        lambda { s.log(1, nil) }.should raise_error(TypeError)
+      end
+    end
+
+    it "fails if the log is closed" do
+      lambda {
+        Syslog.log(Syslog::LOG_ALERT, "test")
+      }.should raise_error(RuntimeError)
+    end
+
+    it "accepts printf parameters" do
+      lambda {
+        Syslog.open("rubyspec", Syslog::LOG_PERROR) do |s|
+          s.log(Syslog::LOG_ALERT, "%s x %d", "chunky bacon", 2)
+        end
+      }.should output_to_fd("rubyspec: chunky bacon x 2\n", $stderr)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/syslog/mask_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/syslog/mask_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/syslog/mask_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,98 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'syslog'
+
+describe "Syslog.mask" do
+  platform_is_not :windows do
+
+    before :each do
+      Syslog.opened?.should be_false
+    end
+
+    after :each do
+      Syslog.opened?.should be_false
+    end
+
+    # make sure we return the mask to the default value
+    after :all do
+      Syslog.open { |s| s.mask = 255 }
+    end
+
+    it "returns the log priority mask" do
+      Syslog.open("rubyspec")
+      Syslog.mask.should == 255
+      Syslog.mask = 3
+      Syslog.mask.should == 3
+      Syslog.mask = 255
+      Syslog.close
+    end
+
+    it "defaults to 255" do
+      Syslog.open do |s|
+        s.mask.should == 255
+      end
+    end
+
+    it "returns nil if the log is closed" do
+      Syslog.opened?.should == false
+      Syslog.mask.should == nil
+    end
+
+    it "persists if the log is reopened" do
+      Syslog.open
+      Syslog.mask.should == 255
+      Syslog.mask = 64
+
+      Syslog.reopen("rubyspec")
+      Syslog.mask.should == 64
+      Syslog.close
+
+      Syslog.open
+      Syslog.mask.should == 64
+      Syslog.close
+    end
+  end
+end
+
+describe "Syslog.mask=" do
+  platform_is_not :windows do
+
+    before :each do
+      Syslog.opened?.should be_false
+    end
+
+    after :each do
+      Syslog.opened?.should be_false
+    end
+
+    # make sure we return the mask to the default value
+    after :all do
+      Syslog.open { |s| s.mask = 255 }
+    end
+
+    it "sets the log priority mask" do
+      Syslog.open
+      Syslog.mask = 64
+      Syslog.mask.should == 64
+      Syslog.close
+    end
+    
+    it "raises an error if the log is closed" do
+      lambda { Syslog.mask = 1337 }.should raise_error(RuntimeError)
+    end
+
+    it "only accepts numbers" do
+      Syslog.open
+
+      Syslog.mask = 1337
+      Syslog.mask.should == 1337
+
+      Syslog.mask = 3.1416
+      Syslog.mask.should == 3
+
+      lambda { Syslog.mask = "oh hai" }.should raise_error(TypeError)
+      lambda { Syslog.mask = "43" }.should raise_error(TypeError)
+
+      Syslog.close
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/syslog/notice_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/syslog/notice_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/syslog/notice_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/log'
+require 'syslog'
+
+describe "Syslog.notice" do
+  it_behaves_like :syslog_log, :notice
+end

Added: MacRuby/branches/experimental/spec/frozen/library/syslog/open_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/syslog/open_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/syslog/open_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,84 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/reopen'
+require 'syslog'
+
+describe "Syslog.open" do
+  platform_is_not :windows do
+
+    before :each do
+      Syslog.opened?.should be_false
+    end
+
+    after :each do
+      Syslog.opened?.should be_false
+    end
+
+    it "returns the module" do
+      Syslog.open.should == Syslog
+      Syslog.close
+      Syslog.open("Test", 5, 9).should == Syslog
+      Syslog.close
+    end
+
+    it "receives an identity as first argument" do
+      Syslog.open("rubyspec")
+      Syslog.ident.should == "rubyspec"
+      Syslog.close
+    end
+
+    it "defaults the identity to $0" do
+      Syslog.open
+      Syslog.ident.should == $0
+      Syslog.close
+    end
+
+    it "receives the logging options as second argument" do
+      Syslog.open("rubyspec", Syslog::LOG_PID)
+      Syslog.options.should == Syslog::LOG_PID
+      Syslog.close
+    end
+
+    it "defaults the logging options to LOG_PID | LOG_CONS" do
+      Syslog.open
+      Syslog.options.should == Syslog::LOG_PID | Syslog::LOG_CONS
+      Syslog.close
+    end
+
+    it "receives a facility as third argument" do
+      Syslog.open("rubyspec", Syslog::LOG_PID, 0)
+      Syslog.facility.should == 0
+      Syslog.close
+    end
+
+    it "defaults the facility to LOG_USER" do
+      Syslog.open
+      Syslog.facility.should == Syslog::LOG_USER
+      Syslog.close
+    end
+
+    it "receives a block and calls it with the module" do
+      Syslog.open("rubyspec", 3, 8) do |s|
+        s.should == Syslog
+        s.ident.should == "rubyspec"
+        s.options.should == 3
+        s.facility.should == Syslog::LOG_USER
+      end
+    end
+
+    it "closes the log if after it receives a block" do
+      Syslog.open{ }
+      Syslog.opened?.should be_false
+    end
+
+    it "raises an error if the log is opened" do
+      Syslog.open
+      lambda { Syslog.open}.should raise_error
+      lambda { Syslog.close; Syslog.open }.should_not raise_error
+      Syslog.close
+    end
+  end
+end
+
+describe "Syslog.open!" do
+  it_behaves_like :syslog_reopen, :open!
+end

Added: MacRuby/branches/experimental/spec/frozen/library/syslog/opened_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/syslog/opened_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/syslog/opened_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,36 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'syslog'
+
+describe "Syslog.opened?" do
+  platform_is_not :windows do
+
+    before :each do
+      Syslog.opened?.should be_false
+    end
+
+    after :each do
+      Syslog.opened?.should be_false
+    end
+
+    it "returns true if the log is opened" do
+      Syslog.open
+      Syslog.opened?.should be_true
+      Syslog.close
+    end
+
+    it "returns false otherwise" do
+      Syslog.opened?.should be_false
+      Syslog.open
+      Syslog.close
+      Syslog.opened?.should be_false
+    end
+
+    it "works inside a block" do
+      Syslog.open do |s|
+        s.opened?.should be_true
+        Syslog.opened?.should be_true
+      end
+      Syslog.opened?.should be_false
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/syslog/options_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/syslog/options_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/syslog/options_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,45 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'syslog'
+
+describe "Syslog.options" do
+  platform_is_not :windows do
+
+    before :each do
+      Syslog.opened?.should be_false
+    end
+
+    after :each do
+      Syslog.opened?.should be_false
+    end
+
+    it "returns the logging options" do
+      Syslog.open("rubyspec", Syslog::LOG_PID)
+      Syslog.options.should == Syslog::LOG_PID
+      Syslog.close
+    end
+
+    it "returns nil when the log is closed" do
+      Syslog.opened?.should be_false
+      Syslog.options.should == nil
+    end
+
+    it "defaults to LOG_PID | LOG_CONS" do
+      Syslog.open
+      Syslog.options.should == Syslog::LOG_PID | Syslog::LOG_CONS
+      Syslog.close
+    end
+
+    it "resets after each open call" do
+      Syslog.open
+      Syslog.options.should == Syslog::LOG_PID | Syslog::LOG_CONS
+
+      Syslog.open!("rubyspec", Syslog::LOG_PID)
+      Syslog.options.should == Syslog::LOG_PID
+      Syslog.close
+
+      Syslog.open
+      Syslog.options.should == Syslog::LOG_PID | Syslog::LOG_CONS
+      Syslog.close
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/syslog/reopen_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/syslog/reopen_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/syslog/reopen_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/reopen'
+require 'syslog'
+
+describe "Syslog.reopen" do
+  it_behaves_like :syslog_reopen, :reopen
+end

Added: MacRuby/branches/experimental/spec/frozen/library/syslog/shared/log.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/syslog/shared/log.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/syslog/shared/log.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,41 @@
+describe :syslog_log, :shared => true do
+  platform_is_not :windows do
+    before :each do
+      Syslog.opened?.should be_false
+    end
+
+    after :each do
+      Syslog.opened?.should be_false
+    end
+
+    it "logs a message" do
+      lambda {
+        Syslog.open("rubyspec", Syslog::LOG_PERROR) do
+          Syslog.send(@method, "Hello")
+        end
+      }.should output_to_fd("rubyspec: Hello\n", $stderr)
+    end
+
+    it "accepts sprintf arguments" do
+      lambda {
+        Syslog.open("rubyspec", Syslog::LOG_PERROR) do
+          Syslog.send(@method, "Hello %s", "world")
+          Syslog.send(@method, "%d dogs", 2)
+        end
+      }.should output_to_fd("rubyspec: Hello world\nrubyspec: 2 dogs\n", $stderr)
+    end
+
+    it "works as an alias for Syslog.log" do
+      level = Syslog.const_get "LOG_#{@method.to_s.upcase}"
+      response = "rubyspec: Hello\n"
+      lambda {
+        Syslog.open("rubyspec", Syslog::LOG_PERROR) do
+          Syslog.send(@method, "Hello")
+          Syslog.log(level, "Hello")
+        end
+        # make sure the same thing is written to $stderr.
+      }.should output_to_fd(response * 2, $stderr)
+    end
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/syslog/shared/reopen.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/syslog/shared/reopen.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/syslog/shared/reopen.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,40 @@
+describe :syslog_reopen, :shared => true do
+  platform_is_not :windows do
+    before :each do
+      Syslog.opened?.should be_false
+    end
+
+    after :each do
+      Syslog.opened?.should be_false
+    end
+
+    it "reopens the log" do
+      Syslog.open
+      lambda { Syslog.send(@method)}.should_not raise_error
+      Syslog.opened?.should be_true
+      Syslog.close
+    end
+
+    it "fails with RuntimeError if the log is closed" do
+      lambda { Syslog.send(@method)}.should raise_error(RuntimeError)
+    end
+
+    it "receives the same parameters as Syslog.open" do
+      Syslog.open
+      Syslog.send(@method, "rubyspec", 3, 8) do |s|
+        s.should == Syslog
+        s.ident.should == "rubyspec"
+        s.options.should == 3
+        s.facility.should == Syslog::LOG_USER
+        s.opened?.should be_true
+      end
+      Syslog.opened?.should be_false
+    end
+
+    it "returns the module" do
+      Syslog.open
+      Syslog.send(@method).should == Syslog
+      Syslog.close
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/syslog/warning_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/syslog/warning_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/syslog/warning_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/log'
+require 'syslog'
+
+describe "Syslog.warning" do
+  it_behaves_like :syslog_log, :warning
+end

Added: MacRuby/branches/experimental/spec/frozen/library/tempfile/_close_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/tempfile/_close_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/tempfile/_close_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'tempfile'
+
+describe "Tempfile#_close" do
+  before(:each) do
+    @tempfile = Tempfile.new("specs")
+  end
+  
+  it "is protected" do
+    @tempfile.protected_methods.should include("_close")
+  end
+  
+  it "closes self" do
+    @tempfile.send(:_close)
+    @tempfile.closed?.should be_true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/tempfile/callback_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/tempfile/callback_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/tempfile/callback_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'tempfile'
+
+describe "Tempfile.callback" do
+  it "needs to be reviewed for spec completeness"
+end

Added: MacRuby/branches/experimental/spec/frozen/library/tempfile/close_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/tempfile/close_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/tempfile/close_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,55 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'tempfile'
+
+describe "Tempfile#close when passed no argument or [false]" do
+  before(:each) do
+    @tempfile = Tempfile.new("specs", tmp(""))
+  end
+  
+  it "closes self" do
+    @tempfile.close
+    @tempfile.closed?.should be_true
+  end
+end
+
+describe "Tempfile#close when passed [true]" do
+  before(:each) do
+    @tempfile = Tempfile.new("specs", tmp(""))
+  end
+  
+  after(:each) do
+    @tempfile.unlink unless @tempfile.path.nil?
+  end
+  
+  it "closes self" do
+    @tempfile.close(true)
+    @tempfile.closed?.should be_true
+  end
+  
+  it "unlinks self" do
+    path = @tempfile.path
+    @tempfile.close(true)
+    File.exists?(path).should be_false
+  end
+end
+
+describe "Tempfile#close!" do
+  before(:each) do
+    @tempfile = Tempfile.new("specs", tmp(""))
+  end
+  
+  after(:each) do
+    @tempfile.unlink unless @tempfile.path.nil?
+  end
+  
+  it "closes self" do
+    @tempfile.close!
+    @tempfile.closed?.should be_true
+  end
+  
+  it "unlinks self" do
+    path =  @tempfile.path
+    @tempfile.close!
+    File.exists?(path).should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/tempfile/delete_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/tempfile/delete_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/tempfile/delete_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'tempfile'
+require File.dirname(__FILE__) + "/shared/unlink"
+
+describe "Tempfile#delete" do
+  it_behaves_like :tempfile_unlink, :delete
+end

Added: MacRuby/branches/experimental/spec/frozen/library/tempfile/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/tempfile/initialize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/tempfile/initialize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'tempfile'
+
+describe "Tempfile#initialize" do
+  before(:each) do
+    @tempfile = Tempfile.allocate
+  end
+
+  after(:each) do
+    @tempfile.close
+  end
+
+  it "opens a new tempfile with the passed name in the passed directory" do
+    @tempfile.send(:initialize, "basename", tmp(""))
+    File.exist?(@tempfile.path).should be_true
+    @tempfile.path.should =~ /^#{tmp("")}/
+    @tempfile.path.should include("basename")
+  end
+
+  it "sets the permisssions on the tempfile to 0600" do
+    @tempfile.send(:initialize, "basename", tmp(""))
+    File.stat(@tempfile.path).mode.should == 0100600
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/tempfile/length_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/tempfile/length_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/tempfile/length_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'tempfile'
+require File.dirname(__FILE__) + "/shared/length"
+
+describe "Tempfile#length" do
+  it_behaves_like :tempfile_length, :length
+end

Added: MacRuby/branches/experimental/spec/frozen/library/tempfile/open_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/tempfile/open_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/tempfile/open_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,55 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'tempfile'
+
+describe "Tempfile#open" do
+  before(:each) do
+    @tempfile = Tempfile.new("specs")
+    @tempfile.puts("Test!")
+  end
+  
+  after(:each) do
+    @tempfile.close
+  end
+
+  it "reopens self" do
+    @tempfile.close
+    @tempfile.open
+    @tempfile.closed?.should be_false
+  end
+  
+  it "reopens self in read and write mode and does not truncate" do
+    @tempfile.open
+    @tempfile.puts("Another Test!")
+    
+    @tempfile.open
+    @tempfile.readline.should == "Another Test!\n"
+  end
+end
+
+describe "Tempfile.open" do
+  it "returns a new, open Tempfile instance" do
+    # Tempfile.open("specs").should be_kind_of(Tempfile) # => fails!
+    t = Tempfile.open("specs")
+    t.instance_of?(Tempfile).should be_true
+    t.close
+  end
+end
+
+describe "Tempfile.open when passed a block" do
+  it "yields a new, open Tempfile instance to the block" do
+    yielded = false
+    Tempfile.open("specs") do |tmpfile|
+      yielded = true
+      #tmpfile.should be_kind_of(Tempfile)
+      tmpfile.instance_of?(Tempfile).should be_true
+      tmpfile.closed?.should be_false
+    end
+    yielded.should be_true
+  end
+  
+  it "closes the yielded Tempfile after the block" do
+    tempfile = nil
+    Tempfile.open("specs") { |x| tempfile = x }
+    tempfile.closed?.should be_true
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/tempfile/path_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/tempfile/path_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/tempfile/path_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'tempfile'
+
+describe "Tempfile#path" do
+  it "returns the path to the tempfile" do
+    @tempfile = Tempfile.new("specs", tmp(""))
+    @tempfile.path.should =~ /^#{tmp("")}/
+    @tempfile.path.should include("specs")
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/tempfile/shared/length.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/tempfile/shared/length.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/tempfile/shared/length.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+describe :tempfile_length, :shared => true do
+  before(:each) do
+    @tempfile = Tempfile.new("specs")
+  end
+
+  it "returns the size of self" do
+    @tempfile.send(@method).should eql(0)
+    @tempfile.print("Test!")
+    @tempfile.send(@method).should eql(5)
+  end
+
+  it "returns 0 when self is closed" do
+    @tempfile.print("Test!")
+    @tempfile.close
+    @tempfile.send(@method).should eql(0)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/tempfile/shared/unlink.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/tempfile/shared/unlink.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/tempfile/shared/unlink.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+describe :tempfile_unlink, :shared => true do
+  before(:each) do
+    @tempfile = Tempfile.new("specs")
+  end
+
+  after(:each) do
+    @tempfile.close
+  end
+
+  ruby_bug "", "1.8.6" do
+    it "unlinks self" do
+      path = @tempfile.path
+      @tempfile.send(@method)
+      File.exists?(path).should be_false
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/tempfile/size_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/tempfile/size_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/tempfile/size_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'tempfile'
+require File.dirname(__FILE__) + "/shared/length"
+
+describe "Tempfile#size" do
+  it_behaves_like :tempfile_length, :size
+end

Added: MacRuby/branches/experimental/spec/frozen/library/tempfile/unlink_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/tempfile/unlink_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/tempfile/unlink_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'tempfile'
+require File.dirname(__FILE__) + "/shared/unlink"
+
+describe "Tempfile#unlink" do
+  it_behaves_like :tempfile_unlink, :unlink
+end

Added: MacRuby/branches/experimental/spec/frozen/library/time/httpdate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/time/httpdate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/time/httpdate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'time'
+
+describe "Time.httpdate" do
+  it "parses RFC-2616 strings" do
+    t = Time.utc(1994, 11, 6, 8, 49, 37)
+    t.should == Time.httpdate("Sun, 06 Nov 1994 08:49:37 GMT")
+    
+    # relies on Time.parse (not yet implemented)
+    # t.should == Time.httpdate("Sunday, 06-Nov-94 08:49:37 GMT")
+    
+    t.should == Time.httpdate("Sun Nov  6 08:49:37 1994")
+    Time.utc(1995, 11, 15, 6, 25, 24).should == Time.httpdate("Wed, 15 Nov 1995 06:25:24 GMT")
+    Time.utc(1995, 11, 15, 4, 58, 8).should == Time.httpdate("Wed, 15 Nov 1995 04:58:08 GMT")
+    Time.utc(1994, 11, 15, 8, 12, 31).should == Time.httpdate("Tue, 15 Nov 1994 08:12:31 GMT")
+    Time.utc(1994, 12, 1, 16, 0, 0).should == Time.httpdate("Thu, 01 Dec 1994 16:00:00 GMT")
+    Time.utc(1994, 10, 29, 19, 43, 31).should == Time.httpdate("Sat, 29 Oct 1994 19:43:31 GMT")
+    Time.utc(1994, 11, 15, 12, 45, 26).should == Time.httpdate("Tue, 15 Nov 1994 12:45:26 GMT")
+    Time.utc(1999, 12, 31, 23, 59, 59).should == Time.httpdate("Fri, 31 Dec 1999 23:59:59 GMT")   
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/time/iso8601_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/time/iso8601_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/time/iso8601_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/xmlschema'
+require 'time'
+
+describe "Time.xmlschema" do
+  it_behaves_like :time_xmlschema, :iso8601
+end

Added: MacRuby/branches/experimental/spec/frozen/library/time/rfc2822_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/time/rfc2822_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/time/rfc2822_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/rfc2822'
+require 'time'
+
+describe "Time.rfc2822" do
+  it_behaves_like :time_rfc2822, :rfc2822
+end

Added: MacRuby/branches/experimental/spec/frozen/library/time/rfc822_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/time/rfc822_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/time/rfc822_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/rfc2822'
+require 'time'
+
+describe "Time.rfc822" do
+  it_behaves_like :time_rfc2822, :rfc822
+end

Added: MacRuby/branches/experimental/spec/frozen/library/time/shared/rfc2822.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/time/shared/rfc2822.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/time/shared/rfc2822.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,65 @@
+describe :time_rfc2822, :shared => true do
+  it "parses RFC-822 strings" do
+    t1 = (Time.utc(1976, 8, 26, 14, 30) + 4 * 3600)
+    t2 = Time.rfc2822("26 Aug 76 14:30 EDT")
+    t1.should == t2
+
+    t3 = Time.utc(1976, 8, 27, 9, 32) + 7 * 3600
+    t4 = Time.rfc2822("27 Aug 76 09:32 PDT")
+    t3.should == t4
+  end
+
+  it "parses RFC-2822 strings" do
+    t1 = Time.utc(1997, 11, 21, 9, 55, 6) + 6 * 3600
+    t2 = Time.rfc2822("Fri, 21 Nov 1997 09:55:06 -0600")
+    t1.should == t2
+
+    t3 = Time.utc(2003, 7, 1, 10, 52, 37) - 2 * 3600
+    t4 = Time.rfc2822("Tue, 1 Jul 2003 10:52:37 +0200")
+    t3.should == t4
+
+    t5 = Time.utc(1997, 11, 21, 10, 1, 10) + 6 * 3600
+    t6 = Time.rfc2822("Fri, 21 Nov 1997 10:01:10 -0600")
+    t5.should == t6
+
+    t7 = Time.utc(1997, 11, 21, 11, 0, 0) + 6 * 3600
+    t8 = Time.rfc2822("Fri, 21 Nov 1997 11:00:00 -0600")
+    t7.should == t8
+
+    t9 = Time.utc(1997, 11, 24, 14, 22, 1) + 8 * 3600
+    t10 = Time.rfc2822("Mon, 24 Nov 1997 14:22:01 -0800")
+    t9.should == t10
+
+    begin
+      Time.at(-1)
+    rescue ArgumentError
+      # ignore
+    else
+      t11 = Time.utc(1969, 2, 13, 23, 32, 54) + 3 * 3600 + 30 * 60
+      t12 = Time.rfc2822("Thu, 13 Feb 1969 23:32:54 -0330")
+      t11.should == t12
+
+      t13 = Time.utc(1969, 2, 13, 23, 32, 0) + 3 * 3600 + 30 * 60
+      t14 = Time.rfc2822(" Thu,
+      13
+        Feb
+          1969
+      23:32
+               -0330 (Newfoundland Time)")
+      t13.should == t14
+    end
+
+    t15 = Time.utc(1997, 11, 21, 9, 55, 6)
+    t16 = Time.rfc2822("21 Nov 97 09:55:06 GMT")
+    t15.should == t16
+
+    t17 = Time.utc(1997, 11, 21, 9, 55, 6) + 6 * 3600
+    t18 = Time.rfc2822("Fri, 21 Nov 1997 09 :   55  :  06 -0600")
+    t17.should == t18
+
+    lambda {
+      # inner comment is not supported.
+      Time.rfc2822("Fri, 21 Nov 1997 09(comment):   55  :  06 -0600")
+    }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/time/shared/xmlschema.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/time/shared/xmlschema.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/time/shared/xmlschema.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,53 @@
+describe :time_xmlschema, :shared => true do
+  it "parses ISO-8601 strings" do
+    t = Time.utc(1985, 4, 12, 23, 20, 50, 520000)
+    s = "1985-04-12T23:20:50.52Z"
+    t.should == Time.xmlschema(s)
+    #s.should == t.xmlschema(2)
+
+    t = Time.utc(1996, 12, 20, 0, 39, 57)
+    s = "1996-12-19T16:39:57-08:00"
+    t.should == Time.xmlschema(s)
+    # There is no way to generate time string with arbitrary timezone.
+    s = "1996-12-20T00:39:57Z"
+    t.should == Time.xmlschema(s)
+    #assert_equal(s, t.xmlschema)
+
+    t = Time.utc(1990, 12, 31, 23, 59, 60)
+    s = "1990-12-31T23:59:60Z"
+    t.should == Time.xmlschema(s)
+    # leap second is representable only if timezone file has it.
+    s = "1990-12-31T15:59:60-08:00"
+    t.should == Time.xmlschema(s)
+
+    begin
+      Time.at(-1)
+    rescue ArgumentError
+      # ignore
+    else
+      t = Time.utc(1937, 1, 1, 11, 40, 27, 870000)
+      s = "1937-01-01T12:00:27.87+00:20"
+      t.should == Time.xmlschema(s)
+    end
+
+    # more
+
+    # (Time.utc(1999, 5, 31, 13, 20, 0) + 5 * 3600).should == Time.xmlschema("1999-05-31T13:20:00-05:00")
+    # (Time.local(2000, 1, 20, 12, 0, 0)).should == Time.xmlschema("2000-01-20T12:00:00")
+    # (Time.utc(2000, 1, 20, 12, 0, 0)).should == Time.xmlschema("2000-01-20T12:00:00Z")
+    # (Time.utc(2000, 1, 20, 12, 0, 0) - 12 * 3600).should == Time.xmlschema("2000-01-20T12:00:00+12:00")
+    # (Time.utc(2000, 1, 20, 12, 0, 0) + 13 * 3600).should == Time.xmlschema("2000-01-20T12:00:00-13:00")
+    # (Time.utc(2000, 3, 4, 23, 0, 0) - 3 * 3600).should == Time.xmlschema("2000-03-04T23:00:00+03:00")
+    # (Time.utc(2000, 3, 4, 20, 0, 0)).should == Time.xmlschema("2000-03-04T20:00:00Z")
+    # (Time.local(2000, 1, 15, 0, 0, 0)).should == Time.xmlschema("2000-01-15T00:00:00")
+    # (Time.local(2000, 2, 15, 0, 0, 0)).should == Time.xmlschema("2000-02-15T00:00:00")
+    # (Time.local(2000, 1, 15, 12, 0, 0)).should == Time.xmlschema("2000-01-15T12:00:00")
+    # (Time.utc(2000, 1, 16, 12, 0, 0)).should == Time.xmlschema("2000-01-16T12:00:00Z")
+    # (Time.local(2000, 1, 1, 12, 0, 0)).should == Time.xmlschema("2000-01-01T12:00:00")
+    # (Time.utc(1999, 12, 31, 23, 0, 0)).should == Time.xmlschema("1999-12-31T23:00:00Z")
+    # (Time.local(2000, 1, 16, 12, 0, 0)).should == Time.xmlschema("2000-01-16T12:00:00")
+    # (Time.local(2000, 1, 16, 0, 0, 0)).should == Time.xmlschema("2000-01-16T00:00:00")
+    # (Time.utc(2000, 1, 12, 12, 13, 14)).should == Time.xmlschema("2000-01-12T12:13:14Z")
+    # (Time.utc(2001, 4, 17, 19, 23, 17, 300000)).should == Time.xmlschema("2001-04-17T19:23:17.3Z")
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/time/xmlschema_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/time/xmlschema_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/time/xmlschema_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/shared/xmlschema'
+require 'time'
+
+describe "Time.xmlschema" do
+  it_behaves_like :time_xmlschema, :xmlschema
+end

Added: MacRuby/branches/experimental/spec/frozen/library/timeout/timeout_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/timeout/timeout_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/timeout/timeout_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,44 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'timeout'
+
+describe "Timeout.timeout" do
+  it "raises Timeout::Error when it times out" do
+    lambda {
+      Timeout::timeout(1) do
+        sleep 3
+      end
+    }.should raise_error(Timeout::Error)
+  end
+  
+  it "shouldn't wait too long" do
+    before_time = Time.now
+    begin
+      Timeout::timeout(1) do
+        sleep 3
+      end
+    rescue Timeout::Error
+      (Time.now - before_time).should < 1.2
+    else
+      1.should == 0  # I can't think of a better way to say "shouldn't get here"
+    end
+  end
+
+  it "shouldn't return too quickly" do
+    before_time = Time.now
+    begin
+      Timeout::timeout(2) do
+        sleep 3
+      end
+    rescue Timeout::Error
+      (Time.now - before_time).should > 1.9
+    else
+      1.should == 0  # I can't think of a better way to say "shouldn't get here"
+    end
+  end
+
+  it "should return back the last value in the block" do
+    Timeout::timeout(1) do
+      42
+    end.should == 42
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/tmpdir/dir/mktmpdir_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/tmpdir/dir/mktmpdir_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/tmpdir/dir/mktmpdir_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,93 @@
+require File.dirname(__FILE__) + "/../../../spec_helper"
+require "tmpdir"
+
+ruby_version_is "1.8.7" do
+  describe "Dir.mktmpdir when passed no arguments" do
+    it "returns the path to the created tmp-dir" do
+      Dir.stub!(:mkdir)
+      Dir.should_receive(:tmpdir).and_return("/tmp")
+      path = Dir.mktmpdir
+      path.should =~ /^\/tmp\//
+    end
+  
+    it "creates a new writable directory in the path provided by Dir.tmpdir" do
+      Dir.should_receive(:tmpdir).and_return(tmp(""))
+      path = Dir.mktmpdir
+      File.directory?(path).should be_true
+      File.writable?(path).should be_true
+    end
+  end
+
+  describe "Dir.mkdir when passed a block" do
+    before(:each) do
+      Dir.stub!(:tmpdir).and_return("/tmp")
+      FileUtils.stub!(:remove_entry_secure)
+    end
+  
+    it "yields the path to the passed block" do
+      Dir.stub!(:mkdir)
+      called = nil
+      Dir.mktmpdir do |path|
+        called = true
+        path.should =~ /^\/tmp\//
+      end
+      called.should be_true
+    end
+  
+    it "creates the tmp-dir before yielding" do
+      Dir.should_receive(:tmpdir).and_return(tmp(""))
+      Dir.mktmpdir do |path|
+        File.directory?(path).should be_true
+        File.writable?(path).should be_true
+      end
+    end
+  
+    it "removes the tmp-dir after executing the block" do
+      Dir.stub!(:mkdir)
+      Dir.mktmpdir do |path|
+        FileUtils.should_receive(:remove_entry_secure).with(path)
+      end
+    end
+  
+    it "returns the blocks return value" do
+      Dir.mktmpdir { :test }.should equal(:test)
+    end
+  end
+
+  describe "Dir.mktmpdir when passed [String]" do
+    before(:each) do
+      Dir.stub!(:mkdir)
+      Dir.stub!(:tmpdir).and_return("/tmp")
+    end
+
+    it "uses the passed String as a prefix to the tmp-directory" do
+      prefix = "before"
+      path = Dir.mktmpdir(prefix)
+      path.should =~ /^\/tmp\/#{prefix}/
+    end
+  end
+
+  describe "Dir.mktmpdir when passed [Array]" do
+    before(:each) do
+      Dir.stub!(:mkdir)
+      Dir.stub!(:tmpdir).and_return("/tmp")
+      FileUtils.stub!(:remove_entry_secure)
+    end
+
+    it "uses the first element of the passed Array as a prefix and the scond element as a suffix to the tmp-directory" do
+      prefix = "before"
+      suffix = "after"
+    
+      path = Dir.mktmpdir([prefix, suffix])
+      path.should =~ /#{suffix}$/
+    end
+  end
+
+  describe "Dir.mktmpdir when passed [Object]" do
+    it "raises an ArgumentError" do
+      lambda { Dir.mktmpdir(Object.new) }.should raise_error(ArgumentError)
+      lambda { Dir.mktmpdir(:symbol) }.should raise_error(ArgumentError)
+      lambda { Dir.mktmpdir(10) }.should raise_error(ArgumentError)
+    end
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/tmpdir/dir/tmpdir_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/tmpdir/dir/tmpdir_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/tmpdir/dir/tmpdir_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + "/../../../spec_helper"
+require "tmpdir"
+
+describe "Dir.tmpdir" do
+  it "returns the path to a writable and readable directory" do
+    dir = Dir.tmpdir
+    File.directory?(dir).should be_true 
+    File.writable?(dir).should be_true
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/uri/equality_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/uri/equality_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/uri/equality_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'uri'
+
+describe "URI#==" do
+  it "ignores capitalization of host names and scheme names" do
+    URI("http://exAMPLE.cOm").should == URI("http://example.com")
+  end
+  
+  it "treats a blank path and a path of '/' as the same" do
+    URI("http://example.com").should == URI("http://example.com/")
+  end
+  
+  it "is case sensitive in all components of the URI but the host and scheme" do
+    URI("hTTp://example.com").should_not == URI("http://example.com")    
+    URI("http://example.com/paTH").should_not == URI("http://example.com/path")
+    URI("http://uSer@example.com").should_not == URI("http://user@example.com")            
+    URI("http://example.com/path?quERy").should_not == URI("http://example.com/?query")
+    URI("http://example.com/#fragMENT").should_not == URI("http://example.com#fragment")            
+  end
+  
+  it "differentiates based on port number" do
+    URI("http://example.com:8080").should_not == URI("http://example.com")
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/uri/extract_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/uri/extract_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/uri/extract_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,86 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'uri'
+
+describe "URI.extract" do
+  it "behaves according to its documentation" do
+    URI.extract("text here http://foo.example.org/bla and here mailto:test at example.com and here also.").should == ["http://foo.example.org/bla", "mailto:test at example.com"]
+  end
+
+  it "treats contiguous URIs as a single URI" do
+    URI.extract('http://example.jphttp://example.jp').should == ['http://example.jphttp://example.jp']
+  end
+
+  it "treats pretty much anything with a colon as a URI" do
+    URI.extract('From: XXX [mailto:xxx at xxx.xxx.xxx]').should == ['From:', 'mailto:xxx at xxx.xxx.xxx]']
+  end
+
+  it "wraps a URI string in an array" do
+    URI.extract("http://github.com/brixen/rubyspec/tree/master").should == ["http://github.com/brixen/rubyspec/tree/master"]
+  end
+  
+  it "pulls a variety of protocol URIs from a string" do
+    URI.extract("this is a string, it has http://rubini.us/ in it").should == ["http://rubini.us/"]
+    URI.extract("mailto:spambait at example.com").should == ["mailto:spambait at example.com"]
+    URI.extract("ftp://ruby-lang.org/").should == ["ftp://ruby-lang.org/"]
+    URI.extract("https://mail.google.com").should == ["https://mail.google.com"]
+    URI.extract("anything://example.com/").should == ["anything://example.com/"]
+  end
+  
+  it "pulls all URIs within a string in order into an array when a block is not given" do
+    URI.extract("1.3. Example URI
+
+       The following examples illustrate URI that are in common use.
+
+       ftp://ftp.is.co.za/rfc/rfc1808.txt
+          -- ftp scheme for File Transfer Protocol services
+
+       gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles
+          -- gopher scheme for Gopher and Gopher+ Protocol services
+
+       http://www.math.uio.no/faq/compression-faq/part1.html
+          -- http scheme for Hypertext Transfer Protocol services
+
+       mailto:mduerst at ifi.unizh.ch
+          -- mailto scheme for electronic mail addresses
+
+       news:comp.infosystems.www.servers.unix
+          -- news scheme for USENET news groups and articles
+
+       telnet://melvyl.ucop.edu/
+          -- telnet scheme for interactive services via the TELNET Protocol
+    ").should == ["ftp://ftp.is.co.za/rfc/rfc1808.txt","gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles","http://www.math.uio.no/faq/compression-faq/part1.html","mailto:mduerst@ifi.unizh.ch","news:comp.infosystems.www.servers.unix","telnet://melvyl.ucop.edu/"]
+  end
+  
+  it "yields each URI in the given string in order to a block, if given, and returns nil" do
+    results = ["http://foo.example.org/bla", "mailto:test at example.com"]
+    URI.extract("text here http://foo.example.org/bla and here mailto:test at example.com and here also.") {|uri|
+      uri.should == results.shift
+    }.should == nil
+    results.should == []
+  end
+  
+  it "allows the user to specify a list of acceptable protocols of URIs to scan for" do
+    URI.extract("1.3. Example URI
+
+       The following examples illustrate URI that are in common use.
+
+       ftp://ftp.is.co.za/rfc/rfc1808.txt
+          -- ftp scheme for File Transfer Protocol services
+
+       gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles
+          -- gopher scheme for Gopher and Gopher+ Protocol services
+
+       http://www.math.uio.no/faq/compression-faq/part1.html
+          -- http scheme for Hypertext Transfer Protocol services
+
+       mailto:mduerst at ifi.unizh.ch
+          -- mailto scheme for electronic mail addresses
+
+       news:comp.infosystems.www.servers.unix
+          -- news scheme for USENET news groups and articles
+
+       telnet://melvyl.ucop.edu/
+          -- telnet scheme for interactive services via the TELNET Protocol
+    ", ["http","ftp","mailto"]).should == ["ftp://ftp.is.co.za/rfc/rfc1808.txt","http://www.math.uio.no/faq/compression-faq/part1.html","mailto:mduerst@ifi.unizh.ch"]
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/uri/fixtures/classes.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/uri/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/uri/fixtures/classes.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require 'uri'
+
+module URISpec
+  def self.components(uri)
+    result = {}
+    uri.component.each do |component|
+      result[component] = uri.send(component)
+    end
+    result
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/uri/http/request_uri_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/uri/http/request_uri_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/uri/http/request_uri_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'uri'
+
+describe "URI::HTTP.request_uri" do
+  it "returns a string of the path + query" do
+    URI("http://reddit.com/r/ruby/").request_uri.should == "/r/ruby/"
+    URI("http://reddit.com/r/ruby/search?q=rubinius").request_uri.should == "/r/ruby/search?q=rubinius"
+  end
+  
+  it "returns '/' if the path of the URI is blank" do
+    URI("http://ruby.reddit.com").request_uri.should == "/"
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/uri/join_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/uri/join_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/uri/join_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'uri'
+
+describe "URI.join" do
+  it "returns a URI object of the concatonation of a protocol and domain, and a path" do
+    URI.join("http://localhost/","main.rbx").should == URI.parse("http://localhost/main.rbx")
+  end
+  
+  it "doesn't create redundent '/'s" do
+    URI.join("http://localhost/", "/main.rbx").should == URI.parse("http://localhost/main.rbx")
+  end
+end
+
+
+# assert_equal(URI.parse('http://foo/bar'), URI.join('http://foo/bar'))
+# assert_equal(URI.parse('http://foo/bar'), URI.join('http://foo', 'bar'))
+# assert_equal(URI.parse('http://foo/bar/'), URI.join('http://foo', 'bar/'))
+# 
+# assert_equal(URI.parse('http://foo/baz'), URI.join('http://foo', 'bar', 'baz'))
+# assert_equal(URI.parse('http://foo/baz'), URI.join('http://foo', 'bar', '/baz'))
+# assert_equal(URI.parse('http://foo/baz/'), URI.join('http://foo', 'bar', '/baz/'))
+# assert_equal(URI.parse('http://foo/bar/baz'), URI.join('http://foo', 'bar/', 'baz'))
+# assert_equal(URI.parse('http://foo/hoge'), URI.join('http://foo', 'bar', 'baz', 'hoge'))
+# 
+# assert_equal(URI.parse('http://foo/bar/baz'), URI.join('http://foo', 'bar/baz'))
+# assert_equal(URI.parse('http://foo/bar/hoge'), URI.join('http://foo', 'bar/baz', 'hoge'))
+# assert_equal(URI.parse('http://foo/bar/baz/hoge'), URI.join('http://foo', 'bar/baz/', 'hoge'))
+# assert_equal(URI.parse('http://foo/hoge'), URI.join('http://foo', 'bar/baz', '/hoge'))
+# assert_equal(URI.parse('http://foo/bar/hoge'), URI.join('http://foo', 'bar/baz', 'hoge'))
+# assert_equal(URI.parse('http://foo/bar/baz/hoge'), URI.join('http://foo', 'bar/baz/', 'hoge'))
+# assert_equal(URI.parse('http://foo/hoge'), URI.join('http://foo', 'bar/baz', '/hoge'))

Added: MacRuby/branches/experimental/spec/frozen/library/uri/mailto/build_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/uri/mailto/build_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/uri/mailto/build_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,95 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'uri'
+
+describe 'URI::Mailto.build' do
+  it "conforms to the MatzRuby tests" do
+    ok = []
+    bad = []
+
+    # RFC2368, 6. Examples
+    # mailto:chris at example.com
+    ok << ["mailto:chris at example.com"]
+    ok[-1] << ["chris at example.com", nil]
+    ok[-1] << {:to => "chris at example.com"}
+
+    # mailto:infobot at example.com?subject=current-issue
+    ok << ["mailto:infobot at example.com?subject=current-issue"]
+    ok[-1] << ["infobot at example.com", ["subject=current-issue"]]
+    ok[-1] << {:to => "infobot at example.com", 
+      :headers => ["subject=current-issue"]}
+
+    # mailto:infobot at example.com?body=send%20current-issue
+    ok << ["mailto:infobot at example.com?body=send%20current-issue"]
+    ok[-1] << ["infobot at example.com", ["body=send%20current-issue"]]
+    ok[-1] << {:to => "infobot at example.com", 
+      :headers => ["body=send%20current-issue"]}
+
+    # mailto:infobot at example.com?body=send%20current-issue%0D%0Asend%20index
+    ok << ["mailto:infobot at example.com?body=send%20current-issue%0D%0Asend%20index"]
+    ok[-1] << ["infobot at example.com", 
+      ["body=send%20current-issue%0D%0Asend%20index"]]
+    ok[-1] << {:to => "infobot at example.com", 
+      :headers => ["body=send%20current-issue%0D%0Asend%20index"]}
+
+    # mailto:foobar at example.com?In-Reply-To=%3c3469A91.D10AF4C at example.com
+    ok << ["mailto:foobar at example.com?In-Reply-To=%3c3469A91.D10AF4C at example.com"]
+    ok[-1] << ["foobar at example.com", 
+      ["In-Reply-To=%3c3469A91.D10AF4C at example.com"]]
+    ok[-1] << {:to => "foobar at example.com", 
+      :headers => ["In-Reply-To=%3c3469A91.D10AF4C at example.com"]}
+
+    # mailto:majordomo at example.com?body=subscribe%20bamboo-l
+    ok << ["mailto:majordomo at example.com?body=subscribe%20bamboo-l"]
+    ok[-1] << ["majordomo at example.com", ["body=subscribe%20bamboo-l"]]
+    ok[-1] << {:to => "majordomo at example.com", 
+      :headers => ["body=subscribe%20bamboo-l"]}
+
+    # mailto:joe at example.com?cc=bob at example.com&body=hello
+    ok << ["mailto:joe at example.com?cc=bob at example.com&body=hello"]
+    ok[-1] << ["joe at example.com", ["cc=bob at example.com", "body=hello"]]
+    ok[-1] << {:to => "joe at example.com", 
+      :headers => ["cc=bob at example.com", "body=hello"]}
+
+    # mailto:?to=joe at example.com&cc=bob at example.com&body=hello
+    ok << ["mailto:?to=joe at example.com&cc=bob at example.com&body=hello"]
+    ok[-1] << [nil, 
+      ["to=joe at example.com", "cc=bob at example.com", "body=hello"]]
+    ok[-1] << {:headers => ["to=joe at example.com", 
+	"cc=bob at example.com", "body=hello"]}
+
+    # mailto:gorby%25kremvax at example.com
+    ok << ["mailto:gorby%25kremvax at example.com"]
+    ok[-1] << ["gorby%25kremvax at example.com", nil]
+    ok[-1] << {:to => "gorby%25kremvax at example.com"}
+
+    # mailto:unlikely%3Faddress at example.com?blat=foop
+    ok << ["mailto:unlikely%3Faddress at example.com?blat=foop"]
+    ok[-1] << ["unlikely%3Faddress at example.com", ["blat=foop"]]
+    ok[-1] << {:to => "unlikely%3Faddress at example.com", 
+      :headers => ["blat=foop"]}
+
+    ok_all = ok.flatten.join("\0")
+
+    # mailto:joe at example.com?cc=bob at example.com?body=hello   ; WRONG!
+    bad << ["joe at example.com", ["cc=bob at example.com?body=hello"]]
+
+    # mailto:javascript:alert()
+    bad << ["javascript:alert()", []]
+
+    # '=' which is in hname or hvalue is wrong.
+    bad << ["foo at example.jp?subject=1+1=2", []]
+
+    ok.each do |x|
+      URI::MailTo.build(x[1]).to_s.should == x[0]
+      URI::MailTo.build(x[2]).to_s.should == x[0]
+    end
+
+    bad.each do |x|
+      lambda { URI::MailTo.build(x) }.should raise_error(URI::InvalidComponentError)
+    end
+
+    ok.flatten.join("\0").should == ok_all
+  end
+end
+
+

Added: MacRuby/branches/experimental/spec/frozen/library/uri/normalize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/uri/normalize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/uri/normalize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'uri'
+
+describe "URI#normalize" do
+  it "adds a / onto the end of the URI if the path is blank" do
+    no_path = URI("http://example.com")
+    no_path.to_s.should_not == "http://example.com/"
+    no_path.normalize.to_s.should == "http://example.com/"
+  end
+  
+  it "downcases the host of the URI" do
+    uri = URI("http://exAMPLE.cOm/")
+    uri.to_s.should_not == "http://example.com/"
+    uri.normalize.to_s.should == "http://example.com/"
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/uri/parse_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/uri/parse_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/uri/parse_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,249 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "URI.parse" do
+
+  it "returns a URI::HTTP object when parsing an HTTP URI" do
+    URI.parse("http://www.example.com/").should be_kind_of(URI::HTTP)
+  end
+  
+  it "populates the components of a parsed URI::HTTP, setting the port to 80 by default" do
+    # general case
+    URISpec.components(URI.parse("http://user:pass@example.com/path/?query=val&q2=val2#fragment")).should == {
+      :scheme => "http",
+      :userinfo => "user:pass",
+      :host => "example.com",
+      :port => 80,
+      :path => "/path/",
+      :query => "query=val&q2=val2",
+      :fragment => "fragment"
+    }
+
+    # multiple paths
+    URISpec.components(URI.parse("http://a/b/c/d;p?q")).should == { 
+      :scheme => "http",
+      :userinfo => nil,
+      :host => "a",
+      :port => 80,
+      :path => "/b/c/d;p",
+      :query => "q",
+      :fragment => nil
+    }
+    
+    # multi-level domain
+    URISpec.components(URI.parse('http://www.math.uio.no/faq/compression-faq/part1.html')).should == { 
+      :scheme => "http",
+      :userinfo => nil,
+      :host => "www.math.uio.no",
+      :port => 80,
+      :path => "/faq/compression-faq/part1.html",
+      :query => nil,
+      :fragment => nil
+    }
+  end
+
+  it "parses out the port number of a URI, when given" do
+    URI.parse("http://example.com:8080/").port.should == 8080    
+  end
+  
+  it "returns a URI::HTTPS object when parsing an HTTPS URI" do
+    URI.parse("https://important-intern-net.net").should be_kind_of(URI::HTTPS)
+  end
+  
+  it "sets the port of a parsed https URI to 443 by default" do
+    URI.parse("https://example.com/").port.should == 443
+  end
+
+  ruby_version_is "".."1.8.6" do
+    it "populates the components of a parsed URI::FTP object" do
+      # generic, empty password.
+      url = URI.parse("ftp://anonymous@ruby-lang.org/pub/ruby/1.8/ruby-1.8.6.tar.bz2;type=i")
+      url.should be_kind_of(URI::FTP)
+      URISpec.components(url).should == {
+        :scheme => "ftp",
+        :userinfo => "anonymous",
+        :host => "ruby-lang.org",
+        :port => 21,
+        :path => "pub/ruby/1.8/ruby-1.8.6.tar.bz2",
+        :typecode => "i"
+      }
+
+      # multidomain, no user or password
+      url = URI.parse('ftp://ftp.is.co.za/rfc/rfc1808.txt')
+      url.should be_kind_of(URI::FTP)
+      URISpec.components(url).should == { 
+        :scheme => "ftp",
+        :userinfo => nil,
+        :host => "ftp.is.co.za",
+        :port => 21,
+        :path => "rfc/rfc1808.txt",
+        :typecode => nil
+      }
+
+      # empty user
+      url = URI.parse('ftp://:pass@localhost/')
+      url.should be_kind_of(URI::FTP)
+      URISpec.components(url).should == { 
+        :scheme => "ftp",
+        :userinfo => ":pass",
+        :host => "localhost",
+        :port => 21,
+        :path => "/",
+        :typecode => nil
+      }
+      url.password.should == "pass"
+
+    end
+  end
+
+  ruby_version_is "1.8.7".."" do
+    it "populates the components of a parsed URI::FTP object" do
+      # generic, empty password.
+      url = URI.parse("ftp://anonymous@ruby-lang.org/pub/ruby/1.8/ruby-1.8.6.tar.bz2;type=i")
+      url.should be_kind_of(URI::FTP)
+      URISpec.components(url).should == {
+        :scheme => "ftp",
+        :userinfo => "anonymous",
+        :host => "ruby-lang.org",
+        :port => 21,
+        :path => "/pub/ruby/1.8/ruby-1.8.6.tar.bz2",
+        :typecode => "i"
+      }
+
+      # multidomain, no user or password
+      url = URI.parse('ftp://ftp.is.co.za/rfc/rfc1808.txt')
+      url.should be_kind_of(URI::FTP)
+      URISpec.components(url).should == { 
+        :scheme => "ftp",
+        :userinfo => nil,
+        :host => "ftp.is.co.za",
+        :port => 21,
+        :path => "/rfc/rfc1808.txt",
+        :typecode => nil
+      }
+
+      # empty user
+      url = URI.parse('ftp://:pass@localhost/')
+      url.should be_kind_of(URI::FTP)
+      URISpec.components(url).should == { 
+        :scheme => "ftp",
+        :userinfo => ":pass",
+        :host => "localhost",
+        :port => 21,
+        :path => "/",
+        :typecode => nil
+      }
+      url.password.should == "pass"
+
+    end
+  end
+
+
+  it "returns a URI::LDAP object when parsing an LDAP URI" do
+    #taken from http://www.faqs.org/rfcs/rfc2255.html 'cause I don't really know what an LDAP url looks like
+    ldap_uris = %w{ ldap:///o=University%20of%20Michigan,c=US ldap://ldap.itd.umich.edu/o=University%20of%20Michigan,c=US ldap://ldap.itd.umich.edu/o=University%20of%20Michigan,c=US?postalAddress ldap://host.com:6666/o=University%20of%20Michigan,c=US??sub?(cn=Babs%20Jensen) ldap://ldap.itd.umich.edu/c=GB?objectClass?one ldap://ldap.question.com/o=Question%3f,c=US?mail ldap://ldap.netscape.com/o=Babsco,c=US??(int=%5c00%5c00%5c00%5c04) ldap:///??sub??bindname=cn=Manager%2co=Foo ldap:///??sub??!bindname=cn=Manager%2co=Foo }
+    ldap_uris.each do |ldap_uri|
+      URI.parse(ldap_uri).should be_kind_of(URI::LDAP)
+    end
+  end
+  
+  it "populates the components of a parsed URI::LDAP object" do
+    URISpec.components(URI.parse("ldap://ldap.itd.umich.edu/o=University%20of%20Michigan,c=US?postalAddress?scope?filter?extensions")).should == {
+      :scheme => "ldap",
+      :host => "ldap.itd.umich.edu",
+      :port => 389,
+      :dn => "o=University%20of%20Michigan,c=US",
+      :attributes => "postalAddress",
+      :scope => "scope",
+      :filter => "filter",
+      :extensions => "extensions"
+    }
+  end
+  
+  it "returns a URI::MailTo object when passed a mailto URI" do
+    URI.parse("mailto:spam at mailinator.com").should be_kind_of(URI::MailTo)
+  end
+  
+  it "populates the components of a parsed URI::MailTo object" do
+    URISpec.components(URI.parse("mailto:spam at mailinator.com?subject=Discounts%20On%20Imported%20methods!!!&body=Exciting%20offer")).should == {
+      :scheme => "mailto",
+      :to => "spam at mailinator.com",
+      :headers => [["subject","Discounts%20On%20Imported%20methods!!!"],
+                   ["body", "Exciting%20offer"]]
+    }
+  end
+  
+  # TODO
+  # Test registry 
+  it "does its best to extract components from URI::Generic objects" do
+    # generic
+    URISpec.components(URI("scheme://userinfo@host/path?query#fragment")).should == {
+      :scheme => "scheme",
+      :userinfo => "userinfo",
+      :host => "host",
+      :port => nil,
+      :path => "/path",
+      :query => "query",
+      :fragment => "fragment",
+      :registry => nil,
+      :opaque => nil
+    }
+
+    # gopher
+    gopher = URI.parse('gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles')
+    gopher.should be_kind_of(URI::Generic)
+
+    URISpec.components(gopher).should == { 
+      :scheme => "gopher",
+      :userinfo => nil,
+      :host => "spinaltap.micro.umn.edu",
+      :port => nil,
+      :path => "/00/Weather/California/Los%20Angeles",
+      :query => nil,
+      :fragment => nil,
+      :registry => nil,
+      :opaque => nil
+    }
+
+    # news
+    news = URI.parse('news:comp.infosystems.www.servers.unix')
+    news.should be_kind_of(URI::Generic)
+    URISpec.components(news).should == { 
+      :scheme => "news",
+      :userinfo => nil,
+      :host => nil,
+      :port => nil,
+      :path => nil,
+      :query => nil,
+      :fragment => nil,
+      :registry => nil,
+      :opaque => "comp.infosystems.www.servers.unix"
+    }
+
+    # telnet
+    telnet = URI.parse('telnet://melvyl.ucop.edu/')
+    telnet.should be_kind_of(URI::Generic)
+    URISpec.components(telnet).should == { 
+      :scheme => "telnet",
+      :userinfo => nil,
+      :host => "melvyl.ucop.edu",
+      :port => nil,
+      :path => "/",
+      :query => nil,
+      :fragment => nil,
+      :registry => nil,
+      :opaque => nil
+    }
+
+    # files
+    file_l = URI.parse('file:///foo/bar.txt')
+    file_l.should be_kind_of(URI::Generic)
+    file = URI.parse('file:/foo/bar.txt')
+    file.should be_kind_of(URI::Generic)
+  end
+
+  it "raises errors on malformed URIs" do
+    lambda { URI.parse('http://a_b:80/') }.should raise_error(URI::InvalidURIError)
+    lambda { URI.parse('http://a_b/') }.should raise_error(URI::InvalidURIError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/uri/plus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/uri/plus_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/uri/plus_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,489 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'uri'
+
+#an alias of URI#merge
+describe "URI#+" do
+  it "replaces the end of the path of the URI when added to a string that looks like a relative path" do
+    (URI('http://foo') + 'bar').should == URI("http://foo/bar")
+    (URI('http://foo/baz') + 'bar').should == URI("http://foo/bar")
+    (URI('http://foo/baz/') + 'bar').should == URI("http://foo/baz/bar")
+    (URI('mailto:foo at example.com') + "#bar").should == URI("mailto:foo at example.com#bar")
+  end
+  
+  it "replaces the entire path of the URI when added to a string that begins with a /" do
+    (URI('http://foo/baz/') + '/bar').should == URI("http://foo/bar")
+  end
+  
+  it "replaces the entire url when added to a string that looks like a full url" do
+    (URI.parse('http://a/b') + 'http://x/y').should == URI("http://x/y")
+    (URI.parse('telnet:example.com') + 'http://x/y').should == URI("http://x/y")
+  end
+  
+  it "canonicalizes the URI's path, removing ../'s" do
+    (URI.parse('http://a/b/c/../') + "./").should == URI("http://a/b/")
+    (URI.parse('http://a/b/c/../') + ".").should == URI("http://a/b/")
+    (URI.parse('http://a/b/c/')   + "../").should == URI("http://a/b/")
+    (URI.parse('http://a/b/c/../../') + "./").should == URI("http://a/")
+    (URI.parse('http://a/b/c/')   + "../e/").should == URI("http://a/b/e/")
+    (URI.parse('http://a/b/c/')   + "../e/../").should == URI("http://a/b/")
+    (URI.parse('http://a/b/../c/') + ".").should == URI("http://a/c/")
+
+    (URI.parse('http://a/b/c/../../../') + ".").should == URI("http://a/")    
+  end
+  
+  it "doesn't conconicalize the path when adding to the empty string" do
+    (URI.parse('http://a/b/c/../') + "").should == URI("http://a/b/c/../")
+  end
+  
+  it "raises a URI::BadURIError when adding two relative URIs" do
+    lambda {URI.parse('a/b/c') + "d"}.should raise_error(URI::BadURIError)
+  end
+  
+  #Todo: make more BDD?
+  it "conforms to the merge specifications from rfc 2396" do
+    @url = 'http://a/b/c/d;p?q'
+    @base_url = URI.parse(@url)
+
+#  http://a/b/c/d;p?q
+#        g:h           =  g:h
+    url = @base_url.merge('g:h')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == 'g:h'
+    url = @base_url.route_to('g:h')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == 'g:h'
+
+#  http://a/b/c/d;p?q
+#        g             =  http://a/b/c/g
+    url = @base_url.merge('g')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/c/g'
+    url = @base_url.route_to('http://a/b/c/g')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == 'g'
+
+#  http://a/b/c/d;p?q
+#        ./g           =  http://a/b/c/g
+    url = @base_url.merge('./g')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/c/g'
+    url = @base_url.route_to('http://a/b/c/g')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should_not == './g' # ok
+    url.to_s.should == 'g'
+
+#  http://a/b/c/d;p?q
+#        g/            =  http://a/b/c/g/
+    url = @base_url.merge('g/')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/c/g/'
+    url = @base_url.route_to('http://a/b/c/g/')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == 'g/'
+
+#  http://a/b/c/d;p?q
+#        /g            =  http://a/g
+    url = @base_url.merge('/g')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/g'
+    url = @base_url.route_to('http://a/g')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should_not == '/g' # ok
+    url.to_s.should == '../../g'
+
+#  http://a/b/c/d;p?q
+#        //g           =  http://g
+    url = @base_url.merge('//g')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://g'
+    url = @base_url.route_to('http://g')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == '//g'
+
+#  http://a/b/c/d;p?q
+#        ?y            =  http://a/b/c/?y
+    url = @base_url.merge('?y')
+    url.should be_kind_of(URI::HTTP)
+    
+    ruby_version_is "" ... "1.8.7" do
+      url.to_s.should == 'http://a/b/c/?y'
+    end
+    
+    ruby_version_is "1.8.7" do
+      url.to_s.should == 'http://a/b/c/d;p?y'
+    end
+    
+    url = @base_url.route_to('http://a/b/c/?y')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == '?y'
+
+#  http://a/b/c/d;p?q
+#        g?y           =  http://a/b/c/g?y
+    url = @base_url.merge('g?y')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/c/g?y'
+    url = @base_url.route_to('http://a/b/c/g?y')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == 'g?y'
+
+#  http://a/b/c/d;p?q
+#        #s            =  (current document)#s
+    url = @base_url.merge('#s')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == @base_url.to_s + '#s'
+    url = @base_url.route_to(@base_url.to_s + '#s')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == '#s'
+
+#  http://a/b/c/d;p?q
+#        g#s           =  http://a/b/c/g#s
+    url = @base_url.merge('g#s')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/c/g#s'
+    url = @base_url.route_to('http://a/b/c/g#s')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == 'g#s'
+
+#  http://a/b/c/d;p?q
+#        g?y#s         =  http://a/b/c/g?y#s
+    url = @base_url.merge('g?y#s')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/c/g?y#s'
+    url = @base_url.route_to('http://a/b/c/g?y#s')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == 'g?y#s'
+
+#  http://a/b/c/d;p?q
+#        ;x            =  http://a/b/c/;x
+    url = @base_url.merge(';x')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/c/;x'
+    url = @base_url.route_to('http://a/b/c/;x')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == ';x'
+
+#  http://a/b/c/d;p?q
+#        g;x           =  http://a/b/c/g;x
+    url = @base_url.merge('g;x')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/c/g;x'
+    url = @base_url.route_to('http://a/b/c/g;x')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == 'g;x'
+
+#  http://a/b/c/d;p?q
+#        g;x?y#s       =  http://a/b/c/g;x?y#s
+    url = @base_url.merge('g;x?y#s')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/c/g;x?y#s'
+    url = @base_url.route_to('http://a/b/c/g;x?y#s')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == 'g;x?y#s'
+
+#  http://a/b/c/d;p?q
+#        .             =  http://a/b/c/
+    url = @base_url.merge('.')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/c/'
+    url = @base_url.route_to('http://a/b/c/')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should_not == '.' # ok
+    url.to_s.should == './'
+
+#  http://a/b/c/d;p?q
+#        ./            =  http://a/b/c/
+    url = @base_url.merge('./')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/c/'
+    url = @base_url.route_to('http://a/b/c/')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == './'
+
+#  http://a/b/c/d;p?q
+#        ..            =  http://a/b/
+    url = @base_url.merge('..')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/'
+    url = @base_url.route_to('http://a/b/')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should_not == '..' # ok
+    url.to_s.should == '../'
+
+#  http://a/b/c/d;p?q
+#        ../           =  http://a/b/
+    url = @base_url.merge('../')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/'
+    url = @base_url.route_to('http://a/b/')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == '../'
+
+#  http://a/b/c/d;p?q
+#        ../g          =  http://a/b/g
+    url = @base_url.merge('../g')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/g'
+    url = @base_url.route_to('http://a/b/g')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == '../g'
+
+#  http://a/b/c/d;p?q
+#        ../..         =  http://a/
+    url = @base_url.merge('../..')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/'
+    url = @base_url.route_to('http://a/')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should_not == '../..' # ok
+    url.to_s.should == '../../'
+
+#  http://a/b/c/d;p?q
+#        ../../        =  http://a/
+    url = @base_url.merge('../../')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/'
+    url = @base_url.route_to('http://a/')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == '../../'
+
+#  http://a/b/c/d;p?q
+#        ../../g       =  http://a/g
+    url = @base_url.merge('../../g')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/g'
+    url = @base_url.route_to('http://a/g')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == '../../g'
+
+#  http://a/b/c/d;p?q
+#        <>            =  (current document)
+    url = @base_url.merge('')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/c/d;p?q'
+    url = @base_url.route_to('http://a/b/c/d;p?q')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == ''
+
+#  http://a/b/c/d;p?q
+#        /./g          =  http://a/./g
+    url = @base_url.merge('/./g')
+    url.should be_kind_of(URI::HTTP)
+    
+    ruby_version_is "" ... "1.8.7" do
+      url.to_s.should == 'http://a/./g'
+    end
+    
+    ruby_version_is "1.8.7" do
+      url.to_s.should == 'http://a/g'
+    end
+    
+    url = @base_url.route_to('http://a/./g')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == '/./g'
+
+#  http://a/b/c/d;p?q
+#        /../g         =  http://a/../g
+    url = @base_url.merge('/../g')
+    url.should be_kind_of(URI::HTTP)
+    
+    ruby_version_is "" ... "1.8.7" do
+      url.to_s.should == 'http://a/../g'
+    end
+    
+    ruby_version_is "1.8.7" do
+      url.to_s.should == 'http://a/g'
+    end
+    
+    url = @base_url.route_to('http://a/../g')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == '/../g'
+
+#  http://a/b/c/d;p?q
+#        g.            =  http://a/b/c/g.
+    url = @base_url.merge('g.')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/c/g.'
+    url = @base_url.route_to('http://a/b/c/g.')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == 'g.'
+
+#  http://a/b/c/d;p?q
+#        .g            =  http://a/b/c/.g
+    url = @base_url.merge('.g')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/c/.g'
+    url = @base_url.route_to('http://a/b/c/.g')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == '.g'
+
+#  http://a/b/c/d;p?q
+#        g..           =  http://a/b/c/g..
+    url = @base_url.merge('g..')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/c/g..'
+    url = @base_url.route_to('http://a/b/c/g..')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == 'g..'
+
+#  http://a/b/c/d;p?q
+#        ..g           =  http://a/b/c/..g
+    url = @base_url.merge('..g')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/c/..g'
+    url = @base_url.route_to('http://a/b/c/..g')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == '..g'
+
+#  http://a/b/c/d;p?q
+#        ../../../g    =  http://a/../g
+    url = @base_url.merge('../../../g')
+    url.should be_kind_of(URI::HTTP)
+
+    ruby_version_is "" ... "1.8.7" do
+      url.to_s.should == 'http://a/../g'
+    end
+    
+    ruby_version_is "1.8.7" do
+      url.to_s.should == 'http://a/g'
+    end
+
+    url = @base_url.route_to('http://a/../g')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should_not == '../../../g' # ok? yes, it confuses you
+    url.to_s.should == '/../g'  # and it is clearly
+
+#  http://a/b/c/d;p?q
+#        ../../../../g =  http://a/../../g
+    url = @base_url.merge('../../../../g')
+    url.should be_kind_of(URI::HTTP)
+
+    ruby_version_is "" ... "1.8.7" do
+      url.to_s.should == 'http://a/../../g'
+    end
+    
+    ruby_version_is "1.8.7" do
+      url.to_s.should == 'http://a/g'
+    end
+
+    url = @base_url.route_to('http://a/../../g')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should_not == '../../../../g' # ok? yes, it confuses you
+    url.to_s.should == '/../../g'  # and it is clearly
+
+#  http://a/b/c/d;p?q
+#        ./../g        =  http://a/b/g
+    url = @base_url.merge('./../g')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/g'
+    url = @base_url.route_to('http://a/b/g')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should_not == './../g' # ok
+    url.to_s.should == '../g'
+
+#  http://a/b/c/d;p?q
+#        ./g/.         =  http://a/b/c/g/
+    url = @base_url.merge('./g/.')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/c/g/'
+    url = @base_url.route_to('http://a/b/c/g/')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should_not == './g/.' # ok
+    url.to_s.should == 'g/'
+
+#  http://a/b/c/d;p?q
+#        g/./h         =  http://a/b/c/g/h
+    url = @base_url.merge('g/./h')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/c/g/h'
+    url = @base_url.route_to('http://a/b/c/g/h')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should_not == 'g/./h' # ok
+    url.to_s.should == 'g/h'
+
+#  http://a/b/c/d;p?q
+#        g/../h        =  http://a/b/c/h
+    url = @base_url.merge('g/../h')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/c/h'
+    url = @base_url.route_to('http://a/b/c/h')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should_not == 'g/../h' # ok
+    url.to_s.should == 'h'
+
+#  http://a/b/c/d;p?q
+#        g;x=1/./y     =  http://a/b/c/g;x=1/y
+    url = @base_url.merge('g;x=1/./y')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/c/g;x=1/y'
+    url = @base_url.route_to('http://a/b/c/g;x=1/y')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should_not == 'g;x=1/./y' # ok
+    url.to_s.should == 'g;x=1/y'
+
+#  http://a/b/c/d;p?q
+#        g;x=1/../y    =  http://a/b/c/y
+    url = @base_url.merge('g;x=1/../y')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/c/y'
+    url = @base_url.route_to('http://a/b/c/y')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should_not == 'g;x=1/../y' # ok
+    url.to_s.should == 'y'
+
+#  http://a/b/c/d;p?q
+#        g?y/./x       =  http://a/b/c/g?y/./x
+    url = @base_url.merge('g?y/./x')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/c/g?y/./x'
+    url = @base_url.route_to('http://a/b/c/g?y/./x')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == 'g?y/./x'
+
+#  http://a/b/c/d;p?q
+#        g?y/../x      =  http://a/b/c/g?y/../x
+    url = @base_url.merge('g?y/../x')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/c/g?y/../x'
+    url = @base_url.route_to('http://a/b/c/g?y/../x')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == 'g?y/../x'
+
+#  http://a/b/c/d;p?q
+#        g#s/./x       =  http://a/b/c/g#s/./x
+    url = @base_url.merge('g#s/./x')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/c/g#s/./x'
+    url = @base_url.route_to('http://a/b/c/g#s/./x')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == 'g#s/./x'
+
+#  http://a/b/c/d;p?q
+#        g#s/../x      =  http://a/b/c/g#s/../x
+    url = @base_url.merge('g#s/../x')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http://a/b/c/g#s/../x'
+    url = @base_url.route_to('http://a/b/c/g#s/../x')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == 'g#s/../x'
+
+#  http://a/b/c/d;p?q
+#        http:g        =  http:g           ; for validating parsers
+#                      |  http://a/b/c/g   ; for backwards compatibility
+    url = @base_url.merge('http:g')
+    url.should be_kind_of(URI::HTTP)
+    url.to_s.should == 'http:g'
+    url = @base_url.route_to('http:g')
+    url.should be_kind_of(URI::Generic)
+    url.to_s.should == 'http:g'
+  end
+end
+
+#TODO: incorporate these tests:
+#
+# u = URI.parse('http://foo/bar/baz')
+# assert_equal(nil, u.merge!(""))
+# assert_equal(nil, u.merge!(u))
+# assert(nil != u.merge!("."))
+# assert_equal('http://foo/bar/', u.to_s)
+# assert(nil != u.merge!("../baz"))
+# assert_equal('http://foo/baz', u.to_s)
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/uri/regexp_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/uri/regexp_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/uri/regexp_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'uri'
+
+#I'm more or less ok with these limited tests, as the more extensive extract tests
+#use URI.regexp
+describe "URI.regexp" do
+  it "behaves according to the MatzRuby tests" do
+    URI.regexp.should == URI.regexp
+    'x http:// x'.slice(URI.regexp).should == 'http://'
+    'x http:// x'.slice(URI.regexp(['http'])).should == 'http://'
+    'x http:// x ftp://'.slice(URI.regexp(['http'])).should == 'http://'
+    'http://'.slice(URI.regexp([])).should == nil
+    ''.slice(URI.regexp).should == nil
+    'xxxx'.slice(URI.regexp).should == nil
+    ':'.slice(URI.regexp).should == nil
+    'From:'.slice(URI.regexp).should == 'From:'
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/uri/route_to.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/uri/route_to.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/uri/route_to.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'uri'
+
+describe "URI#route_to" do
+
+  #this could be split out a good bit better
+  it "gives the minimal difference between the current URI and the target" do
+    URI("http://example.com/a.html").route_to('http://example.com/a.html').to_s.should == ""
+    URI("http://example.com/a.html").route_to('http://example.com/b.html').to_s.should == "b.html"
+    URI("http://example.com/a/").route_to('http://example.com/b/').to_s.should == "../b/"
+    URI("http://example.com/a/c").route_to('http://example.com/b/').to_s.should == "../b/"
+    URI("http://example.com/a/b/").route_to('http://example.com/b/').to_s.should == "../../b/"
+    URI("http://example.com/a/b/").route_to('http://EXAMPLE.cOm/b/').to_s.should == "../../b/"
+    URI("http://example.com/a/b/").route_to('http://example.net/b/').to_s.should == "//example.net/b/"    
+    URI("mailto:foo at example.com").route_to('mailto:foo at example.com#bar').to_s.should == "#bar"    
+    
+    #this was a little surprising to me
+    URI("mailto:foo at example.com#bar").route_to('mailto:foo at example.com').to_s.should == ""    
+  end
+  
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/uri/select_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/uri/select_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/uri/select_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'uri'
+
+describe "URI#select" do
+  it "takes any number of component names as symbols, and returns an array of those components" do
+    URI("http://host:8080/path/").select.should == []
+    URI("http://host:8080/path/").select(:scheme,:host,:port,:path).should == [
+      "http","host",8080,"/path/"]
+  end
+  
+  it "returns nil for any valid component that isn't set and doesn't have a default" do
+    uri = URI("http://host")
+    uri.select(:userinfo, :query, :fragment).should == [nil] * 3
+    uri.select(:port, :path).should == [80, '']
+  end
+  
+  it "raises an ArgumentError if a component is requested that isn't valid under the given scheme" do
+    bad_selects = [
+      lambda {URI("mailto:spam at mailinator.com").select(:path)},
+      lambda {URI("http://blog.blag.web").select(:typecode)},
+    ].each do |select_lambda|
+      select_lambda.should raise_error(ArgumentError)
+    end
+  end
+  
+  it "raises an ArgumentError if given strings rather than symbols" do
+    lambda {
+      URI("http://host:8080/path/").select("scheme","host","port",'path')
+    }.should raise_error(ArgumentError)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/uri/set_component_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/uri/set_component_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/uri/set_component_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,47 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'uri'
+
+#TODO: make this more BDD
+describe 'URI#select' do
+  it "conforms to the MatzRuby tests" do
+    uri = URI.parse('http://foo:bar@baz')
+    (uri.user = 'oof').should == 'oof'
+    uri.to_s.should == 'http://oof:bar@baz'
+    (uri.password = 'rab').should == 'rab'
+    uri.to_s.should == 'http://oof:rab@baz'
+    (uri.userinfo = 'foo').should == 'foo'
+    uri.to_s.should == 'http://foo:rab@baz'
+    (uri.userinfo = ['foo', 'bar']).should == ['foo', 'bar']
+    uri.to_s.should == 'http://foo:bar@baz'
+    (uri.userinfo = ['foo']).should == ['foo']
+    uri.to_s.should == 'http://foo:bar@baz'
+    (uri.host = 'zab').should == 'zab'
+    uri.to_s.should == 'http://foo:bar@zab'
+    (uri.port = 8080).should == 8080
+    uri.to_s.should == 'http://foo:bar@zab:8080'
+    (uri.path = '/').should == '/'
+    uri.to_s.should == 'http://foo:bar@zab:8080/'
+    (uri.query = 'a=1').should == 'a=1'
+    uri.to_s.should == 'http://foo:bar@zab:8080/?a=1'
+    (uri.fragment = 'b123').should == 'b123'
+    uri.to_s.should == 'http://foo:bar@zab:8080/?a=1#b123'
+
+    uri = URI.parse('http://example.com')
+    lambda { uri.password = 'bar' }.should raise_error(URI::InvalidURIError)
+    uri.userinfo = 'foo:bar'
+    uri.to_s.should == 'http://foo:bar@example.com'
+    lambda { uri.registry = 'bar' }.should raise_error(URI::InvalidURIError)
+    lambda { uri.opaque = 'bar' }.should raise_error(URI::InvalidURIError)
+
+    uri = URI.parse('mailto:foo at example.com')
+    lambda { uri.user = 'bar' }.should raise_error(URI::InvalidURIError)
+    lambda { uri.password = 'bar' }.should raise_error(URI::InvalidURIError)
+    lambda { uri.userinfo = ['bar', 'baz'] }.should raise_error(URI::InvalidURIError)
+    lambda { uri.host = 'bar' }.should raise_error(URI::InvalidURIError)
+    lambda { uri.port = 'bar' }.should raise_error(URI::InvalidURIError)
+    lambda { uri.path = 'bar' }.should raise_error(URI::InvalidURIError)
+    lambda { uri.query = 'bar' }.should raise_error(URI::InvalidURIError)
+  end
+end
+
+

Added: MacRuby/branches/experimental/spec/frozen/library/uri/uri_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/uri/uri_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/uri/uri_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'uri'
+
+#the testing is light here as this is an alias for URI.parse
+
+#we're just testing that the method ends up in the right place
+describe "the URI method" do
+  it "parses a given URI, returning a URI object" do
+    result = URI.parse("http://ruby-lang.org")
+    URI("http://ruby-lang.org").should == result
+    Kernel::URI("http://ruby-lang.org").should == result
+  end
+  
+  #apparently this was a concern?  imported from MRI tests
+  it "does not add a URI method to Object instances" do
+    lambda {Object.new.URI("http://ruby-lang.org/")}.should raise_error(NoMethodError)
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/add_builtin_type_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/add_builtin_type_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/add_builtin_type_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/add_domain_type_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/add_domain_type_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/add_domain_type_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/add_private_type_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/add_private_type_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/add_private_type_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/add_ruby_type_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/add_ruby_type_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/add_ruby_type_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/detect_implicit_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/detect_implicit_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/detect_implicit_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/dump_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/dump_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/dump_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+
+describe "YAML.dump" do
+  after :each do
+    File.delete $test_file if File.exist? $test_file
+  end
+  
+  it "converts an object to YAML and write result to io when io provided" do
+    File.open($test_file, 'w' ) do |io|
+      YAML.dump( ['badger', 'elephant', 'tiger'], io )
+    end
+    YAML.load_file($test_file).should == ['badger', 'elephant', 'tiger']
+  end
+  
+  it "returns a string containing dumped YAML when no io provided" do
+    YAML.dump( :locked ).should == "--- :locked\n"
+  end  
+  
+  it "returns the same string that #to_yaml on objects" do
+    ["a", "b", "c"].to_yaml.should == YAML.dump(["a", "b", "c"])
+  end
+
+  it "dumps strings into YAML strings" do
+    YAML.dump("str").should == "--- str\n"
+  end
+
+  it "dumps hashes into YAML key-values" do
+    YAML.dump({ "a" => "b" }).should ==  "--- \na: b\n"
+  end
+
+  it "dumps Arrays into YAML collection" do
+    YAML.dump(["a", "b", "c"]).should == "--- \n- a\n- b\n- c\n"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/dump_stream_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/dump_stream_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/dump_stream_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+
+describe "YAML.dump_stream" do
+  it "returns an empty string when not passed any objects" do
+    YAML.dump_stream.should == ""
+  end
+
+  it "returns a YAML stream containing the objects passed" do
+    YAML.dump_stream('foo', 20, [], {}).should == "--- foo\n--- 20\n--- []\n\n--- {}\n\n"
+  end
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/each_document_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/each_document_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/each_document_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+require File.dirname(__FILE__) + '/fixtures/strings'
+require File.dirname(__FILE__) + '/shared/each_document'
+
+describe "YAML#each_document" do
+  it_behaves_like :yaml_each_document, :each_document
+end

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/each_node_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/each_node_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/each_node_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/emitter_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/emitter_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/emitter_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/fixtures/common.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/fixtures/common.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/fixtures/common.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+require 'yaml'
+
+$test_file = tmp("yaml_test_file")
+$test_parse_file = File.dirname(__FILE__) + "/test_yaml.yml"

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/fixtures/example_class.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/fixtures/example_class.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/fixtures/example_class.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+class FooBar
+  def initialize(name)
+    @name = name
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/fixtures/strings.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/fixtures/strings.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/fixtures/strings.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,36 @@
+$complex_key_1 = <<EOY
+    ? # PLAY SCHEDULE
+      - Detroit Tigers
+      - Chicago Cubs
+    :  
+      - 2001-07-23
+
+    ? [ New York Yankees,
+        Atlanta Braves ]
+    : [ 2001-07-02, 2001-08-12, 
+       2001-08-14 ]
+EOY
+
+$to_yaml_hash =
+<<EOY
+-
+  avg: 0.278
+  hr: 65
+  name: Mark McGwire
+-
+  avg: 0.288
+  hr: 63
+  name: Sammy Sosa
+EOY
+
+$multidocument = <<EOY
+---
+- Mark McGwire
+- Sammy Sosa
+- Ken Griffey
+
+# Team ranking
+---
+- Chicago Cubs
+- St Louis Cardinals
+EOY

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/fixtures/test_yaml.yml
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/fixtures/test_yaml.yml	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/fixtures/test_yaml.yml	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+project:
+  name: RubySpec

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/generic_parser_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/generic_parser_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/generic_parser_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/load_documents_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/load_documents_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/load_documents_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+require File.dirname(__FILE__) + '/fixtures/strings'
+require File.dirname(__FILE__) + '/shared/each_document'
+
+describe "YAML.load_documents" do
+  it_behaves_like :yaml_each_document, :load_documents
+end

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/load_file_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/load_file_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/load_file_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,13 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+
+describe "YAML.load_file" do
+  after :each do
+    File.delete $test_file if File.exist? $test_file
+  end
+  
+  it "returns a hash" do
+    File.open($test_file,'w' ){|io| YAML.dump( {"bar"=>2, "car"=>1}, io ) }
+    YAML.load_file($test_file).should == {"bar"=>2, "car"=>1}
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/load_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/load_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/load_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,90 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+require File.dirname(__FILE__) + '/fixtures/strings'
+
+describe "YAML.load" do
+  after :each do
+    File.delete $test_file if File.exist? $test_file
+  end
+  
+  it "returns a document from current io stream when io provided" do
+    File.open($test_file, 'w') do |io|
+      YAML.dump( ['badger', 'elephant', 'tiger'], io )
+    end
+    File.open($test_file) { |yf| YAML.load( yf ) }.should == ['badger', 'elephant', 'tiger']
+  end
+  
+  it "loads strings" do
+    strings = ["str",
+               " str", 
+               "'str'",
+               "str",
+               " str",
+               "'str'",
+               "\"str\"",
+                "\n str",
+                "---  str",
+                "---\nstr",
+                "--- \nstr",
+                "--- \n str",
+                "--- 'str'"
+              ]
+    strings.each do |str|
+      YAML.load(str).should == "str"
+    end
+  end  
+
+  it "fails on invalid keys" do
+    lambda { YAML.load("key1: value\ninvalid_key") }.should raise_error(ArgumentError)
+  end
+
+  it "accepts symbols" do
+    YAML.load( "--- :locked" ).should == :locked
+  end
+
+  it "accepts numbers" do
+    YAML.load("47").should == 47
+    YAML.load("-1").should == -1
+  end
+
+  it "accepts collections" do
+    expected = ["a", "b", "c"]
+    YAML.load("--- \n- a\n- b\n- c\n").should == expected
+    YAML.load("--- [a, b, c]").should == expected
+    YAML.load("[a, b, c]").should == expected
+  end
+
+  it "parses start markers" do
+    YAML.load("---\n").should == nil
+    YAML.load("--- ---\n").should == "---"
+    YAML.load("--- abc").should == "abc"
+  end
+
+  it "does not escape symbols" do
+    YAML.load("foobar: >= 123").should == { "foobar" => ">= 123"}
+    YAML.load("foobar: |= 567").should == { "foobar" => "|= 567"}
+    YAML.load("--- \n*.rb").should == "*.rb"
+    YAML.load("--- \n&.rb").should == "&.rb"
+  end
+
+  it "works with block sequence shortcuts" do
+    block_seq = "- - - one\n    - two\n    - three"
+    YAML.load(block_seq).should == [[["one", "two", "three"]]]
+  end
+
+  it "works on complex keys" do
+    expected = { 
+      [ 'Detroit Tigers', 'Chicago Cubs' ] => [ Date.new( 2001, 7, 23 ) ],
+      [ 'New York Yankees', 'Atlanta Braves' ] => [ Date.new( 2001, 7, 2 ), 
+                                                    Date.new( 2001, 8, 12 ), 
+                                                    Date.new( 2001, 8, 14 ) ] 
+    }
+    YAML.load($complex_key_1).should == expected
+  end
+  
+  it "loads a symbol key that contains spaces" do
+    string = ":user name: This is the user name."
+    expected = { :"user name" => "This is the user name."}
+    YAML.load(string).should == expected
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/load_stream_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/load_stream_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/load_stream_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/object_maker_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/object_maker_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/object_maker_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/parse_documents_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/parse_documents_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/parse_documents_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/parse_file_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/parse_file_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/parse_file_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+
+describe "YAML#parse_file" do
+  quarantine! do
+    it "returns a YAML::Syck::Map object after parsing a YAML file" do
+      YAML.parse_file($test_parse_file).should be_kind_of(YAML::Syck::Map)
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/parse_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/parse_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/parse_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+
+describe "YAML#parse with an empty string" do
+  it "returns false" do
+    YAML.parse('').should be_false
+  end
+end
+  
+describe "YAML#parse" do
+  before :each do
+    @string_yaml = "foo".to_yaml
+  end
+  
+  it "returns the value from the object" do
+    YAML.parse(@string_yaml).value.should == "foo"
+  end  
+end

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/parser_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/parser_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/parser_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/quick_emit_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/quick_emit_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/quick_emit_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/read_type_class_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/read_type_class_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/read_type_class_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/shared/each_document.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/shared/each_document.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/shared/each_document.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,18 @@
+describe :yaml_each_document, :shared => true do
+  it "calls the block on each succesive document" do
+    documents = []
+    YAML.send(@method, $multidocument) do |doc|
+      documents << doc
+    end
+    documents.should == [["Mark McGwire", "Sammy Sosa", "Ken Griffey"], 
+                         ["Chicago Cubs", "St Louis Cardinals"]]
+  end
+
+  it "works on files" do
+    File.open($test_parse_file, "r") do |file|
+      YAML.send(@method, file) do |doc|
+        doc.should == {"project"=>{"name"=>"RubySpec"}}
+      end
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/tag_class_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/tag_class_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/tag_class_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+
+describe "YAML.tag_class" do
+  it "associates a taguri tag with a ruby class" do
+    YAML.tag_class('rubini.us','rubinius').should == "rubinius"
+  end  
+end

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/tagged_classes_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/tagged_classes_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/tagged_classes_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+
+describe "YAML.tagged_classes" do
+  it "returns a complete dictionary of taguris paired with classes" do
+    YAML.tagged_classes["tag:yaml.org,2002:int"].should == Integer
+  end  
+end

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/tagurize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/tagurize_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/tagurize_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+
+describe "YAML.tagurize" do
+  it "converts a type_id to a taguri" do
+    YAML.tagurize('wtf').should == "tag:yaml.org,2002:wtf"
+    YAML.tagurize(1).should == 1
+  end  
+end

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/to_yaml_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/to_yaml_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/to_yaml_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,98 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'
+require File.dirname(__FILE__) + '/fixtures/example_class'
+
+describe "Object#to_yaml" do
+
+  it "returns the YAML representation of an Array object" do
+    %w( 30 ruby maz irb 99 ).to_yaml.should == "--- \n- \"30\"\n- ruby\n- maz\n- irb\n- \"99\"\n"
+  end
+
+  it "returns the YAML representation of a Hash object" do
+    { "a" => "b"}.to_yaml.should match_yaml("--- \na: b\n")
+  end
+
+  it "returns the YAML representation of a Class object" do
+    FooBar.new("baz").to_yaml.should match_yaml("--- !ruby/object:FooBar\nname: baz\n")
+
+  end
+
+  it "returns the YAML representation of a Date object" do
+    Date.parse('1997/12/30').to_yaml.should == "--- 1997-12-30\n"
+  end
+
+  it "returns the YAML representation of a FalseClass" do
+    false_klass = false
+    false_klass.should be_kind_of(FalseClass)
+    false_klass.to_yaml.should == "--- false\n"
+  end
+
+  it "returns the YAML representation of a Float object" do
+    float = 1.2
+    float.should be_kind_of(Float)
+    float.to_yaml.should == "--- 1.2\n"
+  end
+  
+  it "returns the YAML representation of an Integer object" do
+    int = 20
+    int.should be_kind_of(Integer)
+    int.to_yaml.should == "--- 20\n"
+  end
+  
+  it "returns the YAML representation of a NilClass object" do
+    nil_klass = nil
+    nil_klass.should be_kind_of(NilClass)
+    nil_klass.to_yaml.should == "--- \n"
+  end
+  
+  it "returns the YAML represenation of a RegExp object" do
+    Regexp.new('^a-z+:\\s+\w+').to_yaml.should == "--- !ruby/regexp /^a-z+:\\s+\\w+/\n"
+  end
+  
+  it "returns the YAML representation of a String object" do
+    "I love Ruby".to_yaml.should == "--- I love Ruby\n"
+  end
+
+  it "returns the YAML representation of a Struct object" do
+    Person = Struct.new(:name, :gender)
+    Person.new("Jane", "female").to_yaml.should match_yaml("--- !ruby/struct:Person\nname: Jane\ngender: female\n")
+  end
+
+  it "returns the YAML representation of a Symbol object" do
+    :symbol.to_yaml.should ==  "--- :symbol\n"
+  end
+  
+  it "returns the YAML representation of a Time object" do
+    Time.utc(2000,"jan",1,20,15,1).to_yaml.should == "--- 2000-01-01 20:15:01 Z\n"
+  end
+  
+  it "returns the YAML representation of a TrueClass" do
+    true_klass = true
+    true_klass.should be_kind_of(TrueClass)
+    true_klass.to_yaml.should == "--- true\n"
+  end  
+
+  it "returns the YAML representation of a Error object" do
+    StandardError.new("foobar").to_yaml.should match_yaml("--- !ruby/exception:StandardError\nmessage: foobar\n")
+  end
+
+  it "returns the YAML representation for Range objects" do
+    yaml = Range.new(1,3).to_yaml
+    yaml.include?("!ruby/range").should be_true
+    yaml.include?("begin: 1").should be_true
+    yaml.include?("end: 3").should be_true
+    yaml.include?("excl: false").should be_true
+  end
+
+  it "returns the YAML representation of numeric constants" do
+    (0.0/0.0).to_yaml.should == "--- .NaN\n"
+    (1.0/0.0).to_yaml.should == "--- .Inf\n"
+    (-1.0/0.0).to_yaml.should == "--- -.Inf\n"
+    (0.0).to_yaml.should == "--- 0.0\n"
+  end
+
+  it "returns the YAML representation of an array of hashes" do
+    players = [{"a" => "b"}, {"b" => "c"}]
+    players.to_yaml.should == "--- \n- a: b\n- b: c\n"
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/transfer_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/transfer_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/transfer_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'

Added: MacRuby/branches/experimental/spec/frozen/library/yaml/try_implicit_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/yaml/try_implicit_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/yaml/try_implicit_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/common'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/adler32_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/adler32_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/adler32_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,46 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'zlib'
+
+describe "Zlib.adler32" do
+  it "calculates Adler checksum for string" do
+    Zlib.adler32("").should == 1
+    Zlib.adler32(" ").should == 2162721
+    Zlib.adler32("123456789").should == 152961502
+    Zlib.adler32("!@#\{$\}%^&**()").should == 365495023
+    Zlib.adler32("to be or not to be" * 22).should == 3979904837
+    Zlib.adler32("0").should == 3211313
+    Zlib.adler32((2**32).to_s).should == 193331739
+    Zlib.adler32((2**64).to_s).should == 723452953
+  end
+
+  it "calculates Adler checksum for string and initial Adler value" do
+    test_string = "This is a test string! How exciting!%?"
+    Zlib.adler32(test_string, 0).should == 63900955
+    Zlib.adler32(test_string, 1).should == 66391324
+    Zlib.adler32(test_string, 2**8).should == 701435419
+    Zlib.adler32(test_string, 2**16).should == 63966491
+    lambda { Zlib.adler32(test_string, 2**128) }.should raise_error(RangeError) 
+  end
+  
+  it "calculates the Adler checksum for string and initial Adler value for Bignums" do
+    test_string = "This is a test string! How exciting!%?"    
+    Zlib.adler32(test_string, 2**30).should == 1137642779    
+  end
+  
+  it "assumes that the initial value is given to adler, if adler is omitted" do
+    orig_crc = Zlib.adler32
+    Zlib.adler32("").should == Zlib.adler32("", orig_crc)
+    Zlib.adler32(" ").should == Zlib.adler32(" ", orig_crc)
+    Zlib.adler32("123456789").should == Zlib.adler32("123456789", orig_crc)
+    Zlib.adler32("!@#\{$\}%^&**()").should == Zlib.adler32("!@#\{$\}%^&**()", orig_crc)
+    Zlib.adler32("to be or not to be" * 22).should == Zlib.adler32("to be or not to be" * 22, orig_crc)
+    Zlib.adler32("0").should == Zlib.adler32("0", orig_crc)
+    Zlib.adler32((2**32).to_s).should == Zlib.adler32((2**32).to_s, orig_crc)
+    Zlib.adler32((2**64).to_s).should == Zlib.adler32((2**64).to_s, orig_crc)
+  end
+  
+  it "it returns the CRC initial value, if string is omitted" do
+    Zlib.adler32.should == 1
+  end  
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/crc32_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/crc32_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/crc32_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,52 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require 'zlib'
+
+describe "Zlib.crc32" do
+  it "calculates CRC checksum for string" do
+    Zlib.crc32("").should == 0
+    Zlib.crc32(" ").should == 3916222277
+    Zlib.crc32("123456789").should == 3421780262
+    Zlib.crc32("!@#\{$\}%^&**()").should == 2824518887
+    Zlib.crc32("to be or not to be" * 22).should == 1832379978
+    Zlib.crc32("0").should == 4108050209
+    Zlib.crc32((2**32).to_s).should == 3267533297
+    Zlib.crc32((2**64).to_s).should == 653721760
+  end
+
+  it "calculates CRC checksum for string and initial CRC value" do
+    test_string = "This is a test string! How exciting!%?"
+    # Zlib.crc32(test_string, -2**28).should == 3230195786
+    # Zlib.crc32(test_string, -2**20).should == 2770207303
+    # Zlib.crc32(test_string, -2**16).should == 2299432960
+    # Zlib.crc32(test_string, -2**8).should == 861809849
+    # Zlib.crc32(test_string, -1).should == 2170124077
+    Zlib.crc32(test_string, 0).should == 3864990561
+    Zlib.crc32(test_string, 1).should == 1809313411
+    Zlib.crc32(test_string, 2**8).should == 1722745982
+    Zlib.crc32(test_string, 2**16).should == 1932511220
+    lambda { Zlib.crc32(test_string, 2**128) }.should raise_error(RangeError) 
+  end
+
+  it "calculates the CRC checksum for string and initial CRC value for Bignums" do
+    test_string = "This is a test string! How exciting!%?"    
+    # Zlib.crc32(test_string, -2**30).should == 277228695
+    Zlib.crc32(test_string, 2**30).should == 46597132    
+  end
+
+  it "assumes that the initial value is given to crc, if crc is omitted" do
+    orig_crc = Zlib.crc32
+    Zlib.crc32("").should == Zlib.crc32("", orig_crc)
+    Zlib.crc32(" ").should == Zlib.crc32(" ", orig_crc)
+    Zlib.crc32("123456789").should == Zlib.crc32("123456789", orig_crc)
+    Zlib.crc32("!@#\{$\}%^&**()").should == Zlib.crc32("!@#\{$\}%^&**()", orig_crc)
+    Zlib.crc32("to be or not to be" * 22).should == Zlib.crc32("to be or not to be" * 22, orig_crc)
+    Zlib.crc32("0").should == Zlib.crc32("0", orig_crc)
+    Zlib.crc32((2**32).to_s).should == Zlib.crc32((2**32).to_s, orig_crc)
+    Zlib.crc32((2**64).to_s).should == Zlib.crc32((2**64).to_s, orig_crc)
+  end
+
+  it "it returns the CRC initial value, if string is omitted" do
+    Zlib.crc32.should == 0
+  end  
+
+end

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/crc_table_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/crc_table_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/crc_table_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require "zlib"
+
+describe "Zlib.crc_table" do
+  
+  it "should return the same value as zlib's get_crc_table()" do
+    Zlib.crc_table.should ==
+      [0, 1996959894, 3993919788, 2567524794, 124634137, 1886057615, 3915621685, 2657392035, 249268274, 2044508324, 3772115230, 2547177864, 162941995, 2125561021, 3887607047, 2428444049, 498536548, 1789927666, 4089016648, 2227061214, 450548861, 1843258603, 4107580753, 2211677639, 325883990, 1684777152, 4251122042, 2321926636, 335633487, 1661365465, 4195302755, 2366115317, 997073096, 1281953886, 3579855332, 2724688242, 1006888145, 1258607687, 3524101629, 2768942443, 901097722, 1119000684, 3686517206, 2898065728, 853044451, 1172266101, 3705015759, 2882616665, 651767980, 1373503546, 3369554304, 3218104598, 565507253, 1454621731, 3485111705, 3099436303, 671266974, 1594198024, 3322730930, 2970347812, 795835527, 1483230225, 3244367275, 3060149565, 1994146192, 31158534, 2563907772, 4023717930, 1907459465, 112637215, 2680153253, 3904427059, 2013776290, 251722036, 2517215374, 3775830040, 2137656763, 141376813, 2439277719, 3865271297, 1802195444, 476864866, 2238001368, 4066508878, 181
 2370925, 453092731, 2181625025, 4111451223, 1706088902, 314042704, 2344532202, 4240017532, 1658658271, 366619977, 2362670323, 4224994405, 1303535960, 984961486, 2747007092, 3569037538, 1256170817, 1037604311, 2765210733, 3554079995, 1131014506, 879679996, 2909243462, 3663771856, 1141124467, 855842277, 2852801631, 3708648649, 1342533948, 654459306, 3188396048, 3373015174, 1466479909, 544179635, 3110523913, 3462522015, 1591671054, 702138776, 2966460450, 3352799412, 1504918807, 783551873, 3082640443, 3233442989, 3988292384, 2596254646, 62317068, 1957810842, 3939845945, 2647816111, 81470997, 1943803523, 3814918930, 2489596804, 225274430, 2053790376, 3826175755, 2466906013, 167816743, 2097651377, 4027552580, 2265490386, 503444072, 1762050814, 4150417245, 2154129355, 426522225, 1852507879, 4275313526, 2312317920, 282753626, 1742555852, 4189708143, 2394877945, 397917763, 1622183637, 3604390888, 2714866558, 953729732, 1340076626, 3518719985, 2797360999, 1068828381, 1219638859, 36247
 41850, 2936675148, 906185462, 1090812512, 3747672003, 2825379669, 829329135, 1181335161, 3412177804, 3160834842, 628085408, 1382605366, 3423369109, 3138078467, 570562233, 1426400815, 3317316542, 2998733608, 733239954, 1555261956, 3268935591, 3050360625, 752459403, 1541320221, 2607071920, 3965973030, 1969922972, 40735498, 2617837225, 3943577151, 1913087877, 83908371, 2512341634, 3803740692, 2075208622, 213261112, 2463272603, 3855990285, 2094854071, 198958881, 2262029012, 4057260610, 1759359992, 534414190, 2176718541, 4139329115, 1873836001, 414664567, 2282248934, 4279200368, 1711684554, 285281116, 2405801727, 4167216745, 1634467795, 376229701, 2685067896, 3608007406, 1308918612, 956543938, 2808555105, 3495958263, 1231636301, 1047427035, 2932959818, 3654703836, 1088359270, 936918000, 2847714899, 3736837829, 1202900863, 817233897, 3183342108, 3401237130, 1404277552, 615818150, 3134207493, 3453421203, 1423857449, 601450431, 3009837614, 3294710456, 1567103746, 711928724, 30206684
 71, 3272380065, 1510334235, 755167117]    
+  end
+  
+end
\ No newline at end of file

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/append_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/append_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/append_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/deflate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/deflate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/deflate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,49 @@
+require 'zlib'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe 'Zlib::Deflate#deflate' do
+
+  before :each do
+    @deflator = Zlib::Deflate.new
+  end
+
+  it 'deflates some data' do
+    data = "\000" * 10
+
+    zipped = @deflator.deflate data, Zlib::FINISH
+    @deflator.finish
+
+    zipped.should == "x\234c`\200\001\000\000\n\000\001"
+  end
+
+  it 'deflates lots of data' do
+    data = "\000" * 32 * 1024
+
+    zipped = @deflator.deflate data, Zlib::FINISH
+    @deflator.finish
+
+    zipped.should == "x\234\355\301\001\001\000\000\000\200\220\376\257\356\b\n#{"\000" * 31}\030\200\000\000\001"
+  end
+
+end
+
+describe 'Zlib::Deflate::deflate' do
+
+  it 'deflates some data' do
+    data = "\000" * 10
+
+    zipped = Zlib::Deflate.deflate data
+
+    zipped.should == "x\234c`\200\001\000\000\n\000\001"
+  end
+
+  it 'deflates lots of data' do
+    data = "\000" * 32 * 1024
+
+    zipped = Zlib::Deflate.deflate data
+
+    zipped.should == "x\234\355\301\001\001\000\000\000\200\220\376\257\356\b\n#{"\000" * 31}\030\200\000\000\001"
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/flush_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/flush_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/flush_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/initialize_copy_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/initialize_copy_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/initialize_copy_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/params_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/params_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/params_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'zlib'
+
+describe 'Zlib::Deflate#params' do
+  ruby_bug '293', '1.9.0' do
+  it 'changes the deflate parameters' do
+    data = 'abcdefghijklm'
+
+    d = Zlib::Deflate.new Zlib::NO_COMPRESSION, Zlib::MAX_WBITS,
+    Zlib::DEF_MEM_LEVEL, Zlib::DEFAULT_STRATEGY
+
+    d << data.slice!(0..10)
+    d.params Zlib::BEST_COMPRESSION, Zlib::DEFAULT_STRATEGY
+    d << data
+
+    d.finish.should ==
+      "x\001\000\v\000\364\377abcdefghijk\002,'\027\000\#\364\005<"
+  end
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/set_dictionary_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/set_dictionary_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/deflate/set_dictionary_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'zlib'
+
+describe 'Zlib::Deflate#set_dictionary' do
+  it 'sets the dictionary' do
+    d = Zlib::Deflate.new
+    d.set_dictionary 'aaaaaaaaaa'
+    d << 'abcdefghij'
+
+    d.finish.should ==
+      "x\273\024\341\003\313KLJNIMK\317\310\314\002\000\025\206\003\370"
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/close_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/close_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/close_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'stringio'
+require 'zlib'
+
+describe 'Zlib::GzipFile#close' do
+  it 'finishes the stream and closes the io' do
+    io = StringIO.new
+    Zlib::GzipWriter.wrap io do |gzio|
+      gzio.close
+
+      gzio.closed?.should == true
+
+      lambda { gzio.orig_name }.should \
+        raise_error(Zlib::GzipFile::Error, 'closed gzip stream')
+      lambda { gzio.comment }.should \
+        raise_error(Zlib::GzipFile::Error, 'closed gzip stream')
+    end
+
+    io.string[10..-1].should == "\003\000\000\000\000\000\000\000\000\000"
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/closed_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/closed_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/closed_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'stringio'
+require 'zlib'
+
+describe 'Zlib::GzipFile#closed?' do
+  it 'returns the closed status' do
+    io = StringIO.new
+    Zlib::GzipWriter.wrap io do |gzio|
+      gzio.closed?.should == false
+
+      gzio.close
+
+      gzio.closed?.should == true
+    end
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/comment_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/comment_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/comment_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'stringio'
+require 'zlib'
+
+describe 'Zlib::GzipFile#comment' do
+  before :each do
+    @io = StringIO.new
+  end
+
+  it 'returns the name' do
+    Zlib::GzipWriter.wrap @io do |gzio|
+      gzio.comment = 'name'
+
+      gzio.comment.should == 'name'
+    end
+  end
+
+  it 'raises an error on a closed stream' do
+    Zlib::GzipWriter.wrap @io do |gzio|
+      gzio.close
+
+      lambda { gzio.comment }.should \
+        raise_error(Zlib::GzipFile::Error, 'closed gzip stream')
+    end
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/crc_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/crc_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/crc_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/finish_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/finish_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/finish_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/level_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/level_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/level_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/mtime_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/mtime_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/mtime_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/orig_name_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/orig_name_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/orig_name_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,27 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'stringio'
+require 'zlib'
+
+describe 'Zlib::GzipFile#orig_name' do
+  before :each do
+    @io = StringIO.new
+  end
+
+  it 'returns the name' do
+    Zlib::GzipWriter.wrap @io do |gzio|
+      gzio.orig_name = 'name'
+
+      gzio.orig_name.should == 'name'
+    end
+  end
+
+  it 'raises an error on a closed stream' do
+    Zlib::GzipWriter.wrap @io do |gzio|
+      gzio.close
+
+      lambda { gzio.orig_name }.should \
+        raise_error(Zlib::GzipFile::Error, 'closed gzip stream')
+    end
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/os_code_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/os_code_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/os_code_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/sync_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/sync_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/sync_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/to_io_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/to_io_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/to_io_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/wrap_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/wrap_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipfile/wrap_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/each_byte_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/each_byte_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/each_byte_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/each_line_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/each_line_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/each_line_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/each_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/each_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/each_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/eof_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/eof_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/eof_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'stringio'
+require 'zlib'
+
+describe "GzipReader#eof?" do
+
+  before :each do
+    @data = '12345abcde'
+    @zip = "\037\213\b\000,\334\321G\000\00334261MLJNI\005\000\235\005\000$\n\000\000\000"
+    @io = StringIO.new @zip
+  end
+
+  it "returns true when at EOF" do
+    gz = Zlib::GzipReader.new @io
+
+    gz.eof?.should == false
+    gz.read
+    gz.eof?.should == true
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/getc_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/getc_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/getc_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/gets_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/gets_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/gets_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/lineno_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/lineno_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/lineno_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/open_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/open_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/open_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/pos_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/pos_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/pos_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,26 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'stringio'
+require 'zlib'
+
+describe "GzipReader#pos" do
+
+  before :each do
+    @data = '12345abcde'
+    @zip = "\037\213\b\000,\334\321G\000\00334261MLJNI\005\000\235\005\000$\n\000\000\000"
+    @io = StringIO.new @zip
+  end
+
+  it "returns the position" do
+    gz = Zlib::GzipReader.new @io
+
+    gz.pos.should == 0
+
+    gz.read 5
+    gz.pos.should == 5
+
+    gz.read
+    gz.pos.should == @data.length
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/read_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/read_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/read_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,28 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'stringio'
+require 'zlib'
+
+describe "GzipReader#read" do
+
+  before :each do
+    @data = '12345abcde'
+    @zip = "\037\213\b\000,\334\321G\000\00334261MLJNI\005\000\235\005\000$\n\000\000\000"
+    @io = StringIO.new @zip
+  end
+
+  it "reads the contents of a gzip file" do
+    gz = Zlib::GzipReader.new @io
+
+    gz.read.should == @data
+  end
+
+  it "reads the contents up to a certain size" do
+    gz = Zlib::GzipReader.new @io
+
+    gz.read(5).should == @data[0...5]
+
+    gz.read(5).should == @data[5...10]
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/readchar_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/readchar_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/readchar_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/readline_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/readline_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/readline_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/readlines_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/readlines_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/readlines_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/rewind_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/rewind_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/rewind_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,32 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'stringio'
+require 'zlib'
+
+describe "GzipReader#rewind" do
+
+  before :each do
+    @data = '12345abcde'
+    @zip = "\037\213\b\000,\334\321G\000\00334261MLJNI\005\000\235\005\000$\n\000\000\000"
+    @io = StringIO.new @zip
+  end
+
+  it "resets the position of the file pointer" do
+    gz = Zlib::GzipReader.new @io
+    gz.read
+    gz.pos.should == @data.length
+
+    gz.rewind
+    gz.pos.should == 0
+  end
+
+  it "invokes seek method on the associated IO object" do
+    # first, prepare the mock object:
+    (obj = mock("io")).should_receive(:get_io).any_number_of_times.and_return(@io)
+    def obj.read(args); get_io.read(args); end
+    obj.should_receive(:seek).and_return(0)
+
+    gz = Zlib::GzipReader.new(obj)
+    gz.rewind()
+    gz.pos.should == 0
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/tell_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/tell_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/tell_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/ungetc_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/ungetc_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/ungetc_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/unused_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/unused_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipreader/unused_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/append_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/append_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/append_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/comment_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/comment_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/comment_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/flush_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/flush_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/flush_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/mtime_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/mtime_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/mtime_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,41 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'stringio'
+require 'zlib'
+
+describe 'Zlib::GzipWriter#mtime=' do
+  before :each do
+    @io = StringIO.new
+  end
+
+  it 'sets mtime using Integer' do
+    Zlib::GzipWriter.wrap @io do |gzio|
+      gzio.mtime = 1
+
+      gzio.mtime.should == Time.at(1)
+    end
+
+    @io.string[4, 4].should == "\001\0\0\0"
+  end
+
+  ruby_bug '253', '1.9.0' do
+  it 'sets mtime using Time' do
+    Zlib::GzipWriter.wrap @io do |gzio|
+      gzio.mtime = Time.at 1
+
+      gzio.mtime.should == Time.at(1)
+    end
+
+    @io.string[4, 4].should == "\001\0\0\0"
+  end
+  end
+
+  it 'raises if the header was written' do
+    Zlib::GzipWriter.wrap @io do |gzio|
+      gzio.write ''
+
+      lambda { gzio.mtime = nil }.should \
+        raise_error(Zlib::GzipFile::Error, 'header is already written')
+    end
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/open_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/open_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/open_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/orig_name_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/orig_name_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/orig_name_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/pos_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/pos_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/pos_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/print_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/print_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/print_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/printf_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/printf_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/printf_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/putc_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/putc_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/putc_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/puts_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/puts_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/puts_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/tell_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/tell_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/tell_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/write_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/write_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/gzipwriter/write_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,23 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'stringio'
+require 'zlib'
+
+describe "GzipWriter#write" do
+
+  before :each do
+    @data = '12345abcde'
+    @zip = "\037\213\b\000,\334\321G\000\00334261MLJNI\005\000\235\005\000$\n\000\000\000"
+    @io = StringIO.new
+  end
+
+  it "writes some compressed data" do
+    Zlib::GzipWriter.wrap @io do |gzio|
+      gzio.write @data
+    end
+
+    # skip gzip header for now
+    @io.string[10..-1].should == @zip[10..-1]
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/inflate/append_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/inflate/append_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/inflate/append_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'zlib'
+
+describe 'Zlib::Inflate#<<' do
+  it 'appends data to the input stream' do
+    zs = Zlib::Inflate.new
+    zs << "x\234K\313\317\a\000\002\202\001E"
+
+    zs.finish.should == 'foo'
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/inflate/inflate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/inflate/inflate_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/inflate/inflate_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,49 @@
+require 'zlib'
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe 'Zlib::Inflate#inflate' do
+
+  before :each do
+    @inflator = Zlib::Inflate.new
+  end
+
+  it 'inflates some data' do
+    data = "x\234c`\200\001\000\000\n\000\001"
+
+    unzipped = @inflator.inflate data
+    @inflator.finish
+
+    unzipped.should == "\000" * 10
+  end
+
+  it 'inflates lots of data' do
+    data = "x\234\355\301\001\001\000\000\000\200\220\376\257\356\b\n#{"\000" * 31}\030\200\000\000\001"
+
+    unzipped = @inflator.inflate data
+    @inflator.finish
+
+    unzipped.should == "\000" * 32 * 1024
+  end
+
+end
+
+describe 'Zlib::Inflate::inflate' do
+
+  it 'inflates some data' do
+    data = "x\234c`\200\001\000\000\n\000\001"
+
+    unzipped = Zlib::Inflate.inflate data
+
+    unzipped.should == "\000" * 10
+  end
+
+  it 'inflates lots of data' do
+    data = "x\234\355\301\001\001\000\000\000\200\220\376\257\356\b\n#{"\000" * 31}\030\200\000\000\001"
+
+    zipped = Zlib::Inflate.inflate data
+
+    zipped.should == "\000" * 32 * 1024
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/inflate/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/inflate/new_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/inflate/new_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/inflate/set_dictionary_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/inflate/set_dictionary_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/inflate/set_dictionary_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'zlib'
+
+describe 'Zlib::Inflate#set_dictionary' do
+  it 'sets the inflate dictionary' do
+    deflated = "x\273\024\341\003\313KLJNIMK\317\310\314\002\000\025\206\003\370"
+
+    i = Zlib::Inflate.new
+
+    begin
+      i << deflated
+      flunk 'Zlib::NeedDict not raised'
+    rescue Zlib::NeedDict
+      i.set_dictionary 'aaaaaaaaaa'
+    end
+
+    i.finish.should == 'abcdefghij'
+  end
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/inflate/sync_point_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/inflate/sync_point_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/inflate/sync_point_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/inflate/sync_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/inflate/sync_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/inflate/sync_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/zlib_version_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/zlib_version_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/zlib_version_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/adler_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/adler_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/adler_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/avail_in_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/avail_in_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/avail_in_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/avail_out_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/avail_out_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/avail_out_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/close_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/close_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/close_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/closed_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/closed_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/closed_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/data_type_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/data_type_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/data_type_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/end_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/end_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/end_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/ended_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/ended_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/ended_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/finish_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/finish_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/finish_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/finished_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/finished_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/finished_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/flush_next_in_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/flush_next_in_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/flush_next_in_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/flush_next_out_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/flush_next_out_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/flush_next_out_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'zlib'
+
+describe 'Zlib::ZStream#flush_next_out' do
+
+  it 'flushes the stream and flushes the output buffer' do
+    zs = Zlib::Inflate.new
+    zs << "x\234K\313\317\a\000\002\202\001E"
+
+    zs.flush_next_out.should == 'foo'
+    zs.finished?.should == true
+    zs.flush_next_out.should == ''
+  end
+
+end
+

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/reset_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/reset_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/reset_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/stream_end_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/stream_end_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/stream_end_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/total_in_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/total_in_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/total_in_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/total_out_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/total_out_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/library/zlib/zstream/total_out_spec.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'

Added: MacRuby/branches/experimental/spec/frozen/nbproject/project.properties
===================================================================
--- MacRuby/branches/experimental/spec/frozen/nbproject/project.properties	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/nbproject/project.properties	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+file.reference.rubyspec-core=core
+file.reference.rubyspec-fixtures=fixtures
+file.reference.rubyspec-language=language
+file.reference.rubyspec-library=library
+file.reference.rubyspec-shared=shared
+fixtures.dir=${file.reference.rubyspec-fixtures}
+javac.classpath=
+language.dir=${file.reference.rubyspec-language}
+library.dir=${file.reference.rubyspec-library}
+main.file=
+platform.active=default
+shared.dir=${file.reference.rubyspec-shared}
+source.encoding=UTF-8
+src.dir=${file.reference.rubyspec-core}

Added: MacRuby/branches/experimental/spec/frozen/nbproject/project.xml
===================================================================
--- MacRuby/branches/experimental/spec/frozen/nbproject/project.xml	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/nbproject/project.xml	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+    <type>org.netbeans.modules.ruby.rubyproject</type>
+    <configuration>
+        <data xmlns="http://www.netbeans.org/ns/ruby-project/1">
+            <name>RubySpec</name>
+            <source-roots>
+                <root id="src.dir" name="core"/>
+                <root id="fixtures.dir"/>
+                <root id="language.dir"/>
+                <root id="library.dir"/>
+                <root id="shared.dir"/>
+            </source-roots>
+            <test-roots/>
+        </data>
+    </configuration>
+</project>

Added: MacRuby/branches/experimental/spec/frozen/ruby.1.8.mspec
===================================================================
--- MacRuby/branches/experimental/spec/frozen/ruby.1.8.mspec	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/ruby.1.8.mspec	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,35 @@
+class MSpecScript
+  # Language features specs
+  set :language, [ 'language' ]
+
+  # Core library specs
+  set :core, [
+    'core',
+
+    # 1.9
+    '^core/basicobject'
+  ]
+
+  # Standard library specs
+  set :library, [
+    'library',
+
+    # 1.9 feature
+    '^library/cmath',
+    '^library/continuation',
+    '^library/coverage',
+    '^library/fiber',
+    '^library/json',
+    '^library/minitest',
+    '^library/prime',
+    '^library/ripper',
+    '^library/rake',
+    '^library/rubygems',
+  ]
+
+  # An ordered list of the directories containing specs to run
+  set :files, get(:language) + get(:core) + get(:library)
+
+  # The default implementation to run the specs.
+  set :target, 'ruby'
+end

Added: MacRuby/branches/experimental/spec/frozen/ruby.1.9.mspec
===================================================================
--- MacRuby/branches/experimental/spec/frozen/ruby.1.9.mspec	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/ruby.1.9.mspec	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,58 @@
+class MSpecScript
+  # Language features specs
+  set :language, [ 'language' ]
+
+  # Core library specs
+  set :core, [ 'core' ]
+
+  # Standard library specs
+  set :library, [
+    'library',
+
+    # obsolete libraries
+    '^library/cgi-lib',
+    '^library/date2',
+    '^library/eregex',
+    '^library/finalize',
+    '^library/ftools',
+    '^library/generator',
+    '^library/getopts',
+    '^library/importenv',
+    '^library/jcode',
+    '^library/mailread',
+    '^library/parsearg',
+    '^library/parsedate',
+    '^library/ping',
+    '^library/readbytes',
+    '^library/rubyunit',
+    '^library/runit',
+    '^library/soap',
+    '^library/wsdl',
+    '^library/xsd',
+    '^library/Win32API',
+
+    '^library/test/unit/collector',
+    '^library/test/unit/ui',
+    '^library/test/unit/util',
+
+    '^library/dl',  # reimplemented and API changed
+  ]
+
+  # An ordered list of the directories containing specs to run
+  set :files, get(:language) + get(:core) + get(:library)
+
+  # This set of files is run by mspec ci
+  set :ci_files, get(:files)
+
+  # The default implementation to run the specs.
+  # TODO: this needs to be more sophisticated since the
+  # executable is not consistently named.
+  set :target, 'ruby1.9'
+
+  set :tags_patterns, [
+                        [%r(language/), 'tags/1.9/language/'],
+                        [%r(core/),     'tags/1.9/core/'],
+                        [%r(library/),  'tags/1.9/library/'],
+                        [/_spec.rb$/,   '_tags.txt']
+                      ]
+end

Added: MacRuby/branches/experimental/spec/frozen/shared/file/blockdev.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/file/blockdev.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/file/blockdev.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+describe :file_blockdev, :shared => true do
+  it "returns true/false depending if the named file is a block device" do
+    @object.send(@method, tmp("/")).should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/shared/file/chardev.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/file/chardev.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/file/chardev.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+describe :file_chardev, :shared => true do
+  it "returns true/false depending if the named file is a char device" do
+    @object.send(@method, tmp("/")).should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/shared/file/directory.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/file/directory.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/file/directory.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,31 @@
+describe :file_directory, :shared => true do
+  before :each do
+    platform_is :windows do
+      @dir  = "C:\\"
+      @file = "C:\\winnt\\notepad.exe"
+    end
+
+    platform_is_not :windows do
+      @dir  = "/"
+      @file = "/bin/ls"
+    end
+  end
+
+  after :each do
+    @dir = nil
+  end
+
+  it "return true if dir is a directory, otherwise return false" do
+    @object.send(@method, @dir).should == true
+    @object.send(@method, @file).should == false
+  end
+
+  it "raises an ArgumentError if not passed one argument" do
+    lambda { @object.send(@method)              }.should raise_error(ArgumentError)
+    lambda { @object.send(@method, @dir, @file) }.should raise_error(ArgumentError)
+  end
+
+  it "raises a TypeError if not passed a String type" do
+    lambda { @object.send(@method, nil) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/shared/file/executable.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/file/executable.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/file/executable.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,48 @@
+describe :file_executable, :shared => true do
+  before :each do
+    @file1 = tmp('temp1.txt')
+    @file2 = tmp('temp2.txt')
+
+    File.open(@file1, "w"){} # touch
+    File.open(@file2, "w"){} # touch
+
+    File.chmod(0755, @file1)
+  end
+
+  after :each do
+    File.delete(@file1) if File.exist?(@file1)
+    File.delete(@file2) if File.exist?(@file2)
+
+    @file1 = nil
+    @file2 = nil
+  end
+
+  platform_is_not :windows do
+    it "returns true if named file is executable by the effective user id of the process, otherwise false" do
+      @object.send(@method, '/etc/passwd').should == false
+      @object.send(@method, @file1).should == true
+      @object.send(@method, @file2).should == false
+    end
+
+    it "return true if the argument is an executable file" do
+      @object.send(@method, @file1).should == true
+      @object.send(@method, @file2).should == false
+    end
+  end
+
+  it "raises an ArgumentError if not passed one argument" do
+    lambda { @object.send(@method) }.should raise_error(ArgumentError)
+  end
+
+  it "raises a TypeError if not passed a String type" do
+    lambda { @object.send(@method, 1)     }.should raise_error(TypeError)
+    lambda { @object.send(@method, nil)   }.should raise_error(TypeError)
+    lambda { @object.send(@method, false) }.should raise_error(TypeError)
+  end
+end
+
+describe :file_executable_missing, :shared => true do
+  it "returns false if the file does not exist" do
+    @object.send(@method, 'fake_file').should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/shared/file/executable_real.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/file/executable_real.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/file/executable_real.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,46 @@
+describe :file_executable_real, :shared => true do
+  before :each do
+    @file1 = tmp('temp1.txt')
+    @file2 = tmp('temp2.txt')
+
+    File.open(@file1, "w") {} # touch
+    File.open(@file2, "w") {}
+
+    File.chmod(0755, @file1)
+  end
+
+  after :each do
+    File.delete(@file1) if File.exist?(@file1)
+    File.delete(@file2) if File.exist?(@file2)
+
+    @file1 = nil
+    @file2 = nil
+  end
+
+  platform_is_not :windows do
+    it "returns true if the file its an executable" do
+      @object.send(@method, @file1).should == true
+      @object.send(@method, @file2).should == false
+    end
+  end
+
+  it "returns true if named file is readable by the real user id of the process, otherwise false" do
+    @object.send(@method, @file1).should == true
+  end
+
+  it "raises an ArgumentError if not passed one argument" do
+    lambda { @object.send(@method) }.should raise_error(ArgumentError)
+  end
+
+  it "raises a TypeError if not passed a String type" do
+    lambda { @object.send(@method, 1)     }.should raise_error(TypeError)
+    lambda { @object.send(@method, nil)   }.should raise_error(TypeError)
+    lambda { @object.send(@method, false) }.should raise_error(TypeError)
+  end
+end
+
+describe :file_executable_real_missing, :shared => true do
+  it "returns false if the file does not exist" do
+    @object.send(@method, 'fake_file').should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/shared/file/exist.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/file/exist.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/file/exist.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+describe :file_exist, :shared => true do
+  it "return true if the file exist" do
+    @object.send(@method, __FILE__).should == true
+    @object.send(@method, 'a_fake_file').should == false
+  end
+
+  it "return true if the file exist using the alias exists?" do
+    @object.send(@method, __FILE__).should == true
+    @object.send(@method, 'a_fake_file').should == false
+  end
+
+  it "raises an ArgumentError if not passed one argument" do
+    lambda { @object.send(@method) }.should raise_error(ArgumentError)
+    lambda { @object.send(@method, __FILE__, __FILE__) }.should raise_error(ArgumentError)
+  end
+
+  it "raises a TypeError if not passed a String type" do
+    lambda { @object.send(@method, nil) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/shared/file/file.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/file/file.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/file/file.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,43 @@
+describe :file_file, :shared => true do
+  before :each do
+    platform_is :windows do
+      @null = "NUL"
+      @dir  = "C:\\"
+    end
+
+    platform_is_not :windows do
+      @null = "/dev/null"
+      @dir  = "/bin"
+    end
+
+    @file = tmp("test.txt")
+    File.open(@file, "w"){} # touch
+  end
+
+  after :each do
+    File.delete(@file) rescue nil
+    @null = nil
+    @file = nil
+  end
+
+  it "returns true if the named file exists and is a regular file." do
+    @object.send(@method, @file).should == true
+    @object.send(@method, @dir).should == false
+  end
+
+  platform_is_not :windows do
+    it "return true if the null device exists and is a regular file." do
+      @object.send(@method, @null).should == false # May fail on MS Windows
+    end
+  end
+
+  it "raises an ArgumentError if not passed one argument" do
+    lambda { @object.send(@method)               }.should raise_error(ArgumentError)
+    lambda { @object.send(@method, @null, @file) }.should raise_error(ArgumentError)
+  end
+
+  it "raises a TypeError if not passed a String type" do
+    lambda { @object.send(@method, nil) }.should raise_error(TypeError)
+    lambda { @object.send(@method, 1)   }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/shared/file/grpowned.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/file/grpowned.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/file/grpowned.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+describe :file_grpowned, :shared => true do
+  before :each do
+    @file = tmp('i_exist')
+    File.open(@file,'w'){|f| f.write 'rubinius'; @fh = f}
+    File.chown(nil, Process.gid, @file) rescue nil
+  end
+
+  after :each do
+    @fh.close
+    File.delete(@file) if File.exist?(@file)
+  end
+
+  platform_is_not :windows do
+    it "return true if the file exist" do
+      @object.send(@method, @file).should == true
+    end
+  end
+
+  platform_is :windows do
+    it "return false if the file exist" do
+      @object.send(@method, @file).should == false
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/shared/file/identical.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/file/identical.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/file/identical.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,38 @@
+describe :file_identical, :shared => true do
+  before :each do
+    @file1 = tmp('test.txt')
+    @file2 = tmp('test2.txt')
+    @file3 = tmp('test.lnk')
+    File.delete(@file3) if File.exists?(@file3)
+
+    File.open(@file1,"w+") { |f| f.puts "file1" }
+    File.open(@file2,"w+") { |f| f.puts "file2" }
+    File.link(@file1, @file3)
+  end
+
+  after :each do
+    File.unlink(@file3)
+    File.delete(@file1) if File.exists?(@file1)
+    File.delete(@file2) if File.exists?(@file2)
+  end
+
+  it "return true if they are identical" do
+    @object.send(@method, @file1, @file1).should == true
+    @object.send(@method, @file1, @file2).should == false
+    @object.send(@method, @file1, @file3).should == true
+  end
+
+  it "raises an ArgumentError if not passed two arguments" do
+    lambda { @object.send(@method, @file1, @file2, @file3) }.should raise_error(ArgumentError)
+    lambda { @object.send(@method, @file1) }.should raise_error(ArgumentError)
+  end
+
+  it "raises a TypeError if not passed String types" do
+    lambda { @object.send(@method, 1,1) }.should raise_error(TypeError)
+  end
+
+  it "returns true if both named files are identical" do
+    @object.send(@method, @file1, @file1).should be_true
+    @object.send(@method, @file1, @file2).should be_false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/shared/file/owned.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/file/owned.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/file/owned.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+describe :file_owned, :shared => true do
+end

Added: MacRuby/branches/experimental/spec/frozen/shared/file/pipe.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/file/pipe.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/file/pipe.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+describe :file_pipe, :shared => true do
+end

Added: MacRuby/branches/experimental/spec/frozen/shared/file/readable.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/file/readable.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/file/readable.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+describe :file_readable, :shared => true do
+  before :each do
+    @file = '/tmp/i_exist'
+  end
+
+  after :each do
+    File.delete(@file) if File.exists?(@file)
+  end
+
+  it "returns true if named file is readable by the effective user id of the process, otherwise false" do
+    @object.send(@method, '/etc/passwd').should == true
+    File.open(@file,'w') { @object.send(@method, @file).should == true }
+  end
+end
+
+describe :file_readable_missing, :shared => true do
+  it "returns false if the file does not exist" do
+    @object.send(@method, 'fake_file').should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/shared/file/readable_real.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/file/readable_real.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/file/readable_real.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+describe :file_readable_real, :shared => true do
+  before :each do
+    @file = tmp('i_exist')
+  end
+
+  after :each do
+    File.delete(@file) if File.exists?(@file)
+  end
+
+  it "returns true if named file is readable by the real user id of the process, otherwise false" do
+    File.open(@file,'w') { @object.send(@method, @file).should == true }
+  end
+end
+
+describe :file_readable_real_missing, :shared => true do
+  it "returns false if the file does not exist" do
+    @object.send(@method, 'fake_file').should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/shared/file/setgid.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/file/setgid.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/file/setgid.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+describe :file_setgid, :shared => true do
+end

Added: MacRuby/branches/experimental/spec/frozen/shared/file/setuid.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/file/setuid.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/file/setuid.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+describe :file_setuid, :shared => true do
+end

Added: MacRuby/branches/experimental/spec/frozen/shared/file/size.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/file/size.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/file/size.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,34 @@
+describe :file_size, :shared => true do
+  before :each do
+    @empty = "i_am_empty"
+    File.delete @empty if File.exist? @empty
+    File.open(@empty,'w') { }
+
+    @exists = tmp('i_exist')
+    File.open(@exists,'w') { |f| f.write 'rubinius' }
+  end
+
+  after :each do
+    File.delete @empty if File.exist? @empty
+    File.delete @exists if File.exist? @exists
+  end
+
+  it "returns nil if the file has zero size" do
+    @object.send(@method, @empty).should == nil
+  end
+
+  it "returns the size of the file if it exists and is not empty" do
+    @object.send(@method, @exists).should == 8
+  end
+end
+
+describe :file_size_missing, :shared => true do
+  before :each do
+    @missing = "i_dont_exist"
+    File.delete @missing if File.exists? @missing
+  end
+
+  it "returns nil if file_name doesn't exist" do
+    @object.send(@method, @missing).should == nil
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/shared/file/socket.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/file/socket.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/file/socket.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+describe :file_socket, :shared => true do
+end

Added: MacRuby/branches/experimental/spec/frozen/shared/file/sticky.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/file/sticky.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/file/sticky.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+describe :file_sticky, :shared => true do
+end

Added: MacRuby/branches/experimental/spec/frozen/shared/file/symlink.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/file/symlink.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/file/symlink.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,22 @@
+describe :file_symlink, :shared => true do
+  before :each do
+    @file = "test.txt"
+    @link = "test.lnk"
+    File.delete(@link) if File.exist?(@link)
+    File.delete(@file) if File.exist?(@file)
+    File.open(@file,"w+")
+  end
+
+  after :each do
+    File.unlink(@link) if File.exist?(@link)
+    File.delete(@file) if File.exist?(@file)
+    @link = nil
+  end
+
+  platform_is_not :windows do
+    it "returns true if the file is a link" do
+      File.symlink(@file, @link)
+      @object.send(@method, @link).should == true
+    end
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/shared/file/writable.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/file/writable.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/file/writable.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,20 @@
+describe :file_writable, :shared => true do
+  before :each do
+    @file = tmp('i_exist')
+  end
+
+  after :each do
+    File.delete(@file) if File.exists?(@file)
+  end
+
+  it "returns true if named file is writable by the effective user id of the process, otherwise false" do
+    @object.send(@method, '/etc/passwd').should == false
+    File.open(@file,'w') { @object.send(@method, @file).should == true }
+  end
+end
+
+describe :file_writable_missing, :shared => true do
+  it "returns false if the file does not exist" do
+    @object.send(@method, 'fake_file').should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/shared/file/writable_real.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/file/writable_real.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/file/writable_real.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,29 @@
+describe :file_writable_real, :shared => true do
+  before :each do
+    @file = tmp('i_exist')
+  end
+
+  after :each do
+    File.delete(@file) if File.exist?(@file)
+  end
+
+  it "returns true if named file is writable by the real user id of the process, otherwise false" do
+    File.open(@file,'w') { @object.send(@method, @file).should == true }
+  end
+
+  it "raises an ArgumentError if not passed one argument" do
+    lambda { File.writable_real?        }.should raise_error(ArgumentError)
+  end
+
+  it "raises a TypeError if not passed a String type" do
+    lambda { @object.send(@method, 1)     }.should raise_error(TypeError)
+    lambda { @object.send(@method, nil)   }.should raise_error(TypeError)
+    lambda { @object.send(@method, false) }.should raise_error(TypeError)
+  end
+end
+
+describe :file_writable_real_missing, :shared => true do
+  it "returns false if the file does not exist" do
+    @object.send(@method, 'fake_file').should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/shared/file/zero.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/file/zero.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/file/zero.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,78 @@
+describe :file_zero, :shared => true do
+  before :each do
+    @zero_file    = 'test.txt'
+    @nonzero_file = 'test2.txt'
+    @dir = File.dirname(__FILE__)
+
+    File.open(@zero_file, "w") {|f| @zero_fh = f} # Touch
+    File.open(@nonzero_file, "w") { |f| f.puts "hello"; @nonzero_fh = f }
+  end
+
+  after :each do
+    @zero_fh.close unless @zero_fh.closed?
+    @nonzero_fh.close unless @nonzero_fh.closed?
+    File.delete(@zero_file) if File.exists?(@zero_file)
+    File.delete(@nonzero_file) if File.exists?(@nonzero_file)
+    @zero_file    = nil
+    @zero_fh    = nil
+    @nonzero_file = nil
+    @nonzero_fh = nil
+  end
+
+  it "returns true if the file is empty" do
+    @object.send(@method, @zero_file).should == true
+  end
+
+  it "returns false if the file is not empty" do
+    @object.send(@method, @nonzero_file).should == false
+  end
+
+  platform_is :windows do
+    it "returns true for NUL" do
+      @object.send(@method, 'NUL').should == true
+      @object.send(@method, 'nul').should == true
+    end
+  end
+
+  platform_is_not :windows do
+    it "returns true for /dev/null" do
+      @object.send(@method, '/dev/null').should == true
+    end
+  end
+
+  it "raises an ArgumentError if not passed one argument" do
+    lambda { File.zero? }.should raise_error(ArgumentError)
+  end
+
+  it "raises a TypeError if not passed a String type" do
+    lambda { @object.send(@method, nil)   }.should raise_error(TypeError)
+    lambda { @object.send(@method, true)  }.should raise_error(TypeError)
+    lambda { @object.send(@method, false) }.should raise_error(TypeError)
+  end
+
+  it "returns true inside a block opening a file if it is empty" do
+    File.open(@zero_file,'w') do
+      @object.send(@method, @zero_file).should == true
+    end
+  end
+
+  platform_is_not :windows do
+    it "returns false for a directory" do
+      @object.send(@method, @dir).should == false
+    end
+  end
+
+  platform_is :windows do
+    ruby_bug("redmine #449", "1.8.6") do
+      it "returns false for a directory" do
+        @object.send(@method, @dir).should == false
+      end
+    end
+  end
+end
+
+describe :file_zero_missing, :shared => true do
+  it "returns false if the file does not exist" do
+    @object.send(@method, 'fake_file').should == false
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/shared/kernel/raise.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/kernel/raise.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/kernel/raise.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,43 @@
+describe :kernel_raise, :shared => true do
+  before :each do
+    ScratchPad.clear
+  end
+
+  it "aborts execution" do
+    lambda do
+      @object.raise Exception, "abort"
+      ScratchPad.record :no_abort
+    end.should raise_error(Exception, "abort")
+
+    ScratchPad.recorded.should be_nil
+  end
+
+  it "raises RuntimeError if no exception class is given" do
+    lambda { @object.raise }.should raise_error(RuntimeError)
+  end
+
+  it "re-raises the rescued exception" do
+    lambda do
+      begin
+        raise Exception, "outer"
+        ScratchPad.record :no_abort
+      rescue
+        begin
+          raise StandardError, "inner"
+        rescue
+        end
+
+        @object.raise
+        ScratchPad.record :no_reraise
+      end
+    end.should raise_error(Exception, "outer")
+
+    ScratchPad.recorded.should be_nil
+  end
+
+  it "allows Exception, message, and backtrace parameters" do
+    lambda do
+      @object.raise(ArgumentError, "message", caller)
+    end.should raise_error(ArgumentError, "message")
+  end
+end

Added: MacRuby/branches/experimental/spec/frozen/spec_helper.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/spec_helper.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/spec_helper.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,49 @@
+unless ENV['MSPEC_RUNNER']
+  begin
+    require "pp"
+    require 'mspec/version'
+    require 'mspec/helpers'
+    require 'mspec/guards'
+    require 'mspec/runner/shared'
+    require 'mspec/matchers/be_ancestor_of'
+    require 'mspec/matchers/output'
+    require 'mspec/matchers/output_to_fd'
+    require 'mspec/matchers/complain'
+    require 'mspec/matchers/equal_element'
+    require 'mspec/matchers/equal_utf16'
+    require 'mspec/matchers/match_yaml'
+
+    # Code to setup HOME directory correctly on Windows
+    # This duplicates Ruby 1.9 semantics for defining HOME
+    platform_is :windows do
+      if ENV['HOME']
+        ENV['HOME'] = ENV['HOME'].tr '\\', '/'
+      elsif ENV['HOMEDIR'] && ENV['HOMEDRIVE']
+        ENV['HOME'] = File.join(ENV['HOMEDRIVE'], ENV['HOMEDIR'])
+      elsif ENV['HOMEDIR']
+        ENV['HOME'] = ENV['HOMEDIR']
+      elsif ENV['HOMEDRIVE']
+        ENV['HOME'] = ENV['HOMEDRIVE']
+      elsif ENV['USERPROFILE']
+        ENV['HOME'] = ENV['USERPROFILE']
+      else
+        puts "No suitable HOME environment found. This means that all of"
+        puts "HOME, HOMEDIR, HOMEDRIVE, and USERPROFILE are not set"
+        exit 1
+      end
+    end
+
+    TOLERANCE = 0.00003 unless Object.const_defined?(:TOLERANCE)
+  rescue LoadError
+    puts "Please install the MSpec gem to run the specs."
+    exit 1
+  end
+end
+
+minimum_version = "1.5.10"
+unless MSpec::VERSION >= minimum_version
+  puts "Please install MSpec version >= #{minimum_version} to run the specs"
+  exit 1
+end
+
+$VERBOSE = nil unless ENV['OUTPUT_WARNINGS']

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/closed_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/closed_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/closed_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:ARGF.closed? returns true if the current stream has been closed

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/each_byte_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/each_byte_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/each_byte_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:ARGF.each_byte yields each byte of all streams to the passed block
+fails:ARGF.each_byte returns self when passed a block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/each_line_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/each_line_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/each_line_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:ARGF.each_line reads each line of files

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/each_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/each_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/each_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:ARGF.each reads each line of files

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/eof_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/eof_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/eof_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+fails:ARGF.eof returns true when reaching the end of a file
+fails:ARGF.eof raises IOError when called on a closed stream
+fails:ARGF.eof? returns true when reaching the end of a file
+fails:ARGF.eof? raises IOError when called on a closed stream

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/file_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/file_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/file_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:ARGF.file returns the current file object on each file

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/filename_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/filename_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/filename_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:ARGF.filename returns the current file name on each file
+fails:ARGF.filename it sets the $FILENAME global variable with the current file name on each file

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/fileno_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/fileno_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/fileno_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:ARGF.fileno returns the current file number on each file
+fails:ARGF.fileno raises an ArgumentError when called on a closed stream

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/getc_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/getc_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/getc_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:ARGF.getc reads each char of files
+fails:ARGF.getc returns nil when end of stream reached

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/gets_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/gets_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/gets_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+fails:ARGF.gets reads one line of a file
+fails:ARGF.gets reads all lines of a file
+fails:ARGF.gets reads all lines of stdin
+fails:ARGF.gets reads all lines of two files
+fails:ARGF.gets sets $_ global variable with each line read
+fails:ARGF.gets returns nil when reaching end of files

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/lineno_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/lineno_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/lineno_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:ARGF.lineno returns the current line number on each file

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/path_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/path_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/path_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:ARGF.path returns the current file name on each file
+fails:ARGF.path it sets the $FILENAME global variable with the current file name on each file

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/pos_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/pos_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/pos_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+fails:ARGF.pos gives the correct position for each read operation
+fails:ARGF.pos raises an ArgumentError when called on a closed stream
+fails:ARGF.pos= sets the correct position in files

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/read_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/read_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/read_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+fails:ARGF.read reads the contents of a file
+fails:ARGF.read treats first nil argument as no length limit
+fails:ARGF.read treats second nil argument as no output buffer
+fails:ARGF.read treats second argument as an output buffer
+fails:ARGF.read reads a number of bytes from the first file
+fails:ARGF.read reads from a single file consecutively
+fails:ARGF.read reads the contents of two files
+fails:ARGF.read reads the contents of one file and some characters from the second
+fails:ARGF.read reads across two files consecutively
+fails:ARGF.read reads the contents of stdin
+fails:ARGF.read reads a number of bytes from stdin
+fails:ARGF.read reads the contents of one file and stdin
+fails:ARGF.read reads the contents of the same file twice
+fails:ARGF.read reads the contents of a special device file

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/readchar_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/readchar_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/readchar_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:ARGF.getc reads each char of files
+fails:ARGF.readchar raises EOFError when end of stream reached

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/readline_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/readline_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/readline_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+fails:ARGF.readline reads one line of a file
+fails:ARGF.readline reads all lines of a file
+fails:ARGF.readline reads all lines of stdin
+fails:ARGF.readline reads all lines of two files
+fails:ARGF.readline sets $_ global variable with each line read
+fails:ARGF.readline raises an EOFError when reaching end of files

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/readlines_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/readlines_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/readlines_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:ARGF.readlines reads all lines of all files
+fails:ARGF.readlines returns nil when end of stream reached

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/rewind_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/rewind_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/rewind_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:ARGF.rewind goes back to beginning of current file
+fails:ARGF.rewind raises an ArgumentError when end of stream reached

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/seek_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/seek_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/seek_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+fails:ARGF.seek sets the absolute position relative to beginning of file
+fails:ARGF.seek sets the position relative to current position in file
+fails:ARGF.seek sets the absolute position relative to end of file
+fails:ARGF.seek takes at least one argument (offset)

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/skip_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/skip_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/skip_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+fails:ARGF.skip skips the current file
+fails:ARGF.skip has no effect when called twice in a row
+fails:ARGF.skip has no effect at end of stream

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/tell_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/tell_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/tell_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:ARGF.tell gives the correct position for each read operation
+fails:ARGF.tell raises an ArgumentError when called on a closed stream

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/to_a_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/to_a_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/to_a_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:ARGF.to_a reads all lines of all files
+fails:ARGF.to_a returns nil when end of stream reached

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/to_i_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/to_i_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/to_i_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:ARGF.to_i returns the current file number on each file
+fails:ARGF.to_i raises an ArgumentError when called on a closed stream

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/to_io_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/to_io_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/to_io_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:ARGF.to_io returns the IO of the current file

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/to_s_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/to_s_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/argf/to_s_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:ARGF.to_s returns 'ARGF'

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/frozen_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/frozen_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/frozen_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Array#frozen? returns true if array is temporarily frozen while being sort!ed

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/pack_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/pack_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/pack_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,268 @@
+fails:Array#pack sequentially processes each pack format, which consumes element in the array, and finally concatenates their result
+fails:Array#pack ignores white spaces
+fails:Array#pack with format 'B' returns packed bit-string descending order
+fails:Array#pack with format 'B' conversion edge case: all zeros
+fails:Array#pack with format 'B' conversion edge case: all ones
+fails:Array#pack with format 'B' conversion edge case: left one
+fails:Array#pack with format 'B' conversion edge case: right one
+fails:Array#pack with format 'B' conversion edge case: edge sequences not in first char
+fails:Array#pack with format 'B' returns zero-char for each 2 of count that greater than string length
+fails:Array#pack with format 'B' returns extra zero char if count is odd and greater than string length
+fails:Array#pack with format 'B' starts new char if string is ended before char's 8 bits
+fails:Array#pack with format 'B' returns empty string if count = 0
+fails:Array#pack with format 'b' returns packed bit-string descending order
+fails:Array#pack with format 'b' conversion edge case: all zeros
+fails:Array#pack with format 'b' conversion edge case: all ones
+fails:Array#pack with format 'b' conversion edge case: left one
+fails:Array#pack with format 'b' conversion edge case: right one
+fails:Array#pack with format 'b' conversion edge case: edge sequences not in first char
+fails:Array#pack with format 'b' returns zero-char for each 2 of count that greater than string length
+fails:Array#pack with format 'b' returns extra zero char if count is odd and greater than string length
+fails:Array#pack with format 'b' starts new char if argument string is ended before char's 8 bits
+fails:Array#pack with format 'b' returns empty string if count = 0
+fails:Array#pack with format 'H' encodes hexadecimal digits to byte sequence in the order of high-nibble first
+fails:Array#pack with format 'H' ignores rest of the pack argument when the argument is too long
+fails:Array#pack with format 'H' fills low-nibble of the last byte with 0 when count is odd
+fails:Array#pack with format 'H' fills the rest bytes with 0 if pack argument has insufficient length
+fails:Array#pack with format 'H' returns the whole argument string with star parameter
+fails:Array#pack with format 'H' consumes only one array item per a format
+fails:Array#pack with format 'h' encodes hexadecimal digits to byte sequence in the order of low-nibble first
+fails:Array#pack with format 'h' ignores rest of the pack argument when the argument is too long
+fails:Array#pack with format 'h' fills low-nibble of the last byte with 0 when count is odd
+fails:Array#pack with format 'h' fills the rest bytes with 0 if pack argument has insufficient length
+fails:Array#pack with format 'h' returns the whole argument string with star parameter
+fails:Array#pack with format 'h' consumes only one array item per a format
+fails:Array#pack with format 'C' returns a string with byte of appropriate number
+fails:Array#pack with format 'C' regards negative values as 2's complement in order to converts it to positive
+fails:Array#pack with format 'C' reduces value to fit in byte
+fails:Array#pack with format 'C' tries to convert the pack argument to an Integer using #to_int
+fails:Array#pack with format 'C' processes count number of array elements if count given
+fails:Array#pack with format 'C' returns empty string if count = 0
+fails:Array#pack with format 'C' with star parameter processes all remaining array items
+fails:Array#pack with format 'c' returns a string with byte of appropriate number
+fails:Array#pack with format 'c' regards negative values as 2's complement in order to converts it to positive
+fails:Array#pack with format 'c' reduces value to fit in byte
+fails:Array#pack with format 'c' tries to convert the pack argument to an Integer using #to_int
+fails:Array#pack with format 'c' processes count number of array elements if count given
+fails:Array#pack with format 'c' returns empty string if count = 0
+fails:Array#pack with format 'c' with star parameter processes all remaining array items
+fails:Array#pack with format 'n' returns a string containing 2 bytes for an integer
+fails:Array#pack with format 'n' regards negative values as 2's complement in order to converts it to positive
+fails:Array#pack with format 'n' drops higher bytes when a pack argument is >= 2**32
+fails:Array#pack with format 'n' drops higher bytes when a pack argument is < -2**32
+fails:Array#pack with format 'n' tries to convert the pack argument to an Integer using #to_int
+fails:Array#pack with format 'n' processes count number of array elements if count given
+fails:Array#pack with format 'n' returns empty string if count = 0
+fails:Array#pack with format 'n' with star parameter processes all remaining array items
+fails:Array#pack with format 'v' returns a string containing 2 bytes for an integer
+fails:Array#pack with format 'v' regards negative values as 2's complement in order to converts it to positive
+fails:Array#pack with format 'v' drops higher bytes when a pack argument is >= 2**16
+fails:Array#pack with format 'v' drops higher bytes when a pack argument is < -2**16
+fails:Array#pack with format 'v' tries to convert the pack argument to an Integer using #to_int
+fails:Array#pack with format 'v' processes count number of array elements if count given
+fails:Array#pack with format 'v' returns empty string if count = 0
+fails:Array#pack with format 'v' with star parameter processes all remaining array items
+fails:Array#pack with format 'N' returns a string containing 4 bytes for an integer
+fails:Array#pack with format 'N' regards negative values as 2's complement in order to converts it to positive
+fails:Array#pack with format 'N' tries to convert the pack argument to an Integer using #to_int
+fails:Array#pack with format 'N' processes count number of array elements if count given
+fails:Array#pack with format 'N' returns empty string if count = 0
+fails:Array#pack with format 'N' with star parameter processes all remaining array items
+fails:Array#pack with format 'V' returns a string containing 4 bytes for an integer
+fails:Array#pack with format 'V' regards negative values as 2's complement in order to converts it to positive
+fails:Array#pack with format 'V' tries to convert the pack argument to an Integer using #to_int
+fails:Array#pack with format 'V' processes count number of array elements if count given
+fails:Array#pack with format 'V' returns empty string if count = 0
+fails:Array#pack with format 'V' with star parameter processes all remaining array items
+fails:Array#pack with format 's' returns a string containing 2 bytes for an integer
+fails:Array#pack with format 's' regards negative values as 2's complement in order to converts it to positive
+fails:Array#pack with format 's' drops higher bytes when a pack argument is >= 2**16
+fails:Array#pack with format 's' drops higher bytes when a pack argument is < -2**16
+fails:Array#pack with format 's' tries to convert the pack argument to an Integer using #to_int
+fails:Array#pack with format 's' processes count number of array elements if count given
+fails:Array#pack with format 's' returns empty string if count = 0
+fails:Array#pack with format 's' with star parameter processes all remaining array items
+fails:Array#pack with format 'S' returns a string containing 2 bytes for an integer
+fails:Array#pack with format 'S' regards negative values as 2's complement in order to converts it to positive
+fails:Array#pack with format 'S' drops higher bytes when a pack argument is >= 2**16
+fails:Array#pack with format 'S' drops higher bytes when a pack argument is < -2**16
+fails:Array#pack with format 'S' tries to convert the pack argument to an Integer using #to_int
+fails:Array#pack with format 'S' processes count number of array elements if count given
+fails:Array#pack with format 'S' returns empty string if count = 0
+fails:Array#pack with format 'S' with star parameter processes all remaining array items
+fails:Array#pack with format 'l' returns a string containing 4 bytes for an integer
+fails:Array#pack with format 'l' regards negative values as 2's complement in order to converts it to positive
+fails:Array#pack with format 'l' tries to convert the pack argument to an Integer using #to_int
+fails:Array#pack with format 'l' processes count number of array elements if count given
+fails:Array#pack with format 'l' returns empty string if count = 0
+fails:Array#pack with format 'l' with star parameter processes all remaining array items
+fails:Array#pack with format 'L' returns a string containing 4 bytes for an integer
+fails:Array#pack with format 'L' regards negative values as 2's complement in order to converts it to positive
+fails:Array#pack with format 'L' tries to convert the pack argument to an Integer using #to_int
+fails:Array#pack with format 'L' processes count number of array elements if count given
+fails:Array#pack with format 'L' returns empty string if count = 0
+fails:Array#pack with format 'L' with star parameter processes all remaining array items
+fails:Array#pack with format 'q' returns a string containing 8 bytes for an integer
+fails:Array#pack with format 'q' regards negative values as 2's complement in order to converts it to positive
+fails:Array#pack with format 'q' tries to convert the pack argument to an Integer using #to_int
+fails:Array#pack with format 'q' processes count number of array elements if count given
+fails:Array#pack with format 'q' returns empty string if count = 0
+fails:Array#pack with format 'q' with star parameter processes all remaining array items
+fails:Array#pack with format 'Q' returns a string containing 8 bytes for an integer
+fails:Array#pack with format 'Q' regards negative values as 2's complement in order to converts it to positive
+fails:Array#pack with format 'Q' tries to convert the pack argument to an Integer using #to_int
+fails:Array#pack with format 'Q' processes count number of array elements if count given
+fails:Array#pack with format 'Q' returns empty string if count = 0
+fails:Array#pack with format 'Q' with star parameter processes all remaining array items
+fails:Array#pack with format 's!' returns a string containing 2 bytes for an integer
+fails:Array#pack with format 's!' regards negative values as 2's complement in order to converts it to positive
+fails:Array#pack with format 's!' drops higher bytes when a pack argument is >= 2**16
+fails:Array#pack with format 's!' drops higher bytes when a pack argument is < -2**16
+fails:Array#pack with format 's!' tries to convert the pack argument to an Integer using #to_int
+fails:Array#pack with format 's!' processes count number of array elements if count given
+fails:Array#pack with format 's!' returns empty string if count = 0
+fails:Array#pack with format 's!' with star parameter processes all remaining array items
+fails:Array#pack with format 's_' returns a string containing 2 bytes for an integer
+fails:Array#pack with format 's_' regards negative values as 2's complement in order to converts it to positive
+fails:Array#pack with format 's_' drops higher bytes when a pack argument is >= 2**16
+fails:Array#pack with format 's_' drops higher bytes when a pack argument is < -2**16
+fails:Array#pack with format 's_' tries to convert the pack argument to an Integer using #to_int
+fails:Array#pack with format 's_' processes count number of array elements if count given
+fails:Array#pack with format 's_' returns empty string if count = 0
+fails:Array#pack with format 's_' with star parameter processes all remaining array items
+fails:Array#pack with format 'S!' returns a string containing 2 bytes for an integer
+fails:Array#pack with format 'S!' regards negative values as 2's complement in order to converts it to positive
+fails:Array#pack with format 'S!' drops higher bytes when a pack argument is >= 2**16
+fails:Array#pack with format 'S!' drops higher bytes when a pack argument is < -2**16
+fails:Array#pack with format 'S!' tries to convert the pack argument to an Integer using #to_int
+fails:Array#pack with format 'S!' processes count number of array elements if count given
+fails:Array#pack with format 'S!' returns empty string if count = 0
+fails:Array#pack with format 'S!' with star parameter processes all remaining array items
+fails:Array#pack with format 'S_' returns a string containing 2 bytes for an integer
+fails:Array#pack with format 'S_' regards negative values as 2's complement in order to converts it to positive
+fails:Array#pack with format 'S_' drops higher bytes when a pack argument is >= 2**16
+fails:Array#pack with format 'S_' drops higher bytes when a pack argument is < -2**16
+fails:Array#pack with format 'S_' tries to convert the pack argument to an Integer using #to_int
+fails:Array#pack with format 'S_' processes count number of array elements if count given
+fails:Array#pack with format 'S_' returns empty string if count = 0
+fails:Array#pack with format 'S_' with star parameter processes all remaining array items
+fails:Array#pack with format 'i' returns a string containing 4 bytes for an integer
+fails:Array#pack with format 'i' regards negative values as 2's complement in order to converts it to positive
+fails:Array#pack with format 'i' tries to convert the pack argument to an Integer using #to_int
+fails:Array#pack with format 'i' processes count number of array elements if count given
+fails:Array#pack with format 'i' returns empty string if count = 0
+fails:Array#pack with format 'i' with star parameter processes all remaining array items
+fails:Array#pack with format 'i!' returns a string containing 4 bytes for an integer
+fails:Array#pack with format 'i!' regards negative values as 2's complement in order to converts it to positive
+fails:Array#pack with format 'i!' tries to convert the pack argument to an Integer using #to_int
+fails:Array#pack with format 'i!' processes count number of array elements if count given
+fails:Array#pack with format 'i!' returns empty string if count = 0
+fails:Array#pack with format 'i!' with star parameter processes all remaining array items
+fails:Array#pack with format 'i_' returns a string containing 4 bytes for an integer
+fails:Array#pack with format 'i_' regards negative values as 2's complement in order to converts it to positive
+fails:Array#pack with format 'i_' tries to convert the pack argument to an Integer using #to_int
+fails:Array#pack with format 'i_' processes count number of array elements if count given
+fails:Array#pack with format 'i_' returns empty string if count = 0
+fails:Array#pack with format 'i_' with star parameter processes all remaining array items
+fails:Array#pack with format 'I' returns a string containing 4 bytes for an integer
+fails:Array#pack with format 'I' regards negative values as 2's complement in order to converts it to positive
+fails:Array#pack with format 'I' tries to convert the pack argument to an Integer using #to_int
+fails:Array#pack with format 'I' processes count number of array elements if count given
+fails:Array#pack with format 'I' returns empty string if count = 0
+fails:Array#pack with format 'I' with star parameter processes all remaining array items
+fails:Array#pack with format 'I!' returns a string containing 4 bytes for an integer
+fails:Array#pack with format 'I!' regards negative values as 2's complement in order to converts it to positive
+fails:Array#pack with format 'I!' tries to convert the pack argument to an Integer using #to_int
+fails:Array#pack with format 'I!' processes count number of array elements if count given
+fails:Array#pack with format 'I!' returns empty string if count = 0
+fails:Array#pack with format 'I!' with star parameter processes all remaining array items
+fails:Array#pack with format 'I_' returns a string containing 4 bytes for an integer
+fails:Array#pack with format 'I_' regards negative values as 2's complement in order to converts it to positive
+fails:Array#pack with format 'I_' tries to convert the pack argument to an Integer using #to_int
+fails:Array#pack with format 'I_' processes count number of array elements if count given
+fails:Array#pack with format 'I_' returns empty string if count = 0
+fails:Array#pack with format 'I_' with star parameter processes all remaining array items
+fails:Array#pack with format 'l!' returns a string containing 4 bytes for an integer
+fails:Array#pack with format 'l!' regards negative values as 2's complement in order to converts it to positive
+fails:Array#pack with format 'l!' tries to convert the pack argument to an Integer using #to_int
+fails:Array#pack with format 'l!' processes count number of array elements if count given
+fails:Array#pack with format 'l!' returns empty string if count = 0
+fails:Array#pack with format 'l!' with star parameter processes all remaining array items
+fails:Array#pack with format 'l_' returns a string containing 4 bytes for an integer
+fails:Array#pack with format 'l_' regards negative values as 2's complement in order to converts it to positive
+fails:Array#pack with format 'l_' tries to convert the pack argument to an Integer using #to_int
+fails:Array#pack with format 'l_' processes count number of array elements if count given
+fails:Array#pack with format 'l_' returns empty string if count = 0
+fails:Array#pack with format 'l_' with star parameter processes all remaining array items
+fails:Array#pack with format 'L!' returns a string containing 4 bytes for an integer
+fails:Array#pack with format 'L!' regards negative values as 2's complement in order to converts it to positive
+fails:Array#pack with format 'L!' tries to convert the pack argument to an Integer using #to_int
+fails:Array#pack with format 'L!' processes count number of array elements if count given
+fails:Array#pack with format 'L!' returns empty string if count = 0
+fails:Array#pack with format 'L!' with star parameter processes all remaining array items
+fails:Array#pack with format 'L_' returns a string containing 4 bytes for an integer
+fails:Array#pack with format 'L_' regards negative values as 2's complement in order to converts it to positive
+fails:Array#pack with format 'L_' tries to convert the pack argument to an Integer using #to_int
+fails:Array#pack with format 'L_' processes count number of array elements if count given
+fails:Array#pack with format 'L_' returns empty string if count = 0
+fails:Array#pack with format 'L_' with star parameter processes all remaining array items
+fails:Array#pack with format 'f' tries to convert the pack argument to a Float using #to_f
+fails:Array#pack with format 'f' accepts a string representation of real number as the pack argument
+fails:Array#pack with format 'f' accepts the positive zero
+fails:Array#pack with format 'f' accepts the negative zero
+fails:Array#pack with format 'f' accepts a positive value
+fails:Array#pack with format 'f' accepts a negative value
+fails:Array#pack with format 'f' accepts the positive infinity
+fails:Array#pack with format 'f' accepts the negative infinity
+fails:Array#pack with format 'd' tries to convert the pack argument to a Float using #to_f
+fails:Array#pack with format 'd' accepts a string representation of real number as the pack argument
+fails:Array#pack with format 'd' accepts the positive zero
+fails:Array#pack with format 'd' accepts the negative zero
+fails:Array#pack with format 'd' accepts a positive value
+fails:Array#pack with format 'd' accepts a negative value
+fails:Array#pack with format 'd' accepts the positive infinity
+fails:Array#pack with format 'd' accepts the negative infinity
+fails:Array#pack with format 'e' tries to convert the pack argument to a Float using #to_f
+fails:Array#pack with format 'e' accepts a string representation of real number as the pack argument
+fails:Array#pack with format 'e' accepts the positive zero
+fails:Array#pack with format 'e' accepts the negative zero
+fails:Array#pack with format 'e' accepts a positive value
+fails:Array#pack with format 'e' accepts a negative value
+fails:Array#pack with format 'e' accepts the positive infinity
+fails:Array#pack with format 'e' accepts the negative infinity
+fails:Array#pack with format 'E' tries to convert the pack argument to a Float using #to_f
+fails:Array#pack with format 'E' accepts a string representation of real number as the pack argument
+fails:Array#pack with format 'E' accepts the positive zero
+fails:Array#pack with format 'E' accepts the negative zero
+fails:Array#pack with format 'E' accepts a positive value
+fails:Array#pack with format 'E' accepts a negative value
+fails:Array#pack with format 'E' accepts the positive infinity
+fails:Array#pack with format 'E' accepts the negative infinity
+fails:Array#pack with format 'g' tries to convert the pack argument to a Float using #to_f
+fails:Array#pack with format 'g' accepts a string representation of real number as the pack argument
+fails:Array#pack with format 'g' accepts the positive zero
+fails:Array#pack with format 'g' accepts the negative zero
+fails:Array#pack with format 'g' accepts a positive value
+fails:Array#pack with format 'g' accepts a negative value
+fails:Array#pack with format 'g' accepts the positive infinity
+fails:Array#pack with format 'g' accepts the negative infinity
+fails:Array#pack with format 'G' tries to convert the pack argument to a Float using #to_f
+fails:Array#pack with format 'G' accepts a string representation of real number as the pack argument
+fails:Array#pack with format 'G' accepts the positive zero
+fails:Array#pack with format 'G' accepts the negative zero
+fails:Array#pack with format 'G' accepts a positive value
+fails:Array#pack with format 'G' accepts a negative value
+fails:Array#pack with format 'G' accepts the positive infinity
+fails:Array#pack with format 'G' accepts the negative infinity
+fails:Array#pack with format 'U' regards a integer as a Unicode codepoint and encodes into UTF-8 byte sequence
+fails:Array#pack with format 'w' converts to BER-compressed integer
+fails:Array#pack with format 'w' calls to_int on non-integer values before packing
+fails:Array#pack with '@' moves the end of result string into the specified position by offset from head
+fails:Array#pack with '@' fills blank with NUL bytes if the position exceeds the end of string
+fails:Array#pack with '@' concatenates successing formats at the position '@' moves it into
+fails:Array#pack with '@' does not recover lost bytes when shorten the string and then extends it again
+fails:Array#pack with '@' is able to work with 'X'
+fails:Array#pack with format 'p' returns a pointer which is able to dereferenced into NUL terminated byte sequence
+fails:Array#pack with format 'p' returns a pointer which is able to dereferenced into a right value
+fails:Array#pack with format 'P' returns a pointer which is able to dereferenced into NUL terminated byte sequence
+fails:Array#pack with format 'P' returns a pointer which is able to dereferenced into a right value

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/push_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/push_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/push_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Array#push raises a TypeError on a frozen array if modification takes place
+fails:Array#push does not raise on a frozen array if no modification is made

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/reject_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/reject_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/reject_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Array#reject! raises a TypeError on a frozen array

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/reverse_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/reverse_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/reverse_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Array#reverse! raises a TypeError on a frozen array

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/shift_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/shift_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/shift_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Array#shift raises a TypeError on a frozen array

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/slice_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/slice_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/slice_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Array#slice! raises a TypeError on a frozen array

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/to_s_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/to_s_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/to_s_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Array#to_s is equivalent to #join without a separator string
+fails:Array#to_s properly handles recursive arrays

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/uniq_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/uniq_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/uniq_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Array#uniq! raises a TypeError on a frozen array if modification would take place

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/unshift_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/unshift_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/array/unshift_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Array#unshift raises a TypeError on a frozen array

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/bit_and_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/bit_and_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/bit_and_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Bignum#& returns self bitwise AND other
+fails:Bignum#& tries to convert the given argument to an Integer using to_int

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/bit_or_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/bit_or_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/bit_or_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Bignum#| returns self bitwise OR other
+fails:Bignum#| tries to convert the given argument to an Integer using to_int

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/bit_xor_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/bit_xor_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/bit_xor_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Bignum#^ returns self bitwise EXCLUSIVE OR other
+fails:Bignum#^ tries to convert the given argument to an Integer using to_int

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/divmod_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/divmod_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/divmod_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Bignum#divmod raises a FloatDomainError when the given argument is 0 and a Float

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/modulo_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/modulo_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/modulo_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Bignum#% does not raise a FloatDomainError when the given argument is 0 and a Float
+fails:Bignum#modulo does not raise a FloatDomainError when the given argument is 0 and a Float

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/quo_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/quo_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/quo_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Bignum#quo does not raise a ZeroDivisionError when the given Integer is 0

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/remainder_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/remainder_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/bignum/remainder_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Bignum#remainder does NOT raise ZeroDivisionError if other is zero and is a Float

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/class/inherited_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/class/inherited_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/class/inherited_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+fails:Class.inherited is called when marked as a private class method
+fails:Class.inherited is called when marked as a protected class method
+fails:Class.inherited is called when marked as a public class method
+fails:Class.inherited is called by super from a method provided by an included module
+fails:Class.inherited is called by super even when marked as a private class method
+fails:Class.inherited will be invoked by child class regardless of visibility

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/class/new_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/class/new_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/class/new_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Class.new creates a class without a name
+fails:Class.new creates a class that can be given a name by assigning it to a constant

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/class/superclass_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/class/superclass_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/class/superclass_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Class#superclass returns the superclass of self

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/comparable/equal_value_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/comparable/equal_value_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/comparable/equal_value_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Comparable#== returns nil if calling #<=> on self returns nil or a non-Integer
+fails:Comparable#== returns nil if calling #<=> on self raises a StandardError

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/dir/pwd_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/dir/pwd_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/dir/pwd_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Dir.pwd correctly displays dirs with unicode characters in them

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/enumerable/inject_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/enumerable/inject_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/enumerable/inject_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Enumerable#inject only takes one argument

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/enumerable/zip_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/enumerable/zip_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/enumerable/zip_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Enumerable#zip converts arguments to arrays using #to_a

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/env/select_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/env/select_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/env/select_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:ENV.select returns the Hash for which block return true

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/exception/standard_error_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/exception/standard_error_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/exception/standard_error_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:StandardError is a superclass of SecurityError

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/file/expand_path_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/file/expand_path_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/file/expand_path_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:File.expand_path raises an ArgumentError if the path is not valid
+fails:File.expand_path expands ~ENV['USER'] to the user's home directory

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/file/join_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/file/join_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/file/join_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:File.join handles recursive arrays

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/file/new_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/file/new_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/file/new_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+fails:File.new raises an Errno::EINVAL error with File::APPEND
+fails:File.new raises an Errno::EINVAL error with File::RDONLY|File::APPEND
+fails:File.new can't alter mode or permissions when opening a file

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/file/open_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/file/open_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/file/open_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:File.open raises an IO exception when read in a block opened with File::RDONLY|File::APPEND mode
+fails:File.open raises an Errorno::EEXIST if the file exists when open with File::RDONLY|File::APPEND

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/div_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/div_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/div_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Fixnum#div raises a FloatDomainError when the given argument is 0 and a Float

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/divmod_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/divmod_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/divmod_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Fixnum#divmod raises a FloatDomainError when the given argument is 0 and a Float

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/id2name_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/id2name_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/id2name_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Fixnum#id2name returns the string name of the object whose symbol ID is self
+fails:Fixnum#id2name returns nil if there is no symbol in the symbol table with this value

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/induced_from_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/induced_from_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/induced_from_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+fails:Fixnum.induced_from with [Float] returns a Fixnum when the passed Float is in Fixnum's range
+fails:Fixnum.induced_from with [Float] raises a RangeError when the passed Float is out of Fixnum's range
+fails:Fixnum.induced_from returns the passed argument when passed a Fixnum
+fails:Fixnum.induced_from tries to convert non-Integers to a Integers using #to_int
+fails:Fixnum.induced_from raises a TypeError when conversion to Integer returns a Bignum

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/modulo_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/modulo_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/modulo_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Fixnum#% does not raise a FloatDomainError when the given argument is 0 and a Float
+fails:Fixnum#modulo does not raise a FloatDomainError when the given argument is 0 and a Float

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/quo_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/quo_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/quo_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Fixnum#quo does not raise a ZeroDivisionError when the given Integer is 0

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/to_sym_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/to_sym_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/fixnum/to_sym_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Fixnum#to_sym returns the symbol whose integer value is self
+fails:Fixnum#to_sym returns nil if there is no symbol in the symbol table with this value

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/float/divmod_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/float/divmod_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/float/divmod_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Float#divmod raises FloatDomainError if other is zero

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/float/induced_from_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/float/induced_from_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/float/induced_from_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+fails:Float.induced_from returns the passed argument when passed a Float
+fails:Float.induced_from converts passed Fixnums or Bignums to Floats (using #to_f)
+fails:Float.induced_from does not try to convert non-Integers to Integers using #to_int
+fails:Float.induced_from does not try to convert non-Integers to Floats using #to_f
+fails:Float.induced_from raises a TypeError when passed a non-Integer

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/float/modulo_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/float/modulo_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/float/modulo_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Float#% does NOT raise ZeroDivisionError if other is zero
+fails:Float#modulo does NOT raise ZeroDivisionError if other is zero

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/clear_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/clear_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/clear_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Hash#clear raises a TypeError if called on a frozen instance

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/default_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/default_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/default_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Hash#default= raises a TypeError if called on a frozen instance

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/delete_if_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/delete_if_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/delete_if_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Hash#delete_if processes entries with the same order as each()
+fails:Hash#delete_if raises a TypeError if called on a frozen instance

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/delete_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/delete_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/delete_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Hash#delete raises a TypeError if called on a frozen instance

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/each_pair_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/each_pair_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/each_pair_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Hash#each_pair processes all pairs, yielding two arguments: key and value

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/element_set_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/element_set_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/element_set_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Hash#[]= raises a TypeError if called on a frozen instance

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/indexes_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/indexes_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/indexes_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Hash#indexes returns an array of values for the given keys

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/indices_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/indices_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/indices_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Hash#indices returns an array of values for the given keys

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/initialize_copy_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/initialize_copy_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/initialize_copy_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Hash#initialize_copy raises a TypeError if called on a frozen instance

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/initialize_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/initialize_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/initialize_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Hash#initialize raises a TypeError if called on a frozen instance

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/merge_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/merge_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/merge_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+critical:Hash#merge! does not affect yielded items by removing the current element
+fails:Hash#merge processes entries with same order as each()
+fails:Hash#merge! raises a TypeError if called on a non-empty, frozen instance

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/rehash_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/rehash_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/rehash_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Hash#rehash raises a TypeError if called on a frozen instance

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/reject_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/reject_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/reject_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Hash#reject! raises a TypeError if called on a frozen instance

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/replace_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/replace_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/replace_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Hash#replace raises a TypeError if called on a frozen instance

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/shift_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/shift_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/shift_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Hash#shift raises a TypeError if called on a frozen instance

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/store_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/store_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/store_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Hash#store raises a TypeError if called on a frozen instance

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/to_a_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/to_a_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/to_a_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Hash#to_a returns a list of [key, value] pairs with same order as each()

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/to_s_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/to_s_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/to_s_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Hash#to_s returns a string by calling Hash#to_a and using Array#join with default separator

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/update_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/update_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/hash/update_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+critical:Hash#update does not affect yielded items by removing the current element
+fails:Hash#update raises a TypeError if called on a non-empty, frozen instance

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/integer/induced_from_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/integer/induced_from_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/integer/induced_from_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+fails:Integer.induced_from with [Float] returns a Fixnum when the passed Float is in Fixnum's range
+fails:Integer.induced_from with [Float] returns a Bignum when the passed Float is out of Fixnum's range
+fails:Integer.induced_from returns the passed argument when passed a Bignum or Fixnum
+fails:Integer.induced_from does not try to convert non-Integers to Integers using #to_int
+fails:Integer.induced_from does not try to convert non-Integers to Integers using #to_i
+fails:Integer.induced_from raises a TypeError when passed a non-Integer

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/binmode_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/binmode_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/binmode_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:IO#binmode does not raise any errors on closed stream

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/each_line_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/each_line_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/each_line_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+fails:IO#each_line yields each line to the passed block
+fails:IO#each_line yields each line starting from the current position
+fails:IO#each_line uses $/ as the default line separator
+fails:IO#each_line when passed a separator uses the passed argument as the line separator
+fails:IO#each_line when passed a separator tries to convert the passed separator to a String using #to_str

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/each_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/each_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/each_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+fails:IO#each yields each line to the passed block
+fails:IO#each yields each line starting from the current position
+fails:IO#each uses $/ as the default line separator
+fails:IO#each when passed a separator uses the passed argument as the line separator
+fails:IO#each when passed a separator tries to convert the passed separator to a String using #to_str

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/eof_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/eof_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/eof_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:IO#eof? should not consume the data from the stream

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/for_fd_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/for_fd_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/for_fd_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:IO.for_fd raises EINVAL if mode is not compatible with the descriptor's current mode
+fails:IO.for_fd cannot open an IO with incompatible flags

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/foreach_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/foreach_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/foreach_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+fails:IO::foreach yields a sequence of Strings that were separated by $/
+fails:IO::foreach yields a sequence of Strings that were separated by r
+fails:IO::foreach yields a single string with entire content when the separator is nil
+fails:IO::foreach yields a sequence of paragraphs when the separator is an empty string
+fails:IO::foreach can handle non-ASCII data as separator
+fails:IO::foreach converts first parameter to string and uses as file name
+fails:IO::foreach converts second parameter to string and uses as separator

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/getc_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/getc_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/getc_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:IO#getc returns the next byte from the stream

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/gets_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/gets_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/gets_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+fails:IO#gets returns the next line of string that were separated by $/
+fails:IO#gets assigns the returned line to $_
+fails:IO#gets returns the entire content if the separator is nil
+fails:IO#gets returns the next paragraph if the separator's length is 0

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/inspect_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/inspect_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/inspect_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:IO#inspect returns a string describing a stream

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/new_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/new_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/new_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:IO.new raises EINVAL if mode is not compatible with the descriptor's current mode
+fails:IO.new cannot open an IO with incompatible flags

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/open_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/open_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/open_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:IO.open raises EINVAL if mode is not compatible with the descriptor's current mode
+fails:IO.open cannot open an IO with incompatible flags

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/print_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/print_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/print_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+fails:IO#print writes obj.to_s followed by $\ (if any) to the stream when given one object
+fails:IO#print does not call obj.to_str
+fails:IO#print writes each obj.to_s to the stream and appends $\ (if any) given multiple objects

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/putc_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/putc_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/putc_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:IO#putc writes Numerics that fit in a C char

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/puts_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/puts_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/puts_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:IO#puts writes nil with a newline when given nil as an arg

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/read_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/read_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/read_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:IO#read can read lots of data

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/readchar_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/readchar_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/readchar_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:IO#readchar returns the next byte from the stream

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/readlines_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/readlines_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/readlines_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+fails:IO#readlines when passed no arguments returns an Array containing lines based on $/
+fails:IO#readlines when passed [separator] returns an Array containing lines based on the passed separator
+fails:IO#readlines when passed [separator] returns the remaining content as one line starting at the current position when passed nil
+fails:IO#readlines when passed [separator] tries to convert the passed separator to a String using #to_str
+fails:IO.readlines when passed [file_name] returns an Array containing lines of file_name based on $/
+fails:IO.readlines when passed [file_name] tries to convert the passed file_name to a String using #to_str
+fails:IO#readlines when passed [file_name, separator] returns an Array containing lines of file_name based on the passed separator
+fails:IO#readlines when passed [file_name, separator] tries to convert the passed separator to a String using #to_str

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/reopen_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/reopen_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/reopen_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:IO#reopen reassociates self with the I/O stream specified as an argument, after some reads
+fails:IO#reopen reassociates self with new a new stream after some reads

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/sysread_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/sysread_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/sysread_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:IO#sysread on a file throws IOError when called immediately after a buffered IO#read

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/ungetc_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/ungetc_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/io/ungetc_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+fails:IO#ungetc pushes back one character onto stream
+fails:IO#ungetc pushes back one character when invoked at the end of the stream
+fails:IO#ungetc pushes back one character when invoked at the start of the stream
+fails:IO#ungetc pushes back one character when invoked on empty stream
+fails:IO#ungetc raises IOError when invoked on stream that was not yet read

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/callcc_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/callcc_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/callcc_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+fails:Kernel#callcc is a private method
+fails:Kernel#callcc is possible to exit a loop like a break
+fails:Kernel#callcc is possible to call a continuation multiple times
+fails:Kernel#callcc returns the results of a block if continuation is not called
+fails:Kernel#callcc returns the results of continuation once called
+fails:Kernel#callcc returns the arguments to call
+fails:Kernel#callcc preserves changes to block-local scope
+fails:Kernel#callcc preserves changes to method-local scope
+fails:Kernel#callcc raises a LocalJumpError if callcc is not given a block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/caller_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/caller_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/caller_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+fails:Kernel#caller in a Proc or eval returns the definition trace of a block when evaluated in a Proc binding
+fails:Kernel#caller in a Proc or eval returns the definition trace of a Proc
+fails:Kernel#caller in a Proc or eval returns the correct caller line from a called Proc
+fails:Kernel#caller in a Proc or eval returns the correct definition line for a complex Proc trace
+fails:Kernel#caller in a Proc or eval begins with (eval) for caller(0) in eval
+fails:Kernel#caller in a Proc or eval begins with the eval's sender's sender for caller(1) in eval
+fails:Kernel#caller in a Proc or eval shows the current line in the calling block twice when evaled

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/catch_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/catch_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/catch_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Kernel.catch raises ArgumentError if the number of arguments is not one
+fails:Kernel.catch raises TypeError if the argument is not a symbol

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/chomp_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/chomp_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/chomp_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Kernel#chomp is a private method
+fails:Kernel#chomp! is a private method

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/chop_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/chop_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/chop_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Kernel#chop is a private method
+fails:Kernel#chop! is a private method

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/eval_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/eval_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/eval_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+fails:Kernel#eval accepts a Proc object as a binding
+fails:Kernel#eval does not make Proc locals visible to evaluated code
+fails:Kernel#eval allows a binding to be captured inside an eval
+fails:Kernel#eval allows Proc and binding to be nested in horrible ways
+fails:Kernel#eval allows creating a new class in a binding
+fails:Kernel#eval allows creating a new class in a binding created by #eval
+fails:Kernel#eval allows creating a new class in a binding returned by a method defined with #eval
+fails:Kernel#eval should perform top level evaluations from inside a block
+fails:Kernel#eval uses the filename of the binding if none is provided

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/extend_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/extend_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/extend_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Kernel#extend raises a TypeError if self is frozen

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/freeze_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/freeze_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/freeze_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Kernel#freeze has no effect on immediate values

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/getc_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/getc_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/getc_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Kernel#getc is a private method

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/global_variables_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/global_variables_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/global_variables_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Kernel.global_variables finds subset starting with std

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/gsub_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/gsub_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/gsub_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+fails:Kernel#gsub is a private method
+fails:Kernel#gsub raises a TypeError if $_ is not a String
+fails:Kernel#gsub when matches sets $_ to a new string, leaving the former value unaltered
+fails:Kernel#gsub returns a string with the same contents as $_ after the operation
+fails:Kernel#gsub accepts Regexps as patterns
+fails:Kernel#gsub accepts Strings as patterns, treated literally
+fails:Kernel#gsub accepts objects which respond to #to_str as patterns and treats them as strings
+fails:Kernel#gsub with a pattern and replacement accepts strings for replacement
+fails:Kernel#gsub with a pattern and replacement accepts objects which respond to #to_str for replacement
+fails:Kernel#gsub with a pattern and replacement replaces \1 sequences with the regexp's corresponding capture
+fails:Kernel#gsub with pattern and block acts similarly to using $_.gsub
+fails:Kernel#gsub! is a private method

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/instance_eval_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/instance_eval_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/instance_eval_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+fails:Kernel#instance_eval passes the object to the block
+fails:Kernel#instance_eval shares a scope across sibling evals
+fails:Kernel#instance_eval sets class variables in the receiver

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/instance_variable_get_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/instance_variable_get_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/instance_variable_get_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+fails:Kernel#instance_variable_get when passed Fixnum tries to convert the passed Integer to a Symbol and returns the instance variable that is referred by the Symbol
+fails:Kernel#instance_variable_get when passed Fixnum outputs a warning
+fails:Kernel#instance_variable_get when passed Fixnum raises an ArgumentError when the passed Fixnum can't be converted to a Symbol

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/instance_variable_set_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/instance_variable_set_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/instance_variable_set_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Kernel#instance_variable_set raises an ArgumentError if the instance variable name is a Fixnum

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/load_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/load_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/load_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Kernel#load produces __FILE__ as the given filename and __LINE__ as the source line number

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/local_variables_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/local_variables_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/local_variables_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Kernel.local_variables contains locals as they are added
+fails:Kernel.local_variables is accessable from bindings

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/loop_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/loop_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/loop_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Kernel.loop raises a LocalJumpError if no block given

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/method_missing_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/method_missing_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/method_missing_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+fails:Kernel#method_missing is a private method
+fails:Kernel#method_missing is called when an undefined method is called
+fails:Kernel#method_missing is called when a private method is called
+fails:Kernel#method_missing is called when a protected method is called

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/methods_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/methods_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/methods_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+fails:Kernel#methods picks up methods added via self.meth
+fails:Kernel#methods picks up methods added inside 'class << self'
+fails:Kernel#methods picks up private methods added via self.meth
+fails:Kernel#methods picks up methods added inside 'class << self' after private
+fails:Kernel#methods returns a list of the names of publicly accessible methods in the object
+fails:Kernel#methods returns a list of the names of publicly accessible methods in the object and its ancestors and mixed-in modules
+fails:Kernel#methods does not include any .undef'd methods

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/p_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/p_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/p_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Kernel#p prints obj.inspect followed by system record separator for each argument given

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/private_methods_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/private_methods_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/private_methods_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Kernel#private_methods returns a list of the names of privately accessible methods in the object
+fails:Kernel#private_methods returns a list of the names of privately accessible methods in the object and its ancestors and mixed-in modules

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/proc_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/proc_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/proc_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+fails:Kernel.proc raises an ArgumentError when given too many arguments
+fails:Kernel.proc raises an ArgumentError when given too few arguments
+fails:Kernel.proc returns from block into caller block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/protected_methods_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/protected_methods_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/protected_methods_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Kernel#protected_methods returns a list of the names of protected methods accessible in the object
+fails:Kernel#protected_methods returns a list of the names of protected methods accessible in the object and from its ancestors and mixed-in modules

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/public_methods_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/public_methods_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/public_methods_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Kernel#public_methods returns a list of the names of publicly accessible methods in the object
+fails:Kernel#public_methods returns a list of the names of publicly accessible methods in the object and its ancestors and mixed-in modules

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/puts_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/puts_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/puts_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Kernel#puts writes nil with a newline when given nil as an arg

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/require_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/require_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/require_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+fails:Kernel#require loads a .rb from a relative path and returns true
+fails:Kernel#require allows unqualified files to contain path information (just not in the beginning)
+fails:Kernel#require appends a file with no extension with .rb/.<ext> in that order to locate file
+fails:Kernel#require prefers to use .rb over .<ext> if given non-extensioned file and both exist
+fails:Kernel#require will load file.rb when given 'file' if it exists even if file.<ext> is loaded
+fails:Kernel#require produces __FILE__ as the given filename and __LINE__ as the source line number
+fails:Kernel#require stores the loaded file in $LOADED_FEATURES
+fails:Kernel#require stores a non-extensioned file with its located suffix
+fails:Kernel#require bases the filename in $LOADED_FEATURES on the path given, not just basename
+fails:Kernel#require will not load the same file twice, returns false instead
+fails:Kernel#require checks $LOADED_FEATURES to see whether file is already loaded
+fails:Kernel#require does not infinite loop on an rb file that requires itself

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/scan_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/scan_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/scan_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Kernel#scan is a private method

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/singleton_method_added_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/singleton_method_added_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/singleton_method_added_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Kernel#singleton_method_added is a private method

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/singleton_method_removed_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/singleton_method_removed_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/singleton_method_removed_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Kernel#singleton_method_removed is a private method

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/singleton_method_undefined_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/singleton_method_undefined_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/singleton_method_undefined_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Kernel#singleton_method_undefined is a private method

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/singleton_methods_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/singleton_methods_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/singleton_methods_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Kernel#singleton_methods returns a list of the names of singleton methods in the object
+fails:Kernel#singleton_methods returns a list of the names of singleton methods in the object and its ancestors and mixed-in modules

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/split_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/split_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/split_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Kernel#split is a private method

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/sprintf_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/sprintf_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/sprintf_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Kernel#sprintf treats nil arguments as zeroes in %d slots

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/sub_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/sub_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/sub_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Kernel#sub is a private method
+fails:Kernel#sub! is a private method

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/system_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/system_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/system_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Kernel#system returns false when it can't

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/throw_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/throw_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/throw_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Kernel.throw raises NameError if there is no catch block for the symbol
+fails:Kernel.throw raises TypeError if the first argument is not a symbol

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/to_a_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/to_a_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/to_a_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Kernel#to_a is defined on Kernel
+fails:Kernel#to_a when the receiver is not an Array returns an Array containing self

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/warn_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/warn_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/kernel/warn_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+fails:Kernel.warn calls #write on $stderr if $VERBOSE is true
+fails:Kernel.warn calls #write on $stderr if $VERBOSE is false
+fails:Kernel.warn writes the default record separator and NOT $/ to $stderr after the warning message

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/marshal/dump_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/marshal/dump_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/marshal/dump_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,19 @@
+fails:Marshal.dump raises an ArgumentError when the recursion limit is exceeded
+fails:Marshal.dump dumps an object having ivar
+fails:Marshal.dump dumps an extended_user_regexp having ivar
+fails:Marshal.dump dumps an extended_user_hash_default
+fails:Marshal.dump dumps an extended_user_hash with a parameter to initialize
+fails:Marshal.dump dumps an array containing objects having _dump method
+fails:Marshal.dump dumps an array containing objects having marshal_dump method
+fails:Marshal.dump dumps an array containing the same objects
+fails:Marshal.dump dumps an extended_array having ivar
+fails:Marshal.dump dumps an extended_struct having fields with same objects
+fails:Marshal.dump dumps a String empty
+fails:Marshal.dump dumps a String small
+fails:Marshal.dump dumps a String big
+fails:Marshal.dump dumps a String extended
+fails:Marshal.dump dumps a _dump object
+fails:Marshal.dump dumps a _dump object extended
+fails:Marshal.dump dumps a marshal_dump object
+fails:Marshal.dump dumps a Regexp
+fails:Marshal.dump dumps a Regexp subclass /i

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/marshal/load_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/marshal/load_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/marshal/load_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+fails:Marshal::load loads a array containing objects having _dump method, and with proc
+fails:Marshal::load loads an array containing objects having marshal_dump method, and with proc
+fails:Marshal::load loads an Array with proc

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/matchdata/select_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/matchdata/select_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/matchdata/select_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:MatchData#select yields the contents of the match array to a block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/acos_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/acos_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/acos_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math.acos raises an ArgumentError if the argument cannot be coerced with Float()
+fails:Math.acos accepts any argument that can be coerced with Float()

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/acosh_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/acosh_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/acosh_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math.acosh raises an ArgumentError if the argument cannot be coerced with Float()
+fails:Math.acosh accepts any argument that can be coerced with Float()

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/asin_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/asin_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/asin_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math.asin raises an ArgumentError if the argument cannot be coerced with Float()
+fails:Math.asin accepts any argument that can be coerced with Float()

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/asinh_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/asinh_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/asinh_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math.asinh raises an ArgumentError if the argument cannot be coerced with Float()
+fails:Math.asinh accepts any argument that can be coerced with Float()

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/atan2_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/atan2_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/atan2_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math.atan2 raises an ArgumentError if the argument cannot be coerced with Float()
+fails:Math.atan2 accepts any argument that can be coerced with Float()

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/atan_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/atan_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/atan_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math.atan raises an ArgumentError if the argument cannot be coerced with Float()
+fails:Math.atan accepts any argument that can be coerced with Float()

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/atanh_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/atanh_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/atanh_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+fails:Math.atanh returns Infinity for 1.0
+fails:Math.atanh returns -Infinity for -1.0
+fails:Math.atanh raises an ArgumentError if the argument cannot be coerced with Float()
+fails:Math.atanh accepts any argument that can be coerced with Float()

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/cos_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/cos_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/cos_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math.cos raises an ArgumentError if the argument cannot be coerced with Float()
+fails:Math.cos accepts any argument that can be coerced with Float()

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/cosh_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/cosh_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/cosh_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math.cosh raises an ArgumentError if the argument cannot be coerced with Float()
+fails:Math.cosh accepts any argument that can be coerced with Float()

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/erf_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/erf_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/erf_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math.erf raises an ArgumentError if the argument cannot be coerced with Float()
+fails:Math.erf accepts any argument that can be coerced with Float()

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/erfc_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/erfc_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/erfc_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math.erfc raises an ArgumentError if the argument cannot be coerced with Float()
+fails:Math.erfc accepts any argument that can be coerced with Float()

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/exp_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/exp_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/exp_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math.exp raises an ArgumentError if the argument cannot be coerced with Float()
+fails:Math.exp accepts any argument that can be coerced with Float()

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/frexp_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/frexp_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/frexp_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math.frexp raises an ArgumentError if the argument cannot be coerced with Float()
+fails:Math.frexp accepts any argument that can be coerced with Float()

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/hypot_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/hypot_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/hypot_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math.hypot raises an ArgumentError if the argument cannot be coerced with Float()
+fails:Math.hypot accepts any argument that can be coerced with Float()

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/ldexp_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/ldexp_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/ldexp_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math.ldexp raises an ArgumentError if the first argument cannot be coerced with Float()
+fails:Math.ldexp accepts any first argument that can be coerced with Float()

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/log10_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/log10_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/log10_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math.log10 raises an ArgumentError if the argument cannot be coerced with Float()
+fails:Math.log10 accepts any argument that can be coerced with Float()

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/log_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/log_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/log_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math.log raises an ArgumentError if the argument cannot be coerced with Float()
+fails:Math.log accepts any argument that can be coerced with Float()

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/sin_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/sin_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/sin_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math.sin raises an ArgumentError if the argument cannot be coerced with Float()
+fails:Math.sin accepts any argument that can be coerced with Float()

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/sinh_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/sinh_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/sinh_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math.sinh raises an ArgumentError if the argument cannot be coerced with Float()
+fails:Math.sinh accepts any argument that can be coerced with Float()

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/sqrt_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/sqrt_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/sqrt_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math.sqrt raises an ArgumentError if the argument cannot be coerced with Float()
+fails:Math.sqrt accepts any argument that can be coerced with Float()

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/tan_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/tan_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/tan_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math.tan raises an ArgumentError if the argument cannot be coerced with Float()
+fails:Math.tan accepts any argument that can be coerced with Float()

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/tanh_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/tanh_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/math/tanh_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math.tanh raises an ArgumentError if the argument cannot be coerced with Float()
+fails:Math.tanh accepts any argument that can be coerced with Float()

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/method/clone_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/method/clone_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/method/clone_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Method#clone returns a copy of the method

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/attr_writer_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/attr_writer_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/attr_writer_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Module#attr_writer creates a setter for an attribute name given as a Fixnum

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/autoload_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/autoload_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/autoload_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Module#autoload with constant enumeration or removal doesn't trigger file load
+fails:Module#autoload autoloaded constants are removed on the first access

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/class_eval_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/class_eval_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/class_eval_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Module#class_eval shares a scope across sibling evals

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/class_variable_defined_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/class_variable_defined_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/class_variable_defined_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Module#class_variable_defined? accepts Fixnums for class variables

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/class_variable_get_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/class_variable_get_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/class_variable_get_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Module#class_variable_get accepts Fixnums for class variables

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/class_variable_set_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/class_variable_set_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/class_variable_set_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Module#class_variable_set accepts Fixnums for class variables
+fails:Module#class_variable_set raises a TypeError when self is frozen

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/class_variables_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/class_variables_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/class_variables_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+fails:Module#class_variables returns an Array with the names of class variables of self and self's ancestors
+fails:Module#class_variables returns an Array with names of class variables defined in metaclasses
+fails:Module#class_variables returns an Array with names of class variables defined in included modules

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/const_defined_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/const_defined_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/const_defined_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Module#const_defined? returns false if the constant is not defined in the receiver

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/const_missing_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/const_missing_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/const_missing_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Module#const_missing is called when an undefined constant is referenced via literal form
+fails:Module#const_missing is called when an undefined constant is referenced via #const_get

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/define_method_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/define_method_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/define_method_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Module#define_method when given an UnboundMethod adds the new method to the methods list

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/freeze_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/freeze_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/freeze_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Module#freeze prevents further modifications to self

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/include_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/include_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/include_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+fails:Module#include imports constants to modules and classes
+fails:Module#include imports instance methods to modules and classes
+fails:Module#include does not import methods to modules and classes

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/instance_methods_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/instance_methods_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/instance_methods_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Module#instance_methods returns an array containing the public and protected methods of self if include_super is false
+fails:Module#instance_methods returns an array containing the public and protected methods of self and it's ancestors

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/module_eval_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/module_eval_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/module_eval_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Module#module_eval shares a scope across sibling evals

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/name_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/name_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/name_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Module#name returns the name of self

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/private_method_defined_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/private_method_defined_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/private_method_defined_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Module#private_method_defined? raises an ArgumentError if passed a Fixnum

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/protected_instance_methods_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/protected_instance_methods_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/protected_instance_methods_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Module#protected_instance_methods returns a list of protected methods in module and its ancestors
+fails:Module#protected_instance_methods when passed false as a parameter, should return only methods defined in that module

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/protected_method_defined_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/protected_method_defined_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/protected_method_defined_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Module#protected_method_defined? raises an ArgumentError if passed a Fixnum

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/public_instance_methods_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/public_instance_methods_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/public_instance_methods_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Module#public_instance_methods returns a list of public methods in module and its ancestors
+fails:Module#public_instance_methods when passed false as a parameter, should return only methods defined in that module

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/public_method_defined_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/public_method_defined_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/module/public_method_defined_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Module#public_method_defined? raises an ArgumentError if called with a Fixnum

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/numeric/quo_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/numeric/quo_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/numeric/quo_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Numeric#quo returns the result of calling self#/ with other

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/object/match_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/object/match_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/object/match_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Object =~ returns false matching any object

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/precision/included_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/precision/included_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/precision/included_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Precision.included raises a TypeError when a class mixed with Precision does not specify induced_from
+fails:Precision.included doesn't raise a TypeError when a class mixed with Precision specifies induced_from

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/precision/prec_f_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/precision/prec_f_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/precision/prec_f_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Precision#prec_f converts a Integer to Float when called on an Integer
+fails:Precision#prec_f returns the same Float when called on a Float

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/precision/prec_i_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/precision/prec_i_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/precision/prec_i_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Precision#prec_i returns the same Integer when called on an Integer
+fails:Precision#prec_i converts Float to an Integer when called on an Integer

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/precision/prec_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/precision/prec_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/precision/prec_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+fails:Float#prec returns the same Float when given the class Float
+fails:Float#prec converts the Float to an Integer when given the class Integer
+fails:Integer#prec returns the same Integer when given the class Integer
+fails:Integer#prec converts the Integer to Float when given the class Float

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/proc/arity_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/proc/arity_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/proc/arity_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+fails:Proc#arity returns -1 if no argument declaration is made, using Proc.new
+fails:Proc#arity returns -1 if no argument declaration is made, using Kernel#lambda
+fails:Proc#arity returns -1 if no argument declaration is made, using Kernel#proc

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/proc/call_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/proc/call_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/proc/call_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+fails:Proc#call sets self's single parameter to an Array of all given values
+fails:Proc#call on a Proc created with Kernel#lambda or Kernel#proc raises an ArgumentError when called with too few arguments
+fails:Proc#call on a Proc created with Kernel#lambda or Kernel#proc raises an ArgumentError when called with too many arguments
+fails:Proc#call on a Proc created with Kernel#lambda or Kernel#proc treats a single Array argument as a single argument

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/proc/element_reference_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/proc/element_reference_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/proc/element_reference_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+fails:Proc#[] sets self's single parameter to an Array of all given values
+fails:Proc#call on a Proc created with Kernel#lambda or Kernel#proc raises an ArgumentError when called with too few arguments
+fails:Proc#call on a Proc created with Kernel#lambda or Kernel#proc raises an ArgumentError when called with too many arguments
+fails:Proc#call on a Proc created with Kernel#lambda or Kernel#proc treats a single Array argument as a single argument

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/proc/new_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/proc/new_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/proc/new_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+critical:Proc.new with an associated block raises a LocalJumpError when context of the block no longer exists

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/proc/to_s_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/proc/to_s_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/proc/to_s_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Proc#to_s returns a description of self

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/regexp/compile_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/regexp/compile_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/regexp/compile_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+fails:Regexp.compile given a String does not enable multibyte support by default
+fails:Regexp.compile given a String enables EUC encoding if third argument is 'e' or 'euc' (case-insensitive)
+fails:Regexp.compile given a String enables SJIS encoding if third argument is 's' or 'sjis' (case-insensitive)
+fails:Regexp.compile given a String enables UTF-8 encoding if third argument is 'u' or 'utf8' (case-insensitive)
+fails:Regexp.compile given a String disables multibyte support if third argument is 'n' or 'none' (case insensitive)
+fails:Regexp.compile given a Regexp does not enable multibyte support by default
+fails:Regexp.compile given a Regexp enables multibyte support if given in the literal

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/regexp/inspect_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/regexp/inspect_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/regexp/inspect_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Regexp#inspect returns a formatted string that would eval to the same regexp

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/regexp/kcode_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/regexp/kcode_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/regexp/kcode_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Regexp#kcode returns the character set code

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/regexp/new_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/regexp/new_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/regexp/new_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+fails:Regexp.new given a String does not enable multibyte support by default
+fails:Regexp.new given a String enables EUC encoding if third argument is 'e' or 'euc' (case-insensitive)
+fails:Regexp.new given a String enables SJIS encoding if third argument is 's' or 'sjis' (case-insensitive)
+fails:Regexp.new given a String enables UTF-8 encoding if third argument is 'u' or 'utf8' (case-insensitive)
+fails:Regexp.new given a String disables multibyte support if third argument is 'n' or 'none' (case insensitive)
+fails:Regexp.new given a Regexp does not enable multibyte support by default
+fails:Regexp.new given a Regexp enables multibyte support if given in the literal

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/append_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/append_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/append_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+fails:String#<< raises a TypeError when self is frozen
+fails:String#<< with Fixnum raises a TypeError when the given Fixnum is not between 0 and 255
+fails:String#<< with Fixnum raises a TypeError when self is frozen

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/chomp_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/chomp_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/chomp_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:String#chomp with separator raises a TypeError if separator can't be converted to a string
+fails:String#chomp! with separator raises a TypeError when self is frozen

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/chop_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/chop_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/chop_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:String#chop returns a new string with the last character removed
+fails:String#chop! raises a TypeError when self is frozen

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/concat_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/concat_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/concat_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+fails:String#concat raises a TypeError when self is frozen
+fails:String#concat with Fixnum raises a TypeError when the given Fixnum is not between 0 and 255
+fails:String#concat with Fixnum raises a TypeError when self is frozen

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/delete_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/delete_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/delete_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:String#delete! raises a TypeError when self is frozen

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/each_line_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/each_line_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/each_line_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:String#each_line raises a RuntimeError if the string is modified while substituting
+fails:String#each_line raises a TypeError when the separator can't be converted to a string

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/each_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/each_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/each_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+fails:String#each splits self using the supplied record separator and passes each substring to the block
+fails:String#each taints substrings that are passed to the block if self is tainted
+fails:String#each passes self as a whole to the block if the separator is nil
+fails:String#each appends multiple successive newlines together when the separator is an empty string
+fails:String#each uses $/ as the separator when none is given
+fails:String#each yields subclass instances for subclasses
+fails:String#each returns self
+fails:String#each tries to convert the separator to a string using to_str
+fails:String#each raises a RuntimeError if the string is modified while substituting
+fails:String#each raises a TypeError when the separator can't be converted to a string

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/element_set_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/element_set_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/element_set_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+fails:String#[]= with index sets the code of the character at idx to char modulo 256
+fails:String#[]= with index raises an IndexError without changing self if idx is outside of self
+fails:String#[]= with index sets the code to char % 256
+fails:String#[]= with index raises a TypeError when self is frozen
+fails:String#[]= with String raises an IndexError without changing self if idx is outside of self
+fails:String#[]= with String raises a TypeError when self is frozen

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/entries_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/entries_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/entries_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:String#entries returns an empty array for empty strings
+fails:String#entries returns an array containing the string for non-empty strings

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/gsub_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/gsub_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/gsub_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+fails:String#gsub with pattern and replacement raises a TypeError when pattern can't be converted to a string
+fails:String#gsub with pattern and replacement raises a TypeError when replacement can't be converted to a string
+fails:String#gsub with pattern and block restores $~ after leaving the block
+fails:String#gsub with pattern and block raises a RuntimeError if the string is modified while substituting
+fails:String#gsub! with pattern and replacement raises a TypeError when self is frozen

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/include_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/include_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/include_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:String#include? with Fixnum returns true if self contains the given char
+fails:String#include? with Fixnum uses fixnum % 256

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/index_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/index_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/index_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+fails:String#index with Fixnum character values over 255 (256th ASCII character) always result in nil
+fails:String#index with Fixnum negative character values always result in nil
+fails:String#index with Fixnum returns nil if the character isn't found
+fails:String#index with Regexp behaves the same as String#index(string) for escaped string regexps

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/initialize_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/initialize_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/initialize_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:String#initialize is a private method
+fails:String#initialize raises a TypeError if self is frozen

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/insert_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/insert_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/insert_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:String#insert with index, other raises a TypeError if other can't be converted to string
+fails:String#insert with index, other raises a TypeError if self is frozen

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/intern_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/intern_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/intern_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:String#intern raises an ArgumentError when self can't be converted to symbol

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/ljust_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/ljust_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/ljust_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:String#ljust with length, padding raises a TypeError when padstr can't be converted

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/lstrip_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/lstrip_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/lstrip_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:String#lstrip! raises a TypeError if self is frozen

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/modulo_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/modulo_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/modulo_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+fails:String#% supports binary formats using %b
+fails:String#% supports character formats using %c
+fails:String#% uses argument % 256
+fails:String#% supports float formats using %e, and downcases -Inf, Inf, and NaN
+fails:String#% supports float formats using %E, and upcases Inf, -Inf, and NaN
+fails:String#% pads with zeros using %E with Inf, -Inf, and NaN
+fails:String#% supports octal formats using %o
+fails:String#% supports unsigned formats using %u
+fails:String#% supports hex formats using %x
+fails:String#% supports hex formats using %X
+fails:String#% behaves as if calling Kernel#Integer for %b argument, if it does not respond to #to_ary
+fails:String#% behaves as if calling Kernel#Integer for %d argument, if it does not respond to #to_ary
+fails:String#% behaves as if calling Kernel#Integer for %i argument, if it does not respond to #to_ary
+fails:String#% behaves as if calling Kernel#Integer for %o argument, if it does not respond to #to_ary
+fails:String#% behaves as if calling Kernel#Integer for %u argument, if it does not respond to #to_ary
+fails:String#% behaves as if calling Kernel#Integer for %x argument, if it does not respond to #to_ary
+fails:String#% behaves as if calling Kernel#Integer for %X argument, if it does not respond to #to_ary

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/next_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/next_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/next_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:String#next! raises a TypeError if self is frozen

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/replace_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/replace_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/replace_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:String#replace raises a TypeError if self is frozen

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/reverse_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/reverse_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/reverse_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:String#reverse! raises a TypeError if self is frozen

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/rindex_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/rindex_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/rindex_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:String#rindex with Fixnum doesn't use fixnum % 256
+fails:String#rindex with Fixnum returns nil if the character isn't found

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/rjust_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/rjust_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/rjust_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:String#rjust with length, padding raises a TypeError when padstr can't be converted

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/rstrip_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/rstrip_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/rstrip_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:String#rstrip! raises a TypeError if self is frozen

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/scan_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/scan_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/scan_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:String#scan with pattern and block restores $~ after leaving the block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/slice_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/slice_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/slice_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,14 @@
+fails:String#slice! with index raises a TypeError if self is frozen
+fails:String#slice! with index doesn't raise a TypeError if self is frozen and idx is outside of self
+fails:String#slice! with index, length raises a TypeError if self is frozen
+fails:String#slice! with index, length doesn't raise a TypeError if self is frozen but the given position is out of self
+fails:String#slice! with index, length doesn't raise a TypeError if self is frozen but length is negative
+fails:String#slice! Range raises a TypeError if self is frozen
+fails:String#slice! Range doesn't raise a TypeError if self is frozen but the given range is out of self
+fails:String#slice! with Regexp raises a TypeError if self is frozen
+fails:String#slice! with Regexp doesn't raise a TypeError if self is frozen but there is no match
+fails:String#slice! with Regexp, index raises a TypeError if self is frozen
+fails:String#slice! with Regexp, index doesn't raise a TypeError if self is frozen but there is no match
+fails:String#slice! with Regexp, index doesn't raise a TypeError if self is frozen but there is no capture for idx
+fails:String#slice! with String raises a TypeError if self is frozen
+fails:String#slice! with String doesn't raise a TypeError if self is frozen but self does not contain other

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/squeeze_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/squeeze_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/squeeze_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:String#squeeze raises a TypeError when one set arg can't be converted to a string
+fails:String#squeeze! raises a TypeError when self is frozen

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/strip_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/strip_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/strip_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:String#strip! raises a TypeError if self is frozen

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/sub_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/sub_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/sub_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+fails:String#sub with pattern, replacement raises a TypeError when pattern can't be converted to a string
+fails:String#sub with pattern, replacement raises a TypeError when replacement can't be converted to a string
+fails:String#sub with pattern and block returns a copy of self with the first occurrences of pattern replaced with the block's return value
+fails:String#sub with pattern and block restores $~ after leaving the block
+fails:String#sub! with pattern, replacement raises a TypeError when self is frozen

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/succ_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/succ_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/succ_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:String#succ! raises a TypeError if self is frozen

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/to_a_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/to_a_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/to_a_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:String#to_a returns an empty array for empty strings
+fails:String#to_a returns an array containing the string for non-empty strings

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/to_i_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/to_i_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/to_i_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:String#to_i ignores leading underscores
+fails:String#to_i ignores a leading mix of whitespaces and underscores

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/to_sym_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/to_sym_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/to_sym_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:String#to_sym raises an ArgumentError when self can't be converted to symbol

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/tr_s_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/tr_s_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/tr_s_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:String#tr_s! raises a TypeError if self is frozen

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/tr_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/tr_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/tr_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:String#tr! raises a TypeError if self is frozen

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/unpack_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/unpack_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/unpack_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:String#unpack with 'DdEeFfGg' directives returns an array by decoding self in little-endian order according to the format string

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/upto_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/upto_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/string/upto_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+fails:String#upto stops iterating as soon as the current value's character count gets higher than stop's
+fails:String#upto raises a TypeError if other can't be converted to a string
+fails:String#upto raises a LocalJumpError if other is a string but no block was given

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/struct/inspect_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/struct/inspect_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/struct/inspect_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Struct#inspect returns a string representation of some kind

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/struct/members_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/struct/members_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/struct/members_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Struct#members returns an array of attribute names

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/struct/new_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/struct/new_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/struct/new_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+fails:Struct.new creates a new anonymous class with nil first argument
+fails:Struct.new creates a new anonymous class with symbol arguments
+fails:Struct.new accepts Fixnums as Symbols unless fixnum.to_sym.nil?
+fails:Struct.new raises an ArgumentError if fixnum#to_sym is nil
+fails:Struct.new instance_eval's a passed block
+fails:Struct.new creates reader methods
+fails:Struct.new creates writer methods

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/symbol/inspect_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/symbol/inspect_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/symbol/inspect_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+fails:Symbol#inspect returns self as a symbol literal for :"!"
+fails:Symbol#inspect returns self as a symbol literal for :"!="
+fails:Symbol#inspect returns self as a symbol literal for :"!~"

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/symbol/to_i_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/symbol/to_i_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/symbol/to_i_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Symbol#to_i returns an integer that is unique for each symbol for each program execution

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/symbol/to_int_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/symbol/to_int_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/symbol/to_int_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Symbol#to_int returns Symbol#to_i

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/element_reference_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/element_reference_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/element_reference_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Thread#[] raises exceptions on the wrong type of keys

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/element_set_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/element_set_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/element_set_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Thread#[]= raises exceptions on the wrong type of keys

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/inspect_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/inspect_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/inspect_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Thread#inspect reports aborting on a killed thread

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/key_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/key_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/key_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Thread#key? raises exceptions on the wrong type of keys

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/raise_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/raise_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/raise_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Thread#raise on a sleeping thread re-raises active exception
+fails:Thread#raise on a running thread re-raises active exception

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/stop_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/stop_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/stop_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+critical:Thread.stop resets Thread.critical to false

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/terminate_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/terminate_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/thread/terminate_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+critical:Thread#terminate does not deadlock when called from within the thread while being joined from without

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/at_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/at_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/at_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Time.at converts to time object

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/comparison_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/comparison_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/comparison_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Time#<=> returns nil when Time is compared to some Object

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/gm_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/gm_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/gm_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Time.gm creates a time based on given values, interpreted as UTC (GMT)
+fails:Time.gm creates a time based on given C-style gmtime arguments, interpreted as UTC (GMT)

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/hash_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/hash_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/hash_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Time#hash returns a unique integer for each time

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/local_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/local_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/local_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Time.local creates a time based on given values, interpreted in the local time zone
+fails:Time.local creates a time based on given C-style gmtime arguments, interpreted in the local time zone

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/mktime_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/mktime_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/mktime_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Time.mktime creates a time based on given values, interpreted in the local time zone
+fails:Time.mktime creates a time based on given C-style gmtime arguments, interpreted in the local time zone

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/utc_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/utc_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/time/utc_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Time.utc creates a time based on given values, interpreted as UTC (GMT)
+fails:Time.utc creates a time based on given C-style gmtime arguments, interpreted as UTC (GMT)

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/language/alias_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/language/alias_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/language/alias_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:The alias keyword adds the new method to the list of methods
+fails:The alias keyword adds the new method to the list of public methods

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/language/catch_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/language/catch_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/language/catch_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:The catch keyword only allows symbols and strings
+fails:The catch keyword matches strings as symbols

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/language/class_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/language/class_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/language/class_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+fails:A class definition raises TypeError if constant given as class name exists and is not a Module
+fails:A class definition raises TypeError if any constant qualifying the class is not a Module
+fails:A class definition allows the declaration of class variables in the body
+fails:A class definition stores instance variables defined in the class body in the class object
+fails:A class definition allows the declaration of class variables in a class method
+fails:A class definition allows the definition of class-level instance variables in a class method
+fails:A class definition allows the declaration of class variables in an instance method
+fails:An outer class definition contains the inner classes

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/language/constants_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/language/constants_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/language/constants_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,24 @@
+fails:Literal (A::X) constant resolution with dynamically assigned constants returns the updated value when a constant is reassigned
+fails:Constant resolution within methods sends #const_missing to the original class or module scope
+fails:Constant resolution within methods with statically assigned constants searches the immediate class or module scope first
+fails:Constant resolution within methods with statically assigned constants searches a module included in the immediate class before the superclass
+fails:Constant resolution within methods with statically assigned constants searches the superclass before a module included in the superclass
+fails:Constant resolution within methods with statically assigned constants searches a module included in the superclass
+fails:Constant resolution within methods with statically assigned constants searches the superclass chain
+fails:Constant resolution within methods with statically assigned constants searches the lexical scope of the method not the receiver's immediate class
+fails:Constant resolution within methods with statically assigned constants searches the lexical scope of a singleton method
+fails:Constant resolution within methods with statically assigned constants searches the lexical scope of a block
+fails:Constant resolution within methods with statically assigned constants searches Object as a lexical scope only if Object is explicitly opened
+fails:Constant resolution within methods with dynamically assigned constants searches the immediate class or module scope first
+fails:Constant resolution within methods with dynamically assigned constants searches a module included in the immediate class before the superclass
+fails:Constant resolution within methods with dynamically assigned constants searches the superclass before a module included in the superclass
+fails:Constant resolution within methods with dynamically assigned constants searches a module included in the superclass
+fails:Constant resolution within methods with dynamically assigned constants searches the superclass chain
+fails:Constant resolution within methods with dynamically assigned constants searches the lexical scope of the method not the receiver's immediate class
+fails:Constant resolution within methods with dynamically assigned constants searches the lexical scope of a singleton method
+fails:Constant resolution within methods with dynamically assigned constants does not search the lexical scope of the caller
+fails:Constant resolution within methods with dynamically assigned constants searches the lexical scope of a block
+fails:Constant resolution within methods with dynamically assigned constants searches Object as a lexical scope only if Object is explicitly opened
+fails:Constant resolution within methods with dynamically assigned constants returns the updated value when a constant is reassigned
+fails:Constant resolution within methods with dynamically assigned constants does not search the lexical scope of qualifying modules
+fails:Literal (A::X) constant resolution sends #const_missing to the original class or module scope

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/language/defined_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/language/defined_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/language/defined_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+fails:The defined? keyword returns 'super' when Subclass#no_args uses defined?
+fails:The defined? keyword returns 'super' when Subclass#args uses defined?
+fails:The defined? keyword returns 'local-variable' when defined? is called on a block var

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/language/metaclass_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/language/metaclass_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/language/metaclass_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:A constant on a metaclass appears in the metaclass constant list

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/language/module_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/language/module_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/language/module_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:module gets a name when assigned to a constant

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/language/numbers_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/language/numbers_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/language/numbers_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Ruby numbers in various ways character to numeric shortcut
+fails:Ruby numbers in various ways character with control character to numeric shortcut

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/language/precedence_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/language/precedence_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/language/precedence_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Operators ! ~ + have a higher precedence than **
+fails:Operators <= < > >= have higher precedence than <=> == === != =~ !~

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/language/private_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/language/private_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/language/private_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+fails:The private keyword is overridden when a new class is opened
+fails:The private keyword is no longer in effect when the class is closed
+fails:The private keyword changes visibility of previously called method
+fails:The private keyword changes visiblity of previously called methods with same send/call site
+fails:The private keyword changes the visibility of the existing method in the subclass

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/language/return_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/language/return_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/language/return_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+fails:The return keyword in a Thread raises a ThreadError if used to exit a thread
+fails:The return keyword when passed a splat returns nil when the ary is empty
+fails:The return keyword when passed a splat returns the first element when the array is size of 1
+fails:The return keyword when passed a splat returns a non-array when used as a splat
+fails:The return keyword when passed a splat calls 'to_a' on the splatted value first
+fails:The return keyword when passed a splat calls 'to_ary' on the splatted value first
+fails:The return keyword within a block raises a LocalJumpError if there is no lexicaly enclosing method

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/language/symbol_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/language/symbol_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/language/symbol_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:A Symbol literal must not be an empty string

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/language/throw_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/language/throw_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/language/throw_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+fails:The throw keyword only allows symbols and strings as it's argument
+fails:The throw keyword converts strings to a symbol
+fails:The throw keyword raises a name error if outside of scope of a matching catch
+fails:The throw keyword raises a ThreadError if used to exit a thread

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/language/undef_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/language/undef_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/language/undef_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:The undef keyword undefines 'meth='

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/language/variables_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/language/variables_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/language/variables_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+fails:Basic assignment assigns nil to lhs when rhs is an empty expression
+fails:Basic assignment allows the assignment of the rhs to the lhs using the rhs splat operator
+fails:Basic assignment allows the assignment of the rhs to the lhs using the lhs splat operator
+fails:Basic assignment allows the assignment of rhs to the lhs using the lhs and rhs splat operators simultaneously
+fails:Assignment using expansion succeeds without conversion
+fails:Assigning multiple values calls #to_ary on rhs arg if rhs has only a single arg
+fails:Operator assignment 'obj[idx] op= expr' returns result of rhs not result of []=
+fails:Multiple assignments with splats * on the lhs has to be applied to the last parameter
+fails:Multiple assignments with splats * on the lhs collects all parameters from its position onwards as an Array or an empty Array

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/base64/b64encode_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/base64/b64encode_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/base64/b64encode_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+fails:Base64#b64encode returns the Base64-encoded version of the given string with a newline at 60 characters
+fails:Base64#b64encode prints the Base64-encoded version of the given string with a newline after 60 characters
+fails:Base64#b64encode with length returns the Base64-encoded version of the given string with a newline at 60 characters
+fails:Base64#b64encode with length prints the Base64-encoded version of the given stringwith a newline after length characters

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/base64/decode_b_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/base64/decode_b_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/base64/decode_b_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Base64#decode_b supports an encoding type of base64 and the charachter set SHIFT_JIS
+fails:Base64#decode_b supports an encoding type of base64 and the character set ISO-2022-JP

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/ceil_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/ceil_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/ceil_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:BigDecimal#ceil returns a BigDecimal
+fails:BigDecimal#ceil returns the smallest integer greater or equal to self, if n is unspecified

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/div_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/div_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/div_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+fails:BigDecimal#div with precision set to 0 returns NaN if NaN is involved
+fails:BigDecimal#div returns NaN if NaN is involved
+fails:BigDecimal#div returns NaN if divided by Infinity and no precision given
+fails:BigDecimal#div returns NaN if divided by zero and no precision given
+fails:BigDecimal#div returns NaN if zero is divided by zero
+fails:BigDecimal#div returns NaN if (+|-) Infinity divided by 1 and no precision given

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/divmod_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/divmod_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/divmod_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+fails:BigDecimal#mod_part_of_divmod returns self modulo other
+fails:BigDecimal#mod_part_of_divmod returns a [Float value] when the argument is Float
+fails:BigDecimal#mod_part_of_divmod returns NaN if NaN is involved
+fails:BigDecimal#mod_part_of_divmod returns NaN if Infinity is involved
+fails:BigDecimal#mod_part_of_divmod raises TypeError if the argument cannot be coerced to BigDecimal
+fails:BigDecimal#mod_part_of_divmod does NOT raise ZeroDivisionError if other is zero
+fails:BigDecimal#divmod array contains quotient and modulus as BigDecimal
+fails:BigDecimal#divmod Can be reversed with * and +
+fails:BigDecimal#divmod properly handles special values
+fails:BigDecimal#divmod returns an array of two NaNs if the argument is zero

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/exponent_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/exponent_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/exponent_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:BigDecimal#** returns NaN if self is infinite

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/floor_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/floor_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/floor_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:BigDecimal#floor returns the greatest integer smaller or equal to self

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/induced_from_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/induced_from_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/induced_from_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+fails:BigDecimal.induced_from returns the passed argument when passed a BigDecimal
+fails:BigDecimal.induced_from converts passed Fixnums to BigDecimal
+fails:BigDecimal.induced_from converts passed Bignums to BigDecimal
+fails:BigDecimal.induced_from does not try to convert non-Integers to Integer using #to_i
+fails:BigDecimal.induced_from raises a TypeError when passed a non-Integer

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/infinite_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/infinite_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/infinite_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:BigDecimal#infinite? returns not true otherwise

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/inspect_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/inspect_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/inspect_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:BigDecimal#inspect returns String starting with #

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/mode_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/mode_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/mode_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:BigDecimal.mode returns the appropriate value and continue the computation if the flag is false

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/modulo_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/modulo_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/modulo_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+fails:BigDecimal#% returns self modulo other
+fails:BigDecimal#% returns a [Float value] when the argument is Float
+fails:BigDecimal#% does NOT raise ZeroDivisionError if other is zero
+fails:BigDecimal#modulo returns self modulo other
+fails:BigDecimal#modulo returns a [Float value] when the argument is Float
+fails:BigDecimal#modulo does NOT raise ZeroDivisionError if other is zero

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/new_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/new_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/new_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:BigDecimal.new creates a new object of class BigDecimal

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/nonzero_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/nonzero_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/nonzero_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:BigDecimal#nonzero? returns nil otherwise

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/power_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/power_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/power_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:BigDecimal#power returns NaN if self is infinite

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/to_i_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/to_i_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/to_i_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:BigDecimal#to_i returns nil if BigDecimal is infinity or NaN

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/to_int_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/to_int_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/to_int_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:BigDecimal#to_int returns nil if BigDecimal is infinity or NaN

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/truncate_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/truncate_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/truncate_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+fails:BigDecimal#truncate returns value of type Bigdecimal.
+fails:BigDecimal#truncate returns NaN if self is NaN
+fails:BigDecimal#truncate returns Infinity if self is infinite

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/zero_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/zero_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/bigdecimal/zero_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:BigDecimal#zero? returns true if self does equal zero

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html3/doctype_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html3/doctype_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html3/doctype_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:CGI::Html3#doctype returns the doctype declaration for HTML3

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html3/element_init_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html3/element_init_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html3/element_init_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:CGI::Html3#element_init initializes the HTML Generation methods for HTML3
+fails:CGI::Html3#element_init should extend self with CGI::TagMaker

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html4/doctype_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html4/doctype_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html4/doctype_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:CGI::Html4#doctype returns the doctype declaration for HTML4

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html4/element_init_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html4/element_init_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html4/element_init_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:CGI::Html4#element_init initializes the HTML Generation methods for HTML4
+fails:CGI::Html4#element_init should extend self with CGI::TagMaker

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html4fr/doctype_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html4fr/doctype_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html4fr/doctype_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:CGI::Html4Fr#doctype returns the doctype declaration for the Frameset version of HTML4

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html4fr/element_init_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html4fr/element_init_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html4fr/element_init_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:CGI::Html4Fr#element_init initializes the HTML Generation methods for the Frameset version of HTML4

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html4tr/doctype_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html4tr/doctype_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html4tr/doctype_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:CGI::Html4Tr#doctype returns the doctype declaration for the Transitional version of HTML4

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html4tr/element_init_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html4tr/element_init_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/html4tr/element_init_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:CGI::Html4Tr#element_init initializes the HTML Generation methods for HTML4
+fails:CGI::Html4Tr#element_init should extend self with CGI::TagMaker

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/a_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/a_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/a_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+fails:CGI::HtmlExtension#a when passed a String returns an 'a'-element, using the passed String as the 'href'-attribute
+fails:CGI::HtmlExtension#a when passed a String includes the passed block's return value when passed a block
+fails:CGI::HtmlExtension#a when passed a Hash returns an 'a'-element, using the passed Hash for attributes
+fails:CGI::HtmlExtension#a when passed a Hash includes the passed block's return value when passed a block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/base_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/base_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/base_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+fails:CGI::HtmlExtension#base when bassed a String returns a 'base'-element, using the passed String as the 'href'-attribute
+fails:CGI::HtmlExtension#base when bassed a String ignores a passed block
+fails:CGI::HtmlExtension#base when passed a Hash returns a 'base'-element, using the passed Hash for attributes
+fails:CGI::HtmlExtension#base when passed a Hash ignores a passed block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/blockquote_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/blockquote_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/blockquote_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+fails:CGI::HtmlExtension#blockquote when passed a String returns a 'blockquote'-element, using the passed String for the 'cite'-attribute
+fails:CGI::HtmlExtension#blockquote when passed a String includes the passed block's return value when passed a block
+fails:CGI::HtmlExtension#blockquote when passed a Hash returns a 'blockquote'-element, using the passed Hash for attributes
+fails:CGI::HtmlExtension#blockquote when passed a Hash includes the passed block's return value when passed a block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/caption_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/caption_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/caption_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+fails:CGI::HtmlExtension#caption when passed a String returns a 'caption'-element, using the passed String for the 'align'-attribute
+fails:CGI::HtmlExtension#caption when passed a String includes the passed block's return value when passed a block
+fails:CGI::HtmlExtension#caption when passed a Hash returns a 'caption'-element, using the passed Hash for attributes
+fails:CGI::HtmlExtension#caption when passed a Hash includes the passed block's return value when passed a block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/checkbox_group_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/checkbox_group_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/checkbox_group_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+fails:CGI::HtmlExtension#checkbox_group when passed name, values ... returns a sequence of 'checkbox'-elements with the passed name and the passed values
+fails:CGI::HtmlExtension#checkbox_group when passed name, values ... allows passing a value inside an Array
+fails:CGI::HtmlExtension#checkbox_group when passed name, values ... allows passing a value as an Array containing the value and the checked state or a label
+fails:CGI::HtmlExtension#checkbox_group when passed name, values ... returns an empty String when passed no values
+fails:CGI::HtmlExtension#checkbox_group when passed name, values ... ignores a passed block
+fails:CGI::HtmlExtension#checkbox_group when passed Hash uses the passed Hash to generate the checkbox sequence
+fails:CGI::HtmlExtension#checkbox_group when passed Hash ignores a passed block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/checkbox_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/checkbox_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/checkbox_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+fails:CGI::HtmlExtension#checkbox when passed no arguments returns a checkbox-'input'-element without a name
+fails:CGI::HtmlExtension#checkbox when passed no arguments ignores a passed block
+fails:CGI::HtmlExtension#checkbox when passed name returns a checkbox-'input'-element with the passed name
+fails:CGI::HtmlExtension#checkbox when passed name ignores a passed block
+fails:CGI::HtmlExtension#checkbox CGI::HtmlExtension#checkbox when passed name, value returns a checkbox-'input'-element with the passed name and value
+fails:CGI::HtmlExtension#checkbox CGI::HtmlExtension#checkbox when passed name, value ignores a passed block
+fails:CGI::HtmlExtension#checkbox when passed name, value, checked returns a checked checkbox-'input'-element with the passed name and value when checked is true
+fails:CGI::HtmlExtension#checkbox when passed name, value, checked ignores a passed block
+fails:CGI::HtmlExtension#checkbox when passed Hash returns a checkbox-'input'-element using the passed Hash for attributes
+fails:CGI::HtmlExtension#checkbox when passed Hash ignores a passed block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/file_field_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/file_field_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/file_field_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+fails:CGI::HtmlExtension#file_field when passed no arguments returns a file-'input'-element without a name and a size of 20
+fails:CGI::HtmlExtension#file_field when passed no arguments ignores a passed block
+fails:CGI::HtmlExtension#file_field when passed name returns a checkbox-'input'-element with the passed name
+fails:CGI::HtmlExtension#file_field when passed name ignores a passed block
+fails:CGI::HtmlExtension#file_field when passed name, size returns a checkbox-'input'-element with the passed name and size
+fails:CGI::HtmlExtension#file_field when passed name, size ignores a passed block
+fails:CGI::HtmlExtension#file_field when passed name, size, maxlength returns a checkbox-'input'-element with the passed name, size and maxlength
+fails:CGI::HtmlExtension#file_field when passed name, size, maxlength ignores a passed block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/form_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/form_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/form_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+fails:CGI::HtmlExtension#form when passed no arguments returns a 'form'-element
+fails:CGI::HtmlExtension#form when passed no arguments includes the return value of the passed block when passed a block
+fails:CGI::HtmlExtension#form when passed method returns a 'form'-element with the passed method
+fails:CGI::HtmlExtension#form when passed method includes the return value of the passed block when passed a block
+fails:CGI::HtmlExtension#form when passed method, action returns a 'form'-element with the passed method and the passed action
+fails:CGI::HtmlExtension#form when passed method, action includes the return value of the passed block when passed a block
+fails:CGI::HtmlExtension#form when passed method, action, enctype returns a 'form'-element with the passed method, action and enctype
+fails:CGI::HtmlExtension#form when passed method, action, enctype includes the return value of the passed block when passed a block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/hidden_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/hidden_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/hidden_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+fails:CGI::HtmlExtension#hidden when passed no arguments returns an hidden-'input'-element without a name
+fails:CGI::HtmlExtension#hidden when passed no arguments ignores a passed block
+fails:CGI::HtmlExtension#hidden when passed name returns an hidden-'input'-element with the passed name
+fails:CGI::HtmlExtension#hidden when passed name ignores a passed block
+fails:CGI::HtmlExtension#hidden when passed name, value returns an hidden-'input'-element with the passed name and value
+fails:CGI::HtmlExtension#hidden when passed name, value ignores a passed block
+fails:CGI::HtmlExtension#hidden when passed Hash returns a checkbox-'input'-element using the passed Hash for attributes
+fails:CGI::HtmlExtension#hidden when passed Hash ignores a passed block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/html_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/html_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/html_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+fails:CGI::HtmlExtension#html when passed no arguments returns a self's doctype and an 'html'-element
+fails:CGI::HtmlExtension#html when passed no arguments includes the passed block when passed a block
+fails:CGI::HtmlExtension#html when passed 'PRETTY' returns pretty output when the passed String is 'PRETTY
+fails:CGI::HtmlExtension#html when passed 'PRETTY' includes the passed block when passed a block
+fails:CGI::HtmlExtension#html when passed a Hash returns an 'html'-element using the passed Hash for attributes
+fails:CGI::HtmlExtension#html when passed a Hash omits the doctype when the Hash contains a 'DOCTYPE' entry that's false or nil

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/image_button_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/image_button_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/image_button_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+fails:CGI::HtmlExtension#image_button when passed no arguments returns an image-'input'-element without a source image
+fails:CGI::HtmlExtension#image_button when passed no arguments ignores a passed block
+fails:CGI::HtmlExtension#image_button when passed src returns an image-'input'-element with the passed src
+fails:CGI::HtmlExtension#image_button when passed src ignores a passed block
+fails:CGI::HtmlExtension#image_button when passed src, name returns an image-'input'-element with the passed src and name
+fails:CGI::HtmlExtension#image_button when passed src, name ignores a passed block
+fails:CGI::HtmlExtension#image_button when passed src, name, alt returns an image-'input'-element with the passed src, name and alt
+fails:CGI::HtmlExtension#image_button when passed src, name, alt ignores a passed block
+fails:CGI::HtmlExtension#image_button when passed Hash returns a image-'input'-element using the passed Hash for attributes
+fails:CGI::HtmlExtension#image_button when passed Hash ignores a passed block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/img_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/img_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/img_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+fails:CGI::HtmlExtension#img when passed no arguments returns an 'img'-element without an src-url or alt-text
+fails:CGI::HtmlExtension#img when passed no arguments ignores a passed block
+fails:CGI::HtmlExtension#img when passed src returns an 'img'-element with the passed src-url
+fails:CGI::HtmlExtension#img when passed src ignores a passed block
+fails:CGI::HtmlExtension#img when passed src, alt returns an 'img'-element with the passed src-url and the passed alt-text
+fails:CGI::HtmlExtension#img when passed src, alt ignores a passed block
+fails:CGI::HtmlExtension#img when passed src, alt, width returns an 'img'-element with the passed src-url, the passed alt-text and the passed width
+fails:CGI::HtmlExtension#img when passed src, alt, width ignores a passed block
+fails:CGI::HtmlExtension#img when passed src, alt, width, height returns an 'img'-element with the passed src-url, the passed alt-text, the passed width and the passed height
+fails:CGI::HtmlExtension#img when passed src, alt, width, height ignores a passed block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/multipart_form_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/multipart_form_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/multipart_form_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+fails:CGI::HtmlExtension#multipart_form when passed no arguments returns a 'form'-element with it's enctype set to multipart
+fails:CGI::HtmlExtension#multipart_form when passed no arguments includes the return value of the passed block when passed a block
+fails:CGI::HtmlExtension#multipart_form when passed action returns a 'form'-element with the passed action
+fails:CGI::HtmlExtension#multipart_form when passed action includes the return value of the passed block when passed a block
+fails:CGI::HtmlExtension#multipart_form when passed action, enctype returns a 'form'-element with the passed action and enctype
+fails:CGI::HtmlExtension#multipart_form when passed action, enctype includes the return value of the passed block when passed a block
+fails:CGI::HtmlExtension#multipart_form when passed Hash returns a 'form'-element with the passed Hash as attributes
+fails:CGI::HtmlExtension#multipart_form when passed Hash includes the return value of the passed block when passed a block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/password_field_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/password_field_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/password_field_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+fails:CGI::HtmlExtension#password_field when passed no arguments returns an password-'input'-element without a name
+fails:CGI::HtmlExtension#password_field when passed no arguments ignores a passed block
+fails:CGI::HtmlExtension#password_field when passed name returns an password-'input'-element with the passed name
+fails:CGI::HtmlExtension#password_field when passed name ignores a passed block
+fails:CGI::HtmlExtension#password_field when passed name, value returns an password-'input'-element with the passed name and value
+fails:CGI::HtmlExtension#password_field when passed name, value ignores a passed block
+fails:CGI::HtmlExtension#password_field when passed name, value, size returns an password-'input'-element with the passed name, value and size
+fails:CGI::HtmlExtension#password_field when passed name, value, size ignores a passed block
+fails:CGI::HtmlExtension#password_field when passed name, value, size, maxlength returns an password-'input'-element with the passed name, value, size and maxlength
+fails:CGI::HtmlExtension#password_field when passed name, value, size, maxlength ignores a passed block
+fails:CGI::HtmlExtension#password_field when passed Hash returns a checkbox-'input'-element using the passed Hash for attributes
+fails:CGI::HtmlExtension#password_field when passed Hash ignores a passed block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/radio_button_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/radio_button_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/radio_button_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+fails:CGI::HtmlExtension#radio_button when passed no arguments returns a radio-'input'-element without a name
+fails:CGI::HtmlExtension#radio_button when passed no arguments ignores a passed block
+fails:CGI::HtmlExtension#radio_button when passed name returns a radio-'input'-element with the passed name
+fails:CGI::HtmlExtension#radio_button when passed name ignores a passed block
+fails:CGI::HtmlExtension#radio_button CGI::HtmlExtension#checkbox when passed name, value returns a radio-'input'-element with the passed name and value
+fails:CGI::HtmlExtension#radio_button CGI::HtmlExtension#checkbox when passed name, value ignores a passed block
+fails:CGI::HtmlExtension#radio_button when passed name, value, checked returns a checked radio-'input'-element with the passed name and value when checked is true
+fails:CGI::HtmlExtension#radio_button when passed name, value, checked ignores a passed block
+fails:CGI::HtmlExtension#radio_button when passed Hash returns a radio-'input'-element using the passed Hash for attributes
+fails:CGI::HtmlExtension#radio_button when passed Hash ignores a passed block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/radio_group_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/radio_group_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/radio_group_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+fails:CGI::HtmlExtension#radio_group when passed name, values ... returns a sequence of 'radio'-elements with the passed name and the passed values
+fails:CGI::HtmlExtension#radio_group when passed name, values ... allows passing a value inside an Array
+fails:CGI::HtmlExtension#radio_group when passed name, values ... allows passing a value as an Array containing the value and the checked state or a label
+fails:CGI::HtmlExtension#radio_group when passed name, values ... returns an empty String when passed no values
+fails:CGI::HtmlExtension#radio_group when passed name, values ... ignores a passed block
+fails:CGI::HtmlExtension#radio_group when passed Hash uses the passed Hash to generate the radio sequence
+fails:CGI::HtmlExtension#radio_group when passed Hash ignores a passed block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/reset_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/reset_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/reset_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+fails:CGI::HtmlExtension#reset when passed no arguments returns a reset-'input'-element
+fails:CGI::HtmlExtension#reset when passed no arguments ignores a passed block
+fails:CGI::HtmlExtension#reset when passed value returns a reset-'input'-element with the passed value
+fails:CGI::HtmlExtension#reset when passed value ignores a passed block
+fails:CGI::HtmlExtension#reset when passed value, name returns a reset-'input'-element with the passed value and the passed name
+fails:CGI::HtmlExtension#reset when passed value, name ignores a passed block
+fails:CGI::HtmlExtension#reset when passed Hash returns a reset-'input'-element with the passed value
+fails:CGI::HtmlExtension#reset when passed Hash ignores a passed block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/submit_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/submit_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/submit_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+fails:CGI::HtmlExtension#submit when passed no arguments returns a submit-'input'-element
+fails:CGI::HtmlExtension#submit when passed no arguments ignores a passed block
+fails:CGI::HtmlExtension#submit when passed value returns a submit-'input'-element with the passed value
+fails:CGI::HtmlExtension#submit when passed value ignores a passed block
+fails:CGI::HtmlExtension#submit when passed value, name returns a submit-'input'-element with the passed value and the passed name
+fails:CGI::HtmlExtension#submit when passed value, name ignores a passed block
+fails:CGI::HtmlExtension#submit when passed Hash returns a submit-'input'-element with the passed value
+fails:CGI::HtmlExtension#submit when passed Hash ignores a passed block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/text_field_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/text_field_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/text_field_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,12 @@
+fails:CGI::HtmlExtension#text_field when passed no arguments returns an text-'input'-element without a name
+fails:CGI::HtmlExtension#text_field when passed no arguments ignores a passed block
+fails:CGI::HtmlExtension#text_field when passed name returns an text-'input'-element with the passed name
+fails:CGI::HtmlExtension#text_field when passed name ignores a passed block
+fails:CGI::HtmlExtension#text_field when passed name, value returns an text-'input'-element with the passed name and value
+fails:CGI::HtmlExtension#text_field when passed name, value ignores a passed block
+fails:CGI::HtmlExtension#text_field when passed name, value, size returns an text-'input'-element with the passed name, value and size
+fails:CGI::HtmlExtension#text_field when passed name, value, size ignores a passed block
+fails:CGI::HtmlExtension#text_field when passed name, value, size, maxlength returns an text-'input'-element with the passed name, value, size and maxlength
+fails:CGI::HtmlExtension#text_field when passed name, value, size, maxlength ignores a passed block
+fails:CGI::HtmlExtension#text_field when passed Hash returns a checkbox-'input'-element using the passed Hash for attributes
+fails:CGI::HtmlExtension#text_field when passed Hash ignores a passed block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/textarea_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/textarea_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/htmlextension/textarea_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+fails:CGI::HtmlExtension#textarea when passed no arguments returns an 'textarea'-element without a name
+fails:CGI::HtmlExtension#textarea when passed no arguments includes the return value of the passed block when passed a block
+fails:CGI::HtmlExtension#textarea when passed name returns an 'textarea'-element with the passed name
+fails:CGI::HtmlExtension#textarea when passed name includes the return value of the passed block when passed a block
+fails:CGI::HtmlExtension#textarea when passed name, cols returns an 'textarea'-element with the passed name and the passed amount of columns
+fails:CGI::HtmlExtension#textarea when passed name, cols includes the return value of the passed block when passed a block
+fails:CGI::HtmlExtension#textarea when passed name, cols, rows returns an 'textarea'-element with the passed name, the passed amount of columns and the passed number of rows
+fails:CGI::HtmlExtension#textarea when passed name, cols, rows includes the return value of the passed block when passed a block
+fails:CGI::HtmlExtension#textarea when passed Hash should use the passed Hash as attributes
+fails:CGI::HtmlExtension#textarea when passed Hash includes the return value of the passed block when passed a block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/initialize_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/initialize_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/initialize_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+fails:CGI#initialize when passed no arguments does not extend self with CGI::HtmlExtension
+fails:CGI#initialize when passed no arguments does not extend self with any of the other HTML modules
+fails:CGI#initialize when CGI_PARAMS is set prints out a warning
+fails:CGI#initialize when CGI_PARAMS is set sets #cookies and #params to the contents of CGI_PARAMS and CGI_COOKIES

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/out_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/out_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/out_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+fails:CGI#out it writes a HTMl header based on the passed argument to $stdout
+fails:CGI#out appends the block's return value to the HTML header
+fails:CGI#out automatically sets the Content-Length Header based on the block's return value
+fails:CGI#out includes Cookies in the @output_cookies field

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/element_reference_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/element_reference_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/element_reference_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:CGI::QueryExtension#[] returns a String that was extended with CGI::QueryExtension::Value
+fails:CGI::QueryExtension#[] sets the other values in the returned value

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/params_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/params_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/params_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:CGI::QueryExtension#params returns the parsed HTTP Query Params

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/value/element_reference_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/value/element_reference_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/value/element_reference_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:CGI::QueryExtension::Value#[] when passed index returns the alternative value with the passed index

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/value/first_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/value/first_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/value/first_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:CGI::QueryExtension::Value#first returns self
+fails:CGI::QueryExtension::Value#first outputs a warning

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/value/last_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/value/last_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/value/last_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:CGI::QueryExtension::Value#last returns self
+fails:CGI::QueryExtension::Value#last outputs a warning

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/value/set_params_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/value/set_params_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/value/set_params_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:CGI::QueryExtension::Value#set_params sets alternative params

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/value/to_a_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/value/to_a_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/value/to_a_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:CGI::QueryExtension::Value#to_a returns an Array containing self
+fails:CGI::QueryExtension::Value#to_a when alternative values for self are set returns an array containing the alternative values

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/value/to_ary_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/value/to_ary_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/queryextension/value/to_ary_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:CGI::QueryExtension::Value#to_ary returns an Array containing self
+fails:CGI::QueryExtension::Value#to_ary when alternative values for self are set returns an array containing the alternative values

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/tagmaker/nOE_element_def_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/tagmaker/nOE_element_def_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/tagmaker/nOE_element_def_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:CGI::TagMaker#nOE_element_def when passed element returns code for the passed element
+fails:CGI::TagMaker#nOE_element_def when passed element automatically converts the tag to capital letters

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/tagmaker/nO_element_def_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/tagmaker/nO_element_def_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/tagmaker/nO_element_def_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:CGI::TagMaker#nO_element_def when passed element returns code for the passed element with optional start/end tags
+fails:CGI::TagMaker#nO_element_def when passed element automatically converts the element tag to capital letters

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/tagmaker/nn_element_def_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/tagmaker/nn_element_def_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/tagmaker/nn_element_def_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:CGI::TagMaker#nn_element_def when passed element returns code for the passed element with required start and end tags
+fails:CGI::TagMaker#nn_element_def when passed element automatically converts the element tag to capital letters

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/unescape_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/unescape_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/cgi/unescape_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:CGI.unescape url-decodes the passed argument

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/Complex_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/Complex_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/Complex_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+fails:Complex when passed [Complex, Complex] returns a new Complex number based on the two given numbers
+fails:Complex when passed [Integer, Integer] returns a new Complex number
+fails:Complex when passed [Integer] returns a new Complex number with 0 as the imaginary component
+fails:Complex when passed [Integer] returns the passed Integer when Complex::Unify is defined

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/coerce_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/coerce_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/coerce_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+fails:Complex#coerce returns an array containing other and self as Complex when other is an Integer
+fails:Complex#coerce returns an array containing other and self as Complex when other is a Float
+fails:Complex#coerce returns an array containing other and self as Complex when other is a Bignum
+fails:Complex#coerce returns an array containing other and self as Complex when other is a Rational
+fails:Complex#coerce raises a TypeError when other is a String

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/comparison_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/comparison_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/comparison_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Complex#<=> compares the absolute values of self and other

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/divide_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/divide_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/divide_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Complex#/ with Float returns Complex(Infinity, Infinity) when given zero

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/exponent_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/exponent_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/exponent_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Complex#** when given 0 returns Complex(1)

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/inspect_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/inspect_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/inspect_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Complex#inspect returns "Complex(real, image)"

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/acos_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/acos_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/acos_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math#acos! raises a TypeError when passed a Complex number
+fails:Math.acos! raises a TypeError when passed a Complex number

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/acosh_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/acosh_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/acosh_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math#acosh! raises a TypeError when passed a Complex number
+fails:Math.acosh! raises a TypeError when passed a Complex number

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/asin_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/asin_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/asin_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math#asin! raises a TypeError when passed a Complex number
+fails:Math.asin! raises a TypeError when passed a Complex number

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/asinh_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/asinh_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/asinh_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math#asinh! raises a TypeError when passed a Complex number
+fails:Math.asinh! raises a TypeError when passed a Complex number

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/atan2_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/atan2_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/atan2_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math#atan2! raises a TypeError when passed a Complex number
+fails:Math.atan2! raises a TypeError when passed a Complex number

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/atan_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/atan_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/atan_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math#atan! raises a TypeError when passed a Complex number
+fails:Math.atan! raises a TypeError when passed a Complex number

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/atanh_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/atanh_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/atanh_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,10 @@
+fails:Math#atanh returns Infinity for 1.0
+fails:Math#atanh returns -Infinity for -1.0
+fails:Math#atanh! returns Infinity for 1.0
+fails:Math#atanh! returns -Infinity for -1.0
+fails:Math#atanh! raises a TypeError when passed a Complex number
+fails:Math.atanh returns Infinity for 1.0
+fails:Math.atanh returns -Infinity for -1.0
+fails:Math.atanh! returns Infinity for 1.0
+fails:Math.atanh! returns -Infinity for -1.0
+fails:Math.atanh! raises a TypeError when passed a Complex number

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/cos_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/cos_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/cos_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math#cos! raises a TypeError when passed a Complex number
+fails:Math.cos! raises a TypeError when passed a Complex number

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/cosh_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/cosh_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/cosh_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math#cosh! raises a TypeError when passed a Complex number
+fails:Math.cosh! raises a TypeError when passed a Complex number

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/exp_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/exp_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/exp_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math#exp! raises a TypeError when passed a Complex number
+fails:Math.exp! raises a TypeError when passed a Complex number

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/log10_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/log10_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/log10_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math#log10! raises a TypeError when passed a Complex number
+fails:Math.log10! raises a TypeError when passed a Complex number

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/log_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/log_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/log_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math#log! raises a TypeError when passed a Complex number
+fails:Math.log! raises a TypeError when passed a Complex number

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/sin_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/sin_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/sin_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math#sin! raises a TypeError when passed a Complex number
+fails:Math.sin! raises a TypeError when passed a Complex number

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/sinh_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/sinh_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/sinh_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math#sinh! raises a TypeError when passed a Complex number
+fails:Math.sinh! raises a TypeError when passed a Complex number

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/sqrt_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/sqrt_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/sqrt_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math#sqrt! raises a TypeError when passed a Complex number
+fails:Math.sqrt! raises a TypeError when passed a Complex number

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/tan_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/tan_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/tan_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math#tan! raises a TypeError when passed a Complex number
+fails:Math.tan! raises a TypeError when passed a Complex number

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/tanh_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/tanh_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/math/tanh_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Math#tanh! raises a TypeError when passed a Complex number
+fails:Math.tanh! raises a TypeError when passed a Complex number

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/modulo_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/modulo_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/modulo_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+fails:Complex#% with Complex returns the remainder from complex division
+fails:Complex#% with Integer returns the remainder from dividing both parts of self by the given Integer
+fails:Complex#% with Object tries to coerce self into other

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/new_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/new_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/new_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+fails:Complex.new returns a new Complex number
+fails:Complex.new raises a TypeError when one of the given arguments is not Numeric
+fails:Complex.new raises a TypeError when one of the given arguments is a Complex
+fails:Complex.new! returns a new Complex number
+fails:Complex.new! defaults to 0 for the imaginery part
+fails:Complex.new! raises a TypeError when one of the given arguments is not Numeric
+fails:Complex.new! raises a TypeError when one of the given arguments is a Complex

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/numeric/image_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/numeric/image_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/numeric/image_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Numeric#image returns 0

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/to_s_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/to_s_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/complex/to_s_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Complex#to_s when self's real component is 0 returns only the imaginary component as String
+fails:Complex#to_s returns self as String

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/conditionvariable/broadcast_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/conditionvariable/broadcast_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/conditionvariable/broadcast_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:ConditionVariable#broadcast should return self if nothing to broadcast to
+fails:ConditionVariable#broadcast should return self if something is waiting for a broadcast

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/conditionvariable/signal_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/conditionvariable/signal_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/conditionvariable/signal_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:ConditionVariable#signal should return self if nothing to signal
+fails:ConditionVariable#signal should return self if something is waiting for a signal

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/conditionvariable/wait_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/conditionvariable/wait_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/conditionvariable/wait_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:ConditionVariable#wait should return self

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/csv/generate_line_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/csv/generate_line_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/csv/generate_line_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+fails:CSV.generate_line generates an empty string
+fails:CSV.generate_line generates the string 'foo,bar'
+fails:CSV.generate_line generates the string 'foo;bar'
+fails:CSV.generate_line generates the string 'foo,,bar'
+fails:CSV.generate_line generates the string 'foo;;bar'

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/csv/generate_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/csv/generate_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/csv/generate_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+fails:CSV.generate creates a BasicWriter
+fails:CSV.generate accepts a field separator
+fails:CSV.generate accepts a row separator
+fails:CSV.generate creates a BasicWriter to use in a block
+fails:CSV.generate creates a BasicWriter with ; as the separator inside the block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/csv/parse_line_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/csv/parse_line_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/csv/parse_line_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+fails:"CSV.parse_line parses '\n' into [[nil]]"
+fails:"CSV.parse_line parses '\nfoo' into [[nil],['foo']]"
+fails:"CSV.parse_line parses '\n\nbar' into [[nil],[nil],'bar']]"
+fails:CSV.parse_line parses 'foo' into [['foo']] with a separator of ;
+fails:CSV.parse_line parses 'foo;bar' into [['foo','bar']] with a separator of ;
+fails:"CSV.parse_line parses 'foo;bar\nbaz;quz' into [['foo','bar'],['baz','quz']] with a separator of ;"

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/csv/parse_row_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/csv/parse_row_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/csv/parse_row_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:"CSV.parse_row parses 'foo\nbar' one row at a time"

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/csv/reader/parse_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/csv/reader/parse_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/csv/reader/parse_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:CSV::Reader.parse processes empty input without calling block
+fails:CSV::Reader.parse calls block once for one row of input

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/civil_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/civil_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/civil_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Date#valid_civil? should be able to determine if a date is valid
+fails:Date#valid_civil? should be able to handle negative months and days

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/commercial_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/commercial_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/commercial_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+fails:Date#commercial creates a Date for the day of Julian calendar reform in Italy by default
+fails:Date#commercial Creates a Date for the friday in the year and week given
+fails:Date#valid_commercial? should be able to determine if the date is a valid commercial date
+fails:Date#valid_commercial? should be able to handle negative week and day numbers

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/conversions_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/conversions_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/conversions_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,17 @@
+fails:Date#ordinal_to_jd should convert an ordinal date (year-day) to a Julian day number
+fails:Date#jd_to_ordinal should convert a Julian day number into an ordinal date
+fails:Date#civil_to_jd should convert a civil date into a Julian day number
+fails:Date#jd_to_civil should convert a Julian day into a civil date
+fails:Date#commercial_to_jd should convert a commercial date (year - week - day of week) into a Julian day number
+fails:Date#jd_to_commercial should convert a Julian day number into a commercial date
+fails:Date#ajd_to_jd should convert a Astronomical Julian day number into a Julian day number
+fails:Date#jd_to_ajd should convert a Julian day number into a Astronomical Julian day number
+fails:Date#day_fraction_to_time should be able to convert a day fraction into time
+fails:Date#time_to_day_fraction should be able to convert a time into a day fraction
+fails:Date#amjd_to_ajd shoud be able to convert Astronomical Modified Julian day numbers into Astronomical Julian day numbers
+fails:Date#ajd_to_amjd shoud be able to convert Astronomical Julian day numbers into Astronomical Modified Julian day numbers
+fails:Date#mjd_to_jd shoud be able to convert Modified Julian day numbers into Julian day numbers
+fails:Date#jd_to_mjd shoud be able to convert Julian day numbers into Modified Julian day numbers
+fails:Date#ld_to_jd should be able to convert the number of days since the Gregorian calendar in Italy into Julian day numbers
+fails:Date#jd_to_ld should be able to convert Julian day numbers into the number of days since the Gregorian calendar in Italy
+fails:Date#jd_to_wday should be able to convert a Julian day number into a week day number

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/julian_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/julian_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/julian_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Date#valid_jd? should be able to determine if a day number is a valid Julian day number, true for all numbers

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/neww_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/neww_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/neww_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+fails:Date#neww creates a Date for the day of Julian calendar reform in Italy by default
+fails:Date#neww Creates a Date for the friday in the year and week given
+fails:Date#neww Creates a Date for the correct day given the year, week and day number
+fails:Date#neww creates only Date objects for valid weeks

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/ordinal_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/ordinal_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/ordinal_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+fails:Date#ordinal should be able to construct a Date object from an ordinal date
+fails:Date#valid_ordinal? should be able to determine if the date is a valid ordinal date
+fails:Date#valid_ordinal? should be able to handle negative day numbers

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/parse_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/parse_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/date/parse_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+fails:Date#parse can handle YYDDD as year and day number
+fails:Date#parse can handle YYMMDD as year month and day
+fails:Date#parse with '/' separator US-style parses a MMDDYYYY string into a Date object
+fails:Date#parse with '/' separator US-style parses a MMDDYY string into a Date object
+fails:Date#parse with '/' separator US-style parses a MMDDYY string into a Date object using the year digits as 20XX
+fails:Date#parse with '-' separator EU-style can parse a MM-DD-YY string into a Date object

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/enumerator/enum_cons_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/enumerator/enum_cons_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/enumerator/enum_cons_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Enumerator#enum_cons returns an enumerator of the receiver with iteration of each_cons for each array of n concecutive elements

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/enumerator/enum_slice_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/enumerator/enum_slice_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/enumerator/enum_slice_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Enumerator#enum_slice returns an enumerator of the receiver with iteration of each_slice for each slice of n elements

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/enumerator/enum_with_index_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/enumerator/enum_with_index_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/enumerator/enum_with_index_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Enumerator#enum_with_index returns an enumerator of the receiver with an iteration of each_with_index

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/enumerator/new_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/enumerator/new_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/enumerator/new_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+fails:Enumerator.new creates a new custom enumerator with the given object, iterator and arguments
+fails:Enumerator.new creates a new custom enumerator that responds to #each
+fails:Enumerator.new creates a new custom enumerator that runs correctly

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/etc/getpwuid_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/etc/getpwuid_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/etc/getpwuid_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Etc.getpwuid uses Process.uid as the default value for the argument

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/each_option_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/each_option_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/each_option_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:GetoptLong#each_option passes each argument/value pair to the block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/each_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/each_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/each_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:GetoptLong#each passes each argument/value pair to the block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/get_option_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/get_option_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/get_option_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+fails:GetoptLong#get_option returns the next option name and its argument as an Array
+fails:GetoptLong#get_option shifts ARGV on each call
+fails:GetoptLong#get_option terminates processing when encountering '--'
+fails:GetoptLong#get_option raises a if an argument was required, but none given

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/get_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/get_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/get_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+fails:GetoptLong#get returns the next option name and its argument as an Array
+fails:GetoptLong#get shifts ARGV on each call
+fails:GetoptLong#get terminates processing when encountering '--'
+fails:GetoptLong#get raises a if an argument was required, but none given

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/set_options_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/set_options_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/set_options_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+fails:GetoptLong#set_options allows setting command line options
+fails:GetoptLong#set_options discards previously defined command line options
+fails:GetoptLong#set_options raises an ArgumentError if one of the given arguments is not an Array

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/terminate_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/terminate_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/terminate_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:GetoptLong#terminate terminates option proccessing

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/terminated_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/terminated_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/getoptlong/terminated_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:GetoptLong#terminated? returns true if option processing has terminated

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/iconv/close_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/iconv/close_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/iconv/close_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Iconv#close returns a string containing the byte sequence to change the output buffer to its initial shift state

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/iconv/conv_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/iconv/conv_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/iconv/conv_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Iconv.conv acts exactly as if opening a converter and invoking #iconv once

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/iconv/iconv_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/iconv/iconv_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/iconv/iconv_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,7 @@
+fails:Iconv#iconv when given a string or string-like parameter returns a converted version of it
+fails:Iconv.iconv converts a series of strings with a single converter
+fails:The 'utf-8' encoder emits proper representations for characters outside the Basic Multilingual Plane
+fails:The 'utf-16be' decoder does not emit a byte-order mark
+fails:The 'utf-16be' decoder treats possible byte-order marks as regular characters
+fails:The 'utf-16le' decoder does not emit a byte-order mark
+fails:The 'utf-16le' decoder treats possible byte-order marks as regular characters

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/mathn/integer/gcd2_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/mathn/integer/gcd2_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/mathn/integer/gcd2_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Integer#gcd2 Returns the greatest common divisor of the two numbers
+fails:Integer#gcd2 raises a ZeroDivisionError when is called on zero

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/mathn/rational/exponent_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/mathn/rational/exponent_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/mathn/rational/exponent_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+fails:Rational#** when passed [Rational] returns Rational.new!(1, 1) when the passed argument is 0
+fails:Rational#** when passed [Rational] returns Rational.new!(1, 1) when self is 1
+fails:Rational#** when passed [Rational] returns Rational.new!(0, 1) when self is 0
+fails:Rational#** when passed [Rational] returns a Complex number when self is negative
+fails:Rational#** when passed [Integer] returns the Rational value of self raised to the passed argument
+fails:Rational#** when passed [Integer] returns Rational.new!(1, 1) when the passed argument is 0
+fails:Rational#** when passed [Float] returns self converted to Float and raised to the passed argument
+fails:Rational#** when passed [Float] returns 1.0 when the passed argument is 0
+fails:Rational#** when passed [Float] returns NaN if self is negative and the passed argument is not 0

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/mathn/rational/inspect_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/mathn/rational/inspect_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/mathn/rational/inspect_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Rational#inspect returns a string representation of self

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/mathn/rational/power2_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/mathn/rational/power2_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/mathn/rational/power2_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+fails:Rational#power2 when passed [Rational] returns Rational.new!(1, 1) when self is 1
+fails:Rational#power2 when passed [Rational] returns Rational.new!(0, 1) when self is 0
+fails:Rational#power2 when passed [Rational] returns a Complex number when self is negative
+fails:Rational#power2 when passed [Integer] returns the Rational value of self raised to the passed argument
+fails:Rational#power2 when passed [Integer] returns Rational.new!(1, 1) when the passed argument is 0
+fails:Rational#power2 when passed [Float] returns self converted to Float and raised to the passed argument
+fails:Rational#power2 when passed [Float] returns 1.0 when the passed argument is 0
+fails:Rational#power2 when passed [Float] returns NaN if self is negative and the passed argument is not 0

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/matrix/divide_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/matrix/divide_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/matrix/divide_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+fails:Matrix#/ returns the result of dividing self by another Matrix
+fails:Matrix#/ returns the result of dividing self by a Fixnum
+fails:Matrix#/ returns the result of dividing self by a Bignum

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/matrix/initialize_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/matrix/initialize_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/matrix/initialize_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Matrix#initialize is private

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/binary_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/binary_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/binary_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Net::FTP#binary returns true when self is in binary mode
+fails:Net::FTP#binary= sets self to binary mode when passed true

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/connect_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/connect_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/connect_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Net::FTP#connect prints a small debug line when in debug mode

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/getbinaryfile_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/getbinaryfile_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/getbinaryfile_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Net::FTP#getbinaryfile sends the RETR command to the server

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/gettextfile_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/gettextfile_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/gettextfile_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Net::FTP#gettextfile sends the RETR command to the server

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/initialize_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/initialize_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/initialize_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Net::FTP#initialize is private
+fails:Net::FTP#initialize sets self into binary mode

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/login_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/login_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/login_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+fails:Net::FTP#login when passed no arguments sends the USER command with 'anonymous' as name to the server
+fails:Net::FTP#login when passed no arguments sends the current username + hostname as a password when required
+fails:Net::FTP#login when passed name sends the USER command with the passed name to the server
+fails:Net::FTP#login when passed name, password sends the USER command with the passed name to the server
+fails:Net::FTP#login when passed name, password sends the passed password when required
+fails:Net::FTP#login when passed name, password, account sends the USER command with the passed name to the server
+fails:Net::FTP#login when passed name, password, account sends the passed password when required
+fails:Net::FTP#login when passed name, password, account sends the passed account when required

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/nlst_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/nlst_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/nlst_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+fails:Net::FTP#nlst when switching type fails raises a Net::FTPPermError when the response code is 500
+fails:Net::FTP#nlst when switching type fails raises a Net::FTPPermError when the response code is 501
+fails:Net::FTP#nlst when switching type fails raises a Net::FTPPermError when the response code is 504
+fails:Net::FTP#nlst when switching type fails raises a Net::FTPTempError when the response code is 421
+fails:Net::FTP#nlst when switching type fails raises a Net::FTPPermError when the response code is 530

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/putbinaryfile_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/putbinaryfile_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/putbinaryfile_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Net::FTP#putbinaryfile sends the STOR command to the server

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/puttextfile_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/puttextfile_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/puttextfile_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Net::FTP#puttextfile sends the STOR command to the server

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/retrbinary_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/retrbinary_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/retrbinary_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Net::FTP#retrbinary sends the passed command to the server

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/return_code_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/return_code_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/return_code_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+fails:Net::FTP#return_code outputs a warning and returns \n
+fails:Net::FTP#return_code= outputs a warning
+fails:Net::FTP#return_code outputs a warning and returns a newline

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/size_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/size_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/size_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Net::FTP#size sends the SIZE command to the server

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/storbinary_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/storbinary_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/ftp/storbinary_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Net::FTP#storbinary sends the passed command and the passed File object's content to the server

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/http/get_print_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/http/get_print_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/http/get_print_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Net::HTTP.get_print when passed host, path, port it prints the body of the specified uri to $stdout

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/http/initialize_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/http/initialize_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/http/initialize_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Net::HTTP#initialize is private

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/http/post_form_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/http/post_form_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/http/post_form_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Net::HTTP.post_form when passed URI POSTs the passed form data to the given uri

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/http/set_debug_output_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/http/set_debug_output_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/http/set_debug_output_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Net::HTTP#set_debug_output when passed io outputs a warning when the connection has already been started

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpgenericrequest/exec_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpgenericrequest/exec_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpgenericrequest/exec_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,6 @@
+fails:Net::HTTPGenericRequest#exec wehn passed socket, version, path executes the request over the passed socket to the passed path using the passed HTTP version
+fails:Net::HTTPGenericRequest#exec wehn passed socket, version, path when a request body is set sets the 'Content-Type' header to 'application/x-www-form-urlencoded' unless the 'Content-Type' header is supplied
+fails:Net::HTTPGenericRequest#exec wehn passed socket, version, path when a request body is set correctly sets the 'Content-Length' header and includes the body
+fails:Net::HTTPGenericRequest#exec wehn passed socket, version, path when a body stream is set sets the 'Content-Type' header to 'application/x-www-form-urlencoded' unless the 'Content-Type' header is supplied
+fails:Net::HTTPGenericRequest#exec wehn passed socket, version, path when a body stream is set sends the whole stream, regardless of the 'Content-Length' header
+fails:Net::HTTPGenericRequest#exec wehn passed socket, version, path when a body stream is set sends the request in chunks of 1024 bytes when 'Transfer-Encoding' is set to 'chunked'

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/body_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/body_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/body_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Net::HTTPResponse#body returns the read body
+fails:Net::HTTPResponse#body returns the previously read body if called a second time

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/entity_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/entity_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/entity_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Net::HTTPResponse#entity returns the read body
+fails:Net::HTTPResponse#entity returns the previously read body if called a second time

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/inspect_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/inspect_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/inspect_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Net::HTTPResponse#inspect returns a String representation of self

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/read_body_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/read_body_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/read_body_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,9 @@
+fails:Net::HTTPResponse#read_body when passed no arguments returns the read body
+fails:Net::HTTPResponse#read_body when passed no arguments returns the previously read body if called a second time
+fails:Net::HTTPResponse#read_body when passed a buffer reads the body to the passed buffer
+fails:Net::HTTPResponse#read_body when passed a buffer returns the passed buffer
+fails:Net::HTTPResponse#read_body when passed a buffer raises an IOError if called a second time
+fails:Net::HTTPResponse#read_body when passed a block reads the body and yields it to the passed block (in chunks)
+fails:Net::HTTPResponse#read_body when passed a block returns the ReadAdapter
+fails:Net::HTTPResponse#read_body when passed a block raises an IOError if called a second time
+fails:Net::HTTPResponse#read_body when passed buffer and block rauses an ArgumentError

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/read_new_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/read_new_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/read_new_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Net::HTTPResponse.read_new creates a HTTPResponse object based on the response read from the passed socket

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/reading_body_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/reading_body_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/reading_body_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+fails:Net::HTTPResponse#reading_body when body_allowed is true reads and returns the response body for self from the passed socket
+fails:Net::HTTPResponse#reading_body when body_allowed is true yields the passed block before reading the body
+fails:Net::HTTPResponse#reading_body when body_allowed is false yields the passed block

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/to_ary_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/to_ary_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/net/http/httpresponse/to_ary_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Net::HTTPResponse#to_ary returns an Array containing a duplicate of self and self's body
+fails:Net::HTTPResponse#to_ary removes #to_ary from the duplicate of self

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/observer/count_observers_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/observer/count_observers_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/observer/count_observers_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Observer#count_observers counts the observers

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/openstruct/table_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/openstruct/table_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/openstruct/table_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:OpenStruct#table is protected

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/queue/num_waiting_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/queue/num_waiting_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/queue/num_waiting_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Queue#num_waiting reports the number of threads waiting on the Queue

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/Rational_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/Rational_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/Rational_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+fails:Rational when passed Integer, Integer returns a new Rational number
+fails:Rational when passed Integer, Integer automatically reduces the Rational
+fails:Rational when passed Integer returns a new Rational number with 1 as the denominator

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/coerce_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/coerce_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/coerce_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Rational#coerce does try to convert the passed argument into a Float (using #to_f)
+fails:Rational#coerce returns the passed argument, self converted to Floats

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/divmod_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/divmod_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/divmod_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Rational#divmod when passed [Rational] returns the quotient as Integer and the remainder as Rational

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/equal_value_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/equal_value_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/equal_value_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+fails:Rational#== when passed [Rational] returns false if self has different numerator/denominator but the same numerical value as the passed argument
+fails:Rational#== when passed [Integer] returns true if self has the passed argument as numerator and a denominator of 1
+fails:Rational#== when passed [Float] converts self to a Float and compares it with the passed argument

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/exponent_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/exponent_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/exponent_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,5 @@
+fails:Rational#** when passed [Rational] converts self to a Float and returns it raised to the passed argument
+fails:Rational#** when passed [Rational] returns NaN when self is negative and the passed argument is not 0
+fails:Rational#** when passed [Integer] returns the Rational value of self raised to the passed argument
+fails:Rational#** when passed [Integer] returns Rational(1, 1) when the passed argument is 0
+fails:Rational#** when passed [Float] returns NaN if self is negative and the passed argument is not 0

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/initialize_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/initialize_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/initialize_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Rational#initialize turns around the numerators and denominators signs around when the denominator is negative

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/inspect_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/inspect_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/inspect_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Rational#inspect returns a reconstructable string representation of self

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/new_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/new_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/new_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Rational.new is private
+fails:Rational.new! returns a Rational with the passed numerator and denominator not reduced to their lowest terms

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/reduce_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/reduce_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/reduce_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Rational.reduce when Unify is defined returns an Integer when the reduced denominator is 1
+fails:Rational.reduce raises a ZeroDivisionError when the passed denominator is 0

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/to_r_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/to_r_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rational/to_r_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Rational#to_r returns self

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rexml/text/indent_text_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rexml/text/indent_text_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rexml/text/indent_text_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+fails:REXML::Text#indent_text indents a string with default parameters
+fails:REXML::Text#indent_text accepts a custom indentation level as second argument
+fails:REXML::Text#indent_text accepts a custom separator as third argument
+fails:REXML::Text#indent_text accepts a fourth parameter to skip the first line

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rexml/text/new_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rexml/text/new_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/rexml/text/new_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:REXML::Text.new expects escaped text if raw is true
+fails:REXML::Text.new can detect illegal expressions from a regex if raw is true

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/difference_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/difference_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/difference_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Set#difference raises an ArgumentError when passed a non-Enumerable

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/exclusion_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/exclusion_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/exclusion_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Set#^ raises an ArgumentError when passed a non-Enumerable

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/flatten_merge_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/flatten_merge_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/flatten_merge_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Set#flatten_merge is protected

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/initialize_copy_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/initialize_copy_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/initialize_copy_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Set#initialize_copy is private

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/initialize_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/initialize_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/initialize_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Set#initialize is private

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/intersection_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/intersection_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/intersection_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Set#intersection raises an ArgumentError when passed a non-Enumerable
+fails:Set#& raises an ArgumentError when passed a non-Enumerable

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/merge_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/merge_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/merge_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Set#merge raises an ArgumentError when passed a non-Enumerable

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/minus_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/minus_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/minus_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Set#- raises an ArgumentError when passed a non-Enumerable

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/plus_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/plus_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/plus_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Set#+ raises an ArgumentError when passed a non-Enumerable

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/difference_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/difference_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/difference_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:SortedSet#difference raises an ArgumentError when passed a non-Enumerable

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/exclusion_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/exclusion_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/exclusion_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:SortedSet#^ raises an ArgumentError when passed a non-Enumerable

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/flatten_merge_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/flatten_merge_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/flatten_merge_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:SortedSet#flatten_merge is protected

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/initialize_copy_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/initialize_copy_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/initialize_copy_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:SortedSet#initialize_copy is private

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/initialize_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/initialize_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/initialize_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:SortedSet#initialize is private

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/intersection_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/intersection_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/intersection_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:SortedSet#intersection raises an ArgumentError when passed a non-Enumerable
+fails:SortedSet#& raises an ArgumentError when passed a non-Enumerable

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/merge_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/merge_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/merge_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:SortedSet#merge raises an ArgumentError when passed a non-Enumerable

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/minus_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/minus_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/minus_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:SortedSet#- raises an ArgumentError when passed a non-Enumerable

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/plus_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/plus_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/plus_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:SortedSet#+ raises an ArgumentError when passed a non-Enumerable

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/union_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/union_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/sortedset/union_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:SortedSet#union raises an ArgumentError when passed a non-Enumerable
+fails:SortedSet#| raises an ArgumentError when passed a non-Enumerable

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/union_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/union_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/set/union_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:Set#union raises an ArgumentError when passed a non-Enumerable
+fails:Set#| raises an ArgumentError when passed a non-Enumerable

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/singleton/instantiate_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/singleton/instantiate_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/singleton/instantiate_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Singleton._instantiate? returns nil until it is instantiated

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/socket/basicsocket/getsockopt_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/socket/basicsocket/getsockopt_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/socket/basicsocket/getsockopt_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:BasicSocket#getsockopt gets a socket option

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/socket/constants/constants_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/socket/constants/constants_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/socket/constants/constants_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,8 @@
+fails:Socket::Constants defines socket types
+fails:Socket::Constants defines protocol families
+fails:Socket::Constants defines address families
+fails:Socket::Constants defines send/receive options
+fails:Socket::Constants defines socket level options
+fails:Socket::Constants defines socket options
+fails:Socket::Constants defines multicast options
+fails:Socket::Constants defines TCP options

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/socket/socket/for_fd_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/socket/socket/for_fd_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/socket/socket/for_fd_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Socket#for_fd given a file descriptor raises EBADF for a bad descriptor

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/socket/socket/pair_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/socket/socket/pair_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/socket/socket/pair_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Socket#pair ensures the returned sockets are connected

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/each_line_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/each_line_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/each_line_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:StringIO#each_line when passed a separator yields each paragraph when passed an empty String as separator

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/each_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/each_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/each_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:StringIO#each when passed a separator yields each paragraph when passed an empty String as separator

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/gets_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/gets_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/gets_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:StringIO#gets when passed [separator] returns the next paragraph when the passed separator is an empty String

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/initialize_copy_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/initialize_copy_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/initialize_copy_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:StringIO#initialize_copy is private

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/initialize_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/initialize_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/initialize_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,2 @@
+fails:StringIO#initialize when passed [Object, mode] raises a TypeError when passed a frozen String in truncate mode as StringIO backend
+fails:StringIO#initialize when passed no arguments is private

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/open_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/open_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/open_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:StringIO.open when passed [Object, mode] raises a TypeError when passed a frozen String in truncate mode as StringIO backend

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/print_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/print_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/print_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:StringIO#print prints $_ when passed no arguments

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/putc_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/putc_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/putc_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:StringIO#putc when passed [Object] tries to convert the passed argument to an Integer using #to_int

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/read_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/read_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/read_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:StringIO#read when passed length, buffer raises an error when passed a frozen String as buffer

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/readline_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/readline_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/readline_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:StringIO#readline when passed [separator] returns the next paragraph when the passed separator is an empty String

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/readlines_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/readlines_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/readlines_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:StringIO#readlines when passed [separator] returns an Array containing all paragraphs when the passed separator is an empty String

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/reopen_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/reopen_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/reopen_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:StringIO#reopen when passed [Object, Integer] raises a TypeError when trying to reopen self with a frozen String in truncate-mode

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/sysread_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/sysread_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/sysread_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:StringIO#sysread when passed length, buffer raises an error when passed a frozen String as buffer

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/ungetc_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/ungetc_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringio/ungetc_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+fails:StringIO#ungetc when passed [char] pads with \000 when the current position is after the end
+fails:StringIO#ungetc when passed [char] does nothing when at the beginning of self
+fails:StringIO#ungetc when passed [char] tries to convert the passed length to an Integer using #to_int
+fails:StringIO#ungetc when passed [char] raises a TypeError when the passed length can't be converted to an Integer

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringscanner/getch_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringscanner/getch_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringscanner/getch_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:StringScanner#getch is multi-byte character sensitive

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringscanner/initialize_copy_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringscanner/initialize_copy_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringscanner/initialize_copy_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:StringScanner#initialize_copy is a private method

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringscanner/initialize_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringscanner/initialize_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/stringscanner/initialize_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:StringScanner#initialize is a private method

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/syslog/constants_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/syslog/constants_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/syslog/constants_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Syslog::Constants includes the Syslog constants

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/tempfile/_close_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/tempfile/_close_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/tempfile/_close_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Tempfile#_close is protected

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/tempfile/close_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/tempfile/close_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/tempfile/close_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,4 @@
+fails:Tempfile#close when passed [true] closes self
+fails:Tempfile#close when passed [true] unlinks self
+fails:Tempfile#close! closes self
+fails:Tempfile#close! unlinks self

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/yaml/load_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/yaml/load_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/yaml/load_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+critical:YAML.load fails on invalid keys

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/yaml/to_yaml_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/yaml/to_yaml_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/yaml/to_yaml_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:Object#to_yaml returns the YAML representation of a Struct object

Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/library/zlib/gzipwriter/write_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/library/zlib/gzipwriter/write_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/library/zlib/gzipwriter/write_tags.txt	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1 @@
+fails:GzipWriter#write writes some compressed data

Added: MacRuby/branches/experimental/spec/frozen/version.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/version.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/version.rb	2009-03-11 22:46:43 UTC (rev 875)
@@ -0,0 +1,3 @@
+module RubySpec
+  VERSION = "0.7.5"
+end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090311/52848cf2/attachment-0001.html>


More information about the macruby-changes mailing list