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

Commits on Feb 26, 2017

  1. Squashed 'spec/mspec/' changes from 4bcdee5..b6a6877

    b6a6877 Fix detection of TruffleRuby now that its RUBY_ENGINE is "truffleruby"
    9c22593 Use latest stable of JRuby and Rubinius
    6e8741d Fix system-dependent path
    03a0c2b Always show the command line used by mspec on stderr
    4067b63 Add variables which were not initialized
    5c5e5d5 Use a helper for integration specs
    7e4b5e9 Fix uninitialized instance variable warning
    7426462 Add encoding magic comments for 1.9.3
    0ac9516 Read and write tags as UTF-8
    76ba93f Simpler replacement for RUBY_DESCRIPTION in specs
    
    git-subtree-dir: spec/mspec
    git-subtree-split: b6a687780c2fc2f0a76a826a677cfd054046d8de
    eregon committed Feb 26, 2017
    Copy the full SHA
    73717e2 View commit details
  2. Copy the full SHA
    88ca2c1 View commit details
  3. Squashed 'spec/ruby/' changes from fb3e3ac..0fe99d2

    0fe99d2 Random.raw_seed was renamed to Random.urandom
    e3770c3 Random.raw_seed is available since 2.3
    a200478 Add 2 specs for break in lambda
    1608074 Remove useless check
    bd9f415 RubySpec needs to know about the new name for TruffleRuby
    553a5a8 Add a spec for Hash#shift while iterating
    82866c5 Add a few specs related to Hash#delete while iterating
    1ebd056 Add spec that [].map(:foo) raises an ArgumentError
    06ca271 Spec that Hash#shift calls Hash#default when the Hash is empty
    1f23f0d The string cext specs use varargs so should include the header
    4fbb5bf TruffleRuby declares all spec'd cext functions
    6e9e617 TruffleRuby declares global variable cext functions
    94686ce Wait until the Init_ function before assigning locals in cext global specs
    92e18d9 TruffleRuby declares file cext functions
    b43032d TruffleRuby implements more cext functions
    ab18a0d TruffleRuby has a couple more cext declarations
    08716b6 TruffleRuby declares more exception cext functions
    ce61c7d TruffleRuby implements more of cext data
    e56cc67 TruffleRuby supports more cext constants
    ad0fad8 TruffleRuby has more class cext functions
    3c398d7 TruffleRuby has more numeric cext functions
    603d702 TruffleRuby has more io cext functions
    97172be TruffleRuby has marshal cext functions
    0be0b83 TruffleRuby has regexp cext functions
    183c123 TruffleRuby has time cext functions
    15a36f0 TruffleRuby has range cext functions
    ad68dfe TruffleRuby has more encoding cext functions
    710bd85 TruffleRuby has hash kernel and thread cext functions
    ca067aa TruffleRuby has hash cext functions
    8a9455f TruffleRuby has symbol cext functions
    85276a7 TruffleRuby has bignum cext functions
    def12b6 Remove version checks from TruffleRuby's configuration
    0330df9 TruffleRuby has struct cext functions
    2803eeb rb_setenv doesn't seem to be spec'd so doesn't need a flag
    56152d0 rb_strdup doesn't seem to be spec'd so doesn't need a flag
    85dd844 We have rb_scan_args
    47cb9bd Fix broken C code in cext typed data spec
    ec3fb38 Make TruffleRuby as declaring a couple of cext encoding functions
    d9c521b Fix broken C code in cext data spec
    3ea542f Mark TruffleRuby as supporting more string cext functions
    6a8cf74 Mark TruffleRuby as implement more of the cext object API
    39a73be Add a spec for cext rb_cTime
    f200874 Mark TruffleRuby as having some more cext array functions
    110fb93 Mark more of the TruffleRuby cext constants as available
    82e4730 Remove references to JRuby+Truffle in cext specs
    fe0131f Mark more TruffleRuby cext constants as available
    f94dbac Add 2 specs about a key in a Hash is not changed with Hash#[]=
    2412d26 Add specs for WeakRef
    b6a6247 Specify that Random.raw_seed raises an ArgumentError on negative sizes
    222075d Specify Random.raw_seed
    91e61b5 Add block argument cases to proc curry spec.
    9a0e7c8 Fix incorrect spec
    0aefb0d Shut down the correct half when calling BasicSocket#close_write
    60035e6 [spec] IO.try_convert when BasicObject is passed
    5e44b57 [spec] TypeError raised from `Rational( BasicObject.new )`
    8435503 [spec] check for respond_to? :to_c on Complex(arg)
    e88bc23 Add specs for EAGAIN/EWOULDBLOCK+WaitReadable/Writable.
    52e1526 Add String#% test for %p receiving a single hash
    bb48cad [spec] some unpack specs for returned string's encoding
    bdfc985 Travis: use a more terse formatter for the repeated run
    87451dc Travis: activate CHECK_LEAKS for 2.4.0
    edcedb7 Travis: test that running specs repetitively works
    ce637bb Travis: switch to an include list
    cd6c17f Fix fd leak in IO#each_codepoint spec
    b230a37 Cleanup after autoload spec
    ebd114e Fix global state in ObjectSpace specs
    36fe744 Avoid global state in Module specs
    b23f89a Fix repeatability of a Module specs
    8a879b4 Avoid changing global state in Method#super_method spec
    bf29639 No different license for an exclusion list header
    6f4e978 The minimum version is 2.1, remove guards and inline fixtures
    c06b7f3 Generate unique names for Encoding replicates and global variables
    1405cc8 before/after :each instead of before/after :all in glob specs
    42cb0d6 Use the ScratchPad instead of a custom recording
    1afb7ac Avoid global state in BasicObject specs
    a9816d2 Fix repeatability of C API specs
    b76ff9f Avoid after :all hooks in library specs
    71fd36e Recreate state for each spec as it is mutated
    cf50d0d Reset Syslog#mask after each spec
    ac47318 Create a new Queue or SizedQueue for each example
    b02beb8 Cleanup in autoload spec to avoid hanging when repeated
    4ba88e7 Fix spec repeatability of language specs
    5d6c351 Fix repeatability for flip-flop specs
    9315ce3 Avoid global state in private spec
    ee0db4a Simplify by just defining singleton methods
    165e7b0 Fix repeatability of a /regexp/o spec and simplify
    6792bfa Avoid global state in undef spec
    708d390 Use the block of Class.new which is like class_eval/exec
    ed878ae Fix repeatability of a precedence spec
    878b757 Fix repeatability of an alias spec
    a5adf38 Fix spec description for String#scrub
    
    git-subtree-dir: spec/ruby
    git-subtree-split: 0fe99d24f4a17eaa39563623209747eee278c3d1
    eregon committed Feb 26, 2017
    Copy the full SHA
    8ecb16c View commit details
  4. Copy the full SHA
    ffb61b4 View commit details
Showing with 760 additions and 845 deletions.
  1. +4 −6 spec/mspec/.travis.yml
  2. +1 −1 spec/mspec/lib/mspec/commands/mspec.rb
  3. +2 −2 spec/mspec/lib/mspec/guards/guard.rb
  4. +0 −1 spec/mspec/lib/mspec/helpers/numeric.rb
  5. +1 −1 spec/mspec/lib/mspec/runner/actions/filter.rb
  6. +6 −4 spec/mspec/lib/mspec/runner/mspec.rb
  7. +14 −0 spec/mspec/spec/commands/mspec_spec.rb
  8. +5 −0 spec/mspec/spec/fixtures/config.mspec
  9. +16 −0 spec/mspec/spec/fixtures/tagging_spec.rb
  10. +3 −7 spec/mspec/spec/integration/interpreter_spec.rb
  11. +8 −16 spec/mspec/spec/integration/run_spec.rb
  12. +61 −0 spec/mspec/spec/integration/tag_spec.rb
  13. +10 −0 spec/mspec/spec/spec_helper.rb
  14. +11 −7 spec/ruby/.travis.yml
  15. +7 −0 spec/ruby/core/array/shared/collect.rb
  16. +0 −15 spec/ruby/core/basicobject/fixtures/singleton_method.rb
  17. +7 −2 spec/ruby/core/basicobject/singleton_method_removed_spec.rb
  18. +7 −2 spec/ruby/core/basicobject/singleton_method_undefined_spec.rb
  19. +2 −9 spec/ruby/core/class/fixtures/classes.rb
  20. +34 −20 spec/ruby/core/class/inherited_spec.rb
  21. +2 −2 spec/ruby/core/dir/shared/glob.rb
  22. +21 −8 spec/ruby/core/encoding/replicate_spec.rb
  23. +6 −0 spec/ruby/core/hash/delete_if_spec.rb
  24. +12 −0 spec/ruby/core/hash/delete_spec.rb
  25. +15 −0 spec/ruby/core/hash/fixtures/classes.rb
  26. +6 −0 spec/ruby/core/hash/keep_if_spec.rb
  27. +6 −0 spec/ruby/core/hash/reject_spec.rb
  28. +6 −0 spec/ruby/core/hash/select_spec.rb
  29. +28 −0 spec/ruby/core/hash/shared/store.rb
  30. +23 −0 spec/ruby/core/hash/shift_spec.rb
  31. +11 −1 spec/ruby/core/io/each_codepoint_spec.rb
  32. +8 −3 spec/ruby/core/kernel/global_variables_spec.rb
  33. +2 −0 spec/ruby/core/method/fixtures/classes.rb
  34. +0 −5 spec/ruby/core/method/fixtures/classes21.rb
  35. +3 −7 spec/ruby/core/method/parameters_spec.rb
  36. +8 −2 spec/ruby/core/method/super_method_spec.rb
  37. +8 −0 spec/ruby/core/module/autoload_spec.rb
  38. +4 −1 spec/ruby/core/module/constants_spec.rb
  39. +0 −9 spec/ruby/core/module/fixtures/classes.rb
  40. +8 −4 spec/ruby/core/module/include_spec.rb
  41. +3 −2 spec/ruby/core/module/instance_method_spec.rb
  42. +5 −1 spec/ruby/core/module/instance_methods_spec.rb
  43. +5 −5 spec/ruby/core/module/prepend_spec.rb
  44. +1 −0 spec/ruby/core/module/remove_const_spec.rb
  45. +16 −22 spec/ruby/core/module/remove_method_spec.rb
  46. +28 −28 spec/ruby/core/module/undef_method_spec.rb
  47. +9 −9 spec/ruby/core/objectspace/each_object_spec.rb
  48. +8 −0 spec/ruby/core/proc/curry_spec.rb
  49. +9 −0 spec/ruby/core/random/raw_seed_spec.rb
  50. +23 −0 spec/ruby/core/random/shared/urandom.rb
  51. +9 −0 spec/ruby/core/random/urandom_spec.rb
  52. +1 −1 spec/ruby/core/string/scrub_spec.rb
  53. +2 −2 spec/ruby/core/string/unpack/b_spec.rb
  54. +0 −2 spec/ruby/fixtures/constants.rb
  55. +4 −5 spec/ruby/language/alias_spec.rb
  56. +31 −0 spec/ruby/language/break_spec.rb
  57. +4 −0 spec/ruby/language/class_spec.rb
  58. +1 −0 spec/ruby/language/constants_spec.rb
  59. +2 −0 spec/ruby/language/def_spec.rb
  60. +0 −20 spec/ruby/language/fixtures/classes.rb
  61. +0 −6 spec/ruby/language/fixtures/private.rb
  62. +5 −5 spec/ruby/language/if_spec.rb
  63. +7 −2 spec/ruby/language/precedence_spec.rb
  64. +8 −5 spec/ruby/language/private_spec.rb
  65. +6 −3 spec/ruby/language/regexp/interpolation_spec.rb
  66. +5 −5 spec/ruby/language/regexp/modifiers_spec.rb
  67. +23 −20 spec/ruby/language/undef_spec.rb
  68. +1 −1 spec/ruby/library/bigdecimal/mode_spec.rb
  69. +1 −1 spec/ruby/library/delegate/delegator/method_spec.rb
  70. +2 −4 spec/ruby/library/find/find_spec.rb
  71. +1 −1 spec/ruby/library/logger/application/log_spec.rb
  72. +2 −8 spec/ruby/library/syslog/mask_spec.rb
  73. +1 −1 spec/ruby/library/thread/queue/append_spec.rb
  74. +1 −1 spec/ruby/library/thread/queue/clear_spec.rb
  75. +1 −1 spec/ruby/library/thread/queue/close_spec.rb
  76. +1 −1 spec/ruby/library/thread/queue/closed_spec.rb
  77. +1 −1 spec/ruby/library/thread/queue/deq_spec.rb
  78. +1 −1 spec/ruby/library/thread/queue/empty_spec.rb
  79. +1 −1 spec/ruby/library/thread/queue/enq_spec.rb
  80. +1 −1 spec/ruby/library/thread/queue/length_spec.rb
  81. +1 −1 spec/ruby/library/thread/queue/num_waiting_spec.rb
  82. +1 −1 spec/ruby/library/thread/queue/pop_spec.rb
  83. +1 −1 spec/ruby/library/thread/queue/push_spec.rb
  84. +1 −1 spec/ruby/library/thread/queue/shift_spec.rb
  85. +1 −1 spec/ruby/library/thread/queue/size_spec.rb
  86. +1 −1 spec/ruby/library/thread/shared/queue/clear.rb
  87. +3 −3 spec/ruby/library/thread/shared/queue/close.rb
  88. +2 −2 spec/ruby/library/thread/shared/queue/closed.rb
  89. +4 −4 spec/ruby/library/thread/shared/queue/deque.rb
  90. +2 −2 spec/ruby/library/thread/shared/queue/empty.rb
  91. +1 −1 spec/ruby/library/thread/shared/queue/enque.rb
  92. +1 −1 spec/ruby/library/thread/shared/queue/length.rb
  93. +1 −1 spec/ruby/library/thread/shared/queue/num_waiting.rb
  94. +2 −2 spec/ruby/library/thread/sizedqueue/append_spec.rb
  95. +1 −1 spec/ruby/library/thread/sizedqueue/clear_spec.rb
  96. +1 −1 spec/ruby/library/thread/sizedqueue/close_spec.rb
  97. +1 −1 spec/ruby/library/thread/sizedqueue/closed_spec.rb
  98. +1 −1 spec/ruby/library/thread/sizedqueue/deq_spec.rb
  99. +1 −1 spec/ruby/library/thread/sizedqueue/empty_spec.rb
  100. +2 −2 spec/ruby/library/thread/sizedqueue/enq_spec.rb
  101. +1 −1 spec/ruby/library/thread/sizedqueue/length_spec.rb
  102. +1 −1 spec/ruby/library/thread/sizedqueue/num_waiting_spec.rb
  103. +1 −1 spec/ruby/library/thread/sizedqueue/pop_spec.rb
  104. +2 −2 spec/ruby/library/thread/sizedqueue/push_spec.rb
  105. +2 −2 spec/ruby/library/thread/sizedqueue/shared/enque.rb
  106. +1 −1 spec/ruby/library/thread/sizedqueue/shift_spec.rb
  107. +1 −1 spec/ruby/library/thread/sizedqueue/size_spec.rb
  108. +17 −0 spec/ruby/library/weakref/__getobj___spec.rb
  109. +24 −0 spec/ruby/library/weakref/fixtures/classes.rb
  110. +15 −0 spec/ruby/library/weakref/weakref_alive_spec.rb
  111. +9 −2 spec/ruby/optional/capi/class_spec.rb
  112. +4 −0 spec/ruby/optional/capi/constants_spec.rb
  113. +10 −0 spec/ruby/optional/capi/ext/constants_spec.c
  114. +2 −0 spec/ruby/optional/capi/ext/data_spec.c
  115. +6 −3 spec/ruby/optional/capi/ext/globals_spec.c
  116. +0 −486 spec/ruby/optional/capi/ext/jruby_truffle.h
  117. +3 −4 spec/ruby/optional/capi/ext/rubyspec.h
  118. +1 −0 spec/ruby/optional/capi/ext/string_spec.c
  119. +6 −0 spec/ruby/optional/capi/ext/truffleruby.h
  120. +4 −2 spec/ruby/optional/capi/ext/typed_data_spec.c
  121. +0 −3 spec/ruby/optional/capi/fixtures/class.rb
  122. +9 −0 spec/ruby/optional/capi/object_spec.rb
  123. +6 −6 spec/ruby/optional/capi/spec_helper.rb
10 changes: 4 additions & 6 deletions spec/mspec/.travis.yml
Original file line number Diff line number Diff line change
@@ -8,11 +8,9 @@ rvm:
- 2.1.5
- 2.2.1
- ruby-head
- rbx-2
- jruby-1.7
- jruby-head
- rubinius
- jruby
matrix:
allow_failures:
- rvm: rbx-2
- rvm: jruby-1.7
- rvm: jruby-head
- rvm: rubinius
- rvm: jruby
2 changes: 1 addition & 1 deletion spec/mspec/lib/mspec/commands/mspec.rb
Original file line number Diff line number Diff line change
@@ -157,9 +157,9 @@ def run
else
cmd, *rest = config[:target].split(/\s+/)
argv = rest + argv unless rest.empty?
$stderr.puts "$ #{cmd} #{argv.join(' ')}"
exec cmd, *argv
end
end
end
end

4 changes: 2 additions & 2 deletions spec/mspec/lib/mspec/guards/guard.rb
Original file line number Diff line number Diff line change
@@ -119,11 +119,11 @@ def implementation?(*args)
when :rubinius
RUBY_NAME =~ /^rbx/
when :ruby
RUBY_NAME =~ /^ruby/ && !defined?(::Truffle)
RUBY_NAME =~ /^ruby/
when :jruby
RUBY_NAME =~ /^jruby/
when :truffleruby
RUBY_NAME =~ /^ruby/ && defined?(::Truffle)
RUBY_NAME =~ /^truffleruby/
when :ironruby
RUBY_NAME =~ /^ironruby/
when :macruby
1 change: 0 additions & 1 deletion spec/mspec/lib/mspec/helpers/numeric.rb
Original file line number Diff line number Diff line change
@@ -55,7 +55,6 @@ def fixnum_min
Fixnum::MIN
end
elsif guard.implementation?(:jruby) || guard.implementation?(:truffleruby)
# Values from jruby/test/testFixnumBignumAutoconversion.rb
def fixnum_max
9223372036854775807
end
2 changes: 1 addition & 1 deletion spec/mspec/lib/mspec/runner/actions/filter.rb
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ class ActionFilter
def initialize(tags=nil, descs=nil)
@tags = Array(tags)
descs = Array(descs)
@sfilter = MatchFilter.new(nil, *descs) unless descs.empty?
@sfilter = descs.empty? ? nil : MatchFilter.new(nil, *descs)
@tfilter = nil
end

10 changes: 6 additions & 4 deletions spec/mspec/lib/mspec/runner/mspec.rb
Original file line number Diff line number Diff line change
@@ -5,9 +5,11 @@
module MSpec

@exit = nil
@abort = nil
@start = nil
@enter = nil
@before = nil
@add = nil
@after = nil
@leave = nil
@finish = nil
@@ -293,7 +295,7 @@ def self.read_tags(keys)
tags = []
file = tags_file
if File.exist? file
File.open(file, "rb") do |f|
File.open(file, "r:utf-8") do |f|
f.each_line do |line|
line.chomp!
next if line.empty?
@@ -321,7 +323,7 @@ def self.make_tag_dir(path)
def self.write_tags(tags)
file = tags_file
make_tag_dir(file)
File.open(file, "wb") do |f|
File.open(file, "w:utf-8") do |f|
tags.each { |t| f.puts t }
end
end
@@ -338,7 +340,7 @@ def self.write_tag(tag)

file = tags_file
make_tag_dir(file)
File.open(file, "ab") { |f| f.puts tag.to_s }
File.open(file, "a:utf-8") { |f| f.puts tag.to_s }
return true
end

@@ -351,7 +353,7 @@ def self.delete_tag(tag)
file = tags_file
if File.exist? file
lines = IO.readlines(file)
File.open(file, "wb") do |f|
File.open(file, "w:utf-8") do |f|
lines.each do |line|
line = line.chomp
if line.start_with?(tag.tag) and line.end_with?(desc)
14 changes: 14 additions & 0 deletions spec/mspec/spec/commands/mspec_spec.rb
Original file line number Diff line number Diff line change
@@ -217,6 +217,12 @@
@script = MSpecMain.new
@script.stub(:config).and_return(@config)
@script.stub(:exec)
@err = $stderr
$stderr = IOStub.new
end

after :each do
$stderr = @err
end

it "uses exec to invoke the runner script" do
@@ -225,12 +231,20 @@
@script.run
end

it "shows the command line on stderr" do
@script.should_receive(:exec).with("ruby", "-v", %r"#{MSPEC_HOME}/bin/mspec-run$")
@script.options []
@script.run
$stderr.to_s.should == "$ ruby -v #{Dir.pwd}/bin/mspec-run\n"
end

it "adds config[:launch] to the exec options" do
@script.should_receive(:exec).with("ruby",
"-Xlaunch.option", "-v", %r"#{MSPEC_HOME}/bin/mspec-run$")
@config[:launch] << "-Xlaunch.option"
@script.options []
@script.run
$stderr.to_s.should == "$ ruby -Xlaunch.option -v #{Dir.pwd}/bin/mspec-run\n"
end

it "calls #multi_exec if the command is 'ci' and the multi option is passed" do
5 changes: 5 additions & 0 deletions spec/mspec/spec/fixtures/config.mspec
Original file line number Diff line number Diff line change
@@ -2,4 +2,9 @@ class MSpecScript
set :target, 'ruby'

set :backtrace_filter, /lib\/mspec\//

set :tags_patterns, [
[%r(spec/fixtures/), 'spec/fixtures/tags/'],
[/_spec.rb$/, '_tags.txt']
]
end
16 changes: 16 additions & 0 deletions spec/mspec/spec/fixtures/tagging_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# encoding: utf-8
unless defined?(RSpec)
describe "Tag#me" do
it "passes" do
1.should == 1
end

it "errors" do
1.should == 2
end

it "érròrs in unicode" do
1.should == 2
end
end
end
10 changes: 3 additions & 7 deletions spec/mspec/spec/integration/interpreter_spec.rb
Original file line number Diff line number Diff line change
@@ -4,18 +4,14 @@
it "is used in subprocess" do
fixtures = "spec/fixtures"
interpreter = "#{fixtures}/my_ruby"
cmd = "bin/mspec run"
cmd << " -B #{fixtures}/config.mspec"
cmd << " #{fixtures}/print_interpreter_spec.rb"
cmd << " -t #{interpreter}"
out = `#{cmd}`
out = run_mspec("run", "#{fixtures}/print_interpreter_spec.rb -t #{interpreter}")
out = out.lines.map(&:chomp).reject { |line|
line == RUBY_DESCRIPTION
line == 'RUBY_DESCRIPTION'
}.take(3)
out.should == [
interpreter,
interpreter,
File.expand_path(interpreter)
"CWD/#{interpreter}"
]
end
end
24 changes: 8 additions & 16 deletions spec/mspec/spec/integration/run_spec.rb
Original file line number Diff line number Diff line change
@@ -3,34 +3,26 @@
describe "Running mspec" do
it "runs the specs" do
fixtures = "spec/fixtures"
cwd = Dir.pwd

cmd = "bin/mspec run"
cmd << " -B #{fixtures}/config.mspec"
cmd << " #{fixtures}/a_spec.rb"
out = `#{cmd}`
out = out.lines.reject { |line|
line.chomp == RUBY_DESCRIPTION
}.join
out = out.gsub(/\d\.\d{6}/, "D.DDDDDD")
out = run_mspec("run", "#{fixtures}/a_spec.rb")
out.should == <<EOS
RUBY_DESCRIPTION
.FE
1)
Foo#bar errors FAILED
Expected 1
to equal 2
#{cwd}/spec/fixtures/a_spec.rb:8:in `block (2 levels) in <top (required)>'
#{cwd}/spec/fixtures/a_spec.rb:2:in `<top (required)>'
#{cwd}/bin/mspec-run:7:in `<main>'
CWD/spec/fixtures/a_spec.rb:8:in `block (2 levels) in <top (required)>'
CWD/spec/fixtures/a_spec.rb:2:in `<top (required)>'
CWD/bin/mspec-run:7:in `<main>'
2)
Foo#bar fails ERROR
RuntimeError: failure
#{cwd}/spec/fixtures/a_spec.rb:12:in `block (2 levels) in <top (required)>'
#{cwd}/spec/fixtures/a_spec.rb:2:in `<top (required)>'
#{cwd}/bin/mspec-run:7:in `<main>'
CWD/spec/fixtures/a_spec.rb:12:in `block (2 levels) in <top (required)>'
CWD/spec/fixtures/a_spec.rb:2:in `<top (required)>'
CWD/bin/mspec-run:7:in `<main>'
Finished in D.DDDDDD seconds
61 changes: 61 additions & 0 deletions spec/mspec/spec/integration/tag_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# encoding: utf-8
require 'spec_helper'

describe "Running mspec tag" do
before :all do
FileUtils.rm_rf 'spec/fixtures/tags'
end

after :all do
FileUtils.rm_rf 'spec/fixtures/tags'
end

it "tags the failing specs" do
fixtures = "spec/fixtures"
out = run_mspec("tag", "--add fails --fail #{fixtures}/tagging_spec.rb")
out.should == <<EOS
RUBY_DESCRIPTION
.FF
TagAction: specs tagged with 'fails':
Tag#me errors
Tag#me érròrs in unicode
1)
Tag#me errors FAILED
Expected 1
to equal 2
CWD/spec/fixtures/tagging_spec.rb:9:in `block (2 levels) in <top (required)>'
CWD/spec/fixtures/tagging_spec.rb:3:in `<top (required)>'
CWD/bin/mspec-tag:7:in `<main>'
2)
Tag#me érròrs in unicode FAILED
Expected 1
to equal 2
CWD/spec/fixtures/tagging_spec.rb:13:in `block (2 levels) in <top (required)>'
CWD/spec/fixtures/tagging_spec.rb:3:in `<top (required)>'
CWD/bin/mspec-tag:7:in `<main>'
Finished in D.DDDDDD seconds
1 file, 3 examples, 3 expectations, 2 failures, 0 errors, 0 tagged
EOS
end

it "does not run already tagged specs" do
fixtures = "spec/fixtures"
out = run_mspec("run", "--excl-tag fails #{fixtures}/tagging_spec.rb")
out.should == <<EOS
RUBY_DESCRIPTION
.
Finished in D.DDDDDD seconds
1 file, 3 examples, 1 expectation, 0 failures, 0 errors, 2 tagged
EOS
end
end
10 changes: 10 additions & 0 deletions spec/mspec/spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -39,3 +39,13 @@ class MSpecExampleError < Exception
def hide_deprecation_warnings
MSpec.stub(:deprecate)
end

def run_mspec(command, args)
cwd = Dir.pwd
cmd = "bin/mspec #{command} -B spec/fixtures/config.mspec #{args}"
out = `#{cmd} 2>&1`
out = out.sub(/\A\$.+\n/, '') # Remove printed command line
out = out.sub(RUBY_DESCRIPTION, "RUBY_DESCRIPTION")
out = out.gsub(/\d\.\d{6}/, "D.DDDDDD")
out = out.gsub(cwd, "CWD")
end
18 changes: 11 additions & 7 deletions spec/ruby/.travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
sudo: false
language: ruby
rvm:
- 2.1.10
- 2.2.6
- 2.3.3
- 2.4.0
- ruby-head
install:
- git clone https://github.com/ruby/mspec.git ../mspec
script:
- ../mspec/bin/mspec
- ../mspec/bin/mspec $MSPEC_OPTS
matrix:
include:
- rvm: 2.1.10
- rvm: 2.2.6
- rvm: 2.3.3
- rvm: 2.4.0
env: CHECK_LEAKS=true
- rvm: 2.4.0
env: MSPEC_OPTS="-R2 -ff"
- rvm: ruby-head
branches:
only:
- master
7 changes: 7 additions & 0 deletions spec/ruby/core/array/shared/collect.rb
Original file line number Diff line number Diff line change
@@ -35,6 +35,13 @@
a.send(@method).should be_an_instance_of(enumerator_class)
end

it "raises an ArgumentError when no block and with arguments" do
a = [1, 2, 3]
lambda {
a.send(@method, :foo)
}.should raise_error(ArgumentError)
end

it "does not copy tainted status" do
a = [1, 2, 3]
a.taint
15 changes: 0 additions & 15 deletions spec/ruby/core/basicobject/fixtures/singleton_method.rb
Original file line number Diff line number Diff line change
@@ -4,22 +4,7 @@ def self.singleton_method_added name
ScratchPad.record [:singleton_method_added, name]
end

def self.singleton_method_removed name
ScratchPad.record [:singleton_method_removed, name]
end

def self.singleton_method_undefined name
ScratchPad.record [:singleton_method_undefined, name]
end

def self.singleton_method_to_alias
end

def self.singleton_method_to_remove
end

def self.singleton_method_to_undefine
end

end
end
9 changes: 7 additions & 2 deletions spec/ruby/core/basicobject/singleton_method_removed_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/singleton_method', __FILE__)

describe "BasicObject#singleton_method_removed" do
before :each do
@@ -11,7 +10,13 @@
end

it "is called when a method is removed on self" do
class << BasicObjectSpecs::SingletonMethod
klass = Class.new
def klass.singleton_method_removed(name)
ScratchPad.record [:singleton_method_removed, name]
end
def klass.singleton_method_to_remove
end
class << klass
remove_method :singleton_method_to_remove
end
ScratchPad.recorded.should == [:singleton_method_removed, :singleton_method_to_remove]
Loading