backports 3.6.8 → 3.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. checksums.yaml +13 -5
  2. data/.gitmodules +4 -1
  3. data/.travis.yml +4 -1
  4. data/Gemfile +1 -1
  5. data/Gemfile.lock +3 -8
  6. data/README.rdoc +16 -2
  7. data/Rakefile +60 -20
  8. data/frozen_old_spec/tags/1.8.6/core/argf/each_line_spec.rb +6 -0
  9. data/frozen_old_spec/tags/1.8.6/core/argf/each_spec.rb +6 -0
  10. data/frozen_old_spec/tags/1.8.6/core/argf/lines_spec.rb +6 -0
  11. data/frozen_old_spec/tags/1.8.6/core/array/collect_spec.rb +7 -0
  12. data/frozen_old_spec/tags/1.8.6/core/array/rotate_spec.rb +2 -0
  13. data/frozen_old_spec/tags/1.8.6/core/array/uniq_spec.rb +3 -0
  14. data/frozen_old_spec/tags/1.8.6/core/complex/to_r_spec.rb +3 -0
  15. data/frozen_old_spec/tags/1.8.6/core/enumerable/each_entry_spec.rb +1 -0
  16. data/frozen_old_spec/tags/1.8.6/core/enumerator/next_spec.rb +1 -0
  17. data/frozen_old_spec/tags/1.8.6/core/env/to_h_spec.rb +2 -0
  18. data/frozen_old_spec/tags/1.8.6/core/file/join_spec.rb +3 -0
  19. data/frozen_old_spec/tags/1.8.6/core/file/lchmod_spec.rb +2 -0
  20. data/frozen_old_spec/tags/1.8.6/core/file/new_spec.rb +2 -0
  21. data/frozen_old_spec/tags/1.8.6/core/file/open_spec.rb +13 -0
  22. data/frozen_old_spec/tags/1.8.6/core/file/to_path_spec.rb +1 -0
  23. data/frozen_old_spec/tags/1.8.6/core/fixnum/fdiv_spec.rb +1 -0
  24. data/frozen_old_spec/tags/1.8.6/core/gc/stress_spec.rb +2 -0
  25. data/frozen_old_spec/tags/1.8.6/core/hash/assoc_spec.rb +1 -0
  26. data/frozen_old_spec/tags/1.8.6/core/hash/constructor_spec.rb +3 -0
  27. data/frozen_old_spec/tags/1.8.6/core/hash/default_proc_spec.rb +3 -0
  28. data/frozen_old_spec/tags/1.8.6/core/hash/delete_if_spec.rb +1 -0
  29. data/frozen_old_spec/tags/1.8.6/core/hash/each_pair_spec.rb +1 -0
  30. data/frozen_old_spec/tags/1.8.6/core/hash/eql_spec.rb +3 -0
  31. data/frozen_old_spec/tags/1.8.6/core/hash/hash_spec.rb +3 -0
  32. data/frozen_old_spec/tags/1.8.6/core/hash/keep_if_spec.rb +2 -0
  33. data/frozen_old_spec/tags/1.8.6/core/hash/rassoc_spec.rb +1 -0
  34. data/frozen_old_spec/tags/1.8.6/core/hash/reject_spec.rb +2 -0
  35. data/frozen_old_spec/tags/1.8.6/core/hash/select_spec.rb +8 -0
  36. data/frozen_old_spec/tags/1.8.6/core/integer/round_spec.rb +2 -0
  37. data/frozen_old_spec/tags/1.8.6/core/io/binread_spec.rb +7 -0
  38. data/frozen_old_spec/tags/1.8.6/core/io/chars_spec.rb +1 -0
  39. data/frozen_old_spec/tags/1.8.6/core/io/each_char_spec.rb +1 -0
  40. data/frozen_old_spec/tags/1.8.6/core/io/lines_spec.rb +1 -0
  41. data/frozen_old_spec/tags/1.8.6/core/io/open_spec.rb +24 -0
  42. data/frozen_old_spec/tags/1.8.6/core/io/ungetbyte_spec.rb +4 -0
  43. data/frozen_old_spec/tags/1.8.6/core/io/write_spec.rb +5 -0
  44. data/frozen_old_spec/tags/1.8.6/core/kernel/__callee___spec.rb +6 -0
  45. data/frozen_old_spec/tags/1.8.6/core/kernel/__method___spec.rb +1 -0
  46. data/frozen_old_spec/tags/1.8.6/core/kernel/define_singleton_method_spec.rb +2 -0
  47. data/frozen_old_spec/tags/1.8.6/core/kernel/public_method_spec.rb +2 -0
  48. data/frozen_old_spec/tags/1.8.6/core/kernel/require_relative_spec.rb +3 -0
  49. data/frozen_old_spec/tags/1.8.6/core/math/log2_spec.rb +6 -0
  50. data/frozen_old_spec/tags/1.8.6/core/math/log_spec.rb +3 -0
  51. data/frozen_old_spec/tags/1.8.6/core/module/class_exec_spec.rb +2 -0
  52. data/frozen_old_spec/tags/1.8.6/core/module/module_exec_spec.rb +2 -0
  53. data/frozen_old_spec/tags/1.8.6/core/numeric/step_spec.rb +12 -0
  54. data/frozen_old_spec/tags/1.8.6/core/proc/curry_spec.rb +4 -0
  55. data/frozen_old_spec/tags/1.8.6/core/range/step_spec.rb +12 -0
  56. data/frozen_old_spec/tags/1.8.6/core/string/getbyte_spec.rb +6 -0
  57. data/frozen_old_spec/tags/1.8.6/core/string/partition_spec.rb +1 -0
  58. data/frozen_old_spec/tags/1.8.6/core/string/prepend_spec.rb +1 -0
  59. data/frozen_old_spec/tags/1.8.6/core/string/rpartition_spec.rb +1 -0
  60. data/frozen_old_spec/tags/1.8.6/core/string/setbyte_spec.rb +5 -0
  61. data/frozen_old_spec/tags/1.8.6/core/string/upto_spec.rb +1 -0
  62. data/frozen_old_spec/tags/1.8.6/core/symbol/capitalize_spec.rb +3 -0
  63. data/frozen_old_spec/tags/1.8.6/core/symbol/comparison_spec.rb +1 -0
  64. data/frozen_old_spec/tags/1.8.6/core/symbol/downcase_spec.rb +2 -0
  65. data/frozen_old_spec/tags/1.8.6/core/symbol/element_reference_spec.rb +4 -0
  66. data/frozen_old_spec/tags/1.8.6/core/symbol/empty_spec.rb +1 -0
  67. data/frozen_old_spec/tags/1.8.6/core/symbol/match_spec.rb +2 -0
  68. data/frozen_old_spec/tags/1.8.6/core/symbol/swapcase_spec.rb +2 -0
  69. data/frozen_old_spec/tags/1.8.6/core/symbol/to_proc_spec.rb +1 -0
  70. data/frozen_old_spec/tags/1.8.6/core/symbol/upcase_spec.rb +1 -0
  71. data/frozen_old_spec/tags/1.8.7/core/array/keep_if_spec.rb +2 -0
  72. data/frozen_old_spec/tags/1.8.7/core/array/rotate_spec.rb +2 -0
  73. data/frozen_old_spec/tags/1.8.7/core/array/select_spec.rb +2 -0
  74. data/frozen_old_spec/tags/1.8.7/core/array/uniq_spec.rb +3 -0
  75. data/frozen_old_spec/tags/1.8.7/core/complex/to_r_spec.rb +3 -0
  76. data/frozen_old_spec/tags/1.8.7/core/enumerable/collect_concat_spec.rb +1 -0
  77. data/frozen_old_spec/tags/1.8.7/core/enumerable/flat_map_spec.rb +1 -0
  78. data/frozen_old_spec/tags/1.8.7/core/env/to_h_spec.rb +2 -0
  79. data/frozen_old_spec/tags/1.8.7/core/file/lchmod_spec.rb +2 -0
  80. data/frozen_old_spec/tags/1.8.7/core/file/new_spec.rb +1 -0
  81. data/frozen_old_spec/tags/1.8.7/core/file/open_spec.rb +5 -0
  82. data/frozen_old_spec/tags/1.8.7/core/file/readlink_spec.rb +6 -0
  83. data/frozen_old_spec/tags/1.8.7/core/file/to_path_spec.rb +1 -0
  84. data/frozen_old_spec/tags/1.8.7/core/hash/assoc_spec.rb +1 -0
  85. data/frozen_old_spec/tags/1.8.7/core/hash/default_proc_spec.rb +3 -0
  86. data/frozen_old_spec/tags/1.8.7/core/hash/keep_if_spec.rb +2 -0
  87. data/frozen_old_spec/tags/1.8.7/core/hash/rassoc_spec.rb +1 -0
  88. data/frozen_old_spec/tags/1.8.7/core/hash/select_spec.rb +1 -0
  89. data/frozen_old_spec/tags/1.8.7/core/integer/round_spec.rb +2 -0
  90. data/frozen_old_spec/tags/1.8.7/core/io/binread_spec.rb +7 -0
  91. data/frozen_old_spec/tags/1.8.7/core/io/open_spec.rb +32 -0
  92. data/frozen_old_spec/tags/1.8.7/core/io/ungetbyte_spec.rb +4 -0
  93. data/frozen_old_spec/tags/1.8.7/core/io/write_spec.rb +5 -0
  94. data/frozen_old_spec/tags/1.8.7/core/kernel/__callee___spec.rb +6 -0
  95. data/frozen_old_spec/tags/1.8.7/core/kernel/define_singleton_method_spec.rb +2 -0
  96. data/frozen_old_spec/tags/1.8.7/core/kernel/public_method_spec.rb +1 -0
  97. data/frozen_old_spec/tags/1.8.7/core/kernel/require_relative_spec.rb +3 -0
  98. data/frozen_old_spec/tags/1.8.7/core/math/log2_spec.rb +6 -0
  99. data/frozen_old_spec/tags/1.8.7/core/math/log_spec.rb +3 -0
  100. data/frozen_old_spec/tags/1.8.7/core/module/include_spec.rb +3 -0
  101. data/frozen_old_spec/tags/1.8.7/core/proc/curry_spec.rb +3 -0
  102. data/frozen_old_spec/tags/1.8.7/core/proc/yield_spec.rb +4 -0
  103. data/frozen_old_spec/tags/1.8.7/core/range/size_spec.rb +1 -0
  104. data/frozen_old_spec/tags/1.8.7/core/string/getbyte_spec.rb +5 -0
  105. data/frozen_old_spec/tags/1.8.7/core/string/prepend_spec.rb +1 -0
  106. data/frozen_old_spec/tags/1.8.7/core/string/setbyte_spec.rb +5 -0
  107. data/frozen_old_spec/tags/1.8.7/core/symbol/capitalize_spec.rb +3 -0
  108. data/frozen_old_spec/tags/1.8.7/core/symbol/comparison_spec.rb +1 -0
  109. data/frozen_old_spec/tags/1.8.7/core/symbol/downcase_spec.rb +2 -0
  110. data/frozen_old_spec/tags/1.8.7/core/symbol/element_reference_spec.rb +4 -0
  111. data/frozen_old_spec/tags/1.8.7/core/symbol/empty_spec.rb +1 -0
  112. data/frozen_old_spec/tags/1.8.7/core/symbol/match_spec.rb +2 -0
  113. data/frozen_old_spec/tags/1.8.7/core/symbol/swapcase_spec.rb +2 -0
  114. data/frozen_old_spec/tags/1.8.7/core/symbol/upcase_spec.rb +1 -0
  115. data/frozen_old_spec/tags/1.9.1/core/array/rotate_spec.rb +1 -0
  116. data/frozen_old_spec/tags/1.9.1/core/env/to_h_spec.rb +2 -0
  117. data/frozen_old_spec/tags/1.9.1/core/hash/default_proc_spec.rb +1 -0
  118. data/frozen_old_spec/tags/1.9.1/core/io/write_spec.rb +2 -0
  119. data/frozen_old_spec/tags/1.9.2/core/io/write_spec.rb +3 -0
  120. data/lib/backports/1.8.7/fixnum/div.rb +1 -1
  121. data/lib/backports/1.8.7/fixnum/fdiv.rb +1 -1
  122. data/lib/backports/1.9.2/stdlib/matrix.rb +3 -3
  123. data/lib/backports/2.0.0/range/bsearch.rb +5 -7
  124. data/lib/backports/2.1.0/bignum/bit_length.rb +1 -1
  125. data/lib/backports/2.1.0/fixnum/bit_length.rb +1 -1
  126. data/lib/backports/2.2.0.rb +3 -0
  127. data/lib/backports/2.2.0/enumerable.rb +3 -0
  128. data/lib/backports/2.2.0/enumerable/slice_after.rb +25 -0
  129. data/lib/backports/2.2.0/enumerable/slice_when.rb +27 -0
  130. data/lib/backports/2.2.0/float.rb +3 -0
  131. data/lib/backports/2.2.0/float/next_float.rb +11 -0
  132. data/lib/backports/2.2.0/float/prev_float.rb +11 -0
  133. data/lib/backports/2.2.rb +2 -0
  134. data/lib/backports/2.3.0.rb +3 -0
  135. data/lib/backports/2.3.0/.git_keep +0 -0
  136. data/lib/backports/2.3.rb +2 -0
  137. data/lib/backports/2.4.0.rb +3 -0
  138. data/lib/backports/2.4.0/comparable.rb +3 -0
  139. data/lib/backports/2.4.0/comparable/clamp.rb +20 -0
  140. data/lib/backports/2.4.rb +2 -0
  141. data/lib/backports/tools/extreme_object.rb +2 -2
  142. data/lib/backports/tools/float_integer_conversion.rb +17 -0
  143. data/lib/backports/version.rb +1 -1
  144. data/set_version/2.2.0.rb +1 -0
  145. data/set_version/2.3.0.rb +1 -0
  146. data/set_version/2.4.0.rb +1 -0
  147. metadata +141 -10
@@ -0,0 +1,4 @@
1
+ fails:IO#ungetbyte does nothing when passed nil
2
+ fails:IO#ungetbyte puts back each byte in a String argument
3
+ fails:IO#ungetbyte calls #to_str to convert the argument
4
+ fails:IO#ungetbyte puts back one byte for an Integer argument
@@ -0,0 +1,5 @@
1
+ fails:IO.write uses encoding from given options, if provided
2
+ fails:IO.write uses an :open_args option
3
+ fails:IO.write disregards other options if :open_args is given
4
+ fails:IO.write uses the given encoding and returns the number of bytes written
5
+ fails:IO.write writes binary data if no encoding is given
@@ -0,0 +1,6 @@
1
+ fails:Kernel.__callee__ returns the current method, even when aliased
2
+ fails:Kernel.__callee__ returns the original name when aliased method
3
+ fails:Kernel.__callee__ returns the caller from blocks too
4
+ fails:Kernel.__callee__ returns nil when not called from a method
5
+ fails:Kernel.__callee__ returns the caller when sent as a string
6
+ fails:Kernel.__callee__ returns the aliased name when aliased method
@@ -0,0 +1 @@
1
+ fails:Kernel.__method__ returns the original name when aliased method
@@ -0,0 +1,2 @@
1
+ fails:Kernel#define_singleton_method when given an UnboundMethod defines any Child class method from any Parent's class methods
2
+ fails:Kernel#define_singleton_method when given an UnboundMethod will raise when attempting to define an object's singleton method from another object's singleton method
@@ -0,0 +1,2 @@
1
+ fails:Kernel#public_method returns a method object if we repond_to_missing? method
2
+ fails:Kernel#public_method changes the method called for super on a target aliased method
@@ -0,0 +1,3 @@
1
+ fails:Kernel#require_relative with a relative path stores the missing path in a LoadError object
2
+ fails:Kernel#require_relative with a relative path when file is a symlink loads a path relative to current file
3
+ fails:Kernel#require_relative with an absolute path stores the missing path in a LoadError object
@@ -0,0 +1,6 @@
1
+ fails:Math.log2 raises an Errno::EDOM if the argument is less than 0
2
+ fails:Math.log2 raises an TypeError if the argument cannot be coerced with Float()
3
+ fails:Math.log2 raises an TypeError if passed a numerical argument as a string
4
+ fails:Math.log2 returns NaN given NaN
5
+ fails:Math.log2 raises a TypeError if the argument cannot be coerced with Float()
6
+ fails:Math.log2 raises a TypeError if passed a numerical argument as a string
@@ -0,0 +1,3 @@
1
+ fails:Math.log raises a TypeError if the argument cannot be coerced with Float()
2
+ fails:Math.log raises a TypeError for numerical values passed as string
3
+ fails:Math.log returns NaN given NaN
@@ -0,0 +1,2 @@
1
+ fails:Module#class_exec defines method in the receiver's scope
2
+ fails:Module#class_exec raises an LocalJumpError when no block is given
@@ -0,0 +1,2 @@
1
+ fails:Module#module_exec defines method in the receiver's scope
2
+ fails:Module#module_exec raises an LocalJumpError when no block is given
@@ -0,0 +1,12 @@
1
+ fails:Numeric#step Numeric#step with [stop, +step] when self, stop or step is a Float is careful about not yielding a value greater than limit
2
+ fails:Numeric#step Numeric#step with [stop, -step] when self, stop or step is a Float is careful about not yielding a value smaller than limit
3
+ fails:Numeric#step Numeric#step with [stop, +Infinity] yields once if self < stop
4
+ fails:Numeric#step Numeric#step with [stop, +Infinity] yields once when stop is Infinity
5
+ fails:Numeric#step Numeric#step with [stop, +Infinity] yields once when self equals stop
6
+ fails:Numeric#step Numeric#step with [stop, +Infinity] yields once when self and stop are Infinity
7
+ fails:Numeric#step Numeric#step with [stop, +Infinity] does not yield when self > stop
8
+ fails:Numeric#step Numeric#step with [stop, -infinity] yields once if self > stop
9
+ fails:Numeric#step Numeric#step with [stop, -infinity] yields once if stop is -Infinity
10
+ fails:Numeric#step Numeric#step with [stop, -infinity] yields once when self equals stop
11
+ fails:Numeric#step Numeric#step with [stop, -infinity] yields once when self and stop are Infinity
12
+ fails:Numeric#step Numeric#step with [stop, -infinity] does not yield when self > stop
@@ -0,0 +1,4 @@
1
+ fails:Proc#curry produces Procs that raise ArgumentError for #binding
2
+ fails:Proc#curry produces Procs that return [[:rest]] for #parameters
3
+ fails:Proc#curry produces Procs that return nil for #source_location
4
+ fails:Proc#curry produces Procs that can be passed as the block for instance_exec
@@ -0,0 +1,12 @@
1
+ fails:Range#step with inclusive end and Integer values yields Float values incremented by a Float step
2
+ fails:Range#step with inclusive end and Float values returns Float values of 'step * n + begin <= end'
3
+ fails:Range#step with inclusive end and Integer, Float values yields Float values incremented by 1 and less than or equal to end when not passed a step
4
+ fails:Range#step with inclusive end and Integer, Float values yields Float values incremented by an Integer step
5
+ fails:Range#step with inclusive end and Integer, Float values yields Float values incremented by a Float step
6
+ fails:Range#step with inclusive end and String values raises a TypeError when passed a Float step
7
+ fails:Range#step with exclusive end and Integer values yields Float values incremented by a Float step
8
+ fails:Range#step with exclusive end and Float values returns Float values of 'step * n + begin < end'
9
+ fails:Range#step with exclusive end and Integer, Float values yields Float values incremented by 1 and less than end when not passed a step
10
+ fails:Range#step with exclusive end and Integer, Float values yields Float values incremented by an Integer step
11
+ fails:Range#step with exclusive end and Integer, Float values yields an Float and then Float values incremented by a Float step
12
+ fails:Range#step with exclusive end and String values raises a TypeError when passed a Float step
@@ -0,0 +1,6 @@
1
+ fails:String#getbyte returns an Integer between 0 and 255
2
+ fails:String#getbyte regards a multi-byte character as having multiple bytes
3
+ fails:String#getbyte mirrors the output of #bytes
4
+ fails:String#getbyte interprets bytes relative to the String's encoding
5
+ fails:String#getbyte raises an ArgumentError unless given one argument
6
+ fails:String#getbyte raises a TypeError unless its argument can be coerced into an Integer
@@ -0,0 +1 @@
1
+ fails:String#partition with String sets global vars if regexp used
@@ -0,0 +1 @@
1
+ fails:String#prepend raises a RuntimeError when self if frozen
@@ -0,0 +1 @@
1
+ fails:String#rpartition with String affects $~
@@ -0,0 +1,5 @@
1
+ fails:String#setbyte allows changing bytes in multi-byte characters
2
+ fails:String#setbyte can invalidate a String's encoding
3
+ fails:String#setbyte sets a byte at an index greater than String size
4
+ fails:String#setbyte raises a RuntimeError if self is frozen
5
+ fails:String#setbyte raises a TypeError unless the second argument is an Integer
@@ -0,0 +1 @@
1
+ fails:String#upto raises a LocalJumpError if other is a string but no block was given
@@ -0,0 +1,3 @@
1
+ fails:Symbol#capitalize leaves the first character alone if it is not an alphabetical ASCII character
2
+ fails:Symbol#capitalize leaves uppercase Unicode characters as they were
3
+ fails:Symbol#capitalize leaves lowercase Unicode characters as they were
@@ -0,0 +1 @@
1
+ fails:Symbol#<=> with Symbol compares individual characters based on their ascii value
@@ -0,0 +1,2 @@
1
+ fails:Symbol#downcase leaves lowercase Unicode characters as they were
2
+ fails:Symbol#downcase leaves uppercase Unicode characters as they were
@@ -0,0 +1,4 @@
1
+ fails:Symbol#[] with a Regex slice without a capture index sets $~ to the MatchData if there is a match
2
+ fails:Symbol#[] with a Regex slice with a capture index sets $~ to the MatchData if there is a match
3
+ fails:Symbol#[] with a Regex slice without a capture index returns an untrusted string if the regexp is untrusted
4
+ fails:Symbol#[] with a Regex slice with a capture index returns an untrusted string if the regexp is untrusted
@@ -0,0 +1 @@
1
+ fails:Symbol#empty? returns true if self is empty
@@ -0,0 +1,2 @@
1
+ fails:Symbol#=~ sets the last match pseudo-variables
2
+ fails:Symbol#match sets the last match pseudo-variables
@@ -0,0 +1,2 @@
1
+ fails:Symbol#swapcase leaves uppercase Unicode characters as they were
2
+ fails:Symbol#swapcase leaves lowercase Unicode characters as they were
@@ -0,0 +1 @@
1
+ fails:Symbol#to_proc raises an ArgumentError when calling #call on the Proc without receiver
@@ -0,0 +1 @@
1
+ fails:Symbol#upcase leaves lowercase Unicode characters as they were
@@ -0,0 +1,2 @@
1
+ fails:Array#keep_if on frozen objects with truthy block raises a RuntimeError
2
+ fails:Array#keep_if on frozen objects with falsy block raises a RuntimeError
@@ -0,0 +1,2 @@
1
+ fails:Array#rotate returns subclass instance for Array subclasses
2
+ fails:Array#rotate! raises a RuntimeError on a frozen array
@@ -0,0 +1,2 @@
1
+ fails:Array#select! on frozen objects with truthy block raises a RuntimeError
2
+ fails:Array#select! on frozen objects with falsy block raises a RuntimeError
@@ -0,0 +1,3 @@
1
+ fails:Array#uniq! raises a RuntimeError on a frozen array when the array is modified
2
+ fails:Array#uniq! raises a RuntimeError on a frozen array when the array would not be modified
3
+ fails:Array#uniq! doesn't yield to the block on a frozen array
@@ -0,0 +1,3 @@
1
+ fails:Complex#to_r when the imaginary part is Fixnum 0 returns the result of sending #to_r to the real part
2
+ fails:Complex#to_r when the imaginary part is Rational 0 returns the result of sending #to_r to the real part
3
+ fails:Complex#to_r when the imaginary part responds to #== 0 with true returns the result of sending #to_r to the real part
@@ -0,0 +1 @@
1
+ fails:Enumerable#collect_concat calls to_ary but not to_a
@@ -0,0 +1 @@
1
+ fails:Enumerable#flat_map calls to_ary but not to_a
@@ -0,0 +1,2 @@
1
+ fails:ENV.to_hash uses the locale encoding for keys
2
+ fails:ENV.to_hash uses the locale encoding for values
@@ -0,0 +1,2 @@
1
+ fails:File.lchmod returns false from #respond_to?
2
+ fails:File.lchmod raises a NotImplementedError when called
@@ -0,0 +1 @@
1
+ fails:File.new raises an Errno::EBADF if the first parameter is an invalid file descriptor
@@ -0,0 +1,5 @@
1
+ fails:File.open on a FIFO opens it as a normal file
2
+ fails:File.open raises a SystemCallError if passed an invalid Integer type
3
+ fails:File.open defaults external_encoding to ASCII-8BIT for binary modes
4
+ fails:File.open when passed a file descriptor opens a file
5
+ fails:File.open when passed a file descriptor opens a file when passed a block
@@ -0,0 +1,6 @@
1
+ fails:File.readlink File.readlink with absolute paths return the name of the file referenced by the given link
2
+ fails:File.readlink File.readlink with absolute paths returns the name of the file referenced by the given link when the file does not exist
3
+ fails:File.readlink File.readlink with absolute paths raises an Errno::ENOENT if there is no such file
4
+ fails:File.readlink File.readlink with absolute paths raises an Errno::EINVAL if called with a normal file
5
+ fails:File.readlink File.readlink when changing the working directory returns the name of the file referenced by the given link
6
+ fails:File.readlink File.readlink when changing the working directory returns the name of the file referenced by the given link when the file does not exist
@@ -0,0 +1 @@
1
+ fails:File#to_path preserves the encoding of the path
@@ -0,0 +1 @@
1
+ fails:Hash#assoc only returns the first matching key-value pair for identity hashes
@@ -0,0 +1,3 @@
1
+ fails:Hash#default_proc= raises an error if passed nil
2
+ fails:Hash#default_proc= raises a TypeError if passed a lambda with an arity other than 2
3
+ fails:Hash#default_proc= raises a RuntimeError if self is frozen
@@ -0,0 +1,2 @@
1
+ fails:Hash#keep_if raises an RuntimeError if called on a frozen instance
2
+ fails:Hash#keep_if raises a RuntimeError if called on a frozen instance
@@ -0,0 +1 @@
1
+ fails:Hash#rassoc only returns the first matching key-value pair
@@ -0,0 +1 @@
1
+ fails:Hash#select returns a Hash of entries for which block is true
@@ -0,0 +1,2 @@
1
+ fails:Integer#round raises a RangeError when passed Float::INFINITY
2
+ fails:Integer#round raises a RangeError when passed a big negative value
@@ -0,0 +1,7 @@
1
+ fails:IO.binread reads the contents of a file
2
+ fails:IO.binread reads the contents of a file up to a certain size when specified
3
+ fails:IO.binread reads the contents of a file from an offset of a specific size when specified
4
+ fails:IO.binread returns a String in ASCII-8BIT encoding
5
+ fails:IO.binread returns a String in ASCII-8BIT encoding regardless of Encoding.default_internal
6
+ fails:IO.binread raises an ArgumentError when not passed a valid length
7
+ fails:IO.binread raises an Errno::EINVAL when not passed a valid offset
@@ -0,0 +1,32 @@
1
+ fails:IO.open uses the external encoding specified in the mode argument
2
+ fails:IO.open uses the external and the internal encoding specified in the mode argument
3
+ fails:IO.open uses the external encoding specified via the :external_encoding option
4
+ fails:IO.open uses the internal encoding specified via the :internal_encoding option
5
+ fails:IO.open uses the colon-separated encodings specified via the :encoding option
6
+ fails:IO.open ingores the :encoding option when the :external_encoding option is present
7
+ fails:IO.open ingores the :encoding option when the :internal_encoding option is present
8
+ fails:IO.open uses the encoding specified via the :mode option hash
9
+ fails:IO.open ignores the :internal_encoding option when the same as the external encoding
10
+ fails:IO.open sets internal encoding to nil when passed '-'
11
+ fails:IO.open raises an error if passed encodings two ways
12
+ fails:IO.open sets binmode from mode string
13
+ fails:IO.open does not set binmode without being asked
14
+ fails:IO.open sets binmode from :binmode option
15
+ fails:IO.open does not set binmode from false :binmode
16
+ fails:IO.open sets external encoding to binary with binmode in mode string
17
+ fails:IO.open does not use binary encoding when mode encoding is specified
18
+ fails:IO.open does not use binary encoding when :encoding option is specified
19
+ fails:IO.open does not use binary encoding when :external_encoding option is specified
20
+ fails:IO.open does not use binary encoding when :internal_encoding option is specified
21
+ fails:IO.open coerces mode with #to_int
22
+ fails:IO.open coerces options as second argument with #to_hash
23
+ fails:IO.open raises ArgumentError if not passed a hash or nil for options
24
+ fails:IO.open sets external encoding to binary with :binmode option
25
+ fails:IO.open raises an error if passed binary/text mode two ways
26
+ fails:IO.open uses the :encoding option as the external encoding when only one is given
27
+ fails:IO.open uses the :encoding options as the external encoding when it's an Encoding object
28
+ fails:IO.open coerces :encoding option with #to_str
29
+ fails:IO.open coerces :external_encoding option with #to_str
30
+ fails:IO.open coerces :internal_encoding option with #to_str
31
+ fails:IO.open accepts an :autoclose option
32
+ fails:IO.open accepts any truthy option :autoclose
@@ -0,0 +1,4 @@
1
+ fails:IO#ungetbyte does nothing when passed nil
2
+ fails:IO#ungetbyte puts back each byte in a String argument
3
+ fails:IO#ungetbyte calls #to_str to convert the argument
4
+ fails:IO#ungetbyte puts back one byte for an Integer argument
@@ -0,0 +1,5 @@
1
+ fails:IO.write uses encoding from given options, if provided
2
+ fails:IO.write uses an :open_args option
3
+ fails:IO.write disregards other options if :open_args is given
4
+ fails:IO.write uses the given encoding and returns the number of bytes written
5
+ fails:IO.write writes binary data if no encoding is given
@@ -0,0 +1,6 @@
1
+ fails:Kernel.__callee__ returns the current method, even when aliased
2
+ fails:Kernel.__callee__ returns the original name when aliased method
3
+ fails:Kernel.__callee__ returns the caller from blocks too
4
+ fails:Kernel.__callee__ returns nil when not called from a method
5
+ fails:Kernel.__callee__ returns the caller when sent as a string
6
+ fails:Kernel.__callee__ returns the aliased name when aliased method
@@ -0,0 +1,2 @@
1
+ fails:Kernel#define_singleton_method when given an UnboundMethod defines any Child class method from any Parent's class methods
2
+ fails:Kernel#define_singleton_method when given an UnboundMethod will raise when attempting to define an object's singleton method from another object's singleton method
@@ -0,0 +1 @@
1
+ fails:Kernel#public_method returns a method object if we repond_to_missing? method
@@ -0,0 +1,3 @@
1
+ fails:Kernel#require_relative with a relative path stores the missing path in a LoadError object
2
+ fails:Kernel#require_relative with a relative path when file is a symlink loads a path relative to current file
3
+ fails:Kernel#require_relative with an absolute path stores the missing path in a LoadError object
@@ -0,0 +1,6 @@
1
+ fails:Math.log2 raises an Errno::EDOM if the argument is less than 0
2
+ fails:Math.log2 raises an TypeError if the argument cannot be coerced with Float()
3
+ fails:Math.log2 raises an TypeError if passed a numerical argument as a string
4
+ fails:Math.log2 returns NaN given NaN
5
+ fails:Math.log2 raises a TypeError if the argument cannot be coerced with Float()
6
+ fails:Math.log2 raises a TypeError if passed a numerical argument as a string
@@ -0,0 +1,3 @@
1
+ fails:Math.log raises a TypeError if the argument cannot be coerced with Float()
2
+ fails:Math.log raises a TypeError for numerical values passed as string
3
+ fails:Math.log returns NaN given NaN
@@ -0,0 +1,3 @@
1
+ fails:Module#include imports constants to modules and classes
2
+ fails:Module#include imports instance methods to modules and classes
3
+ fails:Module#include does not import methods to modules and classes
@@ -0,0 +1,3 @@
1
+ fails:Proc#curry produces Procs that raise ArgumentError for #binding
2
+ fails:Proc#curry produces Procs that return [[:rest]] for #parameters
3
+ fails:Proc#curry produces Procs that return nil for #source_location
@@ -0,0 +1,4 @@
1
+ fails:Proc#yield on a Proc created with Kernel#lambda or Kernel#proc ignores excess arguments when self is a proc
2
+ fails:Proc#yield on a Proc created with Kernel#lambda or Kernel#proc substitutes nil for missing arguments when self is a proc
3
+ fails:Proc#yield on a Proc created with Kernel#lambda or Kernel#proc raises an ArgumentError on excess arguments when self is a lambda
4
+ fails:Proc#yield on a Proc created with Kernel#lambda or Kernel#proc raises an ArgumentError on missing arguments when self is a lambda
@@ -0,0 +1 @@
1
+ fails:Range#size returns nil if first and last are not Numeric
@@ -0,0 +1,5 @@
1
+ fails:String#getbyte returns an Integer between 0 and 255
2
+ fails:String#getbyte regards a multi-byte character as having multiple bytes
3
+ fails:String#getbyte interprets bytes relative to the String's encoding
4
+ fails:String#getbyte raises an ArgumentError unless given one argument
5
+ fails:String#getbyte raises a TypeError unless its argument can be coerced into an Integer
@@ -0,0 +1 @@
1
+ fails:String#prepend raises a RuntimeError when self if frozen
@@ -0,0 +1,5 @@
1
+ fails:String#setbyte allows changing bytes in multi-byte characters
2
+ fails:String#setbyte can invalidate a String's encoding
3
+ fails:String#setbyte sets a byte at an index greater than String size
4
+ fails:String#setbyte raises a RuntimeError if self is frozen
5
+ fails:String#setbyte raises a TypeError unless the second argument is an Integer
@@ -0,0 +1,3 @@
1
+ fails:Symbol#capitalize leaves the first character alone if it is not an alphabetical ASCII character
2
+ fails:Symbol#capitalize leaves uppercase Unicode characters as they were
3
+ fails:Symbol#capitalize leaves lowercase Unicode characters as they were
@@ -0,0 +1 @@
1
+ fails:Symbol#<=> with Symbol compares individual characters based on their ascii value
@@ -0,0 +1,2 @@
1
+ fails:Symbol#downcase leaves lowercase Unicode characters as they were
2
+ fails:Symbol#downcase leaves uppercase Unicode characters as they were
@@ -0,0 +1,4 @@
1
+ fails:Symbol#[] with a Regex slice without a capture index sets $~ to the MatchData if there is a match
2
+ fails:Symbol#[] with a Regex slice with a capture index sets $~ to the MatchData if there is a match
3
+ fails:Symbol#[] with a Regex slice without a capture index returns an untrusted string if the regexp is untrusted
4
+ fails:Symbol#[] with a Regex slice with a capture index returns an untrusted string if the regexp is untrusted
@@ -0,0 +1 @@
1
+ fails:Symbol#empty? returns true if self is empty
@@ -0,0 +1,2 @@
1
+ fails:Symbol#=~ sets the last match pseudo-variables
2
+ fails:Symbol#match sets the last match pseudo-variables
@@ -0,0 +1,2 @@
1
+ fails:Symbol#swapcase leaves uppercase Unicode characters as they were
2
+ fails:Symbol#swapcase leaves lowercase Unicode characters as they were
@@ -0,0 +1 @@
1
+ fails:Symbol#upcase leaves lowercase Unicode characters as they were
@@ -0,0 +1 @@
1
+ fails:Array#rotate returns subclass instance for Array subclasses
@@ -0,0 +1,2 @@
1
+ fails:ENV.to_hash uses the locale encoding for keys
2
+ fails:ENV.to_hash uses the locale encoding for values
@@ -0,0 +1 @@
1
+ fails:Hash#default_proc= raises a TypeError if passed a lambda with an arity other than 2
@@ -0,0 +1,2 @@
1
+ fails:IO.write uses encoding from given options, if provided
2
+ fails:IO.write uses an :open_args option
@@ -0,0 +1,3 @@
1
+ fails:IO.write uses encoding from given options, if provided
2
+ fails:IO.write uses an :open_args option
3
+ fails:IO.write uses the given encoding and returns the number of bytes written
@@ -1,4 +1,4 @@
1
- unless Fixnum.method_defined? :div
1
+ unless Integer.method_defined?(:div) || Fixnum.method_defined?(:div)
2
2
  class Fixnum
3
3
  def div(n)
4
4
  (self / n).to_i
@@ -1,4 +1,4 @@
1
- unless Fixnum.method_defined? :fdiv
1
+ unless Integer.method_defined?(:fdiv) || Fixnum.method_defined?(:fdiv)
2
2
  class Fixnum
3
3
  def fdiv(n)
4
4
  to_f / n
@@ -970,7 +970,7 @@ class Matrix
970
970
  # => 67 96
971
971
  # 48 99
972
972
  #
973
- def ** (other)
973
+ def **(other)
974
974
  case other
975
975
  when Integer
976
976
  x = self
@@ -1465,7 +1465,7 @@ end
1465
1465
  end
1466
1466
  end
1467
1467
 
1468
- def / (other)
1468
+ def /(other)
1469
1469
  case other
1470
1470
  when Numeric
1471
1471
  Scalar.new(@value / other)
@@ -1478,7 +1478,7 @@ end
1478
1478
  end
1479
1479
  end
1480
1480
 
1481
- def ** (other)
1481
+ def **(other)
1482
1482
  case other
1483
1483
  when Numeric
1484
1484
  Scalar.new(@value ** other)