[macruby-changes] [5211] MacRuby/trunk/spec/frozen

source_changes at macosforge.org source_changes at macosforge.org
Sun Jan 30 22:19:31 PST 2011


Revision: 5211
          http://trac.macosforge.org/projects/ruby/changeset/5211
Author:   watson1978 at gmail.com
Date:     2011-01-30 22:19:30 -0800 (Sun, 30 Jan 2011)
Log Message:
-----------
Updates RubySpec to 1ae7ffa8786a22f65259d5e6071543adf36692fb

Modified Paths:
--------------
    MacRuby/trunk/spec/frozen/README.markdown
    MacRuby/trunk/spec/frozen/core/argf/rewind_spec.rb
    MacRuby/trunk/spec/frozen/core/array/combination_spec.rb
    MacRuby/trunk/spec/frozen/core/array/compact_spec.rb
    MacRuby/trunk/spec/frozen/core/array/cycle_spec.rb
    MacRuby/trunk/spec/frozen/core/array/delete_spec.rb
    MacRuby/trunk/spec/frozen/core/array/each_index_spec.rb
    MacRuby/trunk/spec/frozen/core/array/element_set_spec.rb
    MacRuby/trunk/spec/frozen/core/array/fill_spec.rb
    MacRuby/trunk/spec/frozen/core/array/fixtures/classes.rb
    MacRuby/trunk/spec/frozen/core/array/flatten_spec.rb
    MacRuby/trunk/spec/frozen/core/array/inspect_spec.rb
    MacRuby/trunk/spec/frozen/core/array/join_spec.rb
    MacRuby/trunk/spec/frozen/core/array/pack/c_spec.rb
    MacRuby/trunk/spec/frozen/core/array/pack/i_spec.rb
    MacRuby/trunk/spec/frozen/core/array/pack/l_spec.rb
    MacRuby/trunk/spec/frozen/core/array/pack/n_spec.rb
    MacRuby/trunk/spec/frozen/core/array/pack/q_spec.rb
    MacRuby/trunk/spec/frozen/core/array/pack/s_spec.rb
    MacRuby/trunk/spec/frozen/core/array/pack/shared/basic.rb
    MacRuby/trunk/spec/frozen/core/array/pack/shared/numeric_basic.rb
    MacRuby/trunk/spec/frozen/core/array/pack/v_spec.rb
    MacRuby/trunk/spec/frozen/core/array/permutation_spec.rb
    MacRuby/trunk/spec/frozen/core/array/product_spec.rb
    MacRuby/trunk/spec/frozen/core/array/reject_spec.rb
    MacRuby/trunk/spec/frozen/core/array/repeated_combination_spec.rb
    MacRuby/trunk/spec/frozen/core/array/repeated_permutation_spec.rb
    MacRuby/trunk/spec/frozen/core/array/reverse_spec.rb
    MacRuby/trunk/spec/frozen/core/array/rindex_spec.rb
    MacRuby/trunk/spec/frozen/core/array/rotate_spec.rb
    MacRuby/trunk/spec/frozen/core/array/shuffle_spec.rb
    MacRuby/trunk/spec/frozen/core/array/sort_spec.rb
    MacRuby/trunk/spec/frozen/core/array/to_s_spec.rb
    MacRuby/trunk/spec/frozen/core/array/uniq_spec.rb
    MacRuby/trunk/spec/frozen/core/basicobject/__send___spec.rb
    MacRuby/trunk/spec/frozen/core/basicobject/equal_spec.rb
    MacRuby/trunk/spec/frozen/core/basicobject/equal_value_spec.rb
    MacRuby/trunk/spec/frozen/core/basicobject/instance_eval_spec.rb
    MacRuby/trunk/spec/frozen/core/basicobject/instance_exec_spec.rb
    MacRuby/trunk/spec/frozen/core/basicobject/method_missing_spec.rb
    MacRuby/trunk/spec/frozen/core/basicobject/new_spec.rb
    MacRuby/trunk/spec/frozen/core/basicobject/not_equal_spec.rb
    MacRuby/trunk/spec/frozen/core/basicobject/not_spec.rb
    MacRuby/trunk/spec/frozen/core/bignum/comparison_spec.rb
    MacRuby/trunk/spec/frozen/core/bignum/right_shift_spec.rb
    MacRuby/trunk/spec/frozen/core/class/new_spec.rb
    MacRuby/trunk/spec/frozen/core/dir/glob_spec.rb
    MacRuby/trunk/spec/frozen/core/dir/pwd_spec.rb
    MacRuby/trunk/spec/frozen/core/dir/shared/glob.rb
    MacRuby/trunk/spec/frozen/core/encoding/find_spec.rb
    MacRuby/trunk/spec/frozen/core/enumerator/next_spec.rb
    MacRuby/trunk/spec/frozen/core/file/basename_spec.rb
    MacRuby/trunk/spec/frozen/core/file/fixtures/common.rb
    MacRuby/trunk/spec/frozen/core/file/open_spec.rb
    MacRuby/trunk/spec/frozen/core/fixnum/exponent_spec.rb
    MacRuby/trunk/spec/frozen/core/float/comparison_spec.rb
    MacRuby/trunk/spec/frozen/core/float/divide_spec.rb
    MacRuby/trunk/spec/frozen/core/float/divmod_spec.rb
    MacRuby/trunk/spec/frozen/core/float/fdiv_spec.rb
    MacRuby/trunk/spec/frozen/core/float/round_spec.rb
    MacRuby/trunk/spec/frozen/core/float/shared/modulo.rb
    MacRuby/trunk/spec/frozen/core/hash/initialize_spec.rb
    MacRuby/trunk/spec/frozen/core/hash/shared/each.rb
    MacRuby/trunk/spec/frozen/core/kernel/Array_spec.rb
    MacRuby/trunk/spec/frozen/core/kernel/String_spec.rb
    MacRuby/trunk/spec/frozen/core/kernel/__method___spec.rb
    MacRuby/trunk/spec/frozen/core/kernel/define_singleton_method_spec.rb
    MacRuby/trunk/spec/frozen/core/kernel/eval_spec.rb
    MacRuby/trunk/spec/frozen/core/kernel/extend_spec.rb
    MacRuby/trunk/spec/frozen/core/kernel/fixtures/classes.rb
    MacRuby/trunk/spec/frozen/core/kernel/instance_variable_get_spec.rb
    MacRuby/trunk/spec/frozen/core/kernel/instance_variable_set_spec.rb
    MacRuby/trunk/spec/frozen/core/kernel/method_spec.rb
    MacRuby/trunk/spec/frozen/core/kernel/private_methods_spec.rb
    MacRuby/trunk/spec/frozen/core/kernel/protected_methods_spec.rb
    MacRuby/trunk/spec/frozen/core/kernel/public_methods_spec.rb
    MacRuby/trunk/spec/frozen/core/kernel/shared/abort.rb
    MacRuby/trunk/spec/frozen/core/kernel/shared/require.rb
    MacRuby/trunk/spec/frozen/core/kernel/singleton_methods_spec.rb
    MacRuby/trunk/spec/frozen/core/kernel/sprintf_spec.rb
    MacRuby/trunk/spec/frozen/core/marshal/dump_spec.rb
    MacRuby/trunk/spec/frozen/core/marshal/fixtures/marshal_data.rb
    MacRuby/trunk/spec/frozen/core/marshal/load_spec.rb
    MacRuby/trunk/spec/frozen/core/method/name_spec.rb
    MacRuby/trunk/spec/frozen/core/module/class_variable_defined_spec.rb
    MacRuby/trunk/spec/frozen/core/module/class_variable_get_spec.rb
    MacRuby/trunk/spec/frozen/core/module/class_variable_set_spec.rb
    MacRuby/trunk/spec/frozen/core/module/class_variables_spec.rb
    MacRuby/trunk/spec/frozen/core/module/const_defined_spec.rb
    MacRuby/trunk/spec/frozen/core/module/const_get_spec.rb
    MacRuby/trunk/spec/frozen/core/module/define_method_spec.rb
    MacRuby/trunk/spec/frozen/core/module/module_exec_spec.rb
    MacRuby/trunk/spec/frozen/core/module/name_spec.rb
    MacRuby/trunk/spec/frozen/core/module/remove_class_variable_spec.rb
    MacRuby/trunk/spec/frozen/core/module/remove_const_spec.rb
    MacRuby/trunk/spec/frozen/core/module/shared/class_eval.rb
    MacRuby/trunk/spec/frozen/core/numeric/step_spec.rb
    MacRuby/trunk/spec/frozen/core/object/shared/dup_clone.rb
    MacRuby/trunk/spec/frozen/core/objectspace/define_finalizer_spec.rb
    MacRuby/trunk/spec/frozen/core/proc/new_spec.rb
    MacRuby/trunk/spec/frozen/core/proc/source_location_spec.rb
    MacRuby/trunk/spec/frozen/core/proc/versions/parameters_1.9.rb
    MacRuby/trunk/spec/frozen/core/process/fork_spec.rb
    MacRuby/trunk/spec/frozen/core/process/setpriority_spec.rb
    MacRuby/trunk/spec/frozen/core/process/status/exited_spec.rb
    MacRuby/trunk/spec/frozen/core/process/status/exitstatus_spec.rb
    MacRuby/trunk/spec/frozen/core/process/status/pid_spec.rb
    MacRuby/trunk/spec/frozen/core/process/status/signaled_spec.rb
    MacRuby/trunk/spec/frozen/core/process/status/success_spec.rb
    MacRuby/trunk/spec/frozen/core/process/status/termsig_spec.rb
    MacRuby/trunk/spec/frozen/core/signal/trap_spec.rb
    MacRuby/trunk/spec/frozen/core/string/casecmp_spec.rb
    MacRuby/trunk/spec/frozen/core/string/center_spec.rb
    MacRuby/trunk/spec/frozen/core/string/delete_spec.rb
    MacRuby/trunk/spec/frozen/core/string/gsub_spec.rb
    MacRuby/trunk/spec/frozen/core/string/ljust_spec.rb
    MacRuby/trunk/spec/frozen/core/string/modulo_spec.rb
    MacRuby/trunk/spec/frozen/core/string/rindex_spec.rb
    MacRuby/trunk/spec/frozen/core/string/rjust_spec.rb
    MacRuby/trunk/spec/frozen/core/string/scan_spec.rb
    MacRuby/trunk/spec/frozen/core/string/split_spec.rb
    MacRuby/trunk/spec/frozen/core/string/sub_spec.rb
    MacRuby/trunk/spec/frozen/core/string/tr_spec.rb
    MacRuby/trunk/spec/frozen/core/string/unpack/c_spec.rb
    MacRuby/trunk/spec/frozen/core/string/unpack_spec.rb
    MacRuby/trunk/spec/frozen/core/struct/new_spec.rb
    MacRuby/trunk/spec/frozen/core/struct/shared/equal_value.rb
    MacRuby/trunk/spec/frozen/core/thread/fixtures/classes.rb
    MacRuby/trunk/spec/frozen/core/thread/new_spec.rb
    MacRuby/trunk/spec/frozen/core/thread/raise_spec.rb
    MacRuby/trunk/spec/frozen/core/thread/shared/exit.rb
    MacRuby/trunk/spec/frozen/core/time/at_spec.rb
    MacRuby/trunk/spec/frozen/core/time/fixtures/methods.rb
    MacRuby/trunk/spec/frozen/core/time/plus_spec.rb
    MacRuby/trunk/spec/frozen/core/time/shared/now.rb
    MacRuby/trunk/spec/frozen/core/time/usec_spec.rb
    MacRuby/trunk/spec/frozen/fixtures/class.rb
    MacRuby/trunk/spec/frozen/language/BEGIN_spec.rb
    MacRuby/trunk/spec/frozen/language/alias_spec.rb
    MacRuby/trunk/spec/frozen/language/block_spec.rb
    MacRuby/trunk/spec/frozen/language/break_spec.rb
    MacRuby/trunk/spec/frozen/language/class_spec.rb
    MacRuby/trunk/spec/frozen/language/constants_spec.rb
    MacRuby/trunk/spec/frozen/language/def_spec.rb
    MacRuby/trunk/spec/frozen/language/defined_spec.rb
    MacRuby/trunk/spec/frozen/language/fixtures/block.rb
    MacRuby/trunk/spec/frozen/language/fixtures/classes.rb
    MacRuby/trunk/spec/frozen/language/fixtures/defined.rb
    MacRuby/trunk/spec/frozen/language/fixtures/return.rb
    MacRuby/trunk/spec/frozen/language/if_spec.rb
    MacRuby/trunk/spec/frozen/language/module_spec.rb
    MacRuby/trunk/spec/frozen/language/not_spec.rb
    MacRuby/trunk/spec/frozen/language/predefined_spec.rb
    MacRuby/trunk/spec/frozen/language/regexp/encoding_spec.rb
    MacRuby/trunk/spec/frozen/language/return_spec.rb
    MacRuby/trunk/spec/frozen/language/string_spec.rb
    MacRuby/trunk/spec/frozen/language/versions/block_1.8.rb
    MacRuby/trunk/spec/frozen/language/versions/block_1.9.rb
    MacRuby/trunk/spec/frozen/language/versions/not_1.9.rb
    MacRuby/trunk/spec/frozen/language/versions/regexp_1.9.rb
    MacRuby/trunk/spec/frozen/library/bigdecimal/divmod_spec.rb
    MacRuby/trunk/spec/frozen/library/csv/readlines_spec.rb
    MacRuby/trunk/spec/frozen/library/date/conversions_spec.rb
    MacRuby/trunk/spec/frozen/library/delegate/delegate_class/instance_method_spec.rb
    MacRuby/trunk/spec/frozen/library/delegate/delegate_class/instance_methods_spec.rb
    MacRuby/trunk/spec/frozen/library/delegate/delegate_class/private_instance_methods_spec.rb
    MacRuby/trunk/spec/frozen/library/delegate/delegate_class/protected_instance_methods_spec.rb
    MacRuby/trunk/spec/frozen/library/delegate/delegate_class/public_instance_methods_spec.rb
    MacRuby/trunk/spec/frozen/library/delegate/delegator/equal_value_spec.rb
    MacRuby/trunk/spec/frozen/library/delegate/delegator/frozen_spec.rb
    MacRuby/trunk/spec/frozen/library/delegate/delegator/marshal_spec.rb
    MacRuby/trunk/spec/frozen/library/delegate/delegator/method_spec.rb
    MacRuby/trunk/spec/frozen/library/delegate/delegator/methods_spec.rb
    MacRuby/trunk/spec/frozen/library/delegate/delegator/not_equal_spec.rb
    MacRuby/trunk/spec/frozen/library/delegate/delegator/private_methods_spec.rb
    MacRuby/trunk/spec/frozen/library/delegate/delegator/protected_methods_spec.rb
    MacRuby/trunk/spec/frozen/library/delegate/delegator/public_methods_spec.rb
    MacRuby/trunk/spec/frozen/library/delegate/delegator/send_spec.rb
    MacRuby/trunk/spec/frozen/library/digest/md5/shared/length.rb
    MacRuby/trunk/spec/frozen/library/digest/sha256/shared/length.rb
    MacRuby/trunk/spec/frozen/library/digest/sha384/shared/length.rb
    MacRuby/trunk/spec/frozen/library/digest/sha512/shared/length.rb
    MacRuby/trunk/spec/frozen/library/iconv/iconv_spec.rb
    MacRuby/trunk/spec/frozen/library/net/http/http/fixtures/http_server.rb
    MacRuby/trunk/spec/frozen/library/net/http/http/get_spec.rb
    MacRuby/trunk/spec/frozen/library/net/http/http/shared/version_1_1.rb
    MacRuby/trunk/spec/frozen/library/net/http/http/shared/version_1_2.rb
    MacRuby/trunk/spec/frozen/library/net/http/http/version_1_1_spec.rb
    MacRuby/trunk/spec/frozen/library/net/http/httpresponse/to_ary_spec.rb
    MacRuby/trunk/spec/frozen/library/queue/shared/deque.rb
    MacRuby/trunk/spec/frozen/library/socket/basicsocket/getsockname_spec.rb
    MacRuby/trunk/spec/frozen/library/socket/socket/connect_nonblock_spec.rb
    MacRuby/trunk/spec/frozen/library/socket/socket/getaddrinfo_spec.rb
    MacRuby/trunk/spec/frozen/library/socket/socket/getnameinfo_spec.rb
    MacRuby/trunk/spec/frozen/library/socket/udpsocket/bind_spec.rb
    MacRuby/trunk/spec/frozen/library/stringio/bytes_spec.rb
    MacRuby/trunk/spec/frozen/library/stringio/gets_spec.rb
    MacRuby/trunk/spec/frozen/library/stringio/initialize_copy_spec.rb
    MacRuby/trunk/spec/frozen/library/stringio/initialize_spec.rb
    MacRuby/trunk/spec/frozen/library/stringio/puts_spec.rb
    MacRuby/trunk/spec/frozen/library/stringio/shared/each.rb
    MacRuby/trunk/spec/frozen/library/stringio/shared/eof.rb
    MacRuby/trunk/spec/frozen/library/stringscanner/check_spec.rb
    MacRuby/trunk/spec/frozen/library/stringscanner/element_reference_spec.rb
    MacRuby/trunk/spec/frozen/library/stringscanner/exist_spec.rb
    MacRuby/trunk/spec/frozen/library/stringscanner/initialize_copy_spec.rb
    MacRuby/trunk/spec/frozen/library/stringscanner/match_spec.rb
    MacRuby/trunk/spec/frozen/library/stringscanner/pre_match_spec.rb
    MacRuby/trunk/spec/frozen/library/stringscanner/scan_spec.rb
    MacRuby/trunk/spec/frozen/library/stringscanner/scan_until_spec.rb
    MacRuby/trunk/spec/frozen/library/stringscanner/shared/concat.rb
    MacRuby/trunk/spec/frozen/library/stringscanner/shared/get_byte.rb
    MacRuby/trunk/spec/frozen/library/stringscanner/shared/peek.rb
    MacRuby/trunk/spec/frozen/library/stringscanner/shared/pos.rb
    MacRuby/trunk/spec/frozen/library/stringscanner/skip_spec.rb
    MacRuby/trunk/spec/frozen/library/tempfile/_close_spec.rb
    MacRuby/trunk/spec/frozen/library/tempfile/callback_spec.rb
    MacRuby/trunk/spec/frozen/library/tempfile/close_spec.rb
    MacRuby/trunk/spec/frozen/library/tempfile/delete_spec.rb
    MacRuby/trunk/spec/frozen/library/tempfile/initialize_spec.rb
    MacRuby/trunk/spec/frozen/library/tempfile/length_spec.rb
    MacRuby/trunk/spec/frozen/library/tempfile/open_spec.rb
    MacRuby/trunk/spec/frozen/library/tempfile/path_spec.rb
    MacRuby/trunk/spec/frozen/library/tempfile/shared/length.rb
    MacRuby/trunk/spec/frozen/library/tempfile/shared/unlink.rb
    MacRuby/trunk/spec/frozen/library/tempfile/size_spec.rb
    MacRuby/trunk/spec/frozen/library/tempfile/unlink_spec.rb
    MacRuby/trunk/spec/frozen/library/timeout/timeout_spec.rb
    MacRuby/trunk/spec/frozen/library/yaml/dump_stream_spec.rb
    MacRuby/trunk/spec/frozen/library/yaml/load_spec.rb
    MacRuby/trunk/spec/frozen/library/yaml/to_yaml_spec.rb
    MacRuby/trunk/spec/frozen/shared/enumerator/next.rb
    MacRuby/trunk/spec/frozen/tags/macruby/core/array/pack/c_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/core/array/repeated_combination_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/core/array/repeated_permutation_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/core/encoding/find_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/core/file/open_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/core/fixnum/right_shift_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/core/float/fdiv_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/core/kernel/String_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/core/kernel/method_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/core/kernel/require_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/core/marshal/dump_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/core/module/define_method_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/core/module/module_exec_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/core/numeric/step_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/core/objectspace/define_finalizer_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/core/proc/parameters_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/core/process/fork_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/core/string/scan_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/core/string/split_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/core/string/tr_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/core/unboundmethod/owner_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/language/block_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/language/constants_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/language/def_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/language/predefined_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/language/super_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/library/socket/socket/getnameinfo_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/library/stringio/gets_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/library/stringio/puts_tags.txt
    MacRuby/trunk/spec/frozen/tags/macruby/library/stringscanner/scan_tags.txt

Added Paths:
-----------
    MacRuby/trunk/spec/frozen/core/array/pack/a_spec.rb
    MacRuby/trunk/spec/frozen/core/array/pack/at_spec.rb
    MacRuby/trunk/spec/frozen/core/array/pack/comment_spec.rb
    MacRuby/trunk/spec/frozen/core/array/pack/m_spec.rb
    MacRuby/trunk/spec/frozen/core/array/pack/percent_spec.rb
    MacRuby/trunk/spec/frozen/core/array/pack/shared/encodings.rb
    MacRuby/trunk/spec/frozen/core/array/pack/shared/float.rb
    MacRuby/trunk/spec/frozen/core/array/pack/shared/string.rb
    MacRuby/trunk/spec/frozen/core/array/pack/shared/unicode.rb
    MacRuby/trunk/spec/frozen/core/array/pack/u_spec.rb
    MacRuby/trunk/spec/frozen/core/array/pack/w_spec.rb
    MacRuby/trunk/spec/frozen/core/array/pack/x_spec.rb
    MacRuby/trunk/spec/frozen/core/array/pack/z_spec.rb
    MacRuby/trunk/spec/frozen/core/basicobject/ancestors_spec.rb
    MacRuby/trunk/spec/frozen/core/basicobject/basicobject_spec.rb
    MacRuby/trunk/spec/frozen/core/basicobject/class_spec.rb
    MacRuby/trunk/spec/frozen/core/basicobject/fixtures/common.rb
    MacRuby/trunk/spec/frozen/core/basicobject/fixtures/remove_method_missing.rb
    MacRuby/trunk/spec/frozen/core/basicobject/initialize_spec.rb
    MacRuby/trunk/spec/frozen/core/basicobject/superclass_spec.rb
    MacRuby/trunk/spec/frozen/core/float/fixtures/
    MacRuby/trunk/spec/frozen/core/float/fixtures/coerce.rb
    MacRuby/trunk/spec/frozen/core/kernel/fixtures/__method__.rb
    MacRuby/trunk/spec/frozen/core/marshal/fixtures/random.dump
    MacRuby/trunk/spec/frozen/core/object/fixtures/
    MacRuby/trunk/spec/frozen/core/object/fixtures/classes.rb
    MacRuby/trunk/spec/frozen/core/object/instance_exec_spec.rb
    MacRuby/trunk/spec/frozen/core/proc/fixtures/common.rb
    MacRuby/trunk/spec/frozen/core/proc/fixtures/source_location.rb
    MacRuby/trunk/spec/frozen/core/string/append_spec.rb
    MacRuby/trunk/spec/frozen/core/string/ascii_only_spec.rb
    MacRuby/trunk/spec/frozen/core/string/bytes_spec.rb
    MacRuby/trunk/spec/frozen/core/string/bytesize_spec.rb
    MacRuby/trunk/spec/frozen/core/string/concat_spec.rb
    MacRuby/trunk/spec/frozen/core/string/each_byte_spec.rb
    MacRuby/trunk/spec/frozen/core/string/eql_spec.rb
    MacRuby/trunk/spec/frozen/core/string/equal_value_spec.rb
    MacRuby/trunk/spec/frozen/core/string/fixtures/utf-8-encoding.rb
    MacRuby/trunk/spec/frozen/core/string/getbyte_spec.rb
    MacRuby/trunk/spec/frozen/core/string/inspect_spec.rb
    MacRuby/trunk/spec/frozen/core/string/intern_spec.rb
    MacRuby/trunk/spec/frozen/core/string/next_spec.rb
    MacRuby/trunk/spec/frozen/core/string/setbyte_spec.rb
    MacRuby/trunk/spec/frozen/core/string/succ_spec.rb
    MacRuby/trunk/spec/frozen/core/string/to_s_spec.rb
    MacRuby/trunk/spec/frozen/core/string/to_str_spec.rb
    MacRuby/trunk/spec/frozen/core/string/to_sym_spec.rb
    MacRuby/trunk/spec/frozen/core/string/unpack/a_spec.rb
    MacRuby/trunk/spec/frozen/core/string/unpack/at_spec.rb
    MacRuby/trunk/spec/frozen/core/string/unpack/b_spec.rb
    MacRuby/trunk/spec/frozen/core/string/unpack/comment_spec.rb
    MacRuby/trunk/spec/frozen/core/string/unpack/i_spec.rb
    MacRuby/trunk/spec/frozen/core/string/unpack/l_spec.rb
    MacRuby/trunk/spec/frozen/core/string/unpack/m_spec.rb
    MacRuby/trunk/spec/frozen/core/string/unpack/n_spec.rb
    MacRuby/trunk/spec/frozen/core/string/unpack/percent_spec.rb
    MacRuby/trunk/spec/frozen/core/string/unpack/q_spec.rb
    MacRuby/trunk/spec/frozen/core/string/unpack/s_spec.rb
    MacRuby/trunk/spec/frozen/core/string/unpack/shared/
    MacRuby/trunk/spec/frozen/core/string/unpack/shared/basic.rb
    MacRuby/trunk/spec/frozen/core/string/unpack/shared/float.rb
    MacRuby/trunk/spec/frozen/core/string/unpack/shared/integer.rb
    MacRuby/trunk/spec/frozen/core/string/unpack/shared/string.rb
    MacRuby/trunk/spec/frozen/core/string/unpack/shared/unicode.rb
    MacRuby/trunk/spec/frozen/core/string/unpack/u_spec.rb
    MacRuby/trunk/spec/frozen/core/string/unpack/v_spec.rb
    MacRuby/trunk/spec/frozen/core/string/unpack/w_spec.rb
    MacRuby/trunk/spec/frozen/core/string/unpack/x_spec.rb
    MacRuby/trunk/spec/frozen/core/string/unpack/z_spec.rb
    MacRuby/trunk/spec/frozen/core/time/fixtures/classes.rb
    MacRuby/trunk/spec/frozen/language/fixtures/rubyopt.rb
    MacRuby/trunk/spec/frozen/library/readline/readline_spec.rb
    MacRuby/trunk/spec/frozen/library/socket/fixtures/send_io.txt
    MacRuby/trunk/spec/frozen/library/socket/unixsocket/recv_io_spec.rb
    MacRuby/trunk/spec/frozen/library/socket/unixsocket/send_io_spec.rb
    MacRuby/trunk/spec/frozen/library/tempfile/fixtures/
    MacRuby/trunk/spec/frozen/library/tempfile/fixtures/common.rb
    MacRuby/trunk/spec/frozen/library/zlib/deflate/set_dictionary_spec.rb

Removed Paths:
-------------
    MacRuby/trunk/spec/frozen/core/basicobject/basic_object_class_spec.rb
    MacRuby/trunk/spec/frozen/core/basicobject/basic_object_spec.rb
    MacRuby/trunk/spec/frozen/core/basicobject/basic_object_subclass_spec.rb
    MacRuby/trunk/spec/frozen/core/basicobject/fixtures/classes.rb
    MacRuby/trunk/spec/frozen/core/basicobject/metaclass_spec.rb
    MacRuby/trunk/spec/frozen/core/basicobject/remove_method_missing.rb
    MacRuby/trunk/spec/frozen/core/basicobject/shared/behavior.rb
    MacRuby/trunk/spec/frozen/core/proc/fixtures/procs.rb
    MacRuby/trunk/spec/frozen/core/string/append_spec_disabled.rb
    MacRuby/trunk/spec/frozen/core/string/ascii_only_spec_disabled.rb
    MacRuby/trunk/spec/frozen/core/string/bytes_spec_disabled.rb
    MacRuby/trunk/spec/frozen/core/string/bytesize_spec_disabled.rb
    MacRuby/trunk/spec/frozen/core/string/concat_spec_disabled.rb
    MacRuby/trunk/spec/frozen/core/string/each_byte_spec_disabled.rb
    MacRuby/trunk/spec/frozen/core/string/eql_spec_disabled.rb
    MacRuby/trunk/spec/frozen/core/string/equal_value_spec_disabled.rb
    MacRuby/trunk/spec/frozen/core/string/getbyte_spec_disabled.rb
    MacRuby/trunk/spec/frozen/core/string/inspect_spec_disabled.rb
    MacRuby/trunk/spec/frozen/core/string/intern_spec_disabled.rb
    MacRuby/trunk/spec/frozen/core/string/next_spec_disabled.rb
    MacRuby/trunk/spec/frozen/core/string/setbyte_spec_disabled.rb
    MacRuby/trunk/spec/frozen/core/string/succ_spec_disabled.rb
    MacRuby/trunk/spec/frozen/core/string/to_s_spec_disabled.rb
    MacRuby/trunk/spec/frozen/core/string/to_str_spec_disabled.rb
    MacRuby/trunk/spec/frozen/core/string/to_sym_spec_disabled.rb
    MacRuby/trunk/spec/frozen/core/thread/key_spec_disabled.rb
    MacRuby/trunk/spec/frozen/core/thread/raise_spec_disabled.rb
    MacRuby/trunk/spec/frozen/fixtures/load/@a
    MacRuby/trunk/spec/frozen/library/readline/readline_spec_disabled.rb
    MacRuby/trunk/spec/frozen/library/stringio/shared/getbyte.rb
    MacRuby/trunk/spec/frozen/library/stringio/shared/readbyte.rb
    MacRuby/trunk/spec/frozen/library/stringscanner/shared/eucjp.rb
    MacRuby/trunk/spec/frozen/library/zlib/deflate/set_dictionary_spec_disabled.rb

Modified: MacRuby/trunk/spec/frozen/README.markdown
===================================================================
--- MacRuby/trunk/spec/frozen/README.markdown	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/README.markdown	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,62 +1,88 @@
 # About RubySpec
 
-RubySpec is a project to write a complete, executable specification for the Ruby programming language. The goal is official recognition and support from all the organizations currently involved in Ruby implementations, such as MatzRuby (including YARV), JRuby, IronRuby, MacRuby, Ruby.NET and MagLev. The specs describe Ruby language syntax, core library classes, and standard library classes.
+RubySpec is a project to write a complete, executable specification for the
+Ruby programming language. The specs describe Ruby language syntax as well as
+the core and standard library classes.
 
-This project has a free-flowing commit bit policy. If you have had a patch accepted by any current Ruby implementation project, you can get a commit bit by referencing your patch. Anyone who submits an accepted patch to this project will also receive a commit bit. The only requirement is that you have a Github account.
+* [RubySpec website](http://rubyspec.org/)
+* [Github repository](http://github.com/rubyspec/rubyspec)
 
-  - [RubySpec website](http://rubyspec.org/)
-  - [RubySpec Wiki with documentation](http://rubyspec.org/wiki/rubyspec)
-  - [Github repository](http://github.com/rubyspec/rubyspec)
 
 ## Running RubySpec
 
-The RubySpec specification files are written in Ruby, utilizing the [MSpec](http://github.com/rubyspec/mspec/tree/master) testing framework, so you need to download MSpec in order to run the RubySpec suite. If you don't have MSpec yet, then go to a directory outside the RubySpec directory and check out its source code from Github:
+The RubySpec specification files are written using RSpec-compatible syntax.
+RubySpec provides a purpose-built framework, named
+[MSpec](http://github.com/rubyspec/mspec/tree/master), for running the specs.
 
+The easiest way to run the RubySpecs suite is to install the MSpec gem.
+
+    $ [sudo] gem install mspec
+
+However, RubySpec often utilizes the latest MSpec features, so you may want to
+use MSpec directly from the Git repository.
+
     $ cd /somewhere
     $ git clone git://github.com/rubyspec/mspec.git
-    # MSpec is now available in /somewhere/mspec.
 
-You should add the MSpec `bin` directory to your PATH for easy access. In this README we'll assume that the `mspec` command is in PATH.
+MSpec is now available in `/somewhere/mspec`.
 
+To make the MSpec scripts available, add the MSpec `bin` directory to you
+PATH:
+
     $ export PATH=/somewhere/mspec/bin:$PATH
 
-If you already have MSpec, then you should run `git pull` from the MSpec source directory from time to time, because RubySpec often utilizes the latest MSpec features.
+Once you have MSpec installed, clone the RubySpec Git repository to run the
+specs.
 
-By invoking the `mspec` command inside the RubySpec directory, it will run the entire RubySpec suite against the Ruby interpreter (named `ruby`) in your PATH:
+    $ cd /somewhere
+    $ git clone git://github.com/rubyspec/rubyspec.git
 
-    $ cd /path-to-rubyspec
+To run the RubySpec suite:
+
+    $ cd /somewhere/rubyspec
     $ mspec
 
+This will execute all the RubySpec specs using the executable named `ruby` on
+your current PATH.
+
+
 ### Running RubySpec against a specific Ruby interpreter
 
-Use the `-t` option to specify the Ruby interpreter that you want to run RubySpec against. The argument may be a full path to the Ruby binary:
+Use the `-t` option to specify the Ruby implementation with which to run the
+specs. The argument may be a full path to the Ruby binary. For example, to run
+RubySpec against `/opt/ruby-enterprise/bin/ruby`:
 
-    # Runs RubySpec against /opt/ruby-enterprise/bin/ruby
     $ mspec -t /opt/ruby-enterprise/bin/ruby
 
-The argument may also be a shortcut. For example, if you specify `j`, then MSpec will look for `jruby` in PATH and run RubySpec against that:
+There are some arguments that are abbreviations for known Ruby implementations.
+For example, if you specify `j`, then MSpec will look for `jruby` in PATH and
+run RubySpec against that:
 
-    # Runs RubySpec against JRuby in PATH.
     $ mspec -t j
 
-See `mspec --help` for a list of possible `-t` shortcut values.
+See `mspec --help` for a list of `-t` abbreviations.
 
+
 ### Running parts of the spec
 
-To run a single spec file, pass the filename to MSpec, for example:
+To run a single spec file, pass the filename to `mspec`:
 
     $ mspec core/kernel/kind_of_spec.rb
 
-You can also pass a directory, in which case all specs in that directories will be run:
+You can also pass a directory, in which case all specs in that directories
+will be run:
 
     $ mspec core/kernel
 
-Note however that passing a directory to MSpec may not always be a good idea, because some specs aren't supposed to be run against the active Ruby interpreter. For example, if you run `mspec -t /usr/bin/ruby1.8 library`, then MSpec will run the 1.9-specific library specs as well, even though you specified Ruby 1.8 as the Ruby interpreter. Instead, you can specify pseudo-directories, which are defined in ruby.1.8.mspec and ruby.1.9.mspec. These pseudo-directories only include files appropriate for the active Ruby interpreter.
+Note however that passing a directory to MSpec may not always be a good idea,
+because some specs aren't supposed to be run against the active Ruby
+interpreter. For example, if you run `mspec -t /usr/bin/ruby1.8 library`, then
+MSpec will run the 1.9-specific library specs as well, even though you
+specified Ruby 1.8 as the Ruby interpreter. Instead, you can specify
+pseudo-directories, which are defined in ruby.1.8.mspec and ruby.1.9.mspec.
+These pseudo-directories only include files appropriate for the active Ruby
+interpreter.
 
     $ mspec :core
     $ mspec :library
     $ mspec :language
-
-## More
-
-For more documentation, e.g. with regard to writing specs, please visit the [Wiki](http://rubyspec.org/wiki/rubyspec).
\ No newline at end of file

Modified: MacRuby/trunk/spec/frozen/core/argf/rewind_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/rewind_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/argf/rewind_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -30,7 +30,7 @@
 
   # This fails on all versions as reported in bug #1693. If it's deemed not to
   # be a bug, this guard can be removed
-  ruby_bug "#1693", "1.8.7.248" do
+  ruby_bug "#1693", "1.8.7.302" do
     it "resets ARGF.lineno to 0" do
       argv [@file2_name] do
         ARGF.lineno = 0

Modified: MacRuby/trunk/spec/frozen/core/array/combination_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/combination_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/combination_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -42,5 +42,14 @@
     it "yields a partition consisting of only singletons" do
       @array.combination(1).to_a.sort.should == [[1],[2],[3],[4]]
     end
+    
+    it "generates from a defensive copy, ignoring mutations" do
+      accum = []
+      @array.combination(2) do |x|
+        accum << x
+        @array[0] = 1
+      end
+      accum.should == [[1, 2], [1, 3], [1, 4], [2, 3], [2, 4], [3, 4]]
+    end
   end
 end

Modified: MacRuby/trunk/spec/frozen/core/array/compact_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/compact_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/compact_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -18,23 +18,45 @@
     a.compact.should_not equal(a)
   end
 
-  it "returns subclass instance for Array subclasses" do
-    ArraySpecs::MyArray[1, 2, 3, nil].compact.should be_kind_of(ArraySpecs::MyArray)
+  ruby_version_is '' ... '1.9.3' do
+    it "keeps tainted status even if all elements are removed" do
+      a = [nil, nil]
+      a.taint
+      a.compact.tainted?.should be_true
+    end
   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
+  ruby_version_is '1.9' ... '1.9.3' 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
+
+  ruby_version_is '' ... '1.9.3' do
+    it "returns subclass instance for Array subclasses" do
+      ArraySpecs::MyArray[1, 2, 3, nil].compact.should be_kind_of(ArraySpecs::MyArray)
+    end
+  end
+
+  ruby_version_is '1.9.3' do
+    it "does not return subclass instance for Array subclasses" do
+      ArraySpecs::MyArray[1, 2, 3, nil].compact.should be_kind_of(Array)
+    end
+
+    it "does not keep tainted status even if all elements are removed" do
+      a = [nil, nil]
+      a.taint
+      a.compact.tainted?.should be_false
+    end
+
+    it "does not keep untrusted status even if all elements are removed" do
+      a = [nil, nil]
+      a.untrust
+      a.compact.untrusted?.should be_false
+    end
+  end
 end
 
 describe "Array#compact!" do

Modified: MacRuby/trunk/spec/frozen/core/array/cycle_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/cycle_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/cycle_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,61 +1,89 @@
-describe "Array#cycle" do
-  ruby_version_is '1.8.7' do
-    it "returns nil and does nothing for non positive n or empty arrays" do
-      [1,2,3].cycle(0){ throw "ball"}.should be_nil
-      [].cycle(6){ throw "ball"}.should be_nil
-    end
+ruby_version_is '1.8.7' do
+  describe "Array#cycle" do
+    before :each do
+      ScratchPad.record []
 
-    it "cycle as many times as requested" do
-      [1,2,3].cycle(2).to_a.should == [1,2,3,1,2,3]
+      @array = [1, 2, 3]
+      @prc = lambda { |x| ScratchPad << x }
     end
 
-    it "cycles indefinitely if called without argument" do
-      bomb = 10
-      [1,2,3].cycle do
-        bomb -= 1
-        break 42 if bomb <= 0
-      end.should == 42
-      bomb.should == 0
+    it "does not yield and returns nil when the array is empty" do
+      [].cycle(6, &@prc).should be_nil
+      ScratchPad.recorded.should == []
     end
 
-    it "cycles indefinitely if argument is nil" do
-      bomb = 10
-      [1,2,3].cycle(nil) do
-        bomb -= 1
-        break 42 if bomb <= 0
-      end.should == 42
-      bomb.should == 0
+    it "does not yield and returns nil when passed 0" do
+      @array.cycle(0, &@prc).should be_nil
+      ScratchPad.recorded.should == []
     end
 
-    it "doesn't rescue StopIteration" do
-      lambda {
-        [1,2,3].cycle do
-          raise StopIteration
-        end
-      }.should raise_error(StopIteration)
-      lambda {
-        [1,2,3].cycle(2) do
-          raise StopIteration
-        end
-      }.should raise_error(StopIteration)
+    it "iterates the array 'count' times yielding each item to the block" do
+      @array.cycle(2, &@prc)
+      ScratchPad.recorded.should == [1, 2, 3, 1, 2, 3]
     end
 
-    it "raises a TypeError if passed a non-Numeric and non-nil argument" do
-      lambda {
-        [1,2,3].cycle("4"){}
-      }.should raise_error(TypeError)
-      lambda {
-        [1,2,3].cycle(false){}
-      }.should raise_error(TypeError)
+    it "iterates indefinitely when not passed a count" do
+      @array.cycle do |x|
+        ScratchPad << x
+        break if ScratchPad.recorded.size > 7
+      end
+      ScratchPad.recorded.should == [1, 2, 3, 1, 2, 3, 1, 2]
     end
 
-    it "yields successive elements of the array repeatedly" do
-      b = []
-      [1,2,3].cycle do |elem|
-        b << elem
-        break if b.size == 7
+    it "iterates indefinitely when passed nil" do
+      @array.cycle(nil) do |x|
+        ScratchPad << x
+        break if ScratchPad.recorded.size > 7
       end
-      b.should == [1,2,3,1,2,3,1]
+      ScratchPad.recorded.should == [1, 2, 3, 1, 2, 3, 1, 2]
     end
+
+    it "does not rescue StopIteration when not passed a count" do
+      lambda do
+        @array.cycle { raise StopIteration }
+      end.should raise_error(StopIteration)
+    end
+
+    it "does not rescue StopIteration when passed a count" do
+      lambda do
+        @array.cycle(3) { raise StopIteration }
+      end.should raise_error(StopIteration)
+    end
+
+    it "iterates the array Integer(count) times when passed a Float count" do
+      @array.cycle(2.7, &@prc)
+      ScratchPad.recorded.should == [1, 2, 3, 1, 2, 3]
+    end
+
+    it "calls #to_int to convert count to an Integer" do
+      count = mock("cycle count 2")
+      count.should_receive(:to_int).and_return(2)
+
+      @array.cycle(count, &@prc)
+      ScratchPad.recorded.should == [1, 2, 3, 1, 2, 3]
+    end
+
+    it "raises a TypeError if #to_int does not return an Integer" do
+      count = mock("cycle count 2")
+      count.should_receive(:to_int).and_return("2")
+
+      lambda { @array.cycle(count, &@prc) }.should raise_error(TypeError)
+    end
+
+    it "raises a TypeError if passed a String" do
+      lambda { @array.cycle("4") { } }.should raise_error(TypeError)
+    end
+
+    it "raises a TypeError if passed an Object" do
+      lambda { @array.cycle(mock("cycle count")) { } }.should raise_error(TypeError)
+    end
+
+    it "raises a TypeError if passed true" do
+      lambda { @array.cycle(true) { } }.should raise_error(TypeError)
+    end
+
+    it "raises a TypeError if passed false" do
+      lambda { @array.cycle(false) { } }.should raise_error(TypeError)
+    end
   end
 end

Modified: MacRuby/trunk/spec/frozen/core/array/delete_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/delete_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/delete_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -30,14 +30,28 @@
     [].delete('a') {:not_found}.should == :not_found
   end
 
+  it "returns nil if the array is empty due to a shift" do
+    a = [1]
+    a.shift
+    a.delete(nil).should == nil
+  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
 
-    it "returns false on a frozen array if a modification does not take place" do
-      [1, 2, 3].freeze.delete(0).should == nil
+    not_compliant_on :rubinius do
+      it "returns false on a frozen array if a modification does not take place" do
+        [1, 2, 3].freeze.delete(0).should == nil
+      end
     end
+
+    deviates_on :rubinius do
+      it "raises a TypeError if the array is frozen" do
+        lambda { [1, 2, 3].freeze.delete(0) }.should raise_error(TypeError)
+      end
+    end
   end
 
   ruby_version_is '1.9' do

Modified: MacRuby/trunk/spec/frozen/core/array/each_index_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/each_index_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/each_index_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -22,5 +22,19 @@
     a.each_index { |i| }.should equal(a)
   end
 
+  it "is not confused by removing elements from the front" do
+    a = [1, 2, 3]
+
+    a.shift
+    ScratchPad.record []
+    a.each_index { |i| ScratchPad << i }
+    ScratchPad.recorded.should == [0, 1]
+
+    a.shift
+    ScratchPad.record []
+    a.each_index { |i| ScratchPad << i }
+    ScratchPad.recorded.should == [0]
+  end
+
   it_behaves_like :enumeratorize, :each_index
 end

Modified: MacRuby/trunk/spec/frozen/core/array/element_set_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/element_set_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/element_set_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -48,6 +48,15 @@
       a[1, 3] = nil
       a.should == ["a", "e"]
     end
+
+    it "is not confused by shift when removing elements with nil" do
+      a = [1,2,3]
+
+      a.shift
+      a[1,1] = nil
+
+      a.should == [2]
+    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
@@ -107,7 +116,15 @@
     a[obj] = -1
     a.should == [1, 2, -1]
   end
-
+  
+  ruby_version_is '1.9' do
+    it "checks frozen before attempting to coerce arguments" do
+      a = [1,2,3,4].freeze
+      lambda {a[:foo] = 1}.should raise_error(RuntimeError)
+      lambda {a[:foo, :bar] = 1}.should raise_error(RuntimeError)
+    end
+  end
+  
   it "sets elements in the range arguments when passed ranges" do
     ary = [1, 2, 3]
     rhs = [nil, [], ["x"], ["x", "y"]]

Modified: MacRuby/trunk/spec/frozen/core/array/fill_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/fill_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/fill_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -108,6 +108,7 @@
     a = [1, 2, 3]
     a.fill('x', 1, nil).should == [1, 'x', 'x']
     a.fill(1, nil){|i| i*2}.should == [1, 2, 4]
+    a.fill('y', nil).should == ['y', 'y', 'y']
   end
 
   it "replaces the last (-n) elements if given an index n which is negative and no length" do
@@ -224,19 +225,27 @@
     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)
+  not_compliant_on :rubinius do
+    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
 
-  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)
+  deviates_on :rubinius do
+    it "raises an ArgumentError if the length is not a Fixnum" do
+      lambda { [1, 2].fill(10, 1, bignum_value()) }.should raise_error(ArgumentError)
     end
   end
 end

Modified: MacRuby/trunk/spec/frozen/core/array/fixtures/classes.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/fixtures/classes.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/fixtures/classes.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -178,6 +178,14 @@
     end
   end
 
+  def self.universal_pack_object
+    obj = mock("string float int")
+    obj.stub!(:to_int).and_return(1)
+    obj.stub!(:to_str).and_return("1")
+    obj.stub!(:to_f).and_return(1.0)
+    obj
+  end
+
   LargeArray = ["test_create_table_with_force_true_does_not_drop_nonexisting_table",
  "test_add_table",
  "assert_difference",

Modified: MacRuby/trunk/spec/frozen/core/array/flatten_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/flatten_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/flatten_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -92,6 +92,26 @@
     ary.flatten
     ary.should == [1, [2, 3]]
   end
+
+  describe "with a non-Array object in the Array" do
+    before :each do
+      @obj = mock("Array#flatten")
+    end
+
+    it "does not call #to_ary if the method does not exist" do
+      [@obj].flatten.should == [@obj]
+    end
+
+    it "ignores the return value of #to_ary if it is nil" do
+      @obj.should_receive(:to_ary).and_return(nil)
+      [@obj].flatten.should == [@obj]
+    end
+
+    it "raises a TypeError if the return value of #to_ary is not an Array" do
+      @obj.should_receive(:to_ary).and_return(1)
+      lambda { [@obj].flatten }.should raise_error(TypeError)
+    end
+  end
 end
 
 describe "Array#flatten!" do

Modified: MacRuby/trunk/spec/frozen/core/array/inspect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/inspect_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/inspect_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -30,4 +30,29 @@
     lambda{ x.inspect }.should_not raise_error
     lambda{ y.inspect }.should_not raise_error
   end
+  
+  it "propagates taint from itself or elements" do
+    x = [1, 2]
+    x.taint
+    s = x.inspect
+    s.tainted?.should == true
+    
+    x = [1, s]
+    s = x.inspect
+    s.tainted?.should == true
+  end
+  
+  ruby_version_is "1.9" do
+    it "propagates untrust from itself or elements" do
+      x = [1, 2]
+      x.untrust
+      s = x.inspect
+      s.untrusted?.should == true
+      
+      x = [1, s]
+      x.untrust
+      s = x.inspect
+      s.untrusted?.should == true
+    end
+  end
 end

Modified: MacRuby/trunk/spec/frozen/core/array/join_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/join_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/join_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -3,9 +3,10 @@
 require File.expand_path('../shared/join', __FILE__)
 
 describe "Array#join" do
-
   it_behaves_like :array_join, :join, ArraySpecs::NewArray
+end
 
+describe "Array#join" do
   it "does not separates elements when the passed separator is nil" do
     [1, 2, 3].join(nil).should == '123'
   end
@@ -32,6 +33,14 @@
     [1, 2].send(@method, sep).should == "1, 2"
   end
 
+  it "calls #to_s on the Array elements" do
+    a = mock("Array#join element")
+    a.should_receive(:to_s).and_return("-a-")
+    a.should_not_receive(:to_a)
+
+    [a].join(",").should == "-a-"
+  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)

Added: MacRuby/trunk/spec/frozen/core/array/pack/a_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/pack/a_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/array/pack/a_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,59 @@
+# -*- encoding: ascii-8bit -*-
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+require File.expand_path('../shared/basic', __FILE__)
+require File.expand_path('../shared/string', __FILE__)
+
+describe "Array#pack with format 'A'" do
+  it_behaves_like :array_pack_basic, 'A'
+  it_behaves_like :array_pack_basic_non_float, 'A'
+  it_behaves_like :array_pack_no_platform, 'A'
+  it_behaves_like :array_pack_string, 'A'
+
+  it "adds all the bytes to the output when passed the '*' modifier" do
+    ["abc"].pack("A*").should == "abc"
+  end
+
+  it "padds the output with spaces when the count exceeds the size of the String" do
+    ["abc"].pack("A6").should == "abc   "
+  end
+
+  it "adds a space when the value is nil" do
+    [nil].pack("A").should == " "
+  end
+
+  it "pads the output with spaces when the value is nil" do
+    [nil].pack("A3").should == "   "
+  end
+
+  it "does not pad with spaces when passed the '*' modifier and the value is nil" do
+    [nil].pack("A*").should == ""
+  end
+end
+
+describe "Array#pack with format 'a'" do
+  it_behaves_like :array_pack_basic, 'a'
+  it_behaves_like :array_pack_basic_non_float, 'a'
+  it_behaves_like :array_pack_no_platform, 'a'
+  it_behaves_like :array_pack_string, 'a'
+
+  it "adds all the bytes to the output when passed the '*' modifier" do
+    ["abc"].pack("a*").should == "abc"
+  end
+
+  it "padds the output with NULL bytes when the count exceeds the size of the String" do
+    ["abc"].pack("a6").should == "abc\x00\x00\x00"
+  end
+
+  it "adds a NULL byte when the value is nil" do
+    [nil].pack("a").should == "\x00"
+  end
+
+  it "pads the output with NULL bytes when the value is nil" do
+    [nil].pack("a3").should == "\x00\x00\x00"
+  end
+
+  it "does not pad with NULL bytes when passed the '*' modifier and the value is nil" do
+    [nil].pack("a*").should == ""
+  end
+end

Added: MacRuby/trunk/spec/frozen/core/array/pack/at_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/pack/at_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/array/pack/at_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,30 @@
+# -*- encoding: ascii-8bit -*-
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+require File.expand_path('../shared/basic', __FILE__)
+
+describe "Array#pack with format '@'" do
+  it_behaves_like :array_pack_basic, '@'
+  it_behaves_like :array_pack_basic_non_float, '@'
+  it_behaves_like :array_pack_no_platform, '@'
+
+  it "moves the insertion point to the index specified by the count modifier" do
+    [1, 2, 3, 4, 5].pack("C4 at 2C").should == "\x01\x02\x05"
+  end
+
+  it "does not consume any elements" do
+    [1, 2, 3].pack("C at 3C").should == "\x01\x00\x00\x02"
+  end
+
+  it "extends the string with NULL bytes if the string size is less than the count" do
+    [1, 2, 3].pack("@3C*").should == "\x00\x00\x00\x01\x02\x03"
+  end
+
+  it "truncates the string if the string size is greater than the count" do
+    [1, 2, 3].pack("Cx5 at 2C").should == "\x01\x00\x02"
+  end
+
+  it "implicitly has a count of one when no count modifier is passed" do
+    [1, 2, 3].pack("C*@").should == "\x01"
+  end
+end

Modified: MacRuby/trunk/spec/frozen/core/array/pack/c_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/pack/c_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/pack/c_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -63,15 +63,21 @@
 end
 
 describe "Array#pack with format 'C'" do
+  it_behaves_like :array_pack_basic, 'C'
+  it_behaves_like :array_pack_basic_non_float, 'C'
   it_behaves_like :array_pack_8bit, 'C'
-  it_behaves_like :array_pack_basic, 'C'
+  it_behaves_like :array_pack_arguments, 'C'
   it_behaves_like :array_pack_numeric_basic, 'C'
+  it_behaves_like :array_pack_integer, 'C'
   it_behaves_like :array_pack_no_platform, 'C'
 end
 
 describe "Array#pack with format 'c'" do
+  it_behaves_like :array_pack_basic, 'c'
+  it_behaves_like :array_pack_basic_non_float, 'c'
   it_behaves_like :array_pack_8bit, 'c'
-  it_behaves_like :array_pack_basic, 'c'
+  it_behaves_like :array_pack_arguments, 'c'
   it_behaves_like :array_pack_numeric_basic, 'c'
+  it_behaves_like :array_pack_integer, 'c'
   it_behaves_like :array_pack_no_platform, 'c'
 end

Added: MacRuby/trunk/spec/frozen/core/array/pack/comment_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/pack/comment_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/array/pack/comment_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,25 @@
+# -*- encoding: ascii-8bit -*-
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+
+describe "Array#pack" do
+  it "ignores directives text from '#' to the first newline" do
+    [1, 2, 3].pack("c#this is a comment\nc").should == "\x01\x02"
+  end
+
+  it "ignores directives text from '#' to the end if no newline is present" do
+    [1, 2, 3].pack("c#this is a comment c").should == "\x01"
+  end
+
+  it "ignores comments at the start of the directives string" do
+    [1, 2, 3].pack("#this is a comment\nc").should == "\x01"
+  end
+
+  it "ignores the entire directive string if it is a comment" do
+    [1, 2, 3].pack("#this is a comment").should == ""
+  end
+
+  it "ignores multiple comments" do
+    [1, 2, 3].pack("c#comment\nc#comment\nc#c").should == "\x01\x02\x03"
+  end
+end

Modified: MacRuby/trunk/spec/frozen/core/array/pack/i_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/pack/i_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/pack/i_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -6,12 +6,18 @@
 
 describe "Array#pack with format 'I'" do
   it_behaves_like :array_pack_basic, 'I'
+  it_behaves_like :array_pack_basic_non_float, 'I'
+  it_behaves_like :array_pack_arguments, 'I'
   it_behaves_like :array_pack_numeric_basic, 'I'
+  it_behaves_like :array_pack_integer, 'I'
 end
 
 describe "Array#pack with format 'i'" do
   it_behaves_like :array_pack_basic, 'i'
+  it_behaves_like :array_pack_basic_non_float, 'i'
+  it_behaves_like :array_pack_arguments, 'i'
   it_behaves_like :array_pack_numeric_basic, 'i'
+  it_behaves_like :array_pack_integer, 'i'
 end
 
 little_endian do

Modified: MacRuby/trunk/spec/frozen/core/array/pack/l_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/pack/l_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/pack/l_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -6,12 +6,18 @@
 
 describe "Array#pack with format 'L'" do
   it_behaves_like :array_pack_basic, 'L'
+  it_behaves_like :array_pack_basic_non_float, 'L'
+  it_behaves_like :array_pack_arguments, 'L'
   it_behaves_like :array_pack_numeric_basic, 'L'
+  it_behaves_like :array_pack_integer, 'L'
 end
 
 describe "Array#pack with format 'l'" do
   it_behaves_like :array_pack_basic, 'l'
+  it_behaves_like :array_pack_basic_non_float, 'l'
+  it_behaves_like :array_pack_arguments, 'l'
   it_behaves_like :array_pack_numeric_basic, 'l'
+  it_behaves_like :array_pack_integer, 'l'
 end
 
 little_endian do

Added: MacRuby/trunk/spec/frozen/core/array/pack/m_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/pack/m_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/array/pack/m_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,337 @@
+# -*- encoding: ascii-8bit -*-
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+require File.expand_path('../shared/basic', __FILE__)
+
+describe "Array#pack with format 'M'" do
+  it_behaves_like :array_pack_basic, 'M'
+  it_behaves_like :array_pack_basic_non_float, 'M'
+  it_behaves_like :array_pack_arguments, 'M'
+
+  it "encodes an empty string as an empty string" do
+    [""].pack("M").should == ""
+  end
+
+  it "encodes nil as an empty string" do
+    [nil].pack("M").should == ""
+  end
+
+  it "appends a soft line break at the end of an encoded string" do
+    ["a"].pack("M").should == "a=\n"
+  end
+
+  it "does not append a soft break if the string ends with a newline" do
+    ["a\n"].pack("M").should == "a\n"
+  end
+
+  it "encodes one element for each directive" do
+    ["a", "b", "c"].pack("MM").should == "a=\nb=\n"
+  end
+
+  it "encodes byte values 33..60 directly" do
+    [ [["!\"\#$%&'()*+,-./"], "!\"\#$%&'()*+,-./=\n"],
+      [["0123456789"],        "0123456789=\n"],
+      [[":;<"],               ":;<=\n"]
+    ].should be_computed_by(:pack, "M")
+  end
+
+  it "encodes byte values 62..126 directly" do
+    [ [[">?@"],                         ">?@=\n"],
+      [["ABCDEFGHIJKLMNOPQRSTUVWXYZ"],  "ABCDEFGHIJKLMNOPQRSTUVWXYZ=\n"],
+      [["[\\]^_`"],                     "[\\]^_`=\n"],
+      [["abcdefghijklmnopqrstuvwxyz"],  "abcdefghijklmnopqrstuvwxyz=\n"],
+      [["{|}~"],                        "{|}~=\n"]
+    ].should be_computed_by(:pack, "M")
+  end
+
+  it "encodes an '=' character in hex format" do
+    ["="].pack("M").should == "=3D=\n"
+  end
+
+  it "encodes an embedded space directly" do
+    ["a b"].pack("M").should == "a b=\n"
+  end
+
+  it "encodes a space at the end of the string directly" do
+    ["a "].pack("M").should == "a =\n"
+  end
+
+  it "encodes an embedded tab directly" do
+    ["a\tb"].pack("M").should == "a\tb=\n"
+  end
+
+  it "encodes a tab at the end of the string directly" do
+    ["a\t"].pack("M").should == "a\t=\n"
+  end
+
+  it "encodes an embedded newline directly" do
+    ["a\nb"].pack("M").should == "a\nb=\n"
+  end
+
+  it "encodes 0..31 except tab and newline in hex format" do
+    [ [["\x00\x01\x02\x03\x04\x05\x06"],  "=00=01=02=03=04=05=06=\n"],
+      [["\a\b\v\f\r"],                    "=07=08=0B=0C=0D=\n"],
+      [["\x0e\x0f\x10\x11\x12\x13\x14"],  "=0E=0F=10=11=12=13=14=\n"],
+      [["\x15\x16\x17\x18\x19\x1a"],      "=15=16=17=18=19=1A=\n"],
+      [["\e"],                            "=1B=\n"],
+      [["\x1c\x1d\x1e\x1f"],              "=1C=1D=1E=1F=\n"]
+    ].should be_computed_by(:pack, "M")
+  end
+
+  it "encodes a tab followed by a newline with an encoded newline" do
+    ["\t\n"].pack("M").should == "\t=\n\n"
+  end
+
+  it "encodes 127..255 in hex format" do
+    [ [["\x7f\x80\x81\x82\x83\x84\x85\x86"], "=7F=80=81=82=83=84=85=86=\n"],
+      [["\x87\x88\x89\x8a\x8b\x8c\x8d\x8e"], "=87=88=89=8A=8B=8C=8D=8E=\n"],
+      [["\x8f\x90\x91\x92\x93\x94\x95\x96"], "=8F=90=91=92=93=94=95=96=\n"],
+      [["\x97\x98\x99\x9a\x9b\x9c\x9d\x9e"], "=97=98=99=9A=9B=9C=9D=9E=\n"],
+      [["\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6"], "=9F=A0=A1=A2=A3=A4=A5=A6=\n"],
+      [["\xa7\xa8\xa9\xaa\xab\xac\xad\xae"], "=A7=A8=A9=AA=AB=AC=AD=AE=\n"],
+      [["\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6"], "=AF=B0=B1=B2=B3=B4=B5=B6=\n"],
+      [["\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe"], "=B7=B8=B9=BA=BB=BC=BD=BE=\n"],
+      [["\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6"], "=BF=C0=C1=C2=C3=C4=C5=C6=\n"],
+      [["\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce"], "=C7=C8=C9=CA=CB=CC=CD=CE=\n"],
+      [["\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6"], "=CF=D0=D1=D2=D3=D4=D5=D6=\n"],
+      [["\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde"], "=D7=D8=D9=DA=DB=DC=DD=DE=\n"],
+      [["\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6"], "=DF=E0=E1=E2=E3=E4=E5=E6=\n"],
+      [["\xe7\xe8\xe9\xea\xeb\xec\xed\xee"], "=E7=E8=E9=EA=EB=EC=ED=EE=\n"],
+      [["\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6"], "=EF=F0=F1=F2=F3=F4=F5=F6=\n"],
+      [["\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe"], "=F7=F8=F9=FA=FB=FC=FD=FE=\n"],
+      [["\xff"], "=FF=\n"]
+    ].should be_computed_by(:pack, "M")
+  end
+
+  it "emits a soft line break when the output exceeds 72 characters when passed '*', 0, 1, or no count modifier" do
+    s1 = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+    r1 = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa=\na=\n"
+    s2 = "\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19"
+    r2 = "=19=19=19=19=19=19=19=19=19=19=19=19=19=19=19=19=19=19=19=19=19=19=19=19=19=\n=19=\n"
+    s3 = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\x15a"
+    r3 = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa=15=\na=\n"
+    s4 = "\x15aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\x15a"
+    r4 = "=15aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa=\na=15a=\n"
+
+    [ [[s1], "M",  r1],
+      [[s1], "M0", r1],
+      [[s1], "M1", r1],
+      [[s2], "M",  r2],
+      [[s2], "M0", r2],
+      [[s2], "M1", r2],
+      [[s3], "M",  r3],
+      [[s3], "M0", r3],
+      [[s3], "M1", r3],
+      [[s4], "M",  r4],
+      [[s4], "M0", r4],
+      [[s4], "M1", r4]
+    ].should be_computed_by(:pack)
+  end
+
+  it "emits a soft line break when the output exceeds count characters" do
+    [ [["abcdefghi"],        "M2", "abc=\ndef=\nghi=\n"],
+      [["abcdefghi"],        "M3", "abcd=\nefgh=\ni=\n"],
+      [["abcdefghi"],        "M4", "abcde=\nfghi=\n"],
+      [["abcdefghi"],        "M5", "abcdef=\nghi=\n"],
+      [["abcdefghi"],        "M6", "abcdefg=\nhi=\n"],
+      [["\x19\x19\x19\x19"], "M2", "=19=\n=19=\n=19=\n=19=\n"],
+      [["\x19\x19\x19\x19"], "M3", "=19=19=\n=19=19=\n"],
+      [["\x19\x19\x19\x19"], "M4", "=19=19=\n=19=19=\n"],
+      [["\x19\x19\x19\x19"], "M5", "=19=19=\n=19=19=\n"],
+      [["\x19\x19\x19\x19"], "M6", "=19=19=19=\n=19=\n"],
+      [["\x19\x19\x19\x19"], "M7", "=19=19=19=\n=19=\n"]
+    ].should be_computed_by(:pack)
+  end
+
+  it "encodes a recursive array" 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
+
+  it "calls #to_s to convert an object to a String" do
+    obj = mock("pack M string")
+    obj.should_receive(:to_s).and_return("packing")
+
+    [obj].pack("M").should == "packing=\n"
+  end
+
+  it "converts the object to a String representation if #to_s does not return a String" do
+    obj = mock("pack M non-string")
+    obj.should_receive(:to_s).and_return(2)
+
+    [obj].pack("M").should be_an_instance_of(String)
+  end
+
+  it "encodes a Symbol as a String" do
+    [:symbol].pack("M").should == "symbol=\n"
+  end
+
+  it "encodes an Integer as a String" do
+    [ [[1],             "1=\n"],
+      [[bignum_value],  "#{bignum_value}=\n"]
+    ].should be_computed_by(:pack, "M")
+  end
+
+  it "encodes a Float as a String" do
+    [1.0].pack("M").should == "1.0=\n"
+  end
+
+  ruby_bug "#3273", "1.8.7" do
+    it "converts Floats to the minimum unique representation" do
+      [1.0 / 3.0].pack("M").should == "0.3333333333333333=\n"
+    end
+  end
+
+  ruby_version_is "".."1.9" do
+    describe "with a multibyte $KCODE" do
+      before :each do
+        @kcode = $KCODE
+      end
+
+      after :each do
+        $KCODE = @kcode
+      end
+
+      it "encodes multibyte characters" do
+        $KCODE = "UTF8"
+        ["あ"].pack("M").should == "=E3=81=82=\n"
+      end
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "sets the output string to US-ASCII encoding" do
+      ["abcd"].pack("M").encoding.should == Encoding::US_ASCII
+    end
+  end
+end
+
+describe "Array#pack with format 'm'" do
+  it_behaves_like :array_pack_basic, 'm'
+  it_behaves_like :array_pack_basic_non_float, 'm'
+  it_behaves_like :array_pack_arguments, 'm'
+
+  it "encodes an empty string as an empty string" do
+    [""].pack("m").should == ""
+  end
+
+  it "appends a newline to the end of the encoded string" do
+    ["a"].pack("m").should == "YQ==\n"
+  end
+
+  it "encodes one element per directive" do
+    ["abc", "DEF"].pack("mm").should == "YWJj\nREVG\n"
+  end
+
+  it "encodes 1, 2, or 3 characters in 4 output characters (Base64 encoding)" do
+    [ [["a"],       "YQ==\n"],
+      [["ab"],      "YWI=\n"],
+      [["abc"],     "YWJj\n"],
+      [["abcd"],    "YWJjZA==\n"],
+      [["abcde"],   "YWJjZGU=\n"],
+      [["abcdef"],  "YWJjZGVm\n"],
+      [["abcdefg"], "YWJjZGVmZw==\n"],
+    ].should be_computed_by(:pack, "m")
+  end
+
+  it "emits a newline after complete groups of count / 3 input characters when passed a count modifier" do
+    ["abcdefg"].pack("m3").should == "YWJj\nZGVm\nZw==\n"
+  end
+
+  it "implicitly has a count of 45 when passed '*', 1, 2 or no count modifier" do
+    s = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+    r = "YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh\nYWFhYWE=\n"
+    [ [[s], "m", r],
+      [[s], "m*", r],
+      [[s], "m1", r],
+      [[s], "m2", r],
+    ].should be_computed_by(:pack)
+  end
+
+  it "encodes all ascii characters" do
+    [ [["\x00\x01\x02\x03\x04\x05\x06"],          "AAECAwQFBg==\n"],
+      [["\a\b\t\n\v\f\r"],                        "BwgJCgsMDQ==\n"],
+      [["\x0E\x0F\x10\x11\x12\x13\x14\x15\x16"],  "Dg8QERITFBUW\n"],
+      [["\x17\x18\x19\x1a\e\x1c\x1d\x1e\x1f"],    "FxgZGhscHR4f\n"],
+      [["!\"\#$%&'()*+,-./"],                     "ISIjJCUmJygpKissLS4v\n"],
+      [["0123456789"],                            "MDEyMzQ1Njc4OQ==\n"],
+      [[":;<=>?@"],                               "Ojs8PT4/QA==\n"],
+      [["ABCDEFGHIJKLMNOPQRSTUVWXYZ"],            "QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVo=\n"],
+      [["[\\]^_`"],                               "W1xdXl9g\n"],
+      [["abcdefghijklmnopqrstuvwxyz"],            "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo=\n"],
+      [["{|}~"],                                  "e3x9fg==\n"],
+      [["\x7f\xc2\x80\xc2\x81\xc2\x82\xc2\x83"],  "f8KAwoHCgsKD\n"],
+      [["\xc2\x84\xc2\x85\xc2\x86\xc2\x87\xc2"],  "woTChcKGwofC\n"],
+      [["\x88\xc2\x89\xc2\x8a\xc2\x8b\xc2\x8c"],  "iMKJworCi8KM\n"],
+      [["\xc2\x8d\xc2\x8e\xc2\x8f\xc2\x90\xc2"],  "wo3CjsKPwpDC\n"],
+      [["\x91\xc2\x92\xc2\x93\xc2\x94\xc2\x95"],  "kcKSwpPClMKV\n"],
+      [["\xc2\x96\xc2\x97\xc2\x98\xc2\x99\xc2"],  "wpbCl8KYwpnC\n"],
+      [["\x9a\xc2\x9b\xc2\x9c\xc2\x9d\xc2\x9e"],  "msKbwpzCncKe\n"],
+      [["\xc2\x9f\xc2\xa0\xc2\xa1\xc2\xa2\xc2"],  "wp/CoMKhwqLC\n"],
+      [["\xa3\xc2\xa4\xc2\xa5\xc2\xa6\xc2\xa7"],  "o8KkwqXCpsKn\n"],
+      [["\xc2\xa8\xc2\xa9\xc2\xaa\xc2\xab\xc2"],  "wqjCqcKqwqvC\n"],
+      [["\xac\xc2\xad\xc2\xae\xc2\xaf\xc2\xb0"],  "rMKtwq7Cr8Kw\n"],
+      [["\xc2\xb1\xc2\xb2\xc2\xb3\xc2\xb4\xc2"],  "wrHCssKzwrTC\n"],
+      [["\xb5\xc2\xb6\xc2\xb7\xc2\xb8\xc2\xb9"],  "tcK2wrfCuMK5\n"],
+      [["\xc2\xba\xc2\xbb\xc2\xbc\xc2\xbd\xc2"],  "wrrCu8K8wr3C\n"],
+      [["\xbe\xc2\xbf\xc3\x80\xc3\x81\xc3\x82"],  "vsK/w4DDgcOC\n"],
+      [["\xc3\x83\xc3\x84\xc3\x85\xc3\x86\xc3"],  "w4PDhMOFw4bD\n"],
+      [["\x87\xc3\x88\xc3\x89\xc3\x8a\xc3\x8b"],  "h8OIw4nDisOL\n"],
+      [["\xc3\x8c\xc3\x8d\xc3\x8e\xc3\x8f\xc3"],  "w4zDjcOOw4/D\n"],
+      [["\x90\xc3\x91\xc3\x92\xc3\x93\xc3\x94"],  "kMORw5LDk8OU\n"],
+      [["\xc3\x95\xc3\x96\xc3\x97\xc3\x98\xc3"],  "w5XDlsOXw5jD\n"],
+      [["\x99\xc3\x9a\xc3\x9b\xc3\x9c\xc3\x9d"],  "mcOaw5vDnMOd\n"],
+      [["\xc3\x9e\xc3\x9f\xc3\xa0\xc3\xa1\xc3"],  "w57Dn8Ogw6HD\n"],
+      [["\xa2\xc3\xa3\xc3\xa4\xc3\xa5\xc3\xa6"],  "osOjw6TDpcOm\n"],
+      [["\xc3\xa7\xc3\xa8\xc3\xa9\xc3\xaa\xc3"],  "w6fDqMOpw6rD\n"],
+      [["\xab\xc3\xac\xc3\xad\xc3\xae\xc3\xaf"],  "q8Osw63DrsOv\n"],
+      [["\xc3\xb0\xc3\xb1\xc3\xb2\xc3\xb3\xc3"],  "w7DDscOyw7PD\n"],
+      [["\xb4\xc3\xb5\xc3\xb6\xc3\xb7\xc3\xb8"],  "tMO1w7bDt8O4\n"],
+      [["\xc3\xb9\xc3\xba\xc3\xbb\xc3\xbc\xc3"],  "w7nDusO7w7zD\n"],
+      [["\xbd\xc3\xbe\xc3\xbf"],                  "vcO+w78=\n"]
+    ].should be_computed_by(:pack, "m")
+  end
+
+  it "calls #to_str to convert an object to a String" do
+    obj = mock("pack m string")
+    obj.should_receive(:to_str).and_return("abc")
+    [obj].pack("m").should == "YWJj\n"
+  end
+
+  it "raises a TypeError if #to_str does not return a String" do
+    obj = mock("pack m non-string")
+    lambda { [obj].pack("m") }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError if passed nil" do
+    lambda { [nil].pack("m") }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError if passed an Integer" do
+    lambda { [0].pack("m") }.should raise_error(TypeError)
+    lambda { [bignum_value].pack("m") }.should raise_error(TypeError)
+  end
+
+  ruby_version_is ""..."1.9" do
+    it "emits a newline after 45 characters if passed zero as the count modifier" do
+      s = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+      r = "YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh\nYWFhYWE=\n"
+      [s].pack("m0").should == r
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "does not emit a newline if passed zero as the count modifier" do
+      s = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+      r = "YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWE="
+      [s].pack("m0").should == r
+    end
+
+    it "sets the output string to US-ASCII encoding" do
+      ["abcd"].pack("m").encoding.should == Encoding::US_ASCII
+    end
+  end
+end

Modified: MacRuby/trunk/spec/frozen/core/array/pack/n_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/pack/n_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/pack/n_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -6,12 +6,20 @@
 
 describe "Array#pack with format 'N'" do
   it_behaves_like :array_pack_basic, 'N'
+  it_behaves_like :array_pack_basic_non_float, 'N'
+  it_behaves_like :array_pack_arguments, 'N'
   it_behaves_like :array_pack_numeric_basic, 'N'
+  it_behaves_like :array_pack_integer, 'N'
+  it_behaves_like :array_pack_no_platform, 'N'
   it_behaves_like :array_pack_32bit_be, 'N'
 end
 
 describe "Array#pack with format 'n'" do
   it_behaves_like :array_pack_basic, 'n'
+  it_behaves_like :array_pack_basic_non_float, 'n'
+  it_behaves_like :array_pack_arguments, 'n'
   it_behaves_like :array_pack_numeric_basic, 'n'
+  it_behaves_like :array_pack_integer, 'n'
+  it_behaves_like :array_pack_no_platform, 'n'
   it_behaves_like :array_pack_16bit_be, 'n'
 end

Added: MacRuby/trunk/spec/frozen/core/array/pack/percent_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/pack/percent_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/array/pack/percent_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,7 @@
+require File.expand_path('../../../../spec_helper', __FILE__)
+
+describe "Array#pack with format '%'" do
+  it "raises an Argument Error" do
+    lambda { [1].pack("%") }.should raise_error(ArgumentError)
+  end
+end

Modified: MacRuby/trunk/spec/frozen/core/array/pack/q_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/pack/q_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/pack/q_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -6,12 +6,20 @@
 
 describe "Array#pack with format 'Q'" do
   it_behaves_like :array_pack_basic, 'Q'
+  it_behaves_like :array_pack_basic_non_float, 'Q'
+  it_behaves_like :array_pack_arguments, 'Q'
   it_behaves_like :array_pack_numeric_basic, 'Q'
+  it_behaves_like :array_pack_integer, 'Q'
+  it_behaves_like :array_pack_no_platform, 'Q'
 end
 
 describe "Array#pack with format 'q'" do
   it_behaves_like :array_pack_basic, 'q'
+  it_behaves_like :array_pack_basic_non_float, 'q'
+  it_behaves_like :array_pack_arguments, 'q'
   it_behaves_like :array_pack_numeric_basic, 'q'
+  it_behaves_like :array_pack_integer, 'q'
+  it_behaves_like :array_pack_no_platform, 'q'
 end
 
 little_endian do

Modified: MacRuby/trunk/spec/frozen/core/array/pack/s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/pack/s_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/pack/s_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -6,12 +6,18 @@
 
 describe "Array#pack with format 'S'" do
   it_behaves_like :array_pack_basic, 'S'
+  it_behaves_like :array_pack_basic_non_float, 'S'
+  it_behaves_like :array_pack_arguments, 'S'
   it_behaves_like :array_pack_numeric_basic, 'S'
+  it_behaves_like :array_pack_integer, 'S'
 end
 
 describe "Array#pack with format 's'" do
   it_behaves_like :array_pack_basic, 's'
+  it_behaves_like :array_pack_basic_non_float, 's'
+  it_behaves_like :array_pack_arguments, 's'
   it_behaves_like :array_pack_numeric_basic, 's'
+  it_behaves_like :array_pack_integer, 's'
 end
 
 little_endian do

Modified: MacRuby/trunk/spec/frozen/core/array/pack/shared/basic.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/pack/shared/basic.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/pack/shared/basic.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,9 +1,51 @@
-describe :array_pack_basic, :shared => true do
+describe :array_pack_arguments, :shared => true do
   it "raises an ArgumentError if there are fewer elements than the format requires" do
     lambda { [].pack(pack_format(1)) }.should raise_error(ArgumentError)
   end
 end
 
+describe :array_pack_basic, :shared => true do
+  before :each do
+    @obj = ArraySpecs.universal_pack_object
+  end
+
+  it "raises a TypeError when passed nil" do
+    lambda { [@obj].pack(nil) }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError when passed an Integer" do
+    lambda { [@obj].pack(1) }.should raise_error(TypeError)
+  end
+end
+
+describe :array_pack_basic_non_float, :shared => true do
+  before :each do
+    @obj = ArraySpecs.universal_pack_object
+  end
+
+  it "calls #to_str to coerce the directives string" do
+    d = mock("pack directive")
+    d.should_receive(:to_str).and_return("x"+pack_format)
+    [@obj, @obj].pack(d).should be_an_instance_of(String)
+  end
+
+  it "taints the output string if the format string is tainted" do
+    [@obj, @obj].pack("x"+pack_format.taint).tainted?.should be_true
+  end
+end
+
+describe :array_pack_basic_float, :shared => true do
+  it "calls #to_str to coerce the directives string" do
+    d = mock("pack directive")
+    d.should_receive(:to_str).and_return("x"+pack_format)
+    [1.2, 4.7].pack(d).should be_an_instance_of(String)
+  end
+
+  it "taints the output string if the format string is tainted" do
+    [3.2, 2.8].pack("x"+pack_format.taint).tainted?.should be_true
+  end
+end
+
 describe :array_pack_no_platform, :shared => true do
   it "raises ArgumentError when the format modifier is '_'" do
     lambda{ [1].pack(pack_format("_")) }.should raise_error(ArgumentError)

Added: MacRuby/trunk/spec/frozen/core/array/pack/shared/encodings.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/pack/shared/encodings.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/array/pack/shared/encodings.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,16 @@
+describe :array_pack_hex, :shared => true do
+  it "encodes no bytes when passed zero as the count modifier" do
+    ["abc"].pack(pack_format(0)).should == ""
+  end
+
+  it "raises a TypeError if the object does not respond to #to_str" do
+    obj = mock("pack hex non-string")
+    lambda { [obj].pack(pack_format) }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError if #to_str does not return a String" do
+    obj = mock("pack hex non-string")
+    obj.should_receive(:to_str).and_return(1)
+    lambda { [obj].pack(pack_format) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/trunk/spec/frozen/core/array/pack/shared/float.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/pack/shared/float.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/array/pack/shared/float.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,277 @@
+# -*- encoding: ascii-8bit -*-
+
+describe :array_pack_float_le, :shared => true do
+  it "encodes a positive Float" do
+    [1.42].pack(pack_format).should == "\x8f\xc2\xb5?"
+  end
+
+  it "encodes a negative Float" do
+    [-34.2].pack(pack_format).should == "\xcd\xcc\x08\xc2"
+  end
+
+  it "converts an Integer to a Float" do
+    [8].pack(pack_format).should == "\x00\x00\x00A"
+  end
+
+  ruby_version_is ""..."1.9" do
+    it "converts a String representation of a floating point number to a Float" do
+      ["13"].pack(pack_format).should == "\x00\x00PA"
+    end
+
+    it "calls #to_f to convert an object to a float" do
+      obj = mock("pack float")
+      obj.should_receive(:to_f).and_return(7.2)
+
+      [obj].pack(pack_format).should == "ff\xe6@"
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "raises a TypeError if passed a String representation of a floating point number" do
+      lambda { ["13"].pack(pack_format) }.should raise_error(TypeError)
+    end
+  end
+
+  it "encodes the number of array elements specified by the count modifier" do
+    [2.9, 1.4, 8.2].pack(pack_format(nil, 2)).should == "\x9a\x999 at 33\xb3?"
+  end
+
+  it "encodes all remaining elements when passed the '*' modifier" do
+    [2.9, 1.4, 8.2].pack(pack_format("*")).should == "\x9a\x999 at 33\xb3?33\x03A"
+  end
+
+  it "ignores NULL bytes between directives" do
+    [5.3, 9.2].pack(pack_format("\000", 2)).should == "\x9a\x99\xa9 at 33\x13A"
+  end
+
+  it "ignores spaces between directives" do
+    [5.3, 9.2].pack(pack_format(" ", 2)).should == "\x9a\x99\xa9 at 33\x13A"
+  end
+
+  it "encodes positive Infinity" do
+    [infinity_value].pack(pack_format).should == "\x00\x00\x80\x7f"
+  end
+
+  it "encodes negative Infinity" do
+    [-infinity_value].pack(pack_format).should == "\x00\x00\x80\xff"
+  end
+
+  it "encodes NaN" do
+    [nan_value].pack(pack_format).should == "\x00\x00\xc0\xff"
+  end
+
+  it "encodes a positive Float outside the range of a single precision float" do
+    [1e150].pack(pack_format).should == "\x00\x00\x80\x7f"
+  end
+
+  it "encodes a negative Float outside the range of a single precision float" do
+    [-1e150].pack(pack_format).should == "\x00\x00\x80\xff"
+  end
+end
+
+describe :array_pack_float_be, :shared => true do
+  it "encodes a positive Float" do
+    [1.42].pack(pack_format).should == "?\xb5\xc2\x8f"
+  end
+
+  it "encodes a negative Float" do
+    [-34.2].pack(pack_format).should == "\xc2\x08\xcc\xcd"
+  end
+
+  it "converts an Integer to a Float" do
+    [8].pack(pack_format).should == "A\x00\x00\x00"
+  end
+
+  ruby_version_is ""..."1.9" do
+    it "converts a String representation of a floating point number to a Float" do
+      ["13"].pack(pack_format).should == "AP\x00\x00"
+    end
+
+    it "calls #to_f to convert an object to a float" do
+      obj = mock("pack float")
+      obj.should_receive(:to_f).and_return(7.2)
+
+      [obj].pack(pack_format).should == "@\xe6ff"
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "raises a TypeError if passed a String representation of a floating point number" do
+      lambda { ["13"].pack(pack_format) }.should raise_error(TypeError)
+    end
+  end
+
+  it "encodes the number of array elements specified by the count modifier" do
+    [2.9, 1.4, 8.2].pack(pack_format(nil, 2)).should == "@9\x99\x9a?\xb333"
+  end
+
+  it "encodes all remaining elements when passed the '*' modifier" do
+    [2.9, 1.4, 8.2].pack(pack_format("*")).should == "@9\x99\x9a?\xb333A\x0333"
+  end
+
+  it "ignores NULL bytes between directives" do
+    [5.3, 9.2].pack(pack_format("\000", 2)).should == "@\xa9\x99\x9aA\x1333"
+  end
+
+  it "ignores spaces between directives" do
+    [5.3, 9.2].pack(pack_format(" ", 2)).should == "@\xa9\x99\x9aA\x1333"
+  end
+
+  it "encodes positive Infinity" do
+    [infinity_value].pack(pack_format).should == "\x7f\x80\x00\x00"
+  end
+
+  it "encodes negative Infinity" do
+    [-infinity_value].pack(pack_format).should == "\xff\x80\x00\x00"
+  end
+
+  it "encodes NaN" do
+    [nan_value].pack(pack_format).should == "\xff\xc0\x00\x00"
+  end
+
+  it "encodes a positive Float outside the range of a single precision float" do
+    [1e150].pack(pack_format).should == "\x7f\x80\x00\x00"
+  end
+
+  it "encodes a negative Float outside the range of a single precision float" do
+    [-1e150].pack(pack_format).should == "\xff\x80\x00\x00"
+  end
+end
+
+describe :array_pack_double_le, :shared => true do
+  it "encodes a positive Float" do
+    [1.42].pack(pack_format).should == "\xb8\x1e\x85\xebQ\xb8\xf6?"
+  end
+
+  it "encodes a negative Float" do
+    [-34.2].pack(pack_format).should == "\x9a\x99\x99\x99\x99\x19A\xc0"
+  end
+
+  it "converts an Integer to a Float" do
+    [8].pack(pack_format).should == "\x00\x00\x00\x00\x00\x00\x20@"
+  end
+
+  ruby_version_is ""..."1.9" do
+    it "converts a String representation of a floating point number to a Float" do
+      ["13"].pack(pack_format).should == "\x00\x00\x00\x00\x00\x00\x2a@"
+    end
+
+    it "calls #to_f to convert an object to a float" do
+      obj = mock("pack float")
+      obj.should_receive(:to_f).and_return(7.2)
+
+      [obj].pack(pack_format).should == "\xcd\xcc\xcc\xcc\xcc\xcc\x1c@"
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "raises a TypeError if passed a String representation of a floating point number" do
+      lambda { ["13"].pack(pack_format) }.should raise_error(TypeError)
+    end
+  end
+
+  it "encodes the number of array elements specified by the count modifier" do
+    [2.9, 1.4, 8.2].pack(pack_format(nil, 2)).should == "333333\x07 at ffffff\xf6?"
+  end
+
+  it "encodes all remaining elements when passed the '*' modifier" do
+    [2.9, 1.4, 8.2].pack(pack_format("*")).should == "333333\x07 at ffffff\xf6?ffffff\x20@"
+  end
+
+  it "ignores NULL bytes between directives" do
+    [5.3, 9.2].pack(pack_format("\000", 2)).should == "333333\x15 at ffffff\x22@"
+  end
+
+  it "ignores spaces between directives" do
+    [5.3, 9.2].pack(pack_format(" ", 2)).should == "333333\x15 at ffffff\x22@"
+  end
+
+  it "encodes positive Infinity" do
+    [infinity_value].pack(pack_format).should == "\x00\x00\x00\x00\x00\x00\xf0\x7f"
+  end
+
+  it "encodes negative Infinity" do
+    [-infinity_value].pack(pack_format).should == "\x00\x00\x00\x00\x00\x00\xf0\xff"
+  end
+
+  it "encodes NaN" do
+    [nan_value].pack(pack_format).should == "\x00\x00\x00\x00\x00\x00\xf8\xff"
+  end
+
+  it "encodes a positive Float outside the range of a single precision float" do
+    [1e150].pack(pack_format).should == "\xaf\x96P\x2e5\x8d\x13_"
+  end
+
+  it "encodes a negative Float outside the range of a single precision float" do
+    [-1e150].pack(pack_format).should == "\xaf\x96P\x2e5\x8d\x13\xdf"
+  end
+end
+
+describe :array_pack_double_be, :shared => true do
+  it "encodes a positive Float" do
+    [1.42].pack(pack_format).should == "?\xf6\xb8Q\xeb\x85\x1e\xb8"
+  end
+
+  it "encodes a negative Float" do
+    [-34.2].pack(pack_format).should == "\xc0A\x19\x99\x99\x99\x99\x9a"
+  end
+
+  it "converts an Integer to a Float" do
+    [8].pack(pack_format).should == "@\x20\x00\x00\x00\x00\x00\x00"
+  end
+
+  ruby_version_is ""..."1.9" do
+    it "converts a String representation of a floating point number to a Float" do
+      ["13"].pack(pack_format).should == "@\x2a\x00\x00\x00\x00\x00\x00"
+    end
+
+    it "calls #to_f to convert an object to a float" do
+      obj = mock("pack float")
+      obj.should_receive(:to_f).and_return(7.2)
+
+      [obj].pack(pack_format).should == "@\x1c\xcc\xcc\xcc\xcc\xcc\xcd"
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "raises a TypeError if passed a String representation of a floating point number" do
+      lambda { ["13"].pack(pack_format) }.should raise_error(TypeError)
+    end
+  end
+
+  it "encodes the number of array elements specified by the count modifier" do
+    [2.9, 1.4, 8.2].pack(pack_format(nil, 2)).should == "@\x07333333?\xf6ffffff"
+  end
+
+  it "encodes all remaining elements when passed the '*' modifier" do
+    [2.9, 1.4, 8.2].pack(pack_format("*")).should == "@\x07333333?\xf6ffffff@\x20ffffff"
+  end
+
+  it "ignores NULL bytes between directives" do
+    [5.3, 9.2].pack(pack_format("\000", 2)).should == "@\x15333333@\x22ffffff"
+  end
+
+  it "ignores spaces between directives" do
+    [5.3, 9.2].pack(pack_format(" ", 2)).should == "@\x15333333@\x22ffffff"
+  end
+
+  it "encodes positive Infinity" do
+    [infinity_value].pack(pack_format).should == "\x7f\xf0\x00\x00\x00\x00\x00\x00"
+  end
+
+  it "encodes negative Infinity" do
+    [-infinity_value].pack(pack_format).should == "\xff\xf0\x00\x00\x00\x00\x00\x00"
+  end
+
+  it "encodes NaN" do
+    [nan_value].pack(pack_format).should == "\xff\xf8\x00\x00\x00\x00\x00\x00"
+  end
+
+  it "encodes a positive Float outside the range of a single precision float" do
+    [1e150].pack(pack_format).should == "_\x13\x8d5\x2eP\x96\xaf"
+  end
+
+  it "encodes a negative Float outside the range of a single precision float" do
+    [-1e150].pack(pack_format).should == "\xdf\x13\x8d5\x2eP\x96\xaf"
+  end
+end

Modified: MacRuby/trunk/spec/frozen/core/array/pack/shared/numeric_basic.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/pack/shared/numeric_basic.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/pack/shared/numeric_basic.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -3,15 +3,18 @@
     [1].pack(pack_format(0)).should == ""
   end
 
-  it "raises a TypeError when passed a String" do
-    lambda { ["5"].pack(pack_format) }.should raise_error(TypeError)
+  it "raises a TypeError when passed nil" do
+    lambda { [nil].pack(pack_format) }.should raise_error(TypeError)
   end
 
-  it "raises a TypeError when the object does not respond to #to_int" do
-    obj = mock('not an integer')
-    lambda { [obj].pack(pack_format) }.should raise_error(TypeError)
+  it "raises a TypeError when passed true" do
+    lambda { [true].pack(pack_format) }.should raise_error(TypeError)
   end
 
+  it "raises a TypeError when passed false" do
+    lambda { [false].pack(pack_format) }.should raise_error(TypeError)
+  end
+
   ruby_version_is '1.9' do
     it "returns an ASCII-8BIT string" do
       [0xFF].pack(pack_format).encoding.should == Encoding::ASCII_8BIT
@@ -19,3 +22,33 @@
     end
   end
 end
+
+describe :array_pack_integer, :shared => true do
+  it "raises a TypeError when the object does not respond to #to_int" do
+    obj = mock('not an integer')
+    lambda { [obj].pack(pack_format) }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError when passed a String" do
+    lambda { ["5"].pack(pack_format) }.should raise_error(TypeError)
+  end
+end
+
+describe :array_pack_float, :shared => true do
+  ruby_version_is ""..."1.9" do
+    it "raises a ArgumentError if a String does not represent a floating point number" do
+      lambda { ["a"].pack(pack_format) }.should raise_error(ArgumentError)
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "raises a TypeError if a String does not represent a floating point number" do
+      lambda { ["a"].pack(pack_format) }.should raise_error(TypeError)
+    end
+  end
+
+  it "raises a TypeError when the object does not respond to #to_f" do
+    obj = mock('not an float')
+    lambda { [obj].pack(pack_format) }.should raise_error(TypeError)
+  end
+end

Added: MacRuby/trunk/spec/frozen/core/array/pack/shared/string.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/pack/shared/string.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/array/pack/shared/string.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,83 @@
+describe :array_pack_string, :shared => true do
+  it "adds count bytes of a String to the output" do
+    ["abc"].pack(pack_format(2)).should == "ab"
+  end
+
+  it "implicitly has a count of one when no count is specified" do
+    ["abc"].pack(pack_format).should == "a"
+  end
+
+  it "does not add any bytes when the count is zero" do
+    ["abc"].pack(pack_format(0)).should == ""
+  end
+
+  it "is not affected by a previous count modifier" do
+    ["abcde", "defg"].pack(pack_format(3)+pack_format).should == "abcd"
+  end
+
+  it "raises an ArgumentError when the Array is empty" do
+    lambda { [].pack(pack_format) }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError when the Array has too few elements" do
+    lambda { ["a"].pack(pack_format(nil, 2)) }.should raise_error(ArgumentError)
+  end
+
+  it "calls #to_str to convert the element to a String" do
+    obj = mock('pack string')
+    obj.should_receive(:to_str).and_return("abc")
+
+    [obj].pack(pack_format).should == "a"
+  end
+
+  it "raises a TypeError when the object does not respond to #to_str" do
+    obj = mock("not a string")
+    lambda { [obj].pack(pack_format) }.should raise_error(TypeError)
+  end
+
+  it "returns a tainted string when a pack argument is tainted" do
+    ["abcd".taint, 0x20].pack(pack_format("3C")).tainted?.should be_true
+  end
+
+  it "does not return a tainted string when the array is tainted" do
+    ["abcd", 0x20].taint.pack(pack_format("3C")).tainted?.should be_false
+  end
+
+  ruby_version_is "1.8.8" do
+    it "returns a tainted string when the format is tainted" do
+      ["abcd", 0x20].pack(pack_format("3C").taint).tainted?.should be_true
+    end
+
+    it "returns a tainted string when an empty format is tainted" do
+      ["abcd", 0x20].pack("".taint).tainted?.should be_true
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "returns a untrusted string when the format is untrusted" do
+      ["abcd", 0x20].pack(pack_format("3C").untrust).untrusted?.should be_true
+    end
+
+    it "returns a untrusted string when the empty format is untrusted" 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(pack_format("3C")).untrusted?.should be_true
+    end
+
+    it "returns a trusted string when the array is untrusted" do
+      ["abcd", 0x20].untrust.pack(pack_format("3C")).untrusted?.should be_false
+    end
+
+    it "returns a string in encoding of common to the concatenated results" do
+      f = pack_format("*")
+      [ [["\u{3042 3044 3046 3048}", 0x2000B].pack(f+"U"),       Encoding::ASCII_8BIT],
+        [["abcde\xd1", "\xFF\xFe\x81\x82"].pack(f+"u"),          Encoding::ASCII_8BIT],
+        [[encode("a", "ascii"), "\xFF\xFe\x81\x82"].pack(f+"u"), Encoding::ASCII_8BIT],
+        # under discussion [ruby-dev:37294]
+        [["\u{3042 3044 3046 3048}", 1].pack(f+"N"),             Encoding::ASCII_8BIT]
+      ].should be_computed_by(:encoding)
+    end
+  end
+end

Added: MacRuby/trunk/spec/frozen/core/array/pack/shared/unicode.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/pack/shared/unicode.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/array/pack/shared/unicode.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,89 @@
+# -*- encoding: utf-8 -*-
+
+describe :array_pack_unicode, :shared => true do
+  it "encodes ASCII values as a Unicode codepoint" do
+    [ [[0],   "\x00"],
+      [[1],   "\x01"],
+      [[8],   "\x08"],
+      [[15],  "\x0f"],
+      [[24],  "\x18"],
+      [[31],  "\x1f"],
+      [[127], "\x7f"],
+      [[128], "\xc2\x80"],
+      [[129], "\xc2\x81"],
+      [[255], "\xc3\xbf"]
+    ].should be_computed_by(:pack, "U")
+  end
+
+  it "encodes UTF-8 BMP codepoints" do
+    [ [[0x80],    "\xc2\x80"],
+      [[0x7ff],   "\xdf\xbf"],
+      [[0x800],   "\xe0\xa0\x80"],
+      [[0xffff],  "\xef\xbf\xbf"]
+    ].should be_computed_by(:pack, "U")
+  end
+
+  it "encodes UTF-8 max codepoints" do
+    [ [[0x10000],   "\xf0\x90\x80\x80"],
+      [[0xfffff],   "\xf3\xbf\xbf\xbf"],
+      [[0x100000],  "\xf4\x80\x80\x80"],
+      [[0x10ffff],  "\xf4\x8f\xbf\xbf"]
+    ].should be_computed_by(:pack, "U")
+  end
+
+  it "encodes values larger than UTF-8 max codepoints" do
+    [ [[0x00110000], "\xf4\x90\x80\x80"],
+      [[0x04000000], "\xfc\x84\x80\x80\x80\x80"],
+      [[0x7FFFFFFF], "\xfd\xbf\xbf\xbf\xbf\xbf"]
+    ].should be_computed_by(:pack, "U")
+  end
+
+  it "encodes the number of array elements specified by the count modifier" do
+    [ [[0x41, 0x42, 0x43, 0x44], "U2",  "\x41\x42"],
+      [[0x41, 0x42, 0x43, 0x44], "U2U", "\x41\x42\x43"]
+    ].should be_computed_by(:pack)
+  end
+
+  it "encodes all remaining elements when passed the '*' modifier" do
+    [0x41, 0x42, 0x43, 0x44].pack("U*").should == "\x41\x42\x43\x44"
+  end
+
+  it "calls #to_int to convert the pack argument to an Integer" do
+    obj = mock('to_int')
+    obj.should_receive(:to_int).and_return(5)
+    [obj].pack("U").should == "\x05"
+  end
+
+  it "raises a TypeError if #to_int does not return an Integer" do
+    obj = mock('to_int')
+    obj.should_receive(:to_int).and_return("5")
+    lambda { [obj].pack("U") }.should raise_error(TypeError)
+  end
+
+  it "ignores NULL bytes between directives" do
+    [1, 2, 3].pack("U\x00U").should == "\x01\x02"
+  end
+
+  it "ignores spaces between directives" do
+    [1, 2, 3].pack("U U").should == "\x01\x02"
+  end
+
+  it "raises a RangeError if passed a negative number" do
+    lambda { [-1].pack("U") }.should raise_error(RangeError)
+  end
+
+  it "raises a RangeError if passed a number larger than an unsigned 32-bit integer" do
+    lambda { [2**32].pack("U") }.should raise_error(RangeError)
+  end
+
+  ruby_version_is "1.9" do
+    it "sets the output string to UTF-8 encoding" do
+      [ [[0x00].pack("U"),     Encoding::UTF_8],
+        [[0x41].pack("U"),     Encoding::UTF_8],
+        [[0x7F].pack("U"),     Encoding::UTF_8],
+        [[0x80].pack("U"),     Encoding::UTF_8],
+        [[0x10FFFF].pack("U"), Encoding::UTF_8]
+      ].should be_computed_by(:encoding)
+    end
+  end
+end

Added: MacRuby/trunk/spec/frozen/core/array/pack/u_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/pack/u_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/array/pack/u_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,130 @@
+# -*- encoding: ascii-8bit -*-
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+require File.expand_path('../shared/basic', __FILE__)
+require File.expand_path('../shared/unicode', __FILE__)
+
+describe "Array#pack with format 'U'" do
+  it_behaves_like :array_pack_basic, 'U'
+  it_behaves_like :array_pack_basic_non_float, 'U'
+  it_behaves_like :array_pack_arguments, 'U'
+  it_behaves_like :array_pack_unicode, 'U'
+end
+
+describe "Array#pack with format 'u'" do
+  it_behaves_like :array_pack_basic, 'u'
+  it_behaves_like :array_pack_basic_non_float, 'u'
+  it_behaves_like :array_pack_arguments, 'u'
+
+  it "encodes an empty string as an empty string" do
+    [""].pack("u").should == ""
+  end
+
+  it "appends a newline to the end of the encoded string" do
+    ["a"].pack("u").should == "!80``\n"
+  end
+
+  it "encodes one element per directive" do
+    ["abc", "DEF"].pack("uu").should == "#86)C\n#1$5&\n"
+  end
+
+  it "prepends the length of each segment of the input string as the first character (+32) in each line of the output" do
+    ["abcdefghijklm"].pack("u7").should == "&86)C9&5F\n&9VAI:FML\n!;0``\n"
+  end
+
+  it "encodes 1, 2, or 3 characters in 4 output characters (uuencoding)" do
+    [ [["a"],       "!80``\n"],
+      [["ab"],      "\"86(`\n"],
+      [["abc"],     "#86)C\n"],
+      [["abcd"],    "$86)C9```\n"],
+      [["abcde"],   "%86)C9&4`\n"],
+      [["abcdef"],  "&86)C9&5F\n"],
+      [["abcdefg"], "'86)C9&5F9P``\n"],
+    ].should be_computed_by(:pack, "u")
+  end
+
+  it "emits a newline after complete groups of count / 3 input characters when passed a count modifier" do
+    ["abcdefg"].pack("u3").should == "#86)C\n#9&5F\n!9P``\n"
+  end
+
+  it "implicitly has a count of 45 when passed '*', 0, 1, 2 or no count modifier" do
+    s = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+    r = "M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A\n%86%A86$`\n"
+    [ [[s], "u", r],
+      [[s], "u*", r],
+      [[s], "u0", r],
+      [[s], "u1", r],
+      [[s], "u2", r],
+    ].should be_computed_by(:pack)
+  end
+
+  it "encodes all ascii characters" do
+    [ [["\x00\x01\x02\x03\x04\x05\x06"],          "'``$\"`P0%!@``\n"],
+      [["\a\b\t\n\v\f\r"],                        "'!P@)\"@L,#0``\n"],
+      [["\x0E\x0F\x10\x11\x12\x13\x14\x15\x16"],  ")\#@\\0$1(3%!46\n"],
+      [["\x17\x18\x19\x1a\e\x1c\x1d\x1e\x1f"],    ")%Q at 9&AL<'1X?\n"],
+      [["!\"\#$%&'()*+,-./"],                     "/(2(C)\"4F)R at I*BLL+2XO\n"],
+      [["0123456789"],                            "*,\#$R,S0U-C<X.0``\n"],
+      [[":;<=>?@"],                               "'.CL\\/3X_0```\n"],
+      [["ABCDEFGHIJKLMNOPQRSTUVWXYZ"],            ":04)#1$5&1TA)2DM,34Y/4%%24U155E=865H`\n"],
+      [["[\\]^_`"],                               "&6UQ=7E]@\n"],
+      [["abcdefghijklmnopqrstuvwxyz"],            ":86)C9&5F9VAI:FML;6YO<'%R<W1U=G=X>7H`\n"],
+      [["{|}~"],                                  "$>WQ]?@``\n"],
+      [["\x7f\xc2\x80\xc2\x81\xc2\x82\xc2\x83"],  ")?\\*`PH'\"@L*#\n"],
+      [["\xc2\x84\xc2\x85\xc2\x86\xc2\x87\xc2"],  ")PH3\"A<*&PH?\"\n"],
+      [["\x88\xc2\x89\xc2\x8a\xc2\x8b\xc2\x8c"],  ")B,*)PHK\"B\\*,\n"],
+      [["\xc2\x8d\xc2\x8e\xc2\x8f\xc2\x90\xc2"],  ")PHW\"CL*/PI#\"\n"],
+      [["\x91\xc2\x92\xc2\x93\xc2\x94\xc2\x95"],  ")D<*2PI/\"E,*5\n"],
+      [["\xc2\x96\xc2\x97\xc2\x98\xc2\x99\xc2"],  ")PI;\"E\\*8PIG\"\n"],
+      [["\x9a\xc2\x9b\xc2\x9c\xc2\x9d\xc2\x9e"],  ")FL*;PIS\"G<*>\n"],
+      [["\xc2\x9f\xc2\xa0\xc2\xa1\xc2\xa2\xc2"],  ")PI_\"H,*APJ+\"\n"],
+      [["\xa3\xc2\xa4\xc2\xa5\xc2\xa6\xc2\xa7"],  ")H\\*DPJ7\"IL*G\n"],
+      [["\xc2\xa8\xc2\xa9\xc2\xaa\xc2\xab\xc2"],  ")PJC\"J<*JPJO\"\n"],
+      [["\xac\xc2\xad\xc2\xae\xc2\xaf\xc2\xb0"],  ")K,*MPJ[\"K\\*P\n"],
+      [["\xc2\xb1\xc2\xb2\xc2\xb3\xc2\xb4\xc2"],  ")PK'\"LL*SPK3\"\n"],
+      [["\xb5\xc2\xb6\xc2\xb7\xc2\xb8\xc2\xb9"],  ")M<*VPK?\"N,*Y\n"],
+      [["\xc2\xba\xc2\xbb\xc2\xbc\xc2\xbd\xc2"],  ")PKK\"N\\*\\PKW\"\n"],
+      [["\xbe\xc2\xbf\xc3\x80\xc3\x81\xc3\x82"],  ")OL*_PX#\#@<.\"\n"],
+      [["\xc3\x83\xc3\x84\xc3\x85\xc3\x86\xc3"],  ")PX/#A,.%PX;#\n"],
+      [["\x87\xc3\x88\xc3\x89\xc3\x8a\xc3\x8b"],  ")A\\.(PXG#BL.+\n"],
+      [["\xc3\x8c\xc3\x8d\xc3\x8e\xc3\x8f\xc3"],  ")PXS#C<..PX_#\n"],
+      [["\x90\xc3\x91\xc3\x92\xc3\x93\xc3\x94"],  ")D,.1PY+#D\\.4\n"],
+      [["\xc3\x95\xc3\x96\xc3\x97\xc3\x98\xc3"],  ")PY7#EL.7PYC#\n"],
+      [["\x99\xc3\x9a\xc3\x9b\xc3\x9c\xc3\x9d"],  ")F<.:PYO#G,.=\n"],
+      [["\xc3\x9e\xc3\x9f\xc3\xa0\xc3\xa1\xc3"],  ")PY[#G\\. at PZ'#\n"],
+      [["\xa2\xc3\xa3\xc3\xa4\xc3\xa5\xc3\xa6"],  ")HL.CPZ3#I<.F\n"],
+      [["\xc3\xa7\xc3\xa8\xc3\xa9\xc3\xaa\xc3"],  ")PZ?#J,.IPZK#\n"],
+      [["\xab\xc3\xac\xc3\xad\xc3\xae\xc3\xaf"],  ")J\\.LPZW#KL.O\n"],
+      [["\xc3\xb0\xc3\xb1\xc3\xb2\xc3\xb3\xc3"],  ")P[##L<.RP[/#\n"],
+      [["\xb4\xc3\xb5\xc3\xb6\xc3\xb7\xc3\xb8"],  ")M,.UP[;#M\\.X\n"],
+      [["\xc3\xb9\xc3\xba\xc3\xbb\xc3\xbc\xc3"],  ")P[G#NL.[P[S#\n"],
+      [["\xbd\xc3\xbe\xc3\xbf"],                  "%O<.^P[\\`\n"]
+    ].should be_computed_by(:pack, "u")
+  end
+
+  it "calls #to_str to convert an object to a String" do
+    obj = mock("pack m string")
+    obj.should_receive(:to_str).and_return("abc")
+    [obj].pack("u").should == "#86)C\n"
+  end
+
+  it "raises a TypeError if #to_str does not return a String" do
+    obj = mock("pack m non-string")
+    lambda { [obj].pack("u") }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError if passed nil" do
+    lambda { [nil].pack("u") }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError if passed an Integer" do
+    lambda { [0].pack("u") }.should raise_error(TypeError)
+    lambda { [bignum_value].pack("u") }.should raise_error(TypeError)
+  end
+
+  ruby_version_is "1.9" do
+    it "sets the output string to US-ASCII encoding" do
+      ["abcd"].pack("u").encoding.should == Encoding::US_ASCII
+    end
+  end
+end

Modified: MacRuby/trunk/spec/frozen/core/array/pack/v_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/pack/v_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/pack/v_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -6,12 +6,20 @@
 
 describe "Array#pack with format 'V'" do
   it_behaves_like :array_pack_basic, 'V'
+  it_behaves_like :array_pack_basic_non_float, 'V'
+  it_behaves_like :array_pack_arguments, 'V'
   it_behaves_like :array_pack_numeric_basic, 'V'
+  it_behaves_like :array_pack_integer, 'V'
+  it_behaves_like :array_pack_no_platform, 'V'
   it_behaves_like :array_pack_32bit_le, 'V'
 end
 
 describe "Array#pack with format 'v'" do
   it_behaves_like :array_pack_basic, 'v'
+  it_behaves_like :array_pack_basic_non_float, 'v'
+  it_behaves_like :array_pack_arguments, 'v'
   it_behaves_like :array_pack_numeric_basic, 'v'
+  it_behaves_like :array_pack_integer, 'v'
+  it_behaves_like :array_pack_no_platform, 'v'
   it_behaves_like :array_pack_16bit_le, 'v'
 end

Added: MacRuby/trunk/spec/frozen/core/array/pack/w_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/pack/w_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/array/pack/w_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,44 @@
+# -*- encoding: ascii-8bit -*-
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+require File.expand_path('../shared/basic', __FILE__)
+require File.expand_path('../shared/numeric_basic', __FILE__)
+
+describe "Array#pack with format 'w'" do
+  it_behaves_like :array_pack_basic, 'w'
+  it_behaves_like :array_pack_basic_non_float, 'w'
+  it_behaves_like :array_pack_arguments, 'w'
+  it_behaves_like :array_pack_numeric_basic, 'w'
+
+  it "encodes a BER-compressed integer" do
+    [ [[0],     "\x00"],
+      [[1],     "\x01"],
+      [[9999],  "\xce\x0f"],
+      [[2**65], "\x84\x80\x80\x80\x80\x80\x80\x80\x80\x00"]
+    ].should be_computed_by(:pack, "w")
+  end
+
+  it "calls #to_int to convert the pack argument to an Integer" do
+    obj = mock('to_int')
+    obj.should_receive(:to_int).and_return(5)
+    [obj].pack("w").should == "\x05"
+  end
+
+  it "ignores NULL bytes between directives" do
+    [1, 2, 3].pack("w\x00w").should == "\x01\x02"
+  end
+
+  it "ignores spaces between directives" do
+    [1, 2, 3].pack("w w").should == "\x01\x02"
+  end
+
+  it "raises an ArgumentError when passed a negative value" do
+    lambda { [-1].pack("w") }.should raise_error(ArgumentError)
+  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

Added: MacRuby/trunk/spec/frozen/core/array/pack/x_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/pack/x_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/array/pack/x_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,64 @@
+# -*- encoding: ascii-8bit -*-
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+require File.expand_path('../shared/basic', __FILE__)
+
+describe "Array#pack with format 'x'" do
+  it_behaves_like :array_pack_basic, 'x'
+  it_behaves_like :array_pack_basic_non_float, 'x'
+  it_behaves_like :array_pack_no_platform, 'x'
+
+  it "adds a NULL byte with an empty array" do
+    [].pack("x").should == "\x00"
+  end
+
+  it "adds a NULL byte without consuming an element" do
+    [1, 2].pack("CxC").should == "\x01\x00\x02"
+  end
+
+  it "is not affected by a previous count modifier" do
+    [].pack("x3x").should == "\x00\x00\x00\x00"
+  end
+
+  it "adds multiple NULL bytes when passed a count modifier" do
+    [].pack("x3").should == "\x00\x00\x00"
+  end
+
+  it "does not add a NULL byte if the count modifier is zero" do
+    [].pack("x0").should == ""
+  end
+
+  it "does not add a NULL byte when passed the '*' modifier" do
+    [].pack("x*").should == ""
+  end
+end
+
+describe "Array#pack with format 'X'" do
+  it_behaves_like :array_pack_basic, 'X'
+  it_behaves_like :array_pack_basic_non_float, 'X'
+  it_behaves_like :array_pack_no_platform, 'X'
+
+  it "reduces the output string by one byte at the point it is encountered" do
+    [1, 2, 3].pack("C2XC").should == "\x01\x03"
+  end
+
+  it "does not consume any elements" do
+    [1, 2, 3].pack("CXC").should == "\x02"
+  end
+
+  it "reduces the output string by multiple bytes when passed a count modifier" do
+    [1, 2, 3, 4, 5].pack("C2X2C").should == "\x03"
+  end
+
+  it "has no affect when passed the '*' modifier" do
+    [1, 2, 3].pack("C2X*C").should == "\x01\x02\x03"
+  end
+
+  it "raises an ArgumentError if the output string is empty" do
+    lambda { [1, 2, 3].pack("XC") }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError if the count modifier is greater than the bytes in the string" do
+    lambda { [1, 2, 3].pack("C2X3") }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/trunk/spec/frozen/core/array/pack/z_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/pack/z_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/array/pack/z_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,32 @@
+# -*- encoding: ascii-8bit -*-
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+require File.expand_path('../shared/basic', __FILE__)
+require File.expand_path('../shared/string', __FILE__)
+
+describe "Array#pack with format 'Z'" do
+  it_behaves_like :array_pack_basic, 'Z'
+  it_behaves_like :array_pack_basic_non_float, 'Z'
+  it_behaves_like :array_pack_no_platform, 'Z'
+  it_behaves_like :array_pack_string, 'Z'
+
+  it "adds all the bytes and appends a NULL byte when passed the '*' modifier" do
+    ["abc"].pack("Z*").should == "abc\x00"
+  end
+
+  it "padds the output with NULL bytes when the count exceeds the size of the String" do
+    ["abc"].pack("Z6").should == "abc\x00\x00\x00"
+  end
+
+  it "adds a NULL byte when the value is nil" do
+    [nil].pack("Z").should == "\x00"
+  end
+
+  it "pads the output with NULL bytes when the value is nil" do
+    [nil].pack("Z3").should == "\x00\x00\x00"
+  end
+
+  it "does not append a NULL byte when passed the '*' modifier and the value is nil" do
+    [nil].pack("Z*").should == "\x00"
+  end
+end

Modified: MacRuby/trunk/spec/frozen/core/array/permutation_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/permutation_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/permutation_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -96,5 +96,16 @@
         [1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]
       ].sort
     end
+    
+    it "generates from a defensive copy, ignoring mutations" do
+      accum = []
+      ary = [1,2,3]
+      ary.permutation(3) do |x|
+        accum << x
+        ary[0] = 5
+      end
+      
+      accum.should == [[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]
+    end
   end
 end

Modified: MacRuby/trunk/spec/frozen/core/array/product_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/product_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/product_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -23,6 +23,13 @@
       [1, 2].product([]).should == []
     end
   end
+  
+  it "does not attempt to produce an unreasonable number of products" do
+    a = (0..100).to_a
+    lambda do
+      a.product(a, a, a, a, a, a, a, a, a, a)
+    end.should raise_error(RangeError)
+  end
 
   ruby_version_is "1.9" do
     describe "when given a block" do
@@ -36,6 +43,13 @@
         [1,2].product([3,4,5],[],[6,8]){|array| acc << array}
         acc.should be_empty
       end
+      
+      it "will ignore unreasonable numbers of products and yield anyway" do
+        a = (0..100).to_a
+        lambda do
+          a.product(a, a, a, a, a, a, a, a, a, a)
+        end.should raise_error(RangeError)
+      end
     end
 
     describe "when given an empty block" do

Modified: MacRuby/trunk/spec/frozen/core/array/reject_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/reject_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/reject_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -29,18 +29,32 @@
     array.reject { true }.should == []
   end
 
-  not_compliant_on :ironruby do
-    it "returns subclass instance on Array subclasses" do
-      ArraySpecs::MyArray[1, 2, 3].reject { |x| x % 2 == 0 }.should be_kind_of(ArraySpecs::MyArray)
+  ruby_version_is "" ... "1.9.3" do
+    not_compliant_on :ironruby do
+      it "returns subclass instance on Array subclasses" do
+        ArraySpecs::MyArray[1, 2, 3].reject { |x| x % 2 == 0 }.should be_kind_of(ArraySpecs::MyArray)
+      end
     end
+
+    deviates_on :ironruby do
+      it "does not return subclass instance on Array subclasses" do
+        ArraySpecs::MyArray[1, 2, 3].reject { |x| x % 2 == 0 }.should be_kind_of(Array)
+      end
+    end
   end
 
-  deviates_on :ironruby do
+  ruby_version_is "1.9.3" do
     it "does not return subclass instance on Array subclasses" do
       ArraySpecs::MyArray[1, 2, 3].reject { |x| x % 2 == 0 }.should be_kind_of(Array)
     end
+
+    it "does not retain instance variables" do
+      array = []
+      array.instance_variable_set("@variable", "value")
+      array.reject { false }.instance_variable_get("@variable").should == nil
+    end
   end
-  
+
   it_behaves_like :enumeratorize, :reject 
 end
 

Modified: MacRuby/trunk/spec/frozen/core/array/repeated_combination_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/repeated_combination_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/repeated_combination_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -37,5 +37,23 @@
     it "yields a partition consisting of only singletons" do
       @array.repeated_combination(1).sort.to_a.should == [[10],[11],[12]]
     end
+    
+    it "accepts sizes larger than the original array" do
+      @array.repeated_combination(4).to_a.sort.should ==
+        [[10, 10, 10, 10], [10, 10, 10, 11], [10, 10, 10, 12],
+         [10, 10, 11, 11], [10, 10, 11, 12], [10, 10, 12, 12],
+         [10, 11, 11, 11], [10, 11, 11, 12], [10, 11, 12, 12],
+         [10, 12, 12, 12], [11, 11, 11, 11], [11, 11, 11, 12],
+         [11, 11, 12, 12], [11, 12, 12, 12], [12, 12, 12, 12]]
+    end
+    
+    it "generates from a defensive copy, ignoring mutations" do
+      accum = []
+      @array.repeated_combination(2) do |x|
+        accum << x
+        @array[0] = 1
+      end
+      accum.should == [[10, 10], [10, 11], [10, 12], [11, 11], [11, 12], [12, 12]]
+    end
   end
 end

Modified: MacRuby/trunk/spec/frozen/core/array/repeated_permutation_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/repeated_permutation_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/repeated_permutation_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -47,5 +47,26 @@
       @numbers.unshift 10
       enum.to_a.sort.should == @permutations
     end
+    
+    it "allows permutations larger than the number of elements" do
+      [1,2].repeated_permutation(3).sort.should ==
+        [[1, 1, 1], [1, 1, 2], [1, 2, 1],
+         [1, 2, 2], [2, 1, 1], [2, 1, 2],
+         [2, 2, 1], [2, 2, 2]]
+    end
+    
+    it "generates from a defensive copy, ignoring mutations" do
+      accum = []
+      ary = [1,2]
+      ary.repeated_permutation(3) do |x|
+        accum << x
+        ary[0] = 5
+      end
+      
+      accum.should ==
+        [[1, 1, 1], [1, 1, 2], [1, 2, 1],
+         [1, 2, 2], [2, 1, 1], [2, 1, 2],
+         [2, 2, 1], [2, 2, 2]]
+    end
   end
 end

Modified: MacRuby/trunk/spec/frozen/core/array/reverse_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/reverse_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/reverse_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -7,10 +7,6 @@
     [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.should be_kind_of(ArraySpecs::MyArray)
-  end
-
   it "properly handles recursive arrays" do
     empty = ArraySpecs.empty_recursive_array
     empty.reverse.should == empty
@@ -18,6 +14,18 @@
     array = ArraySpecs.recursive_array
     array.reverse.should == [array, array, array, array, array, 3.0, 'two', 1]
   end
+
+  ruby_version_is "" ... "1.9.3" do
+    it "returns subclass instance on Array subclasses" do
+      ArraySpecs::MyArray[1, 2, 3].reverse.should be_kind_of(ArraySpecs::MyArray)
+    end
+  end
+
+  ruby_version_is "1.9.3" do
+    it "does not return subclass instance on Array subclasses" do
+      ArraySpecs::MyArray[1, 2, 3].reverse.should be_kind_of(Array)
+    end
+  end
 end
 
 describe "Array#reverse!" do

Modified: MacRuby/trunk/spec/frozen/core/array/rindex_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/rindex_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/rindex_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -51,5 +51,21 @@
     it "ignore the block if there is an argument" do
       [4, 2, 1, 5, 1, 3].rindex(5){|x| x < 2}.should == 3
     end
+    
+    describe "given no argument and no block" do
+      it "produces an Enumerator" do
+        enum = [4, 2, 1, 5, 1, 3].rindex
+        enum.class.should == enumerator_class
+        enum.each {|x| x < 2}.should == 4
+      end
+      
+      it "raises StopIteration if the array is truncated before completion" do
+        ary = [4, 2, 1, 5, 1, 3]
+        enum = ary.rindex
+        enum.next.should == 3
+        ary.clear
+        lambda {enum.next}.should raise_error(StopIteration)
+      end
+    end
   end
 end

Modified: MacRuby/trunk/spec/frozen/core/array/rotate_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/rotate_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/rotate_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -28,9 +28,17 @@
       a.rotate.should_not equal(a)
     end
 
-    it "returns subclass instance for Array subclasses" do
-      ArraySpecs::MyArray[1, 2, 3].rotate.should be_kind_of(ArraySpecs::MyArray)
+    ruby_version_is "" ... "1.9.3" do
+      it "returns subclass instance for Array subclasses" do
+        ArraySpecs::MyArray[1, 2, 3].rotate.should be_kind_of(ArraySpecs::MyArray)
+      end
     end
+
+    ruby_version_is "1.9.3" do
+      it "does not return subclass instance for Array subclasses" do
+        ArraySpecs::MyArray[1, 2, 3].rotate.should be_kind_of(Array)
+      end
+    end
   end
 
   describe "Array#rotate!" do

Modified: MacRuby/trunk/spec/frozen/core/array/shuffle_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/shuffle_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/shuffle_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -14,10 +14,6 @@
       different.should be_true # Will fail once in a blue moon (4!^10)
     end
 
-    it "returns subclass instances with Array subclass" do
-      ArraySpecs::MyArray[1, 2, 3].shuffle.should be_an_instance_of(ArraySpecs::MyArray)
-    end
-
     it "is not destructive" do
       a = [1, 2, 3]
       10.times do
@@ -26,6 +22,18 @@
       end
     end
   end
+
+  ruby_version_is "1.8.7" ... "1.9.3" do
+    it "returns subclass instances with Array subclass" do
+      ArraySpecs::MyArray[1, 2, 3].shuffle.should be_an_instance_of(ArraySpecs::MyArray)
+    end
+  end
+
+  ruby_version_is "1.9.3" do
+    it "does not return subclass instances with Array subclass" do
+      ArraySpecs::MyArray[1, 2, 3].shuffle.should be_an_instance_of(Array)
+    end
+  end
 end
 
 describe "Array#shuffle!" do

Modified: MacRuby/trunk/spec/frozen/core/array/sort_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/sort_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/sort_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -92,11 +92,6 @@
     a.sort { -1 }.should be_kind_of(Array)
   end
 
-  it "returns subclass instance on Array subclasses" do
-    ary = ArraySpecs::MyArray[1, 2, 3]
-    ary.sort.should be_kind_of(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 }
@@ -106,6 +101,23 @@
     [1, 2, 3].sort{ break :a }.should == :a
   end
 
+  it "uses the sign of Bignum block results as the sort result" do
+    a = [1, 2, 5, 10, 7, -4, 12]
+    begin
+      class Bignum;
+        alias old_spaceship <=>
+        def <=>(other)
+          raise
+        end
+      end
+      a.sort {|n, m| (n - m) * (2 ** 200)}.should == [-4, 1, 2, 5, 7, 10, 12]
+    ensure
+      class Bignum
+        alias <=> old_spaceship
+      end
+    end
+  end
+
   it "compares values returned by block with 0" do
     a = [1, 2, 5, 10, 7, -4, 12]
     a.sort { |n, m| n - m }.should == [-4, 1, 2, 5, 7, 10, 12]
@@ -127,6 +139,20 @@
     pruned = ArraySpecs::LargeArray.dup.delete_if { |n| n !~ /^test./ }
     pruned.sort.should == ArraySpecs::LargeTestArraySorted
   end
+
+  ruby_version_is "" ... "1.9.3" do
+    it "returns subclass instance on Array subclasses" do
+      ary = ArraySpecs::MyArray[1, 2, 3]
+      ary.sort.should be_kind_of(ArraySpecs::MyArray)
+    end
+  end
+
+  ruby_version_is "1.9.3" do
+    it "does not return subclass instance on Array subclasses" do
+      ary = ArraySpecs::MyArray[1, 2, 3]
+      ary.sort.should be_kind_of(Array)
+    end
+  end
 end
 
 describe "Array#sort!" do

Modified: MacRuby/trunk/spec/frozen/core/array/to_s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/to_s_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/to_s_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,7 +2,7 @@
 require File.expand_path('../fixtures/classes', __FILE__)
 
 describe "Array#to_s" do
-  ruby_version_is "" ... "1.9" do
+  ruby_version_is "" .. "1.9" do
     it "is equivalent to #join without a separator string" do
       old = $,
       begin

Modified: MacRuby/trunk/spec/frozen/core/array/uniq_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/uniq_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/array/uniq_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -80,9 +80,17 @@
     a[1].tainted?.should == true
   end
 
-  it "returns subclass instance on Array subclasses" do
-    ArraySpecs::MyArray[1, 2, 3].uniq.should be_kind_of(ArraySpecs::MyArray)
+  ruby_version_is "" ... "1.9.3" do
+    it "returns subclass instance on Array subclasses" do
+      ArraySpecs::MyArray[1, 2, 3].uniq.should be_kind_of(ArraySpecs::MyArray)
+    end
   end
+
+  ruby_version_is "1.9.3" do
+    it "does not return subclass instance on Array subclasses" do
+      ArraySpecs::MyArray[1, 2, 3].uniq.should be_kind_of(Array)
+    end
+  end
 end
 
 describe "Array#uniq!" do

Modified: MacRuby/trunk/spec/frozen/core/basicobject/__send___spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/__send___spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/basicobject/__send___spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,6 +2,8 @@
 
 ruby_version_is "1.9" do
   describe "BasicObject#__send__" do
-    it "needs to be reviewed for spec completeness"
+    it "is a public instance method" do
+      BasicObject.should have_public_instance_method(:__send__)
+    end
   end
 end

Added: MacRuby/trunk/spec/frozen/core/basicobject/ancestors_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/ancestors_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/basicobject/ancestors_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,9 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+
+ruby_version_is "1.9" do
+  describe "BasicObject.ancestors" do
+    it "returns only BasicObject" do
+      BasicObject.ancestors.should == [BasicObject]
+    end
+  end
+end

Deleted: MacRuby/trunk/spec/frozen/core/basicobject/basic_object_class_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/basic_object_class_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/basicobject/basic_object_class_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,22 +0,0 @@
-require File::join( File::dirname(__FILE__), %w{ .. .. spec_helper } )
-
-ruby_version_is "1.9" do
-  require File::join( File::dirname(__FILE__), %w{ shared behavior } )
-
-  describe "BasicObject class" do
-
-    it "has no ancestors" do
-      BasicObject.ancestors.should == [ BasicObject ]
-    end
-
-    it "has no superclass" do
-      BasicObject.superclass.should be_nil
-    end
-    
-    it "is a class" do
-      ( Class === BasicObject ).should == true
-    end
-
-  end
-end
-

Deleted: MacRuby/trunk/spec/frozen/core/basicobject/basic_object_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/basic_object_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/basicobject/basic_object_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,23 +0,0 @@
-require File::join( File::dirname(__FILE__), %w{ .. .. spec_helper } )
-
-ruby_version_is "1.9" do
-  require File::join( File::dirname(__FILE__), %w{ shared behavior } )
-
-  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
-

Deleted: MacRuby/trunk/spec/frozen/core/basicobject/basic_object_subclass_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/basic_object_subclass_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/basicobject/basic_object_subclass_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,25 +0,0 @@
-require File::join( File::dirname(__FILE__), %w{ .. .. spec_helper } )
-
-ruby_version_is "1.9" do
-  require File::join( File::dirname(__FILE__), %w{ shared behavior } )
-
-  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/trunk/spec/frozen/core/basicobject/basicobject_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/basicobject_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/basicobject/basicobject_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,67 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
+
+ruby_version_is "1.9" do
+  describe "BasicObject" do
+    it "raises NoMethodError for nonexistent methods after #method_missing is removed" do
+      script = fixture __FILE__, "remove_method_missing.rb"
+      ruby_exe(script).chomp.should == "NoMethodError"
+    end
+  end
+
+  describe "BasicObject metaclass" do
+    before :each do
+      @meta = class << BasicObject; self; end
+    end
+
+    it "is an instance of Class" do
+      @meta.should be_an_instance_of(Class)
+    end
+
+    it "has Class as superclass" do
+      @meta.superclass.should equal(Class)
+    end
+
+    it "contains methods for the BasicObject class" do
+      @meta.class_eval do
+        def rubyspec_test_method() :test end
+      end
+
+      BasicObject.rubyspec_test_method.should == :test
+    end
+  end
+
+  describe "BasicObject instance metaclass" do
+    before :each do
+      @object = BasicObject.new
+      @meta = class << @object; self; end
+    end
+
+    it "is an instance of Class" do
+      @meta.should be_an_instance_of(Class)
+    end
+
+    it "has BasicObject as superclass" do
+      @meta.superclass.should equal(BasicObject)
+    end
+
+    it "contains methods defined for the BasicObject instance" do
+      @meta.class_eval do
+        def test_method() :test end
+      end
+
+      @object.test_method.should == :test
+    end
+  end
+
+  describe "BasicObject subclass" do
+    it "contains Kernel methods when including Kernel" do
+      obj = BasicObjectSpecs::BOSubclass.new
+
+      obj.instance_variable_set(:@test, :value)
+      obj.instance_variable_get(:@test).should == :value
+
+      obj.send(:hash).should be_an_instance_of(Fixnum)
+    end
+  end
+end

Added: MacRuby/trunk/spec/frozen/core/basicobject/class_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/class_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/basicobject/class_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,9 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+
+ruby_version_is "1.9" do
+  describe "BasicObject.class" do
+    it "returns Class" do
+      BasicObject.class.should equal(Class)
+    end
+  end
+end

Modified: MacRuby/trunk/spec/frozen/core/basicobject/equal_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/equal_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/basicobject/equal_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,6 +2,19 @@
 
 ruby_version_is "1.9" do
   describe "BasicObject#equal?" do
-    it "needs to be reviewed for spec completeness"
+    it "is a public instance method" do
+      BasicObject.should have_public_instance_method(:equal?)
+    end
+
+    it "returns true if other is identical to self" do
+      obj = BasicObject.new
+      obj.equal?(obj).should be_true
+    end
+
+    it "returns false if other is not identical to self" do
+      a = BasicObject.new
+      b = BasicObject.new
+      a.equal?(b).should be_false
+    end
   end
 end

Modified: MacRuby/trunk/spec/frozen/core/basicobject/equal_value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/equal_value_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/basicobject/equal_value_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,6 +2,25 @@
 
 ruby_version_is "1.9" do
   describe "BasicObject#==" do
-    it "needs to be reviewed for spec completeness"
+    it "is a public instance method" do
+      BasicObject.should have_public_instance_method(:==)
+    end
+
+    it "returns true if other is identical to self" do
+      a = BasicObject.new
+      (a == a).should be_true
+    end
+
+    it "returns false if other is a BasicObject not identical to self" do
+      a = BasicObject.new
+      b = BasicObject.new
+      (a == b).should be_false
+    end
+
+    it "returns false if other is an Object" do
+      a = BasicObject.new
+      b = Object.new
+      (a == b).should be_false
+    end
   end
 end

Deleted: MacRuby/trunk/spec/frozen/core/basicobject/fixtures/classes.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/fixtures/classes.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/basicobject/fixtures/classes.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,17 +0,0 @@
-module BasicObjectSpecs
-  class IVars
-    def initialize
-      @secret = 99
-    end
-  end
-
-  module InstExec
-    def self.included(base)
-      base.instance_exec { @@count = 2 }
-    end
-  end
-
-  module InstExecIncluded
-    include InstExec
-  end
-end

Added: MacRuby/trunk/spec/frozen/core/basicobject/fixtures/common.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/fixtures/common.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/basicobject/fixtures/common.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,5 @@
+module BasicObjectSpecs
+  class BOSubclass < BasicObject
+    include ::Kernel
+  end
+end

Added: MacRuby/trunk/spec/frozen/core/basicobject/fixtures/remove_method_missing.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/fixtures/remove_method_missing.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/basicobject/fixtures/remove_method_missing.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,9 @@
+class BasicObject
+  remove_method :method_missing
+end
+
+begin
+  Object.new.test_method
+rescue NoMethodError => e
+  puts e.class.name
+end

Added: MacRuby/trunk/spec/frozen/core/basicobject/initialize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/initialize_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/basicobject/initialize_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,9 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+
+ruby_version_is "1.9" do
+  describe "BasicObject#initialize" do
+    it "is a private instance method" do
+      BasicObject.should have_private_instance_method(:initialize)
+    end
+  end
+end

Modified: MacRuby/trunk/spec/frozen/core/basicobject/instance_eval_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/instance_eval_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/basicobject/instance_eval_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,6 +2,13 @@
 
 ruby_version_is "1.9" do
   describe "BasicObject#instance_eval" do
-    it "needs to be reviewed for spec completeness"
+    it "is a public instance method" do
+      BasicObject.should have_public_instance_method(:instance_eval)
+    end
+
+    it "sets self to the receiver in the context of the passed block" do
+      a = BasicObject.new
+      a.instance_eval { self }.equal?(a).should be_true
+    end
   end
 end

Modified: MacRuby/trunk/spec/frozen/core/basicobject/instance_exec_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/instance_exec_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/basicobject/instance_exec_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,92 +1,19 @@
 require File.expand_path('../../../spec_helper', __FILE__)
 
 ruby_version_is "1.9" do
-  
-  require File.expand_path('../fixtures/classes', __FILE__)
-  
   describe "BasicObject#instance_exec" do
-    it "raises a LocalJumpError unless given a block" do
-      lambda { "hola".instance_exec }.should raise_error(LocalJumpError)
+    it "is a public instance method" do
+      BasicObject.should have_public_instance_method(:instance_exec)
     end
-    
-    it "has an arity of -1" do
-      Object.new.method(:instance_exec).arity.should == -1
-    end
 
-    it "accepts arguments with a block" do
-      lambda { "hola".instance_exec(4, 5) { |a,b| a + b } }.should_not raise_error
+    it "sets self to the receiver in the context of the passed block" do
+      a = BasicObject.new
+      a.instance_exec { self }.equal?(a).should be_true
     end
-    
-    it "doesn't pass self to the block as an argument" do
-      "hola".instance_exec { |o| o }.should be_nil
-    end
 
-    it "passes any arguments to the block" do
-      Object.new.instance_exec(1,2) {|one, two| one + two}.should == 3
+    it "passes arguments to the block" do
+      a = BasicObject.new
+      a.instance_exec(1) { |b| b }.should equal(1)
     end
-
-    it "only binds the exec to the receiver" do
-      f = Object.new
-      f.instance_exec 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_exec. See also module_eval/class_eval.
-
-    it "binds self to the receiver" do
-      s = "hola"
-      (s == s.instance_exec { self }).should == true
-    end
-    
-    it "executes in the context of the receiver" do
-      "Ruby-fu".instance_exec { size }.should == 7
-      Object.class_eval { "Ruby-fu".instance_exec{ to_s } }.should == "Ruby-fu"
-    end
-
-    it "has access to receiver's instance variables" do
-      BasicObjectSpecs::IVars.new.instance_exec { @secret }.should == 99
-    end
-
-    it "sets class variables in the receiver" do
-      BasicObjectSpecs::InstExec.class_variables.should include(:@@count)
-      BasicObjectSpecs::InstExec.send(:class_variable_get, :@@count).should == 2
-    end
-
-    it "raises a TypeError when defining methods on an immediate" do
-      lambda do
-        1.instance_exec { def foo; end }
-      end.should raise_error(TypeError)
-      lambda do
-        :foo.instance_exec { 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_exec_spec = 1"
-      (defined? @@__tmp_instance_exec_spec).should == nil
-
-      @@__tmp_instance_exec_spec = 2
-      1.instance_exec { @@__tmp_instance_exec_spec }.should == 2
-      Fixnum.__send__(:remove_class_variable, :@@__tmp_instance_exec_spec)
-    end
   end
-
-    it "raises a TypeError when defining methods on numerics" do
-      lambda do
-        (1.0).instance_exec { def foo; end }
-      end.should raise_error(TypeError)
-      lambda do
-        (1 << 64).instance_exec { def foo; end }
-      end.should raise_error(TypeError)
-    end
-  end
 end

Deleted: MacRuby/trunk/spec/frozen/core/basicobject/metaclass_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/metaclass_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/basicobject/metaclass_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,27 +0,0 @@
-require File::join( File::dirname(__FILE__), %w{ .. .. spec_helper } )
-
-ruby_version_is "1.9" do
-  require File::join( File::dirname(__FILE__), %w{ shared behavior } )
-
-  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

Modified: MacRuby/trunk/spec/frozen/core/basicobject/method_missing_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/method_missing_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/basicobject/method_missing_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -3,13 +3,13 @@
 ruby_version_is "1.9" do
   describe "BasicObject#method_missing" do
     it_behaves_like(:method_missing, :method_missing, BasicObject)
-  end  
+  end
 
   describe "BasicObject#method_missing is undefined" do
     it_behaves_like(:method_missing_undef, :method_missing, BasicObject)
-  end  
+  end
 
   describe "BasicObject.method_missing" do
     it_behaves_like(:method_missing_class_method, :method_missing, BasicObject)
-  end  
+  end
 end

Modified: MacRuby/trunk/spec/frozen/core/basicobject/new_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/new_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/basicobject/new_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,10 +1,12 @@
-require File::join( File::dirname(__FILE__), %w{ .. .. spec_helper } )
+require File.expand_path('../../../spec_helper', __FILE__)
 
-ruby_version_is "1.9".."1.9.9" do
+ruby_version_is "1.9" do
   describe "BasicObject.new" do
-    it "creates a new BasicObject" do
-      ( BasicObject === BasicObject.new ).should == true
+    it "returns an instance of BasicObject" do
+      # BasicObject cannot participate in .should matchers. Further,
+      # there is no #class method on BasicObject. Hence, we can only
+      # infer that we have an instance of BasicObject.
+      (Object === BasicObject.new).should be_false
     end
   end
 end
-

Modified: MacRuby/trunk/spec/frozen/core/basicobject/not_equal_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/not_equal_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/basicobject/not_equal_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,6 +2,25 @@
 
 ruby_version_is "1.9" do
   describe "BasicObject#!=" do
-    it "needs to be reviewed for spec completeness"
+    it "is a public instance method" do
+      BasicObject.should have_public_instance_method(:!=)
+    end
+
+    it "returns true if other is not identical to self" do
+      a = BasicObject.new
+      b = BasicObject.new
+      (a != b).should be_true
+    end
+
+    it "returns true if other is an Object" do
+      a = BasicObject.new
+      b = Object.new
+      (a != b).should be_true
+    end
+
+    it "returns false if other is identical to self" do
+      a = BasicObject.new
+      (a != a).should be_false
+    end
   end
 end

Modified: MacRuby/trunk/spec/frozen/core/basicobject/not_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/not_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/basicobject/not_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,6 +2,12 @@
 
 ruby_version_is "1.9" do
   describe "BasicObject#!" do
-    it "needs to be reviewed for spec completeness"
+    it "is a public instance method" do
+      BasicObject.should have_public_instance_method(:!)
+    end
+
+    it "returns false" do
+      (!BasicObject.new).should be_false
+    end
   end
 end

Deleted: MacRuby/trunk/spec/frozen/core/basicobject/remove_method_missing.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/remove_method_missing.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/basicobject/remove_method_missing.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,14 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-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

Deleted: MacRuby/trunk/spec/frozen/core/basicobject/shared/behavior.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/shared/behavior.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/basicobject/shared/behavior.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,16 +0,0 @@
-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/trunk/spec/frozen/core/basicobject/superclass_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/superclass_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/basicobject/superclass_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,9 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+
+ruby_version_is "1.9" do
+  describe "BasicObject.superclass" do
+    it "returns nil" do
+      BasicObject.superclass.should be_nil
+    end
+  end
+end

Modified: MacRuby/trunk/spec/frozen/core/bignum/comparison_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/comparison_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/bignum/comparison_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,71 +1,152 @@
 require File.expand_path('../../../spec_helper', __FILE__)
 
 describe "Bignum#<=>" do
-  before(:each) do
-    @bignum = bignum_value(96)
-    @inf = 1/0.0
-  end
+  describe "with a Fixnum" do
+    it "returns -1 when other is larger" do
+      (-bignum_value <=> 2).should == -1
+    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
+    it "returns 1 when other is smaller" do
+      (bignum_value <=> 2).should == 1
+    end
   end
 
-  it "returns 0 when self is equal to the given argument" do
-    (@bignum <=> @bignum).should == 0
-    (- at bignum <=> - at bignum).should == 0
-  end
+  describe "with a Bignum" do
+    describe "when other is negative" do
+      it "returns -1 when self is negative and other is larger" do
+        (-bignum_value(42) <=> -bignum_value).should == -1
+      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
+      it "returns 0 when other is equal" do
+        (-bignum_value <=> -bignum_value).should == 0
+      end
+
+      it "returns 1 when self is negative and other is smaller" do
+        (-bignum_value <=> -bignum_value(94)).should == 1
+      end
+
+      it "returns 1 when self is positive" do
+        (bignum_value <=> -bignum_value).should == 1
+      end
+    end
+
+    describe "when other is positive" do
+      it "returns -1 when self is negative" do
+        (-bignum_value <=> bignum_value).should == -1
+      end
+
+      it "returns -1 when self is positive and other is larger" do
+        (bignum_value <=> bignum_value(38)).should == -1
+      end
+
+      it "returns 0 when other is equal" do
+        (bignum_value <=> bignum_value).should == 0
+      end
+
+      it "returns 1 when other is smaller" do
+        (bignum_value(56) <=> bignum_value).should == 1
+      end
+    end
   end
 
-  it "returns nil when the given argument is not an Integer" do
-    (@bignum <=> mock('str')).should == nil
-    (@bignum <=> 'test').should == nil
+  describe "with a Float" do
+    describe "when other is negative" do
+      it "returns -1 when self is negative and other is larger" do
+        (-bignum_value(0xffff) <=> -bignum_value.to_f).should == -1
+      end
+
+      it "returns 0 when other is equal" do
+        (-bignum_value <=> -bignum_value.to_f).should == 0
+      end
+
+      it "returns 1 when self is negative and other is smaller" do
+        (-bignum_value <=> -bignum_value(0xffef).to_f).should == 1
+      end
+
+      it "returns 1 when self is positive" do
+        (bignum_value <=> -bignum_value.to_f).should == 1
+      end
+    end
+
+    describe "when other is positive" do
+      it "returns -1 when self is negative" do
+        (-bignum_value <=> bignum_value.to_f).should == -1
+      end
+
+      it "returns -1 when self is positive and other is larger" do
+        (bignum_value <=> bignum_value(0xfffe).to_f).should == -1
+      end
+
+      it "returns 0 when other is equal" do
+        (bignum_value <=> bignum_value.to_f).should == 0
+      end
+
+      it "returns 1 when other is smaller" do
+        (bignum_value(0xfeff) <=> bignum_value.to_f).should == 1
+      end
+    end
   end
 
-  # TODO: Remove duplicate bug guards when ruby_bug is updated.
-  ruby_bug "[ruby-dev:38672] [Bug #1645]", "1.8.7.248" do
-    # The 4 tests below are taken from matz's revision 23730 for Ruby trunk
-    #
-    it "returns 1 when self is Infinity and other is a Bignum" do
-      (@inf <=> Float::MAX.to_i*2).should == 1
+  describe "with an Object" do
+    before :each do
+      @big = bignum_value
+      @num = mock("value for Bignum#<=>")
     end
 
-    it "returns 1 when self is negative and other is -Infinity" do
-      (-Float::MAX.to_i*2 <=> - at inf).should == 1
+    it "calls #coerce on other" do
+      @num.should_receive(:coerce).with(@big).and_return([@big.to_f, 2.5])
+      @big <=> @num
     end
 
-    it "returns -1 when self is -Infinity and other is negative" do
-      (- at inf <=> -Float::MAX.to_i*2).should == -1
+    it "returns nil if #coerce raises an exception" do
+      @num.should_receive(:coerce).with(@big).and_raise(RuntimeError)
+      (@big <=> @num).should be_nil
     end
 
-    it "returns -1 when self is negative and other is Infinty" do
-      (-Float::MAX.to_i*2 <=> @inf).should == -1
+    it "raises an exception if #coerce raises a non-StandardError exception" do
+      @num.should_receive(:coerce).with(@big).and_raise(Exception)
+      lambda { @big <=> @num }.should raise_error(Exception)
     end
+
+    it "returns nil if #coerce does not return an Array" do
+      @num.should_receive(:coerce).with(@big).and_return(nil)
+      (@big <=> @num).should be_nil
+    end
+
+    it "returns -1 if the coerced value is larger" do
+      @num.should_receive(:coerce).with(@big).and_return([@big, bignum_value(10)])
+      (@big <=> @num).should == -1
+    end
+
+    it "returns 0 if the coerced value is equal" do
+      @num.should_receive(:coerce).with(@big).and_return([@big, bignum_value])
+      (@big <=> @num).should == 0
+    end
+
+    it "returns 1 if the coerced value is smaller" do
+      @num.should_receive(:coerce).with(@big).and_return([@big, 22])
+      (@big <=> @num).should == 1
+    end
   end
 
-  ruby_bug "[ruby-dev:38672] [Bug #1645]", "1.8.7" do
-    # The 4 tests below are taken from matz's revision 23730 for Ruby trunk
-    #
+  # The tests below are taken from matz's revision 23730 for Ruby trunk
+  ruby_bug "[ruby-dev:38672] [Bug #1645]", "1.8.7.302" do
     it "returns 1 when self is Infinity and other is a Bignum" do
-      (@inf <=> Float::MAX.to_i*2).should == 1
+      (infinity_value <=> Float::MAX.to_i*2).should == 1
     end
 
+    it "returns -1 when self is negative and other is Infinty" do
+      (-Float::MAX.to_i*2 <=> infinity_value).should == -1
+    end
+  end
+
+  ruby_bug "[ruby-dev:38672] [Bug #1645]", "1.8.7.302" do
     it "returns 1 when self is negative and other is -Infinity" do
-      (-Float::MAX.to_i*2 <=> - at inf).should == 1
+      (-Float::MAX.to_i*2 <=> -infinity_value).should == 1
     end
 
     it "returns -1 when self is -Infinity and other is negative" do
-      (- at inf <=> -Float::MAX.to_i*2).should == -1
+      (-infinity_value <=> -Float::MAX.to_i*2).should == -1
     end
-
-    it "returns -1 when self is negative and other is Infinty" do
-      (-Float::MAX.to_i*2 <=> @inf).should == -1
-    end
   end
 end

Modified: MacRuby/trunk/spec/frozen/core/bignum/right_shift_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/right_shift_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/bignum/right_shift_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -13,6 +13,32 @@
     (- at bignum >> 2).should == -36893488147419103232
   end
 
+  it "respects twos complement signed shifting" do
+    # This explicit left hand value is important because it is the
+    # exact bit pattern that matters, so it's important it's right
+    # here to show the significance.
+    #
+
+    (-42949672980000000000000 >> 14).should == -2621440001220703125
+    (-42949672980000000000001 >> 14).should == -2621440001220703126
+    # Note the off by one -------------------- ^^^^^^^^^^^^^^^^^^^^
+    # This is because even though we discard the lowest bit, in twos
+    # complement it would influence the bits to the left of it.
+
+    (-42949672980000000000000 >> 15).should == -1310720000610351563
+    (-42949672980000000000001 >> 15).should == -1310720000610351563
+
+    (-0xfffffffffffffffff >> 32).should == -68719476736
+  end
+
+  it "respects twos complement signed shifting for very large values" do
+    giant = 42949672980000000000000000000000000000000000000000000000000000000000000000000000000000000000
+    neg = -giant
+
+    (giant >> 84).should == 2220446050284288846538547929770901490087453566957265138626098632812
+    (neg >> 84).should == -2220446050284288846538547929770901490087453566957265138626098632813
+  end
+
   it "returns n shifted left m bits when  n > 0, m < 0" do
     (@bignum >> -2).should == 590295810358705651712
   end

Modified: MacRuby/trunk/spec/frozen/core/class/new_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/class/new_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/class/new_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -49,6 +49,12 @@
     klass_instance.is_a?(klass).should == true
   end
 
+  it "raises a TypeError if passed a metaclass" do
+    obj = mock("Class.new metaclass")
+    meta = obj.metaclass
+    lambda { Class.new meta }.should raise_error(TypeError)
+  end
+
   ruby_version_is ""..."1.9" do
     it "creates a class without a name" do
       Class.new.name.should == ""

Modified: MacRuby/trunk/spec/frozen/core/dir/glob_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/glob_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/dir/glob_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -40,6 +40,11 @@
     DirSpecs.delete_mock_dirs
   end
 
+  it "can take an array of patterns" do
+    Dir.glob(["file_o*", "file_t*"]).should ==
+               %w!file_one.ext file_two.ext!
+  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
@@ -68,7 +73,14 @@
 
     Dir.glob('**/', File::FNM_DOTMATCH).sort.should == expected
   end
-  
+
+  it "accepts a block and yields it with each elements" do
+    ary = []
+    ret = Dir.glob(["file_o*", "file_t*"]) { |t| ary << t }
+    ret.should be_nil
+    ary.should == %w!file_one.ext file_two.ext!
+  end
+
   platform_is_not(:windows) do
     it "matches the literal character '\\' with option File::FNM_NOESCAPE" do
       Dir.mkdir 'foo?bar'

Modified: MacRuby/trunk/spec/frozen/core/dir/pwd_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/pwd_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/dir/pwd_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -37,7 +37,7 @@
       DirSpecs.clear_dirs
 
       begin
-        str = "\u{e9}" #Unicode \xE9
+        str = [0xe9].pack 'U' #Unicode \xE9
         Dir.mkdir str
         File.exist?(str).should == true
 

Modified: MacRuby/trunk/spec/frozen/core/dir/shared/glob.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/shared/glob.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/dir/shared/glob.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -8,13 +8,29 @@
     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')
+  ruby_version_is ""..."1.9" do
+    it "calls #to_str to convert patterns" 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]
+      Dir.send(@method, obj).should == %w[file_one.ext]
+    end
   end
 
+  ruby_version_is "1.9" do
+    it "calls #to_path to convert patterns" do
+      obj = mock('file_one.ext')
+      obj.should_receive(:to_path).and_return('file_one.ext')
+
+      Dir.send(@method, obj).should == %w[file_one.ext]
+    end
+  end
+
+  it "splits the string on \\0 if there is only one string given" do
+    Dir.send(@method, "file_o*\0file_t*").should ==
+             %w!file_one.ext file_two.ext!
+  end
+
   it "matches non-dotfiles with '*'" do
     expected = %w[
       brace
@@ -226,6 +242,14 @@
          subdir_two/nondotfile
          subdir_two/nondotfile.ext]
   end
+
+  it "preserves the separator between directory components" do
+    Dir.send(@method, "deeply/nested//directory/structure/*.ext").should ==
+      %w!deeply/nested//directory/structure/file_one.ext!
+
+    Dir.send(@method, "deeply/nested/directory/structure//**/*.ext").should ==
+      %w!deeply/nested/directory/structure//file_one.ext!
+  end
 end
 
 describe :dir_glob_recursive, :shared => true do

Modified: MacRuby/trunk/spec/frozen/core/encoding/find_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/find_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/encoding/find_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -31,17 +31,6 @@
     end
 
     it "accepts any object as encoding name, if it responds to #to_str" do
-      obj = Object.new
-      def obj.encoding_name=(name); @name; end
-      def obj.to_str; @name; end
-
-      Encoding.list.each do |enc|
-        obj.encoding_name = enc.name
-        Encoding.find(obj).should == enc
-      end
-    end
-
-    it "accepts any object as encoding name, if it responds to #to_str" do
       obj = Class.new do
         attr_writer :encoding_name
         def to_str; @encoding_name; end
@@ -62,5 +51,32 @@
     it "raises an ArgumentError if the given encoding does not exist" do
       lambda { Encoding.find('dh2dh278d') }.should raise_error(ArgumentError)
     end
+    
+    # Not sure how to do a better test, since locale depends on weird platform-specific stuff
+    it "supports the 'locale' encoding alias" do
+      enc = Encoding.find('locale')
+      enc.should_not == nil
+    end
+    
+    it "returns default external encoding for the 'external' encoding alias" do
+      enc = Encoding.find('external')
+      enc.should == Encoding.default_external
+    end
+    
+    it "returns default internal encoding for the 'internal' encoding alias" do
+      enc = Encoding.find('internal')
+      enc.should == Encoding.default_internal
+    end
+    
+    platform_is_not :windows do
+      it "uses default external encoding for the 'filesystem' encoding alias" do
+        enc = Encoding.find('filesystem')
+        enc.should == Encoding.default_external
+      end
+    end
+    
+    platform_is :windows do
+      it "needs to be reviewed for spec completeness"
+    end
   end
 end

Modified: MacRuby/trunk/spec/frozen/core/enumerator/next_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerator/next_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/enumerator/next_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,7 +1,6 @@
 require File.expand_path('../../../spec_helper', __FILE__)
 
-# TODO: enable for 1.8.7 as well
-ruby_version_is "1.9" do
+ruby_version_is "1.8.7" do
   require File.expand_path('../../../shared/enumerator/next', __FILE__)
   
   describe "Enumerator#next" do

Modified: MacRuby/trunk/spec/frozen/core/file/basename_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/basename_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/file/basename_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -69,7 +69,7 @@
     File.basename("foo/").should == "foo"
   end
 
-  it "ignores a trailing directory seperator" do
+  it "ignores a trailing directory separator" do
     File.basename("foo.rb/", '.rb').should == "foo"
     File.basename("bar.rb///", '.*').should == "bar"
   end

Modified: MacRuby/trunk/spec/frozen/core/file/fixtures/common.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/fixtures/common.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/file/fixtures/common.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,3 +1,22 @@
 module FileSpecs
   class SubString < String; end
+
+  def self.make_closer(obj, exc=nil)
+    ScratchPad << :file_opened
+
+    class << obj
+      attr_accessor :close_exception
+
+      alias_method :original_close, :close
+
+      def close
+        original_close
+        ScratchPad << :file_closed
+
+        raise @close_exception if @close_exception
+      end
+    end
+
+    obj.close_exception = exc
+  end
 end

Modified: MacRuby/trunk/spec/frozen/core/file/open_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/open_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/file/open_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,14 +1,17 @@
 require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
 require File.expand_path('../shared/open', __FILE__)
 
 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")
+    @nonexistent = tmp("fake.txt")
+    rm_r @file, @nonexistent
   end
 
   before :each do
+    ScratchPad.record []
+
     @fh = @fd = nil
     @flags = File::CREAT | File::TRUNC | File::WRONLY
     touch @file
@@ -16,54 +19,34 @@
 
   after :each do
     @fh.close if @fh and not @fh.closed?
-    File.delete(@file) if File.exist?(@file)
-    File.delete("fake") if File.exist?("fake")
+    rm_r @file, @nonexistent
   end
 
-  it "with block does not raise error when file is closed inside the block" do
-    lambda {
+  describe "with a block" do
+    it "does not raise error when file is closed inside the block" do
       @fh = File.open(@file) { |fh| fh.close; fh }
-    }.should_not raise_error
-    @fh.closed?.should == true
-  end
+      @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
+    it "invokes close on an opened file when exiting the block" do
+      File.open(@file, 'r') { |f| FileSpecs.make_closer f }
+
+      ScratchPad.recorded.should == [:file_opened, :file_closed]
     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 "propagates non-StandardErrors produced by close" do
+      lambda {
+        File.open(@file, 'r') { |f| FileSpecs.make_closer f, Exception }
+      }.should raise_error(Exception)
 
-  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
-          close_orig
-          raise IOError
-        end
-      end
-    end.should be_nil
+      ScratchPad.recorded.should == [:file_opened, :file_closed]
+    end
+
+    it "does not propagate StandardErrors produced by close" do
+      File.open(@file, 'r') { |f| FileSpecs.make_closer f, IOError }
+
+      ScratchPad.recorded.should == [:file_opened, :file_closed]
+    end
   end
 
   it "opens the file (basic case)" do
@@ -104,7 +87,7 @@
 
   # 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)
+    rm_r @file
     File.umask(0011)
     @fh = File.open(@file, @flags, 0755)
     @fh.should be_kind_of(File)
@@ -116,7 +99,7 @@
 
   # 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)
+    rm_r @file
     File.umask(0022)
     File.open(@file, "w", 0755){ |fh| @fd = fh.fileno }
     lambda { File.open(@fd) }.should raise_error(SystemCallError)
@@ -130,30 +113,22 @@
     # 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"
+    File.open(@file, "w", 0444) { |f| f.puts("test") }
+    @file.should have_data("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
+    File.chmod(0664, @file)
     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
+    File.open(@file, "w", 0444) { |f| f.puts("test") }
 
-    # it should be still possible to read from the file
-    File.read(@file).should == "test\n"
+    File.stat(@file).mode.to_s(8).should == orig_perms
+    @file.should have_data("test\n")
   end
 
   platform_is_not :windows do
     it "creates a new write-only file when invoked with 'w' and '0222'" do
-      File.delete(@file) if File.exists?(@file)
+      rm_r @file
       File.open(@file, 'w', 0222) {}
       File.readable?(@file).should == false
       File.writable?(@file).should == true
@@ -177,55 +152,55 @@
   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)
+    lambda { File.open(@nonexistent, 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)
+    lambda { File.open(@nonexistent, 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)
+    lambda { File.open(@nonexistent, '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)
+    lambda { File.open(@nonexistent, 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)
+    lambda { File.open(@nonexistent, 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)
+      lambda { File.open(@nonexistent, 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)
+      lambda { File.open(@nonexistent, 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)
+    lambda { File.open(@nonexistent, 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 = File.open(@nonexistent, 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 = File.open(@nonexistent, '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 = File.open(@nonexistent, 'w') { |f| f }
     @fh.should be_kind_of(File)
     File.exist?(@file).should == true
   end
@@ -323,17 +298,7 @@
     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
+  ruby_bug "#", "1.8.7.299" 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|
@@ -402,17 +367,7 @@
     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
+  ruby_bug "#", "1.8.7.299" 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|
@@ -557,6 +512,8 @@
   it "raises an ArgumentError if passed an invalid string for mode" do
     lambda { File.open(@file, 'fake') }.should raise_error(ArgumentError)
   end
-  
+end
+
+describe "File.open" do
   it_behaves_like :open_directory, :open
 end

Modified: MacRuby/trunk/spec/frozen/core/fixnum/exponent_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/exponent_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/fixnum/exponent_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -12,6 +12,30 @@
     (2 ** 40).should == 1099511627776
   end
 
+  it "overflows the answer to a bignum transparantly" do
+    (2 ** 29).should == 536870912
+    (2 ** 30).should == 1073741824
+    (2 ** 31).should == 2147483648
+    (2 ** 32).should == 4294967296
+
+    (2 ** 61).should == 2305843009213693952
+    (2 ** 62).should == 4611686018427387904
+    (2 ** 63).should == 9223372036854775808
+    (2 ** 64).should == 18446744073709551616
+  end
+
+  it "raises negative numbers to the given power" do
+    ((-2) ** 29).should == -536870912
+    ((-2) ** 30).should == 1073741824
+    ((-2) ** 31).should == -2147483648
+    ((-2) ** 32).should == 4294967296
+
+    ((-2) ** 61).should == -2305843009213693952
+    ((-2) ** 62).should == 4611686018427387904
+    ((-2) ** 63).should == -9223372036854775808
+    ((-2) ** 64).should == 18446744073709551616
+  end
+
   it "can raise 1 to a Bignum safely" do
     big = bignum_value(4611686018427387904)
     (1 ** big).should == 1

Modified: MacRuby/trunk/spec/frozen/core/float/comparison_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/comparison_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/float/comparison_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -38,7 +38,7 @@
     end
   end
 
-  ruby_bug "[ruby-dev:38672] [Bug #1645]", "1.8.7.248" do
+  ruby_bug "[ruby-dev:38672] [Bug #1645]", "1.8.7.302" do
     # The 4 tests below are taken from matz's revision 23730 for Ruby trunk
     #
     it "returns 1 when self is Infinity and other is a Bignum" do

Modified: MacRuby/trunk/spec/frozen/core/float/divide_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/divide_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/float/divide_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,4 +1,5 @@
 require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/coerce.rb', __FILE__)
 
 describe "Float#/" do
   it "returns self divided by other" do
@@ -7,6 +8,10 @@
     (91.1 / -0xffffffff).should be_close(-2.12108716418061e-08, TOLERANCE)
   end
   
+  it "properly coerces objects" do
+    (5.0 / FloatSpecs::CanCoerce.new(5)).should be_close(0, TOLERANCE)
+  end
+  
   it "properly handles BigDecimal argument" do
     require 'bigdecimal'
     (2.0 / BigDecimal.new('5.0')).should be_close(0.4, TOLERANCE)

Modified: MacRuby/trunk/spec/frozen/core/float/divmod_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/divmod_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/float/divmod_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,59 +1,47 @@
 require File.expand_path('../../../spec_helper', __FILE__)
 
-describe "Bignum#divmod" do
-  before(:each) do
-    @bignum = bignum_value(55)
+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)
+    values = -1.0.divmod(1)
+    values[0].should == -1
+    values[1].should == 0
   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]
+  # Behaviour established as correct in r23953
+  it "raises a FloatDomainError if self is NaN" do
+    lambda { nan_value.divmod(1) }.should raise_error(FloatDomainError)
   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)
+  # Behaviour established as correct in r23953
+  it "raises a FloatDomainError if other is NaN" do
+    lambda { 1.divmod(nan_value) }.should raise_error(FloatDomainError)
   end
 
   # Behaviour established as correct in r23953
-  it "raises a FloatDomainError if other is NaN" do
-    lambda { @bignum.divmod(nan_value) }.should raise_error(FloatDomainError)
+  it "raises a FloatDomainError if self is Infinity" do
+    lambda { infinity_value.divmod(1) }.should raise_error(FloatDomainError)
   end
 
   ruby_version_is ""..."1.9" do
-    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)
+    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
 
   ruby_version_is "1.9" do
-    it "raises a ZeroDivisionError when the given argument is 0 and a Float" do
-      lambda { @bignum.divmod(0.0) }.should raise_error(ZeroDivisionError)
-      lambda { (- at bignum).divmod(0.0) }.should raise_error(ZeroDivisionError)
+    it "raises a ZeroDivisionError if other is zero" do
+      lambda { 1.0.divmod(0)   }.should raise_error(ZeroDivisionError)
+      lambda { 1.0.divmod(0.0) }.should raise_error(ZeroDivisionError)
     end
   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
\ No newline at end of file
+end

Modified: MacRuby/trunk/spec/frozen/core/float/fdiv_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/fdiv_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/float/fdiv_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -8,7 +8,7 @@
     end
 
     it "performs floating-point division between self and a Fixnum" do
-      8.9.fdiv(7).should be_close(1.2714285714285716, TOLERANCE)
+      8.9.fdiv(7).should == 1.2714285714285716
     end
 
     it "performs floating-point division between self and a Bignum" do

Added: MacRuby/trunk/spec/frozen/core/float/fixtures/coerce.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/fixtures/coerce.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/float/fixtures/coerce.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,15 @@
+module FloatSpecs
+  class CanCoerce
+    def initialize(a)
+      @a = a
+    end
+
+    def coerce(b)
+      [self.class.new(b), @a]
+    end
+
+    def /(b)
+      @a.to_i % b.to_i
+    end
+  end
+end

Modified: MacRuby/trunk/spec/frozen/core/float/round_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/round_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/float/round_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -8,4 +8,15 @@
     0.0.round.should == 0
     0.49999999999999994.round.should == 0 # see http://jira.codehaus.org/browse/JRUBY-5048
   end
+  
+  ruby_version_is "1.9" do
+    it "rounds self to an optionally given precision" do
+      5.5.round(0).should == 6
+      1.2345678.round(2).should be_close(1.23, TOLERANCE)
+      123456.78.round(-2).should == 123500 # rounded up
+      12.345678.round(2.9999999999999999999).should be_close(12.346, TOLERANCE)
+      0.8346268.round(-2.0**30).should == 0
+    end
+  end
+  
 end

Modified: MacRuby/trunk/spec/frozen/core/float/shared/modulo.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/shared/modulo.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/float/shared/modulo.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -7,6 +7,8 @@
     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)
+
+    -1.0.send(@method, 1).should == 0
   end
 
   ruby_version_is ""..."1.9" do

Modified: MacRuby/trunk/spec/frozen/core/hash/initialize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/initialize_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/hash/initialize_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -19,6 +19,11 @@
     NewHash.new(:one, :two)[1].should == :two
   end
 
+  it "returns self" do
+    h = hash_class.new
+    h.send(:initialize).should equal(h)
+  end
+
   ruby_version_is ""..."1.9" do
     it "raises a TypeError if called on a frozen instance" do
       block = lambda { HashSpecs.frozen_hash.instance_eval { initialize() }}

Modified: MacRuby/trunk/spec/frozen/core/hash/shared/each.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/shared/each.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/hash/shared/each.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -11,6 +11,13 @@
     h.send(@method) { |k,v| r[k.to_s] = v.to_s }.should equal(h)
     r.should == new_hash("a" => "1", "b" => "2", "c" => "3", "d" => "5")
   end
+  
+  it "yields the key only to a block expecting |key,|" do
+    ary = []
+    h = new_hash(:a => 1, :b => 2, :c => 3)
+    h.send(@method) { |k,| ary << k }
+    ary.should == [:a, :b, :c]
+  end
 
   it "uses the same order as keys() and values()" do
     h = new_hash(:a => 1, :b => 2, :c => 3, :d => 5)

Modified: MacRuby/trunk/spec/frozen/core/kernel/Array_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/Array_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/kernel/Array_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,61 +1,96 @@
 require File.expand_path('../../../spec_helper', __FILE__)
 require File.expand_path('../fixtures/classes', __FILE__)
 
-describe "Kernel#Array" do
-  it "is a private method" do
+describe "Kernel" do
+  it "has private instance method Array()" do
     Kernel.should have_private_instance_method(:Array)
   end
-  
-  it "does not call #to_ary on an Array" do
-    obj = [1,2,3]
-    obj.should_not_receive(:to_ary)
+end
 
-    Array(obj).should == [1, 2, 3]
+describe :kernel_Array, :shared => true do
+  before :each do
+    @array = [1, 2, 3]
   end
 
-  it "tries to call #to_ary on the given argument if it's not an Array" do
-    (obj = mock('[1,2,3]')).should_receive(:to_ary).and_return([1, 2, 3])
+  it "does not call #to_ary on an Array" do
+    @array.should_not_receive(:to_ary)
+    @object.send(@method, @array).should == @array
+  end
+
+  it "calls #to_ary to convert the argument to an Array" do
+    obj = mock("Array([1,2,3])")
+    obj.should_receive(:to_ary).and_return(@array)
     obj.should_not_receive(:to_a)
 
-    Array(obj).should == [1, 2, 3]
+    @object.send(@method, obj).should == @array
   end
 
   it "does not call #to_a on an Array" do
-    obj = [1,2,3]
-    obj.should_not_receive(:to_a)
+    @array.should_not_receive(:to_a)
+    @object.send(@method, @array).should == @array
+  end
 
-    Array(obj).should == [1, 2, 3]
+  it "calls #to_a if the argument does not respond to #to_ary" do
+    obj = mock("Array([1,2,3])")
+    obj.should_receive(:to_a).and_return(@array)
+
+    @object.send(@method, obj).should == @array
   end
 
-  it "tries to call #to_a on the given argument if #to_ary is provided and it returns nil" do
-    (obj = mock('[4,5,6]')).should_receive(:to_ary).and_return(nil)
-    obj.should_receive(:to_a).and_return([4, 5, 6])
-    Array(obj).should == [4, 5, 6]
+  it "calls #to_a if #to_ary returns nil" do
+    obj = mock("Array([1,2,3])")
+    obj.should_receive(:to_ary).and_return(nil)
+    obj.should_receive(:to_a).and_return(@array)
+
+    @object.send(@method, obj).should == @array
   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]
+  ruby_version_is ""..."1.9" do
+    it "raises a TypeError if #to_a returns nil" do
+      obj = mock("Array([1,2,3])")
+      obj.should_receive(:to_a).and_return(nil)
+
+      lambda { @object.send(@method, obj) }.should raise_error(TypeError)
+    end
   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]
+
+  ruby_version_is "1.9" do
+    it "returns an Array containing the argument if #to_a returns nil" do
+      obj = mock("Array([1,2,3])")
+      obj.should_receive(:to_a).and_return(nil)
+
+      @object.send(@method, obj).should == [obj]
+    end
   end
-  
-  it "returns an empty array if the given argument is nil" do
-    Array(nil).should == []
+
+  it "returns an Array containing the argument if it responds to neither #to_ary nor #to_a" do
+    obj = mock("Array(x)")
+    @object.send(@method, obj).should == [obj]
   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)
+  it "returns an empty Array when passed nil" do
+    @object.send(@method, nil).should == []
   end
+
+  it "raises a TypeError if #to_ary does not return an Array" do
+    obj = mock("Array() string")
+    obj.should_receive(:to_ary).and_return("string")
+
+    lambda { @object.send(@method, obj) }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError if #to_a does not return an Array" do
+    obj = mock("Array() string")
+    obj.should_receive(:to_a).and_return("string")
+
+    lambda { @object.send(@method, obj) }.should raise_error(TypeError)
+  end
 end
 
 describe "Kernel.Array" do
-  it "needs to be reviewed for spec completeness"
+  it_behaves_like :kernel_Array, :Array_method, KernelSpecs
 end
+
+describe "Kernel#Array" do
+  it_behaves_like :kernel_Array, :Array_function, KernelSpecs
+end

Modified: MacRuby/trunk/spec/frozen/core/kernel/String_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/String_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/kernel/String_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -16,7 +16,7 @@
   end
 
   it "converts a constant to a String" do
-    @object.send(@method, Object).should == Object.to_s
+    @object.send(@method, Object).should == "Object"
   end
 
   it "calls #to_s to convert an arbitrary object to a String" do

Modified: MacRuby/trunk/spec/frozen/core/kernel/__method___spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/__method___spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/kernel/__method___spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,9 +1,41 @@
 require File.expand_path('../../../spec_helper', __FILE__)
 require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/__method__', __FILE__)
+require File.expand_path('../fixtures/__method__', __FILE__)
 
+# Can not, must not use a shared spec because #send influences
+# __method__ on 1.8.7
+
 describe "Kernel.__method__" do
   ruby_version_is '1.8.7' do
-    it_behaves_like(:kernel___method__, :__method__)
+    it "returns the current method, even when aliased" do
+      KernelSpecs::MethodTest.new.f.should == :f
+    end
+
+    it "returns the original name when aliased method" do
+      KernelSpecs::MethodTest.new.g.should == :f
+    end
+
+    it "returns the caller from blocks too" do
+      KernelSpecs::MethodTest.new.in_block.should == [:in_block, :in_block]
+    end
+
+    it "returns the caller from define_method too" do
+      KernelSpecs::MethodTest.new.dm.should == :dm
+    end
+
+    it "returns the caller from block inside define_method too" do
+      KernelSpecs::MethodTest.new.dm_block.should == [:dm_block, :dm_block]
+    end
+
+    it "returns method name even from eval" do
+      KernelSpecs::MethodTest.new.from_eval.should == :from_eval
+    end
+
+    # crashes hard on 1.8.7-p174
+    ruby_bug "unknown", "1.8.7.248" do
+      it "returns nil when not called from a method" do
+        __method__.should == nil
+      end
+    end
   end
 end

Modified: MacRuby/trunk/spec/frozen/core/kernel/define_singleton_method_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/define_singleton_method_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/kernel/define_singleton_method_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -4,11 +4,9 @@
 ruby_version_is '1.9' do
   describe "Kernel#define_singleton_method" do
     describe "when given an UnboundMethod" do
-      before :all do
-        class DefineSingletonMethodSpecClass
-          MY_CONST = 42
-          define_singleton_method(:another_test_method, self.method(:constants))
-        end
+      class DefineSingletonMethodSpecClass
+        MY_CONST = 42
+        define_singleton_method(:another_test_method, self.method(:constants))
       end
 
       it "correctly calls the new method" do

Modified: MacRuby/trunk/spec/frozen/core/kernel/eval_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/eval_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/kernel/eval_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -245,7 +245,7 @@
 
   it "should perform top level evaluations from inside a block" do
     # The class Object bit is needed to workaround some mspec oddness
-    class ::Object
+    class Object
       [1].each { eval "Const = 1"}
       Const.should == 1
       remove_const :Const
@@ -282,6 +282,12 @@
       x.should == 42
     end
   end
+
+  # See http://jira.codehaus.org/browse/JRUBY-5163
+  it "uses the receiver as self inside the eval" do
+    eval("self").should equal(self)
+    Kernel.eval("self").should equal(Kernel)
+  end
 end
 
 describe "Kernel.eval" do

Modified: MacRuby/trunk/spec/frozen/core/kernel/extend_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/extend_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/kernel/extend_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -11,6 +11,11 @@
     ScratchPad << "extended"
     super
   end
+
+  def self.append_features(o)
+    ScratchPad << "append_features"
+    super
+  end
 end
 
 describe "Kernel#extend" do
@@ -24,6 +29,12 @@
     ScratchPad.recorded.include?("extend_object").should == true
   end
 
+  it "does not calls append_features on arguments metaclass" do
+    o = mock('o')
+    o.extend KernelSpecs::M
+    ScratchPad.recorded.include?("append_features").should == false
+  end
+
   it "calls extended on argument" do
     o = mock('o')
     o.extend KernelSpecs::M

Added: MacRuby/trunk/spec/frozen/core/kernel/fixtures/__method__.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/fixtures/__method__.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/kernel/fixtures/__method__.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,25 @@
+module KernelSpecs
+  class MethodTest
+    def f
+      __method__
+    end
+
+    alias_method :g, :f
+
+    def in_block
+      (1..2).map { __method__ }
+    end
+
+    define_method(:dm) do
+      __method__
+    end
+
+    define_method(:dm_block) do
+      (1..2).map { __method__ }
+    end
+
+    def from_eval
+      eval "__method__"
+    end
+  end
+end


Property changes on: MacRuby/trunk/spec/frozen/core/kernel/fixtures/__method__.rb
___________________________________________________________________
Added: svn:executable
   + *

Modified: MacRuby/trunk/spec/frozen/core/kernel/fixtures/classes.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/fixtures/classes.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/kernel/fixtures/classes.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,6 +1,14 @@
 require File.expand_path('../caller_fixture1', __FILE__)
 
 module KernelSpecs
+  def self.Array_function(arg)
+    Array(arg)
+  end
+
+  def self.Array_method(arg)
+    Kernel.Array(arg)
+  end
+
   class Method
     def abort(*msg)
       super
@@ -12,6 +20,16 @@
     module MetaclassMethods
       def peekaboo
       end
+
+      protected
+
+      def nopeeking
+      end
+
+      private
+
+      def shoo
+      end
     end
 
     def self.ichi; end
@@ -81,6 +99,10 @@
     define_method(:defined_method) { :defined }
   end
 
+  class B < A
+    alias aliased_pub_method pub_method
+  end
+
   class Binding
     @@super_secret = "password"
 

Modified: MacRuby/trunk/spec/frozen/core/kernel/instance_variable_get_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/instance_variable_get_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/kernel/instance_variable_get_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -38,6 +38,12 @@
     obj.stub!(:to_str).and_return("test")
     lambda { @obj.instance_variable_get(obj) }.should raise_error(NameError)
   end
+
+  it "returns nil when passed just '@'" do
+    obj = mock("to_str")
+    obj.stub!(:to_str).and_return('@')
+    @obj.instance_variable_get(obj).should be_nil
+  end
 end
 
 describe "Kernel#instance_variable_get when passed Symbol" do
@@ -53,6 +59,10 @@
   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
+
+  it "returns nil when passed just '@'" do
+    @obj.instance_variable_get(:"@").should be_nil
+  end
 end
 
 describe "Kernel#instance_variable_get when passed String" do
@@ -68,6 +78,10 @@
   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
+
+  it "returns nil when passed just '@'" do
+    @obj.instance_variable_get("@").should be_nil
+  end
 end
 
 describe "Kernel#instance_variable_get when passed Fixnum" do

Modified: MacRuby/trunk/spec/frozen/core/kernel/instance_variable_set_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/instance_variable_set_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/kernel/instance_variable_set_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -4,10 +4,10 @@
 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 
+      def initialize(p1, p2)
+        @a, @b = p1, p2
+      end
+    end
     Dog.new('cat', 99).instance_variable_set(:@a, 'dog').should == "dog"
   end
 
@@ -21,12 +21,17 @@
     lambda { NoDog.new.instance_variable_set(:c, "cat") }.should raise_error(NameError)
   end
 
+  it "sets the value of the instance variable if argument is '@'" do
+    class DogAt; end
+    DogAt.new.instance_variable_set(:'@', "cat").should == "cat"
+  end
+
   ruby_version_is ""..."1.9" do
     it "raises an ArgumentError if the instance variable name is a Fixnum" do
       lambda { "".instance_variable_set(1, 2) }.should raise_error(ArgumentError)
     end
   end
-  
+
   ruby_version_is "1.9" do
     it "raises a TypeError if the instance variable name is a Fixnum" do
       lambda { "".instance_variable_set(1, 2) }.should raise_error(TypeError)
@@ -37,7 +42,7 @@
     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
@@ -46,11 +51,11 @@
     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

Modified: MacRuby/trunk/spec/frozen/core/kernel/method_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/method_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/kernel/method_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -21,6 +21,11 @@
     @obj.method(:protected_method).should be_an_instance_of(Method)
   end
 
+  it "will see an alias of the original method as == when in a derived class" do
+    obj = KernelSpecs::B.new
+    obj.method(:aliased_pub_method).should == obj.method(:pub_method)
+  end
+
   it "can call methods created with define_method" do
     m = @obj.method(:defined_method)
     m.call.should == :defined

Modified: MacRuby/trunk/spec/frozen/core/kernel/private_methods_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/private_methods_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/kernel/private_methods_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -25,6 +25,12 @@
       m = KernelSpecs::PublicSub.new
       m.private_methods.should_not include("public_in_sub")
     end
+
+    it "returns private methods mixed in to the metaclass" do
+      m = KernelSpecs::Methods.new
+      m.extend(KernelSpecs::Methods::MetaclassMethods)
+      m.private_methods.should include('shoo')
+    end
   end
 
   ruby_version_is "1.9" do
@@ -42,5 +48,11 @@
       m = KernelSpecs::Methods.new.private_methods
       m.should include(:juu_shi)
     end
+
+    it "returns private methods mixed in to the metaclass" do
+      m = KernelSpecs::Methods.new
+      m.extend(KernelSpecs::Methods::MetaclassMethods)
+      m.private_methods.should include(:shoo)
+    end
   end
 end

Modified: MacRuby/trunk/spec/frozen/core/kernel/protected_methods_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/protected_methods_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/kernel/protected_methods_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -16,6 +16,12 @@
       (l1 & l2).should include("juu_ichi")
       KernelSpecs::Methods.new.protected_methods.should include('ku')
     end
+
+    it "returns protected methods mixed in to the metaclass" do
+      m = KernelSpecs::Methods.new
+      m.extend(KernelSpecs::Methods::MetaclassMethods)
+      m.protected_methods.should include('nopeeking')
+    end
   end
 
   ruby_version_is "1.9" do
@@ -30,5 +36,11 @@
       (l1 & l2).should include(:juu_ichi)
       KernelSpecs::Methods.new.protected_methods.should include(:ku)
     end
+
+    it "returns methods mixed in to the metaclass" do
+      m = KernelSpecs::Methods.new
+      m.extend(KernelSpecs::Methods::MetaclassMethods)
+      m.protected_methods.should include(:nopeeking)
+    end
   end
 end

Modified: MacRuby/trunk/spec/frozen/core/kernel/public_methods_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/public_methods_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/kernel/public_methods_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -15,6 +15,12 @@
       m = KernelSpecs::Methods.new.public_methods
       m.should include('ni', 'juu_san')
     end
+
+    it "returns public methods mixed in to the metaclass" do
+      m = KernelSpecs::Methods.new
+      m.extend(KernelSpecs::Methods::MetaclassMethods)
+      m.public_methods.should include('peekaboo')
+    end
   end
 
   ruby_version_is "1.9" do
@@ -30,5 +36,11 @@
       m = KernelSpecs::Methods.new.public_methods
       m.should include(:ni, :juu_san)
     end
+
+    it "returns methods mixed in to the metaclass" do
+      m = KernelSpecs::Methods.new
+      m.extend(KernelSpecs::Methods::MetaclassMethods)
+      m.public_methods.should include(:peekaboo)
+    end
   end
 end

Modified: MacRuby/trunk/spec/frozen/core/kernel/shared/abort.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/shared/abort.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/kernel/shared/abort.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -19,4 +19,8 @@
     lambda { @object.abort "a message" }.should raise_error(SystemExit)
     $stderr.should =~ /a message/
   end
+  
+  it "raises TypeError when given a non-String object" do
+    lambda { @object.abort 123 }.should raise_error(TypeError)
+  end
 end

Modified: MacRuby/trunk/spec/frozen/core/kernel/shared/require.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/shared/require.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/kernel/shared/require.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -331,6 +331,51 @@
       ScratchPad.recorded.should == []
     end
 
+    it "respects being replaced with a new array" do
+      prev = $LOADED_FEATURES.dup
+
+      @object.require(@path).should be_true
+      $LOADED_FEATURES.should == [@path]
+
+      $LOADED_FEATURES.replace(prev)
+
+      @object.require(@path).should be_true
+      $LOADED_FEATURES.should == [@path]
+    end
+
+    describe "when a non-extensioned file is in $LOADED_FEATURES" do
+      before :each do
+        $LOADED_FEATURES << "load_fixture"
+      end
+
+      it "loads a .rb extensioned file when a non extensioned file is in $LOADED_FEATURES" do
+        $LOAD_PATH << CODE_LOADING_DIR
+        @object.require("load_fixture").should be_true
+        ScratchPad.recorded.should == [:loaded]
+      end
+
+      it "loads a .rb extensioned file from a subdirectory" do
+        $LOAD_PATH << File.dirname(CODE_LOADING_DIR)
+        @object.require("code/load_fixture").should be_true
+        ScratchPad.recorded.should == [:loaded]
+      end
+
+      it "returns false if the file is not found" do
+        Dir.chdir File.dirname(CODE_LOADING_DIR) do
+          @object.require("load_fixture").should be_false
+          ScratchPad.recorded.should == []
+        end
+      end
+
+      it "returns false when passed a path and the file is not found" do
+        $LOADED_FEATURES << "code/load_fixture"
+        Dir.chdir CODE_LOADING_DIR do
+          @object.require("code/load_fixture").should be_false
+          ScratchPad.recorded.should == []
+        end
+      end
+    end
+
     ruby_version_is "".."1.9" do
       it "stores ./ relative paths as passed in" do
         $LOAD_PATH << "an_irrelevant_dir"

Modified: MacRuby/trunk/spec/frozen/core/kernel/singleton_methods_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/singleton_methods_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/kernel/singleton_methods_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -47,6 +47,26 @@
       
       KernelSpecs::Methods.new.singleton_methods.should == []
     end
+
+    it "includes public and protected methods defined through a mixin into the metaclass based on the flag" do
+      m = KernelSpecs::Methods.new
+      class << m
+        include MetaclassMethods
+      end
+      m.singleton_methods.should include("peekaboo")
+      m.singleton_methods.should include("nopeeking")
+      m.singleton_methods(false).should_not include("peekaboo")
+      m.singleton_methods(false).should_not include("nopeeking")
+    end
+
+    it "does not include private methods defined through a mixin into the metaclass" do
+      m = KernelSpecs::Methods.new
+      class << m
+        include MetaclassMethods
+      end
+      m.singleton_methods.should_not include("shoo")
+      m.singleton_methods(false).should_not include("shoo")
+    end
   end
 end
 
@@ -96,5 +116,25 @@
       
       KernelSpecs::Methods.new.singleton_methods.should == []
     end
+
+    it "includes public and protected methods defined through a mixin into the metaclass based on the flag" do
+      m = KernelSpecs::Methods.new
+      class << m
+        include MetaclassMethods
+      end
+      m.singleton_methods.should include(:peekaboo)
+      m.singleton_methods.should include(:nopeeking)
+      m.singleton_methods(false).should_not include(:peekaboo)
+      m.singleton_methods(false).should_not include(:nopeeking)
+    end
+
+    it "does not include private methods defined through a mixin into the metaclass" do
+      m = KernelSpecs::Methods.new
+      class << m
+        include MetaclassMethods
+      end
+      m.singleton_methods.should_not include(:shoo)
+      m.singleton_methods(false).should_not include(:shoo)
+    end
   end
 end  

Modified: MacRuby/trunk/spec/frozen/core/kernel/sprintf_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/sprintf_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/kernel/sprintf_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -5,7 +5,7 @@
   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
@@ -15,6 +15,292 @@
       sprintf("%d%d%s%s", nil, 4, 'a', 'b').should == '04ab'
     end
   end
+
+  it "passes some tests for positive %x" do
+    sprintf("%x", 123).should == "7b"
+    sprintf("%0x", 123).should == "7b"
+    sprintf("% x", 123).should == " 7b"
+    sprintf("%+x", 123).should == "+7b"
+    sprintf("%+0x", 123).should == "+7b"
+    sprintf("%+ x", 123).should == "+7b"
+    sprintf("% 0x", 123).should == " 7b"
+
+    sprintf("%#x", 123).should == "0x7b"
+    sprintf("%#0x", 123).should == "0x7b"
+    sprintf("%# x", 123).should == " 0x7b"
+    sprintf("%#+x", 123).should == "+0x7b"
+    sprintf("%#+0x", 123).should == "+0x7b"
+    sprintf("%#+ x", 123).should == "+0x7b"
+    sprintf("%# 0x", 123).should == " 0x7b"
+
+    sprintf("%8x", 123).should == "      7b"
+    sprintf("%08x", 123).should == "0000007b"
+    sprintf("% 8x", 123).should == "      7b"
+    sprintf("%+8x", 123).should == "     +7b"
+    sprintf("%+08x", 123).should == "+000007b"
+    sprintf("%+ 8x", 123).should == "     +7b"
+    sprintf("% 08x", 123).should == " 000007b"
+
+    sprintf("%#8x", 123).should == "    0x7b"
+    sprintf("%#08x", 123).should == "0x00007b"
+    sprintf("%# 8x", 123).should == "    0x7b"
+    sprintf("%#+8x", 123).should == "   +0x7b"
+    sprintf("%#+08x", 123).should == "+0x0007b"
+    sprintf("%#+ 8x", 123).should == "   +0x7b"
+    sprintf("%# 08x", 123).should == " 0x0007b"
+
+    sprintf("%8.10x", 123).should == "000000007b"
+    sprintf("%08.10x", 123).should == "000000007b"
+    sprintf("% 8.10x", 123).should == " 000000007b"
+    sprintf("%+8.10x", 123).should == "+000000007b"
+    sprintf("%+08.10x", 123).should == "+000000007b"
+    sprintf("%+ 8.10x", 123).should == "+000000007b"
+    sprintf("% 08.10x", 123).should == " 000000007b"
+
+    sprintf("%10.8x", 123).should == "  0000007b"
+    sprintf("%010.8x", 123).should == "  0000007b"
+    sprintf("% 10.8x", 123).should == "  0000007b"
+    sprintf("%+10.8x", 123).should == " +0000007b"
+    sprintf("%+010.8x", 123).should == " +0000007b"
+    sprintf("%+ 10.8x", 123).should == " +0000007b"
+    sprintf("% 010.8x", 123).should == "  0000007b"
+  end
+
+  ruby_bug "svn r29502", "1.9.2.135" do
+    describe "with negative values" do
+      describe "with format %x" do
+        it "precedes the number with '..'" do
+          [ ["%0x",     "..f85"],
+            ["%#0x",    "0x..f85"],
+            ["%08x",    "..ffff85"],
+            ["%#08x",   "0x..ff85"],
+            ["%8.10x",  "..ffffff85"],
+            ["%08.10x", "..ffffff85"],
+            ["%10.8x",  "  ..ffff85"],
+            ["%010.8x", "  ..ffff85"],
+          ].should be_computed_by_function(:sprintf, -123)
+        end
+      end
+
+      describe "with format %u" do
+        it "precedes the number with '-'" do
+          [ ["%u",        "-123"],
+            ["%0u",       "-123"],
+            ["%#u",       "-123"],
+            ["%#0u",      "-123"],
+            ["%8u",       "    -123"],
+            ["%08u",      "-0000123"],
+            ["%#8u",      "    -123"],
+            ["%#08u",     "-0000123"],
+            ["%30u",      "                          -123"],
+            ["%030u",     "-00000000000000000000000000123"],
+            ["%#30u",     "                          -123"],
+            ["%#030u",    "-00000000000000000000000000123"],
+            ["%24.30u",   "-000000000000000000000000000123"],
+            ["%024.30u",  "-000000000000000000000000000123"],
+            ["%#24.30u",  "-000000000000000000000000000123"],
+            ["%#024.30u", "-000000000000000000000000000123"],
+            ["%30.24u",   "     -000000000000000000000123"],
+            ["%030.24u",  "     -000000000000000000000123"],
+            ["%#30.24u",  "     -000000000000000000000123"],
+            ["%#030.24u", "     -000000000000000000000123"],
+          ].should be_computed_by_function(:sprintf, -123)
+        end
+      end
+
+      describe "with format %b or %B" do
+        it "precedes the number with '..'" do
+          [ ["%.7b", "..11011"],
+            ["%.7B", "..11011"],
+            ["%0b",  "..1011"],
+          ].should be_computed_by_function(:sprintf, -5)
+        end
+      end
+    end
+  end
+
+  it "passes some tests for negative %x" do
+    sprintf("%x", -123).should == "..f85"
+    sprintf("% x", -123).should == "-7b"
+    sprintf("%+x", -123).should == "-7b"
+    sprintf("%+0x", -123).should == "-7b"
+    sprintf("%+ x", -123).should == "-7b"
+    sprintf("% 0x", -123).should == "-7b"
+
+    sprintf("%#x", -123).should == "0x..f85"
+    sprintf("%# x", -123).should == "-0x7b"
+    sprintf("%#+x", -123).should == "-0x7b"
+    sprintf("%#+0x", -123).should == "-0x7b"
+    sprintf("%#+ x", -123).should == "-0x7b"
+    sprintf("%# 0x", -123).should == "-0x7b"
+
+    sprintf("%8x", -123).should == "   ..f85"
+    sprintf("% 8x", -123).should == "     -7b"
+    sprintf("%+8x", -123).should == "     -7b"
+    sprintf("%+08x", -123).should == "-000007b"
+    sprintf("%+ 8x", -123).should == "     -7b"
+    sprintf("% 08x", -123).should == "-000007b"
+
+    sprintf("%#8x", -123).should == " 0x..f85"
+    sprintf("%# 8x", -123).should == "   -0x7b"
+    sprintf("%#+8x", -123).should == "   -0x7b"
+    sprintf("%#+08x", -123).should == "-0x0007b"
+    sprintf("%#+ 8x", -123).should == "   -0x7b"
+    sprintf("%# 08x", -123).should == "-0x0007b"
+
+    sprintf("% 8.10x", -123).should == "-000000007b"
+    sprintf("%+8.10x", -123).should == "-000000007b"
+    sprintf("%+08.10x", -123).should == "-000000007b"
+    sprintf("%+ 8.10x", -123).should == "-000000007b"
+    sprintf("% 08.10x", -123).should == "-000000007b"
+
+    sprintf("% 10.8x", -123).should == " -0000007b"
+    sprintf("%+10.8x", -123).should == " -0000007b"
+    sprintf("%+010.8x", -123).should == " -0000007b"
+    sprintf("%+ 10.8x", -123).should == " -0000007b"
+    sprintf("% 010.8x", -123).should == " -0000007b"
+  end
+
+  it "passes some tests for negative %u" do
+    sprintf("% u", -123).should == "-123"
+    sprintf("%+u", -123).should == "-123"
+    sprintf("%+0u", -123).should == "-123"
+    sprintf("%+ u", -123).should == "-123"
+    sprintf("% 0u", -123).should == "-123"
+
+    sprintf("%# u", -123).should == "-123"
+    sprintf("%#+u", -123).should == "-123"
+    sprintf("%#+0u", -123).should == "-123"
+    sprintf("%#+ u", -123).should == "-123"
+    sprintf("%# 0u", -123).should == "-123"
+
+    sprintf("% 8u", -123).should == "    -123"
+    sprintf("%+8u", -123).should == "    -123"
+    sprintf("%+08u", -123).should == "-0000123"
+    sprintf("%+ 8u", -123).should == "    -123"
+    sprintf("% 08u", -123).should == "-0000123"
+
+    sprintf("%# 8u", -123).should == "    -123"
+    sprintf("%#+8u", -123).should == "    -123"
+    sprintf("%#+08u", -123).should == "-0000123"
+    sprintf("%#+ 8u", -123).should == "    -123"
+    sprintf("%# 08u", -123).should == "-0000123"
+
+
+    platform_is :wordsize => 32 do
+    end
+
+    platform_is :wordsize => 64 do
+      sprintf("%u", -123).should == "..18446744073709551493"
+      sprintf("%0u", -123).should == "18446744073709551493"
+      sprintf("%#u", -123).should == "..18446744073709551493"
+      sprintf("%#0u", -123).should == "18446744073709551493"
+      sprintf("%8u", -123).should == "..18446744073709551493"
+      sprintf("%08u", -123).should == "18446744073709551493"
+      sprintf("%#8u", -123).should == "..18446744073709551493"
+      sprintf("%#08u", -123).should == "18446744073709551493"
+
+      sprintf("%30u", -123).should == "        ..18446744073709551493"
+      sprintf("%030u", -123).should == "..........18446744073709551493"
+
+      sprintf("%#30u", -123).should == "        ..18446744073709551493"
+      sprintf("%#030u", -123).should == "..........18446744073709551493"
+
+      sprintf("%24.30u", -123).should == "..........18446744073709551493"
+      sprintf("%024.30u", -123).should == "..........18446744073709551493"
+
+      sprintf("%#24.30u", -123).should == "..........18446744073709551493"
+      sprintf("%#024.30u", -123).should == "..........18446744073709551493"
+
+
+      sprintf("%30.24u", -123).should == "      ....18446744073709551493"
+      sprintf("%030.24u", -123).should == "      ....18446744073709551493"
+
+      sprintf("%#30.24u", -123).should == "      ....18446744073709551493"
+      sprintf("%#030.24u", -123).should == "      ....18446744073709551493"
+    end
+  end
+
+  it "passes some tests for positive %u" do
+    sprintf("%30u", 123).should == "                           123"
+    sprintf("%030u", 123).should == "000000000000000000000000000123"
+
+    sprintf("%#30u", 123).should == "                           123"
+    sprintf("%#030u", 123).should == "000000000000000000000000000123"
+
+
+    sprintf("%24.30u", 123).should == "000000000000000000000000000123"
+    sprintf("%024.30u", 123).should == "000000000000000000000000000123"
+
+    sprintf("%#24.30u", 123).should == "000000000000000000000000000123"
+    sprintf("%#024.30u", 123).should == "000000000000000000000000000123"
+
+
+    sprintf("%30.24u", 123).should == "      000000000000000000000123"
+    sprintf("%030.24u", 123).should == "      000000000000000000000123"
+
+    sprintf("%#30.24u", 123).should == "      000000000000000000000123"
+    sprintf("%#030.24u", 123).should == "      000000000000000000000123"
+  end
+
+  it "passes some tests for positive %f" do
+    sprintf("%30f", 123.1).should == "                    123.100000"
+    sprintf("%030f", 123.1).should == "00000000000000000000123.100000"
+
+    sprintf("%#30f", 123.1).should == "                    123.100000"
+    sprintf("%#030f", 123.1).should == "00000000000000000000123.100000"
+
+    sprintf("%10.4f", 123.1).should == "  123.1000"
+    sprintf("%010.4f", 123.1).should == "00123.1000"
+
+    sprintf("%10.0f", 123.1).should == "       123"
+    sprintf("%010.0f", 123.1).should == "0000000123"
+  end
+
+  it "passes some tests for negative %f" do
+    sprintf("%30f", -123.5).should == "                   -123.500000"
+    sprintf("%030f", -123.5).should == "-0000000000000000000123.500000"
+
+    sprintf("%#30f", -123.5).should == "                   -123.500000"
+    sprintf("%#030f", -123.5).should == "-0000000000000000000123.500000"
+
+    sprintf("%10.4f", -123.5).should == " -123.5000"
+    sprintf("%010.4f", -123.5).should == "-0123.5000"
+
+    sprintf("%10.0f", -123.5).should == "      -124"
+    sprintf("%010.0f", -123.5).should == "-000000124"
+  end
+
+  it "passes kstephens's tests" do
+    sprintf("%*1$.*2$3$d", 10, 5, 1).should == "     00001"
+    sprintf("%b", 0).should == "0"
+    sprintf("%B", 0).should == "0"
+    sprintf("%b", -5).should == "..1011"
+    sprintf("%B", -5).should == "..1011"
+    sprintf("%+b", -5).should == "-101"
+    sprintf("%+b", 10).should == "+1010"
+    sprintf("%+b", 0).should == "+0"
+    sprintf("%+o", -5).should == "-5"
+    sprintf("%+o", 10).should == "+12"
+    sprintf("%+o", 0).should == "+0"
+    sprintf("%+d", -5).should == "-5"
+    sprintf("%+d", 10).should == "+10"
+    sprintf("%+d", 0).should == "+0"
+    sprintf("%+x", -15).should == "-f"
+    sprintf("%+x", 100).should == "+64"
+    sprintf("%+x", 0).should == "+0"
+    sprintf("%+X", -15).should == "-F"
+    sprintf("%+X", 100).should == "+64"
+    sprintf("%+X", 0).should == "+0"
+    sprintf("=%02X", 1).should == "=01"
+    sprintf("%+03d", 0).should == "+00"
+    sprintf("%+03d", 5).should == "+05"
+    sprintf("%+03d", -5).should == "-05"
+    sprintf("%+03d", 12).should == "+12"
+    sprintf("%+03d", -12).should == "-12"
+    sprintf("%+03d", 123).should == "+123"
+    sprintf("%+03d", -123).should == "-123"
+  end
 end
 
 describe "Kernel.sprintf" do

Modified: MacRuby/trunk/spec/frozen/core/marshal/dump_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/marshal/dump_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/marshal/dump_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -57,6 +57,70 @@
     lambda { Marshal.dump(klass) }.should raise_error(TypeError)
     lambda { Marshal.dump(mod)   }.should raise_error(TypeError)
   end
+  
+  ruby_version_is ""..."1.9" do
+    it "invokes respond_to? for marshal_dump and _dump on user classes" do
+      obj = UserDefinedWithRespondTo.new
+      
+      result = Marshal.dump(obj)
+      
+      obj.collected.should == [:marshal_dump, :_dump]
+      obj.marshal_dump_called.should be_nil
+      obj._dump_called.should be_nil
+    end
+    
+    it "attempts to invoke marshal_dump if respond_to? :marshal_dump is true" do
+      obj = UserDefinedWithRespondTo.new(:marshal_dump)
+      
+      result = Marshal.dump(obj)
+      
+      obj.collected.should == [:marshal_dump]
+      obj.marshal_dump_called.should be_true
+      obj._dump_called.should be_nil
+    end
+    
+    it "attempts to invoke _dump if respond_to? :_dump is true" do
+      obj = UserDefinedWithRespondTo.new(:_dump)
+      
+      result = Marshal.dump(obj)
+      
+      obj.collected.should == [:marshal_dump, :_dump]
+      obj.marshal_dump_called.should be_nil
+      obj._dump_called.should be_true
+    end
+  end
+  
+  ruby_version_is "1.9" do
+    it "invokes respond_to? for marshal_dump and _dump on user classes" do
+      obj = UserDefinedWithRespondTo.new
+      
+      result = Marshal.dump(obj)
+      
+      obj.collected.should == [:marshal_dump, :_dump]
+      obj.marshal_dump_called.should be_nil
+      obj._dump_called.should be_nil
+    end
+    
+    it "attempts to invoke marshal_dump if respond_to? :marshal_dump is true" do
+      obj = UserDefinedWithRespondTo.new(:marshal_dump)
+      
+      result = Marshal.dump(obj)
+      
+      obj.collected.should == [:marshal_dump]
+      obj.marshal_dump_called.should be_true
+      obj._dump_called.should be_nil
+    end
+    
+    it "attempts to invoke _dump if respond_to? :_dump is true" do
+      obj = UserDefinedWithRespondTo.new(:_dump)
+      
+      result = Marshal.dump(obj)
+      
+      obj.collected.should == [:marshal_dump, :_dump]
+      obj.marshal_dump_called.should be_nil
+      obj._dump_called.should be_true
+    end
+  end
 
   it "raises a TypeError if _dump returns a non-string" do
     lambda { Marshal.dump(UserDefinedBad.new) }.should raise_error(TypeError)

Modified: MacRuby/trunk/spec/frozen/core/marshal/fixtures/marshal_data.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/marshal/fixtures/marshal_data.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/marshal/fixtures/marshal_data.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -139,6 +139,50 @@
 Struct.new "Pyramid"
 Struct.new "Useful", :a, :b
 
+class UserDefinedWithRespondTo
+  def initialize(*names)
+    @names = names
+  end
+  def collected
+    @collected ||= []
+  end
+  attr_reader :marshal_dump_called, :_dump_called
+  def respond_to?(name)
+    collected << name
+    @names.include? name
+  end
+  def marshal_dump
+    @marshal_dump_called = true
+    "marshal_dump"
+  end
+  def _dump(depth)
+    @_dump_called = true
+    "_dump"
+  end
+end
+
+class UserDefinedWithRespondToMarshalLoad
+  def marshal_dump
+    "dump"
+  end
+  
+  def respond_to?(name)
+    throw :RespondTo if name == :marshal_load
+  end
+end
+
+class UserDefinedWithRespondToLoad
+  def _dump(depth)
+    "dump"
+  end
+  
+  class << self
+    def respond_to?(name)
+      throw :RespondTo if name == :_load
+    end
+  end
+end
+
 module MarshalSpec
   def self.random_data
     randomizer = Random.new(42)
@@ -243,6 +287,8 @@
                     "\004\bf\0061"],
     "Float 8323434.342" => [8323434.342,
                             "\004\bf\0328323434.3420000002\000S\370"],
+    "Float 1.0799999999999912" => [1.0799999999999912,
+                            "\004\bf\0321.0799999999999912\000\341 "],
     "Hash" => [Hash.new,
                "\004\b{\000"],
     "Hash subclass" => [UserHash.new,

Added: MacRuby/trunk/spec/frozen/core/marshal/fixtures/random.dump
===================================================================
--- MacRuby/trunk/spec/frozen/core/marshal/fixtures/random.dump	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/marshal/fixtures/random.dump	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,19 @@
+U:Random[l+\xE0\xE1489\x94_9\x8A\xC2$\\xC2\xC6Zjm\x85Y\xFB\x85.\x94\xFB
tG\xCAX\x95 y,rF_-\xAB\x83!c\xDE~\xAF%ݵ\xEFt\x9D\xD4>S@
e$\xD0R>3C\xB9s\xAE&B\x9B@Խ'\x9FXq\xA2TTvկ\xB3)0\xCD\xE8&\xDE\xF4\xE2
|\xACWM\x98\xA3Ž\xA6e
\xAC\xECJ8*\xA9䠹\xB2Xm\xD9\xFF\xA9j\xAB\xB8\xBCM0L*
+ļ\xA3O|D\xB9>\xB34\xA0?Pt\xB8YW\xE0\xB9}\xC0j\xF9\xFD\x96\xAA2\x9C\xADw\xE2\xB1e\xEB\xA09su\xD4D1\x976\xE2L\x86R\x8Cō\x9B>B\xF3\x91\xBD\xEB\xA1\xBE\xDFH\xEF\xD1ݫ%\x95\xBDN\xF3	\xBF\x8B
+'\xFC\xBAϋT\xAA\xC8\xC6)i\xA8\xAAoyYb\xDB}-\x81A\xB6\xD2\x87+
HT\xA1"\x97T\x96|\xFAs\xC0
2\xF0B\x99l>\x95F\x8F\xEE-\xA8\xDDv\x88B\cs,:\x9A\x85
\xD1\xD5n`
Sc
+,\x9C\xE8\xB3.\x9C+\xD0\\xF5)\x97\xB6j\x84܂\x9Ak\x81\xB1(\xD8\xF2p\x85^\x87vmQ\xB3[
\xC4Q\x81\xF8NS٩\x8E\xE1,N\xC1\xD2]\x88\xD8\xCF\x94\xF7\x849OI\xC3\xEDz%\x9C\xDC \x95\xB6wg\x8F
+=
\xF6\xCF"Տ\xC6F]>\x86\xDD?\xF0\xA5¿\xEB2"(頬\x93 \x9D3\x8Dq\xD7:!\xF9\xA6\xA7O͞B|\xA3\xDCj\xA9$\x93!\xD9?\xA8\xEF\xF1k\xAD\xE3!\xB6\xC0o&\xA9L\xA5_\xC1k\xA5, ްV\xB3\x8Ag\xBE\xE8r+\x80\xFE嘷T\xDFd\xFDq\x97
+u=\xA6v\x86\xCATedI
\xC2u*\xBF\xD0\xDE\xC0g+\xF7\xBFGD\xCEL\xDE0\xAAh\x94\xB4K��\xF8lb\xC9\xE1_\x96j\xBE*L\xB0-\xFA\x87\xD7+Kx4Qe\xFB\xBAHݳI\xFB\x82\xBBG\x96\xEFVU>\xA6\xDB\xE9~f 2\xCCjR\x86`P\xFB\x8D\xA6x\x82N?\xCB\xCC=-ZR\\xEA4\x92
N[[!g?\x85I\xED\x8C:e\xF6\xEB8\x89(ҟ\x8B{(h\xA2\xD6:
`;\xF0\xE6\xA9(\xB1u\xF4#4<\x89\x81{\xF6\xD5ܓ}Vv\xAB\xF3g6\xBFBԷH\xD8q\xE8!X\xBDX\x96(?\xD1A\xE0	\xF2\xA3\xDB\xE8Z\xED~\xA5\x96B٣9.\xE4\xE7\xEA\xCF\xFA\x8D\xE1Moj\xB3w\xDBh\xF1\xAEN\xF1]\xEB\xC8\xCF\xFA\xE6(\xF5˖\v
\xD9+\xE0S0W\x8A\x9B\xA5+\xD2+9F\x89\x81\xE6\x8D\xEE1\x89\x978\xB1[W\xD4!EAOBub\xA8\x80(ߟ\xB4\xC9\xFD\xEAZ\x92\xCB Y\xD1T\xB3\xB3#\xB5NI-H
\xF17\xC6\xE6֖i\xE3\x9Eǣ7\x92\x8FX\xF0\xC4R\x8D\xBF(\x9F\xE4\xC0\xEF\xD0<\xA9\x9A.\xC6\xC2\xC2)v\x9B\xACY\xA2\xAA5\xD3jY7c\xB6\xB2\xA4\xE2\xEF]
+\xEC3\xD0\xCFύF\x89\xAE\x80r\x8E\xE1\xB8 at fz\xA6\x9Am%\xC0\xCBA!"\xDAp\xE8\xD3\xE4	\xF5\x9B;\xFF\xFDvX\xCBi<,BMl
+w\xE8\xAF\xED\xA4\xD4ڤ\xA8Y\xA5Q\xDCђ\xB0>v^a\xE6ߤ߆=p\xA8\xBC'\x82\xB6B\xA2\x9F\xC2\xE0\xD9nh\xDDL\xE24"qH\x96\x80r\xEDE\xF8\x97\xC0\xD0<y\x85\xDA}\x990\xD2\xF5'\xEF9\xECC\xAEG4K\xBF\xE3\xD8\\xEE\xD9d\xE2\x8CJ\xC0\xE1\xC6$\xA79\xD7OЄU\x96\xFBw6\xE9d9\xCEl\xD3\xA3\xAA\x99$4!{H\x89\x98+\xEE\xF4ߟ\x98循|\xEE1 `˧\xED~ҿ\xE1\x8Av26
?\xB2\xE4`tY\xF6c\xA8l'w\xFC\xD5L\xE4\xB7g\)\xE3\xA9Љ\xB1P\xA7\xC1\x8CEh$@{Z\x93ܥ\x93柿o/9\xD8
+\x8C\xC8\xF1]y\xF5\xD02\xB2;\x907_LSÛ\xA7[\xA1\xC9\xF0\xE9u9\xFB\xC4U"л\xC3\xEB:Wy\x85\xF8\xAE\xD6\xCA
+X\x83\x97	\x8F\xA4J\x99\xEAv~\x{DDE3}v\xA8BL\xA9غ\xA4\xD8\xCE\xF9f\xBB\xCA`L\xCB\xC4\xB4E7b\xD7\xE6+j\xB8\x88&B\x83\xBF\x802\xA0\x98C	

\xAB2\x9C\xA9v\xECfĮ^Q\xC7R\xB0\xEEn\x9AL貱\xCB
\xB8\xFC\xAE<\xBC\xBE\xD3W\xD4\xCBɃ\x91u\x85	\xD2)š\xAC\x9E\x83k\x8Dn*\xCEA\xD9/^JZ\xD2	7\xA4]0O\xC3_C\xAB|d\xFC\xADU\xF07d\xE85\xE7!\xD7A+\x97\xA7K\xA8Wb\xB1\xDD\xDC\xF0\xA1\xA2\xC7\xDEEz\xC9)tI\x8BN\x99@\x81\x9FP5z\xE7\xE1a6\x8A\xE9	\xA3͚\x87\xDF5t\x80IМ\x9B\x93\xE9\xF4\xFA8\xA96UM'\xBBkV\xE08\xE7\xB8\xA0\xC5p=m1\xABX\xB5\xA24e\x8B½A\xFF\xFF+\x8B\x9C\xF0\x8E\\xA8\xBD\xB8\xAE\xD4\xD00\xC7
+\xFDBʫCC{(\xC1\xC1\x94\xCB\xDDo5\xFA	\xED\xE46o
\xB0\xE9U)x\xCA\xE9\x98\x84\xC0\xADJ\xA5\x99A\xFD\xA7|\xBD,l\щ\xFCdJp9\xC2\xE2\xF4\xAF}6\xF0oӲ\xA9\xB59
+|g[\xE3ZQ|\xB8V\xF1\xF9\xD7LO\x8F\xE6\+ۻ\x92Wb\xA7\x89^\x8C\x96Ky+(\x82\xC7}\xC0\xB064\x9C\;'A1\x92E_\xFF#\xB0<\x9C\xBDQ\xE8\xEB\xC0\x83j\xE9\x8B\xEC\xF7\xBE\xA6촑R\xE8\xAA\xC1ȃח\xEC\xE5\x95XH\xCCa\xB6;\x82\x90\xD9\xECʢ\xB8\xF4s>|:dԐzg8Xsl \xE0A\x86~\xE9\xE40\xC5a0\xA5;8\xED\x9D~\xA4T\xF4\xD1d\xE9\xA1\xF1=\xE5\xB6c\x82\xAE
.~\xEA\xA0^\x8B#D\x89\xA1\xF1V\xEF[\xB0v(@\xF2{\x91\xBC~\x8A\xCAC_ \xEB/S\xA3U\xE0\xEA\xBCAi\x89[ 
\xAA\xBEFj\x88h\x8D\xFB\xB5]m\x92l\xF1\xBC\xCA\xF8jι\xFB\xEF\xFE.pQ\xA6
Vչ
I	\xED\x9Cٜ\xF2\xB2\xE8\xDA$\x89zL\xB0\xB4\xE8e at F\xC5
+\x8F*\xD1\xE9\x9B7\x87\x80\xD2%g\x8EX\xA7Kʔ\xE6f\x95 +\x83^\xDCw\x93\xEF\xAC3\xFA\xEA{\xE7#Y\xA0\xB2\xD9\xFE\x84\xE9
\xE9\xD3\xF4\x80\xFE\xF0\x96!s5\xB3\xEA}O\xE0\x9A\xA0>\xD1Λ\xB6-\xF5\xA4g9\xA7\xBC\xBECW\xFC\xD4W\x9DSS at s\xE33|\xE8\xFDGŝi\xFA\xA2\x97\xF2\xB3n\xA6p\xDB\xFD\xF0 at E[\xAA<\xB8\xECӠ\xC1\xE3\xBE\xE4k?.%\xA7\xAF2\xB5\xA5½\x86GgQ\x9F\xB2y\xE3F\xF4_J8\xF1;\xC08\xD8\xCD\xBA\x8FP!\xC8?\xFB\xAF1\x9Cn\xC9s\xD8l\x87\xAC\xF5q\xEE\xAB \xCD\xD4f\xD6ae\x85\x99\xD3\xEDEd
6iy_\x92"\xBC\x9A
\x8A\x99H\xF5?\xB4\x93\xF8\xF8\xD9DwϾڨ\xD6f\x86\xEE\x8Cw\xF6\xC4Η\xD4LU\xE4\xEE?\xB0[
+6B]\xA1\xEB\xDC\xF5\xC93\x97\xB7%\xF2[\xFC\xC1\xBC\xE6\xB4b\x8E\xC8\xFF\xC85H\xB5\xAE\xC0b͒rAd\xB5L\xB2\xCA\xC1\xC5O\x8E\xBA\xC6 
+&@\x9C.Z\xBB\xA6i5\x91t)**\x98\xC87\xC5\xF6\xDD\x96\x83\x86\xC7\x85\x94\xAC6\xC9\xDC\xF3-\xFF\xF4\xE9	\xA7\xEDϰ\x90`\xE5i\xB7'\x85\xE2o\xA1H\xA0e\xF5\xDF\xE0Ml\xC9_2\x92^Č/\xB7;I>@op2\x86D5\xF9qb_x\xFA\xB1)"۹\x8D\x93Ƃb\xF7Dcm#at<\xE1Nm4\xEBD\xD6Ќn\x85 6\x9DB)\xA0\xA4\xE9ο\x93\xC6b\xC0\x90,!\xFF_\xBA6\x92\xCF\xF9c\x8F\x9B\xDF>>\xC6`\xB1ϭ\xDBb5\xA6YT+\xC8ya\xFB\xFD\x8D\x95;Z\x85\xB6\x89
+\xAB\xFE#0
\xEEw \xEA;'\xBA~\xDCZ^\x9Eu\xC1\x8B\xBD\xEBd\xB0||\xCF\xE0ʇ\xB3 \x88\xEF\x9Cr\xD9 v
+\xF4\xB7	\xF2\xB5\x8E\xD5
+\xA9}\xBB\xF7La\xD2l
+\x82|\xE0\xD1\xD9^Oj\xD1{H\x8F\xCE*L\xAB\x91R} \xA2\x83\xD3Jn*\x88\xBB\xB8\xA7\xDDhE~\xEFu\x9D(\xAE\x8E"\xEDi(\xA6\xFF\xF6Q\x91)\xBB\xA5\x827\x85\xB8\xF2jq\x8CKhl\xC3Y\xFAv\xC7*\xA0W$J	\xB7\xCE%\xFE\x93O\xEEa\xFB%\xA7KS ?\xE4¶\xFE\x8D\xDB/\x88Hq\xA5\xBB\xED\xAE\xCFł\x8F\xB0\xCC\xFF
e/ b.]i~\xE4lэ\xE6\xBC\xD9<\xF543Bj\x98	\x89\xC3\x8AV1U$Fc{i\xF1i/
\ No newline at end of file


Property changes on: MacRuby/trunk/spec/frozen/core/marshal/fixtures/random.dump
___________________________________________________________________
Added: svn:executable
   + *

Modified: MacRuby/trunk/spec/frozen/core/marshal/load_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/marshal/load_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/marshal/load_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -27,6 +27,26 @@
     new_obj_metaclass_ancestors[0].should == Meths
     new_obj_metaclass_ancestors[1].should == UserHashInitParams
   end
+  
+  # FIXME: Not proud of these next two specs, but unsure how to check for respond_to?
+  # on object and class cleanly
+  it "invokes respond_to? for marshal_load when the stream needs marshal_load" do
+    obj = UserDefinedWithRespondToMarshalLoad.new
+    data = Marshal.dump(obj)
+    
+    catch(:RespondTo) do
+      Marshal.load(data)
+    end.should_not be_nil
+  end
+  
+  it "invokes respond_to? for _load when the stream needs _load" do
+    obj = UserDefinedWithRespondToLoad.new
+    data = Marshal.dump(obj)
+    
+    catch(:RespondTo) do
+      Marshal.load(data)
+    end.should be_nil
+  end
 
   it "loads a user-marshaled extended object" do
     obj = UserMarshal.new.extend(Meths)

Modified: MacRuby/trunk/spec/frozen/core/method/name_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/method/name_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/method/name_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,7 +2,7 @@
 require File.expand_path('../fixtures/classes', __FILE__)
 
 describe "Method#name" do
-  ruby_version_is '1.8.7'...'1.9' do
+  ruby_version_is '1.8.7'..'1.9' do
     it "returns the name of the method" do
       "abc".method(:upcase).name.should == "upcase"
     end

Modified: MacRuby/trunk/spec/frozen/core/module/class_variable_defined_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/class_variable_defined_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/module/class_variable_defined_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -15,6 +15,19 @@
     ModuleSpecs::CVars.class_variable_defined?("@@meta").should == true
   end
 
+  it "returns true if the class variable is defined in a metaclass" do
+    obj = mock("metaclass class variable")
+    meta = obj.metaclass
+    meta.send :class_variable_set, :@@var, 1
+    meta.send(:class_variable_defined?, :@@var).should be_true
+  end
+
+  it "returns false if the class variable is not defined in a metaclass" do
+    obj = mock("metaclass class variable")
+    meta = obj.metaclass
+    meta.class_variable_defined?(:@@var).should be_false
+  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

Modified: MacRuby/trunk/spec/frozen/core/module/class_variable_get_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/class_variable_get_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/module/class_variable_get_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -13,6 +13,12 @@
     c.send(:class_variable_get, "@@mvar").should == :mvar
   end
 
+  it "allows '@@' to be a valid class variable name" do
+    c = Class.new { class_variable_set '@@', :foo }
+    c.send(:class_variable_get, "@@").should == :foo
+    c.send(:class_variable_get, :"@@").should == :foo
+  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
@@ -33,6 +39,13 @@
     ModuleSpecs::CVars.new.meta.should == :meta
   end
 
+  it "returns a class variable defined in a metaclass" do
+    obj = mock("metaclass class variable")
+    meta = obj.metaclass
+    meta.send :class_variable_set, :@@var, :cvar_value
+    meta.send(:class_variable_get, :@@var).should == :cvar_value
+  end
+
   ruby_version_is ""..."1.9" do
     not_compliant_on :rubinius do
       it "accepts Fixnums for class variables" do

Modified: MacRuby/trunk/spec/frozen/core/module/class_variable_set_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/class_variable_set_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/module/class_variable_set_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -12,6 +12,13 @@
     c.send(:class_variable_get, :@@test3).should == "test3"
   end
 
+  it "sets a class variable on a metaclass" do
+    obj = mock("metaclass class variable")
+    meta = obj.metaclass
+    meta.send(:class_variable_set, :@@var, :cvar_value).should == :cvar_value
+    meta.send(:class_variable_get, :@@var).should == :cvar_value
+  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.dup }
     c.send(:class_variable_set, "@@mvar", :new_mvar).should == :new_mvar

Modified: MacRuby/trunk/spec/frozen/core/module/class_variables_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/class_variables_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/module/class_variables_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -13,6 +13,13 @@
       ModuleSpecs::CVars.class_variables.should include("@@cls", "@@meta")
     end
 
+    it "returns an Array of Strings of class variable names defined in a metaclass" do
+      obj = mock("metaclass class variable")
+      meta = obj.metaclass
+      meta.send :class_variable_set, :@@var, :cvar_value
+      meta.class_variables.should == ["@@var"]
+    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")
@@ -31,6 +38,13 @@
       ModuleSpecs::ClassVars::M.class_variables.should include(:@@m_cvar)
     end
 
+    it "returns an Array of Symbols of class variable names defined in a metaclass" do
+      obj = mock("metaclass class variable")
+      meta = obj.metaclass
+      meta.send :class_variable_set, :@@var, :cvar_value
+      meta.class_variables.should == [:@@var]
+    end
+
     it "returns an Array with names of class variables defined in metaclasses" do
       ModuleSpecs::CVars.class_variables.should include(:@@cls, :@@meta)
     end

Modified: MacRuby/trunk/spec/frozen/core/module/const_defined_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/const_defined_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/module/const_defined_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -19,6 +19,14 @@
       # CS_CONST10 is defined in a module included by ChildA
       ConstantSpecs::ContainerA::ChildA.const_defined?(:CS_CONST10).should be_true
     end
+
+    it "returns false if the constant is defined in the receiver's superclass and the inherit flag is false" do
+      ConstantSpecs::ContainerA::ChildA.const_defined?(:CS_CONST4, false).should be_false
+    end
+
+    it "returns true if the constant is defined in the receiver's superclass and the inherit flag is true" do
+      ConstantSpecs::ContainerA::ChildA.const_defined?(:CS_CONST4, true).should be_true
+    end
   end
 
   it "returns true if the given String names a constant defined in the receiver" do

Modified: MacRuby/trunk/spec/frozen/core/module/const_get_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/const_get_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/module/const_get_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -61,6 +61,18 @@
     end.should raise_error(NameError)
   end
 
+  ruby_version_is "1.9" do
+    it "raises a NameError if the constant is defined in the receiver's supperclass and the inherit flag is false" do
+      lambda do
+        ConstantSpecs::ContainerA::ChildA.const_get(:CS_CONST4, false)
+      end.should raise_error(NameError)
+    end
+
+    it "searches into the receiver superclasses if the inherit flag is true" do
+      ConstantSpecs::ContainerA::ChildA.const_get(:CS_CONST4, true).should == :const4
+    end
+  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

Modified: MacRuby/trunk/spec/frozen/core/module/define_method_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/define_method_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/module/define_method_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -55,6 +55,20 @@
     o.test1.should == o.another_test
   end
 
+  it "supports being called with a splat" do
+    class DefineMethodSpecClass
+      define_method(:splat_test) { |a,b,*c| c }
+    end
+
+    o = DefineMethodSpecClass.new
+
+    lambda {
+      o.splat_test
+    }.should raise_error(ArgumentError)
+
+    o.splat_test(1,2,3,4).should == [3,4]
+  end
+
   it "calls #method_added after the method is added to the Module" do
     DefineMethodSpecClass.should_receive(:method_added).with(:test_ma)
 
@@ -128,4 +142,15 @@
   it "is private" do
     Module.should have_private_instance_method(:define_method)
   end
+  
+  it "returns a Proc" do
+    class DefineMethodSpecClass
+      method = define_method("return_test") { || true }
+      method.is_a?(Proc).should be_true
+      # check if it is a lambda:
+      lambda {
+        method.call :too_many_arguments
+      }.should raise_error(ArgumentError)
+    end
+  end
 end

Modified: MacRuby/trunk/spec/frozen/core/module/module_exec_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/module_exec_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/module/module_exec_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,6 +2,6 @@
 require File.expand_path('../fixtures/classes', __FILE__)
 require File.expand_path('../shared/class_exec', __FILE__)
 
-describe "Module#class_exec" do
+describe "Module#module_exec" do
   it_behaves_like :module_class_exec, :module_exec
 end

Modified: MacRuby/trunk/spec/frozen/core/module/name_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/name_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/module/name_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -15,12 +15,10 @@
       Class.new.name.should be_nil
     end
 
-    not_compliant_on :jruby do
-      require File.expand_path('../fixtures/name', __FILE__)
-      # http://redmine.ruby-lang.org/issues/show/1833
-      it "preserves the encoding in which the class was defined" do
-        ModuleSpecs::NameEncoding.new.name.encoding.should == Encoding::UTF_8
-      end
+    require File.expand_path('../fixtures/name', __FILE__)
+    # http://redmine.ruby-lang.org/issues/show/1833
+    it "preserves the encoding in which the class was defined" do
+      ModuleSpecs::NameEncoding.new.name.encoding.should == Encoding::UTF_8
     end
   end
 

Modified: MacRuby/trunk/spec/frozen/core/module/remove_class_variable_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/remove_class_variable_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/module/remove_class_variable_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -13,6 +13,14 @@
     m.send(:remove_class_variable, :@@mvar).should == :mvar
   end
 
+  it "removes a class variable defined in a metaclass" do
+    obj = mock("metaclass class variable")
+    meta = obj.metaclass
+    meta.send :class_variable_set, :@@var, 1
+    meta.send(:remove_class_variable, :@@var).should == 1
+    meta.class_variable_defined?(:@@var).should be_false
+  end
+
   it "raises a NameError when removing class variable declared in included module" do
     c = ModuleSpecs::RemoveClassVariable.new { include ModuleSpecs::MVars.dup }
     lambda { c.send(:remove_class_variable, :@@mvar) }.should raise_error(NameError)

Modified: MacRuby/trunk/spec/frozen/core/module/remove_const_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/remove_const_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/module/remove_const_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -21,9 +21,16 @@
     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
+  it "raises a NameError and does not call #const_missing if the constant is not defined" do
+    ConstantSpecs.should_not_receive(:const_missing)
+    lambda { ConstantSpecs.send(:remove_const, :Nonexistent) }.should raise_error(NameError)
+  end
+
+  it "raises a NameError and does not call #const_missing if the constant is not defined directly in the module" do
     ConstantSpecs::ModuleM::CS_CONST255 = :const255
     ConstantSpecs::ContainerA::CS_CONST255.should == :const255
+    ConstantSpecs::ContainerA.should_not_receive(:const_missing)
+
     lambda do
       ConstantSpecs::ContainerA.send :remove_const, :CS_CONST255
     end.should raise_error(NameError)

Modified: MacRuby/trunk/spec/frozen/core/module/shared/class_eval.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/shared/class_eval.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/module/shared/class_eval.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -31,6 +31,16 @@
     ModuleSpecs.send(@method, "[__FILE__, __LINE__]", "test", 102).should == ["test", 102]
   end
 
+  it "converts a non-string filename to a string using to_str" do
+    (file = mock(__FILE__)).should_receive(:to_str).and_return(__FILE__)
+    ModuleSpecs.send(@method, "1+1", file)
+  end
+
+  it "raises a TypeError when the given filename can't be converted to string using to_str" do
+    (file = mock('123')).should_receive(:to_str).and_return(123)
+    lambda { ModuleSpecs.send(@method, "1+1", file) }.should raise_error(TypeError)
+  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

Modified: MacRuby/trunk/spec/frozen/core/numeric/step_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/step_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/numeric/step_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,252 +1,251 @@
 require File.expand_path('../../../spec_helper', __FILE__)
 require File.expand_path('../fixtures/classes', __FILE__)
 
-describe "Numeric#step with [stop, step]" do
-  before(:each) do
-    @obj = NumericSpecs::Subclass.new
+describe "Numeric#step" do
+  before :each do
+    ScratchPad.record []
+    @prc = lambda { |x| ScratchPad << x }
   end
-  
+
   it "raises an ArgumentError when step is 0" do
-    lambda { @obj.step(5, 0) {} }.should raise_error(ArgumentError)
+    lambda { 1.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
+  it "raises an ArgumentError when step is 0.0" do
+    lambda { 1.step(2, 0.0) {} }.should raise_error(ArgumentError)
   end
 
+  it "defaults to step = 1" do
+    1.step(5, &@prc)
+    ScratchPad.recorded.should == [1, 2, 3, 4, 5]
+  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_an_instance_of(enumerator_class)
+    it "returns an Enumerator when step is 0" do
+      1.step(2, 0).should be_an_instance_of(enumerator_class)
     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_an_instance_of(enumerator_class)
+    it "returns an Enumerator when not passed a block and self > stop" do
+      1.step(0, 2).should be_an_instance_of(enumerator_class)
     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 "returns an Enumerator when not passed a block and self < stop" do
+      1.step(2, 3).should be_an_instance_of(enumerator_class)
+    end
 
-  it "yields only Fixnums" do
-    1.step(5, 1) { |x| x.should be_kind_of(Fixnum) }
+    it "returns an Enumerator that uses the given step" do
+      0.step(5, 2).to_a.should == [0, 2, 4]
+    end
   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
+  describe "with [stop, step]" do
+    before :each do
+      @stop = mock("Numeric#step stop value")
+      @step = mock("Numeric#step step value")
+      @obj = NumericSpecs::Subclass.new
+    end
 
-  it "yields once when self equals stop" do
-    result = []
-    1.step(1, 1) { |x| result << x }
-    result.should == [1]
-  end
+    ruby_version_is ""..."1.8.7" do
+      it "does not raise a LocalJumpError when not passed a block and self > stop" do
+        @step.should_receive(:>).with(0).and_return(true)
+        @obj.should_receive(:>).with(@stop).and_return(true)
+        @obj.step(@stop, @step)
+      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 "raises a LocalJumpError when not passed a block and self < stop" do
+        @step.should_receive(:>).with(0).and_return(true)
+        @obj.should_receive(:>).with(@stop).and_return(false)
 
-  it "yields once when self equals stop" do
-    result = []
-    5.step(5, -1) { |x| result << x }
-    result.should == [5]
-  end
+        lambda { @obj.step(@stop, @step) }.should raise_error(LocalJumpError)
+      end
+    end
 
-  it "does not yield when self is less than stop" do
-    result = []
-    1.step(5, -1) { |x| result << x }
-    result.should == []
+    it "increments self using #+ until self > stop when step > 0" do
+      @step.should_receive(:>).with(0).and_return(true)
+      @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, &@prc)
+
+      ScratchPad.recorded.should == [@obj, @obj, @obj]
+    end
+
+    it "decrements self using #+ until self < stop when step < 0" do
+      @step.should_receive(:>).with(0).and_return(false)
+      @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, &@prc)
+
+      ScratchPad.recorded.should == [@obj, @obj, @obj]
+    end
   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)
+  describe "Numeric#step with [stop, step] when self, stop and step are Fixnums" do
+    it "yields only Fixnums" do
+      1.step(5, 1) { |x| x.should be_kind_of(Fixnum) }
+    end
   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, +infinity]" do
-  ruby_bug "#781", "1.8.7" do
-    it "yields once if self < stop" do
-      result = []
-      42.step(100, 1.0/0.0)              { |x| result << x }
-      42.step(1.0/0.0, 1.0/0.0)          { |x| result << x }
-      result.should == [42, 42]
+  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
+      1.step(5, 1, &@prc)
+      ScratchPad.recorded.should == [1, 2, 3, 4, 5]
     end
 
     it "yields once when self equals stop" do
-      result = []
-      42.step(42, 1.0/0.0)               { |x| result << x }
-      (1.0/0.0).step(1.0/0.0, 1.0/0.0)   { |x| result << x }
-      result.should == [42, 1.0/0.0]
+      1.step(1, 1, &@prc)
+      ScratchPad.recorded.should == [1]
     end
-  end
 
-  ruby_bug "#3945", "1.9.2" do
-    it "does not yield when self > stop" do
-      result = []
-      100.step(42, 1.0/0.0)              { |x| result << x }
-      42.step(-1.0/0.0, 1.0/0.0)         { |x| result << x }
-      result.should == []
+    it "does not yield when self is greater than stop" do
+      2.step(1, 1, &@prc)
+      ScratchPad.recorded.should == []
     end
   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
+  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
+      5.step(1, -1, &@prc)
+      ScratchPad.recorded.should == [5, 4, 3, 2, 1]
+    end
 
-  it "yields once when self equals stop" do
-    result = []
-    1.5.step(1.5, 1) { |x| result << x }
-    result.should == [1.5]
+    it "yields once when self equals stop" do
+      5.step(5, -1, &@prc)
+      ScratchPad.recorded.should == [5]
+    end
+
+    it "does not yield when self is less than stop" do
+      1.step(5, -1, &@prc)
+      ScratchPad.recorded.should == []
+    end
   end
 
-  it "does not yield when self is greater than stop" do
-    result = []
-    2.5.step(1.5, 1) { |x| result << x }
-    result.should == []
+  describe "Numeric#step with [stop, step]" do
+    it "yields only Floats when self is a Float" do
+      1.5.step(5, 1) { |x| x.should be_kind_of(Float) }
+    end
+
+    it "yields only Floats when stop is a Float" do
+      1.step(5.0, 1) { |x| x.should be_kind_of(Float) }
+    end
+
+    it "yields only Floats when step is a Float" do
+      1.step(5, 1.0) { |x| x.should be_kind_of(Float) }
+    end
   end
-end
 
-describe "Numeric#step with [stop, -infinity]" do
-  ruby_bug "#3945", "1.9.2" do
-    it "yields once if self > stop" do
-      result = []
-      42.step(6, -1.0/0.0)               { |x| result << x }
-      42.step(-1.0/0.0, -1.0/0.0)        { |x| result << x }
-      result.should == [42, 42]
+  describe "Numeric#step with [stop, +step] when self, stop or step is a Float" do
+    it "yields while increasing self by step while stop < stop" do
+      1.5.step(5, 1, &@prc)
+      ScratchPad.recorded.should == [1.5, 2.5, 3.5, 4.5]
     end
 
     it "yields once when self equals stop" do
-      result = []
-      42.step(42, -1.0/0.0)              { |x| result << x }
-      (1.0/0.0).step(1.0/0.0, -1.0/0.0)  { |x| result << x }
-      result.should == [42, 1.0/0.0]
+      1.5.step(1.5, 1, &@prc)
+      ScratchPad.recorded.should == [1.5]
     end
+
+    it "does not yield when self is greater than stop" do
+      2.5.step(1.5, 1, &@prc)
+      ScratchPad.recorded.should == []
+    end
   end
 
-  ruby_bug "#781", "1.8.7" do
-    it "does not yield when self > stop" do
-      result = []
-      42.step(100, -1.0/0.0)             { |x| result << x }
-      42.step(1.0/0.0, -1.0/0.0)         { |x| result << x }
-      result.should == []
+  describe "Numeric#step with [stop, -step] when self, stop or step is a Float" do
+    it "yields while decreasing self by step while self > stop" do
+      5.step(1.5, -1, &@prc)
+      ScratchPad.recorded.should == [5.0, 4.0, 3.0, 2.0]
     end
+
+    it "yields once when self equals stop" do
+      1.5.step(1.5, -1, &@prc)
+      ScratchPad.recorded.should == [1.5]
+    end
+
+    it "does not yield when self is less than stop" do
+      1.step(5, -1.5, &@prc)
+      ScratchPad.recorded.should == []
+    end
   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]
+  describe "Numeric#step with [stop, +Infinity]" do
+    ruby_bug "#781", "1.8.7" do
+      it "yields once if self < stop" do
+        42.step(100, infinity_value, &@prc)
+        ScratchPad.recorded.should == [42]
+      end
+
+      it "yields once when stop is Infinity" do
+        42.step(infinity_value, infinity_value, &@prc)
+        ScratchPad.recorded.should == [42]
+      end
+
+      it "yields once when self equals stop" do
+        42.step(42, infinity_value, &@prc)
+        ScratchPad.recorded.should == [42]
+      end
+
+      it "yields once when self and stop are Infinity" do
+        (infinity_value).step(infinity_value, infinity_value, &@prc)
+        ScratchPad.recorded.should == [infinity_value]
+      end
+    end
+
+    ruby_bug "#3945", "1.9.2.135" do
+      it "does not yield when self > stop" do
+        100.step(42, infinity_value, &@prc)
+        ScratchPad.recorded.should == []
+      end
+
+      it "does not yield when stop is -Infinity" do
+        42.step(-infinity_value, infinity_value, &@prc)
+        ScratchPad.recorded.should == []
+      end
+    end
   end
 
-  it "yields once when self equals stop" do
-    result = []
-    1.5.step(1.5, -1) { |x| result << x }
-    result.should == [1.5]
+  describe "Numeric#step with [stop, -infinity]" do
+    ruby_bug "#3945", "1.9.2.135" do
+      it "yields once if self > stop" do
+        42.step(6, -infinity_value, &@prc)
+        ScratchPad.recorded.should == [42]
+      end
+
+      it "yields once if stop is -Infinity" do
+        42.step(-infinity_value, -infinity_value, &@prc)
+        ScratchPad.recorded.should == [42]
+      end
+
+      it "yields once when self equals stop" do
+        42.step(42, -infinity_value, &@prc)
+        ScratchPad.recorded.should == [42]
+      end
+
+      it "yields once when self and stop are Infinity" do
+        (infinity_value).step(infinity_value, -infinity_value, &@prc)
+        ScratchPad.recorded.should == [infinity_value]
+      end
+    end
+
+    ruby_bug "#781", "1.8.7" do
+      it "does not yield when self > stop" do
+        42.step(100, -infinity_value, &@prc)
+        ScratchPad.recorded.should == []
+      end
+
+      it "does not yield when stop is Infinity" do
+        42.step(infinity_value, -infinity_value, &@prc)
+        ScratchPad.recorded.should == []
+      end
+    end
   end
 
-  it "does not yield when self is less than stop" do
-    result = []
-    1.step(5, -1.5) { |x| result << x }
-    result.should == []
+  it "does not rescue ArgumentError exceptions" do
+    lambda { 1.step(2) { raise ArgumentError, "" }}.should raise_error(ArgumentError)
   end
-end
 
-describe "Numeric#step" do
-  it "doesn't catch errors" do
-    lambda{ 1.step(2) { raise ArgumentError, "oups" }}.should raise_error(ArgumentError, "oups")
-    lambda{ 1.step(2) { raise TypeError, "oups" }    }.should raise_error(TypeError, "oups")
+  it "does not rescue TypeError exceptions" do
+    lambda { 1.step(2) { raise TypeError, "" } }.should raise_error(TypeError)
   end
 end

Copied: MacRuby/trunk/spec/frozen/core/object/fixtures/classes.rb (from rev 5210, MacRuby/trunk/spec/frozen/core/basicobject/fixtures/classes.rb)
===================================================================
--- MacRuby/trunk/spec/frozen/core/object/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/object/fixtures/classes.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,17 @@
+module ObjectSpecs
+  class IVars
+    def initialize
+      @secret = 99
+    end
+  end
+
+  module InstExec
+    def self.included(base)
+      base.instance_exec { @@count = 2 }
+    end
+  end
+
+  module InstExecIncluded
+    include InstExec
+  end
+end

Copied: MacRuby/trunk/spec/frozen/core/object/instance_exec_spec.rb (from rev 5210, MacRuby/trunk/spec/frozen/core/basicobject/instance_exec_spec.rb)
===================================================================
--- MacRuby/trunk/spec/frozen/core/object/instance_exec_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/object/instance_exec_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,101 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+
+ruby_version_is "1.8.7" do
+
+  require File.expand_path('../fixtures/classes', __FILE__)
+
+  describe "Object#instance_exec" do
+    it "raises a LocalJumpError unless given a block" do
+      lambda { "hola".instance_exec }.should raise_error(LocalJumpError)
+    end
+
+    it "has an arity of -1" do
+      Object.new.method(:instance_exec).arity.should == -1
+    end
+
+    it "accepts arguments with a block" do
+      lambda { "hola".instance_exec(4, 5) { |a,b| a + b } }.should_not raise_error
+    end
+
+    it "doesn't pass self to the block as an argument" do
+      "hola".instance_exec { |o| o }.should be_nil
+    end
+
+    it "passes any arguments to the block" do
+      Object.new.instance_exec(1,2) {|one, two| one + two}.should == 3
+    end
+
+    it "only binds the exec to the receiver" do
+      f = Object.new
+      f.instance_exec 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_exec. See also module_eval/class_eval.
+
+    it "binds self to the receiver" do
+      s = "hola"
+      (s == s.instance_exec { self }).should == true
+    end
+
+    it "executes in the context of the receiver" do
+      "Ruby-fu".instance_exec { size }.should == 7
+      Object.class_eval { "Ruby-fu".instance_exec{ to_s } }.should == "Ruby-fu"
+    end
+
+    it "has access to receiver's instance variables" do
+      ObjectSpecs::IVars.new.instance_exec { @secret }.should == 99
+    end
+
+    ruby_version_is ""..."1.9" do
+      it "sets class variables in the receiver" do
+        ObjectSpecs::InstExec.class_variables.should include("@@count")
+        ObjectSpecs::InstExec.send(:class_variable_get, :@@count).should == 2
+      end
+    end
+
+    ruby_version_is "1.9" do
+       it "sets class variables in the receiver" do
+        ObjectSpecs::InstExec.class_variables.should include(:@@count)
+        ObjectSpecs::InstExec.send(:class_variable_get, :@@count).should == 2
+      end
+    end
+
+    it "raises a TypeError when defining methods on an immediate" do
+      lambda do
+        1.instance_exec { def foo; end }
+      end.should raise_error(TypeError)
+      lambda do
+        :foo.instance_exec { 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_exec_spec = 1"
+      (defined? @@__tmp_instance_exec_spec).should == nil
+
+      @@__tmp_instance_exec_spec = 2
+      1.instance_exec { @@__tmp_instance_exec_spec }.should == 2
+      Fixnum.__send__(:remove_class_variable, :@@__tmp_instance_exec_spec)
+    end
+  end
+
+    it "raises a TypeError when defining methods on numerics" do
+      lambda do
+        (1.0).instance_exec { def foo; end }
+      end.should raise_error(TypeError)
+      lambda do
+        (1 << 64).instance_exec { def foo; end }
+      end.should raise_error(TypeError)
+    end
+  end
+end

Modified: MacRuby/trunk/spec/frozen/core/object/shared/dup_clone.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/object/shared/dup_clone.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/object/shared/dup_clone.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -22,7 +22,6 @@
 end
 
 describe :object_dup_clone, :shared => true do
-  
   it "returns a new object duplicated from the original" do
     o = ObjectSpecDup.new
     o2 = ObjectSpecDup.new
@@ -34,11 +33,6 @@
     o3.obj.should == 10
     o2.obj.should == :original
   end
-  
-  it "produces distinct objects" do
-    o = ObjectSpecDup.new
-    o.should_not.eql? o.send(@method)
-  end
 
   it "produces a shallow copy, contained objects are not recursively dupped" do
     o = ObjectSpecDup.new

Modified: MacRuby/trunk/spec/frozen/core/objectspace/define_finalizer_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/objectspace/define_finalizer_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/objectspace/define_finalizer_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -23,6 +23,12 @@
     ObjectSpace.define_finalizer("garbage", handler).should == [0, handler]
   end
 
+  it "raises ArgumentError trying to define a finalizer on a non-reference" do
+    lambda {
+      ObjectSpace.define_finalizer(:blah) { 1 }
+    }.should raise_error(ArgumentError)
+  end
+
   # see [ruby-core:24095]
   ruby_version_is "1.9" do
     with_feature :fork do

Added: MacRuby/trunk/spec/frozen/core/proc/fixtures/common.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/fixtures/common.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/proc/fixtures/common.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,24 @@
+module ProcSpecs
+  def self.new_proc_in_method
+    Proc.new
+  end
+
+  class ProcSubclass < Proc
+  end
+
+  def self.new_proc_subclass_in_method
+    ProcSubclass.new
+  end
+
+  class MyProc < Proc
+  end
+
+  class MyProc2 < Proc
+    def initialize(a, b)
+      @first = a
+      @second = b
+    end
+
+    attr_reader :first, :second
+  end
+end

Deleted: MacRuby/trunk/spec/frozen/core/proc/fixtures/procs.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/fixtures/procs.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/proc/fixtures/procs.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,54 +0,0 @@
-module ProcSpecs
-  def self.new_proc_in_method
-    Proc.new
-  end
-  class SourceLocation
-    def self.my_proc
-      proc { true }
-    end
-
-    def self.my_lambda
-      lambda { true }
-    end
-
-    def self.my_proc_new
-      Proc.new { true }
-    end
-
-    def self.my_multiline_proc
-      proc do
-        'a'.upcase
-        1 + 22
-      end
-    end
-
-    def self.my_multiline_lambda
-      lambda do
-        'a'.upcase
-        1 + 22
-      end
-    end
-
-    def self.my_multiline_proc_new
-      Proc.new do
-        'a'.upcase
-        1 + 22
-      end
-    end
-
-    def self.my_detached_proc
-      body = proc { true }
-      proc &body
-    end
-
-    def self.my_detached_lambda
-      body = lambda { true }
-      lambda &body
-    end
-
-    def self.my_detached_proc_new
-      body = Proc.new { true }
-      Proc.new &body
-    end
-  end
-end

Copied: MacRuby/trunk/spec/frozen/core/proc/fixtures/source_location.rb (from rev 5210, MacRuby/trunk/spec/frozen/core/proc/fixtures/procs.rb)
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/fixtures/source_location.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/proc/fixtures/source_location.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,51 @@
+module ProcSpecs
+  class SourceLocation
+    def self.my_proc
+      proc { true }
+    end
+
+    def self.my_lambda
+      lambda { true }
+    end
+
+    def self.my_proc_new
+      Proc.new { true }
+    end
+
+    def self.my_multiline_proc
+      proc do
+        'a'.upcase
+        1 + 22
+      end
+    end
+
+    def self.my_multiline_lambda
+      lambda do
+        'a'.upcase
+        1 + 22
+      end
+    end
+
+    def self.my_multiline_proc_new
+      Proc.new do
+        'a'.upcase
+        1 + 22
+      end
+    end
+
+    def self.my_detached_proc
+      body = proc { true }
+      proc &body
+    end
+
+    def self.my_detached_lambda
+      body = lambda { true }
+      lambda &body
+    end
+
+    def self.my_detached_proc_new
+      body = Proc.new { true }
+      Proc.new &body
+    end
+  end
+end

Modified: MacRuby/trunk/spec/frozen/core/proc/new_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/new_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/proc/new_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,5 +1,5 @@
-require File.expand_path('../fixtures/procs.rb', __FILE__)
 require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
 
 describe "Proc.new with an associated block" do
   it "returns a proc that represents the block" do
@@ -46,6 +46,24 @@
       end
     end
   end
+  
+  # JRUBY-5261; Proc sets up the block during .new, not in #initialize
+  describe "called on a subclass of Proc that does not 'super' in 'initialize'" do
+    before :each do
+      @subclass = Class.new(Proc) do
+        attr_reader :ok
+        def initialize
+          @ok = true
+        end
+      end
+    end
+    
+    it "still constructs a functional proc" do
+      proc = @subclass.new {'ok'}
+      proc.call.should == 'ok'
+      proc.ok.should == true
+    end
+  end
 
   # This raises a ThreadError on 1.8 HEAD. Reported as bug #1707
   it "raises a LocalJumpError when context of the block no longer exists" do
@@ -78,6 +96,28 @@
     some_method.should == :proc_return_value
   end
 
+  it "returns a subclass of Proc" do
+    obj = ProcSpecs::MyProc.new { }
+    obj.should be_kind_of(ProcSpecs::MyProc)
+  end
+
+  it "calls initialize on the Proc object" do
+    obj = ProcSpecs::MyProc2.new(:a, 2) { }
+    obj.first.should == :a
+    obj.second.should == 2
+  end
+
+  it "returns a new Proc instance from the block passed to the containing method" do
+    prc = ProcSpecs.new_proc_in_method { "hello" }
+    prc.should be_an_instance_of(Proc)
+    prc.call.should == "hello"
+  end
+
+  it "returns a new Proc instance from the block passed to the containing method" do
+    prc = ProcSpecs.new_proc_subclass_in_method { "hello" }
+    prc.should be_an_instance_of(ProcSpecs::ProcSubclass)
+    prc.call.should == "hello"
+  end
 end
 
 describe "Proc.new without a block" do
@@ -86,13 +126,11 @@
   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)
+    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"
+  it "raises an ArgumentError if invoked on a subclass from within a method with no block" do
+    lambda { ProcSpecs.new_proc_subclass_in_method }.should raise_error(ArgumentError)
   end
 
 end

Modified: MacRuby/trunk/spec/frozen/core/proc/source_location_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/source_location_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/proc/source_location_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,5 +1,5 @@
 require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/procs', __FILE__)
+require File.expand_path('../fixtures/source_location', __FILE__)
 
 ruby_version_is "1.9" do
   describe "Proc#source_location" do
@@ -18,29 +18,29 @@
     it "sets the first value to the path of the file in which the proc was defined" do
       file = @proc.source_location.first
       file.should be_an_instance_of(String)
-      file.should == File.dirname(__FILE__) + '/fixtures/procs.rb'
+      file.should == File.dirname(__FILE__) + '/fixtures/source_location.rb'
 
       file = @proc_new.source_location.first
       file.should be_an_instance_of(String)
-      file.should == File.dirname(__FILE__) + '/fixtures/procs.rb'
+      file.should == File.dirname(__FILE__) + '/fixtures/source_location.rb'
 
       file = @lambda.source_location.first
       file.should be_an_instance_of(String)
-      file.should == File.dirname(__FILE__) + '/fixtures/procs.rb'
+      file.should == File.dirname(__FILE__) + '/fixtures/source_location.rb'
     end
 
     it "sets the last value to a Fixnum representing the line on which the proc was defined" do
-      line = @proc.source_location.last 
+      line = @proc.source_location.last
       line.should be_an_instance_of(Fixnum)
-      line.should == 7 
+      line.should == 4
 
-      line = @proc_new.source_location.last 
+      line = @proc_new.source_location.last
       line.should be_an_instance_of(Fixnum)
-      line.should == 15 
+      line.should == 12
 
-      line = @lambda.source_location.last 
+      line = @lambda.source_location.last
       line.should be_an_instance_of(Fixnum)
-      line.should == 11 
+      line.should == 8
     end
 
     it "works even if the proc was created on the same line" do
@@ -50,15 +50,15 @@
     end
 
     it "returns the first line of a multi-line proc (i.e. the line containing 'proc do')" do
-      ProcSpecs::SourceLocation.my_multiline_proc.source_location.last.should == 19
-      ProcSpecs::SourceLocation.my_multiline_proc_new.source_location.last.should == 33
-      ProcSpecs::SourceLocation.my_multiline_lambda.source_location.last.should == 26 
+      ProcSpecs::SourceLocation.my_multiline_proc.source_location.last.should == 16
+      ProcSpecs::SourceLocation.my_multiline_proc_new.source_location.last.should == 30
+      ProcSpecs::SourceLocation.my_multiline_lambda.source_location.last.should == 23
     end
 
     it "returns the location of the proc's body; not necessarily the proc itself" do
-      ProcSpecs::SourceLocation.my_detached_proc.source_location.last.should == 40
-      ProcSpecs::SourceLocation.my_detached_proc_new.source_location.last.should == 50 
-      ProcSpecs::SourceLocation.my_detached_lambda.source_location.last.should ==45 
+      ProcSpecs::SourceLocation.my_detached_proc.source_location.last.should == 37
+      ProcSpecs::SourceLocation.my_detached_proc_new.source_location.last.should == 47
+      ProcSpecs::SourceLocation.my_detached_lambda.source_location.last.should == 42
     end
   end
 end

Modified: MacRuby/trunk/spec/frozen/core/proc/versions/parameters_1.9.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/versions/parameters_1.9.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/proc/versions/parameters_1.9.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -61,5 +61,13 @@
       proc {|*rest| }.parameters.first.last.should == :rest
       proc {|&block| }.parameters.first.last.should == :block
     end
+    
+    it "ignores unnamed rest args" do
+      lambda {|x,|}.parameters.should == [[:req, :x]]
+    end
+    
+    it "adds nameless rest arg for \"star\" argument" do
+      lambda {|x,*|}.parameters.should == [[:req, :x], [:rest]]
+    end
   end
 end

Modified: MacRuby/trunk/spec/frozen/core/process/fork_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/fork_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/process/fork_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -10,15 +10,9 @@
       end
     end
   end
-  
-  compliant_on :macruby do
-    it "is not implemented" do
-      Process.respond_to?(:fork).should be_false
-    end
-  end
 
   platform_is_not :windows do
-    not_supported_on :jruby, :macruby do
+    not_supported_on :jruby do
       before :each do
         @file = tmp('i_exist')
         rm_r @file

Modified: MacRuby/trunk/spec/frozen/core/process/setpriority_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/setpriority_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/process/setpriority_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -57,25 +57,12 @@
   end
 
   platform_is_not :os => :windows do
-    it "sets the scheduling priority for a specified user" do
-      p = Process.getpriority(Process::PRIO_USER, 0)
-      if Process.uid == 0
+    as_superuser do
+      it "sets the scheduling priority for a specified user" do
+        p = Process.getpriority(Process::PRIO_USER, 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

Modified: MacRuby/trunk/spec/frozen/core/process/status/exited_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/status/exited_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/process/status/exited_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,5 +1,37 @@
 require File.expand_path('../../../../spec_helper', __FILE__)
 
 describe "Process::Status#exited?" do
-  it "needs to be reviewed for spec completeness"
+
+  describe "for a child that exited normally" do
+
+    before :each do
+      ruby_exe("exit(0)")
+    end
+
+    it "returns true" do
+      $?.exited?.should be_true
+    end
+  end
+
+
+  describe "for a terminated child" do
+
+    before :each do
+      ruby_exe("Process.kill(:KILL, $$); exit(42)")
+    end
+
+    platform_is_not :windows do
+      it "returns false" do
+        $?.exited?.should be_false
+      end
+    end
+
+    platform_is :windows do
+      it "always returns true" do
+        $?.exited?.should be_true
+      end
+    end
+
+  end
+
 end

Modified: MacRuby/trunk/spec/frozen/core/process/status/exitstatus_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/status/exitstatus_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/process/status/exitstatus_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,5 +1,13 @@
 require File.expand_path('../../../../spec_helper', __FILE__)
 
 describe "Process::Status#exitstatus" do
-  it "needs to be reviewed for spec completeness"
+
+  before :each do
+    ruby_exe("exit(42)")
+  end
+
+  it "returns the process exit code" do
+    $?.exitstatus.should == 42
+  end
+
 end

Modified: MacRuby/trunk/spec/frozen/core/process/status/pid_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/status/pid_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/process/status/pid_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,5 +1,13 @@
 require File.expand_path('../../../../spec_helper', __FILE__)
 
 describe "Process::Status#pid" do
-  it "needs to be reviewed for spec completeness"
+
+  before :each do
+    @pid = ruby_exe("print $$").to_i
+  end
+
+  it "returns the pid of the process" do
+    $?.pid.should == @pid
+  end
+
 end

Modified: MacRuby/trunk/spec/frozen/core/process/status/signaled_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/status/signaled_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/process/status/signaled_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,5 +1,35 @@
 require File.expand_path('../../../../spec_helper', __FILE__)
 
 describe "Process::Status#signaled?" do
-  it "needs to be reviewed for spec completeness"
+
+  describe "for a cleanly exited child" do
+
+    before :each do
+      ruby_exe("exit(0)")
+    end
+
+    it "returns false" do
+      $?.signaled?.should be_false
+    end
+  end
+
+  describe "for a terminated child" do
+
+    before :each do
+      ruby_exe("Process.kill(:KILL, $$); exit(42)")
+    end
+
+    platform_is_not :windows do
+      it "returns true" do
+        $?.signaled?.should be_true
+      end
+    end
+
+    platform_is :windows do
+      it "always returns false" do
+        $?.signaled?.should be_false
+      end
+    end
+
+  end
 end

Modified: MacRuby/trunk/spec/frozen/core/process/status/success_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/status/success_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/process/status/success_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,5 +1,51 @@
 require File.expand_path('../../../../spec_helper', __FILE__)
 
 describe "Process::Status#success?" do
-  it "needs to be reviewed for spec completeness"
+
+  describe "for a child that exited normally" do
+
+    before :each do
+      ruby_exe("exit(0)")
+    end
+
+    it "returns true" do
+      $?.success?.should be_true
+    end
+  end
+
+  describe "for a child that exited with a non zero status" do
+
+    before :each do
+      ruby_exe("exit(42)")
+    end
+
+    it "returns false" do
+      $?.success?.should be_false
+    end
+  end
+
+  describe "for a child that was terminated" do
+
+    before :each do
+      ruby_exe("Process.kill(:KILL, $$); exit(42)")
+    end
+
+    platform_is_not :windows do
+
+      it "returns nil" do
+        $?.success?.should be_nil
+      end
+
+    end
+
+    platform_is :windows do
+
+      it "always returns true" do
+        $?.success?.should be_true
+      end
+
+    end
+
+  end
+
 end

Modified: MacRuby/trunk/spec/frozen/core/process/status/termsig_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/status/termsig_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/process/status/termsig_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,5 +1,39 @@
 require File.expand_path('../../../../spec_helper', __FILE__)
 
 describe "Process::Status#termsig" do
-  it "needs to be reviewed for spec completeness"
+
+  describe "for a child that exited normally" do
+
+    before :each do
+      ruby_exe("exit(0)")
+    end
+
+    it "returns true" do
+      $?.termsig.should be_nil
+    end
+  end
+
+  describe "for a child that was sent a signal" do
+
+    before :each do
+      ruby_exe("Process.kill(:KILL, $$); exit(42)")
+    end
+
+    platform_is_not :windows do
+
+      it "returns the signal" do
+        $?.termsig.should == Signal.list["KILL"]
+      end
+
+    end
+
+    platform_is :windows do
+
+      it "always returns nil" do
+        $?.termsig.should be_nil
+      end
+
+    end
+
+  end
 end

Modified: MacRuby/trunk/spec/frozen/core/signal/trap_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/signal/trap_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/signal/trap_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -32,6 +32,7 @@
     it "uses the command argument when passed both a command and block" do
       Signal.trap(:HUP, @proc) { ScratchPad.record :block_trap }
       Process.kill :HUP, Process.pid
+      sleep 0.5
       ScratchPad.recorded.should == :proc_trap
     end
   end
@@ -82,4 +83,24 @@
     Signal.trap :HUP, "IGNORE"
     Signal.trap(:HUP, "IGNORE").should == "IGNORE"
   end
+
+  describe "the special EXIT signal code" do
+
+    it "accepts the EXIT code" do
+      code = "trap(:EXIT, proc { print 1 })"
+      ruby_exe(code).should == "1"
+    end
+
+    it "runs the proc before at_exit handlers" do
+      code = "at_exit {print 1}; trap(:EXIT, proc {print 2}); at_exit {print 3}"
+      ruby_exe(code).should == "231"
+    end
+
+    it "can unset the handler" do
+      code = "trap(:EXIT, proc { print 1 }); trap(:EXIT, 'DEFAULT')"
+      ruby_exe(code).should == ""
+    end
+
+  end
+
 end

Copied: MacRuby/trunk/spec/frozen/core/string/append_spec.rb (from rev 5210, MacRuby/trunk/spec/frozen/core/string/append_spec_disabled.rb)
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/append_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/append_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,11 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
+require File.expand_path('../shared/concat.rb', __FILE__)
+
+describe "String#<<" do
+  it_behaves_like :string_concat, :<<
+end
+
+describe "String#<< with Fixnum" do
+  it_behaves_like :string_concat_fixnum, :<<
+end

Deleted: MacRuby/trunk/spec/frozen/core/string/append_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/append_spec_disabled.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/append_spec_disabled.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,11 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes.rb', __FILE__)
-require File.expand_path('../shared/concat.rb', __FILE__)
-
-describe "String#<<" do
-  it_behaves_like :string_concat, :<<
-end
-
-describe "String#<< with Fixnum" do
-  it_behaves_like :string_concat_fixnum, :<<
-end

Copied: MacRuby/trunk/spec/frozen/core/string/ascii_only_spec.rb (from rev 5210, MacRuby/trunk/spec/frozen/core/string/ascii_only_spec_disabled.rb)
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/ascii_only_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/ascii_only_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,79 @@
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
+
+with_feature :encoding do
+  describe "String#ascii_only?" do
+    it "returns true if the String contains only US-ASCII characters" do
+      "hello".ascii_only?.should be_true
+    end
+    
+    it "returns true if the String contains only US-ASCII characters
+    and is encoded as US-ASCII" do
+      "hello".force_encoding(Encoding::US_ASCII).ascii_only?.should be_true
+      "hello".encode(Encoding::US_ASCII).ascii_only?.should be_true
+    end
+
+    it "returns true if the String contains only US-ASCII characters
+    and is encoded as UTF-8" do
+      "hello".force_encoding('UTF-8').ascii_only?.should be_true
+      "hello".encode('UTF-8').ascii_only?.should be_true
+    end
+    
+    it "returns true for all single-character US-ASCII Strings" do
+      0.upto(127) do |n|
+        n.chr.ascii_only?.should be_true
+      end
+    end
+
+    it "returns false for the first non-US-ASCII single-character String" do
+      chr = 128.chr
+      chr.encoding.should == Encoding::ASCII_8BIT
+      chr.ascii_only?.should be_false
+    end
+    
+    it "returns false if the String contains only non-US-ASCII characters" do
+      "\u{6666}".ascii_only?.should be_false
+    end
+    
+    it "returns false if the String contains only non-US-ASCII characters
+    and is encoded as UTF-8" do
+      "\u{6666}".force_encoding('UTF-8').ascii_only?.should be_false
+      "\u{6666}".encode('UTF-8').ascii_only?.should be_false
+    end
+    
+    it "returns false if the String contains only non-ASCII characters
+    and is encoded as US-ASCII" do
+      "\u{6666}".force_encoding(Encoding::US_ASCII).ascii_only?.should be_false
+    end
+    
+    it "returns false if the String contains US-ASCII and non-US-ASCII characters" do
+      "hello, \u{6666}".ascii_only?.should be_false
+    end
+
+    it "returns false if the String contains US-ASCII and non-US-ASCII characters
+    and is encoded as US-ASCII" do
+      "hello, \u{6666}".force_encoding(Encoding::US_ASCII).ascii_only?.should be_false
+    end
+    
+    it "returns false if the String contains US-ASCII and non-US-ASCII characters
+    and is encoded as UTF-8" do
+      "hello, \u{6666}".encode('UTF-8').ascii_only?.should be_false
+      "hello, \u{6666}".force_encoding('UTF-8').ascii_only?.should be_false
+    end
+    
+    it "accepts no arguments" do
+      lambda { "Glark".ascii_only?('?') }.should raise_error(ArgumentError)
+    end
+    
+    it "returns true for the empty String with an ASCII-compatiable encoding" do
+      ''.ascii_only?.should be_true
+      ''.encode('UTF-8').ascii_only?.should be_true
+    end
+
+    it "returns false for the empty String with a non-ASCII-compatiable encoding" do
+      ''.force_encoding('UTF-16LE').ascii_only?.should be_false
+      ''.encode('UTF-16BE').ascii_only?.should be_false
+    end
+  end
+end

Deleted: MacRuby/trunk/spec/frozen/core/string/ascii_only_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/ascii_only_spec_disabled.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/ascii_only_spec_disabled.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,79 +0,0 @@
-# -*- encoding: utf-8 -*-
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes.rb', __FILE__)
-
-with_feature :encoding do
-  describe "String#ascii_only?" do
-    it "returns true if the String contains only US-ASCII characters" do
-      "hello".ascii_only?.should be_true
-    end
-    
-    it "returns true if the String contains only US-ASCII characters
-    and is encoded as US-ASCII" do
-      "hello".force_encoding(Encoding::US_ASCII).ascii_only?.should be_true
-      "hello".encode(Encoding::US_ASCII).ascii_only?.should be_true
-    end
-
-    it "returns true if the String contains only US-ASCII characters
-    and is encoded as UTF-8" do
-      "hello".force_encoding('UTF-8').ascii_only?.should be_true
-      "hello".encode('UTF-8').ascii_only?.should be_true
-    end
-    
-    it "returns true for all single-character US-ASCII Strings" do
-      0.upto(127) do |n|
-        n.chr.ascii_only?.should be_true
-      end
-    end
-
-    it "returns false for the first non-US-ASCII single-character String" do
-      chr = 128.chr
-      chr.encoding.should == Encoding::ASCII_8BIT
-      chr.ascii_only?.should be_false
-    end
-    
-    it "returns false if the String contains only non-US-ASCII characters" do
-      "\u{6666}".ascii_only?.should be_false
-    end
-    
-    it "returns false if the String contains only non-US-ASCII characters
-    and is encoded as UTF-8" do
-      "\u{6666}".force_encoding('UTF-8').ascii_only?.should be_false
-      "\u{6666}".encode('UTF-8').ascii_only?.should be_false
-    end
-    
-    it "returns false if the String contains only non-ASCII characters
-    and is encoded as US-ASCII" do
-      "\u{6666}".force_encoding(Encoding::US_ASCII).ascii_only?.should be_false
-    end
-    
-    it "returns false if the String contains US-ASCII and non-US-ASCII characters" do
-      "hello, \u{6666}".ascii_only?.should be_false
-    end
-
-    it "returns false if the String contains US-ASCII and non-US-ASCII characters
-    and is encoded as US-ASCII" do
-      "hello, \u{6666}".force_encoding(Encoding::US_ASCII).ascii_only?.should be_false
-    end
-    
-    it "returns false if the String contains US-ASCII and non-US-ASCII characters
-    and is encoded as UTF-8" do
-      "hello, \u{6666}".encode('UTF-8').ascii_only?.should be_false
-      "hello, \u{6666}".force_encoding('UTF-8').ascii_only?.should be_false
-    end
-    
-    it "accepts no arguments" do
-      lambda { "Glark".ascii_only?('?') }.should raise_error(ArgumentError)
-    end
-    
-    it "returns true for the empty String with an ASCII-compatiable encoding" do
-      ''.ascii_only?.should be_true
-      ''.encode('UTF-8').ascii_only?.should be_true
-    end
-
-    it "returns false for the empty String with a non-ASCII-compatiable encoding" do
-      ''.force_encoding('UTF-16LE').ascii_only?.should be_false
-      ''.encode('UTF-16BE').ascii_only?.should be_false
-    end
-  end
-end

Copied: MacRuby/trunk/spec/frozen/core/string/bytes_spec.rb (from rev 5210, MacRuby/trunk/spec/frozen/core/string/bytes_spec_disabled.rb)
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/bytes_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/bytes_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,60 @@
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../spec_helper', __FILE__)
+
+with_feature :encoding_transition do
+  describe "String#bytes" do
+    before(:each) do
+      @utf8 = "東京"
+      @ascii = 'Tokyo'
+      @utf8_ascii = @utf8 + @ascii
+    end
+
+    it "returns an Enumerator when no block is given" do
+      @utf8.bytes.should be_kind_of(Enumerable)
+    end
+
+    it "yields each byte to a block if one is given, returning self" do
+      bytes = []
+      @utf8.bytes {|b| bytes << b}.should == @utf8
+      bytes.should == @utf8.bytes.to_a
+    end
+
+    it "returns #bytesize bytes" do
+      @utf8_ascii.bytes.to_a.size.should == @utf8_ascii.bytesize
+    end
+
+    it "returns bytes as Fixnums" do
+      @ascii.bytes.to_a.each {|b| b.should be_an_instance_of(Fixnum)}
+      @utf8_ascii.bytes { |b| b.should be_an_instance_of(Fixnum) }
+    end
+
+    it "agrees with #unpack('C*')" do
+      @utf8_ascii.bytes.to_a.should == @utf8_ascii.unpack("C*")
+    end
+
+    it "yields/returns no bytes for the empty string" do
+      ''.bytes.to_a.should == []
+    end
+
+  end
+end
+
+with_feature :encoding do
+  describe "String#bytes" do
+    before(:each) do
+      @utf8 = "東京"
+      @ascii = 'Tokyo'
+      @utf8_ascii = @utf8 + @ascii
+    end
+
+    it "agrees with #getbyte" do
+      @utf8_ascii.bytes.to_a.each_with_index do |byte,index|
+        byte.should == @utf8_ascii.getbyte(index)
+      end
+    end
+
+    it "is unaffected by #force_encoding" do
+      @utf8.force_encoding('ASCII').bytes.to_a.should == @utf8.bytes.to_a
+    end
+  end
+end

Deleted: MacRuby/trunk/spec/frozen/core/string/bytes_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/bytes_spec_disabled.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/bytes_spec_disabled.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,54 +0,0 @@
-# -*- encoding: utf-8 -*-
-require File.expand_path('../../../spec_helper', __FILE__)
-
-with_feature :encoding_transition do
-  describe "String#bytes" do
-    before(:each) do
-      @utf8 = "東京"
-      @ascii = 'Tokyo'
-      @utf8_ascii = @utf8 + @ascii
-    end
-
-    it "returns an Enumerator when no block is given" do
-      @utf8.bytes.should be_kind_of(Enumerable)
-    end
-
-    it "yields each byte to a block if one is given, returning self" do
-      bytes = []
-      @utf8.bytes {|b| bytes << b}.should == @utf8
-      bytes.should == @utf8.bytes.to_a
-    end
-
-    it "returns #bytesize bytes" do
-      @utf8_ascii.bytes.to_a.size.should == @utf8_ascii.bytesize
-    end
-
-    it "returns bytes as Fixnums" do
-      @ascii.bytes.to_a.each {|b| b.should be_an_instance_of(Fixnum)}
-      @utf8_ascii.bytes { |b| b.should be_an_instance_of(Fixnum) }
-    end
-
-    it "agrees with #unpack('C*')" do
-      @utf8_ascii.bytes.to_a.should == @utf8_ascii.unpack("C*")
-    end
-
-    it "yields/returns no bytes for the empty string" do
-      ''.bytes.to_a.should == []
-    end
-
-  end
-end
-
-with_feature :encoding do
-  describe "String#bytes" do
-    it "agrees with #getbyte" do
-      @utf8_ascii.bytes.to_a.each_with_index do |byte,index|
-        byte.should == @utf8_ascii.getbyte(index)
-      end
-    end
-
-    it "is unaffected by #force_encoding" do
-      @utf8.force_encoding('ASCII').bytes.to_a.should == @utf8.bytes.to_a
-    end
-  end
-end

Copied: MacRuby/trunk/spec/frozen/core/string/bytesize_spec.rb (from rev 5210, MacRuby/trunk/spec/frozen/core/string/bytesize_spec_disabled.rb)
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/bytesize_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/bytesize_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,37 @@
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
+
+with_feature :encoding do
+  describe "#String#bytesize" do
+    it "needs to be reviewed for spec completeness"
+
+    it "returns the length of self in bytes" do
+      "hello".bytesize.should == 5
+      " ".bytesize.should == 1
+    end
+    
+    it "works with strings containing single UTF-8 characters" do
+      "\u{6666}".bytesize.should == 3
+    end
+
+    it "works with pseudo-ASCII strings containing single UTF-8 characters" do
+      "\u{6666}".force_encoding('ASCII').bytesize.should == 3
+    end
+    
+    it "works with strings containing UTF-8 characters" do
+      "c \u{6666}".force_encoding('UTF-8').bytesize.should == 5
+      "c \u{6666}".bytesize.should == 5
+    end
+    
+    it "works with pseudo-ASCII strings containing UTF-8 characters" do
+      "c \u{6666}".force_encoding('ASCII').bytesize.should == 5
+    end
+    
+    it "returns 0 for the empty string" do
+      "".bytesize.should == 0
+      "".force_encoding('ASCII').bytesize.should == 0
+      "".force_encoding('UTF-8').bytesize.should == 0
+    end
+  end
+end

Deleted: MacRuby/trunk/spec/frozen/core/string/bytesize_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/bytesize_spec_disabled.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/bytesize_spec_disabled.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,37 +0,0 @@
-# -*- encoding: utf-8 -*-
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes.rb', __FILE__)
-
-with_feature :encoding do
-  describe "#String#bytesize" do
-    it "needs to be reviewed for spec completeness"
-
-    it "returns the length of self in bytes" do
-      "hello".bytesize.should == 5
-      " ".bytesize.should == 1
-    end
-    
-    it "works with strings containing single UTF-8 characters" do
-      "\u{6666}".bytesize.should == 3
-    end
-
-    it "works with pseudo-ASCII strings containing single UTF-8 characters" do
-      "\u{6666}".force_encoding('ASCII').bytesize.should == 3
-    end
-    
-    it "works with strings containing UTF-8 characters" do
-      "c \u{6666}".force_encoding('UTF-8').bytesize.should == 5
-      "c \u{6666}".bytesize.should == 5
-    end
-    
-    it "works with pseudo-ASCII strings containing UTF-8 characters" do
-      "c \u{6666}".force_encoding('ASCII').bytesize.should == 5
-    end
-    
-    it "returns 0 for the empty string" do
-      "".bytesize.should == 0
-      "".force_encoding('ASCII').bytesize.should == 0
-      "".force_encoding('UTF-8').bytesize.should == 0
-    end
-  end
-end

Modified: MacRuby/trunk/spec/frozen/core/string/casecmp_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/casecmp_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/casecmp_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,69 +1,122 @@
+# -*- encoding: ascii-8bit -*-
 require File.expand_path('../../../spec_helper', __FILE__)
 require File.expand_path('../fixtures/classes.rb', __FILE__)
 
-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
+describe "String#casecmp independent of case" do
+  it "returns -1 when less than other" do
+    "a".casecmp("b").should == -1
+    "A".casecmp("b").should == -1
   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
+  it "returns 0 when equal to other" do
+    "a".casecmp("a").should == 0
+    "A".casecmp("a").should == 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"
+  it "returns 1 when greater than other" do
+    "b".casecmp("a").should == 1
+    "B".casecmp("a").should == 1
+  end
 
-    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
+  it "tries to convert other to string using to_str" do
+    other = mock('abc')
+    def other.to_str() "abc" end
+    "abc".casecmp(other).should == 0
   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
+
+  it "raises a TypeError if other can't be converted to a string" do
+    lambda { "abc".casecmp(mock('abc')) }.should raise_error(TypeError)
   end
+
+  describe "in UTF-8 mode" do
+    before :each do
+      @kcode = $KCODE
+      $KCODE = "utf-8"
+    end
+
+    after :each do
+      $KCODE = @kcode
+    end
+
+    describe "for non-ASCII characters" do
+      before :each do
+        @upper_a_tilde  = "\xc3\x83"
+        @lower_a_tilde  = "\xc3\xa3"
+        @upper_a_umlaut = "\xc3\x84"
+        @lower_a_umlaut = "\xc3\xa4"
+      end
+
+      it "returns -1 when numerically less than other" do
+        @upper_a_tilde.casecmp(@lower_a_tilde).should == -1
+        @upper_a_tilde.casecmp(@upper_a_umlaut).should == -1
+      end
+
+      it "returns 0 when numerically equal to other" do
+        @upper_a_tilde.casecmp(@upper_a_tilde).should == 0
+      end
+
+      it "returns 1 when numerically greater than other" do
+        @lower_a_umlaut.casecmp(@upper_a_umlaut).should == 1
+        @lower_a_umlaut.casecmp(@lower_a_tilde).should == 1
+      end
+    end
+
+    describe "for ASCII characters" do
+      it "returns -1 when less than other" do
+        "a".casecmp("b").should == -1
+        "A".casecmp("b").should == -1
+      end
+
+      it "returns 0 when equal to other" do
+        "a".casecmp("a").should == 0
+        "A".casecmp("a").should == 0
+      end
+
+      it "returns 1 when greater than other" do
+        "b".casecmp("a").should == 1
+        "B".casecmp("a").should == 1
+      end
+    end
+  end
+
+  describe "for non-ASCII characters" do
+    before :each do
+      @upper_a_tilde = "\xc3"
+      @lower_a_tilde = "\xe3"
+    end
+
+    # These could be encoded in Latin-1, but there's no way
+    # to express that in 1.8.
+    it "returns -1 when numerically less than other" do
+      @upper_a_tilde.casecmp(@lower_a_tilde).should == -1
+    end
+
+    it "returns 0 when equal to other" do
+      @upper_a_tilde.casecmp("\xc3").should == 0
+    end
+
+    it "returns 1 when numerically greater than other" do
+      @lower_a_tilde.casecmp(@upper_a_tilde).should == 1
+    end
+  end
+
+  describe "when comparing a subclass instance" do
+    it "returns -1 when less than other" do
+      b = StringSpecs::MyString.new "b"
+      "a".casecmp(b).should == -1
+      "A".casecmp(b).should == -1
+    end
+
+    it "returns 0 when equal to other" do
+      a = StringSpecs::MyString.new "a"
+      "a".casecmp(a).should == 0
+      "A".casecmp(a).should == 0
+    end
+
+    it "returns 1 when greater than other" do
+      a = StringSpecs::MyString.new "a"
+      "b".casecmp(a).should == 1
+      "B".casecmp(a).should == 1
+    end
+  end
 end

Modified: MacRuby/trunk/spec/frozen/core/string/center_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/center_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/center_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -96,4 +96,10 @@
     "".center(10, StringSpecs::MyString.new("x")).should be_kind_of(String)
     "foo".center(10, StringSpecs::MyString.new("x")).should be_kind_of(String)
   end
+
+  it "when padding is tainted and self is untainted returns a tainted string if and only if length is longer than self" do
+    "hello".center(4, 'X'.taint).tainted?.should be_false
+    "hello".center(5, 'X'.taint).tainted?.should be_false
+    "hello".center(6, 'X'.taint).tainted?.should be_true
+  end
 end

Copied: MacRuby/trunk/spec/frozen/core/string/concat_spec.rb (from rev 5210, MacRuby/trunk/spec/frozen/core/string/concat_spec_disabled.rb)
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/concat_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/concat_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,11 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
+require File.expand_path('../shared/concat.rb', __FILE__)
+
+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

Deleted: MacRuby/trunk/spec/frozen/core/string/concat_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/concat_spec_disabled.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/concat_spec_disabled.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,11 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes.rb', __FILE__)
-require File.expand_path('../shared/concat.rb', __FILE__)
-
-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

Modified: MacRuby/trunk/spec/frozen/core/string/delete_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/delete_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/delete_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -48,6 +48,11 @@
     "ABCabc[]".delete("A-a").should == "bc"
   end
 
+  it "respects backslash for escaping a -" do
+    'Non-Authoritative Information'.delete(' \-\'').should ==
+      'NonAuthoritativeInformation'
+  end
+
   ruby_version_is ""..."1.9" do
     it "regards invalid ranges as nothing" do
       "hello".delete("h-e").should == "hello"

Copied: MacRuby/trunk/spec/frozen/core/string/each_byte_spec.rb (from rev 5210, MacRuby/trunk/spec/frozen/core/string/each_byte_spec_disabled.rb)
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/each_byte_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/each_byte_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,49 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
+
+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
+
+  ruby_version_is "1.8.7" do
+    it "returns an enumerator when no block given" do
+      enum = "hello".each_byte
+      enum.should be_an_instance_of(enumerator_class)
+      enum.to_a.should == [104, 101, 108, 108, 111]
+    end
+  end
+
+end

Deleted: MacRuby/trunk/spec/frozen/core/string/each_byte_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/each_byte_spec_disabled.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/each_byte_spec_disabled.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,49 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes.rb', __FILE__)
-
-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
-
-  ruby_version_is "1.8.7" do
-    it "returns an enumerator when no block given" do
-      enum = "hello".each_byte
-      enum.should be_an_instance_of(enumerator_class)
-      enum.to_a.should == [104, 101, 108, 108, 111]
-    end
-  end
-
-end

Copied: MacRuby/trunk/spec/frozen/core/string/eql_spec.rb (from rev 5210, MacRuby/trunk/spec/frozen/core/string/eql_spec_disabled.rb)
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/eql_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/eql_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,20 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
+require File.expand_path('../shared/equal_value.rb', __FILE__)
+
+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

Deleted: MacRuby/trunk/spec/frozen/core/string/eql_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/eql_spec_disabled.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/eql_spec_disabled.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,20 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes.rb', __FILE__)
-require File.expand_path('../shared/equal_value.rb', __FILE__)
-
-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

Copied: MacRuby/trunk/spec/frozen/core/string/equal_value_spec.rb (from rev 5210, MacRuby/trunk/spec/frozen/core/string/equal_value_spec_disabled.rb)
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/equal_value_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/equal_value_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,31 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
+require File.expand_path('../shared/equal_value.rb', __FILE__)
+
+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
+
+  it "is not fooled by NUL characters" do
+    "abc\0def".should_not == "abc\0xyz"
+  end
+end

Deleted: MacRuby/trunk/spec/frozen/core/string/equal_value_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/equal_value_spec_disabled.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/equal_value_spec_disabled.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,31 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes.rb', __FILE__)
-require File.expand_path('../shared/equal_value.rb', __FILE__)
-
-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
-
-  it "is not fooled by NUL characters" do
-    "abc\0def".should_not == "abc\0xyz"
-  end
-end

Added: MacRuby/trunk/spec/frozen/core/string/fixtures/utf-8-encoding.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/fixtures/utf-8-encoding.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/fixtures/utf-8-encoding.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,7 @@
+# -*- encoding: utf-8 -*-
+module StringSpecs
+  class UTF8Encoding
+    def self.source_encoding; __ENCODING__; end
+    def self.egrave; "é"; end
+  end
+end

Copied: MacRuby/trunk/spec/frozen/core/string/getbyte_spec.rb (from rev 5210, MacRuby/trunk/spec/frozen/core/string/getbyte_spec_disabled.rb)
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/getbyte_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/getbyte_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,63 @@
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../spec_helper', __FILE__)
+
+ruby_version_is "1.8.8" do
+  describe "String#getbyte" do
+    it "returns an Integer if given a valid index" do
+      "a".getbyte(0).should be_kind_of(Integer)
+    end
+
+    it "starts indexing at 0" do
+      "b".getbyte(0).should == 98
+    end
+
+    it "counts from the end of the String if given a negative argument" do
+      "glark".getbyte(-1).should == "glark".getbyte(4)
+    end
+
+    it "returns an Integer between 0 and 255" do
+      "\x00".getbyte(0).should == 0
+      "\xFF".getbyte(0).should == 255
+      256.chr('utf-8').getbyte(0).should == 196
+      256.chr('utf-8').getbyte(1).should == 128
+    end
+
+    it "regards a multi-byte character as having multiple bytes" do
+      chr = "\u{998}"
+      chr.bytesize.should == 3
+      chr.getbyte(0).should == 224
+      chr.getbyte(1).should == 166
+      chr.getbyte(2).should == 152
+    end
+
+    it "mirrors the output of #bytes" do
+      str = "UTF-8 (\u{9865}} characters and hex escapes (\xDE)"
+      str.bytes.to_a.each_with_index do |byte, index|
+        str.getbyte(index).should == byte
+      end
+    end
+
+    it "interprets bytes relative to the String's encoding" do
+      str = "\u{333}"
+      str.encode('utf-8').getbyte(0).should_not == \
+        str.encode('utf-16le').getbyte(0)
+    end
+
+    it "returns nil for out-of-bound indexes" do
+      "g".getbyte(1).should be_nil
+    end
+
+    it "regards the empty String as containing no bytes" do
+      "".getbyte(0).should be_nil
+    end
+
+    it "raises an ArgumentError unless given one argument" do
+      lambda { "glark".getbyte     }.should raise_error(ArgumentError)
+      lambda { "food".getbyte(0,0) }.should raise_error(ArgumentError)
+    end
+
+    it "raises a TypeError unless its argument can be coerced into an Integer" do
+      lambda { "a".getbyte('a') }.should raise_error(TypeError)
+    end
+  end
+end

Deleted: MacRuby/trunk/spec/frozen/core/string/getbyte_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/getbyte_spec_disabled.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/getbyte_spec_disabled.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,63 +0,0 @@
-# -*- encoding: utf-8 -*-
-require File.expand_path('../../../spec_helper', __FILE__)
-
-ruby_version_is "1.8.8" do
-  describe "String#getbyte" do
-    it "returns an Integer if given a valid index" do
-      "a".getbyte(0).should be_kind_of(Integer)
-    end
-
-    it "starts indexing at 0" do
-      "b".getbyte(0).should == 98
-    end
-
-    it "counts from the end of the String if given a negative argument" do
-      "glark".getbyte(-1).should == "glark".getbyte(4)
-    end
-
-    it "returns an Integer between 0 and 255" do
-      "\x00".getbyte(0).should == 0
-      "\xFF".getbyte(0).should == 255
-      256.chr('utf-8').getbyte(0).should == 196
-      256.chr('utf-8').getbyte(1).should == 128
-    end
-
-    it "regards a multi-byte character as having multiple bytes" do
-      chr = "\u{998}"
-      chr.bytesize.should == 3
-      chr.getbyte(0).should == 224
-      chr.getbyte(1).should == 166
-      chr.getbyte(2).should == 152
-    end
-
-    it "mirrors the output of #bytes" do
-      str = "UTF-8 (\u{9865}} characters and hex escapes (\xDE)"
-      str.bytes.to_a.each_with_index do |byte, index|
-        str.getbyte(index).should == byte
-      end
-    end
-
-    it "interprets bytes relative to the String's encoding" do
-      str = "\u{333}"
-      str.encode('utf-8').getbyte(0).should_not == \
-        str.encode('utf-16le').getbyte(0)
-    end
-
-    it "returns nil for out-of-bound indexes" do
-      "g".getbyte(1).should be_nil
-    end
-
-    it "regards the empty String as containing no bytes" do
-      "".getbyte(0).should be_nil
-    end
-
-    it "raises an ArgumentError unless given one argument" do
-      lambda { "glark".getbyte     }.should raise_error(ArgumentError)
-      lambda { "food".getbyte(0,0) }.should raise_error(ArgumentError)
-    end
-
-    it "raises a TypeError unless its argument can be coerced into an Integer" do
-      lambda { "a".getbyte('a') }.should raise_error(TypeError)
-    end
-  end
-end

Modified: MacRuby/trunk/spec/frozen/core/string/gsub_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/gsub_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/gsub_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -537,13 +537,28 @@
       s.gsub!(/ROAR/) { "x" }.should be_nil
     end
 
-    it "raises a RuntimeError if the frozen string would be modified" do
-      s = "hello"
-      s.freeze
+    deviates_on :rubinius do
+      # MRI 1.8.x is inconsistent here, raising a TypeError when not passed
+      # a block and a RuntimeError when passed a block. This is arguably a
+      # bug in MRI. In 1.9, both situations raise a RuntimeError.
+      it "raises a TypeError if the frozen string would be modified" do
+        s = "hello"
+        s.freeze
 
-      lambda { s.gsub!(/e/)       { "e" } }.should raise_error(RuntimeError)
-      lambda { s.gsub!(/[aeiou]/) { '*' } }.should raise_error(RuntimeError)
+        lambda { s.gsub!(/e/)       { "e" } }.should raise_error(TypeError)
+        lambda { s.gsub!(/[aeiou]/) { '*' } }.should raise_error(TypeError)
+      end
     end
+
+    not_compliant_on :rubinius do
+      it "raises a RuntimeError if the frozen string would be modified" do
+        s = "hello"
+        s.freeze
+
+        lambda { s.gsub!(/e/)       { "e" } }.should raise_error(RuntimeError)
+        lambda { s.gsub!(/[aeiou]/) { '*' } }.should raise_error(RuntimeError)
+      end
+    end
   end
 
   # See [ruby-core:23663]

Copied: MacRuby/trunk/spec/frozen/core/string/inspect_spec.rb (from rev 5210, MacRuby/trunk/spec/frozen/core/string/inspect_spec_disabled.rb)
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/inspect_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/inspect_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,693 @@
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
+
+describe "String#inspect" do
+  ruby_version_is "1.9" do
+    before :each do
+      Encoding.default_external = Encoding::UTF_8
+      @orig_exteenc = Encoding.default_external
+    end
+
+    after :each do
+      Encoding.default_external = @orig_exteenc
+    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.should be_an_instance_of(String)
+  end
+
+  it "returns a string with special characters replaced with \\<char> notation" do
+    [ ["\a", '"\\a"'],
+      ["\b", '"\\b"'],
+      ["\t", '"\\t"'],
+      ["\n", '"\\n"'],
+      ["\v", '"\\v"'],
+      ["\f", '"\\f"'],
+      ["\r", '"\\r"'],
+      ["\e", '"\\e"']
+    ].should be_computed_by(:inspect)
+  end
+
+  it "returns a string with \" and \\ escaped with a backslash" do
+    [ ["\"", '"\\""'],
+      ["\\", '"\\\\"']
+    ].should be_computed_by(:inspect)
+  end
+
+  it "returns a string with \\#<char> when # is followed by $, @, {" do
+    [ ["\#$", '"\\#$"'],
+      ["\#@", '"\\#@"'],
+      ["\#{", '"\\#{"']
+    ].should be_computed_by(:inspect)
+  end
+
+  it "returns a string with # not escaped when followed by any other character" do
+    [ ["#", '"#"'],
+      ["#1", '"#1"']
+    ].should be_computed_by(:inspect)
+  end
+
+  it "returns a string with printable non-alphanumeric characters unescaped" do
+    [ [" ", '" "'],
+      ["!", '"!"'],
+      ["$", '"$"'],
+      ["%", '"%"'],
+      ["&", '"&"'],
+      ["'", '"\'"'],
+      ["(", '"("'],
+      [")", '")"'],
+      ["*", '"*"'],
+      ["+", '"+"'],
+      [",", '","'],
+      ["-", '"-"'],
+      [".", '"."'],
+      ["/", '"/"'],
+      [":", '":"'],
+      [";", '";"'],
+      ["<", '"<"'],
+      ["=", '"="'],
+      [">", '">"'],
+      ["?", '"?"'],
+      ["@", '"@"'],
+      ["[", '"["'],
+      ["]", '"]"'],
+      ["^", '"^"'],
+      ["_", '"_"'],
+      ["`", '"`"'],
+      ["{", '"{"'],
+      ["|", '"|"'],
+      ["}", '"}"'],
+      ["~", '"~"']
+    ].should be_computed_by(:inspect)
+  end
+
+  it "returns a string with numeric characters unescaped" do
+    [ ["0", '"0"'],
+      ["1", '"1"'],
+      ["2", '"2"'],
+      ["3", '"3"'],
+      ["4", '"4"'],
+      ["5", '"5"'],
+      ["6", '"6"'],
+      ["7", '"7"'],
+      ["8", '"8"'],
+      ["9", '"9"'],
+    ].should be_computed_by(:inspect)
+  end
+
+  it "returns a string with upper-case alpha characters unescaped" do
+    [ ["A", '"A"'],
+      ["B", '"B"'],
+      ["C", '"C"'],
+      ["D", '"D"'],
+      ["E", '"E"'],
+      ["F", '"F"'],
+      ["G", '"G"'],
+      ["H", '"H"'],
+      ["I", '"I"'],
+      ["J", '"J"'],
+      ["K", '"K"'],
+      ["L", '"L"'],
+      ["M", '"M"'],
+      ["N", '"N"'],
+      ["O", '"O"'],
+      ["P", '"P"'],
+      ["Q", '"Q"'],
+      ["R", '"R"'],
+      ["S", '"S"'],
+      ["T", '"T"'],
+      ["U", '"U"'],
+      ["V", '"V"'],
+      ["W", '"W"'],
+      ["X", '"X"'],
+      ["Y", '"Y"'],
+      ["Z", '"Z"']
+    ].should be_computed_by(:inspect)
+  end
+
+  it "returns a string with lower-case alpha characters unescaped" do
+    [ ["a", '"a"'],
+      ["b", '"b"'],
+      ["c", '"c"'],
+      ["d", '"d"'],
+      ["e", '"e"'],
+      ["f", '"f"'],
+      ["g", '"g"'],
+      ["h", '"h"'],
+      ["i", '"i"'],
+      ["j", '"j"'],
+      ["k", '"k"'],
+      ["l", '"l"'],
+      ["m", '"m"'],
+      ["n", '"n"'],
+      ["o", '"o"'],
+      ["p", '"p"'],
+      ["q", '"q"'],
+      ["r", '"r"'],
+      ["s", '"s"'],
+      ["t", '"t"'],
+      ["u", '"u"'],
+      ["v", '"v"'],
+      ["w", '"w"'],
+      ["x", '"x"'],
+      ["y", '"y"'],
+      ["z", '"z"']
+    ].should be_computed_by(:inspect)
+  end
+
+  ruby_version_is ""..."1.9" do
+    it "returns a string with non-printing characters replaced with \\0nn notation" do
+      [ ["\000", '"\\000"'],
+        ["\001", '"\\001"'],
+        ["\002", '"\\002"'],
+        ["\003", '"\\003"'],
+        ["\004", '"\\004"'],
+        ["\005", '"\\005"'],
+        ["\006", '"\\006"'],
+        ["\016", '"\\016"'],
+        ["\017", '"\\017"'],
+        ["\020", '"\\020"'],
+        ["\021", '"\\021"'],
+        ["\022", '"\\022"'],
+        ["\023", '"\\023"'],
+        ["\024", '"\\024"'],
+        ["\025", '"\\025"'],
+        ["\026", '"\\026"'],
+        ["\027", '"\\027"'],
+        ["\030", '"\\030"'],
+        ["\031", '"\\031"'],
+        ["\032", '"\\032"'],
+        ["\034", '"\\034"'],
+        ["\035", '"\\035"'],
+        ["\036", '"\\036"'],
+        ["\177", '"\\177"'],
+        ["\200", '"\\200"'],
+        ["\201", '"\\201"'],
+        ["\202", '"\\202"'],
+        ["\203", '"\\203"'],
+        ["\204", '"\\204"'],
+        ["\205", '"\\205"'],
+        ["\206", '"\\206"'],
+        ["\207", '"\\207"'],
+        ["\210", '"\\210"'],
+        ["\211", '"\\211"'],
+        ["\212", '"\\212"'],
+        ["\213", '"\\213"'],
+        ["\214", '"\\214"'],
+        ["\215", '"\\215"'],
+        ["\216", '"\\216"'],
+        ["\217", '"\\217"'],
+        ["\220", '"\\220"'],
+        ["\221", '"\\221"'],
+        ["\222", '"\\222"'],
+        ["\223", '"\\223"'],
+        ["\224", '"\\224"'],
+        ["\225", '"\\225"'],
+        ["\226", '"\\226"'],
+        ["\227", '"\\227"'],
+        ["\230", '"\\230"'],
+        ["\231", '"\\231"'],
+        ["\232", '"\\232"'],
+        ["\233", '"\\233"'],
+        ["\234", '"\\234"'],
+        ["\235", '"\\235"'],
+        ["\236", '"\\236"'],
+        ["\237", '"\\237"'],
+        ["\240", '"\\240"'],
+        ["\241", '"\\241"'],
+        ["\242", '"\\242"'],
+        ["\243", '"\\243"'],
+        ["\244", '"\\244"'],
+        ["\245", '"\\245"'],
+        ["\246", '"\\246"'],
+        ["\247", '"\\247"'],
+        ["\250", '"\\250"'],
+        ["\251", '"\\251"'],
+        ["\252", '"\\252"'],
+        ["\253", '"\\253"'],
+        ["\254", '"\\254"'],
+        ["\255", '"\\255"'],
+        ["\256", '"\\256"'],
+        ["\257", '"\\257"'],
+        ["\260", '"\\260"'],
+        ["\261", '"\\261"'],
+        ["\262", '"\\262"'],
+        ["\263", '"\\263"'],
+        ["\264", '"\\264"'],
+        ["\265", '"\\265"'],
+        ["\266", '"\\266"'],
+        ["\267", '"\\267"'],
+        ["\270", '"\\270"'],
+        ["\271", '"\\271"'],
+        ["\272", '"\\272"'],
+        ["\273", '"\\273"'],
+        ["\274", '"\\274"'],
+        ["\275", '"\\275"'],
+        ["\276", '"\\276"'],
+        ["\277", '"\\277"'],
+        ["\300", '"\\300"'],
+        ["\301", '"\\301"'],
+        ["\302", '"\\302"'],
+        ["\303", '"\\303"'],
+        ["\304", '"\\304"'],
+        ["\305", '"\\305"'],
+        ["\306", '"\\306"'],
+        ["\307", '"\\307"'],
+        ["\310", '"\\310"'],
+        ["\311", '"\\311"'],
+        ["\312", '"\\312"'],
+        ["\313", '"\\313"'],
+        ["\314", '"\\314"'],
+        ["\315", '"\\315"'],
+        ["\316", '"\\316"'],
+        ["\317", '"\\317"'],
+        ["\320", '"\\320"'],
+        ["\321", '"\\321"'],
+        ["\322", '"\\322"'],
+        ["\323", '"\\323"'],
+        ["\324", '"\\324"'],
+        ["\325", '"\\325"'],
+        ["\326", '"\\326"'],
+        ["\327", '"\\327"'],
+        ["\330", '"\\330"'],
+        ["\331", '"\\331"'],
+        ["\332", '"\\332"'],
+        ["\333", '"\\333"'],
+        ["\334", '"\\334"'],
+        ["\335", '"\\335"'],
+        ["\336", '"\\336"'],
+        ["\337", '"\\337"'],
+        ["\340", '"\\340"'],
+        ["\341", '"\\341"'],
+        ["\342", '"\\342"'],
+        ["\343", '"\\343"'],
+        ["\344", '"\\344"'],
+        ["\345", '"\\345"'],
+        ["\346", '"\\346"'],
+        ["\347", '"\\347"'],
+        ["\350", '"\\350"'],
+        ["\351", '"\\351"'],
+        ["\352", '"\\352"'],
+        ["\353", '"\\353"'],
+        ["\354", '"\\354"'],
+        ["\355", '"\\355"'],
+        ["\356", '"\\356"'],
+        ["\357", '"\\357"'],
+        ["\360", '"\\360"'],
+        ["\361", '"\\361"'],
+        ["\362", '"\\362"'],
+        ["\363", '"\\363"'],
+        ["\364", '"\\364"'],
+        ["\365", '"\\365"'],
+        ["\366", '"\\366"'],
+        ["\367", '"\\367"'],
+        ["\370", '"\\370"'],
+        ["\371", '"\\371"'],
+        ["\372", '"\\372"'],
+        ["\373", '"\\373"'],
+        ["\374", '"\\374"'],
+        ["\375", '"\\375"'],
+        ["\376", '"\\376"'],
+        ["\377", '"\\377"']
+      ].should be_computed_by(:inspect)
+    end
+
+    describe "with $KCODE == 'NONE'" do
+      before :each do
+        @kcode = $KCODE
+      end
+
+      after :each do
+        $KCODE = @kcode
+      end
+
+      it "returns a string with bytes represented in stringified octal notation" do
+        $KCODE = "NONE"
+        "äöü".inspect.should == "\"\\303\\244\\303\\266\\303\\274\""
+      end
+    end
+
+    describe "with $KCODE == 'UTF-8'" do
+      before :each do
+        @kcode = $KCODE
+      end
+
+      after :each do
+        $KCODE = @kcode
+      end
+
+      it "returns a string with extended character set" do
+        $KCODE = "UTF-8"
+        "äöü".inspect.should == "\"äöü\""
+      end
+
+      it "returns malformed UTF-8 characters in stringified octal notation" do
+        $KCODE = "UTF-8"
+        "\007äöüz\303".inspect.should == "\"\\aäöüz\\303\""
+      end
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "returns a string with non-printing characters replaced by \\x notation" do
+      # Avoid the file encoding by computing the string with #chr.
+      [ [0000.chr, '"\\x00"'],
+        [0001.chr, '"\\x01"'],
+        [0002.chr, '"\\x02"'],
+        [0003.chr, '"\\x03"'],
+        [0004.chr, '"\\x04"'],
+        [0005.chr, '"\\x05"'],
+        [0006.chr, '"\\x06"'],
+        [0016.chr, '"\\x0E"'],
+        [0017.chr, '"\\x0F"'],
+        [0020.chr, '"\\x10"'],
+        [0021.chr, '"\\x11"'],
+        [0022.chr, '"\\x12"'],
+        [0023.chr, '"\\x13"'],
+        [0024.chr, '"\\x14"'],
+        [0025.chr, '"\\x15"'],
+        [0026.chr, '"\\x16"'],
+        [0027.chr, '"\\x17"'],
+        [0030.chr, '"\\x18"'],
+        [0031.chr, '"\\x19"'],
+        [0032.chr, '"\\x1A"'],
+        [0034.chr, '"\\x1C"'],
+        [0035.chr, '"\\x1D"'],
+        [0036.chr, '"\\x1E"'],
+        [0037.chr, '"\\x1F"'],
+        [0177.chr, '"\\x7F"'],
+        [0200.chr, '"\\x80"'],
+        [0201.chr, '"\\x81"'],
+        [0202.chr, '"\\x82"'],
+        [0203.chr, '"\\x83"'],
+        [0204.chr, '"\\x84"'],
+        [0205.chr, '"\\x85"'],
+        [0206.chr, '"\\x86"'],
+        [0207.chr, '"\\x87"'],
+        [0210.chr, '"\\x88"'],
+        [0211.chr, '"\\x89"'],
+        [0212.chr, '"\\x8A"'],
+        [0213.chr, '"\\x8B"'],
+        [0214.chr, '"\\x8C"'],
+        [0215.chr, '"\\x8D"'],
+        [0216.chr, '"\\x8E"'],
+        [0217.chr, '"\\x8F"'],
+        [0220.chr, '"\\x90"'],
+        [0221.chr, '"\\x91"'],
+        [0222.chr, '"\\x92"'],
+        [0223.chr, '"\\x93"'],
+        [0224.chr, '"\\x94"'],
+        [0225.chr, '"\\x95"'],
+        [0226.chr, '"\\x96"'],
+        [0227.chr, '"\\x97"'],
+        [0230.chr, '"\\x98"'],
+        [0231.chr, '"\\x99"'],
+        [0232.chr, '"\\x9A"'],
+        [0233.chr, '"\\x9B"'],
+        [0234.chr, '"\\x9C"'],
+        [0235.chr, '"\\x9D"'],
+        [0236.chr, '"\\x9E"'],
+        [0237.chr, '"\\x9F"'],
+        [0240.chr, '"\\xA0"'],
+        [0241.chr, '"\\xA1"'],
+        [0242.chr, '"\\xA2"'],
+        [0243.chr, '"\\xA3"'],
+        [0244.chr, '"\\xA4"'],
+        [0245.chr, '"\\xA5"'],
+        [0246.chr, '"\\xA6"'],
+        [0247.chr, '"\\xA7"'],
+        [0250.chr, '"\\xA8"'],
+        [0251.chr, '"\\xA9"'],
+        [0252.chr, '"\\xAA"'],
+        [0253.chr, '"\\xAB"'],
+        [0254.chr, '"\\xAC"'],
+        [0255.chr, '"\\xAD"'],
+        [0256.chr, '"\\xAE"'],
+        [0257.chr, '"\\xAF"'],
+        [0260.chr, '"\\xB0"'],
+        [0261.chr, '"\\xB1"'],
+        [0262.chr, '"\\xB2"'],
+        [0263.chr, '"\\xB3"'],
+        [0264.chr, '"\\xB4"'],
+        [0265.chr, '"\\xB5"'],
+        [0266.chr, '"\\xB6"'],
+        [0267.chr, '"\\xB7"'],
+        [0270.chr, '"\\xB8"'],
+        [0271.chr, '"\\xB9"'],
+        [0272.chr, '"\\xBA"'],
+        [0273.chr, '"\\xBB"'],
+        [0274.chr, '"\\xBC"'],
+        [0275.chr, '"\\xBD"'],
+        [0276.chr, '"\\xBE"'],
+        [0277.chr, '"\\xBF"'],
+        [0300.chr, '"\\xC0"'],
+        [0301.chr, '"\\xC1"'],
+        [0302.chr, '"\\xC2"'],
+        [0303.chr, '"\\xC3"'],
+        [0304.chr, '"\\xC4"'],
+        [0305.chr, '"\\xC5"'],
+        [0306.chr, '"\\xC6"'],
+        [0307.chr, '"\\xC7"'],
+        [0310.chr, '"\\xC8"'],
+        [0311.chr, '"\\xC9"'],
+        [0312.chr, '"\\xCA"'],
+        [0313.chr, '"\\xCB"'],
+        [0314.chr, '"\\xCC"'],
+        [0315.chr, '"\\xCD"'],
+        [0316.chr, '"\\xCE"'],
+        [0317.chr, '"\\xCF"'],
+        [0320.chr, '"\\xD0"'],
+        [0321.chr, '"\\xD1"'],
+        [0322.chr, '"\\xD2"'],
+        [0323.chr, '"\\xD3"'],
+        [0324.chr, '"\\xD4"'],
+        [0325.chr, '"\\xD5"'],
+        [0326.chr, '"\\xD6"'],
+        [0327.chr, '"\\xD7"'],
+        [0330.chr, '"\\xD8"'],
+        [0331.chr, '"\\xD9"'],
+        [0332.chr, '"\\xDA"'],
+        [0333.chr, '"\\xDB"'],
+        [0334.chr, '"\\xDC"'],
+        [0335.chr, '"\\xDD"'],
+        [0336.chr, '"\\xDE"'],
+        [0337.chr, '"\\xDF"'],
+        [0340.chr, '"\\xE0"'],
+        [0341.chr, '"\\xE1"'],
+        [0342.chr, '"\\xE2"'],
+        [0343.chr, '"\\xE3"'],
+        [0344.chr, '"\\xE4"'],
+        [0345.chr, '"\\xE5"'],
+        [0346.chr, '"\\xE6"'],
+        [0347.chr, '"\\xE7"'],
+        [0350.chr, '"\\xE8"'],
+        [0351.chr, '"\\xE9"'],
+        [0352.chr, '"\\xEA"'],
+        [0353.chr, '"\\xEB"'],
+        [0354.chr, '"\\xEC"'],
+        [0355.chr, '"\\xED"'],
+        [0356.chr, '"\\xEE"'],
+        [0357.chr, '"\\xEF"'],
+        [0360.chr, '"\\xF0"'],
+        [0361.chr, '"\\xF1"'],
+        [0362.chr, '"\\xF2"'],
+        [0363.chr, '"\\xF3"'],
+        [0364.chr, '"\\xF4"'],
+        [0365.chr, '"\\xF5"'],
+        [0366.chr, '"\\xF6"'],
+        [0367.chr, '"\\xF7"'],
+        [0370.chr, '"\\xF8"'],
+        [0371.chr, '"\\xF9"'],
+        [0372.chr, '"\\xFA"'],
+        [0373.chr, '"\\xFB"'],
+        [0374.chr, '"\\xFC"'],
+        [0375.chr, '"\\xFD"'],
+        [0376.chr, '"\\xFE"'],
+        [0377.chr, '"\\xFF"']
+      ].should be_computed_by(:inspect)
+    end
+
+    it "returns a string with non-printing, characters replaced by \\u notation for Unicode strings" do
+      [ [0000.chr('utf-8'), '"\u0000"'],
+        [0001.chr('utf-8'), '"\u0001"'],
+        [0002.chr('utf-8'), '"\u0002"'],
+        [0003.chr('utf-8'), '"\u0003"'],
+        [0004.chr('utf-8'), '"\u0004"'],
+        [0005.chr('utf-8'), '"\u0005"'],
+        [0006.chr('utf-8'), '"\u0006"'],
+        [0016.chr('utf-8'), '"\u000E"'],
+        [0017.chr('utf-8'), '"\u000F"'],
+        [0020.chr('utf-8'), '"\u0010"'],
+        [0021.chr('utf-8'), '"\u0011"'],
+        [0022.chr('utf-8'), '"\u0012"'],
+        [0023.chr('utf-8'), '"\u0013"'],
+        [0024.chr('utf-8'), '"\u0014"'],
+        [0025.chr('utf-8'), '"\u0015"'],
+        [0026.chr('utf-8'), '"\u0016"'],
+        [0027.chr('utf-8'), '"\u0017"'],
+        [0030.chr('utf-8'), '"\u0018"'],
+        [0031.chr('utf-8'), '"\u0019"'],
+        [0032.chr('utf-8'), '"\u001A"'],
+        [0034.chr('utf-8'), '"\u001C"'],
+        [0035.chr('utf-8'), '"\u001D"'],
+        [0036.chr('utf-8'), '"\u001E"'],
+        [0037.chr('utf-8'), '"\u001F"'],
+        [0177.chr('utf-8'), '"\u007F"'],
+        [0200.chr('utf-8'), '"\u0080"'],
+        [0201.chr('utf-8'), '"\u0081"'],
+        [0202.chr('utf-8'), '"\u0082"'],
+        [0203.chr('utf-8'), '"\u0083"'],
+        [0204.chr('utf-8'), '"\u0084"'],
+        [0206.chr('utf-8'), '"\u0086"'],
+        [0207.chr('utf-8'), '"\u0087"'],
+        [0210.chr('utf-8'), '"\u0088"'],
+        [0211.chr('utf-8'), '"\u0089"'],
+        [0212.chr('utf-8'), '"\u008A"'],
+        [0213.chr('utf-8'), '"\u008B"'],
+        [0214.chr('utf-8'), '"\u008C"'],
+        [0215.chr('utf-8'), '"\u008D"'],
+        [0216.chr('utf-8'), '"\u008E"'],
+        [0217.chr('utf-8'), '"\u008F"'],
+        [0220.chr('utf-8'), '"\u0090"'],
+        [0221.chr('utf-8'), '"\u0091"'],
+        [0222.chr('utf-8'), '"\u0092"'],
+        [0223.chr('utf-8'), '"\u0093"'],
+        [0224.chr('utf-8'), '"\u0094"'],
+        [0225.chr('utf-8'), '"\u0095"'],
+        [0226.chr('utf-8'), '"\u0096"'],
+        [0227.chr('utf-8'), '"\u0097"'],
+        [0230.chr('utf-8'), '"\u0098"'],
+        [0231.chr('utf-8'), '"\u0099"'],
+        [0232.chr('utf-8'), '"\u009A"'],
+        [0233.chr('utf-8'), '"\u009B"'],
+        [0234.chr('utf-8'), '"\u009C"'],
+        [0235.chr('utf-8'), '"\u009D"'],
+        [0236.chr('utf-8'), '"\u009E"'],
+        [0237.chr('utf-8'), '"\u009F"'],
+      ].should be_computed_by(:inspect)
+    end
+
+    it "returns a string with extended characters for Unicode strings" do
+      [ [0240.chr('utf-8'), '" "'],
+        [0241.chr('utf-8'), '"¡"'],
+        [0242.chr('utf-8'), '"¢"'],
+        [0243.chr('utf-8'), '"£"'],
+        [0244.chr('utf-8'), '"¤"'],
+        [0245.chr('utf-8'), '"¥"'],
+        [0246.chr('utf-8'), '"¦"'],
+        [0247.chr('utf-8'), '"§"'],
+        [0250.chr('utf-8'), '"¨"'],
+        [0251.chr('utf-8'), '"©"'],
+        [0252.chr('utf-8'), '"ª"'],
+        [0253.chr('utf-8'), '"«"'],
+        [0254.chr('utf-8'), '"¬"'],
+        [0255.chr('utf-8'), '"­"'],
+        [0256.chr('utf-8'), '"®"'],
+        [0257.chr('utf-8'), '"¯"'],
+        [0260.chr('utf-8'), '"°"'],
+        [0261.chr('utf-8'), '"±"'],
+        [0262.chr('utf-8'), '"²"'],
+        [0263.chr('utf-8'), '"³"'],
+        [0264.chr('utf-8'), '"´"'],
+        [0265.chr('utf-8'), '"µ"'],
+        [0266.chr('utf-8'), '"¶"'],
+        [0267.chr('utf-8'), '"·"'],
+        [0270.chr('utf-8'), '"¸"'],
+        [0271.chr('utf-8'), '"¹"'],
+        [0272.chr('utf-8'), '"º"'],
+        [0273.chr('utf-8'), '"»"'],
+        [0274.chr('utf-8'), '"¼"'],
+        [0275.chr('utf-8'), '"½"'],
+        [0276.chr('utf-8'), '"¾"'],
+        [0277.chr('utf-8'), '"¿"'],
+        [0300.chr('utf-8'), '"À"'],
+        [0301.chr('utf-8'), '"Á"'],
+        [0302.chr('utf-8'), '"Â"'],
+        [0303.chr('utf-8'), '"Ã"'],
+        [0304.chr('utf-8'), '"Ä"'],
+        [0305.chr('utf-8'), '"Å"'],
+        [0306.chr('utf-8'), '"Æ"'],
+        [0307.chr('utf-8'), '"Ç"'],
+        [0310.chr('utf-8'), '"È"'],
+        [0311.chr('utf-8'), '"É"'],
+        [0312.chr('utf-8'), '"Ê"'],
+        [0313.chr('utf-8'), '"Ë"'],
+        [0314.chr('utf-8'), '"Ì"'],
+        [0315.chr('utf-8'), '"Í"'],
+        [0316.chr('utf-8'), '"Î"'],
+        [0317.chr('utf-8'), '"Ï"'],
+        [0320.chr('utf-8'), '"Ð"'],
+        [0321.chr('utf-8'), '"Ñ"'],
+        [0322.chr('utf-8'), '"Ò"'],
+        [0323.chr('utf-8'), '"Ó"'],
+        [0324.chr('utf-8'), '"Ô"'],
+        [0325.chr('utf-8'), '"Õ"'],
+        [0326.chr('utf-8'), '"Ö"'],
+        [0327.chr('utf-8'), '"×"'],
+        [0330.chr('utf-8'), '"Ø"'],
+        [0331.chr('utf-8'), '"Ù"'],
+        [0332.chr('utf-8'), '"Ú"'],
+        [0333.chr('utf-8'), '"Û"'],
+        [0334.chr('utf-8'), '"Ü"'],
+        [0335.chr('utf-8'), '"Ý"'],
+        [0336.chr('utf-8'), '"Þ"'],
+        [0337.chr('utf-8'), '"ß"'],
+        [0340.chr('utf-8'), '"à"'],
+        [0341.chr('utf-8'), '"á"'],
+        [0342.chr('utf-8'), '"â"'],
+        [0343.chr('utf-8'), '"ã"'],
+        [0344.chr('utf-8'), '"ä"'],
+        [0345.chr('utf-8'), '"å"'],
+        [0346.chr('utf-8'), '"æ"'],
+        [0347.chr('utf-8'), '"ç"'],
+        [0350.chr('utf-8'), '"è"'],
+        [0351.chr('utf-8'), '"é"'],
+        [0352.chr('utf-8'), '"ê"'],
+        [0353.chr('utf-8'), '"ë"'],
+        [0354.chr('utf-8'), '"ì"'],
+        [0355.chr('utf-8'), '"í"'],
+        [0356.chr('utf-8'), '"î"'],
+        [0357.chr('utf-8'), '"ï"'],
+        [0360.chr('utf-8'), '"ð"'],
+        [0361.chr('utf-8'), '"ñ"'],
+        [0362.chr('utf-8'), '"ò"'],
+        [0363.chr('utf-8'), '"ó"'],
+        [0364.chr('utf-8'), '"ô"'],
+        [0365.chr('utf-8'), '"õ"'],
+        [0366.chr('utf-8'), '"ö"'],
+        [0367.chr('utf-8'), '"÷"'],
+        [0370.chr('utf-8'), '"ø"'],
+        [0371.chr('utf-8'), '"ù"'],
+        [0372.chr('utf-8'), '"ú"'],
+        [0373.chr('utf-8'), '"û"'],
+        [0374.chr('utf-8'), '"ü"'],
+        [0375.chr('utf-8'), '"ý"'],
+        [0376.chr('utf-8'), '"þ"'],
+        [0377.chr('utf-8'), '"ÿ"']
+      ].should be_computed_by(:inspect)
+    end
+
+    # TODO: these specs need to be fixed, they are testing the result of
+    # #force_encoding being called *after* #inspect.
+    it "produces different output based on #force_encoding" do
+      "äöü".inspect.force_encoding('UTF-8').should == "\"\xC3\xA4\xC3\xB6\xC3\xBC\""
+      "äöü".inspect.force_encoding('ASCII').should == "\"äöü\"".force_encoding('ASCII')
+    end
+
+    it "can handle malformed UTF-8 string for #force_encoding('UTF-8')" do
+      # malformed UTF-8 sequence
+      "\007äöüz\303".inspect.force_encoding('UTF-8').should ==
+        "\"\\aäöüz\\xC3\"".force_encoding('UTF-8')
+    end
+  end
+end

Deleted: MacRuby/trunk/spec/frozen/core/string/inspect_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/inspect_spec_disabled.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/inspect_spec_disabled.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,684 +0,0 @@
-# -*- encoding: utf-8 -*-
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes.rb', __FILE__)
-
-describe "String#inspect" do
-  ruby_version_is "1.9" do
-    before :each do
-      Encoding.default_external = Encoding::UTF_8
-      @orig_exteenc = Encoding.default_external
-    end
-
-    after :each do
-      Encoding.default_external = @orig_exteenc
-    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.should be_an_instance_of(String)
-  end
-
-  it "returns a string with special characters replaced with \\<char> notation" do
-    [ ["\a", '"\\a"'],
-      ["\b", '"\\b"'],
-      ["\t", '"\\t"'],
-      ["\n", '"\\n"'],
-      ["\v", '"\\v"'],
-      ["\f", '"\\f"'],
-      ["\r", '"\\r"'],
-      ["\e", '"\\e"']
-    ].should be_computed_by(:inspect)
-  end
-
-  it "returns a string with \" and \\ escaped with a backslash" do
-    [ ["\"", '"\\""'],
-      ["\\", '"\\\\"']
-    ].should be_computed_by(:inspect)
-  end
-
-  it "returns a string with \\#<char> when # is followed by $, @, {" do
-    [ ["\#$", '"\\#$"'],
-      ["\#@", '"\\#@"'],
-      ["\#{", '"\\#{"']
-    ].should be_computed_by(:inspect)
-  end
-
-  it "returns a string with # not escaped when followed by any other character" do
-    [ ["#", '"#"'],
-      ["#1", '"#1"']
-    ].should be_computed_by(:inspect)
-  end
-
-  it "returns a string with printable non-alphanumeric characters unescaped" do
-    [ [" ", '" "'],
-      ["!", '"!"'],
-      ["$", '"$"'],
-      ["%", '"%"'],
-      ["&", '"&"'],
-      ["'", '"\'"'],
-      ["(", '"("'],
-      [")", '")"'],
-      ["*", '"*"'],
-      ["+", '"+"'],
-      [",", '","'],
-      ["-", '"-"'],
-      [".", '"."'],
-      ["/", '"/"'],
-      [":", '":"'],
-      [";", '";"'],
-      ["<", '"<"'],
-      ["=", '"="'],
-      [">", '">"'],
-      ["?", '"?"'],
-      ["@", '"@"'],
-      ["[", '"["'],
-      ["]", '"]"'],
-      ["^", '"^"'],
-      ["_", '"_"'],
-      ["`", '"`"'],
-      ["{", '"{"'],
-      ["|", '"|"'],
-      ["}", '"}"'],
-      ["~", '"~"']
-    ].should be_computed_by(:inspect)
-  end
-
-  it "returns a string with numeric characters unescaped" do
-    [ ["0", '"0"'],
-      ["1", '"1"'],
-      ["2", '"2"'],
-      ["3", '"3"'],
-      ["4", '"4"'],
-      ["5", '"5"'],
-      ["6", '"6"'],
-      ["7", '"7"'],
-      ["8", '"8"'],
-      ["9", '"9"'],
-    ].should be_computed_by(:inspect)
-  end
-
-  it "returns a string with upper-case alpha characters unescaped" do
-    [ ["A", '"A"'],
-      ["B", '"B"'],
-      ["C", '"C"'],
-      ["D", '"D"'],
-      ["E", '"E"'],
-      ["F", '"F"'],
-      ["G", '"G"'],
-      ["H", '"H"'],
-      ["I", '"I"'],
-      ["J", '"J"'],
-      ["K", '"K"'],
-      ["L", '"L"'],
-      ["M", '"M"'],
-      ["N", '"N"'],
-      ["O", '"O"'],
-      ["P", '"P"'],
-      ["Q", '"Q"'],
-      ["R", '"R"'],
-      ["S", '"S"'],
-      ["T", '"T"'],
-      ["U", '"U"'],
-      ["V", '"V"'],
-      ["W", '"W"'],
-      ["X", '"X"'],
-      ["Y", '"Y"'],
-      ["Z", '"Z"']
-    ].should be_computed_by(:inspect)
-  end
-
-  it "returns a string with lower-case alpha characters unescaped" do
-    [ ["a", '"a"'],
-      ["b", '"b"'],
-      ["c", '"c"'],
-      ["d", '"d"'],
-      ["e", '"e"'],
-      ["f", '"f"'],
-      ["g", '"g"'],
-      ["h", '"h"'],
-      ["i", '"i"'],
-      ["j", '"j"'],
-      ["k", '"k"'],
-      ["l", '"l"'],
-      ["m", '"m"'],
-      ["n", '"n"'],
-      ["o", '"o"'],
-      ["p", '"p"'],
-      ["q", '"q"'],
-      ["r", '"r"'],
-      ["s", '"s"'],
-      ["t", '"t"'],
-      ["u", '"u"'],
-      ["v", '"v"'],
-      ["w", '"w"'],
-      ["x", '"x"'],
-      ["y", '"y"'],
-      ["z", '"z"']
-    ].should be_computed_by(:inspect)
-  end
-
-  ruby_version_is ""..."1.9" do
-    it "returns a string with non-printing characters replaced with \\0nn notation" do
-      [ ["\000", '"\\000"'],
-        ["\001", '"\\001"'],
-        ["\002", '"\\002"'],
-        ["\003", '"\\003"'],
-        ["\004", '"\\004"'],
-        ["\005", '"\\005"'],
-        ["\006", '"\\006"'],
-        ["\016", '"\\016"'],
-        ["\017", '"\\017"'],
-        ["\020", '"\\020"'],
-        ["\021", '"\\021"'],
-        ["\022", '"\\022"'],
-        ["\023", '"\\023"'],
-        ["\024", '"\\024"'],
-        ["\025", '"\\025"'],
-        ["\026", '"\\026"'],
-        ["\027", '"\\027"'],
-        ["\030", '"\\030"'],
-        ["\031", '"\\031"'],
-        ["\032", '"\\032"'],
-        ["\034", '"\\034"'],
-        ["\035", '"\\035"'],
-        ["\036", '"\\036"'],
-        ["\177", '"\\177"'],
-        ["\200", '"\\200"'],
-        ["\201", '"\\201"'],
-        ["\202", '"\\202"'],
-        ["\203", '"\\203"'],
-        ["\204", '"\\204"'],
-        ["\205", '"\\205"'],
-        ["\206", '"\\206"'],
-        ["\207", '"\\207"'],
-        ["\210", '"\\210"'],
-        ["\211", '"\\211"'],
-        ["\212", '"\\212"'],
-        ["\213", '"\\213"'],
-        ["\214", '"\\214"'],
-        ["\215", '"\\215"'],
-        ["\216", '"\\216"'],
-        ["\217", '"\\217"'],
-        ["\220", '"\\220"'],
-        ["\221", '"\\221"'],
-        ["\222", '"\\222"'],
-        ["\223", '"\\223"'],
-        ["\224", '"\\224"'],
-        ["\225", '"\\225"'],
-        ["\226", '"\\226"'],
-        ["\227", '"\\227"'],
-        ["\230", '"\\230"'],
-        ["\231", '"\\231"'],
-        ["\232", '"\\232"'],
-        ["\233", '"\\233"'],
-        ["\234", '"\\234"'],
-        ["\235", '"\\235"'],
-        ["\236", '"\\236"'],
-        ["\237", '"\\237"'],
-        ["\240", '"\\240"'],
-        ["\241", '"\\241"'],
-        ["\242", '"\\242"'],
-        ["\243", '"\\243"'],
-        ["\244", '"\\244"'],
-        ["\245", '"\\245"'],
-        ["\246", '"\\246"'],
-        ["\247", '"\\247"'],
-        ["\250", '"\\250"'],
-        ["\251", '"\\251"'],
-        ["\252", '"\\252"'],
-        ["\253", '"\\253"'],
-        ["\254", '"\\254"'],
-        ["\255", '"\\255"'],
-        ["\256", '"\\256"'],
-        ["\257", '"\\257"'],
-        ["\260", '"\\260"'],
-        ["\261", '"\\261"'],
-        ["\262", '"\\262"'],
-        ["\263", '"\\263"'],
-        ["\264", '"\\264"'],
-        ["\265", '"\\265"'],
-        ["\266", '"\\266"'],
-        ["\267", '"\\267"'],
-        ["\270", '"\\270"'],
-        ["\271", '"\\271"'],
-        ["\272", '"\\272"'],
-        ["\273", '"\\273"'],
-        ["\274", '"\\274"'],
-        ["\275", '"\\275"'],
-        ["\276", '"\\276"'],
-        ["\277", '"\\277"'],
-        ["\300", '"\\300"'],
-        ["\301", '"\\301"'],
-        ["\302", '"\\302"'],
-        ["\303", '"\\303"'],
-        ["\304", '"\\304"'],
-        ["\305", '"\\305"'],
-        ["\306", '"\\306"'],
-        ["\307", '"\\307"'],
-        ["\310", '"\\310"'],
-        ["\311", '"\\311"'],
-        ["\312", '"\\312"'],
-        ["\313", '"\\313"'],
-        ["\314", '"\\314"'],
-        ["\315", '"\\315"'],
-        ["\316", '"\\316"'],
-        ["\317", '"\\317"'],
-        ["\320", '"\\320"'],
-        ["\321", '"\\321"'],
-        ["\322", '"\\322"'],
-        ["\323", '"\\323"'],
-        ["\324", '"\\324"'],
-        ["\325", '"\\325"'],
-        ["\326", '"\\326"'],
-        ["\327", '"\\327"'],
-        ["\330", '"\\330"'],
-        ["\331", '"\\331"'],
-        ["\332", '"\\332"'],
-        ["\333", '"\\333"'],
-        ["\334", '"\\334"'],
-        ["\335", '"\\335"'],
-        ["\336", '"\\336"'],
-        ["\337", '"\\337"'],
-        ["\340", '"\\340"'],
-        ["\341", '"\\341"'],
-        ["\342", '"\\342"'],
-        ["\343", '"\\343"'],
-        ["\344", '"\\344"'],
-        ["\345", '"\\345"'],
-        ["\346", '"\\346"'],
-        ["\347", '"\\347"'],
-        ["\350", '"\\350"'],
-        ["\351", '"\\351"'],
-        ["\352", '"\\352"'],
-        ["\353", '"\\353"'],
-        ["\354", '"\\354"'],
-        ["\355", '"\\355"'],
-        ["\356", '"\\356"'],
-        ["\357", '"\\357"'],
-        ["\360", '"\\360"'],
-        ["\361", '"\\361"'],
-        ["\362", '"\\362"'],
-        ["\363", '"\\363"'],
-        ["\364", '"\\364"'],
-        ["\365", '"\\365"'],
-        ["\366", '"\\366"'],
-        ["\367", '"\\367"'],
-        ["\370", '"\\370"'],
-        ["\371", '"\\371"'],
-        ["\372", '"\\372"'],
-        ["\373", '"\\373"'],
-        ["\374", '"\\374"'],
-        ["\375", '"\\375"'],
-        ["\376", '"\\376"'],
-        ["\377", '"\\377"']
-      ].should be_computed_by(:inspect)
-    end
-
-    describe "with $KCODE" do
-      before :each do
-        @kcode = $KCODE
-      end
-
-      after :each do
-        $KCODE = @kcode
-      end
-
-      it "returns a string with bytes represented in \\0nn notation when $KCODE == 'NONE'" do
-        $KCODE = "NONE"
-        "äöü".inspect.should == "\"\\303\\244\\303\\266\\303\\274\""
-      end
-
-      it "returns a string with extended character set when $KCODE == 'UTF-8'" do
-        $KCODE = "UTF-8"
-        "äöü".inspect.should == "\"äöü\""
-      end
-
-      it "can handle malformed UTF-8 string when $KCODE is UTF-8" do
-        $KCODE = "UTF-8"
-        # malformed UTF-8 sequence
-        "\007äöüz\303".inspect.should == "\"\\aäöüz\\303\""
-      end
-    end
-  end
-
-  ruby_version_is "1.9" do
-    it "returns a string with non-printing characters replaced by \\x notation" do
-      # Avoid the file encoding by computing the string with #chr.
-      [ [0000.chr, '"\\x00"'],
-        [0001.chr, '"\\x01"'],
-        [0002.chr, '"\\x02"'],
-        [0003.chr, '"\\x03"'],
-        [0004.chr, '"\\x04"'],
-        [0005.chr, '"\\x05"'],
-        [0006.chr, '"\\x06"'],
-        [0016.chr, '"\\x0E"'],
-        [0017.chr, '"\\x0F"'],
-        [0020.chr, '"\\x10"'],
-        [0021.chr, '"\\x11"'],
-        [0022.chr, '"\\x12"'],
-        [0023.chr, '"\\x13"'],
-        [0024.chr, '"\\x14"'],
-        [0025.chr, '"\\x15"'],
-        [0026.chr, '"\\x16"'],
-        [0027.chr, '"\\x17"'],
-        [0030.chr, '"\\x18"'],
-        [0031.chr, '"\\x19"'],
-        [0032.chr, '"\\x1A"'],
-        [0034.chr, '"\\x1C"'],
-        [0035.chr, '"\\x1D"'],
-        [0036.chr, '"\\x1E"'],
-        [0037.chr, '"\\x1F"'],
-        [0177.chr, '"\\x7F"'],
-        [0200.chr, '"\\x80"'],
-        [0201.chr, '"\\x81"'],
-        [0202.chr, '"\\x82"'],
-        [0203.chr, '"\\x83"'],
-        [0204.chr, '"\\x84"'],
-        [0205.chr, '"\\x85"'],
-        [0206.chr, '"\\x86"'],
-        [0207.chr, '"\\x87"'],
-        [0210.chr, '"\\x88"'],
-        [0211.chr, '"\\x89"'],
-        [0212.chr, '"\\x8A"'],
-        [0213.chr, '"\\x8B"'],
-        [0214.chr, '"\\x8C"'],
-        [0215.chr, '"\\x8D"'],
-        [0216.chr, '"\\x8E"'],
-        [0217.chr, '"\\x8F"'],
-        [0220.chr, '"\\x90"'],
-        [0221.chr, '"\\x91"'],
-        [0222.chr, '"\\x92"'],
-        [0223.chr, '"\\x93"'],
-        [0224.chr, '"\\x94"'],
-        [0225.chr, '"\\x95"'],
-        [0226.chr, '"\\x96"'],
-        [0227.chr, '"\\x97"'],
-        [0230.chr, '"\\x98"'],
-        [0231.chr, '"\\x99"'],
-        [0232.chr, '"\\x9A"'],
-        [0233.chr, '"\\x9B"'],
-        [0234.chr, '"\\x9C"'],
-        [0235.chr, '"\\x9D"'],
-        [0236.chr, '"\\x9E"'],
-        [0237.chr, '"\\x9F"'],
-        [0240.chr, '"\\xA0"'],
-        [0241.chr, '"\\xA1"'],
-        [0242.chr, '"\\xA2"'],
-        [0243.chr, '"\\xA3"'],
-        [0244.chr, '"\\xA4"'],
-        [0245.chr, '"\\xA5"'],
-        [0246.chr, '"\\xA6"'],
-        [0247.chr, '"\\xA7"'],
-        [0250.chr, '"\\xA8"'],
-        [0251.chr, '"\\xA9"'],
-        [0252.chr, '"\\xAA"'],
-        [0253.chr, '"\\xAB"'],
-        [0254.chr, '"\\xAC"'],
-        [0255.chr, '"\\xAD"'],
-        [0256.chr, '"\\xAE"'],
-        [0257.chr, '"\\xAF"'],
-        [0260.chr, '"\\xB0"'],
-        [0261.chr, '"\\xB1"'],
-        [0262.chr, '"\\xB2"'],
-        [0263.chr, '"\\xB3"'],
-        [0264.chr, '"\\xB4"'],
-        [0265.chr, '"\\xB5"'],
-        [0266.chr, '"\\xB6"'],
-        [0267.chr, '"\\xB7"'],
-        [0270.chr, '"\\xB8"'],
-        [0271.chr, '"\\xB9"'],
-        [0272.chr, '"\\xBA"'],
-        [0273.chr, '"\\xBB"'],
-        [0274.chr, '"\\xBC"'],
-        [0275.chr, '"\\xBD"'],
-        [0276.chr, '"\\xBE"'],
-        [0277.chr, '"\\xBF"'],
-        [0300.chr, '"\\xC0"'],
-        [0301.chr, '"\\xC1"'],
-        [0302.chr, '"\\xC2"'],
-        [0303.chr, '"\\xC3"'],
-        [0304.chr, '"\\xC4"'],
-        [0305.chr, '"\\xC5"'],
-        [0306.chr, '"\\xC6"'],
-        [0307.chr, '"\\xC7"'],
-        [0310.chr, '"\\xC8"'],
-        [0311.chr, '"\\xC9"'],
-        [0312.chr, '"\\xCA"'],
-        [0313.chr, '"\\xCB"'],
-        [0314.chr, '"\\xCC"'],
-        [0315.chr, '"\\xCD"'],
-        [0316.chr, '"\\xCE"'],
-        [0317.chr, '"\\xCF"'],
-        [0320.chr, '"\\xD0"'],
-        [0321.chr, '"\\xD1"'],
-        [0322.chr, '"\\xD2"'],
-        [0323.chr, '"\\xD3"'],
-        [0324.chr, '"\\xD4"'],
-        [0325.chr, '"\\xD5"'],
-        [0326.chr, '"\\xD6"'],
-        [0327.chr, '"\\xD7"'],
-        [0330.chr, '"\\xD8"'],
-        [0331.chr, '"\\xD9"'],
-        [0332.chr, '"\\xDA"'],
-        [0333.chr, '"\\xDB"'],
-        [0334.chr, '"\\xDC"'],
-        [0335.chr, '"\\xDD"'],
-        [0336.chr, '"\\xDE"'],
-        [0337.chr, '"\\xDF"'],
-        [0340.chr, '"\\xE0"'],
-        [0341.chr, '"\\xE1"'],
-        [0342.chr, '"\\xE2"'],
-        [0343.chr, '"\\xE3"'],
-        [0344.chr, '"\\xE4"'],
-        [0345.chr, '"\\xE5"'],
-        [0346.chr, '"\\xE6"'],
-        [0347.chr, '"\\xE7"'],
-        [0350.chr, '"\\xE8"'],
-        [0351.chr, '"\\xE9"'],
-        [0352.chr, '"\\xEA"'],
-        [0353.chr, '"\\xEB"'],
-        [0354.chr, '"\\xEC"'],
-        [0355.chr, '"\\xED"'],
-        [0356.chr, '"\\xEE"'],
-        [0357.chr, '"\\xEF"'],
-        [0360.chr, '"\\xF0"'],
-        [0361.chr, '"\\xF1"'],
-        [0362.chr, '"\\xF2"'],
-        [0363.chr, '"\\xF3"'],
-        [0364.chr, '"\\xF4"'],
-        [0365.chr, '"\\xF5"'],
-        [0366.chr, '"\\xF6"'],
-        [0367.chr, '"\\xF7"'],
-        [0370.chr, '"\\xF8"'],
-        [0371.chr, '"\\xF9"'],
-        [0372.chr, '"\\xFA"'],
-        [0373.chr, '"\\xFB"'],
-        [0374.chr, '"\\xFC"'],
-        [0375.chr, '"\\xFD"'],
-        [0376.chr, '"\\xFE"'],
-        [0377.chr, '"\\xFF"']
-      ].should be_computed_by(:inspect)
-    end
-
-    it "returns a string with non-printing, characters replaced by \\u notation for Unicode strings" do
-      [ [0000.chr('utf-8'), '"\u0000"'],
-        [0001.chr('utf-8'), '"\u0001"'],
-        [0002.chr('utf-8'), '"\u0002"'],
-        [0003.chr('utf-8'), '"\u0003"'],
-        [0004.chr('utf-8'), '"\u0004"'],
-        [0005.chr('utf-8'), '"\u0005"'],
-        [0006.chr('utf-8'), '"\u0006"'],
-        [0016.chr('utf-8'), '"\u000E"'],
-        [0017.chr('utf-8'), '"\u000F"'],
-        [0020.chr('utf-8'), '"\u0010"'],
-        [0021.chr('utf-8'), '"\u0011"'],
-        [0022.chr('utf-8'), '"\u0012"'],
-        [0023.chr('utf-8'), '"\u0013"'],
-        [0024.chr('utf-8'), '"\u0014"'],
-        [0025.chr('utf-8'), '"\u0015"'],
-        [0026.chr('utf-8'), '"\u0016"'],
-        [0027.chr('utf-8'), '"\u0017"'],
-        [0030.chr('utf-8'), '"\u0018"'],
-        [0031.chr('utf-8'), '"\u0019"'],
-        [0032.chr('utf-8'), '"\u001A"'],
-        [0034.chr('utf-8'), '"\u001C"'],
-        [0035.chr('utf-8'), '"\u001D"'],
-        [0036.chr('utf-8'), '"\u001E"'],
-        [0037.chr('utf-8'), '"\u001F"'],
-        [0177.chr('utf-8'), '"\u007F"'],
-        [0200.chr('utf-8'), '"\u0080"'],
-        [0201.chr('utf-8'), '"\u0081"'],
-        [0202.chr('utf-8'), '"\u0082"'],
-        [0203.chr('utf-8'), '"\u0083"'],
-        [0204.chr('utf-8'), '"\u0084"'],
-        [0206.chr('utf-8'), '"\u0086"'],
-        [0207.chr('utf-8'), '"\u0087"'],
-        [0210.chr('utf-8'), '"\u0088"'],
-        [0211.chr('utf-8'), '"\u0089"'],
-        [0212.chr('utf-8'), '"\u008A"'],
-        [0213.chr('utf-8'), '"\u008B"'],
-        [0214.chr('utf-8'), '"\u008C"'],
-        [0215.chr('utf-8'), '"\u008D"'],
-        [0216.chr('utf-8'), '"\u008E"'],
-        [0217.chr('utf-8'), '"\u008F"'],
-        [0220.chr('utf-8'), '"\u0090"'],
-        [0221.chr('utf-8'), '"\u0091"'],
-        [0222.chr('utf-8'), '"\u0092"'],
-        [0223.chr('utf-8'), '"\u0093"'],
-        [0224.chr('utf-8'), '"\u0094"'],
-        [0225.chr('utf-8'), '"\u0095"'],
-        [0226.chr('utf-8'), '"\u0096"'],
-        [0227.chr('utf-8'), '"\u0097"'],
-        [0230.chr('utf-8'), '"\u0098"'],
-        [0231.chr('utf-8'), '"\u0099"'],
-        [0232.chr('utf-8'), '"\u009A"'],
-        [0233.chr('utf-8'), '"\u009B"'],
-        [0234.chr('utf-8'), '"\u009C"'],
-        [0235.chr('utf-8'), '"\u009D"'],
-        [0236.chr('utf-8'), '"\u009E"'],
-        [0237.chr('utf-8'), '"\u009F"'],
-      ].should be_computed_by(:inspect)
-    end
-
-    it "returns a string with extended characters for Unicode strings" do
-      [ [0240.chr('utf-8'), '" "'],
-        [0241.chr('utf-8'), '"¡"'],
-        [0242.chr('utf-8'), '"¢"'],
-        [0243.chr('utf-8'), '"£"'],
-        [0244.chr('utf-8'), '"¤"'],
-        [0245.chr('utf-8'), '"¥"'],
-        [0246.chr('utf-8'), '"¦"'],
-        [0247.chr('utf-8'), '"§"'],
-        [0250.chr('utf-8'), '"¨"'],
-        [0251.chr('utf-8'), '"©"'],
-        [0252.chr('utf-8'), '"ª"'],
-        [0253.chr('utf-8'), '"«"'],
-        [0254.chr('utf-8'), '"¬"'],
-        [0255.chr('utf-8'), '"­"'],
-        [0256.chr('utf-8'), '"®"'],
-        [0257.chr('utf-8'), '"¯"'],
-        [0260.chr('utf-8'), '"°"'],
-        [0261.chr('utf-8'), '"±"'],
-        [0262.chr('utf-8'), '"²"'],
-        [0263.chr('utf-8'), '"³"'],
-        [0264.chr('utf-8'), '"´"'],
-        [0265.chr('utf-8'), '"µ"'],
-        [0266.chr('utf-8'), '"¶"'],
-        [0267.chr('utf-8'), '"·"'],
-        [0270.chr('utf-8'), '"¸"'],
-        [0271.chr('utf-8'), '"¹"'],
-        [0272.chr('utf-8'), '"º"'],
-        [0273.chr('utf-8'), '"»"'],
-        [0274.chr('utf-8'), '"¼"'],
-        [0275.chr('utf-8'), '"½"'],
-        [0276.chr('utf-8'), '"¾"'],
-        [0277.chr('utf-8'), '"¿"'],
-        [0300.chr('utf-8'), '"À"'],
-        [0301.chr('utf-8'), '"Á"'],
-        [0302.chr('utf-8'), '"Â"'],
-        [0303.chr('utf-8'), '"Ã"'],
-        [0304.chr('utf-8'), '"Ä"'],
-        [0305.chr('utf-8'), '"Å"'],
-        [0306.chr('utf-8'), '"Æ"'],
-        [0307.chr('utf-8'), '"Ç"'],
-        [0310.chr('utf-8'), '"È"'],
-        [0311.chr('utf-8'), '"É"'],
-        [0312.chr('utf-8'), '"Ê"'],
-        [0313.chr('utf-8'), '"Ë"'],
-        [0314.chr('utf-8'), '"Ì"'],
-        [0315.chr('utf-8'), '"Í"'],
-        [0316.chr('utf-8'), '"Î"'],
-        [0317.chr('utf-8'), '"Ï"'],
-        [0320.chr('utf-8'), '"Ð"'],
-        [0321.chr('utf-8'), '"Ñ"'],
-        [0322.chr('utf-8'), '"Ò"'],
-        [0323.chr('utf-8'), '"Ó"'],
-        [0324.chr('utf-8'), '"Ô"'],
-        [0325.chr('utf-8'), '"Õ"'],
-        [0326.chr('utf-8'), '"Ö"'],
-        [0327.chr('utf-8'), '"×"'],
-        [0330.chr('utf-8'), '"Ø"'],
-        [0331.chr('utf-8'), '"Ù"'],
-        [0332.chr('utf-8'), '"Ú"'],
-        [0333.chr('utf-8'), '"Û"'],
-        [0334.chr('utf-8'), '"Ü"'],
-        [0335.chr('utf-8'), '"Ý"'],
-        [0336.chr('utf-8'), '"Þ"'],
-        [0337.chr('utf-8'), '"ß"'],
-        [0340.chr('utf-8'), '"à"'],
-        [0341.chr('utf-8'), '"á"'],
-        [0342.chr('utf-8'), '"â"'],
-        [0343.chr('utf-8'), '"ã"'],
-        [0344.chr('utf-8'), '"ä"'],
-        [0345.chr('utf-8'), '"å"'],
-        [0346.chr('utf-8'), '"æ"'],
-        [0347.chr('utf-8'), '"ç"'],
-        [0350.chr('utf-8'), '"è"'],
-        [0351.chr('utf-8'), '"é"'],
-        [0352.chr('utf-8'), '"ê"'],
-        [0353.chr('utf-8'), '"ë"'],
-        [0354.chr('utf-8'), '"ì"'],
-        [0355.chr('utf-8'), '"í"'],
-        [0356.chr('utf-8'), '"î"'],
-        [0357.chr('utf-8'), '"ï"'],
-        [0360.chr('utf-8'), '"ð"'],
-        [0361.chr('utf-8'), '"ñ"'],
-        [0362.chr('utf-8'), '"ò"'],
-        [0363.chr('utf-8'), '"ó"'],
-        [0364.chr('utf-8'), '"ô"'],
-        [0365.chr('utf-8'), '"õ"'],
-        [0366.chr('utf-8'), '"ö"'],
-        [0367.chr('utf-8'), '"÷"'],
-        [0370.chr('utf-8'), '"ø"'],
-        [0371.chr('utf-8'), '"ù"'],
-        [0372.chr('utf-8'), '"ú"'],
-        [0373.chr('utf-8'), '"û"'],
-        [0374.chr('utf-8'), '"ü"'],
-        [0375.chr('utf-8'), '"ý"'],
-        [0376.chr('utf-8'), '"þ"'],
-        [0377.chr('utf-8'), '"ÿ"']
-      ].should be_computed_by(:inspect)
-    end
-
-    # TODO: these specs need to be fixed, they are testing the result of
-    # #force_encoding being called *after* #inspect.
-    it "produces different output based on #force_encoding" do
-      "äöü".inspect.force_encoding('UTF-8').should == "\"\xC3\xA4\xC3\xB6\xC3\xBC\""
-      "äöü".inspect.force_encoding('ASCII').should == "\"äöü\"".force_encoding('ASCII')
-    end
-
-    it "can handle malformed UTF-8 string for #force_encoding('UTF-8')" do
-      # malformed UTF-8 sequence
-      "\007äöüz\303".inspect.force_encoding('UTF-8').should ==
-        "\"\\aäöüz\\xC3\"".force_encoding('UTF-8')
-    end
-  end
-end

Copied: MacRuby/trunk/spec/frozen/core/string/intern_spec.rb (from rev 5210, MacRuby/trunk/spec/frozen/core/string/intern_spec_disabled.rb)
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/intern_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/intern_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,7 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
+require File.expand_path('../shared/to_sym.rb', __FILE__)
+
+describe "String#intern" do
+  it_behaves_like(:string_to_sym, :intern)
+end
\ No newline at end of file

Deleted: MacRuby/trunk/spec/frozen/core/string/intern_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/intern_spec_disabled.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/intern_spec_disabled.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,7 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes.rb', __FILE__)
-require File.expand_path('../shared/to_sym.rb', __FILE__)
-
-describe "String#intern" do
-  it_behaves_like(:string_to_sym, :intern)
-end
\ No newline at end of file

Modified: MacRuby/trunk/spec/frozen/core/string/ljust_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/ljust_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/ljust_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -16,7 +16,7 @@
     "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
@@ -46,7 +46,7 @@
 
     "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)
@@ -66,17 +66,23 @@
     lambda { "hello".ljust(20, Object.new)}.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).should be_kind_of(StringSpecs::MyString)
     StringSpecs::MyString.new("foo").ljust(10).should be_kind_of(StringSpecs::MyString)
     StringSpecs::MyString.new("foo").ljust(10, StringSpecs::MyString.new("x")).should be_kind_of(StringSpecs::MyString)
-    
+
     "".ljust(10, StringSpecs::MyString.new("x")).should be_kind_of(String)
     "foo".ljust(10, StringSpecs::MyString.new("x")).should be_kind_of(String)
   end
+
+  it "when padding is tainted and self is untainted returns a tainted string if and only if length is longer than self" do
+    "hello".ljust(4, 'X'.taint).tainted?.should be_false
+    "hello".ljust(5, 'X'.taint).tainted?.should be_false
+    "hello".ljust(6, 'X'.taint).tainted?.should be_true
+  end
 end

Modified: MacRuby/trunk/spec/frozen/core/string/modulo_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/modulo_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/modulo_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -30,7 +30,7 @@
     lambda { ("foo%quux" % []) }.should raise_error(ArgumentError)
   end
 
-  it "raises an error if NULL or \n appear anywhere else in the format string" do
+  it "raises an error if NULL or \\n appear anywhere else in the format string" do
     begin
       old_debug, $DEBUG = $DEBUG, false
 
@@ -113,6 +113,10 @@
     ("%2$.2f" % [0, 1]).should == "1.00"
   end
 
+  it "allows more than one digit of position" do
+    ("%50$d" % (0..100).to_a).should == "49"
+  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
@@ -167,6 +171,21 @@
     ("%*1$.*2$3$d" % [10, 5, 1]).should == "     00001"
   end
 
+  it "allows negative width to imply '-' flag" do
+    ("%*1$.*2$3$d" % [-10, 5, 1]).should == "00001     "
+    ("%-*1$.*2$3$d" % [10, 5, 1]).should == "00001     "
+    ("%-*1$.*2$3$d" % [-10, 5, 1]).should == "00001     "
+  end
+
+  it "ignores negative precision" do
+    ("%*1$.*2$3$d" % [10, -5, 1]).should == "         1"
+  end
+
+  it "allows a star to take an argument number to use as the width" do
+    ("%1$*2$s" % ["a", 8]).should == "       a"
+    ("%1$*10$s" % ["a",0,0,0,0,0,0,0,0,8]).should == "       a"
+  end
+
   it "calls to_int on width star and precision star tokens" do
     w = mock('10')
     w.should_receive(:to_int).and_return(10)
@@ -175,6 +194,15 @@
     p.should_receive(:to_int).and_return(5)
 
     ("%*.*f" % [w, p, 1]).should == "   1.00000"
+
+
+    w = mock('10')
+    w.should_receive(:to_int).and_return(10)
+
+    p = mock('5')
+    p.should_receive(:to_int).and_return(5)
+
+    ("%*.*d" % [w, p, 1]).should == "     00001"
   end
 
   ruby_bug "#", "1.8.6.228" do
@@ -664,21 +692,13 @@
   end
 
   ruby_version_is ""..."1.9" do
-    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
+    # 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
-
-    deviates_on :rubinius do
-      it "does not support negative bignums" do
-        lambda { ("%u" % -(2 ** 64 + 5)) }.should raise_error(ArgumentError)
-      end
-    end
   end
 
   ruby_version_is "1.9" do

Copied: MacRuby/trunk/spec/frozen/core/string/next_spec.rb (from rev 5210, MacRuby/trunk/spec/frozen/core/string/next_spec_disabled.rb)
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/next_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/next_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,11 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
+require File.expand_path('../shared/succ.rb', __FILE__)
+
+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

Deleted: MacRuby/trunk/spec/frozen/core/string/next_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/next_spec_disabled.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/next_spec_disabled.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,11 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes.rb', __FILE__)
-require File.expand_path('../shared/succ.rb', __FILE__)
-
-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

Modified: MacRuby/trunk/spec/frozen/core/string/rindex_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/rindex_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/rindex_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,5 +1,6 @@
 require File.expand_path('../../../spec_helper', __FILE__)
 require File.expand_path('../fixtures/classes.rb', __FILE__)
+require File.expand_path('../fixtures/utf-8-encoding.rb', __FILE__)
 
 describe "String#rindex with object" do
   it "raises a TypeError if obj isn't a String, Fixnum or Regexp" do
@@ -433,4 +434,10 @@
   it "raises a TypeError when given offset is nil" do
     lambda { "str".rindex(/../, nil) }.should raise_error(TypeError)
   end
+  
+  ruby_version_is "1.9.2" do
+    it "reverse matches multibyte UTF-8 chars" do
+      StringSpecs::UTF8Encoding.egrave.rindex(/[\w\W]/).should == 0
+    end
+  end
 end

Modified: MacRuby/trunk/spec/frozen/core/string/rjust_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/rjust_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/rjust_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -79,4 +79,10 @@
     "".rjust(10, StringSpecs::MyString.new("x")).should be_kind_of(String)
     "foo".rjust(10, StringSpecs::MyString.new("x")).should be_kind_of(String)
   end
+
+  it "when padding is tainted and self is untainted returns a tainted string if and only if length is longer than self" do
+    "hello".rjust(4, 'X'.taint).tainted?.should be_false
+    "hello".rjust(5, 'X'.taint).tainted?.should be_false
+    "hello".rjust(6, 'X'.taint).tainted?.should be_true
+  end
 end

Modified: MacRuby/trunk/spec/frozen/core/string/scan_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/scan_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/scan_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -74,21 +74,26 @@
     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 }
+  ruby_bug "#4087", "1.9.2.135" do
+    it "taints the results if the String argument is tainted" do
+      a = "hello hello hello".scan("hello".taint)
+      a.each { |m| m.tainted?.should be_true }
+    end
+  end
 
+  it "taints the results when passed a String argument if self is tainted" do
     a = "hello hello hello".taint.scan("hello")
-    a.each { |m| m.tainted?.should == true }
+    a.each { |m| m.tainted?.should be_true }
+  end
 
+  it "taints the results if the Regexp argument is tainted" do
     a = "hello".scan(/./.taint)
-    a.each { |m| m.tainted?.should == true }
+    a.each { |m| m.tainted?.should be_true }
+  end
 
+  it "taints the results when passed a Regexp argument if self is tainted" do
     a = "hello".taint.scan(/./)
-    a.each { |m| m.tainted?.should == true }
+    a.each { |m| m.tainted?.should be_true }
   end
 end
 
@@ -172,19 +177,21 @@
     $~.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 }
+  ruby_bug "#4087", "1.9.2.135" do
+    it "taints the results if the String argument is tainted" do
+      "hello hello hello".scan("hello".taint).each { |m| m.tainted?.should be_true }
     end
+  end
 
-    "hello hello hello".taint.scan("hello") { |m| m.tainted?.should == true }
+  it "taints the results when passed a String argument if self is tainted" do
+    "hello hello hello".taint.scan("hello").each { |m| m.tainted?.should be_true }
+  end
 
-    "hello".scan(/./.taint) { |m| m.tainted?.should == true }
-    "hello".taint.scan(/./) { |m| m.tainted?.should == true }
+  it "taints the results if the Regexp argument is tainted" do
+    "hello".scan(/./.taint).each { |m| m.tainted?.should be_true }
   end
+
+  it "taints the results when passed a Regexp argument if self is tainted" do
+    "hello".taint.scan(/./).each { |m| m.tainted?.should be_true }
+  end
 end

Copied: MacRuby/trunk/spec/frozen/core/string/setbyte_spec.rb (from rev 5210, MacRuby/trunk/spec/frozen/core/string/setbyte_spec_disabled.rb)
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/setbyte_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/setbyte_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,55 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+
+ruby_version_is "1.8.8" do
+  describe "String#setbyte" do
+    it "returns an Integer" do
+      "a".setbyte(0,1).should be_kind_of(Integer)
+    end
+    
+    it "modifies the receiver" do
+      str = "glark"
+      old_id = str.object_id
+      str.setbyte(0,88)
+      str.object_id.should == old_id
+    end
+
+    it "changes the byte at the given index to the new byte" do
+      str = "a"
+      str.setbyte(0,98)
+      str.should == 'b'
+    end
+
+    it "allows changing bytes in multi-byte characters" do
+      str = "\u{915}"
+      str.setbyte(1,254)
+      str.getbyte(1).should == 254
+    end
+
+    it "can invalidate a String's encoding" do
+      str = "glark"
+      str.valid_encoding?.should be_true
+      str.setbyte(2,253)
+      str.valid_encoding?.should be_false
+    end
+
+    it "regards a negative index as counting from the end of the String" do
+      str = "hedgehog"
+      str.setbyte(-3, 108)
+      str.should == "hedgelog"
+    end
+
+    it "raises an IndexError unless the index is inside the String" do
+      lambda { "?".setbyte(1,97) }.should raise_error(IndexError)
+    end
+
+    it "raises a RuntimeError if self is frozen" do
+      str = "cold".freeze
+      str.frozen?.should be_true
+      lambda { str.setbyte(3,96) }.should raise_error(RuntimeError)
+    end
+    
+    it "raises a TypeError unless the second argument is an Integer" do
+      lambda { "a".setbyte(0,'a') }.should raise_error(TypeError)
+    end  
+  end
+end

Deleted: MacRuby/trunk/spec/frozen/core/string/setbyte_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/setbyte_spec_disabled.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/setbyte_spec_disabled.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,55 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-ruby_version_is "1.8.8" do
-  describe "String#setbyte" do
-    it "returns an Integer" do
-      "a".setbyte(0,1).should be_kind_of(Integer)
-    end
-    
-    it "modifies the receiver" do
-      str = "glark"
-      old_id = str.object_id
-      str.setbyte(0,88)
-      str.object_id.should == old_id
-    end
-
-    it "changes the byte at the given index to the new byte" do
-      str = "a"
-      str.setbyte(0,98)
-      str.should == 'b'
-    end
-
-    it "allows changing bytes in multi-byte characters" do
-      str = "\u{915}"
-      str.setbyte(1,254)
-      str.getbyte(1).should == 254
-    end
-
-    it "can invalidate a String's encoding" do
-      str = "glark"
-      str.valid_encoding?.should be_true
-      str.setbyte(2,253)
-      str.valid_encoding?.should be_false
-    end
-
-    it "regards a negative index as counting from the end of the String" do
-      str = "hedgehog"
-      str.setbyte(-3, 108)
-      str.should == "hedgelog"
-    end
-
-    it "raises an IndexError unless the index is inside the String" do
-      lambda { "?".setbyte(1,97) }.should raise_error(IndexError)
-    end
-
-    it "raises a RuntimeError if self is frozen" do
-      str = "cold".freeze
-      str.frozen?.should be_true
-      lambda { str.setbyte(3,96) }.should raise_error(RuntimeError)
-    end
-    
-    it "raises a TypeError unless the second argument is an Integer" do
-      lambda { "a".setbyte(0,'a') }.should raise_error(TypeError)
-    end  
-  end
-end

Modified: MacRuby/trunk/spec/frozen/core/string/split_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/split_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/split_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -82,6 +82,7 @@
   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", ""]
+    " now's  the time  ".split(' ', 3).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"]

Modified: MacRuby/trunk/spec/frozen/core/string/sub_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/sub_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/sub_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -338,7 +338,7 @@
     end
   end
 
-  ruby_version_is "1.9" do    
+  ruby_version_is "1.9" do
     it "raises a RuntimeError when self is frozen" do
       s = "hello"
       s.freeze
@@ -347,7 +347,7 @@
       lambda { s.sub!(/e/, "e")       }.should raise_error(RuntimeError)
       lambda { s.sub!(/[aeiou]/, '*') }.should raise_error(RuntimeError)
     end
-  end    
+  end
 end
 
 describe "String#sub! with pattern and block" do
@@ -396,17 +396,33 @@
   end
 
   ruby_version_is ""..."1.9" do
-    it "raises a RuntimeError when self is frozen" do
-      s = "hello"
-      s.freeze
+    deviates_on :rubinius do
+      # MRI 1.8.x is inconsistent here, raising a TypeError when not passed
+      # a block and a RuntimeError when passed a block. This is arguably a
+      # bug in MRI. In 1.9, both situations raise a RuntimeError.
+      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(RuntimeError)
-      lambda { s.sub!(/[aeiou]/) { '*' } }.should raise_error(RuntimeError)
+        s.sub!(/ROAR/) { "x" } # ok
+        lambda { s.sub!(/e/) { "e" }       }.should raise_error(TypeError)
+        lambda { s.sub!(/[aeiou]/) { '*' } }.should raise_error(TypeError)
+      end
     end
+
+    not_compliant_on :rubinius do
+      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
   end
 
-  ruby_version_is "1.9" do    
+  ruby_version_is "1.9" do
     it "raises a RuntimeError when self is frozen" do
       s = "hello"
       s.freeze
@@ -415,5 +431,5 @@
       lambda { s.sub!(/e/) { "e" }       }.should raise_error(RuntimeError)
       lambda { s.sub!(/[aeiou]/) { '*' } }.should raise_error(RuntimeError)
     end
-  end    
+  end
 end

Copied: MacRuby/trunk/spec/frozen/core/string/succ_spec.rb (from rev 5210, MacRuby/trunk/spec/frozen/core/string/succ_spec_disabled.rb)
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/succ_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/succ_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,11 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
+require File.expand_path('../shared/succ.rb', __FILE__)
+
+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

Deleted: MacRuby/trunk/spec/frozen/core/string/succ_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/succ_spec_disabled.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/succ_spec_disabled.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,11 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes.rb', __FILE__)
-require File.expand_path('../shared/succ.rb', __FILE__)
-
-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

Copied: MacRuby/trunk/spec/frozen/core/string/to_s_spec.rb (from rev 5210, MacRuby/trunk/spec/frozen/core/string/to_s_spec_disabled.rb)
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/to_s_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/to_s_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,7 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
+require File.expand_path('../shared/to_s.rb', __FILE__)
+
+describe "String#to_s" do
+  it_behaves_like(:string_to_s, :to_s)
+end
\ No newline at end of file

Deleted: MacRuby/trunk/spec/frozen/core/string/to_s_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/to_s_spec_disabled.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/to_s_spec_disabled.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,7 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes.rb', __FILE__)
-require File.expand_path('../shared/to_s.rb', __FILE__)
-
-describe "String#to_s" do
-  it_behaves_like(:string_to_s, :to_s)
-end
\ No newline at end of file

Copied: MacRuby/trunk/spec/frozen/core/string/to_str_spec.rb (from rev 5210, MacRuby/trunk/spec/frozen/core/string/to_str_spec_disabled.rb)
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/to_str_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/to_str_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,7 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
+require File.expand_path('../shared/to_s.rb', __FILE__)
+
+describe "String#to_str" do
+  it_behaves_like(:string_to_s, :to_str)
+end
\ No newline at end of file

Deleted: MacRuby/trunk/spec/frozen/core/string/to_str_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/to_str_spec_disabled.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/to_str_spec_disabled.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,7 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes.rb', __FILE__)
-require File.expand_path('../shared/to_s.rb', __FILE__)
-
-describe "String#to_str" do
-  it_behaves_like(:string_to_s, :to_str)
-end
\ No newline at end of file

Copied: MacRuby/trunk/spec/frozen/core/string/to_sym_spec.rb (from rev 5210, MacRuby/trunk/spec/frozen/core/string/to_sym_spec_disabled.rb)
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/to_sym_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/to_sym_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,7 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
+require File.expand_path('../shared/to_sym.rb', __FILE__)
+
+describe "String#to_sym" do
+  it_behaves_like(:string_to_sym, :to_sym)
+end
\ No newline at end of file

Deleted: MacRuby/trunk/spec/frozen/core/string/to_sym_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/to_sym_spec_disabled.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/to_sym_spec_disabled.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,7 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes.rb', __FILE__)
-require File.expand_path('../shared/to_sym.rb', __FILE__)
-
-describe "String#to_sym" do
-  it_behaves_like(:string_to_sym, :to_sym)
-end
\ No newline at end of file

Modified: MacRuby/trunk/spec/frozen/core/string/tr_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/tr_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/tr_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -21,6 +21,14 @@
     "hello".tr("a-z", "A-H.").should == "HE..."
   end
 
+  it "treats a descending range in the replacement as containing just the start character" do
+    "hello".tr("a-y", "z-b").should == "zzzzz"
+  end
+
+  it "treats a descending range in the source as empty" do
+    "hello".tr("l-a", "z").should == "hello"
+  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"

Added: MacRuby/trunk/spec/frozen/core/string/unpack/a_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/unpack/a_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/unpack/a_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,51 @@
+# -*- encoding: ascii-8bit -*-
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+require File.expand_path('../shared/basic', __FILE__)
+require File.expand_path('../shared/string', __FILE__)
+
+describe "String#unpack with format 'A'" do
+  it_behaves_like :string_unpack_basic, 'A'
+  it_behaves_like :string_unpack_no_platform, 'A'
+  it_behaves_like :string_unpack_string, 'A'
+  it_behaves_like :string_unpack_Aa, 'A'
+
+  it "removes trailing space and NULL bytes from the decoded string" do
+    [ ["a\x00 b \x00",  ["a\x00 b", ""]],
+      ["a\x00 b \x00 ", ["a\x00 b", ""]],
+      ["a\x00 b\x00 ",  ["a\x00 b", ""]],
+      ["a\x00 b\x00",   ["a\x00 b", ""]],
+      ["a\x00 b ",      ["a\x00 b", ""]]
+    ].should be_computed_by(:unpack, "A*A")
+  end
+
+  it "does not remove whitespace other than space" do
+    [ ["a\x00 b\x00\f", ["a\x00 b\x00\f"]],
+      ["a\x00 b\x00\n", ["a\x00 b\x00\n"]],
+      ["a\x00 b\x00\r", ["a\x00 b\x00\r"]],
+      ["a\x00 b\x00\t", ["a\x00 b\x00\t"]],
+      ["a\x00 b\x00\v", ["a\x00 b\x00\v"]],
+    ].should be_computed_by(:unpack, "A*")
+  end
+end
+
+describe "String#unpack with format 'a'" do
+  it_behaves_like :string_unpack_basic, 'a'
+  it_behaves_like :string_unpack_no_platform, 'a'
+  it_behaves_like :string_unpack_string, 'a'
+  it_behaves_like :string_unpack_Aa, 'a'
+
+  it "does not remove trailing whitespace or NULL bytes from the decoded string" do
+    [ ["a\x00 b \x00",  ["a\x00 b \x00"]],
+      ["a\x00 b \x00 ", ["a\x00 b \x00 "]],
+      ["a\x00 b\x00 ",  ["a\x00 b\x00 "]],
+      ["a\x00 b\x00",   ["a\x00 b\x00"]],
+      ["a\x00 b ",      ["a\x00 b "]],
+      ["a\x00 b\f",     ["a\x00 b\f"]],
+      ["a\x00 b\n",     ["a\x00 b\n"]],
+      ["a\x00 b\r",     ["a\x00 b\r"]],
+      ["a\x00 b\t",     ["a\x00 b\t"]],
+      ["a\x00 b\v",     ["a\x00 b\v"]]
+    ].should be_computed_by(:unpack, "a*")
+  end
+end

Added: MacRuby/trunk/spec/frozen/core/string/unpack/at_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/unpack/at_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/unpack/at_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,29 @@
+# -*- encoding: ascii-8bit -*-
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+require File.expand_path('../shared/basic', __FILE__)
+
+describe "String#unpack with format '@'" do
+  it_behaves_like :string_unpack_basic, '@'
+  it_behaves_like :string_unpack_no_platform, '@'
+
+  it "moves the read index to the byte specified by the count" do
+    "\x01\x02\x03\x04".unpack("C3 at 2C").should == [1, 2, 3, 3]
+  end
+
+  it "implicitly has a count of zero when count is not specified" do
+    "\x01\x02\x03\x04".unpack("C2 at C").should == [1, 2, 1]
+  end
+
+  it "has no effect when passed the '*' modifier" do
+    "\x01\x02\x03\x04".unpack("C2@*C").should == [1, 2, 3]
+  end
+
+  it "positions the read index one beyond the last readable byte in the String" do
+    "\x01\x02\x03\x04".unpack("C2 at 4C").should == [1, 2, nil]
+  end
+
+  it "raises an ArgumentError if the count exceeds the size of the String" do
+    lambda { "\x01\x02\x03\x04".unpack("C2 at 5C") }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/trunk/spec/frozen/core/string/unpack/b_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/unpack/b_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/unpack/b_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,184 @@
+# -*- encoding: ascii-8bit -*-
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+require File.expand_path('../shared/basic', __FILE__)
+
+describe "String#unpack with format 'B'" do
+  it_behaves_like :string_unpack_basic, 'B'
+  it_behaves_like :string_unpack_no_platform, 'B'
+
+  it "decodes one bit from each byte for each format character starting with the most significant bit" do
+    [ ["\x00",     "B",  ["0"]],
+      ["\x80",     "B",  ["1"]],
+      ["\x0f",     "B",  ["0"]],
+      ["\x8f",     "B",  ["1"]],
+      ["\x7f",     "B",  ["0"]],
+      ["\xff",     "B",  ["1"]],
+      ["\x80\x00", "BB", ["1", "0"]],
+      ["\x8f\x00", "BB", ["1", "0"]],
+      ["\x80\x0f", "BB", ["1", "0"]],
+      ["\x80\x8f", "BB", ["1", "1"]],
+      ["\x80\x80", "BB", ["1", "1"]],
+      ["\x0f\x80", "BB", ["0", "1"]]
+    ].should be_computed_by(:unpack)
+  end
+
+  it "decodes only the number of bits in the string when passed a count" do
+    "\x83".unpack("B25").should == ["10000011"]
+  end
+
+  it "decodes multiple differing bit counts from a single string" do
+    str = "\xaa\xaa\xaa\xaa\x55\xaa\xd4\xc3\x6b\xd7\xaa\xd7\xc3\xd4\xaa\x6b\xd7\xaa"
+    array = str.unpack("B5B6B7B8B9B10B13B14B16B17")
+    array.should == ["10101", "101010", "1010101", "10101010", "010101011",
+                     "1101010011", "0110101111010", "10101010110101",
+                     "1100001111010100", "10101010011010111"]
+  end
+
+  it "decodes a directive with a '*' modifier after a directive with a count modifier" do
+    "\xd4\xc3\x6b\xd7".unpack("B5B*").should == ["11010", "110000110110101111010111"]
+  end
+
+  it "decodes a directive with a count modifier after a directive with a '*' modifier" do
+    "\xd4\xc3\x6b\xd7".unpack("B*B5").should == ["11010100110000110110101111010111", ""]
+  end
+
+  it "decodes the number of bits specified by the count modifier" do
+    [ ["\x00",     "B0",  [""]],
+      ["\x80",     "B1",  ["1"]],
+      ["\x7f",     "B2",  ["01"]],
+      ["\x8f",     "B3",  ["100"]],
+      ["\x7f",     "B4",  ["0111"]],
+      ["\xff",     "B5",  ["11111"]],
+      ["\xf8",     "B6",  ["111110"]],
+      ["\x9c",     "B7",  ["1001110"]],
+      ["\xbd",     "B8",  ["10111101"]],
+      ["\x80\x80", "B9",  ["100000001"]],
+      ["\x80\x70", "B10", ["1000000001"]],
+      ["\x80\x20", "B11", ["10000000001"]],
+      ["\x8f\x10", "B12", ["100011110001"]],
+      ["\x8f\x0f", "B13", ["1000111100001"]],
+      ["\x80\x0f", "B14", ["10000000000011"]],
+      ["\x80\x8f", "B15", ["100000001000111"]],
+      ["\x0f\x81", "B16", ["0000111110000001"]]
+    ].should be_computed_by(:unpack)
+  end
+
+  it "decodes all the bits when passed the '*' modifier" do
+    [ ["",         [""]],
+      ["\x00",     ["00000000"]],
+      ["\x80",     ["10000000"]],
+      ["\x7f",     ["01111111"]],
+      ["\x81",     ["10000001"]],
+      ["\x0f",     ["00001111"]],
+      ["\x80\x80", ["1000000010000000"]],
+      ["\x8f\x10", ["1000111100010000"]],
+      ["\x00\x10", ["0000000000010000"]]
+    ].should be_computed_by(:unpack, "B*")
+  end
+
+  it "adds an empty string for each element requested beyond the end of the String" do
+    [ ["",          ["", "", ""]],
+      ["\x80",      ["1", "", ""]],
+      ["\x80\x08",  ["1", "0", ""]]
+    ].should be_computed_by(:unpack, "BBB")
+  end
+
+  it "ignores NULL bytes between directives" do
+    "\x80\x00".unpack("B\x00B").should == ["1", "0"]
+  end
+
+  it "ignores spaces between directives" do
+    "\x80\x00".unpack("B B").should == ["1", "0"]
+  end
+end
+
+describe "String#unpack with format 'b'" do
+  it_behaves_like :string_unpack_basic, 'b'
+  it_behaves_like :string_unpack_no_platform, 'b'
+
+  it "decodes one bit from each byte for each format character starting with the least significant bit" do
+    [ ["\x00",     "b",  ["0"]],
+      ["\x01",     "b",  ["1"]],
+      ["\xf0",     "b",  ["0"]],
+      ["\xf1",     "b",  ["1"]],
+      ["\xfe",     "b",  ["0"]],
+      ["\xff",     "b",  ["1"]],
+      ["\x01\x00", "bb", ["1", "0"]],
+      ["\xf1\x00", "bb", ["1", "0"]],
+      ["\x01\xf0", "bb", ["1", "0"]],
+      ["\x01\xf1", "bb", ["1", "1"]],
+      ["\x01\x01", "bb", ["1", "1"]],
+      ["\xf0\x01", "bb", ["0", "1"]]
+    ].should be_computed_by(:unpack)
+  end
+
+  it "decodes only the number of bits in the string when passed a count" do
+    "\x83".unpack("b25").should == ["11000001"]
+  end
+
+  it "decodes multiple differing bit counts from a single string" do
+    str = "\xaa\xaa\xaa\xaa\x55\xaa\xd4\xc3\x6b\xd7\xaa\xd7\xc3\xd4\xaa\x6b\xd7\xaa"
+    array = str.unpack("b5b6b7b8b9b10b13b14b16b17")
+    array.should == ["01010", "010101", "0101010", "01010101", "101010100",
+                     "0010101111", "1101011011101", "01010101111010",
+                     "1100001100101011", "01010101110101101"]
+  end
+
+  it "decodes a directive with a '*' modifier after a directive with a count modifier" do
+    "\xd4\xc3\x6b\xd7".unpack("b5b*").should == ["00101", "110000111101011011101011"]
+  end
+
+  it "decodes a directive with a count modifier after a directive with a '*' modifier" do
+    "\xd4\xc3\x6b\xd7".unpack("b*b5").should == ["00101011110000111101011011101011", ""]
+  end
+
+  it "decodes the number of bits specified by the count modifier" do
+    [ ["\x00",     "b0",  [""]],
+      ["\x01",     "b1",  ["1"]],
+      ["\xfe",     "b2",  ["01"]],
+      ["\xfc",     "b3",  ["001"]],
+      ["\xf7",     "b4",  ["1110"]],
+      ["\xff",     "b5",  ["11111"]],
+      ["\xfe",     "b6",  ["011111"]],
+      ["\xce",     "b7",  ["0111001"]],
+      ["\xbd",     "b8",  ["10111101"]],
+      ["\x01\xff", "b9",  ["100000001"]],
+      ["\x01\xfe", "b10", ["1000000001"]],
+      ["\x01\xfc", "b11", ["10000000001"]],
+      ["\xf1\xf8", "b12", ["100011110001"]],
+      ["\xe1\xf1", "b13", ["1000011110001"]],
+      ["\x03\xe0", "b14", ["11000000000001"]],
+      ["\x47\xc0", "b15", ["111000100000001"]],
+      ["\x81\x0f", "b16", ["1000000111110000"]]
+    ].should be_computed_by(:unpack)
+  end
+
+  it "decodes all the bits when passed the '*' modifier" do
+    [ ["",         [""]],
+      ["\x00",     ["00000000"]],
+      ["\x80",     ["00000001"]],
+      ["\x7f",     ["11111110"]],
+      ["\x81",     ["10000001"]],
+      ["\x0f",     ["11110000"]],
+      ["\x80\x80", ["0000000100000001"]],
+      ["\x8f\x10", ["1111000100001000"]],
+      ["\x00\x10", ["0000000000001000"]]
+    ].should be_computed_by(:unpack, "b*")
+  end
+
+  it "adds an empty string for each element requested beyond the end of the String" do
+    [ ["",          ["", "", ""]],
+      ["\x01",      ["1", "", ""]],
+      ["\x01\x80",  ["1", "0", ""]]
+    ].should be_computed_by(:unpack, "bbb")
+  end
+
+  it "ignores NULL bytes between directives" do
+    "\x01\x00".unpack("b\x00b").should == ["1", "0"]
+  end
+
+  it "ignores spaces between directives" do
+    "\x01\x00".unpack("b b").should == ["1", "0"]
+  end
+end

Modified: MacRuby/trunk/spec/frozen/core/string/unpack/c_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/unpack/c_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/unpack/c_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,4 +1,4 @@
-# -*- encoding: utf-8 -*-
+# -*- encoding: ascii-8bit -*-
 require File.expand_path('../../../../spec_helper', __FILE__)
 require File.expand_path('../../fixtures/classes', __FILE__)
 
@@ -11,7 +11,7 @@
     "abc".unpack(unpack_format(nil, 2)).should == [97, 98]
   end
 
-  it "decods the number of bytes requested by the count modifier" do
+  it "decodes the number of bytes requested by the count modifier" do
     "abc".unpack(unpack_format(2)).should == [97, 98]
   end
 
@@ -44,6 +44,7 @@
 end
 
 describe "String#unpack with format 'C'" do
+  it_behaves_like :string_unpack_basic, 'C'
   it_behaves_like :string_unpack_8bit, 'C'
 
   it "decodes a byte with most significant bit set as a positive number" do
@@ -52,6 +53,7 @@
 end
 
 describe "String#unpack with format 'c'" do
+  it_behaves_like :string_unpack_basic, 'c'
   it_behaves_like :string_unpack_8bit, 'c'
 
   it "decodes a byte with most significant bit set as a negative number" do

Added: MacRuby/trunk/spec/frozen/core/string/unpack/comment_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/unpack/comment_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/unpack/comment_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,25 @@
+# -*- encoding: ascii-8bit -*-
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+
+describe "String#unpack" do
+  it "ignores directives text from '#' to the first newline" do
+    "\x01\x02\x03".unpack("c#this is a comment\nc").should == [1, 2]
+  end
+
+  it "ignores directives text from '#' to the end if no newline is present" do
+    "\x01\x02\x03".unpack("c#this is a comment c").should == [1]
+  end
+
+  it "ignores comments at the start of the directives string" do
+    "\x01\x02\x03".unpack("#this is a comment\nc").should == [1]
+  end
+
+  it "ignores the entire directive string if it is a comment" do
+    "\x01\x02\x03".unpack("#this is a comment c").should == []
+  end
+
+  it "ignores multiple comments" do
+    "\x01\x02\x03".unpack("c#comment\nc#comment\nc#c").should == [1, 2, 3]
+  end
+end

Added: MacRuby/trunk/spec/frozen/core/string/unpack/i_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/unpack/i_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/unpack/i_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,71 @@
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+require File.expand_path('../shared/integer', __FILE__)
+
+little_endian do
+  describe "String#unpack with format 'I'" do
+    it_behaves_like :string_unpack_basic, 'I'
+    it_behaves_like :string_unpack_32bit_le, 'I'
+    it_behaves_like :string_unpack_32bit_le_unsigned, 'I'
+  end
+
+  describe "String#unpack with format 'I' with modifier '_'" do
+    it_behaves_like :string_unpack_32bit_le, 'I_'
+    it_behaves_like :string_unpack_32bit_le_unsigned, 'I_'
+  end
+
+  describe "String#unpack with format 'I' with modifier '!'" do
+    it_behaves_like :string_unpack_32bit_le, 'I!'
+    it_behaves_like :string_unpack_32bit_le_unsigned, 'I!'
+  end
+
+  describe "String#unpack with format 'i'" do
+    it_behaves_like :string_unpack_basic, 'i'
+    it_behaves_like :string_unpack_32bit_le, 'i'
+    it_behaves_like :string_unpack_32bit_le_signed, 'i'
+  end
+
+  describe "String#unpack with format 'i' with modifier '_'" do
+    it_behaves_like :string_unpack_32bit_le, 'i_'
+    it_behaves_like :string_unpack_32bit_le_signed, 'i_'
+  end
+
+  describe "String#unpack with format 'i' with modifier '!'" do
+    it_behaves_like :string_unpack_32bit_le, 'i!'
+    it_behaves_like :string_unpack_32bit_le_signed, 'i!'
+  end
+end
+
+big_endian do
+  describe "String#unpack with format 'I'" do
+    it_behaves_like :string_unpack_basic, 'I'
+    it_behaves_like :string_unpack_32bit_be, 'I'
+    it_behaves_like :string_unpack_32bit_be_unsigned, 'I'
+  end
+
+  describe "String#unpack with format 'I' with modifier '_'" do
+    it_behaves_like :string_unpack_32bit_be, 'I_'
+    it_behaves_like :string_unpack_32bit_be_unsigned, 'I_'
+  end
+
+  describe "String#unpack with format 'I' with modifier '!'" do
+    it_behaves_like :string_unpack_32bit_be, 'I!'
+    it_behaves_like :string_unpack_32bit_be_unsigned, 'I!'
+  end
+
+  describe "String#unpack with format 'i'" do
+    it_behaves_like :string_unpack_basic, 'i'
+    it_behaves_like :string_unpack_32bit_be, 'i'
+    it_behaves_like :string_unpack_32bit_be_signed, 'i'
+  end
+
+  describe "String#unpack with format 'i' with modifier '_'" do
+    it_behaves_like :string_unpack_32bit_be, 'i_'
+    it_behaves_like :string_unpack_32bit_be_signed, 'i_'
+  end
+
+  describe "String#unpack with format 'i' with modifier '!'" do
+    it_behaves_like :string_unpack_32bit_be, 'i!'
+    it_behaves_like :string_unpack_32bit_be_signed, 'i!'
+  end
+end

Added: MacRuby/trunk/spec/frozen/core/string/unpack/l_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/unpack/l_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/unpack/l_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,215 @@
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+require File.expand_path('../shared/integer', __FILE__)
+
+little_endian do
+  describe "String#unpack with format 'L'" do
+    it_behaves_like :string_unpack_basic, 'L'
+    it_behaves_like :string_unpack_32bit_le, 'L'
+    it_behaves_like :string_unpack_32bit_le_unsigned, 'L'
+  end
+
+  describe "String#unpack with format 'l'" do
+    it_behaves_like :string_unpack_basic, 'l'
+    it_behaves_like :string_unpack_32bit_le, 'l'
+    it_behaves_like :string_unpack_32bit_le_signed, 'l'
+  end
+
+  platform_is :wordsize => 32 do
+    describe "String#unpack with format 'L' with modifier '_'" do
+      it_behaves_like :string_unpack_32bit_le, 'L_'
+      it_behaves_like :string_unpack_32bit_le_unsigned, 'L_'
+    end
+
+    describe "String#unpack with format 'L' with modifier '!'" do
+      it_behaves_like :string_unpack_32bit_le, 'L!'
+      it_behaves_like :string_unpack_32bit_le_unsigned, 'L!'
+    end
+
+    describe "String#unpack with format 'l' with modifier '_'" do
+      it_behaves_like :string_unpack_32bit_le, 'l_'
+      it_behaves_like :string_unpack_32bit_le_signed, 'l'
+    end
+
+    describe "String#unpack with format 'l' with modifier '!'" do
+      it_behaves_like :string_unpack_32bit_le, 'l!'
+      it_behaves_like :string_unpack_32bit_le_signed, 'l'
+    end
+  end
+
+  platform_is :wordsize => 64 do
+    platform_is_not :os => :windows do
+      describe "String#unpack with format 'L' with modifier '_'" do
+        it_behaves_like :string_unpack_64bit_le, 'L_'
+        it_behaves_like :string_unpack_64bit_le_unsigned, 'L_'
+      end
+
+      describe "String#unpack with format 'L' with modifier '!'" do
+        it_behaves_like :string_unpack_64bit_le, 'L!'
+        it_behaves_like :string_unpack_64bit_le_unsigned, 'L!'
+      end
+
+      describe "String#unpack with format 'l' with modifier '_'" do
+        it_behaves_like :string_unpack_64bit_le, 'l_'
+        it_behaves_like :string_unpack_64bit_le_signed, 'l_'
+      end
+
+      describe "String#unpack with format 'l' with modifier '!'" do
+        it_behaves_like :string_unpack_64bit_le, 'l!'
+        it_behaves_like :string_unpack_64bit_le_signed, 'l!'
+      end
+    end
+
+    platform_is :os => :windows do
+      not_compliant_on :jruby do
+        describe "String#unpack with format 'L' with modifier '_'" do
+          it_behaves_like :string_unpack_32bit_le, 'L_'
+          it_behaves_like :string_unpack_32bit_le_unsigned, 'L_'
+        end
+
+        describe "String#unpack with format 'L' with modifier '!'" do
+          it_behaves_like :string_unpack_32bit_le, 'L!'
+          it_behaves_like :string_unpack_32bit_le_unsigned, 'L!'
+        end
+
+        describe "String#unpack with format 'l' with modifier '_'" do
+          it_behaves_like :string_unpack_32bit_le, 'l_'
+          it_behaves_like :string_unpack_32bit_le_signed, 'l_'
+        end
+
+        describe "String#unpack with format 'l' with modifier '!'" do
+          it_behaves_like :string_unpack_32bit_le, 'l!'
+          it_behaves_like :string_unpack_32bit_le_signed, 'l!'
+        end
+      end
+
+      deviates_on :jruby do
+        describe "String#unpack with format 'L' with modifier '_'" do
+          it_behaves_like :string_unpack_64bit_le, 'L_'
+          it_behaves_like :string_unpack_64bit_le_unsigned, 'L_'
+        end
+
+        describe "String#unpack with format 'L' with modifier '!'" do
+          it_behaves_like :string_unpack_64bit_le, 'L!'
+          it_behaves_like :string_unpack_64bit_le_unsigned, 'L!'
+        end
+
+        describe "String#unpack with format 'l' with modifier '_'" do
+          it_behaves_like :string_unpack_64bit_le, 'l_'
+          it_behaves_like :string_unpack_64bit_le_signed, 'l_'
+        end
+
+        describe "String#unpack with format 'l' with modifier '!'" do
+          it_behaves_like :string_unpack_64bit_le, 'l!'
+          it_behaves_like :string_unpack_64bit_le_signed, 'l!'
+        end
+      end
+    end
+  end
+end
+
+big_endian do
+  describe "String#unpack with format 'L'" do
+    it_behaves_like :string_unpack_basic, 'L'
+    it_behaves_like :string_unpack_32bit_be, 'L'
+    it_behaves_like :string_unpack_32bit_be_unsigned, 'L'
+  end
+
+  describe "String#unpack with format 'l'" do
+    it_behaves_like :string_unpack_basic, 'l'
+    it_behaves_like :string_unpack_32bit_be, 'l'
+    it_behaves_like :string_unpack_32bit_be_signed, 'l'
+  end
+
+  platform_is :wordsize => 32 do
+    describe "String#unpack with format 'L' with modifier '_'" do
+      it_behaves_like :string_unpack_32bit_be, 'L_'
+      it_behaves_like :string_unpack_32bit_be_unsigned, 'L_'
+    end
+
+    describe "String#unpack with format 'L' with modifier '!'" do
+      it_behaves_like :string_unpack_32bit_be, 'L!'
+      it_behaves_like :string_unpack_32bit_be_unsigned, 'L!'
+    end
+
+    describe "String#unpack with format 'l' with modifier '_'" do
+      it_behaves_like :string_unpack_32bit_be, 'l_'
+      it_behaves_like :string_unpack_32bit_be_signed, 'l'
+    end
+
+    describe "String#unpack with format 'l' with modifier '!'" do
+      it_behaves_like :string_unpack_32bit_be, 'l!'
+      it_behaves_like :string_unpack_32bit_be_signed, 'l'
+    end
+  end
+
+  platform_is :wordsize => 64 do
+    platform_is_not :os => :windows do
+      describe "String#unpack with format 'L' with modifier '_'" do
+        it_behaves_like :string_unpack_64bit_be, 'L_'
+        it_behaves_like :string_unpack_64bit_be_unsigned, 'L_'
+      end
+
+      describe "String#unpack with format 'L' with modifier '!'" do
+        it_behaves_like :string_unpack_64bit_be, 'L!'
+        it_behaves_like :string_unpack_64bit_be_unsigned, 'L!'
+      end
+
+      describe "String#unpack with format 'l' with modifier '_'" do
+        it_behaves_like :string_unpack_64bit_be, 'l_'
+        it_behaves_like :string_unpack_64bit_be_signed, 'l_'
+      end
+
+      describe "String#unpack with format 'l' with modifier '!'" do
+        it_behaves_like :string_unpack_64bit_be, 'l!'
+        it_behaves_like :string_unpack_64bit_be_signed, 'l!'
+      end
+    end
+
+    platform_is :os => :windows do
+      not_compliant_on :jruby do
+        describe "String#unpack with format 'L' with modifier '_'" do
+          it_behaves_like :string_unpack_32bit_be, 'L_'
+          it_behaves_like :string_unpack_32bit_be_unsigned, 'L_'
+        end
+
+        describe "String#unpack with format 'L' with modifier '!'" do
+          it_behaves_like :string_unpack_32bit_be, 'L!'
+          it_behaves_like :string_unpack_32bit_be_unsigned, 'L!'
+        end
+
+        describe "String#unpack with format 'l' with modifier '_'" do
+          it_behaves_like :string_unpack_32bit_be, 'l_'
+          it_behaves_like :string_unpack_32bit_be_signed, 'l_'
+        end
+
+        describe "String#unpack with format 'l' with modifier '!'" do
+          it_behaves_like :string_unpack_32bit_be, 'l!'
+          it_behaves_like :string_unpack_32bit_be_signed, 'l!'
+        end
+      end
+
+      deviates_on :jruby do
+        describe "String#unpack with format 'L' with modifier '_'" do
+          it_behaves_like :string_unpack_64bit_be, 'L_'
+          it_behaves_like :string_unpack_64bit_be_unsigned, 'L_'
+        end
+
+        describe "String#unpack with format 'L' with modifier '!'" do
+          it_behaves_like :string_unpack_64bit_be, 'L!'
+          it_behaves_like :string_unpack_64bit_be_unsigned, 'L!'
+        end
+
+        describe "String#unpack with format 'l' with modifier '_'" do
+          it_behaves_like :string_unpack_64bit_be, 'l_'
+          it_behaves_like :string_unpack_64bit_be_signed, 'l_'
+        end
+
+        describe "String#unpack with format 'l' with modifier '!'" do
+          it_behaves_like :string_unpack_64bit_be, 'l!'
+          it_behaves_like :string_unpack_64bit_be_signed, 'l!'
+        end
+      end
+    end
+  end
+end

Added: MacRuby/trunk/spec/frozen/core/string/unpack/m_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/unpack/m_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/unpack/m_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,165 @@
+# -*- encoding: ascii-8bit -*-
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+require File.expand_path('../shared/basic', __FILE__)
+
+describe "String#unpack with format 'M'" do
+  it_behaves_like :string_unpack_basic, 'M'
+  it_behaves_like :string_unpack_no_platform, 'M'
+
+  it "decodes an empty string" do
+    "".unpack("M").should == [""]
+  end
+
+  it "decodes the complete string ignoring newlines when given a single directive" do
+    "a=\nb=\nc=\n".unpack("M").should == ["abc"]
+  end
+
+  it "appends empty string to the array for directives exceeding the input size" do
+    "a=\nb=\nc=\n".unpack("MMM").should == ["abc", "", ""]
+  end
+
+  it "ignores the count or '*' modifier and decodes the entire string" do
+    [ ["a=\nb=\nc=\n", "M238", ["abc"]],
+      ["a=\nb=\nc=\n", "M*",   ["abc"]]
+    ].should be_computed_by(:unpack)
+  end
+
+  it "decodes the '=' character" do
+    "=3D=\n".unpack("M").should == ["="]
+  end
+
+  it "decodes an embedded space character" do
+    "a b=\n".unpack("M").should == ["a b"]
+  end
+
+  it "decodes a space at the end of the pre-encoded string" do
+    "a =\n".unpack("M").should == ["a "]
+  end
+
+  it "decodes an embedded tab character" do
+    "a\tb=\n".unpack("M").should == ["a\tb"]
+  end
+
+  it "decodes a tab character at the end of the pre-encoded string" do
+    "a\t=\n".unpack("M").should == ["a\t"]
+  end
+
+  it "decodes an embedded newline" do
+    "a\nb=\n".unpack("M").should == ["a\nb"]
+  end
+
+  it "decodes pre-encoded byte values 33..60" do
+    [ ["!\"\#$%&'()*+,-./=\n",  ["!\"\#$%&'()*+,-./"]],
+      ["0123456789=\n",         ["0123456789"]],
+      [":;<=\n",                [":;<"]]
+    ].should be_computed_by(:unpack, "M")
+  end
+
+  it "decodes pre-encoded byte values 62..126" do
+    [ [">?@=\n",                        [">?@"]],
+      ["ABCDEFGHIJKLMNOPQRSTUVWXYZ=\n", ["ABCDEFGHIJKLMNOPQRSTUVWXYZ"]],
+      ["[\\]^_`=\n",                    ["[\\]^_`"]],
+      ["abcdefghijklmnopqrstuvwxyz=\n", ["abcdefghijklmnopqrstuvwxyz"]],
+      ["{|}~=\n",                       ["{|}~"]]
+    ].should be_computed_by(:unpack, "M")
+  end
+
+  it "decodes pre-encoded byte values 0..31 except tab and newline" do
+    [ ["=00=01=02=03=04=05=06=\n",  ["\x00\x01\x02\x03\x04\x05\x06"]],
+      ["=07=08=0B=0C=0D=\n",        ["\a\b\v\f\r"]],
+      ["=0E=0F=10=11=12=13=14=\n",  ["\x0e\x0f\x10\x11\x12\x13\x14"]],
+      ["=15=16=17=18=19=1A=\n",     ["\x15\x16\x17\x18\x19\x1a"]],
+      ["=1B=\n",                    ["\e"]],
+      ["=1C=1D=1E=1F=\n",           ["\x1c\x1d\x1e\x1f"]]
+    ].should be_computed_by(:unpack, "M")
+  end
+
+  it "decodes pre-encoded byte values 127..255" do
+    [ ["=7F=80=81=82=83=84=85=86=\n", ["\x7f\x80\x81\x82\x83\x84\x85\x86"]],
+      ["=87=88=89=8A=8B=8C=8D=8E=\n", ["\x87\x88\x89\x8a\x8b\x8c\x8d\x8e"]],
+      ["=8F=90=91=92=93=94=95=96=\n", ["\x8f\x90\x91\x92\x93\x94\x95\x96"]],
+      ["=97=98=99=9A=9B=9C=9D=9E=\n", ["\x97\x98\x99\x9a\x9b\x9c\x9d\x9e"]],
+      ["=9F=A0=A1=A2=A3=A4=A5=A6=\n", ["\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6"]],
+      ["=A7=A8=A9=AA=AB=AC=AD=AE=\n", ["\xa7\xa8\xa9\xaa\xab\xac\xad\xae"]],
+      ["=AF=B0=B1=B2=B3=B4=B5=B6=\n", ["\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6"]],
+      ["=B7=B8=B9=BA=BB=BC=BD=BE=\n", ["\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe"]],
+      ["=BF=C0=C1=C2=C3=C4=C5=C6=\n", ["\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6"]],
+      ["=C7=C8=C9=CA=CB=CC=CD=CE=\n", ["\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce"]],
+      ["=CF=D0=D1=D2=D3=D4=D5=D6=\n", ["\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6"]],
+      ["=D7=D8=D9=DA=DB=DC=DD=DE=\n", ["\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde"]],
+      ["=DF=E0=E1=E2=E3=E4=E5=E6=\n", ["\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6"]],
+      ["=E7=E8=E9=EA=EB=EC=ED=EE=\n", ["\xe7\xe8\xe9\xea\xeb\xec\xed\xee"]],
+      ["=EF=F0=F1=F2=F3=F4=F5=F6=\n", ["\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6"]],
+      ["=F7=F8=F9=FA=FB=FC=FD=FE=\n", ["\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe"]],
+      ["=FF=\n",                      ["\xff"]]
+    ].should be_computed_by(:unpack, "M")
+  end
+end
+
+describe "String#unpack with format 'm'" do
+  it_behaves_like :string_unpack_basic, 'm'
+  it_behaves_like :string_unpack_no_platform, 'm'
+
+  it "decodes an empty string" do
+    "".unpack("m").should == [""]
+  end
+
+  it "decodes the complete string ignoring newlines when given a single directive" do
+    "YWJj\nREVG\n".unpack("m").should == ["abcDEF"]
+  end
+
+  it "ignores the count or '*' modifier and decodes the entire string" do
+    [ ["YWJj\nREVG\n", "m238", ["abcDEF"]],
+      ["YWJj\nREVG\n", "m*",   ["abcDEF"]]
+    ].should be_computed_by(:unpack)
+  end
+
+  it "appends empty string to the array for directives exceeding the input size" do
+    "YWJj\nREVG\n".unpack("mmm").should == ["abcDEF", "", ""]
+  end
+
+  it "decodes all pre-encoded ascii byte values" do
+    [ ["AAECAwQFBg==\n",                          ["\x00\x01\x02\x03\x04\x05\x06"]],
+      ["BwgJCgsMDQ==\n",                          ["\a\b\t\n\v\f\r"]],
+      ["Dg8QERITFBUW\n",                          ["\x0E\x0F\x10\x11\x12\x13\x14\x15\x16"]],
+      ["FxgZGhscHR4f\n",                          ["\x17\x18\x19\x1a\e\x1c\x1d\x1e\x1f"]],
+      ["ISIjJCUmJygpKissLS4v\n",                  ["!\"\#$%&'()*+,-./"]],
+      ["MDEyMzQ1Njc4OQ==\n",                      ["0123456789"]],
+      ["Ojs8PT4/QA==\n",                          [":;<=>?@"]],
+      ["QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVo=\n",  ["ABCDEFGHIJKLMNOPQRSTUVWXYZ"]],
+      ["W1xdXl9g\n",                              ["[\\]^_`"]],
+      ["YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo=\n",  ["abcdefghijklmnopqrstuvwxyz"]],
+      ["e3x9fg==\n",                              ["{|}~"]],
+      ["f8KAwoHCgsKD\n",                          ["\x7f\xc2\x80\xc2\x81\xc2\x82\xc2\x83"]],
+      ["woTChcKGwofC\n",                          ["\xc2\x84\xc2\x85\xc2\x86\xc2\x87\xc2"]],
+      ["iMKJworCi8KM\n",                          ["\x88\xc2\x89\xc2\x8a\xc2\x8b\xc2\x8c"]],
+      ["wo3CjsKPwpDC\n",                          ["\xc2\x8d\xc2\x8e\xc2\x8f\xc2\x90\xc2"]],
+      ["kcKSwpPClMKV\n",                          ["\x91\xc2\x92\xc2\x93\xc2\x94\xc2\x95"]],
+      ["wpbCl8KYwpnC\n",                          ["\xc2\x96\xc2\x97\xc2\x98\xc2\x99\xc2"]],
+      ["msKbwpzCncKe\n",                          ["\x9a\xc2\x9b\xc2\x9c\xc2\x9d\xc2\x9e"]],
+      ["wp/CoMKhwqLC\n",                          ["\xc2\x9f\xc2\xa0\xc2\xa1\xc2\xa2\xc2"]],
+      ["o8KkwqXCpsKn\n",                          ["\xa3\xc2\xa4\xc2\xa5\xc2\xa6\xc2\xa7"]],
+      ["wqjCqcKqwqvC\n",                          ["\xc2\xa8\xc2\xa9\xc2\xaa\xc2\xab\xc2"]],
+      ["rMKtwq7Cr8Kw\n",                          ["\xac\xc2\xad\xc2\xae\xc2\xaf\xc2\xb0"]],
+      ["wrHCssKzwrTC\n",                          ["\xc2\xb1\xc2\xb2\xc2\xb3\xc2\xb4\xc2"]],
+      ["tcK2wrfCuMK5\n",                          ["\xb5\xc2\xb6\xc2\xb7\xc2\xb8\xc2\xb9"]],
+      ["wrrCu8K8wr3C\n",                          ["\xc2\xba\xc2\xbb\xc2\xbc\xc2\xbd\xc2"]],
+      ["vsK/w4DDgcOC\n",                          ["\xbe\xc2\xbf\xc3\x80\xc3\x81\xc3\x82"]],
+      ["w4PDhMOFw4bD\n",                          ["\xc3\x83\xc3\x84\xc3\x85\xc3\x86\xc3"]],
+      ["h8OIw4nDisOL\n",                          ["\x87\xc3\x88\xc3\x89\xc3\x8a\xc3\x8b"]],
+      ["w4zDjcOOw4/D\n",                          ["\xc3\x8c\xc3\x8d\xc3\x8e\xc3\x8f\xc3"]],
+      ["kMORw5LDk8OU\n",                          ["\x90\xc3\x91\xc3\x92\xc3\x93\xc3\x94"]],
+      ["w5XDlsOXw5jD\n",                          ["\xc3\x95\xc3\x96\xc3\x97\xc3\x98\xc3"]],
+      ["mcOaw5vDnMOd\n",                          ["\x99\xc3\x9a\xc3\x9b\xc3\x9c\xc3\x9d"]],
+      ["w57Dn8Ogw6HD\n",                          ["\xc3\x9e\xc3\x9f\xc3\xa0\xc3\xa1\xc3"]],
+      ["osOjw6TDpcOm\n",                          ["\xa2\xc3\xa3\xc3\xa4\xc3\xa5\xc3\xa6"]],
+      ["w6fDqMOpw6rD\n",                          ["\xc3\xa7\xc3\xa8\xc3\xa9\xc3\xaa\xc3"]],
+      ["q8Osw63DrsOv\n",                          ["\xab\xc3\xac\xc3\xad\xc3\xae\xc3\xaf"]],
+      ["w7DDscOyw7PD\n",                          ["\xc3\xb0\xc3\xb1\xc3\xb2\xc3\xb3\xc3"]],
+      ["tMO1w7bDt8O4\n",                          ["\xb4\xc3\xb5\xc3\xb6\xc3\xb7\xc3\xb8"]],
+      ["w7nDusO7w7zD\n",                          ["\xc3\xb9\xc3\xba\xc3\xbb\xc3\xbc\xc3"]],
+      ["vcO+w78=\n",                              ["\xbd\xc3\xbe\xc3\xbf"]]
+    ].should be_computed_by(:unpack, "m")
+  end
+end

Added: MacRuby/trunk/spec/frozen/core/string/unpack/n_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/unpack/n_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/unpack/n_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,18 @@
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+require File.expand_path('../shared/basic', __FILE__)
+require File.expand_path('../shared/integer', __FILE__)
+
+describe "String#unpack with format 'N'" do
+  it_behaves_like :string_unpack_basic, 'N'
+  it_behaves_like :string_unpack_32bit_be, 'N'
+  it_behaves_like :string_unpack_32bit_be_unsigned, 'N'
+  it_behaves_like :string_unpack_no_platform, 'N'
+end
+
+describe "String#unpack with format 'n'" do
+  it_behaves_like :string_unpack_basic, 'n'
+  it_behaves_like :string_unpack_16bit_be, 'n'
+  it_behaves_like :string_unpack_16bit_be_unsigned, 'n'
+  it_behaves_like :string_unpack_no_platform, 'n'
+end

Added: MacRuby/trunk/spec/frozen/core/string/unpack/percent_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/unpack/percent_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/unpack/percent_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,7 @@
+require File.expand_path('../../../../spec_helper', __FILE__)
+
+describe "String#unpack with format '%'" do
+  it "raises an Argument Error" do
+    lambda { "abc".unpack("%") }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/trunk/spec/frozen/core/string/unpack/q_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/unpack/q_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/unpack/q_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,42 @@
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+require File.expand_path('../shared/basic', __FILE__)
+require File.expand_path('../shared/integer', __FILE__)
+
+describe "String#unpack with format 'Q'" do
+  it_behaves_like :string_unpack_basic, 'Q'
+  it_behaves_like :string_unpack_no_platform, 'Q'
+end
+
+describe "String#unpack with format 'q'" do
+  it_behaves_like :string_unpack_basic, 'q'
+  it_behaves_like :string_unpack_no_platform, 'q'
+end
+
+little_endian do
+  describe "String#unpack with format 'Q'" do
+    it_behaves_like :string_unpack_64bit_le, 'Q'
+    it_behaves_like :string_unpack_64bit_le_extra, 'Q'
+    it_behaves_like :string_unpack_64bit_le_unsigned, 'Q'
+  end
+
+  describe "String#unpack with format 'q'" do
+    it_behaves_like :string_unpack_64bit_le, 'q'
+    it_behaves_like :string_unpack_64bit_le_extra, 'q'
+    it_behaves_like :string_unpack_64bit_le_signed, 'q'
+  end
+end
+
+big_endian do
+  describe "String#unpack with format 'Q'" do
+    it_behaves_like :string_unpack_64bit_be, 'Q'
+    it_behaves_like :string_unpack_64bit_be_extra, 'Q'
+    it_behaves_like :string_unpack_64bit_be_unsigned, 'Q'
+  end
+
+  describe "String#unpack with format 'q'" do
+    it_behaves_like :string_unpack_64bit_be, 'q'
+    it_behaves_like :string_unpack_64bit_be_extra, 'q'
+    it_behaves_like :string_unpack_64bit_be_signed, 'q'
+  end
+end

Added: MacRuby/trunk/spec/frozen/core/string/unpack/s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/unpack/s_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/unpack/s_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,71 @@
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+require File.expand_path('../shared/integer', __FILE__)
+
+little_endian do
+  describe "String#unpack with format 'S'" do
+    it_behaves_like :string_unpack_basic, 'S'
+    it_behaves_like :string_unpack_16bit_le, 'S'
+    it_behaves_like :string_unpack_16bit_le_unsigned, 'S'
+  end
+
+  describe "String#unpack with format 'S' with modifier '_'" do
+    it_behaves_like :string_unpack_16bit_le, 'S_'
+    it_behaves_like :string_unpack_16bit_le_unsigned, 'S_'
+  end
+
+  describe "String#unpack with format 'S' with modifier '!'" do
+    it_behaves_like :string_unpack_16bit_le, 'S!'
+    it_behaves_like :string_unpack_16bit_le_unsigned, 'S!'
+  end
+
+  describe "String#unpack with format 's'" do
+    it_behaves_like :string_unpack_basic, 's'
+    it_behaves_like :string_unpack_16bit_le, 's'
+    it_behaves_like :string_unpack_16bit_le_signed, 's'
+  end
+
+  describe "String#unpack with format 's' with modifier '_'" do
+    it_behaves_like :string_unpack_16bit_le, 's_'
+    it_behaves_like :string_unpack_16bit_le_signed, 's_'
+  end
+
+  describe "String#unpack with format 's' with modifier '!'" do
+    it_behaves_like :string_unpack_16bit_le, 's!'
+    it_behaves_like :string_unpack_16bit_le_signed, 's!'
+  end
+end
+
+big_endian do
+  describe "String#unpack with format 'S'" do
+    it_behaves_like :string_unpack_basic, 'S'
+    it_behaves_like :string_unpack_16bit_be, 'S'
+    it_behaves_like :string_unpack_16bit_be_unsigned, 'S'
+  end
+
+  describe "String#unpack with format 'S' with modifier '_'" do
+    it_behaves_like :string_unpack_16bit_be, 'S_'
+    it_behaves_like :string_unpack_16bit_be_unsigned, 'S_'
+  end
+
+  describe "String#unpack with format 'S' with modifier '!'" do
+    it_behaves_like :string_unpack_16bit_be, 'S!'
+    it_behaves_like :string_unpack_16bit_be_unsigned, 'S!'
+  end
+
+  describe "String#unpack with format 's'" do
+    it_behaves_like :string_unpack_basic, 's'
+    it_behaves_like :string_unpack_16bit_be, 's'
+    it_behaves_like :string_unpack_16bit_be_signed, 's'
+  end
+
+  describe "String#unpack with format 's' with modifier '_'" do
+    it_behaves_like :string_unpack_16bit_be, 's_'
+    it_behaves_like :string_unpack_16bit_be_signed, 's_'
+  end
+
+  describe "String#unpack with format 's' with modifier '!'" do
+    it_behaves_like :string_unpack_16bit_be, 's!'
+    it_behaves_like :string_unpack_16bit_be_signed, 's!'
+  end
+end

Added: MacRuby/trunk/spec/frozen/core/string/unpack/shared/basic.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/unpack/shared/basic.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/unpack/shared/basic.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,25 @@
+describe :string_unpack_basic, :shared => true do
+  it "calls #to_str to coerce the directives string" do
+    d = mock("unpack directive")
+    d.should_receive(:to_str).and_return("a"+unpack_format)
+    "abc".unpack(d).should be_an_instance_of(Array)
+  end
+
+  it "raises a TypeError when passed nil" do
+    lambda { "abc".unpack(nil) }.should raise_error(TypeError)
+  end
+
+  it "raises a TypeError when passed an Integer" do
+    lambda { "abc".unpack(1) }.should raise_error(TypeError)
+  end
+end
+
+describe :string_unpack_no_platform, :shared => true do
+  it "raises an ArgumentError when the format modifier is '_'" do
+    lambda { "abcdefgh".unpack(unpack_format("_")) }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError when the format modifier is '!'" do
+    lambda { "abcdefgh".unpack(unpack_format("!")) }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/trunk/spec/frozen/core/string/unpack/shared/float.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/unpack/shared/float.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/unpack/shared/float.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,267 @@
+# -*- encoding: ascii-8bit -*-
+
+describe :string_unpack_float_le, :shared => true do
+  it "decodes one float for a single format character" do
+    "\x8f\xc2\xb5?".unpack(unpack_format).should == [1.4199999570846558]
+  end
+
+  it "decodes a negative float" do
+    "\xcd\xcc\x08\xc2".unpack(unpack_format).should == [-34.200000762939453]
+  end
+
+  it "decodes two floats for two format characters" do
+    array = "\x9a\x999 at 33\xb3?".unpack(unpack_format(nil, 2))
+    array.should == [2.9000000953674316, 1.399999976158142]
+  end
+
+  it "decodes the number of floats requested by the count modifier" do
+    array = "\x9a\x999 at 33\xb3?33\x03A".unpack(unpack_format(3))
+    array.should == [2.9000000953674316, 1.399999976158142, 8.199999809265137]
+  end
+
+  it "decodes the remaining floats when passed the '*' modifier" do
+    array = "\x9a\x999 at 33\xb3?33\x03A".unpack(unpack_format("*"))
+    array.should == [2.9000000953674316, 1.399999976158142, 8.199999809265137]
+  end
+
+  it "decodes the remaining floats when passed the '*' modifier after another directive" do
+    array = "\x9a\x99\xa9 at 33\x13A".unpack(unpack_format()+unpack_format('*'))
+    array.should == [5.300000190734863, 9.199999809265137]
+  end
+
+  it "does not decode a float when fewer bytes than a float remain and the '*' modifier is passed" do
+    [ ["\xff", []],
+      ["\xff\x00", []],
+      ["\xff\x00\xff", []]
+    ].should be_computed_by(:unpack, unpack_format("*"))
+  end
+
+  it "adds nil for each element requested beyond the end of the String" do
+    [ ["abc",                  [nil, nil, nil]],
+      ["\x8f\xc2\xb5?abc",     [1.4199999570846558, nil, nil]],
+      ["\x9a\x999 at 33\xb3?abc", [2.9000000953674316, 1.399999976158142, nil]]
+    ].should be_computed_by(:unpack, unpack_format(3))
+  end
+
+  it "decodes positive Infinity" do
+    "\x00\x00\x80\x7f".unpack(unpack_format).should == [infinity_value]
+  end
+
+  it "decodes negative Infinity" do
+    "\x00\x00\x80\xff".unpack(unpack_format).should == [-infinity_value]
+  end
+
+  it "decodes NaN" do
+    "\x00\x00\xc0\xff".unpack(unpack_format).first.nan?.should be_true
+  end
+
+  it "ignores NULL bytes between directives" do
+    array = "\x9a\x999 at 33\xb3?".unpack(unpack_format("\000", 2))
+    array.should == [2.9000000953674316, 1.399999976158142]
+  end
+
+  it "ignores spaces between directives" do
+    array = "\x9a\x999 at 33\xb3?".unpack(unpack_format(' ', 2))
+    array.should == [2.9000000953674316, 1.399999976158142]
+  end
+end
+
+describe :string_unpack_float_be, :shared => true do
+  it "decodes one float for a single format character" do
+    "?\xb5\xc2\x8f".unpack(unpack_format).should == [1.4199999570846558]
+  end
+
+  it "decodes a negative float" do
+    "\xc2\x08\xcc\xcd".unpack(unpack_format).should == [-34.200000762939453]
+  end
+
+  it "decodes two floats for two format characters" do
+    array = "@9\x99\x9a?\xb333".unpack(unpack_format(nil, 2))
+    array.should == [2.9000000953674316, 1.399999976158142]
+  end
+
+  it "decodes the number of floats requested by the count modifier" do
+    array = "@9\x99\x9a?\xb333A\x0333".unpack(unpack_format(3))
+    array.should == [2.9000000953674316, 1.399999976158142, 8.199999809265137]
+  end
+
+  it "decodes the remaining floats when passed the '*' modifier" do
+    array = "@9\x99\x9a?\xb333A\x0333".unpack(unpack_format("*"))
+    array.should == [2.9000000953674316, 1.399999976158142, 8.199999809265137]
+  end
+
+  it "decodes the remaining floats when passed the '*' modifier after another directive" do
+    array = "@\xa9\x99\x9aA\x1333".unpack(unpack_format()+unpack_format('*'))
+    array.should == [5.300000190734863, 9.199999809265137]
+  end
+
+  it "does not decode a float when fewer bytes than a float remain and the '*' modifier is passed" do
+    [ ["\xff", []],
+      ["\xff\x00", []],
+      ["\xff\x00\xff", []]
+    ].should be_computed_by(:unpack, unpack_format("*"))
+  end
+
+  it "adds nil for each element requested beyond the end of the String" do
+    [ ["abc",                  [nil, nil, nil]],
+      ["?\xb5\xc2\x8fabc",     [1.4199999570846558, nil, nil]],
+      ["@9\x99\x9a?\xb333abc", [2.9000000953674316, 1.399999976158142, nil]]
+    ].should be_computed_by(:unpack, unpack_format(3))
+  end
+
+  it "decodes positive Infinity" do
+    "\x7f\x80\x00\x00".unpack(unpack_format).should == [infinity_value]
+  end
+
+  it "decodes negative Infinity" do
+    "\xff\x80\x00\x00".unpack(unpack_format).should == [-infinity_value]
+  end
+
+  it "decodes NaN" do
+    "\xff\xc0\x00\x00".unpack(unpack_format).first.nan?.should be_true
+  end
+
+  it "ignores NULL bytes between directives" do
+    array = "@9\x99\x9a?\xb333".unpack(unpack_format("\000", 2))
+    array.should == [2.9000000953674316, 1.399999976158142]
+  end
+
+  it "ignores spaces between directives" do
+    array = "@9\x99\x9a?\xb333".unpack(unpack_format(' ', 2))
+    array.should == [2.9000000953674316, 1.399999976158142]
+  end
+end
+
+describe :string_unpack_double_le, :shared => true do
+  it "decodes one double for a single format character" do
+    "\xb8\x1e\x85\xebQ\xb8\xf6?".unpack(unpack_format).should == [1.42]
+  end
+
+  it "decodes a negative double" do
+    "\x9a\x99\x99\x99\x99\x19A\xc0".unpack(unpack_format).should == [-34.2]
+  end
+
+  it "decodes two doubles for two format characters" do
+    "333333\x07 at ffffff\xf6?".unpack(unpack_format(nil, 2)).should == [2.9, 1.4]
+  end
+
+  it "decodes the number of doubles requested by the count modifier" do
+    array = "333333\x07 at ffffff\xf6?ffffff\x20@".unpack(unpack_format(3))
+    array.should == [2.9, 1.4, 8.2]
+  end
+
+  it "decodes the remaining doubles when passed the '*' modifier" do
+    array = "333333\x07 at ffffff\xf6?ffffff\x20@".unpack(unpack_format("*"))
+    array.should == [2.9, 1.4, 8.2]
+  end
+
+  it "decodes the remaining doubles when passed the '*' modifier after another directive" do
+    array = "333333\x15 at ffffff\x22@".unpack(unpack_format()+unpack_format('*'))
+    array.should == [5.3, 9.2]
+  end
+
+  it "does not decode a double when fewer bytes than a double remain and the '*' modifier is passed" do
+    [ ["\xff", []],
+      ["\xff\x00", []],
+      ["\xff\x00\xff", []],
+      ["\xff\x00\xff\x00", []],
+      ["\xff\x00\xff\x00\xff", []],
+      ["\xff\x00\xff\x00\xff\x00", []],
+      ["\xff\x00\xff\x00\xff\x00\xff", []]
+    ].should be_computed_by(:unpack, unpack_format("*"))
+  end
+
+  it "adds nil for each element requested beyond the end of the String" do
+    [ ["\xff\x00\xff\x00\xff\x00\xff",  [nil, nil, nil]],
+      ["\xb8\x1e\x85\xebQ\xb8\xf6?abc", [1.42, nil, nil]],
+      ["333333\x07 at ffffff\xf6?abcd",    [2.9, 1.4, nil]]
+    ].should be_computed_by(:unpack, unpack_format(3))
+  end
+
+  it "decodes positive Infinity" do
+    "\x00\x00\x00\x00\x00\x00\xf0\x7f".unpack(unpack_format).should == [infinity_value]
+  end
+
+  it "decodes negative Infinity" do
+    "\x00\x00\x00\x00\x00\x00\xf0\xff".unpack(unpack_format).should == [-infinity_value]
+  end
+
+  it "decodes NaN" do
+    "\x00\x00\x00\x00\x00\x00\xf8\xff".unpack(unpack_format).first.nan?.should be_true
+  end
+
+  it "ignores NULL bytes between directives" do
+    "333333\x07 at ffffff\xf6?".unpack(unpack_format("\000", 2)).should == [2.9, 1.4]
+  end
+
+  it "ignores spaces between directives" do
+    "333333\x07 at ffffff\xf6?".unpack(unpack_format(' ', 2)).should == [2.9, 1.4]
+  end
+end
+
+describe :string_unpack_double_be, :shared => true do
+  it "decodes one double for a single format character" do
+    "?\xf6\xb8Q\xeb\x85\x1e\xb8".unpack(unpack_format).should == [1.42]
+  end
+
+  it "decodes a negative double" do
+    "\xc0A\x19\x99\x99\x99\x99\x9a".unpack(unpack_format).should == [-34.2]
+  end
+
+  it "decodes two doubles for two format characters" do
+    "@\x07333333?\xf6ffffff".unpack(unpack_format(nil, 2)).should == [2.9, 1.4]
+  end
+
+  it "decodes the number of doubles requested by the count modifier" do
+    array = "@\x07333333?\xf6ffffff@\x20ffffff".unpack(unpack_format(3))
+    array.should == [2.9, 1.4, 8.2]
+  end
+
+  it "decodes the remaining doubles when passed the '*' modifier" do
+    array = "@\x07333333?\xf6ffffff@\x20ffffff".unpack(unpack_format("*"))
+    array.should == [2.9, 1.4, 8.2]
+  end
+
+  it "decodes the remaining doubles when passed the '*' modifier after another directive" do
+    array = "@\x15333333@\x22ffffff".unpack(unpack_format()+unpack_format('*'))
+    array.should == [5.3, 9.2]
+  end
+
+  it "does not decode a double when fewer bytes than a double remain and the '*' modifier is passed" do
+    [ ["\xff", []],
+      ["\xff\x00", []],
+      ["\xff\x00\xff", []],
+      ["\xff\x00\xff\x00", []],
+      ["\xff\x00\xff\x00\xff", []],
+      ["\xff\x00\xff\x00\xff\x00", []],
+      ["\xff\x00\xff\x00\xff\x00\xff", []]
+    ].should be_computed_by(:unpack, unpack_format("*"))
+  end
+
+  it "adds nil for each element requested beyond the end of the String" do
+    [ ["abcdefg",  [nil, nil, nil]],
+      ["?\xf6\xb8Q\xeb\x85\x1e\xb8abc", [1.42, nil, nil]],
+      ["@\x07333333?\xf6ffffffabcd",    [2.9, 1.4, nil]]
+    ].should be_computed_by(:unpack, unpack_format(3))
+  end
+
+  it "decodes positive Infinity" do
+    "\x7f\xf0\x00\x00\x00\x00\x00\x00".unpack(unpack_format).should == [infinity_value]
+  end
+
+  it "decodes negative Infinity" do
+    "\xff\xf0\x00\x00\x00\x00\x00\x00".unpack(unpack_format).should == [-infinity_value]
+  end
+
+  it "decodes NaN" do
+    "\xff\xf8\x00\x00\x00\x00\x00\x00".unpack(unpack_format).first.nan?.should be_true
+  end
+
+  it "ignores NULL bytes between directives" do
+    "@\x07333333?\xf6ffffff".unpack(unpack_format("\000", 2)).should == [2.9, 1.4]
+  end
+
+  it "ignores spaces between directives" do
+    "@\x07333333?\xf6ffffff".unpack(unpack_format(' ', 2)).should == [2.9, 1.4]
+  end
+end

Added: MacRuby/trunk/spec/frozen/core/string/unpack/shared/integer.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/unpack/shared/integer.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/unpack/shared/integer.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,343 @@
+# -*- encoding: ascii-8bit -*-
+
+describe :string_unpack_16bit_le, :shared => true do
+  it "decodes one short for a single format character" do
+    "ab".unpack(unpack_format).should == [25185]
+  end
+
+  it "decodes two shorts for two format characters" do
+    "abcd".unpack(unpack_format(nil, 2)).should == [25185, 25699]
+  end
+
+  it "decodes the number of shorts requested by the count modifier" do
+    "abcdef".unpack(unpack_format(3)).should == [25185, 25699, 26213]
+  end
+
+  it "decodes the remaining shorts when passed the '*' modifier" do
+    "abcd".unpack(unpack_format('*')).should == [25185, 25699]
+  end
+
+  it "decodes the remaining shorts when passed the '*' modifier after another directive" do
+    "abcd".unpack(unpack_format()+unpack_format('*')).should == [25185, 25699]
+  end
+
+  it "does not decode a short when fewer bytes than a short remain and the '*' modifier is passed" do
+    "\xff".unpack(unpack_format('*')).should == []
+  end
+
+  it "adds nil for each element requested beyond the end of the String" do
+    [ ["",     [nil, nil, nil]],
+      ["abc",  [25185, nil, nil]],
+      ["abcd", [25185, 25699, nil]]
+    ].should be_computed_by(:unpack, unpack_format(3))
+  end
+
+  it "ignores NULL bytes between directives" do
+    "abcd".unpack(unpack_format("\000", 2)).should == [25185, 25699]
+  end
+
+  it "ignores spaces between directives" do
+    "abcd".unpack(unpack_format(' ', 2)).should == [25185, 25699]
+  end
+end
+
+describe :string_unpack_16bit_le_signed, :shared => true do
+  it "decodes a short with most significant bit set as a negative number" do
+    "\x00\xff".unpack(unpack_format()).should == [-256]
+  end
+end
+
+describe :string_unpack_16bit_le_unsigned, :shared => true do
+  it "decodes a short with most significant bit set as a positive number" do
+    "\x00\xff".unpack(unpack_format()).should == [65280]
+  end
+end
+
+describe :string_unpack_16bit_be, :shared => true do
+  it "decodes one short for a single format character" do
+    "ba".unpack(unpack_format).should == [25185]
+  end
+
+  it "decodes two shorts for two format characters" do
+    "badc".unpack(unpack_format(nil, 2)).should == [25185, 25699]
+  end
+
+  it "decodes the number of shorts requested by the count modifier" do
+    "badcfe".unpack(unpack_format(3)).should == [25185, 25699, 26213]
+  end
+
+  it "decodes the remaining shorts when passed the '*' modifier" do
+    "badc".unpack(unpack_format('*')).should == [25185, 25699]
+  end
+
+  it "decodes the remaining shorts when passed the '*' modifier after another directive" do
+    "badc".unpack(unpack_format()+unpack_format('*')).should == [25185, 25699]
+  end
+
+  it "does not decode a short when fewer bytes than a short remain and the '*' modifier is passed" do
+    "\xff".unpack(unpack_format('*')).should == []
+  end
+
+  it "adds nil for each element requested beyond the end of the String" do
+    [ ["",     [nil, nil, nil]],
+      ["bac",  [25185, nil, nil]],
+      ["badc", [25185, 25699, nil]]
+    ].should be_computed_by(:unpack, unpack_format(3))
+  end
+
+  it "ignores NULL bytes between directives" do
+    "badc".unpack(unpack_format("\000", 2)).should == [25185, 25699]
+  end
+
+  it "ignores spaces between directives" do
+    "badc".unpack(unpack_format(' ', 2)).should == [25185, 25699]
+  end
+end
+
+describe :string_unpack_16bit_be_signed, :shared => true do
+  it "decodes a short with most significant bit set as a negative number" do
+    "\xff\x00".unpack(unpack_format()).should == [-256]
+  end
+end
+
+describe :string_unpack_16bit_be_unsigned, :shared => true do
+  it "decodes a short with most significant bit set as a positive number" do
+    "\xff\x00".unpack(unpack_format()).should == [65280]
+  end
+end
+
+describe :string_unpack_32bit_le, :shared => true do
+  it "decodes one int for a single format character" do
+    "abcd".unpack(unpack_format).should == [1684234849]
+  end
+
+  it "decodes two ints for two format characters" do
+    "abghefcd".unpack(unpack_format(nil, 2)).should == [1751605857, 1684235877]
+  end
+
+  it "decodes the number of ints requested by the count modifier" do
+    "abcedfgh".unpack(unpack_format(2)).should == [1701012065, 1751606884]
+  end
+
+  it "decodes the remaining ints when passed the '*' modifier" do
+    "acbdegfh".unpack(unpack_format('*')).should == [1684169569, 1751541605]
+  end
+
+  it "decodes the remaining ints when passed the '*' modifier after another directive" do
+    "abcdefgh".unpack(unpack_format()+unpack_format('*')).should == [1684234849, 1751606885]
+  end
+
+  it "does not decode an int when fewer bytes than an int remain and the '*' modifier is passed" do
+    "abc".unpack(unpack_format('*')).should == []
+  end
+
+  it "adds nil for each element requested beyond the end of the String" do
+    [ ["",          [nil, nil, nil]],
+      ["abcde",     [1684234849, nil, nil]],
+      ["abcdefg",   [1684234849, nil, nil]],
+      ["abcdefgh",  [1684234849, 1751606885, nil]]
+    ].should be_computed_by(:unpack, unpack_format(3))
+  end
+
+  it "ignores NULL bytes between directives" do
+    "abcdefgh".unpack(unpack_format("\000", 2)).should == [1684234849, 1751606885]
+  end
+
+  it "ignores spaces between directives" do
+    "abcdefgh".unpack(unpack_format(' ', 2)).should == [1684234849, 1751606885]
+  end
+end
+
+describe :string_unpack_32bit_le_signed, :shared => true do
+  it "decodes an int with most significant bit set as a negative number" do
+    "\x00\xaa\x00\xff".unpack(unpack_format()).should == [-16733696]
+  end
+end
+
+describe :string_unpack_32bit_le_unsigned, :shared => true do
+  it "decodes an int with most significant bit set as a positive number" do
+    "\x00\xaa\x00\xff".unpack(unpack_format()).should == [4278233600]
+  end
+end
+
+describe :string_unpack_32bit_be, :shared => true do
+  it "decodes one int for a single format character" do
+    "dcba".unpack(unpack_format).should == [1684234849]
+  end
+
+  it "decodes two ints for two format characters" do
+    "hgbadcfe".unpack(unpack_format(nil, 2)).should == [1751605857, 1684235877]
+  end
+
+  it "decodes the number of ints requested by the count modifier" do
+    "ecbahgfd".unpack(unpack_format(2)).should == [1701012065, 1751606884]
+  end
+
+  it "decodes the remaining ints when passed the '*' modifier" do
+    "dbcahfge".unpack(unpack_format('*')).should == [1684169569, 1751541605]
+  end
+
+  it "decodes the remaining ints when passed the '*' modifier after another directive" do
+    "dcbahgfe".unpack(unpack_format()+unpack_format('*')).should == [1684234849, 1751606885]
+  end
+
+  it "does not decode an int when fewer bytes than an int remain and the '*' modifier is passed" do
+    "abc".unpack(unpack_format('*')).should == []
+  end
+
+  it "adds nil for each element requested beyond the end of the String" do
+    [ ["",          [nil, nil, nil]],
+      ["dcbae",     [1684234849, nil, nil]],
+      ["dcbaefg",   [1684234849, nil, nil]],
+      ["dcbahgfe",  [1684234849, 1751606885, nil]]
+    ].should be_computed_by(:unpack, unpack_format(3))
+  end
+
+  it "ignores NULL bytes between directives" do
+    "dcbahgfe".unpack(unpack_format("\000", 2)).should == [1684234849, 1751606885]
+  end
+
+  it "ignores spaces between directives" do
+    "dcbahgfe".unpack(unpack_format(' ', 2)).should == [1684234849, 1751606885]
+  end
+end
+
+describe :string_unpack_32bit_be_signed, :shared => true do
+  it "decodes an int with most significant bit set as a negative number" do
+    "\xff\x00\xaa\x00".unpack(unpack_format()).should == [-16733696]
+  end
+end
+
+describe :string_unpack_32bit_be_unsigned, :shared => true do
+  it "decodes an int with most significant bit set as a positive number" do
+    "\xff\x00\xaa\x00".unpack(unpack_format()).should == [4278233600]
+  end
+end
+
+describe :string_unpack_64bit_le, :shared => true do
+  it "decodes one long for a single format character" do
+    "abcdefgh".unpack(unpack_format).should == [7523094288207667809]
+  end
+
+  it "decodes two longs for two format characters" do
+    array = "abghefcdghefabcd".unpack(unpack_format(nil, 2))
+    array.should == [7233738012216484449, 7233733596956420199]
+  end
+
+  it "decodes the number of longs requested by the count modifier" do
+    array = "abcedfghefcdghef".unpack(unpack_format(2))
+    array.should == [7523094283929477729, 7378418357791581797]
+  end
+
+  it "decodes the remaining longs when passed the '*' modifier" do
+    array = "acbdegfhdegfhacb".unpack(unpack_format('*'))
+    array.should == [7522813912742519649, 7089617339433837924]
+  end
+
+  it "decodes the remaining longs when passed the '*' modifier after another directive" do
+    array = "bcahfgedhfgedbca".unpack(unpack_format()+unpack_format('*'))
+    array.should == [7234302065976107874, 7017560827710891624]
+  end
+
+  it "does not decode a long when fewer bytes than a long remain and the '*' modifier is passed" do
+    "abc".unpack(unpack_format('*')).should == []
+  end
+
+  it "ignores NULL bytes between directives" do
+    array = "abcdefghabghefcd".unpack(unpack_format("\000", 2))
+    array.should == [7523094288207667809, 7233738012216484449]
+  end
+
+  it "ignores spaces between directives" do
+    array = "abcdefghabghefcd".unpack(unpack_format(' ', 2))
+    array.should == [7523094288207667809, 7233738012216484449]
+  end
+end
+
+describe :string_unpack_64bit_le_extra, :shared => true do
+  ruby_bug "#", "1.8.7" do
+    it "adds nil for each element requested beyond the end of the String" do
+      [ ["",                  [nil, nil, nil]],
+        ["abcdefgh",          [7523094288207667809, nil, nil]],
+        ["abcdefghcdefab",    [7523094288207667809, nil, nil]],
+        ["abcdefghcdefabde",  [7523094288207667809, 7306072665971057763, nil]]
+      ].should be_computed_by(:unpack, unpack_format(3))
+    end
+  end
+end
+
+describe :string_unpack_64bit_le_signed, :shared => true do
+  it "decodes a long with most significant bit set as a negative number" do
+    "\x00\xcc\x00\xbb\x00\xaa\x00\xff".unpack(unpack_format()).should == [-71870673923814400]
+  end
+end
+
+describe :string_unpack_64bit_le_unsigned, :shared => true do
+  it "decodes a long with most significant bit set as a positive number" do
+    "\x00\xcc\x00\xbb\x00\xaa\x00\xff".unpack(unpack_format()).should == [18374873399785737216]
+  end
+end
+
+describe :string_unpack_64bit_be, :shared => true do
+  it "decodes one long for a single format character" do
+    "hgfedcba".unpack(unpack_format).should == [7523094288207667809]
+  end
+
+  it "decodes two longs for two format characters" do
+    array = "dcfehgbadcbafehg".unpack(unpack_format(nil, 2))
+    array.should == [7233738012216484449, 7233733596956420199]
+  end
+
+  it "decodes the number of longs requested by the count modifier" do
+    array = "hgfdecbafehgdcfe".unpack(unpack_format(2))
+    array.should == [7523094283929477729, 7378418357791581797]
+  end
+
+  it "decodes the remaining longs when passed the '*' modifier" do
+    array = "hfgedbcabcahfged".unpack(unpack_format('*'))
+    array.should == [7522813912742519649, 7089617339433837924]
+  end
+
+  it "decodes the remaining longs when passed the '*' modifier after another directive" do
+    array = "degfhacbacbdegfh".unpack(unpack_format()+unpack_format('*'))
+    array.should == [7234302065976107874, 7017560827710891624]
+  end
+
+  it "does not decode a long when fewer bytes than a long remain and the '*' modifier is passed" do
+    "abc".unpack(unpack_format('*')).should == []
+  end
+
+  it "ignores NULL bytes between directives" do
+    array = "hgfedcbadcfehgba".unpack(unpack_format("\000", 2))
+    array.should == [7523094288207667809, 7233738012216484449]
+  end
+
+  it "ignores spaces between directives" do
+    array = "hgfedcbadcfehgba".unpack(unpack_format(' ', 2))
+    array.should == [7523094288207667809, 7233738012216484449]
+  end
+end
+
+describe :string_unpack_64bit_be_extra, :shared => true do
+  ruby_bug "#", "1.8.7" do
+    it "adds nil for each element requested beyond the end of the String" do
+      [ ["",                  [nil, nil, nil]],
+        ["hgfedcba",          [7523094288207667809, nil, nil]],
+        ["hgfedcbacdefab",    [7523094288207667809, nil, nil]],
+        ["hgfedcbadeabfedc",  [7523094288207667809, 7306072665971057763, nil]]
+      ].should be_computed_by(:unpack, unpack_format(3))
+    end
+  end
+end
+
+describe :string_unpack_64bit_be_signed, :shared => true do
+  it "decodes a long with most significant bit set as a negative number" do
+    "\xff\x00\xaa\x00\xbb\x00\xcc\x00".unpack(unpack_format()).should == [-71870673923814400]
+  end
+end
+
+describe :string_unpack_64bit_be_unsigned, :shared => true do
+  it "decodes a long with most significant bit set as a positive number" do
+    "\xff\x00\xaa\x00\xbb\x00\xcc\x00".unpack(unpack_format()).should == [18374873399785737216]
+  end
+end

Added: MacRuby/trunk/spec/frozen/core/string/unpack/shared/string.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/unpack/shared/string.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/unpack/shared/string.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,51 @@
+describe :string_unpack_string, :shared => true do
+  it "returns an empty string if the input is empty" do
+    "".unpack(unpack_format).should == [""]
+  end
+
+  it "returns empty strings for repeated formats if the input is empty" do
+    "".unpack(unpack_format(nil, 3)).should == ["", "", ""]
+  end
+
+  it "returns an empty string and does not decode any bytes when the count modifier is zero" do
+    "abc".unpack(unpack_format(0)+unpack_format).should == ["", "a"]
+  end
+
+  it "implicitly has a count of one when no count is specified" do
+    "abc".unpack(unpack_format).should == ["a"]
+  end
+
+  it "decodes the number of bytes specified by the count modifier" do
+    "abc".unpack(unpack_format(3)).should == ["abc"]
+  end
+
+  it "decodes the number of bytes specified by the count modifier including whitespace bytes" do
+    [ ["a bc",  ["a b", "c"]],
+      ["a\fbc", ["a\fb", "c"]],
+      ["a\nbc", ["a\nb", "c"]],
+      ["a\rbc", ["a\rb", "c"]],
+      ["a\tbc", ["a\tb", "c"]],
+      ["a\vbc", ["a\vb", "c"]]
+    ].should be_computed_by(:unpack, unpack_format(3)+unpack_format)
+  end
+
+  it "decodes past whitespace bytes when passed the '*' modifier" do
+    [ ["a b c",    ["a b c"]],
+      ["a\fb c",   ["a\fb c"]],
+      ["a\nb c",   ["a\nb c"]],
+      ["a\rb c",   ["a\rb c"]],
+      ["a\tb c",   ["a\tb c"]],
+      ["a\vb c",   ["a\vb c"]],
+    ].should be_computed_by(:unpack, unpack_format("*"))
+  end
+end
+
+describe :string_unpack_Aa, :shared => true do
+  it "decodes the number of bytes specified by the count modifier including NULL bytes" do
+    "a\x00bc".unpack(unpack_format(3)+unpack_format).should == ["a\x00b", "c"]
+  end
+
+  it "decodes past NULL bytes when passed the '*' modifier" do
+    "a\x00b c".unpack(unpack_format("*")).should == ["a\x00b c"]
+  end
+end

Added: MacRuby/trunk/spec/frozen/core/string/unpack/shared/unicode.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/unpack/shared/unicode.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/unpack/shared/unicode.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,60 @@
+# -*- encoding: utf-8 -*-
+
+describe :string_unpack_unicode, :shared => true do
+  it "decodes Unicode codepoints as ASCII values" do
+    [ ["\x00",      [0]],
+      ["\x01",      [1]],
+      ["\x08",      [8]],
+      ["\x0f",      [15]],
+      ["\x18",      [24]],
+      ["\x1f",      [31]],
+      ["\x7f",      [127]],
+      ["\xc2\x80",  [128]],
+      ["\xc2\x81",  [129]],
+      ["\xc3\xbf",  [255]]
+    ].should be_computed_by(:unpack, "U")
+  end
+
+  it "decodes the number of characters specified by the count modifier" do
+    [ ["\xc2\x80\xc2\x81\xc2\x82\xc2\x83", "U1", [0x80]],
+      ["\xc2\x80\xc2\x81\xc2\x82\xc2\x83", "U2", [0x80, 0x81]],
+      ["\xc2\x80\xc2\x81\xc2\x82\xc2\x83", "U3", [0x80, 0x81, 0x82]]
+    ].should be_computed_by(:unpack)
+  end
+
+  it "implicitly has a count of one when no count modifier is passed" do
+    "\xc2\x80\xc2\x81\xc2\x82\xc2\x83".unpack("U1").should == [0x80]
+  end
+
+  it "decodes all remaining characters when passed the '*' modifier" do
+    "\xc2\x80\xc2\x81\xc2\x82\xc2\x83".unpack("U*").should == [0x80, 0x81, 0x82, 0x83]
+  end
+
+  it "decodes UTF-8 BMP codepoints" do
+    [ ["\xc2\x80",      [0x80]],
+      ["\xdf\xbf",      [0x7ff]],
+      ["\xe0\xa0\x80",  [0x800]],
+      ["\xef\xbf\xbf",  [0xffff]]
+    ].should be_computed_by(:unpack, "U")
+  end
+
+  it "decodes UTF-8 max codepoints" do
+    [ ["\xf0\x90\x80\x80", [0x10000]],
+      ["\xf3\xbf\xbf\xbf", [0xfffff]],
+      ["\xf4\x80\x80\x80", [0x100000]],
+      ["\xf4\x8f\xbf\xbf", [0x10ffff]]
+    ].should be_computed_by(:unpack, "U")
+  end
+
+  it "does not decode any items for directives exceeding the input string size" do
+    "\xc2\x80".unpack("UUUU").should == [0x80]
+  end
+
+  it "ignores NULL bytes between directives" do
+    "\x01\x02".unpack("U\x00U").should == [1, 2]
+  end
+
+  it "ignores spaces between directives" do
+    "\x01\x02".unpack("U U").should == [1, 2]
+  end
+end

Added: MacRuby/trunk/spec/frozen/core/string/unpack/u_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/unpack/u_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/unpack/u_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,78 @@
+# -*- encoding: ascii-8bit -*-
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+require File.expand_path('../shared/basic', __FILE__)
+require File.expand_path('../shared/unicode', __FILE__)
+
+describe "String#unpack with format 'U'" do
+  it_behaves_like :string_unpack_basic, 'U'
+  it_behaves_like :string_unpack_no_platform, 'U'
+  it_behaves_like :string_unpack_unicode, 'U'
+end
+
+describe "String#unpack with format 'u'" do
+  it_behaves_like :string_unpack_basic, 'u'
+  it_behaves_like :string_unpack_no_platform, 'u'
+
+  it "decodes an empty string as an empty string" do
+    "".unpack("u").should == [""]
+  end
+
+  it "decodes the complete string ignoring newlines when given a single directive" do
+    "#86)C\n#1$5&\n".unpack("u").should == ["abcDEF"]
+  end
+
+  it "appends empty string to the array for directives exceeding the input size" do
+    "#86)C\n#1$5&\n".unpack("uuu").should == ["abcDEF", "", ""]
+  end
+
+  it "ignores the count or '*' modifier and decodes the entire string" do
+    [ ["#86)C\n#1$5&\n", "u238", ["abcDEF"]],
+      ["#86)C\n#1$5&\n", "u*",   ["abcDEF"]]
+    ].should be_computed_by(:unpack)
+  end
+
+  it "decodes all ascii characters" do
+    [ ["'``$\"`P0%!@``\n",          ["\x00\x01\x02\x03\x04\x05\x06"]],
+      ["'!P@)\"@L,#0``\n",          ["\a\b\t\n\v\f\r"]],
+      [")\#@\\0$1(3%!46\n",         ["\x0E\x0F\x10\x11\x12\x13\x14\x15\x16"]],
+      [")%Q at 9&AL<'1X?\n",           ["\x17\x18\x19\x1a\e\x1c\x1d\x1e\x1f"]],
+      ["/(2(C)\"4F)R at I*BLL+2XO\n",  ["!\"\#$%&'()*+,-./"]],
+      ["*,\#$R,S0U-C<X.0``\n",      ["0123456789"]],
+      ["'.CL\\/3X_0```\n",          [":;<=>?@"]],
+      [":04)#1$5&1TA)2DM,34Y/4%%24U155E=865H`\n", ["ABCDEFGHIJKLMNOPQRSTUVWXYZ"]],
+      ["&6UQ=7E]@\n",               ["[\\]^_`"]],
+      [":86)C9&5F9VAI:FML;6YO<'%R<W1U=G=X>7H`\n", ["abcdefghijklmnopqrstuvwxyz"]],
+      ["$>WQ]?@``\n",               ["{|}~"]],
+      [")?\\*`PH'\"@L*#\n",         ["\x7f\xc2\x80\xc2\x81\xc2\x82\xc2\x83"]],
+      [")PH3\"A<*&PH?\"\n",         ["\xc2\x84\xc2\x85\xc2\x86\xc2\x87\xc2"]],
+      [")B,*)PHK\"B\\*,\n",         ["\x88\xc2\x89\xc2\x8a\xc2\x8b\xc2\x8c"]],
+      [")PHW\"CL*/PI#\"\n",         ["\xc2\x8d\xc2\x8e\xc2\x8f\xc2\x90\xc2"]],
+      [")D<*2PI/\"E,*5\n",          ["\x91\xc2\x92\xc2\x93\xc2\x94\xc2\x95"]],
+      [")PI;\"E\\*8PIG\"\n",        ["\xc2\x96\xc2\x97\xc2\x98\xc2\x99\xc2"]],
+      [")FL*;PIS\"G<*>\n",          ["\x9a\xc2\x9b\xc2\x9c\xc2\x9d\xc2\x9e"]],
+      [")PI_\"H,*APJ+\"\n",         ["\xc2\x9f\xc2\xa0\xc2\xa1\xc2\xa2\xc2"]],
+      [")H\\*DPJ7\"IL*G\n",         ["\xa3\xc2\xa4\xc2\xa5\xc2\xa6\xc2\xa7"]],
+      [")PJC\"J<*JPJO\"\n",         ["\xc2\xa8\xc2\xa9\xc2\xaa\xc2\xab\xc2"]],
+      [")K,*MPJ[\"K\\*P\n",         ["\xac\xc2\xad\xc2\xae\xc2\xaf\xc2\xb0"]],
+      [")PK'\"LL*SPK3\"\n",         ["\xc2\xb1\xc2\xb2\xc2\xb3\xc2\xb4\xc2"]],
+      [")M<*VPK?\"N,*Y\n",          ["\xb5\xc2\xb6\xc2\xb7\xc2\xb8\xc2\xb9"]],
+      [")PKK\"N\\*\\PKW\"\n",       ["\xc2\xba\xc2\xbb\xc2\xbc\xc2\xbd\xc2"]],
+      [")OL*_PX#\#@<.\"\n",         ["\xbe\xc2\xbf\xc3\x80\xc3\x81\xc3\x82"]],
+      [")PX/#A,.%PX;#\n",           ["\xc3\x83\xc3\x84\xc3\x85\xc3\x86\xc3"]],
+      [")A\\.(PXG#BL.+\n",          ["\x87\xc3\x88\xc3\x89\xc3\x8a\xc3\x8b"]],
+      [")PXS#C<..PX_#\n",           ["\xc3\x8c\xc3\x8d\xc3\x8e\xc3\x8f\xc3"]],
+      [")D,.1PY+#D\\.4\n",          ["\x90\xc3\x91\xc3\x92\xc3\x93\xc3\x94"]],
+      [")PY7#EL.7PYC#\n",           ["\xc3\x95\xc3\x96\xc3\x97\xc3\x98\xc3"]],
+      [")F<.:PYO#G,.=\n",           ["\x99\xc3\x9a\xc3\x9b\xc3\x9c\xc3\x9d"]],
+      [")PY[#G\\. at PZ'#\n",          ["\xc3\x9e\xc3\x9f\xc3\xa0\xc3\xa1\xc3"]],
+      [")HL.CPZ3#I<.F\n",           ["\xa2\xc3\xa3\xc3\xa4\xc3\xa5\xc3\xa6"]],
+      [")PZ?#J,.IPZK#\n",           ["\xc3\xa7\xc3\xa8\xc3\xa9\xc3\xaa\xc3"]],
+      [")J\\.LPZW#KL.O\n",          ["\xab\xc3\xac\xc3\xad\xc3\xae\xc3\xaf"]],
+      [")P[##L<.RP[/#\n",           ["\xc3\xb0\xc3\xb1\xc3\xb2\xc3\xb3\xc3"]],
+      [")M,.UP[;#M\\.X\n",          ["\xb4\xc3\xb5\xc3\xb6\xc3\xb7\xc3\xb8"]],
+      [")P[G#NL.[P[S#\n",           ["\xc3\xb9\xc3\xba\xc3\xbb\xc3\xbc\xc3"]],
+      ["%O<.^P[\\`\n",              ["\xbd\xc3\xbe\xc3\xbf"]]
+    ].should be_computed_by(:unpack, "u")
+  end
+end

Added: MacRuby/trunk/spec/frozen/core/string/unpack/v_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/unpack/v_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/unpack/v_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,18 @@
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+require File.expand_path('../shared/basic', __FILE__)
+require File.expand_path('../shared/integer', __FILE__)
+
+describe "String#unpack with format 'V'" do
+  it_behaves_like :string_unpack_basic, 'V'
+  it_behaves_like :string_unpack_32bit_le, 'V'
+  it_behaves_like :string_unpack_32bit_le_unsigned, 'V'
+  it_behaves_like :string_unpack_no_platform, 'V'
+end
+
+describe "String#unpack with format 'v'" do
+  it_behaves_like :string_unpack_basic, 'v'
+  it_behaves_like :string_unpack_16bit_le, 'v'
+  it_behaves_like :string_unpack_16bit_le_unsigned, 'v'
+  it_behaves_like :string_unpack_no_platform, 'v'
+end

Added: MacRuby/trunk/spec/frozen/core/string/unpack/w_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/unpack/w_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/unpack/w_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,25 @@
+# -*- encoding: ascii-8bit -*-
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+require File.expand_path('../shared/basic', __FILE__)
+
+describe "String#unpack with directive 'w'" do
+  it_behaves_like :string_unpack_basic, 'w'
+  it_behaves_like :string_unpack_no_platform, 'w'
+
+  it "decodes a BER-compressed integer" do
+    [ ["\x00", [0]],
+      ["\x01", [1]],
+      ["\xce\x0f", [9999]],
+      ["\x84\x80\x80\x80\x80\x80\x80\x80\x80\x00", [2**65]]
+    ].should be_computed_by(:unpack, "w")
+  end
+
+  it "ignores NULL bytes between directives" do
+    "\x01\x02\x03".unpack("w\x00w").should == [1, 2]
+  end
+
+  it "ignores spaces between directives" do
+    "\x01\x02\x03".unpack("w w").should == [1, 2]
+  end
+end

Added: MacRuby/trunk/spec/frozen/core/string/unpack/x_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/unpack/x_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/unpack/x_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,62 @@
+# -*- encoding: ascii-8bit -*-
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+require File.expand_path('../shared/basic', __FILE__)
+
+describe "String#unpack with format 'X'" do
+  it_behaves_like :string_unpack_basic, 'X'
+  it_behaves_like :string_unpack_no_platform, 'X'
+
+  it "moves the read index back by the number of bytes specified by count" do
+    "\x01\x02\x03\x04".unpack("C3X2C").should == [1, 2, 3, 2]
+  end
+
+  it "does not change the read index when passed a count of zero" do
+    "\x01\x02\x03\x04".unpack("C3X0C").should == [1, 2, 3, 4]
+  end
+
+  it "implicitly has a count of one when count is not specified" do
+    "\x01\x02\x03\x04".unpack("C3XC").should == [1, 2, 3, 3]
+  end
+
+  it "moves the read index back by the remaining bytes when passed the '*' modifier" do
+    "abcd".unpack("C3X*C").should == [97, 98, 99, 99]
+  end
+
+  it "raises an ArgumentError when passed the '*' modifier if the remaining bytes exceed the bytes from the index to the start of the String" do
+    lambda { "abcd".unpack("CX*C") }.should raise_error(ArgumentError)
+  end
+
+  it "raises an ArgumentError if the count exceeds the bytes from current index to the start of the String" do
+    lambda { "\x01\x02\x03\x04".unpack("C3X4C") }.should raise_error(ArgumentError)
+  end
+end
+
+describe "String#unpack with format 'x'" do
+  it_behaves_like :string_unpack_basic, 'x'
+  it_behaves_like :string_unpack_no_platform, 'x'
+
+  it "moves the read index forward by the number of bytes specified by count" do
+    "\x01\x02\x03\x04".unpack("Cx2C").should == [1, 4]
+  end
+
+  it "implicitly has a count of one when count is not specified" do
+    "\x01\x02\x03\x04".unpack("CxC").should == [1, 3]
+  end
+
+  it "does not change the read index when passed a count of zero" do
+    "\x01\x02\x03\x04".unpack("Cx0C").should == [1, 2]
+  end
+
+  it "moves the read index to the end of the string when passed the '*' modifier" do
+    "\x01\x02\x03\x04".unpack("Cx*C").should == [1, nil]
+  end
+
+  it "positions the read index one beyond the last readable byte in the String" do
+    "\x01\x02\x03\x04".unpack("C2x2C").should == [1, 2, nil]
+  end
+
+  it "raises an ArgumentError if the count exceeds the size of the String" do
+    lambda { "\x01\x02\x03\x04".unpack("C2x3C") }.should raise_error(ArgumentError)
+  end
+end

Added: MacRuby/trunk/spec/frozen/core/string/unpack/z_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/unpack/z_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/string/unpack/z_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,21 @@
+# -*- encoding: ascii-8bit -*-
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+require File.expand_path('../shared/basic', __FILE__)
+require File.expand_path('../shared/string', __FILE__)
+
+describe "String#unpack with format 'Z'" do
+  it_behaves_like :string_unpack_basic, 'Z'
+  it_behaves_like :string_unpack_no_platform, 'Z'
+  it_behaves_like :string_unpack_string, 'Z'
+
+  it "stops decoding at NULL bytes when passed the '*' modifier" do
+    "a\x00\x00 b \x00c".unpack('Z*Z*Z*Z*').should == ["a", "", " b ", "c"]
+  end
+
+  it "decodes the number of bytes specified by the count modifier and truncates the decoded string at the first NULL byte" do
+    [ ["a\x00 \x00b c",      ["a", " "]],
+      ["\x00a\x00 bc \x00",  ["", "c"]]
+    ].should be_computed_by(:unpack, "Z5Z")
+  end
+end

Modified: MacRuby/trunk/spec/frozen/core/string/unpack_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/unpack_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/string/unpack_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -61,7 +61,6 @@
     "\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]
@@ -77,7 +76,6 @@
     "\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]
@@ -93,7 +91,6 @@
     "\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]
@@ -114,7 +111,6 @@
       "\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]
@@ -123,13 +119,7 @@
       "\x7F\x77\x77\x77\x77\x77\x77\x77".unpack('q0Q*').should == [8608480567731124095]
     end
 
-    ruby_version_is "" ... "1.8.8" do
-      it "does NOT pad nil when the string is short" do
-        "\xF3\xFF\xFF\xFF\x32\x0B\x02\x00".unpack('Q2').should == [575263624658931]
-      end
-    end
-
-    ruby_version_is "1.8.8" do
+    ruby_bug "#", "1.8.7" do
       it "pads nil when the string is short" do
         "\xF3\xFF\xFF\xFF\x32\x0B\x02\x00".unpack('Q2').should == [575263624658931, nil]
       end
@@ -193,9 +183,7 @@
   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 == []
@@ -253,8 +241,6 @@
       # explicitly, so we generate it by summing the maximum Float value and
       # inverting the result...
       "\xFF\x80\x00\x00".unpack('g')[0].should == -(Float::MAX + Float::MAX)
-      "\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]
 
@@ -301,8 +287,6 @@
       ["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", ""]
@@ -317,8 +301,6 @@
       ["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", ""]
@@ -335,7 +317,6 @@
         "\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]
@@ -439,7 +420,6 @@
     "\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 == []
@@ -466,8 +446,6 @@
     "".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
@@ -476,10 +454,7 @@
 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
@@ -496,7 +471,6 @@
     "\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", "", ""]
@@ -528,7 +502,6 @@
     "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               == [""]

Modified: MacRuby/trunk/spec/frozen/core/struct/new_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/struct/new_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/struct/new_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -8,12 +8,6 @@
     struct.name.should == "Struct::Animal"
   end
 
-  it "creates a constant in Struct namespace by assigning to constant" do
-    Animal = Struct.new(:name, :legs, :eyeballs)
-    Animal.should == Animal
-    Animal.name.should == "Animal"
-  end
-
   it "overwrites previously defined constants with string as first argument" do
     first = Struct.new('Person', :height, :weight)
     first.should == Struct::Person

Modified: MacRuby/trunk/spec/frozen/core/struct/shared/equal_value.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/struct/shared/equal_value.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/struct/shared/equal_value.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -17,7 +17,7 @@
   end
 
   ruby_bug "redmine #1885", "1.8" do
-    it "handles recursive structures by returning false if a difference can be found" do
+    it "handles recursive structures by returning false if a difference can be found " do
       MyClass = Struct.new(:foo)
       x = StructClasses::Car.new("Honda", "Accord", "1998")
       x[:make] = x

Modified: MacRuby/trunk/spec/frozen/core/thread/fixtures/classes.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/fixtures/classes.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/thread/fixtures/classes.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -6,6 +6,13 @@
 end
 
 module ThreadSpecs
+
+  class SubThread < Thread
+    def initialize(*args)
+      super { args.first << 1 }
+    end
+  end
+
   class Status
     attr_reader :thread, :inspect, :status
     def initialize(thread)
@@ -98,7 +105,7 @@
       t.kill
       Status.new t
     ensure
-      Thread.critical = false if Thread.respond_to? :critical     
+      Thread.critical = false if Thread.respond_to? :critical
     end
   end
   
@@ -143,7 +150,6 @@
         yield
       end
     end
-    t
   end
   
   def self.dying_thread_with_outer_ensure(kill_method_name=:kill)

Deleted: MacRuby/trunk/spec/frozen/core/thread/key_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/key_spec_disabled.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/thread/key_spec_disabled.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,23 +0,0 @@
-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

Modified: MacRuby/trunk/spec/frozen/core/thread/new_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/new_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/thread/new_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -16,4 +16,16 @@
     t.join
     arr.should == [a,b,c]
   end
+
+  it "raises an exception when not given a block" do
+    lambda { Thread.new }.should raise_error(ThreadError)
+  end
+
+  it "creates a subclass of thread calls super with a block in initialize" do
+    arr = []
+    t = ThreadSpecs::SubThread.new(arr)
+    t.join
+    arr.should == [1]
+  end
+
 end

Modified: MacRuby/trunk/spec/frozen/core/thread/raise_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/raise_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/thread/raise_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -110,27 +110,25 @@
     lambda {t.value}.should raise_error(RuntimeError)
   end
 
-  ruby_version_is "" ... "1.9" do
-    it "raise the given argument even when there is an active exception" do
-      raised = false
-      t = Thread.new do
-        begin
-          1/0
-        rescue ZeroDivisionError
-          raised = true
-          loop { }
-        end
-      end
+  it "raise the given argument even when there is an active exception" do
+    raised = false
+    t = Thread.new do
       begin
-        raise "Create an active exception for the current thread too"
-      rescue
-        Thread.pass until raised || !t.alive?
-        t.raise RangeError
-        lambda {t.value}.should raise_error(RangeError)
+        1/0
+      rescue ZeroDivisionError
+        raised = true
+        loop { }
       end
     end
-
+    begin
+      raise "Create an active exception for the current thread too"
+    rescue
+      Thread.pass until raised || !t.alive?
+      t.raise RangeError
+      lambda {t.value}.should raise_error(RangeError)
+    end
   end
+
 end
 
 describe "Thread#raise on same thread" do

Deleted: MacRuby/trunk/spec/frozen/core/thread/raise_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/raise_spec_disabled.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/thread/raise_spec_disabled.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,127 +0,0 @@
-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.status and @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 and 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.status and @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

Modified: MacRuby/trunk/spec/frozen/core/thread/shared/exit.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/shared/exit.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/thread/shared/exit.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -83,23 +83,26 @@
       t.join
       ScratchPad.recorded.should == :after_stop
     end
-  
-    it "killing dying running does nothing" do
-      in_ensure_clause = false
-      exit_loop = false
-      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
+
+  # This spec is a mess. It fails randomly, it hangs on MRI, it needs to be removed
+  quarantine! do
+  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
+  end
 
   quarantine! do
 

Modified: MacRuby/trunk/spec/frozen/core/time/at_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/at_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/time/at_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -3,19 +3,13 @@
 
 describe "Time.at" do
   platform_is_not :windows do
-    ruby_version_is ""..."1.9" do
-      it "converts to time object" do
+    it "converts to time object" do
+      with_timezone "GMT" do
         # the #chomp calls are necessary because of RSpec
-        Time.at(1184027924).inspect.chomp.should == localtime_18(1184027924).chomp
+        t = Time.at(1184027924)
+        t.inspect.chomp.should == "Tue Jul 10 00:38:44 +0000 2007"
       end
     end
-
-    ruby_version_is "1.9" do
-      it "converts to time object" do
-        # the #chomp calls are necessary because of RSpec
-        Time.at(1184027924).inspect.chomp.should == localtime_19(1184027924).chomp
-      end
-    end
   end
 
   it "creates a new time object with the value given by time" do

Added: MacRuby/trunk/spec/frozen/core/time/fixtures/classes.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/fixtures/classes.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/core/time/fixtures/classes.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,5 @@
+module TimeSpecs
+
+  class SubTime < Time; end
+
+end

Modified: MacRuby/trunk/spec/frozen/core/time/fixtures/methods.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/fixtures/methods.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/time/fixtures/methods.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,7 +1,7 @@
 def with_timezone(name, offset = nil, daylight_saving_zone = "")
   zone = name.dup
 
-  if (offset)
+  if offset
     # TZ convention is backwards
     offset = -offset
 
@@ -19,31 +19,3 @@
     ENV["TZ"] = old
   end
 end
-
-# Returns the given time in the same format as returned by
-# Time.at(seconds).inspect on MRI 1.8
-def localtime_18(seconds)
-  platform_is :os => [:darwin, :bsd] do
-    return `LC_ALL=C /bin/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
-
-# Returns the given time in the same format as returned by
-# Time.at(seconds).inspect on MRI 1.9
-def localtime_19(seconds)
-  platform_is :os => [:darwin, :bsd] do
-    return `LC_ALL=C /bin/date -r #{seconds} +'%F %H:%M:%S %z'`.chomp
-  end
-
-  platform_is :os => :linux do
-    return `LC_ALL=C date -d @#{seconds} +'%F %H:%M:%S %z'`.chomp
-  end
-
-  return `LC_ALL=C date -j -f "%s" #{seconds} "+%F %H:%M:%S %z"`.chomp
-end

Modified: MacRuby/trunk/spec/frozen/core/time/plus_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/plus_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/time/plus_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -39,9 +39,11 @@
     it "does NOT round" do
       t = Time.at(0) + Rational(8_999_999_999_999_999, 1_000_000_000_000_000)
       t.should_not == Time.at(9)
-      t.usec.should == 999_999
-      t.nsec.should == 999_999_999
-      t.subsec.should == Rational(999_999_999_999_999, 1_000_000_000_000_000)
+      not_compliant_on :jruby do # only microseconds are supported
+        t.usec.should == 999_999
+        t.nsec.should == 999_999_999
+        t.subsec.should == Rational(999_999_999_999_999, 1_000_000_000_000_000)
+      end
     end
 
     it "adds a negative Float" do

Modified: MacRuby/trunk/spec/frozen/core/time/shared/now.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/shared/now.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/time/shared/now.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,3 +1,5 @@
+require File.expand_path('../../fixtures/classes', __FILE__)
+
 describe :time_now, :shared => true do
   platform_is_not :windows do
     it "creates a time based on the current system time" do
@@ -6,4 +8,8 @@
       end
     end
   end
+
+  it "creates a subclass instance if called on a subclass" do
+    TimeSpecs::SubTime.now.should be_kind_of(TimeSpecs::SubTime)
+  end
 end

Modified: MacRuby/trunk/spec/frozen/core/time/usec_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/usec_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/core/time/usec_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -7,4 +7,10 @@
     (Time.at(1.1) + 0.9).usec.should == 0
     (Time.at(1.1) - 0.2).usec.should == 900000
   end
+  
+  ruby_version_is "1.9" do
+    it "returns the microseconds for time created by Time#local" do
+      Time.local(1,2,3,4,5,Rational(6.78)).usec.should == 780000
+    end
+  end
 end

Modified: MacRuby/trunk/spec/frozen/fixtures/class.rb
===================================================================
--- MacRuby/trunk/spec/frozen/fixtures/class.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/fixtures/class.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,11 +1,25 @@
 module ClassSpecs
+
+  def self.sclass_with_block
+    class << self
+      yield
+    end
+  end
+
+  def self.sclass_with_return
+    class << self
+      return :inner
+    end
+    return :outer
+  end
+
   class A; end
-  
+
   class B
     @@cvar = :cvar
     @ivar = :ivar
   end
-  
+
   class C
     def self.make_class_variable
       @@cvar = :cvar
@@ -15,24 +29,24 @@
       @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
@@ -40,12 +54,12 @@
   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
@@ -57,21 +71,21 @@
       :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 
+    class J < self
     end
   end
 

Deleted: MacRuby/trunk/spec/frozen/fixtures/load/@a
===================================================================
Modified: MacRuby/trunk/spec/frozen/language/BEGIN_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/language/BEGIN_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/language/BEGIN_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,7 +1,7 @@
 require File.expand_path('../../spec_helper', __FILE__)
 
 describe "The BEGIN keyword" do
-  ruby_version_is "" ... "1.9" do
+  ruby_version_is "" .. "1.9" do
     it "runs in a new isolated scope" do
       lambda {
         eval "BEGIN { var_in_begin = 'foo' }; var_in_begin"

Modified: MacRuby/trunk/spec/frozen/language/alias_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/language/alias_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/language/alias_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -143,4 +143,18 @@
     code
     Sub.new.test("testing").should == 4
   end
+  
+  it "is not allowed against Fixnum or String instances" do
+    lambda do
+      1.instance_eval do
+        alias :foo :to_s
+      end
+    end.should raise_error(TypeError)
+    
+    lambda do
+      :blah.instance_eval do
+        alias :foo :to_s
+      end
+    end.should raise_error(TypeError)
+  end
 end

Modified: MacRuby/trunk/spec/frozen/language/block_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/language/block_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/language/block_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -7,13 +7,13 @@
     BlockSpecs::Yield.new.two_args {|one, two, three| ret = [one, two, three]}
     ret.should == [1, 2, nil]
   end
-  
+
   it "raises ArgumentError if argument is passed, but the block takes none" do
     lambda{
       lambda{ || p "block with no argument" }.call(:arg)
     }.should raise_error(ArgumentError)
   end
-  
+
 end
 
 describe "A block with a 'rest' arg" do
@@ -51,4 +51,70 @@
   end
 end
 
+describe "A block with multiple arguments" do
+  it "unpacks an array if the only argument" do
+    BlockSpecs::Yield.new.two_arg_array do |a,b|
+      a.should == 1
+      b.should == 2
+    end
+  end
+
+  it "tries to use #to_ary to convert a single incoming value" do
+    m = mock("to_ary")
+    m.should_receive(:to_ary).and_return([:one, :two])
+
+    BlockSpecs::Yield.new.yield_this(m) do |a,b|
+      a.should == :one
+      b.should == :two
+    end
+  end
+
+  it "raises a TypeError if the #to_ary value isn't an Array" do
+    m = mock("to_ary")
+    m.should_receive(:to_ary).and_return(1)
+
+    lambda {
+      BlockSpecs::Yield.new.yield_this(m) { |a,b| }
+    }.should raise_error(TypeError)
+  end
+end
+
+describe "Block parameters" do
+  ruby_version_is "" ... "1.9" 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
+
+  ruby_version_is "1.9" do
+    it "does not override a shadowed variable from the outer scope" do
+      i = 0
+      a = [1,2,3]
+      a.each {|i| ;}
+      i.should == 0
+    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 == nil
+    end
+  end
+end
+
 language_version __FILE__, "block"

Modified: MacRuby/trunk/spec/frozen/language/break_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/language/break_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/language/break_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -335,55 +335,27 @@
     end
   end
 
-  ruby_version_is "" ... "1.9" do
-    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
-  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; 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
 
-  ruby_version_is "1.9" do
-    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 == 0
-      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
+    at = 0; 0.upto(5) {|i| at = i; break i if i == 2 }.should == 2
+    at = 0; 0.upto(5) {|i| at = i; break if i == 3 }; at.should == 3
   end
 
-  ruby_version_is "" ... "1.9" do
-    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
+  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
+    at = 0
+    break_test {|i| at = i; break i if i == 1 }
+    at.should == 1
   end
-  
-  ruby_version_is "1.9" do
-    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 == 0
-    end
-  end
 end
 
 language_version __FILE__, "break"

Modified: MacRuby/trunk/spec/frozen/language/class_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/language/class_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/language/class_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -12,7 +12,7 @@
     ClassSpecs::A.should be_kind_of(Class)
     ClassSpecs::A.new.should be_kind_of(ClassSpecs::A)
   end
-  
+
   it "has no class variables" do
     ClassSpecs::A.class_variables.should == []
   end
@@ -45,15 +45,21 @@
       end
     }.should raise_error(TypeError)
   end
-  
+
   it "allows using self as the superclass if self is a class" do
     ClassSpecs::I::J.superclass.should == ClassSpecs::I
-    
+
     lambda {
       class ShouldNotWork < self; end
     }.should raise_error(TypeError)
   end
-  
+
+  it "raises a TypeError if inheriting from a metaclass" do
+    obj = mock("metaclass super")
+    meta = obj.metaclass
+    lambda { class ClassSpecs::MetaclassSuper < meta; 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 == []
@@ -64,7 +70,7 @@
       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
@@ -81,7 +87,7 @@
       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
@@ -94,7 +100,7 @@
       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
@@ -111,7 +117,7 @@
       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
@@ -122,21 +128,21 @@
   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
@@ -159,11 +165,11 @@
   end
 end
 
-describe "A Class Definitions extending an object" do
+describe "A class definition extending an object (sclass)" 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
@@ -175,6 +181,14 @@
       CODE
     }.should raise_error(TypeError)
   end
+
+  it "allows accessing the block of the original scope" do
+    ClassSpecs.sclass_with_block { 123 }.should == 123
+  end
+
+  it "can use return to cause the enclosing method to return" do
+    ClassSpecs.sclass_with_return.should == :inner
+  end
 end
 
 describe "Reopening a class" do
@@ -183,11 +197,11 @@
     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
@@ -200,7 +214,7 @@
       end
     end
     ClassSpecs::M.m.should == 1
-  end  
+  end
 end
 
 describe "class provides hooks" do

Modified: MacRuby/trunk/spec/frozen/language/constants_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/language/constants_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/language/constants_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -114,7 +114,7 @@
         ConstantSpecs::ContainerB::ChildB::CS_CONST108
       end.should raise_error(NameError)
 
-      module ::ConstantSpecs
+      module ConstantSpecs
         class << self
           CS_CONST108 = :const108_2
         end

Modified: MacRuby/trunk/spec/frozen/language/def_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/language/def_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/language/def_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -24,7 +24,7 @@
 describe "Defining an 'initialize_copy' method" do
   it "should make it private" do
     class DefInitializeCopySpec
-      def initialize_copy(obj)
+      def initialize_copy
       end
     end
     DefInitializeCopySpec.should have_private_instance_method(:initialize_copy, false)
@@ -453,11 +453,10 @@
   end
 end
 
-describe "A method definition that sets more than one default parameter all to the same value" do
+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
@@ -491,4 +490,20 @@
   end
 end
 
+describe "The def keyword" do
+  describe "within a closure" do
+    it "looks outside the closure for the visibility" do
+      module DefSpecsLambdaVisibility
+        private
+
+        lambda {
+          def some_method; end
+        }.call
+      end
+
+      DefSpecsLambdaVisibility.should have_private_instance_method("some_method")
+    end
+  end
+end
+
 language_version __FILE__, "def"

Modified: MacRuby/trunk/spec/frozen/language/defined_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/language/defined_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/language/defined_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1228,6 +1228,10 @@
     it "returns 'super' from a block in a #define_method when a superclass method exists" do
       DefinedSpecs::Super.new.define_method_block_no_args.should == "super"
     end
+  
+    it "returns 'super' when the method exists in a supermodule" do
+      DefinedSpecs::SuperWithIntermediateModules.new.method_no_args.should == "super"
+    end
   end
 
   describe "for a method taking arguments" do

Modified: MacRuby/trunk/spec/frozen/language/fixtures/block.rb
===================================================================
--- MacRuby/trunk/spec/frozen/language/fixtures/block.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/language/fixtures/block.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -3,11 +3,11 @@
     def splat(*args)
       yield *args
     end
-    
+
     def two_args
       yield 1, 2
     end
-    
+
     def two_arg_array
       yield [1, 2]
     end
@@ -15,18 +15,9 @@
     def yield_splat_inside_block
       [1, 2].send(:each_with_index) {|*args| yield(*args)}
     end
+
+    def yield_this(obj)
+      yield obj
+    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
-# 

Modified: MacRuby/trunk/spec/frozen/language/fixtures/classes.rb
===================================================================
--- MacRuby/trunk/spec/frozen/language/fixtures/classes.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/language/fixtures/classes.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -3,7 +3,7 @@
     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()
@@ -16,7 +16,7 @@
   class ClassWithout_to_s
     undef :to_s
   end
-  
+
   #############################################################################
   # Regexp support
   #############################################################################
@@ -24,15 +24,15 @@
   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.
@@ -40,15 +40,15 @@
     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

Modified: MacRuby/trunk/spec/frozen/language/fixtures/defined.rb
===================================================================
--- MacRuby/trunk/spec/frozen/language/fixtures/defined.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/language/fixtures/defined.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -237,6 +237,26 @@
       defined?(super)
     end
   end
+  
+  module IntermediateModule1
+    def method_no_args
+    end
+  end
+  
+  module IntermediateModule2
+    def method_no_args
+      defined?(super)
+    end
+  end
+  
+  class SuperWithIntermediateModules
+    include IntermediateModule1
+    include IntermediateModule2
+    
+    def method_no_args
+      super
+    end
+  end
 end
 
 class Object

Modified: MacRuby/trunk/spec/frozen/language/fixtures/return.rb
===================================================================
--- MacRuby/trunk/spec/frozen/language/fixtures/return.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/language/fixtures/return.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -46,6 +46,36 @@
     end
   end
 
+  class SavedInnerBlock
+    def add(&b)
+      @block = b
+    end
+
+    def outer
+      yield
+      @block.call
+    end
+
+    def inner
+      yield
+    end
+
+    def start
+      outer do
+        inner do
+          add do
+            ScratchPad.record :before_return
+            return :return_value
+          end
+        end
+      end
+
+      ScratchPad.record :bottom_of_start
+
+      return false
+    end
+  end
+
   class ThroughDefineMethod
     lamb = proc { |x| x.call }
     define_method :foo, lamb

Added: MacRuby/trunk/spec/frozen/language/fixtures/rubyopt.rb
===================================================================
--- MacRuby/trunk/spec/frozen/language/fixtures/rubyopt.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/language/fixtures/rubyopt.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1 @@
+puts "rubyopt.rb required"

Modified: MacRuby/trunk/spec/frozen/language/if_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/language/if_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/language/if_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -217,26 +217,26 @@
     before :each do
       ScratchPad.record []
     end
-  
+
     after :each do
       ScratchPad.clear
     end
-  
+
     it "mimics an awk conditional with a single-element inclusive-end range" do
       10.times { |i| ScratchPad << i if (i == 4)..(i == 4) }
       ScratchPad.recorded.should == [4]
     end
-  
+
     it "mimics an awk conditional with a many-element inclusive-end range" do
       10.times { |i| ScratchPad << i if (i == 4)..(i == 7) }
       ScratchPad.recorded.should == [4, 5, 6, 7]
     end
-  
+
     it "mimics a sed conditional with a zero-element exclusive-end range" do
       10.times { |i| ScratchPad << i if (i == 4)...(i == 4) }
       ScratchPad.recorded.should == [4, 5, 6, 7, 8, 9]
     end
-  
+
     it "mimics a sed conditional with a many-element exclusive-end range" do
       10.times { |i| ScratchPad << i if (i == 4)...(i == 5) }
       ScratchPad.recorded.should == [4, 5]

Modified: MacRuby/trunk/spec/frozen/language/module_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/language/module_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/language/module_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -34,6 +34,17 @@
       module LangModuleSpec::C2; end
     }.should raise_error(TypeError)
   end
+
+  it "allows for reopening a module subclass" do
+    class ModuleSubClass < Module; end
+    LangModuleSpec::C3 = ModuleSubClass.new
+
+    module LangModuleSpec::C3
+      C4 = 4
+    end
+
+    LangModuleSpec::C3::C4.should == 4
+  end
 end
 
 describe "An anonymous module" do

Modified: MacRuby/trunk/spec/frozen/language/not_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/language/not_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/language/not_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -26,12 +26,8 @@
   end
 
   it "returns true if the argument is nil" do
-    (not(nil)).should be_true
+    (not(false)).should be_true
   end
-
-  it "returns true if no argument is provided" do
-    (not()).should be_true
-  end
 end
 
 language_version __FILE__, "not"

Modified: MacRuby/trunk/spec/frozen/language/predefined_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/language/predefined_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/language/predefined_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -589,4 +589,221 @@
   it "includes TOPLEVEL_BINDING" do
     Object.const_defined?(:TOPLEVEL_BINDING).should == true
   end
+
 end
+
+describe "Processing RUBYOPT" do
+  before (:each) do
+    @rubyopt, ENV["RUBYOPT"] = ENV["RUBYOPT"], nil
+  end
+
+  after (:each) do
+    ENV["RUBYOPT"] = @rubyopt
+  end
+
+  it "adds the -I path to $LOAD_PATH" do
+    ENV["RUBYOPT"] = "-Ioptrubyspecincl"
+    result = ruby_exe("puts $LOAD_PATH.grep(/byspecin/)", :escape => true)
+    result.chomp[-15..-1].should == "optrubyspecincl"
+  end
+
+  it "sets $DEBUG to true for '-d'" do
+    ENV["RUBYOPT"] = '-d'
+    ruby_exe("puts $DEBUG", :escape => true).chomp.should == "true"
+  end
+
+  ruby_version_is "1.9" do
+    it "prints the version number for '-v'" do
+      ENV["RUBYOPT"] = '-v'
+      ruby_exe("").chomp.should == RUBY_DESCRIPTION
+    end
+  end
+
+  it "sets $VERBOSE to true for '-w'" do
+    ENV["RUBYOPT"] = '-w'
+    ruby_exe("p $VERBOSE", :escape => true).chomp.should == "true"
+  end
+
+  it "sets $VERBOSE to true for '-W'" do
+    ENV["RUBYOPT"] = '-W'
+    ruby_exe("p $VERBOSE", :escape => true).chomp.should == "true"
+  end
+
+  it "sets $VERBOSE to nil for '-W0'" do
+    ENV["RUBYOPT"] = '-W0'
+    ruby_exe("p $VERBOSE", :escape => true).chomp.should == "nil"
+  end
+
+  it "sets $VERBOSE to false for '-W1'" do
+    ENV["RUBYOPT"] = '-W1'
+    ruby_exe("p $VERBOSE", :escape => true).chomp.should == "false"
+  end
+
+  it "sets $VERBOSE to true for '-W2'" do
+    ENV["RUBYOPT"] = '-W2'
+    ruby_exe("p $VERBOSE", :escape => true).chomp.should == "true"
+  end
+
+  it "requires the file for '-r'" do
+    f = fixture __FILE__, "rubyopt"
+    ENV["RUBYOPT"] = "-r#{f}"
+    ruby_exe("").should =~ /^rubyopt.rb required/
+  end
+
+  ruby_version_is ""..."1.9" do
+    it "sets $KCODE to 'NONE' with '-K'" do
+      ENV["RUBYOPT"] = '-K'
+      ruby_exe("puts $KCODE", :escape => true).chomp.should == "NONE"
+    end
+
+    it "sets $KCODE to 'NONE' with '-Ka'" do
+      ENV["RUBYOPT"] = '-Ka'
+      ruby_exe("puts $KCODE", :escape => true).chomp.should == "NONE"
+    end
+
+    it "sets $KCODE to 'NONE' with '-KA'" do
+      ENV["RUBYOPT"] = '-KA'
+      ruby_exe("puts $KCODE", :escape => true).chomp.should == "NONE"
+    end
+
+    it "sets $KCODE to 'NONE' with '-Kn'" do
+      ENV["RUBYOPT"] = '-Kn'
+      ruby_exe("puts $KCODE", :escape => true).chomp.should == "NONE"
+    end
+
+    it "sets $KCODE to 'NONE' with '-KN'" do
+      ENV["RUBYOPT"] = '-KN'
+      ruby_exe("puts $KCODE", :escape => true).chomp.should == "NONE"
+    end
+
+    it "sets $KCODE to 'EUC' with '-Ke'" do
+      ENV["RUBYOPT"] = '-Ke'
+      ruby_exe("puts $KCODE", :escape => true).chomp.should == "EUC"
+    end
+
+    it "sets $KCODE to 'EUC' with '-KE'" do
+      ENV["RUBYOPT"] = '-KE'
+      ruby_exe("puts $KCODE", :escape => true).chomp.should == "EUC"
+    end
+
+    it "sets $KCODE to 'UTF8' with '-Ku'" do
+      ENV["RUBYOPT"] = '-Ku'
+      ruby_exe("puts $KCODE", :escape => true).chomp.should == "UTF8"
+    end
+
+    it "sets $KCODE to 'UTF8' with '-KU'" do
+      ENV["RUBYOPT"] = '-KU'
+      ruby_exe("puts $KCODE", :escape => true).chomp.should == "UTF8"
+    end
+
+    it "sets $KCODE to 'SJIS' with '-Ks'" do
+      ENV["RUBYOPT"] = '-Ks'
+      ruby_exe("puts $KCODE", :escape => true).chomp.should == "SJIS"
+    end
+
+    it "sets $KCODE to 'SJIS' with '-KS'" do
+      ENV["RUBYOPT"] = '-KS'
+      ruby_exe("puts $KCODE", :escape => true).chomp.should == "SJIS"
+    end
+  end
+
+  it "raises a RuntimeError for '-a'" do
+    ENV["RUBYOPT"] = '-a'
+    ruby_exe("", :args => '2>&1').should =~ /RuntimeError/
+  end
+
+  it "raises a RuntimeErrorError for '-p'" do
+    ENV["RUBYOPT"] = '-p'
+    ruby_exe("", :args => '2>&1').should =~ /RuntimeError/
+  end
+
+  it "raises a RuntimeErrorError for '-n'" do
+    ENV["RUBYOPT"] = '-n'
+    ruby_exe("", :args => '2>&1').should =~ /RuntimeError/
+  end
+
+  it "raises a RuntimeErrorError for '-y'" do
+    ENV["RUBYOPT"] = '-y'
+    ruby_exe("", :args => '2>&1').should =~ /RuntimeError/
+  end
+
+  it "raises a RuntimeErrorError for '-c'" do
+    ENV["RUBYOPT"] = '-c'
+    ruby_exe("", :args => '2>&1').should =~ /RuntimeError/
+  end
+
+  it "raises a RuntimeErrorError for '-s'" do
+    ENV["RUBYOPT"] = '-s'
+    ruby_exe("", :args => '2>&1').should =~ /RuntimeError/
+  end
+
+  it "raises a RuntimeErrorError for '-h'" do
+    ENV["RUBYOPT"] = '-h'
+    ruby_exe("", :args => '2>&1').should =~ /RuntimeError/
+  end
+
+  it "raises a RuntimeErrorError for '--help'" do
+    ENV["RUBYOPT"] = '--help'
+    ruby_exe("", :args => '2>&1').should =~ /RuntimeError/
+  end
+
+  it "raises a RuntimeErrorError for '-l'" do
+    ENV["RUBYOPT"] = '-l'
+    ruby_exe("", :args => '2>&1').should =~ /RuntimeError/
+  end
+
+  it "raises a RuntimeErrorError for '-S'" do
+    ENV["RUBYOPT"] = '-S irb'
+    ruby_exe("", :args => '2>&1').should =~ /RuntimeError/
+  end
+
+  it "raises a RuntimeErrorError for '-e'" do
+    ENV["RUBYOPT"] = '-e0'
+    ruby_exe("", :args => '2>&1').should =~ /RuntimeError/
+  end
+
+  it "raises a RuntimeErrorError for '-i'" do
+    ENV["RUBYOPT"] = '-i.bak'
+    ruby_exe("", :args => '2>&1').should =~ /RuntimeError/
+  end
+
+  it "raises a RuntimeErrorError for '-x'" do
+    ENV["RUBYOPT"] = '-x'
+    ruby_exe("", :args => '2>&1').should =~ /RuntimeError/
+  end
+
+  it "raises a RuntimeErrorError for '-C'" do
+    ENV["RUBYOPT"] = '-C'
+    ruby_exe("", :args => '2>&1').should =~ /RuntimeError/
+  end
+
+  it "raises a RuntimeErrorError for '-X'" do
+    ENV["RUBYOPT"] = '-X.'
+    ruby_exe("", :args => '2>&1').should =~ /RuntimeError/
+  end
+
+  it "raises a RuntimeErrorError for '-F'" do
+    ENV["RUBYOPT"] = '-F'
+    ruby_exe("", :args => '2>&1').should =~ /RuntimeError/
+  end
+
+  it "raises a RuntimeErrorError for '-0'" do
+    ENV["RUBYOPT"] = '-0'
+    ruby_exe("", :args => '2>&1').should =~ /RuntimeError/
+  end
+
+  it "raises a RuntimeErrorError for '--copyright'" do
+    ENV["RUBYOPT"] = '--copyright'
+    ruby_exe("", :args => '2>&1').should =~ /RuntimeError/
+  end
+
+  it "raises a RuntimeErrorError for '--version'" do
+    ENV["RUBYOPT"] = '--version'
+    ruby_exe("", :args => '2>&1').should =~ /RuntimeError/
+  end
+
+  it "raises a RuntimeErrorError for '--yydebug'" do
+    ENV["RUBYOPT"] = '--yydebug'
+    ruby_exe("", :args => '2>&1').should =~ /RuntimeError/
+  end
+end

Modified: MacRuby/trunk/spec/frozen/language/regexp/encoding_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/language/regexp/encoding_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/language/regexp/encoding_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -7,60 +7,62 @@
   # core/regexp/encoding_spec.rb for 1.9
 
   ruby_version_is ""..."1.9" do
-    it 'supports /e (EUC encoding)' do
-      match = /./e.match("\303\251")
-      match.to_a.should == ["\303\251"]
-    end
-    
-    it 'supports /e (EUC encoding) with interpolation' do
-      match = /#{/./}/e.match("\303\251")
-      match.to_a.should == ["\303\251"]
-    end
-    
-    it 'supports /e (EUC encoding) with interpolation and /o' do
-      match = /#{/./}/e.match("\303\251")
-      match.to_a.should == ["\303\251"]
-    end
-    
-    it 'supports /n (Normal encoding)' do
-      /./n.match("\303\251").to_a.should == ["\303"]
-    end
-    
-    it 'supports /n (Normal encoding) with interpolation' do
-      /#{/./}/n.match("\303\251").to_a.should == ["\303"]
-    end
-    
-    it 'supports /n (Normal encoding) with interpolation and /o' do
-      /#{/./}/no.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 /s (SJIS encoding) with interpolation' do
-      /#{/./}/s.match("\303\251").to_a.should == ["\303"]
-    end
-    
-    it 'supports /s (SJIS encoding) with interpolation and /o' do
-      /#{/./}/so.match("\303\251").to_a.should == ["\303"]
-    end
-    
-    it 'supports /u (UTF8 encoding)' do
-      /./u.match("\303\251").to_a.should == ["\303\251"]
-    end
+    not_compliant_on :macruby do
+      it 'supports /e (EUC encoding)' do
+        match = /./e.match("\303\251")
+        match.to_a.should == ["\303\251"]
+      end
+      
+      it 'supports /e (EUC encoding) with interpolation' do
+        match = /#{/./}/e.match("\303\251")
+        match.to_a.should == ["\303\251"]
+      end
+      
+      it 'supports /e (EUC encoding) with interpolation and /o' do
+        match = /#{/./}/e.match("\303\251")
+        match.to_a.should == ["\303\251"]
+      end
+      
+      it 'supports /n (Normal encoding)' do
+        /./n.match("\303\251").to_a.should == ["\303"]
+      end
+      
+      it 'supports /n (Normal encoding) with interpolation' do
+        /#{/./}/n.match("\303\251").to_a.should == ["\303"]
+      end
+      
+      it 'supports /n (Normal encoding) with interpolation and /o' do
+        /#{/./}/no.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 /s (SJIS encoding) with interpolation' do
+        /#{/./}/s.match("\303\251").to_a.should == ["\303"]
+      end
+      
+      it 'supports /s (SJIS encoding) with interpolation and /o' do
+        /#{/./}/so.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 'supports /u (UTF8 encoding) with interpolation' do
-      /#{/./}/u.match("\303\251").to_a.should == ["\303\251"]
-    end
+      it 'supports /u (UTF8 encoding) with interpolation' do
+        /#{/./}/u.match("\303\251").to_a.should == ["\303\251"]
+      end
 
-    it 'supports /u (UTF8 encoding) with interpolation and /o' do
-      /#{/./}/uo.match("\303\251").to_a.should == ["\303\251"]
+      it 'supports /u (UTF8 encoding) with interpolation and /o' do
+        /#{/./}/uo.match("\303\251").to_a.should == ["\303\251"]
+      end
+      
+      it 'selects last of multiple encoding specifiers' do
+        /foo/ensuensuens.should == /foo/s
+      end
     end
-    
-    it 'selects last of multiple encoding specifiers' do
-      /foo/ensuensuens.should == /foo/s
-    end
   end
 
   ruby_version_is "1.9" do

Modified: MacRuby/trunk/spec/frozen/language/return_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/language/return_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/language/return_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -253,6 +253,11 @@
       ScratchPad.recorded.should == :before_return
     end
 
+    it "causes the method to return even when the immediate parent has already returned" do
+      ReturnSpecs::SavedInnerBlock.new.start.should == :return_value
+      ScratchPad.recorded.should == :before_return
+    end
+
   end
 
   describe "within two blocks" do

Modified: MacRuby/trunk/spec/frozen/language/string_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/language/string_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/language/string_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -143,15 +143,26 @@
     s.should == '    foo bar#{@ip}' + "\n"
   end
 
-  it "interpolates the return value of Object#to_s" do
+  it "call #to_s when the object is not a String" do
     obj = mock('to_s')
     obj.stub!(:to_s).and_return('42')
 
     "#{obj}".should == '42'
   end
 
-  it "interpolates an implementation-dependent representation of an object that does not return a String from #to_s" do
+  it "call #to_s as a private method" do
     obj = mock('to_s')
+    obj.stub!(:to_s).and_return('42')
+
+    class << obj
+      private :to_s
+    end
+
+    "#{obj}".should == '42'
+  end
+
+  it "uses an internal representation when #to_s doesn't return a String" do
+    obj = mock('to_s')
     obj.stub!(:to_s).and_return(42)
 
     # See rubyspec commit 787c132d by yugui. There is value in
@@ -163,6 +174,11 @@
     "#{obj}".should be_an_instance_of(String)
   end
 
+  it "allow a dynamic string to parse a nested do...end block as an argument to a call without parens, interpolated" do
+    s = eval 'eval "#{proc do; 1; end.call}"'
+    s.should == 1
+  end
+
   ruby_version_is '1.9' do
     it "are produced from character shortcuts" do
       ?z.should == 'z'

Modified: MacRuby/trunk/spec/frozen/language/versions/block_1.8.rb
===================================================================
--- MacRuby/trunk/spec/frozen/language/versions/block_1.8.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/language/versions/block_1.8.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,21 +1,3 @@
-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 "Block parameters (to be removed from MRI)" do
   it "assigns to a global variable" do
     $global_for_block_assignment = 0

Modified: MacRuby/trunk/spec/frozen/language/versions/block_1.9.rb
===================================================================
--- MacRuby/trunk/spec/frozen/language/versions/block_1.9.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/language/versions/block_1.9.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,21 +1,3 @@
-describe "Block parameters" do
-  it "does not override a shadowed variable from the outer scope" do
-    i = 0
-    a = [1,2,3]
-    a.each {|i| ;}
-    i.should == 0
-  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 == nil
-  end
-end
-
 describe "Block-local variables" do
   # Examples phrased so the concatenation of the describe and it blocks make
   # grammatical sense.

Modified: MacRuby/trunk/spec/frozen/language/versions/not_1.9.rb
===================================================================
--- MacRuby/trunk/spec/frozen/language/versions/not_1.9.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/language/versions/not_1.9.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -19,8 +19,4 @@
   it "returns true if the argument is nil" do
     not(false).inspect.should == "true"
   end
-
-  it "returns true if no argument is provided" do
-    not().inspect.should == "true"
-  end
 end

Modified: MacRuby/trunk/spec/frozen/language/versions/regexp_1.9.rb
===================================================================
--- MacRuby/trunk/spec/frozen/language/versions/regexp_1.9.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/language/versions/regexp_1.9.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -28,4 +28,4 @@
     /fooA?+Abar/.match("fooAAAbar").should be_nil
     /fooA*+Abar/.match("fooAAAbar").should be_nil
   end
-end
+end
\ No newline at end of file

Modified: MacRuby/trunk/spec/frozen/library/bigdecimal/divmod_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/bigdecimal/divmod_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/bigdecimal/divmod_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -20,7 +20,7 @@
 describe "BigDecimal#mod_part_of_divmod" do
   # BigDecimal#divmod[1] behaves exactly like #modulo
   before :all do
-    class ::BigDecimal
+    class BigDecimal
       def mod_part_of_divmod(arg)
         divmod(arg)[1]
       end
@@ -28,7 +28,7 @@
   end
 
   after :all do
-    class ::BigDecimal
+    class BigDecimal
       undef mod_part_of_divmod
     end
   end

Modified: MacRuby/trunk/spec/frozen/library/csv/readlines_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/csv/readlines_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/csv/readlines_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -4,3 +4,22 @@
 describe "CSV.readlines" do
   it "needs to be reviewed for spec completeness"
 end
+
+ruby_version_is "1.9" do
+  describe "CSV#readlines" do
+    it "returns an Array of Array containing each element in a one-line CSV file" do
+      file = CSV.new "a, b, c"
+      file.readlines.should == [["a", " b", " c"]]
+    end
+
+    it "returns an Array of Arrays containing each element in a multi-line CSV file" do
+      file = CSV.new "a, b, c\nd, e, f"
+      file.readlines.should == [["a", " b", " c"], ["d", " e", " f"]]
+    end
+
+    it "returns nil for a missing value" do
+      file = CSV.new "a,, b, c"
+      file.readlines.should == [["a", nil, " b", " c"]]
+    end
+  end
+end

Modified: MacRuby/trunk/spec/frozen/library/date/conversions_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/date/conversions_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/date/conversions_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -42,12 +42,7 @@
   end
 end
 
-# The following methods are private in 1.9's date.rb.
-# XXX should we write specs that test if they are private?
-# should we rewrite the specs using #send?
 ruby_version_is "" ... "1.9" do
-
-ruby_version_is "" ... "1.9" do
   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
@@ -157,6 +152,4 @@
       Date.jd_to_wday(2454482).should == 3
     end
   end
-end
-
-end # "" ... "1.9"
+end
\ No newline at end of file

Modified: MacRuby/trunk/spec/frozen/library/delegate/delegate_class/instance_method_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/delegate/delegate_class/instance_method_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/delegate/delegate_class/instance_method_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,7 +2,7 @@
 require File.expand_path('../../fixtures/classes', __FILE__)
 
 describe "DelegateClass.instance_method" do
-  before :each do
+  before :all do
     @klass = DelegateSpecs::DelegateClass
     @obj = @klass.new(DelegateSpecs::Simple.new)
   end

Modified: MacRuby/trunk/spec/frozen/library/delegate/delegate_class/instance_methods_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/delegate/delegate_class/instance_methods_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/delegate/delegate_class/instance_methods_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,7 +2,7 @@
 require File.expand_path('../../fixtures/classes', __FILE__)
 
 describe "DelegateClass.instance_methods" do
-  before :each do
+  before :all do
     @methods = DelegateSpecs::DelegateClass.instance_methods
   end
 

Modified: MacRuby/trunk/spec/frozen/library/delegate/delegate_class/private_instance_methods_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/delegate/delegate_class/private_instance_methods_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/delegate/delegate_class/private_instance_methods_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,7 +2,7 @@
 require File.expand_path('../../fixtures/classes', __FILE__)
 
 describe "DelegateClass.private_instance_methods" do
-  before :each do
+  before :all do
     @methods = DelegateSpecs::DelegateClass.private_instance_methods
   end
 

Modified: MacRuby/trunk/spec/frozen/library/delegate/delegate_class/protected_instance_methods_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/delegate/delegate_class/protected_instance_methods_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/delegate/delegate_class/protected_instance_methods_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,7 +2,7 @@
 require File.expand_path('../../fixtures/classes', __FILE__)
 
 describe "DelegateClass.protected_instance_methods" do
-  before :each do
+  before :all do
     @methods = DelegateSpecs::DelegateClass.protected_instance_methods
   end
 

Modified: MacRuby/trunk/spec/frozen/library/delegate/delegate_class/public_instance_methods_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/delegate/delegate_class/public_instance_methods_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/delegate/delegate_class/public_instance_methods_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,7 +2,7 @@
 require File.expand_path('../../fixtures/classes', __FILE__)
 
 describe "DelegateClass.public_instance_methods" do
-  before :each do
+  before :all do
     @methods = DelegateSpecs::DelegateClass.public_instance_methods
   end
 

Modified: MacRuby/trunk/spec/frozen/library/delegate/delegator/equal_value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/delegate/delegator/equal_value_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/delegate/delegator/equal_value_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,7 +2,7 @@
 require File.expand_path('../../fixtures/classes', __FILE__)
 
 describe "Delegator#==" do
-  before :each do
+  before :all do
     @base = mock('base')
     @delegator = DelegateSpecs::Delegator.new(@base)
   end

Modified: MacRuby/trunk/spec/frozen/library/delegate/delegator/frozen_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/delegate/delegator/frozen_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/delegate/delegator/frozen_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,7 +2,7 @@
 require File.expand_path('../../fixtures/classes', __FILE__)
 
 describe "Delegator when frozen" do
-  before :each do
+  before :all do
     @array = [42, :hello]
     @delegate = DelegateSpecs::Delegator.new(@array)
     @delegate.freeze

Modified: MacRuby/trunk/spec/frozen/library/delegate/delegator/marshal_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/delegate/delegator/marshal_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/delegate/delegator/marshal_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,7 +2,7 @@
 require 'delegate'
 
 describe "SimpleDelegator" do
-  before :each do
+  before :all do
     @obj = "hello"
     @delegate = SimpleDelegator.new(@obj)
   end

Modified: MacRuby/trunk/spec/frozen/library/delegate/delegator/method_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/delegate/delegator/method_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/delegate/delegator/method_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,7 +2,7 @@
 require File.expand_path('../../fixtures/classes', __FILE__)
 
 describe "Delegator#method" do
-  before :each do
+  before :all do
     @simple = DelegateSpecs::Simple.new
     @delegate = DelegateSpecs::Delegator.new(@simple)
   end

Modified: MacRuby/trunk/spec/frozen/library/delegate/delegator/methods_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/delegate/delegator/methods_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/delegate/delegator/methods_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,7 +2,7 @@
 require File.expand_path('../../fixtures/classes', __FILE__)
 
 describe "Delegator#methods" do
-  before :each do
+  before :all do
     @simple = DelegateSpecs::Simple.new
     @delegate = DelegateSpecs::Delegator.new(@simple)
     @methods = @delegate.methods

Modified: MacRuby/trunk/spec/frozen/library/delegate/delegator/not_equal_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/delegate/delegator/not_equal_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/delegate/delegator/not_equal_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -3,7 +3,7 @@
 
 ruby_version_is "1.9" do
   describe "Delegator#!=" do
-    before :each do
+    before :all do
       @base = mock('base')
       @delegator = DelegateSpecs::Delegator.new(@base)
     end

Modified: MacRuby/trunk/spec/frozen/library/delegate/delegator/private_methods_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/delegate/delegator/private_methods_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/delegate/delegator/private_methods_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,7 +2,7 @@
 require File.expand_path('../../fixtures/classes', __FILE__)
 
 describe "Delegator#private_methods" do
-  before :each do
+  before :all do
     @simple = DelegateSpecs::Simple.new
     @delegate = DelegateSpecs::Delegator.new(@simple)
     @methods = @delegate.private_methods

Modified: MacRuby/trunk/spec/frozen/library/delegate/delegator/protected_methods_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/delegate/delegator/protected_methods_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/delegate/delegator/protected_methods_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,7 +2,7 @@
 require File.expand_path('../../fixtures/classes', __FILE__)
 
 describe "Delegator#protected_methods" do
-  before :each do
+  before :all do
     @simple = DelegateSpecs::Simple.new
     @delegate = DelegateSpecs::Delegator.new(@simple)
     @methods = @delegate.protected_methods

Modified: MacRuby/trunk/spec/frozen/library/delegate/delegator/public_methods_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/delegate/delegator/public_methods_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/delegate/delegator/public_methods_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,7 +2,7 @@
 require File.expand_path('../../fixtures/classes', __FILE__)
 
 describe "Delegator#public_methods" do
-  before :each do
+  before :all do
     @simple = DelegateSpecs::Simple.new
     @delegate = DelegateSpecs::Delegator.new(@simple)
     @methods = @delegate.public_methods

Modified: MacRuby/trunk/spec/frozen/library/delegate/delegator/send_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/delegate/delegator/send_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/delegate/delegator/send_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,7 +2,7 @@
 require File.expand_path('../../fixtures/classes', __FILE__)
 
 describe "SimpleDelegator.new" do
-  before :each do
+  before :all do
     @simple = DelegateSpecs::Simple.new
     @delegate = SimpleDelegator.new(@simple)
   end

Modified: MacRuby/trunk/spec/frozen/library/digest/md5/shared/length.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/digest/md5/shared/length.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/digest/md5/shared/length.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,19 +1,8 @@
 describe :md5_length, :shared => true do
-  ruby_version_is "" ... "1.9" 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
+  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
-
-  ruby_version_is "1.9" do
-    it 'returns the length of the digest' do
-      cur_digest = Digest::MD5.new
-      cur_digest.send(@method).should == MD5Constants::BlankDigest.dup.force_encoding('ascii-8bit').size
-      cur_digest << MD5Constants::Contents
-      cur_digest.send(@method).should == MD5Constants::Digest.dup.force_encoding('ascii-8bit').size
-    end
-  end
 end

Modified: MacRuby/trunk/spec/frozen/library/digest/sha256/shared/length.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/digest/sha256/shared/length.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/digest/sha256/shared/length.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,18 +1,8 @@
 describe :sha256_length, :shared => true do
-  ruby_version_is "" ... "1.9" 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
+  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
-  ruby_version_is "1.9" do
-    it 'returns the length of the digest' do
-      cur_digest = Digest::SHA256.new
-      cur_digest.send(@method).should == SHA256Constants::BlankDigest.dup.force_encoding('ascii-8bit').size
-      cur_digest << SHA256Constants::Contents
-      cur_digest.send(@method).should == SHA256Constants::Digest.dup.force_encoding('ascii-8bit').size
-    end
-  end
 end

Modified: MacRuby/trunk/spec/frozen/library/digest/sha384/shared/length.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/digest/sha384/shared/length.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/digest/sha384/shared/length.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,18 +1,8 @@
 describe :sha384_length, :shared => true do
-  ruby_version_is "" ... "1.9" 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
+  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
-  ruby_version_is "1.9" do
-    it 'returns the length of the digest' do
-      cur_digest = Digest::SHA384.new
-      cur_digest.send(@method).should == SHA384Constants::BlankDigest.dup.force_encoding('ascii-8bit').size
-      cur_digest << SHA384Constants::Contents
-      cur_digest.send(@method).should == SHA384Constants::Digest.dup.force_encoding('ascii-8bit').size
-    end
-  end
 end

Modified: MacRuby/trunk/spec/frozen/library/digest/sha512/shared/length.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/digest/sha512/shared/length.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/digest/sha512/shared/length.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,18 +1,8 @@
 describe :sha512_length, :shared => true do
-  ruby_version_is "" ... "1.9" 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
+  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
-  ruby_version_is "1.9" do
-    it 'returns the length of the digest' do
-      cur_digest = Digest::SHA512.new
-      cur_digest.send(@method).should == SHA512Constants::BlankDigest.dup.force_encoding('ascii-8bit').size
-      cur_digest << SHA512Constants::Contents
-      cur_digest.send(@method).should == SHA512Constants::Digest.dup.force_encoding('ascii-8bit').size
-    end
-  end
 end

Modified: MacRuby/trunk/spec/frozen/library/iconv/iconv_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/iconv/iconv_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/iconv/iconv_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -121,6 +121,18 @@
   end
 
   it_behaves_like :iconv_initialize_exceptions, :iconv, "test"
+
+  describe "using the ignore option" do
+    # This spec exists because some implementions of libiconv return
+    # an error for this sequence even though they consume all of the
+    # input and write the proper output. We want to be sure that those
+    # platforms ignore the error and give us the data back.
+    #
+    it "causes unknown bytes to be ignored" do
+      str = "f\303\266\303\266 bar" # this is foo bar, with umlate o's
+      Iconv.iconv('ascii//ignore', 'utf-8', str)[0].should == "f bar"
+    end
+  end
 end
 
 describe "The 'utf-8' encoder" do

Modified: MacRuby/trunk/spec/frozen/library/net/http/http/fixtures/http_server.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/net/http/http/fixtures/http_server.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/net/http/http/fixtures/http_server.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -8,13 +8,13 @@
     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|
@@ -27,7 +27,7 @@
       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|
@@ -40,41 +40,58 @@
       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
+    @server = nil
+
     def start_server
-      server_config = {
-        :BindAddress => "localhost",
-        :Port => 3333,
-        :Logger => WEBrick::Log.new(NullWriter.new),
-        :AccessLog => [],
-        :ShutdownSocketWithoutClose => true,
-        :ServerType => Thread }
-      
-      @server = WEBrick::HTTPServer.new(server_config)
+      unless @server
+        server_config = {
+          :BindAddress => "localhost",
+          :Port => 3333,
+          :Logger => WEBrick::Log.new(NullWriter.new),
+          :AccessLog => [],
+          :ShutdownSocketWithoutClose => true,
+          :ServerType => Thread
+        }
 
-      @server.mount_proc('/') do |req, res|
-        res.content_type = "text/plain"
-        res.body = "This is the index page."
+        @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
       end
-      @server.mount('/request', RequestServlet)
-      @server.mount("/request/body", RequestBodyServlet)
-      @server.mount("/request/header", RequestHeaderServlet)
-      
-      @server.start
+
+      # On initial startup or if we re-enter, we wait until the
+      # server is really running.
       Thread.pass until @server.status == :Running
     end
-    
+
+    def shutdown_server
+      @server.shutdown if @server
+    end
+
     def stop_server
-      @server.shutdown
-      Thread.pass until @server.status == :Stop
+      # The specs initially started and stopped the server for every
+      # describe block. This method is now a noop. The server is shutdown
+      # automatically when the spec process exits.
     end
   end
-end
\ No newline at end of file
+
+  at_exit do
+    shutdown_server
+  end
+end

Modified: MacRuby/trunk/spec/frozen/library/net/http/http/get_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/net/http/http/get_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/net/http/http/get_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -23,22 +23,24 @@
     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
+  ruby_version_is ''...'1.9.3' do
+    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
+      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)
+      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."
+        body.should == "This is the index page."
+        response.body.should == "This is the index page."
+      end
     end
 
     it "yields each read part of the body to the passed block when passed a block" do

Modified: MacRuby/trunk/spec/frozen/library/net/http/http/shared/version_1_1.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/net/http/http/shared/version_1_1.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/net/http/http/shared/version_1_1.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,8 +1,19 @@
-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
+ruby_version_is ''...'1.9.3' do
+  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
 end
+
+ruby_version_is '1.9.3' do
+  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
+    end
+  end
+end

Modified: MacRuby/trunk/spec/frozen/library/net/http/http/shared/version_1_2.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/net/http/http/shared/version_1_2.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/net/http/http/shared/version_1_2.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,7 +1,5 @@
 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

Modified: MacRuby/trunk/spec/frozen/library/net/http/http/version_1_1_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/net/http/http/version_1_1_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/net/http/http/version_1_1_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,17 +2,19 @@
 require 'net/http'
 require File.expand_path('../shared/version_1_1', __FILE__)
 
-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
+ruby_version_is ''...'1.9.3' do
+  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
-  
-  it "returns false" do
-    Net::HTTP.version_1_1.should be_false
-  end
 end
 
 describe "Net::HTTP.version_1_1?" do

Modified: MacRuby/trunk/spec/frozen/library/net/http/httpresponse/to_ary_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/net/http/httpresponse/to_ary_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/net/http/httpresponse/to_ary_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,23 +2,25 @@
 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) {}
+ruby_version_is ''...'1.9.3' do
+  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
-  
-  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

Modified: MacRuby/trunk/spec/frozen/library/queue/shared/deque.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/queue/shared/deque.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/queue/shared/deque.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -24,8 +24,6 @@
       v = 1
     end
 
-    Thread.pass while th.status and th.status != "sleep"
-
     v.should == 0
     q << Object.new
     th.join

Copied: MacRuby/trunk/spec/frozen/library/readline/readline_spec.rb (from rev 5210, MacRuby/trunk/spec/frozen/library/readline/readline_spec_disabled.rb)
===================================================================
--- MacRuby/trunk/spec/frozen/library/readline/readline_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/library/readline/readline_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,34 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+
+process_is_foreground do
+  with_feature :readline do
+    require 'readline'
+
+    describe "Readline.readline" do
+      before :each do
+        @file = tmp('readline')
+        File.open(@file, 'w') do |file|
+          file.puts "test\n"
+        end
+        @stdin_back = STDIN.dup
+        @stdout_back = STDOUT.dup
+        STDIN.reopen(@file, 'r')
+        STDOUT.reopen("/dev/null")
+      end
+
+      after :each do
+        rm_r @file
+        STDIN.reopen(@stdin_back)
+        STDOUT.reopen(@stdout_back)
+      end
+
+      it "returns the input string" do
+        Readline.readline.should == "test"
+      end
+
+      it "taints the returned strings" do
+        Readline.readline.tainted?.should be_true
+      end
+    end
+  end
+end

Deleted: MacRuby/trunk/spec/frozen/library/readline/readline_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/readline/readline_spec_disabled.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/readline/readline_spec_disabled.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,34 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-process_is_foreground do
-  with_feature :readline do
-    require 'readline'
-
-    describe "Readline.readline" do
-      before :each do
-        @file = tmp('readline')
-        File.open(@file, 'w') do |file|
-          file.puts "test\n"
-        end
-        @stdin_back = STDIN.dup
-        @stdout_back = STDOUT.dup
-        STDIN.reopen(@file, 'r')
-        STDOUT.reopen("/dev/null")
-      end
-
-      after :each do
-        rm_r @file
-        STDIN.reopen(@stdin_back)
-        STDOUT.reopen(@stdout_back)
-      end
-
-      it "returns the input string" do
-        Readline.readline.should == "test"
-      end
-
-      it "taints the returned strings" do
-        Readline.readline.tainted?.should be_true
-      end
-    end
-  end
-end

Modified: MacRuby/trunk/spec/frozen/library/socket/basicsocket/getsockname_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/socket/basicsocket/getsockname_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/socket/basicsocket/getsockname_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -16,7 +16,7 @@
   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
+    ["::", "0.0.0.0", "::ffff:0.0.0.0"].include?(sockaddr[1]).should be_true
     sockaddr[0].should == SocketSpecs.port
   end
 

Added: MacRuby/trunk/spec/frozen/library/socket/fixtures/send_io.txt
===================================================================
--- MacRuby/trunk/spec/frozen/library/socket/fixtures/send_io.txt	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/library/socket/fixtures/send_io.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1 @@
+This data is magic.

Modified: MacRuby/trunk/spec/frozen/library/socket/socket/connect_nonblock_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/socket/socket/connect_nonblock_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/socket/socket/connect_nonblock_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,2 +1,50 @@
 require File.expand_path('../../../../spec_helper', __FILE__)
 require File.expand_path('../../fixtures/classes', __FILE__)
+
+require 'socket'
+
+describe "Socket#connect_nonblock" do
+  before :each do
+    @addr = Socket.sockaddr_in(SocketSpecs.port, "127.0.0.1")
+    @socket = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
+  end
+
+  after :each do
+    @socket.close
+  end
+
+  it "takes an encoded socket address and starts the connection to it" do
+    lambda {
+      @socket.connect_nonblock(@addr)
+    }.should raise_error(Errno::EINPROGRESS)
+  end
+
+  it "connects the socket to the remote side" do
+    ready = false
+    thread = Thread.new do
+      server = TCPServer.new(SocketSpecs.port)
+      ready = true
+      conn = server.accept
+      conn << "hello!"
+      conn.close
+      server.close
+    end
+
+    Thread.pass while (thread.status and thread.status != 'sleep') or !ready
+
+    begin
+      @socket.connect_nonblock(@addr)
+    rescue Errno::EINPROGRESS
+    end
+
+    IO.select nil, [@socket]
+
+    begin
+      @socket.connect_nonblock(@addr)
+    rescue Errno::EISCONN
+      # Not all OS's use this errno, so we trap and ignore it
+    end
+
+    @socket.read(6).should == "hello!"
+  end
+end

Modified: MacRuby/trunk/spec/frozen/library/socket/socket/getaddrinfo_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/socket/socket/getaddrinfo_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/socket/socket/getaddrinfo_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -34,18 +34,10 @@
           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
 
@@ -57,7 +49,15 @@
     ]
 
     addrinfo = Socket.getaddrinfo SocketSpecs.hostname, 'http'
-    addrinfo.each { |a| expected.should include(a) }
+    addrinfo.each do |a|
+      case a.last
+      when Socket::IPPROTO_UDP, Socket::IPPROTO_TCP
+        expected.should include(a)
+      else
+        # don't check this. It's some weird protocol we don't know about
+        # so we can't spec it.
+      end
+    end
   end
 
    # #getaddrinfo will return a INADDR_ANY address (0.0.0.0

Modified: MacRuby/trunk/spec/frozen/library/socket/socket/getnameinfo_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/socket/socket/getnameinfo_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/socket/socket/getnameinfo_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -3,7 +3,7 @@
 
 require 'socket'
 
-describe "Socket#getnameinfo" do
+describe "Socket.getnameinfo" do
   before :all do
     @reverse_lookup = BasicSocket.do_not_reverse_lookup
     BasicSocket.do_not_reverse_lookup = true
@@ -22,14 +22,15 @@
   it "gets the name information and resolve the host" do
     sockaddr = Socket.sockaddr_in SocketSpecs.port, '127.0.0.1'
     name_info = Socket.getnameinfo(sockaddr, Socket::NI_NUMERICSERV)
-    name_info.should == ['localhost', "#{SocketSpecs.port}"]
+    name_info[0].should be_valid_DNS_name
+    name_info[1].should == SocketSpecs.port.to_s
   end
 
   it "gets the name information and resolves the service" do
     sockaddr = Socket.sockaddr_in 80, '127.0.0.1'
     name_info = Socket.getnameinfo(sockaddr)
     name_info.size.should == 2
-    name_info[0].should == "localhost"
+    name_info[0].should be_valid_DNS_name
     # see http://www.iana.org/assignments/port-numbers
     name_info[1].should =~ /^(www|http|www-http)$/
   end

Modified: MacRuby/trunk/spec/frozen/library/socket/udpsocket/bind_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/socket/udpsocket/bind_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/socket/udpsocket/bind_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -17,17 +17,13 @@
     lambda { @socket.bind(SocketSpecs.hostname, SocketSpecs.port) }.should raise_error
   end
 
-  # This is quarantined because it fails randomly on linux.
-  # I believe it's because of ipv4/ipv6 interaction
-  quarantine! do
-    it "receives a hostname and a port" do
-      @socket.bind(SocketSpecs.hostname, SocketSpecs.port)
+  it "receives a hostname and a port" do
+    @socket.bind(SocketSpecs.hostname, SocketSpecs.port)
 
-      port, host = Socket.unpack_sockaddr_in(@socket.getsockname)
+    port, host = Socket.unpack_sockaddr_in(@socket.getsockname)
 
-      host.should == "127.0.0.1"
-      port.should == SocketSpecs.port
-    end
+    host.should == "127.0.0.1"
+    port.should == SocketSpecs.port
   end
 
   it "binds to INADDR_ANY if the hostname is empty" do

Added: MacRuby/trunk/spec/frozen/library/socket/unixsocket/recv_io_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/socket/unixsocket/recv_io_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/library/socket/unixsocket/recv_io_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,51 @@
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+
+describe "UNIXSocket#recv_io" do
+
+  platform_is_not :windows do
+    before :each do
+      @path = SocketSpecs.socket_path
+      File.unlink(@path) if File.exists?(@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 "reads an IO object across the socket" do
+      path = File.expand_path('../../fixtures/send_io.txt', __FILE__)
+      f = File.open(path)
+
+      @client.send_io(f)
+      io = @server.accept.recv_io
+
+      io.read.should == File.read(path)
+    end
+
+    it "takes an optional class to use" do
+      path = File.expand_path('../../fixtures/send_io.txt', __FILE__)
+      f = File.open(path)
+
+      @client.send_io(f)
+      io = @server.accept.recv_io(File)
+
+      io.should be_kind_of(File)
+    end
+
+    it "takes an optional mode to use" do
+      path = File.expand_path('../../fixtures/send_io.txt', __FILE__)
+      f = File.open(path)
+
+      @client.send_io(f)
+      io = @server.accept.recv_io(File, "r")
+
+      io.mode.should == IO::RDONLY
+    end
+  end
+end

Added: MacRuby/trunk/spec/frozen/library/socket/unixsocket/send_io_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/socket/unixsocket/send_io_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/library/socket/unixsocket/send_io_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,31 @@
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+
+describe "UNIXSocket#send_io" do
+
+  platform_is_not :windows do
+    before :each do
+      @path = SocketSpecs.socket_path
+      File.unlink(@path) if File.exists?(@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 "sends the fd for an IO object across the socket" do
+      path = File.expand_path('../../fixtures/send_io.txt', __FILE__)
+      f = File.open(path)
+
+      @client.send_io(f)
+      io = @server.accept.recv_io
+
+      io.read.should == File.read(path)
+    end
+  end
+end

Modified: MacRuby/trunk/spec/frozen/library/stringio/bytes_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/stringio/bytes_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/stringio/bytes_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,7 +2,7 @@
 require 'stringio'
 require File.expand_path('../shared/each_byte', __FILE__)
 
-ruby_version_is "1.8.7" .. "1.9" do
+ruby_version_is "1.8.7" do
   describe "StringIO#bytes" do
     it_behaves_like :stringio_each_byte, :bytes
   end

Modified: MacRuby/trunk/spec/frozen/library/stringio/gets_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/stringio/gets_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/stringio/gets_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -26,6 +26,17 @@
     $_.should be_nil
   end
 
+  it "accepts string as separator" do
+    @io.gets("is>")
+    $_.should == "this>"
+    @io.gets("an>")
+    $_.should == "is>an>"
+    @io.gets("example")
+    $_.should == "example"
+    @io.gets("ple")
+    $_.should be_nil
+  end
+
   it "updates self's lineno by one" do
     @io.gets(">")
     @io.lineno.should eql(1)

Modified: MacRuby/trunk/spec/frozen/library/stringio/initialize_copy_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/stringio/initialize_copy_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/stringio/initialize_copy_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -6,11 +6,11 @@
     @io      = StringIO.new("StringIO example")
     @orig_io = StringIO.new("Original StringIO")
   end
-
+  
   it "is private" do
     StringIO.should have_private_instance_method(:initialize_copy)
   end
-
+  
   it "returns self" do
     @io.send(:initialize_copy, @orig_io).should equal(@io)
   end

Modified: MacRuby/trunk/spec/frozen/library/stringio/initialize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/stringio/initialize_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/stringio/initialize_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -26,7 +26,7 @@
     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
@@ -111,7 +111,7 @@
   end
 
   ruby_version_is "" ... "1.9" do
-     it "raises a TypeError when passed a frozen String in truncate mode as StringIO backend" do
+    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

Modified: MacRuby/trunk/spec/frozen/library/stringio/puts_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/stringio/puts_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/stringio/puts_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -3,7 +3,7 @@
 require File.expand_path('../../../spec_helper', __FILE__)
 require File.expand_path('../fixtures/classes', __FILE__)
 
-describe "StringIO#puts when passed [Array, ...]" do
+describe "StringIO#puts when passed an Array" do
   before(:each) do
     @io = StringIO.new
   end
@@ -53,7 +53,7 @@
   end
 end
 
-describe "StringIO#puts when passed [Object, ...]" do
+describe "StringIO#puts when passed 1 or more objects" do
   before(:each) do
     @io = StringIO.new
   end
@@ -86,6 +86,11 @@
     @io.puts(obj)
     @io.string.should == "to_s\n"
   end
+
+  it "prints a newline when passed an empty string" do
+    @io.puts ''
+    @io.string.should == "\n"
+  end
 end
 
 describe "StringIO#puts when passed no arguments" do

Modified: MacRuby/trunk/spec/frozen/library/stringio/shared/each.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/stringio/shared/each.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/stringio/shared/each.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -35,7 +35,7 @@
     io.send(@method, nil) {|s| seen << s}
     seen.should == ["2 1 2 1 2"]
   end
-  
+
   ruby_bug "", "1.8.8" do
     it "yields each paragraph when passed an empty String as separator" do
       seen = []

Modified: MacRuby/trunk/spec/frozen/library/stringio/shared/eof.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/stringio/shared/eof.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/stringio/shared/eof.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -21,9 +21,4 @@
     @io.pos = 2
     @io.send(@method).should be_false
   end
-  
-  it "raises an error if the io isn't readable" do
-    @io.close
-    lambda{ @io.send(@method)}.should raise_error(IOError)
-  end
 end

Deleted: MacRuby/trunk/spec/frozen/library/stringio/shared/getbyte.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/stringio/shared/getbyte.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/stringio/shared/getbyte.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,58 +0,0 @@
-describe :stringio_getbyte, :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
-  
-  ruby_version_is "" ... "1.9" do    
-    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
-  end
-  ruby_version_is "1.9" do  
-    it "returns the 8-bit byte at the current position" do
-      @io.send(@method).should == 101
-      @io.send(@method).should == 120
-      @io.send(@method).should == 97
-    end
-  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_getbyte_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

Deleted: MacRuby/trunk/spec/frozen/library/stringio/shared/readbyte.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/stringio/shared/readbyte.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/stringio/shared/readbyte.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,48 +0,0 @@
-describe :stringio_readbyte, :shared => true do
-  before(:each) do
-    @io = StringIO.new("example")
-  end
-  
-  ruby_version_is "" ... "1.9" do
-    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
-  end
-  
-  ruby_version_is "1.9" do
-    it "reads the next character from self's current position" do      
-      @io.send(@method).should == 101
-
-      @io.pos = 4
-      @io.send(@method).should == 112
-    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 
-end  
-
-describe :stringio_readbyte_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

Modified: MacRuby/trunk/spec/frozen/library/stringscanner/check_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/stringscanner/check_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/stringscanner/check_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -11,6 +11,6 @@
     @s.matched.should == "This"
     @s.pos.should == 0
     @s.check(/is/).should == nil
-    @s.matched.should == nil   
+    @s.matched.should == nil
   end
 end

Modified: MacRuby/trunk/spec/frozen/library/stringscanner/element_reference_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/stringscanner/element_reference_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/stringscanner/element_reference_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -6,6 +6,10 @@
     @s = StringScanner.new("Fri Jun 13 2008 22:43")
   end
 
+  it "returns nil if there is no current match" do
+    @s[0].should be_nil
+  end
+
   it "returns the n-th subgroup in the most recent match" do
     @s.scan(/(\w+) (\w+) (\d+) /)
     @s[0].should == "Fri Jun 13 "

Modified: MacRuby/trunk/spec/frozen/library/stringscanner/exist_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/stringscanner/exist_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/stringscanner/exist_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -8,7 +8,7 @@
 
   it "returns the index of the first occurrence of the given pattern" do
     @s.exist?(/s/).should == 4
-    @s.scan /This is/
+    @s.scan(/This is/)
     @s.exist?(/s/).should == 6
   end
 
@@ -18,7 +18,7 @@
 
   it "returns nil if the pattern isn't found in the string" do
     @s.exist?(/S/).should == nil
-    @s.scan /This is/
+    @s.scan(/This is/)
     @s.exist?(/i/).should == nil
   end
 end

Modified: MacRuby/trunk/spec/frozen/library/stringscanner/initialize_copy_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/stringscanner/initialize_copy_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/stringscanner/initialize_copy_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -4,7 +4,8 @@
 describe "StringScanner#initialize_copy" do
   before(:each) do
     @s      = StringScanner.new("StringScanner example")
-    @orig_s = StringScanner.new("Original StringScanner")
+    @string = "this is a test"
+    @orig_s = StringScanner.new(@string)
   end
 
   it "is a private method" do
@@ -13,7 +14,7 @@
 
   it "copies the passed StringScanner's content to self" do
     @s.send(:initialize_copy, @orig_s)
-    @s.string.should == "Original StringScanner"
+    @s.string.should == @string
   end
 
   it "copies the passed StringSCanner's position to self" do
@@ -22,6 +23,19 @@
     @s.pos.should eql(5)
   end
 
+  it "copies previous match state" do
+    @orig_s.scan(/\w+/)
+    @orig_s.scan(/\s/)
+
+    @orig_s.pre_match.should == "this"
+
+    @s.send(:initialize_copy, @orig_s)
+    @s.pre_match.should == "this"
+
+    @s.unscan
+    @s.scan(/\s/).should == " "
+  end
+
   it "does not taint self when the passed StringScanner is tainted" do
     @orig_s.taint
     @s.send(:initialize_copy, @orig_s)

Modified: MacRuby/trunk/spec/frozen/library/stringscanner/match_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/stringscanner/match_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/stringscanner/match_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -16,4 +16,13 @@
     @s.match?(/\d+/).should == nil
     @s.match?(/\s+/).should == nil
   end
+
+  it "effects pre_match" do
+    @s.scan(/\w+/)
+    @s.scan(/\s/)
+
+    @s.pre_match.should == "This"
+    @s.match?(/\w+/)
+    @s.pre_match.should == "This "
+  end
 end

Modified: MacRuby/trunk/spec/frozen/library/stringscanner/pre_match_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/stringscanner/pre_match_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/stringscanner/pre_match_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -24,5 +24,18 @@
     @s.pre_match.should == nil
   end
 
+  it "is more than just the data from the last match" do
+    @s.scan(/\w+/)
+    @s.scan_until(/a te/)
+    @s.pre_match.should == "This is "
+  end
+
+  it "is not changed when the scanner's position changes" do
+    @s.scan_until(/\s+/)
+    @s.pre_match.should == "This"
+    @s.pos -= 1
+    @s.pre_match.should == "This"
+  end
+
   it_behaves_like :extract_range_matched, :pre_match
 end

Modified: MacRuby/trunk/spec/frozen/library/stringscanner/scan_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/stringscanner/scan_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/stringscanner/scan_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -13,11 +13,29 @@
     @s.scan(/\s+/).should == " "
   end
 
+  it "treats ^ as matching from the beginning of the current position" do
+    @s.scan(/\w+/).should == "This"
+    @s.scan(/^\d/).should be_nil
+    @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
+  it "returns nil when there is no more to scan" do
+    @s.scan(/[\w\s]+/).should == "This is a test"
+    @s.scan(/\w+/).should be_nil
+  end
+
+  it "returns an empty string when the pattern matches empty" do
+    @s.scan(/.*/).should == "This is a test"
+    @s.scan(/.*/).should == ""
+    @s.scan(/./).should be_nil
+  end
+
+  it "raises a TypeError if pattern isn't a Regexp" do
+    lambda { @s.scan("aoeu")    }.should raise_error(TypeError)
     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)

Modified: MacRuby/trunk/spec/frozen/library/stringscanner/scan_until_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/stringscanner/scan_until_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/stringscanner/scan_until_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -15,4 +15,9 @@
   it "returns nil if there's no match" do
     @s.scan_until(/\d/).should == nil
   end
+
+  it "can match anchors properly" do
+    @s.scan(/T/)
+    @s.scan_until(/^h/).should == "h"
+  end
 end

Modified: MacRuby/trunk/spec/frozen/library/stringscanner/shared/concat.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/stringscanner/shared/concat.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/stringscanner/shared/concat.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -6,8 +6,8 @@
     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, [1,2,3])    }.should raise_error(TypeError)
+  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

Deleted: MacRuby/trunk/spec/frozen/library/stringscanner/shared/eucjp.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/stringscanner/shared/eucjp.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/stringscanner/shared/eucjp.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,12 +0,0 @@
-# encoding: EUC-JP
-module TestStrings
-  def self.eucjp 
-    @eucjp_str = "\244\242"  # Japanese hira-kana "A"
-  end
-  def self.first_char
-     "\244"
-  end 
-  def self.second_char
-     "\242"
-  end
-end
\ No newline at end of file

Modified: MacRuby/trunk/spec/frozen/library/stringscanner/shared/get_byte.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/stringscanner/shared/get_byte.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/stringscanner/shared/get_byte.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,6 +1,3 @@
-# encoding: UTF-8
-require File.expand_path('../eucjp', __FILE__)
-
 describe :strscan_get_byte, :shared => true do
   it "scans one byte and returns it" do
     s = StringScanner.new('abc5.')
@@ -12,19 +9,10 @@
   end
 
   it "is not multi-byte character sensitive" do
-    s = StringScanner.new("あ") 
-    s.send(@method).should == "\xE3"
-    s.send(@method).should == "\x81"
-    s.send(@method).should == "\x82"
-    s.send(@method).should == nil
+    s = StringScanner.new("\244\242")
+    s.send(@method).should == "\244"
+    s.send(@method).should == "\242"
   end
-  
-  it "is not multi-byte character sensitive and can handle encodings" do
-    s = StringScanner.new(TestStrings.eucjp)
-    s.send(@method).should == TestStrings.first_char
-    s.send(@method).should == TestStrings.second_char
-    s.send(@method).should == nil
-  end 
 
   it "returns nil at the end of the string" do
     # empty string case

Modified: MacRuby/trunk/spec/frozen/library/stringscanner/shared/peek.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/stringscanner/shared/peek.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/stringscanner/shared/peek.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -23,10 +23,6 @@
     lambda { @s.send(@method, bignum_value) }.should raise_error(RangeError)
   end
 
-  it "raises a TypeError when the passed argument is not a Fixnum" do
-    lambda { @s.send(@method, "test") }.should raise_error(TypeError)
-  end
-
   it "returns an instance of String when passed a String subclass" do
     cls = Class.new(String)
     sub = cls.new("abc")

Modified: MacRuby/trunk/spec/frozen/library/stringscanner/shared/pos.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/stringscanner/shared/pos.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/stringscanner/shared/pos.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -33,16 +33,19 @@
     @s.send(@method, 5)
     @s.rest.should == "is a test"
   end
-  
-  it "modify the scan pointer with a negative value in range" do
+
+  it "positions from the end if the argument is negative" do
     @s.send(@method, -2)
+    @s.rest.should == "st"
     @s.pos.should == 12
-  end   
-  
-  it "modify the scan pointer with a negative value out of range" do
-    lambda { @s.send(@method, -15) }.should raise_error(RangeError)
   end
 
+  it "raises a RangeError if position too far backward" do
+    lambda {
+      @s.send(@method, -20)
+    }.should raise_error(RangeError)
+  end
+
   it "raises a RangeError when the passed argument is out of range" do
     lambda { @s.send(@method, 20) }.should raise_error(RangeError)
   end

Modified: MacRuby/trunk/spec/frozen/library/stringscanner/skip_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/stringscanner/skip_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/stringscanner/skip_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -14,5 +14,5 @@
   it "returns nil if there's no match" do
     @s.skip(/\s+/).should == nil
     @s.skip(/\d+/).should == nil
-  end   
+  end
 end

Modified: MacRuby/trunk/spec/frozen/library/tempfile/_close_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/tempfile/_close_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/tempfile/_close_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,15 +1,20 @@
 require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
 require 'tempfile'
 
 describe "Tempfile#_close" do
-  before(:each) do
+  before :each do
     @tempfile = Tempfile.new("specs")
   end
-  
+
+  after :each do
+    TempfileSpecs.cleanup @tempfile
+  end
+
   it "is protected" do
     Tempfile.should have_protected_instance_method(:_close)
   end
-  
+
   it "closes self" do
     @tempfile.send(:_close)
     @tempfile.closed?.should be_true

Modified: MacRuby/trunk/spec/frozen/library/tempfile/callback_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/tempfile/callback_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/tempfile/callback_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,4 +1,5 @@
 require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
 require 'tempfile'
 
 describe "Tempfile.callback" do

Modified: MacRuby/trunk/spec/frozen/library/tempfile/close_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/tempfile/close_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/tempfile/close_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -9,7 +9,7 @@
   after(:each) do
     @tempfile.unlink if @tempfile.path
   end
-  
+
   it "closes self" do
     @tempfile.close
     @tempfile.closed?.should be_true
@@ -20,16 +20,16 @@
   before(:each) do
     @tempfile = Tempfile.new("specs", tmp(""))
   end
-  
+
   after(:each) do
     @tempfile.unlink if @tempfile.path
   end
-  
+
   it "closes self" do
     @tempfile.close(true)
     @tempfile.closed?.should be_true
   end
-  
+
   it "unlinks self" do
     path = @tempfile.path
     @tempfile.close(true)
@@ -41,16 +41,16 @@
   before(:each) do
     @tempfile = Tempfile.new("specs", tmp(""))
   end
-  
+
   after(:each) do
     @tempfile.unlink if @tempfile.path
   end
-  
+
   it "closes self" do
     @tempfile.close!
     @tempfile.closed?.should be_true
   end
-  
+
   it "unlinks self" do
     path =  @tempfile.path
     @tempfile.close!

Modified: MacRuby/trunk/spec/frozen/library/tempfile/delete_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/tempfile/delete_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/tempfile/delete_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,6 +1,7 @@
 require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
+require File.expand_path('../shared/unlink', __FILE__)
 require 'tempfile'
-require File.expand_path('../shared/unlink', __FILE__)
 
 describe "Tempfile#delete" do
   it_behaves_like :tempfile_unlink, :delete

Added: MacRuby/trunk/spec/frozen/library/tempfile/fixtures/common.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/tempfile/fixtures/common.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/library/tempfile/fixtures/common.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,6 @@
+module TempfileSpecs
+  def self.cleanup(tempfile)
+    tempfile.close true unless tempfile.closed?
+    File.delete tempfile.path if tempfile.path and File.exists? tempfile.path
+  end
+end

Modified: MacRuby/trunk/spec/frozen/library/tempfile/initialize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/tempfile/initialize_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/tempfile/initialize_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,14 +1,14 @@
 require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
 require 'tempfile'
 
 describe "Tempfile#initialize" do
-  before(:each) do
+  before :each do
     @tempfile = Tempfile.allocate
   end
 
-  after(:each) do
-    @tempfile.close
-    @tempfile.unlink if @tempfile.path
+  after :each do
+    TempfileSpecs.cleanup @tempfile
   end
 
   it "opens a new tempfile with the passed name in the passed directory" do

Modified: MacRuby/trunk/spec/frozen/library/tempfile/length_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/tempfile/length_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/tempfile/length_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,6 +1,7 @@
 require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
+require File.expand_path('../shared/length', __FILE__)
 require 'tempfile'
-require File.expand_path('../shared/length', __FILE__)
 
 describe "Tempfile#length" do
   it_behaves_like :tempfile_length, :length

Modified: MacRuby/trunk/spec/frozen/library/tempfile/open_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/tempfile/open_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/tempfile/open_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,14 +1,15 @@
 require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
 require 'tempfile'
 
 describe "Tempfile#open" do
-  before(:each) do
+  before :each do
     @tempfile = Tempfile.new("specs")
     @tempfile.puts("Test!")
   end
-  
-  after(:each) do
-    @tempfile.close
+
+  after :each do
+    TempfileSpecs.cleanup @tempfile
   end
 
   it "reopens self" do
@@ -16,50 +17,60 @@
     @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
+  after :each do
+    TempfileSpecs.cleanup @tempfile
+  end
+
   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
+    @tempfile = Tempfile.open("specs")
+    # Delegation messes up .should be_an_instance_of(Tempfile)
+    @tempfile.instance_of?(Tempfile).should be_true
   end
+
+  ruby_version_is "1.8.7" do
+    it "is passed an array [base, suffix] as first argument" do
+      Tempfile.open(["specs", ".tt"]) { |tempfile| @tempfile = tempfile }
+      @tempfile.path.should =~ /specs.*\.tt$/
+    end
+  end
 end
 
 describe "Tempfile.open when passed a block" do
+  before :each do
+    ScratchPad.clear
+  end
+
+  after :each do
+    TempfileSpecs.cleanup @tempfile
+  end
+
   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
+    Tempfile.open("specs") do |tempfile|
+      @tempfile = tempfile
+      ScratchPad.record :yielded
+
+      # Delegation messes up .should be_an_instance_of(Tempfile)
+      tempfile.instance_of?(Tempfile).should be_true
+      tempfile.closed?.should be_false
     end
-    yielded.should be_true
+
+    ScratchPad.recorded.should == :yielded
   end
-  
+
   it "closes the yielded Tempfile after the block" do
-    tempfile = nil
-    Tempfile.open("specs") { |x| tempfile = x }
-    tempfile.closed?.should be_true
+    Tempfile.open("specs") { |tempfile| @tempfile = tempfile }
+    @tempfile.closed?.should be_true
   end
 end
 
-ruby_version_is '1.8.7' .. '1.9' do
-  describe "Tempfile.open" do
-    it "is passed an array [base,suffix] as first argument" do
-      tempfile = nil
-      Tempfile.open(["specs", ".tt"]) { |x| tempfile = x }
-      tempfile.path.should =~ /specs.*\.tt$/
-    end
-  end
-end

Modified: MacRuby/trunk/spec/frozen/library/tempfile/path_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/tempfile/path_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/tempfile/path_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,4 +1,5 @@
 require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
 require 'tempfile'
 
 describe "Tempfile#path" do
@@ -7,8 +8,7 @@
   end
 
   after :each do
-    @tempfile.close
-    @tempfile.unlink if @tempfile.path
+    TempfileSpecs.cleanup @tempfile
   end
 
   it "returns the path to the tempfile" do

Modified: MacRuby/trunk/spec/frozen/library/tempfile/shared/length.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/tempfile/shared/length.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/tempfile/shared/length.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,8 +1,12 @@
 describe :tempfile_length, :shared => true do
-  before(:each) do
+  before :each do
     @tempfile = Tempfile.new("specs")
   end
 
+  after :each do
+    TempfileSpecs.cleanup @tempfile
+  end
+
   it "returns the size of self" do
     @tempfile.send(@method).should eql(0)
     @tempfile.print("Test!")

Modified: MacRuby/trunk/spec/frozen/library/tempfile/shared/unlink.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/tempfile/shared/unlink.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/tempfile/shared/unlink.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,10 +1,10 @@
 describe :tempfile_unlink, :shared => true do
-  before(:each) do
+  before :each do
     @tempfile = Tempfile.new("specs")
   end
 
-  after(:each) do
-    @tempfile.close rescue nil
+  after :each do
+    TempfileSpecs.cleanup @tempfile
   end
 
   ruby_bug "", "1.8.6" do

Modified: MacRuby/trunk/spec/frozen/library/tempfile/size_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/tempfile/size_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/tempfile/size_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,6 +1,7 @@
 require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
+require File.expand_path('../shared/length', __FILE__)
 require 'tempfile'
-require File.expand_path('../shared/length', __FILE__)
 
 describe "Tempfile#size" do
   it_behaves_like :tempfile_length, :size

Modified: MacRuby/trunk/spec/frozen/library/tempfile/unlink_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/tempfile/unlink_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/tempfile/unlink_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,6 +1,7 @@
 require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
+require File.expand_path('../shared/unlink', __FILE__)
 require 'tempfile'
-require File.expand_path('../shared/unlink', __FILE__)
 
 describe "Tempfile#unlink" do
   it_behaves_like :tempfile_unlink, :unlink

Modified: MacRuby/trunk/spec/frozen/library/timeout/timeout_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/timeout/timeout_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/timeout/timeout_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -4,7 +4,7 @@
 describe "Timeout.timeout" do
   it "raises Timeout::Error when it times out with no specified error type" do
     lambda {
-      Timeout::timeout(1) do
+      Timeout.timeout(1) do
         sleep 3
       end
     }.should raise_error(Timeout::Error)
@@ -12,40 +12,25 @@
 
   it "raises specified error type when it times out" do
     lambda do
-      Timeout.timeout(0.1, StandardError) do
-        sleep 1
+      Timeout.timeout(1, StandardError) do
+        sleep 3
       end
     end.should raise_error(StandardError)
   end
   
   it "does not wait too long" do
     before_time = Time.now
-    begin
-      Timeout::timeout(1) do
+    lambda do
+      Timeout.timeout(1, StandardError) 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
+    end.should raise_error(StandardError)
 
-  it "does not 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
+    Time.now.to_f.should be_close(before_time.to_f, 1.2)
   end
 
   it "returns back the last value in the block" do
-    Timeout::timeout(1) do
+    Timeout.timeout(1) do
       42
     end.should == 42
   end

Modified: MacRuby/trunk/spec/frozen/library/yaml/dump_stream_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/yaml/dump_stream_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/yaml/dump_stream_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -6,11 +6,7 @@
     YAML.dump_stream.should == ""
   end
 
-  # 
-  # We used to compare against []\n\n and {}\n\n, but this was overdetermining the format 
-  # just to match Syck
-  #
   it "returns a YAML stream containing the objects passed" do
-    YAML.dump_stream('foo', 20, [], {}).should =~ /--- foo\n--- 20\n--- \[\]\n+--- \{\}\n+/
+    YAML.dump_stream('foo', 20, [], {}).should == "--- foo\n--- 20\n--- []\n\n--- {}\n\n"
   end
-end
+end
\ No newline at end of file

Modified: MacRuby/trunk/spec/frozen/library/yaml/load_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/yaml/load_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/yaml/load_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -41,7 +41,7 @@
   it "accepts symbols" do
     YAML.load( "--- :locked" ).should == :locked
   end
-  
+
   it "accepts numbers" do
     YAML.load("47").should == 47
     YAML.load("-1").should == -1
@@ -59,7 +59,7 @@
     YAML.load("--- ---\n").should == "---"
     YAML.load("--- abc").should == "abc"
   end
-  
+
   not_compliant_on :macruby do
     it "does not escape symbols" do
       YAML.load("foobar: >= 123").should == { "foobar" => ">= 123"}
@@ -73,7 +73,7 @@
     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 ) ],
@@ -83,7 +83,7 @@
     }
     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."}

Modified: MacRuby/trunk/spec/frozen/library/yaml/to_yaml_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/yaml/to_yaml_spec.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/yaml/to_yaml_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -53,17 +53,9 @@
     "I love Ruby".to_yaml.should == "--- I love Ruby\n"
   end
 
-  it "returns correct escape characters for non-ASCII Unicode characters" do
-    #
-    # Not sure if this belongs here? MN
-    #
-    str = YAML.load('--- "\U000000A9\U00002117\U0001D122"')
-    str.to_yaml.chomp.should == '--- "\xA9\u2117\U0001D122"'
-  end
-
   it "returns the YAML representation of a Struct object" do
-    Struct.new("Person", :name, :gender)
-    Struct::Person.new("Jane", "female").to_yaml.should match_yaml("--- !ruby/struct:Person\nname: Jane\ngender: female\n")
+    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

Copied: MacRuby/trunk/spec/frozen/library/zlib/deflate/set_dictionary_spec.rb (from rev 5210, MacRuby/trunk/spec/frozen/library/zlib/deflate/set_dictionary_spec_disabled.rb)
===================================================================
--- MacRuby/trunk/spec/frozen/library/zlib/deflate/set_dictionary_spec.rb	                        (rev 0)
+++ MacRuby/trunk/spec/frozen/library/zlib/deflate/set_dictionary_spec.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,14 @@
+require File.expand_path('../../../../spec_helper', __FILE__)
+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
+

Deleted: MacRuby/trunk/spec/frozen/library/zlib/deflate/set_dictionary_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/library/zlib/deflate/set_dictionary_spec_disabled.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/library/zlib/deflate/set_dictionary_spec_disabled.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,14 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-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
-

Modified: MacRuby/trunk/spec/frozen/shared/enumerator/next.rb
===================================================================
--- MacRuby/trunk/spec/frozen/shared/enumerator/next.rb	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/shared/enumerator/next.rb	2011-01-31 06:19:30 UTC (rev 5211)
@@ -17,12 +17,14 @@
     lambda { @enum.next }.should raise_error(StopIteration)
   end
 
-  it "cannot be called again until the enumerator is rewound" do
-    3.times { @enum.next }
-    lambda { @enum.next }.should raise_error(StopIteration)
-    lambda { @enum.next }.should raise_error(StopIteration)
-    lambda { @enum.next }.should raise_error(StopIteration)
-    @enum.rewind
-    @enum.next.should == 1
+  ruby_version_is "1.9" do
+    it "cannot be called again until the enumerator is rewound" do
+      3.times { @enum.next }
+      lambda { @enum.next }.should raise_error(StopIteration)
+      lambda { @enum.next }.should raise_error(StopIteration)
+      lambda { @enum.next }.should raise_error(StopIteration)
+      @enum.rewind
+      @enum.next.should == 1
+    end
   end
 end

Modified: MacRuby/trunk/spec/frozen/tags/macruby/core/array/pack/c_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/core/array/pack/c_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/core/array/pack/c_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,3 +2,4 @@
 fails:Array#pack with format 'C' encodes the least significant eight bits of a negative number
 fails:Array#pack with format 'c' encodes the least significant eight bits of a positive number
 fails:Array#pack with format 'c' encodes the least significant eight bits of a negative number
+fails:Array#pack with format 'c' calls #to_str to coerce the directives string

Modified: MacRuby/trunk/spec/frozen/tags/macruby/core/array/repeated_combination_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/core/array/repeated_combination_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/core/array/repeated_combination_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,3 +1,5 @@
+fails:Array#repeated_combination accepts sizes larger than the original array
+fails:Array#repeated_combination generates from a defensive copy, ignoring mutations
 fails:Array#repeated_combination returns an enumerator when no block is provided
 fails:Array#repeated_combination returns self when a block is given
 fails:Array#repeated_combination yields nothing for negative length and return self

Modified: MacRuby/trunk/spec/frozen/tags/macruby/core/array/repeated_permutation_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/core/array/repeated_permutation_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/core/array/repeated_permutation_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,3 +1,5 @@
+fails:Array#repeated_permutation allows permutations larger than the number of elements
+fails:Array#repeated_permutation generates from a defensive copy, ignoring mutations
 fails:Array#repeated_permutation returns an Enumerator of all repeated permutations of given length when called without a block
 fails:Array#repeated_permutation yields all repeated_permutations to the block then returns self when called with block but no arguments
 fails:Array#repeated_permutation yields the empty repeated_permutation ([[]]) when the given length is 0

Modified: MacRuby/trunk/spec/frozen/tags/macruby/core/encoding/find_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/core/encoding/find_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/core/encoding/find_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1 +1,5 @@
 fails:Encoding.find accepts any object as encoding name, if it responds to #to_str
+fails:Encoding.find returns default external encoding for the 'external' encoding alias
+fails:Encoding.find returns default internal encoding for the 'internal' encoding alias
+fails:Encoding.find uses default external encoding for the 'filesystem' encoding alias
+

Modified: MacRuby/trunk/spec/frozen/tags/macruby/core/file/open_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/core/file/open_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/core/file/open_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -7,3 +7,5 @@
 fails:File.open opens the file when call with fd
 fails:File.open opens a file with a file descriptor d and a block
 fails:File.open raises a SystemCallError if passed an invalid Integer type
+fails:File.open with a block invokes close on an opened file when exiting the block
+fails:File.open with a block does not propagate StandardErrors produced by close

Modified: MacRuby/trunk/spec/frozen/tags/macruby/core/fixnum/right_shift_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/core/fixnum/right_shift_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/core/fixnum/right_shift_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,2 +1,3 @@
+fails:Fixnum#>> with n >> m
 fails:Fixnum#>> with n >> m returns a Bignum == fixnum_max() * 2 when fixnum_max() >> -1 and n > 0
 fails:Fixnum#>> with n >> m returns a Bignum == fixnum_min() * 2 when fixnum_min() >> -1 and n < 0

Modified: MacRuby/trunk/spec/frozen/tags/macruby/core/float/fdiv_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/core/float/fdiv_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/core/float/fdiv_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1 +1,2 @@
 fails:Float#fdiv performs floating-point division between self and a Complex
+fails:Float#fdiv performs floating-point division between self and a Fixnum

Modified: MacRuby/trunk/spec/frozen/tags/macruby/core/kernel/String_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/core/kernel/String_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/core/kernel/String_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,3 +2,5 @@
 critical:Kernel#String raises a TypeError if #to_s is not defined, even though #respond_to?(:to_s) returns true
 fails:Kernel.String doesn't raise a TypeError even if respond_to? returns false for #to_s
 fails:Kernel#String doesn't raise a TypeError even if respond_to? returns false for #to_s
+fails:Kernel.String converts a constant to a String
+fails:Kernel#String converts a constant to a String

Modified: MacRuby/trunk/spec/frozen/tags/macruby/core/kernel/method_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/core/kernel/method_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/core/kernel/method_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,2 +1,3 @@
 fails:Kernel#method returns a method object if we repond_to_missing? method
 fails:Kernel#method can be called even if we only repond_to_missing? method, true
+fails:Kernel#method will see an alias of the original method as == when in a derived class

Modified: MacRuby/trunk/spec/frozen/tags/macruby/core/kernel/require_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/core/kernel/require_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/core/kernel/require_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,6 +2,8 @@
 fails:Kernel#require ($LOAD_FEATURES) does not load a ../ relative path that is already stored
 fails:Kernel#require ($LOAD_FEATURES) does not load a non-canonical path that is already stored
 fails:Kernel#require ($LOAD_FEATURES) does not load a non-canonical path for a file already loaded
+fails:Kernel#require ($LOAD_FEATURES) when a non-extensioned file is in $LOADED_FEATURES returns false if the file is not found
+fails:Kernel#require ($LOAD_FEATURES) when a non-extensioned file is in $LOADED_FEATURES returns false when passed a path and the file is not found
 fails:Kernel#require (shell expansion) performs tilde expansion on a .rb file before storing paths in $LOADED_FEATURES
 fails:Kernel#require (shell expansion) performs tilde expansion on a non-extensioned file before storing paths in $LOADED_FEATURES
 fails:Kernel.require ($LOAD_FEATURES) does not load a ./ relative path that is already stored
@@ -10,3 +12,5 @@
 fails:Kernel.require ($LOAD_FEATURES) does not load a non-canonical path for a file already loaded
 fails:Kernel.require (shell expansion) performs tilde expansion on a .rb file before storing paths in $LOADED_FEATURES
 fails:Kernel.require (shell expansion) performs tilde expansion on a non-extensioned file before storing paths in $LOADED_FEATURES
+fails:Kernel.require ($LOAD_FEATURES) when a non-extensioned file is in $LOADED_FEATURES returns false if the file is not found
+fails:Kernel.require ($LOAD_FEATURES) when a non-extensioned file is in $LOADED_FEATURES returns false when passed a path and the file is not found

Modified: MacRuby/trunk/spec/frozen/tags/macruby/core/marshal/dump_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/core/marshal/dump_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/core/marshal/dump_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -21,3 +21,5 @@
 fails:Marshal.dump dumps a Regexp
 fails:Marshal.dump dumps a Regexp subclass /i
 fails:Marshal.dump dumps a Random
+fails:Marshal.dump invokes respond_to? for marshal_dump and _dump on user classes
+fails:Marshal.dump attempts to invoke _dump if respond_to? :_dump is true

Modified: MacRuby/trunk/spec/frozen/tags/macruby/core/module/define_method_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/core/module/define_method_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/core/module/define_method_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -4,3 +4,4 @@
 fails:Module#define_method defines the given method as an instance method with the given name in self
 fails:Module#define_method calls #method_added after the method is added to the Module
 fails:Module#define_method accepts a Method (still bound)
+fails:Module#define_method supports being called with a splat

Modified: MacRuby/trunk/spec/frozen/tags/macruby/core/module/module_exec_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/core/module/module_exec_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/core/module/module_exec_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1 +1,2 @@
 fails:Module#class_exec defines method in the receiver's scope
+fails:Module#module_exec defines method in the receiver's scope

Modified: MacRuby/trunk/spec/frozen/tags/macruby/core/numeric/step_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/core/numeric/step_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/core/numeric/step_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -4,3 +4,10 @@
 fails:Numeric#step with [stop, -infinity] yields once if self > stop
 fails:Numeric#step with [stop, -infinity] yields once when self equals stop
 fails:Numeric#step with [stop, -infinity] does not yield when self > stop
+fails:Numeric#step Numeric#step with [stop, +Infinity] yields once if self < stop
+fails:Numeric#step Numeric#step with [stop, +Infinity] yields once when stop is Infinity
+fails:Numeric#step Numeric#step with [stop, +Infinity] yields once when self equals stop
+fails:Numeric#step Numeric#step with [stop, +Infinity] yields once when self and stop are Infinity
+fails:Numeric#step Numeric#step with [stop, +Infinity] does not yield when self > stop
+fails:Numeric#step Numeric#step with [stop, -infinity] yields once if stop is -Infinity
+fails:Numeric#step Numeric#step with [stop, -infinity] yields once when self and stop are Infinity

Modified: MacRuby/trunk/spec/frozen/tags/macruby/core/objectspace/define_finalizer_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/core/objectspace/define_finalizer_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/core/objectspace/define_finalizer_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,2 +1,3 @@
 fails:ObjectSpace.define_finalizer calls finalizer on process termination
 fails:ObjectSpace.define_finalizer calls finalizer at exit even if it is self-referencing
+fails:ObjectSpace.define_finalizer raises ArgumentError trying to define a finalizer on a non-reference

Modified: MacRuby/trunk/spec/frozen/tags/macruby/core/proc/parameters_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/core/proc/parameters_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/core/proc/parameters_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -8,3 +8,5 @@
 fails:Proc#parameters sets the first element of each sub-Array to :rest for parameters prefixed with asterisks
 fails:Proc#parameters sets the first element of each sub-Array to :block for parameters prefixed with ampersands
 fails:Proc#parameters sets the second element of each sub-Array to the name of the argument
+fails:Proc#parameters ignores unnamed rest args
+fails:Proc#parameters adds nameless rest arg for "star" argument

Modified: MacRuby/trunk/spec/frozen/tags/macruby/core/process/fork_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/core/process/fork_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/core/process/fork_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,3 @@
+fails:Process.fork is implemented
+fails:Process.fork return nil for the child process
+fails:Process.fork runs a block in a child process

Modified: MacRuby/trunk/spec/frozen/tags/macruby/core/string/scan_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/core/string/scan_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/core/string/scan_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,2 @@
+fails:String#scan taints the results if the String argument is tainted
+fails:String#scan with pattern and block taints the results if the String argument is tainted

Modified: MacRuby/trunk/spec/frozen/tags/macruby/core/string/split_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/core/string/split_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/core/string/split_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,2 +1,3 @@
 fails:String#split with String returns subclass instances based on self
 fails:String#split with Regexp returns subclass instances based on self
+fails:String#split with String ignores leading and continuous whitespace when string is a single space

Modified: MacRuby/trunk/spec/frozen/tags/macruby/core/string/tr_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/core/string/tr_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/core/string/tr_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,3 +1,5 @@
 fails:String#tr accepts c1-c2 notation to denote ranges of characters
 fails:String#tr translates chars not in from_string when it starts with a ^
 fails:String#tr can replace a 7-bit ASCII character with a multibyte one
+fails:String#tr treats a descending range in the replacement as containing just the start character
+fails:String#tr treats a descending range in the source as empty

Modified: MacRuby/trunk/spec/frozen/tags/macruby/core/unboundmethod/owner_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/core/unboundmethod/owner_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/core/unboundmethod/owner_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,2 +1,3 @@
 fails:UnboundMethod#owner returns the owner of the method
 fails:UnboundMethod#owner returns the class/module it was defined in
+fails:UnboundMethod#owner returns the name even when aliased

Modified: MacRuby/trunk/spec/frozen/tags/macruby/language/block_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/language/block_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/language/block_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1 +1,3 @@
+fails:A block with multiple arguments tries to use #to_ary to convert a single incoming value
+fails:A block with multiple arguments raises a TypeError if the #to_ary value isn't an Array
 fails:Block-local variables override shadowed variables from the outer scope

Modified: MacRuby/trunk/spec/frozen/tags/macruby/language/constants_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/language/constants_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/language/constants_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,3 +2,4 @@
 fails:Constant resolution within methods with statically assigned constants does not search the lexical scope of qualifying modules
 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 does not search the lexical scope of qualifying modules
+fails:Constant resolution within methods with dynamically assigned constants searches the lexical scope of a block

Modified: MacRuby/trunk/spec/frozen/tags/macruby/language/def_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/language/def_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/language/def_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1,2 +1,4 @@
 fails:A method definition in an eval creates an instance method
 fails:A method definition in an eval creates a class method
+fails:Defining an 'initialize_copy' method should make it private
+fails:The def keyword within a closure looks outside the closure for the visibility

Modified: MacRuby/trunk/spec/frozen/tags/macruby/language/predefined_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/language/predefined_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/language/predefined_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -2,3 +2,10 @@
 fails:Predefined global $_ is set at the method-scoped level rather than block-scoped
 fails:Execution variable $: does not include the current directory
 fails:Global variable $FILENAME is read-only
+fails:Processing RUBYOPT adds the -I path to $LOAD_PATH
+fails:Processing RUBYOPT sets $DEBUG to true for '-d'
+fails:Processing RUBYOPT sets $VERBOSE to true for '-w'
+fails:Processing RUBYOPT sets $VERBOSE to true for '-W'
+fails:Processing RUBYOPT sets $VERBOSE to nil for '-W0'
+fails:Processing RUBYOPT sets $VERBOSE to false for '-W1'
+fails:Processing RUBYOPT sets $VERBOSE to true for '-W2'

Modified: MacRuby/trunk/spec/frozen/tags/macruby/language/super_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/language/super_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/language/super_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1 +1,2 @@
 fails:The super keyword calls the superclass method when initial method is defined_method'd
+fails:The super keyword raises an error error when super method does not exist

Modified: MacRuby/trunk/spec/frozen/tags/macruby/library/socket/socket/getnameinfo_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/library/socket/socket/getnameinfo_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/library/socket/socket/getnameinfo_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1,2 @@
+fails:Socket.getnameinfo gets the name information and resolve the host
+fails:Socket.getnameinfo gets the name information and resolves the service

Modified: MacRuby/trunk/spec/frozen/tags/macruby/library/stringio/gets_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/library/stringio/gets_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/library/stringio/gets_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1 @@
+fails:StringIO#gets when passed [separator] accepts string as separator

Modified: MacRuby/trunk/spec/frozen/tags/macruby/library/stringio/puts_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/library/stringio/puts_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/library/stringio/puts_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -1 +1,2 @@
 critical:StringIO#puts when passed [Array, ...] handles self-recursive arrays correctly
+fails:StringIO#puts when passed 1 or more objects prints a newline when passed an empty string

Modified: MacRuby/trunk/spec/frozen/tags/macruby/library/stringscanner/scan_tags.txt
===================================================================
--- MacRuby/trunk/spec/frozen/tags/macruby/library/stringscanner/scan_tags.txt	2011-01-30 06:18:39 UTC (rev 5210)
+++ MacRuby/trunk/spec/frozen/tags/macruby/library/stringscanner/scan_tags.txt	2011-01-31 06:19:30 UTC (rev 5211)
@@ -0,0 +1 @@
+fails:StringScanner#scan raises a TypeError if pattern isn't a Regexp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20110130/dd05a806/attachment-0001.html>


More information about the macruby-changes mailing list