ruby-changes:49976
From: eregon <ko1@a...>
Date: Tue, 30 Jan 2018 01:08:48 +0900 (JST)
Subject: [ruby-changes:49976] eregon:r62094 (trunk): Update to ruby/spec@83063a3
eregon 2018-01-30 01:08:16 +0900 (Tue, 30 Jan 2018) New Revision: 62094 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62094 Log: Update to ruby/spec@83063a3 Added directories: trunk/spec/ruby/shared/hash/ Added files: trunk/spec/ruby/core/enumerator/lazy/chunk_spec.rb trunk/spec/ruby/core/file/shared/path.rb trunk/spec/ruby/core/integer/abs_spec.rb trunk/spec/ruby/core/integer/bit_and_spec.rb trunk/spec/ruby/core/integer/bit_length_spec.rb trunk/spec/ruby/core/integer/bit_or_spec.rb trunk/spec/ruby/core/integer/bit_xor_spec.rb trunk/spec/ruby/core/integer/case_compare_spec.rb trunk/spec/ruby/core/integer/coerce_spec.rb trunk/spec/ruby/core/integer/comparison_spec.rb trunk/spec/ruby/core/integer/complement_spec.rb trunk/spec/ruby/core/integer/div_spec.rb trunk/spec/ruby/core/integer/divmod_spec.rb trunk/spec/ruby/core/integer/element_reference_spec.rb trunk/spec/ruby/core/integer/equal_value_spec.rb trunk/spec/ruby/core/integer/exponent_spec.rb trunk/spec/ruby/core/integer/fdiv_spec.rb trunk/spec/ruby/core/integer/left_shift_spec.rb trunk/spec/ruby/core/integer/magnitude_spec.rb trunk/spec/ruby/core/integer/modulo_spec.rb trunk/spec/ruby/core/integer/pow_spec.rb trunk/spec/ruby/core/integer/remainder_spec.rb trunk/spec/ruby/core/integer/right_shift_spec.rb trunk/spec/ruby/core/integer/shared/abs.rb trunk/spec/ruby/core/integer/shared/arithmetic_coerce.rb trunk/spec/ruby/core/integer/shared/comparison_coerce.rb trunk/spec/ruby/core/integer/shared/equal.rb trunk/spec/ruby/core/integer/shared/exponent.rb trunk/spec/ruby/core/integer/shared/modulo.rb trunk/spec/ruby/core/integer/size_spec.rb trunk/spec/ruby/core/integer/to_f_spec.rb trunk/spec/ruby/core/integer/to_s_spec.rb trunk/spec/ruby/core/integer/uminus_spec.rb trunk/spec/ruby/core/process/last_status_spec.rb trunk/spec/ruby/core/thread/fetch_spec.rb trunk/spec/ruby/shared/hash/key_error.rb Removed files: trunk/spec/ruby/core/bignum/abs_spec.rb trunk/spec/ruby/core/bignum/bignum_spec.rb trunk/spec/ruby/core/bignum/bit_and_spec.rb trunk/spec/ruby/core/bignum/bit_length_spec.rb trunk/spec/ruby/core/bignum/bit_or_spec.rb trunk/spec/ruby/core/bignum/bit_xor_spec.rb trunk/spec/ruby/core/bignum/case_compare_spec.rb trunk/spec/ruby/core/bignum/coerce_spec.rb trunk/spec/ruby/core/bignum/comparison_spec.rb trunk/spec/ruby/core/bignum/complement_spec.rb trunk/spec/ruby/core/bignum/div_spec.rb trunk/spec/ruby/core/bignum/divide_spec.rb trunk/spec/ruby/core/bignum/divmod_spec.rb trunk/spec/ruby/core/bignum/element_reference_spec.rb trunk/spec/ruby/core/bignum/eql_spec.rb trunk/spec/ruby/core/bignum/equal_value_spec.rb trunk/spec/ruby/core/bignum/even_spec.rb trunk/spec/ruby/core/bignum/exponent_spec.rb trunk/spec/ruby/core/bignum/fdiv_spec.rb trunk/spec/ruby/core/bignum/gt_spec.rb trunk/spec/ruby/core/bignum/gte_spec.rb trunk/spec/ruby/core/bignum/hash_spec.rb trunk/spec/ruby/core/bignum/left_shift_spec.rb trunk/spec/ruby/core/bignum/lt_spec.rb trunk/spec/ruby/core/bignum/lte_spec.rb trunk/spec/ruby/core/bignum/magnitude_spec.rb trunk/spec/ruby/core/bignum/minus_spec.rb trunk/spec/ruby/core/bignum/modulo_spec.rb trunk/spec/ruby/core/bignum/multiply_spec.rb trunk/spec/ruby/core/bignum/odd_spec.rb trunk/spec/ruby/core/bignum/plus_spec.rb trunk/spec/ruby/core/bignum/remainder_spec.rb trunk/spec/ruby/core/bignum/right_shift_spec.rb trunk/spec/ruby/core/bignum/shared/abs.rb trunk/spec/ruby/core/bignum/shared/divide.rb trunk/spec/ruby/core/bignum/shared/equal.rb trunk/spec/ruby/core/bignum/shared/modulo.rb trunk/spec/ruby/core/bignum/size_spec.rb trunk/spec/ruby/core/bignum/to_f_spec.rb trunk/spec/ruby/core/bignum/to_s_spec.rb trunk/spec/ruby/core/bignum/uminus_spec.rb trunk/spec/ruby/core/fixnum/abs_spec.rb trunk/spec/ruby/core/fixnum/bit_and_spec.rb trunk/spec/ruby/core/fixnum/bit_length_spec.rb trunk/spec/ruby/core/fixnum/bit_or_spec.rb trunk/spec/ruby/core/fixnum/bit_xor_spec.rb trunk/spec/ruby/core/fixnum/case_compare_spec.rb trunk/spec/ruby/core/fixnum/coerce_spec.rb trunk/spec/ruby/core/fixnum/comparison_spec.rb trunk/spec/ruby/core/fixnum/complement_spec.rb trunk/spec/ruby/core/fixnum/div_spec.rb trunk/spec/ruby/core/fixnum/divide_spec.rb trunk/spec/ruby/core/fixnum/divmod_spec.rb trunk/spec/ruby/core/fixnum/element_reference_spec.rb trunk/spec/ruby/core/fixnum/equal_value_spec.rb trunk/spec/ruby/core/fixnum/even_spec.rb trunk/spec/ruby/core/fixnum/exponent_spec.rb trunk/spec/ruby/core/fixnum/fdiv_spec.rb trunk/spec/ruby/core/fixnum/fixnum_spec.rb trunk/spec/ruby/core/fixnum/gt_spec.rb trunk/spec/ruby/core/fixnum/gte_spec.rb trunk/spec/ruby/core/fixnum/hash_spec.rb trunk/spec/ruby/core/fixnum/left_shift_spec.rb trunk/spec/ruby/core/fixnum/lt_spec.rb trunk/spec/ruby/core/fixnum/lte_spec.rb trunk/spec/ruby/core/fixnum/magnitude_spec.rb trunk/spec/ruby/core/fixnum/minus_spec.rb trunk/spec/ruby/core/fixnum/modulo_spec.rb trunk/spec/ruby/core/fixnum/multiply_spec.rb trunk/spec/ruby/core/fixnum/odd_spec.rb trunk/spec/ruby/core/fixnum/plus_spec.rb trunk/spec/ruby/core/fixnum/right_shift_spec.rb trunk/spec/ruby/core/fixnum/shared/abs.rb trunk/spec/ruby/core/fixnum/shared/equal.rb trunk/spec/ruby/core/fixnum/shared/modulo.rb trunk/spec/ruby/core/fixnum/size_spec.rb trunk/spec/ruby/core/fixnum/succ_spec.rb trunk/spec/ruby/core/fixnum/to_f_spec.rb trunk/spec/ruby/core/fixnum/to_s_spec.rb trunk/spec/ruby/core/fixnum/uminus_spec.rb trunk/spec/ruby/core/fixnum/zero_spec.rb trunk/spec/ruby/core/integer/dup_spec.rb trunk/spec/ruby/core/integer/shared/arithmetic_exception_in_coerce.rb trunk/spec/ruby/core/integer/shared/comparison_exception_in_coerce.rb trunk/spec/ruby/shared/complex/hash.rb Modified files: trunk/spec/ruby/.rubocop.yml trunk/spec/ruby/.rubocop_todo.yml trunk/spec/ruby/CONTRIBUTING.md trunk/spec/ruby/core/array/append_spec.rb trunk/spec/ruby/core/array/collect_spec.rb trunk/spec/ruby/core/array/element_reference_spec.rb trunk/spec/ruby/core/array/element_set_spec.rb trunk/spec/ruby/core/array/index_spec.rb trunk/spec/ruby/core/array/length_spec.rb trunk/spec/ruby/core/array/map_spec.rb trunk/spec/ruby/core/array/prepend_spec.rb trunk/spec/ruby/core/array/push_spec.rb trunk/spec/ruby/core/array/replace_spec.rb trunk/spec/ruby/core/array/size_spec.rb trunk/spec/ruby/core/array/slice_spec.rb trunk/spec/ruby/core/array/unshift_spec.rb trunk/spec/ruby/core/basicobject/__send___spec.rb trunk/spec/ruby/core/binding/clone_spec.rb trunk/spec/ruby/core/binding/dup_spec.rb trunk/spec/ruby/core/complex/abs2_spec.rb trunk/spec/ruby/core/complex/abs_spec.rb trunk/spec/ruby/core/complex/angle_spec.rb trunk/spec/ruby/core/complex/arg_spec.rb trunk/spec/ruby/core/complex/coerce_spec.rb trunk/spec/ruby/core/complex/conj_spec.rb trunk/spec/ruby/core/complex/conjugate_spec.rb trunk/spec/ruby/core/complex/denominator_spec.rb trunk/spec/ruby/core/complex/hash_spec.rb trunk/spec/ruby/core/complex/imag_spec.rb trunk/spec/ruby/core/complex/inspect_spec.rb trunk/spec/ruby/core/complex/magnitude_spec.rb trunk/spec/ruby/core/complex/numerator_spec.rb trunk/spec/ruby/core/complex/polar_spec.rb trunk/spec/ruby/core/complex/real_spec.rb trunk/spec/ruby/core/complex/rect_spec.rb trunk/spec/ruby/core/complex/rectangular_spec.rb trunk/spec/ruby/core/complex/to_s_spec.rb trunk/spec/ruby/core/dir/exist_spec.rb trunk/spec/ruby/core/dir/exists_spec.rb trunk/spec/ruby/core/dir/path_spec.rb trunk/spec/ruby/core/dir/to_path_spec.rb trunk/spec/ruby/core/encoding/name_spec.rb trunk/spec/ruby/core/encoding/to_s_spec.rb trunk/spec/ruby/core/enumerable/collect_concat_spec.rb trunk/spec/ruby/core/enumerable/collect_spec.rb trunk/spec/ruby/core/enumerable/detect_spec.rb trunk/spec/ruby/core/enumerable/entries_spec.rb trunk/spec/ruby/core/enumerable/find_all_spec.rb trunk/spec/ruby/core/enumerable/find_spec.rb trunk/spec/ruby/core/enumerable/flat_map_spec.rb trunk/spec/ruby/core/enumerable/include_spec.rb trunk/spec/ruby/core/enumerable/map_spec.rb trunk/spec/ruby/core/enumerable/member_spec.rb trunk/spec/ruby/core/enumerable/select_spec.rb trunk/spec/ruby/core/enumerable/to_a_spec.rb trunk/spec/ruby/core/enumerator/each_spec.rb trunk/spec/ruby/core/enumerator/each_with_index_spec.rb trunk/spec/ruby/core/enumerator/inject_spec.rb trunk/spec/ruby/core/enumerator/new_spec.rb trunk/spec/ruby/core/enumerator/next_spec.rb trunk/spec/ruby/core/enumerator/rewind_spec.rb trunk/spec/ruby/core/enumerator/with_index_spec.rb trunk/spec/ruby/core/env/each_pair_spec.rb trunk/spec/ruby/core/env/each_spec.rb trunk/spec/ruby/core/env/element_set_spec.rb trunk/spec/ruby/core/env/fetch_spec.rb trunk/spec/ruby/core/env/has_key_spec.rb trunk/spec/ruby/core/env/has_value_spec.rb trunk/spec/ruby/core/env/include_spec.rb trunk/spec/ruby/core/env/index_spec.rb trunk/spec/ruby/core/env/key_spec.rb trunk/spec/ruby/core/env/length_spec.rb trunk/spec/ruby/core/env/member_spec.rb trunk/spec/ruby/core/env/size_spec.rb trunk/spec/ruby/core/env/store_spec.rb trunk/spec/ruby/core/env/to_h_spec.rb trunk/spec/ruby/core/env/to_hash_spec.rb trunk/spec/ruby/core/env/value_spec.rb trunk/spec/ruby/core/exception/exception_spec.rb trunk/spec/ruby/core/exception/fixtures/common.rb trunk/spec/ruby/core/exception/new_spec.rb trunk/spec/ruby/core/exception/no_method_error_spec.rb trunk/spec/ruby/core/fiber/resume_spec.rb trunk/spec/ruby/core/file/delete_spec.rb trunk/spec/ruby/core/file/exist_spec.rb trunk/spec/ruby/core/file/exists_spec.rb trunk/spec/ruby/core/file/fnmatch_spec.rb trunk/spec/ruby/core/file/open_spec.rb trunk/spec/ruby/core/file/path_spec.rb trunk/spec/ruby/core/file/stat/world_readable_spec.rb trunk/spec/ruby/core/file/stat/world_writable_spec.rb trunk/spec/ruby/core/file/to_path_spec.rb trunk/spec/ruby/core/file/unlink_spec.rb trunk/spec/ruby/core/file/world_readable_spec.rb trunk/spec/ruby/core/file/world_writable_spec.rb trunk/spec/ruby/core/float/abs_spec.rb trunk/spec/ruby/core/float/magnitude_spec.rb trunk/spec/ruby/core/float/modulo_spec.rb trunk/spec/ruby/core/float/to_i_spec.rb trunk/spec/ruby/core/float/to_int_spec.rb trunk/spec/ruby/core/float/truncate_spec.rb trunk/spec/ruby/core/hash/delete_if_spec.rb trunk/spec/ruby/core/hash/each_key_spec.rb trunk/spec/ruby/core/hash/each_pair_spec.rb trunk/spec/ruby/core/hash/each_spec.rb trunk/spec/ruby/core/hash/each_value_spec.rb trunk/spec/ruby/core/hash/element_set_spec.rb trunk/spec/ruby/core/hash/fetch_spec.rb trunk/spec/ruby/core/hash/fetch_values_spec.rb trunk/spec/ruby/core/hash/has_key_spec.rb trunk/spec/ruby/core/hash/has_value_spec.rb trunk/spec/ruby/core/hash/include_spec.rb trunk/spec/ruby/core/hash/keep_if_spec.rb trunk/spec/ruby/core/hash/key_spec.rb trunk/spec/ruby/core/hash/length_spec.rb trunk/spec/ruby/core/hash/member_spec.rb trunk/spec/ruby/core/hash/merge_spec.rb trunk/spec/ruby/core/hash/rehash_spec.rb trunk/spec/ruby/core/hash/reject_spec.rb trunk/spec/ruby/core/hash/replace_spec.rb trunk/spec/ruby/core/hash/select_spec.rb trunk/spec/ruby/core/hash/size_spec.rb trunk/spec/ruby/core/hash/store_spec.rb trunk/spec/ruby/core/hash/transform_keys_spec.rb trunk/spec/ruby/core/hash/update_spec.rb trunk/spec/ruby/core/hash/value_spec.rb trunk/spec/ruby/core/hash/values_at_spec.rb trunk/spec/ruby/core/integer/ceil_spec.rb trunk/spec/ruby/core/integer/chr_spec.rb trunk/spec/ruby/core/integer/divide_spec.rb trunk/spec/ruby/core/integer/even_spec.rb trunk/spec/ruby/core/integer/floor_spec.rb trunk/spec/ruby/core/integer/gt_spec.rb trunk/spec/ruby/core/integer/gte_spec.rb trunk/spec/ruby/core/integer/lt_spec.rb trunk/spec/ruby/core/integer/lte_spec.rb trunk/spec/ruby/core/integer/minus_spec.rb trunk/spec/ruby/core/integer/multiply_spec.rb trunk/spec/ruby/core/integer/next_spec.rb trunk/spec/ruby/core/integer/odd_spec.rb trunk/spec/ruby/core/integer/plus_spec.rb trunk/spec/ruby/core/integer/round_spec.rb trunk/spec/ruby/core/integer/succ_spec.rb trunk/spec/ruby/core/integer/to_i_spec.rb trunk/spec/ruby/core/integer/to_int_spec.rb trunk/spec/ruby/core/integer/truncate_spec.rb trunk/spec/ruby/core/io/close_spec.rb trunk/spec/ruby/core/io/codepoints_spec.rb trunk/spec/ruby/core/io/each_codepoint_spec.rb trunk/spec/ruby/core/io/tell_spec.rb trunk/spec/ruby/core/io/ungetc_spec.rb trunk/spec/ruby/core/kernel/Hash_spec.rb trunk/spec/ruby/core/kernel/is_a_spec.rb trunk/spec/ruby/core/kernel/kind_of_spec.rb trunk/spec/ruby/core/kernel/lambda_spec.rb trunk/spec/ruby/core/kernel/method_spec.rb trunk/spec/ruby/core/kernel/proc_spec.rb trunk/spec/ruby/core/kernel/public_method_spec.rb trunk/spec/ruby/core/kernel/public_send_spec.rb trunk/spec/ruby/core/kernel/send_spec.rb trunk/spec/ruby/core/kernel/shared/sprintf.rb trunk/spec/ruby/core/kernel/system_spec.rb trunk/spec/ruby/core/kernel/yield_self_spec.rb trunk/spec/ruby/core/matchdata/eql_spec.rb trunk/spec/ruby/core/matchdata/equal_value_spec.rb trunk/spec/ruby/core/matchdata/length_spec.rb trunk/spec/ruby/core/matchdata/size_spec.rb trunk/spec/ruby/core/method/call_spec.rb trunk/spec/ruby/core/method/case_compare_spec.rb trunk/spec/ruby/core/method/element_reference_spec.rb trunk/spec/ruby/core/method/eql_spec.rb trunk/spec/ruby/core/method/equal_value_spec.rb trunk/spec/ruby/core/method/inspect_spec.rb trunk/spec/ruby/core/method/to_proc_spec.rb trunk/spec/ruby/core/method/to_s_spec.rb trunk/spec/ruby/core/module/const_missing_spec.rb trunk/spec/ruby/core/module/define_method_spec.rb trunk/spec/ruby/core/module/eql_spec.rb trunk/spec/ruby/core/module/equal_spec.rb trunk/spec/ruby/core/module/equal_value_spec.rb trunk/spec/ruby/core/numeric/abs_spec.rb trunk/spec/ruby/core/numeric/angle_spec.rb trunk/spec/ruby/core/numeric/arg_spec.rb trunk/spec/ruby/core/numeric/coerce_spec.rb trunk/spec/ruby/core/numeric/conj_spec.rb trunk/spec/ruby/core/numeric/conjugate_spec.rb trunk/spec/ruby/core/numeric/imag_spec.rb trunk/spec/ruby/core/numeric/imaginary_spec.rb trunk/spec/ruby/core/numeric/magnitude_spec.rb trunk/spec/ruby/core/numeric/phase_spec.rb trunk/spec/ruby/core/numeric/polar_spec.rb trunk/spec/ruby/core/numeric/real_spec.rb trunk/spec/ruby/core/numeric/rect_spec.rb trunk/spec/ruby/core/numeric/rectangular_spec.rb trunk/spec/ruby/core/proc/clone_spec.rb trunk/spec/ruby/core/proc/dup_spec.rb trunk/spec/ruby/core/proc/eql_spec.rb trunk/spec/ruby/core/proc/equal_value_spec.rb trunk/spec/ruby/core/process/setrlimit_spec.rb trunk/spec/ruby/core/range/begin_spec.rb trunk/spec/ruby/core/range/end_spec.rb trunk/spec/ruby/core/range/eql_spec.rb trunk/spec/ruby/core/range/equal_value_spec.rb trunk/spec/ruby/core/range/first_spec.rb trunk/spec/ruby/core/range/last_spec.rb trunk/spec/ruby/core/rational/abs_spec.rb trunk/spec/ruby/core/rational/ceil_spec.rb trunk/spec/ruby/core/rational/coerce_spec.rb trunk/spec/ruby/core/rational/comparison_spec.rb trunk/spec/ruby/core/rational/denominator_spec.rb trunk/spec/ruby/core/rational/div_spec.rb trunk/spec/ruby/core/rational/divide_spec.rb trunk/spec/ruby/core/rational/divmod_spec.rb trunk/spec/ruby/core/rational/equal_value_spec.rb trunk/spec/ruby/core/rational/exponent_spec.rb trunk/spec/ruby/core/rational/fdiv_spec.rb trunk/spec/ruby/core/rational/floor_spec.rb trunk/spec/ruby/core/rational/hash_spec.rb trunk/spec/ruby/core/rational/inspect_spec.rb trunk/spec/ruby/core/rational/magnitude_spec.rb trunk/spec/ruby/core/rational/minus_spec.rb trunk/spec/ruby/core/rational/modulo_spec.rb trunk/spec/ruby/core/rational/multiply_spec.rb trunk/spec/ruby/core/rational/numerator_spec.rb trunk/spec/ruby/core/rational/plus_spec.rb trunk/spec/ruby/core/rational/quo_spec.rb trunk/spec/ruby/core/rational/remainder_spec.rb trunk/spec/ruby/core/rational/round_spec.rb trunk/spec/ruby/core/rational/to_f_spec.rb trunk/spec/ruby/core/rational/to_i_spec.rb trunk/spec/ruby/core/rational/to_r_spec.rb trunk/spec/ruby/core/rational/to_s_spec.rb trunk/spec/ruby/core/rational/truncate_spec.rb trunk/spec/ruby/core/regexp/match_spec.rb trunk/spec/ruby/core/signal/signame_spec.rb trunk/spec/ruby/core/signal/trap_spec.rb trunk/spec/ruby/core/string/case_compare_spec.rb trunk/spec/ruby/core/string/chars_spec.rb trunk/spec/ruby/core/string/codepoints_spec.rb trunk/spec/ruby/core/string/each_char_spec.rb trunk/spec/ruby/core/string/each_codepoint_spec.rb trunk/spec/ruby/core/string/each_line_spec.rb trunk/spec/ruby/core/string/eql_spec.rb trunk/spec/ruby/core/string/equal_value_spec.rb trunk/spec/ruby/core/string/intern_spec.rb trunk/spec/ruby/core/string/length_spec.rb trunk/spec/ruby/core/string/lines_spec.rb trunk/spec/ruby/core/string/modulo_spec.rb trunk/spec/ruby/core/string/next_spec.rb trunk/spec/ruby/core/string/size_spec.rb trunk/spec/ruby/core/string/start_with_spec.rb trunk/spec/ruby/core/string/succ_spec.rb trunk/spec/ruby/core/string/to_s_spec.rb trunk/spec/ruby/core/string/to_str_spec.rb trunk/spec/ruby/core/string/to_sym_spec.rb trunk/spec/ruby/core/string/uminus_spec.rb trunk/spec/ruby/core/struct/eql_spec.rb trunk/spec/ruby/core/struct/equal_value_spec.rb trunk/spec/ruby/core/struct/inspect_spec.rb trunk/spec/ruby/core/struct/to_s_spec.rb trunk/spec/ruby/core/symbol/element_reference_spec.rb trunk/spec/ruby/core/symbol/id2name_spec.rb trunk/spec/ruby/core/symbol/slice_spec.rb trunk/spec/ruby/core/symbol/to_s_spec.rb trunk/spec/ruby/core/thread/backtrace_spec.rb trunk/spec/ruby/core/thread/current_spec.rb trunk/spec/ruby/core/thread/priority_spec.rb trunk/spec/ruby/core/time/asctime_spec.rb trunk/spec/ruby/core/time/ctime_spec.rb trunk/spec/ruby/core/time/day_spec.rb trunk/spec/ruby/core/time/dst_spec.rb trunk/spec/ruby/core/time/getgm_spec.rb trunk/spec/ruby/core/time/getutc_spec.rb trunk/spec/ruby/core/time/gm_spec.rb trunk/spec/ruby/core/time/gmt_offset_spec.rb trunk/spec/ruby/core/time/gmtime_spec.rb trunk/spec/ruby/core/time/gmtoff_spec.rb trunk/spec/ruby/core/time/isdst_spec.rb trunk/spec/ruby/core/time/local_spec.rb trunk/spec/ruby/core/time/mday_spec.rb trunk/spec/ruby/core/time/mktime_spec.rb trunk/spec/ruby/core/time/mon_spec.rb trunk/spec/ruby/core/time/month_spec.rb trunk/spec/ruby/core/time/new_spec.rb trunk/spec/ruby/core/time/now_spec.rb trunk/spec/ruby/core/time/to_i_spec.rb trunk/spec/ruby/core/time/tv_sec_spec.rb trunk/spec/ruby/core/time/utc_offset_spec.rb trunk/spec/ruby/core/time/utc_spec.rb trunk/spec/ruby/core/unboundmethod/inspect_spec.rb trunk/spec/ruby/core/unboundmethod/to_s_spec.rb trunk/spec/ruby/language/def_spec.rb trunk/spec/ruby/language/defined_spec.rb trunk/spec/ruby/language/fixtures/def.rb trunk/spec/ruby/language/fixtures/defined.rb trunk/spec/ruby/language/regexp_spec.rb trunk/spec/ruby/library/bigdecimal/case_compare_spec.rb trunk/spec/ruby/library/bigdecimal/eql_spec.rb trunk/spec/ruby/library/bigdecimal/equal_value_spec.rb trunk/spec/ruby/library/bigdecimal/exponent_spec.rb trunk/spec/ruby/library/bigdecimal/modulo_spec.rb trunk/spec/ruby/library/bigdecimal/power_spec.rb trunk/spec/ruby/library/bigdecimal/to_i_spec.rb trunk/spec/ruby/library/bigdecimal/to_int_spec.rb trunk/spec/ruby/library/cgi/http_header_spec.rb trunk/spec/ruby/library/date/civil_spec.rb trunk/spec/ruby/library/date/commercial_spec.rb trunk/spec/ruby/library/date/new_spec.rb trunk/spec/ruby/library/digest/md5/append_spec.rb trunk/spec/ruby/library/digest/sha256/append_spec.rb trunk/spec/ruby/library/digest/sha384/append_spec.rb trunk/spec/ruby/library/digest/sha512/append_spec.rb trunk/spec/ruby/library/etc/endgrent_spec.rb trunk/spec/ruby/library/etc/endpwent_spec.rb trunk/spec/ruby/library/etc/getgrent_spec.rb trunk/spec/ruby/library/etc/getpwent_spec.rb trunk/spec/ruby/library/etc/group_spec.rb trunk/spec/ruby/library/fiber/transfer_spec.rb trunk/spec/ruby/library/getoptlong/each_option_spec.rb trunk/spec/ruby/library/getoptlong/each_spec.rb trunk/spec/ruby/library/getoptlong/get_option_spec.rb trunk/spec/ruby/library/getoptlong/get_spec.rb trunk/spec/ruby/library/matrix/I_spec.rb trunk/spec/ruby/library/matrix/antisymmetric_spec.rb trunk/spec/ruby/library/matrix/collect_spec.rb trunk/spec/ruby/library/matrix/conj_spec.rb trunk/spec/ruby/library/matrix/conjugate_spec.rb trunk/spec/ruby/library/matrix/det_spec.rb trunk/spec/ruby/library/matrix/determinant_spec.rb trunk/spec/ruby/library/matrix/eql_spec.rb trunk/spec/ruby/library/matrix/equal_value_spec.rb trunk/spec/ruby/library/matrix/identity_spec.rb trunk/spec/ruby/library/matrix/imag_spec.rb trunk/spec/ruby/library/matrix/imaginary_spec.rb trunk/spec/ruby/library/matrix/inv_spec.rb trunk/spec/ruby/library/matrix/inverse_spec.rb trunk/spec/ruby/library/matrix/map_spec.rb trunk/spec/ruby/library/matrix/rect_spec.rb trunk/spec/ruby/library/matrix/rectangular_spec.rb trunk/spec/ruby/library/matrix/t_spec.rb trunk/spec/ruby/library/matrix/tr_spec.rb trunk/spec/ruby/library/matrix/trace_spec.rb trunk/spec/ruby/library/matrix/transpose_spec.rb trunk/spec/ruby/library/matrix/unit_spec.rb trunk/spec/ruby/library/net/ftp/initialize_spec.rb trunk/spec/ruby/library/rexml/document/add_spec.rb trunk/spec/ruby/library/rexml/document/expanded_name_spec.rb trunk/spec/ruby/library/scanf/io/block_scanf_spec.rb trunk/spec/ruby/library/scanf/io/scanf_spec.rb trunk/spec/ruby/library/scanf/string/block_scanf_spec.rb trunk/spec/ruby/library/scanf/string/scanf_spec.rb trunk/spec/ruby/library/socket/addrinfo/to_s_spec.rb trunk/spec/ruby/library/socket/addrinfo/to_sockaddr_spec.rb trunk/spec/ruby/library/stringio/codepoints_spec.rb trunk/spec/ruby/library/stringio/each_codepoint_spec.rb trunk/spec/ruby/library/stringscanner/beginning_of_line_spec.rb trunk/spec/ruby/library/stringscanner/bol_spec.rb trunk/spec/ruby/library/stringscanner/clear_spec.rb trunk/spec/ruby/library/stringscanner/concat_spec.rb trunk/spec/ruby/library/stringscanner/empty_spec.rb trunk/spec/ruby/library/stringscanner/eos_spec.rb trunk/spec/ruby/library/stringscanner/matched_size_spec.rb trunk/spec/ruby/library/stringscanner/peek_spec.rb trunk/spec/ruby/library/stringscanner/peep_spec.rb trunk/spec/ruby/library/stringscanner/pointer_spec.rb trunk/spec/ruby/library/stringscanner/pos_spec.rb trunk/spec/ruby/library/stringscanner/rest_size_spec.rb trunk/spec/ruby/library/stringscanner/restsize_spec.rb trunk/spec/ruby/library/stringscanner/terminate_spec.rb trunk/spec/ruby/library/weakref/fixtures/classes.rb trunk/spec/ruby/optional/capi/ext/numeric_spec.c trunk/spec/ruby/optional/capi/ext/rubyspec.h trunk/spec/ruby/optional/capi/hash_spec.rb trunk/spec/ruby/optional/capi/numeric_spec.rb trunk/spec/ruby/optional/capi/string_spec.rb trunk/spec/ruby/security/cve_2011_4815_spec.rb trunk/spec/ruby/shared/complex/Complex.rb trunk/spec/ruby/shared/fiber/resume.rb Index: spec/ruby/core/integer/dup_spec.rb =================================================================== --- spec/ruby/core/integer/dup_spec.rb (revision 62093) +++ spec/ruby/core/integer/dup_spec.rb (nonexistent) @@ -1,10 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/integer/dup_spec.rb#L0 -require File.expand_path('../../../spec_helper', __FILE__) - -ruby_version_is '2.4' do - describe "Integer#dup" do - it "returns self" do - int = 2 - int.dup.should equal(int) - end - end -end Property changes on: spec/ruby/core/integer/dup_spec.rb ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -LF \ No newline at end of property Index: spec/ruby/core/hash/has_key_spec.rb =================================================================== --- spec/ruby/core/hash/has_key_spec.rb (revision 62093) +++ spec/ruby/core/hash/has_key_spec.rb (revision 62094) @@ -3,6 +3,6 @@ require File.expand_path('../fixtures/cl https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/hash/has_key_spec.rb#L3 require File.expand_path('../shared/key', __FILE__) describe "Hash#has_key?" do - it_behaves_like(:hash_key_p, :has_key?) + it_behaves_like :hash_key_p, :has_key? end Index: spec/ruby/core/hash/merge_spec.rb =================================================================== --- spec/ruby/core/hash/merge_spec.rb (revision 62093) +++ spec/ruby/core/hash/merge_spec.rb (revision 62094) @@ -66,7 +66,7 @@ describe "Hash#merge" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/hash/merge_spec.rb#L66 end describe "Hash#merge!" do - it_behaves_like(:hash_update, :merge!) + it_behaves_like :hash_update, :merge! it "does not raise an exception if changing the value of an existing key during iteration" do hash = {1 => 2, 3 => 4, 5 => 6} Index: spec/ruby/core/hash/transform_keys_spec.rb =================================================================== --- spec/ruby/core/hash/transform_keys_spec.rb (revision 62093) +++ spec/ruby/core/hash/transform_keys_spec.rb (revision 62094) @@ -60,17 +60,39 @@ ruby_version_is "2.5" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/hash/transform_keys_spec.rb#L60 @hash.should == { 'a' => 1, 'b' => 2, 'c' => 3, 'd' => 4 } end - it "prevents conflicts between new keys and old ones" do - @hash.transform_keys!(&:succ) - @hash.should == { b: 1, c: 2, d: 3, e: 4 } + # https://bugs.ruby-lang.org/issues/14380 + ruby_version_is ""..."2.6" do + it "does not prevent conflicts between new keys and old ones" do + @hash.transform_keys!(&:succ) + @hash.should == { e: 1 } + end + end + + ruby_version_is "2.6" do + it "prevents conflicts between new keys and old ones" do + @hash.transform_keys!(&:succ) + @hash.should == { b: 1, c: 2, d: 3, e: 4 } + end + end + + ruby_version_is ""..."2.6" do + it "partially modifies the contents if we broke from the block" do + @hash.transform_keys! do |v| + break if v == :c + v.succ + end + @hash.should == { c: 1, d: 4 } + end end - it "partially modifies the contents if we broke from the block" do - @hash.transform_keys! do |v| - break if v == :c - v.succ + ruby_version_is "2.6" do + it "returns the processed keys if we broke from the block" do + @hash.transform_keys! do |v| + break if v == :c + v.succ + end + @hash.should == { b: 1, c: 2 } end - @hash.should == { b: 1, c: 2 } end it "keeps later pair if new keys conflict" do Index: spec/ruby/core/hash/replace_spec.rb =================================================================== --- spec/ruby/core/hash/replace_spec.rb (revision 62093) +++ spec/ruby/core/hash/replace_spec.rb (revision 62094) @@ -3,5 +3,5 @@ require File.expand_path('../fixtures/cl https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/hash/replace_spec.rb#L3 require File.expand_path('../shared/replace', __FILE__) describe "Hash#replace" do - it_behaves_like(:hash_replace, :replace) + it_behaves_like :hash_replace, :replace end Index: spec/ruby/core/hash/delete_if_spec.rb =================================================================== --- spec/ruby/core/hash/delete_if_spec.rb (revision 62093) +++ spec/ruby/core/hash/delete_if_spec.rb (revision 62094) @@ -39,6 +39,6 @@ describe "Hash#delete_if" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/hash/delete_if_spec.rb#L39 lambda { HashSpecs.empty_frozen_hash.delete_if { true } }.should raise_error(frozen_error_class) end - it_behaves_like(:hash_iteration_no_block, :delete_if) - it_behaves_like(:enumeratorized_with_origin_size, :delete_if, { 1 => 2, 3 => 4, 5 => 6 }) + it_behaves_like :hash_iteration_no_block, :delete_if + it_behaves_like :enumeratorized_with_origin_size, :delete_if, { 1 => 2, 3 => 4, 5 => 6 } end Index: spec/ruby/core/hash/key_spec.rb =================================================================== --- spec/ruby/core/hash/key_spec.rb (revision 62093) +++ spec/ruby/core/hash/key_spec.rb (revision 62094) @@ -4,9 +4,9 @@ require File.expand_path('../shared/key' https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/hash/key_spec.rb#L4 require File.expand_path('../shared/index', __FILE__) describe "Hash#key?" do - it_behaves_like(:hash_key_p, :key?) + it_behaves_like :hash_key_p, :key? end describe "Hash#key" do - it_behaves_like(:hash_index, :key) + it_behaves_like :hash_index, :key end Index: spec/ruby/core/matchdata/equal_value_spec.rb =================================================================== --- spec/ruby/core/matchdata/equal_value_spec.rb (revision 62093) +++ spec/ruby/core/matchdata/equal_value_spec.rb (revision 62094) @@ -2,5 +2,5 @@ require File.expand_path('../../../spec_ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/matchdata/equal_value_spec.rb#L2 require File.expand_path('../shared/eql', __FILE__) describe "MatchData#==" do - it_behaves_like(:matchdata_eql, :==) + it_behaves_like :matchdata_eql, :== end Index: spec/ruby/core/matchdata/length_spec.rb =================================================================== --- spec/ruby/core/matchdata/length_spec.rb (revision 62093) +++ spec/ruby/core/matchdata/length_spec.rb (revision 62094) @@ -2,5 +2,5 @@ require File.expand_path('../../../spec_ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/matchdata/length_spec.rb#L2 require File.expand_path('../shared/length', __FILE__) describe "MatchData#length" do - it_behaves_like(:matchdata_length, :length) + it_behaves_like :matchdata_length, :length end Index: spec/ruby/core/integer/coerce_spec.rb =================================================================== --- spec/ruby/core/integer/coerce_spec.rb (nonexistent) +++ spec/ruby/core/integer/coerce_spec.rb (revision 62094) @@ -0,0 +1,105 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/integer/coerce_spec.rb#L1 +require File.expand_path('../../../spec_helper', __FILE__) + +describe "Integer#coerce" do + context "fixnum" do + describe "when given a Fixnum" do + it "returns an array containing two Fixnums" do + 1.coerce(2).should == [2, 1] + 1.coerce(2).map { |i| i.class }.should == [Fixnum, Fixnum] + end + end + + describe "when given a String" do + it "raises an ArgumentError when trying to coerce with a non-number String" do + lambda { 1.coerce(":)") }.should raise_error(ArgumentError) + end + + it "returns an array containing two Floats" do + 1.coerce("2").should == [2.0, 1.0] + 1.coerce("-2").should == [-2.0, 1.0] + end + end + + it "raises a TypeError when trying to coerce with nil" do + lambda { 1.coerce(nil) }.should raise_error(TypeError) + end + + it "tries to convert the given Object into a Float by using #to_f" do + (obj = mock('1.0')).should_receive(:to_f).and_return(1.0) + 2.coerce(obj).should == [1.0, 2.0] + + (obj = mock('0')).should_receive(:to_f).and_return('0') + lambda { 2.coerce(obj).should == [1.0, 2.0] }.should raise_error(TypeError) + end + + it "raises a TypeError when given an Object that does not respond to #to_f" do + lambda { 1.coerce(mock('x')) }.should raise_error(TypeError) + lambda { 1.coerce(1..4) }.should raise_error(TypeError) + lambda { 1.coerce(:test) }.should raise_error(TypeError) + end + end + + context "bignum" do + it "coerces other to a Bignum and returns [other, self] when passed a Fixnum" do + a = bignum_value + ary = a.coerce(2) + + ary[0].should be_kind_of(Bignum) + ary[1].should be_kind_of(Bignum) + ary.should == [2, a] + end + + it "returns [other, self] when passed a Bignum" do + a = bignum_value + b = bignum_value + ary = a.coerce(b) + + ary[0].should be_kind_of(Bignum) + ary[1].should be_kind_of(Bignum) + ary.should == [b, a] + end + + it "raises a TypeError when not passed a Fixnum or Bignum" do + a = bignum_value + + lambda { a.coerce(nil) }.should raise_error(TypeError) + lambda { a.coerce(mock('str')) }.should raise_error(TypeError) + lambda { a.coerce(1..4) }.should raise_error(TypeError) + lambda { a.coerce(:test) }.should raise_error(TypeError) + end + + ruby_version_is ""..."2.4" do + it "raises a TypeError when passed a String" do + a = bignum_value + lambda { a.coerce("123") }.should raise_error(TypeError) + end + + it "raises a TypeError when passed a Float" do + a = bignum_value + lambda { a.coerce(12.3) }.should raise_error(TypeError) + end + end + + ruby_version_is "2.4" do + it "coerces both values to Floats and returns [other, self] when passed a Float" do + a = bignum_value + a.coerce(1.2).should == [1.2, a.to_f] + end + + it "coerces both values to Floats and returns [other, self] when passed a String" do + a = bignum_value + a.coerce("123").should == [123.0, a.to_f] + end + + it "calls #to_f to coerce other to a Float" do + b = mock("bignum value") + b.should_receive(:to_f).and_return(1.2) + + a = bignum_value + ary = a.coerce(b) + + ary.should == [1.2, a.to_f] + end + end + end +end Property changes on: spec/ruby/core/integer/coerce_spec.rb ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +LF \ No newline at end of property Index: spec/ruby/core/integer/comparison_spec.rb =================================================================== --- spec/ruby/core/integer/comparison_spec.rb (nonexistent) +++ spec/ruby/core/integer/comparison_spec.rb (revision 62094) @@ -0,0 +1,189 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/integer/comparison_spec.rb#L1 +require File.expand_path('../../../spec_helper', __FILE__) + +describe "Integer#<=>" do + context "fixnum" do + it "returns -1 when self is less than the given argument" do + (-3 <=> -1).should == -1 + (-5 <=> 10).should == -1 + (-5 <=> -4.5).should == -1 + end + + it "returns 0 when self is equal to the given argument" do + (0 <=> 0).should == 0 + (954 <=> 954).should == 0 + (954 <=> 954.0).should == 0 + end + + it "returns 1 when self is greater than the given argument" do + (496 <=> 5).should == 1 + (200 <=> 100).should == 1 + (51 <=> 50.5).should == 1 + end + + it "returns nil when the given argument is not an Integer" do + (3 <=> mock('x')).should == nil + (3 <=> 'test').should == nil + end + end + + context "bignum" do + describe "with a Fixnum" do + it "returns -1 when other is larger" do + (-bignum_value <=> 2).should == -1 + end + + it "returns 1 when other is smaller" do + (bignum_value <=> 2).should == 1 + end + end + + describe "with a Bignum" do + describe "when other is negative" do + it "returns -1 when self is negative and other is larger" do + (-bignum_value(42) <=> -bignum_value).should == -1 + end + + it "returns 0 when other is equal" do + (-bignum_value <=> -bignum_value).should == 0 + end + + it "returns 1 when self is negative and other is smaller" do + (-bignum_value <=> -bignum_value(94)).should == 1 + end + + it "returns 1 when self is positive" do + (bignum_value <=> -bignum_value).should == 1 + end + end + + describe "when other is positive" do + it "returns -1 when self is negative" do + (-bignum_value <=> bignum_value).should == -1 + end + + it "returns -1 when self is positive and other is larger" do + (bignum_value <=> bignum_value(38)).should == -1 + end + + it "returns 0 when other is equal" do + (bignum_value <=> bignum_value).should == 0 + end + + it "returns 1 when other is smaller" do + (bignum_value(56) <=> bignum_value).should == 1 + end + end + end + + describe "with a Float" do + describe "when other is negative" do + it "returns -1 when self is negative and other is larger" do + (-bignum_value(0xffff) <=> -bignum_value.to_f).should == -1 + end + + it "returns 0 when other is equal" do + (-bignum_value <=> -bignum_value.to_f).should == 0 + end + + it "returns 1 when self is negative and other is smaller" do + (-bignum_value <=> -bignum_value(0xffef).to_f).should == 1 + end + + it "returns 1 when self is positive" do + (bignum_value <=> -bignum_value.to_f).should == 1 + end + end + + describe "when other is positive" do + it "returns -1 when self is negative" do + (-bignum_value <=> bignum_value.to_f).should == -1 + end + + it "returns -1 when self is positive and other is larger" do + (bignum_value <=> bignum_value(0xfffe).to_f).should == -1 + end + + it "returns 0 when other is equal" do + (bignum_value <=> bignum_value.to_f).should == 0 + end + + it "returns 1 when other is smaller" do + (bignum_value(0xfeff) <=> bignum_value.to_f).should == 1 + end + end + end + + describe "with an Object" do + before :each do + @big = bignum_value + @num = mock("value for Bignum#<=>") + end + + it "calls #coerce on other" do + @num.should_receive(:coerce).with(@big).and_return([@big.to_f, 2.5]) + @big <=> @num + end + + ruby_version_is ""..."2.5" do + it "returns nil if #coerce raises an exception" do + @num.should_receive(:coerce).with(@big).and_raise(RuntimeError) + lambda { + @result = (@big <=> @num) + }.should complain(/Numerical comparison operators will no more rescue exceptions/) + @result.should be_nil + end + end + + ruby_version_is "2.5" do + it "lets the exception go through if #coerce raises an exception" do + @num.should_receive(:coerce).with(@big).and_raise(RuntimeError.new("my error")) + lambda { + @big <=> @num + }.should raise_error(RuntimeError, "my error") + end + end + + it "raises an exception if #coerce raises a non-StandardError exception" do + @num.should_receive(:coerce).with(@big).and_raise(Exception) + lambda { @big <=> @num }.should raise_error(Exception) + end + + it "returns nil if #coerce does not return an Array" do + @num.should_receive(:coerce).with(@big).and_return(nil) + (@big <=> @num).should be_nil + end + + it "returns -1 if the coerced value is larger" do + @num.should_receive(:coerce).with(@big).and_return([@big, bignum_value(10)]) + (@big <=> @num).should == -1 + end + + it "returns 0 if the coerced value is equal" do + @num.should_receive(:coerce).with(@big).and_return([@big, bignum_value]) + (@big <=> @num).should == 0 + end + + it "returns 1 if the coerced value is smaller" do + @num.should_receive(:coerce).with(@big).and_return([@big, 22]) + (@big <=> @num).should == 1 + end + end + + # The tests below are taken from matz's revision 23730 for Ruby trunk + it "returns 1 when self is Infinity and other is a Bignum" do + (infinity_value <=> Float::MAX.to_i*2).should == 1 + end + + it "returns -1 when self is negative and other is Infinty" do + (-Float::MAX.to_i*2 <=> infinity_value).should == -1 + end + + it "returns 1 when self is negative and other is -Infinity" do + (-Float::MAX.to_i*2 <=> -infinity_value).should == 1 + end + + it "returns -1 when self is -Infinity and other is negative" do + (-infinity_value <=> -Float::MAX.to_i*2).should == -1 + end + end +end Property changes on: spec/ruby/core/integer/comparison_spec.rb ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +LF \ No newline at end of property Index: spec/ruby/core/hash/length_spec.rb =================================================================== --- spec/ruby/core/hash/length_spec.rb (revision 62093) +++ spec/ruby/core/hash/length_spec.rb (revision 62094) @@ -3,5 +3,5 @@ require File.expand_path('../fixtures/cl https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/hash/length_spec.rb#L3 require File.expand_path('../shared/length', __FILE__) describe "Hash#length" do - it_behaves_like(:hash_length, :length) + it_behaves_like :hash_length, :length end Index: spec/ruby/core/encoding/to_s_spec.rb =================================================================== --- spec/ruby/core/encoding/to_s_spec.rb (revision 62093) +++ spec/ruby/core/encoding/to_s_spec.rb (revision 62094) @@ -2,6 +2,6 @@ require File.expand_path('../shared/name https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/encoding/to_s_spec.rb#L2 with_feature :encoding do describe "Encoding#to_s" do - it_behaves_like(:encoding_name, :to_s) + it_behaves_like :encoding_name, :to_s end end Index: spec/ruby/core/matchdata/size_spec.rb =================================================================== --- spec/ruby/core/matchdata/size_spec.rb (revision 62093) +++ spec/ruby/core/matchdata/size_spec.rb (revision 62094) @@ -2,5 +2,5 @@ require File.expand_path('../../../spec_ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/matchdata/size_spec.rb#L2 require File.expand_path('../shared/length', __FILE__) describe "MatchData#size" do - it_behaves_like(:matchdata_length, :size) + it_behaves_like :matchdata_length, :size end Index: spec/ruby/core/integer/bit_and_spec.rb =================================================================== --- spec/ruby/core/integer/bit_and_spec.rb (nonexistent) +++ spec/ruby/core/integer/bit_and_spec.rb (revision 62094) @@ -0,0 +1,97 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/integer/bit_and_spec.rb#L1 +require File.expand_path('../../../spec_helper', __FILE__) + +describe "Integer#&" do + context "fixnum" do + it "returns self bitwise AND other" do + (256 & 16).should == 0 + (2010 & 5).should == 0 + (65535 & 1).should == 1 + (0xffff & bignum_value + 0xffff_ffff).should == 65535 + end + + it "returns self bitwise AND other when one operand is negative" do + ((1 << 33) & -1).should == (1 << 33) + (-1 & (1 << 33)).should == (1 << 33) + + ((-(1<<33)-1) & 5).should == 5 + (5 & (-(1<<33)-1)).should == 5 + end + + it "returns self bitwise AND other when both operands are negative" do + (-5 & -1).should == -5 + (-3 & -4).should (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/