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
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 4e7cf14929385f92c1246d5da12ac424b422338e
4
- data.tar.gz: ddccf768a48e4cf4327cb2dd4244d14932b9d0bb
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZTAxODgxMGVjYjhjMWY4YThjZDA0OWU2MjMxZGJkNzA2Y2QyNzM3ZA==
5
+ data.tar.gz: !binary |-
6
+ OWJhNGEwNDRiZDhlYjlkOWMyZDg0Yzc2ZTI3YTk3Y2Y3Y2IzYmViYQ==
5
7
  SHA512:
6
- metadata.gz: 62b66d725bbd40b4462ef16500c78d8d19a8382e09fbeb834ddbd2eab4a7df9bca45d22382604f91d557481b35873977fc304f266fe29be58c9602803f4db6ce
7
- data.tar.gz: 551bddeb601f9eccbbb92469914ef3c7a7a1bd0777f30ec5be5f0763aa3a5b543dbf70fa4159a9ecdd4f7514a632379106af88b685caa03ead26038d88e7cf70
8
+ metadata.gz: !binary |-
9
+ OWJlMTk0N2FjY2RmN2RlYzFkZWY5ZTZlYjQxNjMxNmQ1NzBkMzkwMTgwYzk3
10
+ MWYyYzMwMTM4M2VhMmZiM2M2MzY3YTEzMmM5M2M0ODNjMzFiMzk4NThmMzU1
11
+ ZDVkNGQwN2QzZWY0ZjFhZDM4NDAzMWIyMjk3NWRhMzU1Y2I0YTM=
12
+ data.tar.gz: !binary |-
13
+ ODMwZGRiZmY0NTU1MjI3ZDM1Zjc4NmU5YTlhOWE0NTM1NjQzNWFjN2RjMDJh
14
+ ODRkMjMzNjM3MjU4OWJlNDhmOTMwZjI0MmQ2Mjg2Njk0ZWM0ODI3MjE2ZGY0
15
+ ZWZiMWI1MTM5ODNiN2UyNTNkMzFhYjg3NTZiNmI0OWFhNjM3YzI=
@@ -1,3 +1,6 @@
1
1
  [submodule "spec/rubyspec"]
2
2
  path = spec/rubyspec
3
- url = git://github.com/rubyspec/rubyspec.git
3
+ url = git://github.com/ruby/spec.git
4
+ [submodule "frozen_old_spec/rubyspec"]
5
+ path = frozen_old_spec/rubyspec
6
+ url = git://github.com/ruby/spec.git
@@ -3,9 +3,11 @@ language: ruby
3
3
  rvm:
4
4
  - "1.8.7"
5
5
  - "1.9.2"
6
- - "1.9.3"
7
6
  - "2.0.0"
8
7
  - "2.1.0"
8
+ - "2.2.0"
9
+ - "2.3.0"
10
+ - "2.4.0"
9
11
  - ruby-head
10
12
  - jruby-18mode
11
13
  - jruby-19mode
@@ -14,6 +16,7 @@ rvm:
14
16
 
15
17
  matrix:
16
18
  allow_failures:
19
+ - rvm: "1.9.3"
17
20
  - rvm: jruby-18mode
18
21
  - rvm: jruby-19mode
19
22
  - rvm: rbx-18mode
data/Gemfile CHANGED
@@ -8,7 +8,7 @@ gemspec
8
8
  # jquery-rails is used by the dummy application
9
9
  group :test do
10
10
  gem "rake"
11
- gem 'mspec', :git => 'git://github.com/rubyspec/mspec.git'
11
+ gem 'mspec'
12
12
  gem 'activesupport'
13
13
  gem 'minitest', '< 5.0.0', :require => false
14
14
  gem 'test-unit'
@@ -1,13 +1,7 @@
1
- GIT
2
- remote: git://github.com/rubyspec/mspec.git
3
- revision: 69c388b1187789f4996eda7dec4c1404fcd6b742
4
- specs:
5
- mspec (1.5.18)
6
-
7
1
  PATH
8
2
  remote: .
9
3
  specs:
10
- backports (3.6.8)
4
+ backports (3.7.0)
11
5
 
12
6
  GEM
13
7
  remote: http://rubygems.org/
@@ -17,6 +11,7 @@ GEM
17
11
  multi_json (~> 1.0)
18
12
  i18n (0.6.1)
19
13
  minitest (4.7.5)
14
+ mspec (1.9.1)
20
15
  multi_json (1.7.2)
21
16
  rake (10.1.0)
22
17
  test-unit (2.1.1.0)
@@ -29,6 +24,6 @@ DEPENDENCIES
29
24
  activesupport
30
25
  backports!
31
26
  minitest (< 5.0.0)
32
- mspec!
27
+ mspec
33
28
  rake
34
29
  test-unit
@@ -65,10 +65,24 @@ With bundler, add to your Gemfile:
65
65
 
66
66
  Run <tt>bundle install</tt> and require the desired backports.
67
67
 
68
- 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.
68
+ Compatible with Ruby 1.8.6-2.4, JRuby and Rubinius.
69
69
 
70
70
  = Complete List of backports
71
71
 
72
+ == Ruby 2.4 backports
73
+
74
+ * Comparable
75
+ * +clamp+
76
+
77
+ == Ruby 2.2 backports
78
+
79
+ * Enumerable
80
+ * +slice_after+
81
+ * +slice_when+
82
+ * Float
83
+ * +prev_float+
84
+ * +next_float+
85
+
72
86
  == Ruby 2.1 backports
73
87
 
74
88
  * Array
@@ -142,7 +156,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
142
156
 
143
157
  * Random (new class)
144
158
 
145
- *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>.
159
+ *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>.
146
160
 
147
161
  == Ruby 1.9.1 backports
148
162
 
data/Rakefile CHANGED
@@ -11,23 +11,28 @@ Rake::TestTask.new(:test) do |test|
11
11
  test.verbose = false
12
12
  end
13
13
 
14
- desc "Run specs, where path can be '*/*' (default), 'class/*' or 'class/method'."
15
- task :spec, :path, :action do |t, args|
16
- args.with_defaults(:path => '*/*', :action => 'ci')
17
- stats = [[0] * 5]
18
- not_found = []
19
- mspec_cmds(args[:path], args[:action]) do |cmd, path|
14
+ class SpecRunner
15
+ STATS = [:files, :examples, :expectations, :failures, :errors]
16
+ attr_reader :stats, :not_found
17
+
18
+ def initialize
19
+ @counts = [0] * 5
20
+ @not_found = []
21
+ end
22
+
23
+ def run(cmd, path)
20
24
  result = `#{cmd}`
21
25
  match = result.match(/(\d+) files?, (\d+) examples?, (\d+) expectations?, (\d+) failures?, (\d+) errors?/)
22
26
  if match.nil?
23
27
  puts "*** mspec returned with unexpected results:"
24
28
  puts result
25
29
  puts "Command was:", cmd
26
- fail "Unexpected output from mspec"
27
30
  end
28
31
  _, ex, p, f, e = data = match.captures.map{|x| x.to_i}
29
32
  not_found << path if ex == 0
30
- stats << data
33
+ STATS.each_with_index do |_, i|
34
+ @counts[i] += data[i]
35
+ end
31
36
  if f + e > 0
32
37
  puts cmd
33
38
  puts result
@@ -36,12 +41,35 @@ task :spec, :path, :action do |t, args|
36
41
  STDOUT.flush
37
42
  end
38
43
  end
39
- $:.unshift 'lib'
40
- require 'backports/rails'
41
- _, ex, p, f, e = stats = stats.transpose.map{|x| x.sum}
42
- puts "*** Overall:", stats.zip(%w[files examples expectations failures errors]).map{|a| a.join(' ')}.join(', ')
43
- puts "No spec found for #{not_found.join(', ')}" unless not_found.empty?
44
- fail unless f + e == 0
44
+
45
+ def stats
46
+ h = {}
47
+ STATS.zip(@counts).each{|k, v| h[k]=v}
48
+ h
49
+ end
50
+
51
+ def report
52
+ puts "*** Overall:", stats.map{|a| a.join(' ')}.join(', ')
53
+ puts "No spec found for #{@not_found.join(', ')}" unless @not_found.empty?
54
+ end
55
+
56
+ def success?
57
+ stats[:failures] == 0 && stats[:errors] == 0
58
+ end
59
+ end
60
+
61
+ desc "Run specs, where path can be '*/*' (default), 'class/*' or 'class/method'."
62
+ task :spec, :path, :action do |t, args|
63
+ args.with_defaults(:path => '*/*', :action => 'ci')
64
+ specs = SpecRunner.new
65
+ mspec_cmds(args[:path], 'frozen_old_spec', args[:action]) do |cmd, path|
66
+ specs.run(cmd, path)
67
+ end
68
+ mspec_cmds(args[:path], 'spec', args[:action]) do |cmd, path|
69
+ specs.run(cmd, path)
70
+ end
71
+ specs.report
72
+ fail unless specs.success?
45
73
  end
46
74
 
47
75
  task :all_spec do # Necessary because of argument passing bug in 1.8.7
@@ -67,7 +95,9 @@ DEPENDENCIES = Hash.new([]).merge!(
67
95
  '1.9.2/array/select' => 'backports/1.8.7/array/select',
68
96
  '1.9.2/hash/select' => 'backports/1.8.7/hash/select',
69
97
  '1.9.2/enumerable/each_entry' => 'backports/1.8.7/enumerable/each_with_index',
70
- '2.0.0/hash/to_h' => 'backports/1.9.1/hash/default_proc'
98
+ '2.0.0/hash/to_h' => 'backports/1.9.1/hash/default_proc',
99
+ '2.2.0/float/next_float' => 'backports/2.2.0/float/prev_float',
100
+ '2.2.0/float/prev_float' => 'backports/2.2.0/float/next_float'
71
101
  )
72
102
  {
73
103
  :each_with_index => %w[enumerable/detect enumerable/find enumerable/find_all enumerable/select enumerable/to_a],
@@ -76,22 +106,32 @@ DEPENDENCIES = Hash.new([]).merge!(
76
106
  libs.each{|l| DEPENDENCIES["1.8.7/#{l}"] = "backports/1.8.7/enumerable/#{req}" }
77
107
  end
78
108
 
79
- # These cause actual errors while loading in 1.8:
80
- IGNORE_IN_18 = %w[
109
+ # These **old** specs cause actual errors while loading in 1.8:
110
+ OLD_IGNORE_IN_18 = %w[
81
111
  1.9.1/symbol/length
82
112
  1.9.1/symbol/size
83
113
  1.9.3/string/byteslice
84
114
  1.8.7/proc/yield
85
115
  1.9.1/proc/case_compare
86
116
  ]
87
- def mspec_cmds(pattern, action='ci')
117
+ # These **new** specs cause actual errors while loading in 1.8:
118
+ IGNORE_IN_18 = %w[
119
+ 2.1.0/enumerable/to_h
120
+ 2.1.0/array/to_h
121
+ 2.1.0/module/include
122
+ ]
123
+ def mspec_cmds(pattern, spec_folder, action='ci')
88
124
  pattern = "lib/backports/*.*.*/#{pattern}.rb"
89
125
  Dir.glob(pattern) do |lib_path|
90
126
  _match, version, path = lib_path.match(/backports\/(\d\.\d\.\d)\/(.*)\.rb/).to_a
91
127
  next if path =~ /stdlib/
92
128
  next if version <= RUBY_VERSION
93
129
  version_path = "#{version}/#{path}"
94
- next if IGNORE_IN_18.include? version_path if RUBY_VERSION < '1.9'
130
+ if RUBY_VERSION <= '2.0.0'
131
+ next if OLD_IGNORE_IN_18.include? version_path if RUBY_VERSION < '1.9'
132
+ next if IGNORE_IN_18.include? version_path
133
+ next if spec_folder != 'frozen_old_spec' && version <= '2.0.0' # Don't run new specs for pre 2.0 features & ruby
134
+ end
95
135
  deps = [*DEPENDENCIES[version_path]].map{|p| "-r #{p}"}.join(' ')
96
136
  klass, method = path.split('/')
97
137
  path = [klass.gsub('_', ''), method].join('/') # don't ask me why RubySpec uses matchdata instead of match_data
@@ -100,7 +140,7 @@ def mspec_cmds(pattern, action='ci')
100
140
  -r ./set_version/#{version}
101
141
  #{deps}
102
142
  -r backports/#{version_path}
103
- spec/rubyspec/core/#{path}_spec.rb
143
+ #{spec_folder}/rubyspec/core/#{path}_spec.rb
104
144
  ].join(' '), path
105
145
  end
106
146
  end
@@ -0,0 +1,6 @@
1
+ fails:ARGF.each_line is a public method
2
+ fails:ARGF.each_line requires multiple arguments
3
+ fails:ARGF.each_line reads each line of files
4
+ fails:ARGF.each_line returns self when passed a block
5
+ fails:ARGF.each_line returns an Enumerator when passed no block
6
+ fails:ARGF.each_line with a separator yields each separated section of all streams
@@ -0,0 +1,6 @@
1
+ fails:ARGF.each is a public method
2
+ fails:ARGF.each requires multiple arguments
3
+ fails:ARGF.each reads each line of files
4
+ fails:ARGF.each returns self when passed a block
5
+ fails:ARGF.each returns an Enumerator when passed no block
6
+ fails:ARGF.each with a separator yields each separated section of all streams
@@ -0,0 +1,6 @@
1
+ fails:ARGF.lines is a public method
2
+ fails:ARGF.lines requires multiple arguments
3
+ fails:ARGF.lines reads each line of files
4
+ fails:ARGF.lines returns self when passed a block
5
+ fails:ARGF.lines returns an Enumerator when passed no block
6
+ fails:ARGF.lines with a separator yields each separated section of all streams
@@ -0,0 +1,7 @@
1
+ fails:Array#collect returns an Enumerator when no block given
2
+ fails:Array#collect does not copy untrusted status
3
+ fails:Array#collect! keeps untrusted status
4
+ fails:Array#collect! when frozen raises a RuntimeError
5
+ fails:Array#collect! when frozen raises a RuntimeError when empty
6
+ fails:Array#collect! when frozen raises a RuntimeError when calling #each on the returned Enumerator
7
+ fails:Array#collect! when frozen raises a RuntimeError when calling #each on the returned Enumerator when empty
@@ -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,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#each_entry passes through the values yielded by #each_with_index
@@ -0,0 +1 @@
1
+ fails:Enumerator#next is rewound after encountering a StopIteration
@@ -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,3 @@
1
+ fails:File.join flattens nested arrays
2
+ fails:File.join inserts the separator in between empty strings and arrays
3
+ fails:File.join raises an ArgumentError if passed a recursive array
@@ -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,2 @@
1
+ fails:File.new returns a new File when use File::APPEND mode
2
+ fails:File.new returns a new File when use File::RDONLY|File::APPEND mode
@@ -0,0 +1,13 @@
1
+ fails:File.open on a FIFO opens it as a normal file
2
+ fails:File.open opens file when call with a block (basic case)
3
+ fails:File.open opens a file with mode string and block
4
+ fails:File.open opens a file with mode num and block
5
+ fails:File.open opens the file when passed mode, num, permissions and block
6
+ fails:File.open opens the file when call with fd
7
+ fails:File.open opens a file with a file descriptor d and a block
8
+ fails:File.open raises a SystemCallError if passed an invalid Integer type
9
+ fails:File.open raises an IOError when read in a block opened with File::RDONLY|File::APPEND mode
10
+ fails:File.open raises an IOError if the file exists when open with File::RDONLY|File::APPEND
11
+ fails:File.open defaults external_encoding to ASCII-8BIT for binary modes
12
+ fails:File.open when passed a file descriptor opens a file
13
+ fails:File.open when passed a file descriptor opens a file when passed a block
@@ -0,0 +1 @@
1
+ fails:File#to_path preserves the encoding of the path
@@ -0,0 +1 @@
1
+ fails:Fixnum#fdiv follows the coercion protocol
@@ -0,0 +1,2 @@
1
+ fails:GC.stress returns current status of GC stress mode
2
+ fails:GC.stress= sets the stress mode
@@ -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.[] raises an ArgumentError for arrays of more than 2 elements
2
+ fails:Hash.[] raises an ArgumentError when passed a list of value-invalid-pairs in an array
3
+ fails:Hash.[] removes the default_proc
@@ -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 @@
1
+ fails:Hash#delete_if raises a RuntimeError if called on a frozen instance
@@ -0,0 +1 @@
1
+ fails:Hash#each_pair yields a [[key, value]] Array for each pair to a block expecting |*args|
@@ -0,0 +1,3 @@
1
+ fails:Hash#eql? computes equality for recursive hashes
2
+ fails:Hash#eql? computes equality for complex recursive hashes
3
+ fails:Hash#eql? computes equality for recursive hashes & arrays
@@ -0,0 +1,3 @@
1
+ fails:Hash#hash generates a hash for recursive hash structures
2
+ fails:Hash#hash returns the same hash for recursive hashes
3
+ fails:Hash#hash returns the same hash for recursive hashes through arrays
@@ -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,2 @@
1
+ fails:Hash#reject! raises a RuntimeError if called on a frozen instance that is modified
2
+ fails:Hash#reject! raises a RuntimeError if called on a frozen instance that would not be modified
@@ -0,0 +1,8 @@
1
+ fails:Hash#select returns a Hash of entries for which block is true
2
+ fails:Hash#select! is equivalent to keep_if if changes are made
3
+ fails:Hash#select! returns nil if no changes were made
4
+ fails:Hash#select! raises a RuntimeError if called on an empty frozen instance
5
+ fails:Hash#select! raises a RuntimeError if called on a frozen instance that would not be modified
6
+ fails:Hash#select! returns an Enumerator if called on a non-empty hash without a block
7
+ fails:Hash#select! returns an Enumerator if called on an empty hash without a block
8
+ fails:Hash#select! returns an Enumerator if called on a frozen instance
@@ -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 @@
1
+ fails:IO#chars yields each character
@@ -0,0 +1 @@
1
+ fails:IO#each_char yields each character
@@ -0,0 +1 @@
1
+ fails:IO#lines ignores a given block
@@ -0,0 +1,24 @@
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 sets binmode from mode string
12
+ fails:IO.open does not set binmode without being asked
13
+ fails:IO.open sets binmode from :binmode option
14
+ fails:IO.open does not set binmode from false :binmode
15
+ fails:IO.open raises an error if passed binary/text mode two ways
16
+ fails:IO.open sets external encoding to binary with binmode in mode string
17
+ fails:IO.open sets external encoding to binary with :binmode option
18
+ fails:IO.open does not use binary encoding when mode encoding is specified
19
+ fails:IO.open does not use binary encoding when :encoding option is specified
20
+ fails:IO.open does not use binary encoding when :external_encoding option is specified
21
+ fails:IO.open does not use binary encoding when :internal_encoding option is specified
22
+ fails:IO.open coerces mode with #to_int
23
+ fails:IO.open coerces options as second argument with #to_hash
24
+ fails:IO.open raises ArgumentError if not passed a hash or nil for options