mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/mspec@53a6e3e
This commit is contained in:
parent
1c138327e0
commit
3dd63108b0
6 changed files with 14 additions and 9 deletions
|
@ -40,6 +40,15 @@ class ExceptionState
|
||||||
@backtrace_filter ||= MSpecScript.config[:backtrace_filter] || %r{(?:/bin/mspec|/lib/mspec/)}
|
@backtrace_filter ||= MSpecScript.config[:backtrace_filter] || %r{(?:/bin/mspec|/lib/mspec/)}
|
||||||
|
|
||||||
bt = @exception.backtrace || []
|
bt = @exception.backtrace || []
|
||||||
bt.select { |line| $MSPEC_DEBUG or @backtrace_filter !~ line }.join("\n")
|
unless $MSPEC_DEBUG
|
||||||
|
# Exclude <internal: entries inside MSpec code, so only after the first ignored entry
|
||||||
|
first_excluded_line = bt.index { |line| @backtrace_filter =~ line }
|
||||||
|
if first_excluded_line
|
||||||
|
bt = bt[0...first_excluded_line] + bt[first_excluded_line..-1].reject { |line|
|
||||||
|
@backtrace_filter =~ line || /^<internal:/ =~ line
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
bt.join("\n")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -155,7 +155,9 @@ module MSpec
|
||||||
|
|
||||||
# Stores the shared ContextState keyed by description.
|
# Stores the shared ContextState keyed by description.
|
||||||
def self.register_shared(state)
|
def self.register_shared(state)
|
||||||
@shared[state.to_s] = state
|
name = state.to_s
|
||||||
|
raise "duplicated shared #describe: #{name}" if @shared.key?(name)
|
||||||
|
@shared[name] = state
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns the shared ContextState matching description.
|
# Returns the shared ContextState matching description.
|
||||||
|
|
|
@ -42,7 +42,7 @@ class SpecVersion
|
||||||
|
|
||||||
def <=>(other)
|
def <=>(other)
|
||||||
if other.respond_to? :to_int
|
if other.respond_to? :to_int
|
||||||
other = Integer other
|
other = Integer(other.to_int)
|
||||||
else
|
else
|
||||||
other = SpecVersion.new(String(other)).to_i
|
other = SpecVersion.new(String(other)).to_i
|
||||||
end
|
end
|
||||||
|
|
2
spec/mspec/spec/fixtures/config.mspec
vendored
2
spec/mspec/spec/fixtures/config.mspec
vendored
|
@ -1,8 +1,6 @@
|
||||||
class MSpecScript
|
class MSpecScript
|
||||||
set :target, 'ruby'
|
set :target, 'ruby'
|
||||||
|
|
||||||
set :backtrace_filter, /lib\/mspec\//
|
|
||||||
|
|
||||||
set :tags_patterns, [
|
set :tags_patterns, [
|
||||||
[%r(spec/fixtures/), 'spec/fixtures/tags/'],
|
[%r(spec/fixtures/), 'spec/fixtures/tags/'],
|
||||||
[/_spec.rb$/, '_tags.txt']
|
[/_spec.rb$/, '_tags.txt']
|
||||||
|
|
|
@ -9,14 +9,12 @@ Expected 1 == 2
|
||||||
to be truthy but was false
|
to be truthy but was false
|
||||||
CWD/spec/fixtures/a_spec.rb:8:in `block (2 levels) in <top (required)>'
|
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/spec/fixtures/a_spec.rb:2:in `<top (required)>'
|
||||||
CWD/bin/mspec-run:7:in `<main>'
|
|
||||||
|
|
||||||
2)
|
2)
|
||||||
Foo#bar fails ERROR
|
Foo#bar fails ERROR
|
||||||
RuntimeError: failure
|
RuntimeError: failure
|
||||||
CWD/spec/fixtures/a_spec.rb:12:in `block (2 levels) in <top (required)>'
|
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/spec/fixtures/a_spec.rb:2:in `<top (required)>'
|
||||||
CWD/bin/mspec-run:7:in `<main>'
|
|
||||||
|
|
||||||
Finished in D.DDDDDD seconds
|
Finished in D.DDDDDD seconds
|
||||||
EOS
|
EOS
|
||||||
|
|
|
@ -28,7 +28,6 @@ Expected 1 == 2
|
||||||
to be truthy but was false
|
to be truthy but was false
|
||||||
CWD/spec/fixtures/tagging_spec.rb:9:in `block (2 levels) in <top (required)>'
|
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/spec/fixtures/tagging_spec.rb:3:in `<top (required)>'
|
||||||
CWD/bin/mspec-tag:7:in `<main>'
|
|
||||||
|
|
||||||
2)
|
2)
|
||||||
Tag#me érròrs in unicode FAILED
|
Tag#me érròrs in unicode FAILED
|
||||||
|
@ -36,7 +35,6 @@ Expected 1 == 2
|
||||||
to be truthy but was false
|
to be truthy but was false
|
||||||
CWD/spec/fixtures/tagging_spec.rb:13:in `block (2 levels) in <top (required)>'
|
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/spec/fixtures/tagging_spec.rb:3:in `<top (required)>'
|
||||||
CWD/bin/mspec-tag:7:in `<main>'
|
|
||||||
|
|
||||||
Finished in D.DDDDDD seconds
|
Finished in D.DDDDDD seconds
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue