...
 
Commits (5)
......@@ -6,3 +6,4 @@ rdoc
pkg
assets
rs
Gemfile.lock
[submodule "spec/rubyspec"]
path = spec/rubyspec
url = git://github.com/rubyspec/rubyspec.git
url = git://github.com/ruby/spec.git
[submodule "frozen_old_spec/rubyspec"]
path = frozen_old_spec/rubyspec
url = git://github.com/ruby/spec.git
$:.unshift "./lib"
# frozen_string_literal: true
$LOAD_PATH.unshift './lib'
......@@ -3,21 +3,16 @@ language: ruby
rvm:
- "1.8.7"
- "1.9.2"
- "1.9.3"
- "2.0.0"
- "2.1.0"
- "2.2.0"
- "2.3.0"
- "2.4.0"
- ruby-head
- jruby-18mode
- jruby-19mode
- rbx-18mode
- rbx-19mode
matrix:
allow_failures:
- rvm: jruby-18mode
- rvm: jruby-19mode
- rvm: rbx-18mode
- rvm: rbx-19mode
# matrix:
# allow_failures:
# - rvm: "2.2.0" # Travis suddenly fails to `bundle install`, no idea why
before_install:
- git submodule update --init --recursive
= Backports --- History
== Version 3.11.0 - December 25th, 2017
* New Ruby version 2.5.0
* Array
* +append+, +prepend+
* Dir
* +children+, +each_child+
* Enumerable
* +any?+, +all?+, +none?+, +one?+ (with pattern argument)
* Hash
* +slice+
* +transform_keys+
* Integer
* +sqrt+
* +allbits?+, +anybits?+ and +nobits?+
* Kernel
* +yield_self+
* Module
* +attr+, +attr_accessor+, +attr_reader+, +attr_writer+ (now public)
* +define_method+, +alias_method+, +undef_method+, +remove_method+ (now public)
* String
* +delete_prefix+, +delete_prefix!+
* +delete_suffix+, +delete_suffix!+
* Struct
* +new+ (with <code>keyword_init: true</code>)
* <tt>require 'backports/latest'</tt> is now the right way to require everything
== Version 3.10.0 - October 17, 2017
* Additional features of 2.4.0
* Enumerable
* +uniq+
* +sum+
* Hash
* +compact+
* +transform_values+
== Version 3.9.0 - October 07, 2017
* From 2.4.0: +dup+ for +true+, +false+, +nil+, Numeric
* From 2.2.0: <tt>Method#super_method</tt>
== Version 3.8.0 - April 26, 2017
* From 2.4.0: <tt>String#match?</tt>, <tt>Regexp#match?</tt>
* From 2.3.0:
* unary <tt>String#+</tt>, +-+
* Numeric: +positive?+, +negative?+
* Hash: +to_proc+, +fetch_values+, <tt>></tt>, <tt><</tt>, <tt>>=</tt>, <tt><=</tt>
* Enumerable: +chunk_while+, +grep_v+
* <tt>{Array|Hash|Struct}#dig</tt>
* <tt>Array#bsearch_index</tt>
* From 2.2.0:
* <tt>Method#curry</tt>
* <tt>String#unicode_normalize{|?|!}</tt>
* <tt>Kernel#itself</tt>
* Float: +next_float+, +prev_float+
== Version 3.7.0 - March 28, 2017
* Initiate work on backports of 2.2, 2.3, 2.4
* From 2.4.0:
* <tt>Comparable#clamp</tt>
* From 2.2.0:
* Enumerable: +slice_when+, +slice_after+
== Version 3.6.0 - February 14th, 2014
* Additional features of 2.1.0
......
......@@ -8,10 +8,10 @@ gemspec
# jquery-rails is used by the dummy application
group :test do
gem "rake"
gem 'mspec', :git => 'git://github.com/rubyspec/mspec.git'
gem 'activesupport'
gem 'mspec'
gem 'activesupport', '~>3.2.0'
gem 'minitest', '< 5.0.0', :require => false
gem 'test-unit'
gem 'test-unit', '~>2.1.1.0'
end
# Declare any dependencies that are still in development here instead of in
......
GIT
remote: git://github.com/rubyspec/mspec.git
revision: 69c388b1187789f4996eda7dec4c1404fcd6b742
specs:
mspec (1.5.18)
PATH
remote: .
specs:
backports (3.6.8)
GEM
remote: http://rubygems.org/
specs:
activesupport (3.2.13)
i18n (= 0.6.1)
multi_json (~> 1.0)
i18n (0.6.1)
minitest (4.7.5)
multi_json (1.7.2)
rake (10.1.0)
test-unit (2.1.1.0)
PLATFORMS
java
ruby
DEPENDENCIES
activesupport
backports!
minitest (< 5.0.0)
mspec!
rake
test-unit
......@@ -8,6 +8,10 @@ This gem is for you!
The goal of 'backports' is to make it easier to write ruby code that runs across different versions of Ruby.
== Loading backports
=== Explicitly (recommended)
For example, if you want to use flat_map, even in Ruby implementations that don't include it, as well as the new bsearch method:
require 'backports/1.9.2/enumerable/flat_map'
......@@ -15,11 +19,23 @@ For example, if you want to use flat_map, even in Ruby implementations that don'
This will enable Enumerable#flat_map and Array#bsearch, using the native versions if available or otherwise provide a pure Ruby version.
You can load many backports at once. For example, any version of Ruby up to today's standards:
=== By Module
To bring all the backports for a given Class/Module, you can specify only that Class:
require 'backports/2.3.0/hash'
This will make sure that Hash responds to dig, fetch_values, <, <=, >, >= and to_proc
=== Up to a specific Ruby version
require 'backports'
You can load all backports up to a specific version. For example, to bring any version of Ruby mostly up to Ruby 2.4.0's standards:
This will bring in all the features of 1.8.7 and many features of Ruby 1.9.x and even Ruby 2.0.0 (for all versions of Ruby)!
require 'backports/2.4.0'
This will bring in all the features of 1.8.7 and many features of Ruby 1.9.x all the way up to Ruby 2.4.0 (for all versions of Ruby)!
While it is not recommended, you may `require 'backports/latest'` as a shortcut to the latest Ruby version supported. This is equivalent to the deprecated `require 'backports'`.
+Note+: Although I am a Ruby committer, this gem is a personal project and is not endorsed by ruby-core.
......@@ -28,15 +44,11 @@ This will bring in all the features of 1.8.7 and many features of Ruby 1.9.x and
Goals for backported features:
1. Won't break older code
2. Pure Ruby (no C extensions)
3. Pass RubySpec[http://github.com/rubyspec/rubyspec]
Let's be a bit more precise about the "breaking code" business. It is of course entirely possible that code will break, for example some core methods are monkeypatched or if the code relies on a certain call raising an exception. Example: <tt>[42].sample rescue "dum example"</tt> will return <tt>"dum example"</tt> without this gem and <tt>42</tt> with it.
3. Pass ruby/spec[https://github.com/ruby/spec]
A real incompatibility is, for example, <tt>Module::instance_methods</tt> which returns strings in 1.8 and symbols in 1.9. No change can be made without the risk of breaking existing code. Such incompatibilities are left unchanged, although you can require some of these changes in addition (see below)
Let's be a bit more precise about the "breaking code" business. It is of course entirely possible that code will break. In particular, you may be distinguishing parameters with duck typing, but a builtin class may, in the future, be responding to a particular call. Here's [an exemple from Rails](https://github.com/rails/rails/blob/a4b55827721a5967299f3c1531afb3d6d81e4ac0/activerecord/lib/active_record/associations/association.rb#L155-L159) that is relying on the fact that Proc and Method respond to :to_proc and Hash isn't. That is, until Ruby 2.3... This old version of Rails therefore won't work on Ruby 2.3, or on older Rubies with that the `2.3.0/hash/to_proc` loaded...
All features of 1.8.7 are backported (well, almost all, see the exception list bellow), and many of the following versions up to 2.1
For historical reasons, some generic and self-contained features of active-support are also included. By simple I mean that String#camelcase is there, but #pluralize isn't. These will probably be removed in the future, so it's recommended to require those directly from active_support.
For Ruby < 2.0, there are some real incompatibilities. For example, <tt>Module::instance_methods</tt> which returns strings in 1.8 and symbols in 1.9. No change can be made without the risk of breaking existing code. Such incompatibilities are left unchanged, although you can require some of these changes in addition (see below).
== Installation & compatibility
......@@ -54,9 +66,6 @@ To use:
# For all backports up to a given version
require 'backports/1.9.2' # All backports for Ruby 1.9.2 and below
# Or for all backports
require 'backports'
Note: about a dozen of backports have a dependency that will be also loaded. For example, the backport of Enumerable#flat_map uses flatten(1), so if required from Ruby 1.8.6 (where Array#flatten does not accept an argument), the backport for Ruby's 1.8.7 flatten with an argument will also be loaded.
With bundler, add to your Gemfile:
......@@ -64,11 +73,91 @@ With bundler, add to your Gemfile:
gem 'backports', :require => false
Run <tt>bundle install</tt> and require the desired backports.
Compatible with Ruby 1.8.6, 1.8.7, 1.9.1, 1.9.2, 1.9.3, 2.0, 2.1, JRuby and Rubinius.
Compatible with Ruby itself, JRuby and Rubinius.
= Complete List of backports
== Ruby 2.5 backports
* Array
* +append+, +prepend+
* Dir
* +children+, +each_child+
* Enumerable
* +any?+, +all?+, +none?+, +one?+ (with pattern argument)
* Hash
* +slice+
* +transform_keys+
* Integer
* +sqrt+
* +allbits?+, +anybits?+ and +nobits?+
* Kernel
* +yield_self+
* Module
* +attr+, +attr_accessor+, +attr_reader+, +attr_writer+ (now public)
* +define_method+, +alias_method+, +undef_method+, +remove_method+ (now public)
* String
* +delete_prefix+, +delete_prefix!+
* +delete_suffix+, +delete_suffix!+
* Struct
* +new+ (with <code>keyword_init: true</code>)
== Ruby 2.4 backports
* Comparable
* +clamp+
* Enumerable
* +sum+
* +uniq+
* Hash
* +compact+, +compact!+
* +transform_values+, +transform_values!+
* Regexp
* +match?+
* String
* +match?+
* FalseClass, Fixnum, Float, NilClass, TrueClass
* +dup+
== Ruby 2.3 backports
* Array
* +bsearch_index+
* +dig+
* Enumerable
* +chunk_while+
* +grep_v+
* Hash
* +dig+
* +fetch_values+
* +to_proc+
* <=, <, >=, >
* Numeric
* +negative?+
* +positive?+
* String
* unary + and -
* Struct
* +dig+
== Ruby 2.2 backports
* Enumerable
* +slice_after+
* +slice_when+
* Float
* +prev_float+
* +next_float+
* Kernel
* +itself+
* Method
* +curry+
* +super_method+
* String
* +unicode_normalize+
* +unicode_normalize!+
* +unicode_normalize?+
== Ruby 2.1 backports
* Array
......@@ -142,7 +231,7 @@ Compatible with Ruby 1.8.6, 1.8.7, 1.9.1, 1.9.2, 1.9.3, 2.0, 2.1, JRuby and Rubi
* Random (new class)
*Note*: The methods of +Random+ can't be required individually; the class can only be required whole with <tt>require 'backports/1.9.2/random'</tt>. The implementation is also available with <tt>require 'backports/random/implementation'</tt>.
*Note*: The methods of +Random+ can't be required individually; the class can only be required whole with <tt>require 'backports/1.9.2/random'</tt>.
== Ruby 1.9.1 backports
......@@ -259,7 +348,7 @@ I am aware of the following backport gem, which probably won't make it into this
* Net::SMTP for Ruby 1.8.6: smtp_tls[http://seattlerb.rubyforge.org/smtp_tls/]
Requiring the whole of 'backports', or all backports for a given version of Ruby will also load 'backports/std_lib'.
Requiring backports for a given version of Ruby will also load 'backports/std_lib'.
== Forcing incompatibilities
......@@ -288,7 +377,7 @@ Thanks for the bug reports and patches, in particular the repeat offenders:
* Konstantin Haase ( rkh[https://github.com/rkh])
* Roger Pack ( rdp[http://github.com/rdp] )
The best way to submit a patch is to also submit a patch to RubySpec[https://github.com/rubyspec/rubyspec] and then a patch to backports that make it pass the spec. To test rubyspec:
The best way to submit a patch is to also submit a patch to ruby/spec[https://github.com/ruby/spec] and then a patch to backports that make it pass the spec. To test rubyspec:
git submodule init && git submodule update # => pulls rubyspecs
rake spec[array/bsearch] # => tests Array#bsearch
......
......@@ -11,23 +11,28 @@ Rake::TestTask.new(:test) do |test|
test.verbose = false
end
desc "Run specs, where path can be '*/*' (default), 'class/*' or 'class/method'."
task :spec, :path, :action do |t, args|
args.with_defaults(:path => '*/*', :action => 'ci')
stats = [[0] * 5]
not_found = []
mspec_cmds(args[:path], args[:action]) do |cmd, path|
class SpecRunner
STATS = [:files, :examples, :expectations, :failures, :errors]
attr_reader :stats, :not_found
def initialize
@counts = [0] * 5
@not_found = []
end
def run(cmd, path)
result = `#{cmd}`
match = result.match(/(\d+) files?, (\d+) examples?, (\d+) expectations?, (\d+) failures?, (\d+) errors?/)
if match.nil?
puts "*** mspec returned with unexpected results:"
puts result
puts "Command was:", cmd
fail "Unexpected output from mspec"
end
_, ex, p, f, e = data = match.captures.map{|x| x.to_i}
not_found << path if ex == 0
stats << data
STATS.each_with_index do |_, i|
@counts[i] += data[i]
end
if f + e > 0
puts cmd
puts result
......@@ -36,12 +41,37 @@ task :spec, :path, :action do |t, args|
STDOUT.flush
end
end
$:.unshift 'lib'
require 'backports/rails'
_, ex, p, f, e = stats = stats.transpose.map{|x| x.sum}
puts "*** Overall:", stats.zip(%w[files examples expectations failures errors]).map{|a| a.join(' ')}.join(', ')
puts "No spec found for #{not_found.join(', ')}" unless not_found.empty?
fail unless f + e == 0
def stats
h = {}
STATS.zip(@counts).each{|k, v| h[k]=v}
h
end
def report
puts "*** Overall:", stats.map{|a| a.join(' ')}.join(', ')
puts "No spec found for #{@not_found.join(', ')}" unless @not_found.empty?
end
def success?
stats[:failures] == 0 && stats[:errors] == 0
end
end
desc "Run specs, where path can be '*/*' (default), 'class/*' or 'class/method'."
task :spec, :path, :action do |t, args|
args.with_defaults(:path => '*/*', :action => 'ci')
specs = SpecRunner.new
mspec_cmds(args[:path], 'frozen_old_spec', args[:action]) do |cmd, path|
specs.run(cmd, path)
end
unless RUBY_VERSION < '1.9' # Give up entirely on running new specs in 1.8.x, mainly because of {hash: 'syntax'}
mspec_cmds(args[:path], 'spec', args[:action]) do |cmd, path|
specs.run(cmd, path)
end
end
specs.report
fail unless specs.success?
end
task :all_spec do # Necessary because of argument passing bug in 1.8.7
......@@ -67,7 +97,13 @@ DEPENDENCIES = Hash.new([]).merge!(
'1.9.2/array/select' => 'backports/1.8.7/array/select',
'1.9.2/hash/select' => 'backports/1.8.7/hash/select',
'1.9.2/enumerable/each_entry' => 'backports/1.8.7/enumerable/each_with_index',
'2.0.0/hash/to_h' => 'backports/1.9.1/hash/default_proc'
'2.0.0/hash/to_h' => 'backports/1.9.1/hash/default_proc',
'2.2.0/float/next_float' => 'backports/2.2.0/float/prev_float',
'2.2.0/float/prev_float' => 'backports/2.2.0/float/next_float',
'2.3.0/array/bsearch_index' => ['backports/2.3.0/array/dig', 'backports/2.3.0/hash/dig'],
'2.3.0/array/dig' => ['backports/2.3.0/hash/dig', 'backports/2.3.0/struct/dig'],
'2.3.0/hash/dig' => ['backports/2.3.0/array/dig', 'backports/2.3.0/struct/dig'],
'2.3.0/struct/dig' => ['backports/2.3.0/array/dig', 'backports/2.3.0/hash/dig']
)
{
:each_with_index => %w[enumerable/detect enumerable/find enumerable/find_all enumerable/select enumerable/to_a],
......@@ -76,31 +112,66 @@ DEPENDENCIES = Hash.new([]).merge!(
libs.each{|l| DEPENDENCIES["1.8.7/#{l}"] = "backports/1.8.7/enumerable/#{req}" }
end
# These cause actual errors while loading in 1.8:
IGNORE_IN_18 = %w[
# These **old** specs cause actual errors while loading in 1.8:
OLD_IGNORE_IN_18 = %w[
1.9.1/symbol/length
1.9.1/symbol/size
1.9.3/string/byteslice
1.8.7/proc/yield
1.9.1/proc/case_compare
2.4.0/string/match
2.4.0/regexp/match
2.5.0/module/define_method
]
def mspec_cmds(pattern, action='ci')
# These **new** specs cause actual errors while loading in 1.9:
IGNORE_IN_19 = %w[
2.1.0/enumerable/to_h
2.1.0/array/to_h
2.1.0/module/include
2.5.0/module/define_method
2.5.0/module/alias_method
2.5.0/module/undef_method
2.5.0/module/remove_method
2.5.0/module/attr
2.5.0/module/attr_reader
2.5.0/module/attr_writer
2.5.0/module/attr_accessor
2.5.0/struct/new
]
# These **new** specs cause actual errors while loading in 2.0.0:
IGNORE_IN_200 = %w[
2.4.0/enumerable/sum
]
CLASS_MAP = Hash.new{|k, v| k[v] = v}.merge!(
'match_data' => 'matchdata', # don't ask me why RubySpec uses matchdata instead of match_data
'true_class' => 'true',
'false_class' => 'false',
'nil_class' => 'nil'
)
def mspec_cmds(pattern, spec_folder, action='ci')
pattern = "lib/backports/*.*.*/#{pattern}.rb"
Dir.glob(pattern) do |lib_path|
_match, version, path = lib_path.match(/backports\/(\d\.\d\.\d)\/(.*)\.rb/).to_a
next if path =~ /stdlib/
next if version <= RUBY_VERSION
version_path = "#{version}/#{path}"
next if IGNORE_IN_18.include? version_path if RUBY_VERSION < '1.9'
if RUBY_VERSION < '2.0.0'
next if OLD_IGNORE_IN_18.include? version_path if RUBY_VERSION < '1.9'
next if IGNORE_IN_19.include? version_path
next if spec_folder != 'frozen_old_spec' && version <= '2.0.0' # Don't run new specs for pre 2.0 features & ruby
end
next if RUBY_VERSION < '2.1.0' && IGNORE_IN_200.include?(version_path)
deps = [*DEPENDENCIES[version_path]].map{|p| "-r #{p}"}.join(' ')
klass, method = path.split('/')
path = [klass.gsub('_', ''), method].join('/') # don't ask me why RubySpec uses matchdata instead of match_data
path = [CLASS_MAP[klass], method].join('/')
yield %W[mspec #{action}
-I lib
-r ./set_version/#{version}
#{deps}
-r backports/#{version_path}
spec/rubyspec/core/#{path}_spec.rb
#{spec_folder}/rubyspec/core/#{path}_spec.rb
].join(' '), path
end
end
This diff is collapsed.
ruby-backports (3.11.1-1) unstable; urgency=medium
* Team upload
* New upstream version 3.11.1
- fixes warnings under ruby2.5
* debian/rules: ignore test failures under ruby2.3
-- Antonio Terceiro <terceiro@debian.org> Thu, 01 Mar 2018 10:29:16 -0300
ruby-backports (3.6.8-1) unstable; urgency=medium
* Team upload.
......
#!/usr/bin/make -f
export DH_RUBY_GEMSPEC = debian/backports.gemspec
export DH_RUBY_IGNORE_TESTS = ruby2.3
%:
dh $@ --buildsystem=ruby --with ruby
......
fails:ARGF.each_line is a public method
fails:ARGF.each_line requires multiple arguments
fails:ARGF.each_line reads each line of files
fails:ARGF.each_line returns self when passed a block
fails:ARGF.each_line returns an Enumerator when passed no block
fails:ARGF.each_line with a separator yields each separated section of all streams
fails:ARGF.each is a public method
fails:ARGF.each requires multiple arguments
fails:ARGF.each reads each line of files
fails:ARGF.each returns self when passed a block
fails:ARGF.each returns an Enumerator when passed no block
fails:ARGF.each with a separator yields each separated section of all streams
fails:ARGF.lines is a public method
fails:ARGF.lines requires multiple arguments
fails:ARGF.lines reads each line of files
fails:ARGF.lines returns self when passed a block
fails:ARGF.lines returns an Enumerator when passed no block
fails:ARGF.lines with a separator yields each separated section of all streams
fails:Array#<< raises a RuntimeError on a frozen array
fails:Array#collect returns an Enumerator when no block given
fails:Array#collect does not copy untrusted status
fails:Array#collect! keeps untrusted status
fails:Array#collect! when frozen raises a RuntimeError
fails:Array#collect! when frozen raises a RuntimeError when empty
fails:Array#collect! when frozen raises a RuntimeError when calling #each on the returned Enumerator
fails:Array#collect! when frozen raises a RuntimeError when calling #each on the returned Enumerator when empty
fails:Array#rotate returns subclass instance for Array subclasses
fails:Array#rotate! raises a RuntimeError on a frozen array
fails:Array#uniq! raises a RuntimeError on a frozen array when the array is modified
fails:Array#uniq! raises a RuntimeError on a frozen array when the array would not be modified
fails:Array#uniq! doesn't yield to the block on a frozen array
fails:Complex#to_r when the imaginary part is Fixnum 0 returns the result of sending #to_r to the real part
fails:Complex#to_r when the imaginary part is Rational 0 returns the result of sending #to_r to the real part
fails:Complex#to_r when the imaginary part responds to #== 0 with true returns the result of sending #to_r to the real part
fails:Enumerable#all? with block gathers initial args as elements when each yields multiple
fails:Enumerable#any? raises an ArgumentError when any arguments provided
fails:Enumerable#any? with block gathers initial args as elements when each yields multiple
fails:Enumerable#each_entry passes through the values yielded by #each_with_index
fails:Enumerable#none? with a block gathers initial args as elements when each yields multiple
fails:Enumerable#one? when passed a block gathers initial args as elements when each yields multiple
fails:Enumerator#next is rewound after encountering a StopIteration
fails:ENV.to_hash uses the locale encoding for keys
fails:ENV.to_hash uses the locale encoding for values
fails:File.join flattens nested arrays
fails:File.join inserts the separator in between empty strings and arrays
fails:File.join raises an ArgumentError if passed a recursive array
fails:File.lchmod returns false from #respond_to?
fails:File.lchmod raises a NotImplementedError when called
fails:File.new returns a new File when use File::APPEND mode
fails:File.new returns a new File when use File::RDONLY|File::APPEND mode
fails:File.open on a FIFO opens it as a normal file
fails:File.open opens file when call with a block (basic case)
fails:File.open opens a file with mode string and block
fails:File.open opens a file with mode num and block
fails:File.open opens the file when passed mode, num, permissions and block
fails:File.open opens the file when call with fd
fails:File.open opens a file with a file descriptor d and a block
fails:File.open raises a SystemCallError if passed an invalid Integer type
fails:File.open raises an IOError when read in a block opened with File::RDONLY|File::APPEND mode
fails:File.open raises an IOError if the file exists when open with File::RDONLY|File::APPEND
fails:File.open defaults external_encoding to ASCII-8BIT for binary modes
fails:File.open when passed a file descriptor opens a file
fails:File.open when passed a file descriptor opens a file when passed a block
fails:File#to_path preserves the encoding of the path
fails:Fixnum#fdiv follows the coercion protocol
fails:GC.stress returns current status of GC stress mode
fails:GC.stress= sets the stress mode
fails:Hash#assoc only returns the first matching key-value pair for identity hashes
fails:Hash.[] raises an ArgumentError for arrays of more than 2 elements
fails:Hash.[] raises an ArgumentError when passed a list of value-invalid-pairs in an array
fails:Hash.[] removes the default_proc
fails:Hash#default_proc= raises an error if passed nil
fails:Hash#default_proc= raises a TypeError if passed a lambda with an arity other than 2
fails:Hash#default_proc= raises a RuntimeError if self is frozen
fails:Hash#delete_if raises a RuntimeError if called on a frozen instance
fails:Hash#each_pair yields a [[key, value]] Array for each pair to a block expecting |*args|
fails:Hash#eql? computes equality for recursive hashes
fails:Hash#eql? computes equality for complex recursive hashes
fails:Hash#eql? computes equality for recursive hashes & arrays
fails:Hash#hash generates a hash for recursive hash structures
fails:Hash#hash returns the same hash for recursive hashes
fails:Hash#hash returns the same hash for recursive hashes through arrays
fails:Hash#keep_if raises an RuntimeError if called on a frozen instance
fails:Hash#keep_if raises a RuntimeError if called on a frozen instance
fails:Hash#rassoc only returns the first matching key-value pair
fails:Hash#reject! raises a RuntimeError if called on a frozen instance that is modified
fails:Hash#reject! raises a RuntimeError if called on a frozen instance that would not be modified
fails:Hash#select returns a Hash of entries for which block is true
fails:Hash#select! is equivalent to keep_if if changes are made
fails:Hash#select! returns nil if no changes were made
fails:Hash#select! raises a RuntimeError if called on an empty frozen instance
fails:Hash#select! raises a RuntimeError if called on a frozen instance that would not be modified
fails:Hash#select! returns an Enumerator if called on a non-empty hash without a block
fails:Hash#select! returns an Enumerator if called on an empty hash without a block
fails:Hash#select! returns an Enumerator if called on a frozen instance
fails:Integer#round raises a RangeError when passed Float::INFINITY
fails:Integer#round raises a RangeError when passed a big negative value
fails:IO.binread reads the contents of a file
fails:IO.binread reads the contents of a file up to a certain size when specified
fails:IO.binread reads the contents of a file from an offset of a specific size when specified
fails:IO.binread returns a String in ASCII-8BIT encoding
fails:IO.binread returns a String in ASCII-8BIT encoding regardless of Encoding.default_internal
fails:IO.binread raises an ArgumentError when not passed a valid length
fails:IO.binread raises an Errno::EINVAL when not passed a valid offset
fails:IO#chars yields each character
fails:IO#each_char yields each character
fails:IO#lines ignores a given block
fails:IO.open uses the external encoding specified in the mode argument
fails:IO.open uses the external and the internal encoding specified in the mode argument
fails:IO.open uses the external encoding specified via the :external_encoding option
fails:IO.open uses the internal encoding specified via the :internal_encoding option
fails:IO.open uses the colon-separated encodings specified via the :encoding option
fails:IO.open ingores the :encoding option when the :external_encoding option is present
fails:IO.open ingores the :encoding option when the :internal_encoding option is present
fails:IO.open uses the encoding specified via the :mode option hash
fails:IO.open ignores the :internal_encoding option when the same as the external encoding
fails:IO.open sets internal encoding to nil when passed '-'
fails:IO.open sets binmode from mode string
fails:IO.open does not set binmode without being asked
fails:IO.open sets binmode from :binmode option
fails:IO.open does not set binmode from false :binmode
fails:IO.open raises an error if passed binary/text mode two ways
fails:IO.open sets external encoding to binary with binmode in mode string
fails:IO.open sets external encoding to binary with :binmode option
fails:IO.open does not use binary encoding when mode encoding is specified
fails:IO.open does not use binary encoding when :encoding option is specified
fails:IO.open does not use binary encoding when :external_encoding option is specified
fails:IO.open does not use binary encoding when :internal_encoding option is specified
fails:IO.open coerces mode with #to_int
fails:IO.open coerces options as second argument with #to_hash
fails:IO.open raises ArgumentError if not passed a hash or nil for options
fails:IO#ungetbyte does nothing when passed nil
fails:IO#ungetbyte puts back each byte in a String argument
fails:IO#ungetbyte calls #to_str to convert the argument
fails:IO#ungetbyte puts back one byte for an Integer argument
fails:IO.write uses encoding from given options, if provided
fails:IO.write uses an :open_args option
fails:IO.write disregards other options if :open_args is given
fails:IO.write uses the given encoding and returns the number of bytes written
fails:IO.write writes binary data if no encoding is given
fails:Kernel.__callee__ returns the current method, even when aliased
fails:Kernel.__callee__ returns the original name when aliased method
fails:Kernel.__callee__ returns the caller from blocks too
fails:Kernel.__callee__ returns nil when not called from a method
fails:Kernel.__callee__ returns the caller when sent as a string
fails:Kernel.__callee__ returns the aliased name when aliased method
fails:Kernel.__method__ returns the original name when aliased method
fails:Kernel#define_singleton_method when given an UnboundMethod defines any Child class method from any Parent's class methods
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
fails:Kernel#public_method returns a method object if we repond_to_missing? method
fails:Kernel#public_method changes the method called for super on a target aliased method
fails:Kernel#require_relative with a relative path stores the missing path in a LoadError object
fails:Kernel#require_relative with a relative path when file is a symlink loads a path relative to current file
fails:Kernel#require_relative with an absolute path stores the missing path in a LoadError object
fails:Math.log2 raises an Errno::EDOM if the argument is less than 0
fails:Math.log2 raises an TypeError if the argument cannot be coerced with Float()
fails:Math.log2 raises an TypeError if passed a numerical argument as a string
fails:Math.log2 returns NaN given NaN
fails:Math.log2 raises a TypeError if the argument cannot be coerced with Float()
fails:Math.log2 raises a TypeError if passed a numerical argument as a string
fails:Math.log raises a TypeError if the argument cannot be coerced with Float()
fails:Math.log raises a TypeError for numerical values passed as string
fails:Math.log returns NaN given NaN
fails:Module#alias_method is a private method
fails:Module#attr_accessor allows creating an attr_accessor on an immediate class
fails:Module#attr_accessor is a private method
fails:Module#attr_reader allows for adding an attr_reader to an immediate
fails:Module#attr_reader is a private method
fails:Module#attr is a private method
fails:Module#attr_writer allows for adding an attr_writer to an immediate
fails:Module#attr_writer is a private method
fails:Module#class_exec defines method in the receiver's scope
fails:Module#class_exec raises an LocalJumpError when no block is given
fails:Module#module_exec defines method in the receiver's scope
fails:Module#module_exec raises an LocalJumpError when no block is given
fails:Module#remove_method is a private method
fails:Module#undef_method is a private method
fails:NilClass#dup raises a TypeError
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
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
fails:Numeric#step Numeric#step with [stop, +Infinity] yields once if self < stop
fails:Numeric#step Numeric#step with [stop, +Infinity] yields once when stop is Infinity
fails:Numeric#step Numeric#step with [stop, +Infinity] yields once when self equals stop
fails:Numeric#step Numeric#step with [stop, +Infinity] yields once when self and stop are Infinity
fails:Numeric#step Numeric#step with [stop, +Infinity] does not yield when self > stop
fails:Numeric#step Numeric#step with [stop, -infinity] yields once if self > stop
fails:Numeric#step Numeric#step with [stop, -infinity] yields once if stop is -Infinity
fails:Numeric#step Numeric#step with [stop, -infinity] yields once when self equals stop
fails:Numeric#step Numeric#step with [stop, -infinity] yields once when self and stop are Infinity
fails:Numeric#step Numeric#step with [stop, -infinity] does not yield when self > stop
fails:Proc#curry produces Procs that raise ArgumentError for #binding
fails:Proc#curry produces Procs that return [[:rest]] for #parameters
fails:Proc#curry produces Procs that return nil for #source_location
fails:Proc#curry produces Procs that can be passed as the block for instance_exec
fails:Range#step with inclusive end and Integer values yields Float values incremented by a Float step
fails:Range#step with inclusive end and Float values returns Float values of 'step * n + begin <= end'
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
fails:Range#step with inclusive end and Integer, Float values yields Float values incremented by an Integer step
fails:Range#step with inclusive end and Integer, Float values yields Float values incremented by a Float step
fails:Range#step with inclusive end and String values raises a TypeError when passed a Float step
fails:Range#step with exclusive end and Integer values yields Float values incremented by a Float step
fails:Range#step with exclusive end and Float values returns Float values of 'step * n + begin < end'
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
fails:Range#step with exclusive end and Integer, Float values yields Float values incremented by an Integer step
fails:Range#step with exclusive end and Integer, Float values yields an Float and then Float values incremented by a Float step
fails:Range#step with exclusive end and String values raises a TypeError when passed a Float step
fails:String#getbyte returns an Integer between 0 and 255
fails:String#getbyte regards a multi-byte character as having multiple bytes
fails:String#getbyte mirrors the output of #bytes
fails:String#getbyte interprets bytes relative to the String's encoding
fails:String#getbyte raises an ArgumentError unless given one argument
fails:String#getbyte raises a TypeError unless its argument can be coerced into an Integer
fails:String#partition with String sets global vars if regexp used
fails:String#prepend raises a RuntimeError when self if frozen
fails:String#rpartition with String affects $~
fails:String#setbyte allows changing bytes in multi-byte characters
fails:String#setbyte can invalidate a String's encoding
fails:String#setbyte sets a byte at an index greater than String size
fails:String#setbyte raises a RuntimeError if self is frozen
fails:String#setbyte raises a TypeError unless the second argument is an Integer
fails:String#upto raises a LocalJumpError if other is a string but no block was given
fails:Symbol#capitalize leaves the first character alone if it is not an alphabetical ASCII character
fails:Symbol#capitalize leaves uppercase Unicode characters as they were
fails:Symbol#capitalize leaves lowercase Unicode characters as they were
fails:Symbol#<=> with Symbol compares individual characters based on their ascii value
fails:Symbol#downcase leaves lowercase Unicode characters as they were
fails:Symbol#downcase leaves uppercase Unicode characters as they were
fails:Symbol#[] with a Regex slice without a capture index sets $~ to the MatchData if there is a match
fails:Symbol#[] with a Regex slice with a capture index sets $~ to the MatchData if there is a match
fails:Symbol#[] with a Regex slice without a capture index returns an untrusted string if the regexp is untrusted
fails:Symbol#[] with a Regex slice with a capture index returns an untrusted string if the regexp is untrusted
fails:Symbol#empty? returns true if self is empty
fails:Symbol#=~ sets the last match pseudo-variables
fails:Symbol#match sets the last match pseudo-variables
fails:Symbol#swapcase leaves uppercase Unicode characters as they were
fails:Symbol#swapcase leaves lowercase Unicode characters as they were
fails:Symbol#to_proc raises an ArgumentError when calling #call on the Proc without receiver
fails:Symbol#upcase leaves lowercase Unicode characters as they were
fails:Array#<< raises a RuntimeError on a frozen array
fails:Array#keep_if on frozen objects with truthy block raises a RuntimeError
fails:Array#keep_if on frozen objects with falsy block raises a RuntimeError
fails:Array#rotate returns subclass instance for Array subclasses
fails:Array#rotate! raises a RuntimeError on a frozen array
fails:Array#select! on frozen objects with truthy block raises a RuntimeError
fails:Array#select! on frozen objects with falsy block raises a RuntimeError
fails:Array#uniq! raises a RuntimeError on a frozen array when the array is modified
fails:Array#uniq! raises a RuntimeError on a frozen array when the array would not be modified
fails:Array#uniq! doesn't yield to the block on a frozen array
fails:Complex#to_r when the imaginary part is Fixnum 0 returns the result of sending #to_r to the real part
fails:Complex#to_r when the imaginary part is Rational 0 returns the result of sending #to_r to the real part
fails:Complex#to_r when the imaginary part responds to #== 0 with true returns the result of sending #to_r to the real part
fails:Enumerable#all? with block gathers initial args as elements when each yields multiple
fails:Enumerable#any? raises an ArgumentError when any arguments provided
fails:Enumerable#any? with block gathers initial args as elements when each yields multiple
fails:Enumerable#collect_concat calls to_ary but not to_a
fails:Enumerable#flat_map calls to_ary but not to_a
fails:Enumerable#none? with a block gathers initial args as elements when each yields multiple
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.