Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4bc6c5033694
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f3ec650f7059
Choose a head ref
  • 4 commits
  • 96 files changed
  • 1 contributor

Commits on Jun 29, 2017

  1. Squashed 'spec/mspec/' changes from 86c3bee..021a119

    021a119 Follow close_others change in specs
    f629cae mspec.rb: keep jobserver fds
    e0164eb capi/spec_helper.rb: pass jobserver fds
    b284d6d default.mspec: limit cores
    bd55f0d Allow sync-rubyspec.rb to also sync mspec
    76f85f2 Mark variable as unused
    0e1777a Allow to call ruby_exe without arguments, returning an Array containing the interpreter and flags
    f7433c6 Use stub_const in ruby_exe_spec.rb
    0ac8e47 Make sure only the necessary methods are defined on Object
    3cf01c9 evaluate can be private
    a65dcaa The mock* methods should be private
    ffdc59a Make a few more methods private
    4eb31b9 Remove old unused method
    e4d7b77 Use BasicObject#__id__ instead of a mspec-specific alias
    6eaeddb Use a class for the instance passed in specs
    095f058 The include matcher does not need to be a module_function
    97c04f8 Make all matchers private methods
    490f573 Move all MSpec matchers under MSpecMatchers and avoid defining on Object
    
    git-subtree-dir: spec/mspec
    git-subtree-split: 021a1197ab67ffb4c4bb9217bf52e5f357d62ee2
    eregon committed Jun 29, 2017

    Unverified

    This user has not yet uploaded their public signing key.
    Copy the full SHA
    d0eb5e5 View commit details
  2. Copy the full SHA
    2c8e6d9 View commit details
  3. Squashed 'spec/ruby/' changes from 874f42f..86090df

    86090df Add missing LF
    abf1700 Use more standard String quotes
    136a6fc Fix usage of old matchers/helpers
    6252fe5 Remove unneeded specs.
    a0a28cc When stop is nil or omitted to Numeric#step, it should be set to infinity_value, and sign would be same with step.
    09f29cd Fixed Hash#{inspect, to_s}.
    3990075 Fixed Array#{inspect, to_s}.
    cb1a2a1 Kernel: allow caller{,_locations} to accept a Range
    3b4c15b Add a spec for Float#% with coercion
    df5d0c26 Use the argf helper in the ARGF.binmode spec
    6795636 We can use the argf helper in ARGF.set_encoding spec instead of subprocesses
    9d04f3a Add the possibility to use another ruby for the Process.{spawn,kill,wait} specs
    77c9af7 Group related Process.kill specs together
    5ab94c4 Do not send a signal while waiting in Process#kill specs
    7d16235 Simply use echo to print text and environment variables in Process.spawn specs
    95163fb Add spec for Fixnum#& with an Object responding to #coerce
    2678e58 Add spec for Kernel#singleton_method
    f9de23c Add a spec for dumping a Range with extra ivars
    4883bc0 Add specs that classes of immediates undefine Class#new and have no allocator
    0a10e20 Add some specs for Enumerator#inspect
    fc79a3d Added version guards [Bug#12684]
    9819db6 Delegate to `eql?` [Fix GH-1564]
    b6bb571 Use a file under tmp for File.real{,dir}path specs on Windows
    6ac2679 Adapt Time#zone spec to deal with differences of TZ validation on Windows
    e9d8272 capi/spec_helper.rb: suppress logo
    08cbf1d capi/spec_helper.rb: pass jobserver fds
    93e73a3 capi/spec_helper.rb: use MAKE env
    891bd72 Clear `DESTDIR` when running make
    f1ac005 Use IO.popen over hacks with ruby_cmd + ruby_exe
    f0ef6ea Use *ruby_exe instead of *ruby_cmd(nil).split in IO#popen spec
    4f5bf9a Use *ruby_exe instead of ruby_cmd when we rely on the pid being ruby's pid
    cbf6c15 Fix spacing of `do` keyword
    3426b8a Manually stub __id__ in BasicObject#equal? spec
    e3fac6e Make explicit that autoload is performed on Object
    
    git-subtree-dir: spec/ruby
    git-subtree-split: 86090df99c432f4ecd433c6e33373065113f96b9
    eregon committed Jun 29, 2017
    Copy the full SHA
    7f97e62 View commit details
  4. Copy the full SHA
    f3ec650 View commit details
Showing with 735 additions and 368 deletions.
  1. +4 −4 spec/mspec/lib/mspec/commands/mspec.rb
  2. +13 −1 spec/mspec/lib/mspec/helpers/ruby_exe.rb
  3. +12 −0 spec/mspec/lib/mspec/matchers/base.rb
  4. +2 −2 spec/mspec/lib/mspec/matchers/be_an_instance_of.rb
  5. +2 −2 spec/mspec/lib/mspec/matchers/be_ancestor_of.rb
  6. +2 −2 spec/mspec/lib/mspec/matchers/be_close.rb
  7. +2 −2 spec/mspec/lib/mspec/matchers/be_computed_by.rb
  8. +2 −2 spec/mspec/lib/mspec/matchers/be_empty.rb
  9. +2 −2 spec/mspec/lib/mspec/matchers/be_false.rb
  10. +2 −2 spec/mspec/lib/mspec/matchers/be_kind_of.rb
  11. +2 −2 spec/mspec/lib/mspec/matchers/be_nan.rb
  12. +2 −2 spec/mspec/lib/mspec/matchers/be_nil.rb
  13. +2 −2 spec/mspec/lib/mspec/matchers/be_true.rb
  14. +2 −2 spec/mspec/lib/mspec/matchers/be_true_or_false.rb
  15. +2 −2 spec/mspec/lib/mspec/matchers/block_caller.rb
  16. +2 −2 spec/mspec/lib/mspec/matchers/complain.rb
  17. +2 −2 spec/mspec/lib/mspec/matchers/eql.rb
  18. +2 −2 spec/mspec/lib/mspec/matchers/equal.rb
  19. +2 −2 spec/mspec/lib/mspec/matchers/equal_element.rb
  20. +2 −2 spec/mspec/lib/mspec/matchers/have_class_variable.rb
  21. +2 −2 spec/mspec/lib/mspec/matchers/have_constant.rb
  22. +2 −2 spec/mspec/lib/mspec/matchers/have_instance_method.rb
  23. +2 −2 spec/mspec/lib/mspec/matchers/have_instance_variable.rb
  24. +2 −2 spec/mspec/lib/mspec/matchers/have_method.rb
  25. +2 −2 spec/mspec/lib/mspec/matchers/have_private_instance_method.rb
  26. +2 −2 spec/mspec/lib/mspec/matchers/have_private_method.rb
  27. +2 −2 spec/mspec/lib/mspec/matchers/have_protected_instance_method.rb
  28. +2 −2 spec/mspec/lib/mspec/matchers/have_public_instance_method.rb
  29. +2 −2 spec/mspec/lib/mspec/matchers/have_singleton_method.rb
  30. +2 −3 spec/mspec/lib/mspec/matchers/include.rb
  31. +3 −3 spec/mspec/lib/mspec/matchers/infinity.rb
  32. +2 −3 spec/mspec/lib/mspec/matchers/match_yaml.rb
  33. +2 −2 spec/mspec/lib/mspec/matchers/output.rb
  34. +2 −2 spec/mspec/lib/mspec/matchers/output_to_fd.rb
  35. +2 −2 spec/mspec/lib/mspec/matchers/raise_error.rb
  36. +2 −2 spec/mspec/lib/mspec/matchers/respond_to.rb
  37. +3 −3 spec/mspec/lib/mspec/matchers/signed_zero.rb
  38. +1 −5 spec/mspec/lib/mspec/mocks/mock.rb
  39. +12 −12 spec/mspec/lib/mspec/mocks/object.rb
  40. +4 −4 spec/mspec/lib/mspec/runner/evaluate.rb
  41. +5 −2 spec/mspec/lib/mspec/runner/mspec.rb
  42. +7 −9 spec/mspec/lib/mspec/runner/object.rb
  43. +6 −8 spec/mspec/lib/mspec/runner/shared.rb
  44. +2 −2 spec/mspec/lib/mspec/utils/script.rb
  45. +3 −3 spec/mspec/spec/commands/mspec_spec.rb
  46. +1 −0 spec/mspec/spec/expectations/should.rb
  47. +8 −0 spec/mspec/spec/fixtures/object_methods_spec.rb
  48. +16 −43 spec/mspec/spec/helpers/ruby_exe_spec.rb
  49. +18 −0 spec/mspec/spec/integration/object_methods_spec.rb
  50. +13 −11 spec/mspec/spec/matchers/output_to_fd_spec.rb
  51. +2 −4 spec/mspec/spec/mocks/mock_spec.rb
  52. +2 −0 spec/mspec/spec/runner/shared_spec.rb
  53. +34 −20 spec/mspec/tool/sync/sync-rubyspec.rb
  54. +10 −13 spec/ruby/core/argf/binmode_spec.rb
  55. +0 −5 spec/ruby/core/argf/fixtures/encoding.rb
  56. +22 −9 spec/ruby/core/argf/set_encoding_spec.rb
  57. +40 −0 spec/ruby/core/array/shared/inspect.rb
  58. +2 −2 spec/ruby/core/basicobject/equal_spec.rb
  59. +12 −0 spec/ruby/core/bignum/bignum_spec.rb
  60. +1 −1 spec/ruby/core/enumerable/uniq_spec.rb
  61. +13 −1 spec/ruby/core/enumerator/inspect_spec.rb
  62. +3 −3 spec/ruby/core/enumerator/lazy/uniq_spec.rb
  63. +15 −0 spec/ruby/core/false/falseclass_spec.rb
  64. +6 −2 spec/ruby/core/file/realdirpath_spec.rb
  65. +10 −2 spec/ruby/core/file/realpath_spec.rb
  66. +6 −0 spec/ruby/core/fixnum/bit_and_spec.rb
  67. +12 −0 spec/ruby/core/fixnum/fixnum_spec.rb
  68. +12 −0 spec/ruby/core/float/float_spec.rb
  69. +6 −0 spec/ruby/core/float/shared/modulo.rb
  70. +41 −1 spec/ruby/core/hash/shared/to_s.rb
  71. +13 −16 spec/ruby/core/io/popen_spec.rb
  72. +1 −2 spec/ruby/core/kernel/autoload_spec.rb
  73. +6 −0 spec/ruby/core/kernel/caller_spec.rb
  74. +1 −1 spec/ruby/core/kernel/chomp_spec.rb
  75. +1 −1 spec/ruby/core/kernel/chop_spec.rb
  76. +22 −12 spec/ruby/core/kernel/fixtures/classes.rb
  77. +41 −0 spec/ruby/core/kernel/singleton_method_spec.rb
  78. +9 −0 spec/ruby/core/marshal/dump_spec.rb
  79. +1 −1 spec/ruby/core/matchdata/named_captures_spec.rb
  80. +1 −1 spec/ruby/core/module/autoload_spec.rb
  81. +15 −0 spec/ruby/core/nil/nilclass_spec.rb
  82. +12 −0 spec/ruby/core/numeric/shared/step.rb
  83. +13 −7 spec/ruby/core/process/fixtures/common.rb
  84. +0 −1 spec/ruby/core/process/fixtures/env.rb
  85. +0 −1 spec/ruby/core/process/fixtures/print.rb
  86. +12 −36 spec/ruby/core/process/kill_spec.rb
  87. +48 −36 spec/ruby/core/process/spawn_spec.rb
  88. +3 −0 spec/ruby/core/process/wait_spec.rb
  89. +12 −0 spec/ruby/core/symbol/symbol_spec.rb
  90. +13 −1 spec/ruby/core/time/zone_spec.rb
  91. +15 −0 spec/ruby/core/true/trueclass_spec.rb
  92. +3 −3 spec/ruby/language/predefined_spec.rb
  93. +1 −1 spec/ruby/library/date/shared/jd.rb
  94. +40 −5 spec/ruby/library/delegate/delegator/eql_spec.rb
  95. +1 −1 spec/ruby/library/rexml/text/wrap_spec.rb
  96. +7 −3 spec/ruby/optional/capi/spec_helper.rb
8 changes: 4 additions & 4 deletions spec/mspec/lib/mspec/commands/mspec.rb
Original file line number Diff line number Diff line change
@@ -98,7 +98,7 @@ def multi_exec(argv)
end

output_files = []
processes = [cores, @files.size].min
processes = cores(@files.size)
children = processes.times.map { |i|
name = tmp "mspec-multi-#{i}"
output_files << name
@@ -109,7 +109,7 @@ def multi_exec(argv)
}
command = argv + ["-fy", "-o", name]
$stderr.puts "$ #{command.join(' ')}" if $MSPEC_DEBUG
IO.popen([env, *command], "rb+")
IO.popen([env, *command, close_others: false], "rb+")
}

puts children.map { |child| child.gets }.uniq
@@ -147,7 +147,7 @@ def multi_exec(argv)
success = true
children.each { |child|
child.puts "QUIT"
pid, status = Process.wait2(child.pid)
_pid, status = Process.wait2(child.pid)
success &&= status.success?
child.close
}
@@ -171,7 +171,7 @@ def run
exit multi_exec(argv)
else
$stderr.puts "$ #{argv.join(' ')}"
exec(*argv)
exec(*argv, close_others: false)
end
end
end
14 changes: 13 additions & 1 deletion spec/mspec/lib/mspec/helpers/ruby_exe.rb
Original file line number Diff line number Diff line change
@@ -38,6 +38,14 @@
# If +nil+ is passed for the first argument, the command line
# will be built only from the options hash.
#
# If no arguments are passed to ruby_exe, it returns an Array
# containing the interpreter executable and the flags:
#
# spawn(*ruby_exe, "-e", "puts :hello")
#
# This avoids spawning an extra shell, and ensure the pid returned by spawn
# corresponds to the ruby process and not the shell.
#
# The RUBY_EXE constant is setup by mspec automatically
# and is used by ruby_exe and ruby_cmd. The mspec runner script
# will set ENV['RUBY_EXE'] to the name of the executable used
@@ -121,11 +129,15 @@ def resolve_ruby_exe
raise Exception, "Unable to find a suitable ruby executable."
end

def ruby_exe(code, opts = {})
def ruby_exe(code = :not_given, opts = {})
if opts[:dir]
raise "ruby_exe(..., dir: dir) is no longer supported, use Dir.chdir"
end

if code == :not_given
return RUBY_EXE.split(' ')
end

env = opts[:env] || {}
saved_env = {}
env.each do |key, value|
12 changes: 12 additions & 0 deletions spec/mspec/lib/mspec/matchers/base.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
module MSpecMatchers
end

class MSpecEnv
include MSpecMatchers
end

# Expactations are sometimes used in a module body
class Module
include MSpecMatchers
end

class SpecPositiveOperatorMatcher
def initialize(actual)
@actual = actual
4 changes: 2 additions & 2 deletions spec/mspec/lib/mspec/matchers/be_an_instance_of.rb
Original file line number Diff line number Diff line change
@@ -19,8 +19,8 @@ def negative_failure_message
end
end

class Object
def be_an_instance_of(expected)
module MSpecMatchers
private def be_an_instance_of(expected)
BeAnInstanceOfMatcher.new(expected)
end
end
4 changes: 2 additions & 2 deletions spec/mspec/lib/mspec/matchers/be_ancestor_of.rb
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@ def negative_failure_message
end
end

class Object
def be_ancestor_of(expected)
module MSpecMatchers
private def be_ancestor_of(expected)
BeAncestorOfMatcher.new(expected)
end
end
4 changes: 2 additions & 2 deletions spec/mspec/lib/mspec/matchers/be_close.rb
Original file line number Diff line number Diff line change
@@ -20,8 +20,8 @@ def negative_failure_message
end
end

class Object
def be_close(expected, tolerance)
module MSpecMatchers
private def be_close(expected, tolerance)
BeCloseMatcher.new(expected, tolerance)
end
end
4 changes: 2 additions & 2 deletions spec/mspec/lib/mspec/matchers/be_computed_by.rb
Original file line number Diff line number Diff line change
@@ -30,8 +30,8 @@ def failure_message
end
end

class Object
def be_computed_by(sym, *args)
module MSpecMatchers
private def be_computed_by(sym, *args)
BeComputedByMatcher.new(sym, *args)
end
end
4 changes: 2 additions & 2 deletions spec/mspec/lib/mspec/matchers/be_empty.rb
Original file line number Diff line number Diff line change
@@ -13,8 +13,8 @@ def negative_failure_message
end
end

class Object
def be_empty
module MSpecMatchers
private def be_empty
BeEmptyMatcher.new
end
end
4 changes: 2 additions & 2 deletions spec/mspec/lib/mspec/matchers/be_false.rb
Original file line number Diff line number Diff line change
@@ -13,8 +13,8 @@ def negative_failure_message
end
end

class Object
def be_false
module MSpecMatchers
private def be_false
BeFalseMatcher.new
end
end
4 changes: 2 additions & 2 deletions spec/mspec/lib/mspec/matchers/be_kind_of.rb
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@ def negative_failure_message
end
end

class Object
def be_kind_of(expected)
module MSpecMatchers
private def be_kind_of(expected)
BeKindOfMatcher.new(expected)
end
end
4 changes: 2 additions & 2 deletions spec/mspec/lib/mspec/matchers/be_nan.rb
Original file line number Diff line number Diff line change
@@ -13,8 +13,8 @@ def negative_failure_message
end
end

class Object
def be_nan
module MSpecMatchers
private def be_nan
BeNaNMatcher.new
end
end
4 changes: 2 additions & 2 deletions spec/mspec/lib/mspec/matchers/be_nil.rb
Original file line number Diff line number Diff line change
@@ -13,8 +13,8 @@ def negative_failure_message
end
end

class Object
def be_nil
module MSpecMatchers
private def be_nil
BeNilMatcher.new
end
end
4 changes: 2 additions & 2 deletions spec/mspec/lib/mspec/matchers/be_true.rb
Original file line number Diff line number Diff line change
@@ -13,8 +13,8 @@ def negative_failure_message
end
end

class Object
def be_true
module MSpecMatchers
private def be_true
BeTrueMatcher.new
end
end
4 changes: 2 additions & 2 deletions spec/mspec/lib/mspec/matchers/be_true_or_false.rb
Original file line number Diff line number Diff line change
@@ -13,8 +13,8 @@ def negative_failure_message
end
end

class Object
def be_true_or_false
module MSpecMatchers
private def be_true_or_false
BeTrueOrFalseMatcher.new
end
end
4 changes: 2 additions & 2 deletions spec/mspec/lib/mspec/matchers/block_caller.rb
Original file line number Diff line number Diff line change
@@ -28,8 +28,8 @@ def negative_failure_message
end
end

class Object
def block_caller(timeout = 0.1)
module MSpecMatchers
private def block_caller(timeout = 0.1)
BlockingMatcher.new
end
end
4 changes: 2 additions & 2 deletions spec/mspec/lib/mspec/matchers/complain.rb
Original file line number Diff line number Diff line change
@@ -49,8 +49,8 @@ def negative_failure_message
end
end

class Object
def complain(complaint=nil)
module MSpecMatchers
private def complain(complaint=nil)
ComplainMatcher.new(complaint)
end
end
4 changes: 2 additions & 2 deletions spec/mspec/lib/mspec/matchers/eql.rb
Original file line number Diff line number Diff line change
@@ -19,8 +19,8 @@ def negative_failure_message
end
end

class Object
def eql(expected)
module MSpecMatchers
private def eql(expected)
EqlMatcher.new(expected)
end
end
4 changes: 2 additions & 2 deletions spec/mspec/lib/mspec/matchers/equal.rb
Original file line number Diff line number Diff line change
@@ -19,8 +19,8 @@ def negative_failure_message
end
end

class Object
def equal(expected)
module MSpecMatchers
private def equal(expected)
EqualMatcher.new(expected)
end
end
4 changes: 2 additions & 2 deletions spec/mspec/lib/mspec/matchers/equal_element.rb
Original file line number Diff line number Diff line change
@@ -71,8 +71,8 @@ def content_for_failure_message
end
end

class Object
def equal_element(*args)
module MSpecMatchers
private def equal_element(*args)
EqualElementMatcher.new(*args)
end
end
4 changes: 2 additions & 2 deletions spec/mspec/lib/mspec/matchers/have_class_variable.rb
Original file line number Diff line number Diff line change
@@ -5,8 +5,8 @@ class HaveClassVariableMatcher < VariableMatcher
self.description = 'class variable'
end

class Object
def have_class_variable(variable)
module MSpecMatchers
private def have_class_variable(variable)
HaveClassVariableMatcher.new(variable)
end
end
4 changes: 2 additions & 2 deletions spec/mspec/lib/mspec/matchers/have_constant.rb
Original file line number Diff line number Diff line change
@@ -5,8 +5,8 @@ class HaveConstantMatcher < VariableMatcher
self.description = 'constant'
end

class Object
def have_constant(variable)
module MSpecMatchers
private def have_constant(variable)
HaveConstantMatcher.new(variable)
end
end
4 changes: 2 additions & 2 deletions spec/mspec/lib/mspec/matchers/have_instance_method.rb
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@ def negative_failure_message
end
end

class Object
def have_instance_method(method, include_super=true)
module MSpecMatchers
private def have_instance_method(method, include_super=true)
HaveInstanceMethodMatcher.new method, include_super
end
end
4 changes: 2 additions & 2 deletions spec/mspec/lib/mspec/matchers/have_instance_variable.rb
Original file line number Diff line number Diff line change
@@ -5,8 +5,8 @@ class HaveInstanceVariableMatcher < VariableMatcher
self.description = 'instance variable'
end

class Object
def have_instance_variable(variable)
module MSpecMatchers
private def have_instance_variable(variable)
HaveInstanceVariableMatcher.new(variable)
end
end
4 changes: 2 additions & 2 deletions spec/mspec/lib/mspec/matchers/have_method.rb
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@ def negative_failure_message
end
end

class Object
def have_method(method, include_super=true)
module MSpecMatchers
private def have_method(method, include_super=true)
HaveMethodMatcher.new method, include_super
end
end
4 changes: 2 additions & 2 deletions spec/mspec/lib/mspec/matchers/have_private_instance_method.rb
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@ def negative_failure_message
end
end

class Object
def have_private_instance_method(method, include_super=true)
module MSpecMatchers
private def have_private_instance_method(method, include_super=true)
HavePrivateInstanceMethodMatcher.new method, include_super
end
end
4 changes: 2 additions & 2 deletions spec/mspec/lib/mspec/matchers/have_private_method.rb
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@ def negative_failure_message
end
end

class Object
def have_private_method(method, include_super=true)
module MSpecMatchers
private def have_private_method(method, include_super=true)
HavePrivateMethodMatcher.new method, include_super
end
end
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@ def negative_failure_message
end
end

class Object
def have_protected_instance_method(method, include_super=true)
module MSpecMatchers
private def have_protected_instance_method(method, include_super=true)
HaveProtectedInstanceMethodMatcher.new method, include_super
end
end
4 changes: 2 additions & 2 deletions spec/mspec/lib/mspec/matchers/have_public_instance_method.rb
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@ def negative_failure_message
end
end

class Object
def have_public_instance_method(method, include_super=true)
module MSpecMatchers
private def have_public_instance_method(method, include_super=true)
HavePublicInstanceMethodMatcher.new method, include_super
end
end
4 changes: 2 additions & 2 deletions spec/mspec/lib/mspec/matchers/have_singleton_method.rb
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@ def negative_failure_message
end
end

class Object
def have_singleton_method(method, include_super=true)
module MSpecMatchers
private def have_singleton_method(method, include_super=true)
HaveSingletonMethodMatcher.new method, include_super
end
end
5 changes: 2 additions & 3 deletions spec/mspec/lib/mspec/matchers/include.rb
Original file line number Diff line number Diff line change
@@ -24,9 +24,8 @@ def negative_failure_message
end

# Cannot override #include at the toplevel in MRI
module MSpec
def include(*expected)
module MSpecMatchers
private def include(*expected)
IncludeMatcher.new(*expected)
end
module_function :include
end
6 changes: 3 additions & 3 deletions spec/mspec/lib/mspec/matchers/infinity.rb
Original file line number Diff line number Diff line change
@@ -17,12 +17,12 @@ def negative_failure_message
end
end

class Object
def be_positive_infinity
module MSpecMatchers
private def be_positive_infinity
InfinityMatcher.new(1)
end

def be_negative_infinity
private def be_negative_infinity
InfinityMatcher.new(-1)
end
end
Loading