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: e139d9ce7a97
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b0488b8c1aea
Choose a head ref
  • 4 commits
  • 89 files changed
  • 1 contributor

Commits on Sep 29, 2015

  1. Squashed 'spec/mspec/' changes from 77b49c2..c60587f

    c60587f Remove some uninitialized ivar warnings
    3e76cd0 Add spec for SpecTag#unescape
    e13dde3 Simplify espacing in SpecTag
    57652ef Fix SpecTag#unescape
    1e1b4af Support escape: true only in ruby_exe, by executing from a temporary file
    cc5fd36 Merge pull request #10 from nobu/bug/9-portable-backtick
    d0406c9 Do not use $() for portability
    
    git-subtree-dir: spec/mspec
    git-subtree-split: c60587f02dc806de53521a38cb029959126c7dea
    eregon committed Sep 29, 2015
    Copy the full SHA
    2c48369 View commit details
  2. Copy the full SHA
    a6f282c View commit details
  3. Squashed 'spec/ruby/' changes from f06add1..fa9e1cd

    fa9e1cd Add some other cases for #super_method specs
    3481f99 Add Enumerable#{min,max,min_by,max_by} specs with nil
    00f2439 added spec for lambda with optional parameter
    a9de138 Add version guard
    f424cb0 Add block and lambda specs for MRI bug #9593
    9d36115 Add spec for MRI bug #9593
    14f3122 Update hash spec to include quoted symbol key syntax
    8cb48a7 Spec for Method and UnboundMethod #super_method (Ruby 2.2+)
    d6e3175 Fix Float#prev_float and Float#next_float specs
    be46b2c More edge case specs for Float#next_float and #prev_float near zero
    d7434d3 Specs for Float#next_float and #prev_float use eql? instead of ==
    8fa732b Specs for Float#next_float and #prev_float on NAN
    41a949b Specs for Float#next_float and #prev_float
    4296712 Kernel#throw now raises an UncaughtThrowError when there is no matching catch block.
    1b79214 Add version guard
    3529807 birthtime can also be implemented on Windows
    cd31973 Only darwin supports birthtime
    e6cbae8 adapt specs for specifics platform checks
    6cca077 Add File.birthtime and File#birthtime specs
    ca27d37 Add a single space between after and :each
    8944d0c Add version guard
    8e3cfa6 File#birthtime is not be implemented on some platforms
    af195cb Add File::Stat#birthtime specs
    654c1ee Add version guard
    933b95f Add specs for Enumerable#slice_when
    8011bb5 Argument error -> ArgumentError
    1a9abba Add version guard
    9d9aa3e Add specs for Enumerable#max_by optional arg
    fa4e34a Add version guard
    18d00f6 Add specs for Binding#receiver
    c1a1972 Add version guard
    5f44013 Add spec for Enumerable#max optional arg
    534d780 Fix typo in Enumerable#max's spec. s/minimum/maximum
    78345ae We are already in the Enumerable#max block, there's no need to repeat it.
    559210b Remove unused @A instance variable
    c9b9cd0 Use context for readability
    56639ab Add version guard
    53c2397 Add specs for Enumberable#min_by optional args
    553610a Fix typo in Enumerable#min_by's descriptions: Minimum, not maximum
    549d3b7 Specify some edge cases for Enumerable#min optional arg
    e8a21bb Remove unused instance variable @A
    1469d34 Add version guard
    f8a2be8 Add specs for Enumerable#min with optional arg.
    bf8cd32 Add version guard and fix style
    976c355 Add spec for Enumerable#slice_after
    b92dde0 Add an example to Binding#local_variables
    45f2788 Add version guard
    41b3c09 Add specs for Binding#local_variables
    9b8336e Fix Method#curry spec and add version guard
    60ba4e9 Add Method#curry specs
    9f0f050 Fix an example in ObjectSpace#each_object to run in 2.0.0
    b68632e Specify Binding#local_variable_get
    0291545 Enumerable#find_index should use #== semantics for testing equality
    6e9cc19 Simplify the #=== private spec
    78ed9fc Super uses given block even if arguments are passed explicitly
    3f8b74b Case can call private #=== method
    d0d4f14 Synchronize Fixnum#<< and #>>
    fb52f65 Add a few examples to Fixnum#<<
    9a888d0 Add more examples for Fixnum#>>
    a1aabf0 Fixes to ObjectSpaces specs.
    cf62939 Fix spec name.
    b09b120 More places objects could hide from ObjectSpace - thread and fiber locals and at_exit handlers.
    b91a806 ObjectSpace can reach both implicitly and explicitly captured locals
    9c7123a Add specs for where ObjectSpace.each_object can find objects.
    254ccdf Improve Thread#raise spec to be more precise about the backtrace
    9955865 Remove trailing spaces
    4ab3965 Merge pull request #136 from wied03/master
    477068f Account for cases where the LHS is a nil local variable - opal/opal#1090 (comment)
    5cab2a8 Improve specdocs of class specs
    c9eb2f1 Remove trailing spaces
    db3c823 Merge pull request #135 from wied03/master
    ff28bca Test creating classes within Class.new blocks
    cd78752 Merge pull request #133 from ngoto/use-CCDLFLAGS
    23c373d CCDLFLAGS should be used to build Position Independent Code
    b027be8 Use the output matcher in PP.pp to avoid touching $stdout directly
    a01fdc4 Fix formatting and trailing spaces
    9a73ed9 Merge pull request #130 from wied03/master
    f02ff7d Remove stringio dependency and use IOStub
    ae1aa04 Try to simplify the File#flock blocking spec
    159de46 Get started with PP stdlib specs, especially the PP::pp method
    0e097ec Merge pull request #131 from nobu/ftp#system-fix
    de0d559 newlines do not matter
    46c3fb2 Inline shared describe for Kernel#lambda with single usage.
    80729a3 Merge pull request #129 from iliabylich/stop-generating-dynamic-test-names
    8343600 Stop generating dynamic test names for lambda.
    0dbf847 Merge pull request #128 from ngoto/atan2-revert-ac7ca51
    4abb3c6 Merge pull request #126 from ngoto/File-stat-NFS
    0995c96 Remove needless "platform_is :solaris" guards.
    ec6ce28 Use 1 second ago from now to avoid failure due to NFS cache behavior.
    1f65cb6 Merge pull request #124 from ngoto/flock-Solaris
    5190db6 Merge pull request #123 from ngoto/DATA-flock-Solaris
    aeeb3dd DATA (read-only opened) can not be locked by File#flock on Solaris
    73857c7 Rewrite some File#flock specs using ruby_exe for supporting Solaris
    a0570cc Rewrite -s flag specs to explicitly pass inline code
    25cda76 Use a fixture for the autoload with frozen Object spec
    6e93ec5 Merge pull request #117 from rashmirathi1729/master
    2a4a08c Add Matrix#to_a specs
    96b4183 Merge pull request #119 from tobiashm/master
    0bc0537 String#start_with? and #end_with? for empty string
    f7cf2bd Module#singleton_class? is 2.1+ only
    7afc6fb toplevel visibility is already specified in language/
    08088b9 There is no Kernel#type.
    c695c91 Move method_missing fixture
    48eff07 Move method_missing specs to the right place
    4ddc433 Relax spec of send arity
    511568b Organize send specs
    821845d Unshare Continuation specs
    329d7cc Continuations are only available as a library in 2.0+
    5cebf8e Fix specdocs for Float constants
    20cad95 Move Module#singleton_class? to the right file
    
    git-subtree-dir: spec/ruby
    git-subtree-split: fa9e1cdc2815fa006b89cf83344ba6041d0d566c
    eregon committed Sep 29, 2015
    Copy the full SHA
    ca0e14f View commit details
  4. Merge RubySpec commit 'ca0e14f96fee9cf3438e6513893a0770142798e6'

    * Conflicts:
    *	spec/ruby/core/objectspace/each_object_spec.rb
    eregon committed Sep 29, 2015
    Copy the full SHA
    b0488b8 View commit details
Showing with 1,194 additions and 524 deletions.
  1. +14 −11 spec/mspec/lib/mspec/helpers/ruby_exe.rb
  2. +1 −1 spec/mspec/lib/mspec/runner/actions/filter.rb
  3. +2 −0 spec/mspec/lib/mspec/runner/mspec.rb
  4. +10 −4 spec/mspec/lib/mspec/runner/tag.rb
  5. +1 −0 spec/mspec/spec/helpers/io_spec.rb
  6. +5 −0 spec/mspec/spec/runner/exception_spec.rb
  7. +2 −2 spec/mspec/spec/runner/formatters/method_spec.rb
  8. +0 −1 spec/mspec/spec/runner/mspec_spec.rb
  9. +12 −0 spec/mspec/spec/runner/tag_spec.rb
  10. +8 −12 spec/ruby/command_line/dash_s_spec.rb
  11. +7 −7 spec/ruby/core/array/any_spec.rb
  12. +3 −0 spec/ruby/core/basicobject/__send___spec.rb
  13. +25 −1 spec/ruby/core/basicobject/method_missing_spec.rb
  14. +37 −0 spec/ruby/core/binding/local_variables_spec.rb
  15. +13 −0 spec/ruby/core/binding/receiver_spec.rb
  16. +0 −8 spec/ruby/core/continuation/call_spec.rb
  17. +0 −8 spec/ruby/core/continuation/element_reference_spec.rb
  18. +0 −8 spec/ruby/core/continuation/new_spec.rb
  19. +1 −1 spec/ruby/core/enumerable/each_cons_spec.rb
  20. +1 −1 spec/ruby/core/enumerable/each_entry_spec.rb
  21. +1 −1 spec/ruby/core/enumerable/each_slice_spec.rb
  22. +5 −5 spec/ruby/core/enumerable/grep_v_spec.rb
  23. +40 −0 spec/ruby/core/enumerable/max_by_spec.rb
  24. +50 −15 spec/ruby/core/enumerable/max_spec.rb
  25. +42 −3 spec/ruby/core/enumerable/min_by_spec.rb
  26. +36 −2 spec/ruby/core/enumerable/min_spec.rb
  27. +55 −0 spec/ruby/core/enumerable/slice_after_spec.rb
  28. +1 −1 spec/ruby/core/enumerable/slice_before_spec.rb
  29. +38 −0 spec/ruby/core/enumerable/slice_when_spec.rb
  30. +1 −1 spec/ruby/core/exception/receiver_spec.rb
  31. +60 −0 spec/ruby/core/file/birthtime_spec.rb
  32. +1 −1 spec/ruby/core/file/ctime_spec.rb
  33. +21 −17 spec/ruby/core/file/flock_spec.rb
  34. +29 −0 spec/ruby/core/file/stat/birthtime_spec.rb
  35. +1 −1 spec/ruby/core/file/stat/comparison_spec.rb
  36. +14 −14 spec/ruby/core/float/constants_spec.rb
  37. +46 −0 spec/ruby/core/float/next_float_spec.rb
  38. +46 −0 spec/ruby/core/float/prev_float_spec.rb
  39. +0 −7 spec/ruby/core/kernel/__send___spec.rb
  40. +1 −15 spec/ruby/core/kernel/autoload_spec.rb
  41. +0 −15 spec/ruby/core/kernel/callcc_spec.rb
  42. +7 −0 spec/ruby/core/kernel/fixtures/autoload_frozen.rb
  43. +13 −1 spec/ruby/core/kernel/lambda_spec.rb
  44. +0 −25 spec/ruby/core/kernel/method_missing_spec.rb
  45. +2 −2 spec/ruby/core/kernel/public_send_spec.rb
  46. +2 −2 spec/ruby/core/kernel/send_spec.rb
  47. +0 −17 spec/ruby/core/kernel/shared/lambda.rb
  48. +0 −116 spec/ruby/core/kernel/shared/send.rb
  49. +0 −28 spec/ruby/core/kernel/singleton_class_spec.rb
  50. +6 −0 spec/ruby/core/kernel/throw_spec.rb
  51. +0 −6 spec/ruby/core/kernel/type_spec.rb
  52. +0 −27 spec/ruby/core/main/def_spec.rb
  53. +6 −30 spec/ruby/core/math/atan2_spec.rb
  54. +38 −0 spec/ruby/core/method/curry_spec.rb
  55. +12 −0 spec/ruby/core/method/fixtures/classes.rb
  56. +41 −0 spec/ruby/core/method/super_method_spec.rb
  57. +6 −6 spec/ruby/core/module/deprecate_constant_spec.rb
  58. +29 −0 spec/ruby/core/module/singleton_class_spec.rb
  59. +2 −2 spec/ruby/core/numeric/negative_spec.rb
  60. +2 −2 spec/ruby/core/numeric/positive_spec.rb
  61. +1 −1 spec/ruby/core/objectspace/each_object_spec.rb
  62. +1 −0 spec/ruby/core/proc/curry_spec.rb
  63. +3 −3 spec/ruby/core/string/end_with_spec.rb
  64. +1 −0 spec/ruby/core/string/start_with_spec.rb
  65. +3 −0 spec/ruby/core/unboundmethod/fixtures/classes.rb
  66. +28 −0 spec/ruby/core/unboundmethod/super_method_spec.rb
  67. 0 spec/ruby/fixtures/{kernel/classes.rb → basicobject/method_missing.rb}
  68. +12 −0 spec/ruby/fixtures/class.rb
  69. +14 −0 spec/ruby/language/and_spec.rb
  70. +19 −0 spec/ruby/language/block_spec.rb
  71. +54 −0 spec/ruby/language/class_spec.rb
  72. +12 −1 spec/ruby/language/def_spec.rb
  73. +8 −1 spec/ruby/language/hash_spec.rb
  74. +19 −0 spec/ruby/language/lambda_spec.rb
  75. +1 −1 spec/ruby/language/predefined/data_spec.rb
  76. +1 −1 spec/ruby/library/continuation/call_spec.rb
  77. +1 −1 spec/ruby/library/continuation/element_reference_spec.rb
  78. 0 spec/ruby/{fixtures/kernel → library/continuation/fixtures}/callcc.rb
  79. +67 −3 spec/ruby/library/continuation/kernel/callcc_spec.rb
  80. +3 −2 spec/ruby/library/continuation/new_spec.rb
  81. 0 spec/ruby/{shared/continuation → library/continuation/shared}/call.rb
  82. +6 −1 spec/ruby/library/matrix/to_a_spec.rb
  83. +2 −2 spec/ruby/library/net/ftp/system_spec.rb
  84. +25 −0 spec/ruby/library/pp/pp_spec.rb
  85. +1 −1 spec/ruby/optional/capi/spec_helper.rb
  86. +6 −6 spec/ruby/shared/{kernel → basicobject}/method_missing.rb
  87. +110 −0 spec/ruby/shared/basicobject/send.rb
  88. +0 −5 spec/ruby/shared/continuation/new.rb
  89. +0 −68 spec/ruby/shared/kernel/callcc.rb
25 changes: 14 additions & 11 deletions spec/mspec/lib/mspec/helpers/ruby_exe.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require 'mspec/utils/ruby_name'
require 'mspec/guards/platform'
require 'mspec/helpers/tmp'

# The ruby_exe helper provides a wrapper for invoking the
# same Ruby interpreter as the one running the specs and
@@ -124,6 +125,13 @@ def ruby_exe(code, opts = {})
ENV[key] = value
end

escape = opts.delete(:escape)
if escape
tmpfile = tmp("rubyexe.rb")
File.open(tmpfile, "w") { |f| f.write(code) }
code = tmpfile
end

begin
platform_is_not :opal do
`#{ruby_cmd(code, opts)}`
@@ -134,25 +142,20 @@ def ruby_exe(code, opts = {})
key = key.to_s
ENV.delete key unless saved_env.key? key
end
File.delete tmpfile if escape
end
end
end

def ruby_cmd(code, opts = {})
body = code

if code and not File.exist?(code)
if opts[:escape]
heredoc_separator = "END_OF_RUBYCODE"
lines = code.lines
until lines.none? {|line| line.start_with? heredoc_separator }
heredoc_separator << heredoc_separator
end
if opts[:escape]
raise "escape: true is no longer supported in ruby_cmd, use ruby_exe or a fixture"
end

body = %Q!-e "$(cat <<'#{heredoc_separator}'\n#{code}\n#{heredoc_separator}\n)"!
else
body = "-e #{code.inspect}"
end
if code and not File.exist?(code)
body = "-e #{code.inspect}"
end

[RUBY_EXE, ENV['RUBY_FLAGS'], opts[:options], body, opts[:args]].compact.join(' ')
2 changes: 1 addition & 1 deletion spec/mspec/lib/mspec/runner/actions/filter.rb
Original file line number Diff line number Diff line change
@@ -14,14 +14,14 @@ def initialize(tags=nil, descs=nil)
@tags = Array(tags)
descs = Array(descs)
@sfilter = MatchFilter.new(nil, *descs) unless descs.empty?
@tfilter = nil
end

def ===(string)
@sfilter === string or @tfilter === string
end

def load
@tfilter = nil
return if @tags.empty?

desc = MSpec.read_tags(@tags).map { |t| t.description }
2 changes: 2 additions & 0 deletions spec/mspec/lib/mspec/runner/mspec.rb
Original file line number Diff line number Diff line change
@@ -16,7 +16,9 @@ module MSpec
@leave = nil
@load = nil
@unload = nil
@tagged = nil
@current = nil
@example = nil
@modes = []
@shared = {}
@guarded = []
14 changes: 10 additions & 4 deletions spec/mspec/lib/mspec/runner/tag.rb
Original file line number Diff line number Diff line change
@@ -13,13 +13,19 @@ def parse(string)

def unescape(str)
return unless str
str = str[1..-2] if str[0] == ?" and str[-1] == ?"
str.gsub(/\\n/, "\n")
if str[0] == ?" and str[-1] == ?"
str[1..-2].gsub('\n', "\n")
else
str
end
end

def escape(str)
str = %["#{str.gsub(/\n/, '\n')}"] if /\n/ =~ str
str
if str.include? "\n"
%["#{str.gsub("\n", '\n')}"]
else
str
end
end

def to_s
1 change: 1 addition & 0 deletions spec/mspec/spec/helpers/io_spec.rb
Original file line number Diff line number Diff line change
@@ -52,6 +52,7 @@
describe Object, "#new_fd" do
before :each do
@name = tmp("io_specs")
@io = nil
end

after :each do
5 changes: 5 additions & 0 deletions spec/mspec/spec/runner/exception_spec.rb
Original file line number Diff line number Diff line change
@@ -87,6 +87,10 @@
end

describe ExceptionState, "#message" do
before :each do
@state = ExampleState.new ContextState.new("C#m"), "works"
end

it "returns <No message> if the exception message is empty" do
exc = ExceptionState.new @state, "", Exception.new("")
exc.message.should == "<No message>"
@@ -111,6 +115,7 @@

describe ExceptionState, "#backtrace" do
before :each do
@state = ExampleState.new ContextState.new("C#m"), "works"
begin
raise Exception
rescue Exception => @exception
4 changes: 2 additions & 2 deletions spec/mspec/spec/runner/formatters/method_spec.rb
Original file line number Diff line number Diff line change
@@ -120,8 +120,8 @@
@formatter.before state

exc = SpecExpectationNotMetError.new "failed"
@formatter.exception ExceptionState.new(@state, nil, exc)
@formatter.exception ExceptionState.new(@state, nil, exc)
@formatter.exception ExceptionState.new(state, nil, exc)
@formatter.exception ExceptionState.new(state, nil, exc)

@formatter.after state
h = @formatter.methods["Some#method"]
1 change: 0 additions & 1 deletion spec/mspec/spec/runner/mspec_spec.rb
Original file line number Diff line number Diff line change
@@ -95,7 +95,6 @@
before :each do
MSpec.clear_current
@cs = ContextState.new "C#m"
@cs.stub(:state).and_return(@es)
@cs.parent = MSpec.current

@es = ExampleState.new @cs, "runs"
12 changes: 12 additions & 0 deletions spec/mspec/spec/runner/tag_spec.rb
Original file line number Diff line number Diff line change
@@ -109,3 +109,15 @@
[one].==([two]).should == true
end
end

describe SpecTag, "#unescape" do
it "replaces \\n by LF when the description is quoted" do
tag = SpecTag.new 'tag:"desc with\nnew line"'
tag.description.should == "desc with\nnew line"
end

it "does not replaces \\n by LF when the description is not quoted " do
tag = SpecTag.new 'tag:desc with\nnew line'
tag.description.should == "desc with\\nnew line"
end
end
20 changes: 8 additions & 12 deletions spec/ruby/command_line/dash_s_spec.rb
Original file line number Diff line number Diff line change
@@ -3,27 +3,23 @@
describe "The -s command line option" do
describe "when using -- to stop parsing" do
it "sets the value to true without an explicit value" do
ruby_exe("p $n", escape: true,
options: "-s",
args: "-- -n").chomp.should == "true"
ruby_exe(nil, options: "-s -e 'p $n'",
args: "-- -n").chomp.should == "true"
end

it "parses single letter args into globals" do
ruby_exe("puts $n", escape: true,
options: "-s",
args: "-- -n=blah").chomp.should == "blah"
ruby_exe(nil, options: "-s -e 'puts $n'",
args: "-- -n=blah").chomp.should == "blah"
end

it "parses long args into globals" do
ruby_exe("puts $_name", escape: true,
options: "-s",
args: "-- --name=blah").chomp.should == "blah"
ruby_exe(nil, options: "-s -e 'puts $_name'",
args: "-- --name=blah").chomp.should == "blah"
end

it "converts extra dashes into underscores" do
ruby_exe("puts $___name__test__", escape: true,
options: "-s",
args: "-- ----name--test--=blah").chomp.should == "blah"
ruby_exe(nil, options: "-s -e 'puts $___name__test__'",
args: "-- ----name--test--=blah").chomp.should == "blah"
end
end

14 changes: 7 additions & 7 deletions spec/ruby/core/array/any_spec.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
require File.expand_path('../../../spec_helper', __FILE__)

describe "Array#any?" do
describe 'with no block given (a default block of { |x| x } is implicit)' do
it "is false if the array is empty" do
describe 'with no block given (a default block of { |x| x } is implicit)' do
it "is false if the array is empty" do
empty_array = []
empty_array.any?.should == false
end

it "is false if the array is not empty, but all the members of the array are falsy" do
it "is false if the array is not empty, but all the members of the array are falsy" do
falsy_array = [false, nil, false]
falsy_array.any?.should == false
end
@@ -18,18 +18,18 @@
end
end

describe 'with a block given' do
it 'is false if the array is empty' do
describe 'with a block given' do
it 'is false if the array is empty' do
empty_array = []
empty_array.any? {|v| 1 == 1 }.should == false
end

it 'is true if the block returns true for any member of the array' do
it 'is true if the block returns true for any member of the array' do
array_with_members = [false, false, true, false]
array_with_members.any? {|v| v == true }.should == true
end

it 'is false if the block returns false for all members of the array' do
it 'is false if the block returns false for all members of the array' do
array_with_members = [false, false, true, false]
array_with_members.any? {|v| v == 42 }.should == false
end
3 changes: 3 additions & 0 deletions spec/ruby/core/basicobject/__send___spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../../../shared/basicobject/send', __FILE__)

describe "BasicObject#__send__" do
it "is a public instance method" do
BasicObject.should have_public_instance_method(:__send__)
end

it_behaves_like(:basicobject_send, :__send__)
end
26 changes: 25 additions & 1 deletion spec/ruby/core/basicobject/method_missing_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path('../../../shared/kernel/method_missing', __FILE__)
require File.expand_path('../../../shared/basicobject/method_missing', __FILE__)

describe "BasicObject#method_missing" do
it "is a private method" do
@@ -13,3 +13,27 @@
describe "BasicObject#method_missing" do
it_behaves_like :method_missing_instance, nil, BasicObject
end

describe "BasicObject#method_missing" do
it_behaves_like :method_missing_defined_module, nil, KernelSpecs::ModuleMM
end

describe "BasicObject#method_missing" do
it_behaves_like :method_missing_module, nil, KernelSpecs::ModuleNoMM
end

describe "BasicObject#method_missing" do
it_behaves_like :method_missing_defined_class, nil, KernelSpecs::ClassMM
end

describe "BasicObject#method_missing" do
it_behaves_like :method_missing_class, nil, KernelSpecs::ClassNoMM
end

describe "BasicObject#method_missing" do
it_behaves_like :method_missing_defined_instance, nil, KernelSpecs::ClassMM
end

describe "BasicObject#method_missing" do
it_behaves_like :method_missing_instance, nil, KernelSpecs::ClassNoMM
end
37 changes: 37 additions & 0 deletions spec/ruby/core/binding/local_variables_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
require File.expand_path('../../../spec_helper', __FILE__)

ruby_version_is "2.2" do
describe "Binding#local_variables" do
it "returns an Array" do
binding.local_variables.should be_kind_of(Array)
end

it "includes local variables in the current scope" do
a = 1
b = nil
binding.local_variables.should == [:a, :b]
end

it "includes local variables defined after calling binding.local_variables" do
binding.local_variables.should == [:a, :b]
a = 1
b = 2
end

it "includes local variables of inherited scopes and eval'ed context" do
p = proc { |a| b = 1; eval("c = 2; binding.local_variables") }
p.call.should == [:c, :a, :b, :p]
end

it "includes shadowed local variables only once" do
a = 1
proc { a = 2; binding.local_variables }.call.should == [:a]
end

it "includes new variables defined in the binding" do
b = binding
b.local_variable_set :a, 42
b.local_variables.should == [:a, :b]
end
end
end
13 changes: 13 additions & 0 deletions spec/ruby/core/binding/receiver_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)

ruby_version_is "2.2" do
describe "Binding#receiver" do
it "returns the object to which binding is bound" do
obj = BindingSpecs::Demo.new(1)
obj.get_binding.receiver.should == obj

binding.receiver.should == self
end
end
end
8 changes: 0 additions & 8 deletions spec/ruby/core/continuation/call_spec.rb

This file was deleted.

8 changes: 0 additions & 8 deletions spec/ruby/core/continuation/element_reference_spec.rb

This file was deleted.

8 changes: 0 additions & 8 deletions spec/ruby/core/continuation/new_spec.rb

This file was deleted.

2 changes: 1 addition & 1 deletion spec/ruby/core/enumerable/each_cons_spec.rb
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
acc.should == @in_threes
end

it "raises an Argument Error if there is not a single parameter > 0" do
it "raises an ArgumentError if there is not a single parameter > 0" do
lambda{ @enum.each_cons(0){} }.should raise_error(ArgumentError)
lambda{ @enum.each_cons(-2){} }.should raise_error(ArgumentError)
lambda{ @enum.each_cons{} }.should raise_error(ArgumentError)
2 changes: 1 addition & 1 deletion spec/ruby/core/enumerable/each_entry_spec.rb
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
ScratchPad.recorded.should == [[:a, 0], [:b, 1]]
end

it "raises an Argument error when extra arguments" do
it "raises an ArgumentError when extra arguments" do
lambda { @enum.each_entry("one").to_a }.should raise_error(ArgumentError)
lambda { @enum.each_entry("one"){}.to_a }.should raise_error(ArgumentError)
end
2 changes: 1 addition & 1 deletion spec/ruby/core/enumerable/each_slice_spec.rb
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
acc.should == @sliced
end

it "raises an Argument Error if there is not a single parameter > 0" do
it "raises an ArgumentError if there is not a single parameter > 0" do
lambda{ @enum.each_slice(0){} }.should raise_error(ArgumentError)
lambda{ @enum.each_slice(-2){} }.should raise_error(ArgumentError)
lambda{ @enum.each_slice{} }.should raise_error(ArgumentError)
Loading