Skip to content

Commit 9b3b9b6

Browse files
committed
New upstream version 3.0.0
1 parent 0975bb6 commit 9b3b9b6

File tree

5,128 files changed

+413017
-190377
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,128 files changed

+413017
-190377
lines changed

.bundle/gems/minitest-5.14.2/History.rdoc

Lines changed: 1397 additions & 0 deletions
Large diffs are not rendered by default.

.bundle/gems/minitest-5.14.2/README.rdoc

Lines changed: 764 additions & 0 deletions
Large diffs are not rendered by default.

.bundle/gems/minitest-5.14.2/Rakefile

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# -*- ruby -*-
2+
3+
require "rubygems"
4+
require "hoe"
5+
6+
Hoe.plugin :seattlerb
7+
Hoe.plugin :rdoc
8+
9+
Hoe.spec "minitest" do
10+
developer "Ryan Davis", "[email protected]"
11+
12+
license "MIT"
13+
14+
require_ruby_version [">= 2.2", "< 3.1"]
15+
end
16+
17+
desc "Find missing expectations"
18+
task :specs do
19+
$:.unshift "lib"
20+
require "minitest/test"
21+
require "minitest/spec"
22+
23+
pos_prefix, neg_prefix = "must", "wont"
24+
skip_re = /^(must|wont)$|wont_(throw)|must_(block|not?_|nothing|send|raise$)/x
25+
dont_flip_re = /(must|wont)_(include|respond_to)/
26+
27+
map = {
28+
/(must_throw)s/ => '\1',
29+
/(?!not)_same/ => "_be_same_as",
30+
/_in_/ => "_be_within_",
31+
/_operator/ => "_be",
32+
/_includes/ => "_include",
33+
/(must|wont)_(.*_of|nil|silent|empty)/ => '\1_be_\2',
34+
/must_raises/ => "must_raise",
35+
/(must|wont)_predicate/ => '\1_be',
36+
/(must|wont)_path_exists/ => 'path_\1_exist',
37+
}
38+
39+
expectations = Minitest::Expectations.public_instance_methods.map(&:to_s)
40+
assertions = Minitest::Assertions.public_instance_methods.map(&:to_s)
41+
42+
assertions.sort.each do |assertion|
43+
expectation = case assertion
44+
when /^assert/ then
45+
assertion.sub(/^assert/, pos_prefix.to_s)
46+
when /^refute/ then
47+
assertion.sub(/^refute/, neg_prefix.to_s)
48+
end
49+
50+
next unless expectation
51+
next if expectation =~ skip_re
52+
53+
regexp, replacement = map.find { |re, _| expectation =~ re }
54+
expectation.sub! regexp, replacement if replacement
55+
56+
next if expectations.include? expectation
57+
58+
args = [assertion, expectation].map(&:to_sym).map(&:inspect)
59+
args << :reverse if expectation =~ dont_flip_re
60+
61+
puts
62+
puts "##"
63+
puts "# :method: #{expectation}"
64+
puts "# See Minitest::Assertions##{assertion}"
65+
puts
66+
puts "infect_an_assertion #{args.join ", "}"
67+
end
68+
end
69+
70+
task :bugs do
71+
sh "for f in bug*.rb ; do echo $f; echo; #{Gem.ruby} -Ilib $f && rm $f ; done"
72+
end
73+
74+
# vim: syntax=Ruby

gems/minitest-5.13.0/lib/minitest.rb renamed to .bundle/gems/minitest-5.14.2/lib/minitest.rb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# :include: README.rdoc
99

1010
module Minitest
11-
VERSION = "5.13.0" # :nodoc:
11+
VERSION = "5.14.2" # :nodoc:
1212
ENCS = "".respond_to? :encoding # :nodoc:
1313

1414
@@installed_at_exit ||= false
@@ -238,7 +238,9 @@ def self.process_args args = [] # :nodoc:
238238
end
239239

240240
def self.filter_backtrace bt # :nodoc:
241-
backtrace_filter.filter bt
241+
result = backtrace_filter.filter bt
242+
result = bt.dup if result.empty?
243+
result
242244
end
243245

244246
##
@@ -907,24 +909,21 @@ def result_label # :nodoc:
907909
# Assertion wrapping an unexpected error that was raised during a run.
908910

909911
class UnexpectedError < Assertion
910-
attr_accessor :exception # :nodoc:
912+
# TODO: figure out how to use `cause` instead
913+
attr_accessor :error # :nodoc:
911914

912-
def initialize exception # :nodoc:
915+
def initialize error # :nodoc:
913916
super "Unexpected exception"
914-
self.exception = exception
917+
self.error = error
915918
end
916919

917920
def backtrace # :nodoc:
918-
self.exception.backtrace
919-
end
920-
921-
def error # :nodoc:
922-
self.exception
921+
self.error.backtrace
923922
end
924923

925924
def message # :nodoc:
926925
bt = Minitest.filter_backtrace(self.backtrace).join "\n "
927-
"#{self.exception.class}: #{self.exception.message}\n #{bt}"
926+
"#{self.error.class}: #{self.error.message}\n #{bt}"
928927
end
929928

930929
def result_label # :nodoc:
@@ -1008,12 +1007,13 @@ class BacktraceFilter
10081007
MT_RE = %r%lib/minitest% #:nodoc:
10091008

10101009
##
1011-
# Filter +bt+ to something useful. Returns the whole thing if $DEBUG.
1010+
# Filter +bt+ to something useful. Returns the whole thing if
1011+
# $DEBUG (ruby) or $MT_DEBUG (env).
10121012

10131013
def filter bt
10141014
return ["No backtrace"] unless bt
10151015

1016-
return bt.dup if $DEBUG
1016+
return bt.dup if $DEBUG || ENV["MT_DEBUG"]
10171017

10181018
new_bt = bt.take_while { |line| line !~ MT_RE }
10191019
new_bt = bt.select { |line| line !~ MT_RE } if new_bt.empty?

0 commit comments

Comments
 (0)