diff options
author | Benoit Daloze <[email protected]> | 2020-08-28 20:26:00 +0200 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2020-08-28 20:26:00 +0200 |
commit | 3dd63108b0e7551aba76eba85a459b58ec971ccb (patch) | |
tree | 352ae69c78bef35fd250c280174b35e6b575f156 /spec/mspec/lib | |
parent | 1c138327e0537bb55f7d0810f6fe7e1c7f63b6c5 (diff) |
Update to ruby/mspec@53a6e3e
Diffstat (limited to 'spec/mspec/lib')
-rw-r--r-- | spec/mspec/lib/mspec/runner/exception.rb | 11 | ||||
-rw-r--r-- | spec/mspec/lib/mspec/runner/mspec.rb | 4 | ||||
-rw-r--r-- | spec/mspec/lib/mspec/utils/version.rb | 2 |
3 files changed, 14 insertions, 3 deletions
diff --git a/spec/mspec/lib/mspec/runner/exception.rb b/spec/mspec/lib/mspec/runner/exception.rb index aea6610cd3..e07f02f684 100644 --- a/spec/mspec/lib/mspec/runner/exception.rb +++ b/spec/mspec/lib/mspec/runner/exception.rb @@ -40,6 +40,15 @@ class ExceptionState @backtrace_filter ||= MSpecScript.config[:backtrace_filter] || %r{(?:/bin/mspec|/lib/mspec/)} 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 diff --git a/spec/mspec/lib/mspec/runner/mspec.rb b/spec/mspec/lib/mspec/runner/mspec.rb index 0e2496d3d7..8331086196 100644 --- a/spec/mspec/lib/mspec/runner/mspec.rb +++ b/spec/mspec/lib/mspec/runner/mspec.rb @@ -155,7 +155,9 @@ module MSpec # Stores the shared ContextState keyed by description. 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 # Returns the shared ContextState matching description. diff --git a/spec/mspec/lib/mspec/utils/version.rb b/spec/mspec/lib/mspec/utils/version.rb index 787a76b053..9c1c58b8df 100644 --- a/spec/mspec/lib/mspec/utils/version.rb +++ b/spec/mspec/lib/mspec/utils/version.rb @@ -42,7 +42,7 @@ class SpecVersion def <=>(other) if other.respond_to? :to_int - other = Integer other + other = Integer(other.to_int) else other = SpecVersion.new(String(other)).to_i end |