[macruby-changes] [3871] MacRuby/trunk/spec/frozen/core
source_changes at macosforge.org
source_changes at macosforge.org
Sun Mar 28 12:32:18 PDT 2010
Revision: 3871
http://trac.macosforge.org/projects/ruby/changeset/3871
Author: eloy.de.enige at gmail.com
Date: 2010-03-28 12:32:11 -0700 (Sun, 28 Mar 2010)
Log Message:
-----------
Update RubySpec to 1d137b699c813be4d9f1f2728d68b44ab52ec36a (part 1)
Modified Paths:
--------------
MacRuby/trunk/spec/frozen/core/argf/argf_spec.rb
MacRuby/trunk/spec/frozen/core/argf/binmode_spec.rb
MacRuby/trunk/spec/frozen/core/argf/bytes_spec.rb
MacRuby/trunk/spec/frozen/core/argf/chars_spec.rb
MacRuby/trunk/spec/frozen/core/argf/close_spec.rb
MacRuby/trunk/spec/frozen/core/argf/closed_spec.rb
MacRuby/trunk/spec/frozen/core/argf/each_byte_spec.rb
MacRuby/trunk/spec/frozen/core/argf/each_char_spec.rb
MacRuby/trunk/spec/frozen/core/argf/each_line_spec.rb
MacRuby/trunk/spec/frozen/core/argf/each_spec.rb
MacRuby/trunk/spec/frozen/core/argf/eof_spec.rb
MacRuby/trunk/spec/frozen/core/argf/file_spec.rb
MacRuby/trunk/spec/frozen/core/argf/filename_spec.rb
MacRuby/trunk/spec/frozen/core/argf/fileno_spec.rb
MacRuby/trunk/spec/frozen/core/argf/getc_spec.rb
MacRuby/trunk/spec/frozen/core/argf/gets_spec.rb
MacRuby/trunk/spec/frozen/core/argf/lineno_spec.rb
MacRuby/trunk/spec/frozen/core/argf/path_spec.rb
MacRuby/trunk/spec/frozen/core/argf/pos_spec.rb
MacRuby/trunk/spec/frozen/core/argf/read_spec.rb
MacRuby/trunk/spec/frozen/core/argf/readchar_spec.rb
MacRuby/trunk/spec/frozen/core/argf/readline_spec.rb
MacRuby/trunk/spec/frozen/core/argf/readlines_spec.rb
MacRuby/trunk/spec/frozen/core/argf/rewind_spec.rb
MacRuby/trunk/spec/frozen/core/argf/seek_spec.rb
MacRuby/trunk/spec/frozen/core/argf/shared/each_byte.rb
MacRuby/trunk/spec/frozen/core/argf/shared/each_char.rb
MacRuby/trunk/spec/frozen/core/argf/shared/each_line.rb
MacRuby/trunk/spec/frozen/core/argf/shared/gets.rb
MacRuby/trunk/spec/frozen/core/argf/skip_spec.rb
MacRuby/trunk/spec/frozen/core/argf/tell_spec.rb
MacRuby/trunk/spec/frozen/core/argf/to_a_spec.rb
MacRuby/trunk/spec/frozen/core/argf/to_i_spec.rb
MacRuby/trunk/spec/frozen/core/argf/to_io_spec.rb
MacRuby/trunk/spec/frozen/core/argf/to_s_spec.rb
MacRuby/trunk/spec/frozen/core/array/allocate_spec.rb
MacRuby/trunk/spec/frozen/core/array/append_spec.rb
MacRuby/trunk/spec/frozen/core/array/array_spec.rb
MacRuby/trunk/spec/frozen/core/array/assoc_spec.rb
MacRuby/trunk/spec/frozen/core/array/at_spec.rb
MacRuby/trunk/spec/frozen/core/array/choice_spec.rb
MacRuby/trunk/spec/frozen/core/array/clear_spec.rb
MacRuby/trunk/spec/frozen/core/array/clone_spec.rb
MacRuby/trunk/spec/frozen/core/array/collect_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/comparison_spec.rb
MacRuby/trunk/spec/frozen/core/array/concat_spec.rb
MacRuby/trunk/spec/frozen/core/array/constructor_spec.rb
MacRuby/trunk/spec/frozen/core/array/delete_at_spec.rb
MacRuby/trunk/spec/frozen/core/array/delete_if_spec.rb
MacRuby/trunk/spec/frozen/core/array/delete_spec.rb
MacRuby/trunk/spec/frozen/core/array/dup_spec.rb
MacRuby/trunk/spec/frozen/core/array/each_index_spec.rb
MacRuby/trunk/spec/frozen/core/array/each_spec.rb
MacRuby/trunk/spec/frozen/core/array/element_reference_spec.rb
MacRuby/trunk/spec/frozen/core/array/element_set_spec.rb
MacRuby/trunk/spec/frozen/core/array/empty_spec.rb
MacRuby/trunk/spec/frozen/core/array/eql_spec.rb
MacRuby/trunk/spec/frozen/core/array/equal_value_spec.rb
MacRuby/trunk/spec/frozen/core/array/fetch_spec.rb
MacRuby/trunk/spec/frozen/core/array/fill_spec.rb
MacRuby/trunk/spec/frozen/core/array/first_spec.rb
MacRuby/trunk/spec/frozen/core/array/flatten_spec.rb
MacRuby/trunk/spec/frozen/core/array/frozen_spec.rb
MacRuby/trunk/spec/frozen/core/array/hash_spec.rb
MacRuby/trunk/spec/frozen/core/array/include_spec.rb
MacRuby/trunk/spec/frozen/core/array/index_spec.rb
MacRuby/trunk/spec/frozen/core/array/indexes_spec.rb
MacRuby/trunk/spec/frozen/core/array/indices_spec.rb
MacRuby/trunk/spec/frozen/core/array/initialize_copy_spec.rb
MacRuby/trunk/spec/frozen/core/array/initialize_spec.rb
MacRuby/trunk/spec/frozen/core/array/insert_spec.rb
MacRuby/trunk/spec/frozen/core/array/inspect_spec.rb
MacRuby/trunk/spec/frozen/core/array/intersection_spec.rb
MacRuby/trunk/spec/frozen/core/array/join_spec.rb
MacRuby/trunk/spec/frozen/core/array/last_spec.rb
MacRuby/trunk/spec/frozen/core/array/length_spec.rb
MacRuby/trunk/spec/frozen/core/array/map_spec.rb
MacRuby/trunk/spec/frozen/core/array/minus_spec.rb
MacRuby/trunk/spec/frozen/core/array/multiply_spec.rb
MacRuby/trunk/spec/frozen/core/array/new_spec.rb
MacRuby/trunk/spec/frozen/core/array/nitems_spec.rb
MacRuby/trunk/spec/frozen/core/array/pack_spec.rb
MacRuby/trunk/spec/frozen/core/array/partition_spec.rb
MacRuby/trunk/spec/frozen/core/array/permutation_spec.rb
MacRuby/trunk/spec/frozen/core/array/plus_spec.rb
MacRuby/trunk/spec/frozen/core/array/pop_spec.rb
MacRuby/trunk/spec/frozen/core/array/product_spec.rb
MacRuby/trunk/spec/frozen/core/array/push_spec.rb
MacRuby/trunk/spec/frozen/core/array/rassoc_spec.rb
MacRuby/trunk/spec/frozen/core/array/reject_spec.rb
MacRuby/trunk/spec/frozen/core/array/replace_spec.rb
MacRuby/trunk/spec/frozen/core/array/reverse_each_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/sample_spec.rb
MacRuby/trunk/spec/frozen/core/array/select_spec.rb
MacRuby/trunk/spec/frozen/core/array/shared/collect.rb
MacRuby/trunk/spec/frozen/core/array/shared/enumeratorize.rb
MacRuby/trunk/spec/frozen/core/array/shift_spec.rb
MacRuby/trunk/spec/frozen/core/array/shuffle_spec.rb
MacRuby/trunk/spec/frozen/core/array/size_spec.rb
MacRuby/trunk/spec/frozen/core/array/slice_spec.rb
MacRuby/trunk/spec/frozen/core/array/sort_by_spec.rb
MacRuby/trunk/spec/frozen/core/array/sort_spec.rb
MacRuby/trunk/spec/frozen/core/array/to_a_spec.rb
MacRuby/trunk/spec/frozen/core/array/to_ary_spec.rb
MacRuby/trunk/spec/frozen/core/array/to_s_spec.rb
MacRuby/trunk/spec/frozen/core/array/transpose_spec.rb
MacRuby/trunk/spec/frozen/core/array/try_convert_spec.rb
MacRuby/trunk/spec/frozen/core/array/union_spec.rb
MacRuby/trunk/spec/frozen/core/array/uniq_spec.rb
MacRuby/trunk/spec/frozen/core/array/unshift_spec.rb
MacRuby/trunk/spec/frozen/core/array/values_at_spec.rb
MacRuby/trunk/spec/frozen/core/array/zip_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/remove_method_missing.rb
MacRuby/trunk/spec/frozen/core/basicobject/singleton_method_added_spec.rb
MacRuby/trunk/spec/frozen/core/basicobject/singleton_method_removed_spec.rb
MacRuby/trunk/spec/frozen/core/basicobject/singleton_method_undefined_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/abs_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/bit_and_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/bit_or_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/bit_xor_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/coerce_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/comparison_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/complement_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/div_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/divide_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/divmod_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/element_reference_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/eql_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/equal_value_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/even_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/exponent_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/gt_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/gte_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/hash_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/left_shift_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/lt_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/lte_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/minus_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/modulo_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/multiply_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/odd_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/plus_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/quo_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/remainder_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/right_shift_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/size_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/to_f_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/to_s_spec.rb
MacRuby/trunk/spec/frozen/core/bignum/uminus_spec.rb
MacRuby/trunk/spec/frozen/core/binding/clone_spec.rb
MacRuby/trunk/spec/frozen/core/binding/dup_spec.rb
MacRuby/trunk/spec/frozen/core/binding/eval_spec.rb
MacRuby/trunk/spec/frozen/core/builtin_constants/builtin_constants_spec.rb
MacRuby/trunk/spec/frozen/core/class/allocate_spec.rb
MacRuby/trunk/spec/frozen/core/class/inherited_spec.rb
MacRuby/trunk/spec/frozen/core/class/initialize_copy_spec.rb
MacRuby/trunk/spec/frozen/core/class/initialize_spec.rb
MacRuby/trunk/spec/frozen/core/class/new_spec.rb
MacRuby/trunk/spec/frozen/core/class/superclass_spec.rb
MacRuby/trunk/spec/frozen/core/comparable/between_spec.rb
MacRuby/trunk/spec/frozen/core/comparable/equal_value_spec.rb
MacRuby/trunk/spec/frozen/core/comparable/gt_spec.rb
MacRuby/trunk/spec/frozen/core/comparable/gte_spec.rb
MacRuby/trunk/spec/frozen/core/comparable/lt_spec.rb
MacRuby/trunk/spec/frozen/core/comparable/lte_spec.rb
MacRuby/trunk/spec/frozen/core/complex/Complex_spec.rb
MacRuby/trunk/spec/frozen/core/complex/abs2_spec.rb
MacRuby/trunk/spec/frozen/core/complex/abs_spec.rb
MacRuby/trunk/spec/frozen/core/complex/angle_spec.rb
MacRuby/trunk/spec/frozen/core/complex/arg_spec.rb
MacRuby/trunk/spec/frozen/core/complex/coerce_spec.rb
MacRuby/trunk/spec/frozen/core/complex/conj_spec.rb
MacRuby/trunk/spec/frozen/core/complex/conjugate_spec.rb
MacRuby/trunk/spec/frozen/core/complex/denominator_spec.rb
MacRuby/trunk/spec/frozen/core/complex/divide_spec.rb
MacRuby/trunk/spec/frozen/core/complex/equal_value_spec.rb
MacRuby/trunk/spec/frozen/core/complex/exponent_spec.rb
MacRuby/trunk/spec/frozen/core/complex/fdiv_spec.rb
MacRuby/trunk/spec/frozen/core/complex/hash_spec.rb
MacRuby/trunk/spec/frozen/core/complex/imag_spec.rb
MacRuby/trunk/spec/frozen/core/complex/inspect_spec.rb
MacRuby/trunk/spec/frozen/core/complex/minus_spec.rb
MacRuby/trunk/spec/frozen/core/complex/multiply_spec.rb
MacRuby/trunk/spec/frozen/core/complex/numerator_spec.rb
MacRuby/trunk/spec/frozen/core/complex/plus_spec.rb
MacRuby/trunk/spec/frozen/core/complex/polar_spec.rb
MacRuby/trunk/spec/frozen/core/complex/rationalize_spec.rb
MacRuby/trunk/spec/frozen/core/complex/real_spec.rb
MacRuby/trunk/spec/frozen/core/complex/rect_spec.rb
MacRuby/trunk/spec/frozen/core/complex/rectangular_spec.rb
MacRuby/trunk/spec/frozen/core/complex/to_s_spec.rb
MacRuby/trunk/spec/frozen/core/continuation/call_spec.rb
MacRuby/trunk/spec/frozen/core/continuation/element_reference_spec.rb
MacRuby/trunk/spec/frozen/core/dir/chdir_spec.rb
MacRuby/trunk/spec/frozen/core/dir/chroot_spec.rb
MacRuby/trunk/spec/frozen/core/dir/close_spec.rb
MacRuby/trunk/spec/frozen/core/dir/delete_spec.rb
MacRuby/trunk/spec/frozen/core/dir/dir_spec.rb
MacRuby/trunk/spec/frozen/core/dir/each_spec.rb
MacRuby/trunk/spec/frozen/core/dir/element_reference_spec.rb
MacRuby/trunk/spec/frozen/core/dir/entries_spec.rb
MacRuby/trunk/spec/frozen/core/dir/exist_spec.rb
MacRuby/trunk/spec/frozen/core/dir/exists_spec.rb
MacRuby/trunk/spec/frozen/core/dir/foreach_spec.rb
MacRuby/trunk/spec/frozen/core/dir/getwd_spec.rb
MacRuby/trunk/spec/frozen/core/dir/glob_spec.rb
MacRuby/trunk/spec/frozen/core/dir/home_spec.rb
MacRuby/trunk/spec/frozen/core/dir/inspect_spec.rb
MacRuby/trunk/spec/frozen/core/dir/mkdir_spec.rb
MacRuby/trunk/spec/frozen/core/dir/new_spec.rb
MacRuby/trunk/spec/frozen/core/dir/open_spec.rb
MacRuby/trunk/spec/frozen/core/dir/path_spec.rb
MacRuby/trunk/spec/frozen/core/dir/pos_spec.rb
MacRuby/trunk/spec/frozen/core/dir/pwd_spec.rb
MacRuby/trunk/spec/frozen/core/dir/read_spec.rb
MacRuby/trunk/spec/frozen/core/dir/rewind_spec.rb
MacRuby/trunk/spec/frozen/core/dir/rmdir_spec.rb
MacRuby/trunk/spec/frozen/core/dir/seek_spec.rb
MacRuby/trunk/spec/frozen/core/dir/shared/delete.rb
MacRuby/trunk/spec/frozen/core/dir/shared/path.rb
MacRuby/trunk/spec/frozen/core/dir/tell_spec.rb
MacRuby/trunk/spec/frozen/core/dir/to_path.rb
MacRuby/trunk/spec/frozen/core/dir/unlink_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/aliases_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/ascii_compatible_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/compatible_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/converter/asciicompat_encoding_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/converter/constants_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/converter/convert_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/converter/convpath_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/converter/destination_encoding_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/converter/finish_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/converter/last_error_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/converter/primitive_convert_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/converter/primitive_errinfo_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/converter/putback_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/converter/replacement_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/converter/search_convpath_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/converter/source_encoding_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/default_external_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/default_internal_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/dummy_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/find_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/inspect_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/destination_encoding_name_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/destination_encoding_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/error_bytes_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/incomplete_input_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/readagain_bytes_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/source_encoding_name_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/source_encoding_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/list_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/locale_charmap_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/name_list_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/name_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/names_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/replicate_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/shared/name.rb
MacRuby/trunk/spec/frozen/core/encoding/to_s_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/undefined_conversion_error/destination_encoding_name_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/undefined_conversion_error/destination_encoding_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/undefined_conversion_error/error_char_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/undefined_conversion_error/source_encoding_name_spec.rb
MacRuby/trunk/spec/frozen/core/encoding/undefined_conversion_error/source_encoding_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/all_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/any_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/chunk_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/collect_concat_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/collect_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/count_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/cycle_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/detect_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/drop_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/drop_while_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/each_cons_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/each_slice_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/each_with_index_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/each_with_object_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/entries_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/find_all_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/find_index_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/find_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/first_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/flat_map_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/grep_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/group_by_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/include_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/inject_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/join_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/map_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/max_by_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/max_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/member_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/min_by_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/min_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/minmax_by_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/minmax_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/none_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/one_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/partition_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/reduce_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/reject_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/reverse_each_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/select_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/shared/collect.rb
MacRuby/trunk/spec/frozen/core/enumerable/shared/collect_concat.rb
MacRuby/trunk/spec/frozen/core/enumerable/shared/find.rb
MacRuby/trunk/spec/frozen/core/enumerable/shared/find_all.rb
MacRuby/trunk/spec/frozen/core/enumerable/sort_by_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/sort_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/take_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/take_while_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/to_a_spec.rb
MacRuby/trunk/spec/frozen/core/enumerable/zip_spec.rb
MacRuby/trunk/spec/frozen/core/enumerator/each_spec.rb
MacRuby/trunk/spec/frozen/core/enumerator/each_with_index_spec.rb
MacRuby/trunk/spec/frozen/core/enumerator/each_with_object_spec.rb
MacRuby/trunk/spec/frozen/core/enumerator/enum_for_spec.rb
MacRuby/trunk/spec/frozen/core/enumerator/new_spec.rb
MacRuby/trunk/spec/frozen/core/enumerator/next_spec.rb
MacRuby/trunk/spec/frozen/core/enumerator/peek_spec.rb
MacRuby/trunk/spec/frozen/core/enumerator/rewind_spec.rb
MacRuby/trunk/spec/frozen/core/enumerator/to_enum_spec.rb
MacRuby/trunk/spec/frozen/core/enumerator/with_index_spec.rb
MacRuby/trunk/spec/frozen/core/enumerator/with_object_spec.rb
MacRuby/trunk/spec/frozen/core/env/clear_spec.rb
MacRuby/trunk/spec/frozen/core/env/delete_if_spec.rb
MacRuby/trunk/spec/frozen/core/env/delete_spec.rb
MacRuby/trunk/spec/frozen/core/env/each_key_spec.rb
MacRuby/trunk/spec/frozen/core/env/each_pair_spec.rb
MacRuby/trunk/spec/frozen/core/env/each_spec.rb
MacRuby/trunk/spec/frozen/core/env/each_value_spec.rb
MacRuby/trunk/spec/frozen/core/env/element_reference_spec.rb
MacRuby/trunk/spec/frozen/core/env/element_set_spec.rb
MacRuby/trunk/spec/frozen/core/env/empty_spec.rb
MacRuby/trunk/spec/frozen/core/env/fetch_spec.rb
MacRuby/trunk/spec/frozen/core/env/has_key_spec.rb
MacRuby/trunk/spec/frozen/core/env/has_value_spec.rb
MacRuby/trunk/spec/frozen/core/env/include_spec.rb
MacRuby/trunk/spec/frozen/core/env/index_spec.rb
MacRuby/trunk/spec/frozen/core/env/indexes_spec.rb
MacRuby/trunk/spec/frozen/core/env/indices_spec.rb
MacRuby/trunk/spec/frozen/core/env/inspect_spec.rb
MacRuby/trunk/spec/frozen/core/env/invert_spec.rb
MacRuby/trunk/spec/frozen/core/env/key_spec.rb
MacRuby/trunk/spec/frozen/core/env/keys_spec.rb
MacRuby/trunk/spec/frozen/core/env/length_spec.rb
MacRuby/trunk/spec/frozen/core/env/member_spec.rb
MacRuby/trunk/spec/frozen/core/env/rehash_spec.rb
MacRuby/trunk/spec/frozen/core/env/reject_spec.rb
MacRuby/trunk/spec/frozen/core/env/replace_spec.rb
MacRuby/trunk/spec/frozen/core/env/select_spec.rb
MacRuby/trunk/spec/frozen/core/env/shared/each.rb
MacRuby/trunk/spec/frozen/core/env/shift_spec.rb
MacRuby/trunk/spec/frozen/core/env/size_spec.rb
MacRuby/trunk/spec/frozen/core/env/store_spec.rb
MacRuby/trunk/spec/frozen/core/env/to_a_spec.rb
MacRuby/trunk/spec/frozen/core/env/to_hash_spec.rb
MacRuby/trunk/spec/frozen/core/env/to_s_spec.rb
MacRuby/trunk/spec/frozen/core/env/update_spec.rb
MacRuby/trunk/spec/frozen/core/env/value_spec.rb
MacRuby/trunk/spec/frozen/core/env/values_at_spec.rb
MacRuby/trunk/spec/frozen/core/env/values_spec.rb
MacRuby/trunk/spec/frozen/core/exception/arguments_spec.rb
MacRuby/trunk/spec/frozen/core/exception/backtrace_spec.rb
MacRuby/trunk/spec/frozen/core/exception/case_compare_spec.rb
MacRuby/trunk/spec/frozen/core/exception/equal_value_spec.rb
MacRuby/trunk/spec/frozen/core/exception/errno_spec.rb
MacRuby/trunk/spec/frozen/core/exception/exception_spec.rb
MacRuby/trunk/spec/frozen/core/exception/exit_value_spec.rb
MacRuby/trunk/spec/frozen/core/exception/initialize_spec.rb
MacRuby/trunk/spec/frozen/core/exception/inspect_spec.rb
MacRuby/trunk/spec/frozen/core/exception/io_error_spec.rb
MacRuby/trunk/spec/frozen/core/exception/message_spec.rb
MacRuby/trunk/spec/frozen/core/exception/name_error_spec.rb
MacRuby/trunk/spec/frozen/core/exception/name_spec.rb
MacRuby/trunk/spec/frozen/core/exception/new_spec.rb
MacRuby/trunk/spec/frozen/core/exception/no_method_error_spec.rb
MacRuby/trunk/spec/frozen/core/exception/range_error_spec.rb
MacRuby/trunk/spec/frozen/core/exception/script_error_spec.rb
MacRuby/trunk/spec/frozen/core/exception/set_backtrace_spec.rb
MacRuby/trunk/spec/frozen/core/exception/shared/to_s.rb
MacRuby/trunk/spec/frozen/core/exception/standard_error_spec.rb
MacRuby/trunk/spec/frozen/core/exception/system_call_error_spec.rb
MacRuby/trunk/spec/frozen/core/exception/to_s_spec.rb
MacRuby/trunk/spec/frozen/core/exception/to_str_spec.rb
MacRuby/trunk/spec/frozen/core/false/and_spec.rb
MacRuby/trunk/spec/frozen/core/false/inspect_spec.rb
MacRuby/trunk/spec/frozen/core/false/or_spec.rb
MacRuby/trunk/spec/frozen/core/false/to_s_spec.rb
MacRuby/trunk/spec/frozen/core/false/xor_spec.rb
MacRuby/trunk/spec/frozen/core/fiber/new_spec_disabled.rb
MacRuby/trunk/spec/frozen/core/fiber/resume_spec_disabled.rb
MacRuby/trunk/spec/frozen/core/fiber/yield_spec_disabled.rb
MacRuby/trunk/spec/frozen/core/file/absolute_path_spec.rb
MacRuby/trunk/spec/frozen/core/file/atime_spec.rb
MacRuby/trunk/spec/frozen/core/file/basename_spec.rb
MacRuby/trunk/spec/frozen/core/file/blockdev_spec.rb
MacRuby/trunk/spec/frozen/core/file/chardev_spec.rb
MacRuby/trunk/spec/frozen/core/file/chmod_spec.rb
MacRuby/trunk/spec/frozen/core/file/chown_spec.rb
MacRuby/trunk/spec/frozen/core/file/constants/constants_spec.rb
MacRuby/trunk/spec/frozen/core/file/constants_spec.rb
MacRuby/trunk/spec/frozen/core/file/ctime_spec.rb
MacRuby/trunk/spec/frozen/core/file/delete_spec.rb
MacRuby/trunk/spec/frozen/core/file/directory_spec.rb
MacRuby/trunk/spec/frozen/core/file/dirname_spec.rb
MacRuby/trunk/spec/frozen/core/file/executable_real_spec.rb
MacRuby/trunk/spec/frozen/core/file/executable_spec.rb
MacRuby/trunk/spec/frozen/core/file/exist_spec.rb
MacRuby/trunk/spec/frozen/core/file/exists_spec.rb
MacRuby/trunk/spec/frozen/core/file/expand_path_spec.rb
MacRuby/trunk/spec/frozen/core/file/extname_spec.rb
MacRuby/trunk/spec/frozen/core/file/file_spec.rb
MacRuby/trunk/spec/frozen/core/file/flock_spec.rb
MacRuby/trunk/spec/frozen/core/file/fnmatch_spec.rb
MacRuby/trunk/spec/frozen/core/file/grpowned_spec.rb
MacRuby/trunk/spec/frozen/core/file/identical_spec.rb
MacRuby/trunk/spec/frozen/core/file/initialize_spec.rb
MacRuby/trunk/spec/frozen/core/file/inspect_spec.rb
MacRuby/trunk/spec/frozen/core/file/join_spec.rb
MacRuby/trunk/spec/frozen/core/file/lchmod_spec.rb
MacRuby/trunk/spec/frozen/core/file/lchown_spec.rb
MacRuby/trunk/spec/frozen/core/file/link_spec.rb
MacRuby/trunk/spec/frozen/core/file/lstat_spec.rb
MacRuby/trunk/spec/frozen/core/file/mtime_spec.rb
MacRuby/trunk/spec/frozen/core/file/new_spec.rb
MacRuby/trunk/spec/frozen/core/file/open_spec.rb
MacRuby/trunk/spec/frozen/core/file/owned_spec.rb
MacRuby/trunk/spec/frozen/core/file/path_spec.rb
MacRuby/trunk/spec/frozen/core/file/pipe_spec.rb
MacRuby/trunk/spec/frozen/core/file/readable_real_spec.rb
MacRuby/trunk/spec/frozen/core/file/readable_spec.rb
MacRuby/trunk/spec/frozen/core/file/readlink_spec.rb
MacRuby/trunk/spec/frozen/core/file/rename_spec.rb
MacRuby/trunk/spec/frozen/core/file/reopen_spec.rb
MacRuby/trunk/spec/frozen/core/file/setgid_spec.rb
MacRuby/trunk/spec/frozen/core/file/setuid_spec.rb
MacRuby/trunk/spec/frozen/core/file/shared/fnmatch.rb
MacRuby/trunk/spec/frozen/core/file/shared/open.rb
MacRuby/trunk/spec/frozen/core/file/size_spec.rb
MacRuby/trunk/spec/frozen/core/file/socket_spec.rb
MacRuby/trunk/spec/frozen/core/file/split_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/atime_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/blksize_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/blockdev_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/blocks_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/chardev_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/comparison_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/ctime_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/dev_major_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/dev_minor_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/dev_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/directory_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/executable_real_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/executable_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/file_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/gid_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/grpowned_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/ino_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/inspect_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/mode_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/mtime_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/new_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/nlink_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/owned_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/pipe_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/rdev_major_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/rdev_minor_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/rdev_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/readable_real_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/readable_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/setgid_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/setuid_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/size_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/socket_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/sticky_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/symlink_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/uid_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/world_readable_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/world_writable_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/writable_real_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/writable_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat/zero_spec.rb
MacRuby/trunk/spec/frozen/core/file/stat_spec.rb
MacRuby/trunk/spec/frozen/core/file/sticky_spec.rb
MacRuby/trunk/spec/frozen/core/file/symlink_spec.rb
MacRuby/trunk/spec/frozen/core/file/to_path_spec.rb
MacRuby/trunk/spec/frozen/core/file/truncate_spec.rb
MacRuby/trunk/spec/frozen/core/file/umask_spec.rb
MacRuby/trunk/spec/frozen/core/file/unlink_spec.rb
MacRuby/trunk/spec/frozen/core/file/utime_spec.rb
MacRuby/trunk/spec/frozen/core/file/world_readable_spec.rb
MacRuby/trunk/spec/frozen/core/file/world_writable_spec.rb
MacRuby/trunk/spec/frozen/core/file/writable_real_spec.rb
MacRuby/trunk/spec/frozen/core/file/writable_spec.rb
MacRuby/trunk/spec/frozen/core/file/zero_spec.rb
MacRuby/trunk/spec/frozen/core/filetest/blockdev_spec.rb
MacRuby/trunk/spec/frozen/core/filetest/chardev_spec.rb
MacRuby/trunk/spec/frozen/core/filetest/directory_spec.rb
MacRuby/trunk/spec/frozen/core/filetest/executable_real_spec.rb
MacRuby/trunk/spec/frozen/core/filetest/executable_spec.rb
MacRuby/trunk/spec/frozen/core/filetest/exist_spec.rb
MacRuby/trunk/spec/frozen/core/filetest/exists_spec.rb
MacRuby/trunk/spec/frozen/core/filetest/file_spec.rb
MacRuby/trunk/spec/frozen/core/filetest/grpowned_spec.rb
MacRuby/trunk/spec/frozen/core/filetest/identical_spec.rb
MacRuby/trunk/spec/frozen/core/filetest/owned_spec.rb
MacRuby/trunk/spec/frozen/core/filetest/pipe_spec.rb
MacRuby/trunk/spec/frozen/core/filetest/readable_real_spec.rb
MacRuby/trunk/spec/frozen/core/filetest/readable_spec.rb
MacRuby/trunk/spec/frozen/core/filetest/setgid_spec.rb
MacRuby/trunk/spec/frozen/core/filetest/setuid_spec.rb
MacRuby/trunk/spec/frozen/core/filetest/size_spec.rb
MacRuby/trunk/spec/frozen/core/filetest/socket_spec.rb
MacRuby/trunk/spec/frozen/core/filetest/sticky_spec.rb
MacRuby/trunk/spec/frozen/core/filetest/symlink_spec.rb
MacRuby/trunk/spec/frozen/core/filetest/writable_real_spec.rb
MacRuby/trunk/spec/frozen/core/filetest/writable_spec.rb
MacRuby/trunk/spec/frozen/core/filetest/zero_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/abs_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/bit_and_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/bit_or_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/bit_xor_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/coerce_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/comparison_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/complement_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/div_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/divide_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/divmod_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/element_reference_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/equal_value_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/exponent_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/gt_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/gte_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/hash_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/id2name_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/induced_from_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/left_shift_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/lt_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/lte_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/minus_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/modulo_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/multiply_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/plus_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/quo_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/right_shift_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/size_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/to_f_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/to_s_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/to_sym_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/uminus_spec.rb
MacRuby/trunk/spec/frozen/core/fixnum/zero_spec.rb
MacRuby/trunk/spec/frozen/core/float/abs_spec.rb
MacRuby/trunk/spec/frozen/core/float/ceil_spec.rb
MacRuby/trunk/spec/frozen/core/float/coerce_spec.rb
MacRuby/trunk/spec/frozen/core/float/comparison_spec.rb
MacRuby/trunk/spec/frozen/core/float/constants_spec.rb
MacRuby/trunk/spec/frozen/core/float/denominator_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/eql_spec.rb
MacRuby/trunk/spec/frozen/core/float/equal_value_spec.rb
MacRuby/trunk/spec/frozen/core/float/exponent_spec.rb
MacRuby/trunk/spec/frozen/core/float/fdiv_spec.rb
MacRuby/trunk/spec/frozen/core/float/finite_spec.rb
MacRuby/trunk/spec/frozen/core/float/floor_spec.rb
MacRuby/trunk/spec/frozen/core/float/gt_spec.rb
MacRuby/trunk/spec/frozen/core/float/gte_spec.rb
MacRuby/trunk/spec/frozen/core/float/hash_spec.rb
MacRuby/trunk/spec/frozen/core/float/induced_from_spec.rb
MacRuby/trunk/spec/frozen/core/float/infinite_spec.rb
MacRuby/trunk/spec/frozen/core/float/lt_spec.rb
MacRuby/trunk/spec/frozen/core/float/lte_spec.rb
MacRuby/trunk/spec/frozen/core/float/magnitude_spec.rb
MacRuby/trunk/spec/frozen/core/float/minus_spec.rb
MacRuby/trunk/spec/frozen/core/float/modulo_spec.rb
MacRuby/trunk/spec/frozen/core/float/multiply_spec.rb
MacRuby/trunk/spec/frozen/core/float/nan_spec.rb
MacRuby/trunk/spec/frozen/core/float/numerator_spec.rb
MacRuby/trunk/spec/frozen/core/float/plus_spec.rb
MacRuby/trunk/spec/frozen/core/float/rationalize_spec.rb
MacRuby/trunk/spec/frozen/core/float/round_spec.rb
MacRuby/trunk/spec/frozen/core/float/shared/abs.rb
MacRuby/trunk/spec/frozen/core/float/to_f_spec.rb
MacRuby/trunk/spec/frozen/core/float/to_i_spec.rb
MacRuby/trunk/spec/frozen/core/float/to_int_spec.rb
MacRuby/trunk/spec/frozen/core/float/to_s_spec.rb
MacRuby/trunk/spec/frozen/core/float/truncate_spec.rb
MacRuby/trunk/spec/frozen/core/float/uminus_spec.rb
MacRuby/trunk/spec/frozen/core/float/uplus_spec.rb
MacRuby/trunk/spec/frozen/core/float/zero_spec.rb
MacRuby/trunk/spec/frozen/core/gc/disable_spec.rb
MacRuby/trunk/spec/frozen/core/gc/enable_spec.rb
MacRuby/trunk/spec/frozen/core/gc/garbage_collect_spec.rb
MacRuby/trunk/spec/frozen/core/gc/start_spec.rb
MacRuby/trunk/spec/frozen/core/gc/stress_spec.rb
MacRuby/trunk/spec/frozen/core/hash/allocate_spec.rb
MacRuby/trunk/spec/frozen/core/hash/assoc_spec.rb
MacRuby/trunk/spec/frozen/core/hash/clear_spec.rb
MacRuby/trunk/spec/frozen/core/hash/clone_spec.rb
MacRuby/trunk/spec/frozen/core/hash/constructor_spec.rb
MacRuby/trunk/spec/frozen/core/hash/default_proc_spec.rb
MacRuby/trunk/spec/frozen/core/hash/default_spec.rb
MacRuby/trunk/spec/frozen/core/hash/delete_if_spec.rb
MacRuby/trunk/spec/frozen/core/hash/delete_spec.rb
MacRuby/trunk/spec/frozen/core/hash/each_key_spec.rb
MacRuby/trunk/spec/frozen/core/hash/each_pair_spec.rb
MacRuby/trunk/spec/frozen/core/hash/each_spec.rb
MacRuby/trunk/spec/frozen/core/hash/each_value_spec.rb
MacRuby/trunk/spec/frozen/core/hash/element_reference_spec.rb
MacRuby/trunk/spec/frozen/core/hash/element_set_spec.rb
MacRuby/trunk/spec/frozen/core/hash/empty_spec.rb
MacRuby/trunk/spec/frozen/core/hash/eql_spec.rb
MacRuby/trunk/spec/frozen/core/hash/equal_value_spec.rb
MacRuby/trunk/spec/frozen/core/hash/fetch_spec.rb
MacRuby/trunk/spec/frozen/core/hash/flatten_spec.rb
MacRuby/trunk/spec/frozen/core/hash/has_key_spec.rb
MacRuby/trunk/spec/frozen/core/hash/has_value_spec.rb
MacRuby/trunk/spec/frozen/core/hash/hash_spec.rb
MacRuby/trunk/spec/frozen/core/hash/include_spec.rb
MacRuby/trunk/spec/frozen/core/hash/index_spec.rb
MacRuby/trunk/spec/frozen/core/hash/indexes_spec.rb
MacRuby/trunk/spec/frozen/core/hash/indices_spec.rb
MacRuby/trunk/spec/frozen/core/hash/initialize_copy_spec.rb
MacRuby/trunk/spec/frozen/core/hash/initialize_spec.rb
MacRuby/trunk/spec/frozen/core/hash/inspect_spec.rb
MacRuby/trunk/spec/frozen/core/hash/invert_spec.rb
MacRuby/trunk/spec/frozen/core/hash/key_spec.rb
MacRuby/trunk/spec/frozen/core/hash/keys_spec.rb
MacRuby/trunk/spec/frozen/core/hash/length_spec.rb
MacRuby/trunk/spec/frozen/core/hash/member_spec.rb
MacRuby/trunk/spec/frozen/core/hash/merge_spec.rb
MacRuby/trunk/spec/frozen/core/hash/new_spec.rb
MacRuby/trunk/spec/frozen/core/hash/rassoc_spec.rb
MacRuby/trunk/spec/frozen/core/hash/rehash_spec.rb
MacRuby/trunk/spec/frozen/core/hash/reject_spec.rb
MacRuby/trunk/spec/frozen/core/hash/replace_spec.rb
MacRuby/trunk/spec/frozen/core/hash/select_spec.rb
MacRuby/trunk/spec/frozen/core/hash/shared/index.rb
MacRuby/trunk/spec/frozen/core/hash/shared/iteration.rb
MacRuby/trunk/spec/frozen/core/hash/shared/replace.rb
MacRuby/trunk/spec/frozen/core/hash/shared/store.rb
MacRuby/trunk/spec/frozen/core/hash/shared/to_s.rb
MacRuby/trunk/spec/frozen/core/hash/shared/update.rb
MacRuby/trunk/spec/frozen/core/hash/shift_spec.rb
MacRuby/trunk/spec/frozen/core/hash/size_spec.rb
MacRuby/trunk/spec/frozen/core/hash/sort_spec.rb
MacRuby/trunk/spec/frozen/core/hash/store_spec.rb
MacRuby/trunk/spec/frozen/core/hash/to_a_spec.rb
MacRuby/trunk/spec/frozen/core/hash/to_hash_spec.rb
MacRuby/trunk/spec/frozen/core/hash/to_s_spec.rb
MacRuby/trunk/spec/frozen/core/hash/try_convert_spec.rb
MacRuby/trunk/spec/frozen/core/hash/update_spec.rb
MacRuby/trunk/spec/frozen/core/hash/value_spec.rb
MacRuby/trunk/spec/frozen/core/hash/values_at_spec.rb
MacRuby/trunk/spec/frozen/core/hash/values_spec.rb
MacRuby/trunk/spec/frozen/core/integer/ceil_spec.rb
MacRuby/trunk/spec/frozen/core/integer/chr_spec.rb
MacRuby/trunk/spec/frozen/core/integer/denominator_spec.rb
MacRuby/trunk/spec/frozen/core/integer/downto_spec.rb
MacRuby/trunk/spec/frozen/core/integer/even_spec.rb
MacRuby/trunk/spec/frozen/core/integer/floor_spec.rb
MacRuby/trunk/spec/frozen/core/integer/gcd_spec.rb
MacRuby/trunk/spec/frozen/core/integer/gcdlcm_spec.rb
MacRuby/trunk/spec/frozen/core/integer/induced_from_spec.rb
MacRuby/trunk/spec/frozen/core/integer/integer_spec.rb
MacRuby/trunk/spec/frozen/core/integer/lcm_spec.rb
MacRuby/trunk/spec/frozen/core/integer/next_spec.rb
MacRuby/trunk/spec/frozen/core/integer/numerator_spec.rb
MacRuby/trunk/spec/frozen/core/integer/odd_spec.rb
MacRuby/trunk/spec/frozen/core/integer/ord_spec.rb
MacRuby/trunk/spec/frozen/core/integer/pred_spec.rb
MacRuby/trunk/spec/frozen/core/integer/round_spec.rb
MacRuby/trunk/spec/frozen/core/integer/succ_spec.rb
MacRuby/trunk/spec/frozen/core/integer/times_spec.rb
MacRuby/trunk/spec/frozen/core/integer/to_i_spec.rb
MacRuby/trunk/spec/frozen/core/integer/to_int_spec.rb
MacRuby/trunk/spec/frozen/core/integer/to_r_spec.rb
MacRuby/trunk/spec/frozen/core/integer/truncate_spec.rb
MacRuby/trunk/spec/frozen/core/integer/upto_spec.rb
MacRuby/trunk/spec/frozen/core/io/binmode_spec.rb
MacRuby/trunk/spec/frozen/core/io/bytes_spec.rb
MacRuby/trunk/spec/frozen/core/io/chars_spec.rb
MacRuby/trunk/spec/frozen/core/io/close_read_spec.rb
MacRuby/trunk/spec/frozen/core/io/close_spec.rb
MacRuby/trunk/spec/frozen/core/io/close_write_spec.rb
MacRuby/trunk/spec/frozen/core/io/closed_spec.rb
MacRuby/trunk/spec/frozen/core/io/codepoints_spec.rb
MacRuby/trunk/spec/frozen/core/io/constants_spec.rb
MacRuby/trunk/spec/frozen/core/io/data/data_spec.rb
MacRuby/trunk/spec/frozen/core/io/data/flock_spec.rb
MacRuby/trunk/spec/frozen/core/io/dup_spec_disabled.rb
MacRuby/trunk/spec/frozen/core/io/each_byte_spec.rb
MacRuby/trunk/spec/frozen/core/io/each_char_spec.rb
MacRuby/trunk/spec/frozen/core/io/each_codepoint_spec.rb
MacRuby/trunk/spec/frozen/core/io/each_line_spec.rb
MacRuby/trunk/spec/frozen/core/io/each_spec.rb
MacRuby/trunk/spec/frozen/core/io/eof_spec.rb
MacRuby/trunk/spec/frozen/core/io/fcntl_spec.rb
MacRuby/trunk/spec/frozen/core/io/fileno_spec.rb
MacRuby/trunk/spec/frozen/core/io/fixtures/classes.rb
MacRuby/trunk/spec/frozen/core/io/flush_spec.rb
MacRuby/trunk/spec/frozen/core/io/for_fd_spec.rb
MacRuby/trunk/spec/frozen/core/io/foreach_spec.rb
MacRuby/trunk/spec/frozen/core/io/fsync_spec.rb
MacRuby/trunk/spec/frozen/core/io/getbyte_spec.rb
MacRuby/trunk/spec/frozen/core/io/getc_spec.rb
MacRuby/trunk/spec/frozen/core/io/gets_spec.rb
MacRuby/trunk/spec/frozen/core/io/initialize_copy_spec.rb
MacRuby/trunk/spec/frozen/core/io/initialize_spec.rb
MacRuby/trunk/spec/frozen/core/io/inspect_spec.rb
MacRuby/trunk/spec/frozen/core/io/io_spec.rb
MacRuby/trunk/spec/frozen/core/io/ioctl_spec.rb
MacRuby/trunk/spec/frozen/core/io/isatty_spec.rb
MacRuby/trunk/spec/frozen/core/io/lineno_spec.rb
MacRuby/trunk/spec/frozen/core/io/lines_spec_disabled.rb
MacRuby/trunk/spec/frozen/core/io/new_spec.rb
MacRuby/trunk/spec/frozen/core/io/open_spec.rb
MacRuby/trunk/spec/frozen/core/io/output_spec.rb
MacRuby/trunk/spec/frozen/core/io/pid_spec.rb
MacRuby/trunk/spec/frozen/core/io/pipe_spec.rb
MacRuby/trunk/spec/frozen/core/io/popen_spec.rb
MacRuby/trunk/spec/frozen/core/io/pos_spec.rb
MacRuby/trunk/spec/frozen/core/io/print_spec.rb
MacRuby/trunk/spec/frozen/core/io/printf_spec_disabled.rb
MacRuby/trunk/spec/frozen/core/io/putc_spec.rb
MacRuby/trunk/spec/frozen/core/io/puts_spec_disabled.rb
MacRuby/trunk/spec/frozen/core/io/read_nonblock_spec.rb
MacRuby/trunk/spec/frozen/core/io/read_spec.rb
MacRuby/trunk/spec/frozen/core/io/readchar_spec.rb
MacRuby/trunk/spec/frozen/core/io/readline_spec.rb
MacRuby/trunk/spec/frozen/core/io/readlines_spec.rb
MacRuby/trunk/spec/frozen/core/io/readpartial_spec.rb
MacRuby/trunk/spec/frozen/core/io/reopen_spec.rb
MacRuby/trunk/spec/frozen/core/io/rewind_spec_disabled.rb
MacRuby/trunk/spec/frozen/core/io/seek_spec_disabled.rb
MacRuby/trunk/spec/frozen/core/io/select_spec.rb
MacRuby/trunk/spec/frozen/core/io/shared/codepoints.rb
MacRuby/trunk/spec/frozen/core/io/shared/each.rb
MacRuby/trunk/spec/frozen/core/io/shared/gets_ascii.rb
MacRuby/trunk/spec/frozen/core/io/shared/new.rb
MacRuby/trunk/spec/frozen/core/io/shared/pos.rb
MacRuby/trunk/spec/frozen/core/io/shared/tty.rb
MacRuby/trunk/spec/frozen/core/io/shared/write.rb
MacRuby/trunk/spec/frozen/core/io/stat_spec.rb
MacRuby/trunk/spec/frozen/core/io/sync_spec.rb
MacRuby/trunk/spec/frozen/core/io/sysopen_spec.rb
MacRuby/trunk/spec/frozen/core/io/sysread_spec.rb
MacRuby/trunk/spec/frozen/core/io/sysseek_spec_disabled.rb
MacRuby/trunk/spec/frozen/core/io/syswrite_spec.rb
MacRuby/trunk/spec/frozen/core/io/tell_spec.rb
MacRuby/trunk/spec/frozen/core/io/to_i_spec.rb
MacRuby/trunk/spec/frozen/core/io/to_io_spec.rb
MacRuby/trunk/spec/frozen/core/io/try_convert_spec.rb
MacRuby/trunk/spec/frozen/core/io/tty_spec.rb
MacRuby/trunk/spec/frozen/core/io/ungetc_spec.rb
MacRuby/trunk/spec/frozen/core/io/write_nonblock_spec_disabled.rb
MacRuby/trunk/spec/frozen/core/io/write_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/Array_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/Float_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/Integer_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/String_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/__callee___spec.rb
MacRuby/trunk/spec/frozen/core/kernel/__id___spec.rb
MacRuby/trunk/spec/frozen/core/kernel/__method___spec.rb
MacRuby/trunk/spec/frozen/core/kernel/__send___spec.rb
MacRuby/trunk/spec/frozen/core/kernel/abort_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/at_exit_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/autoload_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/backtick_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/binding_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/block_given_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/callcc_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/caller_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/case_compare_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/catch_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/chomp_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/chop_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/class_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/clone_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/comparison_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/define_singleton_method_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/display_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/dup_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/eql_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/equal_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/equal_value_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/eval_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/exec_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/exit_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/extend_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/fail_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/fixtures/caller_fixture1.rb
MacRuby/trunk/spec/frozen/core/kernel/fixtures/classes.rb
MacRuby/trunk/spec/frozen/core/kernel/fork_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/format_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/freeze_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/frozen_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/getc_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/gets_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/global_variables_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/gsub_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/hash_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/id_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/initialize_copy_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/inspect_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/instance_eval_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/instance_of_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/instance_variable_defined_spec.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/instance_variables_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/is_a_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/iterator_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/kind_of_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/lambda_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/load_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/local_variables_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/loop_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/match_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/method_missing_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/method_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/methods_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/nil_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/object_id_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/open_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/p_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/print_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/printf_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/private_methods_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/proc_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/protected_methods_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/public_method_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/public_methods_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/public_send_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/putc_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/puts_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/raise_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/rand_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/readline_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/readlines_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/remove_instance_variable_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/require_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/respond_to_missing_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/respond_to_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/scan_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/select_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/send_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/set_trace_func_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/shared/method.rb
MacRuby/trunk/spec/frozen/core/kernel/singleton_method_added_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/singleton_method_removed_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/singleton_method_undefined_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/singleton_methods_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/sleep_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/spawn_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/split_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/sprintf_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/srand_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/sub_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/syscall_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/system_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/taint_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/tainted_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/tap_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/test_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/throw_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/to_a_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/to_s_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/trace_var_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/trap_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/trust_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/type_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/untaint_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/untrace_var_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/untrust_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/untrusted_spec.rb
MacRuby/trunk/spec/frozen/core/kernel/warn_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/marshal/restore_spec.rb
MacRuby/trunk/spec/frozen/core/matchdata/begin_spec.rb
MacRuby/trunk/spec/frozen/core/matchdata/captures_spec.rb
MacRuby/trunk/spec/frozen/core/matchdata/element_reference_spec.rb
MacRuby/trunk/spec/frozen/core/matchdata/end_spec.rb
MacRuby/trunk/spec/frozen/core/matchdata/eql_spec.rb
MacRuby/trunk/spec/frozen/core/matchdata/equal_value_spec.rb
MacRuby/trunk/spec/frozen/core/matchdata/initialize_copy_spec.rb
MacRuby/trunk/spec/frozen/core/matchdata/inspect_spec.rb
MacRuby/trunk/spec/frozen/core/matchdata/length_spec.rb
MacRuby/trunk/spec/frozen/core/matchdata/names_spec.rb
MacRuby/trunk/spec/frozen/core/matchdata/offset_spec.rb
MacRuby/trunk/spec/frozen/core/matchdata/post_match_spec.rb
MacRuby/trunk/spec/frozen/core/matchdata/pre_match_spec.rb
MacRuby/trunk/spec/frozen/core/matchdata/regexp_spec.rb
MacRuby/trunk/spec/frozen/core/matchdata/select_spec.rb
MacRuby/trunk/spec/frozen/core/matchdata/shared/eql.rb
MacRuby/trunk/spec/frozen/core/matchdata/size_spec.rb
MacRuby/trunk/spec/frozen/core/matchdata/string_spec.rb
MacRuby/trunk/spec/frozen/core/matchdata/to_a_spec.rb
MacRuby/trunk/spec/frozen/core/matchdata/to_s_spec.rb
MacRuby/trunk/spec/frozen/core/matchdata/values_at_spec.rb
MacRuby/trunk/spec/frozen/core/matchdata/versions/names_1.9.rb
MacRuby/trunk/spec/frozen/core/math/acos_spec.rb
MacRuby/trunk/spec/frozen/core/math/acosh_spec.rb
MacRuby/trunk/spec/frozen/core/math/asin_spec.rb
MacRuby/trunk/spec/frozen/core/math/asinh_spec.rb
MacRuby/trunk/spec/frozen/core/math/atan2_spec.rb
MacRuby/trunk/spec/frozen/core/math/atan_spec.rb
MacRuby/trunk/spec/frozen/core/math/atanh_spec.rb
MacRuby/trunk/spec/frozen/core/math/constants_spec.rb
MacRuby/trunk/spec/frozen/core/math/cos_spec.rb
MacRuby/trunk/spec/frozen/core/math/cosh_spec.rb
MacRuby/trunk/spec/frozen/core/math/erf_spec.rb
MacRuby/trunk/spec/frozen/core/math/erfc_spec.rb
MacRuby/trunk/spec/frozen/core/math/exp_spec.rb
MacRuby/trunk/spec/frozen/core/math/frexp_spec.rb
MacRuby/trunk/spec/frozen/core/math/gamma_spec.rb
MacRuby/trunk/spec/frozen/core/math/hypot_spec.rb
MacRuby/trunk/spec/frozen/core/math/ldexp_spec.rb
MacRuby/trunk/spec/frozen/core/math/lgamma_spec.rb
MacRuby/trunk/spec/frozen/core/math/log10_spec.rb
MacRuby/trunk/spec/frozen/core/math/log2_spec.rb
MacRuby/trunk/spec/frozen/core/math/log_spec.rb
MacRuby/trunk/spec/frozen/core/math/sin_spec.rb
MacRuby/trunk/spec/frozen/core/math/sinh_spec.rb
MacRuby/trunk/spec/frozen/core/math/sqrt_spec.rb
MacRuby/trunk/spec/frozen/core/math/tan_spec.rb
MacRuby/trunk/spec/frozen/core/math/tanh_spec.rb
MacRuby/trunk/spec/frozen/core/method/arity_spec.rb
MacRuby/trunk/spec/frozen/core/method/call_spec.rb
MacRuby/trunk/spec/frozen/core/method/clone_spec.rb
MacRuby/trunk/spec/frozen/core/method/element_reference_spec.rb
MacRuby/trunk/spec/frozen/core/method/eql_spec.rb
MacRuby/trunk/spec/frozen/core/method/equal_value_spec.rb
MacRuby/trunk/spec/frozen/core/method/fixtures/classes.rb
MacRuby/trunk/spec/frozen/core/method/inspect_spec.rb
MacRuby/trunk/spec/frozen/core/method/name_spec.rb
MacRuby/trunk/spec/frozen/core/method/owner_spec.rb
MacRuby/trunk/spec/frozen/core/method/parameters_spec.rb
MacRuby/trunk/spec/frozen/core/method/receiver_spec.rb
MacRuby/trunk/spec/frozen/core/method/shared/eql.rb
MacRuby/trunk/spec/frozen/core/method/source_location_spec.rb
MacRuby/trunk/spec/frozen/core/method/to_proc_spec.rb
MacRuby/trunk/spec/frozen/core/method/to_s_spec.rb
MacRuby/trunk/spec/frozen/core/method/unbind_spec.rb
MacRuby/trunk/spec/frozen/core/method/versions/parameters_1.9.rb
MacRuby/trunk/spec/frozen/core/module/alias_method_spec.rb
MacRuby/trunk/spec/frozen/core/module/allocate_spec.rb
MacRuby/trunk/spec/frozen/core/module/ancestors_spec.rb
MacRuby/trunk/spec/frozen/core/module/append_features_spec.rb
MacRuby/trunk/spec/frozen/core/module/attr_accessor_spec.rb
MacRuby/trunk/spec/frozen/core/module/attr_reader_spec.rb
MacRuby/trunk/spec/frozen/core/module/attr_spec.rb
MacRuby/trunk/spec/frozen/core/module/attr_writer_spec.rb
MacRuby/trunk/spec/frozen/core/module/autoload_spec.rb
MacRuby/trunk/spec/frozen/core/module/case_compare_spec.rb
MacRuby/trunk/spec/frozen/core/module/class_eval_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/comparison_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/const_missing_spec.rb
MacRuby/trunk/spec/frozen/core/module/const_set_spec.rb
MacRuby/trunk/spec/frozen/core/module/constants_spec.rb
MacRuby/trunk/spec/frozen/core/module/define_method_spec.rb
MacRuby/trunk/spec/frozen/core/module/eql_spec.rb
MacRuby/trunk/spec/frozen/core/module/equal_spec.rb
MacRuby/trunk/spec/frozen/core/module/equal_value_spec.rb
MacRuby/trunk/spec/frozen/core/module/extend_object_spec.rb
MacRuby/trunk/spec/frozen/core/module/extended_spec.rb
MacRuby/trunk/spec/frozen/core/module/fixtures/classes.rb
MacRuby/trunk/spec/frozen/core/module/fixtures/name.rb
MacRuby/trunk/spec/frozen/core/module/freeze_spec.rb
MacRuby/trunk/spec/frozen/core/module/gt_spec.rb
MacRuby/trunk/spec/frozen/core/module/gte_spec.rb
MacRuby/trunk/spec/frozen/core/module/include_spec.rb
MacRuby/trunk/spec/frozen/core/module/included_modules_spec.rb
MacRuby/trunk/spec/frozen/core/module/included_spec.rb
MacRuby/trunk/spec/frozen/core/module/initialize_copy_spec.rb
MacRuby/trunk/spec/frozen/core/module/initialize_spec.rb
MacRuby/trunk/spec/frozen/core/module/instance_method_spec.rb
MacRuby/trunk/spec/frozen/core/module/instance_methods_spec.rb
MacRuby/trunk/spec/frozen/core/module/lt_spec.rb
MacRuby/trunk/spec/frozen/core/module/lte_spec.rb
MacRuby/trunk/spec/frozen/core/module/method_added_spec.rb
MacRuby/trunk/spec/frozen/core/module/method_defined_spec.rb
MacRuby/trunk/spec/frozen/core/module/method_removed_spec.rb
MacRuby/trunk/spec/frozen/core/module/method_undefined_spec.rb
MacRuby/trunk/spec/frozen/core/module/module_eval_spec.rb
MacRuby/trunk/spec/frozen/core/module/module_function_spec.rb
MacRuby/trunk/spec/frozen/core/module/name_spec.rb
MacRuby/trunk/spec/frozen/core/module/nesting_spec.rb
MacRuby/trunk/spec/frozen/core/module/new_spec.rb
MacRuby/trunk/spec/frozen/core/module/private_class_method_spec.rb
MacRuby/trunk/spec/frozen/core/module/private_instance_methods_spec.rb
MacRuby/trunk/spec/frozen/core/module/private_method_defined_spec.rb
MacRuby/trunk/spec/frozen/core/module/private_spec.rb
MacRuby/trunk/spec/frozen/core/module/protected_instance_methods_spec.rb
MacRuby/trunk/spec/frozen/core/module/protected_method_defined_spec.rb
MacRuby/trunk/spec/frozen/core/module/protected_spec.rb
MacRuby/trunk/spec/frozen/core/module/public_class_method_spec.rb
MacRuby/trunk/spec/frozen/core/module/public_instance_methods_spec.rb
MacRuby/trunk/spec/frozen/core/module/public_method_defined_spec.rb
MacRuby/trunk/spec/frozen/core/module/public_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/remove_method_spec.rb
MacRuby/trunk/spec/frozen/core/module/to_s_spec.rb
MacRuby/trunk/spec/frozen/core/module/undef_method_spec.rb
MacRuby/trunk/spec/frozen/core/nil/and_spec.rb
MacRuby/trunk/spec/frozen/core/nil/inspect_spec.rb
MacRuby/trunk/spec/frozen/core/nil/nil_spec.rb
MacRuby/trunk/spec/frozen/core/nil/or_spec.rb
MacRuby/trunk/spec/frozen/core/nil/rationalize_spec.rb
MacRuby/trunk/spec/frozen/core/nil/to_a_spec.rb
MacRuby/trunk/spec/frozen/core/nil/to_f_spec.rb
MacRuby/trunk/spec/frozen/core/nil/to_i_spec.rb
MacRuby/trunk/spec/frozen/core/nil/to_r_spec.rb
MacRuby/trunk/spec/frozen/core/nil/to_s_spec.rb
MacRuby/trunk/spec/frozen/core/nil/xor_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/abs2_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/abs_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/angle_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/arg_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/ceil_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/coerce_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/comparison_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/conj_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/conjugate_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/denominator_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/div_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/divmod_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/eql_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/fdiv_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/floor_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/i_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/imag_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/imaginary_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/initialize_copy_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/integer_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/magnitude_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/modulo_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/nonzero_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/numerator_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/phase_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/polar_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/quo_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/rationalize_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/real_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/rect_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/rectangular_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/remainder_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/round_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/shared/abs.rb
MacRuby/trunk/spec/frozen/core/numeric/shared/rect.rb
MacRuby/trunk/spec/frozen/core/numeric/singleton_method_added_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/step_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/to_c_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/to_int_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/truncate_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/uminus_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/uplus_spec.rb
MacRuby/trunk/spec/frozen/core/numeric/zero_spec.rb
MacRuby/trunk/spec/frozen/core/object/clone_spec.rb
MacRuby/trunk/spec/frozen/core/object/dup_spec.rb
MacRuby/trunk/spec/frozen/core/object/initialize_spec.rb
MacRuby/trunk/spec/frozen/core/object/instance_of_spec.rb
MacRuby/trunk/spec/frozen/core/object/is_a_spec.rb
MacRuby/trunk/spec/frozen/core/object/kind_of_spec.rb
MacRuby/trunk/spec/frozen/core/object/match_spec.rb
MacRuby/trunk/spec/frozen/core/object/new_spec.rb
MacRuby/trunk/spec/frozen/core/objectspace/_id2ref_spec.rb
MacRuby/trunk/spec/frozen/core/objectspace/add_finalizer_spec.rb
MacRuby/trunk/spec/frozen/core/objectspace/call_finalizer_spec.rb
MacRuby/trunk/spec/frozen/core/objectspace/define_finalizer_spec.rb
MacRuby/trunk/spec/frozen/core/objectspace/each_object_spec.rb
MacRuby/trunk/spec/frozen/core/objectspace/finalizers_spec.rb
MacRuby/trunk/spec/frozen/core/objectspace/fixtures.rb
MacRuby/trunk/spec/frozen/core/objectspace/garbage_collect_spec.rb
MacRuby/trunk/spec/frozen/core/objectspace/remove_finalizer_spec.rb
MacRuby/trunk/spec/frozen/core/objectspace/undefine_finalizer_spec.rb
MacRuby/trunk/spec/frozen/core/precision/included_spec.rb
MacRuby/trunk/spec/frozen/core/precision/prec_f_spec.rb
MacRuby/trunk/spec/frozen/core/precision/prec_i_spec.rb
MacRuby/trunk/spec/frozen/core/precision/prec_spec.rb
MacRuby/trunk/spec/frozen/core/proc/arity_spec.rb
MacRuby/trunk/spec/frozen/core/proc/binding_spec.rb
MacRuby/trunk/spec/frozen/core/proc/block_pass_spec.rb
MacRuby/trunk/spec/frozen/core/proc/call_spec.rb
MacRuby/trunk/spec/frozen/core/proc/case_compare_spec.rb
MacRuby/trunk/spec/frozen/core/proc/clone_spec.rb
MacRuby/trunk/spec/frozen/core/proc/curry_spec.rb
MacRuby/trunk/spec/frozen/core/proc/dup_spec.rb
MacRuby/trunk/spec/frozen/core/proc/element_reference_spec.rb
MacRuby/trunk/spec/frozen/core/proc/eql_spec.rb
MacRuby/trunk/spec/frozen/core/proc/equal_value_spec.rb
MacRuby/trunk/spec/frozen/core/proc/hash_spec.rb
MacRuby/trunk/spec/frozen/core/proc/lambda_spec.rb
MacRuby/trunk/spec/frozen/core/proc/new_spec.rb
MacRuby/trunk/spec/frozen/core/proc/shared/equal.rb
MacRuby/trunk/spec/frozen/core/proc/source_location_spec.rb
MacRuby/trunk/spec/frozen/core/proc/to_proc_spec.rb
MacRuby/trunk/spec/frozen/core/proc/to_s_spec.rb
MacRuby/trunk/spec/frozen/core/proc/versions/call_1.8.7.rb
MacRuby/trunk/spec/frozen/core/proc/versions/call_1.9.rb
MacRuby/trunk/spec/frozen/core/proc/versions/parameters_1.9.rb
MacRuby/trunk/spec/frozen/core/proc/yield_spec.rb
MacRuby/trunk/spec/frozen/core/process/abort_spec.rb
MacRuby/trunk/spec/frozen/core/process/detach_spec.rb
MacRuby/trunk/spec/frozen/core/process/egid_spec.rb
MacRuby/trunk/spec/frozen/core/process/euid_spec.rb
MacRuby/trunk/spec/frozen/core/process/exit_spec.rb
MacRuby/trunk/spec/frozen/core/process/fork_spec.rb
MacRuby/trunk/spec/frozen/core/process/getpgid_spec.rb
MacRuby/trunk/spec/frozen/core/process/getpgrp_spec.rb
MacRuby/trunk/spec/frozen/core/process/getpriority_spec.rb
MacRuby/trunk/spec/frozen/core/process/getrlimit_spec.rb
MacRuby/trunk/spec/frozen/core/process/gid_spec.rb
MacRuby/trunk/spec/frozen/core/process/groups_spec.rb
MacRuby/trunk/spec/frozen/core/process/initgroups_spec.rb
MacRuby/trunk/spec/frozen/core/process/kill_spec.rb
MacRuby/trunk/spec/frozen/core/process/maxgroups_spec.rb
MacRuby/trunk/spec/frozen/core/process/pid_spec.rb
MacRuby/trunk/spec/frozen/core/process/ppid_spec.rb
MacRuby/trunk/spec/frozen/core/process/setpgid_spec.rb
MacRuby/trunk/spec/frozen/core/process/setpgrp_spec.rb
MacRuby/trunk/spec/frozen/core/process/setpriority_spec.rb
MacRuby/trunk/spec/frozen/core/process/setrlimit_spec.rb
MacRuby/trunk/spec/frozen/core/process/setsid_spec.rb
MacRuby/trunk/spec/frozen/core/process/times_spec.rb
MacRuby/trunk/spec/frozen/core/process/uid_spec.rb
MacRuby/trunk/spec/frozen/core/process/wait2_spec.rb
MacRuby/trunk/spec/frozen/core/process/wait_spec.rb
MacRuby/trunk/spec/frozen/core/process/waitall_spec.rb
MacRuby/trunk/spec/frozen/core/process/waitpid2_spec.rb
MacRuby/trunk/spec/frozen/core/process/waitpid_spec.rb
MacRuby/trunk/spec/frozen/core/random/bytes_spec.rb
MacRuby/trunk/spec/frozen/core/random/equal_value_spec.rb
MacRuby/trunk/spec/frozen/core/random/new_seed_spec.rb
MacRuby/trunk/spec/frozen/core/random/rand_spec.rb
MacRuby/trunk/spec/frozen/core/random/seed_spec.rb
MacRuby/trunk/spec/frozen/core/random/srand_spec.rb
MacRuby/trunk/spec/frozen/core/range/begin_spec.rb
MacRuby/trunk/spec/frozen/core/range/case_compare_spec.rb
MacRuby/trunk/spec/frozen/core/range/cover_spec.rb
MacRuby/trunk/spec/frozen/core/range/each_spec.rb
MacRuby/trunk/spec/frozen/core/range/end_spec.rb
MacRuby/trunk/spec/frozen/core/range/eql_spec.rb
MacRuby/trunk/spec/frozen/core/range/equal_value_spec.rb
MacRuby/trunk/spec/frozen/core/range/exclude_end_spec.rb
MacRuby/trunk/spec/frozen/core/range/first_spec.rb
MacRuby/trunk/spec/frozen/core/range/hash_spec.rb
MacRuby/trunk/spec/frozen/core/range/include_spec.rb
MacRuby/trunk/spec/frozen/core/range/initialize_spec.rb
MacRuby/trunk/spec/frozen/core/range/inspect_spec.rb
MacRuby/trunk/spec/frozen/core/range/last_spec.rb
MacRuby/trunk/spec/frozen/core/range/max_spec.rb
MacRuby/trunk/spec/frozen/core/range/member_spec.rb
MacRuby/trunk/spec/frozen/core/range/min_spec.rb
MacRuby/trunk/spec/frozen/core/range/new_spec.rb
MacRuby/trunk/spec/frozen/core/range/shared/equal_value.rb
MacRuby/trunk/spec/frozen/core/range/shared/include.rb
MacRuby/trunk/spec/frozen/core/range/step_spec.rb
MacRuby/trunk/spec/frozen/core/range/to_a_spec.rb
MacRuby/trunk/spec/frozen/core/range/to_s_spec.rb
MacRuby/trunk/spec/frozen/core/rational/Rational_spec.rb
MacRuby/trunk/spec/frozen/core/rational/abs_spec.rb
MacRuby/trunk/spec/frozen/core/rational/ceil_spec.rb
MacRuby/trunk/spec/frozen/core/rational/coerce_spec.rb
MacRuby/trunk/spec/frozen/core/rational/comparison_spec.rb
MacRuby/trunk/spec/frozen/core/rational/denominator_spec.rb
MacRuby/trunk/spec/frozen/core/rational/div_spec.rb
MacRuby/trunk/spec/frozen/core/rational/divide_spec.rb
MacRuby/trunk/spec/frozen/core/rational/divmod_spec.rb
MacRuby/trunk/spec/frozen/core/rational/equal_value_spec.rb
MacRuby/trunk/spec/frozen/core/rational/exponent_spec.rb
MacRuby/trunk/spec/frozen/core/rational/fdiv_spec.rb
MacRuby/trunk/spec/frozen/core/rational/floor_spec.rb
MacRuby/trunk/spec/frozen/core/rational/hash_spec.rb
MacRuby/trunk/spec/frozen/core/rational/initialize_spec.rb
MacRuby/trunk/spec/frozen/core/rational/inspect_spec.rb
MacRuby/trunk/spec/frozen/core/rational/integer_spec.rb
MacRuby/trunk/spec/frozen/core/rational/minus_spec.rb
MacRuby/trunk/spec/frozen/core/rational/modulo_spec.rb
MacRuby/trunk/spec/frozen/core/rational/multiply_spec.rb
MacRuby/trunk/spec/frozen/core/rational/numerator_spec.rb
MacRuby/trunk/spec/frozen/core/rational/plus_spec.rb
MacRuby/trunk/spec/frozen/core/rational/quo_spec.rb
MacRuby/trunk/spec/frozen/core/rational/rationalize_spec.rb
MacRuby/trunk/spec/frozen/core/rational/remainder_spec.rb
MacRuby/trunk/spec/frozen/core/rational/round_spec.rb
MacRuby/trunk/spec/frozen/core/rational/to_f_spec.rb
MacRuby/trunk/spec/frozen/core/rational/to_i_spec.rb
MacRuby/trunk/spec/frozen/core/rational/to_r_spec.rb
MacRuby/trunk/spec/frozen/core/rational/to_s_spec.rb
MacRuby/trunk/spec/frozen/core/rational/truncate_spec.rb
MacRuby/trunk/spec/frozen/core/regexp/case_compare_spec.rb
MacRuby/trunk/spec/frozen/core/regexp/casefold_spec.rb
MacRuby/trunk/spec/frozen/core/regexp/compile_spec.rb
MacRuby/trunk/spec/frozen/core/regexp/encoding_spec.rb
MacRuby/trunk/spec/frozen/core/regexp/eql_spec.rb
MacRuby/trunk/spec/frozen/core/regexp/equal_value_spec.rb
MacRuby/trunk/spec/frozen/core/regexp/escape_spec.rb
MacRuby/trunk/spec/frozen/core/regexp/fixed_encoding_spec.rb
MacRuby/trunk/spec/frozen/core/regexp/hash_spec.rb
MacRuby/trunk/spec/frozen/core/regexp/initialize_copy_spec.rb
MacRuby/trunk/spec/frozen/core/regexp/initialize_spec.rb
MacRuby/trunk/spec/frozen/core/regexp/inspect_spec.rb
MacRuby/trunk/spec/frozen/core/regexp/kcode_spec.rb
MacRuby/trunk/spec/frozen/core/regexp/last_match_spec.rb
MacRuby/trunk/spec/frozen/core/regexp/match_spec.rb
MacRuby/trunk/spec/frozen/core/regexp/new_spec.rb
MacRuby/trunk/spec/frozen/core/regexp/options_spec.rb
MacRuby/trunk/spec/frozen/core/regexp/quote_spec.rb
MacRuby/trunk/spec/frozen/core/regexp/shared/match.rb
MacRuby/trunk/spec/frozen/core/regexp/source_spec.rb
MacRuby/trunk/spec/frozen/core/regexp/to_s_spec.rb
MacRuby/trunk/spec/frozen/core/regexp/try_convert_spec.rb
MacRuby/trunk/spec/frozen/core/regexp/union_spec.rb
MacRuby/trunk/spec/frozen/core/regexp/versions/named_captures_1.9.rb
MacRuby/trunk/spec/frozen/core/regexp/versions/names_1.9.rb
MacRuby/trunk/spec/frozen/core/signal/list_spec.rb
MacRuby/trunk/spec/frozen/core/signal/trap_spec.rb
MacRuby/trunk/spec/frozen/core/string/allocate_spec.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/capitalize_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/chars_spec.rb
MacRuby/trunk/spec/frozen/core/string/chomp_spec.rb
MacRuby/trunk/spec/frozen/core/string/chop_spec.rb
MacRuby/trunk/spec/frozen/core/string/chr_spec.rb
MacRuby/trunk/spec/frozen/core/string/clear_spec.rb
MacRuby/trunk/spec/frozen/core/string/codepoints_spec.rb
MacRuby/trunk/spec/frozen/core/string/comparison_spec.rb
MacRuby/trunk/spec/frozen/core/string/concat_spec_disabled.rb
MacRuby/trunk/spec/frozen/core/string/count_spec.rb
MacRuby/trunk/spec/frozen/core/string/crypt_spec.rb
MacRuby/trunk/spec/frozen/core/string/delete_spec.rb
MacRuby/trunk/spec/frozen/core/string/downcase_spec.rb
MacRuby/trunk/spec/frozen/core/string/dump_spec.rb
MacRuby/trunk/spec/frozen/core/string/each_byte_spec_disabled.rb
MacRuby/trunk/spec/frozen/core/string/each_char_spec.rb
MacRuby/trunk/spec/frozen/core/string/each_codepoint_spec.rb
MacRuby/trunk/spec/frozen/core/string/each_line_spec.rb
MacRuby/trunk/spec/frozen/core/string/each_spec.rb
MacRuby/trunk/spec/frozen/core/string/element_reference_spec_disabled.rb
MacRuby/trunk/spec/frozen/core/string/element_set_spec.rb
MacRuby/trunk/spec/frozen/core/string/empty_spec.rb
MacRuby/trunk/spec/frozen/core/string/encode_spec.rb
MacRuby/trunk/spec/frozen/core/string/encoding_spec.rb
MacRuby/trunk/spec/frozen/core/string/end_with_spec.rb
MacRuby/trunk/spec/frozen/core/string/entries_spec.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/fixtures/iso-8859-9-encoding.rb
MacRuby/trunk/spec/frozen/core/string/force_encoding_spec.rb
MacRuby/trunk/spec/frozen/core/string/getbyte_spec_disabled.rb
MacRuby/trunk/spec/frozen/core/string/gsub_spec.rb
MacRuby/trunk/spec/frozen/core/string/hash_spec.rb
MacRuby/trunk/spec/frozen/core/string/hex_spec.rb
MacRuby/trunk/spec/frozen/core/string/include_spec.rb
MacRuby/trunk/spec/frozen/core/string/index_spec.rb
MacRuby/trunk/spec/frozen/core/string/initialize_spec.rb
MacRuby/trunk/spec/frozen/core/string/insert_spec.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/length_spec.rb
MacRuby/trunk/spec/frozen/core/string/lines_spec.rb
MacRuby/trunk/spec/frozen/core/string/ljust_spec.rb
MacRuby/trunk/spec/frozen/core/string/lstrip_spec.rb
MacRuby/trunk/spec/frozen/core/string/match_spec.rb
MacRuby/trunk/spec/frozen/core/string/modulo_spec.rb
MacRuby/trunk/spec/frozen/core/string/multiply_spec.rb
MacRuby/trunk/spec/frozen/core/string/new_spec.rb
MacRuby/trunk/spec/frozen/core/string/next_spec_disabled.rb
MacRuby/trunk/spec/frozen/core/string/oct_spec.rb
MacRuby/trunk/spec/frozen/core/string/ord_spec.rb
MacRuby/trunk/spec/frozen/core/string/partition_spec.rb
MacRuby/trunk/spec/frozen/core/string/plus_spec.rb
MacRuby/trunk/spec/frozen/core/string/replace_spec.rb
MacRuby/trunk/spec/frozen/core/string/reverse_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/rpartition_spec.rb
MacRuby/trunk/spec/frozen/core/string/rstrip_spec.rb
MacRuby/trunk/spec/frozen/core/string/scan_spec.rb
MacRuby/trunk/spec/frozen/core/string/setbyte_spec_disabled.rb
MacRuby/trunk/spec/frozen/core/string/shared/chars.rb
MacRuby/trunk/spec/frozen/core/string/shared/codepoints.rb
MacRuby/trunk/spec/frozen/core/string/shared/concat.rb
MacRuby/trunk/spec/frozen/core/string/shared/each_line.rb
MacRuby/trunk/spec/frozen/core/string/shared/encode.rb
MacRuby/trunk/spec/frozen/core/string/size_spec.rb
MacRuby/trunk/spec/frozen/core/string/slice_spec.rb
MacRuby/trunk/spec/frozen/core/string/split_spec.rb
MacRuby/trunk/spec/frozen/core/string/squeeze_spec.rb
MacRuby/trunk/spec/frozen/core/string/start_with_spec.rb
MacRuby/trunk/spec/frozen/core/string/strip_spec.rb
MacRuby/trunk/spec/frozen/core/string/sub_spec.rb
MacRuby/trunk/spec/frozen/core/string/succ_spec_disabled.rb
MacRuby/trunk/spec/frozen/core/string/sum_spec.rb
MacRuby/trunk/spec/frozen/core/string/swapcase_spec.rb
MacRuby/trunk/spec/frozen/core/string/to_a_spec.rb
MacRuby/trunk/spec/frozen/core/string/to_c_spec.rb
MacRuby/trunk/spec/frozen/core/string/to_f_spec.rb
MacRuby/trunk/spec/frozen/core/string/to_i_spec.rb
MacRuby/trunk/spec/frozen/core/string/to_r_spec.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/string/tr_s_spec.rb
MacRuby/trunk/spec/frozen/core/string/tr_spec.rb
MacRuby/trunk/spec/frozen/core/string/try_convert_spec.rb
MacRuby/trunk/spec/frozen/core/string/unpack_spec.rb
MacRuby/trunk/spec/frozen/core/string/upcase_spec.rb
MacRuby/trunk/spec/frozen/core/string/upto_spec.rb
MacRuby/trunk/spec/frozen/core/string/valid_encoding_spec.rb
MacRuby/trunk/spec/frozen/core/struct/each_pair_spec.rb
MacRuby/trunk/spec/frozen/core/struct/each_spec.rb
MacRuby/trunk/spec/frozen/core/struct/element_reference_spec.rb
MacRuby/trunk/spec/frozen/core/struct/element_set_spec.rb
MacRuby/trunk/spec/frozen/core/struct/eql_spec.rb
MacRuby/trunk/spec/frozen/core/struct/equal_value_spec.rb
MacRuby/trunk/spec/frozen/core/struct/hash_spec.rb
MacRuby/trunk/spec/frozen/core/struct/initialize_copy_spec.rb
MacRuby/trunk/spec/frozen/core/struct/initialize_spec.rb
MacRuby/trunk/spec/frozen/core/struct/inspect_spec.rb
MacRuby/trunk/spec/frozen/core/struct/length_spec.rb
MacRuby/trunk/spec/frozen/core/struct/members_spec.rb
MacRuby/trunk/spec/frozen/core/struct/new_spec.rb
MacRuby/trunk/spec/frozen/core/struct/select_spec.rb
MacRuby/trunk/spec/frozen/core/struct/shared/equal_value.rb
MacRuby/trunk/spec/frozen/core/struct/size_spec.rb
MacRuby/trunk/spec/frozen/core/struct/struct_spec.rb
MacRuby/trunk/spec/frozen/core/struct/to_a_spec.rb
MacRuby/trunk/spec/frozen/core/struct/to_s_spec.rb
MacRuby/trunk/spec/frozen/core/struct/values_at_spec.rb
MacRuby/trunk/spec/frozen/core/struct/values_spec.rb
MacRuby/trunk/spec/frozen/core/symbol/all_symbols_spec.rb
MacRuby/trunk/spec/frozen/core/symbol/capitalize_spec.rb
MacRuby/trunk/spec/frozen/core/symbol/case_compare_spec.rb
MacRuby/trunk/spec/frozen/core/symbol/casecmp_spec.rb
MacRuby/trunk/spec/frozen/core/symbol/comparison_spec.rb
MacRuby/trunk/spec/frozen/core/symbol/downcase_spec.rb
MacRuby/trunk/spec/frozen/core/symbol/empty_spec.rb
MacRuby/trunk/spec/frozen/core/symbol/equal_value_spec.rb
MacRuby/trunk/spec/frozen/core/symbol/id2name_spec.rb
MacRuby/trunk/spec/frozen/core/symbol/inspect_spec.rb
MacRuby/trunk/spec/frozen/core/symbol/swapcase_spec.rb
MacRuby/trunk/spec/frozen/core/symbol/to_i_spec.rb
MacRuby/trunk/spec/frozen/core/symbol/to_int_spec.rb
MacRuby/trunk/spec/frozen/core/symbol/to_proc_spec.rb
MacRuby/trunk/spec/frozen/core/symbol/to_s_spec.rb
MacRuby/trunk/spec/frozen/core/symbol/to_sym_spec.rb
MacRuby/trunk/spec/frozen/core/symbol/upcase_spec.rb
MacRuby/trunk/spec/frozen/core/systemexit/initialize_spec.rb
MacRuby/trunk/spec/frozen/core/thread/abort_on_exception_spec.rb
MacRuby/trunk/spec/frozen/core/thread/alive_spec.rb
MacRuby/trunk/spec/frozen/core/thread/critical_spec.rb
MacRuby/trunk/spec/frozen/core/thread/current_spec.rb
MacRuby/trunk/spec/frozen/core/thread/element_reference_spec.rb
MacRuby/trunk/spec/frozen/core/thread/element_set_spec.rb
MacRuby/trunk/spec/frozen/core/thread/exit_spec.rb
MacRuby/trunk/spec/frozen/core/thread/fork_spec.rb
MacRuby/trunk/spec/frozen/core/thread/group_spec.rb
MacRuby/trunk/spec/frozen/core/thread/initialize_spec.rb
MacRuby/trunk/spec/frozen/core/thread/inspect_spec.rb
MacRuby/trunk/spec/frozen/core/thread/join_spec.rb
MacRuby/trunk/spec/frozen/core/thread/key_spec.rb
MacRuby/trunk/spec/frozen/core/thread/keys_spec.rb
MacRuby/trunk/spec/frozen/core/thread/kill_spec.rb
MacRuby/trunk/spec/frozen/core/thread/list_spec.rb
MacRuby/trunk/spec/frozen/core/thread/main_spec.rb
MacRuby/trunk/spec/frozen/core/thread/new_spec.rb
MacRuby/trunk/spec/frozen/core/thread/pass_spec.rb
MacRuby/trunk/spec/frozen/core/thread/priority_spec.rb
MacRuby/trunk/spec/frozen/core/thread/raise_spec.rb
MacRuby/trunk/spec/frozen/core/thread/run_spec.rb
MacRuby/trunk/spec/frozen/core/thread/safe_level_spec.rb
MacRuby/trunk/spec/frozen/core/thread/start_spec.rb
MacRuby/trunk/spec/frozen/core/thread/status_spec.rb
MacRuby/trunk/spec/frozen/core/thread/stop_spec.rb
MacRuby/trunk/spec/frozen/core/thread/terminate_spec.rb
MacRuby/trunk/spec/frozen/core/thread/value_spec.rb
MacRuby/trunk/spec/frozen/core/thread/wakeup_spec.rb
MacRuby/trunk/spec/frozen/core/threadgroup/add_spec.rb
MacRuby/trunk/spec/frozen/core/threadgroup/enclose_spec.rb
MacRuby/trunk/spec/frozen/core/threadgroup/enclosed_spec.rb
MacRuby/trunk/spec/frozen/core/threadgroup/list_spec.rb
MacRuby/trunk/spec/frozen/core/time/_dump_spec.rb
MacRuby/trunk/spec/frozen/core/time/_load_spec.rb
MacRuby/trunk/spec/frozen/core/time/asctime_spec.rb
MacRuby/trunk/spec/frozen/core/time/at_spec.rb
MacRuby/trunk/spec/frozen/core/time/comparison_spec.rb
MacRuby/trunk/spec/frozen/core/time/ctime_spec.rb
MacRuby/trunk/spec/frozen/core/time/day_spec.rb
MacRuby/trunk/spec/frozen/core/time/dst_spec.rb
MacRuby/trunk/spec/frozen/core/time/dup_spec.rb
MacRuby/trunk/spec/frozen/core/time/eql_spec.rb
MacRuby/trunk/spec/frozen/core/time/getgm_spec.rb
MacRuby/trunk/spec/frozen/core/time/getlocal_spec.rb
MacRuby/trunk/spec/frozen/core/time/getutc_spec.rb
MacRuby/trunk/spec/frozen/core/time/gm_spec.rb
MacRuby/trunk/spec/frozen/core/time/gmt_offset_spec.rb
MacRuby/trunk/spec/frozen/core/time/gmt_spec.rb
MacRuby/trunk/spec/frozen/core/time/gmtime_spec.rb
MacRuby/trunk/spec/frozen/core/time/gmtoff_spec.rb
MacRuby/trunk/spec/frozen/core/time/hash_spec.rb
MacRuby/trunk/spec/frozen/core/time/hour_spec.rb
MacRuby/trunk/spec/frozen/core/time/initialize_copy_spec.rb
MacRuby/trunk/spec/frozen/core/time/initialize_spec.rb
MacRuby/trunk/spec/frozen/core/time/inspect_spec.rb
MacRuby/trunk/spec/frozen/core/time/isdst_spec.rb
MacRuby/trunk/spec/frozen/core/time/local_spec.rb
MacRuby/trunk/spec/frozen/core/time/localtime_spec.rb
MacRuby/trunk/spec/frozen/core/time/mday_spec.rb
MacRuby/trunk/spec/frozen/core/time/min_spec.rb
MacRuby/trunk/spec/frozen/core/time/minus_spec.rb
MacRuby/trunk/spec/frozen/core/time/mktime_spec.rb
MacRuby/trunk/spec/frozen/core/time/mon_spec.rb
MacRuby/trunk/spec/frozen/core/time/month_spec.rb
MacRuby/trunk/spec/frozen/core/time/now_spec.rb
MacRuby/trunk/spec/frozen/core/time/plus_spec.rb
MacRuby/trunk/spec/frozen/core/time/sec_spec.rb
MacRuby/trunk/spec/frozen/core/time/shared/isdst.rb
MacRuby/trunk/spec/frozen/core/time/shared/local.rb
MacRuby/trunk/spec/frozen/core/time/shared/time_params.rb
MacRuby/trunk/spec/frozen/core/time/strftime_spec.rb
MacRuby/trunk/spec/frozen/core/time/succ_spec.rb
MacRuby/trunk/spec/frozen/core/time/times_spec.rb
MacRuby/trunk/spec/frozen/core/time/to_a_spec.rb
MacRuby/trunk/spec/frozen/core/time/to_f_spec.rb
MacRuby/trunk/spec/frozen/core/time/to_i_spec.rb
MacRuby/trunk/spec/frozen/core/time/to_s_spec.rb
MacRuby/trunk/spec/frozen/core/time/tv_sec_spec.rb
MacRuby/trunk/spec/frozen/core/time/tv_usec_spec.rb
MacRuby/trunk/spec/frozen/core/time/usec_spec.rb
MacRuby/trunk/spec/frozen/core/time/utc_offset_spec.rb
MacRuby/trunk/spec/frozen/core/time/utc_spec.rb
MacRuby/trunk/spec/frozen/core/time/wday_spec.rb
MacRuby/trunk/spec/frozen/core/time/yday_spec.rb
MacRuby/trunk/spec/frozen/core/time/year_spec.rb
MacRuby/trunk/spec/frozen/core/time/zone_spec.rb
MacRuby/trunk/spec/frozen/core/true/and_spec.rb
MacRuby/trunk/spec/frozen/core/true/inspect_spec.rb
MacRuby/trunk/spec/frozen/core/true/or_spec.rb
MacRuby/trunk/spec/frozen/core/true/to_s_spec.rb
MacRuby/trunk/spec/frozen/core/true/xor_spec.rb
MacRuby/trunk/spec/frozen/core/unboundmethod/arity_spec.rb
MacRuby/trunk/spec/frozen/core/unboundmethod/bind_spec_disabled.rb
MacRuby/trunk/spec/frozen/core/unboundmethod/clone_spec_disabled.rb
MacRuby/trunk/spec/frozen/core/unboundmethod/equal_value_spec.rb
MacRuby/trunk/spec/frozen/core/unboundmethod/inspect_spec.rb
MacRuby/trunk/spec/frozen/core/unboundmethod/name_spec.rb
MacRuby/trunk/spec/frozen/core/unboundmethod/owner_spec.rb
MacRuby/trunk/spec/frozen/core/unboundmethod/to_s_spec.rb
Added Paths:
-----------
MacRuby/trunk/spec/frozen/core/array/rotate_spec.rb
MacRuby/trunk/spec/frozen/core/continuation/new_spec.rb
MacRuby/trunk/spec/frozen/core/dir/shared/chroot.rb
MacRuby/trunk/spec/frozen/core/env/shared/key.rb
MacRuby/trunk/spec/frozen/core/io/fixtures/lines.txt
MacRuby/trunk/spec/frozen/core/kernel/shared/abort.rb
MacRuby/trunk/spec/frozen/core/kernel/shared/load.rb
MacRuby/trunk/spec/frozen/core/kernel/shared/require.rb
MacRuby/trunk/spec/frozen/core/module/fixtures/autoload_w2.rb
MacRuby/trunk/spec/frozen/core/time/to_r_spec.rb
Modified: MacRuby/trunk/spec/frozen/core/argf/argf_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/argf_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/argf_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ARGF" do
it "is extended by the Enumerable module" do
Modified: MacRuby/trunk/spec/frozen/core/argf/binmode_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/binmode_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/binmode_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ARGF.binmode" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/argf/bytes_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/bytes_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/bytes_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/each_byte'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/each_byte', __FILE__)
ruby_version_is "1.8.7" do
describe "ARGF.bytes" do
Modified: MacRuby/trunk/spec/frozen/core/argf/chars_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/chars_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/chars_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/each_char'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/each_char', __FILE__)
ruby_version_is "1.8.7" do
describe "ARGF.chars" do
Modified: MacRuby/trunk/spec/frozen/core/argf/close_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/close_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/close_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ARGF.close" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/argf/closed_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/closed_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/closed_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ARGF.closed?" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/argf/each_byte_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/each_byte_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/each_byte_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/each_byte'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/each_byte', __FILE__)
describe "ARGF.each_byte" do
it_behaves_like :argf_each_byte, :each_byte
Modified: MacRuby/trunk/spec/frozen/core/argf/each_char_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/each_char_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/each_char_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/each_char'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/each_char', __FILE__)
ruby_version_is "1.8.7" do
describe "ARGF.each_char" do
Modified: MacRuby/trunk/spec/frozen/core/argf/each_line_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/each_line_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/each_line_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/each_line'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/each_line', __FILE__)
describe "ARGF.each_line" do
it_behaves_like :argf_each_line, :each_line
Modified: MacRuby/trunk/spec/frozen/core/argf/each_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/each_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/each_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/each_line'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/each_line', __FILE__)
describe "ARGF.each" do
it_behaves_like :argf_each_line, :each
Modified: MacRuby/trunk/spec/frozen/core/argf/eof_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/eof_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/eof_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/eof'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/eof', __FILE__)
describe "ARGF.eof" do
it_behaves_like :argf_eof, :eof
Modified: MacRuby/trunk/spec/frozen/core/argf/file_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/file_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/file_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ARGF.file" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/argf/filename_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/filename_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/filename_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/filename'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/filename', __FILE__)
describe "ARGF.filename" do
it_behaves_like :argf_filename, :filename
Modified: MacRuby/trunk/spec/frozen/core/argf/fileno_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/fileno_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/fileno_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/fileno'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/fileno', __FILE__)
describe "ARGF.fileno" do
it_behaves_like :argf_fileno, :fileno
Modified: MacRuby/trunk/spec/frozen/core/argf/getc_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/getc_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/getc_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/getc'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/getc', __FILE__)
describe "ARGF.getc" do
it_behaves_like :argf_getc, :getc
Modified: MacRuby/trunk/spec/frozen/core/argf/gets_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/gets_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/gets_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/gets'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/gets', __FILE__)
describe "ARGF.gets" do
it_behaves_like :argf_gets, :gets
Modified: MacRuby/trunk/spec/frozen/core/argf/lineno_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/lineno_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/lineno_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ARGF.lineno" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/argf/path_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/path_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/path_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/filename'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/filename', __FILE__)
describe "ARGF.path" do
it_behaves_like :argf_filename, :path
Modified: MacRuby/trunk/spec/frozen/core/argf/pos_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/pos_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/pos_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/pos'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/pos', __FILE__)
describe "ARGF.pos" do
it_behaves_like :argf_pos, :pos
Modified: MacRuby/trunk/spec/frozen/core/argf/read_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/read_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/read_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ARGF.read" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/argf/readchar_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/readchar_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/readchar_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/getc'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/getc', __FILE__)
describe "ARGF.getc" do
it_behaves_like :argf_getc, :readchar
Modified: MacRuby/trunk/spec/frozen/core/argf/readline_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/readline_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/readline_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/gets'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/gets', __FILE__)
describe "ARGF.readline" do
it_behaves_like :argf_gets, :readline
Modified: MacRuby/trunk/spec/frozen/core/argf/readlines_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/readlines_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/readlines_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/readlines'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/readlines', __FILE__)
describe "ARGF.readlines" do
it_behaves_like :argf_readlines, :readlines
Modified: MacRuby/trunk/spec/frozen/core/argf/rewind_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/rewind_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/rewind_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ARGF.rewind" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/argf/seek_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/seek_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/seek_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ARGF.seek" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/argf/shared/each_byte.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/shared/each_byte.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/shared/each_byte.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -20,11 +20,9 @@
end
end
- ruby_bug "#1633", "1.9.2" do
- it "returns self when passed a block" do
- argv [@file1_name, @file2_name] do
- ARGF.send(@method) {}.should equal(ARGF)
- end
+ it "returns self when passed a block" do
+ argv [@file1_name, @file2_name] do
+ ARGF.send(@method) {}.should equal(ARGF)
end
end
Modified: MacRuby/trunk/spec/frozen/core/argf/shared/each_char.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/shared/each_char.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/shared/each_char.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -20,11 +20,9 @@
end
end
- ruby_bug "#1633", "1.9.2" do
- it "returns self when passed a block" do
- argv [@file1_name, @file2_name] do
- ARGF.send(@method) {}.should equal(ARGF)
- end
+ it "returns self when passed a block" do
+ argv [@file1_name, @file2_name] do
+ ARGF.send(@method) {}.should equal(ARGF)
end
end
Modified: MacRuby/trunk/spec/frozen/core/argf/shared/each_line.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/shared/each_line.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/shared/each_line.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -19,11 +19,9 @@
end
end
- ruby_bug "#1633", "1.9.2" do
- it "returns self when passed a block" do
- argv [@file1_name, @file2_name] do
- ARGF.send(@method) {}.should equal(ARGF)
- end
+ it "returns self when passed a block" do
+ argv [@file1_name, @file2_name] do
+ ARGF.send(@method) {}.should equal(ARGF)
end
end
end
Modified: MacRuby/trunk/spec/frozen/core/argf/shared/gets.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/shared/gets.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/shared/gets.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -77,13 +77,16 @@
rm_r @tmp1_name, @tmp2_name, @tmp1_name_bak, @tmp2_name_bak
end
- it "modifies the files when in place edit mode is on" do
- ruby_exe(@code,
- :options => "-i",
- :args => "#{@tmp1_name} #{@tmp2_name}")
+ # -i with no backup extension is not supported on Windows
+ platform_is_not :os => :windows do
+ it "modifies the files when in place edit mode is on" do
+ ruby_exe(@code,
+ :options => "-i",
+ :args => "#{@tmp1_name} #{@tmp2_name}")
- File.read(@tmp1_name).should == "x\nx\n"
- File.read(@tmp2_name).should == "x\nx\n"
+ File.read(@tmp1_name).should == "x\nx\n"
+ File.read(@tmp2_name).should == "x\nx\n"
+ end
end
it "modifies and backups two files when in place edit mode is on" do
Modified: MacRuby/trunk/spec/frozen/core/argf/skip_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/skip_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/skip_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ARGF.skip" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/argf/tell_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/tell_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/tell_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/pos'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/pos', __FILE__)
describe "ARGF.tell" do
it_behaves_like :argf_pos, :tell
Modified: MacRuby/trunk/spec/frozen/core/argf/to_a_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/to_a_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/to_a_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/readlines'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/readlines', __FILE__)
describe "ARGF.to_a" do
it_behaves_like :argf_readlines, :to_a
Modified: MacRuby/trunk/spec/frozen/core/argf/to_i_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/to_i_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/to_i_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/fileno'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/fileno', __FILE__)
describe "ARGF.to_i" do
it_behaves_like :argf_fileno, :to_i
Modified: MacRuby/trunk/spec/frozen/core/argf/to_io_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/to_io_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/to_io_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ARGF.to_io" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/argf/to_s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/argf/to_s_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/argf/to_s_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ARGF.to_s" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/array/allocate_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/allocate_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/allocate_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Array.allocate" do
it "returns an instance of Array" do
Modified: MacRuby/trunk/spec/frozen/core/array/append_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/append_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/append_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#<<" do
it "pushes the object onto the end of the array" do
Modified: MacRuby/trunk/spec/frozen/core/array/array_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/array_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/array_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Array" do
it "includes Enumerable" do
Modified: MacRuby/trunk/spec/frozen/core/array/assoc_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/assoc_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/assoc_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#assoc" do
it "returns the first array whose 1st item is == obj or nil" do
Modified: MacRuby/trunk/spec/frozen/core/array/at_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/at_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/at_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#at" do
it "returns the (n+1)'th element for the passed index n" do
Modified: MacRuby/trunk/spec/frozen/core/array/choice_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/choice_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/choice_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#choice" do
ruby_version_is "" ... "1.8.7" do
Modified: MacRuby/trunk/spec/frozen/core/array/clear_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/clear_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/clear_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#clear" do
it "removes all elements" do
Modified: MacRuby/trunk/spec/frozen/core/array/clone_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/clone_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/clone_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/clone'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/clone', __FILE__)
describe "Array#clone" do
it_behaves_like :array_clone, :clone
Modified: MacRuby/trunk/spec/frozen/core/array/collect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/collect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/collect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/collect'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/collect', __FILE__)
describe "Array#collect" do
it_behaves_like(:array_collect, :collect)
Modified: MacRuby/trunk/spec/frozen/core/array/combination_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/combination_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/combination_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,9 +1,9 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Array#combination" do
ruby_version_is "1.8.7" do
it "returns an enumerator when no block is provided" do
- [1, 2, 3, 4].combination(2).should be_kind_of(enumerator_class)
+ [1, 2, 3, 4].combination(2).should be_an_instance_of(enumerator_class)
end
it "returns self when a block is given" do
Modified: MacRuby/trunk/spec/frozen/core/array/compact_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/compact_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/compact_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#compact" do
it "returns a copy of array with all nil elements removed" do
Modified: MacRuby/trunk/spec/frozen/core/array/comparison_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/comparison_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/comparison_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#<=>" do
it "calls <=> left to right and return first non-0 result" do
Modified: MacRuby/trunk/spec/frozen/core/array/concat_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/concat_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/concat_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#concat" do
it "returns the array itself" do
@@ -32,25 +32,25 @@
[].concat(obj).should == [5, 6, 7]
end
- ruby_version_is '' ... '1.9' do
+ ruby_version_is ""..."1.9" do
it "raises a TypeError when Array is frozen and modification occurs" do
lambda { ArraySpecs.frozen_array.concat [1] }.should raise_error(TypeError)
end
- end
- ruby_version_is '1.9' do
- ruby_bug "[ruby-core:23666]", "1.9.2" do
- it "raises a RuntimeError when Array is frozen and modification occurs" do
- lambda { ArraySpecs.frozen_array.concat [1] }.should raise_error(RuntimeError)
- lambda { ArraySpecs.frozen_array.concat([]) }.should raise_error(RuntimeError)
- end
+ it "does not raise a TypeError when Array is frozen but no modification occurs" do
+ ArraySpecs.frozen_array.concat([]).should == [1, 2, 3]
end
end
- ruby_version_is ""..."1.9" do
- it "does not raise a TypeError when Array is frozen but no modification occurs" do
- ArraySpecs.frozen_array.concat([]).should == [1, 2, 3]
+ ruby_version_is "1.9" do
+ it "raises a RuntimeError when Array is frozen and modification occurs" do
+ lambda { ArraySpecs.frozen_array.concat [1] }.should raise_error(RuntimeError)
end
+
+ # see [ruby-core:23666]
+ it "raises a RuntimeError when Array is frozen and no modification occurs" do
+ lambda { ArraySpecs.frozen_array.concat([]) }.should raise_error(RuntimeError)
+ end
end
it "keeps tainted status" do
Modified: MacRuby/trunk/spec/frozen/core/array/constructor_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/constructor_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/constructor_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array.[]" do
it "returns a new array populated with the given elements" do
Modified: MacRuby/trunk/spec/frozen/core/array/delete_at_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/delete_at_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/delete_at_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#delete_at" do
it "removes the element at the specified index" do
Modified: MacRuby/trunk/spec/frozen/core/array/delete_if_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/delete_if_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/delete_if_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/enumeratorize'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/enumeratorize', __FILE__)
describe "Array#delete_if" do
before do
@@ -22,7 +22,7 @@
ruby_version_is '1.8.7' do
it "returns an Enumerator if no block given, and the enumerator can modify the original array" do
enum = @a.delete_if
- enum.should be_kind_of(enumerator_class)
+ enum.should be_an_instance_of(enumerator_class)
@a.should_not be_empty
enum.each { true }
@a.should be_empty
Modified: MacRuby/trunk/spec/frozen/core/array/delete_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/delete_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/delete_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#delete" do
it "removes elements that are #== to object" do
Modified: MacRuby/trunk/spec/frozen/core/array/dup_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/dup_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/dup_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/clone'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/clone', __FILE__)
describe "Array#dup" do
it_behaves_like :array_clone, :dup # FIX: no, clone and dup are not alike
Modified: MacRuby/trunk/spec/frozen/core/array/each_index_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/each_index_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/each_index_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/enumeratorize'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/enumeratorize', __FILE__)
# Modifying a collection while the contents are being iterated
# gives undefined behavior. See
Modified: MacRuby/trunk/spec/frozen/core/array/each_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/each_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/each_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/enumeratorize'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/enumeratorize', __FILE__)
# Modifying a collection while the contents are being iterated
# gives undefined behavior. See
Modified: MacRuby/trunk/spec/frozen/core/array/element_reference_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/element_reference_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/element_reference_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/slice'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/slice', __FILE__)
describe "Array#[]" do
it_behaves_like(:array_slice, :[])
Modified: MacRuby/trunk/spec/frozen/core/array/element_set_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/element_set_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/element_set_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#[]=" do
it "sets the value of the element at index" do
Modified: MacRuby/trunk/spec/frozen/core/array/empty_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/empty_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/empty_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#empty?" do
it "returns true if the array has no elements" do
Modified: MacRuby/trunk/spec/frozen/core/array/eql_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/eql_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/eql_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/eql'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/eql', __FILE__)
# Do not use #should_receive(:eql?) mocks in these specs
# because MSpec uses Hash for mocks and Hash calls #eql?.
Modified: MacRuby/trunk/spec/frozen/core/array/equal_value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/equal_value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/equal_value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,10 +1,36 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/eql'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/eql', __FILE__)
describe "Array#==" do
it_behaves_like :array_eql, :==
+ it "compares with an equivalent Array-like object using #to_ary" do
+ # FIXME: Proper implementation, commented out due
+ # to mspec bugs (#194 and #195):
+ # obj = mock('array-like')
+ # obj.should_receive(:respond_to?).with(:to_ary).and_return(true)
+ # obj.should_receive(:==).with([1]).and_return(true)
+
+ obj = Object.new
+ def obj.to_ary; [1]; end
+ def obj.==(arg); to_ary == arg; end
+
+ ([1] == obj).should be_true
+ ([[1]] == [obj]).should be_true
+ ([[[1], 3], 2] == [[obj, 3], 2]).should be_true
+
+ ruby_version_is "1.9.1" do
+ # recursive arrays
+ arr1 = [[1]]
+ arr1 << arr1
+ arr2 = [obj]
+ arr2 << arr2
+ (arr1 == arr2).should be_true
+ (arr2 == arr1).should be_true
+ end
+ end
+
it "returns false if any corresponding elements are not #==" do
a = ["a", "b", "c"]
b = ["a", "b", "not equal value"]
Modified: MacRuby/trunk/spec/frozen/core/array/fetch_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/fetch_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/fetch_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#fetch" do
it "returns the element at the passed index" do
Modified: MacRuby/trunk/spec/frozen/core/array/fill_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/fill_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/fill_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#fill" do
before(:all) do
Modified: MacRuby/trunk/spec/frozen/core/array/first_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/first_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/first_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#first" do
it "returns the first element" do
Modified: MacRuby/trunk/spec/frozen/core/array/flatten_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/flatten_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/flatten_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#flatten" do
it "returns a one-dimensional flattening recursively" do
@@ -11,14 +11,14 @@
[ 1, 2, [3, [4, 5] ] ].flatten(1).should == [1, 2, 3, [4, 5]]
end
- ruby_version_is ""..."1.9.2" do
+ ruby_version_is ""..."1.9" do
it "returns self when the level of recursion is 0" do
a = [ 1, 2, [3, [4, 5] ] ]
a.flatten(0).should equal(a)
end
end
- ruby_version_is "1.9.2" do
+ ruby_version_is "1.9" do
it "returns dup when the level of recursion is 0" do
a = [ 1, 2, [3, [4, 5] ] ]
a.flatten(0).should == a
@@ -184,26 +184,28 @@
ary.should == [1, 2, 3]
end
- ruby_version_is '' ... '1.9' do
- it "raises a TypeError on frozen arrays when modification would take place" do
+ ruby_version_is ""..."1.9" do
+ it "raises a TypeError on frozen arrays when the array is modified" do
nested_ary = [1, 2, []]
nested_ary.freeze
lambda { nested_ary.flatten! }.should raise_error(TypeError)
end
-
- it "does not raise on frozen arrays when no modification would take place" do
+
+ it "does not raise on frozen arrays when the array would not be modified" do
ArraySpecs.frozen_array.flatten!.should be_nil
end
end
- ruby_version_is '1.9' do
- ruby_bug "[ruby-core:23663]", "1.9.2" do
- it "raises a RuntimeError on frozen arrays" do
- nested_ary = [1, 2, []]
- nested_ary.freeze
- lambda { nested_ary.flatten! }.should raise_error(RuntimeError)
- lambda { ArraySpecs.frozen_array.flatten! }.should raise_error(RuntimeError)
- end
+ ruby_version_is "1.9" do
+ it "raises a RuntimeError on frozen arrays when the array is modified" do
+ nested_ary = [1, 2, []]
+ nested_ary.freeze
+ lambda { nested_ary.flatten! }.should raise_error(RuntimeError)
end
+
+ # see [ruby-core:23663]
+ it "raises a RuntimeError on frozen arrays when the array would not be modified" do
+ lambda { ArraySpecs.frozen_array.flatten! }.should raise_error(RuntimeError)
+ end
end
end
Modified: MacRuby/trunk/spec/frozen/core/array/frozen_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/frozen_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/frozen_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#frozen?" do
it "returns true if array is frozen" do
Modified: MacRuby/trunk/spec/frozen/core/array/hash_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/hash_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/hash_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#hash" do
it "returns the same fixnum for arrays with the same content" do
Modified: MacRuby/trunk/spec/frozen/core/array/include_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/include_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/include_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#include?" do
it "returns true if object is present, false otherwise" do
Modified: MacRuby/trunk/spec/frozen/core/array/index_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/index_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/index_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Array#index" do
it "returns the index of the first element == to object" do
Modified: MacRuby/trunk/spec/frozen/core/array/indexes_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/indexes_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/indexes_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/indexes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/indexes', __FILE__)
ruby_version_is '' ... '1.9' do
describe "Array#indexes" do
Modified: MacRuby/trunk/spec/frozen/core/array/indices_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/indices_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/indices_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/indexes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/indexes', __FILE__)
ruby_version_is '' ... '1.9' do
describe "Array#indices" do
Modified: MacRuby/trunk/spec/frozen/core/array/initialize_copy_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/initialize_copy_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/initialize_copy_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/replace'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/replace', __FILE__)
describe "Array#initialize_copy" do
it "is private" do
Modified: MacRuby/trunk/spec/frozen/core/array/initialize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/initialize_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/initialize_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#initialize" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/array/insert_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/insert_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/insert_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#insert" do
it "returns self" do
@@ -67,22 +67,24 @@
lambda { [].insert() }.should raise_error(ArgumentError)
end
- ruby_version_is '' ... '1.9' do
- it "raises a TypeError on frozen arrays if modification takes place" do
+ ruby_version_is ""..."1.9" do
+ it "raises a TypeError on frozen arrays when the array is modified" do
lambda { ArraySpecs.frozen_array.insert(0, 'x') }.should raise_error(TypeError)
end
- it "does not raise on frozen arrays if no modification takes place" do
+ it "does not raise on frozen arrays when the array would not be modified" do
ArraySpecs.frozen_array.insert(0).should == [1, 2, 3]
end
end
- ruby_version_is '1.9' do
- ruby_bug "[ruby-core:23666]", "1.9.2" do
- it "raises a RuntimeError on frozen arrays" do
- lambda { ArraySpecs.frozen_array.insert(0, 'x') }.should raise_error(RuntimeError)
- lambda { ArraySpecs.frozen_array.insert(0) }.should raise_error(RuntimeError)
- end
+ ruby_version_is "1.9" do
+ it "raises a RuntimeError on frozen arrays when the array is modified" do
+ lambda { ArraySpecs.frozen_array.insert(0, 'x') }.should raise_error(RuntimeError)
end
+
+ # see [ruby-core:23666]
+ it "raises a RuntimeError on frozen arrays when the array would not be modified" do
+ lambda { ArraySpecs.frozen_array.insert(0) }.should raise_error(RuntimeError)
+ end
end
end
Modified: MacRuby/trunk/spec/frozen/core/array/inspect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/inspect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/inspect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#inspect" do
it "returns a string" do
Modified: MacRuby/trunk/spec/frozen/core/array/intersection_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/intersection_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/intersection_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#&" do
it "creates an array with elements common to both arrays (intersection)" do
Modified: MacRuby/trunk/spec/frozen/core/array/join_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/join_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/join_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
require File.dirname(__FILE__) + '/../../shared/array/join'
describe "Array#join" do
Modified: MacRuby/trunk/spec/frozen/core/array/last_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/last_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/last_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#last" do
it "returns the last element" do
Modified: MacRuby/trunk/spec/frozen/core/array/length_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/length_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/length_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/length'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/length', __FILE__)
describe "Array#length" do
it_behaves_like(:array_length, :length)
Modified: MacRuby/trunk/spec/frozen/core/array/map_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/map_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/map_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/collect'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/collect', __FILE__)
describe "Array#map" do
it_behaves_like(:array_collect, :map)
Modified: MacRuby/trunk/spec/frozen/core/array/minus_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/minus_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/minus_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#-" do
it "creates an array minus any items from other array" do
Modified: MacRuby/trunk/spec/frozen/core/array/multiply_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/multiply_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/multiply_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
require File.dirname(__FILE__) + '/../../shared/array/join'
describe "Array#*" do
Modified: MacRuby/trunk/spec/frozen/core/array/new_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/new_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/new_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array.new" do
it "returns an instance of Array" do
Modified: MacRuby/trunk/spec/frozen/core/array/nitems_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/nitems_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/nitems_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
# Array#nitems was removed from Ruby 1.9.
ruby_version_is '' ... '1.9' do
Modified: MacRuby/trunk/spec/frozen/core/array/pack_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/pack_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/pack_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -3,24 +3,9 @@
# Script encoding of this file should be neither ASCII-8BIT, US-ASCII nor UTF-8.
# This makes it easier to verify that Strings are converted into correct encodings.
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
-if ENV['MRI'] then
- $: << 'kernel/core'
- require 'pack'
-end
-
-ruby_version_is '' ... '1.9' do
- def binary(str) str end
- def utf8(str) str end
-end
-ruby_version_is '1.9' do
- def binary(str) str.force_encoding(Encoding::ASCII_8BIT) end
- def utf8(str) str.force_encoding(Encoding::UTF_8) end
-end
-
-
# general behavior
describe "Array#pack" do
@@ -43,7 +28,7 @@
it "sequentially processes each pack format, which consumes element in the array, and finally concatenates their result" do
["abc", 1, 2, 3, '01000001', 0x20].pack('Av2NB8c').should ==
- binary("a\x01\x00\x02\x00\x00\x00\x00\x03A ")
+ encode("a\x01\x00\x02\x00\x00\x00\x00\x03A ", "binary")
end
it "just ignores unknown format" do
@@ -55,7 +40,7 @@
it "ignores white spaces" do
["abc", 1, 2, 3, '01000001', 0x20, 0x61].pack("A \f v2\tN\rB8\nc\vC").should ==
- binary("a\x01\x00\x02\x00\x00\x00\x00\x03A a")
+ encode("a\x01\x00\x02\x00\x00\x00\x00\x03A a", "binary")
end
it "treats a white space as a separator of formats" do
@@ -241,7 +226,7 @@
describe "Array#pack with format 'B'" do
it "returns packed bit-string descending order" do
- ["011000010110001001100011"].pack('B24').should == binary('abc')
+ ["011000010110001001100011"].pack('B24').should == encode('abc', "binary")
end
# [ruby-dev:37279]
@@ -255,23 +240,23 @@
end
it "conversion edge case: all zeros" do
- ["00000000"].pack('B8').should == binary("\000")
+ ["00000000"].pack('B8').should == encode("\000", "binary")
end
it "conversion edge case: all ones" do
- ["11111111"].pack('B8').should == binary("\xFF")
+ ["11111111"].pack('B8').should == encode("\xFF", "binary")
end
it "conversion edge case: left one" do
- ["10000000"].pack('B8').should == binary("\x80")
+ ["10000000"].pack('B8').should == encode("\x80", "binary")
end
it "conversion edge case: right one" do
- ["00000001"].pack('B8').should == binary("\x01")
+ ["00000001"].pack('B8').should == encode("\x01", "binary")
end
it "conversion edge case: edge sequences not in first char" do
- ["0000000010000000000000011111111100000000"].pack('B40').should == binary("\x00\x80\x01\xFF\x00")
+ ["0000000010000000000000011111111100000000"].pack('B40').should == encode("\x00\x80\x01\xFF\x00", "binary")
end
it "uses zeros if count is not multiple of 8" do
@@ -279,15 +264,15 @@
end
it "returns zero-char for each 2 of count that greater than string length" do
- [""].pack('B6').should == binary("\x00\x00\x00")
+ [""].pack('B6').should == encode("\x00\x00\x00", "binary")
end
it "returns extra zero char if count is odd and greater than string length" do
- [""].pack('B7').should == binary("\x00\x00\x00\x00")
+ [""].pack('B7').should == encode("\x00\x00\x00\x00", "binary")
end
it "starts new char if string is ended before char's 8 bits" do
- ["0011"].pack('B8').should == binary("0\x00\x00")
+ ["0011"].pack('B8').should == encode("0\x00\x00", "binary")
end
it "considers count = 1 if no explicit count it given" do
@@ -296,7 +281,7 @@
end
it "returns empty string if count = 0" do
- ["10101010"].pack('B0').should == binary("")
+ ["10101010"].pack('B0').should == encode("", "binary")
end
it "uses argument string length as count if count = *" do
@@ -326,27 +311,27 @@
describe "Array#pack with format 'b'" do
it "returns packed bit-string descending order" do
- ["100001100100011011000110"].pack('b24').should == binary('abc')
+ ["100001100100011011000110"].pack('b24').should == encode('abc', "binary")
end
it "conversion edge case: all zeros" do
- ["00000000"].pack('b8').should == binary("\x00")
+ ["00000000"].pack('b8').should == encode("\x00", "binary")
end
it "conversion edge case: all ones" do
- ["11111111"].pack('b8').should == binary("\xFF")
+ ["11111111"].pack('b8').should == encode("\xFF", "binary")
end
it "conversion edge case: left one" do
- ["10000000"].pack('b8').should == binary("\x01")
+ ["10000000"].pack('b8').should == encode("\x01", "binary")
end
it "conversion edge case: right one" do
- ["00000001"].pack('b8').should == binary("\x80")
+ ["00000001"].pack('b8').should == encode("\x80", "binary")
end
it "conversion edge case: edge sequences not in first char" do
- ["0000000010000000000000011111111100000000"].pack('b40').should == binary("\x00\x01\x80\xFF\x00")
+ ["0000000010000000000000011111111100000000"].pack('b40').should == encode("\x00\x01\x80\xFF\x00", "binary")
end
# [ruby-dev:37279]
@@ -364,15 +349,15 @@
end
it "returns zero-char for each 2 of count that greater than string length" do
- [""].pack('b6').should == binary("\x00\x00\x00")
+ [""].pack('b6').should == encode("\x00\x00\x00", "binary")
end
it "returns extra zero char if count is odd and greater than string length" do
- [""].pack('b7').should == binary("\x00\x00\x00\x00")
+ [""].pack('b7').should == encode("\x00\x00\x00\x00", "binary")
end
it "starts new char if argument string is ended before char's 8 bits" do
- ["0011"].pack('b8').should == binary("\x0C\x00\x00")
+ ["0011"].pack('b8').should == encode("\x0C\x00\x00", "binary")
end
it "considers count = 1 if no explicit count it given" do
@@ -381,7 +366,7 @@
end
it "returns empty string if count = 0" do
- ["10101010"].pack('b0').should == binary("")
+ ["10101010"].pack('b0').should == encode("", "binary")
end
it "uses argument string length as count if count = *" do
@@ -410,37 +395,37 @@
describe "Array#pack with format 'H'" do
it "encodes hexadecimal digits to byte sequence in the order of high-nibble first" do
- ["41"].pack("H2").should == binary("\x41")
- ["61"].pack("H2").should == binary("\x61")
- ["7e"].pack("H2").should == binary("\x7E")
- ["7E"].pack("H2").should == binary("\x7E")
- ["1"].pack("H").should == binary("\x10")
- ["7E1"].pack("H3").should == binary("\x7E\x10")
+ ["41"].pack("H2").should == encode("\x41", "binary")
+ ["61"].pack("H2").should == encode("\x61", "binary")
+ ["7e"].pack("H2").should == encode("\x7E", "binary")
+ ["7E"].pack("H2").should == encode("\x7E", "binary")
+ ["1"].pack("H").should == encode("\x10", "binary")
+ ["7E1"].pack("H3").should == encode("\x7E\x10", "binary")
end
it "ignores rest of the pack argument when the argument is too long" do
- ["41424344"].pack('H2').should == binary("\x41")
- ["41424344"].pack('H4').should == binary("\x41\x42")
+ ["41424344"].pack('H2').should == encode("\x41", "binary")
+ ["41424344"].pack('H4').should == encode("\x41\x42", "binary")
end
it "fills low-nibble of the last byte with 0 when count is odd" do
- ["41424344"].pack('H3').should == binary("\x41\x40")
- ["41424344"].pack('H5').should == binary("\x41\x42\x40")
+ ["41424344"].pack('H3').should == encode("\x41\x40", "binary")
+ ["41424344"].pack('H5').should == encode("\x41\x42\x40", "binary")
end
it "fills the rest bytes with 0 if pack argument has insufficient length" do
- ["4142"].pack("H4").should == binary("\x41\x42")
- ["4142"].pack("H5").should == binary("\x41\x42\x00")
- ["4142"].pack("H6").should == binary("\x41\x42\x00")
- ["4142"].pack("H7").should == binary("\x41\x42\x00\x00")
+ ["4142"].pack("H4").should == encode("\x41\x42", "binary")
+ ["4142"].pack("H5").should == encode("\x41\x42\x00", "binary")
+ ["4142"].pack("H6").should == encode("\x41\x42\x00", "binary")
+ ["4142"].pack("H7").should == encode("\x41\x42\x00\x00", "binary")
end
ruby_bug("[ruby-dev:37283]", "1.8.7.73") do
it "fills low-nibble of the last byte with 0 when count is odd even if pack argument has insufficient length" do
- ["414"].pack("H3").should == binary("\x41\x40")
- ["414"].pack("H4").should == binary("\x41\x40")
- ["414"].pack("H5").should == binary("\x41\x40\x00")
- ["414"].pack("H6").should == binary("\x41\x40\x00")
+ ["414"].pack("H3").should == encode("\x41\x40", "binary")
+ ["414"].pack("H4").should == encode("\x41\x40", "binary")
+ ["414"].pack("H5").should == encode("\x41\x40\x00", "binary")
+ ["414"].pack("H6").should == encode("\x41\x40\x00", "binary")
end
end
@@ -453,13 +438,13 @@
end
it "returns the whole argument string with star parameter" do
- ['414243444546'].pack('H*').should == binary("\x41\x42\x43\x44\x45\x46")
+ ['414243444546'].pack('H*').should == encode("\x41\x42\x43\x44\x45\x46", "binary")
end
it "consumes only one array item per a format" do
- %w(41 31 2a).pack("H2").should == binary("\x41")
- %w(41 31 2a).pack("H2H2H2").should == binary("\x41\x31\x2A")
- %w(41 31 2a).pack("H6").should == binary("\x41\x00\x00")
+ %w(41 31 2a).pack("H2").should == encode("\x41", "binary")
+ %w(41 31 2a).pack("H2H2H2").should == encode("\x41\x31\x2A", "binary")
+ %w(41 31 2a).pack("H6").should == encode("\x41\x00\x00", "binary")
end
it "tries to convert the pack argument to a String using #to_str" do
@@ -477,37 +462,37 @@
describe "Array#pack with format 'h'" do
it "encodes hexadecimal digits to byte sequence in the order of low-nibble first" do
- ["14"].pack("h2").should == binary("\x41")
- ["16"].pack("h2").should == binary("\x61")
- ["e7"].pack("h2").should == binary("\x7E")
- ["E7"].pack("h2").should == binary("\x7E")
- ["1"].pack("h").should == binary("\x01")
- ["E71"].pack("h3").should == binary("\x7E\x01")
+ ["14"].pack("h2").should == encode("\x41", "binary")
+ ["16"].pack("h2").should == encode("\x61", "binary")
+ ["e7"].pack("h2").should == encode("\x7E", "binary")
+ ["E7"].pack("h2").should == encode("\x7E", "binary")
+ ["1"].pack("h").should == encode("\x01", "binary")
+ ["E71"].pack("h3").should == encode("\x7E\x01", "binary")
end
it "ignores rest of the pack argument when the argument is too long" do
- ["14243444"].pack('h2').should == binary("\x41")
- ["14243444"].pack('h4').should == binary("\x41\x42")
+ ["14243444"].pack('h2').should == encode("\x41", "binary")
+ ["14243444"].pack('h4').should == encode("\x41\x42", "binary")
end
it "fills low-nibble of the last byte with 0 when count is odd" do
- ["14243444"].pack('h3').should == binary("\x41\x02")
- ["14243444"].pack('h5').should == binary("\x41\x42\x03")
+ ["14243444"].pack('h3').should == encode("\x41\x02", "binary")
+ ["14243444"].pack('h5').should == encode("\x41\x42\x03", "binary")
end
it "fills the rest bytes with 0 if pack argument has insufficient length" do
- ["1424"].pack("h4").should == binary("\x41\x42")
- ["1424"].pack("h5").should == binary("\x41\x42\x00")
- ["1424"].pack("h6").should == binary("\x41\x42\x00")
- ["1424"].pack("h7").should == binary("\x41\x42\x00\x00")
+ ["1424"].pack("h4").should == encode("\x41\x42", "binary")
+ ["1424"].pack("h5").should == encode("\x41\x42\x00", "binary")
+ ["1424"].pack("h6").should == encode("\x41\x42\x00", "binary")
+ ["1424"].pack("h7").should == encode("\x41\x42\x00\x00", "binary")
end
ruby_bug("[ruby-dev:37283]", "1.8.7.73") do
it "fills high-nibble of the last byte with 0 when count is odd even if pack argument has insufficient length" do
- ["142"].pack("h3").should == binary("\x41\x02")
- ["142"].pack("h4").should == binary("\x41\x02")
- ["142"].pack("h5").should == binary("\x41\x02\x00")
- ["142"].pack("h6").should == binary("\x41\x02\x00")
+ ["142"].pack("h3").should == encode("\x41\x02", "binary")
+ ["142"].pack("h4").should == encode("\x41\x02", "binary")
+ ["142"].pack("h5").should == encode("\x41\x02\x00", "binary")
+ ["142"].pack("h6").should == encode("\x41\x02\x00", "binary")
end
end
@@ -520,13 +505,13 @@
end
it "returns the whole argument string with star parameter" do
- ['142434445464'].pack('h*').should == binary("\x41\x42\x43\x44\x45\x46")
+ ['142434445464'].pack('h*').should == encode("\x41\x42\x43\x44\x45\x46", "binary")
end
it "consumes only one array item per a format" do
- %w(14 13 a2).pack("h2").should == binary("\x41")
- %w(14 13 a2).pack("h2h2h2").should == binary("\x41\x31\x2A")
- %w(14 13 a2).pack("h6").should == binary("\x41\x00\x00")
+ %w(14 13 a2).pack("h2").should == encode("\x41", "binary")
+ %w(14 13 a2).pack("h2h2h2").should == encode("\x41\x31\x2A", "binary")
+ %w(14 13 a2).pack("h6").should == encode("\x41\x00\x00", "binary")
end
it "tries to convert the pack argument to a String using #to_str" do
@@ -575,30 +560,30 @@
end
it "returns a string with byte of appropriate number" do
- [49].pack(format).should == binary('1')
+ [49].pack(format).should == encode('1', "binary")
end
it "regards negative values as 2's complement in order to converts it to positive" do
- [-1].pack(format).should == binary("\xFF")
- [-(2**7)].pack(format).should == binary("\x80")
+ [-1].pack(format).should == encode("\xFF", "binary")
+ [-(2**7)].pack(format).should == encode("\x80", "binary")
end
it "reduces value to fit in byte" do
- [2**8-1].pack(format).should == binary("\xFF")
- [2**8 ].pack(format).should == binary("\x00")
- [2**8+1].pack(format).should == binary("\x01")
+ [2**8-1].pack(format).should == encode("\xFF", "binary")
+ [2**8 ].pack(format).should == encode("\x00", "binary")
+ [2**8+1].pack(format).should == encode("\x01", "binary")
- [-2**8+1].pack(format).should == binary("\x01")
- [-2**8 ].pack(format).should == binary("\x00")
- [-2**8-1].pack(format).should == binary("\xFF")
+ [-2**8+1].pack(format).should == encode("\x01", "binary")
+ [-2**8 ].pack(format).should == encode("\x00", "binary")
+ [-2**8-1].pack(format).should == encode("\xFF", "binary")
end
it "tries to convert the pack argument to an Integer using #to_int" do
- [5.0].pack(format).should == binary("\x05")
+ [5.0].pack(format).should == encode("\x05", "binary")
obj = mock('to_int')
obj.should_receive(:to_int).and_return(5)
- [obj].pack(format).should == binary("\x05")
+ [obj].pack(format).should == encode("\x05", "binary")
end
not_compliant_on :rubinius do
@@ -617,16 +602,16 @@
end
it "processes count number of array elements if count given" do
- [1, 2, 3].pack(format(3)).should == binary("\x01\x02\x03")
- [1, 2, 3].pack(format(2) + format(1)).should == binary("\x01\x02\x03")
+ [1, 2, 3].pack(format(3)).should == encode("\x01\x02\x03", "binary")
+ [1, 2, 3].pack(format(2) + format(1)).should == encode("\x01\x02\x03", "binary")
end
it "returns empty string if count = 0" do
- [1, 2, 3].pack(format(0)).should == binary('')
+ [1, 2, 3].pack(format(0)).should == encode('', "binary")
end
it "with star parameter processes all remaining array items" do
- [1, 2, 3, 4, 5].pack(format('*')).should == binary("\x01\x02\x03\x04\x05")
+ [1, 2, 3, 4, 5].pack(format('*')).should == encode("\x01\x02\x03\x04\x05", "binary")
end
it "raises an ArgumentError if count is greater than array elements left" do
@@ -651,24 +636,24 @@
end
it "returns a string containing 2 bytes for an integer" do
- [0].pack(format).should == binary("\x00\x00")
- [0xABCD].pack(format).should == binary("\xCD\xAB")
+ [0].pack(format).should == encode("\x00\x00", "binary")
+ [0xABCD].pack(format).should == encode("\xCD\xAB", "binary")
end
it "regards negative values as 2's complement in order to converts it to positive" do
- [-1].pack(format).should == binary("\xFF\xFF")
- [-2**15].pack(format).should == binary("\x00\x80")
+ [-1].pack(format).should == encode("\xFF\xFF", "binary")
+ [-2**15].pack(format).should == encode("\x00\x80", "binary")
end
it "drops higher bytes when a pack argument is >= 2**16" do
- [2**16-1].pack(format).should == binary("\xFF\xFF")
- [2**16 ].pack(format).should == binary("\x00\x00")
- [2**16+1].pack(format).should == binary("\x01\x00")
+ [2**16-1].pack(format).should == encode("\xFF\xFF", "binary")
+ [2**16 ].pack(format).should == encode("\x00\x00", "binary")
+ [2**16+1].pack(format).should == encode("\x01\x00", "binary")
end
it "drops higher bytes when a pack argument is < -2**16" do
- [-2**16+1].pack(format).should == binary("\x01\x00") # 0x ..F 00 01
- [-2**16 ].pack(format).should == binary("\x00\x00") # 0x ..F 00 00
- [-2**16-1].pack(format).should == binary("\xFF\xFF") # 0x .FE FF FF
+ [-2**16+1].pack(format).should == encode("\x01\x00", "binary") # 0x ..F 00 01
+ [-2**16 ].pack(format).should == encode("\x00\x00", "binary") # 0x ..F 00 00
+ [-2**16-1].pack(format).should == encode("\xFF\xFF", "binary") # 0x .FE FF FF
end
ruby_version_is '' ... '1.9' do
@@ -699,38 +684,38 @@
ruby_version_is '1.9' do
platform_is :wordsize => 32 do
it "does not raise a RangeError even when a pack argument is >= 2**32" do
- [2**32-1].pack(format).should == binary("\xFF\xFF")
- [2**32 ].pack(format).should == binary("\x00\x00")
- [2**32+1].pack(format).should == binary("\x01\x00")
+ [2**32-1].pack(format).should == encode("\xFF\xFF", "binary")
+ [2**32 ].pack(format).should == encode("\x00\x00", "binary")
+ [2**32+1].pack(format).should == encode("\x01\x00", "binary")
end
it "does not raise a RangeError even when a pack argument is <= -2**32" do
- [-2**32+1].pack(format).should == binary("\x01\x00")
- [-2**32 ].pack(format).should == binary("\x00\x00")
- [-2**32-1].pack(format).should == binary("\xFF\xFF")
+ [-2**32+1].pack(format).should == encode("\x01\x00", "binary")
+ [-2**32 ].pack(format).should == encode("\x00\x00", "binary")
+ [-2**32-1].pack(format).should == encode("\xFF\xFF", "binary")
end
end
platform_is :wordsize => 64 do
it "does not raise a RangeError even when a pack argument is >= 2**64" do
- [2**64-1].pack(format).should == binary("\xFF\xFF")
- [2**64 ].pack(format).should == binary("\x00\x00")
- [2**64+1].pack(format).should == binary("\x01\x00")
+ [2**64-1].pack(format).should == encode("\xFF\xFF", "binary")
+ [2**64 ].pack(format).should == encode("\x00\x00", "binary")
+ [2**64+1].pack(format).should == encode("\x01\x00", "binary")
end
it "does not raise a RangeError even when a pack argument is <= -2**64" do
- [-2**64+1].pack(format).should == binary("\x01\x00")
- [-2**64 ].pack(format).should == binary("\x00\x00")
- [-2**64-1].pack(format).should == binary("\xFF\xFF")
+ [-2**64+1].pack(format).should == encode("\x01\x00", "binary")
+ [-2**64 ].pack(format).should == encode("\x00\x00", "binary")
+ [-2**64-1].pack(format).should == encode("\xFF\xFF", "binary")
end
end
end
it "tries to convert the pack argument to an Integer using #to_int" do
- [5.0].pack(format).should == binary("\x05\x00")
+ [5.0].pack(format).should == encode("\x05\x00", "binary")
obj = mock('to_int')
obj.should_receive(:to_int).and_return(5)
- [obj].pack(format).should == binary("\x05\x00")
+ [obj].pack(format).should == encode("\x05\x00", "binary")
end
it "raises a TypeError if a pack argument can't be coerced to Integer" do
@@ -741,17 +726,17 @@
end
it "processes count number of array elements if count given" do
- [1, 2, 3].pack(format(3)).should == binary("\x01\x00\x02\x00\x03\x00")
- [1, 2, 3].pack(format(2) + format(1)).should == binary("\x01\x00\x02\x00\x03\x00")
+ [1, 2, 3].pack(format(3)).should == encode("\x01\x00\x02\x00\x03\x00", "binary")
+ [1, 2, 3].pack(format(2) + format(1)).should == encode("\x01\x00\x02\x00\x03\x00", "binary")
end
it "returns empty string if count = 0" do
- [1, 2, 3].pack(format(0)).should == binary('')
+ [1, 2, 3].pack(format(0)).should == encode('', "binary")
end
it "with star parameter processes all remaining array items" do
[1, 2, 3, 4, 5].pack(format('*')).should ==
- binary("\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00")
+ encode("\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00", "binary")
end
it "raises an ArgumentError if count is greater than array elements left" do
@@ -775,33 +760,33 @@
end
it "returns a string containing 2 bytes for an integer" do
- [0].pack(format).should == binary("\x00\x00")
- [0xABCD].pack(format).should == binary("\xAB\xCD")
+ [0].pack(format).should == encode("\x00\x00", "binary")
+ [0xABCD].pack(format).should == encode("\xAB\xCD", "binary")
end
it "regards negative values as 2's complement in order to converts it to positive" do
- [-1].pack(format).should == binary("\xFF\xFF")
- [-2**15].pack(format).should == binary("\x80\x00")
+ [-1].pack(format).should == encode("\xFF\xFF", "binary")
+ [-2**15].pack(format).should == encode("\x80\x00", "binary")
end
it "drops higher bytes when a pack argument is >= 2**32" do
- [2**16-1].pack(format).should == binary("\xFF\xFF")
- [2**16 ].pack(format).should == binary("\x00\x00")
- [2**16+1].pack(format).should == binary("\x00\x01")
+ [2**16-1].pack(format).should == encode("\xFF\xFF", "binary")
+ [2**16 ].pack(format).should == encode("\x00\x00", "binary")
+ [2**16+1].pack(format).should == encode("\x00\x01", "binary")
end
it "drops higher bytes when a pack argument is < -2**32" do
- [-2**16+1].pack(format).should == binary("\x00\x01") # 0x ..F 00 01
- [-2**16 ].pack(format).should == binary("\x00\x00") # 0x ..F 00 00
- [-2**16-1].pack(format).should == binary("\xFF\xFF") # 0x .FE FF FF
+ [-2**16+1].pack(format).should == encode("\x00\x01", "binary") # 0x ..F 00 01
+ [-2**16 ].pack(format).should == encode("\x00\x00", "binary") # 0x ..F 00 00
+ [-2**16-1].pack(format).should == encode("\xFF\xFF", "binary") # 0x .FE FF FF
end
it "tries to convert the pack argument to an Integer using #to_int" do
- [5.0].pack(format).should == binary("\x00\x05")
+ [5.0].pack(format).should == encode("\x00\x05", "binary")
obj = mock('to_int')
obj.should_receive(:to_int).and_return(5)
- [obj].pack(format).should == binary("\x00\x05")
+ [obj].pack(format).should == encode("\x00\x05", "binary")
end
ruby_version_is '' ... '1.9' do
@@ -832,28 +817,28 @@
ruby_version_is '1.9' do
platform_is :wordsize => 32 do
it "does not raise a RangeError even when a pack argument is >= 2**32" do
- [2**32-1].pack(format).should == binary("\xFF\xFF")
- [2**32 ].pack(format).should == binary("\x00\x00")
- [2**32+1].pack(format).should == binary("\x00\x01")
+ [2**32-1].pack(format).should == encode("\xFF\xFF", "binary")
+ [2**32 ].pack(format).should == encode("\x00\x00", "binary")
+ [2**32+1].pack(format).should == encode("\x00\x01", "binary")
end
it "does not raise a RangeError even when a pack argument is <= -2**32" do
- [-2**32+1].pack(format).should == binary("\x00\x01")
- [-2**32 ].pack(format).should == binary("\x00\x00")
- [-2**32-1].pack(format).should == binary("\xFF\xFF")
+ [-2**32+1].pack(format).should == encode("\x00\x01", "binary")
+ [-2**32 ].pack(format).should == encode("\x00\x00", "binary")
+ [-2**32-1].pack(format).should == encode("\xFF\xFF", "binary")
end
end
platform_is :wordsize => 64 do
it "does not raise a RangeError even when a pack argument is >= 2**64" do
- [2**64-1].pack(format).should == binary("\xFF\xFF")
- [2**64 ].pack(format).should == binary("\x00\x00")
- [2**64+1].pack(format).should == binary("\x01\x00")
+ [2**64-1].pack(format).should == encode("\xFF\xFF", "binary")
+ [2**64 ].pack(format).should == encode("\x00\x00", "binary")
+ [2**64+1].pack(format).should == encode("\x00\x01", "binary")
end
it "does not raise a RangeError even when a pack argument is <= -2**64" do
- [-2**64+1].pack(format).should == binary("\x00\x01")
- [-2**64 ].pack(format).should == binary("\x00\x00")
- [-2**64-1].pack(format).should == binary("\xFF\xFF")
+ [-2**64+1].pack(format).should == encode("\x00\x01", "binary")
+ [-2**64 ].pack(format).should == encode("\x00\x00", "binary")
+ [-2**64-1].pack(format).should == encode("\xFF\xFF", "binary")
end
end
end
@@ -866,17 +851,17 @@
end
it "processes count number of array elements if count given" do
- [1, 2, 3].pack(format(3)).should == binary("\x00\x01\x00\x02\x00\x03")
- [1, 2, 3].pack(format(2) + format(1)).should == binary("\x00\x01\x00\x02\x00\x03")
+ [1, 2, 3].pack(format(3)).should == encode("\x00\x01\x00\x02\x00\x03", "binary")
+ [1, 2, 3].pack(format(2) + format(1)).should == encode("\x00\x01\x00\x02\x00\x03", "binary")
end
it "returns empty string if count = 0" do
- [1, 2, 3].pack(format(0)).should == binary('')
+ [1, 2, 3].pack(format(0)).should == encode('', "binary")
end
it "with star parameter processes all remaining array items" do
[1, 2, 3, 4, 5].pack(format('*')).should ==
- binary("\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05")
+ encode("\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05", "binary")
end
it "raises an ArgumentError if count is greater than array elements left" do
@@ -900,8 +885,8 @@
end
it "returns a string containing 4 bytes for an integer" do
- [0].pack(format).should == binary("\x00\x00\x00\x00")
- [0xABCDEF01].pack(format).should == binary("\x01\xEF\xCD\xAB")
+ [0].pack(format).should == encode("\x00\x00\x00\x00", "binary")
+ [0xABCDEF01].pack(format).should == encode("\x01\xEF\xCD\xAB", "binary")
end
ruby_version_is '' ... '1.9' do
@@ -918,44 +903,44 @@
end
platform_is :wordsize => 64 do
it "drops higher bytes when a pack argument is >= 2**32" do
- [2**32-1].pack(format).should == binary("\xFF\xFF\xFF\xFF")
- [2**32 ].pack(format).should == binary("\x00\x00\x00\x00")
- [2**32+1].pack(format).should == binary("\x01\x00\x00\x00")
+ [2**32-1].pack(format).should == encode("\xFF\xFF\xFF\xFF", "binary")
+ [2**32 ].pack(format).should == encode("\x00\x00\x00\x00", "binary")
+ [2**32+1].pack(format).should == encode("\x01\x00\x00\x00", "binary")
end
it "drops higher bytes when a pack argument is < -2**32" do
- [-2**32+1].pack(format).should == binary("\x01\x00\x00\x00") # 0x ..F 00 00 00 01
- [-2**32 ].pack(format).should == binary("\x00\x00\x00\x00") # 0x ..F 00 00 00 00
- [-2**32-1].pack(format).should == binary("\xFF\xFF\xFF\xFF") # 0x .FE FF FF FF FF
+ [-2**32+1].pack(format).should == encode("\x01\x00\x00\x00", "binary") # 0x ..F 00 00 00 01
+ [-2**32 ].pack(format).should == encode("\x00\x00\x00\x00", "binary") # 0x ..F 00 00 00 00
+ [-2**32-1].pack(format).should == encode("\xFF\xFF\xFF\xFF", "binary") # 0x .FE FF FF FF FF
end
end
end
# feature changed by MRI r5542 - [ruby-dev:22654].
ruby_version_is '1.9' do
it "drops higher bytes when a pack argument is >= 2**32" do
- [2**32-1].pack(format).should == binary("\xFF\xFF\xFF\xFF")
- [2**32 ].pack(format).should == binary("\x00\x00\x00\x00")
- [2**32+1].pack(format).should == binary("\x01\x00\x00\x00")
+ [2**32-1].pack(format).should == encode("\xFF\xFF\xFF\xFF", "binary")
+ [2**32 ].pack(format).should == encode("\x00\x00\x00\x00", "binary")
+ [2**32+1].pack(format).should == encode("\x01\x00\x00\x00", "binary")
end
it "drops higher bytes when a pack argument is < -2**32" do
- [-2**32+1].pack(format).should == binary("\x01\x00\x00\x00") # 0x ..F 00 00 00 01
- [-2**32 ].pack(format).should == binary("\x00\x00\x00\x00") # 0x ..F 00 00 00 00
- [-2**32-1].pack(format).should == binary("\xFF\xFF\xFF\xFF") # 0x .FE FF FF FF FF
+ [-2**32+1].pack(format).should == encode("\x01\x00\x00\x00", "binary") # 0x ..F 00 00 00 01
+ [-2**32 ].pack(format).should == encode("\x00\x00\x00\x00", "binary") # 0x ..F 00 00 00 00
+ [-2**32-1].pack(format).should == encode("\xFF\xFF\xFF\xFF", "binary") # 0x .FE FF FF FF FF
end
end
it "regards negative values as 2's complement in order to converts it to positive" do
- [-1].pack(format).should == binary("\xFF\xFF\xFF\xFF")
- [-2**31].pack(format).should == binary("\x00\x00\x00\x80")
+ [-1].pack(format).should == encode("\xFF\xFF\xFF\xFF", "binary")
+ [-2**31].pack(format).should == encode("\x00\x00\x00\x80", "binary")
end
it "tries to convert the pack argument to an Integer using #to_int" do
- [5.0].pack(format).should == binary("\x05\x00\x00\x00")
+ [5.0].pack(format).should == encode("\x05\x00\x00\x00", "binary")
obj = mock('to_int')
obj.should_receive(:to_int).and_return(5)
- [obj].pack(format).should == binary("\x05\x00\x00\x00")
+ [obj].pack(format).should == encode("\x05\x00\x00\x00", "binary")
end
it "raises a TypeError if a pack argument can't be coerced to Integer" do
@@ -966,17 +951,17 @@
end
it "processes count number of array elements if count given" do
- [1, 2, 3].pack(format(3)).should == binary("\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00")
- [1, 2, 3].pack(format(2) + format(1)).should == binary("\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00")
+ [1, 2, 3].pack(format(3)).should == encode("\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00", "binary")
+ [1, 2, 3].pack(format(2) + format(1)).should == encode("\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00", "binary")
end
it "returns empty string if count = 0" do
- [1, 2, 3].pack(format(0)).should == binary('')
+ [1, 2, 3].pack(format(0)).should == encode('', "binary")
end
it "with star parameter processes all remaining array items" do
[1, 2, 3, 4, 5].pack(format('*')).should ==
- binary("\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x04\x00\x00\x00\x05\x00\x00\x00")
+ encode("\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x04\x00\x00\x00\x05\x00\x00\x00", "binary")
end
it "raises an ArgumentError if count is greater than array elements left" do
@@ -1000,13 +985,13 @@
end
it "returns a string containing 4 bytes for an integer" do
- [0].pack(format).should == binary("\x00\x00\x00\x00")
- [0xABCDEF01].pack(format).should == binary("\xAB\xCD\xEF\x01")
+ [0].pack(format).should == encode("\x00\x00\x00\x00", "binary")
+ [0xABCDEF01].pack(format).should == encode("\xAB\xCD\xEF\x01", "binary")
end
it "regards negative values as 2's complement in order to converts it to positive" do
- [-1].pack(format).should == binary("\xFF\xFF\xFF\xFF")
- [-2**31].pack(format).should == binary("\x80\x00\x00\x00")
+ [-1].pack(format).should == encode("\xFF\xFF\xFF\xFF", "binary")
+ [-2**31].pack(format).should == encode("\x80\x00\x00\x00", "binary")
end
ruby_version_is '' ... '1.9' do
@@ -1023,39 +1008,39 @@
end
platform_is :wordsize => 64 do
it "drops higher bytes when a pack argument is >= 2**32" do
- [2**32-1].pack(format).should == binary("\xFF\xFF\xFF\xFF")
- [2**32 ].pack(format).should == binary("\x00\x00\x00\x00")
- [2**32+1].pack(format).should == binary("\x00\x00\x00\x01")
+ [2**32-1].pack(format).should == encode("\xFF\xFF\xFF\xFF", "binary")
+ [2**32 ].pack(format).should == encode("\x00\x00\x00\x00", "binary")
+ [2**32+1].pack(format).should == encode("\x00\x00\x00\x01", "binary")
end
it "drops higher bytes when a pack argument is < -2**32" do
- [-2**32+1].pack(format).should == binary("\x00\x00\x00\x01") # 0x ..F 00 00 00 01
- [-2**32 ].pack(format).should == binary("\x00\x00\x00\x00") # 0x ..F 00 00 00 00
- [-2**32-1].pack(format).should == binary("\xFF\xFF\xFF\xFF") # 0x .FE FF FF FF FF
+ [-2**32+1].pack(format).should == encode("\x00\x00\x00\x01", "binary") # 0x ..F 00 00 00 01
+ [-2**32 ].pack(format).should == encode("\x00\x00\x00\x00", "binary") # 0x ..F 00 00 00 00
+ [-2**32-1].pack(format).should == encode("\xFF\xFF\xFF\xFF", "binary") # 0x .FE FF FF FF FF
end
end
end
# feature changed by MRI r5542 - [ruby-dev:22654].
ruby_version_is '1.9' do
it "drops higher bytes when a pack argument is >= 2**32" do
- [2**32-1].pack(format).should == binary("\xFF\xFF\xFF\xFF")
- [2**32 ].pack(format).should == binary("\x00\x00\x00\x00")
- [2**32+1].pack(format).should == binary("\x00\x00\x00\x01")
+ [2**32-1].pack(format).should == encode("\xFF\xFF\xFF\xFF", "binary")
+ [2**32 ].pack(format).should == encode("\x00\x00\x00\x00", "binary")
+ [2**32+1].pack(format).should == encode("\x00\x00\x00\x01", "binary")
end
it "drops higher bytes when a pack argument is < -2**32" do
- [-2**32+1].pack(format).should == binary("\x00\x00\x00\x01") # 0x ..F 00 00 00 01
- [-2**32 ].pack(format).should == binary("\x00\x00\x00\x00") # 0x ..F 00 00 00 00
- [-2**32-1].pack(format).should == binary("\xFF\xFF\xFF\xFF") # 0x .FE FF FF FF FF
+ [-2**32+1].pack(format).should == encode("\x00\x00\x00\x01", "binary") # 0x ..F 00 00 00 01
+ [-2**32 ].pack(format).should == encode("\x00\x00\x00\x00", "binary") # 0x ..F 00 00 00 00
+ [-2**32-1].pack(format).should == encode("\xFF\xFF\xFF\xFF", "binary") # 0x .FE FF FF FF FF
end
end
it "tries to convert the pack argument to an Integer using #to_int" do
- [5.0].pack(format).should == binary("\x00\x00\x00\x05")
+ [5.0].pack(format).should == encode("\x00\x00\x00\x05", "binary")
obj = mock('to_int')
obj.should_receive(:to_int).and_return(5)
- [obj].pack(format).should == binary("\x00\x00\x00\x05")
+ [obj].pack(format).should == encode("\x00\x00\x00\x05", "binary")
end
it "raises a TypeError if a pack argument can't be coerced to Integer" do
@@ -1066,17 +1051,17 @@
end
it "processes count number of array elements if count given" do
- [1, 2, 3].pack(format(3)).should == binary("\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x03")
- [1, 2, 3].pack(format(2) + format(1)).should == binary("\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x03")
+ [1, 2, 3].pack(format(3)).should == encode("\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x03", "binary")
+ [1, 2, 3].pack(format(2) + format(1)).should == encode("\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x03", "binary")
end
it "returns empty string if count = 0" do
- [1, 2, 3].pack(format(0)).should == binary('')
+ [1, 2, 3].pack(format(0)).should == encode('', "binary")
end
it "with star parameter processes all remaining array items" do
[1, 2, 3, 4, 5].pack(format('*')).should ==
- binary("\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x04\x00\x00\x00\x05")
+ encode("\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x04\x00\x00\x00\x05", "binary")
end
it "raises an ArgumentError if count is greater than array elements left" do
@@ -1100,13 +1085,13 @@
end
it "returns a string containing 8 bytes for an integer" do
- [0].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x00")
- [0xABCDEF0123456789].pack(format).should == binary("\x89\x67\x45\x23\x01\xEF\xCD\xAB")
+ [0].pack(format).should == encode("\x00\x00\x00\x00\x00\x00\x00\x00", "binary")
+ [0xABCDEF0123456789].pack(format).should == encode("\x89\x67\x45\x23\x01\xEF\xCD\xAB", "binary")
end
it "regards negative values as 2's complement in order to converts it to positive" do
- [-1].pack(format).should == binary("\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF")
- [-2**63].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x80")
+ [-1].pack(format).should == encode("\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF", "binary")
+ [-2**63].pack(format).should == encode("\x00\x00\x00\x00\x00\x00\x00\x80", "binary")
end
ruby_version_is '' ... '1.9' do
@@ -1123,24 +1108,24 @@
# feature changed by MRI r5542 - [ruby-dev:22654].
ruby_version_is '1.9' do
it "drops higher bytes when a pack argument is >= 2**64" do
- [2**64-1].pack(format).should == binary("\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF")
- [2**64 ].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x00")
- [2**64+1].pack(format).should == binary("\x01\x00\x00\x00\x00\x00\x00\x00")
+ [2**64-1].pack(format).should == encode("\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF", "binary")
+ [2**64 ].pack(format).should == encode("\x00\x00\x00\x00\x00\x00\x00\x00", "binary")
+ [2**64+1].pack(format).should == encode("\x01\x00\x00\x00\x00\x00\x00\x00", "binary")
end
it "drops higher bytes when a pack argument is < -2**64" do
- [-2**64+1].pack(format).should == binary("\x01\x00\x00\x00\x00\x00\x00\x00") # 0x ..F 00 00 00 00 00 00 00 01
- [-2**64 ].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x00") # 0x ..F 00 00 00 00 00 00 00 00
- [-2**64-1].pack(format).should == binary("\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF") # 0x .FE FF FF FF FF FF FF FF FF
+ [-2**64+1].pack(format).should == encode("\x01\x00\x00\x00\x00\x00\x00\x00", "binary") # 0x ..F 00 00 00 00 00 00 00 01
+ [-2**64 ].pack(format).should == encode("\x00\x00\x00\x00\x00\x00\x00\x00", "binary") # 0x ..F 00 00 00 00 00 00 00 00
+ [-2**64-1].pack(format).should == encode("\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF", "binary") # 0x .FE FF FF FF FF FF FF FF FF
end
end
it "tries to convert the pack argument to an Integer using #to_int" do
- [5.0].pack(format).should == binary("\x05\x00\x00\x00\x00\x00\x00\x00")
+ [5.0].pack(format).should == encode("\x05\x00\x00\x00\x00\x00\x00\x00", "binary")
obj = mock('to_int')
obj.should_receive(:to_int).and_return(5)
- [obj].pack(format).should == binary("\x05\x00\x00\x00\x00\x00\x00\x00")
+ [obj].pack(format).should == encode("\x05\x00\x00\x00\x00\x00\x00\x00", "binary")
end
it "raises a TypeError if a pack argument can't be coerced to Integer" do
@@ -1151,27 +1136,27 @@
end
it "processes count number of array elements if count given" do
- [1, 2, 3].pack(format(3)).should == binary(
+ [1, 2, 3].pack(format(3)).should == encode(
"\x01\x00\x00\x00\x00\x00\x00\x00" +
"\x02\x00\x00\x00\x00\x00\x00\x00" +
- "\x03\x00\x00\x00\x00\x00\x00\x00" )
- [1, 2, 3].pack(format(2) + format(1)).should == binary(
+ "\x03\x00\x00\x00\x00\x00\x00\x00" , "binary")
+ [1, 2, 3].pack(format(2) + format(1)).should == encode(
"\x01\x00\x00\x00\x00\x00\x00\x00" +
"\x02\x00\x00\x00\x00\x00\x00\x00" +
- "\x03\x00\x00\x00\x00\x00\x00\x00" )
+ "\x03\x00\x00\x00\x00\x00\x00\x00" , "binary")
end
it "returns empty string if count = 0" do
- [1, 2, 3].pack(format(0)).should == binary('')
+ [1, 2, 3].pack(format(0)).should == encode('', "binary")
end
it "with star parameter processes all remaining array items" do
- [1, 2, 3, 4, 5].pack(format('*')).should == binary(
+ [1, 2, 3, 4, 5].pack(format('*')).should == encode(
"\x01\x00\x00\x00\x00\x00\x00\x00" +
"\x02\x00\x00\x00\x00\x00\x00\x00" +
"\x03\x00\x00\x00\x00\x00\x00\x00" +
"\x04\x00\x00\x00\x00\x00\x00\x00" +
- "\x05\x00\x00\x00\x00\x00\x00\x00" )
+ "\x05\x00\x00\x00\x00\x00\x00\x00" , "binary")
end
it "raises an ArgumentError if count is greater than array elements left" do
@@ -1195,13 +1180,13 @@
end
it "returns a string containing 8 bytes for an integer" do
- [0].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x00")
- [0xABCDEF0123456789].pack(format).should == binary("\xAB\xCD\xEF\x01\x23\x45\x67\x89")
+ [0].pack(format).should == encode("\x00\x00\x00\x00\x00\x00\x00\x00", "binary")
+ [0xABCDEF0123456789].pack(format).should == encode("\xAB\xCD\xEF\x01\x23\x45\x67\x89", "binary")
end
it "regards negative values as 2's complement in order to converts it to positive" do
- [-1].pack(format).should == binary("\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF")
- [-2**63].pack(format).should == binary("\x80\x00\x00\x00\x00\x00\x00\x00")
+ [-1].pack(format).should == encode("\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF", "binary")
+ [-2**63].pack(format).should == encode("\x80\x00\x00\x00\x00\x00\x00\x00", "binary")
end
ruby_version_is '' ... '1.9' do
@@ -1218,24 +1203,24 @@
# feature changed by MRI r5542 - [ruby-dev:22654].
ruby_version_is '1.9' do
it "drops higher bytes when a pack argument is >= 2**64" do
- [2**64-1].pack(format).should == binary("\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF")
- [2**64 ].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x00")
- [2**64+1].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x01")
+ [2**64-1].pack(format).should == encode("\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF", "binary")
+ [2**64 ].pack(format).should == encode("\x00\x00\x00\x00\x00\x00\x00\x00", "binary")
+ [2**64+1].pack(format).should == encode("\x00\x00\x00\x00\x00\x00\x00\x01", "binary")
end
it "drops higher bytes when a pack argument is < -2**64" do
- [-2**64+1].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x01") # 0x ..F 00 00 00 00 00 00 00 01
- [-2**64 ].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x00") # 0x ..F 00 00 00 00 00 00 00 00
- [-2**64-1].pack(format).should == binary("\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF") # 0x .FE FF FF FF FF FF FF FF FF
+ [-2**64+1].pack(format).should == encode("\x00\x00\x00\x00\x00\x00\x00\x01", "binary") # 0x ..F 00 00 00 00 00 00 00 01
+ [-2**64 ].pack(format).should == encode("\x00\x00\x00\x00\x00\x00\x00\x00", "binary") # 0x ..F 00 00 00 00 00 00 00 00
+ [-2**64-1].pack(format).should == encode("\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF", "binary") # 0x .FE FF FF FF FF FF FF FF FF
end
end
it "tries to convert the pack argument to an Integer using #to_int" do
- [5.0].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x05")
+ [5.0].pack(format).should == encode("\x00\x00\x00\x00\x00\x00\x00\x05", "binary")
obj = mock('to_int')
obj.should_receive(:to_int).and_return(5)
- [obj].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x05")
+ [obj].pack(format).should == encode("\x00\x00\x00\x00\x00\x00\x00\x05", "binary")
end
it "raises a TypeError if a pack argument can't be coerced to Integer" do
@@ -1246,27 +1231,27 @@
end
it "processes count number of array elements if count given" do
- [1, 2, 3].pack(format(3)).should == binary(
+ [1, 2, 3].pack(format(3)).should == encode(
"\x00\x00\x00\x00\x00\x00\x00\x01" +
"\x00\x00\x00\x00\x00\x00\x00\x02" +
- "\x00\x00\x00\x00\x00\x00\x00\x03" )
- [1, 2, 3].pack(format(2) + format(1)).should == binary(
+ "\x00\x00\x00\x00\x00\x00\x00\x03" , "binary")
+ [1, 2, 3].pack(format(2) + format(1)).should == encode(
"\x00\x00\x00\x00\x00\x00\x00\x01" +
"\x00\x00\x00\x00\x00\x00\x00\x02" +
- "\x00\x00\x00\x00\x00\x00\x00\x03" )
+ "\x00\x00\x00\x00\x00\x00\x00\x03" , "binary")
end
it "returns empty string if count = 0" do
- [1, 2, 3].pack(format(0)).should == binary('')
+ [1, 2, 3].pack(format(0)).should == encode('', "binary")
end
it "with star parameter processes all remaining array items" do
- [1, 2, 3, 4, 5].pack(format('*')).should == binary(
+ [1, 2, 3, 4, 5].pack(format('*')).should == encode(
"\x00\x00\x00\x00\x00\x00\x00\x01" +
"\x00\x00\x00\x00\x00\x00\x00\x02" +
"\x00\x00\x00\x00\x00\x00\x00\x03" +
"\x00\x00\x00\x00\x00\x00\x00\x04" +
- "\x00\x00\x00\x00\x00\x00\x00\x05" )
+ "\x00\x00\x00\x00\x00\x00\x00\x05" , "binary")
end
it "raises an ArgumentError if count is greater than array elements left" do
@@ -1633,27 +1618,27 @@
end
it "accepts the positive zero" do
- [+0.0].pack(format).should == binary("\x00\x00\x00\x00")
+ [+0.0].pack(format).should == encode("\x00\x00\x00\x00", "binary")
end
it "accepts the negative zero" do
- [-0.0].pack(format).should == binary("\x80\x00\x00\x00")
+ [-0.0].pack(format).should == encode("\x80\x00\x00\x00", "binary")
end
it "accepts a positive value" do
- [+1.0].pack(format).should == binary("\x3F\x80\x00\x00")
+ [+1.0].pack(format).should == encode("\x3F\x80\x00\x00", "binary")
end
it "accepts a negative value" do
- [-1.0].pack(format).should == binary("\xBF\x80\x00\x00")
+ [-1.0].pack(format).should == encode("\xBF\x80\x00\x00", "binary")
end
it "accepts the positive infinity" do
- [1.0/0.0].pack(format).should == binary("\x7F\x80\x00\x00")
+ [1.0/0.0].pack(format).should == encode("\x7F\x80\x00\x00", "binary")
end
it "accepts the negative infinity" do
- [-1.0/0.0].pack(format).should == binary("\xFF\x80\x00\x00")
+ [-1.0/0.0].pack(format).should == encode("\xFF\x80\x00\x00", "binary")
end
# MacRuby TODO: These fail to parse with `macruby`, but not with `miniruby`
# it "accepts a NaN" do
- # [0.0/0.0].pack(format).should =~ /\xFF(?:[\x81-\xFF]..|\x80[\x01-\xFF].|\x80.[\x01-\xFF])/n
+ # [0.0/0.0].pack(format).should =~ /[\x7F\xFF](?:[\x81-\xFF]..|\x80[\x01-\xFF].|\x80.[\x01-\xFF])/n
# end
it "keeps order of nonnegative real numbers" do
@@ -1682,27 +1667,27 @@
end
it "accepts the positive zero" do
- [+0.0].pack(format).should == binary("\x00\x00\x00\x00")
+ [+0.0].pack(format).should == encode("\x00\x00\x00\x00", "binary")
end
it "accepts the negative zero" do
- [-0.0].pack(format).should == binary("\x00\x00\x00\x80")
+ [-0.0].pack(format).should == encode("\x00\x00\x00\x80", "binary")
end
it "accepts a positive value" do
- [+1.0].pack(format).should == binary("\x00\x00\x80\x3F")
+ [+1.0].pack(format).should == encode("\x00\x00\x80\x3F", "binary")
end
it "accepts a negative value" do
- [-1.0].pack(format).should == binary("\x00\x00\x80\xBF")
+ [-1.0].pack(format).should == encode("\x00\x00\x80\xBF", "binary")
end
it "accepts the positive infinity" do
- [1.0/0.0].pack(format).should == binary("\x00\x00\x80\x7F")
+ [1.0/0.0].pack(format).should == encode("\x00\x00\x80\x7F", "binary")
end
it "accepts the negative infinity" do
- [-1.0/0.0].pack(format).should == binary("\x00\x00\x80\xFF")
+ [-1.0/0.0].pack(format).should == encode("\x00\x00\x80\xFF", "binary")
end
# MacRuby TODO: These fail to parse with `macruby`, but not with `miniruby`
# it "accepts a NaN" do
- # [0.0/0.0].pack(format).should =~ /(?:..[\x81-\xFF]|.[\x01-\xFF]\x80|[\x01-\xFF].\x80)\xFF/n
+ # [0.0/0.0].pack(format).should =~ /(?:..[\x81-\xFF]|.[\x01-\xFF]\x80|[\x01-\xFF].\x80)[\x7F\xFF]/n
# end
end
@@ -1719,27 +1704,27 @@
end
it "accepts the positive zero" do
- [+0.0].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x00")
+ [+0.0].pack(format).should == encode("\x00\x00\x00\x00\x00\x00\x00\x00", "binary")
end
it "accepts the negative zero" do
- [-0.0].pack(format).should == binary("\x80\x00\x00\x00\x00\x00\x00\x00")
+ [-0.0].pack(format).should == encode("\x80\x00\x00\x00\x00\x00\x00\x00", "binary")
end
it "accepts a positive value" do
- [+1.0].pack(format).should == binary("\x3F\xF0\x00\x00\x00\x00\x00\x00")
+ [+1.0].pack(format).should == encode("\x3F\xF0\x00\x00\x00\x00\x00\x00", "binary")
end
it "accepts a negative value" do
- [-1.0].pack(format).should == binary("\xBF\xF0\x00\x00\x00\x00\x00\x00")
+ [-1.0].pack(format).should == encode("\xBF\xF0\x00\x00\x00\x00\x00\x00", "binary")
end
it "accepts the positive infinity" do
- [1.0/0.0].pack(format).should == binary("\x7F\xF0\x00\x00\x00\x00\x00\x00")
+ [1.0/0.0].pack(format).should == encode("\x7F\xF0\x00\x00\x00\x00\x00\x00", "binary")
end
it "accepts the negative infinity" do
- [-1.0/0.0].pack(format).should == binary("\xFF\xF0\x00\x00\x00\x00\x00\x00")
+ [-1.0/0.0].pack(format).should == encode("\xFF\xF0\x00\x00\x00\x00\x00\x00", "binary")
end
# MacRuby TODO: These fail to parse with `macruby`, but not with `miniruby`
# it "accepts a NaN" do
- # [0.0/0.0].pack(format).should =~ /\xFF(?:[\xF1-\xFF].{6}|\xF0\x00*[\x01-\xFF]\x00*)/n
+ # [0.0/0.0].pack(format).should =~ /[\x7F\xFF](?:[\xF1-\xFF].{6}|\xF0\x00*[\x01-\xFF]\x00*)/n
# end
it "keeps order of nonnegative real numbers" do
@@ -1768,27 +1753,27 @@
end
it "accepts the positive zero" do
- [+0.0].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x00")
+ [+0.0].pack(format).should == encode("\x00\x00\x00\x00\x00\x00\x00\x00", "binary")
end
it "accepts the negative zero" do
- [-0.0].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\x00\x80")
+ [-0.0].pack(format).should == encode("\x00\x00\x00\x00\x00\x00\x00\x80", "binary")
end
it "accepts a positive value" do
- [+1.0].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\xF0\x3F")
+ [+1.0].pack(format).should == encode("\x00\x00\x00\x00\x00\x00\xF0\x3F", "binary")
end
it "accepts a negative value" do
- [-1.0].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\xF0\xBF")
+ [-1.0].pack(format).should == encode("\x00\x00\x00\x00\x00\x00\xF0\xBF", "binary")
end
it "accepts the positive infinity" do
- [1.0/0.0].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\xF0\x7F")
+ [1.0/0.0].pack(format).should == encode("\x00\x00\x00\x00\x00\x00\xF0\x7F", "binary")
end
it "accepts the negative infinity" do
- [-1.0/0.0].pack(format).should == binary("\x00\x00\x00\x00\x00\x00\xF0\xFF")
+ [-1.0/0.0].pack(format).should == encode("\x00\x00\x00\x00\x00\x00\xF0\xFF", "binary")
end
# MacRuby TODO: These fail to parse with `macruby`, but not with `miniruby`
# it "accepts a NaN" do
- # [0.0/0.0].pack(format).should =~ /(?:.{6}[\xF1-\xFF]|\x00*[\x01-\xFF]\x00*)\xFF/n
+ # [0.0/0.0].pack(format).should =~ /(?:.{6}[\xF1-\xFF]|\x00*[\x01-\xFF]\x00*)[\x7F\xFF]/n
# end
end
@@ -2090,7 +2075,7 @@
ascii = (0x00 .. 0x7F)
ascii.each do |cp|
chr = [cp].pack('U')
- binary(chr)[0,1].should == cp.chr
+ encode(chr, "binary")[0,1].should == cp.chr
end
ascii.to_a.pack('U*').should == (0x00 .. 0x7F).map{|c| eval('"\x%02x"' % c)}.join
@@ -2103,8 +2088,8 @@
end
[0x7F, 0x7F].pack('U*').should == "\x7F\x7F"
- [262193, 4736, 191, 12, 107].pack('U*').should == utf8("\xF1\x80\x80\xB1\xE1\x8A\x80\xC2\xBF\x0C\x6B")
- [2**16+1, 2**30].pack('U2').should == utf8("\360\220\200\201\375\200\200\200\200\200")
+ [262193, 4736, 191, 12, 107].pack('U*').should == encode("\xF1\x80\x80\xB1\xE1\x8A\x80\xC2\xBF\x0C\x6B", "utf-8")
+ [2**16+1, 2**30].pack('U2').should == encode("\360\220\200\201\375\200\200\200\200\200", "utf-8")
end
it "raises an ArgumentError if count is greater than array elements left" do
@@ -2247,12 +2232,12 @@
describe "Array#pack with format 'w'" do
it "converts to BER-compressed integer" do
- [0].pack('w').should == binary("\000")
- [1].pack('w').should == binary("\001")
- [0, 1, 2].pack('w2').should == binary("\000\001")
- [0, 1, 2].pack('w*').should == binary("\000\001\002")
- [9999].pack('w').should == binary("\316\017")
- [2**64].pack('w').should == binary("\202\200\200\200\200\200\200\200\200\000")
+ [0].pack('w').should == encode("\000", "binary")
+ [1].pack('w').should == encode("\001", "binary")
+ [0, 1, 2].pack('w2').should == encode("\000\001", "binary")
+ [0, 1, 2].pack('w*').should == encode("\000\001\002", "binary")
+ [9999].pack('w').should == encode("\316\017", "binary")
+ [2**64].pack('w').should == encode("\202\200\200\200\200\200\200\200\200\000", "binary")
end
it "raises ArgumentError when a pack argument is negative" do
@@ -2268,7 +2253,7 @@
it "calls to_int on non-integer values before packing" do
obj = mock('1')
obj.should_receive(:to_int).and_return(1)
- [obj].pack('w').should == binary("\001")
+ [obj].pack('w').should == encode("\001", "binary")
end
it "raises TypeError on nil and non-numeric arguments" do
@@ -2333,20 +2318,20 @@
describe "Array#pack with '@'" do
it "moves the end of result string into the specified position by offset from head" do
- [0xABCDEF01].pack("N @2").should == binary("\xAB\xCD")
+ [0xABCDEF01].pack("N @2").should == encode("\xAB\xCD", "binary")
end
it "fills blank with NUL bytes if the position exceeds the end of string" do
- [0xABCDEF01].pack("N @6").should == binary("\xAB\xCD\xEF\x01\x00\x00")
+ [0xABCDEF01].pack("N @6").should == encode("\xAB\xCD\xEF\x01\x00\x00", "binary")
end
it "concatenates successing formats at the position '@' moves it into" do
- [0xABCDEF01, 0x41].pack("N @2 C").should == binary("\xAB\xCD\x41")
- [0xABCDEF01, 0x41].pack("N @6 C").should == binary("\xAB\xCD\xEF\x01\x00\x00\x41")
+ [0xABCDEF01, 0x41].pack("N @2 C").should == encode("\xAB\xCD\x41", "binary")
+ [0xABCDEF01, 0x41].pack("N @6 C").should == encode("\xAB\xCD\xEF\x01\x00\x00\x41", "binary")
end
it "does not recover lost bytes when shorten the string and then extends it again" do
- [0xABCDEF01, 0x41].pack("N @2 @6 C").should == binary("\xAB\xCD\x00\x00\x00\x00\x41")
+ [0xABCDEF01, 0x41].pack("N @2 @6 C").should == encode("\xAB\xCD\x00\x00\x00\x00\x41", "binary")
end
it "is able to work with 'X'" do
- [0xABCDEF01, 0x41].pack("N X @6 C").should == binary("\xAB\xCD\xEF\x00\x00\x00\x41")
+ [0xABCDEF01, 0x41].pack("N X @6 C").should == encode("\xAB\xCD\xEF\x00\x00\x00\x41", "binary")
end
ruby_version_is '1.9' do
Modified: MacRuby/trunk/spec/frozen/core/array/partition_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/partition_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/partition_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#partition" do
it "returns two arrays" do
Modified: MacRuby/trunk/spec/frozen/core/array/permutation_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/permutation_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/permutation_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
ruby_version_is "1.8.7" do
Modified: MacRuby/trunk/spec/frozen/core/array/plus_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/plus_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/plus_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#+" do
it "concatenates two arrays" do
Modified: MacRuby/trunk/spec/frozen/core/array/pop_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/pop_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/pop_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#pop" do
it "removes and returns the last element of the array" do
@@ -66,7 +66,7 @@
describe "passed a number n as an argument" do
ruby_version_is '1.8.7' do
- it "removes and returns an array with the last n element of the array" do
+ it "removes and returns an array with the last n elements of the array" do
a = [1, 2, 3, 4, 5, 6]
a.pop(0).should == []
@@ -82,6 +82,12 @@
a.should == []
end
+ it "returns an array with the last n elements even if shift was invoked" do
+ a = [1, 2, 3, 4]
+ a.shift
+ a.pop(3).should == [2, 3, 4]
+ end
+
it "returns a new empty array if there are no more elements" do
a = []
popped1 = a.pop(1)
Modified: MacRuby/trunk/spec/frozen/core/array/product_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/product_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/product_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#product" do
ruby_version_is "1.8.7" do
Modified: MacRuby/trunk/spec/frozen/core/array/push_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/push_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/push_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#push" do
it "appends the arguments to the array" do
Modified: MacRuby/trunk/spec/frozen/core/array/rassoc_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/rassoc_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/rassoc_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#rassoc" do
it "returns the first contained array whose second element is == object" do
Modified: MacRuby/trunk/spec/frozen/core/array/reject_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/reject_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/reject_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/enumeratorize'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/enumeratorize', __FILE__)
describe "Array#reject" do
it "returns a new array without elements for which block is true" do
Modified: MacRuby/trunk/spec/frozen/core/array/replace_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/replace_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/replace_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/replace'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/replace', __FILE__)
describe "Array#replace" do
it_behaves_like(:array_replace, :replace)
Modified: MacRuby/trunk/spec/frozen/core/array/reverse_each_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/reverse_each_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/reverse_each_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/enumeratorize'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/enumeratorize', __FILE__)
# Modifying a collection while the contents are being iterated
# gives undefined behavior. See
Modified: MacRuby/trunk/spec/frozen/core/array/reverse_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/reverse_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/reverse_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#reverse" do
it "returns a new array with the elements in reverse order" do
Modified: MacRuby/trunk/spec/frozen/core/array/rindex_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/rindex_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/rindex_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
# Modifying a collection while the contents are being iterated
# gives undefined behavior. See
Added: MacRuby/trunk/spec/frozen/core/array/rotate_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/rotate_spec.rb (rev 0)
+++ MacRuby/trunk/spec/frozen/core/array/rotate_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -0,0 +1,77 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+
+ruby_version_is "1.9" do
+ describe "Array#rotate" do
+ it "returns a copy of the array whose first n elements is moved to the last" do
+ a = [1, 2, 3, 4, 5].freeze
+ a.rotate.should == [2, 3, 4, 5, 1]
+ a.rotate(2).should == [3, 4, 5, 1, 2]
+ a.rotate(-1).should == [5, 1, 2, 3, 4]
+ a.rotate(13).should == [4, 5, 1, 2, 3]
+ end
+
+ it "returns a copy of the array when the length is one" do
+ a = [1].freeze
+ a.rotate.should == [1]
+ a.rotate(2).should == [1]
+ end
+
+ it "returns an empty array when self is empty" do
+ a = [].freeze
+ a.rotate.should == []
+ a.rotate(2).should == []
+ end
+
+ it "does not return self" do
+ a = [1, 2, 3]
+ 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)
+ end
+ end
+
+ describe "Array#rotate!" do
+ it "moves the first n elements to the last and returns self" do
+ a = [1, 2, 3, 4, 5]
+ a.rotate!.should == [2, 3, 4, 5, 1]
+ a.should == [2, 3, 4, 5, 1]
+ a = [1, 2, 3, 4, 5]
+ a.rotate!(2).should == [3, 4, 5, 1, 2]
+ a.should == [3, 4, 5, 1, 2]
+ a = [1, 2, 3, 4, 5]
+ a.rotate!(-1).should == [5, 1, 2, 3, 4]
+ a.should == [5, 1, 2, 3, 4]
+ a = [1, 2, 3, 4, 5]
+ a.rotate!(13).should == [4, 5, 1, 2, 3]
+ a.should == [4, 5, 1, 2, 3]
+ end
+
+ it "does nothing and returns self when the length is zero or one" do
+ a = [1]
+ a.rotate! == [1]
+ a.should == [1]
+ a = [1]
+ a.rotate!(2).should == [1]
+ a.should == [1]
+
+ a = []
+ a.rotate!.should == []
+ a.should == []
+ a = []
+ a.rotate!(2).should == []
+ a.should == []
+ end
+
+ it "returns self" do
+ a = [1, 2, 3]
+ a.rotate!.object_id.should == a.object_id
+ end
+
+ it "raises a RuntimeError on a frozen array" do
+ lambda { ArraySpecs.frozen_array.rotate! }.should raise_error(RuntimeError)
+ end
+ end
+end
Modified: MacRuby/trunk/spec/frozen/core/array/sample_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/sample_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/sample_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#sample" do
ruby_version_is "1.8.8" do
Modified: MacRuby/trunk/spec/frozen/core/array/select_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/select_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/select_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/enumeratorize'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/enumeratorize', __FILE__)
describe "Array#select" do
it_behaves_like :enumeratorize, :select
Modified: MacRuby/trunk/spec/frozen/core/array/shared/collect.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/shared/collect.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/shared/collect.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -40,7 +40,7 @@
ruby_version_is '1.9' do
it "returns an Enumerator when no block given" do
a = [1, 2, 3]
- a.send(@method).should be_kind_of(enumerator_class)
+ a.send(@method).should be_an_instance_of(enumerator_class)
end
end
@@ -96,7 +96,7 @@
it "returns an Enumerator when no block given, and the enumerator can modify the original array" do
a = [1, 2, 3]
enum = a.send(@method)
- enum.should be_kind_of(enumerator_class)
+ enum.should be_an_instance_of(enumerator_class)
enum.each{|i| "#{i}!" }
a.should == ["1!", "2!", "3!"]
end
Modified: MacRuby/trunk/spec/frozen/core/array/shared/enumeratorize.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/shared/enumeratorize.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/shared/enumeratorize.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -6,7 +6,7 @@
end
ruby_version_is '1.8.7' do
it 'returns an Enumerator if no block given' do
- [1,2].send(@method).should be_kind_of(enumerator_class)
+ [1,2].send(@method).should be_an_instance_of(enumerator_class)
end
end
end
Modified: MacRuby/trunk/spec/frozen/core/array/shift_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/shift_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/shift_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#shift" do
it "removes and returns the first element" do
@@ -66,6 +66,14 @@
a.should == []
end
+ it "does not corrupt the array when shift without arguments is followed by shift with an argument" do
+ a = [1, 2, 3, 4, 5]
+
+ a.shift.should == 1
+ a.shift(3).should == [2, 3, 4]
+ a.should == [5]
+ end
+
it "returns a new empty array if there are no more elements" do
a = []
popped1 = a.shift(1)
Modified: MacRuby/trunk/spec/frozen/core/array/shuffle_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/shuffle_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/shuffle_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#shuffle" do
ruby_version_is "1.8.7" do
Modified: MacRuby/trunk/spec/frozen/core/array/size_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/size_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/size_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/length'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/length', __FILE__)
describe "Array#size" do
it_behaves_like(:array_length, :size)
Modified: MacRuby/trunk/spec/frozen/core/array/slice_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/slice_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/slice_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/slice'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/slice', __FILE__)
describe "Array#slice!" do
it "removes and return the element at index" do
@@ -126,6 +126,14 @@
a.slice!(10..10).should == nil
a.should == [1, 2]
end
+
+ it "does not expand array with negative indices out of bounds" do
+ a = [1, 2]
+ a.slice!(-3, 1).should == nil
+ a.should == [1, 2]
+ a.slice!(-3..2).should == nil
+ a.should == [1, 2]
+ end
end
ruby_version_is "" ... "1.9" do
Modified: MacRuby/trunk/spec/frozen/core/array/sort_by_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/sort_by_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/sort_by_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,7 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
-ruby_version_is "1.9.2" do
+ruby_version_is "1.9" do
describe "Array#sort_by!" do
it "sorts array in place by passing each element to the given block" do
@@ -11,7 +11,7 @@
end
it "returns an Enumerator if not given a block" do
- (1..10).to_a.sort_by!.should be_kind_of(Enumerator)
+ (1..10).to_a.sort_by!.should be_an_instance_of(enumerator_class)
end
it "completes when supplied a block that always returns the same result" do
Modified: MacRuby/trunk/spec/frozen/core/array/sort_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/sort_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/sort_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#sort" do
it "returns a new array sorted based on comparing elements with <=>" do
Modified: MacRuby/trunk/spec/frozen/core/array/to_a_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/to_a_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/to_a_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#to_a" do
it "returns self" do
Modified: MacRuby/trunk/spec/frozen/core/array/to_ary_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/to_ary_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/to_ary_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#to_ary" do
it "returns self" do
Modified: MacRuby/trunk/spec/frozen/core/array/to_s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/to_s_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/to_s_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#to_s" do
ruby_version_is "" ... "1.9" do
Modified: MacRuby/trunk/spec/frozen/core/array/transpose_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/transpose_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/transpose_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#transpose" do
it "assumes an array of arrays and returns the result of transposing rows and columns" do
Modified: MacRuby/trunk/spec/frozen/core/array/try_convert_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/try_convert_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/try_convert_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array.try_convert" do
ruby_version_is "1.8.8" do
Modified: MacRuby/trunk/spec/frozen/core/array/union_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/union_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/union_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#|" do
it "returns an array of elements that appear in either array (union)" do
Modified: MacRuby/trunk/spec/frozen/core/array/uniq_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/uniq_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/uniq_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#uniq" do
it "returns an array with no duplicates" do
@@ -115,27 +115,29 @@
[ "a", "b", "c" ].uniq!.should == nil
end
- ruby_version_is "" ... "1.9" do
- it "raises a TypeError on a frozen array if modification would take place" do
+ ruby_version_is ""..."1.9" do
+ it "raises a TypeError on a frozen array when the array is modified" do
dup_ary = [1, 1, 2]
dup_ary.freeze
lambda { dup_ary.uniq! }.should raise_error(TypeError)
end
- it "does not raise an exception on a frozen array if no modification takes place" do
+ it "does not raise an exception on a frozen array when the array would not be modified" do
ArraySpecs.frozen_array.uniq!.should be_nil
end
end
ruby_version_is "1.9" do
- ruby_bug "[ruby-core:23666]", "1.9.2" do
- it "raises a RuntimeError on a frozen array" do
- dup_ary = [1, 1, 2]
- dup_ary.freeze
- lambda { dup_ary.uniq! }.should raise_error(RuntimeError)
- lambda { ArraySpecs.frozen_array.uniq!}.should raise_error(RuntimeError)
- end
+ it "raises a RuntimeError on a frozen array when the array is modified" do
+ dup_ary = [1, 1, 2]
+ dup_ary.freeze
+ lambda { dup_ary.uniq! }.should raise_error(RuntimeError)
end
+
+ # see [ruby-core:23666]
+ it "raises a RuntimeError on a frozen array when the array would not be modified" do
+ lambda { ArraySpecs.frozen_array.uniq!}.should raise_error(RuntimeError)
+ end
end
end
Modified: MacRuby/trunk/spec/frozen/core/array/unshift_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/unshift_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/unshift_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#unshift" do
it "prepends object to the original array" do
@@ -46,12 +46,14 @@
end
ruby_version_is "1.9" do
- ruby_bug "[ruby-core:23666]", "1.9.2" do
- it "raises a RuntimeError on a frozen array" do
- lambda { ArraySpecs.frozen_array.unshift(1) }.should raise_error(RuntimeError)
- lambda { ArraySpecs.frozen_array.unshift }.should raise_error(RuntimeError)
- end
+ it "raises a RuntimeError on a frozen array when the array is modified" do
+ lambda { ArraySpecs.frozen_array.unshift(1) }.should raise_error(RuntimeError)
end
+
+ # see [ruby-core:23666]
+ it "raises a RuntimeError on a frozen array when the array would not be modified" do
+ lambda { ArraySpecs.frozen_array.unshift }.should raise_error(RuntimeError)
+ end
end
ruby_version_is ""..."1.9" do
Modified: MacRuby/trunk/spec/frozen/core/array/values_at_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/values_at_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/values_at_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#values_at" do
it "returns an array of elements at the indexes when passed indexes" do
Modified: MacRuby/trunk/spec/frozen/core/array/zip_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/array/zip_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/array/zip_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Array#zip" do
it "returns an array of arrays containing corresponding elements of each array" do
Modified: MacRuby/trunk/spec/frozen/core/basicobject/instance_exec_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/instance_exec_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/basicobject/instance_exec_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,8 +1,8 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
- require File.dirname(__FILE__) + '/fixtures/classes'
+ require File.expand_path('../fixtures/classes', __FILE__)
describe "BasicObject#instance_exec" do
it "raises a LocalJumpError unless given a block" do
Modified: MacRuby/trunk/spec/frozen/core/basicobject/method_missing_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/method_missing_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/basicobject/method_missing_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../shared/kernel/method_missing'
+require File.expand_path('../../../shared/kernel/method_missing', __FILE__)
ruby_version_is "1.9" do
describe "BasicObject#method_missing" do
Modified: MacRuby/trunk/spec/frozen/core/basicobject/remove_method_missing.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/remove_method_missing.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/basicobject/remove_method_missing.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9".."1.9.9" do
Modified: MacRuby/trunk/spec/frozen/core/basicobject/singleton_method_added_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/singleton_method_added_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/basicobject/singleton_method_added_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/kernel/singleton_method_added'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/kernel/singleton_method_added', __FILE__)
ruby_version_is "1.9" do
describe "BasicObject#singleton_method_added" do
Modified: MacRuby/trunk/spec/frozen/core/basicobject/singleton_method_removed_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/singleton_method_removed_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/basicobject/singleton_method_removed_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/kernel/singleton_method_removed'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/kernel/singleton_method_removed', __FILE__)
ruby_version_is "1.9" do
describe "BasicObject#singleton_method_removed" do
Modified: MacRuby/trunk/spec/frozen/core/basicobject/singleton_method_undefined_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/basicobject/singleton_method_undefined_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/basicobject/singleton_method_undefined_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../shared/kernel/singleton_method_undefined'
+require File.expand_path('../../../shared/kernel/singleton_method_undefined', __FILE__)
ruby_version_is "1.9" do
describe "BasicObject#singleton_method_undefined" do
Modified: MacRuby/trunk/spec/frozen/core/bignum/abs_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/abs_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/abs_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#abs" do
it "returns the absolute value" do
Modified: MacRuby/trunk/spec/frozen/core/bignum/bit_and_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/bit_and_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/bit_and_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#&" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/bignum/bit_or_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/bit_or_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/bit_or_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#|" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/bignum/bit_xor_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/bit_xor_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/bit_xor_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#^" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/bignum/coerce_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/coerce_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/coerce_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#coerce" do
it "coerces other to a Bignum and returns [other, self] when passed a Fixnum" do
Modified: MacRuby/trunk/spec/frozen/core/bignum/comparison_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/comparison_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/comparison_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#<=>" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/bignum/complement_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/complement_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/complement_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#~" do
it "returns self with each bit flipped" do
Modified: MacRuby/trunk/spec/frozen/core/bignum/div_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/div_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/div_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/divide'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/divide', __FILE__)
describe "Bignum#div" do
it_behaves_like(:bignum_divide, :div)
Modified: MacRuby/trunk/spec/frozen/core/bignum/divide_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/divide_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/divide_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/divide'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/divide', __FILE__)
describe "Bignum#/" do
it_behaves_like(:bignum_divide, :/)
Modified: MacRuby/trunk/spec/frozen/core/bignum/divmod_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/divmod_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/divmod_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#divmod" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/bignum/element_reference_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/element_reference_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/element_reference_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#[]" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/bignum/eql_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/eql_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/eql_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#eql? when given a Bignum" do
it "returns true if the given argument has the same value" do
Modified: MacRuby/trunk/spec/frozen/core/bignum/equal_value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/equal_value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/equal_value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#==" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/bignum/even_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/even_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/even_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.8.7" do
describe "Bignum#even?" do
Modified: MacRuby/trunk/spec/frozen/core/bignum/exponent_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/exponent_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/exponent_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#**" do
before(:each) do
@@ -16,7 +16,7 @@
lambda { @bignum ** :symbol }.should raise_error
end
- ruby_version_is '1.9.2' do
+ ruby_version_is '1.9' do
it "returns a complex number when negative and raised to a fractional power" do
((- at bignum) ** (1.0/3)) .should be_close(Complex(1048576,1816186.907597341), TOLERANCE)
((- at bignum) ** Rational(1,3)).should be_close(Complex(1048576,1816186.907597341), TOLERANCE)
Modified: MacRuby/trunk/spec/frozen/core/bignum/gt_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/gt_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/gt_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#>" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/bignum/gte_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/gte_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/gte_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#>=" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/bignum/hash_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/hash_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/hash_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#hash" do
it "is provided" do
Modified: MacRuby/trunk/spec/frozen/core/bignum/left_shift_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/left_shift_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/left_shift_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#<<" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/bignum/lt_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/lt_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/lt_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#<" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/bignum/lte_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/lte_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/lte_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#<=" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/bignum/minus_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/minus_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/minus_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#-" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/bignum/modulo_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/modulo_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/modulo_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/modulo'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/modulo', __FILE__)
describe "Bignum#%" do
it_behaves_like(:bignum_modulo, :%)
Modified: MacRuby/trunk/spec/frozen/core/bignum/multiply_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/multiply_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/multiply_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#*" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/bignum/odd_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/odd_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/odd_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.8.7" do
describe "Bignum#odd?" do
Modified: MacRuby/trunk/spec/frozen/core/bignum/plus_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/plus_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/plus_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#+" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/bignum/quo_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/quo_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/quo_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#quo" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/bignum/remainder_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/remainder_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/remainder_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#remainder" do
it "returns the remainder of dividing self by other" do
Modified: MacRuby/trunk/spec/frozen/core/bignum/right_shift_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/right_shift_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/right_shift_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#>>" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/bignum/size_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/size_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/size_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#size" do
Modified: MacRuby/trunk/spec/frozen/core/bignum/to_f_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/to_f_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/to_f_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#to_f" do
it "returns self converted to a Float" do
Modified: MacRuby/trunk/spec/frozen/core/bignum/to_s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/to_s_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/to_s_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#to_s when given a base" do
it "returns self converted to a String using the given base" do
Modified: MacRuby/trunk/spec/frozen/core/bignum/uminus_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/bignum/uminus_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/bignum/uminus_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Bignum#-@" do
it "returns self as a negative value" do
Modified: MacRuby/trunk/spec/frozen/core/binding/clone_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/binding/clone_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/binding/clone_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/clone'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/clone', __FILE__)
describe "Binding#clone" do
it_behaves_like(:binding_clone, :clone)
Modified: MacRuby/trunk/spec/frozen/core/binding/dup_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/binding/dup_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/binding/dup_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/clone'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/clone', __FILE__)
describe "Binding#dup" do
it_behaves_like(:binding_clone, :dup)
Modified: MacRuby/trunk/spec/frozen/core/binding/eval_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/binding/eval_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/binding/eval_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Binding#eval" do
ruby_version_is '1.8.7' do
Modified: MacRuby/trunk/spec/frozen/core/builtin_constants/builtin_constants_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/builtin_constants/builtin_constants_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/builtin_constants/builtin_constants_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "RUBY_VERSION" do
it "is a String" do
Modified: MacRuby/trunk/spec/frozen/core/class/allocate_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/class/allocate_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/class/allocate_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Class#allocate" do
it "returns an instance of self" do
Modified: MacRuby/trunk/spec/frozen/core/class/inherited_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/class/inherited_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/class/inherited_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Class.inherited" do
Modified: MacRuby/trunk/spec/frozen/core/class/initialize_copy_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/class/initialize_copy_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/class/initialize_copy_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1,22 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
+
+describe "Class#initialize_copy" do
+ it "raises a TypeError when called on already initialized classes" do
+ lambda{
+ String.send :initialize_copy, Fixnum
+ }.should raise_error(TypeError)
+
+ lambda{
+ Object.send :initialize_copy, String
+ }.should raise_error(TypeError)
+ end
+
+ ruby_version_is "1.9" do
+ # See [redmine:2601]
+ it "raises a TypeError when called on BasicObject" do
+ lambda{
+ BasicObject.send :initialize_copy, String
+ }.should raise_error(TypeError)
+ end
+ end
+end
Modified: MacRuby/trunk/spec/frozen/core/class/initialize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/class/initialize_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/class/initialize_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Class#new" do
it "returns a new instance of self" do
@@ -36,3 +36,24 @@
klass.new { break 42 }.should == 42
end
end
+
+describe "Class#initialize" do
+ it "raises a TypeError when called on already initialized classes" do
+ lambda{
+ Fixnum.send :initialize
+ }.should raise_error(TypeError)
+
+ lambda{
+ Object.send :initialize
+ }.should raise_error(TypeError)
+ end
+
+ ruby_version_is "1.9" do
+ # See [redmine:2601]
+ it "should raise a TypeError (even for BasicObject)" do
+ lambda{
+ BasicObject.send :initialize
+ }.should raise_error(TypeError)
+ end
+ end
+end
Modified: MacRuby/trunk/spec/frozen/core/class/new_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/class/new_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/class/new_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Class.new with a block given" do
it "uses the given block as the class' body" do
Modified: MacRuby/trunk/spec/frozen/core/class/superclass_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/class/superclass_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/class/superclass_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Class#superclass" do
ruby_version_is ""..."1.9" do
Modified: MacRuby/trunk/spec/frozen/core/comparable/between_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/comparable/between_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/comparable/between_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Comparable#between?" do
it "returns true if self is greater than or equal to the first and less than or equal to the second argument" do
Modified: MacRuby/trunk/spec/frozen/core/comparable/equal_value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/comparable/equal_value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/comparable/equal_value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Comparable#==" do
it "returns true if other is the same as self" do
Modified: MacRuby/trunk/spec/frozen/core/comparable/gt_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/comparable/gt_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/comparable/gt_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Comparable#>" do
it "calls #<=> on self with other and returns true if #<=> returns any Integer greater than 0" do
Modified: MacRuby/trunk/spec/frozen/core/comparable/gte_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/comparable/gte_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/comparable/gte_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Comparable#>=" do
it "calls #<=> on self with other and returns true if #<=> returns 0 or any Integer greater than 0" do
Modified: MacRuby/trunk/spec/frozen/core/comparable/lt_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/comparable/lt_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/comparable/lt_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Comparable#<" do
it "calls #<=> on self with other and returns true if #<=> returns any Integer less than 0" do
Modified: MacRuby/trunk/spec/frozen/core/comparable/lte_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/comparable/lte_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/comparable/lte_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Comparable#<=" do
it "calls #<=> on self with other and returns true if #<=> returns 0 or any Integer less than 0" do
Modified: MacRuby/trunk/spec/frozen/core/complex/Complex_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/complex/Complex_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/complex/Complex_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/complex/Complex'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/complex/Complex', __FILE__)
ruby_version_is "1.9" do
describe "Complex when passed [Complex, Complex]" do
Modified: MacRuby/trunk/spec/frozen/core/complex/abs2_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/complex/abs2_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/complex/abs2_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
ruby_version_is "1.9" do
- require File.dirname(__FILE__) + '/../../shared/complex/abs2'
+ require File.expand_path('../../../shared/complex/abs2', __FILE__)
describe "Complex#abs2" do
it_behaves_like(:complex_abs2, :abs2)
Modified: MacRuby/trunk/spec/frozen/core/complex/abs_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/complex/abs_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/complex/abs_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
ruby_version_is "1.9" do
- require File.dirname(__FILE__) + '/../../shared/complex/abs'
+ require File.expand_path('../../../shared/complex/abs', __FILE__)
describe "Complex#abs" do
it_behaves_like(:complex_abs, :abs)
Modified: MacRuby/trunk/spec/frozen/core/complex/angle_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/complex/angle_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/complex/angle_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,8 +1,8 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
- require File.dirname(__FILE__) + '/../../shared/complex/arg'
+ require File.expand_path('../../../shared/complex/arg', __FILE__)
describe "Complex#angle" do
it_behaves_like(:complex_arg, :angle)
Modified: MacRuby/trunk/spec/frozen/core/complex/arg_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/complex/arg_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/complex/arg_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,8 +1,8 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
- require File.dirname(__FILE__) + '/../../shared/complex/arg'
+ require File.expand_path('../../../shared/complex/arg', __FILE__)
describe "Complex#arg" do
it_behaves_like(:complex_arg, :arg)
Modified: MacRuby/trunk/spec/frozen/core/complex/coerce_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/complex/coerce_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/complex/coerce_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
ruby_version_is "1.9" do
- require File.dirname(__FILE__) + '/../../shared/complex/coerce'
+ require File.expand_path('../../../shared/complex/coerce', __FILE__)
describe "Complex#coerce" do
it_behaves_like(:complex_coerce, :coerce)
Modified: MacRuby/trunk/spec/frozen/core/complex/conj_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/complex/conj_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/complex/conj_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,8 +1,8 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
- require File.dirname(__FILE__) + '/../../shared/complex/conjugate'
+ require File.expand_path('../../../shared/complex/conjugate', __FILE__)
describe "Complex#conj" do
it_behaves_like(:complex_conjugate, :conj)
Modified: MacRuby/trunk/spec/frozen/core/complex/conjugate_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/complex/conjugate_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/complex/conjugate_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,8 +1,8 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
- require File.dirname(__FILE__) + '/../../shared/complex/conjugate'
+ require File.expand_path('../../../shared/complex/conjugate', __FILE__)
describe "Complex#conjugate" do
it_behaves_like(:complex_conjugate, :conjugate)
Modified: MacRuby/trunk/spec/frozen/core/complex/denominator_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/complex/denominator_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/complex/denominator_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,7 @@
ruby_version_is "1.9" do
- require File.dirname(__FILE__) + '/../../shared/complex/denominator'
+ require File.expand_path('../../../shared/complex/denominator', __FILE__)
describe "Complex#denominator" do
it_behaves_like(:complex_denominator, :denominator)
Modified: MacRuby/trunk/spec/frozen/core/complex/divide_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/complex/divide_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/complex/divide_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
ruby_version_is "1.9" do
- require File.dirname(__FILE__) + '/../../shared/complex/divide'
+ require File.expand_path('../../../shared/complex/divide', __FILE__)
describe "Complex#/ with Complex" do
it_behaves_like(:complex_divide_complex, :/)
Modified: MacRuby/trunk/spec/frozen/core/complex/equal_value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/complex/equal_value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/complex/equal_value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
ruby_version_is "1.9" do
- require File.dirname(__FILE__) + '/../../shared/complex/equal_value'
+ require File.expand_path('../../../shared/complex/equal_value', __FILE__)
describe "Complex#== with Complex" do
it_behaves_like(:complex_equal_value_complex, :shared => true)
Modified: MacRuby/trunk/spec/frozen/core/complex/exponent_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/complex/exponent_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/complex/exponent_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
ruby_version_is "1.9" do
- require File.dirname(__FILE__) + '/../../shared/complex/exponent'
+ require File.expand_path('../../../shared/complex/exponent', __FILE__)
describe "Complex#** when given 0" do
it_behaves_like(:complex_exponent_zero, :**)
Modified: MacRuby/trunk/spec/frozen/core/complex/fdiv_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/complex/fdiv_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/complex/fdiv_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Complex#fdiv" do
Modified: MacRuby/trunk/spec/frozen/core/complex/hash_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/complex/hash_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/complex/hash_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/complex/hash'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/complex/hash', __FILE__)
ruby_version_is "1.9" do
describe "Complex#hash" do
Modified: MacRuby/trunk/spec/frozen/core/complex/imag_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/complex/imag_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/complex/imag_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../shared/complex/image'
+require File.expand_path('../../../shared/complex/image', __FILE__)
ruby_version_is "1.9" do
describe "Complex#imag" do
Modified: MacRuby/trunk/spec/frozen/core/complex/inspect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/complex/inspect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/complex/inspect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../shared/complex/inspect'
+require File.expand_path('../../../shared/complex/inspect', __FILE__)
ruby_version_is "1.9" do
describe "Complex#inspect" do
Modified: MacRuby/trunk/spec/frozen/core/complex/minus_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/complex/minus_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/complex/minus_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../shared/complex/minus'
+require File.expand_path('../../../shared/complex/minus', __FILE__)
ruby_version_is "1.9" do
describe "Complex#- with Complex" do
Modified: MacRuby/trunk/spec/frozen/core/complex/multiply_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/complex/multiply_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/complex/multiply_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../shared/complex/multiply'
+require File.expand_path('../../../shared/complex/multiply', __FILE__)
ruby_version_is "1.9" do
Modified: MacRuby/trunk/spec/frozen/core/complex/numerator_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/complex/numerator_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/complex/numerator_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../shared/complex/numerator'
+require File.expand_path('../../../shared/complex/numerator', __FILE__)
ruby_version_is "1.9" do
describe "Complex#numerator" do
Modified: MacRuby/trunk/spec/frozen/core/complex/plus_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/complex/plus_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/complex/plus_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../shared/complex/plus'
+require File.expand_path('../../../shared/complex/plus', __FILE__)
ruby_version_is "1.9" do
Modified: MacRuby/trunk/spec/frozen/core/complex/polar_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/complex/polar_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/complex/polar_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../shared/complex/polar'
+require File.expand_path('../../../shared/complex/polar', __FILE__)
ruby_version_is "1.9" do
Modified: MacRuby/trunk/spec/frozen/core/complex/rationalize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/complex/rationalize_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/complex/rationalize_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-ruby_version_is "1.9.2" do
+ruby_version_is "1.9" do
describe "Complex#rationalize" do
Modified: MacRuby/trunk/spec/frozen/core/complex/real_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/complex/real_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/complex/real_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../shared/complex/real'
+require File.expand_path('../../../shared/complex/real', __FILE__)
ruby_version_is "1.9" do
Modified: MacRuby/trunk/spec/frozen/core/complex/rect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/complex/rect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/complex/rect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
ruby_version_is "1.9" do
- require File.dirname(__FILE__) + '/../../shared/complex/rect'
+ require File.expand_path('../../../shared/complex/rect', __FILE__)
describe "Complex#rect" do
it_behaves_like(:complex_rect, :rect)
Modified: MacRuby/trunk/spec/frozen/core/complex/rectangular_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/complex/rectangular_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/complex/rectangular_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,8 +1,8 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
- require File.dirname(__FILE__) + '/../../shared/complex/rect'
+ require File.expand_path('../../../shared/complex/rect', __FILE__)
describe "Complex#rectangular" do
it_behaves_like(:complex_rect, :rectangular)
Modified: MacRuby/trunk/spec/frozen/core/complex/to_s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/complex/to_s_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/complex/to_s_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../shared/complex/to_s'
+require File.expand_path('../../../shared/complex/to_s', __FILE__)
ruby_version_is "1.9" do
Modified: MacRuby/trunk/spec/frozen/core/continuation/call_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/continuation/call_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/continuation/call_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1,8 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/continuation/call', __FILE__)
+
+with_feature :continuation do
+ describe "Continuation#call" do
+ it_behaves_like :continuation_call, :call
+ end
+end
Modified: MacRuby/trunk/spec/frozen/core/continuation/element_reference_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/continuation/element_reference_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/continuation/element_reference_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1,8 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/continuation/call', __FILE__)
+
+with_feature :continuation do
+ describe "Continuation#call" do
+ it_behaves_like :continuation_call, :[]
+ end
+end
Added: MacRuby/trunk/spec/frozen/core/continuation/new_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/continuation/new_spec.rb (rev 0)
+++ MacRuby/trunk/spec/frozen/core/continuation/new_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -0,0 +1,8 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/continuation/new', __FILE__)
+
+with_feature :continuation do
+ describe "Continuation.new" do
+ it_behaves_like :continuation_new, :new
+ end
+end
Modified: MacRuby/trunk/spec/frozen/core/dir/chdir_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/chdir_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/chdir_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
describe "Dir.chdir" do
before :all do
Modified: MacRuby/trunk/spec/frozen/core/dir/chroot_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/chroot_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/chroot_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,79 +1,50 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
+require File.expand_path('../shared/chroot', __FILE__)
platform_is_not :windows do
not_supported_on :jruby do
as_superuser do
describe "Dir.chroot as root" do
- before :all do
- DirSpecs.create_mock_dirs
+ it_behaves_like :dir_chroot_as_root, :chroot
+ end
+ end
- @real_root = "../" * (File.dirname(__FILE__).count('/') - 1)
- @ref_dir = File.join("/", Dir.new('/').entries.first)
- end
-
- after(:all) do
- until File.exists?(@ref_dir)
- Dir.chroot("../") or break
+ platform_is_not :os => :cygwin do
+ as_user do
+ describe "Dir.chroot as regular user" do
+ before :all do
+ DirSpecs.create_mock_dirs
end
- DirSpecs.delete_mock_dirs
- end
+ after :all do
+ DirSpecs.delete_mock_dirs
+ end
- it "can be used to change the process' root directory" do
- lambda { Dir.chroot(File.dirname(__FILE__)) }.should_not raise_error
- File.exists?("/#{File.basename(__FILE__)}").should be_true
- end
+ it "raises an Errno::EPERM exception if the directory exists" do
+ lambda { Dir.chroot('.') }.should raise_error(Errno::EPERM)
+ end
- it "returns 0 if successful" do
- Dir.chroot('/').should == 0
- end
+ it "raises a SystemCallError if the directory doesn't exist" do
+ lambda { Dir.chroot('xgwhwhsjai2222jg') }.should raise_error(SystemCallError)
+ end
- it "raises an Errno::ENOENT exception if the directory doesn't exist" do
- lambda { Dir.chroot('xgwhwhsjai2222jg') }.should raise_error(Errno::ENOENT)
- end
-
- it "can be escaped from with ../" do
- Dir.chroot(@real_root)
- File.exists?(@ref_dir).should be_true
- File.exists?("/#{File.basename(__FILE__)}").should be_false
- end
-
- ruby_version_is "1.9" do
- it "calls #to_path on non-String argument" do
- p = mock('path')
- p.should_receive(:to_path).and_return(@real_root)
- Dir.chroot(p)
+ ruby_version_is "1.9" do
+ it "calls #to_path on non-String argument" do
+ p = mock('path')
+ p.should_receive(:to_path).and_return('.')
+ lambda { Dir.chroot(p) }.should raise_error
+ end
end
end
end
end
- as_user do
- describe "Dir.chroot as regular user" do
- before :all do
- DirSpecs.create_mock_dirs
+ platform_is :os => :cygwin do
+ as_user do
+ describe "Dir.chroot as regular user" do
+ it_behaves_like :dir_chroot_as_root, :chroot
end
-
- after :all do
- DirSpecs.delete_mock_dirs
- end
-
- it "raises an Errno::EPERM exception if the directory exists" do
- lambda { Dir.chroot('.') }.should raise_error(Errno::EPERM)
- end
-
- it "raises a SystemCallError if the directory doesn't exist" do
- lambda { Dir.chroot('xgwhwhsjai2222jg') }.should raise_error(SystemCallError)
- end
-
- ruby_version_is "1.9" do
- it "calls #to_path on non-String argument" do
- p = mock('path')
- p.should_receive(:to_path).and_return('.')
- lambda { Dir.chroot(p) }.should raise_error
- end
- end
end
end
end
Modified: MacRuby/trunk/spec/frozen/core/dir/close_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/close_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/close_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
-require File.dirname(__FILE__) + '/shared/closed'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
+require File.expand_path('../shared/closed', __FILE__)
describe "Dir#close" do
before :all do
Modified: MacRuby/trunk/spec/frozen/core/dir/delete_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/delete_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/delete_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
-require File.dirname(__FILE__) + '/shared/delete'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
+require File.expand_path('../shared/delete', __FILE__)
describe "Dir.delete" do
before :all do
Modified: MacRuby/trunk/spec/frozen/core/dir/dir_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/dir_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/dir_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Dir" do
it "includes Enumerable" do
Modified: MacRuby/trunk/spec/frozen/core/dir/each_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/each_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/each_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
-require File.dirname(__FILE__) + '/shared/closed'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
+require File.expand_path('../shared/closed', __FILE__)
describe "Dir#each" do
before :all do
@@ -43,7 +43,7 @@
ruby_version_is '1.8.7' do
it 'returns an Enumerator if no block given' do
- @dir.each.should be_kind_of(enumerator_class)
+ @dir.each.should be_an_instance_of(enumerator_class)
@dir.each.to_a.sort.should == DirSpecs.expected_paths
end
end
Modified: MacRuby/trunk/spec/frozen/core/dir/element_reference_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/element_reference_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/element_reference_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
-require File.dirname(__FILE__) + '/shared/glob'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
+require File.expand_path('../shared/glob', __FILE__)
describe "Dir.[]" do
before :all do
Modified: MacRuby/trunk/spec/frozen/core/dir/entries_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/entries_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/entries_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
describe "Dir.entries" do
before :all do
Modified: MacRuby/trunk/spec/frozen/core/dir/exist_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/exist_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/exist_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/exists'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
+require File.expand_path('../shared/exists', __FILE__)
ruby_version_is "1.9" do
describe "Dir.exist?" do
Modified: MacRuby/trunk/spec/frozen/core/dir/exists_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/exists_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/exists_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/exists'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
+require File.expand_path('../shared/exists', __FILE__)
ruby_version_is "1.9" do
describe "Dir.exists?" do
Modified: MacRuby/trunk/spec/frozen/core/dir/foreach_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/foreach_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/foreach_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
describe "Dir.foreach" do
before :all do
@@ -44,7 +44,7 @@
ruby_version_is '1.8.7' do
it 'returns an Enumerator if no block given' do
- Dir.foreach(DirSpecs.mock_dir).should be_kind_of(enumerator_class)
+ Dir.foreach(DirSpecs.mock_dir).should be_an_instance_of(enumerator_class)
Dir.foreach(DirSpecs.mock_dir).to_a.sort.should == DirSpecs.expected_paths
end
end
Modified: MacRuby/trunk/spec/frozen/core/dir/getwd_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/getwd_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/getwd_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
-require File.dirname(__FILE__) + '/shared/pwd'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
+require File.expand_path('../shared/pwd', __FILE__)
describe "Dir.getwd" do
before :all do
Modified: MacRuby/trunk/spec/frozen/core/dir/glob_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/glob_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/glob_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
-require File.dirname(__FILE__) + '/shared/glob'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
+require File.expand_path('../shared/glob', __FILE__)
describe "Dir.glob" do
before :all do
Modified: MacRuby/trunk/spec/frozen/core/dir/home_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/home_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/home_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,7 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
-ruby_version_is "1.9.2" do
+ruby_version_is "1.9" do
describe "Dir.home" do
before :all do
DirSpecs.create_mock_dirs
Modified: MacRuby/trunk/spec/frozen/core/dir/inspect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/inspect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/inspect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
ruby_version_is "1.8.7" do
describe "Dir#inspect" do
Modified: MacRuby/trunk/spec/frozen/core/dir/mkdir_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/mkdir_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/mkdir_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
describe "Dir.mkdir" do
before :all do
@@ -52,6 +52,16 @@
end
end
+ ruby_version_is ""..."1.9" do
+ it "call #to_str on non-String arguments" do
+ DirSpecs.clear_dirs
+ p = mock('path')
+ p.should_receive(:to_str).and_return('nonexisting')
+ Dir.mkdir(p)
+ DirSpecs.clear_dirs
+ end
+ end
+
it "raises a SystemCallError if any of the directories in the path before the last does not exist" do
lambda { Dir.mkdir "#{DirSpecs.nonexistent}/subdir" }.should raise_error(SystemCallError)
end
Modified: MacRuby/trunk/spec/frozen/core/dir/new_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/new_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/new_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
describe "Dir.new" do
it "needs to be reviewed for spec completeness"
Modified: MacRuby/trunk/spec/frozen/core/dir/open_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/open_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/open_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
-require File.dirname(__FILE__) + '/shared/open'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
+require File.expand_path('../shared/open', __FILE__)
describe "Dir.open" do
before :all do
Modified: MacRuby/trunk/spec/frozen/core/dir/path_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/path_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/path_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
-require File.dirname(__FILE__) + '/shared/path'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
+require File.expand_path('../shared/path', __FILE__)
describe "Dir#path" do
before :all do
Modified: MacRuby/trunk/spec/frozen/core/dir/pos_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/pos_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/pos_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,7 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
-require File.dirname(__FILE__) + '/shared/closed'
-require File.dirname(__FILE__) + '/shared/pos'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
+require File.expand_path('../shared/closed', __FILE__)
+require File.expand_path('../shared/pos', __FILE__)
describe "Dir#pos" do
before :all do
Modified: MacRuby/trunk/spec/frozen/core/dir/pwd_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/pwd_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/pwd_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
-require File.dirname(__FILE__) + '/shared/pwd'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
+require File.expand_path('../shared/pwd', __FILE__)
describe "Dir.pwd" do
before :all do
Modified: MacRuby/trunk/spec/frozen/core/dir/read_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/read_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/read_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
-require File.dirname(__FILE__) + '/shared/closed'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
+require File.expand_path('../shared/closed', __FILE__)
describe "Dir#read" do
before :all do
Modified: MacRuby/trunk/spec/frozen/core/dir/rewind_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/rewind_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/rewind_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
-require File.dirname(__FILE__) + '/shared/closed'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
+require File.expand_path('../shared/closed', __FILE__)
describe "Dir#rewind" do
before :all do
Modified: MacRuby/trunk/spec/frozen/core/dir/rmdir_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/rmdir_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/rmdir_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
-require File.dirname(__FILE__) + '/shared/delete'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
+require File.expand_path('../shared/delete', __FILE__)
describe "Dir.rmdir" do
before :all do
Modified: MacRuby/trunk/spec/frozen/core/dir/seek_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/seek_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/seek_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
-require File.dirname(__FILE__) + '/shared/pos'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
+require File.expand_path('../shared/pos', __FILE__)
describe "Dir#seek" do
before :all do
Added: MacRuby/trunk/spec/frozen/core/dir/shared/chroot.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/shared/chroot.rb (rev 0)
+++ MacRuby/trunk/spec/frozen/core/dir/shared/chroot.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -0,0 +1,43 @@
+describe :dir_chroot_as_root, :shared => true do
+ before :all do
+ DirSpecs.create_mock_dirs
+
+ @real_root = "../" * (File.dirname(__FILE__).count('/') - 1)
+ @ref_dir = File.join("/", Dir.new('/').entries.first)
+ end
+
+ after(:all) do
+ until File.exists?(@ref_dir)
+ Dir.send(@method, "../") or break
+ end
+
+ DirSpecs.delete_mock_dirs
+ end
+
+ it "can be used to change the process' root directory" do
+ lambda { Dir.send(@method, File.dirname(__FILE__)) }.should_not raise_error
+ File.exists?("/#{File.basename(__FILE__)}").should be_true
+ end
+
+ it "returns 0 if successful" do
+ Dir.send(@method, '/').should == 0
+ end
+
+ it "raises an Errno::ENOENT exception if the directory doesn't exist" do
+ lambda { Dir.send(@method, 'xgwhwhsjai2222jg') }.should raise_error(Errno::ENOENT)
+ end
+
+ it "can be escaped from with ../" do
+ Dir.send(@method, @real_root)
+ File.exists?(@ref_dir).should be_true
+ File.exists?("/#{File.basename(__FILE__)}").should be_false
+ end
+
+ ruby_version_is "1.9" do
+ it "calls #to_path on non-String argument" do
+ p = mock('path')
+ p.should_receive(:to_path).and_return(@real_root)
+ Dir.send(@method, p)
+ end
+ end
+end
Modified: MacRuby/trunk/spec/frozen/core/dir/shared/delete.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/shared/delete.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/shared/delete.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -20,6 +20,15 @@
end
end
+ ruby_version_is ""..."1.9" do
+ it "calls #to_str on non-String arguments" do
+ DirSpecs.rmdir_dirs
+ p = mock('path')
+ p.should_receive(:to_str).and_return(DirSpecs.mock_rmdir("empty"))
+ Dir.send(@method, p)
+ end
+ end
+
it "raises a SystemCallError when trying to remove a nonempty directory" do
lambda do
Dir.send @method, DirSpecs.mock_rmdir("nonempty")
Modified: MacRuby/trunk/spec/frozen/core/dir/shared/path.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/shared/path.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/shared/path.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../fixtures/common'
-require File.dirname(__FILE__) + '/closed'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/common', __FILE__)
+require File.expand_path('../closed', __FILE__)
describe :dir_path, :shared => true do
it "returns the path that was supplied to .new or .open" do
Modified: MacRuby/trunk/spec/frozen/core/dir/tell_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/tell_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/tell_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,7 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
-require File.dirname(__FILE__) + '/shared/closed'
-require File.dirname(__FILE__) + '/shared/pos'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
+require File.expand_path('../shared/closed', __FILE__)
+require File.expand_path('../shared/pos', __FILE__)
describe "Dir#tell" do
before :all do
Modified: MacRuby/trunk/spec/frozen/core/dir/to_path.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/to_path.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/to_path.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
-require File.dirname(__FILE__) + '/shared/path'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
+require File.expand_path('../shared/path', __FILE__)
ruby_version_is "1.9" do
describe "Dir#to_path" do
Modified: MacRuby/trunk/spec/frozen/core/dir/unlink_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/dir/unlink_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/dir/unlink_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
-require File.dirname(__FILE__) + '/shared/delete'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
+require File.expand_path('../shared/delete', __FILE__)
describe "Dir.unlink" do
before :all do
Modified: MacRuby/trunk/spec/frozen/core/encoding/aliases_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/aliases_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/aliases_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding.aliases" do
it "returns a Hash" do
Encoding.aliases.should be_an_instance_of(Hash)
@@ -42,4 +42,4 @@
end
end
end
-end
\ No newline at end of file
+end
Modified: MacRuby/trunk/spec/frozen/core/encoding/ascii_compatible_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/ascii_compatible_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/ascii_compatible_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding#ascii_compatible?" do
it "returns true if self represents an ASCII-compatible encoding" do
Encoding::UTF_8.ascii_compatible?.should be_true
Modified: MacRuby/trunk/spec/frozen/core/encoding/compatible_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/compatible_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/compatible_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding.compatible?" do
it "returns an Encoding object if the given encodings are compatible" do
Encoding.compatible?('a','a').should be_an_instance_of(Encoding)
@@ -23,4 +23,4 @@
Encoding.compatible?([], :foo).should be_nil
end
end
-end
\ No newline at end of file
+end
Modified: MacRuby/trunk/spec/frozen/core/encoding/converter/asciicompat_encoding_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/converter/asciicompat_encoding_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/converter/asciicompat_encoding_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding::Converter.asciicompat_encoding" do
it "accepts an encoding name as a String argument" do
lambda { Encoding::Converter.asciicompat_encoding('UTF-8') }.
Modified: MacRuby/trunk/spec/frozen/core/encoding/converter/constants_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/converter/constants_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/converter/constants_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding::Converter::INVALID_MASK" do
it "exists" do
Encoding::Converter.should have_constant(:INVALID_MASK)
Modified: MacRuby/trunk/spec/frozen/core/encoding/converter/convert_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/converter/convert_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/converter/convert_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding::Converter#convert" do
it "returns a String" do
ec = Encoding::Converter.new('ascii', 'utf-8')
Modified: MacRuby/trunk/spec/frozen/core/encoding/converter/convpath_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/converter/convpath_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/converter/convpath_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding::Converter#convpath" do
before(:all) do
@perms = Encoding.name_list.permutation(2).map do |pair|
Modified: MacRuby/trunk/spec/frozen/core/encoding/converter/destination_encoding_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/converter/destination_encoding_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/converter/destination_encoding_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding::Converter#destination_encoding" do
it "returns the destination encoding as an Encoding object" do
ec = Encoding::Converter.new('ASCII','Big5')
Modified: MacRuby/trunk/spec/frozen/core/encoding/converter/finish_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/converter/finish_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/converter/finish_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding::Converter#finish" do
before(:each) do
@ec = Encoding::Converter.new("utf-8", "iso-2022-jp")
Modified: MacRuby/trunk/spec/frozen/core/encoding/converter/last_error_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/converter/last_error_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/converter/last_error_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding::Converter#last_error" do
it "returns nil when the no conversion has been attempted" do
ec = Encoding::Converter.new('ascii','utf-8')
Modified: MacRuby/trunk/spec/frozen/core/encoding/converter/primitive_convert_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/converter/primitive_convert_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/converter/primitive_convert_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding::Converter#primitive_convert" do
it "accepts a nil source buffer" do
ec = Encoding::Converter.new("utf-8", "iso-8859-1")
@@ -134,4 +134,4 @@
.should == :destination_buffer_full
end
end
-end
\ No newline at end of file
+end
Modified: MacRuby/trunk/spec/frozen/core/encoding/converter/primitive_errinfo_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/converter/primitive_errinfo_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/converter/primitive_errinfo_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding::Converter#primitive_errinfo" do
it "returns [:source_buffer_empty,nil,nil,nil,nil] when no conversion has been attempted" do
ec = Encoding::Converter.new('ascii','utf-8')
Modified: MacRuby/trunk/spec/frozen/core/encoding/converter/putback_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/converter/putback_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/converter/putback_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding::Converter#putback" do
before(:each) do
@ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1")
@@ -21,7 +21,7 @@
@ec.primitive_errinfo.last.should == 'd'
end
- it "allows conversion to be resumed after an :invalid_byte_sequence" do
+ it "allows conversion to be resumed after an :invalid_byte_sequence" do
@src = @ec.putback + @src
@ret = @ec.primitive_convert(@src, @dst, nil, 10)
@ret.should == :finished
@@ -39,7 +39,7 @@
src = "\x00\xd8\x61\x00"
dst = ""
ec.primitive_convert(src, dst).should == :invalid_byte_sequence
- ec.primitive_errinfo.should ==
+ ec.primitive_errinfo.should ==
[:invalid_byte_sequence, "UTF-16LE", "UTF-8", "\x00\xD8", "a\x00"]
ec.putback(1).should == "\x00".force_encoding("utf-16le")
ec.putback.should == "a".force_encoding("utf-16le")
Modified: MacRuby/trunk/spec/frozen/core/encoding/converter/replacement_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/converter/replacement_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/converter/replacement_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding::Converter#replacement" do
it "returns '?' in US-ASCII when the destination encoding is not UTF-8" do
ec = Encoding::Converter.new("utf-8", "us-ascii")
Modified: MacRuby/trunk/spec/frozen/core/encoding/converter/search_convpath_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/converter/search_convpath_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/converter/search_convpath_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding::Converter.search_convpath" do
before(:all) do
@perms = Encoding.name_list.permutation(2).map do |pair|
Modified: MacRuby/trunk/spec/frozen/core/encoding/converter/source_encoding_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/converter/source_encoding_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/converter/source_encoding_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding::Converter#source_encoding" do
it "returns the source encoding as an Encoding object" do
ec = Encoding::Converter.new('ASCII','Big5')
Modified: MacRuby/trunk/spec/frozen/core/encoding/default_external_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/default_external_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/default_external_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding.default_external" do
before(:all) do
@original_encoding = Encoding.default_external
Modified: MacRuby/trunk/spec/frozen/core/encoding/default_internal_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/default_internal_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/default_internal_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding.default_internal" do
before(:each) do
@original_encoding = Encoding.default_internal
Modified: MacRuby/trunk/spec/frozen/core/encoding/dummy_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/dummy_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/dummy_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding#dummy?" do
it "returns false for proper encodings" do
Encoding::UTF_8.dummy?.should be_false
@@ -13,4 +13,4 @@
Encoding::UTF_7.dummy?.should be_true
end
end
-end
\ No newline at end of file
+end
Modified: MacRuby/trunk/spec/frozen/core/encoding/find_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/find_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/find_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding.find" do
before(:all) do
@encodings = Encoding.aliases.to_a.flatten.uniq
@@ -18,9 +18,9 @@
end
end
- it "accepts encoding names as Symbols" do
+ it "does NOT accept encoding names as Symbols" do
@encodings.each do |enc|
- Encoding.find(enc.to_sym).should == Encoding.find(enc)
+ lambda { Encoding.find(enc.to_sym) }.should raise_error(TypeError)
end
end
@@ -63,4 +63,4 @@
lambda { Encoding.find('dh2dh278d') }.should raise_error(ArgumentError)
end
end
-end
\ No newline at end of file
+end
Modified: MacRuby/trunk/spec/frozen/core/encoding/inspect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/inspect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/inspect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding#inspect" do
it "returns a String" do
Encoding::UTF_8.inspect.should be_an_instance_of(String)
@@ -18,4 +18,4 @@
end
end
end
-end
\ No newline at end of file
+end
Modified: MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/destination_encoding_name_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/destination_encoding_name_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/destination_encoding_name_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../fixtures/classes'
+require File.expand_path('../../fixtures/classes', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding::InvalidByteSequenceError#destination_encoding_name" do
before(:each) do
@exception, = EncodingSpecs::InvalidByteSequenceError.exception
Modified: MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/destination_encoding_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/destination_encoding_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/destination_encoding_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../fixtures/classes'
+require File.expand_path('../../fixtures/classes', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding::InvalidByteSequenceError#destination_encoding" do
before(:each) do
@exception, = EncodingSpecs::InvalidByteSequenceError.exception
Modified: MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/error_bytes_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/error_bytes_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/error_bytes_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../fixtures/classes'
+require File.expand_path('../../fixtures/classes', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding::InvalidByteSequenceError#error_bytes" do
before(:each) do
@exception, @errinfo = EncodingSpecs::InvalidByteSequenceError.exception
Modified: MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/incomplete_input_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/incomplete_input_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/incomplete_input_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding::InvalidByteSequenceError#incomplete_input?" do
it "returns nil by default" do
Modified: MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/readagain_bytes_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/readagain_bytes_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/readagain_bytes_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../fixtures/classes'
+require File.expand_path('../../fixtures/classes', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding::InvalidByteSequenceError#readagain_bytes" do
before(:each) do
@exception, @errinfo = EncodingSpecs::InvalidByteSequenceError.exception
Modified: MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/source_encoding_name_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/source_encoding_name_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/source_encoding_name_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../fixtures/classes'
+require File.expand_path('../../fixtures/classes', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding::UndefinedConversionError#source_encoding_name" do
before(:each) do
@exception, = EncodingSpecs::UndefinedConversionError.exception
Modified: MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/source_encoding_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/source_encoding_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/invalid_byte_sequence_error/source_encoding_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../fixtures/classes'
+require File.expand_path('../../fixtures/classes', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding::InvalidByteSequenceError#source_encoding" do
before(:each) do
@exception, = EncodingSpecs::InvalidByteSequenceError.exception
Modified: MacRuby/trunk/spec/frozen/core/encoding/list_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/list_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/list_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding.list" do
it "returns an Array" do
Encoding.list.should be_an_instance_of(Array)
@@ -40,4 +40,4 @@
# TODO: Find example that illustrates this
it "updates the list when #find is used to load a new encoding"
end
-end
\ No newline at end of file
+end
Modified: MacRuby/trunk/spec/frozen/core/encoding/locale_charmap_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/locale_charmap_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/locale_charmap_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding.locale_charmap" do
it "returns a String" do
Encoding.locale_charmap.should be_an_instance_of(String)
Modified: MacRuby/trunk/spec/frozen/core/encoding/name_list_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/name_list_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/name_list_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding.name_list" do
it "returns an Array" do
Encoding.name_list.should be_an_instance_of(Array)
@@ -22,4 +22,4 @@
end
end
end
-end
\ No newline at end of file
+end
Modified: MacRuby/trunk/spec/frozen/core/encoding/name_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/name_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/name_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,7 @@
-require File.dirname(__FILE__) + '/shared/name'
+require File.expand_path('../shared/name', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding#name" do
it_behaves_like(:encoding_name, :name)
end
-end
\ No newline at end of file
+end
Modified: MacRuby/trunk/spec/frozen/core/encoding/names_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/names_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/names_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding#names" do
it "returns an Array" do
Encoding.name_list.each do |name|
@@ -34,4 +34,4 @@
end
end
end
-end
\ No newline at end of file
+end
Modified: MacRuby/trunk/spec/frozen/core/encoding/replicate_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/replicate_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/replicate_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding#replicate" do
it "returns a replica of ASCII" do
e = Encoding::ASCII.replicate('RS-ASCII')
Modified: MacRuby/trunk/spec/frozen/core/encoding/shared/name.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/shared/name.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/shared/name.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe :encoding_name, :shared => true do
it "returns a String" do
Modified: MacRuby/trunk/spec/frozen/core/encoding/to_s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/to_s_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/to_s_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,7 @@
-require File.dirname(__FILE__) + '/shared/name'
+require File.expand_path('../shared/name', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding#to_s" do
it_behaves_like(:encoding_name, :to_s)
end
-end
\ No newline at end of file
+end
Modified: MacRuby/trunk/spec/frozen/core/encoding/undefined_conversion_error/destination_encoding_name_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/undefined_conversion_error/destination_encoding_name_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/undefined_conversion_error/destination_encoding_name_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../fixtures/classes'
+require File.expand_path('../../fixtures/classes', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding::UndefinedConversionError#destination_encoding_name" do
before(:each) do
@exception = EncodingSpecs::UndefinedConversionError.exception
Modified: MacRuby/trunk/spec/frozen/core/encoding/undefined_conversion_error/destination_encoding_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/undefined_conversion_error/destination_encoding_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/undefined_conversion_error/destination_encoding_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../fixtures/classes'
+require File.expand_path('../../fixtures/classes', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding::UndefinedConversionError#destination_encoding" do
before(:each) do
@exception = EncodingSpecs::UndefinedConversionError.exception
Modified: MacRuby/trunk/spec/frozen/core/encoding/undefined_conversion_error/error_char_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/undefined_conversion_error/error_char_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/undefined_conversion_error/error_char_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../fixtures/classes'
+require File.expand_path('../../fixtures/classes', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding::UndefinedConversionError#error_char" do
before(:each) do
@exception = EncodingSpecs::UndefinedConversionError.exception
Modified: MacRuby/trunk/spec/frozen/core/encoding/undefined_conversion_error/source_encoding_name_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/undefined_conversion_error/source_encoding_name_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/undefined_conversion_error/source_encoding_name_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../fixtures/classes'
+require File.expand_path('../../fixtures/classes', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding::UndefinedConversionError#source_encoding_name" do
before(:each) do
@exception = EncodingSpecs::UndefinedConversionError.exception
Modified: MacRuby/trunk/spec/frozen/core/encoding/undefined_conversion_error/source_encoding_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/encoding/undefined_conversion_error/source_encoding_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/encoding/undefined_conversion_error/source_encoding_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../fixtures/classes'
+require File.expand_path('../../fixtures/classes', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "Encoding::UndefinedConversionError#source_encoding" do
before(:each) do
@exception = EncodingSpecs::UndefinedConversionError.exception
Modified: MacRuby/trunk/spec/frozen/core/enumerable/all_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/all_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/all_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Enumerable#all?" do
Modified: MacRuby/trunk/spec/frozen/core/enumerable/any_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/any_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/any_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Enumerable#any?" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/enumerable/chunk_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/chunk_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/chunk_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
ruby_version_is "1.9" do
describe "Enumerable#chunk" do
@@ -10,7 +10,7 @@
end
it "returns an Enumerator if given a block" do
- EnumerableSpecs::Numerous.new.chunk {}.should be_an_instance_of(Enumerator)
+ EnumerableSpecs::Numerous.new.chunk {}.should be_an_instance_of(enumerator_class)
end
it "yields each element of the Enumerable to the block" do
Modified: MacRuby/trunk/spec/frozen/core/enumerable/collect_concat_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/collect_concat_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/collect_concat_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,8 +1,8 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/collect_concat'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/collect_concat', __FILE__)
-ruby_version_is "1.9.2" do
+ruby_version_is "1.9" do
describe "Enumerable#collect_concat" do
it_behaves_like(:enumerable_collect_concat , :collect_concat)
end
Modified: MacRuby/trunk/spec/frozen/core/enumerable/collect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/collect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/collect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/collect'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/collect', __FILE__)
describe "Enumerable#collect" do
it_behaves_like(:enumerable_collect , :collect)
Modified: MacRuby/trunk/spec/frozen/core/enumerable/count_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/count_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/count_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Enumerable#count" do
ruby_version_is '1.8.7' do
Modified: MacRuby/trunk/spec/frozen/core/enumerable/cycle_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/cycle_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/cycle_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Enumerable#cycle" do
ruby_version_is '1.8.7' do
Modified: MacRuby/trunk/spec/frozen/core/enumerable/detect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/detect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/detect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/find'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/find', __FILE__)
describe "Enumerable#detect" do
it_behaves_like(:enumerable_find , :detect)
Modified: MacRuby/trunk/spec/frozen/core/enumerable/drop_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/drop_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/drop_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Enumerable#drop" do
ruby_version_is '1.8.7' do
Modified: MacRuby/trunk/spec/frozen/core/enumerable/drop_while_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/drop_while_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/drop_while_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Enumerable#drop_while" do
ruby_version_is '1.8.7' do
@@ -8,7 +8,7 @@
end
it 'returns an Enumerator if no block given' do
- @enum.drop_while.should be_kind_of(enumerator_class)
+ @enum.drop_while.should be_an_instance_of(enumerator_class)
end
it "returns no/all elements for {true/false} block" do
Modified: MacRuby/trunk/spec/frozen/core/enumerable/each_cons_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/each_cons_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/each_cons_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
require 'enumerator'
describe "Enumerable#each_cons" do
@@ -50,7 +50,7 @@
ruby_version_is '1.8.7' do
it "returns an enumerator if no block" do
e = @enum.each_cons(3)
- e.should be_kind_of(enumerator_class)
+ e.should be_an_instance_of(enumerator_class)
e.to_a.should == @in_threes
end
end
Modified: MacRuby/trunk/spec/frozen/core/enumerable/each_slice_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/each_slice_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/each_slice_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
require 'enumerator'
describe "Enumerable#each_slice" do
@@ -50,7 +50,7 @@
ruby_version_is '1.8.7' do
it "returns an enumerator if no block" do
e = @enum.each_slice(3)
- e.should be_kind_of(enumerator_class)
+ e.should be_an_instance_of(enumerator_class)
e.to_a.should == @sliced
end
end
Modified: MacRuby/trunk/spec/frozen/core/enumerable/each_with_index_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/each_with_index_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/each_with_index_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Enumerable#each_with_index" do
@@ -38,7 +38,7 @@
ruby_version_is '1.8.7' do
it "returns an enumerator if no block" do
e = @b.each_with_index
- e.should be_kind_of(enumerator_class)
+ e.should be_an_instance_of(enumerator_class)
e.to_a.should == [[2, 0], [5, 1], [3, 2], [6, 3], [1, 4], [4, 5]]
end
end
Modified: MacRuby/trunk/spec/frozen/core/enumerable/each_with_object_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/each_with_object_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/each_with_object_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Enumerable#each_with_object" do
ruby_version_is '1.8.8' do
Modified: MacRuby/trunk/spec/frozen/core/enumerable/entries_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/entries_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/entries_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/entries'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/entries', __FILE__)
describe "Enumerable#entries" do
it_behaves_like(:enumerable_entries , :entries)
Modified: MacRuby/trunk/spec/frozen/core/enumerable/find_all_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/find_all_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/find_all_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/find_all'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/find_all', __FILE__)
describe "Enumerable#find_all" do
it_behaves_like(:enumerable_find_all , :find_all)
Modified: MacRuby/trunk/spec/frozen/core/enumerable/find_index_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/find_index_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/find_index_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Enumerable#find_index" do
ruby_version_is "1.8.7" do
@@ -45,7 +45,7 @@
ruby_version_is '1.8.7' do
it 'returns an Enumerator if no block given' do
- @numerous.find_index.should be_kind_of(enumerator_class)
+ @numerous.find_index.should be_an_instance_of(enumerator_class)
end
end
Modified: MacRuby/trunk/spec/frozen/core/enumerable/find_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/find_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/find_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/find'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/find', __FILE__)
describe "Enumerable#find" do
it_behaves_like(:enumerable_find , :find)
Modified: MacRuby/trunk/spec/frozen/core/enumerable/first_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/first_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/first_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/take'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/take', __FILE__)
describe "Enumerable#first" do
ruby_version_is '1.8.7' do
Modified: MacRuby/trunk/spec/frozen/core/enumerable/flat_map_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/flat_map_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/flat_map_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,8 +1,8 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/collect_concat'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/collect_concat', __FILE__)
-ruby_version_is "1.9.2" do
+ruby_version_is "1.9" do
describe "Enumerable#flat_map" do
it_behaves_like(:enumerable_collect_concat , :flat_map)
end
Modified: MacRuby/trunk/spec/frozen/core/enumerable/grep_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/grep_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/grep_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Enumerable#grep" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/enumerable/group_by_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/group_by_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/group_by_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Enumerable#group_by" do
ruby_version_is "1.8.7" do
@@ -13,7 +13,7 @@
end
it "returns an Enumerator if called without a block" do
- EnumerableSpecs::Numerous.new.group_by.should be_kind_of(enumerator_class)
+ EnumerableSpecs::Numerous.new.group_by.should be_an_instance_of(enumerator_class)
end
end
end
\ No newline at end of file
Modified: MacRuby/trunk/spec/frozen/core/enumerable/include_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/include_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/include_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/include'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/include', __FILE__)
describe "Enumerable#include?" do
it_behaves_like(:enumerable_include, :include?)
Modified: MacRuby/trunk/spec/frozen/core/enumerable/inject_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/inject_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/inject_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/inject'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/inject', __FILE__)
describe "Enumerable#inject" do
it_behaves_like :enumerable_inject, :inject
Modified: MacRuby/trunk/spec/frozen/core/enumerable/join_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/join_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/join_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../shared/array/join'
-require File.dirname(__FILE__) + '/../array/fixtures/classes'
+require File.expand_path('../../../shared/array/join', __FILE__)
+require File.expand_path('../../array/fixtures/classes', __FILE__)
ruby_version_is "1.9" do
describe "Enumerable#join" do
Modified: MacRuby/trunk/spec/frozen/core/enumerable/map_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/map_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/map_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/collect'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/collect', __FILE__)
describe "Enumerable#map" do
it_behaves_like(:enumerable_collect , :map)
Modified: MacRuby/trunk/spec/frozen/core/enumerable/max_by_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/max_by_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/max_by_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,10 +1,10 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Enumerable#max_by" do
ruby_version_is '1.8.7' do
it "returns an enumerator if no block" do
- EnumerableSpecs::Numerous.new(42).max_by.should be_kind_of(enumerator_class)
+ EnumerableSpecs::Numerous.new(42).max_by.should be_an_instance_of(enumerator_class)
end
it "returns nil if #each yields no objects" do
Modified: MacRuby/trunk/spec/frozen/core/enumerable/max_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/max_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/max_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Enumerable#max" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/enumerable/member_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/member_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/member_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/include'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/include', __FILE__)
describe "Enumerable#member?" do
it_behaves_like(:enumerable_include, :member?)
Modified: MacRuby/trunk/spec/frozen/core/enumerable/min_by_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/min_by_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/min_by_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,10 +1,10 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Enumerable#min_by" do
ruby_version_is '1.8.7' do
it "returns an enumerator if no block" do
- EnumerableSpecs::Numerous.new(42).min_by.should be_kind_of(enumerator_class)
+ EnumerableSpecs::Numerous.new(42).min_by.should be_an_instance_of(enumerator_class)
end
it "returns nil if #each yields no objects" do
Modified: MacRuby/trunk/spec/frozen/core/enumerable/min_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/min_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/min_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Enumerable#min" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/enumerable/minmax_by_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/minmax_by_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/minmax_by_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,10 +1,10 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Enumerable#minmax_by" do
ruby_version_is '1.8.7' do
it "returns an enumerator if no block" do
- EnumerableSpecs::Numerous.new(42).minmax_by.should be_kind_of(enumerator_class)
+ EnumerableSpecs::Numerous.new(42).minmax_by.should be_an_instance_of(enumerator_class)
end
it "returns nil if #each yields no objects" do
Modified: MacRuby/trunk/spec/frozen/core/enumerable/minmax_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/minmax_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/minmax_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Enumerable#minmax" do
ruby_version_is '1.8.7' do
Modified: MacRuby/trunk/spec/frozen/core/enumerable/none_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/none_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/none_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
ruby_version_is "1.8.7" do
describe "Enumerable#none?" do
Modified: MacRuby/trunk/spec/frozen/core/enumerable/one_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/one_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/one_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Enumerable#one?" do
it "needs to be reviewed for spec completeness"
Modified: MacRuby/trunk/spec/frozen/core/enumerable/partition_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/partition_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/partition_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Enumerable#partition" do
it "returns two arrays, the first containing elements for which the block is true, the second containing the rest" do
@@ -14,7 +14,7 @@
ruby_version_is "1.8.7" do
it "returns an Enumerator if called without a block" do
- EnumerableSpecs::Numerous.new.partition.should be_kind_of(enumerator_class)
+ EnumerableSpecs::Numerous.new.partition.should be_an_instance_of(enumerator_class)
end
end
end
Modified: MacRuby/trunk/spec/frozen/core/enumerable/reduce_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/reduce_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/reduce_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/inject'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/inject', __FILE__)
describe "Enumerable#reduce" do
ruby_version_is '1.8.7' do
Modified: MacRuby/trunk/spec/frozen/core/enumerable/reject_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/reject_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/reject_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Enumerable#reject" do
it "returns an array of the elements for which block is false" do
@@ -19,7 +19,7 @@
ruby_version_is "1.8.7" do
it "returns an Enumerator if called without a block" do
- EnumerableSpecs::Numerous.new.reject.should be_kind_of(enumerator_class)
+ EnumerableSpecs::Numerous.new.reject.should be_an_instance_of(enumerator_class)
end
end
end
Modified: MacRuby/trunk/spec/frozen/core/enumerable/reverse_each_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/reverse_each_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/reverse_each_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
ruby_version_is '1.8.7' do
describe "Enumerable#reverse_each" do
@@ -12,7 +12,7 @@
it 'returns an Enumerator if no block given' do
enum = EnumerableSpecs::Numerous.new.reverse_each
- enum.should be_kind_of(enumerator_class)
+ enum.should be_an_instance_of(enumerator_class)
enum.to_a.should == [4, 1, 6, 3, 5, 2]
end
end
Modified: MacRuby/trunk/spec/frozen/core/enumerable/select_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/select_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/select_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/find_all'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/find_all', __FILE__)
describe "Enumerable#select" do
it_behaves_like(:enumerable_find_all , :select)
Modified: MacRuby/trunk/spec/frozen/core/enumerable/shared/collect.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/shared/collect.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/shared/collect.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -29,7 +29,7 @@
ruby_version_is "1.9" do
it "returns an enumerator when no block given" do
enum = EnumerableSpecs::Numerous.new.send(@method)
- enum.should be_kind_of(enumerator_class)
+ enum.should be_an_instance_of(enumerator_class)
enum.each { |i| -i }.should == [-2, -5, -3, -6, -1, -4]
end
end
Modified: MacRuby/trunk/spec/frozen/core/enumerable/shared/collect_concat.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/shared/collect_concat.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/shared/collect_concat.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -21,7 +21,7 @@
it "returns an enumerator when no block given" do
enum = EnumerableSpecs::Numerous.new(1, 2).send(@method)
- enum.should be_kind_of(enumerator_class)
+ enum.should be_an_instance_of(enumerator_class)
enum.each{ |i| [i] * i }.should == [1, 2, 2]
end
end
Modified: MacRuby/trunk/spec/frozen/core/enumerable/shared/find.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/shared/find.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/shared/find.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -47,7 +47,7 @@
end
ruby_version_is "1.8.7" do
it "returns an enumerator when no block given" do
- @numerous.send(@method).should be_kind_of(enumerator_class)
+ @numerous.send(@method).should be_an_instance_of(enumerator_class)
end
it "passes the ifnone proc to the enumerator" do
Modified: MacRuby/trunk/spec/frozen/core/enumerable/shared/find_all.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/shared/find_all.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/shared/find_all.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -17,7 +17,7 @@
end
ruby_version_is "1.8.7" do
it "returns an enumerator when no block given" do
- @numerous.send(@method).should be_kind_of(enumerator_class)
+ @numerous.send(@method).should be_an_instance_of(enumerator_class)
end
end
Modified: MacRuby/trunk/spec/frozen/core/enumerable/sort_by_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/sort_by_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/sort_by_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Enumerable#sort_by" do
it "returns an array of elements ordered by the result of block" do
Modified: MacRuby/trunk/spec/frozen/core/enumerable/sort_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/sort_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/sort_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Enumerable#sort" do
it "sorts by the natural order as defined by <=> " do
Modified: MacRuby/trunk/spec/frozen/core/enumerable/take_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/take_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/take_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/take'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/take', __FILE__)
describe "Enumerable#take" do
ruby_version_is '1.8.7' do
Modified: MacRuby/trunk/spec/frozen/core/enumerable/take_while_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/take_while_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/take_while_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Enumerable#take_while" do
ruby_version_is '1.8.7' do
@@ -8,7 +8,7 @@
end
it 'returns an Enumerator if no block given' do
- @enum.take_while.should be_kind_of(enumerator_class)
+ @enum.take_while.should be_an_instance_of(enumerator_class)
end
it "returns no/all elements for {true/false} block" do
Modified: MacRuby/trunk/spec/frozen/core/enumerable/to_a_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/to_a_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/to_a_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/entries'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/entries', __FILE__)
describe "Enumerable#to_a" do
it_behaves_like(:enumerable_entries , :to_a)
Modified: MacRuby/trunk/spec/frozen/core/enumerable/zip_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerable/zip_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerable/zip_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Enumerable#zip" do
Modified: MacRuby/trunk/spec/frozen/core/enumerator/each_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerator/each_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerator/each_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../shared/enumerator/each'
+require File.expand_path('../../../shared/enumerator/each', __FILE__)
ruby_version_is "1.8.7" do
describe "Enumerator#each" do
Modified: MacRuby/trunk/spec/frozen/core/enumerator/each_with_index_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerator/each_with_index_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerator/each_with_index_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,7 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.8.7" do
- require File.dirname(__FILE__) + '/../../shared/enumerator/with_index'
+ require File.expand_path('../../../shared/enumerator/with_index', __FILE__)
describe "Enumerator#each_with_index" do
it_behaves_like(:enum_with_index, :each_with_index)
@@ -10,6 +10,16 @@
lambda do
[1].to_enum.each_with_index(:glark)
end.should raise_error(ArgumentError)
- end
+ end
+
+ it "passes on the given block's return value" do
+ arr = [1,2,3]
+ arr.delete_if.with_index { |a,b| false }
+ arr.should == [1,2,3]
+ end
+
+ it "returns the iterator's return value" do
+ [1,2,3].select.with_index { |a,b| false }.should == []
+ end
end
end
Modified: MacRuby/trunk/spec/frozen/core/enumerator/each_with_object_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerator/each_with_object_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerator/each_with_object_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/enumerator/with_object'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/enumerator/with_object', __FILE__)
ruby_version_is "1.9" do
describe "Enumerator#each_with_object" do
Modified: MacRuby/trunk/spec/frozen/core/enumerator/enum_for_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerator/enum_for_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerator/enum_for_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,7 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.8.7" do
- require File.dirname(__FILE__) + '/../../shared/enumerator/enum_for'
+ require File.expand_path('../../../shared/enumerator/enum_for', __FILE__)
describe "#enum_for" do
it_behaves_like :enum_for, :enum_for
Modified: MacRuby/trunk/spec/frozen/core/enumerator/new_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerator/new_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerator/new_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,7 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.8.7" do
- require File.dirname(__FILE__) + '/../../shared/enumerator/new'
+ require File.expand_path('../../../shared/enumerator/new', __FILE__)
describe "Enumerator.new" do
it_behaves_like(:enum_new, :new)
@@ -13,7 +13,7 @@
yielder.yield 2
yielder.yield 1
end
- enum.should be_kind_of(enumerator_class)
+ enum.should be_an_instance_of(enumerator_class)
enum.to_a.should == [3,2,1]
end
Modified: MacRuby/trunk/spec/frozen/core/enumerator/next_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerator/next_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerator/next_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,8 +1,8 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
# TODO: enable for 1.8.7 as well
ruby_version_is "1.9" do
- require File.dirname(__FILE__) + '/../../shared/enumerator/next'
+ require File.expand_path('../../../shared/enumerator/next', __FILE__)
describe "Enumerator#next" do
it_behaves_like(:enum_next,:next)
Modified: MacRuby/trunk/spec/frozen/core/enumerator/peek_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerator/peek_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerator/peek_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Enumerator#peek" do
Modified: MacRuby/trunk/spec/frozen/core/enumerator/rewind_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerator/rewind_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerator/rewind_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,7 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.8.7" do
- require File.dirname(__FILE__) + '/../../shared/enumerator/rewind'
+ require File.expand_path('../../../shared/enumerator/rewind', __FILE__)
describe "Enumerator#rewind" do
it_behaves_like(:enum_rewind, :rewind)
Modified: MacRuby/trunk/spec/frozen/core/enumerator/to_enum_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerator/to_enum_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerator/to_enum_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,7 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.8.7" do
- require File.dirname(__FILE__) + '/../../shared/enumerator/enum_for'
+ require File.expand_path('../../../shared/enumerator/enum_for', __FILE__)
describe "#to_enum" do
it_behaves_like :enum_for, :enum_for
Modified: MacRuby/trunk/spec/frozen/core/enumerator/with_index_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerator/with_index_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerator/with_index_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,7 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.8.7" do
- require File.dirname(__FILE__) + '/../../shared/enumerator/with_index'
+ require File.expand_path('../../../shared/enumerator/with_index', __FILE__)
describe "Enumerator#with_index" do
it_behaves_like(:enum_with_index, :with_index)
Modified: MacRuby/trunk/spec/frozen/core/enumerator/with_object_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/enumerator/with_object_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/enumerator/with_object_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/enumerator/with_object'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/enumerator/with_object', __FILE__)
ruby_version_is "1.8.8" do
describe "Enumerator#with_object" do
Modified: MacRuby/trunk/spec/frozen/core/env/clear_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/clear_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/clear_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ENV.clear" do
it "deletes all environment variables" do
Modified: MacRuby/trunk/spec/frozen/core/env/delete_if_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/delete_if_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/delete_if_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ENV.delete_if" do
@@ -20,7 +20,7 @@
ruby_version_is "1.8.7" do
it "returns an Enumerator if no block given" do
- ENV.delete_if.should be_kind_of(enumerator_class)
+ ENV.delete_if.should be_an_instance_of(enumerator_class)
end
end
Modified: MacRuby/trunk/spec/frozen/core/env/delete_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/delete_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/delete_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ENV.delete" do
it "removes the variable and return its value" do
Modified: MacRuby/trunk/spec/frozen/core/env/each_key_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/each_key_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/each_key_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ENV.each_key" do
@@ -25,7 +25,7 @@
ruby_version_is "1.8.7" do
it "returns an Enumerator if called without a block" do
- ENV.each_key.should be_kind_of(enumerator_class)
+ ENV.each_key.should be_an_instance_of(enumerator_class)
end
end
Modified: MacRuby/trunk/spec/frozen/core/env/each_pair_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/each_pair_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/each_pair_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/each.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/each.rb', __FILE__)
describe "ENV.each_pair" do
it_behaves_like(:env_each, :each_pair)
Modified: MacRuby/trunk/spec/frozen/core/env/each_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/each_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/each_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/each.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/each.rb', __FILE__)
describe "ENV.each" do
it_behaves_like(:env_each, :each)
Modified: MacRuby/trunk/spec/frozen/core/env/each_value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/each_value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/each_value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ENV.each_value" do
@@ -25,7 +25,7 @@
ruby_version_is "1.8.7" do
it "returns an Enumerator if called without a block" do
- ENV.each_value.should be_kind_of(enumerator_class)
+ ENV.each_value.should be_an_instance_of(enumerator_class)
end
end
Modified: MacRuby/trunk/spec/frozen/core/env/element_reference_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/element_reference_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/element_reference_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ENV.[]" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/env/element_set_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/element_set_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/element_set_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/store.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/store.rb', __FILE__)
describe "ENV.[]=" do
it_behaves_like(:env_store, :[]=)
Modified: MacRuby/trunk/spec/frozen/core/env/empty_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/empty_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/empty_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ENV.empty?" do
Modified: MacRuby/trunk/spec/frozen/core/env/fetch_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/fetch_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/fetch_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ENV.fetch" do
Modified: MacRuby/trunk/spec/frozen/core/env/has_key_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/has_key_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/has_key_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/include.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/include.rb', __FILE__)
describe "ENV.has_key?" do
it_behaves_like(:env_include, :has_key?)
Modified: MacRuby/trunk/spec/frozen/core/env/has_value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/has_value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/has_value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/value.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/value.rb', __FILE__)
describe "ENV.has_value?" do
it_behaves_like(:env_value, :has_value?)
Modified: MacRuby/trunk/spec/frozen/core/env/include_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/include_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/include_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/include.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/include.rb', __FILE__)
describe "ENV.include?" do
it_behaves_like(:env_include, :include?)
Modified: MacRuby/trunk/spec/frozen/core/env/index_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/index_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/index_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/key.rb', __FILE__)
+
+describe "ENV.index" do
+ it_behaves_like(:env_key, :index)
+end
\ No newline at end of file
Modified: MacRuby/trunk/spec/frozen/core/env/indexes_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/indexes_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/indexes_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/env/indices_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/indices_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/indices_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/env/inspect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/inspect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/inspect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ENV.inspect" do
Modified: MacRuby/trunk/spec/frozen/core/env/invert_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/invert_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/invert_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ENV.invert" do
Modified: MacRuby/trunk/spec/frozen/core/env/key_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/key_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/key_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,13 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/include.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/include.rb', __FILE__)
+require File.expand_path('../shared/key.rb', __FILE__)
describe "ENV.key?" do
it_behaves_like(:env_include, :key?)
end
+
+describe "ENV.key" do
+ ruby_version_is "1.9" do
+ it_behaves_like(:env_key, :key)
+ end
+end
\ No newline at end of file
Modified: MacRuby/trunk/spec/frozen/core/env/keys_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/keys_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/keys_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ENV.keys" do
Modified: MacRuby/trunk/spec/frozen/core/env/length_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/length_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/length_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/length.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/length.rb', __FILE__)
describe "ENV.length" do
it_behaves_like(:env_length, :length)
Modified: MacRuby/trunk/spec/frozen/core/env/member_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/member_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/member_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/include.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/include.rb', __FILE__)
describe "ENV.member?" do
it_behaves_like(:env_include, :member?)
Modified: MacRuby/trunk/spec/frozen/core/env/rehash_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/rehash_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/rehash_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/env/reject_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/reject_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/reject_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ENV.reject!" do
it "rejects entries based on key" do
@@ -28,7 +28,7 @@
ruby_version_is "1.8.7" do
it "returns an Enumerator if called without a block" do
- ENV.reject!.should be_kind_of(enumerator_class)
+ ENV.reject!.should be_an_instance_of(enumerator_class)
end
end
@@ -72,7 +72,7 @@
ruby_version_is "1.8.7" do
it "returns an Enumerator if called without a block" do
- ENV.reject.should be_kind_of(enumerator_class)
+ ENV.reject.should be_an_instance_of(enumerator_class)
end
end
Modified: MacRuby/trunk/spec/frozen/core/env/replace_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/replace_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/replace_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ENV.replace" do
Modified: MacRuby/trunk/spec/frozen/core/env/select_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/select_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/select_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ENV.select" do
@@ -26,7 +26,7 @@
ruby_version_is "1.8.7" do
it "returns an Enumerator when no block is given" do
- ENV.select.should be_kind_of(enumerator_class)
+ ENV.select.should be_an_instance_of(enumerator_class)
end
end
end
Modified: MacRuby/trunk/spec/frozen/core/env/shared/each.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/shared/each.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/shared/each.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -22,7 +22,7 @@
ruby_version_is "1.8.7" do
it "returns an Enumerator if called without a block" do
- ENV.send(@method).should be_kind_of(enumerator_class)
+ ENV.send(@method).should be_an_instance_of(enumerator_class)
end
end
Added: MacRuby/trunk/spec/frozen/core/env/shared/key.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/shared/key.rb (rev 0)
+++ MacRuby/trunk/spec/frozen/core/env/shared/key.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -0,0 +1,15 @@
+describe :env_key, :shared => true do
+ it "needs to be reviewed for completeness"
+
+ it "returns the index associated with the passed value" do
+ ENV["foo"] = "bar"
+ ENV.send(@method, "bar").should == "foo"
+ ENV.delete "foo"
+ end
+
+ it "returns nil if the passed value is not found" do
+ ENV.send(@method, "should_never_be_set").should be_nil
+ end
+end
+
+
Modified: MacRuby/trunk/spec/frozen/core/env/shift_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/shift_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/shift_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ENV.shift" do
Modified: MacRuby/trunk/spec/frozen/core/env/size_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/size_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/size_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/length.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/length.rb', __FILE__)
describe "ENV.size" do
it_behaves_like(:env_length, :size)
Modified: MacRuby/trunk/spec/frozen/core/env/store_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/store_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/store_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/store.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/store.rb', __FILE__)
describe "ENV.store" do
it_behaves_like(:env_store, :store)
Modified: MacRuby/trunk/spec/frozen/core/env/to_a_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/to_a_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/to_a_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ENV.to_a" do
Modified: MacRuby/trunk/spec/frozen/core/env/to_hash_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/to_hash_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/to_hash_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ENV.to_hash" do
Modified: MacRuby/trunk/spec/frozen/core/env/to_s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/to_s_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/to_s_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ENV.to_s" do
it "returns \"ENV\"" do
Modified: MacRuby/trunk/spec/frozen/core/env/update_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/update_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/update_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ENV.update" do
Modified: MacRuby/trunk/spec/frozen/core/env/value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/value.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/value.rb', __FILE__)
describe "ENV.value?" do
it_behaves_like(:env_value, :value?)
Modified: MacRuby/trunk/spec/frozen/core/env/values_at_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/values_at_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/values_at_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ENV.values_at" do
Modified: MacRuby/trunk/spec/frozen/core/env/values_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/env/values_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/env/values_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ENV.values" do
Modified: MacRuby/trunk/spec/frozen/core/exception/arguments_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/exception/arguments_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/exception/arguments_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ArgumentError" do
it "is a subclass of StandardError" do
Modified: MacRuby/trunk/spec/frozen/core/exception/backtrace_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/exception/backtrace_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/exception/backtrace_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
describe "Exception#backtrace" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/exception/case_compare_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/exception/case_compare_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/exception/case_compare_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/exception/equal_value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/exception/equal_value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/exception/equal_value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
ruby_version_is "1.9" do
describe "Exception#==" do
Modified: MacRuby/trunk/spec/frozen/core/exception/errno_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/exception/errno_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/exception/errno_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/exception/exception_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/exception/exception_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/exception/exception_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
-require File.dirname(__FILE__) + '/shared/new'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
+require File.expand_path('../shared/new', __FILE__)
describe "Exception.exception" do
it_behaves_like(:exception_new, :exception)
@@ -68,4 +68,18 @@
e2.message.should == :message
end
+ class CustomArgumentError < StandardError
+ attr_reader :val
+ def initialize(val)
+ @val = val
+ end
+ end
+
+ it "returns an exception of the same class as self with the message given as argument, but without reinitializing" do
+ e = CustomArgumentError.new(:boom)
+ e2 = e.exception(:message)
+ e2.should be_an_instance_of(CustomArgumentError)
+ e2.val.should == :boom
+ e2.message.should == :message
+ end
end
Modified: MacRuby/trunk/spec/frozen/core/exception/exit_value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/exception/exit_value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/exception/exit_value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/exception/initialize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/exception/initialize_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/exception/initialize_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/exception/inspect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/exception/inspect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/exception/inspect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Exception#inspect" do
it "returns '#<Exception: Exception>' when no message given" do
Modified: MacRuby/trunk/spec/frozen/core/exception/io_error_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/exception/io_error_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/exception/io_error_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "IOError" do
it "is a superclass of EOFError" do
Modified: MacRuby/trunk/spec/frozen/core/exception/message_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/exception/message_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/exception/message_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Exception#message" do
it "returns the exception message" do
Modified: MacRuby/trunk/spec/frozen/core/exception/name_error_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/exception/name_error_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/exception/name_error_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "NameError" do
it "is a superclass of NoMethodError" do
Modified: MacRuby/trunk/spec/frozen/core/exception/name_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/exception/name_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/exception/name_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/exception/new_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/exception/new_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/exception/new_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/new'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
+require File.expand_path('../shared/new', __FILE__)
describe "Exception.new" do
it_behaves_like(:exception_new, :new)
Modified: MacRuby/trunk/spec/frozen/core/exception/no_method_error_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/exception/no_method_error_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/exception/no_method_error_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/common'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/common', __FILE__)
describe "NoMethodError.new" do
it "allows passing method args" do
Modified: MacRuby/trunk/spec/frozen/core/exception/range_error_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/exception/range_error_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/exception/range_error_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "RangeError" do
it "is a superclass of FloatDomainError" do
Modified: MacRuby/trunk/spec/frozen/core/exception/script_error_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/exception/script_error_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/exception/script_error_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ScriptError" do
it "is a superclass of LoadError" do
Modified: MacRuby/trunk/spec/frozen/core/exception/set_backtrace_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/exception/set_backtrace_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/exception/set_backtrace_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Exception#set_backtrace" do
it "allows the user to set the backtrace to any array" do
Modified: MacRuby/trunk/spec/frozen/core/exception/shared/to_s.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/exception/shared/to_s.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/exception/shared/to_s.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../fixtures/common'
+require File.expand_path('../../fixtures/common', __FILE__)
describe :to_s, :shared => true do
Modified: MacRuby/trunk/spec/frozen/core/exception/standard_error_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/exception/standard_error_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/exception/standard_error_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "StandardError" do
it "is a superclass of ArgumentError" do
Modified: MacRuby/trunk/spec/frozen/core/exception/system_call_error_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/exception/system_call_error_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/exception/system_call_error_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "SystemCallError.new" do
it "requires at least one argumentt" do
Modified: MacRuby/trunk/spec/frozen/core/exception/to_s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/exception/to_s_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/exception/to_s_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/to_s'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/to_s', __FILE__)
describe "Exception#to_s" do
it_behaves_like :to_s, :to_s
Modified: MacRuby/trunk/spec/frozen/core/exception/to_str_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/exception/to_str_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/exception/to_str_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/to_s'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/to_s', __FILE__)
ruby_version_is ""..."1.9" do
describe "Exception#to_str" do
Modified: MacRuby/trunk/spec/frozen/core/false/and_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/false/and_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/false/and_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "FalseClass#&" do
it "returns false" do
Modified: MacRuby/trunk/spec/frozen/core/false/inspect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/false/inspect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/false/inspect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "FalseClass#inspect" do
it "returns the string 'false'" do
Modified: MacRuby/trunk/spec/frozen/core/false/or_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/false/or_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/false/or_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "FalseClass#|" do
it "return false if other is nil or false, otherwise true" do
Modified: MacRuby/trunk/spec/frozen/core/false/to_s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/false/to_s_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/false/to_s_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "FalseClass#to_s" do
it "returns the string 'false'" do
Modified: MacRuby/trunk/spec/frozen/core/false/xor_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/false/xor_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/false/xor_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "FalseClass#^" do
it "returns false if other is nil or false, otherwise true" do
Modified: MacRuby/trunk/spec/frozen/core/fiber/new_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fiber/new_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fiber/new_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,12 +1,12 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :fiber do
describe "Fiber.new" do
it "creates a fiber from the given block" do
fiber = Fiber.new {}
fiber.should be_an_instance_of(Fiber)
end
-
+
it "raises an ArgumentError if called without a block" do
lambda { Fiber.new }.should raise_error(ArgumentError)
end
@@ -16,14 +16,14 @@
fiber = Fiber.new { invoked = true }
invoked.should be_false
end
-
+
it "closes over lexical environments" do
o = Object.new
def o.f
a = 1
f = Fiber.new { a = 2 }
f.resume
- a
+ a
end
o.f.should == 2
end
@@ -40,9 +40,9 @@
end
f.resume.should == :begin
end
-
+
it "raises a SyntaxError when the block contains a retry statement" do
lambda { eval 'Fiber.new { retry; }' }.should raise_error(SyntaxError)
- end
+ end
end
end
Modified: MacRuby/trunk/spec/frozen/core/fiber/resume_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fiber/resume_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fiber/resume_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,23 +1,17 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/resume'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/fiber/resume', __FILE__)
-ruby_version_is "1.9" do
+with_feature :fiber do
describe "Fiber#resume" do
-
- it_behaves_like(:resume, :transfer)
-
+ it_behaves_like :fiber_resume, :resume
+ end
+
+ describe "Fiber#resume" do
it "returns control to the calling Fiber if called from one" do
fiber1 = Fiber.new { :fiber1 }
fiber2 = Fiber.new { fiber1.resume; :fiber2 }
fiber2.resume.should == :fiber2
end
-
- it "raises a FiberError if the Fiber has transfered control to another Fiber" do
- fiber1 = Fiber.new { true }
- fiber2 = Fiber.new { fiber1.transfer; Fiber.yield }
- fiber2.resume
- lambda { fiber2.resume }.should raise_error(FiberError)
- end
ruby_bug "redmine #595", "1.9" do
it "executes the ensure clause" do
Modified: MacRuby/trunk/spec/frozen/core/fiber/yield_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fiber/yield_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fiber/yield_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,8 +1,7 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :fiber do
describe "Fiber.yield" do
-
it "passes control to the Fiber's caller" do
step = 0
fiber = Fiber.new { step = 1; Fiber.yield; step = 2; Fiber.yield; step = 3 }
@@ -15,7 +14,7 @@
it "returns its arguments to the caller" do
fiber = Fiber.new { true; Fiber.yield :glark; true }
fiber.resume.should == :glark
- end
+ end
it "returns nil to the caller if given no arguments" do
fiber = Fiber.new { true; Fiber.yield; true }
@@ -27,9 +26,9 @@
fiber.resume
fiber.resume :caller
end
-
+
it "raises a FiberError if called from the root Fiber" do
lambda{ Fiber.yield }.should raise_error(FiberError)
- end
+ end
end
end
Modified: MacRuby/trunk/spec/frozen/core/file/absolute_path_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/absolute_path_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/absolute_path_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "File.absolute_path" do
Modified: MacRuby/trunk/spec/frozen/core/file/atime_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/atime_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/atime_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "File.atime" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/file/basename_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/basename_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/basename_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "File.basename" do
before :each do
@@ -70,8 +70,10 @@
File.basename("").should == ""
File.basename(".").should == "."
File.basename("..").should == ".."
- File.basename("//foo/").should == "foo"
- File.basename("//foo//").should == "foo"
+ platform_is_not :windows do
+ File.basename("//foo/").should == "foo"
+ File.basename("//foo//").should == "foo"
+ end
File.basename("foo/").should == "foo"
end
@@ -112,25 +114,23 @@
platform_is :windows do
it "return the basename for windows" do
File.basename("C:\\foo\\bar\\baz.txt").should == "baz.txt"
- File.basename("C:\\foo\\bar").should == "baz"
- File.basename("C:\\foo\\bar\\").should == "baz"
+ File.basename("C:\\foo\\bar").should == "bar"
+ File.basename("C:\\foo\\bar\\").should == "bar"
File.basename("C:\\foo").should == "foo"
- File.basename("C:\\").should == "C:\\"
+ File.basename("C:\\").should == "\\"
end
it "return basename windows unc" do
File.basename("\\\\foo\\bar\\baz.txt").should == "baz.txt"
File.basename("\\\\foo\\bar\\baz").should =="baz"
- File.basename("\\\\foo").should == "\\\\foo"
- File.basename("\\\\foo\\bar").should == "\\\\foo\\bar"
end
it "return basename windows forward slash" do
- File.basename("C:/").should == "C:/"
+ File.basename("C:/").should == "/"
File.basename("C:/foo").should == "foo"
File.basename("C:/foo/bar").should == "bar"
- File.basename("C:/foo/bar/").should "bar"
- File.basename("C:/foo/bar//").shouldl == "bar"
+ File.basename("C:/foo/bar/").should == "bar"
+ File.basename("C:/foo/bar//").should == "bar"
end
it "return basename with windows suffix" do
Modified: MacRuby/trunk/spec/frozen/core/file/blockdev_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/blockdev_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/blockdev_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/blockdev'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/blockdev', __FILE__)
describe "File.blockdev?" do
it_behaves_like :file_blockdev, :blockdev?, File
Modified: MacRuby/trunk/spec/frozen/core/file/chardev_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/chardev_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/chardev_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/chardev'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/chardev', __FILE__)
describe "File.chardev?" do
it_behaves_like :file_chardev, :chardev?, File
Modified: MacRuby/trunk/spec/frozen/core/file/chmod_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/chmod_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/chmod_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,8 +1,8 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "File#chmod" do
before :each do
- @filename = tmp('i_exist')
+ @filename = tmp('i_exist.exe')
@file = File.open(@filename, 'w')
end
@@ -97,7 +97,7 @@
describe "File.chmod" do
before :each do
- @file = tmp('i_exist')
+ @file = tmp('i_exist.exe')
touch @file
@count = File.chmod(0755, @file)
end
Modified: MacRuby/trunk/spec/frozen/core/file/chown_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/chown_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/chown_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
as_superuser do
describe "File.chown" do
Modified: MacRuby/trunk/spec/frozen/core/file/constants/constants_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/constants/constants_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/constants/constants_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,10 +1,10 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
["APPEND", "CREAT", "EXCL", "FNM_CASEFOLD",
"FNM_DOTMATCH", "FNM_NOESCAPE", "FNM_PATHNAME",
"FNM_SYSCASE", "LOCK_EX", "LOCK_NB", "LOCK_SH",
"LOCK_UN", "NONBLOCK", "RDONLY",
- "RDWR", "SYNC", "TRUNC", "WRONLY"].each do |const|
+ "RDWR", "TRUNC", "WRONLY"].each do |const|
describe "File::Constants::#{const}" do
it "is defined" do
File::Constants.const_defined?(const).should be_true
@@ -21,9 +21,11 @@
end
platform_is_not :windows do
- describe "File::Constants::NOCTTY" do
- it "is defined" do
- File::Constants.const_defined?(:NOCTTY).should be_true
+ ["NOCTTY", "SYNC"].each do |const|
+ describe "File::Constants::#{const}" do
+ it "is defined" do
+ File::Constants.const_defined?(const).should be_true
+ end
end
end
end
Modified: MacRuby/trunk/spec/frozen/core/file/constants_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/constants_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/constants_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
# TODO: migrate these to constants/constants_spec.rb
Modified: MacRuby/trunk/spec/frozen/core/file/ctime_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/ctime_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/ctime_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "File.ctime" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/file/delete_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/delete_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/delete_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/unlink'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/unlink', __FILE__)
describe "File.delete" do
it_behaves_like(:file_unlink, :delete)
Modified: MacRuby/trunk/spec/frozen/core/file/directory_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/directory_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/directory_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/directory'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/directory', __FILE__)
describe "File.directory?" do
it_behaves_like :file_directory, :directory?, File
Modified: MacRuby/trunk/spec/frozen/core/file/dirname_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/dirname_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/dirname_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "File.dirname" do
it "returns all the components of filename except the last one" do
@@ -21,6 +21,10 @@
x.should == "/usr/bin"
end
+ it "ignores a trailing /" do
+ File.dirname("/foo/bar/").should == "/foo"
+ end
+
it "returns the return all the components of filename except the last one (unix format)" do
File.dirname("foo").should =="."
File.dirname("/foo").should =="/"
Modified: MacRuby/trunk/spec/frozen/core/file/executable_real_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/executable_real_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/executable_real_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/executable_real'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/executable_real', __FILE__)
describe "File.executable_real?" do
it_behaves_like :file_executable_real, :executable_real?, File
Modified: MacRuby/trunk/spec/frozen/core/file/executable_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/executable_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/executable_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/executable'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/executable', __FILE__)
describe "File.executable?" do
it_behaves_like :file_executable, :executable?, File
Modified: MacRuby/trunk/spec/frozen/core/file/exist_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/exist_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/exist_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/exist'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/exist', __FILE__)
describe "File.exist?" do
it_behaves_like(:file_exist, :exist?, File)
Modified: MacRuby/trunk/spec/frozen/core/file/exists_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/exists_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/exists_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/exist'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/exist', __FILE__)
describe "File.exists?" do
it_behaves_like(:file_exist, :exists?, File)
Modified: MacRuby/trunk/spec/frozen/core/file/expand_path_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/expand_path_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/expand_path_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "File.expand_path" do
before :each do
@@ -41,11 +41,20 @@
# FIXME: do not use conditionals like this around #it blocks
unless not home = ENV['HOME']
- it "converts a pathname to an absolute pathname, using ~ (home) as base" do
- File.expand_path('~').should == home
- File.expand_path('~', '/tmp/gumby/ddd').should == home
- File.expand_path('~/a', '/tmp/gumby/ddd').should == File.join(home, 'a')
+ platform_is_not :windows do
+ it "converts a pathname to an absolute pathname, using ~ (home) as base" do
+ File.expand_path('~').should == home
+ File.expand_path('~', '/tmp/gumby/ddd').should == home
+ File.expand_path('~/a', '/tmp/gumby/ddd').should == File.join(home, 'a')
+ end
end
+ platform_is :windows do
+ it "converts a pathname to an absolute pathname, using ~ (home) as base" do
+ File.expand_path('~').should == home.tr("\\", '/')
+ File.expand_path('~', '/tmp/gumby/ddd').should == home.tr("\\", '/')
+ File.expand_path('~/a', '/tmp/gumby/ddd').should == File.join(home.tr("\\", '/'), 'a')
+ end
+ end
end
platform_is_not :windows do
@@ -54,7 +63,8 @@
File.expand_path("../../bin", "/tmp/x").should == "/bin"
File.expand_path("../../bin", "/tmp").should == "/bin"
File.expand_path("../../bin", "/").should == "/bin"
- File.expand_path("../../bin", "tmp/x").should == File.join(@base, 'bin')
+ File.expand_path("../bin", "tmp/x").should == File.join(@base, 'tmp', 'bin')
+ File.expand_path("../bin", "x/../tmp").should == File.join(@base, 'bin')
end
it "expand_path for commoms unix path give a full path" do
@@ -108,16 +118,23 @@
lambda { File.expand_path(true) }.should raise_error(TypeError)
end
- it "expands /./dir to /dir" do
- File.expand_path("/./dir").should == "/dir"
+ platform_is_not :windows do
+ it "expands /./dir to /dir" do
+ File.expand_path("/./dir").should == "/dir"
+ end
end
+ platform_is :windows do
+ it "expands C:/./dir to C:/dir" do
+ File.expand_path("C:/./dir").should == "C:/dir"
+ end
+ end
+
ruby_version_is "1.9" do
it "produces a String in the default external encoding" do
old_external = Encoding.default_external
Encoding.default_external = Encoding::SHIFT_JIS
File.expand_path("./a").encoding.should == Encoding::SHIFT_JIS
- File.expand_path("./\u{9876}").encoding.should == Encoding::SHIFT_JIS
Encoding.default_external = old_external
end
end
Modified: MacRuby/trunk/spec/frozen/core/file/extname_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/extname_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/extname_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "File.extname" do
it "returns the extension (the portion of file name in path after the period)." do
Modified: MacRuby/trunk/spec/frozen/core/file/file_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/file_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/file_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/file'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/file', __FILE__)
describe "File" do
it "includes File::Constants" do
Modified: MacRuby/trunk/spec/frozen/core/file/flock_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/flock_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/flock_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "File#flock" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/file/fnmatch_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/fnmatch_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/fnmatch_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/fnmatch'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/fnmatch', __FILE__)
describe "File.fnmatch" do
it_behaves_like(:file_fnmatch, :fnmatch)
Modified: MacRuby/trunk/spec/frozen/core/file/grpowned_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/grpowned_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/grpowned_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/grpowned'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/grpowned', __FILE__)
describe "File.grpowned?" do
it_behaves_like :file_grpowned, :grpowned?, File
Modified: MacRuby/trunk/spec/frozen/core/file/identical_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/identical_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/identical_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/identical'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/identical', __FILE__)
describe "File.identical?" do
it_behaves_like :file_identical, :identical?, File
Modified: MacRuby/trunk/spec/frozen/core/file/initialize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/initialize_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/initialize_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "File#initialize" do
it "needs to be reviewed for spec completeness"
Modified: MacRuby/trunk/spec/frozen/core/file/inspect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/inspect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/inspect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../io/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../io/fixtures/classes', __FILE__)
describe "File#inspect" do
it "returns string that contains 'closed' when invoked on closed file" do
Modified: MacRuby/trunk/spec/frozen/core/file/join_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/join_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/join_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "File.join" do
it "returns an empty string when given no arguments" do
@@ -102,6 +102,14 @@
File.join("usr", bin).should == "usr/bin"
end
+ it "doesn't mutate the object when calling #to_str" do
+ usr = mock("usr")
+ str = "usr"
+ usr.should_receive(:to_str).and_return(str)
+ File.join(usr, "bin").should == "usr/bin"
+ str.should == "usr"
+ end
+
ruby_version_is "1.9" do
it "calls #to_path" do
lambda { File.join(mock('x')) }.should raise_error(TypeError)
Modified: MacRuby/trunk/spec/frozen/core/file/lchmod_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/lchmod_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/lchmod_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "File.lchmod" do
platform_is_not :os => [:linux, :windows, :openbsd] do
Modified: MacRuby/trunk/spec/frozen/core/file/lchown_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/lchown_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/lchown_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
as_superuser do
describe "File.lchown" do
Modified: MacRuby/trunk/spec/frozen/core/file/link_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/link_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/link_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "File.link" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/file/lstat_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/lstat_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/lstat_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/stat'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/stat', __FILE__)
describe "File.lstat" do
it_behaves_like :file_stat, :lstat
@@ -17,11 +17,13 @@
after :each do
rm_r @link, @file
end
-
- it "returns a File::Stat object with symlink properties for a symlink" do
- st = File.lstat(@link)
- st.symlink?.should == true
- st.file?.should == false
+ platform_is_not :windows do
+ it "returns a File::Stat object with symlink properties for a symlink" do
+ st = File.lstat(@link)
+
+ st.symlink?.should == true
+ st.file?.should == false
+ end
end
end
Modified: MacRuby/trunk/spec/frozen/core/file/mtime_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/mtime_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/mtime_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "File.mtime" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/file/new_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/new_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/new_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/open'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/open', __FILE__)
describe "File.new" do
before :each do
@@ -31,7 +31,9 @@
File.umask(0011)
@fh = File.new(@file, @flags, 0755)
@fh.should be_kind_of(File)
- File.stat(@file).mode.to_s(8).should == "100744"
+ platform_is_not :windows do
+ File.stat(@file).mode.to_s(8).should == "100744"
+ end
File.exists?(@file).should == true
end
@@ -95,19 +97,21 @@
File.exists?(@file).should == true
end
- ruby_bug "#1582", "1.9.2" do
- it "raises an Errno::EINVAL error with File::APPEND" do
- lambda { @fh = File.new(@file, File::APPEND) }.should raise_error(Errno::EINVAL)
+ ruby_bug "[ruby-dev:40397]", "1.8.8" do
+ it "returns a new File when use File::APPEND mode" do
+ @fh = File.new(@file, File::APPEND)
+ @fh.should be_kind_of(File)
+ File.exists?(@file).should == true
end
- end
- ruby_bug "#1582", "1.9.2" do
- it "raises an Errno::EINVAL error with File::RDONLY|File::APPEND" do
- lambda { @fh = File.new(@file, File::RDONLY|File::APPEND) }.should raise_error(Errno::EINVAL)
+ it "returns a new File when use File::RDONLY|File::APPEND mode" do
+ @fh = File.new(@file, File::RDONLY|File::APPEND)
+ @fh.should be_kind_of(File)
+ File.exists?(@file).should == true
end
end
- it "raises an Errno::EINVAL error with File::RDONLY|File::WRONLY" do
+ it "returns a new File when use File::RDONLY|File::WRONLY mode" do
@fh = File.new(@file, File::RDONLY|File::WRONLY)
@fh.should be_kind_of(File)
File.exists?(@file).should == true
@@ -149,13 +153,9 @@
lambda { File.new(-1) }.should raise_error(Errno::EBADF)
end
- ruby_bug "#1582", "1.9.2" do
- # You can't alter mode or permissions when opening a file descriptor
- #
- it "can't alter mode or permissions when opening a file" do
- @fh = File.new(@file)
- lambda { File.new(@fh.fileno, @flags) }.should raise_error(Errno::EINVAL)
- end
+ it "can't alter mode or permissions when opening a file" do
+ @fh = File.new(@file)
+ lambda { File.new(@fh.fileno, @flags) }.should raise_error(Errno::EINVAL)
end
it_behaves_like :open_directory, :new
Modified: MacRuby/trunk/spec/frozen/core/file/open_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/open_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/open_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/open'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/open', __FILE__)
describe "File.open" do
before :all do
@@ -108,7 +108,9 @@
File.umask(0011)
@fh = File.open(@file, @flags, 0755)
@fh.should be_kind_of(File)
- @fh.lstat.mode.to_s(8).should == "100744"
+ platform_is_not :windows do
+ @fh.lstat.mode.to_s(8).should == "100744"
+ end
File.exist?(@file).should == true
end
@@ -118,7 +120,9 @@
File.umask(0022)
File.open(@file, "w", 0755){ |fh| @fd = fh.fileno }
lambda { File.open(@fd) }.should raise_error(SystemCallError)
- File.stat(@file).mode.to_s(8).should == "100755"
+ platform_is_not :windows do
+ File.stat(@file).mode.to_s(8).should == "100755"
+ end
File.exist?(@file).should == true
end
@@ -147,11 +151,13 @@
File.read(@file).should == "test\n"
end
- it "creates a new write-only file when invoked with 'w' and '0222'" do
- File.delete(@file) if File.exists?(@file)
- File.open(@file, 'w', 0222) {}
- File.readable?(@file).should == false
- File.writable?(@file).should == true
+ 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)
+ File.open(@file, 'w', 0222) {}
+ File.readable?(@file).should == false
+ File.writable?(@file).should == true
+ end
end
it "opens the file when call with fd" do
@@ -479,10 +485,12 @@
end
end
- it "raises an Errno::EACCES when opening non-permitted file" do
- @fh = File.open(@file, "w")
- @fh.chmod(000)
- lambda { fh1 = File.open(@file); fh1.close }.should raise_error(Errno::EACCES)
+ platform_is_not :windows do
+ it "raises an Errno::EACCES when opening non-permitted file" do
+ @fh = File.open(@file, "w")
+ @fh.chmod(000)
+ lambda { fh1 = File.open(@file); fh1.close }.should raise_error(Errno::EACCES)
+ end
end
it "raises an Errno::EACCES when opening read-only file" do
Modified: MacRuby/trunk/spec/frozen/core/file/owned_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/owned_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/owned_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/owned'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/owned', __FILE__)
describe "File.owned?" do
it_behaves_like :file_owned, :owned?, File
Modified: MacRuby/trunk/spec/frozen/core/file/path_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/path_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/path_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "File#path" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/file/pipe_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/pipe_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/pipe_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/pipe'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/pipe', __FILE__)
describe "File.pipe?" do
it_behaves_like :file_pipe, :pipe?, File
Modified: MacRuby/trunk/spec/frozen/core/file/readable_real_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/readable_real_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/readable_real_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/readable_real'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/readable_real', __FILE__)
describe "File.readable_real?" do
it_behaves_like :file_readable_real, :readable_real?, File
Modified: MacRuby/trunk/spec/frozen/core/file/readable_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/readable_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/readable_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/readable'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/readable', __FILE__)
describe "File.readable?" do
it_behaves_like :file_readable, :readable?, File
Modified: MacRuby/trunk/spec/frozen/core/file/readlink_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/readlink_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/readlink_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "File.readlink" do
@@ -16,12 +16,15 @@
rm_r @link, @file
end
- it "return the name of the file referenced by the given link" do
- File.readlink(@link).should == @file
- end
+ # symlink/readlink are not supported on Windows
+ platform_is_not :windows do
+ it "return the name of the file referenced by the given link" do
+ File.readlink(@link).should == @file
+ end
- it "raises an Errno::ENOENT if called with an invalid argument" do
- # TODO: missing_file
- lambda { File.readlink("/this/surely/doesnt/exist") }.should raise_error(Errno::ENOENT)
+ it "raises an Errno::ENOENT if called with an invalid argument" do
+ # TODO: missing_file
+ lambda { File.readlink("/this/surely/doesnt/exist") }.should raise_error(Errno::ENOENT)
+ end
end
end
Modified: MacRuby/trunk/spec/frozen/core/file/rename_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/rename_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/rename_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "File.rename" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/file/reopen_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/reopen_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/reopen_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "File#reopen" do
Modified: MacRuby/trunk/spec/frozen/core/file/setgid_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/setgid_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/setgid_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/setgid'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/setgid', __FILE__)
describe "File.setgid?" do
it_behaves_like :file_setgid, :setgid?, File
Modified: MacRuby/trunk/spec/frozen/core/file/setuid_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/setuid_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/setuid_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/setuid'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/setuid', __FILE__)
describe "File.setuid?" do
it_behaves_like :file_setuid, :setuid?, File
Modified: MacRuby/trunk/spec/frozen/core/file/shared/fnmatch.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/shared/fnmatch.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/shared/fnmatch.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -60,7 +60,7 @@
platform_is :windows do
it "matches case sensitive characters on platfroms with case insensitive paths, when flags include FNM_SYSCASE" do
- File.send(@method, 'cat', 'CAT', Filee::FNM_SYSCASE).should == true
+ File.send(@method, 'cat', 'CAT', File::FNM_SYSCASE).should == true
end
end
Modified: MacRuby/trunk/spec/frozen/core/file/shared/open.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/shared/open.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/shared/open.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../dir/fixtures/common'
+require File.expand_path('../../../dir/fixtures/common', __FILE__)
describe :open_directory, :shared => true do
it "opens directories" do
Modified: MacRuby/trunk/spec/frozen/core/file/size_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/size_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/size_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/size'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/size', __FILE__)
describe "File.size?" do
it_behaves_like :file_size, :size?, File
@@ -22,9 +22,11 @@
@name = tmp('i_exist')
touch(@name) { |f| f.write 'rubinius' }
@file = File.new @name
+ @file_org = @file
end
after :each do
+ @file_org.close unless @file_org.closed?
rm_r @name
end
@@ -54,6 +56,7 @@
@file = File.open(@file.path, 'w')
@file.truncate(0)
@file.size.should == 0
+ @file.close
end
platform_is_not :windows do
@@ -61,8 +64,14 @@
ln_file = tmp('i_exist_ln')
rm_r ln_file
- File.symlink(@file.path, ln_file).should == 0
- File.new(ln_file).size.should == 8
+ begin
+ File.symlink(@file.path, ln_file).should == 0
+ file = File.new(ln_file)
+ file.size.should == 8
+ ensure
+ file.close if file && !file.closed?
+ File.unlink(ln_file) if File.exists?(ln_file)
+ end
end
end
end
Modified: MacRuby/trunk/spec/frozen/core/file/socket_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/socket_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/socket_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/socket'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/socket', __FILE__)
describe "File.socket?" do
it_behaves_like :file_socket, :socket?, File
Modified: MacRuby/trunk/spec/frozen/core/file/split_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/split_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/split_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "File.split" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/file/stat/atime_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/atime_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/atime_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe "File::Stat#atime" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/file/stat/blksize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/blksize_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/blksize_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe "File::Stat#blksize" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/file/stat/blockdev_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/blockdev_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/blockdev_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../../../shared/file/blockdev'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../../../shared/file/blockdev', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "File::Stat#blockdev?" do
it_behaves_like :file_blockdev, :blockdev?, FileStat
Modified: MacRuby/trunk/spec/frozen/core/file/stat/blocks_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/blocks_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/blocks_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe "File::Stat#blocks" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/file/stat/chardev_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/chardev_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/chardev_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../../../shared/file/chardev'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../../../shared/file/chardev', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "File::Stat#chardev?" do
it_behaves_like :file_chardev, :chardev?, FileStat
Modified: MacRuby/trunk/spec/frozen/core/file/stat/comparison_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/comparison_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/comparison_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe "File::Stat#<=>" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/file/stat/ctime_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/ctime_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/ctime_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe "File::Stat#ctime" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/file/stat/dev_major_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/dev_major_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/dev_major_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,15 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe "File::Stat#dev_major" do
+ before :each do
+ @name = tmp("file.txt")
+ touch(@name)
+ end
+ after :each do
+ rm_r @name
+ end
+
it "returns the major part of File::Stat#dev" do
- File.stat('/dev/null').dev_major.should be_kind_of(Integer)
+ File.stat(@name).dev_major.should be_kind_of(Integer)
end
end
Modified: MacRuby/trunk/spec/frozen/core/file/stat/dev_minor_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/dev_minor_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/dev_minor_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,15 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe "File::Stat#dev_minor" do
+ before :each do
+ @name = tmp("file.txt")
+ touch(@name)
+ end
+ after :each do
+ rm_r @name
+ end
+
it "returns the minor part of File::Stat#dev" do
- File.stat('/dev/null').dev_minor.should be_kind_of(Integer)
+ File.stat(@name).dev_minor.should be_kind_of(Integer)
end
end
Modified: MacRuby/trunk/spec/frozen/core/file/stat/dev_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/dev_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/dev_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,15 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe 'File::Stat#dev' do
+ before :each do
+ @name = tmp("file.txt")
+ touch(@name)
+ end
+ after :each do
+ rm_r @name
+ end
+
it "returns the number of the device on which the file exists" do
- File.stat('/dev/null').dev.should be_kind_of(Integer)
+ File.stat(@name).dev.should be_kind_of(Integer)
end
end
Modified: MacRuby/trunk/spec/frozen/core/file/stat/directory_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/directory_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/directory_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../../../shared/file/directory'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../../../shared/file/directory', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "File::Stat#directory?" do
it_behaves_like :file_directory, :directory?, FileStat
Modified: MacRuby/trunk/spec/frozen/core/file/stat/executable_real_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/executable_real_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/executable_real_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../../../shared/file/executable_real'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../../../shared/file/executable_real', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "File::Stat#executable_real?" do
it_behaves_like :file_executable_real, :executable_real?, FileStat
Modified: MacRuby/trunk/spec/frozen/core/file/stat/executable_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/executable_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/executable_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../../../shared/file/executable'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../../../shared/file/executable', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "File::Stat#executable?" do
it_behaves_like :file_executable, :executable?, FileStat
Modified: MacRuby/trunk/spec/frozen/core/file/stat/file_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/file_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/file_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../../../shared/file/file'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../../../shared/file/file', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "File::Stat#file?" do
it_behaves_like :file_file, :file?, FileStat
Modified: MacRuby/trunk/spec/frozen/core/file/stat/gid_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/gid_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/gid_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe "File::Stat#gid" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/file/stat/grpowned_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/grpowned_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/grpowned_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../../../shared/file/grpowned'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../../../shared/file/grpowned', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "File::Stat#grpowned?" do
it_behaves_like :file_grpowned, :grpowned?, FileStat
Modified: MacRuby/trunk/spec/frozen/core/file/stat/ino_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/ino_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/ino_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe "File::Stat#ino" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/file/stat/inspect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/inspect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/inspect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe "File::Stat#inspect" do
Modified: MacRuby/trunk/spec/frozen/core/file/stat/mode_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/mode_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/mode_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe "File::Stat#mode" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/file/stat/mtime_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/mtime_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/mtime_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe "File::Stat#mtime" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/file/stat/new_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/new_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/new_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe "File::Stat#initialize" do
Modified: MacRuby/trunk/spec/frozen/core/file/stat/nlink_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/nlink_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/nlink_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe "File::Stat#nlink" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/file/stat/owned_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/owned_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/owned_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../../../shared/file/owned'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../../../shared/file/owned', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "File::Stat#owned?" do
it_behaves_like :file_owned, :owned?, FileStat
Modified: MacRuby/trunk/spec/frozen/core/file/stat/pipe_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/pipe_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/pipe_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../../../shared/file/pipe'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../../../shared/file/pipe', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "File::Stat#pipe?" do
it_behaves_like :file_pipe, :pipe?, FileStat
Modified: MacRuby/trunk/spec/frozen/core/file/stat/rdev_major_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/rdev_major_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/rdev_major_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,15 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe "File::Stat#rdev_major" do
+ before :each do
+ @name = tmp("file.txt")
+ touch(@name)
+ end
+ after :each do
+ rm_r @name
+ end
+
it "returns the major part of File::Stat#rdev" do
- File.stat('/dev/null').rdev_major.should be_kind_of(Integer)
+ File.stat(@name).rdev_major.should be_kind_of(Integer)
end
end
Modified: MacRuby/trunk/spec/frozen/core/file/stat/rdev_minor_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/rdev_minor_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/rdev_minor_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,15 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe "File::Stat#rdev_minor" do
+ before :each do
+ @name = tmp("file.txt")
+ touch(@name)
+ end
+ after :each do
+ rm_r @name
+ end
+
it "returns the minor part of File::Stat#rdev" do
- File.stat('/dev/null').rdev_minor.should be_kind_of(Integer)
+ File.stat(@name).rdev_minor.should be_kind_of(Integer)
end
end
Modified: MacRuby/trunk/spec/frozen/core/file/stat/rdev_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/rdev_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/rdev_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,15 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe 'File::Stat#rdev' do
+ before :each do
+ @name = tmp("file.txt")
+ touch(@name)
+ end
+ after :each do
+ rm_r @name
+ end
+
it "returns the number of the device this file represents which the file exists" do
- File.stat('/dev/null').rdev.should be_kind_of(Integer)
+ File.stat(@name).rdev.should be_kind_of(Integer)
end
end
Modified: MacRuby/trunk/spec/frozen/core/file/stat/readable_real_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/readable_real_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/readable_real_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../../../shared/file/readable_real'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../../../shared/file/readable_real', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "File::Stat#readable_real?" do
it_behaves_like :file_readable_real, :readable_real?, FileStat
Modified: MacRuby/trunk/spec/frozen/core/file/stat/readable_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/readable_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/readable_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../../../shared/file/readable'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../../../shared/file/readable', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "File::Stat#readable?" do
it_behaves_like :file_readable, :readable?, FileStat
Modified: MacRuby/trunk/spec/frozen/core/file/stat/setgid_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/setgid_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/setgid_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../../../shared/file/setgid'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../../../shared/file/setgid', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "File::Stat#setgid?" do
it_behaves_like :file_setgid, :setgid?, FileStat
Modified: MacRuby/trunk/spec/frozen/core/file/stat/setuid_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/setuid_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/setuid_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../../../shared/file/setuid'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../../../shared/file/setuid', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "File::Stat#setuid?" do
it_behaves_like :file_setuid, :setuid?, FileStat
Modified: MacRuby/trunk/spec/frozen/core/file/stat/size_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/size_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/size_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../../../shared/file/size'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../../../shared/file/size', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "File::Stat.size?" do
it_behaves_like :file_size, :size?, FileStat
Modified: MacRuby/trunk/spec/frozen/core/file/stat/socket_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/socket_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/socket_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../../../shared/file/socket'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../../../shared/file/socket', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "File::Stat#socket?" do
it_behaves_like :file_socket, :socket?, FileStat
Modified: MacRuby/trunk/spec/frozen/core/file/stat/sticky_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/sticky_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/sticky_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../../../shared/file/sticky'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../../../shared/file/sticky', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "File::Stat#sticky?" do
it_behaves_like :file_sticky, :sticky?, FileStat
Modified: MacRuby/trunk/spec/frozen/core/file/stat/symlink_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/symlink_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/symlink_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../../../shared/file/symlink'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../../../shared/file/symlink', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "File::Stat#symlink?" do
it_behaves_like :file_symlink, :symlink?, FileStat
Modified: MacRuby/trunk/spec/frozen/core/file/stat/uid_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/uid_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/uid_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe "File::Stat#uid" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/file/stat/world_readable_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/world_readable_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/world_readable_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../../../shared/file/world_readable'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../../../shared/file/world_readable', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
ruby_version_is "1.9" do
describe "File::Stat.world_readable?" do
Modified: MacRuby/trunk/spec/frozen/core/file/stat/world_writable_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/world_writable_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/world_writable_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../../../shared/file/world_writable'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../../../shared/file/world_writable', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
ruby_version_is "1.9" do
describe "File::Stat.world_writable?" do
Modified: MacRuby/trunk/spec/frozen/core/file/stat/writable_real_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/writable_real_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/writable_real_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../../../shared/file/writable_real'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../../../shared/file/writable_real', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "File::Stat#writable_real?" do
it_behaves_like :file_writable_real, :writable_real?, FileStat
Modified: MacRuby/trunk/spec/frozen/core/file/stat/writable_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/writable_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/writable_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../../../shared/file/writable'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../../../shared/file/writable', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "File::Stat#writable?" do
it_behaves_like :file_writable, :writable?, FileStat
Modified: MacRuby/trunk/spec/frozen/core/file/stat/zero_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat/zero_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat/zero_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../../../shared/file/zero'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../../../shared/file/zero', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "File::Stat#zero?" do
it_behaves_like :file_zero, :zero?, FileStat
Modified: MacRuby/trunk/spec/frozen/core/file/stat_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/stat_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/stat_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/stat'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/stat', __FILE__)
describe "File.stat" do
it_behaves_like :file_stat, :stat
Modified: MacRuby/trunk/spec/frozen/core/file/sticky_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/sticky_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/sticky_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/sticky'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/sticky', __FILE__)
describe "File.sticky?" do
it_behaves_like :file_sticky, :sticky?, File
Modified: MacRuby/trunk/spec/frozen/core/file/symlink_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/symlink_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/symlink_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/symlink'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/symlink', __FILE__)
describe "File.symlink" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/file/to_path_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/to_path_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/to_path_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,33 +1,48 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "File#to_path" do
+ before :each do
+ @name = "file_to_path"
+ @path = encode tmp(@name), "euc-jp"
+ touch @path
+ end
+ after :each do
+ @file.close if @file and !@file.closed?
+ rm_r @path
+ end
+
it "returns a String" do
- File.new(__FILE__).to_path.should be_an_instance_of(String)
+ @file = File.new @path
+ @file.to_path.should be_an_instance_of(String)
end
it "does not normalise the path it returns" do
- Dir.chdir(File.dirname(__FILE__)) do
- unorm ='./' + File.basename(__FILE__)
- File.new(unorm).to_path.should == unorm
+ Dir.chdir(tmp("")) do
+ unorm = "./#{@name}"
+ @file = File.new unorm
+ @file.to_path.should == unorm
end
end
- it "does not expand the path it returns" do
- File.new('../').to_path.should == '../'
+ it "does not canonicalize the path it returns" do
+ dir = File.basename tmp("")
+ path = "#{tmp("")}../#{dir}/#{@name}"
+ @file = File.new path
+ @file.to_path.should == path
end
it "does not absolute-ise the path it returns" do
- Dir.chdir(File.dirname(__FILE__)) do
- rel_path = File.basename(__FILE__)
- File.new(rel_path).to_path.should == rel_path
+ Dir.chdir(tmp("")) do
+ @file = File.new @name
+ @file.to_path.should == @name
end
end
- it "does not preserve the encoding of the path" do
- path = File.new(__FILE__.encode('euc-jp')).to_path
- path.encoding.should == Encoding.find(:filesystem)
+ it "preserves the encoding of the path" do
+ @file = File.new @path
+ @file.to_path.encoding.should == Encoding.find("euc-jp")
end
end
end
Modified: MacRuby/trunk/spec/frozen/core/file/truncate_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/truncate_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/truncate_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "File.truncate" do
before :each do
@@ -151,8 +151,9 @@
end
it "raises an IOError if file is not opened for writing" do
- file = File.new(@name, 'r')
- lambda { file.truncate(42) }.should raise_error(IOError)
+ File.open(@name, 'r') do |file|
+ lambda { file.truncate(42) }.should raise_error(IOError)
+ end
end
it "raises a TypeError if not passed an Integer type for the for the argument" do
Modified: MacRuby/trunk/spec/frozen/core/file/umask_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/umask_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/umask_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "File.umask" do
before :each do
@@ -16,16 +16,18 @@
File.umask.should be_kind_of(Fixnum)
end
- it "umask should return the current umask value for the process" do
- File.umask(022)
- File.umask(006).should == 022
- File.umask.should == 006
- end
+ platform_is_not :windows do
+ it "returns the current umask value for the process" do
+ File.umask(022)
+ File.umask(006).should == 022
+ File.umask.should == 006
+ end
- it "invokes to_int on non-integer argument" do
- (obj = mock(022)).should_receive(:to_int).any_number_of_times.and_return(022)
- File.umask(obj)
- File.umask(obj).should == 022
+ it "invokes to_int on non-integer argument" do
+ (obj = mock(022)).should_receive(:to_int).any_number_of_times.and_return(022)
+ File.umask(obj)
+ File.umask(obj).should == 022
+ end
end
it "always succeeds with any integer values" do
@@ -41,18 +43,16 @@
end
platform_is :windows do
- it "Returns the current umask value for this process. (basic)" do
+ it "returns the current umask value for this process (basic)" do
File.umask.should == 0
+ File.umask(022).should == 0
+ File.umask(044).should == 0
end
# The value used here is the value of _S_IWRITE.
- it "Returns the current umask value for this process." do
+ it "returns the current umask value for this process" do
File.umask(0000200)
File.umask.should == 0000200
- end
-
- # FIXME: wtf?
- it "raises an exception if the arguments are wrong type or are the incorect number of arguments " do
File.umask(0006)
File.umask.should == 0
end
Modified: MacRuby/trunk/spec/frozen/core/file/unlink_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/unlink_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/unlink_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/unlink'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/unlink', __FILE__)
describe "File.unlink" do
it_behaves_like(:file_unlink, :unlink)
Modified: MacRuby/trunk/spec/frozen/core/file/utime_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/utime_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/utime_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "File.utime" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/file/world_readable_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/world_readable_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/world_readable_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/world_readable'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/world_readable', __FILE__)
ruby_version_is "1.9" do
describe "File.world_readable?" do
Modified: MacRuby/trunk/spec/frozen/core/file/world_writable_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/world_writable_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/world_writable_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/world_writable'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/world_writable', __FILE__)
ruby_version_is "1.9" do
describe "File.world_writable?" do
Modified: MacRuby/trunk/spec/frozen/core/file/writable_real_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/writable_real_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/writable_real_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/writable_real'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/writable_real', __FILE__)
describe "File.writable_real?" do
it_behaves_like :file_writable_real, :writable_real?, File
Modified: MacRuby/trunk/spec/frozen/core/file/writable_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/writable_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/writable_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/writable'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/writable', __FILE__)
describe "File.writable?" do
it_behaves_like :file_writable, :writable?, File
Modified: MacRuby/trunk/spec/frozen/core/file/zero_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/file/zero_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/file/zero_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/zero'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/zero', __FILE__)
describe "File.zero?" do
it_behaves_like :file_zero, :zero?, File
Modified: MacRuby/trunk/spec/frozen/core/filetest/blockdev_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/filetest/blockdev_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/filetest/blockdev_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/blockdev'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/blockdev', __FILE__)
describe "FileTest.blockdev?" do
it_behaves_like :file_blockdev, :blockdev?, FileTest
Modified: MacRuby/trunk/spec/frozen/core/filetest/chardev_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/filetest/chardev_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/filetest/chardev_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/chardev'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/chardev', __FILE__)
describe "FileTest.chardev?" do
it_behaves_like :file_chardev, :chardev?, FileTest
Modified: MacRuby/trunk/spec/frozen/core/filetest/directory_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/filetest/directory_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/filetest/directory_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/directory'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/directory', __FILE__)
describe "FileTest.directory?" do
it_behaves_like :file_directory, :directory?, FileTest
Modified: MacRuby/trunk/spec/frozen/core/filetest/executable_real_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/filetest/executable_real_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/filetest/executable_real_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/executable_real'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/executable_real', __FILE__)
describe "FileTest.executable_real?" do
it_behaves_like :file_executable_real, :executable_real?, FileTest
Modified: MacRuby/trunk/spec/frozen/core/filetest/executable_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/filetest/executable_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/filetest/executable_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/executable'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/executable', __FILE__)
describe "FileTest.executable?" do
it_behaves_like :file_executable, :executable?, FileTest
Modified: MacRuby/trunk/spec/frozen/core/filetest/exist_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/filetest/exist_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/filetest/exist_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/exist'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/exist', __FILE__)
describe "FileTest.exist?" do
it_behaves_like :file_exist, :exist?, FileTest
Modified: MacRuby/trunk/spec/frozen/core/filetest/exists_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/filetest/exists_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/filetest/exists_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/exist'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/exist', __FILE__)
describe "FileTest.exists?" do
it_behaves_like :file_exist, :exists?, FileTest
Modified: MacRuby/trunk/spec/frozen/core/filetest/file_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/filetest/file_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/filetest/file_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/file'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/file', __FILE__)
describe "File.file?" do
it_behaves_like :file_file, :file?, File
Modified: MacRuby/trunk/spec/frozen/core/filetest/grpowned_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/filetest/grpowned_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/filetest/grpowned_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,10 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/grpowned'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/grpowned', __FILE__)
describe "FileTest.grpowned?" do
it_behaves_like :file_grpowned, :grpowned?, FileTest
+
+ it "returns false if the file doesn't exist" do
+ FileTest.grpowned?("xxx-tmp-doesnt_exist-blah").should be_false
+ end
end
Modified: MacRuby/trunk/spec/frozen/core/filetest/identical_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/filetest/identical_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/filetest/identical_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/identical'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/identical', __FILE__)
describe "FileTest.identical?" do
it_behaves_like :file_identical, :identical?, FileTest
Modified: MacRuby/trunk/spec/frozen/core/filetest/owned_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/filetest/owned_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/filetest/owned_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/owned'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/owned', __FILE__)
describe "FileTest.owned?" do
it_behaves_like :file_owned, :owned?, FileTest
Modified: MacRuby/trunk/spec/frozen/core/filetest/pipe_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/filetest/pipe_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/filetest/pipe_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/pipe'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/pipe', __FILE__)
describe "FileTest.pipe?" do
it_behaves_like :file_pipe, :pipe?, FileTest
Modified: MacRuby/trunk/spec/frozen/core/filetest/readable_real_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/filetest/readable_real_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/filetest/readable_real_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/readable_real'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/readable_real', __FILE__)
describe "FileTest.readable_real?" do
it_behaves_like :file_readable_real, :readable_real?, FileTest
Modified: MacRuby/trunk/spec/frozen/core/filetest/readable_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/filetest/readable_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/filetest/readable_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/readable'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/readable', __FILE__)
describe "FileTest.readable?" do
it_behaves_like :file_readable, :readable?, FileTest
Modified: MacRuby/trunk/spec/frozen/core/filetest/setgid_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/filetest/setgid_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/filetest/setgid_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/setgid'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/setgid', __FILE__)
describe "FileTest.setgid?" do
it_behaves_like :file_setgid, :setgid?, FileTest
Modified: MacRuby/trunk/spec/frozen/core/filetest/setuid_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/filetest/setuid_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/filetest/setuid_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/setuid'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/setuid', __FILE__)
describe "FileTest.setuid?" do
it_behaves_like :file_setuid, :setuid?, FileTest
Modified: MacRuby/trunk/spec/frozen/core/filetest/size_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/filetest/size_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/filetest/size_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/size'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/size', __FILE__)
describe "FileTest.size?" do
it_behaves_like :file_size, :size?, FileTest
Modified: MacRuby/trunk/spec/frozen/core/filetest/socket_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/filetest/socket_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/filetest/socket_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/socket'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/socket', __FILE__)
describe "FileTest.socket?" do
it_behaves_like :file_socket, :socket?, FileTest
Modified: MacRuby/trunk/spec/frozen/core/filetest/sticky_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/filetest/sticky_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/filetest/sticky_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/sticky'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/sticky', __FILE__)
describe "FileTest.sticky?" do
it_behaves_like :file_sticky, :sticky?, FileTest
Modified: MacRuby/trunk/spec/frozen/core/filetest/symlink_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/filetest/symlink_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/filetest/symlink_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/symlink'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/symlink', __FILE__)
describe "FileTest.symlink?" do
it_behaves_like :file_symlink, :symlink?, FileTest
Modified: MacRuby/trunk/spec/frozen/core/filetest/writable_real_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/filetest/writable_real_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/filetest/writable_real_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/writable_real'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/writable_real', __FILE__)
describe "FileTest.writable_real?" do
it_behaves_like :file_writable_real, :writable_real?, FileTest
Modified: MacRuby/trunk/spec/frozen/core/filetest/writable_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/filetest/writable_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/filetest/writable_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/writable'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/writable', __FILE__)
describe "FileTest.writable?" do
it_behaves_like :file_writable, :writable?, FileTest
Modified: MacRuby/trunk/spec/frozen/core/filetest/zero_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/filetest/zero_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/filetest/zero_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/file/zero'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/file/zero', __FILE__)
describe "FileTest.zero?" do
it_behaves_like :file_zero, :zero?, FileTest
Modified: MacRuby/trunk/spec/frozen/core/fixnum/abs_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/abs_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/abs_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#abs" do
it "returns self's absolute value" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/bit_and_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/bit_and_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/bit_and_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#&" do
it "returns self bitwise AND other" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/bit_or_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/bit_or_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/bit_or_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#|" do
it "returns self bitwise OR other" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/bit_xor_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/bit_xor_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/bit_xor_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#^" do
it "returns self bitwise EXCLUSIVE OR other" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/coerce_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/coerce_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/coerce_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#coerce when given a Fixnum" do
it "returns an array containing two Fixnums" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/comparison_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/comparison_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/comparison_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#<=>" do
it "returns -1 when self is less than the given argument" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/complement_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/complement_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/complement_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#~" do
it "returns self with each bit flipped" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/div_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/div_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/div_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#div with a Fixnum" do
it "returns self divided by the given argument as an Integer" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/divide_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/divide_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/divide_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#/" do
it "returns self divided by the given argument" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/divmod_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/divmod_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/divmod_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#divmod" do
it "returns an Array containing quotient and modulus obtained from dividing self by the given argument" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/element_reference_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/element_reference_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/element_reference_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#[]" do
it "returns the nth bit in the binary representation of self" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/equal_value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/equal_value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/equal_value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#==" do
it "returns true if self has the same value as other" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/exponent_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/exponent_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/exponent_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#**" do
it "returns self raised to the given power" do
@@ -38,7 +38,7 @@
end
end
- ruby_version_is '1.9.2' do
+ ruby_version_is '1.9' do
it "returns a complex number when negative and raised to a fractional power" do
((-8) ** (1.0/3)) .should be_close(Complex(1, 1.73205), TOLERANCE)
((-8) ** Rational(1,3)).should be_close(Complex(1, 1.73205), TOLERANCE)
Modified: MacRuby/trunk/spec/frozen/core/fixnum/gt_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/gt_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/gt_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#>" do
it "returns true if self is greater than the given argument" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/gte_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/gte_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/gte_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#>=" do
it "returns true if self is greater than or equal to the given argument" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/hash_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/hash_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/hash_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#hash" do
it "is provided" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/id2name_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/id2name_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/id2name_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is ""..."1.9.1" do
describe "Fixnum#id2name" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/induced_from_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/induced_from_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/induced_from_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is ""..."1.9" do
describe "Fixnum.induced_from with [Float]" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/left_shift_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/left_shift_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/left_shift_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#<<" do
it "returns self shifted the given amount of bits to the left" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/lt_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/lt_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/lt_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#<" do
it "returns true if self is less than the given argument" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/lte_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/lte_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/lte_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#<=" do
it "returns true if self is less than or equal to other" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/minus_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/minus_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/minus_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#-" do
it "returns self minus the given Integer" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/modulo_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/modulo_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/modulo_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/modulo'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/modulo', __FILE__)
describe "Fixnum#%" do
it_behaves_like(:fixnum_modulo, :%)
Modified: MacRuby/trunk/spec/frozen/core/fixnum/multiply_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/multiply_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/multiply_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#*" do
it "returns self multiplied by the given Integer" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/plus_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/plus_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/plus_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#+" do
it "returns self plus the given Integer" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/quo_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/quo_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/quo_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#quo" do
it "returns the result of self divided by the given Integer as a Float" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/right_shift_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/right_shift_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/right_shift_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#>>" do
it "returns self shifted the given amount of bits to the right" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/size_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/size_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/size_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#size" do
platform_is :wordsize => 32 do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/to_f_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/to_f_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/to_f_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#to_f" do
it "returns self converted to a Float" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/to_s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/to_s_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/to_s_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#to_s when given a base" do
it "returns self converted to a String in the given base" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/to_sym_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/to_sym_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/to_sym_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is ""..."1.9.1" do
describe "Fixnum#to_sym" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/uminus_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/uminus_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/uminus_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#-@" do
it "returns self as a negative value" do
Modified: MacRuby/trunk/spec/frozen/core/fixnum/zero_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/fixnum/zero_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/fixnum/zero_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Fixnum#zero?" do
it "returns true if self is 0" do
Modified: MacRuby/trunk/spec/frozen/core/float/abs_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/abs_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/abs_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/shared/abs'
+require File.expand_path('../shared/abs', __FILE__)
describe "Float#abs" do
it_behaves_like(:float_abs, :abs)
Modified: MacRuby/trunk/spec/frozen/core/float/ceil_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/ceil_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/ceil_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Float#ceil" do
it "returns the smallest Integer greater than or equal to self" do
Modified: MacRuby/trunk/spec/frozen/core/float/coerce_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/coerce_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/coerce_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Float#coerce" do
it "returns [other, self] both as Floats" do
Modified: MacRuby/trunk/spec/frozen/core/float/comparison_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/comparison_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/comparison_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Float#<=>" do
before(:all) do
Modified: MacRuby/trunk/spec/frozen/core/float/constants_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/constants_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/constants_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Float#CONSTANTS" do
specify "the DIG value is 15" do
@@ -51,4 +51,14 @@
it "the RADIX is 2" do
Float::RADIX.should == 2
end
+
+ ruby_version_is "1.9" do
+ it "the INFINITY is the positive infinity" do
+ Float::INFINITY.infinite?.should == 1
+ end
+
+ it "the NAN is 'not a number'" do
+ Float::NAN.nan?.should be_true
+ end
+ end
end
Modified: MacRuby/trunk/spec/frozen/core/float/denominator_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/denominator_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/denominator_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Float#denominator" do
Modified: MacRuby/trunk/spec/frozen/core/float/divide_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/divide_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/divide_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Float#/" do
it "returns self divided by other" do
Modified: MacRuby/trunk/spec/frozen/core/float/divmod_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/divmod_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/divmod_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Float#divmod" do
it "returns an [quotient, modulus] from dividing self by other" do
Modified: MacRuby/trunk/spec/frozen/core/float/eql_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/eql_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/eql_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Float#eql?" do
it "returns true if other is a Float equal to self" do
Modified: MacRuby/trunk/spec/frozen/core/float/equal_value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/equal_value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/equal_value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Float#==" do
it "returns true if self has the same value as other" do
Modified: MacRuby/trunk/spec/frozen/core/float/exponent_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/exponent_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/exponent_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Float#**" do
it "returns self raise to the other power" do
@@ -8,7 +8,7 @@
(9.5 ** 0xffffffff).to_s.should == 'Infinity'
end
- ruby_version_is '1.9.2' do
+ ruby_version_is '1.9' do
it "returns a complex number when negative and raised to a fractional power" do
((-8.0) ** (1.0/3)) .should be_close(Complex(1, 1.73205), TOLERANCE)
((-8.0) ** Rational(1,3)).should be_close(Complex(1, 1.73205), TOLERANCE)
Modified: MacRuby/trunk/spec/frozen/core/float/fdiv_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/fdiv_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/fdiv_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Float#fdiv" do
Modified: MacRuby/trunk/spec/frozen/core/float/finite_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/finite_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/finite_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Float#finite?" do
it "returns true if a valid IEEE floating-point number" do
Modified: MacRuby/trunk/spec/frozen/core/float/floor_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/floor_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/floor_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Float#floor" do
it "returns the largest Integer less than or equal to self" do
Modified: MacRuby/trunk/spec/frozen/core/float/gt_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/gt_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/gt_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Float#>" do
it "returns true if self is greater than other" do
Modified: MacRuby/trunk/spec/frozen/core/float/gte_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/gte_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/gte_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Float#>=" do
it "returns true if self is greater than or equal to other" do
Modified: MacRuby/trunk/spec/frozen/core/float/hash_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/hash_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/hash_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Float#hash" do
it "is provided" do
Modified: MacRuby/trunk/spec/frozen/core/float/induced_from_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/induced_from_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/induced_from_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is ""..."1.9" do
describe "Float.induced_from" do
Modified: MacRuby/trunk/spec/frozen/core/float/infinite_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/infinite_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/infinite_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Float#infinite?" do
it "returns nil, -1, +1 when self is finite, -Infinity, +Infinity" do
Modified: MacRuby/trunk/spec/frozen/core/float/lt_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/lt_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/lt_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Float#<" do
it "returns true if self is less than other" do
Modified: MacRuby/trunk/spec/frozen/core/float/lte_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/lte_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/lte_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Float#<=" do
it "returns true if self is less than or equal to other" do
Modified: MacRuby/trunk/spec/frozen/core/float/magnitude_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/magnitude_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/magnitude_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/shared/abs'
+require File.expand_path('../shared/abs', __FILE__)
ruby_version_is "1.9" do
describe "Float#magnitude" do
Modified: MacRuby/trunk/spec/frozen/core/float/minus_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/minus_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/minus_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Float#-" do
it "returns self minus other" do
Modified: MacRuby/trunk/spec/frozen/core/float/modulo_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/modulo_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/modulo_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/modulo'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/modulo', __FILE__)
describe "Float#%" do
it_behaves_like(:float_modulo, :%)
Modified: MacRuby/trunk/spec/frozen/core/float/multiply_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/multiply_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/multiply_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Float#*" do
it "returns self multiplied by other" do
Modified: MacRuby/trunk/spec/frozen/core/float/nan_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/nan_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/nan_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Float#nan?" do
it "returns true if self is not a valid IEEE floating-point number" do
Modified: MacRuby/trunk/spec/frozen/core/float/numerator_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/numerator_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/numerator_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Float#numerator" do
Modified: MacRuby/trunk/spec/frozen/core/float/plus_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/plus_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/plus_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Float#+" do
it "returns self plus other" do
Modified: MacRuby/trunk/spec/frozen/core/float/rationalize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/rationalize_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/rationalize_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Float#rationalize" do
Modified: MacRuby/trunk/spec/frozen/core/float/round_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/round_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/round_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Float#round" do
it "returns the nearest Integer" do
Modified: MacRuby/trunk/spec/frozen/core/float/shared/abs.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/shared/abs.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/shared/abs.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe :float_abs, :shared => true do
it "returns the absolute value" do
Modified: MacRuby/trunk/spec/frozen/core/float/to_f_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/to_f_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/to_f_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Float#to_f" do
it "returns self" do
Modified: MacRuby/trunk/spec/frozen/core/float/to_i_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/to_i_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/to_i_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/to_i'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/to_i', __FILE__)
describe "Float#to_i" do
it_behaves_like(:float_to_i, :to_i)
Modified: MacRuby/trunk/spec/frozen/core/float/to_int_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/to_int_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/to_int_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/to_i'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/to_i', __FILE__)
describe "Float#" do
it_behaves_like(:float_to_i, :to_int)
Modified: MacRuby/trunk/spec/frozen/core/float/to_s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/to_s_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/to_s_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Float#to_s" do
it "returns a string representation of self, possibly Nan, -Infinity, +Infinity" do
Modified: MacRuby/trunk/spec/frozen/core/float/truncate_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/truncate_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/truncate_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/to_i'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/to_i', __FILE__)
describe "Float#truncate" do
it_behaves_like(:float_to_i, :truncate)
Modified: MacRuby/trunk/spec/frozen/core/float/uminus_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/uminus_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/uminus_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Float#-@" do
it "negates self" do
Modified: MacRuby/trunk/spec/frozen/core/float/uplus_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/uplus_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/uplus_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Float#+@" do
it "returns the same value with same sign (twos complement)" do
Modified: MacRuby/trunk/spec/frozen/core/float/zero_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/float/zero_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/float/zero_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Float#zero?" do
it "returns true if self is 0.0" do
Modified: MacRuby/trunk/spec/frozen/core/gc/disable_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/gc/disable_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/gc/disable_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,22 +1,10 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "GC.disable" do
after :each do
GC.enable
end
- it "can be invoked without any exceptions" do
- lambda { GC.disable }.should_not raise_error
- end
-
- it "doesn't accept any arguments" do
- lambda { GC.disable(1) }.should raise_error(ArgumentError)
- end
-
- it "ignores the supplied block" do
- lambda { GC.disable {} }.should_not raise_error
- end
-
it "returns true iff the garbage collection was previously disabled" do
GC.disable.should == false
GC.disable.should == true
Modified: MacRuby/trunk/spec/frozen/core/gc/enable_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/gc/enable_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/gc/enable_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,19 +1,7 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "GC.enable" do
- it "can be invoked without any exceptions" do
- lambda { GC.enable }.should_not raise_error
- end
-
- it "doesn't accept any arguments" do
- lambda { GC.enable(1) }.should raise_error(ArgumentError)
- end
-
- it "ignores the supplied block" do
- lambda { GC.enable {} }.should_not raise_error
- end
-
it "returns true iff the garbage collection was already disabled" do
GC.enable.should == false
GC.disable
Modified: MacRuby/trunk/spec/frozen/core/gc/garbage_collect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/gc/garbage_collect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/gc/garbage_collect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "GC#garbage_collect" do
@@ -7,18 +7,6 @@
@obj.extend(GC)
end
- it "can be invoked without any exceptions" do
- lambda { @obj.garbage_collect }.should_not raise_error
- end
-
- it "doesn't accept any arguments" do
- lambda { @obj.garbage_collect(1) }.should raise_error(ArgumentError)
- end
-
- it "ignores the supplied block" do
- lambda { @obj.garbage_collect {} }.should_not raise_error
- end
-
it "always returns nil" do
@obj.garbage_collect.should == nil
@obj.garbage_collect.should == nil
Modified: MacRuby/trunk/spec/frozen/core/gc/start_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/gc/start_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/gc/start_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,18 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "GC.start" do
- it "can be invoked without any exceptions" do
- lambda { GC.start }.should_not raise_error
- end
-
- it "doesn't accept any arguments" do
- lambda { GC.start(1) }.should raise_error(ArgumentError)
- end
-
- it "ignores the supplied block" do
- lambda { GC.start {} }.should_not raise_error
- end
-
it "always returns nil" do
GC.start.should == nil
GC.start.should == nil
Modified: MacRuby/trunk/spec/frozen/core/gc/stress_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/gc/stress_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/gc/stress_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.8.7" do
describe "GC.stress" do
@@ -6,12 +6,13 @@
# make sure that we never leave these tests in stress enabled GC!
GC.stress = false
end
+
it "returns current status of GC stress mode" do
- GC.stress.should == false
+ GC.stress.should be_false
GC.stress = true
- GC.stress.should == true
+ GC.stress.should be_true
GC.stress = false
- GC.stress.should == false
+ GC.stress.should be_false
end
end
@@ -19,14 +20,11 @@
after :each do
GC.stress = false
end
- it "can be invoked without any exceptions" do
- lambda { GC.stress = true }.should_not raise_error
- lambda { GC.stress = false }.should_not raise_error
+
+ it "sets the stress mode" do
+ GC.stress = true
+ GC.stress.should be_true
end
- it "returns a proper boolean result" do
- GC.send(:stress=, true).should be_true
- GC.send(:stress=, false).should be_false
- end
end
end
Modified: MacRuby/trunk/spec/frozen/core/hash/allocate_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/allocate_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/allocate_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Hash.allocate" do
it "returns an instance of Hash" do
Modified: MacRuby/trunk/spec/frozen/core/hash/assoc_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/assoc_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/assoc_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Hash#assoc" do
Modified: MacRuby/trunk/spec/frozen/core/hash/clear_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/clear_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/clear_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Hash#clear" do
it "removes all key, value pairs" do
Modified: MacRuby/trunk/spec/frozen/core/hash/clone_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/clone_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/clone_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Hash#clone" do
it "copies instance variable but not the objects they refer to" do
Modified: MacRuby/trunk/spec/frozen/core/hash/constructor_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/constructor_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/constructor_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Hash.[]" do
it "creates a Hash; values can be provided as the argument list" do
Modified: MacRuby/trunk/spec/frozen/core/hash/default_proc_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/default_proc_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/default_proc_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Hash#default_proc" do
it "returns the block passed to Hash.new" do
Modified: MacRuby/trunk/spec/frozen/core/hash/default_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/default_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/default_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Hash#default" do
it "returns the default value" do
Modified: MacRuby/trunk/spec/frozen/core/hash/delete_if_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/delete_if_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/delete_if_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/iteration'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/iteration', __FILE__)
describe "Hash#delete_if" do
it "yields two arguments: key and value" do
Modified: MacRuby/trunk/spec/frozen/core/hash/delete_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/delete_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/delete_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Hash#delete" do
it "removes the entry and returns the deleted value" do
Modified: MacRuby/trunk/spec/frozen/core/hash/each_key_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/each_key_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/each_key_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/iteration'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/iteration', __FILE__)
describe "Hash#each_key" do
it "calls block once for each key, passing key" do
Modified: MacRuby/trunk/spec/frozen/core/hash/each_pair_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/each_pair_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/each_pair_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,7 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/iteration'
-require File.dirname(__FILE__) + '/shared/each'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/iteration', __FILE__)
+require File.expand_path('../shared/each', __FILE__)
describe "Hash#each_pair" do
ruby_version_is ""..."1.9" do
Modified: MacRuby/trunk/spec/frozen/core/hash/each_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/each_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/each_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,7 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/iteration'
-require File.dirname(__FILE__) + '/shared/each'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/iteration', __FILE__)
+require File.expand_path('../shared/each', __FILE__)
describe "Hash#each" do
it_behaves_like(:hash_each, :each)
Modified: MacRuby/trunk/spec/frozen/core/hash/each_value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/each_value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/each_value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/iteration'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/iteration', __FILE__)
describe "Hash#each_value" do
it "calls block once for each key, passing value" do
Modified: MacRuby/trunk/spec/frozen/core/hash/element_reference_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/element_reference_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/element_reference_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Hash#[]" do
it "returns the value for key" do
Modified: MacRuby/trunk/spec/frozen/core/hash/element_set_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/element_set_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/element_set_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/store'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/store', __FILE__)
describe "Hash#[]=" do
it_behaves_like(:hash_store, :[]=)
Modified: MacRuby/trunk/spec/frozen/core/hash/empty_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/empty_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/empty_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Hash#empty?" do
it "returns true if the hash has no entries" do
Modified: MacRuby/trunk/spec/frozen/core/hash/eql_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/eql_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/eql_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/eql'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/eql', __FILE__)
# Do not use #should_receive(:eql?) mocks in these specs
# because MSpec uses Hash for mocks and Hash calls #eql?.
Modified: MacRuby/trunk/spec/frozen/core/hash/equal_value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/equal_value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/equal_value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/eql'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/eql', __FILE__)
describe "Hash#==" do
it_behaves_like :hash_eql, :==
Modified: MacRuby/trunk/spec/frozen/core/hash/fetch_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/fetch_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/fetch_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Hash#fetch" do
it "returns the value for key" do
Modified: MacRuby/trunk/spec/frozen/core/hash/flatten_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/flatten_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/flatten_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Hash#flatten" do
Modified: MacRuby/trunk/spec/frozen/core/hash/has_key_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/has_key_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/has_key_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/key'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/key', __FILE__)
describe "Hash#has_key?" do
it_behaves_like(:hash_key_p, :has_key?)
Modified: MacRuby/trunk/spec/frozen/core/hash/has_value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/has_value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/has_value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/value'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/value', __FILE__)
describe "Hash#has_value?" do
it_behaves_like(:hash_value_p, :has_value?)
Modified: MacRuby/trunk/spec/frozen/core/hash/hash_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/hash_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/hash_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Hash" do
it "includes Enumerable" do
Modified: MacRuby/trunk/spec/frozen/core/hash/include_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/include_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/include_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/key'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/key', __FILE__)
describe "Hash#include?" do
it_behaves_like(:hash_key_p, :include?)
Modified: MacRuby/trunk/spec/frozen/core/hash/index_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/index_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/index_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/index'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/index', __FILE__)
describe "Hash#index" do
it_behaves_like :hash_index, :index
Modified: MacRuby/trunk/spec/frozen/core/hash/indexes_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/indexes_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/indexes_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/values_at_spec'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../values_at_spec', __FILE__)
ruby_version_is ""..."1.9" do
describe "Hash#indexes" do
Modified: MacRuby/trunk/spec/frozen/core/hash/indices_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/indices_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/indices_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/values_at_spec'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../values_at_spec', __FILE__)
ruby_version_is ""..."1.9" do
describe "Hash#indices" do
Modified: MacRuby/trunk/spec/frozen/core/hash/initialize_copy_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/initialize_copy_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/initialize_copy_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/replace'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/replace', __FILE__)
describe "Hash#initialize_copy" do
it "is private" do
Modified: MacRuby/trunk/spec/frozen/core/hash/initialize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/initialize_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/initialize_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Hash#initialize" do
it "is private" do
Modified: MacRuby/trunk/spec/frozen/core/hash/inspect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/inspect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/inspect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/to_s'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/to_s', __FILE__)
describe "Hash#inspect" do
it_behaves_like :to_s, :inspect
Modified: MacRuby/trunk/spec/frozen/core/hash/invert_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/invert_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/invert_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Hash#invert" do
it "returns a new hash where keys are values and vice versa" do
Modified: MacRuby/trunk/spec/frozen/core/hash/key_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/key_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/key_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,7 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/key'
-require File.dirname(__FILE__) + '/shared/index'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/key', __FILE__)
+require File.expand_path('../shared/index', __FILE__)
describe "Hash#key?" do
it_behaves_like(:hash_key_p, :key?)
Modified: MacRuby/trunk/spec/frozen/core/hash/keys_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/keys_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/keys_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Hash#keys" do
Modified: MacRuby/trunk/spec/frozen/core/hash/length_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/length_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/length_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/length'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/length', __FILE__)
describe "Hash#length" do
it_behaves_like(:hash_length, :length)
Modified: MacRuby/trunk/spec/frozen/core/hash/member_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/member_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/member_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/key'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/key', __FILE__)
describe "Hash#member?" do
it_behaves_like(:hash_key_p, :member?)
Modified: MacRuby/trunk/spec/frozen/core/hash/merge_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/merge_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/merge_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,7 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/iteration'
-require File.dirname(__FILE__) + '/shared/update'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/iteration', __FILE__)
+require File.expand_path('../shared/update', __FILE__)
describe "Hash#merge" do
it "returns a new hash by combining self with the contents of other" do
@@ -58,17 +58,21 @@
describe "Hash#merge!" do
it_behaves_like(:hash_update, :merge!)
- # This bug is far too odd to explain in a comment; see
- # http://redmine.ruby-lang.org/issues/show/1535 for the closest I've got to
- # an explanation.
+ # see http://redmine.ruby-lang.org/issues/show/1535
ruby_bug "#1535", "1.8.7.248" do
- it "shouldn't raise spurious RuntimeErrors" do
+ it "raises a RuntimeError if a new key is added during iteration" do
hash = {1 => 2, 3 => 4, 5 => 6}
- big_hash = {}
- 64.times { |k| big_hash[k.to_s] = k }
+ hash2 = {:foo => :bar, :baz => :qux}
lambda{
- hash.each { hash.merge!(big_hash) }
- }.should_not raise_error(RuntimeError)
+ hash.each { hash.merge!(hash2) }
+ }.should raise_error(RuntimeError)
end
end
+
+ it "does not raise an exception if changing the value of an existing key during iteration" do
+ hash = {1 => 2, 3 => 4, 5 => 6}
+ hash2 = {1 => :foo, 3 => :bar}
+ hash.each { hash.merge!(hash2) }
+ hash.should == {1 => :foo, 3 => :bar, 5 => 6}
+ end
end
Modified: MacRuby/trunk/spec/frozen/core/hash/new_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/new_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/new_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Hash.new" do
it "creates an empty Hash if passed no arguments" do
Modified: MacRuby/trunk/spec/frozen/core/hash/rassoc_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/rassoc_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/rassoc_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Hash#rassoc" do
Modified: MacRuby/trunk/spec/frozen/core/hash/rehash_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/rehash_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/rehash_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Hash#rehash" do
it "reorganizes the hash by recomputing all key hash codes" do
Modified: MacRuby/trunk/spec/frozen/core/hash/reject_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/reject_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/reject_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/iteration'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/iteration', __FILE__)
describe "Hash#reject" do
it "is equivalent to hsh.dup.delete_if" do
@@ -80,12 +80,13 @@
end
ruby_version_is "1.9" do
- ruby_bug "#1571", "1.9.2" do
- it "raises a RuntimeError if called on a frozen instance" do
- lambda { HashSpecs.frozen_hash.reject! { false } }.should raise_error(RuntimeError)
- lambda { HashSpecs.empty_frozen_hash.reject! { true } }.should raise_error(RuntimeError)
- end
+ it "raises a RuntimeError if called on a frozen instance that is modified" do
+ lambda { HashSpecs.empty_frozen_hash.reject! { true } }.should raise_error(RuntimeError)
end
+
+ it "raises a RuntimeError if called on a frozen instance that would not be modified" do
+ lambda { HashSpecs.frozen_hash.reject! { false } }.should raise_error(RuntimeError)
+ end
end
ruby_version_is "" ... "1.8.7" do
@@ -100,11 +101,11 @@
ruby_version_is "1.8.7" do
it "returns an Enumerator when called on a non-empty hash without a block" do
- @hsh.reject!.should be_kind_of(enumerator_class)
+ @hsh.reject!.should be_an_instance_of(enumerator_class)
end
it "returns an Enumerator when called on an empty hash without a block" do
- @empty.reject!.should be_kind_of(enumerator_class)
+ @empty.reject!.should be_an_instance_of(enumerator_class)
end
end
Modified: MacRuby/trunk/spec/frozen/core/hash/replace_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/replace_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/replace_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/replace'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/replace', __FILE__)
describe "Hash#replace" do
it_behaves_like(:hash_replace, :replace)
Modified: MacRuby/trunk/spec/frozen/core/hash/select_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/select_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/select_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/iteration'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/iteration', __FILE__)
describe "Hash#select" do
before(:each) do
@@ -53,11 +53,11 @@
ruby_version_is "1.8.7" do
it "returns an Enumerator when called on a non-empty hash without a block" do
- @hsh.select.should be_kind_of(enumerator_class)
+ @hsh.select.should be_an_instance_of(enumerator_class)
end
it "returns an Enumerator when called on an empty hash without a block" do
- @empty.select.should be_kind_of(enumerator_class)
+ @empty.select.should be_an_instance_of(enumerator_class)
end
end
Modified: MacRuby/trunk/spec/frozen/core/hash/shared/index.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/shared/index.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/shared/index.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../fixtures/classes'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
describe :hash_index, :shared => true do
it "returns the corresponding key for value" do
Modified: MacRuby/trunk/spec/frozen/core/hash/shared/iteration.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/shared/iteration.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/shared/iteration.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -16,11 +16,11 @@
ruby_version_is "1.8.7" do
it "returns an Enumerator if called on a non-empty hash without a block" do
- @hsh.send(@method).should be_kind_of(enumerator_class)
+ @hsh.send(@method).should be_an_instance_of(enumerator_class)
end
it "returns an Enumerator if called on an empty hash without a block" do
- @empty.send(@method).should be_kind_of(enumerator_class)
+ @empty.send(@method).should be_an_instance_of(enumerator_class)
end
end
end
Modified: MacRuby/trunk/spec/frozen/core/hash/shared/replace.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/shared/replace.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/shared/replace.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -46,13 +46,16 @@
end
ruby_version_is "1.9" do
- ruby_bug "#1571", "1.9.2" do
- it "raises a RuntimeError if called on a frozen instance" do
- lambda { HashSpecs.frozen_hash.send(@method, HashSpecs.frozen_hash) }.
- should raise_error(RuntimeError)
- lambda { HashSpecs.frozen_hash.send(@method, HashSpecs.empty_frozen_hash) }.
- should raise_error(RuntimeError)
- end
+ it "raises a RuntimeError if called on a frozen instance that is modified" do
+ lambda do
+ HashSpecs.frozen_hash.send(@method, HashSpecs.frozen_hash)
+ end.should raise_error(RuntimeError)
end
+
+ it "raises a RuntimeError if called on a frozen instance that would not be modified" do
+ lambda do
+ HashSpecs.frozen_hash.send(@method, HashSpecs.empty_frozen_hash)
+ end.should raise_error(RuntimeError)
+ end
end
end
Modified: MacRuby/trunk/spec/frozen/core/hash/shared/store.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/shared/store.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/shared/store.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -48,4 +48,20 @@
lambda { HashSpecs.frozen_hash.send(@method, 1, 2) }.should raise_error(RuntimeError)
end
end
+
+ # see http://redmine.ruby-lang.org/issues/show/1535
+ ruby_bug "#1535", "1.8.7.248" do
+ it "raises a RuntimeError if a new key is added during iteration" do
+ hash = {1 => 2, 3 => 4, 5 => 6}
+ lambda{
+ hash.each { hash.send(@method, :foo, :bar) }
+ }.should raise_error(RuntimeError)
+ end
+ end
+
+ it "does not raise an exception if changing the value of an existing key during iteration" do
+ hash = {1 => 2, 3 => 4, 5 => 6}
+ hash.each { hash.send(@method, 1, :foo) }
+ hash.should == {1 => :foo, 3 => 4, 5 => 6}
+ end
end
Modified: MacRuby/trunk/spec/frozen/core/hash/shared/to_s.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/shared/to_s.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/shared/to_s.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../fixtures/classes'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
describe :to_s, :shared => true do
Modified: MacRuby/trunk/spec/frozen/core/hash/shared/update.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/shared/update.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/shared/update.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -36,18 +36,27 @@
ruby_version_is ""..."1.9" do
it "raises a TypeError if called on a non-empty, frozen instance" do
- HashSpecs.frozen_hash.send(@method, HashSpecs.empty_frozen_hash) # ok, empty
lambda { HashSpecs.frozen_hash.send(@method, 1 => 2) }.should raise_error(TypeError)
end
+
+ it "does not raise an exception on a frozen instance that would not be modified" do
+ hash = HashSpecs.frozen_hash.send(@method, HashSpecs.empty_frozen_hash)
+ hash.should == HashSpecs.frozen_hash
+ end
end
+
ruby_version_is "1.9" do
- ruby_bug "#1571", "1.9.2" do
- it "raises a RuntimeError if called on a frozen instance" do
- lambda { HashSpecs.frozen_hash.send(@method, HashSpecs.empty_frozen_hash) }.
- should raise_error(RuntimeError)
- lambda { HashSpecs.frozen_hash.send(@method, 1 => 2) }.
- should raise_error(RuntimeError)
- end
+ it "raises a RuntimeError on a frozen instance that is modified" do
+ lambda do
+ HashSpecs.frozen_hash.send(@method, 1 => 2)
+ end.should raise_error(RuntimeError)
end
+
+ # see redmine #1571
+ it "raises a RuntimeError on a frozen instance that would not be modified" do
+ lambda do
+ HashSpecs.frozen_hash.send(@method, HashSpecs.empty_frozen_hash)
+ end.should raise_error(RuntimeError)
+ end
end
end
Modified: MacRuby/trunk/spec/frozen/core/hash/shift_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/shift_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/shift_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Hash#shift" do
it "removes a pair from hash and return it" do
Modified: MacRuby/trunk/spec/frozen/core/hash/size_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/size_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/size_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/length'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/length', __FILE__)
describe "Hash#size" do
it_behaves_like(:hash_length, :size)
Modified: MacRuby/trunk/spec/frozen/core/hash/sort_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/sort_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/sort_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Hash#sort" do
it "converts self to a nested array of [key, value] arrays and sort with Array#sort" do
Modified: MacRuby/trunk/spec/frozen/core/hash/store_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/store_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/store_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/store'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/store', __FILE__)
describe "Hash#store" do
it_behaves_like(:hash_store, :store)
Modified: MacRuby/trunk/spec/frozen/core/hash/to_a_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/to_a_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/to_a_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Hash#to_a" do
it "returns a list of [key, value] pairs with same order as each()" do
Modified: MacRuby/trunk/spec/frozen/core/hash/to_hash_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/to_hash_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/to_hash_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Hash#to_hash" do
it "returns self" do
Modified: MacRuby/trunk/spec/frozen/core/hash/to_s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/to_s_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/to_s_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/to_s'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/to_s', __FILE__)
describe "Hash#to_s" do
Modified: MacRuby/trunk/spec/frozen/core/hash/try_convert_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/try_convert_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/try_convert_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.8.8" do
Modified: MacRuby/trunk/spec/frozen/core/hash/update_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/update_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/update_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/update'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/update', __FILE__)
describe "Hash#update" do
it_behaves_like(:hash_update, :update)
Modified: MacRuby/trunk/spec/frozen/core/hash/value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/value'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/value', __FILE__)
describe "Hash#value?" do
it_behaves_like(:hash_value_p, :value?)
Modified: MacRuby/trunk/spec/frozen/core/hash/values_at_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/values_at_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/values_at_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe :hash_values_at, :shared => true do
it "returns an array of values for the given keys" do
Modified: MacRuby/trunk/spec/frozen/core/hash/values_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/hash/values_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/hash/values_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Hash#values" do
it "returns an array of values" do
Modified: MacRuby/trunk/spec/frozen/core/integer/ceil_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/integer/ceil_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/integer/ceil_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/to_i'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/to_i', __FILE__)
describe "Integer#ceil" do
it_behaves_like(:integer_to_i, :ceil)
Modified: MacRuby/trunk/spec/frozen/core/integer/chr_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/integer/chr_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/integer/chr_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is ""..."1.9" do
describe "Integer#chr" do
Modified: MacRuby/trunk/spec/frozen/core/integer/denominator_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/integer/denominator_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/integer/denominator_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Integer#denominator" do
Modified: MacRuby/trunk/spec/frozen/core/integer/downto_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/integer/downto_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/integer/downto_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Integer#downto [stop] when self and stop are Fixnums" do
it "does not yield when stop is greater than self" do
Modified: MacRuby/trunk/spec/frozen/core/integer/even_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/integer/even_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/integer/even_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.8.7" do
describe "Integer#even?" do
Modified: MacRuby/trunk/spec/frozen/core/integer/floor_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/integer/floor_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/integer/floor_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/to_i'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/to_i', __FILE__)
describe "Integer#floor" do
it_behaves_like(:integer_to_i, :floor)
Modified: MacRuby/trunk/spec/frozen/core/integer/gcd_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/integer/gcd_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/integer/gcd_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Integer#gcd" do
ruby_version_is "1.9" do
Modified: MacRuby/trunk/spec/frozen/core/integer/gcdlcm_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/integer/gcdlcm_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/integer/gcdlcm_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Integer#gcdlcm" do
ruby_version_is "1.9" do
Modified: MacRuby/trunk/spec/frozen/core/integer/induced_from_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/integer/induced_from_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/integer/induced_from_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is ""..."1.9" do
describe "Integer.induced_from with [Float]" do
Modified: MacRuby/trunk/spec/frozen/core/integer/integer_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/integer/integer_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/integer/integer_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Integer#integer?" do
it "returns true" do
Modified: MacRuby/trunk/spec/frozen/core/integer/lcm_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/integer/lcm_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/integer/lcm_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Integer#lcm" do
ruby_version_is "1.9" do
Modified: MacRuby/trunk/spec/frozen/core/integer/next_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/integer/next_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/integer/next_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/next'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/next', __FILE__)
describe "Integer#next" do
it_behaves_like(:integer_next, :next)
Modified: MacRuby/trunk/spec/frozen/core/integer/numerator_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/integer/numerator_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/integer/numerator_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Integer#numerator" do
Modified: MacRuby/trunk/spec/frozen/core/integer/odd_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/integer/odd_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/integer/odd_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.8.7" do
describe "Integer#odd?" do
Modified: MacRuby/trunk/spec/frozen/core/integer/ord_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/integer/ord_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/integer/ord_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.8.7" do
describe "Integer#ord" do
Modified: MacRuby/trunk/spec/frozen/core/integer/pred_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/integer/pred_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/integer/pred_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.8.7" do
describe "Integer#pred" do
Modified: MacRuby/trunk/spec/frozen/core/integer/round_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/integer/round_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/integer/round_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/to_i'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/to_i', __FILE__)
describe "Integer#round" do
it_behaves_like(:integer_to_i, :round)
Modified: MacRuby/trunk/spec/frozen/core/integer/succ_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/integer/succ_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/integer/succ_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/next'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/next', __FILE__)
describe "Integer#succ" do
it_behaves_like(:integer_next, :succ)
Modified: MacRuby/trunk/spec/frozen/core/integer/times_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/integer/times_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/integer/times_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Integer#times" do
it "returns self" do
Modified: MacRuby/trunk/spec/frozen/core/integer/to_i_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/integer/to_i_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/integer/to_i_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/to_i'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/to_i', __FILE__)
describe "Integer#to_i" do
it_behaves_like(:integer_to_i, :to_i)
Modified: MacRuby/trunk/spec/frozen/core/integer/to_int_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/integer/to_int_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/integer/to_int_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/to_i'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/to_i', __FILE__)
describe "Integer#to_int" do
it_behaves_like(:integer_to_i, :to_int)
Modified: MacRuby/trunk/spec/frozen/core/integer/to_r_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/integer/to_r_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/integer/to_r_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Integer#to_r" do
ruby_version_is "1.9" do
Modified: MacRuby/trunk/spec/frozen/core/integer/truncate_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/integer/truncate_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/integer/truncate_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/to_i'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/to_i', __FILE__)
describe "Integer#truncate" do
it_behaves_like(:integer_to_i, :truncate)
Modified: MacRuby/trunk/spec/frozen/core/integer/upto_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/integer/upto_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/integer/upto_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Integer#upto [stop] when self and stop are Fixnums" do
it "does not yield when stop is less than self" do
Modified: MacRuby/trunk/spec/frozen/core/io/binmode_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/binmode_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/binmode_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#binmode" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/io/bytes_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/bytes_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/bytes_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,38 +1,40 @@
-# encoding: utf-8
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
ruby_version_is '1.8.7' do
describe "IO#bytes" do
before :each do
- @original = $KCODE
- $KCODE = "UTF-8"
- @io = File.open(IOSpecs.gets_fixtures)
+ @kcode, $KCODE = $KCODE, "utf-8"
+ @io = IOSpecs.io_fixture "lines.txt"
end
after :each do
@io.close unless @io.closed?
- $KCODE = @original
+ $KCODE = @kcode
end
it "returns an enumerator of the next bytes from the stream" do
enum = @io.bytes
- enum.should be_kind_of(enumerator_class)
+ enum.should be_an_instance_of(enumerator_class)
@io.readline.should == "Voici la ligne une.\n"
enum.first(5).should == [81, 117, 105, 32, 195]
end
- it "ignores a block" do
- @io.bytes{ raise "oups" }.should be_kind_of(enumerator_class)
+ it "does not yield to a block" do
+ @io.bytes{ flunk }.should be_an_instance_of(enumerator_class)
end
- it "raises IOError on closed stream" do
+ it "raises an IOError on closed stream" do
enum = IOSpecs.closed_file.bytes
lambda { enum.first }.should raise_error(IOError)
+ end
+
+ it "raises an IOError on an enumerator for a stream that has been closed" do
enum = @io.bytes
enum.first.should == 86
@io.close
- lambda { enum.first }.should raise_error(IOError)
+ lambda { enum.first }.should raise_error(IOError)
end
end
-end
\ No newline at end of file
+end
Modified: MacRuby/trunk/spec/frozen/core/io/chars_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/chars_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/chars_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,40 +1,45 @@
-# encoding: utf-8
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
ruby_version_is '1.8.7' do
describe "IO#chars" do
before :each do
- @original = $KCODE
- $KCODE = "UTF-8"
- @io = File.open(IOSpecs.gets_fixtures)
+ @kcode, $KCODE = $KCODE, "utf-8"
+ @io = IOSpecs.io_fixture "lines.txt"
end
after :each do
+ $KCODE = @kcode
@io.close unless @io.closed?
- $KCODE = @original
end
it "returns an enumerator of the next chars from the stream" do
enum = @io.chars
- enum.should be_kind_of(enumerator_class)
+ enum.should be_an_instance_of(enumerator_class)
@io.readline.should == "Voici la ligne une.\n"
enum.first(5).should == ["Q", "u", "i", " ", "è"]
end
ruby_version_is '1.9' do
it "ignores a block" do
- @io.chars{ raise "oups" }.should be_kind_of(enumerator_class)
+ @io.chars{ raise "oups" }.should be_an_instance_of(enumerator_class)
end
end
- it "raises IOError on closed stream" do
- enum = IOSpecs.closed_file.chars
- lambda { enum.first }.should raise_error(IOError)
+ it "returns an enumerator for a closed stream" do
+ IOSpecs.closed_file.chars.should be_an_instance_of(enumerator_class)
+ end
+
+ it "raises an IOError when an enumerator created on a closed stream is accessed" do
+ lambda { IOSpecs.closed_file.chars.first }.should raise_error(IOError)
+ end
+
+ it "raises an IOError when the stream for the enumerator is closed" do
enum = @io.chars
enum.first.should == "V"
@io.close
- lambda { enum.first }.should raise_error(IOError)
+ lambda { enum.first }.should raise_error(IOError)
end
end
-end
\ No newline at end of file
+end
Modified: MacRuby/trunk/spec/frozen/core/io/close_read_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/close_read_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/close_read_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#close_read" do
Modified: MacRuby/trunk/spec/frozen/core/io/close_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/close_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/close_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "IO#close" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/io/close_write_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/close_write_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/close_write_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#close_write" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/io/closed_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/closed_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/closed_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,14 +1,20 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
-describe "IO##{}closed?" do
+describe "IO#closed?" do
+ before :each do
+ @io = IOSpecs.io_fixture "lines.txt"
+ end
+
+ after :each do
+ @io.close
+ end
+
it "returns true on closed stream" do
- IOSpecs.closed_file.closed?.should == true
+ IOSpecs.closed_file.closed?.should be_true
end
it "returns false on open stream" do
- File.open(File.dirname(__FILE__) + '/fixtures/gets.txt', 'r') { |io|
- io.closed?.should == false
- }
+ @io.closed?.should be_false
end
end
Modified: MacRuby/trunk/spec/frozen/core/io/codepoints_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/codepoints_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/codepoints_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,17 +1,24 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/codepoints'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/codepoints', __FILE__)
# See redmine #1667
-describe "IO#codepoints" do
- ruby_version_is "1.9.2" do
+ruby_version_is "1.9" do
+ describe "IO#codepoints" do
it_behaves_like(:io_codepoints, :codepoints)
+ end
- it "ignores a given block" do
- File.open(IOSpecs.gets_fixtures) do |io|
- enum = io.codepoints{ raise "Never called!"}
- enum.first.should == 86
- end
+ describe "IO#codepoints" do
+ before :each do
+ @io = IOSpecs.io_fixture "lines.txt"
end
+
+ after :each do
+ @io.close unless @io.closed?
+ end
+
+ it "does not yield to a block" do
+ @io.codepoints{ flunk }.should be_an_instance_of(enumerator_class)
+ end
end
end
Modified: MacRuby/trunk/spec/frozen/core/io/constants_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/constants_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/constants_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "IO::SEEK_SET" do
it "is defined" do
Modified: MacRuby/trunk/spec/frozen/core/io/data/data_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/data/data_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/data/data_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe "DATA" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/io/data/flock_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/data/flock_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/data/flock_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,21 +1,23 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe "DATA.flock" do
before :each do
@data2_name = fixture __FILE__, "data2.rb"
end
- it "succeeds in locking the file DATA came from" do
- data = ruby_exe(@data2_name)
- data.should == "0"
+ platform_is_not :windows do
+ it "succeeds in locking the file DATA came from" do
+ data = ruby_exe(@data2_name)
+ data.should == "0"
- begin
- file = File.open(@data2_name)
- file.flock(File::LOCK_EX)
- data = ruby_exe(@data2_name)
- data.should == "false"
- ensure
- file.flock(File::LOCK_UN) if file
+ begin
+ file = File.open(@data2_name)
+ file.flock(File::LOCK_EX)
+ data = ruby_exe(@data2_name)
+ data.should == "false"
+ ensure
+ file.flock(File::LOCK_UN) if file
+ end
end
end
end
\ No newline at end of file
Modified: MacRuby/trunk/spec/frozen/core/io/dup_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/dup_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/dup_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#dup" do
before :all do
Modified: MacRuby/trunk/spec/frozen/core/io/each_byte_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/each_byte_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/each_byte_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,15 +1,16 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#each_byte" do
- before(:each) do
- @io = File.open(IOSpecs.gets_fixtures)
+ before :each do
+ @io = IOSpecs.io_fixture "lines.txt"
+ ScratchPad.record []
end
-
- after(:each) do
- @io.close
+
+ after :each do
+ @io.close unless @io.closed?
end
-
+
it "raises IOError on closed stream" do
# each_byte must have a block in order to raise the Error.
# MRI 1.8.7 returns enumerator if block is not provided.
@@ -18,25 +19,15 @@
end
it "yields each byte" do
- bytes = []
-
+ count = 0
@io.each_byte do |byte|
- bytes << byte
- break if bytes.length >= 5
+ ScratchPad << byte
+ break if 4 < count += 1
end
- bytes.should == [86, 111, 105, 99, 105]
+ ScratchPad.recorded.should == [86, 111, 105, 99, 105]
end
- it "works on empty streams" do
- f = File.new(tmp("io-each-byte-spec"), "w+")
- lambda {
- f.each_byte { |b| raise IOError }
- }.should_not raise_error
- f.close
- File.unlink(tmp("io-each-byte-spec"))
- end
-
ruby_version_is "" ... "1.8.7" do
it "yields a LocalJumpError when passed no block" do
lambda { @io.each_byte }.should raise_error(LocalJumpError)
@@ -46,9 +37,22 @@
ruby_version_is "1.8.7" do
it "returns an Enumerator when passed no block" do
enum = @io.each_byte
- enum.instance_of?(enumerator_class).should be_true
- enum.each.first(10).should == [86, 111, 105, 99, 105, 32, 108, 97, 32, 108]
+ enum.should be_an_instance_of(enumerator_class)
+ enum.each.first(5).should == [86, 111, 105, 99, 105]
end
end
-
end
+
+describe "IO#each_byte" do
+ before :each do
+ @io = IOSpecs.io_fixture "empty.txt"
+ end
+
+ after :each do
+ @io.close unless @io.closed?
+ end
+
+ it "returns self on an empty stream" do
+ @io.each_byte { |b| }.should equal(@io)
+ end
+end
Modified: MacRuby/trunk/spec/frozen/core/io/each_char_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/each_char_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/each_char_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,18 +1,18 @@
-# encoding: utf-8
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
ruby_version_is '1.8.7' do
describe "IO#each_char" do
before :each do
- @original = $KCODE
- $KCODE = "UTF-8"
- @io = File.open(IOSpecs.gets_fixtures)
+ @io = IOSpecs.io_fixture "lines.txt"
+ @kcode, $KCODE = $KCODE, "utf-8"
+ ScratchPad.record []
end
after :each do
@io.close unless @io.closed?
- $KCODE = @original
+ $KCODE = @kcode
end
it "raises IOError on closed stream" do
@@ -21,29 +21,40 @@
it "yields each character" do
@io.readline.should == "Voici la ligne une.\n"
- chars = []
+ count = 0
@io.each_char do |c|
- chars << c
- break if chars.length >= 5
+ ScratchPad << c
+ break if 4 < count += 1
end
- chars.should == ["Q", "u", "i", " ", "è"]
+ ScratchPad.recorded.should == ["Q", "u", "i", " ", "è"]
end
- it "works on empty streams" do
- f = File.new(tmp("io-each-char-spec"), "w+")
- lambda {
- f.each_char { |b| raise IOError }
- }.should_not raise_error
- f.close
- File.unlink(tmp("io-each-char-spec"))
- end
-
it "returns an Enumerator when passed no block" do
enum = @io.each_char
- enum.instance_of?(enumerator_class).should be_true
+ enum.should be_an_instance_of(enumerator_class)
enum.each.first(5).should == ["V", "o", "i", "c", "i"]
end
end
-end
\ No newline at end of file
+
+ describe "IO#each_char" do
+ before :each do
+ @kcode, $KCODE = $KCODE, "utf-8"
+ @name = tmp("io_each_char")
+ @io = IOSpecs.io_fixture @name, "w+:utf-8"
+ ScratchPad.record []
+ end
+
+ after :each do
+ @io.close unless @io.closed?
+ rm_r @name
+ $KCODE = @kcode
+ end
+
+ it "does not yield any characters on an empty stream" do
+ @io.each_char { |c| ScratchPad << c }
+ ScratchPad.recorded.should == []
+ end
+ end
+end
Modified: MacRuby/trunk/spec/frozen/core/io/each_codepoint_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/each_codepoint_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/each_codepoint_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,25 +1,31 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/codepoints'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/codepoints', __FILE__)
# See redmine #1667
-describe "IO#each_codepoint" do
- ruby_version_is "1.9.2" do
+ruby_version_is "1.9" do
+ describe "IO#each_codepoint" do
it_behaves_like(:io_codepoints, :codepoints)
-
+ end
+
+ describe "IO#each_codepoint" do
+ before :each do
+ @io = IOSpecs.io_fixture "lines.txt"
+ end
+
+ after :each do
+ @io.close
+ end
+
it "calls the given block" do
- File.open(IOSpecs.gets_fixtures) do |io|
- r = []
- io.each_codepoint{|c| r << c }
- r[24].should == 232
- r.last.should == 10
- end
+ r = []
+ @io.each_codepoint { |c| r << c }
+ r[24].should == 232
+ r.last.should == 10
end
it "returns self" do
- File.open(IOSpecs.gets_fixtures) do |io|
- io.each_codepoint {|l| l }.should equal(io)
- end
+ @io.each_codepoint { |l| l }.should equal(@io)
end
end
end
Modified: MacRuby/trunk/spec/frozen/core/io/each_line_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/each_line_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/each_line_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,11 +1,11 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/each'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/each', __FILE__)
describe "IO#each_line" do
it_behaves_like :io_each, :each_line
end
-describe "IO#each_line when passed a separator" do
- it_behaves_like :io_each_separator, :each_line
+describe "IO#each_line" do
+ it_behaves_like :io_each_default_separator, :each_line
end
Modified: MacRuby/trunk/spec/frozen/core/io/each_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/each_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/each_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,11 +1,11 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/each'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/each', __FILE__)
describe "IO#each" do
- it_behaves_like(:io_each, :each)
+ it_behaves_like :io_each, :each
end
-describe "IO#each when passed a separator" do
- it_behaves_like :io_each_separator, :each_line
+describe "IO#each" do
+ it_behaves_like :io_each_default_separator, :each
end
Modified: MacRuby/trunk/spec/frozen/core/io/eof_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/eof_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/eof_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,39 +1,39 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#eof?" do
before :each do
- @file_name = File.dirname(__FILE__) + '/fixtures/readlines.txt'
- @file = File.open(@file_name, 'r')
+ @name = fixture __FILE__, "lines.txt"
+ @io = IOSpecs.io_fixture "lines.txt"
end
after :each do
- @file.close unless @file.closed?
+ @io.close unless @io.closed?
end
it "returns false when not at end of file" do
- @file.read 1
- @file.eof?.should == false
+ @io.read 1
+ @io.eof?.should == false
end
it "returns true after reading with read with no parameters" do
- @file.read()
- @file.eof?.should == true
+ @io.read()
+ @io.eof?.should == true
end
it "returns true after reading with read" do
- @file.read(File.size(@file_name))
- @file.eof?.should == true
+ @io.read(File.size(@name))
+ @io.eof?.should == true
end
it "returns true after reading with sysread" do
- @file.sysread(File.size(@file_name))
- @file.eof?.should == true
+ @io.sysread(File.size(@name))
+ @io.eof?.should == true
end
it "returns true after reading with readlines" do
- @file.readlines
- @file.eof?.should == true
+ @io.readlines
+ @io.eof?.should == true
end
it "returns true on just opened empty stream" do
@@ -45,20 +45,20 @@
end
it "returns false on just opened non-empty stream" do
- @file.eof?.should == false
+ @io.eof?.should == false
end
ruby_version_is ""..."1.9" do
it "should not consume the data from the stream" do
- @file.eof?.should == false
- @file.getc.should == 86
+ @io.eof?.should == false
+ @io.getc.should == 86
end
end
ruby_version_is "1.9" do
it "should not consume the data from the stream" do
- @file.eof?.should == false
- @file.getc.should == 'V'
+ @io.eof?.should == false
+ @io.getc.should == 'V'
end
end
@@ -77,8 +77,8 @@
end
it "raises IOError on stream closed for reading by close_read" do
- @file.close_read
- lambda { @file.eof? }.should raise_error(IOError)
+ @io.close_read
+ lambda { @io.eof? }.should raise_error(IOError)
end
it "returns true on one-byte stream after single-byte read" do
Modified: MacRuby/trunk/spec/frozen/core/io/fcntl_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/fcntl_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/fcntl_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#fcntl" do
it "raises IOError on closed stream" do
Modified: MacRuby/trunk/spec/frozen/core/io/fileno_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/fileno_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/fileno_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#fileno" do
it "returns the numeric file descriptor of the given IO object" do
Modified: MacRuby/trunk/spec/frozen/core/io/fixtures/classes.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/fixtures/classes.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/fixtures/classes.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,5 @@
-# encoding: utf-8
+# -*- encoding: utf-8 -*-
+
module IOSpecs
def self.lines
[ "Voici la ligne une.\n",
@@ -11,23 +12,55 @@
"Est\303\241 aqui a linha cinco.\n",
"Here is line six.\n" ]
end
-
- def self.gets_fixtures
- File.dirname(__FILE__) + '/gets.txt'
+
+ def self.lines_r_separator
+ [ "Voici la ligne une.\nQui \303\250 la linea due.\n\n\n" \
+ "Aqu\303\255 est\303\241 la l\303\255nea tr",
+ "es.\nIst hier",
+ " Linie vier",
+ ".\n\nEst\303\241 aqui a linha cinco.\nHer",
+ "e is line six.\n" ]
end
-
- def self.closed_file
- File.open(File.dirname(__FILE__) + '/gets.txt', 'r') { |f| f }
+
+ def self.lines_empty_separator
+ [ "Voici la ligne une.\nQui \303\250 la linea due.\n\n",
+ "Aqu\303\255 est\303\241 la l\303\255nea tres.\nIst hier Linie vier.\n\n",
+ "Est\303\241 aqui a linha cinco.\nHere is line six.\n" ]
end
- def self.closed_io
- File.open(gets_fixtures, 'r') { |file|
- IO.open(file.fileno, 'r') { |io|
- io
- }
- }
+ def self.lines_space_separator
+ [ "Voici ", "la ", "ligne ", "une.\nQui ",
+ "\303\250 ", "la ", "linea ", "due.\n\n\nAqu\303\255 ",
+ "est\303\241 ", "la ", "l\303\255nea ", "tres.\nIst ",
+ "hier ", "Linie ", "vier.\n\nEst\303\241 ", "aqui ", "a ",
+ "linha ", "cinco.\nHere ", "is ", "line ", "six.\n" ]
end
+ def self.lines_arbitrary_separator
+ [ "Voici la ligne une.\nQui \303\250",
+ " la linea due.\n\n\nAqu\303\255 est\303\241 la l\303\255nea tres.\n" \
+ "Ist hier Linie vier.\n\nEst\303\241 aqui a linha cinco.\nHere is line six.\n" ]
+ end
+
+ def self.paragraphs
+ [ "Voici la ligne une.\nQui \303\250 la linea due.\n\n",
+ "Aqu\303\255 est\303\241 la l\303\255nea tres.\nIst hier Linie vier.\n\n",
+ "Est\303\241 aqui a linha cinco.\nHere is line six.\n" ]
+ end
+
+ def self.io_fixture(name, mode="r:utf-8")
+ path = fixture __FILE__, name
+ if File.exists? path
+ File.open path, fmode(mode)
+ else
+ File.open name, fmode(mode)
+ end
+ end
+
+ def self.closed_file
+ File.open(fixture(__FILE__, "lines.txt"), fmode("r:utf-8")) { |f| f }
+ end
+
class NotConvertable
def to_io
raise TypeError
Added: MacRuby/trunk/spec/frozen/core/io/fixtures/lines.txt
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/fixtures/lines.txt (rev 0)
+++ MacRuby/trunk/spec/frozen/core/io/fixtures/lines.txt 2010-03-28 19:32:11 UTC (rev 3871)
@@ -0,0 +1,9 @@
+Voici la ligne une.
+Qui è la linea due.
+
+
+Aquí está la línea tres.
+Ist hier Linie vier.
+
+Está aqui a linha cinco.
+Here is line six.
Modified: MacRuby/trunk/spec/frozen/core/io/flush_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/flush_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/flush_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#flush" do
it "raises IOError on closed stream" do
Modified: MacRuby/trunk/spec/frozen/core/io/for_fd_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/for_fd_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/for_fd_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/new'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/new', __FILE__)
describe "IO.for_fd" do
it_behaves_like :io_new, :for_fd
Modified: MacRuby/trunk/spec/frozen/core/io/foreach_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/foreach_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/foreach_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,145 +1,109 @@
-# encoding: utf-8
-require File.dirname(__FILE__) + '/../../spec_helper'
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
-describe "IO::foreach" do
- before :all do
- @file = File.dirname(__FILE__) + '/fixtures/readlines.txt'
- @content = ["Voici la ligne une.\n", "Qui \303\250 la linea due.\n",
- "Aqu\303\255 est\303\241 la l\303\255nea tres.\n", "Ist hier Linie vier.\n",
- "Est\303\241 aqui a linha cinco.\n", "Here is line six.\n"]
- @content_with_r = ["Voici la ligne une.\nQui \303\250 la linea due.\nAqu\303\255 est\303\241 la l\303\255nea tr",
- "es.\nIst hier", " Linie vier",
- ".\nEst\303\241 aqui a linha cinco.\nHer","e is line six.\n"]
+describe "IO.foreach" do
+ before :each do
+ @name = fixture __FILE__, "lines.txt"
+ @count = 0
+ ScratchPad.record []
end
- after :all do
- @file = nil
- @content = nil
- end
- it "yields a sequence of Strings that were separated by $/" do
- lines = []
- IO::foreach(@file) do |line|
- lines << line
- end
- lines.should == @content
+ it "raises TypeError if the first parameter is nil" do
+ lambda { IO.foreach(nil) {} }.should raise_error(TypeError)
end
- it "yields a sequence of Strings that were separated by r" do
- lines = []
- IO::foreach(File.dirname(__FILE__) + '/fixtures/readlines.txt','r') do |line|
- lines << line
- end
- lines.should == @content_with_r
+ it "raises Errno::ENOENT if the file does not exist" do
+ lambda { IO.foreach(tmp("nonexistent.txt")) {} }.should raise_error(Errno::ENOENT)
end
- it "yields a single string with entire content when the separator is nil" do
- lines = []
- IO::foreach(@file, nil) do |line|
- lines << line
- end
- lines.should == [@content.join]
+ it "converts first parameter to string and uses as file name" do
+ obj = mock('lines.txt fixture')
+ obj.should_receive(:to_str).and_return(@name)
+ IO.foreach(obj) { |l| ScratchPad << l }
+ ScratchPad.recorded.should == IOSpecs.lines
end
- it "yields a sequence of paragraphs when the separator is an empty string" do
- lines = []
- IO::foreach(File.dirname(__FILE__) + '/fixtures/gets.txt', "") do |line|
- lines << line
+ ruby_version_is "1.8.7" do
+ it "returns an Enumerator when called without a block" do
+ IO.foreach(@name).should be_an_instance_of(enumerator_class)
+ IO.foreach(@name).to_a.should == IOSpecs.lines
end
- lines.should == [
- "Voici la ligne une.\nQui \303\250 la linea due.\n\n",
- "Aqu\303\255 est\303\241 la l\303\255nea tres.\nIst hier Linie vier.\n\n",
- "Est\303\241 aqui a linha cinco.\nHere is line six.\n"]
end
- it "updates $. with each yield" do
- count = 1
- IO::foreach(@file, nil) do
- $..should == count
- count += 1
+ describe "with no separator argument" do
+ it "yields a sequence of Strings that were separated by $/" do
+ IO.foreach(@name) { |l| ScratchPad << l }
+ ScratchPad.recorded.should == IOSpecs.lines
end
- count = 1
- IO::foreach(@file, "") do
- $..should == count
- count += 1
+ it "updates $. with each yield" do
+ IO.foreach(@name) { $..should == @count += 1 }
end
+ end
- count = 1
- IO::foreach(@file) do
- $..should == count
- count += 1
+ describe "with nil as the separator argument" do
+ it "yields a single string with entire content" do
+ IO.foreach(@name, nil) { |l| ScratchPad << l }
+ ScratchPad.recorded.should == [IOSpecs.lines.join]
end
- count = 1
- IO::foreach(@file, "la") do
- $..should == count
- count += 1
+ it "updates $. with each yield" do
+ IO.foreach(@name, nil) { $..should == @count += 1 }
end
end
- it "can handle non-ASCII data as separator" do
- lines = []
- IO::foreach(@file, "\303\250") do |line|
- lines << line
+ describe "with an empty String as the separator argument" do
+ it "yields a sequence of paragraphs when the separator is an empty string" do
+ IO.foreach(@name, "") { |l| ScratchPad << l }
+ ScratchPad.recorded.should == IOSpecs.lines_empty_separator
end
- lines.should == ["Voici la ligne une.\nQui \303\250",
- " la linea due.\nAqu\303\255 est\303\241 la l\303\255nea tres.\nIst hier Linie vier.\nEst\303\241 aqui a linha cinco.\nHere is line six.\n"]
- end
- it "raises TypeError if the first parameter is nil" do
- lambda {
- IO::foreach(nil) {}
- }.should raise_error(TypeError)
+ it "updates $. with each yield" do
+ IO.foreach(@name, "") { $..should == @count += 1 }
+ end
end
- it "raises Errno::ENOENT on invalid_file_name" do
- lambda {
- IO::foreach("_1_2_3_4_nonexistent_hmm") {}
- }.should raise_error(Errno::ENOENT)
- end
+ describe "with an arbitrary String as the separator argument" do
+ it "yields a sequence of Strings that were separated by r" do
+ IO.foreach(@name, "r") { |l| ScratchPad << l }
+ ScratchPad.recorded.should == IOSpecs.lines_r_separator
+ end
- it "converts first parameter to string and uses as file name" do
- (obj = mock('readlines.txt')).should_receive(:to_str).and_return(@file)
- lines = []
- IO::foreach(obj) do |line|
- lines << line
+ it "updates $. with each yield" do
+ IO.foreach(@name, "la") { $..should == @count += 1 }
end
- lines.should == @content
- end
- ruby_version_is "" ... "1.9" do
- it "converts second parameter to string and uses as separator, with a to_str calling for the IO" do
- (obj = mock('r')).should_receive(:to_str).once.and_return('r')
- lines = []
- IO::foreach(@file, obj) do |line|
- lines << line
- end
- lines.should == @content_with_r
+ it "accepts non-ASCII data as separator" do
+ IO.foreach(@name, "\303\250") { |l| ScratchPad << l }
+ ScratchPad.recorded.should == IOSpecs.lines_arbitrary_separator
end
+
end
- ruby_version_is "1.9" do
- it "converts second parameter to string and uses as separator, with each to_str calling for each lines of the IOs" do
- num_lines = 6 # File.read(@file).lines.to_a.size #=> 6
- (obj = mock('r')).should_receive(:to_str).exactly(num_lines).times.and_return('r')
- lines = []
- IO::foreach(@file, obj) do |line|
- lines << line
+ describe "with an object as the separator argument" do
+ ruby_version_is "" ... "1.9" do
+ it "calls #to_str once to convert it to a String" do
+ obj = mock("IO.foreach separator 'r'")
+ obj.should_receive(:to_str).once.and_return("r")
+ IO.foreach(@name, obj) { |l| ScratchPad << l }
+ ScratchPad.recorded.should == IOSpecs.lines_r_separator
end
- lines.should == @content_with_r
end
- it "calls #to_path on non-String arguments" do
- p = mock('path')
- p.should_receive(:to_path).and_return(@file)
- IO.foreach(p).to_a
- end
- end
+ ruby_version_is "1.9" do
+ it "calls #to_str once for each line read to convert it to a String" do
+ obj = mock("IO.foreach separator 'r'")
+ obj.should_receive(:to_str).exactly(6).times.and_return("r")
+ IO.foreach(@name, obj) { |l| ScratchPad << l }
+ ScratchPad.recorded.should == IOSpecs.lines_r_separator
+ end
- ruby_version_is "1.8.7" do
- it "returns an Enumerator when called without a block" do
- IO.foreach(@file).should be_an_instance_of(enumerator_class)
- IO.foreach(@file).to_a.should == @content
+ it "calls #to_path on non-String arguments" do
+ path = mock("IO.foreach path")
+ path.should_receive(:to_path).and_return(@name)
+ IO.foreach(path).to_a.should == IOSpecs.lines
+ end
end
end
end
Modified: MacRuby/trunk/spec/frozen/core/io/fsync_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/fsync_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/fsync_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#fsync" do
it "raises IOError on closed stream" do
Modified: MacRuby/trunk/spec/frozen/core/io/getbyte_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/getbyte_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/getbyte_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,42 +1,46 @@
-# encoding: utf-8
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
ruby_version_is '1.8.7' do
describe "IO#getbyte" do
before :each do
- @original = $KCODE
- $KCODE = "UTF-8"
- @file_name = File.dirname(__FILE__) + '/fixtures/readlines.txt'
- @file = File.open(@file_name, 'r')
+ @kcode, $KCODE = $KCODE, "utf-8"
+ @io = IOSpecs.io_fixture "lines.txt"
end
after :each do
- @file.close unless @file.closed?
- $KCODE = @original
+ @io.close unless @io.closed?
+ $KCODE = @kcode
end
it "returns the next byte from the stream" do
- @file.readline.should == "Voici la ligne une.\n"
- letters = @file.getbyte, @file.getbyte, @file.getbyte, @file.getbyte, @file.getbyte
+ @io.readline.should == "Voici la ligne une.\n"
+ letters = @io.getbyte, @io.getbyte, @io.getbyte, @io.getbyte, @io.getbyte
letters.should == [81, 117, 105, 32, 195]
end
it "returns nil when invoked at the end of the stream" do
- # read entire content
- @file.read
- @file.getbyte.should == nil
+ @io.read
+ @io.getbyte.should == nil
end
- it "returns nil on empty stream" do
- File.open(tmp('empty.txt'), "w+") { |empty|
- empty.getbyte.should == nil
- }
- File.unlink(tmp("empty.txt"))
+ it "raises an IOError on closed stream" do
+ lambda { IOSpecs.closed_file.getbyte }.should raise_error(IOError)
end
+ end
- it "raises IOError on closed stream" do
- lambda { IOSpecs.closed_file.getbyte }.should raise_error(IOError)
+ describe "IO#getbyte" do
+ before :each do
+ @io = IOSpecs.io_fixture "empty.txt"
end
+
+ after :each do
+ @io.close
+ end
+
+ it "returns nil on empty stream" do
+ @io.getbyte.should == nil
+ end
end
-end
\ No newline at end of file
+end
Modified: MacRuby/trunk/spec/frozen/core/io/getc_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/getc_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/getc_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,50 +1,54 @@
-# encoding: utf-8
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#getc" do
before :each do
- @original = $KCODE
- $KCODE = "UTF-8"
- @file_name = File.dirname(__FILE__) + '/fixtures/readlines.txt'
- @file = File.open(@file_name, 'r')
+ @kcode, $KCODE = $KCODE, "utf-8"
+ @io = IOSpecs.io_fixture "lines.txt"
end
after :each do
- @file.close unless @file.closed?
- $KCODE = @original
+ @io.close unless @io.closed?
+ $KCODE = @kcode
end
ruby_version_is ''...'1.9' do
it "returns the next byte from the stream" do
- @file.readline.should == "Voici la ligne une.\n"
- letters = @file.getc, @file.getc, @file.getc, @file.getc, @file.getc
- letters.should == [81, 117, 105, 32, 195]
+ @io.readline.should == "Voici la ligne une.\n"
+ bytes = @io.getc, @io.getc, @io.getc, @io.getc, @io.getc
+ bytes.should == [81, 117, 105, 32, 195]
end
end
ruby_version_is '1.9' do
it "returns the next character from the stream" do
- @file.readline.should == "Voici la ligne une.\n"
- letters = @file.getc, @file.getc, @file.getc, @file.getc, @file.getc
+ @io.readline.should == "Voici la ligne une.\n"
+ letters = @io.getc, @io.getc, @io.getc, @io.getc, @io.getc
letters.should == ["Q", "u", "i", " ", "è"]
end
end
it "returns nil when invoked at the end of the stream" do
- # read entire content
- @file.read
- @file.getc.should == nil
+ @io.read
+ @io.getc.should be_nil
end
- it "returns nil on empty stream" do
- File.open(tmp('empty.txt'), "w+") { |empty|
- empty.getc.should == nil
- }
- File.unlink(tmp("empty.txt"))
- end
-
it "raises IOError on closed stream" do
lambda { IOSpecs.closed_file.getc }.should raise_error(IOError)
end
end
+
+describe "IO#getc" do
+ before :each do
+ @io = IOSpecs.io_fixture "empty.txt"
+ end
+
+ after :each do
+ @io.close unless @io.closed?
+ end
+
+ it "returns nil on empty stream" do
+ @io.getc.should be_nil
+ end
+end
Modified: MacRuby/trunk/spec/frozen/core/io/gets_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/gets_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/gets_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,194 +1,186 @@
-# encoding: utf-8
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/gets_ascii'
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/gets_ascii', __FILE__)
describe "IO#gets" do
- it "returns the next line of string that were separated by $/" do
- File.open(IOSpecs.gets_fixtures, 'r') do |f|
- IOSpecs.lines.each {|line| line.should == f.gets}
+ it_behaves_like :io_gets_ascii, :gets
+end
+
+describe "IO#gets" do
+ before :each do
+ @io = IOSpecs.io_fixture "lines.txt"
+ @count = 0
+ end
+
+ after :each do
+ @io.close unless @io.closed?
+ end
+
+ it "assigns the returned line to $_" do
+ IOSpecs.lines.each do |line|
+ @io.gets
+ $_.should == line
end
end
- it "returns tainted strings" do
- File.open(IOSpecs.gets_fixtures, 'r') do |f|
- while (line = f.gets(nil))
- line.tainted?.should == true
- end
+ it "returns nil if called at the end of the stream" do
+ IOSpecs.lines.length.times { @io.gets }
+ @io.gets.should == nil
+ end
+
+ it "raises IOError on closed stream" do
+ lambda { IOSpecs.closed_file.gets }.should raise_error(IOError)
+ end
+
+ describe "with no separator" do
+ it "returns the next line of string that is separated by $/" do
+ IOSpecs.lines.each { |line| line.should == @io.gets }
end
- File.open(IOSpecs.gets_fixtures, 'r') do |f|
- while (line = f.gets(""))
+ it "returns tainted strings" do
+ while line = @io.gets
line.tainted?.should == true
end
end
- File.open(IOSpecs.gets_fixtures, 'r') do |f|
- while (line = f.gets)
- line.tainted?.should == true
+ it "updates lineno with each invocation" do
+ while line = @io.gets
+ @io.lineno.should == @count += 1
end
end
- File.open(IOSpecs.gets_fixtures, 'r') do |f|
- while (line = f.gets("la"))
- line.tainted?.should == true
+ it "updates $. with each invocation" do
+ while line = @io.gets
+ $..should == @count += 1
end
end
end
- it "updates lineno with each invocation" do
- count = 1
- File.open(IOSpecs.gets_fixtures, 'r') do |f|
- while (line = f.gets(nil))
- f.lineno.should == count
- count += 1
- end
+ describe "with nil separator" do
+ it "returns the entire contents" do
+ @io.gets(nil).should == IOSpecs.lines.join("")
end
- count = 1
- File.open(IOSpecs.gets_fixtures, 'r') do |f|
- while (line = f.gets(""))
- f.lineno.should == count
- count += 1
+ it "returns tainted strings" do
+ while line = @io.gets(nil)
+ line.tainted?.should == true
end
end
- count = 1
- File.open(IOSpecs.gets_fixtures, 'r') do |f|
- while (line = f.gets)
- f.lineno.should == count
- count += 1
+ it "updates lineno with each invocation" do
+ while line = @io.gets(nil)
+ @io.lineno.should == @count += 1
end
end
- count = 1
- File.open(IOSpecs.gets_fixtures, 'r') do |f|
- while (line = f.gets("la"))
- f.lineno.should == count
- count += 1
+ it "updates $. with each invocation" do
+ while line = @io.gets(nil)
+ $..should == @count += 1
end
end
end
- it "updates $. with each invocation" do
- count = 1
- File.open(IOSpecs.gets_fixtures, 'r') do |f|
- while (line = f.gets(nil))
- $..should == count
- count += 1
- end
+ describe "with an empty String separator" do
+ # Two successive newlines in the input separate paragraphs.
+ # When there are more than two successive newlines, only two are kept.
+ it "returns the next paragraph" do
+ @io.gets("").should == IOSpecs.lines[0,3].join("")
+ @io.gets("").should == IOSpecs.lines[4,3].join("")
+ @io.gets("").should == IOSpecs.lines[7,2].join("")
end
- count = 1
- File.open(IOSpecs.gets_fixtures, 'r') do |f|
- while (line = f.gets(""))
- $..should == count
- count += 1
- end
+ it "reads until the beginning of the next paragraph" do
+ # There are three newlines between the first and second paragraph
+ @io.gets("")
+ @io.gets.should == IOSpecs.lines[4]
end
- count = 1
- File.open(IOSpecs.gets_fixtures, 'r') do |f|
- while (line = f.gets)
- $..should == count
- count += 1
+ it "returns tainted strings" do
+ while line = @io.gets("")
+ line.tainted?.should == true
end
end
- count = 1
- File.open(IOSpecs.gets_fixtures, 'r') do |f|
- while (line = f.gets("la"))
- $..should == count
- count += 1
+ it "updates lineno with each invocation" do
+ while line = @io.gets("")
+ @io.lineno.should == @count += 1
end
end
- end
- it "assigns the returned line to $_" do
- File.open(IOSpecs.gets_fixtures, 'r') do |f|
- IOSpecs.lines.each do |line|
- f.gets
- $_.should == line
+ it "updates $. with each invocation" do
+ while line = @io.gets("")
+ $..should == @count += 1
end
end
end
- it "returns nil if called at the end of the stream" do
- File.open(IOSpecs.gets_fixtures, 'r') do |f|
- IOSpecs.lines.length.times { f.gets }
- f.gets.should == nil
+ describe "with an arbitrary String separator" do
+ it "reads up to and including the separator" do
+ @io.gets("la linea").should == "Voici la ligne une.\nQui \303\250 la linea"
end
- end
- it "returns the entire content if the separator is nil" do
- File.open(IOSpecs.gets_fixtures, 'r') do |f|
- f.gets(nil).should == IOSpecs.lines.join('')
+ it "returns tainted strings" do
+ while line = @io.gets("la")
+ line.tainted?.should == true
+ end
end
- end
- # Two successive newlines in the input separate paragraphs.
- # When there are more than two successive newlines, only two are kept.
- it "returns the next paragraph if the separator's length is 0" do
- a = "Voici la ligne une.\nQui \303\250 la linea due.\n\n"
- b = "Aqu\303\255 est\303\241 la l\303\255nea tres.\nIst hier Linie vier.\n\n"
- c = "Est\303\241 aqui a linha cinco.\nHere is line six.\n"
+ it "updates lineno with each invocation" do
+ while (line = @io.gets("la"))
+ @io.lineno.should == @count += 1
+ end
+ end
- File.open(IOSpecs.gets_fixtures, 'r') do |f|
- f.gets("").should == a
- f.gets("").should == b
- f.gets("").should == c
+ it "updates $. with each invocation" do
+ while line = @io.gets("la")
+ $..should == @count += 1
+ end
end
end
+end
- # This could probably be added to the previous test using pos, but right now
- # this doesn't pass and the previous test does.
- it "reads until the beginning of the next paragraph when the separator's length is 0" do
- # Leverage the fact that there are three newlines between the first
- # and second paragraph
- File.open(IOSpecs.gets_fixtures, 'r') do |f|
- f.gets('')
+describe "IO#gets" do
+ before :each do
+ @name = tmp("io_gets")
+ end
- # This should return 'A', the first character of the next paragraph, not $/
- f.read(1).should == 'A'
- end
+ after :each do
+ rm_r @name
end
- it "raises an IOError if the stream is not opened for reading" do
- path = tmp("gets_spec")
- lambda { File.open(path, 'a') {|f| f.gets} }.should raise_error(IOError)
- lambda { File.open(path, 'w') {|f| f.gets} }.should raise_error(IOError)
- File.unlink(path) if File.exist?(path)
+ it "raises an IOError if the stream is opened for append only" do
+ lambda { File.open(@name, fmode("a:utf-8")) { |f| f.gets } }.should raise_error(IOError)
end
- it "raises IOError on closed stream" do
- lambda { IOSpecs.closed_file.gets }.should raise_error(IOError)
+ it "raises an IOError if the stream is opened for writing only" do
+ lambda { File.open(@name, fmode("w:utf-8")) { |f| f.gets } }.should raise_error(IOError)
end
+end
- it "fails on cloned opened streams" do
- f = File.open(tmp("gets_specs"), "w")
- f.puts("heh")
- g = IO.new(f.fileno)
- f.fileno.should == g.fileno
- lambda { g.gets }.should raise_error(IOError)
- g.close
- lambda { f.close }.should raise_error(Errno::EBADF)
- File.unlink(tmp("gets_specs"))
+describe "IO#gets" do
+ before :each do
+ @name = tmp("io_gets")
end
- it "accepts a separator" do
- f = File.open(tmp("gets_specs"), "w")
- f.print("A\n\n\nB\n")
- f.close
- f = File.new(tmp("gets_specs"), "r")
- f.gets("\n\n")
- b = f.gets("\n\n")
- f.gets("\n\n")
- f.close
- b.should == "\nB\n"
- File.unlink(tmp("gets_specs"))
+ after :each do
+ @io.close unless @io.closed?
+ rm_r @name
end
- it_behaves_like(:io_gets_ascii, :gets)
+ it "raises an IOErro on the clone of a stream not open for reading" do
+ @io = File.open @name, fmode("w:utf-8")
+ @io.puts "data for a cloned IO"
+
+ dup_io = IO.new @io.fileno
+ @io.fileno.should == dup_io.fileno
+
+ lambda { dup_io.gets }.should raise_error(IOError)
+
+ # dup_io should not be closed because it may cause an
+ # Errno::EBADF. This should be implementation-defined
+ # so the expectation for this error has been removed.
+ end
end
ruby_version_is "1.9" do
@@ -205,35 +197,35 @@
it "accepts an integer as first parameter to limit the output's size" do
touch(@name) { |f| f.print("waduswadus") }
- @file = File.open(@name)
+ @file = File.open @name, fmode("r:utf-8")
@file.gets(5).should == "wadus"
end
it "accepts an integer as second parameter to limit the output's size" do
touch(@file) { |f| f.print("wa\n\ndus\n\nwadus") }
- @file = File.open(@name)
+ @file = File.open @name, fmode("r:utf-8")
@file.gets('\n\n', 5).should == "wa\n\nd"
end
it "accepts an integer as limit parameter which is smaller than IO size" do
touch(@file) { |f| f.print("ABCD\n") }
- @file = File.open(@name)
+ @file = File.open @name, fmode("r:utf-8")
@file.gets("", 2).should == "AB"
end
it "accepts an integer as limit parameter which is same as IO size" do
touch(@file) { |f| f.print("ABC\n") }
- @file = File.open(@name)
+ @file = File.open @name, fmode("r:utf-8")
@file.gets("", 4).should == "ABC\n"
end
it "accepts an integer as limit parameter which is greater than IO size" do
touch(@file) { |f| f.print("A\n") }
- @file = File.open(@name)
+ @file = File.open @name, fmode("r:utf-8")
@file.gets("", 10).should == "A\n"
end
end
Modified: MacRuby/trunk/spec/frozen/core/io/initialize_copy_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/initialize_copy_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/initialize_copy_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "IO#initialize_copy" do
it "needs to be reviewed for spec completeness"
Modified: MacRuby/trunk/spec/frozen/core/io/initialize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/initialize_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/initialize_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#initialize" do
before :each do
@@ -78,7 +78,7 @@
end
it "ignores the :internal_encoding option when the same as the external encoding" do
- io = IO.new(2, 'w', {:internal_encoding => 'UTF-8'})
+ io = IO.new(2, 'w', {:external_encoding => 'utf-8', :internal_encoding => 'utf-8'})
io.external_encoding.to_s.should == 'UTF-8'
io.internal_encoding.to_s.should == ''
end
Modified: MacRuby/trunk/spec/frozen/core/io/inspect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/inspect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/inspect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#inspect" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/io/io_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/io_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/io_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,11 +1,7 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "IO" do
it "includes File::Constants" do
IO.include?(File::Constants).should == true
end
-
- it "for_fd takes two arguments" do
- IO.method(:for_fd).arity.should == -1
- end
end
Modified: MacRuby/trunk/spec/frozen/core/io/ioctl_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/ioctl_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/ioctl_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#ioctl" do
it "raises IOError on closed stream" do
Modified: MacRuby/trunk/spec/frozen/core/io/isatty_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/isatty_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/isatty_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/tty'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/tty', __FILE__)
describe "IO#isatty" do
it_behaves_like :io_tty, :isatty
Modified: MacRuby/trunk/spec/frozen/core/io/lineno_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/lineno_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/lineno_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,84 +1,95 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#lineno" do
- it "raises IOError on closed stream" do
+ before :each do
+ @io = IOSpecs.io_fixture "lines.txt"
+ end
+
+ after :each do
+ @io.close unless @io.closed?
+ end
+
+ it "raises an IOError on a closed stream" do
lambda { IOSpecs.closed_file.lineno }.should raise_error(IOError)
end
it "returns the current line number" do
- File.open(IOSpecs.gets_fixtures, 'r') do |f|
- f.lineno.should == 0
- while (f.gets)
- f.lineno.should > 0
- end
- f.rewind
- f.lineno.should == 0
+ @io.lineno.should == 0
+
+ count = 0
+ while @io.gets
+ @io.lineno.should == count += 1
end
+
+ @io.rewind
+ @io.lineno.should == 0
end
end
describe "IO#lineno=" do
- it "raises IOError on closed stream" do
+ before :each do
+ @io = IOSpecs.io_fixture "lines.txt"
+ end
+
+ after :each do
+ @io.close unless @io.closed?
+ end
+
+ it "raises an IOError on a closed stream" do
lambda { IOSpecs.closed_file.lineno = 5 }.should raise_error(IOError)
end
- it "invokes to_int on non-numeric arguments" do
- (obj = mock('123')).should_receive(:to_int).and_return(123)
- File.open(IOSpecs.gets_fixtures, 'r') do |f|
- f.lineno = obj
- f.lineno.should == 123
+ it "calls #to_int on a non-numeric argument" do
+ obj = mock('123')
+ obj.should_receive(:to_int).and_return(123)
- f.lineno = 1.5
- f.lineno.should == 1
+ @io.lineno = obj
+ @io.lineno.should == 123
+ end
- f.lineno = 92233.72036854775808
- f.lineno.should == 92233
- end
+ it "truncates a Float argument" do
+ @io.lineno = 1.5
+ @io.lineno.should == 1
+
+ @io.lineno = 92233.72036854775808
+ @io.lineno.should == 92233
end
it "raises TypeError on nil argument" do
- File.open(IOSpecs.gets_fixtures, 'r') do |f|
- lambda { f.lineno = nil }.should raise_error(TypeError)
- end
+ lambda { @io.lineno = nil }.should raise_error(TypeError)
end
it "sets the current line number to the given value" do
- File.open(IOSpecs.gets_fixtures, 'r') do |f|
- count = 500
- f.lineno = count - 1
- while (f.gets)
- f.lineno.should == count
- count += 1
- end
- f.rewind
- f.lineno.should == 0
+ @io.lineno = count = 500
+
+ while @io.gets
+ @io.lineno.should == count += 1
end
+
+ @io.rewind
+ @io.lineno.should == 0
end
it "does not change $." do
- orig_value = $.
- File.open(IOSpecs.gets_fixtures, 'r') do |f|
- numbers = [-2**30, -2**16, -2**8, -100, -10, -1, 0, 1, 10, 2**8, 2**16, 2**30]
- numbers.each { |num|
- f.lineno = num
- f.lineno.should == num
- $..should == orig_value
- }
+ original_line = $.
+ numbers = [-2**30, -2**16, -2**8, -100, -10, -1, 0, 1, 10, 2**8, 2**16, 2**30]
+ numbers.each do |num|
+ @io.lineno = num
+ @io.lineno.should == num
+ $..should == original_line
end
end
it "does not change $. until next read" do
$. = 0
- File.open(IOSpecs.gets_fixtures, 'r') do |f|
- $..should == 0
- count = 500
- f.lineno = count - 1
- $..should == 0
- while (f.gets)
- $..should == count
- count += 1
- end
+ $..should == 0
+
+ @io.lineno = count = 500
+ $..should == 0
+
+ while @io.gets
+ $..should == count += 1
end
end
end
Modified: MacRuby/trunk/spec/frozen/core/io/lines_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/lines_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/lines_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,34 +1,29 @@
-# encoding: utf-8
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
ruby_version_is '1.8.7' do
describe "IO#lines" do
- before(:each) do
- @io = File.open(IOSpecs.gets_fixtures)
+ before :each do
+ @io = IOSpecs.io_fixture "lines.txt"
end
-
- after(:each) do
- @io.close
+
+ after :each do
+ @io.close unless @io.closed?
end
it "returns an Enumerator" do
enum = @io.lines
enum.instance_of?(enumerator_class).should be_true
-
- enum.to_a.should == ["Voici la ligne une.\n",
- "Qui è la linea due.\n",
- "\n",
- "\n",
- "Aquí está la línea tres.\n",
- "Ist hier Linie vier.\n",
- "\n",
- "Está aqui a linha cinco.\n",
- "Here is line six.\n"]
end
-
+
+ it "returns a line when accessed" do
+ enum = @io.lines
+ enum.first.should == IOSpecs.lines[0]
+ end
+
it "ignores a given block" do
- @io.lines{ raise "oups" }.instance_of?(enumerator_class).should be_true
+ @io.lines{ raise "oups" }.should be_an_instance_of(enumerator_class)
end
end
-end
\ No newline at end of file
+end
Modified: MacRuby/trunk/spec/frozen/core/io/new_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/new_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/new_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/new'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/new', __FILE__)
describe "IO.new" do
it_behaves_like :io_new, :new
Modified: MacRuby/trunk/spec/frozen/core/io/open_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/open_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/open_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/new'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/new', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO.open" do
it_behaves_like :io_new, :open
@@ -8,10 +8,10 @@
describe "IO.open" do
before :all do
- @file_name = File.dirname(__FILE__) + '/fixtures/gets.txt'
+ @file_name = fixture __FILE__, "lines.txt"
end
- it "raises IOError on closed stream" do
+ it "raises an IOError on closed stream" do
lambda { IO.open(IOSpecs.closed_file.fileno, 'w') }.should raise_error(IOError)
end
@@ -50,21 +50,4 @@
end
}.should_not raise_error
end
-
-# before :all do
-# @filename = "/tmp/rubinius-spec-io-new-#{$$}.txt"
-# end
-#
-# after :all do
-# File.unlink @filename
-# end
-#
-# before :each do
-# @file = File.open @filename, "w"
-# end
-#
-# after :each do
-# # This should normally NOT be rescued
-# @file.close unless @file.closed? rescue nil
-# end
end
Modified: MacRuby/trunk/spec/frozen/core/io/output_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/output_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/output_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#<<" do
it "writes an object to the IO stream" do
Modified: MacRuby/trunk/spec/frozen/core/io/pid_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/pid_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/pid_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,29 +1,34 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "IO#pid" do
before :each do
- @file = File.open(File.dirname(__FILE__) + '/fixtures/readlines.txt', 'r')
- @io = IO.open @file.fileno, 'r'
+ @io = IOSpecs.io_fixture "lines.txt"
end
after :each do
- # we *must* close both in order to not leak descriptors
@io.close unless @io.closed?
- @file.close unless @file.closed? rescue Errno::EBADF
end
it "returns nil for IO not associated with a process" do
@io.pid.should == nil
end
+end
+describe "IO#pid" do
+ before :each do
+ @io = IO.popen RUBY_EXE, "r+"
+ end
+
+ after :each do
+ @io.close unless @io.closed?
+ end
+
it "returns the ID of a process associated with stream" do
- IO.popen(RUBY_EXE, "r+") { |io|
- io.pid.should_not == nil
- }
+ @io.pid.should_not be_nil
end
- it "raises IOError on closed stream" do
- process_io = IO.popen(RUBY_EXE, "r+") { |io| io }
- lambda { process_io.pid }.should raise_error(IOError)
+ it "raises an IOError on closed stream" do
+ @io.close
+ lambda { @io.pid }.should raise_error(IOError)
end
end
Modified: MacRuby/trunk/spec/frozen/core/io/pipe_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/pipe_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/pipe_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "IO.pipe" do
it "creates a two-ended pipe" do
Modified: MacRuby/trunk/spec/frozen/core/io/popen_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/popen_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/popen_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "IO::popen" do
# NOTE: cause Errno::EBADF on 1.8.6
Modified: MacRuby/trunk/spec/frozen/core/io/pos_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/pos_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/pos_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,51 +1,12 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/pos'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/pos', __FILE__)
describe "IO#pos" do
- it_behaves_like(:io_pos, :pos)
+ it_behaves_like :io_pos, :pos
end
describe "IO#pos=" do
-
- before :each do
- @fname = tmp('test.txt')
- File.open @fname, 'w' do |f| f.write "123" end
- end
-
- after :each do
- File.unlink @fname
- end
-
- it "sets the offset" do
- File.open @fname do |f|
- val1 = f.read 1
- f.pos = 0
- f.read(1).should == val1
- end
- end
-
- it "can handle any numerical argument without breaking" do
- File.open @fname do |io|
- io.pos = 1.2
- io.pos.should == 1
-
- io.pos = 2**32
- io.pos.should == 2**32
-
- io.pos = 1.23423423432e12
- io.pos.should == Integer(1.23423423432e12)
-
- io.pos = Float::EPSILON
- io.pos.should == 0
-
- lambda { io.pos = 2**128 }.should raise_error(RangeError)
- end
- end
-
- it "raises IOError on closed stream" do
- lambda { IOSpecs.closed_file.pos = 0 }.should raise_error(IOError)
- end
-
+ it_behaves_like :io_set_pos, :pos=
end
Modified: MacRuby/trunk/spec/frozen/core/io/print_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/print_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/print_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,46 +1,41 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe IO, "#print" do
- class IOSpecPrint
- attr_accessor :message
- def to_s; @message; end
- end
-
before :each do
@old_separator = $\
$\ = '->'
+ @name = tmp("io_print")
end
after :each do
$\ = @old_separator
+ rm_r @name
end
it "writes $_.to_s followed by $\\ (if any) to the stream if no arguments given" do
- o = IOSpecPrint.new
- o.message = 'I know what you did last line!'
+ o = mock('o')
+ o.should_receive(:to_s).and_return("mockmockmock")
$_ = o
- l = lambda { $stdout.print }.should output_to_fd("#{o.message}#{$\}", STDOUT)
- string = File.open(__FILE__) {|f| f.gets } # Set $_ to something known
- lambda { $stdout.print }.should output_to_fd("#{string}#{$\}", STDOUT)
- end
+ touch(@name) { |f| f.print }
+ IO.read(@name).should == "mockmockmock#{$\}"
- it "writes obj.to_s followed by $\\ (if any) to the stream when given one object" do
- o = Object.new
- def o.to_s(); 'I am an object'; end
+ # Set $_ to something known
+ string = File.open(__FILE__) {|f| f.gets }
- lambda { $stdout.print(o) }.should output("#{o.to_s}#{$\}")
+ touch(@name) { |f| f.print }
+ IO.read(@name).should == "#{string}#{$\}"
end
- it "does not call obj.to_str" do
+ it "calls obj.to_s and not obj.to_str then writes the record seperator" do
o = mock('o')
o.should_not_receive(:to_str)
- o.should_receive(:to_s)
-
- require 'stringio'
+ o.should_receive(:to_s).and_return("hello")
- StringIO.new.print(o)
+ touch(@name) { |f| f.print(o) }
+
+ IO.read(@name).should == "hello#{$\}"
end
it "writes each obj.to_s to the stream and appends $\\ (if any) given multiple objects" do
@@ -48,7 +43,8 @@
def o.to_s(); 'o'; end
def o2.to_s(); 'o2'; end
- lambda { $stdout.print(o, o2) }.should output("#{o.to_s}#{o2.to_s}#{$\}")
+ touch(@name) { |f| f.print(o, o2) }
+ IO.read(@name).should == "#{o.to_s}#{o2.to_s}#{$\}"
end
it "raises IOError on closed stream" do
@@ -56,6 +52,3 @@
end
end
-describe "IO#print" do
- it "needs to be reviewed for spec completeness"
-end
Modified: MacRuby/trunk/spec/frozen/core/io/printf_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/printf_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/printf_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#printf" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/io/putc_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/putc_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/putc_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,17 +1,17 @@
-# encoding: utf-8
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+# -*- encoding: ascii-8bit -*-
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#putc" do
before :each do
- @filename = tmp "IO_putc_file_#{$$}"
- @io = File.open @filename, 'w'
+ @name = tmp "io_putc"
+ @io = File.open @name, fmode("w:binary")
@io.sync = true
end
after :each do
@io.close
- File.unlink @filename
+ rm_r @name
end
it "raises IOError on closed stream" do
@@ -20,30 +20,31 @@
it "writes the first byte of a String" do
@io.putc "foo"
- File.read(@filename).should == 'f'
+ @name.should have_data("f")
end
- it "writes the first byte of an object's string representation" do
- o = Object.new
- def o.to_int() 261 end # \005
+ it "calls #to_int on a non-Integer and writes the first byte of the value" do
+ int = mock("integer 261")
+ int.should_receive(:to_int).and_return(261)
- @io.putc o
- File.read(@filename).should == "\005"
+ @io.putc int
+
+ # \005 is the least significant byte of 261
+ @name.should have_data("\005")
end
- it "writes Numerics that fit in a C char" do
+ it "writes a Numeric that fits in a byte" do
@io.putc(-128)
@io.putc 0
@io.putc 255
- File.read(@filename).should == "\200\000\377"
+ @name.should have_data("\200\000\377")
end
- it "write the first byte of Numerics that don't fit in a C char" do
+ it "write the first byte of a Numeric that does not fit in a byte" do
@io.putc(-129)
@io.putc 256
- File.read(@filename).should == "\177\000"
+ @name.should have_data("\177\000")
end
-
end
Modified: MacRuby/trunk/spec/frozen/core/io/puts_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/puts_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/puts_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
# TODO: need to find a better way to test this. Too fragile to set expectations
# to each write call. Only care that all the characters are sent not the number
Modified: MacRuby/trunk/spec/frozen/core/io/read_nonblock_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/read_nonblock_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/read_nonblock_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#read_nonblock" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/io/read_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/read_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/read_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-# encoding: utf-8
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO.read" do
before :each do
@@ -208,9 +208,8 @@
describe "IO#read with encodings" do
before :each do
- @kcode = $KCODE
-
- @name = fixture __FILE__, "readlines.txt"
+ @kcode, $KCODE = $KCODE, "utf-8"
+ @io = IOSpecs.io_fixture "lines.txt"
end
after :each do
@@ -218,12 +217,8 @@
end
it "ignores unicode encoding" do
- $KCODE = "UTF-8"
-
- File.open(@name, 'r') do |io|
- io.readline.should == "Voici la ligne une.\n"
- io.read(5).should == "Qui " + [195].pack("C")
- end
+ @io.readline.should == "Voici la ligne une.\n"
+ @io.read(5).should == encode("Qui \303", "binary")
end
end
Modified: MacRuby/trunk/spec/frozen/core/io/readchar_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/readchar_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/readchar_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,59 +1,57 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#readchar" do
before :each do
- @file_name = File.dirname(__FILE__) + '/fixtures/readlines.txt'
- @file = File.open(@file_name, 'r')
+ @io = IOSpecs.io_fixture "lines.txt"
end
after :each do
- @file.close unless @file.closed?
+ @io.close unless @io.closed?
end
ruby_version_is "" ... "1.9" do
it "returns the next byte from the stream" do
- @file.readchar.should == 86
- @file.readchar.should == 111
- @file.readchar.should == 105
+ @io.readchar.should == 86
+ @io.readchar.should == 111
+ @io.readchar.should == 105
# read the rest of line
- @file.readline.should == "ci la ligne une.\n"
- @file.readchar.should == 81
+ @io.readline.should == "ci la ligne une.\n"
+ @io.readchar.should == 81
end
end
ruby_version_is "1.9" do
it "returns the next string from the stream" do
- @file.readchar.should == 'V'
- @file.readchar.should == 'o'
- @file.readchar.should == 'i'
+ @io.readchar.should == 'V'
+ @io.readchar.should == 'o'
+ @io.readchar.should == 'i'
# read the rest of line
- @file.readline.should == "ci la ligne une.\n"
- @file.readchar.should == 'Q'
+ @io.readline.should == "ci la ligne une.\n"
+ @io.readchar.should == 'Q'
end
end
- it "raises EOFError when invoked at the end of the stream" do
- # read entire content
- @file.read
- lambda { @file.readchar }.should raise_error(EOFError)
+ it "raises an EOFError when invoked at the end of the stream" do
+ @io.read
+ lambda { @io.readchar }.should raise_error(EOFError)
end
- it "raises EOFError when reaches the end of the stream" do
- lambda { loop { @file.readchar } }.should raise_error(EOFError)
+ it "raises IOError on closed stream" do
+ lambda { IOSpecs.closed_file.readchar }.should raise_error(IOError)
end
+end
- it "raises EOFError on empty stream" do
- File.open(tmp('empty.txt'), "w+") { |empty|
- lambda {
- empty.readchar
- }.should raise_error(EOFError)
- }
+describe "IO#readchar" do
+ before :each do
+ @io = IOSpecs.io_fixture "empty.txt"
+ end
- File.unlink(tmp("empty.txt"))
+ after :each do
+ @io.close unless @io.closed?
end
-
- it "raises IOError on closed stream" do
- lambda { IOSpecs.closed_file.readchar }.should raise_error(IOError)
+
+ it "raises EOFError on empty stream" do
+ lambda { @io.readchar }.should raise_error(EOFError)
end
end
Modified: MacRuby/trunk/spec/frozen/core/io/readline_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/readline_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/readline_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,40 +1,35 @@
# -*- encoding: utf-8 -*-
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#readline" do
+ before :each do
+ @io = IOSpecs.io_fixture "lines.txt"
+ end
+ after :each do
+ @io.close unless @io.closed?
+ end
+
it "returns the next line on the stream" do
- testfile = File.dirname(__FILE__) + '/fixtures/gets.txt'
- f = File.open(testfile, 'r') do |f|
- f.readline.should == "Voici la ligne une.\n"
- f.readline.should == "Qui è la linea due.\n"
- end
+ @io.readline.should == "Voici la ligne une.\n"
+ @io.readline.should == "Qui è la linea due.\n"
end
it "goes back to first position after a rewind" do
- testfile = File.dirname(__FILE__) + '/fixtures/gets.txt'
- f = File.open(testfile, 'r') do |f|
- f.readline.should == "Voici la ligne une.\n"
- f.rewind
- f.readline.should == "Voici la ligne une.\n"
- end
+ @io.readline.should == "Voici la ligne une.\n"
+ @io.rewind
+ @io.readline.should == "Voici la ligne une.\n"
end
- it "is modified by the cursor position" do
- testfile = File.dirname(__FILE__) + '/fixtures/gets.txt'
- f = File.open(testfile, 'r') do |f|
- f.seek(1)
- f.readline.should == "oici la ligne une.\n"
- end
+ it "returns characters after the position set by #seek" do
+ @io.seek(1)
+ @io.readline.should == "oici la ligne une.\n"
end
it "raises EOFError on end of stream" do
- testfile = File.dirname(__FILE__) + '/fixtures/gets.txt'
- File.open(testfile, 'r') do |f|
- lambda { while true; f.readline; end }.should raise_error(EOFError)
- end
-
+ IOSpecs.lines.length.times { @io.readline }
+ lambda { @io.readline }.should raise_error(EOFError)
end
it "raises IOError on closed stream" do
@@ -42,11 +37,9 @@
end
it "assigns the returned line to $_" do
- File.open(IOSpecs.gets_fixtures, 'r') do |f|
- IOSpecs.lines.each do |line|
- f.readline
- $_.should == line
- end
+ IOSpecs.lines.each do |line|
+ @io.readline
+ $_.should == line
end
end
end
Modified: MacRuby/trunk/spec/frozen/core/io/readlines_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/readlines_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/readlines_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,201 +1,192 @@
-# encoding: utf-8
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
-describe "IO#readlines when passed no arguments" do
- before(:each) do
- @io = File.open(File.dirname(__FILE__) + '/fixtures/readlines.txt')
+describe "IO#readlines" do
+ before :each do
+ @io = IOSpecs.io_fixture "lines.txt"
end
- after(:each) do
+ after :each do
+ @io.close unless @io.closed?
+ end
+
+ it "raises an IOError if the stream is closed" do
@io.close
+ lambda { @io.readlines }.should raise_error(IOError)
end
- it "returns an Array containing lines based on $/" do
- begin
- old_sep, $/ = $/, " "
- @io.readlines.should == ["Voici ", "la ", "ligne ", "une.\nQui ", "\303\250 ",
- "la ", "linea ", "due.\nAqu\303\255 ", "est\303\241 ", "la ", "l\303\255nea ",
- "tres.\nIst ", "hier ", "Linie ", "vier.\nEst\303\241 ", "aqui ", "a ",
- "linha ", "cinco.\nHere ", "is ", "line ", "six.\n"]
- ensure
- $/ = old_sep
+ describe "when passed no arguments" do
+ before :each do
+ @sep, $/ = $/, " "
end
- end
- it "updates self's position" do
- @io.readlines
- @io.pos.should eql(134)
- end
+ after :each do
+ $/ = @sep
+ end
- it "updates self's lineno based on the number of lines read" do
- @io.readlines
- @io.lineno.should eql(6)
+ it "returns an Array containing lines based on $/" do
+ @io.readlines.should == IOSpecs.lines_space_separator
+ end
end
- it "does not change $_" do
- $_ = "test"
- @io.readlines(">")
- $_.should == "test"
- end
+ describe "when passed no arguments" do
+ it "updates self's position" do
+ @io.readlines
+ @io.pos.should eql(137)
+ end
- it "returns an empty Array when self is at the end" do
- @io.pos = 134
- @io.readlines.should == []
- end
-end
+ it "updates self's lineno based on the number of lines read" do
+ @io.readlines
+ @io.lineno.should eql(9)
+ end
-describe "IO#readlines when passed [separator]" do
- before(:each) do
- @io = File.open(File.dirname(__FILE__) + '/fixtures/readlines.txt')
- end
+ it "does not change $_" do
+ $_ = "test"
+ @io.readlines
+ $_.should == "test"
+ end
- after(:each) do
- @io.close
+ it "returns an empty Array when self is at the end" do
+ @io.readlines.should == IOSpecs.lines
+ @io.readlines.should == []
+ end
end
- it "returns an Array containing lines based on the passed separator" do
- @io.readlines('r').should == [
- "Voici la ligne une.\nQui \303\250 la linea due.\nAqu\303\255 est\303\241 la l\303\255nea tr",
- "es.\nIst hier",
- " Linie vier",
- ".\nEst\303\241 aqui a linha cinco.\nHer",
- "e is line six.\n"]
+ describe "when passed nil" do
+ it "returns the remaining content as one line starting at the current position" do
+ @io.readlines(nil).should == [IOSpecs.lines.join]
+ end
end
- it "returns an empty Array when self is at the end" do
- @io.pos = 134
- @io.readlines.should == []
+ describe "when passed an empty String" do
+ it "returns an Array containing all paragraphs" do
+ @io.readlines("").should == IOSpecs.paragraphs
+ end
end
- it "updates self's lineno based on the number of lines read" do
- @io.readlines('r')
- @io.lineno.should eql(5)
- end
+ describe "when passed a separator" do
+ it "returns an Array containing lines based on the separator" do
+ @io.readlines("r").should == IOSpecs.lines_r_separator
+ end
- it "updates self's position based on the number of characters read" do
- @io.readlines("r")
- @io.pos.should eql(134)
- end
+ it "returns an empty Array when self is at the end" do
+ @io.readlines
+ @io.readlines("r").should == []
+ end
- it "does not change $_" do
- $_ = "test"
- @io.readlines("r")
- $_.should == "test"
- end
+ it "updates self's lineno based on the number of lines read" do
+ @io.readlines("r")
+ @io.lineno.should eql(5)
+ end
- it "returns an Array containing all paragraphs when the passed separator is an empty String" do
- File.open(File.dirname(__FILE__) + '/fixtures/paragraphs.txt') do |io|
- io.readlines("").should == ["This is\n\n", "an example\n\n", "of paragraphs."]
+ it "updates self's position based on the number of characters read" do
+ @io.readlines("r")
+ @io.pos.should eql(137)
end
+
+ it "does not change $_" do
+ $_ = "test"
+ @io.readlines("r")
+ $_.should == "test"
+ end
+
+ it "tries to convert the passed separator to a String using #to_str" do
+ obj = mock('to_str')
+ obj.stub!(:to_str).and_return("r")
+ @io.readlines(obj).should == IOSpecs.lines_r_separator
+ end
end
+end
- it "returns the remaining content as one line starting at the current position when passed nil" do
- @io.pos = 5
- @io.readlines(nil).should == [" la ligne une.\nQui \303\250 la linea due.\n" +
- "Aqu\303\255 est\303\241 la l\303\255nea tres.\n" +
- "Ist hier Linie vier.\nEst\303\241 aqui a linha cinco.\nHere is line six.\n"]
+describe "IO#readlines" do
+ before :each do
+ @name = tmp("io_readlines")
end
- it "tries to convert the passed separator to a String using #to_str" do
- obj = mock('to_str')
- obj.stub!(:to_str).and_return("r")
- @io.readlines(obj).should == [
- "Voici la ligne une.\nQui \303\250 la linea due.\nAqu\303\255 est\303\241 la l\303\255nea tr",
- "es.\nIst hier",
- " Linie vier",
- ".\nEst\303\241 aqui a linha cinco.\nHer",
- "e is line six.\n"]
+ after :each do
+ rm_r @name
end
-end
-describe "IO#readlines when in write-only mode" do
- it "raises an IOError" do
- path = tmp("write_only_specs")
- File.open(path, 'a') do |io|
- lambda { io.readlines }.should raise_error(IOError)
- end
+ it "raises an IOError if the stream is opened for append only" do
+ lambda do
+ File.open(@name, fmode("a:utf-8")) { |f| f.readlines }
+ end.should raise_error(IOError)
+ end
- File.open(path) do |io|
- io.close_read
- lambda { io.readlines }.should raise_error(IOError)
- end
- File.unlink(path) if File.exists?(path)
+ it "raises an IOError if the stream is opened for write only" do
+ lambda do
+ File.open(@name, fmode("w:utf-8")) { |f| f.readlines }
+ end.should raise_error(IOError)
end
end
-describe "IO.readlines when passed [file_name]" do
+describe "IO.readlines" do
before(:each) do
- @file = File.dirname(__FILE__) + '/fixtures/readlines.txt'
+ @name = fixture __FILE__, "lines.txt"
end
- it "returns an Array containing lines of file_name based on $/" do
- begin
- old_sep, $/ = $/, " "
- IO.readlines(@file).should == ["Voici ", "la ", "ligne ", "une.\nQui ", "\303\250 ",
- "la ", "linea ", "due.\nAqu\303\255 ", "est\303\241 ", "la ", "l\303\255nea ",
- "tres.\nIst ", "hier ", "Linie ", "vier.\nEst\303\241 ", "aqui ", "a ",
- "linha ", "cinco.\nHere ", "is ", "line ", "six.\n"]
- ensure
- $/ = old_sep
+ describe "when not passed a separator" do
+ before :each do
+ @sep, $/ = $/, " "
end
- end
- it "raises an Errno::ENOENT error when the passed file_name does not exist" do
- non_existing_file = File.dirname(__FILE__) + '/fixtures/should_not_exist.txt'
- lambda { IO.readlines(non_existing_file) }.should raise_error(Errno::ENOENT)
- end
+ after :each do
+ $/ = @sep
+ end
- it "does not change $_" do
- $_ = "test"
- IO.readlines(@file)
- $_.should == "test"
+ it "returns an Array containing lines of file_name based on $/" do
+ IO.readlines(@name).should == IOSpecs.lines_space_separator
+ end
end
- it "tries to convert the passed file_name to a String using #to_str" do
- obj = mock('to_str')
- obj.stub!(:to_str).and_return(@file)
- IO.readlines(obj).should == ["Voici la ligne une.\n",
- "Qui \303\250 la linea due.\n",
- "Aqu\303\255 est\303\241 la l\303\255nea tres.\n",
- "Ist hier Linie vier.\n", "Est\303\241 aqui a linha cinco.\n",
- "Here is line six.\n"]
- end
-end
+ describe "when not passed a separator" do
+ it "raises an Errno::ENOENT error when the passed file_name does not exist" do
+ lambda { IO.readlines(tmp("nonexistent.txt")) }.should raise_error(Errno::ENOENT)
+ end
-describe "IO#readlines when passed [file_name, separator]" do
- before(:each) do
- @file = File.dirname(__FILE__) + '/fixtures/readlines.txt'
+ it "does not change $_" do
+ $_ = "test"
+ IO.readlines(@name)
+ $_.should == "test"
+ end
+
+ it "tries to convert the passed file_name to a String using #to_str" do
+ obj = mock('IO.readlines filename')
+ obj.stub!(:to_str).and_return(@name)
+ IO.readlines(obj).should == IOSpecs.lines
+ end
end
- it "returns an Array containing lines of file_name based on the passed separator" do
- IO.readlines(@file, 'r').should == [
- "Voici la ligne une.\nQui \303\250 la linea due.\nAqu\303\255 est\303\241 la l\303\255nea tr",
- "es.\nIst hier",
- " Linie vier",
- ".\nEst\303\241 aqui a linha cinco.\nHer",
- "e is line six.\n"]
+ describe "when passed nil as a separator" do
+ it "returns the contents as a single String" do
+ IO.readlines(@name, nil).should == [IOSpecs.lines.join]
+ end
end
- it "does not change $_" do
- $_ = "test"
- IO.readlines(@file, 'r')
- $_.should == "test"
+ describe "when passed an empty String as a separator" do
+ it "returns an Array containing all paragraphs" do
+ IO.readlines(@name, "").should == IOSpecs.paragraphs
+ end
end
- it "returns an Array containing all paragraphs when the passed separator is an empty String" do
- para_file = File.dirname(__FILE__) + '/fixtures/paragraphs.txt'
- IO.readlines(para_file, "").should == ["This is\n\n", "an example\n\n", "of paragraphs."]
+ describe "when passed an arbitrary string separator" do
+ it "returns an Array containing lines of file_name based on the passed separator" do
+ IO.readlines(@name, "r").should == IOSpecs.lines_r_separator
+ end
+
+ it "does not change $_" do
+ $_ = "test"
+ IO.readlines(@name, "r")
+ $_.should == "test"
+ end
end
- it "tries to convert the passed separator to a String using #to_str" do
- obj = mock('to_str')
- obj.stub!(:to_str).and_return("r")
- IO.readlines(@file, obj).should == [
- "Voici la ligne une.\nQui \303\250 la linea due.\nAqu\303\255 est\303\241 la l\303\255nea tr",
- "es.\nIst hier",
- " Linie vier",
- ".\nEst\303\241 aqui a linha cinco.\nHer",
- "e is line six.\n"]
+ describe "when passed an object as separator" do
+ it "tries to convert the passed separator to a String using #to_str" do
+ obj = mock('IO.readlines filename')
+ obj.stub!(:to_str).and_return("r")
+ IO.readlines(@name, obj).should == IOSpecs.lines_r_separator
+ end
end
end
Modified: MacRuby/trunk/spec/frozen/core/io/readpartial_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/readpartial_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/readpartial_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,9 +1,11 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#readpartial" do
before :each do
@rd, @wr = IO.pipe
+ @rd.binmode
+ @wr.binmode
end
after :each do
Modified: MacRuby/trunk/spec/frozen/core/io/reopen_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/reopen_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/reopen_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,13 +1,12 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#reopen" do
before :each do
# for reading
- @name1 = IOSpecs.gets_fixtures
- @name2 = File.dirname(__FILE__) + '/fixtures/numbered_lines.txt'
- @file1 = File.new(@name1)
- @file2 = File.new(@name2)
+ @name2 = fixture __FILE__, "numbered_lines.txt"
+ @file1 = IOSpecs.io_fixture "lines.txt"
+ @file2 = IOSpecs.io_fixture @name2
# for writing
@name1_w = tmp("IO_reopen_file1") + $$.to_s
@@ -25,9 +24,7 @@
end
it "raises IOError on closed stream" do
- File.open(File.dirname(__FILE__) + '/fixtures/gets.txt', 'r') { |f|
- lambda { f.reopen(IOSpecs.closed_file) }.should raise_error(IOError)
- }
+ lambda { @file1.reopen(IOSpecs.closed_file) }.should raise_error(IOError)
end
it "raises IOError when called on closed stream" do
@@ -121,13 +118,34 @@
File.readlines(@name2_w).should == ["line1-F2\n"]
end
- it "reassociates self with a new stream after some reads" do
+ it "reassociates self with a new stream after some reads from self" do
@file1.reopen(@file2)
@file1.gets
@file1.gets
+ @file2.close
+ @file2 = IOSpecs.io_fixture @name2
@file1.reopen(@file2).gets.should == "Line 1: One\n"
end
+ it "reassociates self with a new stream after some reads from the stream" do
+ @file2.gets
+ @file2.gets
+ @file1.reopen(@file2).gets.should == "Line 3: Three\n"
+ end
+
+ quarantine! do
+ # Access to multiple IOs that share the same fd or duplicated fd may cause
+ # bizarre behavior (see [ruby-core:28281], [ruby-core:28327]).
+ # This is inherent result of buffering. It will not be fixed because
+ # buffering is important for performance.
+ it "reassociates self with a new stream after some reads" do
+ @file1.reopen(@file2)
+ @file1.gets
+ @file1.gets
+ @file1.reopen(@file2).gets.should == "unknown\n"
+ end
+ end
+
ruby_version_is "1.9" do
it "calls #to_path on non-String arguments" do
p = mock('path')
Modified: MacRuby/trunk/spec/frozen/core/io/rewind_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/rewind_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/rewind_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,17 +1,14 @@
# -*- encoding: utf-8 -*-
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#rewind" do
before :each do
- @file = File.open(File.dirname(__FILE__) + '/fixtures/readlines.txt', 'r')
- @io = IO.open @file.fileno, 'r'
+ @io = IOSpecs.io_fixture "lines.txt"
end
after :each do
- # we *must* close both in order to not leak descriptors
@io.close unless @io.closed?
- @file.close unless @file.closed? rescue Errno::EBADF
end
it "positions the instance to the beginning of input" do
Modified: MacRuby/trunk/spec/frozen/core/io/seek_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/seek_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/seek_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,17 +1,19 @@
# -*- encoding: utf-8 -*-
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/pos', __FILE__)
describe "IO#seek" do
+ it_behaves_like :io_set_pos, :seek
+end
+
+describe "IO#seek" do
before :each do
- @file = File.open(File.dirname(__FILE__) + '/fixtures/readlines.txt', 'r')
- @io = IO.open @file.fileno, 'r'
+ @io = IOSpecs.io_fixture "lines.txt"
end
after :each do
- # we *must* close both in order to not leak descriptors
@io.close unless @io.closed?
- @file.close unless @file.closed? rescue Errno::EBADF
end
it "moves the read position relative to the current position with SEEK_CUR" do
@@ -26,31 +28,19 @@
@io.seek(1)
@io.pos.should == 1
@io.rewind
- @io.seek(42, IO::SEEK_SET)
- @io.readline.should == "quí está la línea tres.\n"
+ @io.seek(43, IO::SEEK_SET)
+ @io.readline.should == "Aquí está la línea tres.\n"
@io.seek(5, IO::SEEK_SET)
@io.readline.should == " la ligne une.\n"
end
it "moves the read position relative to the end with SEEK_END" do
@io.seek(0, IO::SEEK_END)
- @io.tell.should == 134
+ @io.tell.should == 137
@io.seek(-25, IO::SEEK_END)
@io.readline.should == "cinco.\n"
end
- it "can handle any numerical argument without breaking" do
- @io.seek(1.2).should == 0
- @io.seek(2**32).should == 0
- @io.seek(1.23423423432e12).should == 0
- @io.seek(0.00000000000000000000001).should == 0
- lambda { @io.seek(2**128) }.should raise_error(RangeError)
- end
-
- it "raises IOError on closed stream" do
- lambda { IOSpecs.closed_file.seek(0) }.should raise_error(IOError)
- end
-
it "moves the read position and clears EOF with SEEK_SET" do
value = @io.read
@io.seek(0, IO::SEEK_SET)
Modified: MacRuby/trunk/spec/frozen/core/io/select_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/select_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/select_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "IO.select" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/io/shared/codepoints.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/shared/codepoints.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/shared/codepoints.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,9 +1,9 @@
-# encoding: utf-8
-require File.dirname(__FILE__) + '/../fixtures/classes'
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../fixtures/classes', __FILE__)
describe :io_codepoints, :shared => true do
before(:each) do
- @io = File.open(IOSpecs.gets_fixtures)
+ @io = IOSpecs.io_fixture "lines.txt"
@enum = @io.send(@method)
end
@@ -16,7 +16,10 @@
end
it "yields each codepoint" do
- @enum.first(25).should == [86, 111, 105, 99, 105, 32, 108, 97, 32, 108, 105, 103, 110, 101, 32, 117, 110, 101, 46, 10, 81, 117, 105, 32, 232]
+ @enum.first(25).should == [
+ 86, 111, 105, 99, 105, 32, 108, 97, 32, 108, 105, 103, 110,
+ 101, 32, 117, 110, 101, 46, 10, 81, 117, 105, 32, 232
+ ]
end
it "yields each codepoint starting from the current position" do
@@ -38,5 +41,4 @@
it "raises an IOError when self is not readable" do
lambda { IOSpecs.closed_file.send(@method).to_a }.should raise_error(IOError)
end
-
-end
\ No newline at end of file
+end
Modified: MacRuby/trunk/spec/frozen/core/io/shared/each.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/shared/each.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/shared/each.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,144 +1,117 @@
-# encoding: utf-8
-require File.dirname(__FILE__) + '/../fixtures/classes'
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../fixtures/classes', __FILE__)
describe :io_each, :shared => true do
- before(:each) do
- @io = File.open(IOSpecs.gets_fixtures)
+ before :each do
+ @io = IOSpecs.io_fixture "lines.txt"
+ ScratchPad.record []
end
- after(:each) do
+ after :each do
@io.close
end
- it "yields each line to the passed block" do
- seen = []
- @io.send(@method) {|s| seen << s }
- seen.should == ["Voici la ligne une.\n",
- "Qui \303\250 la linea due.\n",
- "\n",
- "\n", "Aqu\303\255 est\303\241 la l\303\255nea tres.\n",
- "Ist hier Linie vier.\n",
- "\n",
- "Est\303\241 aqui a linha cinco.\n",
- "Here is line six.\n"]
- end
+ describe "with no separator" do
+ it "yields each line to the passed block" do
+ @io.send(@method) { |s| ScratchPad << s }
+ ScratchPad.recorded.should == IOSpecs.lines
+ end
- it "yields each line starting from the current position" do
- seen = []
- @io.pos = 40
- @io.send(@method) {|s| seen << s }
- seen.should == ["\n", "\n", "\n", "Aqu\303\255 est\303\241 la l\303\255nea tres.\n", "Ist hier Linie vier.\n", "\n", "Est\303\241 aqui a linha cinco.\n", "Here is line six.\n"]
- end
+ it "yields each line starting from the current position" do
+ @io.pos = 41
+ @io.send(@method) { |s| ScratchPad << s }
+ ScratchPad.recorded.should == IOSpecs.lines[2..-1]
+ end
- it "does not change $_" do
- $_ = "test"
- @io.send(@method) { |s| s}
- $_.should == "test"
- end
+ it "returns self" do
+ @io.send(@method) { |l| l }.should equal(@io)
+ end
- it "uses $/ as the default line separator" do
- seen = []
- begin
- old_rs, $/ = $/, " "
- @io.send(@method) {|s| seen << s }
- seen.should == ["Voici ", "la ", "ligne ", "une.\nQui ", "\303\250 ",
- "la ", "linea ", "due.\n\n\nAqu\303\255 ", "est\303\241 ", "la ",
- "l\303\255nea ", "tres.\nIst ", "hier ", "Linie ", "vier.\n\nEst\303\241 ",
- "aqui ", "a ", "linha ", "cinco.\nHere ", "is ", "line ", "six.\n"]
- ensure
- $/ = old_rs
+ it "does not change $_" do
+ $_ = "test"
+ @io.send(@method) { |s| s }
+ $_.should == "test"
end
- end
- it "returns self" do
- @io.send(@method) {|l| l }.should equal(@io)
- end
+ it "returns self" do
+ @io.send(@method) { |l| l }.should equal(@io)
+ end
- it "raises an IOError when self is not readable" do
- # method must have a block in order to raise the IOError.
- # MRI 1.8.7 returns enumerator if block is not provided.
- # See [ruby-core:16557].
- lambda { IOSpecs.closed_file.send(@method){} }.should raise_error(IOError)
- end
+ it "raises an IOError when self is not readable" do
+ # method must have a block in order to raise the IOError.
+ # MRI 1.8.7 returns enumerator if block is not provided.
+ # See [ruby-core:16557].
+ lambda { IOSpecs.closed_file.send(@method){} }.should raise_error(IOError)
+ end
- ruby_version_is "" ... "1.8.7" do
- it "yields a LocalJumpError when passed no block" do
- lambda { @io.send(@method) }.should raise_error(LocalJumpError)
+ ruby_version_is "" ... "1.8.7" do
+ it "raises a LocalJumpError when passed no block" do
+ lambda { @io.send(@method) }.should raise_error(LocalJumpError)
+ end
end
- end
- ruby_version_is "1.8.7" do
- it "returns an Enumerator when passed no block" do
- enum = @io.send(@method)
- enum.instance_of?(enumerator_class).should be_true
+ ruby_version_is "1.8.7" do
+ it "returns an Enumerator when passed no block" do
+ enum = @io.send(@method)
+ enum.should be_an_instance_of(enumerator_class)
- seen = []
- enum.each { |b| seen << b }
- seen.should == ["Voici la ligne une.\n",
- "Qui \303\250 la linea due.\n",
- "\n",
- "\n", "Aqu\303\255 est\303\241 la l\303\255nea tres.\n",
- "Ist hier Linie vier.\n",
- "\n",
- "Est\303\241 aqui a linha cinco.\n",
- "Here is line six.\n"]
+ enum.each { |l| ScratchPad << l }
+ ScratchPad.recorded.should == IOSpecs.lines
+ end
end
end
-end
-describe :io_each_separator, :shared => true do
- before(:each) do
- @io = File.open(IOSpecs.gets_fixtures)
- end
+ describe "when passed a String containing one space as a separator" do
+ it "uses the passed argument as the line separator" do
+ @io.send(@method, " ") { |s| ScratchPad << s }
+ ScratchPad.recorded.should == IOSpecs.lines_space_separator
+ end
- after(:each) do
- @io.close
- end
+ it "does not change $_" do
+ $_ = "test"
+ @io.send(@method, " ") { |s| }
+ $_.should == "test"
+ end
- it "uses the passed argument as the line separator" do
- seen = []
- @io.send(@method, " ") {|s| seen << s}
- seen.should == ["Voici ", "la ", "ligne ", "une.\nQui ", "\303\250 ", "la ",
- "linea ", "due.\n\n\nAqu\303\255 ", "est\303\241 ", "la ", "l\303\255nea ",
- "tres.\nIst ", "hier ", "Linie ", "vier.\n\nEst\303\241 ", "aqui ", "a ",
- "linha ", "cinco.\nHere ", "is ", "line ", "six.\n"]
+ it "tries to convert the passed separator to a String using #to_str" do
+ obj = mock("to_str")
+ obj.stub!(:to_str).and_return(" ")
+
+ @io.send(@method, obj) { |l| ScratchPad << l }
+ ScratchPad.recorded.should == IOSpecs.lines_space_separator
+ end
end
- it "does not change $_" do
- $_ = "test"
- @io.send(@method, " ") { |s| s}
- $_.should == "test"
+ describe "when passed nil as a separator" do
+ it "yields self's content starting from the current position when the passed separator is nil" do
+ @io.pos = 100
+ @io.send(@method, nil) { |s| ScratchPad << s }
+ ScratchPad.recorded.should == ["qui a linha cinco.\nHere is line six.\n"]
+ end
end
- it "returns self" do
- @io.send(@method) {|l| l }.should equal(@io)
+ describe "when passed an empty String as a separator" do
+ it "yields each paragraph" do
+ @io.send(@method, "") { |s| ScratchPad << s }
+ ScratchPad.recorded.should == IOSpecs.paragraphs
+ end
end
+end
- it "tries to convert the passed separator to a String using #to_str" do
- obj = mock("to_str")
- obj.stub!(:to_str).and_return(" ")
-
- seen = []
- @io.send(@method, obj) { |l| seen << l }
- seen.should == ["Voici ", "la ", "ligne ", "une.\nQui ", "\303\250 ", "la ",
- "linea ", "due.\n\n\nAqu\303\255 ", "est\303\241 ", "la ", "l\303\255nea ",
- "tres.\nIst ", "hier ", "Linie ", "vier.\n\nEst\303\241 ", "aqui ", "a ",
- "linha ", "cinco.\nHere ", "is ", "line ", "six.\n"]
+describe :io_each_default_separator, :shared => true do
+ before :each do
+ @io = IOSpecs.io_fixture "lines.txt"
+ ScratchPad.record []
+ @sep, $/ = $/, " "
end
- it "yields self's content starting from the current position when the passed separator is nil" do
- seen = []
- @io.pos = 100
- @io.send(@method, nil) {|s| seen << s}
- seen.should == ["qui a linha cinco.\nHere is line six.\n"]
+ after :each do
+ @io.close
+ $/ = @sep
end
- it "yields each paragraph when passed an empty String as separator" do
- seen = []
- para_file = File.dirname(__FILE__) + '/../fixtures/paragraphs.txt'
- File.open(para_file) do |io|
- io.send(@method, "") {|s| seen << s}
- end
- seen.should == ["This is\n\n", "an example\n\n", "of paragraphs."]
+ it "uses $/ as the default line separator" do
+ @io.send(@method) { |s| ScratchPad << s }
+ ScratchPad.recorded.should == IOSpecs.lines_space_separator
end
end
Modified: MacRuby/trunk/spec/frozen/core/io/shared/gets_ascii.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/shared/gets_ascii.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/shared/gets_ascii.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-# encoding: ASCII
+# -*- encoding: ascii -*-
describe :io_gets_ascii, :shared => true do
describe "with ASCII separator" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/io/shared/new.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/shared/new.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/shared/new.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../fixtures/classes'
+require File.expand_path('../../fixtures/classes', __FILE__)
describe :io_new, :shared => true do
before :all do
Modified: MacRuby/trunk/spec/frozen/core/io/shared/pos.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/shared/pos.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/shared/pos.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -31,3 +31,42 @@
end
end
end
+
+describe :io_set_pos, :shared => true do
+ before :each do
+ @fname = tmp('test.txt')
+ File.open @fname, 'w' do |f| f.write "123" end
+ end
+
+ after :each do
+ File.unlink @fname
+ end
+
+ it "sets the offset" do
+ File.open @fname do |f|
+ val1 = f.read 1
+ f.send @method, 0
+ f.read(1).should == val1
+ end
+ end
+
+ it "converts arguments to Integers" do
+ File.open @fname do |io|
+ o = mock("o")
+ o.should_receive(:to_int).and_return(1)
+
+ io.send @method, o
+ io.pos.should == 1
+ end
+ end
+
+ it "does not accept Bignums that don't fit in a C long" do
+ File.open @fname do |io|
+ lambda { io.send @method, 2**128 }.should raise_error(RangeError)
+ end
+ end
+
+ it "raises IOError on closed stream" do
+ lambda { IOSpecs.closed_file.send @method, 0 }.should raise_error(IOError)
+ end
+end
Modified: MacRuby/trunk/spec/frozen/core/io/shared/tty.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/shared/tty.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/shared/tty.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../fixtures/classes'
+require File.expand_path('../../fixtures/classes', __FILE__)
describe :io_tty, :shared => true do
with_tty do
Modified: MacRuby/trunk/spec/frozen/core/io/shared/write.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/shared/write.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/shared/write.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../fixtures/classes'
+require File.expand_path('../../fixtures/classes', __FILE__)
describe :io_write, :shared => true do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/io/stat_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/stat_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/stat_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,9 +1,9 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#stat" do
it "raises IOError on closed stream" do
- lambda { IOSpecs.closed_io.stat }.should raise_error(IOError)
+ lambda { IOSpecs.closed_file.stat }.should raise_error(IOError)
end
it "returns a File::Stat object for the stream" do
Modified: MacRuby/trunk/spec/frozen/core/io/sync_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/sync_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/sync_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,9 +1,9 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#sync=" do
before :each do
- @io = File.open(File.dirname(__FILE__) + '/fixtures/readlines.txt')
+ @io = IOSpecs.io_fixture "lines.txt"
end
after :each do
@@ -26,14 +26,14 @@
@io.sync.should == true
end
- it "raises IOError on closed stream" do
+ it "raises an IOError on closed stream" do
lambda { IOSpecs.closed_file.sync = true }.should raise_error(IOError)
end
end
describe "IO#sync" do
before :each do
- @io = File.open(File.dirname(__FILE__) + '/fixtures/readlines.txt')
+ @io = IOSpecs.io_fixture "lines.txt"
end
after :each do
@@ -44,7 +44,7 @@
@io.sync.should == false
end
- it "raises IOError on closed stream" do
+ it "raises an IOError on closed stream" do
lambda { IOSpecs.closed_file.sync }.should raise_error(IOError)
end
end
Modified: MacRuby/trunk/spec/frozen/core/io/sysopen_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/sysopen_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/sysopen_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "IO.sysopen" do
Modified: MacRuby/trunk/spec/frozen/core/io/sysread_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/sysread_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/sysread_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#sysread on a file" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/io/sysseek_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/sysseek_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/sysseek_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,18 +1,19 @@
# -*- encoding: utf-8 -*-
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/pos', __FILE__)
-describe "IO#sysseek on a file" do
- # TODO: This should be made more generic with seek spec
+describe "IO#sysseek" do
+ it_behaves_like :io_set_pos, :seek
+end
+
+describe "IO#sysseek" do
before :each do
- @file = File.open(File.dirname(__FILE__) + '/fixtures/readlines.txt', 'r')
- @io = IO.open @file.fileno, 'r'
+ @io = IOSpecs.io_fixture "lines.txt"
end
after :each do
- # we *must* close both in order to not leak descriptors
@io.close unless @io.closed?
- @file.close unless @file.closed? rescue Errno::EBADF
end
it "moves the read position relative to the current position with SEEK_CUR" do
@@ -25,24 +26,9 @@
lambda { @io.sysseek(-5, IO::SEEK_CUR) }.should raise_error(IOError)
end
- it "warns if called immediately after a buffered IO#write" do
- begin
- # copy contents to a separate file
- tmpfile = File.open(tmp("tmp_IO_sysseek"), "w")
- tmpfile.write(@file.read)
- tmpfile.seek(0, File::SEEK_SET)
-
- tmpfile.write("abcde")
- lambda { tmpfile.sysseek(10) }.should complain(/sysseek/)
- ensure
- tmpfile.close
- File.unlink(tmpfile.path)
- end
- end
-
it "moves the read position relative to the start with SEEK_SET" do
- @io.sysseek(42, IO::SEEK_SET)
- @io.readline.should == "quí está la línea tres.\n"
+ @io.sysseek(43, IO::SEEK_SET)
+ @io.readline.should == "Aquí está la línea tres.\n"
end
it "moves the read position relative to the end with SEEK_END" do
@@ -50,22 +36,9 @@
# this is the safest way of checking the EOF when
# sys-* methods are invoked
- lambda {
- @io.sysread(1)
- }.should raise_error(EOFError)
+ lambda { @io.sysread(1) }.should raise_error(EOFError)
@io.sysseek(-25, IO::SEEK_END)
@io.sysread(7).should == "cinco.\n"
end
-
- it "can handle any numerical argument without breaking and can seek past EOF" do
- @io.sysseek(1.2).should == 1
- @io.sysseek(2**10).should == 1024
- @io.sysseek(2**32).should == 4294967296
- lambda { @io.sysseek(2**128) }.should raise_error(RangeError)
- end
-
- it "raises IOError on closed stream" do
- lambda { IOSpecs.closed_file.sysseek(0) }.should raise_error(IOError)
- end
end
Modified: MacRuby/trunk/spec/frozen/core/io/syswrite_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/syswrite_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/syswrite_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/write'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/write', __FILE__)
describe "IO#syswrite on a file" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/io/tell_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/tell_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/tell_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/pos'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/pos', __FILE__)
describe "IO#tell" do
it_behaves_like(:io_pos, :tell)
Modified: MacRuby/trunk/spec/frozen/core/io/to_i_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/to_i_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/to_i_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#to_i" do
it "return the numeric file descriptor of the given IO object" do
Modified: MacRuby/trunk/spec/frozen/core/io/to_io_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/to_io_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/to_io_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,18 +1,21 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#to_io" do
- it "returns self for open stream" do
- io = IO.new(2, 'w')
- io.to_io.should == io
+ before :each do
+ @io = IOSpecs.io_fixture "lines.txt"
+ end
- File.open(File.dirname(__FILE__) + '/fixtures/readlines.txt', 'r') { |io|
- io.to_io.should == io
- }
+ after :each do
+ @io.close unless @io.closed?
end
+ it "returns self for open stream" do
+ @io.to_io.should equal(@io)
+ end
+
it "returns self for closed stream" do
io = IOSpecs.closed_file
- io.to_io.should == io
+ io.to_io.should equal(io)
end
end
Modified: MacRuby/trunk/spec/frozen/core/io/try_convert_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/try_convert_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/try_convert_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "IO.try_convert" do
ruby_version_is "1.8.8" do
Modified: MacRuby/trunk/spec/frozen/core/io/tty_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/tty_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/tty_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/tty'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/tty', __FILE__)
describe "IO#tty?" do
it_behaves_like :io_tty, :tty?
Modified: MacRuby/trunk/spec/frozen/core/io/ungetc_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/ungetc_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/ungetc_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
class IO
@@ -12,77 +12,81 @@
describe "IO#ungetc" do
before :each do
- @file_name = File.dirname(__FILE__) + '/fixtures/readlines.txt'
- @file = File.open(@file_name, 'r')
+ @io = IOSpecs.io_fixture "lines.txt"
+
+ @empty = tmp('empty.txt')
end
after :each do
- @file.close unless @file.closed?
+ @io.close unless @io.closed?
+ rm_r @empty
end
it "pushes back one character onto stream" do
- @file.getc.should == 86
- @file.ungetc(86)
- @file.getc.should == 86
+ @io.getc.should == 86
+ @io.ungetc(86)
+ @io.getc.should == 86
- @file.ungetc(10)
- @file.getc.should == 10
+ @io.ungetc(10)
+ @io.getc.should == 10
- @file.getc.should == 111
- @file.getc.should == 105
+ @io.getc.should == 111
+ @io.getc.should == 105
# read the rest of line
- @file.readline.should == "ci la ligne une.\n"
- @file.getc.should == 81
- @file.ungetc(99)
- @file.getc.should == 99
+ @io.readline.should == "ci la ligne une.\n"
+ @io.getc.should == 81
+ @io.ungetc(99)
+ @io.getc.should == 99
end
it "pushes back one character when invoked at the end of the stream" do
# read entire content
- @file.read
- @file.ungetc(100)
- @file.getc.should == 100
+ @io.read
+ @io.ungetc(100)
+ @io.getc.should == 100
end
it "pushes back one character when invoked at the start of the stream" do
- @file.read(0)
- @file.ungetc(100)
- @file.getc.should == 100
+ @io.read(0)
+ @io.ungetc(100)
+ @io.getc.should == 100
end
it "pushes back one character when invoked on empty stream" do
- File.open(tmp('empty.txt'), "w+") { |empty|
+ touch(@empty)
+
+ File.open(@empty) { |empty|
empty.getc().should == nil
empty.ungetc(10)
empty.getc.should == 10
}
- File.unlink(tmp("empty.txt"))
end
it "affects EOF state" do
- File.open(tmp('empty.txt'), "w+") { |empty|
+ touch(@empty)
+
+ File.open(@empty) { |empty|
empty.eof?.should == true
empty.getc.should == nil
empty.ungetc(100)
empty.eof?.should == false
}
- File.unlink(tmp("empty.txt"))
end
it "adjusts the stream position" do
- @file.pos.should == 0
+ @io.pos.should == 0
# read one char
- c = @file.getc
- @file.pos.should == 1
- @file.ungetc(c)
- @file.pos.should == 0
+ c = @io.getc
+ @io.pos.should == 1
+ @io.ungetc(c)
+ @io.pos.should == 0
# read all
- @file.read
- pos = @file.pos
- @file.ungetc(98)
- @file.pos.should == pos - 1
+ @io.read
+ pos = @io.pos
+ @io.ungetc(98)
+ @io.pos.should == pos - 1
end
# TODO: file MRI bug
@@ -90,34 +94,34 @@
# "Has no effect with unbuffered reads (such as IO#sysread)."
#
#it "has no effect with unbuffered reads" do
- # length = File.size(@file_name)
- # content = @file.sysread(length)
- # @file.rewind
- # @file.ungetc(100)
- # @file.sysread(length).should == content
+ # length = File.size(@io_name)
+ # content = @io.sysread(length)
+ # @io.rewind
+ # @io.ungetc(100)
+ # @io.sysread(length).should == content
#end
it "makes subsequent unbuffered operations to raise IOError" do
- @file.getc
- @file.ungetc(100)
- lambda { @file.sysread(1) }.should raise_error(IOError)
+ @io.getc
+ @io.ungetc(100)
+ lambda { @io.sysread(1) }.should raise_error(IOError)
end
ruby_version_is "" ... "1.9" do
it "raises IOError when invoked on stream that was not yet read" do
- lambda { @file.ungetc(100) }.should raise_error(IOError)
+ lambda { @io.ungetc(100) }.should raise_error(IOError)
end
end
ruby_version_is "1.9" do
it "returns nil when invoked on stream that was not yet read" do
- @file.ungetc(100).should be_nil
+ @io.ungetc(100).should be_nil
end
end
it "raises IOError on closed stream" do
- @file.getc
- @file.close
- lambda { @file.ungetc(100) }.should raise_error(IOError)
+ @io.getc
+ @io.close
+ lambda { @io.ungetc(100) }.should raise_error(IOError)
end
end
Modified: MacRuby/trunk/spec/frozen/core/io/write_nonblock_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/write_nonblock_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/write_nonblock_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/write'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/write', __FILE__)
describe "IO#write_nonblock on a file" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/io/write_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/io/write_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/io/write_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/write'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/write', __FILE__)
describe "IO#write on a file" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/kernel/Array_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/Array_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/Array_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#Array" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/Float_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/Float_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/Float_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe :kernel_float, :shared => true do
it "returns the identical Float for numeric Floats" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/Integer_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/Integer_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/Integer_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
require "rational"
describe :kernel_integer, :shared => true do
Modified: MacRuby/trunk/spec/frozen/core/kernel/String_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/String_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/String_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe :kernel_String, :shared => true do
it "converts nil to a String" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/__callee___spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/__callee___spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/__callee___spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/__method__'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/__method__', __FILE__)
describe "Kernel.__callee__" do
ruby_version_is '1.9' do
Modified: MacRuby/trunk/spec/frozen/core/kernel/__id___spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/__id___spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/__id___spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/object_id'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/object_id', __FILE__)
describe "Kernel#__id__" do
it_behaves_like(:kernel_object_id, :__id__)
Modified: MacRuby/trunk/spec/frozen/core/kernel/__method___spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/__method___spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/__method___spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/__method__'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/__method__', __FILE__)
describe "Kernel.__method__" do
ruby_version_is '1.8.7' do
Modified: MacRuby/trunk/spec/frozen/core/kernel/__send___spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/__send___spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/__send___spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#__send__" do
it "needs to be reviewed for spec completeness"
Modified: MacRuby/trunk/spec/frozen/core/kernel/abort_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/abort_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/abort_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,12 +1,15 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/abort', __FILE__)
describe "Kernel#abort" do
it "is a private method" do
Kernel.should have_private_instance_method(:abort)
end
+
+ it_behaves_like :kernel_abort, :abort, KernelSpecs::Method.new
end
describe "Kernel.abort" do
- it "needs to be reviewed for spec completeness"
+ it_behaves_like :kernel_abort, :abort, Kernel
end
Modified: MacRuby/trunk/spec/frozen/core/kernel/at_exit_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/at_exit_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/at_exit_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel.at_exit" do
it "is a private method" do
@@ -14,6 +14,12 @@
code = "at_exit {print 4};at_exit {print 5}; print 6; at_exit {print 7}"
ruby_exe(code).should == "6754"
end
+
+ it "allows calling exit inside at_exit handler" do
+ code = "at_exit {print 3}; at_exit {print 4; exit; print 5}; at_exit {print 6}"
+ ruby_exe(code).should == "643"
+ end
+
end
describe "Kernel#at_exit" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/autoload_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/autoload_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/autoload_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
# These specs only illustrate the basic autoload cases
# and where toplevel autoload behaves differently from
Modified: MacRuby/trunk/spec/frozen/core/kernel/backtick_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/backtick_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/backtick_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#`" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/binding_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/binding_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/binding_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#binding" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/block_given_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/block_given_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/block_given_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe :kernel_block_given, :shared => true do
it "returns true if and only if a block is supplied" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/callcc_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/callcc_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/callcc_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,79 +1,15 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../fixtures/kernel/callcc', __FILE__)
+require File.expand_path('../../../shared/kernel/callcc', __FILE__)
-ruby_version_is "1.9" do
- not_supported_on :jruby do
- require 'continuation'
- end
-end
+with_feature :continuation do
+ describe "Kernel#callcc" do
+ it_behaves_like :kernel_instance_callcc, :callcc
-describe "Kernel#callcc" do
- it "is a private method" do
- Kernel.should have_private_instance_method(:callcc)
+ it_behaves_like :kernel_callcc, :callcc, KernelSpecs::Method.new
end
- it "is possible to exit a loop like a break" do
- i = 0
- Kernel.callcc do |x|
- loop do
- i += 1
- x.call() if i == 5
- end
- end.should == nil
- i.should == 5
+ describe "Kernel.callcc" do
+ it_behaves_like :kernel_callcc, :callcc, Kernel
end
-
- it "is possible to call a continuation multiple times" do
- i = 0
- cont = nil
- @cont = nil
- Kernel.callcc {|cont| @cont = cont}
- i += 1
- @cont.call() if i < 5
- i.should == 5
- end
-
- it "returns the results of a block if continuation is not called" do
- cont = nil
- a = callcc {|cont| 0}
- a.should == 0
- end
-
- it "returns the results of continuation once called" do
- cont = nil
- @cont = nil
- a = callcc {|cont| @cont = cont; 0}
- @cont.call(1) if a == 0
- a.should == 1
- end
-
- it "returns the arguments to call" do
- callcc {|cont| cont.call }.should == nil
- callcc {|cont| cont.call 1 }.should == 1
- callcc {|cont| cont.call 1,2,3 }.should == [1,2,3]
- end
-
- it "preserves changes to block-local scope" do
- i = "before"
- cont = callcc { |c| c }
- if cont # nil the second time
- i = "after"
- cont.call
- end
- i.should == "after"
- end
-
- it "preserves changes to method-local scope" do
- # This spec tests that a continuation shares the same locals
- # tuple as the scope that created it.
- KernelSpecs.before_and_after.should == "after"
- end
-
- it "raises a LocalJumpError if callcc is not given a block" do
- lambda { Kernel.callcc }.should raise_error(LocalJumpError)
- end
end
-
-describe "Kernel.callcc" do
- it "needs to be reviewed for spec completeness"
-end
Modified: MacRuby/trunk/spec/frozen/core/kernel/caller_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/caller_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/caller_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
# DO NOT PUT ANYTHING ABOVE THIS
describe "Kernel#caller" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/case_compare_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/case_compare_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/case_compare_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
module Specs
Modified: MacRuby/trunk/spec/frozen/core/kernel/catch_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/catch_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/catch_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel.catch" do
it "executes its block" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/chomp_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/chomp_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/chomp_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
# FIXME: These methods exist on 1.9 only when the -n or -p option is passed to
# ruby, but we currently don't have a way of specifying that.
Modified: MacRuby/trunk/spec/frozen/core/kernel/chop_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/chop_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/chop_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
# FIXME: These methods exist on 1.9 only when the -n or -p option is passed to
# ruby, but we currently don't have a way of specifying that.
Modified: MacRuby/trunk/spec/frozen/core/kernel/class_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/class_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/class_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#class" do
it "needs to be reviewed for spec completeness"
Modified: MacRuby/trunk/spec/frozen/core/kernel/clone_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/clone_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/clone_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#clone" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/kernel/comparison_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/comparison_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/comparison_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Kernel#<=>" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/define_singleton_method_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/define_singleton_method_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/define_singleton_method_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
ruby_version_is '1.9' do
describe "Kernel#define_singleton_method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/display_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/display_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/display_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#display" do
it "needs to be reviewed for spec completeness"
Modified: MacRuby/trunk/spec/frozen/core/kernel/dup_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/dup_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/dup_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#dup" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/kernel/eql_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/eql_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/eql_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#eql?" do
it "returns true if obj and anObject are the same object." do
Modified: MacRuby/trunk/spec/frozen/core/kernel/equal_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/equal_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/equal_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#equal?" do
it "returns true only if obj and other are the same object" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/equal_value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/equal_value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/equal_value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#==" do
it "returns true only if obj and other are the same object" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/eval_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/eval_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/eval_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
EvalSpecs::A.new.c
Modified: MacRuby/trunk/spec/frozen/core/kernel/exec_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/exec_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/exec_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#exec" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/exit_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/exit_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/exit_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#exit" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/extend_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/extend_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/extend_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
module KernelSpecs::M
def self.extend_object(o)
Modified: MacRuby/trunk/spec/frozen/core/kernel/fail_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/fail_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/fail_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel.fail" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/fixtures/caller_fixture1.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/fixtures/caller_fixture1.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/fixtures/caller_fixture1.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/caller_fixture2'
+require File.expand_path('../caller_fixture2', __FILE__)
2 + 2
3 + 3
CallerFixture.capture do
Modified: MacRuby/trunk/spec/frozen/core/kernel/fixtures/classes.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/fixtures/classes.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/fixtures/classes.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,19 @@
-require File.dirname(__FILE__) + '/caller_fixture1'
+require File.expand_path('../caller_fixture1', __FILE__)
module KernelSpecs
+ class Method
+ def abort(*msg)
+ super
+ end
+ end
+
class Methods
+
+ module MetaclassMethods
+ def peekaboo
+ end
+ end
+
def self.ichi; end
def ni; end
class << self
@@ -145,16 +157,6 @@
end
end
- def self.before_and_after
- i = "before"
- cont = callcc { |c| c }
- if cont # nil the second time
- i = "after"
- cont.call
- end
- i
- end
-
class IVars
def initialize
@secret = 99
Modified: MacRuby/trunk/spec/frozen/core/kernel/fork_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/fork_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/fork_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,12 +1,14 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
-describe "Kernel#fork" do
- it "is a private method" do
- Kernel.should have_private_instance_method(:fork)
+with_feature :fork do
+ describe "Kernel#fork" do
+ it "is a private method" do
+ Kernel.should have_private_instance_method(:fork)
+ end
end
-end
-describe "Kernel.fork" do
- it "needs to be reviewed for spec completeness"
+ describe "Kernel.fork" do
+ it "needs to be reviewed for spec completeness"
+ end
end
Modified: MacRuby/trunk/spec/frozen/core/kernel/format_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/format_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/format_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#format" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/freeze_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/freeze_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/freeze_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#freeze" do
it "prevents self from being further modified" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/frozen_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/frozen_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/frozen_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#frozen?" do
it "returns true if self is frozen" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/getc_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/getc_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/getc_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
ruby_version_is ""..."1.9" do
describe "Kernel#getc" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/gets_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/gets_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/gets_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#gets" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/global_variables_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/global_variables_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/global_variables_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel.global_variables" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/gsub_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/gsub_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/gsub_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
# FIXME: These methods exist on 1.9 only when the -n or -p option is passed to
# ruby, but we currently don't have a way of specifying that.
Modified: MacRuby/trunk/spec/frozen/core/kernel/hash_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/hash_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/hash_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#hash" do
it "needs to be reviewed for spec completeness"
Modified: MacRuby/trunk/spec/frozen/core/kernel/id_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/id_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/id_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#id" do
it "needs to be reviewed for spec completeness"
Modified: MacRuby/trunk/spec/frozen/core/kernel/initialize_copy_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/initialize_copy_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/initialize_copy_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#initialize_copy" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/inspect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/inspect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/inspect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#inspect" do
it "needs to be reviewed for spec completeness"
Modified: MacRuby/trunk/spec/frozen/core/kernel/instance_eval_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/instance_eval_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/instance_eval_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#instance_eval" do
it "expects a block with no arguments" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/instance_of_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/instance_of_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/instance_of_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Kernel#instance_of?" do
it "needs to be reviewed for spec completeness"
Modified: MacRuby/trunk/spec/frozen/core/kernel/instance_variable_defined_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/instance_variable_defined_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/instance_variable_defined_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Kernel#instance_variable_defined?" do
it "needs to be reviewed for spec completeness"
Modified: MacRuby/trunk/spec/frozen/core/kernel/instance_variable_get_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/instance_variable_get_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/instance_variable_get_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#instance_variable_get" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/kernel/instance_variable_set_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/instance_variable_set_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/instance_variable_set_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#instance_variable_set" do
it "sets the value of the specified instance variable" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/instance_variables_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/instance_variables_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/instance_variables_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#instance_variables" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/is_a_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/is_a_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/is_a_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Kernel#is_a?" do
it "needs to be reviewed for spec completeness"
Modified: MacRuby/trunk/spec/frozen/core/kernel/iterator_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/iterator_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/iterator_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#iterator?" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/kind_of_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/kind_of_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/kind_of_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Kernel#kind_of?" do
it "needs to be reviewed for spec completeness"
Modified: MacRuby/trunk/spec/frozen/core/kernel/lambda_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/lambda_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/lambda_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/lambda'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/lambda', __FILE__)
# The functionality of lambdas is specified in core/proc
Modified: MacRuby/trunk/spec/frozen/core/kernel/load_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/load_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/load_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,255 +1,40 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../fixtures/code_loading', __FILE__)
+require File.expand_path('../shared/load', __FILE__)
+require File.expand_path('../shared/require', __FILE__)
-$load_fixture_dir = (File.dirname(__FILE__) + '/../../fixtures/load')
-$LOAD_PATH << $load_fixture_dir
-
-$load_spec_1 = nil
-$load_spec_2 = nil
-$load_spec_3 = nil
-$load_spec_4 = nil
-$load_spec_5 = nil
-$load_spec_6 = nil
-$load_spec_7 = nil
-$load_spec_8 = nil
-$load_spec_9 = nil
-$load_spec_10 = nil
-$load_spec_wrap = nil
-$load_spec_wrap2 = nil
-$load_spec = nil
-$load_spec_rooby = nil
-
-require 'rbconfig'
-
-# The files used below just contain code that assigns
-# Time.now to the respective global variable.
-#
-# The only exception are the _wrap files which contain
-# similarly named classes. The class definitions, in
-# addition, contain another global timestamp assignment.
describe "Kernel#load" do
- it "is a private method" do
- Kernel.should have_private_instance_method(:load)
+ before :each do
+ CodeLoadingSpecs.spec_setup
end
- it "loads a .rb from an absolute path and returns true" do
- path = File.expand_path(File.dirname(__FILE__) + '/../../fixtures/load/load_spec_1.rb')
-
- load(path).should == true
- $load_spec_1.nil?.should == false
+ after :each do
+ CodeLoadingSpecs.spec_cleanup
end
- it "loads a .rb from a relative path and returns true" do
- Dir.chdir($load_fixture_dir) do |dir|
- $load_spec_1 = nil
- load('../../fixtures/load/load_spec_1.rb').should == true
- $load_spec_1.nil?.should == false
-
- $load_spec_1 = nil
- load('./../load/load_spec_1.rb').should == true
- $load_spec_1.nil?.should == false
- end
+ it "is a private method" do
+ Kernel.should have_private_instance_method(:load)
end
- # TODO: add an implementation-agnostic method for creating
- # an extension file
- it "loads extension files"
+ it_behaves_like :kernel_require_basic, :load, CodeLoadingSpecs::Method.new
+end
- it "loads an unqualified .rb by looking in $LOAD_PATH and returns true" do
- load('load_spec_2.rb').should == true
- $load_spec_2.nil?.should == false
- end
-
- it "does not expand/resolve qualified files against $LOAD_PATH" do
- Dir.chdir($load_fixture_dir + '/../') do |dir|
- # This would be a valid path if expanded against the fixture dir
- lambda { load '../load/load_spec_2.rb' }.should raise_error LoadError
- end
- end
-
- it "allows unqualified files to contain path information (just not in the beginning)" do
- name = (File.dirname(__FILE__) + '/../../fixtures')
- $LOAD_PATH << name
-
- $load_spec_2 = nil
- load('load/../load/load_spec_2.rb').should == true
- $load_spec_2.nil?.should == false
-
- $LOAD_PATH.delete name
- end
-
- it "loads a file with no extension as a ruby source file" do
- load('load_spec').should == true
- $load_spec.nil?.should == false
- end
-
- it "loads a file with any extension as a ruby source file" do
- load('load_spec.rooby').should == true
- $load_spec_rooby.nil?.should == false
- end
-
- it "does not create a .rb file for the non-.rb files" do
- load('load_spec').should == true
- load('load_spec.rooby').should == true
-
- File.exist?("#{$load_fixture_dir}/load_spec.rb").should == false
- File.exist?("#{$load_fixture_dir}/load_spec.rooby.rb").should == false
- end
-
- it "does not add the loaded file to $LOADED_FEATURES" do
- $LOADED_FEATURES.grep(/load_spec_3.rb/).should == []
- load('load_spec_3.rb').should == true
- $load_spec_3.nil?.should == false
- $LOADED_FEATURES.grep(/load_spec_3.rb/).should == []
- end
-
- ruby_version_is ""..."1.9" do
- it "returns __FILE__ as a relative path" do
- Dir.chdir($load_fixture_dir) do |dir|
- load('load_spec_4.rb')
- $load_spec_4.first.first.should == './load_spec_4.rb'
- end
- end
- end
-
- ruby_version_is "1.9" do
- it "returns __FILE__ as an absolute path" do
- Dir.chdir($load_fixture_dir) do |dir|
- load('load_spec_4.rb')
- $load_spec_4.first.first.should == File.expand_path('./load_spec_4.rb')
- end
- end
- end
-
- it "produces __FILE__ as the given filename and __LINE__ as the source line number" do
- Dir.chdir($load_fixture_dir) do |dir|
- load('load_spec_4.rb').should == true
- $load_spec_4.first.first.should =~ /load_spec_4\.rb$/
- $load_spec_4.first.last.should == 1
- $load_spec_4.last.first.should =~ /load_spec_4\.rb$/
- $load_spec_4.last.last.should == 10
-
- extended_on :rubinius do
- `rm load_spec_4.rbc`
- end
- end
-
- load("#{$load_fixture_dir}/load_spec_4.rb").should == true
- $load_spec_4[0][0].should =~ %r[^.*/fixtures/load/load_spec_4.rb]
- $load_spec_4[0][1].should == 1
- $load_spec_4[1][0].should =~ %r[^.*/fixtures/load/load_spec_4.rb]
- $load_spec_4[1][1].should == 10
- end
-
- it "reloads the file if invoked on the same filename again, returning true" do
- load('load_spec_4.rb').should == true
- load('load_spec_4.rb').should == true
- end
-
- it "re-evaluates the file each time it is loaded" do
- load('load_spec_5.rb').should == true
- a = $load_spec_5
- load('load_spec_5.rb').should == true
- b = $load_spec_5
-
- a.should_not eql(b)
- end
-
- it "loads the file even if it has already been #required" do
- require('load_spec_6.rb').should == true
- a = $load_spec_6
-
- require('load_spec_6.rb').should == false
- b = $load_spec_6
-
- load('load_spec_6.rb').should == true
- c = $load_spec_6
-
- a.should eql(b)
- c.should_not eql(a)
- end
-
- it "does not cause #require on the same filename to fail" do
- load('load_spec_7.rb').should == true
- a = $load_spec_7
-
- require('load_spec_7.rb').should == true
- b = $load_spec_7
-
- load('load_spec_7.rb').should == true
- c = $load_spec_7
-
- a.should_not eql(b)
- b.should_not eql(c)
- c.should_not eql(a)
- end
-
- it "raises a LoadError if the file can't be found" do
- lambda { load("./nonexistent#{Time.now.to_f}#{$$}") }.should raise_error LoadError
- end
-
- # TODO: This currently fails on Rubinius because the #load logic
- # will take 'load_spec_1' and try 'load_spec_1.rbc' since
- # that is the logic for .rb files.
- it "raises a LoadError if filename given without its extension" do
- lambda { load('load_spec_1') }.should raise_error LoadError
- load('load_spec_1.rb').should == true
- lambda { load('load_spec_1') }.should raise_error LoadError
- end
-
- it "only accepts strings as the filename argument" do
- lambda { load(nil) }.should raise_error TypeError
- lambda { load(42) }.should raise_error TypeError
- lambda { load([]) }.should raise_error TypeError
- end
-
- ruby_version_is "1.9" do
- it "calls #to_path on non-String arguments" do
- p = mock('path')
- p.should_receive(:to_path).and_return 'load_spec_1.rb'
- load(p)
- end
- end
-
- runner_is_not :rspec do
- it "allows wrapping the code in the file in an anonymous module" do
- defined?(LoadSpecWrap).should == nil
- defined?(LoadSpecWrapTwo).should == nil
-
- load('load_spec_wrap.rb').should == true
- $load_spec_wrap.nil?.should == false
- LoadSpecWrap.lsw.should == :lsw
-
- load('load_spec_wrap2.rb', true).should == true
- $load_spec_wrap2.nil?.should == false
- defined?(LoadSpecWrapTwo).should == nil
- end
- end
+describe "Kernel#load" do
+ it_behaves_like :kernel_load, :load, CodeLoadingSpecs::Method.new
end
-describe "Shell expansion in Kernel#load" do
- before :all do
- @rs_home = ENV["HOME"]
- ENV["HOME"] = $load_fixture_dir
- @rs_short = "~/load_spec_1.rb"
- @rs_long = "#{$load_fixture_dir}/load_spec_1.rb"
- end
-
- after :all do
- ENV["HOME"] = @rs_home
- end
-
+describe "Kernel.load" do
before :each do
- $LOADED_FEATURES.delete @rs_long
- $LOADED_FEATURES.delete @rs_short
+ CodeLoadingSpecs.spec_setup
end
- it "expands a preceding ~/ to the user's home directory to use as path" do
- $load_spec_1 = nil
- load(@rs_short).should == true
- $load_spec_1.nil?.should == false
+ after :each do
+ CodeLoadingSpecs.spec_cleanup
end
+
+ it_behaves_like :kernel_require_basic, :load, Kernel
end
-describe "Kernel.load" do
- it "needs to be reviewed for spec completeness"
+describe "Kernel#load" do
+ it_behaves_like :kernel_load, :load, Kernel
end
Modified: MacRuby/trunk/spec/frozen/core/kernel/local_variables_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/local_variables_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/local_variables_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel.local_variables" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/loop_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/loop_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/loop_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel.loop" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/match_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/match_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/match_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#=~" do
it "needs to be reviewed for spec completeness"
Modified: MacRuby/trunk/spec/frozen/core/kernel/method_missing_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/method_missing_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/method_missing_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../shared/kernel/method_missing'
+require File.expand_path('../../../shared/kernel/method_missing', __FILE__)
ruby_version_is ""..."1.9" do
describe "Kernel#method_missing" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/method_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/method_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/method_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/method'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/method', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#method" do
it_behaves_like(:kernel_method, :method)
@@ -26,7 +26,7 @@
m.call.should == :defined
end
- ruby_version_is "1.9.2" do
+ ruby_version_is "1.9" do
it "can be called even if we only repond_to_missing? method, true" do
m = KernelSpecs::RespondViaMissing.new.method(:handled_privately)
m.should be_an_instance_of(Method)
Modified: MacRuby/trunk/spec/frozen/core/kernel/methods_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/methods_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/methods_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
# On Ruby < 1.9 #methods returns an Array of Strings
ruby_version_is ""..."1.9" do
@@ -40,6 +40,13 @@
KernelSpecs::Methods.new.methods.should include("ku", "ni", "juu_san")
end
+ it "returns methods added to the metaclass through extend" do
+ meth = KernelSpecs::Methods.new
+ meth.methods.should_not include("peekaboo")
+ meth.extend(KernelSpecs::Methods::MetaclassMethods)
+ meth.methods.should include("peekaboo")
+ end
+
it "does not return undefined singleton methods defined by obj.meth" do
o = KernelSpecs::Child.new
def o.single; end
@@ -102,6 +109,13 @@
KernelSpecs::Methods.new.methods.should include(:ku, :ni, :juu_san)
end
+ it "returns methods added to the metaclass through extend" do
+ meth = KernelSpecs::Methods.new
+ meth.methods.should_not include(:peekaboo)
+ meth.extend(KernelSpecs::Methods::MetaclassMethods)
+ meth.methods.should include(:peekaboo)
+ end
+
it "does not return undefined singleton methods defined by obj.meth" do
o = KernelSpecs::Child.new
def o.single; end
Modified: MacRuby/trunk/spec/frozen/core/kernel/nil_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/nil_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/nil_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#nil?" do
it "needs to be reviewed for spec completeness"
Modified: MacRuby/trunk/spec/frozen/core/kernel/object_id_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/object_id_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/object_id_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/object_id'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/object_id', __FILE__)
describe "Object.object_id" do
it_behaves_like(:kernel_object_id, :object_id)
Modified: MacRuby/trunk/spec/frozen/core/kernel/open_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/open_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/open_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,78 +1,76 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#open" do
- it "is a private method" do
- Kernel.should have_private_instance_method(:open)
- end
-
+
before :each do
@name = tmp("kernel_open.txt")
touch(@name) { |f| f.write "This is a test" }
+ @file = nil
end
-
+
after :each do
+ @file.close if @file
rm_r @name
end
-
+
+ it "is a private method" do
+ Kernel.should have_private_instance_method(:open)
+ end
+
it "opens a file when given a valid filename" do
@file = open(@name)
@file.should be_kind_of(File)
end
-
+
it "opens a file when called with a block" do
@output = open(@name, "r") { |f| f.gets }
@output.should == "This is a test"
end
-
platform_is_not :windows do
-
it "opens an io when path starts with a pipe" do
@io = open("|date")
@io.should be_kind_of(IO)
end
-
+
it "opens an io when called with a block" do
@output = open("|date") { |f| f.gets }
@output.should_not == ''
end
-
end
platform_is :windows do
-
it "opens an io when path starts with a pipe" do
@io = open("|date /t")
@io.should be_kind_of(IO)
end
-
+
it "opens an io when called with a block" do
@output = open("|date /t") { |f| f.gets }
@output.should_not == ''
end
-
end
-
-
+
it "raises an ArgumentError if not passed one argument" do
lambda { open }.should raise_error(ArgumentError)
end
-
+
ruby_version_is "1.9" do
it "calls #to_open on argument" do
obj = mock('fileish')
- obj.should_receive(:to_open).and_return(File.open(@file))
+ @file = File.open(@name)
+ obj.should_receive(:to_open).and_return(@file)
@file = open(obj)
@file.should be_kind_of(File)
end
-
+
it "raises a TypeError if passed a non-String that does not respond to #to_open" do
obj = mock('non-fileish')
lambda { open(obj) }.should raise_error(TypeError)
lambda { open(nil) }.should raise_error(TypeError)
lambda { open(7) }.should raise_error(TypeError)
- end
+ end
end
ruby_version_is ""..."1.9" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/p_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/p_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/p_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#p" do
before :all do
Modified: MacRuby/trunk/spec/frozen/core/kernel/print_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/print_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/print_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#print" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/printf_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/printf_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/printf_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#printf" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/private_methods_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/private_methods_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/private_methods_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#private_methods" do
ruby_version_is ""..."1.9" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/proc_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/proc_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/proc_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/lambda'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/lambda', __FILE__)
# The functionality of Proc objects is specified in core/proc
Modified: MacRuby/trunk/spec/frozen/core/kernel/protected_methods_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/protected_methods_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/protected_methods_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
# The reason why having include() and ruby_version_is is to show the specification explicitly.
# You should use have_protected_method() with the exception of this spec.
Modified: MacRuby/trunk/spec/frozen/core/kernel/public_method_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/public_method_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/public_method_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/method'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/method', __FILE__)
ruby_version_is "1.9" do
describe "Kernel#public_method" do
@@ -24,7 +24,7 @@
end.should raise_error(NameError)
end
- ruby_version_is "1.9.2" do
+ ruby_version_is "1.9" do
it "raises a NameError if we only repond_to_missing? method, true" do
obj = KernelSpecs::RespondViaMissing.new
lambda do
Modified: MacRuby/trunk/spec/frozen/core/kernel/public_methods_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/public_methods_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/public_methods_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#public_methods" do
ruby_version_is ""..."1.9" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/public_send_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/public_send_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/public_send_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/send'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/send', __FILE__)
ruby_version_is "1.9" do
describe "Kernel#public_send" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/putc_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/putc_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/putc_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#putc" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/puts_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/puts_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/puts_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#puts" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/raise_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/raise_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/raise_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/../../shared/kernel/raise'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../../../shared/kernel/raise', __FILE__)
describe "Kernel#raise" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/rand_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/rand_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/rand_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel.rand" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/readline_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/readline_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/readline_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#readline" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/readlines_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/readlines_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/readlines_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#readlines" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/remove_instance_variable_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/remove_instance_variable_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/remove_instance_variable_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#remove_instance_variable" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/require_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/require_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/require_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,568 +1,36 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../fixtures/code_loading', __FILE__)
+require File.expand_path('../shared/require', __FILE__)
-$require_fixture_dir = (File.dirname(__FILE__) + '/../../fixtures/require')
-$require_tmp_dir = tmp("require_specs")
-$LOAD_PATH << $require_fixture_dir
-$LOAD_PATH << $require_tmp_dir
-
-
-require 'rbconfig'
-
describe "Kernel#require" do
- conflicts_with :Gem do
- # rubygems redefines #require without setting its
- # visibility back to module_function or private
- it "is a private method" do
- Kernel.should have_private_instance_method(:require)
- end
- end
-
- # Avoid storing .rbc in repo
before :each do
- # We explicitly delete and recreate our temporary directories every time
- # to avoid establishing dependencies between tests.
- rm_r $require_tmp_dir
- Dir.mkdir($require_tmp_dir)
- Dir.chdir($require_tmp_dir) {
- touch "require_spec_dummy.#{Config::CONFIG['DLEXT']}"
- touch "require_spec_dummy.rb"
- }
- $LOADED_FEATURES.delete_if {|path| path =~ /require_spec/}
- $require_spec = nil
- $require_spec_1 = nil
- $require_spec_2 = nil
- $require_spec_3 = nil
- $require_spec_4 = nil
- $require_spec_5 = nil
- $require_spec_6 = nil
- $require_spec_7 = nil
- $require_spec_8 = nil
- $require_spec_9 = nil
- $require_spec_10 = nil
- $require_spec_rooby = nil
- $require_spec_recursive = nil
+ CodeLoadingSpecs.spec_setup
end
after :each do
- rm_r $require_tmp_dir
+ CodeLoadingSpecs.spec_cleanup
end
- # The files used below just contain code that assigns
- # Time.now to the respective global variable so that
- # reloads can easily be verified.
-
- # CAUTION: Some of these work because a different path is used to
- # load the same file. Be careful if you change the order
- # or add items.
-
-#######################################
-# PATH RESOLUTION
-#######################################
-
- it "resolves paths relative to the current working directory" do
- Dir.chdir($require_fixture_dir) do |dir|
- require('../../fixtures/require/require_spec_1.rb').should be_true
- $require_spec_1.should_not be_nil
- $LOADED_FEATURES.grep(/require_spec_1\.rb/).size.should == 1
- end
+ # if this fails, update your rubygems
+ it "is a private method" do
+ Kernel.should have_private_instance_method(:require)
end
- ruby_version_is "1.9" do
- # This expectation is necessarily long-winded because the conditions are
- # particularly specific. Namely:
- #
- # * The directory containing the file isn't in $LOAD_PATH
- # * The filename has no path components prepended
- # * The file hasn't already been required
- # * The file exists
- #
- # For reference see [ruby-core:24155] in which matz confirms this feature is
- # intentional for security reasons.
- it "does not resolve completely unqualified filenames against the current working directory unless it appears in $LOAD_PATH" do
- dir = File.join($require_tmp_dir, $$.to_s)
- $LOAD_PATH.include?(dir).should be_false
- File.directory?(dir).should be_false
- Dir.mkdir(dir)
- File.directory?(dir).should be_true
- Dir.chdir(dir) do |tmp_dir|
- file = "#{$$}_#{Process.times.utime}.rb"
- touch file
- File.exist?(file).should be_true
- lambda { require file }.should raise_error(LoadError)
- File.unlink(file)
- end
- Dir.rmdir(dir)
- end
- end
+ it_behaves_like :kernel_require_basic, :require, CodeLoadingSpecs::Method.new
- it "does not expand/resolve qualified files against $LOAD_PATH" do
- num_features = $LOADED_FEATURES.size
- Dir.chdir($require_fixture_dir + '/../') do |dir|
- # This would be a valid path if expanded against the fixture dir
- lambda { require '../require/require_spec_2.rb' }.should raise_error LoadError
- end
- $LOADED_FEATURES.size.should == num_features
- end
-
- it "loads a .rb from an absolute path" do
- path = File.join($require_fixture_dir, 'require_spec_1.rb')
- require(path).should be_true
- $require_spec_1.should_not be_nil
- end
-
- it "collapses consecutive path separators" do
- abs_path = File.join($require_fixture_dir, '/require_spec_1.rb')
- path_parts = File.split(abs_path)
- # Mangle the absolute path so it contains multiple consecutive separator
- # characters, then require it.
- require([
- path_parts[0], File::Separator, path_parts[1]
- ].join(File::Separator)).should be_true
- $require_spec_1.should_not be_nil
- end
-
- # Has been fixed on 1.9.2 HEAD; not backported yet
- ruby_bug "#1627", "1.9.2" do
- ruby_version_is "1.9" do
- platform_is_not :windows do
- it "collapses '../' inside an absolute path" do
- abs_path = File.expand_path(
- File.join($require_fixture_dir, 'require_spec_1.rb'))
- require(abs_path).should be_true
- # Create an absolute path (beginning at a child of the filesystem
- # root), containing '../' (to move to the root), then the real
- # absolute path.
- require("/tmp/../#{abs_path}")
- $LOADED_FEATURES.grep(/require_spec_1\.rb/).should == [abs_path]
- end
- end
-
- # This is untested because I don't have access to a Windows box.
- platform_is :windows do
- it "collapses '../' inside an absolute path" do
- abs_path = File.expand_path(
- File.join($require_fixture_dir, 'require_spec_1.rb'))
- require(abs_path).should be_true
- # Create an absolute path (beginning at a child of the filesystem
- # root), containing '../' (to move to the root), then the real
- # absolute path.
- require("C:\Windows\..\#{abs_path}")
- $require_spec_1.should_not be_nil
- end
- end
- end
- end
-
- it "loads an unqualified .rb by looking in $LOAD_PATH and returning true" do
- require('require_spec_2.rb').should be_true
- $require_spec_2.should_not be_nil
- end
-
- it "allows unqualified files to contain path information (just not in the beginning)" do
- name = (File.dirname(__FILE__) + '/../../fixtures')
- $LOAD_PATH << name
- require('require/../require/require_spec_2.rb').should be_true
- $require_spec_2.should_not be_nil
- end
-
- it "loads a file with ./filename even if . is not in path" do
- Dir.chdir($require_fixture_dir) do |dir|
- path_backup = $LOAD_PATH.clone
- $LOAD_PATH.clear
- $LOAD_PATH << "Someirrelevantpath"
- begin
- require('./require_spec.rb').should be_true
- ensure
- $LOAD_PATH.clear
- $LOAD_PATH.concat(path_backup)
- end
- end
- end
-
-#######################################
-# PATH CANONICALIZATION
-#######################################
-
- # This bug has been fixed on 1.9.2 HEAD.
- ruby_bug "#1627", "1.9.2" do
- ruby_version_is "1.9" do
- it "stores relative paths as absolute paths in $LOADED_FEATURES" do
- Dir.chdir($require_fixture_dir) do |dir|
- abs_path = File.expand_path('../require/require_spec_1.rb')
- require(abs_path).should be_true
- require("../require/require_spec_1.rb").should be_false
- $LOADED_FEATURES.grep(/require_spec_1\.rb/).should == [abs_path]
- end
- end
-
- it "stores ./file paths as absolute paths in $LOADED_FEATURES" do
- Dir.chdir($require_fixture_dir) do |dir|
- abs_path = File.expand_path('./require_spec_1.rb')
- require(abs_path).should be_true
- require("./require_spec_1.rb").should be_false
- $LOADED_FEATURES.grep(/require_spec_1\.rb/).should == [abs_path]
- end
- end
-
- it "performs tilde expansion before storing paths in $LOADED_FEATURES" do
- begin
- original_home = ENV['HOME'].dup
- ENV['HOME'] = $require_fixture_dir
- abs_path = File.expand_path(
- File.join($require_fixture_dir, 'require_spec_1.rb'))
- tilde_path = File.join('~', 'require_spec_1.rb')
- require(tilde_path).should be_true
- $LOADED_FEATURES.grep(/require_spec_1\.rb/).should == [abs_path]
- ensure
- ENV['HOME'] = original_home
- end
- end
-
- it "collapses multiple consecutive path separators before storing in $LOADED_FEATURES" do
- Dir.chdir($require_fixture_dir) do |dir|
- abs_path = File.expand_path('../require/require_spec_1.rb')
- path_parts = File.split(abs_path)
- require([
- path_parts[0], File::Separator, path_parts[1]
- ].join(File::Separator)).should be_true
-
- $LOADED_FEATURES.grep(/require_spec_1\.rb/).should == [abs_path]
- end
- end
-
- platform_is_not :windows do
- it "collapses '../' inside an absolute path before storing in $LOADED_FEATURES" do
- abs_path = File.expand_path(
- File.join($require_fixture_dir, '/require_spec_1.rb'))
- require(abs_path).should be_true
- # Create an absolute path (beginning at a child of the filesystem
- # root), containing '../' (to move to the root), then the real
- # absolute path.
- require("/tmp/../#{abs_path}")
- $LOADED_FEATURES.grep(/require_spec_1\.rb/).should == [abs_path]
- end
- end
-
- # This is untested because I don't have access to a Windows box.
- platform_is :windows do
- it "collapses '../' inside an absolute path before storing in $LOADED_FEATURES" do
- abs_path = File.expand_path(
- File.join($require_fixture_dir, '/require_spec_1.rb'))
- require(abs_path).should be_true
- # Create an absolute path (beginning at a child of the filesystem
- # root), containing '../' (to move to the root), then the real
- # absolute path.
- require("C:\Windows\..\#{abs_path}")
- $LOADED_FEATURES.grep(/require_spec_1\.rb/).should == [abs_path]
- end
- end
- end
- end
-
- it "stores a non-extensioned file with its located suffix" do
- require('require_spec_6').should be_true
- $LOADED_FEATURES.grep(/require_spec_6\.rb/).should_not == []
- end
-
-#######################################
-# FILE EXTENSIONS
-#######################################
-
- it "appends a file with no extension with .rb/.<ext> in that order to locate file" do
- load('require_spec')
- $require_spec.should == :noext
- load('require_spec.rb')
- $require_spec.should == :rb
-
- $require_spec = nil
-
- # 1.9 won't re-require 'require_spec.rb' because it already appears in
- # $LOADED_FEATURES, so we delete it first. On 1.8 this has no effect.
- $LOADED_FEATURES.delete File.expand_path(
- File.join($require_fixture_dir, 'require_spec.rb'))
- require('require_spec')
- $require_spec.should == :rb
- end
-
- it "prefers to use .rb over .<ext> if given non-extensioned file and both exist" do
- require('require_spec_dummy').should be_true
- $LOADED_FEATURES.grep(/require_spec_dummy\.rb/).should_not == []
- $LOADED_FEATURES.grep(/require_spec_dummy\.#{Config::CONFIG['DLEXT']}/).should == []
- end
-
- it "will load file.rb when given 'file' if it exists even if file.<ext> is loaded" do
- $LOADED_FEATURES << "require_spec_3.#{Config::CONFIG['DLEXT']}"
- require('require_spec_3.rb').should be_true
- $LOADED_FEATURES.grep(/require_spec_3\.rb/).should_not == []
- end
-
- it "will not load file.<ext> when given 'file' if file.rb already loaded" do
- require('require_spec_dummy.rb').should be_true
- require('require_spec_dummy').should be_false
- end
-
- it "appends any non-ruby extensioned file with .rb/.<ext> in that order to locate file" do
- load('require_spec.rooby')
- $require_spec_rooby.should == :rooby
- load('require_spec.rooby.rb')
- $require_spec_rooby.should == :rb
-
- $require_spec_rooby = nil
-
- require('require_spec.rooby')
- $require_spec_rooby.should == :rb
- end
-
- # TODO: add an implementation-agnostic method for creating
- # an extension file
- it "loads extension files"
-
- # TODO: add an implementation-agnostic method for creating
- # an extension file
- it "will load explicit file.<ext> even if file.rb already loaded and vice versa"
-
-
-#######################################
-# $LOADED_FEATURES
-#######################################
-
- it "stores the loaded file in $LOADED_FEATURES" do
- require('require_spec_6.rb').should be_true
- $LOADED_FEATURES.grep(/require_spec_6\.rb/).should_not == []
- end
-
- runner_is_not :rspec do
- it "will not add a bad load to LOADED_FEATURES" do
- lambda { require('require_spec_raises') }.should raise_error(RuntimeError)
-
- $LOADED_FEATURES.grep(/require_spec_raises\.rb/).should == []
- end
- end
-
-
- it "uses $LOADED_FEATURES to see whether file is already loaded" do
- require('require_spec_7.rb').should be_true
-
- $LOADED_FEATURES.delete_if {|path| path =~ /require_spec_7\.rb$/}
- require('require_spec_7.rb').should be_true
- require('require_spec_7.rb').should be_false
-
- $LOADED_FEATURES.grep(/require_spec_7\.rb/).should_not == []
- end
-
- it "will not load a file whose path appears in $LOADED_FEATURES; it will return false" do
- # This wording is necessarily precise because 1.8 and 1.9 perform
- # different forms of normalisation before storing the path in
- # $LOADED_FEATURES. We deliberately don't concern ourselves with the form
- # of the saved path; just that an approximation of it has been recorded.
- require('require_spec_7.rb').should be_true
- a = $require_spec_7
- a.should_not be_nil
-
- $LOADED_FEATURES.grep(/require_spec_7.rb/).should_not == []
-
- require('require_spec_7.rb').should be_false
- b = $require_spec_7
- b.should_not be_nil
-
- # Timestamps should not differ
- a.should eql(b)
-
- $LOADED_FEATURES.grep(/require_spec_7\.rb/).should_not == []
- end
-
-#######################################
-# ERROR BEHAVIOUR
-#######################################
-
- it "requires arbitrarily complex files (files with large numbers of AST nodes)" do
- lambda {require File.expand_path(File.dirname(__FILE__)) + '/fixtures/test'}.should_not raise_error
- end
-
- it "raises a LoadError if the file can't be found" do
- lambda { require "nonesuch#{$$}#{Time.now.to_f}" }.should raise_error LoadError
- end
-
- platform_is_not :os => [:windows, :cygwin] do # can't make file unreadable
- it "raises a LoadError if the file exists but can't be read" do
- abs_path = File.expand_path(File.join($require_tmp_dir, 'require_spec_dummy.rb'))
- File.exists?(abs_path).should be_true
- file = File.new(abs_path)
- begin
- file.chmod(0000)
- lambda {require(abs_path)}.should raise_error(LoadError)
- ensure
- file.close
- end
- end
- end
-
- ruby_version_is ""..."1.9" do
- it "only accepts strings and objects with #to_str" do
- lambda { require(nil) }.should raise_error(TypeError)
- lambda { require(42) }.should raise_error(TypeError)
- lambda { require([]) }.should raise_error(TypeError)
-
- # objects with to_s are not good enough
- o = mock('require_spec_dummy');
- o.should_receive(:to_s).any_number_of_times.and_return("require_spec_dummy")
- lambda { require(o) }.should raise_error(TypeError)
-
- # objects with to_path are not good enough
- o = mock('require_spec_dummy');
- o.should_receive(:to_path).any_number_of_times.and_return("require_spec_dummy")
- lambda { require(o) }.should raise_error(TypeError)
- end
- end
-
- ruby_version_is "1.9" do
- it "only accepts string or objects with #to_path or #to_str" do
- lambda { require(nil) }.should raise_error(TypeError)
- lambda { require(42) }.should raise_error(TypeError)
- lambda { require([]) }.should raise_error(TypeError)
- end
-
- it "calls #to_path on non-String arguments" do
- abs_path = File.expand_path(
- File.join($require_fixture_dir, 'require_spec.rb'))
- path = mock('abs_path')
- path.should_receive(:to_path).and_return(abs_path)
- require(path).should be_true
- $LOADED_FEATURES.include?(abs_path).should be_true
- end
-
- it "does not call #to_path on String arguments" do
- abs_path = File.expand_path(
- File.join($require_fixture_dir, 'require_spec.rb'))
-
- def abs_path.to_path
- 'blah-non-existing-path'
- end
- require(abs_path).should be_true
- $LOADED_FEATURES.include?(abs_path).should be_true
- end
-
- it "calls #to_str on non-String objects returned by #to_path" do
- abs_path = File.expand_path(
- File.join($require_fixture_dir, 'require_spec.rb'))
-
- non_string_path = mock("non_string_path")
- non_string_path.should_receive(:to_str).and_return(abs_path)
-
- path = mock('path')
- path.should_receive(:to_path).and_return(non_string_path)
-
- require(path).should be_true
- $LOADED_FEATURES.include?(abs_path).should be_true
- end
- end
-
- it "calls #to_str on non-String arguments" do
- abs_path = File.expand_path(
- File.join($require_fixture_dir, 'require_spec.rb'))
- o = mock('require_spec');
- o.should_receive(:to_str).and_return(abs_path)
- $LOADED_FEATURES.include?(abs_path).should be_false
- require(o).should be_true
- $LOADED_FEATURES.include?(abs_path).should be_true
-
- nil_mock = mock('nil')
- nil_mock.should_receive(:to_str).at_least(1).and_return(nil)
- lambda { require(nil_mock) }.should raise_error(TypeError)
- end
-
- it "does not infinite loop on an rb file that requires itself" do
- $LOADED_FEATURES.grep(/require_spec_recursive\.rb/).should == []
- require('require_spec_recursive').should be_true
- $LOADED_FEATURES.grep(/require_spec_recursive.rb/).should_not == []
- $require_spec_recursive.should_not be_false
- end
-
-#######################################
-# __FILE__ / __LINE__
-#######################################
-
- ruby_version_is ""..."1.9" do
- it "produces __FILE__ as the given filename and __LINE__ as the source line number" do
- Dir.chdir($require_fixture_dir) do |dir|
- require('require_spec_4').should be_true
- $require_spec_4.should == [['./require_spec_4.rb', 1], ['./require_spec_4.rb', 10]]
-
- extended_on :rubinius do
- `rm require_spec_4.rbc`
- end
- end
-
- $require_spec_4 = nil
-
- require("#{$require_fixture_dir}/require_spec_4").should be_true
- $require_spec_4[0][0].should =~ %r[^.*/fixtures/require/require_spec_4.rb]
- $require_spec_4[0][1].should == 1
- $require_spec_4[1][0].should =~ %r[^.*/fixtures/require/require_spec_4.rb]
- $require_spec_4[1][1].should == 10
- end
- end
-
- ruby_version_is "1.9" do
- it "produces __FILE__ as the given filename and __LINE__ as the source line number" do
- abs_path = File.expand_path(
- File.join($require_fixture_dir, 'require_spec_4.rb'))
- Dir.chdir($require_fixture_dir) do |dir|
- require('require_spec_4').should be_true
- $require_spec_4.should == [[abs_path, 1], [abs_path, 10]]
-
- extended_on :rubinius do
- `rm require_spec_4.rbc`
- end
- end
-
- $require_spec_4 = nil
- $LOADED_FEATURES.delete abs_path
- require('require_spec_4').should be_true
- $require_spec_4[0][0].should =~ %r[^.*/fixtures/require/require_spec_4.rb]
- $require_spec_4[0][1].should == 1
- $require_spec_4[1][0].should =~ %r[^.*/fixtures/require/require_spec_4.rb]
- $require_spec_4[1][1].should == 10
- end
- end
+ it_behaves_like :kernel_require, :require, CodeLoadingSpecs::Method.new
end
-describe "Shell expansion in Kernel#require" do
- before :all do
- @rs_home = ENV["HOME"]
- ENV["HOME"] = $require_fixture_dir
- @rs_short = "~/require_spec_1.rb"
- @rs_long = "#{$require_fixture_dir}/require_spec_1.rb"
- @rs_abs = File.expand_path(@rs_long)
- end
-
- after :all do
- ENV["HOME"] = @rs_home
- end
-
+describe "Kernel.require" do
before :each do
- [@rs_long, @rs_short, @rs_abs].each do |path|
- $LOADED_FEATURES.delete path
- end
+ CodeLoadingSpecs.spec_setup
end
- it "expands a preceding ~/ to the user's home directory for building the path to search" do
- $require_spec_1 = nil
- require(@rs_short).should == true
- $require_spec_1.nil?.should == false
+ after :each do
+ CodeLoadingSpecs.spec_cleanup
end
- it "adds the path to $LOADED_FEATURES" do
- $require_spec_1 = nil
- require(@rs_short).should == true
- $require_spec_1.nil?.should == false
+ it_behaves_like :kernel_require_basic, :require, Kernel
- $LOADED_FEATURES.find {|f|
- f == @rs_short || f == @rs_long || f == @rs_abs
- }.nil?.should == false
- end
+ it_behaves_like :kernel_require, :require, Kernel
end
-
-describe "Kernel.require" do
- it "needs to be reviewed for spec completeness"
-end
Modified: MacRuby/trunk/spec/frozen/core/kernel/respond_to_missing_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/respond_to_missing_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/respond_to_missing_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
ruby_version_is "1.9" do
describe "Kernel#respond_to_missing?" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/respond_to_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/respond_to_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/respond_to_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel.respond_to?" do
it "indicates if a singleton object responds to a particular message" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/scan_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/scan_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/scan_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
ruby_version_is ""..."1.9" do
describe "Kernel#scan" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/select_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/select_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/select_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#select" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/send_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/send_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/send_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/send'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/send', __FILE__)
describe "Kernel#send" do
it "invokes the named public method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/set_trace_func_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/set_trace_func_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/set_trace_func_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#set_trace_func" do
it "is a private method" do
Added: MacRuby/trunk/spec/frozen/core/kernel/shared/abort.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/shared/abort.rb (rev 0)
+++ MacRuby/trunk/spec/frozen/core/kernel/shared/abort.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -0,0 +1,22 @@
+describe :kernel_abort, :shared => true do
+ before :each do
+ @stderr, $stderr = $stderr, IOStub.new
+ end
+
+ after :each do
+ $stderr = @stderr
+ end
+
+ it "raises a SystemExit exception" do
+ lambda { @object.abort }.should raise_error(SystemExit)
+ end
+
+ it "sets the exception status code of of 1" do
+ lambda { @object.abort }.should raise_error { |e| e.status.should == 1 }
+ end
+
+ it "prints the specified message to STDERR" do
+ lambda { @object.abort "a message" }.should raise_error(SystemExit)
+ $stderr.should =~ /a message/
+ end
+end
Added: MacRuby/trunk/spec/frozen/core/kernel/shared/load.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/shared/load.rb (rev 0)
+++ MacRuby/trunk/spec/frozen/core/kernel/shared/load.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -0,0 +1,91 @@
+describe :kernel_load, :shared => true do
+ before :each do
+ CodeLoadingSpecs.spec_setup
+ @path = File.expand_path "load_fixture.rb", CODE_LOADING_DIR
+ end
+
+ after :each do
+ CodeLoadingSpecs.spec_cleanup
+ end
+
+ it "loads a non-extensioned file as a Ruby source file" do
+ path = File.expand_path "load_fixture", CODE_LOADING_DIR
+ @object.load(path).should be_true
+ ScratchPad.recorded.should == [:no_ext]
+ end
+
+ it "loads a non .rb extensioned file as a Ruby source file" do
+ path = File.expand_path "load_fixture.ext", CODE_LOADING_DIR
+ @object.load(path).should be_true
+ ScratchPad.recorded.should == [:no_rb_ext]
+ end
+
+ it "loads a file that recursively requires itself" do
+ path = File.expand_path "recursive_require_fixture.rb", CODE_LOADING_DIR
+ @object.load(path).should be_true
+ ScratchPad.recorded.should == [:loaded, :loaded]
+ end
+
+ it "loads a file that recursively loads itself" do
+ path = File.expand_path "recursive_load_fixture.rb", CODE_LOADING_DIR
+ @object.load(path).should be_true
+ ScratchPad.recorded.should == [:loaded, :loaded]
+ end
+
+ it "loads a file each time the method is called" do
+ @object.load(@path).should be_true
+ @object.load(@path).should be_true
+ ScratchPad.recorded.should == [:loaded, :loaded]
+ end
+
+ it "loads a file even when the name appears in $LOADED_FEATURES" do
+ $LOADED_FEATURES << @path
+ @object.load(@path).should be_true
+ ScratchPad.recorded.should == [:loaded]
+ end
+
+ it "loads a file that has been loaded by #require" do
+ @object.require(@path).should be_true
+ @object.load(@path).should be_true
+ ScratchPad.recorded.should == [:loaded, :loaded]
+ end
+
+ it "does not cause #require with the same path to fail" do
+ @object.load(@path).should be_true
+ @object.require(@path).should be_true
+ ScratchPad.recorded.should == [:loaded, :loaded]
+ end
+
+ it "does not add the loaded path to $LOADED_FEATURES" do
+ @object.load(@path).should be_true
+ $LOADED_FEATURES.should == []
+ end
+
+ it "raises a LoadError if passed a non-extensioned path that does not exist but a .rb extensioned path does exist" do
+ path = File.expand_path "load_ext_fixture", CODE_LOADING_DIR
+ lambda { @object.load(path) }.should raise_error(LoadError)
+ end
+
+ it "sets the enclosing scope to an anonymous module if passed true for 'wrap'" do
+ path = File.expand_path "wrap_fixture.rb", CODE_LOADING_DIR
+ @object.load(path, true).should be_true
+ Object.const_defined?(:LoadSpecWrap).should be_false
+ ScratchPad.recorded.first.should =~ /::LoadSpecWrap$/
+ end
+
+ describe "(shell expansion)" do
+ before :all do
+ @env_home = ENV["HOME"]
+ ENV["HOME"] = CODE_LOADING_DIR
+ end
+
+ after :all do
+ ENV["HOME"] = @env_home
+ end
+
+ it "expands a tilde to the HOME environment variable as the path to load" do
+ @object.require("~/load_fixture.rb").should be_true
+ ScratchPad.recorded.should == [:loaded]
+ end
+ end
+end
Modified: MacRuby/trunk/spec/frozen/core/kernel/shared/method.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/shared/method.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/shared/method.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe :kernel_method, :shared => true do
it "returns a method object for a valid method" do
@@ -15,7 +15,7 @@
m.call.should == 'class done'
end
- ruby_version_is "1.9.2" do
+ ruby_version_is "1.9" do
it "returns a method object if we repond_to_missing? method" do
class KernelSpecs::Foo;
def respond_to_missing?(method, priv=false)
Added: MacRuby/trunk/spec/frozen/core/kernel/shared/require.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/shared/require.rb (rev 0)
+++ MacRuby/trunk/spec/frozen/core/kernel/shared/require.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -0,0 +1,482 @@
+describe :kernel_require_basic, :shared => true do
+ describe "(path resolution)" do
+ it "loads an absolute path" do
+ path = File.expand_path "load_fixture.rb", CODE_LOADING_DIR
+ @object.send(@method, path).should be_true
+ ScratchPad.recorded.should == [:loaded]
+ end
+
+ it "loads a non-canonical absolute path" do
+ dir, file = File.split(File.expand_path("load_fixture.rb", CODE_LOADING_DIR))
+ path = File.join dir, ["..", "code"], file
+ @object.send(@method, path).should be_true
+ ScratchPad.recorded.should == [:loaded]
+ end
+
+ it "loads a file defining many methods" do
+ path = File.expand_path "methods_fixture.rb", CODE_LOADING_DIR
+ @object.send(@method, path).should be_true
+ ScratchPad.recorded.should == [:loaded]
+ end
+
+ it "raises a LoadError if the file does not exist" do
+ path = File.expand_path "nonexistent.rb", CODE_LOADING_DIR
+ File.exists?(path).should be_false
+ lambda { @object.send(@method, path) }.should raise_error(LoadError)
+ ScratchPad.recorded.should == []
+ end
+
+ # Can't make a file unreadable on these platforms
+ platform_is_not :os => [:windows, :cygwin] do
+ describe "with an unreadable file" do
+ before :each do
+ @path = tmp("unreadable_file.rb")
+ touch @path
+ File.chmod 0000, @path
+ end
+
+ after :each do
+ File.chmod 0666, @path
+ rm_r @path
+ end
+
+ it "raises a LoadError" do
+ File.exists?(@path).should be_true
+ lambda { @object.send(@method, @path) }.should raise_error(LoadError)
+ end
+ end
+ end
+
+ it "calls #to_str on non-String objects" do
+ path = File.expand_path "load_fixture.rb", CODE_LOADING_DIR
+ name = mock("load_fixture.rb mock")
+ name.should_receive(:to_str).and_return(path)
+ @object.send(@method, name).should be_true
+ ScratchPad.recorded.should == [:loaded]
+ end
+
+ it "raises a TypeError if passed nil" do
+ lambda { @object.send(@method, nil) }.should raise_error(TypeError)
+ end
+
+ it "raises a TypeError if passed a Fixnum" do
+ lambda { @object.send(@method, 42) }.should raise_error(TypeError)
+ end
+
+ it "raises a TypeError if passed an Array" do
+ lambda { @object.send(@method, []) }.should raise_error(TypeError)
+ end
+
+ it "raises a TypeError if passed an object that does not provide #to_str" do
+ lambda { @object.send(@method, mock("not a filename")) }.should raise_error(TypeError)
+ end
+
+ it "raises a TypeError if passed an object that has #to_s but not #to_str" do
+ name = mock("load_fixture.rb mock")
+ name.stub!(:to_s).and_return("load_fixture.rb")
+ $LOAD_PATH << "."
+ Dir.chdir CODE_LOADING_DIR do
+ lambda { @object.send(@method, name) }.should raise_error(TypeError)
+ end
+ end
+
+ it "raises a TypeError if #to_str does not return a String" do
+ name = mock("#to_str returns nil")
+ name.should_receive(:to_str).at_least(1).times.and_return(nil)
+ lambda { @object.send(@method, name) }.should raise_error(TypeError)
+ end
+
+ ruby_version_is "".."1.9" do
+ it "raises a TypeError if passed an object that has #to_path but not #to_str" do
+ name = mock("load_fixture.rb mock")
+ name.stub!(:to_path).and_return("load_fixture.rb")
+ $LOAD_PATH << "."
+ Dir.chdir CODE_LOADING_DIR do
+ lambda { @object.send(@method, name) }.should raise_error(TypeError)
+ end
+ end
+ end
+
+ ruby_version_is "1.9" do
+ it "calls #to_path on non-String objects" do
+ name = mock("load_fixture.rb mock")
+ name.stub!(:to_path).and_return("load_fixture.rb")
+ $LOAD_PATH << "."
+ Dir.chdir CODE_LOADING_DIR do
+ @object.send(@method, name).should be_true
+ end
+ ScratchPad.recorded.should == [:loaded]
+ end
+
+ it "does not call #to_path on a String" do
+ path = File.expand_path "load_fixture.rb", CODE_LOADING_DIR
+ path.should_not_receive(:to_path)
+ @object.send(@method, path).should be_true
+ ScratchPad.recorded.should == [:loaded]
+ end
+
+ it "calls #to_str on non-String objects returned by #to_path" do
+ path = File.expand_path "load_fixture.rb", CODE_LOADING_DIR
+ name = mock("load_fixture.rb mock")
+ to_path = mock("load_fixture_rb #to_path mock")
+ name.should_receive(:to_path).and_return(to_path)
+ to_path.should_receive(:to_str).and_return(path)
+ @object.send(@method, name).should be_true
+ ScratchPad.recorded.should == [:loaded]
+ end
+ end
+
+ ruby_bug "http://redmine.ruby-lang.org/issues/show/2578", "1.8" do
+ it "loads a ./ relative path from the current working directory with empty $LOAD_PATH" do
+ Dir.chdir CODE_LOADING_DIR do
+ @object.send(@method, "./load_fixture.rb").should be_true
+ end
+ ScratchPad.recorded.should == [:loaded]
+ end
+
+ it "loads a ../ relative path from the current working directory with empty $LOAD_PATH" do
+ Dir.chdir CODE_LOADING_DIR do
+ @object.send(@method, "../code/load_fixture.rb").should be_true
+ end
+ ScratchPad.recorded.should == [:loaded]
+ end
+ end
+
+ it "loads a ./ relative path from the current working directory with non-empty $LOAD_PATH" do
+ $LOAD_PATH << "an_irrelevant_dir"
+ Dir.chdir CODE_LOADING_DIR do
+ @object.send(@method, "./load_fixture.rb").should be_true
+ end
+ ScratchPad.recorded.should == [:loaded]
+ end
+
+ it "loads a ../ relative path from the current working directory with non-empty $LOAD_PATH" do
+ $LOAD_PATH << "an_irrelevant_dir"
+ Dir.chdir CODE_LOADING_DIR do
+ @object.send(@method, "../code/load_fixture.rb").should be_true
+ end
+ ScratchPad.recorded.should == [:loaded]
+ end
+
+ it "loads a non-canonical path from the current working directory with non-empty $LOAD_PATH" do
+ $LOAD_PATH << "an_irrelevant_dir"
+ Dir.chdir CODE_LOADING_DIR do
+ @object.send(@method, "../code/../code/load_fixture.rb").should be_true
+ end
+ ScratchPad.recorded.should == [:loaded]
+ end
+
+ it "resolves a filename against $LOAD_PATH entries" do
+ $LOAD_PATH << CODE_LOADING_DIR
+ @object.send(@method, "load_fixture.rb").should be_true
+ ScratchPad.recorded.should == [:loaded]
+ end
+
+ it "does not resolve a ./ relative path against $LOAD_PATH entries" do
+ $LOAD_PATH << CODE_LOADING_DIR
+ lambda do
+ @object.send(@method, "./load_fixture.rb")
+ end.should raise_error(LoadError)
+ ScratchPad.recorded.should == []
+ end
+
+ it "does not resolve a ../ relative path against $LOAD_PATH entries" do
+ $LOAD_PATH << CODE_LOADING_DIR
+ lambda do
+ @object.send(@method, "../code/load_fixture.rb")
+ end.should raise_error(LoadError)
+ ScratchPad.recorded.should == []
+ end
+
+ it "resolves a non-canonical path against $LOAD_PATH entries" do
+ $LOAD_PATH << File.dirname(CODE_LOADING_DIR)
+ @object.send(@method, "code/../code/load_fixture.rb").should be_true
+ ScratchPad.recorded.should == [:loaded]
+ end
+
+ it "loads a path with duplicate path separators" do
+ $LOAD_PATH << "."
+ sep = File::Separator + File::Separator
+ path = ["..", "code", "load_fixture.rb"].join(sep)
+ Dir.chdir CODE_LOADING_DIR do
+ @object.send(@method, path).should be_true
+ end
+ ScratchPad.recorded.should == [:loaded]
+ end
+ end
+end
+
+describe :kernel_require, :shared => true do
+ describe "(path resolution)" do
+ ruby_version_is "1.9" do
+ # For reference see [ruby-core:24155] in which matz confirms this feature is
+ # intentional for security reasons.
+ it "does not load a bare filename unless the current working directory is in $LOAD_PATH" do
+ Dir.chdir CODE_LOADING_DIR do
+ lambda { @object.require("load_fixture.rb") }.should raise_error(LoadError)
+ ScratchPad.recorded.should == []
+ end
+ end
+
+ it "does not load a relative path unless the current working directory is in $LOAD_PATH" do
+ Dir.chdir File.dirname(CODE_LOADING_DIR) do
+ lambda do
+ @object.require("code/load_fixture.rb")
+ end.should raise_error(LoadError)
+ ScratchPad.recorded.should == []
+ end
+ end
+ end
+
+ it "loads a file that recursively requires itself" do
+ path = File.expand_path "recursive_require_fixture.rb", CODE_LOADING_DIR
+ @object.require(path).should be_true
+ ScratchPad.recorded.should == [:loaded]
+ end
+ end
+
+ describe "(file extensions)" do
+ it "loads a .rb extensioned file when passed a non-extensioned path" do
+ path = File.expand_path "load_fixture", CODE_LOADING_DIR
+ File.exists?(path).should be_true
+ @object.require(path).should be_true
+ ScratchPad.recorded.should == [:loaded]
+ end
+
+ it "loads a .rb extensioned file when a C-extension file of the same name is loaded" do
+ $LOADED_FEATURES << File.expand_path("load_fixture.bundle", CODE_LOADING_DIR)
+ $LOADED_FEATURES << File.expand_path("load_fixture.dylib", CODE_LOADING_DIR)
+ $LOADED_FEATURES << File.expand_path("load_fixture.so", CODE_LOADING_DIR)
+ $LOADED_FEATURES << File.expand_path("load_fixture.dll", CODE_LOADING_DIR)
+ path = File.expand_path "load_fixture", CODE_LOADING_DIR
+ @object.require(path).should be_true
+ ScratchPad.recorded.should == [:loaded]
+ end
+
+ it "does not load a C-extension file if a .rb extensioned file is already loaded" do
+ $LOADED_FEATURES << File.expand_path("load_fixture.rb", CODE_LOADING_DIR)
+ path = File.expand_path "load_fixture", CODE_LOADING_DIR
+ @object.require(path).should be_false
+ ScratchPad.recorded.should == []
+ end
+
+ it "loads a .rb extensioned file when passed a non-.rb extensioned path" do
+ path = File.expand_path "load_fixture.ext", CODE_LOADING_DIR
+ File.exists?(path).should be_true
+ @object.require(path).should be_true
+ ScratchPad.recorded.should == [:loaded]
+ end
+
+ it "loads a .rb extensioned file when a complex-extensioned C-extension file of the same name is loaded" do
+ $LOADED_FEATURES << File.expand_path("load_fixture.ext.bundle", CODE_LOADING_DIR)
+ $LOADED_FEATURES << File.expand_path("load_fixture.ext.dylib", CODE_LOADING_DIR)
+ $LOADED_FEATURES << File.expand_path("load_fixture.ext.so", CODE_LOADING_DIR)
+ $LOADED_FEATURES << File.expand_path("load_fixture.ext.dll", CODE_LOADING_DIR)
+ path = File.expand_path "load_fixture.ext", CODE_LOADING_DIR
+ @object.require(path).should be_true
+ ScratchPad.recorded.should == [:loaded]
+ end
+
+ it "does not load a C-extension file if a complex-extensioned .rb file is already loaded" do
+ $LOADED_FEATURES << File.expand_path("load_fixture.ext.rb", CODE_LOADING_DIR)
+ path = File.expand_path "load_fixture.ext", CODE_LOADING_DIR
+ @object.require(path).should be_false
+ ScratchPad.recorded.should == []
+ end
+ end
+
+ describe "($LOAD_FEATURES)" do
+ before :each do
+ @path = File.expand_path("load_fixture.rb", CODE_LOADING_DIR)
+ end
+
+ it "stores an absolute path" do
+ @object.require(@path).should be_true
+ $LOADED_FEATURES.should == [@path]
+ end
+
+ it "does not store the path if the load fails" do
+ $LOAD_PATH << CODE_LOADING_DIR
+ lambda { @object.require("raise_fixture.rb") }.should raise_error(RuntimeError)
+ $LOADED_FEATURES.should == []
+ end
+
+ it "does not load an absolute path that is already stored" do
+ $LOADED_FEATURES << @path
+ @object.require(@path).should be_false
+ ScratchPad.recorded.should == []
+ end
+
+ it "does not load a ./ relative path that is already stored" do
+ $LOADED_FEATURES << "./load_fixture.rb"
+ Dir.chdir CODE_LOADING_DIR do
+ @object.require("./load_fixture.rb").should be_false
+ end
+ ScratchPad.recorded.should == []
+ end
+
+ it "does not load a ../ relative path that is already stored" do
+ $LOADED_FEATURES << "../load_fixture.rb"
+ Dir.chdir CODE_LOADING_DIR do
+ @object.require("../load_fixture.rb").should be_false
+ end
+ ScratchPad.recorded.should == []
+ end
+
+ it "does not load a non-canonical path that is already stored" do
+ $LOADED_FEATURES << "code/../code/load_fixture.rb"
+ $LOAD_PATH << File.dirname(CODE_LOADING_DIR)
+ @object.require("code/../code/load_fixture.rb").should be_false
+ ScratchPad.recorded.should == []
+ end
+
+ ruby_version_is "".."1.9" do
+ it "stores ./ relative paths as passed in" do
+ $LOAD_PATH << "an_irrelevant_dir"
+ Dir.chdir CODE_LOADING_DIR do
+ @object.require("./load_fixture.rb").should be_true
+ end
+ $LOADED_FEATURES.should == ["./load_fixture.rb"]
+ end
+
+ it "stores ../ relative paths as passed in" do
+ $LOAD_PATH << "an_irrelevant_dir"
+ Dir.chdir CODE_LOADING_DIR do
+ @object.require("../code/load_fixture.rb").should be_true
+ end
+ $LOADED_FEATURES.should == ["../code/load_fixture.rb"]
+ end
+
+ it "does not collapse duplicate path separators" do
+ $LOAD_PATH << "."
+ sep = File::Separator + File::Separator
+ path = ["..", "code", "load_fixture.rb"].join(sep)
+ Dir.chdir CODE_LOADING_DIR do
+ @object.require(path).should be_true
+ end
+ $LOADED_FEATURES.should == [path]
+ end
+
+ it "adds the suffix of the resolved filename" do
+ $LOAD_PATH << CODE_LOADING_DIR
+ @object.require("load_fixture").should be_true
+ $LOADED_FEATURES.should == ["load_fixture.rb"]
+ end
+
+ it "loads a non-canonical path for a file already loaded" do
+ $LOADED_FEATURES << @path
+ $LOAD_PATH << File.dirname(CODE_LOADING_DIR)
+ @object.require("code/../code/load_fixture.rb").should be_true
+ ScratchPad.recorded.should == [:loaded]
+ end
+
+ it "loads a ./ relative path for a file already loaded" do
+ $LOADED_FEATURES << @path
+ $LOAD_PATH << "an_irrelevant_dir"
+ Dir.chdir CODE_LOADING_DIR do
+ @object.require("./load_fixture.rb").should be_true
+ end
+ ScratchPad.recorded.should == [:loaded]
+ end
+
+ it "loads a ../ relative path for a file already loaded" do
+ $LOADED_FEATURES << @path
+ $LOAD_PATH << "an_irrelevant_dir"
+ Dir.chdir CODE_LOADING_DIR do
+ @object.require("../code/load_fixture.rb").should be_true
+ end
+ ScratchPad.recorded.should == [:loaded]
+ end
+ end
+
+ ruby_version_is "1.9" do
+ it "stores ../ relative paths as absolute paths" do
+ Dir.chdir CODE_LOADING_DIR do
+ @object.require("../code/load_fixture.rb").should be_true
+ end
+ $LOADED_FEATURES.should == [@path]
+ end
+
+ it "stores ./ relative paths as absolute paths" do
+ Dir.chdir CODE_LOADING_DIR do
+ @object.require("./load_fixture.rb").should be_true
+ end
+ $LOADED_FEATURES.should == [@path]
+ end
+
+ it "collapses duplicate path separators" do
+ $LOAD_PATH << "."
+ sep = File::Separator + File::Separator
+ path = ["..", "code", "load_fixture.rb"].join(sep)
+ Dir.chdir CODE_LOADING_DIR do
+ @object.require(path).should be_true
+ end
+ $LOADED_FEATURES.should == [@path]
+ end
+
+ it "canonicalizes non-unique absolute paths" do
+ dir, file = File.split(File.expand_path("load_fixture.rb", CODE_LOADING_DIR))
+ path = File.join dir, ["..", "code"], file
+ @object.require(path).should be_true
+ $LOADED_FEATURES.should == [@path]
+ end
+
+ it "adds the suffix of the resolved filename" do
+ $LOAD_PATH << CODE_LOADING_DIR
+ @object.require("load_fixture").should be_true
+ $LOADED_FEATURES.should == [@path]
+ end
+
+ it "does not load a non-canonical path for a file already loaded" do
+ $LOADED_FEATURES << @path
+ $LOAD_PATH << File.dirname(CODE_LOADING_DIR)
+ @object.require("code/../code/load_fixture.rb").should be_false
+ ScratchPad.recorded.should == []
+ end
+
+ it "does not load a ./ relative path for a file already loaded" do
+ $LOADED_FEATURES << @path
+ $LOAD_PATH << "an_irrelevant_dir"
+ Dir.chdir CODE_LOADING_DIR do
+ @object.require("./load_fixture.rb").should be_false
+ end
+ ScratchPad.recorded.should == []
+ end
+
+ it "does not load a ../ relative path for a file already loaded" do
+ $LOADED_FEATURES << @path
+ $LOAD_PATH << "an_irrelevant_dir"
+ Dir.chdir CODE_LOADING_DIR do
+ @object.require("../code/load_fixture.rb").should be_false
+ end
+ ScratchPad.recorded.should == []
+ end
+ end
+ end
+
+ describe "(shell expansion)" do
+ before :all do
+ @env_home = ENV["HOME"]
+ ENV["HOME"] = CODE_LOADING_DIR
+ end
+
+ after :all do
+ ENV["HOME"] = @env_home
+ end
+
+ ruby_version_is "".."1.9" do
+ it "does not perform tilde expansion before storing paths in $LOADED_FEATURES" do
+ @object.require("~/load_fixture.rb").should be_true
+ $LOADED_FEATURES.should == ["~/load_fixture.rb"]
+ end
+ end
+
+ ruby_version_is "1.9" do
+ it "performs tilde expansion before storing paths in $LOADED_FEATURES" do
+ path = File.expand_path("load_fixture.rb", CODE_LOADING_DIR)
+ @object.require("~/load_fixture.rb").should be_true
+ $LOADED_FEATURES.should == [path]
+ end
+ end
+ end
+end
Modified: MacRuby/trunk/spec/frozen/core/kernel/singleton_method_added_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/singleton_method_added_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/singleton_method_added_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/../../shared/kernel/singleton_method_added'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../../../shared/kernel/singleton_method_added', __FILE__)
ruby_version_is ""..."1.9" do
describe "Kernel#singleton_method_added" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/singleton_method_removed_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/singleton_method_removed_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/singleton_method_removed_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/kernel/singleton_method_removed'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/kernel/singleton_method_removed', __FILE__)
ruby_version_is ""..."1.9" do
describe "Kernel#singleton_method_removed" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/singleton_method_undefined_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/singleton_method_undefined_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/singleton_method_undefined_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../shared/kernel/singleton_method_undefined'
+require File.expand_path('../../../shared/kernel/singleton_method_undefined', __FILE__)
ruby_version_is ""..."1.9" do
describe "Kernel#singleton_method_undefined" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/singleton_methods_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/singleton_methods_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/singleton_methods_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
# Prior to MRI 1.9 #singleton_methods returned an Array of Strings
ruby_version_is ""..."1.9" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/sleep_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/sleep_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/sleep_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#sleep" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/spawn_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/spawn_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/spawn_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Kernel.spawn" do
@@ -13,18 +13,20 @@
it "executes the given command" do
File.exists?(@f).should be_false
pid = spawn("ruby -e 'print :spawn' >#{@f}")
- sleep 0.1
+ Process.wait pid
File.exists?(@f).should be_true
File.read(@f).should == "spawn"
end
it "executes the given command as a new process" do
pid = spawn("ruby -v >#{@f}")
+ Process.wait pid
pid.should_not == Process.pid
end
it "returns the process ID of the new process as a Fixnum" do
pid = spawn("ruby -v >#{@f}")
+ Process.wait pid
pid.should be_an_instance_of(Fixnum)
end
@@ -32,34 +34,38 @@
start = Time.now
pid = spawn('ruby -e "sleep 10"')
(Time.now - start).should < 1
+ Process.kill :KILL, pid
+ Process.wait pid
end
it "sets the child's environment variables according to a supplied hash" do
- pid = spawn({:spawn_of_ruby => 'yes'}, "ruby -e 'print ENV[\"spawn_of_ruby\"]' >#{@f}")
- sleep 0.1
+ pid = spawn({"spawn_of_ruby" => 'yes'}, "ruby -e 'print ENV[\"spawn_of_ruby\"]' >#{@f}")
+ Process.wait pid
File.exists?(@f).should be_true
File.read(@f).should == "yes"
end
- it "joins the current process group by default" do
- pid = spawn("ruby -e 'print Process.getpgid(Process.pid)' >#{@f}")
- sleep 0.1
- File.exists?(@f).should be_true
- pgid = File.read(@f).to_i
- pgid.should == Process.getpgid(Process.pid)
- end
+ platform_is_not :windows do
+ it "joins the current process group by default" do
+ pid = spawn("ruby -e 'print Process.getpgid(Process.pid)' >#{@f}")
+ Process.wait pid
+ File.exists?(@f).should be_true
+ pgid = File.read(@f).to_i
+ pgid.should == Process.getpgid(Process.pid)
+ end
- it "joins a new process group if :pgroup => true" do
- pid = spawn("ruby -e 'print Process.getpgid(Process.pid)' >#{@f}", {:pgroup => true})
- sleep 0.1
- File.exists?(@f).should be_true
- pgid = File.read(@f).to_i
- pgid.should_not == Process.getpgid(Process.pid)
+ it "joins a new process group if :pgroup => true" do
+ pid = spawn("ruby -e 'print Process.getpgid(Process.pid)' >#{@f}", {:pgroup => true})
+ Process.wait pid
+ File.exists?(@f).should be_true
+ pgid = File.read(@f).to_i
+ pgid.should_not == Process.getpgid(Process.pid)
+ end
end
it "uses the current working directory as its working directory" do
- pid = spawn("ruby -e 'print Dir.pwd' >#{@f}")
- sleep 0.1
+ pid = spawn("ruby -e 'print Dir.pwd' >#{@f}")
+ Process.wait pid
File.exists?(@f).should be_true
File.read(@f).should == Dir.pwd
end
@@ -67,22 +73,24 @@
it "uses the given working directory if :chdir => dir is supplied" do
dir = File.expand_path('../')
dir.should_not == Dir.pwd
- pid = spawn("ruby -e 'print Dir.pwd' >#{@f}", {:chdir => dir})
- sleep 0.1
+ pid = spawn("ruby -e 'print Dir.pwd' >#{@f}", {:chdir => dir})
+ Process.wait pid
File.exists?(@f).should be_true
File.read(@f).should == dir
end
it "redirects STDERR to the given file descriptior if if :err => Fixnum" do
- fd = File.open(@f,'w').fileno
- spawn("ruby -e 'warn(:glark)'", {:err => fd})
- sleep 0.1
+ file = File.open(@f,'w')
+ fd = file.fileno
+ pid = spawn("ruby -e 'warn(:glark)'", {:err => fd})
+ Process.wait pid
File.read(@f).should =~ /glark/
+ file.close
end
it "redirects STDERR to the given file if :err => String" do
- spawn("ruby -e 'warn(:glark)'", {:err => @f})
- sleep 0.1
+ pid = spawn("ruby -e 'warn(:glark)'", {:err => @f})
+ Process.wait pid
File.read(@f).should =~ /glark/
end
Modified: MacRuby/trunk/spec/frozen/core/kernel/split_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/split_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/split_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
ruby_version_is ""..."1.9" do
describe "Kernel#split" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/sprintf_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/sprintf_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/sprintf_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#sprintf" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/srand_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/srand_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/srand_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel.srand" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/sub_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/sub_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/sub_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
# FIXME: These methods exist on 1.9 only when the -n or -p option is passed to
# ruby, but we currently don't have a way of specifying that.
Modified: MacRuby/trunk/spec/frozen/core/kernel/syscall_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/syscall_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/syscall_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#syscall" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/system_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/system_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/system_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#system" do
@@ -58,7 +58,11 @@
before :each do
ENV['TEST_SH_EXPANSION'] = 'foo'
- @shell_var = platform_is(:windows) ? '%TEST_SH_EXPANSION%' : '$TEST_SH_EXPANSION'
+ @shell_var = '$TEST_SH_EXPANSION'
+ platform_is :windows do
+ @shell_var = '%TEST_SH_EXPANSION%'
+ end
+
@helper_script = KernelSpecs.helper_script
end
Modified: MacRuby/trunk/spec/frozen/core/kernel/taint_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/taint_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/taint_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#taint" do
it "sets self to be tainted" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/tainted_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/tainted_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/tainted_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#tainted?" do
it "returns true if Object is tainted" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/tap_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/tap_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/tap_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
ruby_version_is "1.8.7" do
describe "Kernel#tap" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/test_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/test_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/test_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#test" do
before :all do
Modified: MacRuby/trunk/spec/frozen/core/kernel/throw_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/throw_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/throw_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel.throw" do
it "transfers control to the end of the active catch block waiting for symbol" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/to_a_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/to_a_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/to_a_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
ruby_version_is ""..."1.9" do
describe "Kernel#to_a" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/to_s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/to_s_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/to_s_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#to_s" do
it "needs to be reviewed for spec completeness"
Modified: MacRuby/trunk/spec/frozen/core/kernel/trace_var_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/trace_var_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/trace_var_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#trace_var" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/trap_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/trap_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/trap_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#trap" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/trust_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/trust_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/trust_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#trust" do
ruby_version_is "1.9" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/type_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/type_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/type_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#type" do
it "needs to be reviewed for spec completeness"
Modified: MacRuby/trunk/spec/frozen/core/kernel/untaint_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/untaint_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/untaint_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#untaint" do
it "needs to be reviewed for spec completeness"
Modified: MacRuby/trunk/spec/frozen/core/kernel/untrace_var_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/untrace_var_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/untrace_var_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#untrace_var" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/untrust_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/untrust_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/untrust_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#untrusted?" do
ruby_version_is "1.9" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/untrusted_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/untrusted_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/untrusted_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#untrusted?" do
ruby_version_is "1.9" do
Modified: MacRuby/trunk/spec/frozen/core/kernel/warn_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/kernel/warn_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/kernel/warn_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel.warn" do
it "is a private method" do
Modified: MacRuby/trunk/spec/frozen/core/marshal/dump_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/marshal/dump_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/marshal/dump_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/marshal_data'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/marshal_data', __FILE__)
mv = [Marshal::MAJOR_VERSION].pack 'C'
nv = [Marshal::MINOR_VERSION].pack 'C'
@@ -201,6 +201,21 @@
end
end
+ it "favors marshal_dump over _dump" do
+ m = mock("marshaled")
+ m.should_receive(:marshal_dump).and_return(0)
+ m.should_not_receive(:_dump)
+
+ Marshal.dump(m)
+ end
+
+ it "does not use Class#name when using marshal_dump" do
+ u = UserMarshalWithClassName.new
+
+ m = Marshal.dump(u)
+ m.index(u.class.name).should be_nil
+ end
+
ruby_version_is ""..."1.9" do
it "dumps an array containing the same objects" do
s = 'oh'; b = 'hi'; r = //; d = [b, :no, s, :go]; c = String
Modified: MacRuby/trunk/spec/frozen/core/marshal/fixtures/marshal_data.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/marshal/fixtures/marshal_data.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/marshal/fixtures/marshal_data.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -80,6 +80,12 @@
def ==(other) self.class === other and @data == other.data end
end
+class UserMarshalWithClassName < UserMarshal
+ def self.name
+ "Never::A::Real::Class"
+ end
+end
+
class UserMarshalWithIvar
attr_reader :data
Modified: MacRuby/trunk/spec/frozen/core/marshal/load_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/marshal/load_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/marshal/load_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/marshal_data'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/marshal_data', __FILE__)
describe "Marshal::load" do
it "loads a extended_struct having fields with same objects" do
@@ -112,6 +112,11 @@
obj
end
+ it "raises an ArgumentError when the dumped data is truncated" do
+ obj = {:first => 1, :second => 2, :third => 3}
+ lambda { Marshal.load(Marshal.dump(obj)[0, 5]) }.should raise_error(ArgumentError)
+ end
+
ruby_version_is "1.9" do
it "returns the value of the proc when called with a proc" do
Marshal.load(Marshal.dump([1,2]), proc { [3,4] }).should == [3,4]
@@ -286,6 +291,17 @@
obj
end
+ it "preserves hash ivars when hash contains a string having ivar" do
+ s = 'string'
+ s.instance_variable_set :@string_ivar, 'string ivar'
+ h = { :key => s }
+ h.instance_variable_set :@hash_ivar, 'hash ivar'
+
+ unmarshalled = Marshal.load Marshal.dump(h)
+ unmarshalled.instance_variable_get(:@hash_ivar).should == 'hash ivar'
+ unmarshalled[:key].instance_variable_get(:@string_ivar).should == 'string ivar'
+ end
+
it "raises a TypeError with bad Marshal version" do
marshal_data = '\xff\xff'
marshal_data[0] = (Marshal::MAJOR_VERSION).chr
Modified: MacRuby/trunk/spec/frozen/core/marshal/restore_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/marshal/restore_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/marshal/restore_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/matchdata/begin_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/matchdata/begin_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/matchdata/begin_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "MatchData#begin" do
it "returns the offset of the start of the nth element" do
Modified: MacRuby/trunk/spec/frozen/core/matchdata/captures_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/matchdata/captures_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/matchdata/captures_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "MatchData#captures" do
it "returns an array of the match captures" do
Modified: MacRuby/trunk/spec/frozen/core/matchdata/element_reference_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/matchdata/element_reference_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/matchdata/element_reference_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "MatchData#[]" do
it "acts as normal array indexing [index]" do
Modified: MacRuby/trunk/spec/frozen/core/matchdata/end_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/matchdata/end_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/matchdata/end_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "MatchData#end" do
it "returns the offset of the end of the nth element" do
Modified: MacRuby/trunk/spec/frozen/core/matchdata/eql_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/matchdata/eql_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/matchdata/eql_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/eql'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/eql', __FILE__)
ruby_version_is "1.9" do
describe "MatchData#eql?" do
Modified: MacRuby/trunk/spec/frozen/core/matchdata/equal_value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/matchdata/equal_value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/matchdata/equal_value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/eql'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/eql', __FILE__)
ruby_version_is "1.9" do
describe "MatchData#==" do
Modified: MacRuby/trunk/spec/frozen/core/matchdata/initialize_copy_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/matchdata/initialize_copy_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/matchdata/initialize_copy_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/matchdata/inspect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/matchdata/inspect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/matchdata/inspect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1,19 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
+
+describe "MatchData#inspect" do
+ before :each do
+ @match_data = /(.)(.)(\d+)(\d)/.match("THX1138.")
+ end
+
+ it "returns a String" do
+ @match_data.inspect.should be_kind_of(String)
+ end
+
+ ruby_version_is '1.8.7' do
+ it "returns a human readable representation that contains entire matched string and the captures" do
+ # yeah, hardcoding the inspect output is not ideal, but in this case
+ # it makes perfect sense. See JRUBY-4558 for example.
+ @match_data.inspect.should == '#<MatchData "HX1138" 1:"H" 2:"X" 3:"113" 4:"8">'
+ end
+ end
+end
Modified: MacRuby/trunk/spec/frozen/core/matchdata/length_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/matchdata/length_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/matchdata/length_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/length'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/length', __FILE__)
describe "MatchData#length" do
it_behaves_like(:matchdata_length, :length)
Modified: MacRuby/trunk/spec/frozen/core/matchdata/names_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/matchdata/names_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/matchdata/names_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
# MacRuby does not support named captures yet.
#language_version __FILE__, "names"
Modified: MacRuby/trunk/spec/frozen/core/matchdata/offset_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/matchdata/offset_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/matchdata/offset_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "MatchData#offset" do
it "returns a two element array with the begin and end of the nth match" do
Modified: MacRuby/trunk/spec/frozen/core/matchdata/post_match_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/matchdata/post_match_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/matchdata/post_match_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "MatchData#post_match" do
it "returns the string after the match equiv. special var $'" do
Modified: MacRuby/trunk/spec/frozen/core/matchdata/pre_match_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/matchdata/pre_match_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/matchdata/pre_match_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "MatchData#pre_match" do
it "returns the string before the match, equiv. special var $`" do
Modified: MacRuby/trunk/spec/frozen/core/matchdata/regexp_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/matchdata/regexp_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/matchdata/regexp_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.8.8" do
describe "MatchData#regexp" do
Modified: MacRuby/trunk/spec/frozen/core/matchdata/select_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/matchdata/select_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/matchdata/select_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is ""..."1.9" do
describe "MatchData#select" do
Modified: MacRuby/trunk/spec/frozen/core/matchdata/shared/eql.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/matchdata/shared/eql.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/matchdata/shared/eql.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe :matchdata_eql, :shared => true do
it "returns true if both operands have equal target strings, patterns, and match positions" do
Modified: MacRuby/trunk/spec/frozen/core/matchdata/size_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/matchdata/size_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/matchdata/size_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/length'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/length', __FILE__)
describe "MatchData#size" do
it_behaves_like(:matchdata_length, :size)
Modified: MacRuby/trunk/spec/frozen/core/matchdata/string_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/matchdata/string_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/matchdata/string_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "MatchData#string" do
it "returns a copy of the match string" do
Modified: MacRuby/trunk/spec/frozen/core/matchdata/to_a_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/matchdata/to_a_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/matchdata/to_a_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "MatchData#to_a" do
it "returns an array of matches" do
Modified: MacRuby/trunk/spec/frozen/core/matchdata/to_s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/matchdata/to_s_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/matchdata/to_s_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "MatchData#to_s" do
it "returns the entire matched string" do
Modified: MacRuby/trunk/spec/frozen/core/matchdata/values_at_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/matchdata/values_at_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/matchdata/values_at_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "MatchData#values_at" do
it "returns an array of the matching value" do
Modified: MacRuby/trunk/spec/frozen/core/matchdata/versions/names_1.9.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/matchdata/versions/names_1.9.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/matchdata/versions/names_1.9.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe "MatchData#names" do
it "returns an Array" do
Modified: MacRuby/trunk/spec/frozen/core/math/acos_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/math/acos_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/math/acos_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
# arccosine : (-1.0, 1.0) --> (0, PI)
describe "Math.acos" do
Modified: MacRuby/trunk/spec/frozen/core/math/acosh_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/math/acosh_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/math/acosh_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Math.acosh" do
it "returns a float" do
Modified: MacRuby/trunk/spec/frozen/core/math/asin_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/math/asin_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/math/asin_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
# arcsine : (-1.0, 1.0) --> (-PI/2, PI/2)
describe "Math.asin" do
Modified: MacRuby/trunk/spec/frozen/core/math/asinh_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/math/asinh_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/math/asinh_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Math.asinh" do
it "returns a float" do
Modified: MacRuby/trunk/spec/frozen/core/math/atan2_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/math/atan2_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/math/atan2_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Math.atan2" do
it "returns a float" do
Modified: MacRuby/trunk/spec/frozen/core/math/atan_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/math/atan_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/math/atan_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
# arctangent : (-Inf, Inf) --> (-PI/2, PI/2)
describe "Math.atan" do
Modified: MacRuby/trunk/spec/frozen/core/math/atanh_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/math/atanh_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/math/atanh_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,86 +1,14 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../fixtures/math/common', __FILE__)
+require File.expand_path('../../../shared/math/atanh', __FILE__)
describe "Math.atanh" do
- it "returns a float" do
- Math.atanh(0.5).should be_an_instance_of(Float)
- end
-
- it "returns the inverse hyperbolic tangent of the argument" do
- Math.atanh(0.0).should == 0.0
- Math.atanh(-0.0).should == -0.0
- Math.atanh(0.5).should be_close(0.549306144334055, TOLERANCE)
- Math.atanh(-0.2).should be_close(-0.202732554054082, TOLERANCE)
- end
-
- platform_is :darwin, :freebsd, :java do
- ruby_version_is ""..."1.9" do
- it "returns Infinity for 1.0" do
- Math.atanh(1.0).infinite?.should == 1
- end
-
- it "returns -Infinity for -1.0" do
- Math.atanh(-1.0).infinite?.should == -1
- end
- end
-
- ruby_version_is "1.9" do
- it "raises an Errno::EDOM if x = 1.0" do
- lambda { Math.atanh(1.0) }.should raise_error(Errno::EDOM)
- end
-
- it "raises an Errno::EDOM if x = -1.0" do
- lambda { Math.atanh(-1.0) }.should raise_error(Errno::EDOM)
- end
- end
- end
-
- platform_is :windows, :linux, :openbsd do
- # jruby is cross-platform and behaves as :darwin above
- not_compliant_on :jruby do
- it "raises an Errno::EDOM if x = 1.0" do
- lambda { Math.atanh(1.0) }.should raise_error(Errno::EDOM)
- end
-
- it "raises an Errno::EDOM if x = -1.0" do
- lambda { Math.atanh(-1.0) }.should raise_error(Errno::EDOM)
- end
- end
- end
-
- conflicts_with :Complex do
- it "raises an Errno::EDOM if the passed argument is greater than 1.0" do
- lambda { Math.atanh(1.0 + TOLERANCE) }.should raise_error(Errno::EDOM)
- end
-
- it "raises an Errno::EDOM if the passed argument is less than -1.0" do
- lambda { Math.atanh(-1.0 - TOLERANCE) }.should raise_error(Errno::EDOM)
- end
- end
-
- ruby_version_is ""..."1.9" do
- it "raises an ArgumentError if the argument cannot be coerced with Float()" do
- lambda { Math.atanh("test") }.should raise_error(ArgumentError)
- end
- end
-
- ruby_version_is "1.9" do
- it "raises a TypeError if the argument cannot be coerced with Float()" do
- lambda { Math.atanh("test") }.should raise_error(TypeError)
- end
- end
-
- it "raises a TypeError if the argument is nil" do
- lambda { Math.atanh(nil) }.should raise_error(TypeError)
- end
-
- it "accepts any argument that can be coerced with Float()" do
- Math.atanh(MathSpecs::Float.new(0.5)).infinite?.should be_nil
- end
+ it_behaves_like :math_atanh_base, :atanh, Math
+ it_behaves_like :math_atanh_no_complex, :atanh, Math
end
describe "Math#atanh" do
- it "is accessible as a private instance method" do
- IncludesMath.new.send(:atanh, 0.1415).should be_close(0.14245589281616, TOLERANCE)
- end
+ it_behaves_like :math_atanh_private, :atanh
+ it_behaves_like :math_atanh_base, :atanh, IncludesMath.new
+ it_behaves_like :math_atanh_no_complex, :atanh, IncludesMath.new
end
Modified: MacRuby/trunk/spec/frozen/core/math/constants_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/math/constants_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/math/constants_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Math::PI" do
it "approximates the value of pi" do
Modified: MacRuby/trunk/spec/frozen/core/math/cos_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/math/cos_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/math/cos_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
# cosine : (-Inf, Inf) --> (-1.0, 1.0)
describe "Math.cos" do
Modified: MacRuby/trunk/spec/frozen/core/math/cosh_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/math/cosh_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/math/cosh_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Math.cosh" do
it "returns a float" do
Modified: MacRuby/trunk/spec/frozen/core/math/erf_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/math/erf_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/math/erf_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
# erf method is the "error function" encountered in integrating the normal
# distribution (which is a normalized form of the Gaussian function).
Modified: MacRuby/trunk/spec/frozen/core/math/erfc_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/math/erfc_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/math/erfc_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
# erfc is the complementary error function
describe "Math.erfc" do
Modified: MacRuby/trunk/spec/frozen/core/math/exp_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/math/exp_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/math/exp_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Math.exp" do
it "returns a float" do
Modified: MacRuby/trunk/spec/frozen/core/math/frexp_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/math/frexp_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/math/frexp_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Math.frexp" do
it "returns the normalized fraction and exponent" do
Modified: MacRuby/trunk/spec/frozen/core/math/gamma_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/math/gamma_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/math/gamma_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,39 +1,71 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Math.gamma" do
- it "returns a float" do
- Math.gamma(2).should be_kind_of(Float)
- end
-
- it "returns well-known values" do
- # These are theoretically known precise values
+ it "returns +infinity given 0" do
Math.gamma(0).infinite?.should == 1
- Math.gamma(0.5).should be_close(Math.sqrt(Math::PI), TOLERANCE)
- Math.gamma(1).should be_close(1.0, TOLERANCE)
- Math.gamma(6.0).should be_close(120.0, TOLERANCE)
- Math.gamma(1.0/0).infinite?.should == 1
end
- it "returns good numerical approximations" do
- Math.gamma( 3.2) .should be_close( 2.423965, TOLERANCE)
- Math.gamma(-2.15).should be_close( -2.999619, TOLERANCE)
- Math.gamma( 0.00001).should be_close( 99999.422794, TOLERANCE)
- Math.gamma(-0.00001).should be_close(-100000.577225, TOLERANCE)
+ it "returns Math.sqrt(Math::PI) given 0.5" do
+ Math.gamma(0.5).should be_close(Math.sqrt(Math::PI), TOLERANCE)
end
- it "raises Domain Error on negative integers" do
- lambda { Math.gamma(-1) }.should raise_error(Errno::EDOM)
- lambda { Math.gamma(-2.0) }.should raise_error(Errno::EDOM)
+ # stop at n=23 because 23! is too big to fit in a IEEE 754 double
+ f = 1
+ 2.upto(23) do |n|
+ it "returns #{n-1}! given #{n}" do
+ Math.gamma(n).should be_close(f*=(n-1), TOLERANCE)
+ end
end
- it "raises Domain Error given negative infinity" do
- lambda { Math.gamma(-1.0/0) }.should raise_error(Errno::EDOM)
+ it "returns good numerical approximation for gamma(3.2)" do
+ Math.gamma(3.2) .should be_close(2.423965, TOLERANCE)
end
-
+
+ it "returns good numerical approximation for gamma(-2.15)" do
+ Math.gamma(-2.15).should be_close(-2.999619, TOLERANCE)
+ end
+
+ it "returns good numerical approximation for gamma(0.00001)" do
+ Math.gamma(0.00001).should be_close(99999.422794, TOLERANCE)
+ end
+
+ it "returns good numerical approximation for gamma(-0.00001)" do
+ Math.gamma(-0.00001).should be_close(-100000.577225, TOLERANCE)
+ end
+
+ ruby_version_is ""..."1.9" do
+ it "raises Domain Error given -1" do
+ lambda { Math.gamma(-1) }.should raise_error(Errno::EDOM)
+ end
+ end
+
+ ruby_version_is "1.9" do
+ it "raises Math::DomainError given -1" do
+ lambda { Math.gamma(-1) }.should raise_error(Math::DomainError)
+ end
+ end
+
+ # See http://redmine.ruby-lang.org/issues/show/2189
+ it "returns +infinity given +infinity" do
+ Math.gamma(infinity_value).infinite?.should == 1
+ end
+
+ ruby_version_is ""..."1.9" do
+ it "raises Domain Error given negative infinity" do
+ lambda { Math.gamma(-infinity_value) }.should raise_error(Errno::EDOM)
+ end
+ end
+
+ ruby_version_is "1.9" do
+ it "raises Math::DomainError given negative infinity" do
+ lambda { Math.gamma(-infinity_value) }.should raise_error(Math::DomainError)
+ end
+ end
+
it "returns NaN given NaN" do
- Math.gamma(0.0/0).nan?.should be_true
+ Math.gamma(nan_value).nan?.should be_true
end
end
-end
\ No newline at end of file
+end
Modified: MacRuby/trunk/spec/frozen/core/math/hypot_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/math/hypot_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/math/hypot_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Math.hypot" do
it "returns a float" do
Modified: MacRuby/trunk/spec/frozen/core/math/ldexp_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/math/ldexp_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/math/ldexp_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Math.ldexp" do
it "returns a float" do
Modified: MacRuby/trunk/spec/frozen/core/math/lgamma_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/math/lgamma_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/math/lgamma_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,44 +1,85 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Math.lgamma" do
- it "returns an array of 2 elements" do
- lg = Math.lgamma(0)
- lg.should be_kind_of(Array)
- lg.size.should == 2
+ it "returns [Infinity, 1] when passed 0" do
+ Math.lgamma(0).should == [infinity_value, 1]
end
- it "returns known values" do
- Math.lgamma(0).should == [1.0/0, 1]
- Math.lgamma(-1).should == [1.0/0, 1]
+ it "returns [Infinity, 1] when passed -1" do
+ Math.lgamma(-1).should == [infinity_value, 1]
+ end
+
+ it "returns [log(sqrt(PI)), 1] when passed 0.5" do
lg1 = Math.lgamma(0.5)
lg1[0].should be_close(Math.log(Math.sqrt(Math::PI)), TOLERANCE)
lg1[1].should == 1
-
+ end
+
+ it "returns [log(2/3*PI, 1] when passed 6.0" do
lg2 = Math.lgamma(6.0)
lg2[0].should be_close(Math.log(120.0), TOLERANCE)
lg2[1].should == 1
end
- it "returns good numerical approximations" do
+ it "returns an approximate value when passed -0.5" do
lg1 = Math.lgamma(-0.5)
lg1[0].should be_close(1.2655121, TOLERANCE)
lg1[1].should == -1
-
+ end
+
+ it "returns an approximate value when passed -1.5" do
lg2 = Math.lgamma(-1.5)
lg2[0].should be_close(0.8600470, TOLERANCE)
lg2[1].should == 1
end
-
- it "returns correct values given +/- infinity" do
- Math.lgamma( 1.0/0).should == [1.0/0, 1]
- Math.lgamma(-1.0/0).should == [1.0/0, 1]
+
+ ruby_version_is ""..."1.9" do
+ it "returns [Infinity, 1] when passed -Infinity" do
+ Math.lgamma(-infinity_value).should == [infinity_value, 1]
+ end
end
-
- it "returns correct value given NaN" do
- Math.lgamma(0.0/0)[0].nan?.should be_true
- Math.lgamma(0.0/0)[1].should == 1
+
+ ruby_version_is "1.9" do
+ it "raises Math::DomainError when passed -Infinity" do
+ lambda { Math.lgamma(-infinity_value) }.should raise_error(Math::DomainError)
+ end
end
+ # Note: see related issue http://redmine.ruby-lang.org/issues/show/2189
+ # If you would like to see simpler Ruby behavior, lobby for Ruby to
+ # have platform-independent Math functions.
+ ruby_version_is ""..."1.9" do
+ platform_is_not :darwin do
+ it "returns [Infinity, 1] when passed Infinity" do
+ Math.lgamma(-infinity_value).should == [infinity_value, 1]
+ end
+ end
+ end
+
+ # Note: see related issue http://redmine.ruby-lang.org/issues/show/2189
+ # If you would like to see simpler Ruby behavior, lobby for Ruby to
+ # have platform-independent Math functions.
+ ruby_version_is ""..."1.9" do
+ platform_is :darwin do
+ # JRuby has platform-independent math and behaves as above
+ not_compliant_on :jruby do
+ it "raises an Errno::EDOM when passed Infinity" do
+ lambda { Math.lgamma(infinity_value) }.should raise_error(Errno::EDOM)
+ end
+ end
+ end
+ end
+
+ ruby_version_is "1.9" do
+ it "returns [Infinity, 1] when passed Infinity" do
+ Math.lgamma(infinity_value).should == [infinity_value, 1]
+ end
+ end
+
+ it "returns [NaN, 1] when passed NaN" do
+ Math.lgamma(nan_value)[0].nan?.should be_true
+ Math.lgamma(nan_value)[1].should == 1
+ end
end
-end
\ No newline at end of file
+end
Modified: MacRuby/trunk/spec/frozen/core/math/log10_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/math/log10_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/math/log10_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
# The common logarithm, having base 10
describe "Math.log10" do
Modified: MacRuby/trunk/spec/frozen/core/math/log2_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/math/log2_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/math/log2_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
extended_on :rubinius do
describe "Math.log2" do
Modified: MacRuby/trunk/spec/frozen/core/math/log_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/math/log_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/math/log_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
# The natural logarithm, having base Math::E
describe "Math.log" do
Modified: MacRuby/trunk/spec/frozen/core/math/sin_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/math/sin_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/math/sin_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
# sine : (-Inf, Inf) --> (-1.0, 1.0)
describe "Math.sin" do
Modified: MacRuby/trunk/spec/frozen/core/math/sinh_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/math/sinh_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/math/sinh_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Math.sinh" do
it "returns a float" do
Modified: MacRuby/trunk/spec/frozen/core/math/sqrt_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/math/sqrt_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/math/sqrt_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Math.sqrt" do
it "returns a float" do
Modified: MacRuby/trunk/spec/frozen/core/math/tan_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/math/tan_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/math/tan_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Math.tan" do
it "returns a float" do
Modified: MacRuby/trunk/spec/frozen/core/math/tanh_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/math/tanh_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/math/tanh_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Math.tanh" do
it "returns a float" do
Modified: MacRuby/trunk/spec/frozen/core/method/arity_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/method/arity_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/method/arity_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Method#arity" do
before(:each) do
@@ -14,6 +14,13 @@
@m.method(:two_req).arity.should == 2
end
+ it "returns n, where n is the number of required arguments and method created via defined_method" do
+ @m.method(:zero_defined_method).arity.should == 0
+ @m.method(:one_req_defined_method).arity.should == 1
+ @m.method(:two_req_defined_method).arity.should == 2
+ @m.method(:zero_with_splat_defined_method).arity.should == -1
+ end
+
it "returns -(n+1), where n is the number of required arguments, when there is at least one optional argument" do
@m.method(:one_opt).arity.should == -1
@m.method(:one_req_one_opt).arity.should == -2
Modified: MacRuby/trunk/spec/frozen/core/method/call_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/method/call_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/method/call_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/call'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/call', __FILE__)
describe "Method#call" do
it_behaves_like(:method_call, :call)
Modified: MacRuby/trunk/spec/frozen/core/method/clone_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/method/clone_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/method/clone_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Method#clone" do
it "returns a copy of the method" do
Modified: MacRuby/trunk/spec/frozen/core/method/element_reference_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/method/element_reference_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/method/element_reference_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/call'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/call', __FILE__)
describe "Method#[]" do
it_behaves_like(:method_call, :[])
Modified: MacRuby/trunk/spec/frozen/core/method/eql_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/method/eql_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/method/eql_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/eql'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/eql', __FILE__)
ruby_version_is "1.9" do
describe "Method#eql?" do
Modified: MacRuby/trunk/spec/frozen/core/method/equal_value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/method/equal_value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/method/equal_value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/eql'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/eql', __FILE__)
describe "Method#==" do
it_behaves_like(:method_equal, :==)
Modified: MacRuby/trunk/spec/frozen/core/method/fixtures/classes.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/method/fixtures/classes.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/method/fixtures/classes.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -68,6 +68,11 @@
def one_req_one_opt_with_splat_and_block(a, b=nil, *c, &block); end
def two_req_one_opt_with_splat_and_block(a, b, c=nil, *d, &block); end
def one_req_two_opt_with_splat_and_block(a, b=nil, c=nil, *d, &block); end
+
+ define_method(:zero_defined_method, Proc.new {||})
+ define_method(:zero_with_splat_defined_method, Proc.new {|*x|})
+ define_method(:one_req_defined_method, Proc.new {|x|})
+ define_method(:two_req_defined_method, Proc.new {|x, y|})
end
module MyMod
Modified: MacRuby/trunk/spec/frozen/core/method/inspect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/method/inspect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/method/inspect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/to_s'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/to_s', __FILE__)
describe "Method#inspect" do
it_behaves_like(:method_to_s, :inspect)
Modified: MacRuby/trunk/spec/frozen/core/method/name_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/method/name_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/method/name_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Method#name" do
ruby_version_is '1.8.7'..'1.9' do
Modified: MacRuby/trunk/spec/frozen/core/method/owner_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/method/owner_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/method/owner_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Method#owner" do
ruby_version_is '1.8.7' do
Modified: MacRuby/trunk/spec/frozen/core/method/parameters_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/method/parameters_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/method/parameters_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,3 +1,3 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
language_version __FILE__, "parameters"
Modified: MacRuby/trunk/spec/frozen/core/method/receiver_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/method/receiver_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/method/receiver_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Method#receiver" do
ruby_version_is '1.8.7' do
Modified: MacRuby/trunk/spec/frozen/core/method/shared/eql.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/method/shared/eql.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/method/shared/eql.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../fixtures/classes'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
describe :method_equal, :shared => true do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/method/source_location_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/method/source_location_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/method/source_location_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
ruby_version_is "1.9" do
describe "Method#source_location" do
Modified: MacRuby/trunk/spec/frozen/core/method/to_proc_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/method/to_proc_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/method/to_proc_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Method#to_proc" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/method/to_s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/method/to_s_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/method/to_s_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/to_s'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/to_s', __FILE__)
describe "Method#to_s" do
it_behaves_like(:method_to_s, :to_s)
Modified: MacRuby/trunk/spec/frozen/core/method/unbind_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/method/unbind_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/method/unbind_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Method#unbind" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/method/versions/parameters_1.9.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/method/versions/parameters_1.9.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/method/versions/parameters_1.9.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../fixtures/classes'
-require File.dirname(__FILE__) + '/../fixtures/classes_1.9'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+require File.expand_path('../../fixtures/classes_1.9', __FILE__)
ruby_version_is "1.9" do
describe "Method#parameters" do
Modified: MacRuby/trunk/spec/frozen/core/module/alias_method_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/alias_method_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/alias_method_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#alias_method" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/module/allocate_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/allocate_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/allocate_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Module.allocate" do
it "returns an instance of Module" do
Modified: MacRuby/trunk/spec/frozen/core/module/ancestors_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/ancestors_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/ancestors_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#ancestors" do
it "returns a list of modules included in self (including self)" do
Modified: MacRuby/trunk/spec/frozen/core/module/append_features_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/append_features_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/append_features_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#append_features" do
it "gets called when self is included in another module/class" do
@@ -9,14 +9,25 @@
$appended_to = mod
end
end
-
+
c = Class.new do
include m
end
-
+
$appended_to.should == c
ensure
$appended_to = nil
end
end
+
+ it "raises an ArgumentError on a cyclic include" do
+ lambda {
+ ModuleSpecs::CyclicAppendA.send(:append_features, ModuleSpecs::CyclicAppendA)
+ }.should raise_error(ArgumentError)
+
+ lambda {
+ ModuleSpecs::CyclicAppendB.send(:append_features, ModuleSpecs::CyclicAppendA)
+ }.should raise_error(ArgumentError)
+
+ end
end
Modified: MacRuby/trunk/spec/frozen/core/module/attr_accessor_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/attr_accessor_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/attr_accessor_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#attr_accessor" do
it "creates a getter and setter for each given attribute name" do
Modified: MacRuby/trunk/spec/frozen/core/module/attr_reader_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/attr_reader_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/attr_reader_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#attr_reader" do
it "creates a getter for each given attribute name" do
Modified: MacRuby/trunk/spec/frozen/core/module/attr_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/attr_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/attr_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#attr" do
it "creates a getter for the given attribute name" do
Modified: MacRuby/trunk/spec/frozen/core/module/attr_writer_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/attr_writer_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/attr_writer_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#attr_writer" do
it "creates a setter for each given attribute name" do
Modified: MacRuby/trunk/spec/frozen/core/module/autoload_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/autoload_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/autoload_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#autoload?" do
it "returns the name of the file that will be autoloaded" do
@@ -217,15 +217,19 @@
end
end
+ # This spec used autoload_w.rb which is TOTALLY WRONG. Both of these specs run on rubinius
+ # (only one on MRI), and autoload uses require logic, so we can only pull in
+ # autoload_w.rb ONCE. Thusly, it now uses autoload_w2.rb.
+
ruby_version_is ""..."1.9" do
# [ruby-core:19127]
it "raises a NameError when the autoload file did not define the constant and a module is opened with the same name" do
lambda do
- module ModuleSpecs::Autoload
- class W
- autoload :Y, fixture(__FILE__, "autoload_w.rb")
+ module ModuleSpecs::Autoload2
+ class W2
+ autoload :Y2, fixture(__FILE__, "autoload_w2.rb")
- class Y
+ class Y2
end
end
end
Modified: MacRuby/trunk/spec/frozen/core/module/case_compare_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/case_compare_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/case_compare_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#===" do
it "returns true when the given Object is an instance of self or of self's descendants" do
Modified: MacRuby/trunk/spec/frozen/core/module/class_eval_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/class_eval_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/class_eval_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/class_eval'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/class_eval', __FILE__)
describe "Module#class_eval" do
it_behaves_like :module_class_eval, :class_eval
Modified: MacRuby/trunk/spec/frozen/core/module/class_variable_defined_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/class_variable_defined_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/class_variable_defined_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#class_variable_defined?" do
it "returns true if a class variable with the given name is defined in self" do
Modified: MacRuby/trunk/spec/frozen/core/module/class_variable_get_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/class_variable_get_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/class_variable_get_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#class_variable_get" do
it "returns the value of the class variable with the given name" do
Modified: MacRuby/trunk/spec/frozen/core/module/class_variable_set_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/class_variable_set_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/class_variable_set_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#class_variable_set" do
it "sets the class variable with the given name to the given value" do
Modified: MacRuby/trunk/spec/frozen/core/module/class_variables_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/class_variables_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/class_variables_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#class_variables" do
ruby_version_is ""..."1.9" do
Modified: MacRuby/trunk/spec/frozen/core/module/comparison_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/comparison_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/comparison_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#<=>" do
it "returns -1 if self is a subclass of or includes the given module" do
Modified: MacRuby/trunk/spec/frozen/core/module/const_defined_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/const_defined_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/const_defined_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../fixtures/constants'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../fixtures/constants', __FILE__)
describe "Module#const_defined?" do
it "returns true if the given Symbol 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 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/const_get_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../fixtures/constants'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../fixtures/constants', __FILE__)
describe "Module#const_get" do
it "accepts a String or Symbol name" do
Modified: MacRuby/trunk/spec/frozen/core/module/const_missing_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/const_missing_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/const_missing_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../fixtures/constants'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../fixtures/constants', __FILE__)
describe "Module#const_missing" do
it "is called when an undefined constant is referenced via literal form" do
Modified: MacRuby/trunk/spec/frozen/core/module/const_set_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/const_set_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/const_set_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../fixtures/constants'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../fixtures/constants', __FILE__)
describe "Module#const_set" do
it "sets the constant specified by a String or Symbol to the given value" do
Modified: MacRuby/trunk/spec/frozen/core/module/constants_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/constants_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/constants_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../fixtures/constants'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../fixtures/constants', __FILE__)
describe "Module.constants" do
it "returns an array of the names of all toplevel constants" do
@@ -32,6 +32,21 @@
:Numeric, :Object, :Range, :Regexp, :String,
:Symbol, :Thread, :Time, :TrueClass)
end
+
+ it "returns Module's constants when given a parameter" do
+ direct = Module.constants(false)
+ indirect = Module.constants(true)
+ module ConstantSpecsIncludedModule
+ MODULE_CONSTANTS_SPECS_INDIRECT = :foo
+ end
+
+ class Module
+ MODULE_CONSTANTS_SPECS_DIRECT = :bar
+ include ConstantSpecsIncludedModule
+ end
+ (Module.constants(false) - direct).should == [:MODULE_CONSTANTS_SPECS_DIRECT]
+ (Module.constants(true) - indirect).sort.should == [:MODULE_CONSTANTS_SPECS_DIRECT, :MODULE_CONSTANTS_SPECS_INDIRECT]
+ end
end
end
@@ -56,11 +71,20 @@
ConstantSpecs::ContainerA.constants.sort.should == [
:CS_CONST10, :CS_CONST23, :CS_CONST24, :CS_CONST5, :ChildA
]
+ ConstantSpecs::ContainerA.constants(true).sort.should == [
+ :CS_CONST10, :CS_CONST23, :CS_CONST24, :CS_CONST5, :ChildA
+ ]
end
it "includes names of constants defined after a module is included" do
ConstantSpecs::ModuleM::CS_CONST251 = :const251
ConstantSpecs::ContainerA.constants.should include(:CS_CONST251)
end
+
+ it "doesn't returns inherited constants when passed false" do
+ ConstantSpecs::ContainerA.constants(false).sort.should == [
+ :CS_CONST10, :CS_CONST23, :CS_CONST5, :ChildA
+ ]
+ end
end
end
Modified: MacRuby/trunk/spec/frozen/core/module/define_method_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/define_method_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/define_method_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
class DefineMethodSpecClass
end
@@ -106,4 +106,8 @@
o = DefineMethodByProcClass.new
o.proc_test.should be_true
end
+
+ it "is private" do
+ Module.should have_private_instance_method(:define_method)
+ end
end
Modified: MacRuby/trunk/spec/frozen/core/module/eql_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/eql_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/eql_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/equal_value'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/equal_value', __FILE__)
describe "Module#eql?" do
it_behaves_like(:module_equal, :eql?)
Modified: MacRuby/trunk/spec/frozen/core/module/equal_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/equal_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/equal_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/equal_value'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/equal_value', __FILE__)
describe "Module#equal?" do
it_behaves_like(:module_equal, :equal?)
Modified: MacRuby/trunk/spec/frozen/core/module/equal_value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/equal_value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/equal_value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/equal_value'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/equal_value', __FILE__)
describe "Module#==" do
it_behaves_like(:module_equal, :==)
Modified: MacRuby/trunk/spec/frozen/core/module/extend_object_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/extend_object_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/extend_object_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#extend_object" do
it "extends the given object with constants and methods of self" do
Modified: MacRuby/trunk/spec/frozen/core/module/extended_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/extended_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/extended_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#extended" do
it "is called when an object gets extended with self" do
Added: MacRuby/trunk/spec/frozen/core/module/fixtures/autoload_w2.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/fixtures/autoload_w2.rb (rev 0)
+++ MacRuby/trunk/spec/frozen/core/module/fixtures/autoload_w2.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -0,0 +1 @@
+ScratchPad.record :loaded
Modified: MacRuby/trunk/spec/frozen/core/module/fixtures/classes.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/fixtures/classes.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/fixtures/classes.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -344,6 +344,13 @@
:after_redefinition
end
end
+
+ module CyclicAppendA
+ end
+
+ module CyclicAppendB
+ include CyclicAppendA
+ end
end
ModuleSpecs::Nesting[:root_level] = Module.nesting
Modified: MacRuby/trunk/spec/frozen/core/module/fixtures/name.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/fixtures/name.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/fixtures/name.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-# encoding: utf-8
+# -*- encoding: utf-8 -*-
module ModuleSpecs
class NameEncoding
class Cß
Modified: MacRuby/trunk/spec/frozen/core/module/freeze_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/freeze_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/freeze_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#freeze" do
ruby_version_is ""..."1.9" do
Modified: MacRuby/trunk/spec/frozen/core/module/gt_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/gt_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/gt_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#>" do
it "returns true if self is a superclass of or included by the given module" do
Modified: MacRuby/trunk/spec/frozen/core/module/gte_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/gte_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/gte_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#>=" do
it "returns true if self is a superclass of, the same as or included by given module" do
Modified: MacRuby/trunk/spec/frozen/core/module/include_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/include_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/include_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#include" do
it "calls #append_features(self) in reversed order on each module" do
@@ -128,13 +128,13 @@
module M; end
class A; include M; end
class B < A; include M; end
-
+
all = [A,B,M]
-
+
(B.ancestors & all).should == [B, A, M]
end
end
-
+
it "recursively includes new mixins" do
module ModuleSpecs::M1
module U; end
@@ -144,21 +144,44 @@
module Y; end
class A; include X; end;
class B < A; include U, V, W; end;
-
- all = [U,V,W,X,Y,A,B]
-
+
# update V
module V; include X, U, Y; end
-
- (B.ancestors & all).should == [B, U, V, W, A, X]
-
+
+ # This code used to use Array#& and then compare 2 arrays, but
+ # the ordering from Array#& is undefined, as it uses Hash internally.
+ #
+ # Loop is more verbose, but more explicit in what we're testing.
+
+ anc = B.ancestors
+ [B, U, V, W, A, X].each do |i|
+ anc.include?(i).should be_true
+ end
+
class B; include V; end
-
+
# the only new module is Y, it is added after U since it follows U in V mixin list:
- (B.ancestors & all).should == [B, U, Y, V, W, A, X]
+ anc = B.ancestors
+ [B, U, Y, V, W, A, X].each do |i|
+ anc.include?(i).should be_true
+ end
end
end
-
+
+ it "preserves ancestor order" do
+ module ModuleSpecs::M2
+ module M1; end
+ module M2; end
+ module M3; include M2; end
+
+ module M2; include M1; end
+ module M3; include M2; end
+
+ M3.ancestors.should == [M3, M2, M1]
+
+ end
+ end
+
it "detects cyclic includes" do
lambda {
module ModuleSpecs::M
@@ -174,6 +197,59 @@
end
}.should_not raise_error
end
+
+ it "ignores modules it has already included via module mutual inclusion" do
+ module ModuleSpecs::AlreadyInc
+ module M0
+ end
+
+ module M
+ include M0
+ end
+
+ class K
+ include M
+ include M
+ end
+
+ K.ancestors[0].should == K
+ K.ancestors[1].should == M
+ K.ancestors[2].should == M0
+ end
+ end
+
+ it "clears any caches" do
+ module ModuleSpecs::M3
+ module M1
+ def foo
+ :m1
+ end
+ end
+
+ module M2
+ def foo
+ :m2
+ end
+ end
+
+ class C
+ include M1
+
+ def get
+ foo
+ end
+ end
+
+ c = C.new
+ c.get.should == :m1
+
+ class C
+ include M2
+ end
+
+ c.get.should == :m2
+ end
+ end
end
describe "Module#include?" do
Modified: MacRuby/trunk/spec/frozen/core/module/included_modules_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/included_modules_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/included_modules_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#included_modules" do
it "returns a list of modules included in self" do
Modified: MacRuby/trunk/spec/frozen/core/module/included_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/included_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/included_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#included" do
it "is invoked when self is included in another module or class" do
Modified: MacRuby/trunk/spec/frozen/core/module/initialize_copy_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/initialize_copy_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/initialize_copy_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,2 +1,2 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/module/initialize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/initialize_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/initialize_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#initialize" do
it "accepts a block" do
Modified: MacRuby/trunk/spec/frozen/core/module/instance_method_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/instance_method_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/instance_method_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#instance_method" do
before :all do
Modified: MacRuby/trunk/spec/frozen/core/module/instance_methods_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/instance_methods_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/instance_methods_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
# Prior to MRI 1.9 #instance_methods returned an Array of Strings
ruby_version_is ""..."1.9" do
Modified: MacRuby/trunk/spec/frozen/core/module/lt_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/lt_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/lt_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#<" do
it "returns true if self is a subclass of or includes the given module" do
Modified: MacRuby/trunk/spec/frozen/core/module/lte_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/lte_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/lte_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#<=" do
it "returns true if self is a subclass of, the same as or includes the given module" do
Modified: MacRuby/trunk/spec/frozen/core/module/method_added_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/method_added_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/method_added_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#method_added" do
it "is a private instance method" do
Modified: MacRuby/trunk/spec/frozen/core/module/method_defined_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/method_defined_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/method_defined_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#method_defined?" do
it "returns true if a public or private method with the given name is defined in self, self's ancestors or one of self's included modules" do
Modified: MacRuby/trunk/spec/frozen/core/module/method_removed_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/method_removed_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/method_removed_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#method_removed" do
it "is called when a method is removed from self" do
Modified: MacRuby/trunk/spec/frozen/core/module/method_undefined_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/method_undefined_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/method_undefined_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#method_undefined" do
it "is called when a method is undefined from self" do
Modified: MacRuby/trunk/spec/frozen/core/module/module_eval_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/module_eval_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/module_eval_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/class_eval'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/class_eval', __FILE__)
describe "Module#module_eval" do
it_behaves_like :module_class_eval, :module_eval
Modified: MacRuby/trunk/spec/frozen/core/module/module_function_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/module_function_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/module_function_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#module_function with specific method names" do
it "creates duplicates of the given instance methods on the Module object" do
Modified: MacRuby/trunk/spec/frozen/core/module/name_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/name_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/name_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#name" do
ruby_version_is ""..."1.9" do
@@ -15,7 +15,7 @@
Class.new.name.should be_nil
end
- require File.dirname(__FILE__) + '/fixtures/name'
+ 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
Modified: MacRuby/trunk/spec/frozen/core/module/nesting_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/nesting_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/nesting_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module::Nesting" do
Modified: MacRuby/trunk/spec/frozen/core/module/new_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/new_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/new_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module.new" do
it "creates a new anonymous Module" do
Modified: MacRuby/trunk/spec/frozen/core/module/private_class_method_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/private_class_method_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/private_class_method_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#private_class_method" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/module/private_instance_methods_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/private_instance_methods_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/private_instance_methods_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#private_instance_methods" do
it "returns a list of private methods in module and its ancestors" do
Modified: MacRuby/trunk/spec/frozen/core/module/private_method_defined_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/private_method_defined_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/private_method_defined_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#private_method_defined?" do
it "returns true if the named private method is defined by module or its ancestors" do
Modified: MacRuby/trunk/spec/frozen/core/module/private_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/private_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/private_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#private" do
it "makes the target method uncallable from other types" do
Modified: MacRuby/trunk/spec/frozen/core/module/protected_instance_methods_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/protected_instance_methods_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/protected_instance_methods_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#protected_instance_methods" do
ruby_version_is ""..."1.9" do
Modified: MacRuby/trunk/spec/frozen/core/module/protected_method_defined_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/protected_method_defined_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/protected_method_defined_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#protected_method_defined?" do
it "returns true if the named protected method is defined by module or its ancestors" do
Modified: MacRuby/trunk/spec/frozen/core/module/protected_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/protected_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/protected_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#protected" do
Modified: MacRuby/trunk/spec/frozen/core/module/public_class_method_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/public_class_method_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/public_class_method_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#public_class_method" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/module/public_instance_methods_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/public_instance_methods_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/public_instance_methods_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
# Before MRI 1.9 #public_instance_methods returned an Array of Strings
ruby_version_is ""..."1.9" do
Modified: MacRuby/trunk/spec/frozen/core/module/public_method_defined_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/public_method_defined_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/public_method_defined_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#public_method_defined?" do
it "returns true if the named public method is defined by module or its ancestors" do
Modified: MacRuby/trunk/spec/frozen/core/module/public_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/public_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/public_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#public" do
it "on a superclass method calls the redefined method" do
Modified: MacRuby/trunk/spec/frozen/core/module/remove_class_variable_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/remove_class_variable_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/remove_class_variable_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,2 +1,2 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/module/remove_const_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/remove_const_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/remove_const_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../fixtures/constants'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../fixtures/constants', __FILE__)
describe "Module#remove_const" do
it "removes the constant specified by a String or Symbol from the receiver's constant table" do
Modified: MacRuby/trunk/spec/frozen/core/module/remove_method_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/remove_method_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/remove_method_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
module ModuleSpecs
class NoInheritance
Modified: MacRuby/trunk/spec/frozen/core/module/to_s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/to_s_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/to_s_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,2 +1,2 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/module/undef_method_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/module/undef_method_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/module/undef_method_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
module ModuleSpecs
class NoInheritance
Modified: MacRuby/trunk/spec/frozen/core/nil/and_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/nil/and_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/nil/and_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "NilClass#&" do
it "returns false" do
Modified: MacRuby/trunk/spec/frozen/core/nil/inspect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/nil/inspect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/nil/inspect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "NilClass#inspect" do
it "returns the string 'nil'" do
Modified: MacRuby/trunk/spec/frozen/core/nil/nil_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/nil/nil_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/nil/nil_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "NilClass#nil?" do
it "returns true" do
Modified: MacRuby/trunk/spec/frozen/core/nil/or_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/nil/or_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/nil/or_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "NilClass#|" do
it "returns false if other is nil or false, otherwise true" do
Modified: MacRuby/trunk/spec/frozen/core/nil/rationalize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/nil/rationalize_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/nil/rationalize_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "NilClass#rationalize" do
Modified: MacRuby/trunk/spec/frozen/core/nil/to_a_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/nil/to_a_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/nil/to_a_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "NilClass#to_a" do
it "returns an empty array" do
Modified: MacRuby/trunk/spec/frozen/core/nil/to_f_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/nil/to_f_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/nil/to_f_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "NilClass#to_f" do
it "returns 0.0" do
Modified: MacRuby/trunk/spec/frozen/core/nil/to_i_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/nil/to_i_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/nil/to_i_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "NilClass#to_i" do
it "returns 0" do
Modified: MacRuby/trunk/spec/frozen/core/nil/to_r_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/nil/to_r_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/nil/to_r_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "NilClass#to_r" do
Modified: MacRuby/trunk/spec/frozen/core/nil/to_s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/nil/to_s_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/nil/to_s_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "NilClass#to_s" do
it "returns the string ''" do
Modified: MacRuby/trunk/spec/frozen/core/nil/xor_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/nil/xor_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/nil/xor_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "NilClass#^" do
it "returns false if other is nil or false, otherwise true" do
Modified: MacRuby/trunk/spec/frozen/core/numeric/abs2_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/abs2_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/abs2_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Numeric#abs2" do
Modified: MacRuby/trunk/spec/frozen/core/numeric/abs_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/abs_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/abs_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/shared/abs'
+require File.expand_path('../shared/abs', __FILE__)
describe "Numeric#abs" do
it_behaves_like(:numeric_abs, :abs)
Modified: MacRuby/trunk/spec/frozen/core/numeric/angle_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/angle_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/angle_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/complex/numeric/arg'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/complex/numeric/arg', __FILE__)
ruby_version_is "1.9" do
describe "Numeric#angle" do
Modified: MacRuby/trunk/spec/frozen/core/numeric/arg_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/arg_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/arg_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/complex/numeric/arg'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/complex/numeric/arg', __FILE__)
ruby_version_is "1.9" do
describe "Numeric#arg" do
Modified: MacRuby/trunk/spec/frozen/core/numeric/ceil_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/ceil_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/ceil_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,14 +1,15 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Numeric#ceil" do
- before(:each) do
- @obj = NumericSub.new
- end
-
it "converts self to a Float (using #to_f) and returns the #ceil'ed result" do
- @obj.should_receive(:to_f).and_return(1 + TOLERANCE, - 1 - TOLERANCE)
- @obj.ceil.should == 2
- @obj.ceil.should == -1
+ o = mock_numeric("ceil")
+ o.should_receive(:to_f).and_return(1 + TOLERANCE)
+ o.ceil.should == 2
+
+ o2 = mock_numeric("ceil")
+ v = -1 - TOLERANCE
+ o2.should_receive(:to_f).and_return(v)
+ o2.ceil.should == -1
end
end
Modified: MacRuby/trunk/spec/frozen/core/numeric/coerce_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/coerce_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/coerce_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Numeric#coerce" do
before(:each) do
@@ -14,8 +14,25 @@
a.coerce(b).should == [b, a]
end
+ # I (emp) think that this behavior is actually a bug in MRI. It's here as documentation
+ # of the behavior until we find out if it's a bug.
+ quarantine! do
+ it "considers the presense of a metaclass when checking the class of the objects" do
+ a = NumericSub.new
+ b = NumericSub.new
+
+ # inject a metaclass on a
+ class << a; true; end
+
+ # watch it explode
+ lambda { a.coerce(b) }.should raise_error(TypeError)
+ end
+ end
+
it "calls #to_f to convert other if self responds to #to_f" do
- other = NumericSub.new
+ # Do not use NumericSub here, because coerce checks the classes of the receiver
+ # and arguments before calling #to_f.
+ other = mock("numeric")
lambda { @obj.coerce(other) }.should raise_error(TypeError)
end
Modified: MacRuby/trunk/spec/frozen/core/numeric/comparison_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/comparison_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/comparison_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Numeric#<=>" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/numeric/conj_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/conj_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/conj_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/complex/numeric/conj'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/complex/numeric/conj', __FILE__)
ruby_version_is "1.9" do
describe "Numeric#conj" do
Modified: MacRuby/trunk/spec/frozen/core/numeric/conjugate_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/conjugate_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/conjugate_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/complex/numeric/conj'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/complex/numeric/conj', __FILE__)
ruby_version_is "1.9" do
describe "Numeric#conjugate" do
Modified: MacRuby/trunk/spec/frozen/core/numeric/denominator_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/denominator_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/denominator_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Numeric#denominator" do
Modified: MacRuby/trunk/spec/frozen/core/numeric/div_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/div_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/div_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Numeric#div" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/numeric/divmod_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/divmod_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/divmod_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Numeric#divmod" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/numeric/eql_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/eql_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/eql_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Numeric#eql?" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/numeric/fdiv_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/fdiv_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/fdiv_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Numeric#fdiv" do
ruby_version_is "1.9" do
Modified: MacRuby/trunk/spec/frozen/core/numeric/floor_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/floor_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/floor_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Numeric#floor" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/numeric/i_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/i_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/i_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Numeric#i" do
Modified: MacRuby/trunk/spec/frozen/core/numeric/imag_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/imag_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/imag_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/complex/numeric/imag'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/complex/numeric/imag', __FILE__)
ruby_version_is "1.9" do
describe "Numeric#imag" do
Modified: MacRuby/trunk/spec/frozen/core/numeric/imaginary_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/imaginary_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/imaginary_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/complex/numeric/imag'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/complex/numeric/imag', __FILE__)
ruby_version_is "1.9" do
describe "Numeric#imaginary" do
Modified: MacRuby/trunk/spec/frozen/core/numeric/initialize_copy_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/initialize_copy_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/initialize_copy_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Numeric#singleton_method_added" do
it "raises a TypeError when trying to #dup a Numeric" do
Modified: MacRuby/trunk/spec/frozen/core/numeric/integer_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/integer_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/integer_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Numeric#integer?" do
it "returns false" do
Modified: MacRuby/trunk/spec/frozen/core/numeric/magnitude_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/magnitude_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/magnitude_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/shared/abs'
+require File.expand_path('../shared/abs', __FILE__)
ruby_version_is "1.9" do
describe "Numeric#magnitude" do
Modified: MacRuby/trunk/spec/frozen/core/numeric/modulo_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/modulo_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/modulo_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Numeric#modulo" do
ruby_version_is "".."1.9" do
Modified: MacRuby/trunk/spec/frozen/core/numeric/nonzero_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/nonzero_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/nonzero_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Numeric#nonzero?" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/numeric/numerator_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/numerator_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/numerator_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Numeric#numerator" do
Modified: MacRuby/trunk/spec/frozen/core/numeric/phase_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/phase_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/phase_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/complex/numeric/arg'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/complex/numeric/arg', __FILE__)
ruby_version_is "1.9" do
describe "Numeric#phase" do
Modified: MacRuby/trunk/spec/frozen/core/numeric/polar_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/polar_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/polar_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/complex/numeric/polar'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/complex/numeric/polar', __FILE__)
ruby_version_is "1.9" do
describe "Numeric#polar" do
Modified: MacRuby/trunk/spec/frozen/core/numeric/quo_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/quo_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/quo_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Numeric#quo" do
ruby_version_is ""..."1.9" do
Modified: MacRuby/trunk/spec/frozen/core/numeric/rationalize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/rationalize_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/rationalize_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Numeric#rationalize" do
Modified: MacRuby/trunk/spec/frozen/core/numeric/real_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/real_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/real_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/complex/numeric/real'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/complex/numeric/real', __FILE__)
ruby_version_is "1.9" do
describe "Numeric#real" do
Modified: MacRuby/trunk/spec/frozen/core/numeric/rect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/rect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/rect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/rect'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/rect', __FILE__)
ruby_version_is "1.9" do
describe "Numeric#rect" do
Modified: MacRuby/trunk/spec/frozen/core/numeric/rectangular_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/rectangular_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/rectangular_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/rect'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/rect', __FILE__)
ruby_version_is "1.9" do
describe "Numeric#rectangular" do
Modified: MacRuby/trunk/spec/frozen/core/numeric/remainder_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/remainder_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/remainder_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Numeric#remainder" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/numeric/round_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/round_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/round_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Numeric#round" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/numeric/shared/abs.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/shared/abs.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/shared/abs.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../fixtures/classes'
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
describe :numeric_abs, :shared => true do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/numeric/shared/rect.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/shared/rect.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/shared/rect.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe :numeric_rect, :shared => true do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/numeric/singleton_method_added_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/singleton_method_added_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/singleton_method_added_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Numeric#singleton_method_added" do
before(:all) do
Modified: MacRuby/trunk/spec/frozen/core/numeric/step_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/step_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/step_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Numeric#step with [stop, step]" do
before(:each) do
@@ -37,14 +37,14 @@
@stop = mock("Stop value")
@step = mock("Step value")
- @obj.step(@stop, @step).should be_kind_of(enumerator_class)
+ @obj.step(@stop, @step).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_kind_of(enumerator_class)
+ @obj.step(@stop, @step).should be_an_instance_of(enumerator_class)
end
end
Modified: MacRuby/trunk/spec/frozen/core/numeric/to_c_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/to_c_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/to_c_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Numeric#to_c" do
Modified: MacRuby/trunk/spec/frozen/core/numeric/to_int_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/to_int_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/to_int_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Numeric#to_int" do
it "returns self#to_i" do
Modified: MacRuby/trunk/spec/frozen/core/numeric/truncate_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/truncate_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/truncate_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Numeric#truncate" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/numeric/uminus_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/uminus_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/uminus_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Numeric#-@" do
it " should return the same value with opposite sign (integers)" do
Modified: MacRuby/trunk/spec/frozen/core/numeric/uplus_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/uplus_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/uplus_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Numeric#+@" do
it "returns self" do
Modified: MacRuby/trunk/spec/frozen/core/numeric/zero_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/numeric/zero_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/numeric/zero_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Numeric#zero?" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/object/clone_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/object/clone_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/object/clone_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/dup_clone'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/dup_clone', __FILE__)
describe "Object#clone" do
it_behaves_like :object_dup_clone, :clone
Modified: MacRuby/trunk/spec/frozen/core/object/dup_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/object/dup_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/object/dup_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/dup_clone'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/dup_clone', __FILE__)
describe "Object#dup" do
it_behaves_like :object_dup_clone, :dup
Modified: MacRuby/trunk/spec/frozen/core/object/initialize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/object/initialize_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/object/initialize_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/object/instance_of_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/object/instance_of_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/object/instance_of_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
module ObjectSpecs
module SomeOtherModule; end
Modified: MacRuby/trunk/spec/frozen/core/object/is_a_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/object/is_a_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/object/is_a_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/kind_of'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/kind_of', __FILE__)
describe "Object#is_a?" do
it_behaves_like(:object_kind_of , :is_a?)
Modified: MacRuby/trunk/spec/frozen/core/object/kind_of_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/object/kind_of_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/object/kind_of_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/kind_of'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/kind_of', __FILE__)
describe "Object#kind_of?" do
it_behaves_like(:object_kind_of , :kind_of?)
Modified: MacRuby/trunk/spec/frozen/core/object/match_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/object/match_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/object/match_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe Object, '=~' do
ruby_version_is ""..."1.9" do
Modified: MacRuby/trunk/spec/frozen/core/object/new_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/object/new_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/object/new_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,11 +1,11 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Object.new" do
it "creates a new Object" do
Object.new.should be_kind_of(Object)
end
- ruby_version_is "1.9.2" do # Ref: [redmine:2451]
+ ruby_version_is "1.9" do # Ref: [redmine:2451]
it "accepts any number of arguments" do
lambda {
Object.new("This", "makes it easier", "to call super", "from other constructors")
Modified: MacRuby/trunk/spec/frozen/core/objectspace/_id2ref_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/objectspace/_id2ref_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/objectspace/_id2ref_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ObjectSpace._id2ref" do
it "converts an object id to a reference to the object" do
Modified: MacRuby/trunk/spec/frozen/core/objectspace/add_finalizer_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/objectspace/add_finalizer_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/objectspace/add_finalizer_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/objectspace/call_finalizer_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/objectspace/call_finalizer_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/objectspace/call_finalizer_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/objectspace/define_finalizer_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/objectspace/define_finalizer_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/objectspace/define_finalizer_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures', __FILE__)
# NOTE: A call to define_finalizer does not guarantee that the
# passed proc or callable will be called at any particular time.
@@ -23,34 +23,37 @@
ObjectSpace.define_finalizer("garbage", handler).should == [0, handler]
end
- ruby_bug "#1706", "1.9.2" do
- it "calls finalizer on process termination" do
- rd, wr = IO.pipe
- if Kernel::fork then
- wr.close
- rd.read.should == "finalized"
- rd.close
- else
- rd.close
- handler = Proc.new { wr.write "finalized"; wr.close }
- obj = "Test"
- ObjectSpace.define_finalizer(obj, handler)
- exit 0
+ # see [ruby-core:24095]
+ ruby_version_is "1.9" do
+ with_feature :fork do
+ it "calls finalizer on process termination" do
+ rd, wr = IO.pipe
+ if Kernel::fork then
+ wr.close
+ rd.read.should == "finalized"
+ rd.close
+ else
+ rd.close
+ handler = ObjectSpaceFixtures.scoped(wr)
+ obj = "Test"
+ ObjectSpace.define_finalizer(obj, handler)
+ exit 0
+ end
end
- end
- it "doesn't call self-referencing finalizers" do
- rd, wr = IO.pipe
- if Kernel::fork then
- wr.close
- rd.read.should_not == "finalized"
- rd.close
- else
- rd.close
- obj = "Test"
- handler = Proc.new { wr.write "finalized"; wr.close }
- ObjectSpace.define_finalizer(obj, handler)
- exit 0
+ it "calls finalizer at exit even if it is self-referencing" do
+ rd, wr = IO.pipe
+ if Kernel::fork then
+ wr.close
+ rd.read.should == "finalized"
+ rd.close
+ else
+ rd.close
+ obj = "Test"
+ handler = Proc.new { wr.write "finalized"; wr.close }
+ ObjectSpace.define_finalizer(obj, handler)
+ exit 0
+ end
end
end
end
Modified: MacRuby/trunk/spec/frozen/core/objectspace/each_object_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/objectspace/each_object_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/objectspace/each_object_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ObjectSpace.each_object" do
it "calls the block once for each living, non-immediate object in the Ruby process" do
@@ -39,7 +39,7 @@
new_obj = ObjectSpaceSpecEachOtherObject.new
counter = ObjectSpace.each_object(ObjectSpaceSpecEachOtherObject)
- counter.should be_kind_of(enumerator_class)
+ counter.should be_an_instance_of(enumerator_class)
counter.each{}.should == 1
# this is needed to prevent the new_obj from being GC'd too early
new_obj.should_not == nil
Modified: MacRuby/trunk/spec/frozen/core/objectspace/finalizers_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/objectspace/finalizers_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/objectspace/finalizers_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/objectspace/fixtures.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/objectspace/fixtures.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/objectspace/fixtures.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -27,4 +27,9 @@
handler = lambda { |obj| ScratchPad.record :finalized }
ObjectSpace.define_finalizer "#{rand 5}", handler
end
+
+ def self.scoped(wr)
+ return Proc.new { wr.write "finalized"; wr.close }
+ end
+
end
Modified: MacRuby/trunk/spec/frozen/core/objectspace/garbage_collect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/objectspace/garbage_collect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/objectspace/garbage_collect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "ObjectSpace.garbage_collect" do
Modified: MacRuby/trunk/spec/frozen/core/objectspace/remove_finalizer_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/objectspace/remove_finalizer_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/objectspace/remove_finalizer_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/objectspace/undefine_finalizer_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/objectspace/undefine_finalizer_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/objectspace/undefine_finalizer_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/precision/included_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/precision/included_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/precision/included_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is ""..."1.9.1" do
describe "Precision.included" do
Modified: MacRuby/trunk/spec/frozen/core/precision/prec_f_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/precision/prec_f_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/precision/prec_f_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is ""..."1.9.1" do
describe "Precision#prec_f" do
Modified: MacRuby/trunk/spec/frozen/core/precision/prec_i_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/precision/prec_i_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/precision/prec_i_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is ""..."1.9.1" do
describe "Precision#prec_i" do
Modified: MacRuby/trunk/spec/frozen/core/precision/prec_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/precision/prec_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/precision/prec_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is ""..."1.9.1" do
describe "Float#prec" do
Modified: MacRuby/trunk/spec/frozen/core/proc/arity_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/arity_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/proc/arity_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Proc#arity" do
it "returns the number of arguments, using Proc.new" do
@@ -26,18 +26,21 @@
end
it "if optional arguments, return the negative number of mandatory arguments using Proc.new " do
+ Proc.new { |*| }.arity.should == -1
Proc.new { |*a| }.arity.should == -1
Proc.new { |a, *b| }.arity.should == -2
Proc.new { |a, b, *c| }.arity.should == -3
end
it "if optional arguments, return the negative number of mandatory arguments using Kernel#lambda" do
+ lambda { |*| }.arity.should == -1
lambda { |*a| }.arity.should == -1
lambda { |a, *b| }.arity.should == -2
lambda { |a, b, *c| }.arity.should == -3
end
it "if optional arguments, return the negative number of mandatory arguments using Kernel#proc" do
+ proc { |*| }.arity.should == -1
proc { |*a| }.arity.should == -1
proc { |a, *b| }.arity.should == -2
proc { |a, b, *c| }.arity.should == -3
Modified: MacRuby/trunk/spec/frozen/core/proc/binding_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/binding_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/proc/binding_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Proc#binding" do
it "returns a Binding instance" do
Modified: MacRuby/trunk/spec/frozen/core/proc/block_pass_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/block_pass_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/proc/block_pass_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Proc as a block pass argument" do
def revivify(&b)
Modified: MacRuby/trunk/spec/frozen/core/proc/call_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/call_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/proc/call_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/call'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/call', __FILE__)
language_version __FILE__, "call"
Modified: MacRuby/trunk/spec/frozen/core/proc/case_compare_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/case_compare_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/proc/case_compare_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/call'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/call', __FILE__)
language_version __FILE__, "call"
Modified: MacRuby/trunk/spec/frozen/core/proc/clone_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/clone_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/proc/clone_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/dup'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/dup', __FILE__)
describe "Proc#clone" do
it_behaves_like(:proc_dup, :clone)
Modified: MacRuby/trunk/spec/frozen/core/proc/curry_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/curry_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/proc/curry_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Proc#curry" do
Modified: MacRuby/trunk/spec/frozen/core/proc/dup_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/dup_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/proc/dup_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/dup'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/dup', __FILE__)
describe "Proc#dup" do
it_behaves_like(:proc_dup, :dup)
Modified: MacRuby/trunk/spec/frozen/core/proc/element_reference_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/element_reference_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/proc/element_reference_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/call'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/call', __FILE__)
language_version __FILE__, "call"
Modified: MacRuby/trunk/spec/frozen/core/proc/eql_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/eql_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/proc/eql_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/equal'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/equal', __FILE__)
ruby_version_is "1.9" do
describe "Proc#eql?" do
Modified: MacRuby/trunk/spec/frozen/core/proc/equal_value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/equal_value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/proc/equal_value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/equal'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/equal', __FILE__)
describe "Proc#==" do
it_behaves_like(:proc_equal, :==)
Modified: MacRuby/trunk/spec/frozen/core/proc/hash_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/hash_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/proc/hash_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Proc#hash" do
Modified: MacRuby/trunk/spec/frozen/core/proc/lambda_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/lambda_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/proc/lambda_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Proc#lambda?" do
Modified: MacRuby/trunk/spec/frozen/core/proc/new_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/new_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/proc/new_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/fixtures/procs.rb'
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../fixtures/procs.rb', __FILE__)
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Proc.new with an associated block" do
it "returns a proc that represents the block" do
Modified: MacRuby/trunk/spec/frozen/core/proc/shared/equal.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/shared/equal.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/proc/shared/equal.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe :proc_equal, :shared => true do
it "returns true if self and other are the same object" do
Modified: MacRuby/trunk/spec/frozen/core/proc/source_location_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/source_location_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/proc/source_location_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/procs'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/procs', __FILE__)
ruby_version_is "1.9" do
describe "Proc#source_location" do
Modified: MacRuby/trunk/spec/frozen/core/proc/to_proc_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/to_proc_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/proc/to_proc_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Proc#to_proc" do
it "returns self" do
Modified: MacRuby/trunk/spec/frozen/core/proc/to_s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/to_s_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/proc/to_s_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Proc#to_s" do
Modified: MacRuby/trunk/spec/frozen/core/proc/versions/call_1.8.7.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/versions/call_1.8.7.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/proc/versions/call_1.8.7.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1 @@
-require File.dirname(__FILE__) + '/../shared/call_arguments'
+require File.expand_path('../../shared/call_arguments', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/proc/versions/call_1.9.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/versions/call_1.9.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/proc/versions/call_1.9.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1 @@
-require File.dirname(__FILE__) + '/../shared/call_arguments'
+require File.expand_path('../../shared/call_arguments', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/proc/versions/parameters_1.9.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/versions/parameters_1.9.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/proc/versions/parameters_1.9.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Proc#parameters" do
Modified: MacRuby/trunk/spec/frozen/core/proc/yield_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/proc/yield_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/proc/yield_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/call'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/call', __FILE__)
language_version __FILE__, "call"
Modified: MacRuby/trunk/spec/frozen/core/process/abort_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/abort_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/abort_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
# TODO: share with Kernel.abort, abort.
describe "Process.abort" do
Modified: MacRuby/trunk/spec/frozen/core/process/detach_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/detach_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/detach_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Process#detach" do
platform_is_not :windows do
Modified: MacRuby/trunk/spec/frozen/core/process/egid_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/egid_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/egid_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Process.egid" do
it "returns the effective group ID for this process" do
Modified: MacRuby/trunk/spec/frozen/core/process/euid_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/euid_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/euid_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Process.euid" do
it "returns the effective user ID for this process" do
Modified: MacRuby/trunk/spec/frozen/core/process/exit_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/exit_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/exit_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/process/fork_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/fork_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/fork_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,7 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Process.fork" do
- # As of 1.9.2 Process.respond_to?(:fork) returns false on platforms that do
+ # As of 1.9 Process.respond_to?(:fork) returns false on platforms that do
# not implement it.
ruby_version_is "1.9" do
platform_is :windows do
@@ -17,38 +17,40 @@
end
end
- not_supported_on :macruby, :jruby, :windows do
- before :each do
- @file = tmp('i_exist')
- rm_r @file
- end
+ platform_is_not :windows do
+ not_supported_on :jruby, :macruby do
+ before :each do
+ @file = tmp('i_exist')
+ rm_r @file
+ end
- after :each do
- rm_r @file
- end
+ after :each do
+ rm_r @file
+ end
- it "is implemented" do
- Process.respond_to?(:fork).should be_true
- end
+ it "is implemented" do
+ Process.respond_to?(:fork).should be_true
+ end
- it "return nil for the child process" do
- child_id = Process.fork
- if child_id == nil
- touch(@file) { |f| f.write 'rubinius' }
- Process.exit!
- else
- Process.waitpid(child_id)
+ it "return nil for the child process" do
+ child_id = Process.fork
+ if child_id == nil
+ touch(@file) { |f| f.write 'rubinius' }
+ Process.exit!
+ else
+ Process.waitpid(child_id)
+ end
+ File.exist?(@file).should == true
end
- File.exist?(@file).should == true
- end
- it "runs a block in a child process" do
- pid = Process.fork {
- touch(@file) { |f| f.write 'rubinius' }
- Process.exit!
- }
- Process.waitpid(pid)
- File.exist?(@file).should == true
+ it "runs a block in a child process" do
+ pid = Process.fork {
+ touch(@file) { |f| f.write 'rubinius' }
+ Process.exit!
+ }
+ Process.waitpid(pid)
+ File.exist?(@file).should == true
+ end
end
end
end
Modified: MacRuby/trunk/spec/frozen/core/process/getpgid_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/getpgid_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/getpgid_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,11 +1,11 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Process.getpgid" do
- it "requires one argument" do
- lambda { Process.getpgid }.should raise_error(ArgumentError)
- end
+ platform_is_not :windows do
+ it "requires one argument" do
+ lambda { Process.getpgid }.should raise_error(ArgumentError)
+ end
- platform_is_not :windows do
it "returns the process group ID for the given process id" do
Process.getpgid(Process.pid).should == Process.getpgrp
end
Modified: MacRuby/trunk/spec/frozen/core/process/getpgrp_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/getpgrp_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/getpgrp_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,3 +1,3 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
# see setpgrp_spec.rb
Modified: MacRuby/trunk/spec/frozen/core/process/getpriority_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/getpriority_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/getpriority_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Process.getpriority" do
platform_is_not :windows do
Modified: MacRuby/trunk/spec/frozen/core/process/getrlimit_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/getrlimit_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/getrlimit_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,3 +1,3 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
# see setrlimit_spec.rb
Modified: MacRuby/trunk/spec/frozen/core/process/gid_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/gid_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/gid_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,9 +1,11 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Process.gid" do
- it "returns the correct gid for the user executing this process" do
- current_gid_according_to_unix = `id -gr`.to_i
- Process.gid.should == current_gid_according_to_unix
+ platform_is_not :windows do
+ it "returns the correct gid for the user executing this process" do
+ current_gid_according_to_unix = `id -gr`.to_i
+ Process.gid.should == current_gid_according_to_unix
+ end
end
it "also goes by Process::GID.rid" do
Modified: MacRuby/trunk/spec/frozen/core/process/groups_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/groups_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/groups_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Process.groups" do
platform_is_not :windows do
Modified: MacRuby/trunk/spec/frozen/core/process/initgroups_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/initgroups_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/initgroups_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,12 +1,12 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Process.initgroups" do
- it "requires two arguments" do
- lambda { Process.initgroups }.should raise_error(ArgumentError)
- lambda { Process.initgroups("root") }.should raise_error(ArgumentError)
- end
+ platform_is_not :windows do
+ it "requires two arguments" do
+ lambda { Process.initgroups }.should raise_error(ArgumentError)
+ lambda { Process.initgroups("root") }.should raise_error(ArgumentError)
+ end
- platform_is_not :windows do
it "initializes the supplemental group access list" do
name = `id -un`.strip
groups = Process.groups
Modified: MacRuby/trunk/spec/frozen/core/process/kill_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/kill_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/kill_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
# if run indirectly (eg via CI), kills the runner. TODO: needs guard
describe "Process.kill" do
@@ -42,8 +42,8 @@
end
end
- it "raises an EPERM if permission is denied" do
- if Process.uid != 0
+ if Process.uid != 0
+ it "raises an EPERM if permission is denied" do
lambda { Process.kill(1, 1) }.should raise_error(Errno::EPERM)
end
end
Modified: MacRuby/trunk/spec/frozen/core/process/maxgroups_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/maxgroups_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/maxgroups_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Process.maxgroups" do
it "returns the maximum number of gids allowed in the supplemental group access list" do
Modified: MacRuby/trunk/spec/frozen/core/process/pid_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/pid_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/pid_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Process.pid" do
it "returns the process id of this process" do
Modified: MacRuby/trunk/spec/frozen/core/process/ppid_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/ppid_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/ppid_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,20 +1,22 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Process.ppid" do
- it "returns the process id of the parent of this process" do
+ with_feature :fork do
+ it "returns the process id of the parent of this process" do
- read, write = IO.pipe
+ read, write = IO.pipe
- child_pid = Process.fork {
+ child_pid = Process.fork {
+ read.close
+ write << "#{Process.ppid}\n"
+ write.close
+ exit!
+ }
+ write.close
+ pid = read.gets
read.close
- write << "#{Process.ppid}\n"
- write.close
- exit!
- }
- write.close
- pid = read.gets
- read.close
- Process.wait(child_pid)
- pid.to_i.should == Process.pid
+ Process.wait(child_pid)
+ pid.to_i.should == Process.pid
+ end
end
end
Modified: MacRuby/trunk/spec/frozen/core/process/setpgid_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/setpgid_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/setpgid_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,28 +1,32 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Process.setpgid" do
- it "requires two arguments" do
- lambda { Process.setpgid }.should raise_error(ArgumentError)
- lambda { Process.setpgid(0) }.should raise_error(ArgumentError)
+ platform_is_not :windows do
+ it "requires two arguments" do
+ lambda { Process.setpgid }.should raise_error(ArgumentError)
+ lambda { Process.setpgid(0) }.should raise_error(ArgumentError)
+ end
end
- it "sets the process group id of the specified process" do
- rd, wr = IO.pipe
+ with_feature :fork do
+ it "sets the process group id of the specified process" do
+ rd, wr = IO.pipe
- pid = Process.fork do
- wr.close
- rd.read
+ pid = Process.fork do
+ wr.close
+ rd.read
+ rd.close
+ Process.exit!
+ end
+
rd.close
- Process.exit!
- end
- rd.close
+ Process.getpgid(pid).should == Process.getpgrp
+ Process.setpgid(pid, pid).should == 0
+ Process.getpgid(pid).should == pid
- Process.getpgid(pid).should == Process.getpgrp
- Process.setpgid(pid, pid).should == 0
- Process.getpgid(pid).should == pid
-
- wr.write ' '
- wr.close
+ wr.write ' '
+ wr.close
+ end
end
end
Modified: MacRuby/trunk/spec/frozen/core/process/setpgrp_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/setpgrp_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/setpgrp_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
# TODO: put these in the right files.
describe "Process.setpgrp and Process.getpgrp" do
Modified: MacRuby/trunk/spec/frozen/core/process/setpriority_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/setpriority_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/setpriority_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,14 +1,16 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Process.setpriority" do
- it "takes three arguments" do
- lambda { Process.setpriority }.should raise_error(ArgumentError)
- lambda {
- Process.setpriority(Process::PRIO_PROCESS)
- }.should raise_error(ArgumentError)
- lambda {
- Process.setpriority(Process::PRIO_PROCESS, 0)
- }.should raise_error(ArgumentError)
+ platform_is_not :windows do
+ it "takes three arguments" do
+ lambda { Process.setpriority }.should raise_error(ArgumentError)
+ lambda {
+ Process.setpriority(Process::PRIO_PROCESS)
+ }.should raise_error(ArgumentError)
+ lambda {
+ Process.setpriority(Process::PRIO_PROCESS, 0)
+ }.should raise_error(ArgumentError)
+ end
end
# Needs a valid version written for Linux
@@ -29,7 +31,7 @@
# Darwin and FreeBSD don't seem to handle these at all, getting all out of
# whack with either permission errors or just the wrong value
- platform_is_not :os => [:darwin, :freebsd] do
+ platform_is_not :os => [:darwin, :freebsd, :windows] do
it "sets the scheduling priority for a specified process group" do
pr = Process.getpriority(Process::PRIO_PGRP, 0)
@@ -54,25 +56,27 @@
end
end
- it "sets the scheduling priority for a specified user" do
- p = Process.getpriority(Process::PRIO_USER, 0)
- if Process.uid == 0
- Process.setpriority(Process::PRIO_USER, 0, p + 1).should == 0
- Process.getpriority(Process::PRIO_USER, 0).should == (p + 1)
- Process.setpriority(Process::PRIO_USER, 0, p).should == 0
- else
- # EACCESS is not always raised. It's a stupid OS behavior.
- ok = false
- begin
- Process.setpriority(Process::PRIO_USER, 0, p - 1)
- ok = true
- rescue Errno::EACCES
- ok = true
- rescue Object
+ 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
+ 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
-
- ok.should == true
end
end
Modified: MacRuby/trunk/spec/frozen/core/process/setrlimit_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/setrlimit_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/setrlimit_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Process.setrlimit" do
platform_is_not :windows do
@@ -11,8 +11,10 @@
end
describe "Process.getrlimit" do
- it "requires one argument" do
- lambda { Process.getrlimit }.should raise_error(ArgumentError)
+ platform_is_not :windows do
+ it "requires one argument" do
+ lambda { Process.getrlimit }.should raise_error(ArgumentError)
+ end
end
end
Modified: MacRuby/trunk/spec/frozen/core/process/setsid_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/setsid_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/setsid_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,26 +1,30 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Process.setsid" do
- it "takes no arguments" do
- lambda { Process.setsid(0) }.should raise_error(ArgumentError)
+ platform_is_not :windows do
+ it "takes no arguments" do
+ lambda { Process.setsid(0) }.should raise_error(ArgumentError)
+ end
end
- it "establishes this process as a new session and process group leader" do
- read, write = IO.pipe
- pid = Process.fork {
- begin
- read.close
- pgid = Process.setsid
- write << pgid.class.to_s
- write.close
- rescue Exception => e
- write << e << e.backtrace
- end
- Process.exit!
- }
- write.close
- klass = read.gets
- read.close
- klass.should == "Fixnum"
+ with_feature :fork do
+ it "establishes this process as a new session and process group leader" do
+ read, write = IO.pipe
+ pid = Process.fork {
+ begin
+ read.close
+ pgid = Process.setsid
+ write << pgid.class.to_s
+ write.close
+ rescue Exception => e
+ write << e << e.backtrace
+ end
+ Process.exit!
+ }
+ write.close
+ klass = read.gets
+ read.close
+ klass.should == "Fixnum"
+ end
end
end
Modified: MacRuby/trunk/spec/frozen/core/process/times_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/times_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/times_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/process/times'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/process/times', __FILE__)
describe "Process.times" do
it_behaves_like :process_times, :times, Process
Modified: MacRuby/trunk/spec/frozen/core/process/uid_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/uid_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/uid_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,9 +1,11 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Process.uid" do
- it "returns the correct uid for the user executing this process" do
- current_uid_according_to_unix = `id -ur`.to_i
- Process.uid.should == current_uid_according_to_unix
+ platform_is_not :windows do
+ it "returns the correct uid for the user executing this process" do
+ current_uid_according_to_unix = `id -ur`.to_i
+ Process.uid.should == current_uid_according_to_unix
+ end
end
it "also goes by Process::UID.rid" do
Modified: MacRuby/trunk/spec/frozen/core/process/wait2_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/wait2_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/wait2_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,10 +1,13 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Process.wait2" do
before :all do
# HACK: this kludge is temporarily necessary because some
# misbehaving spec somewhere else does not clear processes
- Process.waitall
+ begin
+ Process.waitall
+ rescue NotImplementedError
+ end
end
platform_is_not :windows do
Modified: MacRuby/trunk/spec/frozen/core/process/wait_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/wait_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/wait_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,8 +1,11 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Process.wait" do
before :all do
- Process.waitall
+ begin
+ Process.waitall
+ rescue NotImplementedError
+ end
end
it "raises a Errno::ECHILD if there are no child processes" do
Modified: MacRuby/trunk/spec/frozen/core/process/waitall_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/waitall_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/waitall_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,8 +1,11 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Process.waitall" do
before :all do
- Process.waitall
+ begin
+ Process.waitall
+ rescue NotImplementedError
+ end
end
it "returns an empty array when there are no children" do
Modified: MacRuby/trunk/spec/frozen/core/process/waitpid2_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/waitpid2_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/waitpid2_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/process/waitpid_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/process/waitpid_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/process/waitpid_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/random/bytes_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/random/bytes_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/random/bytes_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Random#bytes" do
Modified: MacRuby/trunk/spec/frozen/core/random/equal_value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/random/equal_value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/random/equal_value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Random#==" do
Modified: MacRuby/trunk/spec/frozen/core/random/new_seed_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/random/new_seed_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/random/new_seed_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Random.new_seed" do
Modified: MacRuby/trunk/spec/frozen/core/random/rand_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/random/rand_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/random/rand_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Random.rand" do
Modified: MacRuby/trunk/spec/frozen/core/random/seed_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/random/seed_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/random/seed_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Random#seed" do
Modified: MacRuby/trunk/spec/frozen/core/random/srand_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/random/srand_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/random/srand_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Random.srand" do
Modified: MacRuby/trunk/spec/frozen/core/range/begin_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/range/begin_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/range/begin_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/begin'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/begin', __FILE__)
describe "Range#begin" do
it_behaves_like(:range_begin, :begin)
Modified: MacRuby/trunk/spec/frozen/core/range/case_compare_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/range/case_compare_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/range/case_compare_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/include'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/include', __FILE__)
describe "Range#===" do
it_behaves_like(:range_include, :===)
Modified: MacRuby/trunk/spec/frozen/core/range/cover_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/range/cover_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/range/cover_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.8.8" do
describe "Range#cover?" do
Modified: MacRuby/trunk/spec/frozen/core/range/each_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/range/each_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/range/each_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Range#each" do
it "passes each element to the given block by using #succ" do
@@ -47,7 +47,7 @@
ruby_version_is "1.8.7" do
it "returns an enumerator when no block given" do
enum = (1..3).each
- enum.should be_kind_of(enumerator_class)
+ enum.should be_an_instance_of(enumerator_class)
enum.to_a.should == [1, 2, 3]
end
end
Modified: MacRuby/trunk/spec/frozen/core/range/end_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/range/end_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/range/end_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/end'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/end', __FILE__)
describe "Range#end" do
it_behaves_like(:range_end, :end)
Modified: MacRuby/trunk/spec/frozen/core/range/eql_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/range/eql_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/range/eql_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/equal_value'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/equal_value', __FILE__)
describe "Range#eql?" do
it_behaves_like(:range_eql, :eql?)
Modified: MacRuby/trunk/spec/frozen/core/range/equal_value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/range/equal_value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/range/equal_value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/equal_value'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/equal_value', __FILE__)
describe "Range#==" do
it_behaves_like(:range_eql, :==)
Modified: MacRuby/trunk/spec/frozen/core/range/exclude_end_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/range/exclude_end_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/range/exclude_end_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Range#exclude_end?" do
it "returns true if the range exludes the end value" do
Modified: MacRuby/trunk/spec/frozen/core/range/first_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/range/first_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/range/first_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/begin'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/begin', __FILE__)
describe "Range#first" do
it_behaves_like(:range_begin, :first)
Modified: MacRuby/trunk/spec/frozen/core/range/hash_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/range/hash_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/range/hash_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Range#hash" do
it "is provided" do
Modified: MacRuby/trunk/spec/frozen/core/range/include_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/range/include_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/range/include_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/include'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/include', __FILE__)
describe "Range#include?" do
it_behaves_like(:range_include, :include?)
Modified: MacRuby/trunk/spec/frozen/core/range/initialize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/range/initialize_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/range/initialize_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Range#initialize" do
it "is private" do
Modified: MacRuby/trunk/spec/frozen/core/range/inspect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/range/inspect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/range/inspect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Range#inspect" do
it "provides a printable form, using #inspect to convert the start and end objects" do
Modified: MacRuby/trunk/spec/frozen/core/range/last_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/range/last_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/range/last_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/end'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/end', __FILE__)
describe "Range#last" do
it_behaves_like(:range_end, :last)
Modified: MacRuby/trunk/spec/frozen/core/range/max_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/range/max_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/range/max_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.8.7" do
describe "Range#max" do
Modified: MacRuby/trunk/spec/frozen/core/range/member_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/range/member_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/range/member_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/include'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/include', __FILE__)
describe "Range#member?" do
it_behaves_like(:range_include, :member?)
Modified: MacRuby/trunk/spec/frozen/core/range/min_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/range/min_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/range/min_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.8.7" do
describe "Range#min" do
Modified: MacRuby/trunk/spec/frozen/core/range/new_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/range/new_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/range/new_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Range.new" do
it "constructs a range using the given start and end" do
Modified: MacRuby/trunk/spec/frozen/core/range/shared/equal_value.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/range/shared/equal_value.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/range/shared/equal_value.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -23,8 +23,8 @@
(1..10).send(@method, 'a').should == false
(1..10).send(@method, mock('x')).should == false
end
-
- ruby_bug "redmine #1165", "1.9.2" do
+
+ ruby_version_is "1.9" do
it "returns true for subclasses to Range" do
class MyRange < Range ; end
Range.new(1, 2).send(@method, MyRange.new(1, 2)).should == true
Modified: MacRuby/trunk/spec/frozen/core/range/shared/include.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/range/shared/include.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/range/shared/include.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -15,4 +15,13 @@
(0.5..2.4).send(@method, 2.4).should == true
(0.5...2.4).send(@method, 2.4).should == false
end
+
+ it "compares values using <=>" do
+ rng = (1..5)
+ m = mock("int")
+ m.should_receive(:coerce).and_return([1, 2])
+ m.should_receive(:<=>).and_return(1)
+
+ rng.send(@method, m).should be_false
+ end
end
Modified: MacRuby/trunk/spec/frozen/core/range/step_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/range/step_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/range/step_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Range#step" do
it "passes each nth element to the block" do
@@ -52,7 +52,7 @@
ruby_version_is "1.8.7" do
it "returns an enumerator when no block given" do
enum = (1..10).step(4)
- enum.should be_kind_of(enumerator_class)
+ enum.should be_an_instance_of(enumerator_class)
enum.to_a.should == [1, 5, 9]
end
end
Modified: MacRuby/trunk/spec/frozen/core/range/to_a_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/range/to_a_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/range/to_a_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Range#to_a" do
it "converts self to an array" do
Modified: MacRuby/trunk/spec/frozen/core/range/to_s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/range/to_s_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/range/to_s_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Range#to_s" do
it "provides a printable form of self" do
Modified: MacRuby/trunk/spec/frozen/core/rational/Rational_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/Rational_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/Rational_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/Rational'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/Rational', __FILE__)
-ruby_version_is "1.9" do
describe "Rational() passed two arguments" do
it_behaves_like(:rational_rational_two, :Rational)
end
Modified: MacRuby/trunk/spec/frozen/core/rational/abs_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/abs_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/abs_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/abs'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/abs', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#abs" do
it_behaves_like(:rational_abs, :abs)
end
Modified: MacRuby/trunk/spec/frozen/core/rational/ceil_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/ceil_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/ceil_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/ceil'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/ceil', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#ceil" do
it_behaves_like(:rational_ceil, :ceil)
end
Modified: MacRuby/trunk/spec/frozen/core/rational/coerce_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/coerce_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/coerce_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/coerce'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/coerce', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#coerce" do
it_behaves_like(:rational_coerce, :coerce)
end
Modified: MacRuby/trunk/spec/frozen/core/rational/comparison_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/comparison_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/comparison_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/comparison'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/comparison', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#<=> when passed a Rational object" do
it_behaves_like(:rational_cmp_rat, :<=>)
end
Modified: MacRuby/trunk/spec/frozen/core/rational/denominator_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/denominator_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/denominator_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/denominator'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/denominator', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#denominator" do
it_behaves_like(:rational_denominator, :denominator)
end
Modified: MacRuby/trunk/spec/frozen/core/rational/div_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/div_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/div_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/div'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/div', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#div" do
it_behaves_like(:rational_div, :div)
end
Modified: MacRuby/trunk/spec/frozen/core/rational/divide_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/divide_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/divide_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/divide'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/divide', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#/" do
it_behaves_like(:rational_divide, :/)
end
Modified: MacRuby/trunk/spec/frozen/core/rational/divmod_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/divmod_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/divmod_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/divmod'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/divmod', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#divmod when passed a Rational" do
it_behaves_like(:rational_divmod_rat, :divmod)
end
Modified: MacRuby/trunk/spec/frozen/core/rational/equal_value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/equal_value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/equal_value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/equal_value'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/equal_value', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#==" do
it_behaves_like(:rational_equal_value, :==)
end
@@ -16,4 +16,4 @@
describe "Rational#== when passed an Integer" do
it_behaves_like(:rational_equal_value_int, :==)
end
-end
+end
Modified: MacRuby/trunk/spec/frozen/core/rational/exponent_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/exponent_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/exponent_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/exponent'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/exponent', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#**" do
it_behaves_like(:rational_exponent, :**)
end
Modified: MacRuby/trunk/spec/frozen/core/rational/fdiv_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/fdiv_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/fdiv_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/fdiv'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/fdiv', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#fdiv" do
it_behaves_like(:rational_fdiv, :fdiv)
end
Modified: MacRuby/trunk/spec/frozen/core/rational/floor_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/floor_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/floor_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/floor'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/floor', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#floor" do
it_behaves_like(:rational_floor, :floor)
end
Modified: MacRuby/trunk/spec/frozen/core/rational/hash_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/hash_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/hash_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/hash'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/hash', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#hash" do
it_behaves_like(:rational_hash, :hash)
end
Modified: MacRuby/trunk/spec/frozen/core/rational/initialize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/initialize_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/initialize_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,9 +1,7 @@
-require File.dirname(__FILE__) + '/../../shared/rational/initialize'
-
ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/initialize', __FILE__)
+
describe "Rational#initialize" do
it_behaves_like(:rational_initialize, :initialize)
end
-end
-
-
+end
Modified: MacRuby/trunk/spec/frozen/core/rational/inspect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/inspect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/inspect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/inspect'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/inspect', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#inspect" do
it_behaves_like(:rational_inspect, :inspect)
end
Modified: MacRuby/trunk/spec/frozen/core/rational/integer_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/integer_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/integer_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -3,11 +3,11 @@
it "returns false for a rational with a numerator and no denominator" do
Rational(20).integer?.should be_false
- end
+ end
it "returns false for a rational with a numerator and a denominator" do
Rational(20,3).integer?.should be_false
- end
+ end
end
end
Modified: MacRuby/trunk/spec/frozen/core/rational/minus_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/minus_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/minus_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/minus'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/minus', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#-" do
it_behaves_like(:rational_minus, :-)
end
Modified: MacRuby/trunk/spec/frozen/core/rational/modulo_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/modulo_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/modulo_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/modulo'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/modulo', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#%" do
it_behaves_like(:rational_modulo, :%)
end
Modified: MacRuby/trunk/spec/frozen/core/rational/multiply_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/multiply_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/multiply_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/multiply'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/multiply', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#*" do
it_behaves_like(:rational_multiply, :*)
end
Modified: MacRuby/trunk/spec/frozen/core/rational/numerator_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/numerator_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/numerator_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/numerator'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/numerator', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#numerator" do
it_behaves_like(:rational_numerator, :numerator)
end
Modified: MacRuby/trunk/spec/frozen/core/rational/plus_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/plus_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/plus_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/plus'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/plus', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#+" do
it_behaves_like(:rational_plus, :+)
end
Modified: MacRuby/trunk/spec/frozen/core/rational/quo_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/quo_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/quo_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/divide'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/divide', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#quo" do
it_behaves_like(:rational_divide, :quo)
end
Modified: MacRuby/trunk/spec/frozen/core/rational/rationalize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/rationalize_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/rationalize_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#rationalize" do
it "returns self with no argument" do
Rational(12,3).rationalize.should == Rational(12,3)
Modified: MacRuby/trunk/spec/frozen/core/rational/remainder_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/remainder_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/remainder_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/remainder'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/remainder', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#remainder" do
it_behaves_like(:rational_remainder, :remainder)
end
Modified: MacRuby/trunk/spec/frozen/core/rational/round_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/round_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/round_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/round'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/round', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#round" do
it_behaves_like(:rational_round, :round)
end
Modified: MacRuby/trunk/spec/frozen/core/rational/to_f_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/to_f_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/to_f_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/to_f'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/to_f', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#to_f" do
it_behaves_like(:rational_to_f, :to_f)
end
Modified: MacRuby/trunk/spec/frozen/core/rational/to_i_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/to_i_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/to_i_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/to_i'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/to_i', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#to_i" do
it_behaves_like(:rational_to_i, :to_i)
end
Modified: MacRuby/trunk/spec/frozen/core/rational/to_r_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/to_r_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/to_r_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/to_r'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/to_r', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#to_r" do
it_behaves_like(:rational_to_r, :to_r)
end
Modified: MacRuby/trunk/spec/frozen/core/rational/to_s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/to_s_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/to_s_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/to_s'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/to_s', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#to_s" do
it_behaves_like(:rational_to_s, :to_s)
end
Modified: MacRuby/trunk/spec/frozen/core/rational/truncate_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/rational/truncate_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/rational/truncate_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../shared/rational/truncate'
+ruby_version_is "1.9" do
+ require File.expand_path('../../../shared/rational/truncate', __FILE__)
-ruby_version_is "1.9" do
describe "Rational#truncate" do
it_behaves_like(:rational_truncate, :truncate)
end
Modified: MacRuby/trunk/spec/frozen/core/regexp/case_compare_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/regexp/case_compare_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/regexp/case_compare_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Regexp#===" do
it "is true if there is a match" do
Modified: MacRuby/trunk/spec/frozen/core/regexp/casefold_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/regexp/casefold_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/regexp/casefold_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Regexp#casefold?" do
it "returns the value of the case-insensitive flag" do
Modified: MacRuby/trunk/spec/frozen/core/regexp/compile_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/regexp/compile_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/regexp/compile_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/new'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/new', __FILE__)
describe "Range.compile" do
it_behaves_like :regexp_new, :compile
Modified: MacRuby/trunk/spec/frozen/core/regexp/encoding_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/regexp/encoding_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/regexp/encoding_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-# coding: utf-8
-require File.dirname(__FILE__) + '/../../spec_helper'
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Regexp#encoding" do
Modified: MacRuby/trunk/spec/frozen/core/regexp/eql_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/regexp/eql_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/regexp/eql_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/equal_value'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/equal_value', __FILE__)
describe "Regexp#eql?" do
it_behaves_like(:regexp_eql, :eql?)
Modified: MacRuby/trunk/spec/frozen/core/regexp/equal_value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/regexp/equal_value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/regexp/equal_value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/equal_value'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/equal_value', __FILE__)
describe "Regexp#==" do
it_behaves_like(:regexp_eql, :==)
Modified: MacRuby/trunk/spec/frozen/core/regexp/escape_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/regexp/escape_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/regexp/escape_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/quote'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/quote', __FILE__)
describe "Range.escape" do
it_behaves_like(:regexp_quote, :escape)
Modified: MacRuby/trunk/spec/frozen/core/regexp/fixed_encoding_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/regexp/fixed_encoding_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/regexp/fixed_encoding_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-# coding: utf-8
-require File.dirname(__FILE__) + '/../../spec_helper'
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Regexp#fixed_encoding?" do
Modified: MacRuby/trunk/spec/frozen/core/regexp/hash_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/regexp/hash_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/regexp/hash_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Regexp#hash" do
it "is provided" do
Modified: MacRuby/trunk/spec/frozen/core/regexp/initialize_copy_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/regexp/initialize_copy_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/regexp/initialize_copy_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/regexp/initialize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/regexp/initialize_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/regexp/initialize_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/regexp/inspect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/regexp/inspect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/regexp/inspect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Regexp#inspect" do
it "returns a formatted string that would eval to the same regexp" do
Modified: MacRuby/trunk/spec/frozen/core/regexp/kcode_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/regexp/kcode_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/regexp/kcode_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is ""..."1.9" do
describe "Regexp#kcode" do
Modified: MacRuby/trunk/spec/frozen/core/regexp/last_match_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/regexp/last_match_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/regexp/last_match_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Regexp.last_match" do
it "returns MatchData instance when not passed arguments" do
Modified: MacRuby/trunk/spec/frozen/core/regexp/match_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/regexp/match_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/regexp/match_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/match'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/match', __FILE__)
describe "Regexp#=~" do
it_behaves_like(:regexp_match, :=~)
@@ -8,10 +8,24 @@
describe "Regexp#match" do
it_behaves_like(:regexp_match, :match)
- it "should coerce Exceptions into strings" do
- f = Exception.new("foo")
- /foo/.match(f)[0].should == "foo"
+ it "raises TypeError when the given argument cannot be coarce to String" do
+ f = 1
+ lambda { /foo/.match(f)[0] }.should raise_error(TypeError)
end
+
+ ruby_version_is ""..."1.9" do
+ it "coerces Exceptions into strings" do
+ f = Exception.new("foo")
+ /foo/.match(f)[0].should == "foo"
+ end
+ end
+
+ ruby_version_is "1.9" do
+ it "raises TypeError when the given argument is an Exception" do
+ f = Exception.new("foo")
+ lambda { /foo/.match(f)[0] }.should raise_error(TypeError)
+ end
+ end
end
describe "Regexp#~" do
Modified: MacRuby/trunk/spec/frozen/core/regexp/new_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/regexp/new_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/regexp/new_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/new'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/new', __FILE__)
describe "Regexp.new" do
it_behaves_like :regexp_new, :new
Modified: MacRuby/trunk/spec/frozen/core/regexp/options_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/regexp/options_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/regexp/options_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Regexp#options" do
it "returns a Fixnum bitvector of regexp options for the Regexp object" do
Modified: MacRuby/trunk/spec/frozen/core/regexp/quote_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/regexp/quote_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/regexp/quote_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/quote'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/quote', __FILE__)
describe "Regexp.quote" do
it_behaves_like(:regexp_quote, :quote)
Modified: MacRuby/trunk/spec/frozen/core/regexp/shared/match.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/regexp/shared/match.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/regexp/shared/match.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,9 +1,9 @@
describe :regexp_match, :shared => true do
it "returns nil if there is no match" do
- /xyz/.send(@method,"abxyc").should == nil
+ /xyz/.send(@method,"abxyc").should be_nil
end
it "returns nil if the object is nil" do
- /\w+/.send(@method, nil).should == nil
+ /\w+/.send(@method, nil).should be_nil
end
end
Modified: MacRuby/trunk/spec/frozen/core/regexp/source_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/regexp/source_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/regexp/source_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Regexp#source" do
it "returns the original string of the pattern" do
Modified: MacRuby/trunk/spec/frozen/core/regexp/to_s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/regexp/to_s_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/regexp/to_s_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Regexp#to_s" do
it "displays options if included" do
Modified: MacRuby/trunk/spec/frozen/core/regexp/try_convert_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/regexp/try_convert_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/regexp/try_convert_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Regexp.try_convert" do
Modified: MacRuby/trunk/spec/frozen/core/regexp/union_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/regexp/union_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/regexp/union_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Regexp.union" do
it "returns /(?!)/ when passed no arguments" do
Modified: MacRuby/trunk/spec/frozen/core/regexp/versions/named_captures_1.9.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/regexp/versions/named_captures_1.9.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/regexp/versions/named_captures_1.9.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe "Regexp#named_captures" do
it "returns a Hash" do
Modified: MacRuby/trunk/spec/frozen/core/regexp/versions/names_1.9.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/regexp/versions/names_1.9.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/regexp/versions/names_1.9.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../../spec_helper'
+require File.expand_path('../../../../spec_helper', __FILE__)
describe "Regexp#names" do
it "returns an Array" do
Modified: MacRuby/trunk/spec/frozen/core/signal/list_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/signal/list_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/signal/list_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Signal.list" do
RUBY18_SIGNALS = %w{
Modified: MacRuby/trunk/spec/frozen/core/signal/trap_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/signal/trap_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/signal/trap_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/string/allocate_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/allocate_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/allocate_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "String.allocate" do
it "returns an instance of String" do
Modified: MacRuby/trunk/spec/frozen/core/string/append_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/append_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/append_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
-require File.dirname(__FILE__) + '/shared/concat.rb'
+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, :<<
Modified: MacRuby/trunk/spec/frozen/core/string/ascii_only_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/ascii_only_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/ascii_only_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,8 +1,8 @@
# -*- encoding: utf-8 -*-
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
-ruby_version_is '1.9' do
+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
Modified: MacRuby/trunk/spec/frozen/core/string/bytes_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/bytes_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/bytes_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,14 +1,14 @@
# -*- encoding: utf-8 -*-
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
-ruby_version_is "1.8.7" do
+with_feature :encoding_transition do
describe "String#bytes" do
before(:each) do
@utf8 = "東京"
@ascii = 'Tokyo'
@utf8_ascii = @utf8 + @ascii
- end
-
+ end
+
it "returns an Enumerator when no block is given" do
@utf8.bytes.should be_kind_of(Enumerable)
end
@@ -18,7 +18,7 @@
@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
@@ -28,7 +28,6 @@
@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
@@ -37,17 +36,19 @@
''.bytes.to_a.should == []
end
- # #getbyte and #force_encoding are 1.9 methods
- ruby_version_is "1.9" 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
+
+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
+end
Modified: MacRuby/trunk/spec/frozen/core/string/bytesize_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/bytesize_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/bytesize_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,8 +1,8 @@
# -*- encoding: utf-8 -*-
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "#String#bytesize" do
it "needs to be reviewed for spec completeness"
Modified: MacRuby/trunk/spec/frozen/core/string/capitalize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/capitalize_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/capitalize_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
# -*- encoding: utf-8 -*-
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#capitalize" do
it "returns a copy of self with the first character converted to uppercase and the remainder to lowercase" do
Modified: MacRuby/trunk/spec/frozen/core/string/casecmp_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/casecmp_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/casecmp_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+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
Modified: MacRuby/trunk/spec/frozen/core/string/center_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/center_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/center_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#center with length, padding" do
it "returns a new string of specified length with self centered and padded with padstr" do
Modified: MacRuby/trunk/spec/frozen/core/string/chars_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/chars_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/chars_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/shared/chars'
+require File.expand_path('../shared/chars', __FILE__)
ruby_version_is '1.8.7' do
describe "String#chars" do
Modified: MacRuby/trunk/spec/frozen/core/string/chomp_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/chomp_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/chomp_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#chomp with separator" do
it "returns a new string with the given record separator removed" do
@@ -134,28 +134,37 @@
"hello".chomp!(nil).should == nil
end
- ruby_version_is ""..."1.9" do
+ ruby_version_is ""..."1.9" do
it "raises a TypeError when self is frozen" do
a = "string\n\r"
a.freeze
lambda { a.chomp! }.should raise_error(TypeError)
+ end
- a.chomp!(nil) # ok, no change
- a.chomp!("x") # ok, no change
+ it "does not raise an exception when the string would not be modified" do
+ a = "string\n\r"
+ a.freeze
+
+ a.chomp!(nil).should be_nil
+ a.chomp!("x").should be_nil
end
end
- ruby_version_is "1.9" do
- ruby_bug "[ruby-core:23666]", "1.9.2" do
- it "raises a RuntimeError when self is frozen" do
- a = "string\n\r"
- a.freeze
+ ruby_version_is "1.9" do
+ it "raises a RuntimeError on a frozen instance when it is modified" do
+ a = "string\n\r"
+ a.freeze
- lambda { a.chomp! }.should raise_error(RuntimeError)
- lambda { a.chomp!(nil) }.should raise_error(RuntimeError)
- lambda { a.chomp!("x") }.should raise_error(RuntimeError)
- end
+ lambda { a.chomp! }.should raise_error(RuntimeError)
end
- end
+
+ # see [ruby-core:23666]
+ it "raises a RuntimeError on a frozen instance when it would not be modified" do
+ a = "string\n\r"
+ a.freeze
+ lambda { a.chomp!(nil) }.should raise_error(RuntimeError)
+ lambda { a.chomp!("x") }.should raise_error(RuntimeError)
+ end
+ end
end
Modified: MacRuby/trunk/spec/frozen/core/string/chop_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/chop_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/chop_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,38 +1,19 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#chop" do
- ruby_version_is "".."1.9" do
- it "returns a new string with the last character removed" do
- "hello\n".chop.should == "hello"
- "hello\x00".chop.should == "hello"
- "hello".chop.should == "hell"
-
- ori_str = ""
- 256.times { |i| ori_str << i }
-
- str = ori_str
- 256.times do |i|
- str = str.chop
- str.should == ori_str[0, 255 - i]
- end
- end
- end
+ it "returns a new string with the last character removed" do
+ "hello\n".chop.should == "hello"
+ "hello\x00".chop.should == "hello"
+ "hello".chop.should == "hell"
- ruby_version_is "1.9" do
- it "returns a new string with the last character removed" do
- "hello\n".chop.should == "hello"
- "hello\x00".chop.should == "hello"
- "hello".chop.should == "hell"
-
- ori_str = ""
- 256.times { |i| ori_str.encode('UTF-8') << i }
-
- str = ori_str
- 256.times do |i|
- str = str.chop
- str.should == ori_str[0, 255 - i]
- end
+ ori_str = encode("", "utf-8")
+ 256.times { |i| ori_str << i }
+
+ str = ori_str
+ 256.times do |i|
+ str = str.chop
+ str.should == ori_str[0, 255 - i]
end
end
@@ -84,27 +65,24 @@
ruby_version_is ""..."1.9" do
it "raises a TypeError when self is frozen" do
- a = "string\n\r"
- a.freeze
- lambda { a.chop! }.should raise_error(TypeError)
+ lambda { "string\n\r".freeze.chop! }.should raise_error(TypeError)
+ end
- a = ""
- a.freeze
- a.chop! # ok, no change
+ it "does not raise an exception on a frozen instance that would not be modified" do
+ "".freeze.chop!.should be_nil
end
end
ruby_version_is "1.9" do
- ruby_bug "[ruby-core:23666]", "1.9.2" do
- it "raises a RuntimeError when self is frozen" do
- a = "string\n\r"
- a.freeze
- lambda { a.chop! }.should raise_error(RuntimeError)
+ it "raises a RuntimeError on a frozen instance that is modified" do
+ lambda { "string\n\r".freeze.chop! }.should raise_error(RuntimeError)
+ end
- a = ""
- a.freeze
- lambda { a.chop! }.should raise_error(RuntimeError)
- end
+ # see [ruby-core:23666]
+ it "raises a RuntimeError on a frozen instance that would not be modified" do
+ a = ""
+ a.freeze
+ lambda { a.chop! }.should raise_error(RuntimeError)
end
end
end
Modified: MacRuby/trunk/spec/frozen/core/string/chr_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/chr_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/chr_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "String#chr" do
it "returns a copy of self" do
s = 'e'
Modified: MacRuby/trunk/spec/frozen/core/string/clear_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/clear_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/clear_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "String#clear" do
before(:each) do
@s = "Jolene"
Modified: MacRuby/trunk/spec/frozen/core/string/codepoints_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/codepoints_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/codepoints_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,7 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/codepoints'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/codepoints', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "String#codepoints" do
it_behaves_like(:string_codepoints, :codepoints)
end
Modified: MacRuby/trunk/spec/frozen/core/string/comparison_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/comparison_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/comparison_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#<=> with String" do
it "compares individual characters based on their ascii value" do
Modified: MacRuby/trunk/spec/frozen/core/string/concat_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/concat_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/concat_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
-require File.dirname(__FILE__) + '/shared/concat.rb'
+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
Modified: MacRuby/trunk/spec/frozen/core/string/count_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/count_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/count_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#count" do
it "counts occurrences of chars from the intersection of the specified sets" do
Modified: MacRuby/trunk/spec/frozen/core/string/crypt_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/crypt_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/crypt_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#crypt" do
# Note: MRI's documentation just says that the C stdlib function crypt() is
@@ -28,44 +28,44 @@
"hello world".crypt("aabc").should == "aayPz4hyPS1wI"
end
- platform_is_not :darwin do
- not_compliant_on :jruby do
- it "returns an empty string when the salt starts NULL bytes" do
+ platform_is :java do
+ it "returns NULL bytes prepended to the string when the salt contains NULL bytes" do
+ "hello".crypt("\x00\x00").should == "\x00\x00dR0/E99ehpU"
+ "hello".crypt("\x00a").should == "\x00aeipc4xPxhGY"
+ "hello".crypt("a\x00").should == "a\x00GJVggM8eWwo"
+ end
+ end
+
+ platform_is_not :java do
+ platform_is :darwin, :netbsd, :openbsd do
+ it "returns '.' prepended to the string for each NULL byte the salt contains" do
+ "hello".crypt("\x00\x00").should == "..dR0/E99ehpU"
+ "hello".crypt("\x00a").should == ".aeipc4xPxhGY"
+ "hello".crypt("a\x00").should == "a.GJVggM8eWwo"
+ end
+ end
+
+ platform_is :freebsd do
+ it "returns an empty string when the salt starts with NULL bytes" do
"hello".crypt("\x00\x00").should == ""
"hello".crypt("\x00a").should == ""
end
it "ignores trailing NULL bytes in the salt but counts them for the 2 character minimum" do
- "hello".crypt("a\x00").should == "aa1dYAU.hgL3A"
+ "hello".crypt("a\x00").should == "aaGJVggM8eWwo"
end
end
- # TODO: verify this
- deviates_on :jruby do
- it "returns NULL bytes prepended to the string when the salt contains NULL bytes" do
- "hello".crypt("\x00\x00").should == "\x00\x00dR0/E99ehpU"
- "hello".crypt("\x00a").should == "\000aeipc4xPxhGY"
- "hello".crypt("a\x00").should == "a\000GJVggM8eWwo"
+ platform_is :linux do
+ it "returns an empty string when the salt starts with NULL bytes" do
+ "hello".crypt("\x00\x00").should == ""
+ "hello".crypt("\x00a").should == ""
end
- end
- end
- platform_is :darwin do
- not_compliant_on :jruby do
- it "returns '.' prepended to the string for each NULL byte the salt contains" do
- "hello".crypt("\x00\x00").should == "..dR0/E99ehpU"
- "hello".crypt("\x00a").should == ".aeipc4xPxhGY"
- "hello".crypt("a\x00").should == "a.GJVggM8eWwo"
+ it "ignores trailing NULL bytes in the salt but counts them for the 2 character minimum" do
+ "hello".crypt("a\x00").should == "aa1dYAU.hgL3A"
end
end
-
- deviates_on :jruby do
- it "returns NULL bytes prepended to the string when the salt contains NULL bytes" do
- "hello".crypt("\x00\x00").should == "\x00\x00dR0/E99ehpU"
- "hello".crypt("\x00a").should == "\000aeipc4xPxhGY"
- "hello".crypt("a\x00").should == "a\000GJVggM8eWwo"
- end
- end
end
it "raises an ArgumentError when the salt is shorter than two characters" do
Modified: MacRuby/trunk/spec/frozen/core/string/delete_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/delete_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/delete_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#delete" do
it "returns a new string with the chars from the intersection of sets removed" do
Modified: MacRuby/trunk/spec/frozen/core/string/downcase_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/downcase_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/downcase_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
# -*- encoding: utf-8 -*-
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#downcase" do
it "returns a copy of self with all uppercase letters downcased" do
Modified: MacRuby/trunk/spec/frozen/core/string/dump_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/dump_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/dump_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
# -*- encoding: utf-8 -*-
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#dump" do
ruby_version_is ""..."1.9" do
@@ -16,12 +16,13 @@
it "returns a string with nonprinting charaters replaced by \\x notation" do
("\000".."A").to_a.join('').should == "\x00\x01\x02\x03\x04\x05\x06\a\b\t\n\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\e\x1C\x1D\x1E\x1F !\"\#$%&'()*+,-./0123456789:;<=>?@A"
end
+
# This test is based on my observations; the precise workings of this
# feature are unknown to me
- it "includes .force_encoding(name) if the encoding isn't ASCII compatible" do
- "\u{876}".encode('utf-16be').dump.should ==
+ it "includes .force_encoding(name) if the encoding isn't ASCII compatiable" do
+ "\u{876}".encode('utf-16be').dump.should ==
"\"\\bv\".force_encoding(\"UTF-16BE\")"
- "\u{876}".encode('utf-16le').dump.should ==
+ "\u{876}".encode('utf-16le').dump.should ==
"\"v\\b\".force_encoding(\"UTF-16LE\")"
end
end
Modified: MacRuby/trunk/spec/frozen/core/string/each_byte_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/each_byte_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/each_byte_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+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
@@ -41,7 +41,7 @@
ruby_version_is "1.8.7" do
it "returns an enumerator when no block given" do
enum = "hello".each_byte
- enum.should be_kind_of(enumerator_class)
+ enum.should be_an_instance_of(enumerator_class)
enum.to_a.should == [104, 101, 108, 108, 111]
end
end
Modified: MacRuby/trunk/spec/frozen/core/string/each_char_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/each_char_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/each_char_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/shared/chars'
+require File.expand_path('../shared/chars', __FILE__)
ruby_version_is '1.8.7' do
describe "String#each_char" do
Modified: MacRuby/trunk/spec/frozen/core/string/each_codepoint_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/each_codepoint_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/each_codepoint_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,7 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/codepoints'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/codepoints', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "String#each_codepoint" do
it_behaves_like(:string_codepoints, :each_codepoint)
end
Modified: MacRuby/trunk/spec/frozen/core/string/each_line_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/each_line_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/each_line_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/each_line'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/each_line', __FILE__)
describe "String#each_line" do
it_behaves_like(:string_each_line, :each_line)
Modified: MacRuby/trunk/spec/frozen/core/string/each_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/each_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/each_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,16 +1,9 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/each_line'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/each_line', __FILE__)
describe "String#each" do
ruby_version_is ''...'1.9' do
it_behaves_like(:string_each_line, :each)
end
-
- ruby_version_is '1.9' do
- it "raises a NoMethodError" do
- lambda { "gone in 1.9".each }.should raise_error(NoMethodError)
- end
- end
-
end
Modified: MacRuby/trunk/spec/frozen/core/string/element_reference_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/element_reference_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/element_reference_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
-require File.dirname(__FILE__) + '/shared/slice.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
+require File.expand_path('../shared/slice.rb', __FILE__)
describe "String#[]" do
it_behaves_like :string_slice, :[]
Modified: MacRuby/trunk/spec/frozen/core/string/element_set_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/element_set_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/element_set_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
# TODO: Add missing String#[]= specs:
# String#[range] = obj
@@ -138,12 +138,6 @@
str.should == "hello"
end
- it "raises IndexError if the regexp index doesn't match a position in the string" do
- str = "hello"
- lambda { str[/y/] = "bam" }.should raise_error(IndexError)
- str.should == "hello"
- end
-
ruby_version_is ""..."1.9" do
it "raises a TypeError when self is frozen" do
a = "hello"
@@ -189,6 +183,41 @@
end
end
+describe "String#[]= matching with a Regexp" do
+ it "replaces the matched text with the rhs" do
+ str = "hello"
+ str[/lo/] = "x"
+ str.should == "helx"
+ end
+
+ it "raises IndexError if the regexp index doesn't match a position in the string" do
+ str = "hello"
+ lambda { str[/y/] = "bam" }.should raise_error(IndexError)
+ str.should == "hello"
+ end
+
+ describe "with 3 arguments" do
+ it "uses the 2nd of 3 arguments as which capture should be replaced" do
+ str = "aaa bbb ccc"
+ str[/a (bbb) c/, 1] = "ddd"
+ str.should == "aaa ddd ccc"
+ end
+
+ it "allows the specified capture to be negative and count from the end" do
+ str = "abcd"
+ str[/(a)(b)(c)(d)/, -2] = "e"
+ str.should == "abed"
+ end
+
+ it "raises IndexError if the specified capture isn't available" do
+ str = "aaa bbb ccc"
+ lambda { str[/a (bbb) c/, 2] = "ddd" }.should raise_error(IndexError)
+ lambda { str[/a (bbb) c/, -2] = "ddd" }.should raise_error(IndexError)
+ end
+ end
+
+end
+
describe "String#[]= with index, count" do
it "starts at idx and overwrites count characters before inserting the rest of other_str" do
a = "hello"
Modified: MacRuby/trunk/spec/frozen/core/string/empty_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/empty_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/empty_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#empty?" do
it "returns true if the string has a length of zero" do
Modified: MacRuby/trunk/spec/frozen/core/string/encode_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/encode_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/encode_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,8 @@
-# coding: utf-8
-require File.dirname(__FILE__) + '/shared/encode'
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/encode', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "String#encode with no arguments" do
before(:each) do
@original_encoding = Encoding.default_internal
@@ -71,4 +72,43 @@
str.encoding.should == Encoding::UTF_8
end
end
-end
\ No newline at end of file
+
+ describe "String#encode!" do
+ it_behaves_like :encode_string, :encode!
+
+ it "raises a RuntimeError when called on a frozen String" do
+ lambda do
+ "foo".freeze.encode!(Encoding::ANSI_X3_4_1968)
+ end.should raise_error(RuntimeError)
+ end
+
+ # http://redmine.ruby-lang.org/issues/show/1836
+ it "raises a RuntimeError when called on a frozen String when it's a no-op" do
+ lambda do
+ "foo".freeze.encode!("foo".encoding)
+ end.should raise_error(RuntimeError)
+ end
+
+ it "returns self when called with only a target encoding" do
+ str = "strung"
+ str.encode!(Encoding::BINARY).should == str.force_encoding(Encoding::BINARY)
+ end
+
+ it "returns self when called with only a target encoding" do
+ str = "strung"
+ str.encode!(Encoding::BINARY,Encoding::ASCII).should == str.force_encoding(Encoding::BINARY)
+ end
+
+ it "returns self even when no changes are made" do
+ str = "strung"
+ str.encode!(Encoding::UTF_8).should == str
+ end
+
+ it "tags the String with the given encoding" do
+ str = "ürst"
+ str.encoding.should == Encoding::UTF_8
+ str.encode!(Encoding::UTF_16LE)
+ str.encoding.should == Encoding::UTF_16LE
+ end
+ end
+end
Modified: MacRuby/trunk/spec/frozen/core/string/encoding_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/encoding_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/encoding_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,7 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/iso-8859-9-encoding'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/iso-8859-9-encoding', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "String#encoding" do
it "returns an Encoding object" do
String.new.encoding.should be_an_instance_of(Encoding)
Modified: MacRuby/trunk/spec/frozen/core/string/end_with_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/end_with_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/end_with_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
# -*- encoding: utf-8 -*-
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
ruby_version_is '1.8.7' do
describe "String#end_with?" do
Modified: MacRuby/trunk/spec/frozen/core/string/entries_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/entries_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/entries_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/to_a'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/to_a', __FILE__)
ruby_version_is ""..."1.9" do
describe "String#entries" do
Modified: MacRuby/trunk/spec/frozen/core/string/eql_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/eql_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/eql_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
-require File.dirname(__FILE__) + '/shared/equal_value.rb'
+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?)
Modified: MacRuby/trunk/spec/frozen/core/string/equal_value_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/equal_value_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/equal_value_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
-require File.dirname(__FILE__) + '/shared/equal_value.rb'
+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, :==)
Modified: MacRuby/trunk/spec/frozen/core/string/fixtures/iso-8859-9-encoding.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/fixtures/iso-8859-9-encoding.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/fixtures/iso-8859-9-encoding.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-# coding: iso-8859-9
+# -*- encoding: iso-8859-9 -*-
module StringSpecs
class ISO88599Encoding
def source_encoding; __ENCODING__; end
Modified: MacRuby/trunk/spec/frozen/core/string/force_encoding_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/force_encoding_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/force_encoding_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,6 @@
+require File.expand_path('../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "String#force_encoding" do
it "requires exactly one argument" do
lambda {
Modified: MacRuby/trunk/spec/frozen/core/string/getbyte_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/getbyte_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/getbyte_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-# coding: utf-8
-require File.dirname(__FILE__) + '/../../spec_helper'
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.8.8" do
describe "String#getbyte" do
Modified: MacRuby/trunk/spec/frozen/core/string/gsub_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/gsub_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/gsub_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,8 +1,29 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#gsub with pattern and replacement" do
+ before :each do
+ @kcode = $KCODE
+ end
+
+ after :each do
+ $KCODE = @kcode
+ end
+
+ it "inserts the replacement around every character when the pattern collapses" do
+ "hello".gsub(//, ".").should == ".h.e.l.l.o."
+ end
+
+ it "respects $KCODE when the pattern collapses" do
+ str = "こにちわ"
+ reg = %r!!
+
+ $KCODE = "utf-8"
+ str.gsub(reg, ".").should == ".こ.に.ち.わ."
+ end
+
it "doesn't freak out when replacing ^" do
"Text\n".gsub(/^/, ' ').should == " Text\n"
"Text\nFoo".gsub(/^/, ' ').should == " Text\n Foo"
@@ -13,8 +34,6 @@
str = "hello homely world. hah!"
str.gsub(/\Ah\S+\s*/, "huh? ").should == "huh? homely world. hah!"
-
- "hello".gsub(//, ".").should == ".h.e.l.l.o."
end
it "ignores a block if supplied" do
@@ -444,35 +463,40 @@
a.gsub!(/./, "foo".untrust).untrusted?.should == true
end
end
-
+
it "returns nil if no modifications were made" do
a = "hello"
a.gsub!(/z/, '*').should == nil
a.gsub!(/z/, 'z').should == nil
a.should == "hello"
end
-
+
ruby_version_is ""..."1.9" do
- it "raises a TypeError when self is frozen" do
+ it "does not raise an error if the frozen string would not be modified" do
s = "hello"
s.freeze
-
- s.gsub!(/ROAR/, "x") # ok
+
+ s.gsub!(/ROAR/, "x").should be_nil
+ end
+
+ it "raises a TypeError if the frozen string would be modified" do
+ s = "hello"
+ s.freeze
+
lambda { s.gsub!(/e/, "e") }.should raise_error(TypeError)
lambda { s.gsub!(/[aeiou]/, '*') }.should raise_error(TypeError)
end
end
+ # See [ruby-core:23666]
ruby_version_is "1.9" do
- ruby_bug "[ruby-core:23666]", "1.9.2" do
- it "raises a RuntimeError when self is frozen" do
- s = "hello"
- s.freeze
-
- lambda { s.gsub!(/ROAR/, "x") }.should raise_error(RuntimeError)
- lambda { s.gsub!(/e/, "e") }.should raise_error(RuntimeError)
- lambda { s.gsub!(/[aeiou]/, '*') }.should raise_error(RuntimeError)
- end
+ it "raises a RuntimeError when self is frozen" do
+ s = "hello"
+ s.freeze
+
+ lambda { s.gsub!(/ROAR/, "x") }.should raise_error(RuntimeError)
+ lambda { s.gsub!(/e/, "e") }.should raise_error(RuntimeError)
+ lambda { s.gsub!(/[aeiou]/, '*') }.should raise_error(RuntimeError)
end
end
end
@@ -497,15 +521,33 @@
a.gsub!(/./) { "foo".untrust }.untrusted?.should == true
end
end
-
+
it "returns nil if no modifications were made" do
a = "hello"
a.gsub!(/z/) { '*' }.should == nil
a.gsub!(/z/) { 'z' }.should == nil
a.should == "hello"
end
-
- ruby_bug "[ruby-core:23663]", "1.9" do
+
+ ruby_version_is ""..."1.9" do
+ it "does not raise an error if the frozen string would not be modified" do
+ s = "hello"
+ s.freeze
+
+ s.gsub!(/ROAR/) { "x" }.should be_nil
+ end
+
+ 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
+
+ # See [ruby-core:23663]
+ ruby_version_is "1.9" do
it "raises a RuntimeError when self is frozen" do
s = "hello"
s.freeze
Modified: MacRuby/trunk/spec/frozen/core/string/hash_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/hash_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/hash_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#hash" do
it "returns a hash based on a string's length and content" do
Modified: MacRuby/trunk/spec/frozen/core/string/hex_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/hex_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/hex_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
# TODO: Move actual results to String#to_int() and spec in terms of it
describe "String#hex" do
Modified: MacRuby/trunk/spec/frozen/core/string/include_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/include_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/include_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#include? with String" do
it "returns true if self contains other_str" do
Modified: MacRuby/trunk/spec/frozen/core/string/index_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/index_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/index_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#index with object" do
it "raises a TypeError if obj isn't a String, Fixnum or Regexp" do
@@ -212,23 +212,19 @@
end
describe "String#index with Regexp" do
- # This test fails on 1.9.2 because it handles empty regexps wrongly, i.e.
- # when the regexp is //, the expectation isn't met.
- ruby_bug "#1553", "1.9.2" do
- it "behaves the same as String#index(string) for escaped string regexps" do
- ["blablabla", "hello cruel world...!"].each do |str|
- ["", "b", "bla", "lab", "o c", "d."].each do |needle|
- regexp = Regexp.new(Regexp.escape(needle))
- str.index(regexp).should == str.index(needle)
-
- 0.upto(str.size + 1) do |start|
- str.index(regexp, start).should == str.index(needle, start)
- end
-
- (-str.size - 1).upto(-1) do |start|
- str.index(regexp, start).should == str.index(needle, start)
- end
+ it "behaves the same as String#index(string) for escaped string regexps" do
+ ["blablabla", "hello cruel world...!"].each do |str|
+ ["", "b", "bla", "lab", "o c", "d."].each do |needle|
+ regexp = Regexp.new(Regexp.escape(needle))
+ str.index(regexp).should == str.index(needle)
+
+ 0.upto(str.size + 1) do |start|
+ str.index(regexp, start).should == str.index(needle, start)
end
+
+ (-str.size - 1).upto(-1) do |start|
+ str.index(regexp, start).should == str.index(needle, start)
+ end
end
end
end
@@ -312,10 +308,8 @@
"blaxbla".index(/..x/, 2).should == nil
end
- ruby_bug "#1553", "1.9.2" do
- it "returns nil if the Regexp matches the empty string and the offset is out of range" do
- "ruby".index(//,12).should be_nil
- end
+ it "returns nil if the Regexp matches the empty string and the offset is out of range" do
+ "ruby".index(//,12).should be_nil
end
it "supports \\G which matches at the given start offset" do
Modified: MacRuby/trunk/spec/frozen/core/string/initialize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/initialize_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/initialize_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,19 +1,11 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#initialize" do
- ruby_version_is ""..."1.9" do
- it "is a private method" do
- "".private_methods.should include("initialize")
- end
+ it "is a private method" do
+ String.should have_private_instance_method(:initialize)
end
- ruby_version_is "1.9" do
- it "is a private method" do
- "".private_methods.should include(:initialize)
- end
- end
-
it "replaces contents of self with the passed string" do
s = "some string"
id = s.object_id
@@ -63,21 +55,27 @@
lambda { String.new nil }.should raise_error(TypeError)
end
- ruby_version_is ""..."1.9" do
- it "raises a TypeError if self is frozen" do
+ ruby_version_is ""..."1.9" do
+ it "raises a TypeError on a frozen instance that is modified" do
a = "hello".freeze
-
- a.send :initialize, a
lambda { a.send :initialize, "world" }.should raise_error(TypeError)
end
- end
- ruby_version_is "1.9" do
- it "raises a RuntimeError if self is frozen" do
+ it "does not raise an exception on a frozen instance that would not be modified" do
a = "hello".freeze
+ a.send(:initialize, a).should equal(a)
+ end
+ end
- a.send :initialize, a
+ ruby_version_is "1.9" do
+ it "raises a RuntimeError on a frozen instance that is modified" do
+ a = "hello".freeze
lambda { a.send :initialize, "world" }.should raise_error(RuntimeError)
end
- end
+
+ it "raises a RuntimeError on a frozen instance that would not be modified" do
+ a = "hello".freeze
+ lambda { a.send :initialize, a }.should raise_error(RuntimeError)
+ end
+ end
end
Modified: MacRuby/trunk/spec/frozen/core/string/insert_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/insert_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/insert_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#insert with index, other" do
it "inserts other before the character at the given index" do
Modified: MacRuby/trunk/spec/frozen/core/string/inspect_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/inspect_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/inspect_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
# -*- encoding: utf-8 -*-
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+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
Modified: MacRuby/trunk/spec/frozen/core/string/intern_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/intern_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/intern_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
-require File.dirname(__FILE__) + '/shared/to_sym.rb'
+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)
Modified: MacRuby/trunk/spec/frozen/core/string/length_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/length_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/length_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
-require File.dirname(__FILE__) + '/shared/length'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
+require File.expand_path('../shared/length', __FILE__)
describe "String#length" do
it_behaves_like(:string_length, :length)
Modified: MacRuby/trunk/spec/frozen/core/string/lines_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/lines_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/lines_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/each_line'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/each_line', __FILE__)
ruby_version_is "1.8.7" do
describe "String#lines" do
Modified: MacRuby/trunk/spec/frozen/core/string/ljust_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/ljust_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/ljust_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#ljust with length, padding" do
it "returns a new string of specified length with self left justified and padded with padstr" do
Modified: MacRuby/trunk/spec/frozen/core/string/lstrip_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/lstrip_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/lstrip_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#lstrip" do
it "returns a copy of self with leading whitespace removed" do
@@ -36,22 +36,26 @@
a.should == "hello"
end
- ruby_version_is ""..."1.9" do
- it "raises a TypeError if self is frozen" do
- "hello".freeze.lstrip! # ok, nothing changed
- "".freeze.lstrip! # ok, nothing changed
-
+ ruby_version_is ""..."1.9" do
+ it "raises a TypeError on a frozen instance that is modified" do
lambda { " hello ".freeze.lstrip! }.should raise_error(TypeError)
end
+
+ it "does not raise an exception on a frozen instance that would not be modified" do
+ "hello".freeze.lstrip!.should be_nil
+ "".freeze.lstrip!.should be_nil
+ end
end
- ruby_version_is "1.9" do
- ruby_bug "#1550", "1.9.2" do
- it "raises a RuntimeError if self is frozen" do
- lambda { "hello".freeze.lstrip! }.should raise_error(RuntimeError)
- lambda { "".freeze.lstrip! }.should raise_error(RuntimeError)
- lambda { " hello ".freeze.lstrip! }.should raise_error(RuntimeError)
- end
+ ruby_version_is "1.9" do
+ it "raises a RuntimeError on a frozen instance that is modified" do
+ lambda { " hello ".freeze.lstrip! }.should raise_error(RuntimeError)
end
+
+ # see [ruby-core:23657]
+ it "raises a RuntimeError on a frozen instance that would not be modified" do
+ lambda { "hello".freeze.lstrip! }.should raise_error(RuntimeError)
+ lambda { "".freeze.lstrip! }.should raise_error(RuntimeError)
+ end
end
end
Modified: MacRuby/trunk/spec/frozen/core/string/match_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/match_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/match_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#=~" do
it "behaves the same way as index() when given a regexp" do
Modified: MacRuby/trunk/spec/frozen/core/string/modulo_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/modulo_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/modulo_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#%" do
it "formats multiple expressions" do
Modified: MacRuby/trunk/spec/frozen/core/string/multiply_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/multiply_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/multiply_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#*" do
it "returns a new string containing count copies of self" do
Modified: MacRuby/trunk/spec/frozen/core/string/new_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/new_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/new_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "String.new" do
it "returns an instance of String" do
Modified: MacRuby/trunk/spec/frozen/core/string/next_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/next_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/next_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
-require File.dirname(__FILE__) + '/shared/succ.rb'
+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)
Modified: MacRuby/trunk/spec/frozen/core/string/oct_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/oct_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/oct_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,25 +1,68 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
# Note: We can't completely spec this in terms of to_int() because hex()
# allows the base to be changed by a base specifier in the string.
# See http://groups.google.com/group/ruby-core-google/browse_frm/thread/b53e9c2003425703
describe "String#oct" do
- it "treats leading characters of self as a string of oct digits" do
+ it "treats numeric digits as base-8 digits by default" do
"0".oct.should == 0
"77".oct.should == 077
- "78".oct.should == 7
"077".oct.should == 077
- "0o".oct.should == 0
+ end
- "755_333".oct.should == 0755_333
- "5678".oct.should == 0567
+ it "accepts numbers formatted as binary" do
+ "0b1010".oct.should == 0b1010
+ end
- "0b1010".oct.should == 0b1010
+ it "accepts numbers formatted as hexadecimal" do
"0xFF".oct.should == 0xFF
+ end
+
+ it "accepts numbers formatted as decimal" do
"0d500".oct.should == 500
end
-
+
+ describe "with a leading minus sign" do
+ it "treats numeric digits as base-8 digits by default" do
+ "-12348".oct.should == -01234
+ end
+
+ it "accepts numbers formatted as binary" do
+ "-0b0101".oct.should == -0b0101
+ end
+
+ it "accepts numbers formatted as hexadecimal" do
+ "-0xEE".oct.should == -0xEE
+ end
+
+ it "accepts numbers formatted as decimal" do
+ "-0d500".oct.should == -500
+ end
+ end
+
+ describe "with a leading plus sign" do
+ it "treats numeric digits as base-8 digits by default" do
+ "+12348".oct.should == 01234
+ end
+
+ it "accepts numbers formatted as binary" do
+ "+0b1010".oct.should == 0b1010
+ end
+
+ it "accepts numbers formatted as hexadecimal" do
+ "+0xFF".oct.should == 0xFF
+ end
+
+ it "accepts numbers formatted as decimal" do
+ "+0d500".oct.should == 500
+ end
+ end
+
+ it "accepts a single underscore separating digits" do
+ "755_333".oct.should == 0755_333
+ end
+
ruby_version_is "" ... "1.8.7" do
it "accepts a sequence of underscores as part of a number" do
"7__3".oct.should == 073
@@ -27,7 +70,7 @@
"7__5".oct.should == 075
end
end
-
+
ruby_version_is "1.8.7" do
it "does not accept a sequence of underscores as part of a number" do
"7__3".oct.should == 07
@@ -35,13 +78,13 @@
"7__5".oct.should == 07
end
end
-
- it "takes an optional sign" do
- "-1234".oct.should == -01234
- "+1234".oct.should == 01234
+
+ it "ignores characters that are incorrect for the base-8 digits" do
+ "0o".oct.should == 0
+ "5678".oct.should == 0567
end
-
- it "returns 0 on error" do
+
+ it "returns 0 if no characters can be interpreted as a base-8 number" do
"".oct.should == 0
"+-5".oct.should == 0
"wombat".oct.should == 0
Modified: MacRuby/trunk/spec/frozen/core/string/ord_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/ord_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/ord_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
-ruby_version_is "1.8.8" do
+with_feature :encoding do
describe "String#ord" do
it "returns a Fixnum" do
'a'.ord.should be_an_instance_of(Fixnum)
Modified: MacRuby/trunk/spec/frozen/core/string/partition_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/partition_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/partition_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
ruby_version_is '1.8.7' do
describe "String#partition with String" do
Modified: MacRuby/trunk/spec/frozen/core/string/plus_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/plus_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/plus_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#+" do
it "returns a new string containing the given string concatenated to self" do
Modified: MacRuby/trunk/spec/frozen/core/string/replace_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/replace_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/replace_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#replace" do
it "replaces the content of self with other and returns self" do
@@ -28,24 +28,29 @@
end
ruby_version_is ""..."1.9" do
- it "raises a TypeError if self is frozen" do
+ it "raises a TypeError on a frozen instance that is modified" do
a = "hello".freeze
-
- a.replace(a) # ok, no change
lambda { a.replace("") }.should raise_error(TypeError)
lambda { a.replace("world") }.should raise_error(TypeError)
end
+
+ it "does not raise an exception on a frozen instance that would not be modified" do
+ a = "hello".freeze
+ a.freeze.replace(a).should equal(a)
+ end
end
ruby_version_is "1.9" do
- ruby_bug "[ruby-core:23666]", "1.9.2" do
- it "raises a RuntimeError if self is frozen" do
- a = "hello".freeze
+ it "raises a RuntimeError on a frozen instance that is modified" do
+ a = "hello".freeze
+ lambda { a.replace("") }.should raise_error(RuntimeError)
+ lambda { a.replace("world") }.should raise_error(RuntimeError)
+ end
- lambda { a.replace(a) }.should raise_error(RuntimeError)
- lambda { a.replace("") }.should raise_error(RuntimeError)
- lambda { a.replace("world") }.should raise_error(RuntimeError)
- end
+ # see [ruby-core:23666]
+ it "raises a RuntimeError on a frozen instance that would not be modified" do
+ a = "hello".freeze
+ lambda { a.freeze.replace(a) }.should raise_error(RuntimeError)
end
end
end
Modified: MacRuby/trunk/spec/frozen/core/string/reverse_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/reverse_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/reverse_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#reverse" do
it "returns a new string with the characters of self in reverse order" do
@@ -24,20 +24,25 @@
end
ruby_version_is ""..."1.9" do
- it "raises a TypeError if self is frozen" do
- "".freeze.reverse! # ok, no change
+ it "raises a TypeError on a frozen instance that is modified" do
lambda { "anna".freeze.reverse! }.should raise_error(TypeError)
lambda { "hello".freeze.reverse! }.should raise_error(TypeError)
end
+
+ it "does not raise an exception on a frozen instance that would not be modified" do
+ "".freeze.reverse!.should == ""
+ end
end
ruby_version_is "1.9" do
- ruby_bug "[ruby-core:23666]", "1.9.2" do
- it "raises a RuntimeError if self is frozen" do
- lambda { "".freeze.reverse! }.should raise_error(RuntimeError)
- lambda { "anna".freeze.reverse! }.should raise_error(RuntimeError)
- lambda { "hello".freeze.reverse! }.should raise_error(RuntimeError)
- end
+ it "raises a RuntimeError on a frozen instance that is modified" do
+ lambda { "anna".freeze.reverse! }.should raise_error(RuntimeError)
+ lambda { "hello".freeze.reverse! }.should raise_error(RuntimeError)
end
- end
+
+ # see [ruby-core:23666]
+ it "raises a RuntimeError on a frozen instance that would not be modified" do
+ lambda { "".freeze.reverse! }.should raise_error(RuntimeError)
+ end
+ end
end
Modified: MacRuby/trunk/spec/frozen/core/string/rindex_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/rindex_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/rindex_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#rindex with object" do
it "raises a TypeError if obj isn't a String, Fixnum or Regexp" do
Modified: MacRuby/trunk/spec/frozen/core/string/rjust_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/rjust_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/rjust_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#rjust with length, padding" do
it "returns a new string of specified length with self right justified and padded with padstr" do
Modified: MacRuby/trunk/spec/frozen/core/string/rpartition_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/rpartition_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/rpartition_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
ruby_version_is '1.8.7' do
describe "String#rpartition with String" do
@@ -16,6 +16,11 @@
"hello!".rpartition(/l./).should == ["hel", "lo", "!"]
end
+ it "affects $~" do
+ matched_string = "hello!".rpartition(/l./)[1]
+ matched_string.should == $~[0]
+ end
+
ruby_bug "redmine #1510", '1.9.1' do
it "converts its argument using :to_str" do
find = mock('l')
Modified: MacRuby/trunk/spec/frozen/core/string/rstrip_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/rstrip_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/rstrip_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#rstrip" do
it "returns a copy of self with trailing whitespace removed" do
@@ -31,21 +31,25 @@
end
ruby_version_is ""..."1.9" do
- it "raises a TypeError if self is frozen" do
- "hello".freeze.rstrip! # ok, nothing changed
- "".freeze.rstrip! # ok, nothing changed
-
+ it "raises a TypeError on a frozen instance that is modified" do
lambda { " hello ".freeze.rstrip! }.should raise_error(TypeError)
end
+
+ it "does not raise an exception on a frozen instance that would not be modified" do
+ "hello".freeze.rstrip!.should be_nil # ok, nothing changed
+ "".freeze.rstrip!.should be_nil # ok, nothing changed
+ end
end
-
+
ruby_version_is "1.9" do
- ruby_bug "[ruby-core:23666]", "1.9.2" do
- it "raises a RuntimeError if self is frozen" do
- lambda { "hello".freeze.rstrip! }.should raise_error(RuntimeError)
- lambda { "".freeze.rstrip! }.should raise_error(RuntimeError)
- lambda { " hello ".freeze.rstrip! }.should raise_error(RuntimeError)
- end
+ it "raises a RuntimeError on a frozen instance that is modified" do
+ lambda { " hello ".freeze.rstrip! }.should raise_error(RuntimeError)
end
- end
+
+ # see [ruby-core:23666]
+ it "raises a RuntimeError on a frozen instance that would not be modified" do
+ lambda { "hello".freeze.rstrip! }.should raise_error(RuntimeError)
+ lambda { "".freeze.rstrip! }.should raise_error(RuntimeError)
+ end
+ end
end
Modified: MacRuby/trunk/spec/frozen/core/string/scan_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/scan_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/scan_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,16 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#scan" do
+ before :each do
+ @kcode = $KCODE
+ end
+
+ after :each do
+ $KCODE = @kcode
+ end
+
it "returns an array containing all matches" do
"cruel world".scan(/\w+/).should == ["cruel", "world"]
"cruel world".scan(/.../).should == ["cru", "el ", "wor"]
@@ -11,6 +20,15 @@
"".scan(//).should == [""]
end
+ it "respects $KCODE when the pattern collapses to nothing" do
+ str = "こにちわ"
+ reg = %r!!
+
+ $KCODE = "utf-8"
+
+ str.scan(reg).should == ["", "", "", "", ""]
+ end
+
it "stores groups as arrays in the returned arrays" do
"hello".scan(/()/).should == [[""]] * 6
"hello".scan(/()()/).should == [["", ""]] * 6
Modified: MacRuby/trunk/spec/frozen/core/string/setbyte_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/setbyte_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/setbyte_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.8.8" do
describe "String#setbyte" do
Modified: MacRuby/trunk/spec/frozen/core/string/shared/chars.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/shared/chars.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/shared/chars.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-# encoding: utf-8
-require File.dirname(__FILE__) + '/../../../spec_helper'
-require File.dirname(__FILE__) + '/../fixtures/classes'
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
describe :string_chars, :shared => true do
it "passes each char in self to the given block" do
@@ -18,7 +18,7 @@
it "returns an enumerator when no block given" do
enum = "hello".send(@method)
- enum.should be_kind_of(enumerator_class)
+ enum.should be_an_instance_of(enumerator_class)
enum.to_a.should == ['h', 'e', 'l', 'l', 'o']
end
@@ -30,7 +30,7 @@
$KCODE = before
end
- ruby_version_is "1.9" do
+ with_feature :encoding do
it "returns characters in the same encoding as self" do
"&%".force_encoding('Shift_JIS').chars.to_a.all? {|c| c.encoding.name.should == 'Shift_JIS'}
"&%".encode('ASCII-8BIT').chars.to_a.all? {|c| c.encoding.name.should == 'ASCII-8BIT'}
Modified: MacRuby/trunk/spec/frozen/core/string/shared/codepoints.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/shared/codepoints.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/shared/codepoints.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,13 +1,13 @@
describe :string_codepoints, :shared => true do
it "returns an Enumerator when no block is given" do
- "".send(@method).should be_an_instance_of(Enumerator)
+ "".send(@method).should be_an_instance_of(enumerator_class)
end
it "returns an Enumerator when no block is given even when self has an invalid encoding" do
s = "\xDF".force_encoding(Encoding::UTF_8)
s.valid_encoding?.should be_false
- "".send(@method).should be_an_instance_of(Enumerator)
+ "".send(@method).should be_an_instance_of(enumerator_class)
end
it "raises an ArgumentError when self has an invalid encoding and a method is called on the returned Enumerator" do
Modified: MacRuby/trunk/spec/frozen/core/string/shared/concat.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/shared/concat.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/shared/concat.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -26,6 +26,7 @@
lambda { a.send(@method, "test") }.should raise_error(TypeError)
end
end
+
ruby_version_is "1.9" do
it "raises a RuntimeError when self is frozen" do
a = "hello"
@@ -34,13 +35,15 @@
lambda { a.send(@method, "") }.should raise_error(RuntimeError)
lambda { a.send(@method, "test") }.should raise_error(RuntimeError)
end
- end
- ruby_version_is "1.9" do
- it "raises ArgumentError for negative length argument" do
+ it "raises RangeError for negative length argument" do
lambda do
'glark'.force_encoding('UTF-8').send(@method, -200)
- end.should raise_error(ArgumentError)
+ end.should raise_error(RangeError)
+
+ lambda do
+ 'glark'.force_encoding('UTF-8').send(@method, -2**64)
+ end.should raise_error(RangeError)
end
end
Modified: MacRuby/trunk/spec/frozen/core/string/shared/each_line.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/shared/each_line.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/shared/each_line.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -25,10 +25,14 @@
a.should == ["one\ntwo\r\nthree"]
end
- it "appends multiple successive newlines together when the separator is an empty string" do
+ it "yields paragraphs (broken by 2 or more successive newlines) when passed ''" do
a = []
"hello\nworld\n\n\nand\nuniverse\n\n\n\n\n".send(@method, '') { |s| a << s }
a.should == ["hello\nworld\n\n\n", "and\nuniverse\n\n\n\n\n"]
+
+ a = []
+ "hello\nworld\n\n\nand\nuniverse\n\n\n\n\ndog".send(@method, '') { |s| a << s }
+ a.should == ["hello\nworld\n\n\n", "and\nuniverse\n\n\n\n\n", "dog"]
end
it "uses $/ as the separator when none is given" do
@@ -103,16 +107,19 @@
end
ruby_version_is '1.9' do
- it "accept string-like separator" do
+ it "accept string separator" do
"hello world".send(@method, ?o).to_a.should == ["hello", " wo", "rld"]
- "hello world".send(@method, :o).to_a.should == ["hello", " wo", "rld"]
end
+
+ it "raises a TypeError when the separator is a symbol" do
+ lambda { "hello world".send(@method, :o).to_a }.should raise_error(TypeError)
+ end
end
ruby_version_is "1.8.7" do
it "returns an enumerator when no block given" do
enum = "hello world".send(@method, ' ')
- enum.should be_kind_of(enumerator_class)
+ enum.should be_an_instance_of(enumerator_class)
enum.to_a.should == ["hello ", "world"]
end
end
Modified: MacRuby/trunk/spec/frozen/core/string/shared/encode.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/shared/encode.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/shared/encode.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-# coding: utf-8
+# -*- encoding: utf-8 -*-
describe :encode_string, :shared => true do
it "transcodes to the default internal encoding with no argument" do
begin
Modified: MacRuby/trunk/spec/frozen/core/string/size_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/size_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/size_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
-require File.dirname(__FILE__) + '/shared/length'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
+require File.expand_path('../shared/length', __FILE__)
describe "String#size" do
it_behaves_like(:string_length, :size)
Modified: MacRuby/trunk/spec/frozen/core/string/slice_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/slice_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/slice_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
-require File.dirname(__FILE__) + '/shared/slice.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
+require File.expand_path('../shared/slice.rb', __FILE__)
describe "String#slice" do
it_behaves_like :string_slice, :slice
@@ -228,21 +228,23 @@
a.slice!(range_incl).should == "OO"
end
- ruby_version_is ""..."1.9" do
- it "raises a TypeError if self is frozen" do
+ ruby_version_is ""..."1.9" do
+ it "raises a TypeError on a frozen instance that would be modifed" do
lambda { "hello".freeze.slice!(1..3) }.should raise_error(TypeError)
end
- ruby_bug "#1551", "1.9.2" do
- it "doesn't raise a TypeError if self is frozen but the given range is out of self" do
- "hello".freeze.slice!(10..20).should == nil
- end
+ it "does not raise an exception on a frozen instance that would not be modified" do
+ "hello".freeze.slice!(10..20).should be_nil
end
end
- ruby_version_is "1.9" do
- it "raises a RuntimeError if self is frozen" do
+ ruby_version_is "1.9" do
+ it "raises a RuntimeError on a frozen instance that is modified" do
lambda { "hello".freeze.slice!(1..3) }.should raise_error(RuntimeError)
+ end
+
+ # see redmine #1551
+ it "raises a RuntimeError on a frozen instance that would not be modified" do
lambda { "hello".freeze.slice!(10..20)}.should raise_error(RuntimeError)
end
end
@@ -293,8 +295,6 @@
s.slice!(/../).should be_kind_of(StringSpecs::MyString)
end
- # This currently fails, but passes in a pure Rubinius environment (without mspec)
- # probably because mspec uses match internally for its operation
it "sets $~ to MatchData when there is a match and nil when there's none" do
'hello'.slice!(/./)
$~[0].should == 'h'
@@ -303,17 +303,23 @@
$~.should == nil
end
- ruby_version_is ""..."1.9" do
- it "raises a TypeError if self is frozen" do
+ ruby_version_is ""..."1.9" do
+ it "raises a TypeError on a frozen instance that is modified" do
lambda { "this is a string".freeze.slice!(/s.*t/) }.should raise_error(TypeError)
end
+
+ it "does not raise an exception on a frozen instance that would not be modified" do
+ "this is a string".freeze.slice!(/zzz/).should be_nil
+ end
end
- ruby_version_is "1.9" do
- it "raises a RuntimeError if self is frozen" do
+ ruby_version_is "1.9" do
+ it "raises a RuntimeError on a frozen instance that is modified" do
lambda { "this is a string".freeze.slice!(/s.*t/) }.should raise_error(RuntimeError)
+ end
+
+ it "raises a RuntimeError on a frozen instance that would not be modified" do
lambda { "this is a string".freeze.slice!(/zzz/) }.should raise_error(RuntimeError)
- lambda { "this is a string".freeze.slice!(/zzz/) }.should raise_error(RuntimeError)
end
end
end
Modified: MacRuby/trunk/spec/frozen/core/string/split_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/split_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/split_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,17 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#split with String" do
+
+ before :each do
+ @kcode = $KCODE
+ end
+
+ after :each do
+ $KCODE = @kcode
+ end
+
it "returns an array of substrings based on splitting on the given string" do
"mellow yellow".split("ello").should == ["m", "w y", "w"]
end
@@ -227,6 +237,16 @@
"hi mom".split(/\s*/).should == ["h", "i", "m", "o", "m"]
end
+ it "respects $KCODE when splitting between characters" do
+ str = "こにちわ"
+ reg = %r!!
+
+ $KCODE = "utf-8"
+ ary = str.split(reg)
+ ary.size.should == 4
+ ary.should == ["こ", "に", "ち", "わ"]
+ end
+
it "includes all captures in the result array" do
"hello".split(/(el)/).should == ["h", "el", "lo"]
"hi!".split(/()/).should == ["h", "", "i", "", "!"]
@@ -285,12 +305,20 @@
["", "x:y:z:", " x y "].each do |str|
[//, /:/, /\s+/].each do |pat|
[-1, 0, 1, 2].each do |limit|
- str.dup.taint.split(pat).each do |x|
- x.tainted?.should == true
+ str.dup.taint.split(pat, limit).each do |x|
+ x.tainted?.should be_true
end
+ end
+ end
+ end
+ end
- str.split(pat.dup.taint).each do |x|
- x.tainted?.should == false
+ it "doesn't taints the resulting strings if the Regexp is tainted" do
+ ["", "x:y:z:", " x y "].each do |str|
+ [//, /:/, /\s+/].each do |pat|
+ [-1, 0, 1, 2].each do |limit|
+ str.split(pat.dup.taint, limit).each do |x|
+ x.tainted?.should be_false
end
end
end
Modified: MacRuby/trunk/spec/frozen/core/string/squeeze_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/squeeze_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/squeeze_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#squeeze" do
it "returns new string where runs of the same character are replaced by a single character when no args are given" do
Modified: MacRuby/trunk/spec/frozen/core/string/start_with_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/start_with_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/start_with_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
# -*- encoding: utf-8 -*-
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
ruby_version_is '1.8.7' do
describe "String#start_with?" do
Modified: MacRuby/trunk/spec/frozen/core/string/strip_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/strip_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/strip_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#strip" do
it "returns a new string with leading and trailing whitespace removed" do
@@ -30,21 +30,25 @@
end
ruby_version_is ""..."1.9" do
- it "raises a TypeError if self is frozen" do
- "hello".freeze.strip! # ok, nothing changed
- "".freeze.strip! # ok, nothing changed
-
+ it "raises a TypeError on a frozen instance that is modified" do
lambda { " hello ".freeze.strip! }.should raise_error(TypeError)
end
+
+ it "does not raise an exception on a frozen instance that would not be modified" do
+ "hello".freeze.strip!.should be_nil
+ "".freeze.strip!.should be_nil
+ end
end
ruby_version_is "1.9" do
- ruby_bug "#1552", "1.9.2" do
- it "raises a RuntimeError if self is frozen" do
- lambda {"hello".freeze.strip! }.should raise_error(RuntimeError)
- lambda {"".freeze.strip! }.should raise_error(RuntimeError)
- lambda { " hello ".freeze.strip! }.should raise_error(RuntimeError)
- end
+ it "raises a RuntimeError on a frozen instance that is modified" do
+ lambda { " hello ".freeze.strip! }.should raise_error(RuntimeError)
end
+
+ # see #1552
+ it "raises a RuntimeError on a frozen instance that would not be modified" do
+ lambda {"hello".freeze.strip! }.should raise_error(RuntimeError)
+ lambda {"".freeze.strip! }.should raise_error(RuntimeError)
+ end
end
end
Modified: MacRuby/trunk/spec/frozen/core/string/sub_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/sub_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/sub_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#sub with pattern, replacement" do
it "returns a copy of self with all occurrences of pattern replaced with replacement" do
@@ -339,7 +339,7 @@
end
ruby_version_is "1.9" do
- ruby_bug "[ruby-core:23666]", "1.9.2" do
+ ruby_bug "[ruby-core:23666]", "1.9" do
it "raises a RuntimeError when self is frozen" do
s = "hello"
s.freeze
Modified: MacRuby/trunk/spec/frozen/core/string/succ_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/succ_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/succ_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
-require File.dirname(__FILE__) + '/shared/succ.rb'
+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)
Modified: MacRuby/trunk/spec/frozen/core/string/sum_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/sum_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/sum_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#sum" do
it "returns a basic n-bit checksum of the characters in self" do
Modified: MacRuby/trunk/spec/frozen/core/string/swapcase_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/swapcase_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/swapcase_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
# -*- encoding: utf-8 -*-
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#swapcase" do
it "returns a new string with all uppercase chars from self converted to lowercase and vice versa" do
Modified: MacRuby/trunk/spec/frozen/core/string/to_a_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/to_a_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/to_a_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/to_a'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/to_a', __FILE__)
ruby_version_is ""..."1.9" do
describe "String#to_a" do
Modified: MacRuby/trunk/spec/frozen/core/string/to_c_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/to_c_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/to_c_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "String#to_c" do
Modified: MacRuby/trunk/spec/frozen/core/string/to_f_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/to_f_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/to_f_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
# src.scan(/[+-]?[\d_]+\.[\d_]+(e[+-]?[\d_]+)?\b|[+-]?[\d_]+e[+-]?[\d_]+\b/i)
Modified: MacRuby/trunk/spec/frozen/core/string/to_i_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/to_i_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/to_i_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#to_i" do
# Ruby 1.9 doesn't allow underscores and spaces as part of a number
Modified: MacRuby/trunk/spec/frozen/core/string/to_r_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/to_r_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/to_r_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "String#to_r" do
Modified: MacRuby/trunk/spec/frozen/core/string/to_s_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/to_s_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/to_s_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
-require File.dirname(__FILE__) + '/shared/to_s.rb'
+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)
Modified: MacRuby/trunk/spec/frozen/core/string/to_str_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/to_str_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/to_str_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
-require File.dirname(__FILE__) + '/shared/to_s.rb'
+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)
Modified: MacRuby/trunk/spec/frozen/core/string/to_sym_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/to_sym_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/to_sym_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
-require File.dirname(__FILE__) + '/shared/to_sym.rb'
+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)
Modified: MacRuby/trunk/spec/frozen/core/string/tr_s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/tr_s_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/tr_s_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#tr_s" do
it "returns a string processed according to tr with newly duplicate characters removed" do
Modified: MacRuby/trunk/spec/frozen/core/string/tr_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/tr_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/tr_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-# coding: utf-8
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#tr" do
it "returns a new string with the characters from from_string replaced by the ones in to_string" do
@@ -60,7 +60,7 @@
end
end
- ruby_version_is "1.9" do
+ with_feature :encoding do
# http://redmine.ruby-lang.org/issues/show/1839
it "can replace a 7-bit ASCII character with a multibyte one" do
a = "uber"
Modified: MacRuby/trunk/spec/frozen/core/string/try_convert_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/try_convert_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/try_convert_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "String.try_convert" do
ruby_version_is "1.9" do
Modified: MacRuby/trunk/spec/frozen/core/string/unpack_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/unpack_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/unpack_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
if ENV['MRI'] then
$: << 'kernel/core'
@@ -107,7 +107,6 @@
it "returns an array in little-endian (native format) order by decoding self according to the format string" do
"\xF3\x02\x00\x42\x32\x23\xB3\xF0".unpack('Q').should == [17344245288696546035]
"\xF3\x02".unpack('Q*').should == []
- "\xF3\xFF\xFF\xFF\x32\x0B\x02\x00".unpack('Q2').should == [575263624658931]
"\xF3\x02\xC0\x42\x3A\x87\xF3\x00\xFA\xFF\x00\x02\x32\x87\xF3\xEE".unpack('Q*').should ==
[68547103638422259, 17218254449219272698]
"\xF3\x02\x00\x42".unpack('q').should == [nil]
@@ -119,13 +118,24 @@
[68547068192358922, -1228489624490278918]
"\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
+ it "pads nil when the string is short" do
+ "\xF3\xFF\xFF\xFF\x32\x0B\x02\x00".unpack('Q2').should == [575263624658931, nil]
+ end
+ end
end
big_endian do
it "returns an array in big-endian (native format) order by decoding self according to the format string" do
"\xF3\x02\x00\x42\x32\x23\xB3\xF0".unpack('Q').should == [17510558585478951920]
"\xF3\x02".unpack('Q*').should == []
- "\xF3\xFF\xFF\xFF\x32\x0B\x02\x00".unpack('Q2').should == [17582052941799031296]
"\xF3\x02\xC0\x42\x3A\x87\xF3\x00\xFA\xFF\x00\x02\x32\x87\xF3\xEE".unpack('Q*').should ==
[17510769691852272384, 18086174637980906478]
"\xF3\x02\x00\x42".unpack('q').should == [nil]
@@ -137,6 +147,18 @@
[721138899770405632, -360569435728645138]
"\x7F\x77\x77\x77\x77\x77\x77\x77".unpack('q0Q*').should == [9184941320034547575]
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 == [17582052941799031296]
+ end
+ end
+
+ ruby_version_is "1.8.8" do
+ it "pads nil when the string is short" do
+ "\xF3\xFF\xFF\xFF\x32\x0B\x02\x00".unpack('Q2').should == [17582052941799031296, nil]
+ end
+ end
end
little_endian do
Modified: MacRuby/trunk/spec/frozen/core/string/upcase_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/upcase_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/upcase_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
# -*- encoding: utf-8 -*-
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#upcase" do
it "returns a copy of self with all lowercase letters upcased" do
Modified: MacRuby/trunk/spec/frozen/core/string/upto_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/upto_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/upto_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes.rb'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#upto" do
it "passes successive values, starting at self and ending at other_string, to the block" do
@@ -86,13 +86,13 @@
end
ruby_version_is '1.9' do
- it "works with symbols" do
- "a".upto(:c).to_a.should == ["a", "b", "c"]
+ it "does not work with symbols" do
+ lambda { "a".upto(:c).to_a }.should raise_error(TypeError)
end
it "returns an enumerator when no block given" do
enum = "aaa".upto("baa", true)
- enum.should be_kind_of(enumerator_class)
+ enum.should be_an_instance_of(enumerator_class)
enum.count.should == 26**2
end
Modified: MacRuby/trunk/spec/frozen/core/string/valid_encoding_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/valid_encoding_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/string/valid_encoding_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
-ruby_version_is "1.9" do
+with_feature :encoding do
describe "String#valid_encoding?" do
it "returns true if the String's encoding is valid" do
"a".valid_encoding?.should be_true
Modified: MacRuby/trunk/spec/frozen/core/struct/each_pair_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/struct/each_pair_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/struct/each_pair_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Struct#each_pair" do
it "passes each key value pair to the given block" do
@@ -19,7 +19,7 @@
ruby_version_is "1.8.7" do
it "returns an Enumerator if not passed a block" do
car = Struct::Car.new('Ford', 'Ranger')
- car.each_pair.should be_kind_of(enumerator_class)
+ car.each_pair.should be_an_instance_of(enumerator_class)
end
end
end
Modified: MacRuby/trunk/spec/frozen/core/struct/each_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/struct/each_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/struct/each_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Struct#each" do
it "passes each value to the given block" do
@@ -20,7 +20,7 @@
ruby_version_is "1.8.7" do
it "returns an Enumerator if not passed a block" do
car = Struct::Car.new('Ford', 'Ranger')
- car.each.should be_kind_of(enumerator_class)
+ car.each.should be_an_instance_of(enumerator_class)
end
end
end
Modified: MacRuby/trunk/spec/frozen/core/struct/element_reference_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/struct/element_reference_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/struct/element_reference_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Struct[]" do
it "is a synonym for new" do
Modified: MacRuby/trunk/spec/frozen/core/struct/element_set_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/struct/element_set_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/struct/element_set_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Struct#[]=" do
it "assigns the passed value" do
Modified: MacRuby/trunk/spec/frozen/core/struct/eql_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/struct/eql_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/struct/eql_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/equal_value'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/equal_value', __FILE__)
describe "Struct#eql?" do
it_behaves_like(:struct_equal_value, :eql?)
Modified: MacRuby/trunk/spec/frozen/core/struct/equal_value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/struct/equal_value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/struct/equal_value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/equal_value'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/equal_value', __FILE__)
describe "Struct#==" do
it_behaves_like(:struct_equal_value, :==)
Modified: MacRuby/trunk/spec/frozen/core/struct/hash_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/struct/hash_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/struct/hash_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Struct#hash" do
Modified: MacRuby/trunk/spec/frozen/core/struct/initialize_copy_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/struct/initialize_copy_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/struct/initialize_copy_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,3 +1,3 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/struct/initialize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/struct/initialize_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/struct/initialize_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Struct#initialize" do
Modified: MacRuby/trunk/spec/frozen/core/struct/inspect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/struct/inspect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/struct/inspect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/inspect'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/inspect', __FILE__)
describe "Struct#inspect" do
it "returns a string representation of some kind" do
Modified: MacRuby/trunk/spec/frozen/core/struct/length_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/struct/length_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/struct/length_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Struct#length" do
it "returns the number of attributes" do
Modified: MacRuby/trunk/spec/frozen/core/struct/members_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/struct/members_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/struct/members_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Struct#members" do
ruby_version_is ""..."1.9" do
Modified: MacRuby/trunk/spec/frozen/core/struct/new_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/struct/new_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/struct/new_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Struct.new" do
it "creates a constant in Struct namespace with string as first argument" do
Modified: MacRuby/trunk/spec/frozen/core/struct/select_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/struct/select_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/struct/select_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Struct#select" do
it "raises an ArgumentError if given any non-block arguments" do
Modified: MacRuby/trunk/spec/frozen/core/struct/shared/equal_value.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/struct/shared/equal_value.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/struct/shared/equal_value.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -16,7 +16,7 @@
car.send(@method, different_car).should == false
end
- ruby_bug "redmine #1885", "1.9.2" do
+ ruby_bug "redmine #1885", "1.8" do
it "handles recursive structures by returning false if a difference can be found" do
MyClass = Struct.new(:foo)
x = Struct::Car.new("Honda", "Accord", "1998")
@@ -30,5 +30,4 @@
x.send(@method, stepping).should == false
end
end
-
end
Modified: MacRuby/trunk/spec/frozen/core/struct/size_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/struct/size_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/struct/size_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Struct#size" do
it "is a synonym for length" do
Modified: MacRuby/trunk/spec/frozen/core/struct/struct_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/struct/struct_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/struct/struct_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Struct anonymous class instance methods" do
it "Enumerable methods should work" do
Modified: MacRuby/trunk/spec/frozen/core/struct/to_a_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/struct/to_a_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/struct/to_a_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Struct#to_a" do
it "returns the values for this instance as an array" do
Modified: MacRuby/trunk/spec/frozen/core/struct/to_s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/struct/to_s_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/struct/to_s_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/inspect'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/inspect', __FILE__)
describe "Struct#to_s" do
it "is a synonym for inspect" do
Modified: MacRuby/trunk/spec/frozen/core/struct/values_at_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/struct/values_at_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/struct/values_at_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Struct#values_at" do
it "returns an array of values" do
Modified: MacRuby/trunk/spec/frozen/core/struct/values_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/struct/values_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/struct/values_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Struct#values" do
it "is a synonym for to_a" do
Modified: MacRuby/trunk/spec/frozen/core/symbol/all_symbols_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/symbol/all_symbols_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/symbol/all_symbols_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Symbol.all_symbols" do
it "returns an array containing all the Symbols in the symbol table" do
Modified: MacRuby/trunk/spec/frozen/core/symbol/capitalize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/symbol/capitalize_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/symbol/capitalize_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-# encoding: utf-8
-require File.dirname(__FILE__) + '/../../spec_helper'
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Symbol#capitalize" do
Modified: MacRuby/trunk/spec/frozen/core/symbol/case_compare_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/symbol/case_compare_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/symbol/case_compare_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Symbol#===" do
it "returns true when the other is a Symbol" do
Modified: MacRuby/trunk/spec/frozen/core/symbol/casecmp_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/symbol/casecmp_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/symbol/casecmp_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Symbol#casecmp" do
Modified: MacRuby/trunk/spec/frozen/core/symbol/comparison_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/symbol/comparison_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/symbol/comparison_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Symbol#<=> with Symbol" do
Modified: MacRuby/trunk/spec/frozen/core/symbol/downcase_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/symbol/downcase_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/symbol/downcase_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-# encoding: utf-8
-require File.dirname(__FILE__) + '/../../spec_helper'
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Symbol#downcase" do
Modified: MacRuby/trunk/spec/frozen/core/symbol/empty_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/symbol/empty_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/symbol/empty_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Symbol#empty?" do
Modified: MacRuby/trunk/spec/frozen/core/symbol/equal_value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/symbol/equal_value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/symbol/equal_value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Symbol#==" do
it "only returns true when the other is exactly the same symbol" do
Modified: MacRuby/trunk/spec/frozen/core/symbol/id2name_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/symbol/id2name_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/symbol/id2name_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/id2name'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/id2name', __FILE__)
describe "Symbol#id2name" do
it_behaves_like(:symbol_id2name, :id2name)
Modified: MacRuby/trunk/spec/frozen/core/symbol/inspect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/symbol/inspect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/symbol/inspect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Symbol#inspect" do
symbols = {
Modified: MacRuby/trunk/spec/frozen/core/symbol/swapcase_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/symbol/swapcase_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/symbol/swapcase_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-# encoding: utf-8
-require File.dirname(__FILE__) + '/../../spec_helper'
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Symbol#swapcase" do
Modified: MacRuby/trunk/spec/frozen/core/symbol/to_i_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/symbol/to_i_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/symbol/to_i_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Symbol#to_i" do
ruby_version_is ""..."1.9" do
Modified: MacRuby/trunk/spec/frozen/core/symbol/to_int_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/symbol/to_int_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/symbol/to_int_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Symbol#to_int" do
ruby_version_is ""..."1.9" do
Modified: MacRuby/trunk/spec/frozen/core/symbol/to_proc_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/symbol/to_proc_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/symbol/to_proc_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.8.7" do
describe "Symbol#to_proc" do
Modified: MacRuby/trunk/spec/frozen/core/symbol/to_s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/symbol/to_s_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/symbol/to_s_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/id2name'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../shared/id2name', __FILE__)
describe "Symbol#to_s" do
it_behaves_like(:symbol_id2name, :to_s)
Modified: MacRuby/trunk/spec/frozen/core/symbol/to_sym_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/symbol/to_sym_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/symbol/to_sym_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "Symbol#to_sym" do
it "returns self" do
Modified: MacRuby/trunk/spec/frozen/core/symbol/upcase_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/symbol/upcase_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/symbol/upcase_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-# encoding: utf-8
-require File.dirname(__FILE__) + '/../../spec_helper'
+# -*- encoding: utf-8 -*-
+require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "Symbol#upcase" do
Modified: MacRuby/trunk/spec/frozen/core/systemexit/initialize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/systemexit/initialize_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/systemexit/initialize_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "SystemExit#initialize" do
it "accepts a status" do
Modified: MacRuby/trunk/spec/frozen/core/thread/abort_on_exception_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/abort_on_exception_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/abort_on_exception_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Thread#abort_on_exception" do
it "is changeable to true or false" do
Modified: MacRuby/trunk/spec/frozen/core/thread/alive_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/alive_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/alive_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Thread#alive?" do
it "can check it's own status" do
Modified: MacRuby/trunk/spec/frozen/core/thread/critical_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/critical_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/critical_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
ruby_version_is "" ... "1.9" do
describe "Thread.critical=" do
Modified: MacRuby/trunk/spec/frozen/core/thread/current_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/current_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/current_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Thread.current" do
it "returns a thread" do
Modified: MacRuby/trunk/spec/frozen/core/thread/element_reference_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/element_reference_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/element_reference_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Thread#[]" do
it "gives access to thread local values" do
Modified: MacRuby/trunk/spec/frozen/core/thread/element_set_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/element_set_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/element_set_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Thread#[]=" do
ruby_version_is ""..."1.9" do
Modified: MacRuby/trunk/spec/frozen/core/thread/exit_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/exit_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/exit_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/exit'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/exit', __FILE__)
ruby_version_is ""..."1.9.1" do
describe "Thread#exit" do
Modified: MacRuby/trunk/spec/frozen/core/thread/fork_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/fork_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/fork_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,2 +1,2 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
\ No newline at end of file
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
\ No newline at end of file
Modified: MacRuby/trunk/spec/frozen/core/thread/group_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/group_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/group_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,2 +1,2 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
\ No newline at end of file
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
\ No newline at end of file
Modified: MacRuby/trunk/spec/frozen/core/thread/initialize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/initialize_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/initialize_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,2 +1,2 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
\ No newline at end of file
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
\ No newline at end of file
Modified: MacRuby/trunk/spec/frozen/core/thread/inspect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/inspect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/inspect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Thread#inspect" do
it "can check it's own status" do
Modified: MacRuby/trunk/spec/frozen/core/thread/join_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/join_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/join_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Thread#join" do
it "returns the thread when it is finished" do
Modified: MacRuby/trunk/spec/frozen/core/thread/key_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/key_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/key_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Thread#key?" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/thread/keys_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/keys_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/keys_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Thread#keys" do
it "returns an array of the names of the thread-local variables as symbols" do
Modified: MacRuby/trunk/spec/frozen/core/thread/kill_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/kill_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/kill_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/exit'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/exit', __FILE__)
describe "Thread#kill" do
it_behaves_like :thread_exit, :kill
Modified: MacRuby/trunk/spec/frozen/core/thread/list_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/list_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/list_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Thread::list" do
it "includes the current and main thread" do
Modified: MacRuby/trunk/spec/frozen/core/thread/main_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/main_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/main_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Thread.main" do
it "returns the main thread" do
Modified: MacRuby/trunk/spec/frozen/core/thread/new_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/new_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/new_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Thread.new" do
it "creates a thread executing the given block" do
Modified: MacRuby/trunk/spec/frozen/core/thread/pass_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/pass_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/pass_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Thread.pass" do
it "returns nil" do
Modified: MacRuby/trunk/spec/frozen/core/thread/priority_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/priority_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/priority_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,2 +1,2 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
\ No newline at end of file
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
\ No newline at end of file
Modified: MacRuby/trunk/spec/frozen/core/thread/raise_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/raise_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/raise_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/../../shared/kernel/raise'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../../../shared/kernel/raise', __FILE__)
describe "Thread#raise" do
it "ignores dead threads" do
Modified: MacRuby/trunk/spec/frozen/core/thread/run_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/run_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/run_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,7 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
-require File.dirname(__FILE__) + '/shared/wakeup'
+require File.expand_path('../shared/wakeup', __FILE__)
describe "Thread#run" do
it_behaves_like :thread_wakeup, :run
Modified: MacRuby/trunk/spec/frozen/core/thread/safe_level_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/safe_level_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/safe_level_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,2 +1,2 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
\ No newline at end of file
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
\ No newline at end of file
Modified: MacRuby/trunk/spec/frozen/core/thread/start_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/start_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/start_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,2 +1,2 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
\ No newline at end of file
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
\ No newline at end of file
Modified: MacRuby/trunk/spec/frozen/core/thread/status_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/status_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/status_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Thread#status" do
it "can check it's own status" do
Modified: MacRuby/trunk/spec/frozen/core/thread/stop_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/stop_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/stop_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Thread.stop" do
it "causes the current thread to sleep indefinitely" do
Modified: MacRuby/trunk/spec/frozen/core/thread/terminate_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/terminate_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/terminate_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/exit'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/exit', __FILE__)
describe "Thread#terminate" do
it_behaves_like :thread_exit, :terminate
Modified: MacRuby/trunk/spec/frozen/core/thread/value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "Thread#value" do
it "returns the result of the block" do
Modified: MacRuby/trunk/spec/frozen/core/thread/wakeup_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/thread/wakeup_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/thread/wakeup_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/wakeup'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/wakeup', __FILE__)
describe "Thread#wakeup" do
it_behaves_like :thread_wakeup, :wakeup
Modified: MacRuby/trunk/spec/frozen/core/threadgroup/add_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/threadgroup/add_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/threadgroup/add_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "ThreadGroup#add" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/threadgroup/enclose_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/threadgroup/enclose_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/threadgroup/enclose_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/threadgroup/enclosed_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/threadgroup/enclosed_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/threadgroup/enclosed_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1 +1 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/threadgroup/list_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/threadgroup/list_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/threadgroup/list_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "ThreadGroup#list" do
it "returns the list of threads in the group" do
Modified: MacRuby/trunk/spec/frozen/core/time/_dump_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/_dump_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/_dump_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,8 +1,9 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
describe "Time#_dump" do
before :each do
+ @local = Time.at(946812800)
@t = Time.at(946812800)
@t = @t.gmtime
@s = @t._dump
@@ -13,6 +14,10 @@
@t.gmt?.should == true
dump = @t._dump.unpack("VV").first
((dump >> 30) & 0x1).should == 1
+
+ @local.gmt?.should == false
+ dump = @local._dump.unpack("VV").first
+ ((dump >> 30) & 0x1).should == 0
end
it "dumps a Time object to a bytestring" do
Modified: MacRuby/trunk/spec/frozen/core/time/_load_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/_load_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/_load_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
describe "Time#_load" do
ruby_bug("http://redmine.ruby-lang.org/issues/show/627", "1.8.7") do
Modified: MacRuby/trunk/spec/frozen/core/time/asctime_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/asctime_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/asctime_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
-require File.dirname(__FILE__) + '/shared/asctime'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
+require File.expand_path('../shared/asctime', __FILE__)
describe "Time#asctime" do
it_behaves_like(:time_asctime, :asctime)
Modified: MacRuby/trunk/spec/frozen/core/time/at_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/at_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/at_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
describe "Time.at" do
platform_is_not :windows do
Modified: MacRuby/trunk/spec/frozen/core/time/comparison_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/comparison_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/comparison_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
describe "Time#<=>" do
it "returns 1 if the first argument is a point in time after the second argument" do
Modified: MacRuby/trunk/spec/frozen/core/time/ctime_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/ctime_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/ctime_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
-require File.dirname(__FILE__) + '/shared/asctime'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
+require File.expand_path('../shared/asctime', __FILE__)
describe "Time#ctime" do
it_behaves_like(:time_asctime, :ctime)
Modified: MacRuby/trunk/spec/frozen/core/time/day_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/day_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/day_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
-require File.dirname(__FILE__) + '/shared/day'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
+require File.expand_path('../shared/day', __FILE__)
describe "Time#day" do
it_behaves_like(:time_day, :day)
Modified: MacRuby/trunk/spec/frozen/core/time/dst_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/dst_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/dst_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
-require File.dirname(__FILE__) + '/shared/isdst'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
+require File.expand_path('../shared/isdst', __FILE__)
describe "Time#dst?" do
it_behaves_like(:time_isdst, :dst?)
Modified: MacRuby/trunk/spec/frozen/core/time/dup_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/dup_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/dup_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
describe "Time#dup" do
it "returns a Time object that represents the same time" do
Modified: MacRuby/trunk/spec/frozen/core/time/eql_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/eql_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/eql_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
describe "Time#eql?" do
it "returns true iff time is equal in seconds and usecs to other time" do
Modified: MacRuby/trunk/spec/frozen/core/time/getgm_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/getgm_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/getgm_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
-require File.dirname(__FILE__) + '/shared/getgm'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
+require File.expand_path('../shared/getgm', __FILE__)
describe "Time#getgm" do
it_behaves_like(:time_getgm, :getgm)
Modified: MacRuby/trunk/spec/frozen/core/time/getlocal_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/getlocal_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/getlocal_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
describe "Time#getlocal" do
it "returns a new time which is the local representation of time" do
Modified: MacRuby/trunk/spec/frozen/core/time/getutc_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/getutc_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/getutc_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
-require File.dirname(__FILE__) + '/shared/getgm'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
+require File.expand_path('../shared/getgm', __FILE__)
describe "Time#getutc" do
it_behaves_like(:time_getgm, :getutc)
Modified: MacRuby/trunk/spec/frozen/core/time/gm_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/gm_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/gm_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,7 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
-require File.dirname(__FILE__) + '/shared/gm'
-require File.dirname(__FILE__) + '/shared/time_params'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
+require File.expand_path('../shared/gm', __FILE__)
+require File.expand_path('../shared/time_params', __FILE__)
describe "Time.gm" do
it_behaves_like(:time_gm, :gm)
Modified: MacRuby/trunk/spec/frozen/core/time/gmt_offset_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/gmt_offset_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/gmt_offset_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
-require File.dirname(__FILE__) + '/shared/gmt_offset'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
+require File.expand_path('../shared/gmt_offset', __FILE__)
describe "Time#gmt_offset" do
it_behaves_like(:time_gmt_offset, :gmt_offset)
Modified: MacRuby/trunk/spec/frozen/core/time/gmt_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/gmt_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/gmt_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
describe "Time#gmt?" do
it "returns true if time represents a time in UTC (GMT)" do
Modified: MacRuby/trunk/spec/frozen/core/time/gmtime_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/gmtime_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/gmtime_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
-require File.dirname(__FILE__) + '/shared/gmtime'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
+require File.expand_path('../shared/gmtime', __FILE__)
describe "Time#gmtime" do
it_behaves_like(:time_gmtime, :gmtime)
Modified: MacRuby/trunk/spec/frozen/core/time/gmtoff_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/gmtoff_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/gmtoff_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
-require File.dirname(__FILE__) + '/shared/gmt_offset'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
+require File.expand_path('../shared/gmt_offset', __FILE__)
describe "Time#gmtoff" do
it_behaves_like(:time_gmt_offset, :gmtoff)
Modified: MacRuby/trunk/spec/frozen/core/time/hash_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/hash_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/hash_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
describe "Time#hash" do
it "returns a Fixnum" do
Modified: MacRuby/trunk/spec/frozen/core/time/hour_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/hour_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/hour_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
describe "Time#hour" do
it "returns the hour of the day (0..23) for time" do
Modified: MacRuby/trunk/spec/frozen/core/time/initialize_copy_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/initialize_copy_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/initialize_copy_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,2 +1,2 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/time/initialize_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/initialize_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/initialize_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
-require File.dirname(__FILE__) + '/shared/now'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
+require File.expand_path('../shared/now', __FILE__)
describe 'Time.new' do
it_behaves_like(:time_now, :new)
Modified: MacRuby/trunk/spec/frozen/core/time/inspect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/inspect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/inspect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
-require File.dirname(__FILE__) + '/shared/inspect'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
+require File.expand_path('../shared/inspect', __FILE__)
describe "Time.inspect" do
it_behaves_like :inspect, :inspect
Modified: MacRuby/trunk/spec/frozen/core/time/isdst_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/isdst_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/isdst_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
-require File.dirname(__FILE__) + '/shared/isdst'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
+require File.expand_path('../shared/isdst', __FILE__)
describe "Time#isdst" do
it_behaves_like(:time_isdst, :isdst)
Modified: MacRuby/trunk/spec/frozen/core/time/local_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/local_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/local_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,7 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
-require File.dirname(__FILE__) + '/shared/local'
-require File.dirname(__FILE__) + '/shared/time_params'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
+require File.expand_path('../shared/local', __FILE__)
+require File.expand_path('../shared/time_params', __FILE__)
describe "Time.local" do
it_behaves_like(:time_local, :local)
Modified: MacRuby/trunk/spec/frozen/core/time/localtime_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/localtime_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/localtime_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
describe "Time#localtime" do
it "returns the local representation of time" do
Modified: MacRuby/trunk/spec/frozen/core/time/mday_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/mday_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/mday_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
-require File.dirname(__FILE__) + '/shared/day'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
+require File.expand_path('../shared/day', __FILE__)
describe "Time#mday" do
it_behaves_like(:time_day, :mday)
Modified: MacRuby/trunk/spec/frozen/core/time/min_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/min_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/min_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
describe "Time#min" do
it "returns the minute of the hour (0..59) for time" do
Modified: MacRuby/trunk/spec/frozen/core/time/minus_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/minus_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/minus_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
# MRI 1.9 broke this test, so we use a combination of version guards and bug
# guards to indicate that it is expected to pass on versions < 1.9, and,
@@ -14,9 +14,15 @@
(Time.at(1.1) - 0.2).should == Time.at(0.9)
end
+ it "understands negative subtractions" do
+ t = Time.at(100) - -1.3
+ t.usec.should == 300000
+ t.to_i.should == 101
+ end
+
it "accepts arguments that can be coerced into Float" do
(obj = mock('9.5')).should_receive(:to_f).and_return(9.5)
- (Time.at(100) - obj).should == Time.at(90.5)
+ (Time.at(100) - obj).should == Time.at(90.5)
end
it "raises TypeError on argument that can't be coerced into Float" do
@@ -39,35 +45,35 @@
end
ruby_version_is "1.9" do
- ruby_bug "[ruby-dev:38446]", "1.9.2" do
- describe "Time#-" do
- it "decrements the time by the specified amount" do
- (Time.at(100) - 100).should == Time.at(0)
- (Time.at(100) - Time.at(99)).should == 1.0
- (Time.at(1.1) - 0.2).should == Time.at(0.9)
- end
+ describe "Time#-" do
+ #see [ruby-dev:38446]
+ it "decrements the time by the specified amount" do
+ (Time.at(100) - 100).should == Time.at(0)
+ (Time.at(100) - Time.at(99)).should == 1
+ (Time.at(Rational(11, 10)) - Rational(2, 10)).should == Time.at(Rational(9, 10))
+ end
- it "accepts arguments that can be coerced into Float" do
- (obj = mock('9.5')).should_receive(:to_f).and_return(9.5)
- (Time.at(100) - obj).should == Time.at(90.5)
- end
+ #see [ruby-dev:38446]
+ it "accepts arguments that can be coerced into Rational" do
+ (obj = mock('10')).should_receive(:to_r).and_return(Rational(10))
+ (Time.at(100) - obj).should == Time.at(90)
+ end
- it "raises TypeError on argument that can't be coerced into Float" do
- lambda { Time.now - Object.new }.should raise_error(TypeError)
- lambda { Time.now - "stuff" }.should raise_error(TypeError)
- end
+ it "raises TypeError on argument that can't be coerced into Rational" do
+ lambda { Time.now - Object.new }.should raise_error(TypeError)
+ lambda { Time.now - "stuff" }.should raise_error(TypeError)
+ end
- it "raises TypeError on nil argument" do
- lambda { Time.now - nil }.should raise_error(TypeError)
- end
+ it "raises TypeError on nil argument" do
+ lambda { Time.now - nil }.should raise_error(TypeError)
+ end
- it "tracks microseconds" do
- time = Time.at(0.777777)
- time -= 0.654321
- time.usec.should == 123456
- time -= 0.123456
- time.usec.should == 0
- end
+ it "tracks microseconds" do
+ time = Time.at(Rational(777777, 1000000))
+ time -= Rational(654321, 1000000)
+ time.usec.should == 123456
+ time -= Rational(123456, 1000000)
+ time.usec.should == 0
end
end
-end
+end
Modified: MacRuby/trunk/spec/frozen/core/time/mktime_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/mktime_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/mktime_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,7 +1,7 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
-require File.dirname(__FILE__) + '/shared/local'
-require File.dirname(__FILE__) + '/shared/time_params'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
+require File.expand_path('../shared/local', __FILE__)
+require File.expand_path('../shared/time_params', __FILE__)
describe "Time.mktime" do
it_behaves_like(:time_local, :mktime)
Modified: MacRuby/trunk/spec/frozen/core/time/mon_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/mon_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/mon_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
-require File.dirname(__FILE__) + '/shared/month'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
+require File.expand_path('../shared/month', __FILE__)
describe "Time#mon" do
it_behaves_like(:time_month, :mon)
Modified: MacRuby/trunk/spec/frozen/core/time/month_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/month_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/month_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
-require File.dirname(__FILE__) + '/shared/month'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
+require File.expand_path('../shared/month', __FILE__)
describe "Time#month" do
it_behaves_like(:time_month, :month)
Modified: MacRuby/trunk/spec/frozen/core/time/now_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/now_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/now_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
-require File.dirname(__FILE__) + '/shared/now'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
+require File.expand_path('../shared/now', __FILE__)
describe 'Time.now' do
it_behaves_like(:time_now, :now)
Modified: MacRuby/trunk/spec/frozen/core/time/plus_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/plus_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/plus_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
describe "Time#+" do
it "increments the time by the specified amount" do
@@ -11,6 +11,47 @@
end
ruby_version_is "" ... "1.9" do
+ it "rounds micro seconds rather than truncates" do
+ # The use of 8.9999999 is intentional. This is because
+ # Time treats the fractional part as the number of micro seconds.
+ # Thusly it multiplies the result by 1_000_000 to go from
+ # seconds to microseconds. That conversion should be rounded
+ # properly. In this case, it's rounded up to 1,000,000, and thus
+ # contributes a full extra second to the Time object.
+ t = Time.at(0) + 8.9999999
+ t.should == Time.at(9)
+ t.usec.should == 0
+
+ # Check the non-edge case works properly, that the fractional part
+ # contributes to #usecs
+ t2 = Time.at(0) + 8.9
+ t2.usec.should == 900000
+ end
+
+ it "adds a negative Float" do
+ t = Time.at(100) + -1.3
+ t.usec.should == 700000
+ t.to_i.should == 98
+ end
+ end
+
+ ruby_version_is "1.9" do
+ 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)
+ end
+
+ it "adds a negative Float" do
+ t = Time.at(100) + -1.3
+ t.usec.should == 699999
+ t.to_i.should == 98
+ end
+ end
+
+ ruby_version_is "" ... "1.9" do
it "increments the time by the specified amount as float numbers" do
(Time.at(1.1) + 0.9).should == Time.at(2)
end
@@ -26,9 +67,9 @@
end
end
- ruby_version_is "1.9.2" do
+ ruby_version_is "1.9" do
it "increments the time by the specified amount as rational numbers" do
- (Time.at(1.1) + 0.9).should_not == Time.at(2)
+ (Time.at(Rational(11, 10)) + Rational(9, 10)).should == Time.at(2)
end
it "accepts arguments that can be coerced into Rational" do
@@ -36,15 +77,21 @@
(Time.at(100) + obj).should == Time.at(110)
end
- ruby_bug "#1583", "1.9.2" do
- it "raises TypeError on argument that can't be coerced into Rational" do
- lambda { Time.now + Object.new }.should raise_error(TypeError)
- lambda { Time.now + "stuff" }.should raise_error(TypeError)
- end
+ it "raises TypeError on argument that can't be coerced into Rational" do
+ lambda { Time.now + Object.new }.should raise_error(TypeError)
+ lambda { Time.now + "stuff" }.should raise_error(TypeError)
end
+
+ #see [ruby-dev:38446]
+ it "tracks microseconds" do
+ time = Time.at(0)
+ time += Rational(123456, 1000000)
+ time.usec.should == 123456
+ time += Rational(654321, 1000000)
+ time.usec.should == 777777
+ end
end
-
it "raises TypeError on Time argument" do
lambda { Time.now + Time.now }.should raise_error(TypeError)
end
@@ -52,14 +99,4 @@
it "raises TypeError on nil argument" do
lambda { Time.now + nil }.should raise_error(TypeError)
end
-
- ruby_bug "[ruby-dev:38446]", "1.9.2" do
- it "tracks microseconds" do
- time = Time.at(0)
- time += 0.123456
- time.usec.should == 123456
- time += 0.654321
- time.usec.should == 777777
- end
- end
end
Modified: MacRuby/trunk/spec/frozen/core/time/sec_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/sec_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/sec_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
describe "Time#sec" do
it "returns the second of the minute(0..60) for time" do
Modified: MacRuby/trunk/spec/frozen/core/time/shared/isdst.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/shared/isdst.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/shared/isdst.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../fixtures/methods'
+require File.expand_path('../../fixtures/methods', __FILE__)
describe :time_isdst, :shared => true do
it "dst? returns whether time is during daylight saving time" do
Modified: MacRuby/trunk/spec/frozen/core/time/shared/local.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/shared/local.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/shared/local.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -13,6 +13,14 @@
time.inspect.should == "Sat Jan 01 20:15:01 -0800 2000"
end
end
+
+ it "respects rare old timezones" do
+ with_timezone("Europe/Amsterdam") do
+ time = Time.send(@method, 1910, 1, 1)
+ time.to_i.should == -1893457172
+ time.inspect.should == "Sat Jan 01 00:00:00 +0019 1910"
+ end
+ end
end
ruby_version_is "1.9" do
Modified: MacRuby/trunk/spec/frozen/core/time/shared/time_params.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/shared/time_params.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/shared/time_params.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -66,8 +66,8 @@
end
end
- # MRI 1.9.2 relaxes 1.8's restriction's on allowed years.
- ruby_version_is "1.9.2" do
+ # MRI 1.9 relaxes 1.8's restriction's on allowed years.
+ ruby_version_is "1.9" do
it "should accept various year ranges" do
Time.send(@method, 1801, 12, 31, 23, 59, 59, 0).wday.should == 4
Time.send(@method, 3000, 12, 31, 23, 59, 59, 0).wday.should == 3
Modified: MacRuby/trunk/spec/frozen/core/time/strftime_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/strftime_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/strftime_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
describe "Time#strftime" do
it "formats time according to the directives in the given format string" do
Modified: MacRuby/trunk/spec/frozen/core/time/succ_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/succ_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/succ_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
describe "Time#succ" do
it "returns a new time one second later than time" do
Modified: MacRuby/trunk/spec/frozen/core/time/times_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/times_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/times_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/../../shared/process/times'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../../shared/process/times', __FILE__)
describe 'Time.times' do
ruby_version_is "" ... "1.9" do
Modified: MacRuby/trunk/spec/frozen/core/time/to_a_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/to_a_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/to_a_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
describe "Time#to_a" do
it "returns a 10 element array representing the deconstructed time" do
Modified: MacRuby/trunk/spec/frozen/core/time/to_f_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/to_f_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/to_f_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
describe "Time#to_f" do
it "returns the float number of seconds + usecs since the epoch" do
Modified: MacRuby/trunk/spec/frozen/core/time/to_i_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/to_i_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/to_i_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
-require File.dirname(__FILE__) + '/shared/to_i'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
+require File.expand_path('../shared/to_i', __FILE__)
describe "Time#to_i" do
it_behaves_like(:time_to_i, :to_i)
Added: MacRuby/trunk/spec/frozen/core/time/to_r_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/to_r_spec.rb (rev 0)
+++ MacRuby/trunk/spec/frozen/core/time/to_r_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -0,0 +1,13 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+
+describe "Time#to_r" do
+ ruby_version_is "1.9" do
+ it "returns the rational number of seconds + usecs since the epoch" do
+ Time.at(1.1).to_r.should == 1.1.to_r
+ end
+
+ it "returns the numerator of the rational number when the denominator is 1" do
+ Time.at(2).to_r.should == 2
+ end
+ end
+end
Modified: MacRuby/trunk/spec/frozen/core/time/to_s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/to_s_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/to_s_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
-require File.dirname(__FILE__) + '/shared/inspect'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
+require File.expand_path('../shared/inspect', __FILE__)
describe "Time.to_s" do
it_behaves_like :inspect, :to_s
Modified: MacRuby/trunk/spec/frozen/core/time/tv_sec_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/tv_sec_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/tv_sec_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
-require File.dirname(__FILE__) + '/shared/to_i'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
+require File.expand_path('../shared/to_i', __FILE__)
describe "Time#tv_sec" do
it_behaves_like(:time_to_i, :tv_sec)
Modified: MacRuby/trunk/spec/frozen/core/time/tv_usec_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/tv_usec_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/tv_usec_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,2 +1,2 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
Modified: MacRuby/trunk/spec/frozen/core/time/usec_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/usec_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/usec_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
describe "Time#usec" do
it "returns the microseconds for time" do
Modified: MacRuby/trunk/spec/frozen/core/time/utc_offset_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/utc_offset_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/utc_offset_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
-require File.dirname(__FILE__) + '/shared/gmt_offset'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
+require File.expand_path('../shared/gmt_offset', __FILE__)
describe "Time#utc_offset" do
it_behaves_like(:time_gmt_offset, :utc_offset)
Modified: MacRuby/trunk/spec/frozen/core/time/utc_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/utc_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/utc_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,8 +1,8 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
-require File.dirname(__FILE__) + '/shared/gm'
-require File.dirname(__FILE__) + '/shared/gmtime'
-require File.dirname(__FILE__) + '/shared/time_params'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
+require File.expand_path('../shared/gm', __FILE__)
+require File.expand_path('../shared/gmtime', __FILE__)
+require File.expand_path('../shared/time_params', __FILE__)
describe "Time#utc?" do
it "returns true if time represents a time in UTC (GMT)" do
Modified: MacRuby/trunk/spec/frozen/core/time/wday_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/wday_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/wday_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
describe "Time#wday" do
it "returns an integer representing the day of the week, 0..6, with Sunday being 0" do
Modified: MacRuby/trunk/spec/frozen/core/time/yday_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/yday_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/yday_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
describe "Time#yday" do
it "returns an integer representing the day of the year, 1..366" do
Modified: MacRuby/trunk/spec/frozen/core/time/year_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/year_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/year_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
describe "Time#year" do
it "returns the four digit year for time as an integer" do
Modified: MacRuby/trunk/spec/frozen/core/time/zone_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/time/zone_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/time/zone_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/methods'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/methods', __FILE__)
describe "Time#zone" do
it "returns the time zone used for time" do
Modified: MacRuby/trunk/spec/frozen/core/true/and_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/true/and_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/true/and_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "TrueClass#&" do
it "returns false if other is nil or false, otherwise true" do
Modified: MacRuby/trunk/spec/frozen/core/true/inspect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/true/inspect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/true/inspect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "TrueClass#inspect" do
it "returns the string 'true'" do
Modified: MacRuby/trunk/spec/frozen/core/true/or_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/true/or_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/true/or_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "TrueClass#|" do
it "returns true" do
Modified: MacRuby/trunk/spec/frozen/core/true/to_s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/true/to_s_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/true/to_s_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "TrueClass#to_s" do
it "returns the string 'true'" do
Modified: MacRuby/trunk/spec/frozen/core/true/xor_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/true/xor_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/true/xor_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path('../../../spec_helper', __FILE__)
describe "TrueClass#^" do
it "returns true if other is nil or false, otherwise false" do
Modified: MacRuby/trunk/spec/frozen/core/unboundmethod/arity_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/unboundmethod/arity_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/unboundmethod/arity_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "UnboundMethod#arity" do
before(:each) do
Modified: MacRuby/trunk/spec/frozen/core/unboundmethod/bind_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/unboundmethod/bind_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/unboundmethod/bind_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "UnboundMethod#bind" do
before :each do
Modified: MacRuby/trunk/spec/frozen/core/unboundmethod/clone_spec_disabled.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/unboundmethod/clone_spec_disabled.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/unboundmethod/clone_spec_disabled.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "UnboundMethod#clone" do
it "returns a copy of the UnboundMethod" do
Modified: MacRuby/trunk/spec/frozen/core/unboundmethod/equal_value_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/unboundmethod/equal_value_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/unboundmethod/equal_value_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
context "Creating UnboundMethods" do
specify "there is no difference between Method#unbind and Module#instance_method" do
Modified: MacRuby/trunk/spec/frozen/core/unboundmethod/inspect_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/unboundmethod/inspect_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/unboundmethod/inspect_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + "/fixtures/classes"
-require File.dirname(__FILE__) + '/shared/to_s'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/to_s', __FILE__)
describe "UnboundMethod#inspect" do
it_behaves_like(:unboundmethod_to_s, :inspect)
Modified: MacRuby/trunk/spec/frozen/core/unboundmethod/name_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/unboundmethod/name_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/unboundmethod/name_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "UnboundMethod#name" do
ruby_version_is '1.8.7'..'1.9' do
Modified: MacRuby/trunk/spec/frozen/core/unboundmethod/owner_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/unboundmethod/owner_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/unboundmethod/owner_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,5 +1,5 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
describe "UnboundMethod#owner" do
ruby_version_is '1.8.7' do
Modified: MacRuby/trunk/spec/frozen/core/unboundmethod/to_s_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/unboundmethod/to_s_spec.rb 2010-03-28 17:00:14 UTC (rev 3870)
+++ MacRuby/trunk/spec/frozen/core/unboundmethod/to_s_spec.rb 2010-03-28 19:32:11 UTC (rev 3871)
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/to_s'
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/to_s', __FILE__)
describe "UnboundMethod#to_s" do
it_behaves_like(:unboundmethod_to_s, :to_s)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100328/319d89ce/attachment-0001.html>
More information about the macruby-changes
mailing list