minitest/test/minitest/metametameta.rb

137 lines
2.8 KiB
Ruby
Raw Normal View History

require "tempfile"
require "stringio"
require "minitest/autorun"
Oh god... here we go. Minitest 5: Deaths in the family: ! MiniTest.runner is dead. No more manager objects. ! MiniTest::Unit#record is dead. Use a Reporter instance instead. ! MiniTest::Unit._run_* is dead. Runnable things are responsible for their own runs. ! MiniTest::Unit.output is dead. No more centralized IO. Major (oft incompatible) changes: ! Renamed MiniTest to Minitest. Your pinkies will thank me. ! Removed MiniTest::Unit entirely. No more manager objects. ! Added Minitest::Runnable. Everything minitest can run subclasses this. ! Renamed MiniTest::Unit::TestCase to Minitest::Test (subclassing Runnable). ! Added Minitest::Benchmark. ! Your benchmarks need to move to their own subclass. ! Benchmarks using the spec DSL have to have "Bench" somewhere in their describe. ! MiniTest::Unit.after_tests moved to Minitest.after_tests ! MiniTest::Unit.autorun is now Minitest.autorun. Just require minitest/autorun pls. ! Removed ParallelEach#grep since it isn't used anywhere. Minor moves: + Moved Assertions module to minitest/assertions.rb + Moved Expectations module to minitest/expectations.rb + Moved Test to minitest/test.rb + Moved everything else in minitest/unit.rb to minitest.rb + minitest/unit.rb is now just a small (user-test only) compatibility layer. Additions: + Added a plugin system that can extend command-line options. + Added Minitest.extensions. + Added Minitest.reporter (only available during startup). + Added Minitest.run(args). This is the very top of any Minitest run. + Added Minitest::Reporter. Everything minitest can report goes through here. + Minitest.reporter is a composite so you can add your own. + Added Minitest::CompositeReporter. Much easier to extend with your own reporters. + Added UnexpectedError, an Assertion subclass, to wrap up errors. + Minitest::Test#run is now freakin' beautiful. 47 -> 17 loc Other: + Removed Object.infect_with_assertions (it was already dead code). + Runnables are responsible for knowing their result_code (eg "." or "F"). [git-p4: depot-paths = "//src/minitest/dev/": change = 8451]
2013-04-25 01:38:14 +00:00
class Minitest::Test
def clean s
s.gsub(/^ {6}/, "")
end
def with_empty_backtrace_filter
original = Minitest.backtrace_filter
obj = Minitest::BacktraceFilter.new
def obj.filter _bt
[]
end
Minitest::Test.io_lock.synchronize do # try not to trounce in parallel
begin
Minitest.backtrace_filter = obj
yield
ensure
Minitest.backtrace_filter = original
end
end
end
end
class FakeNamedTest < Minitest::Test
@@count = 0
def self.name
@fake_name ||= begin
@@count += 1
"FakeNamedTest%02d" % @@count
end
end
end
module MyModule; end
class AnError < StandardError; include MyModule; end
Oh god... here we go. Minitest 5: Deaths in the family: ! MiniTest.runner is dead. No more manager objects. ! MiniTest::Unit#record is dead. Use a Reporter instance instead. ! MiniTest::Unit._run_* is dead. Runnable things are responsible for their own runs. ! MiniTest::Unit.output is dead. No more centralized IO. Major (oft incompatible) changes: ! Renamed MiniTest to Minitest. Your pinkies will thank me. ! Removed MiniTest::Unit entirely. No more manager objects. ! Added Minitest::Runnable. Everything minitest can run subclasses this. ! Renamed MiniTest::Unit::TestCase to Minitest::Test (subclassing Runnable). ! Added Minitest::Benchmark. ! Your benchmarks need to move to their own subclass. ! Benchmarks using the spec DSL have to have "Bench" somewhere in their describe. ! MiniTest::Unit.after_tests moved to Minitest.after_tests ! MiniTest::Unit.autorun is now Minitest.autorun. Just require minitest/autorun pls. ! Removed ParallelEach#grep since it isn't used anywhere. Minor moves: + Moved Assertions module to minitest/assertions.rb + Moved Expectations module to minitest/expectations.rb + Moved Test to minitest/test.rb + Moved everything else in minitest/unit.rb to minitest.rb + minitest/unit.rb is now just a small (user-test only) compatibility layer. Additions: + Added a plugin system that can extend command-line options. + Added Minitest.extensions. + Added Minitest.reporter (only available during startup). + Added Minitest.run(args). This is the very top of any Minitest run. + Added Minitest::Reporter. Everything minitest can report goes through here. + Minitest.reporter is a composite so you can add your own. + Added Minitest::CompositeReporter. Much easier to extend with your own reporters. + Added UnexpectedError, an Assertion subclass, to wrap up errors. + Minitest::Test#run is now freakin' beautiful. 47 -> 17 loc Other: + Removed Object.infect_with_assertions (it was already dead code). + Runnables are responsible for knowing their result_code (eg "." or "F"). [git-p4: depot-paths = "//src/minitest/dev/": change = 8451]
2013-04-25 01:38:14 +00:00
class MetaMetaMetaTestCase < Minitest::Test
attr_accessor :reporter, :output, :tu
def with_stderr err
old = $stderr
$stderr = err
yield
ensure
$stderr = old
end
Oh god... here we go. Minitest 5: Deaths in the family: ! MiniTest.runner is dead. No more manager objects. ! MiniTest::Unit#record is dead. Use a Reporter instance instead. ! MiniTest::Unit._run_* is dead. Runnable things are responsible for their own runs. ! MiniTest::Unit.output is dead. No more centralized IO. Major (oft incompatible) changes: ! Renamed MiniTest to Minitest. Your pinkies will thank me. ! Removed MiniTest::Unit entirely. No more manager objects. ! Added Minitest::Runnable. Everything minitest can run subclasses this. ! Renamed MiniTest::Unit::TestCase to Minitest::Test (subclassing Runnable). ! Added Minitest::Benchmark. ! Your benchmarks need to move to their own subclass. ! Benchmarks using the spec DSL have to have "Bench" somewhere in their describe. ! MiniTest::Unit.after_tests moved to Minitest.after_tests ! MiniTest::Unit.autorun is now Minitest.autorun. Just require minitest/autorun pls. ! Removed ParallelEach#grep since it isn't used anywhere. Minor moves: + Moved Assertions module to minitest/assertions.rb + Moved Expectations module to minitest/expectations.rb + Moved Test to minitest/test.rb + Moved everything else in minitest/unit.rb to minitest.rb + minitest/unit.rb is now just a small (user-test only) compatibility layer. Additions: + Added a plugin system that can extend command-line options. + Added Minitest.extensions. + Added Minitest.reporter (only available during startup). + Added Minitest.run(args). This is the very top of any Minitest run. + Added Minitest::Reporter. Everything minitest can report goes through here. + Minitest.reporter is a composite so you can add your own. + Added Minitest::CompositeReporter. Much easier to extend with your own reporters. + Added UnexpectedError, an Assertion subclass, to wrap up errors. + Minitest::Test#run is now freakin' beautiful. 47 -> 17 loc Other: + Removed Object.infect_with_assertions (it was already dead code). + Runnables are responsible for knowing their result_code (eg "." or "F"). [git-p4: depot-paths = "//src/minitest/dev/": change = 8451]
2013-04-25 01:38:14 +00:00
def run_tu_with_fresh_reporter flags = %w[--seed 42]
options = Minitest.process_args flags
@output = StringIO.new("".encode('UTF-8'))
self.reporter = Minitest::CompositeReporter.new
reporter << Minitest::SummaryReporter.new(@output, options)
reporter << Minitest::ProgressReporter.new(@output, options)
with_stderr @output do
reporter.start
Oh god... here we go. Minitest 5: Deaths in the family: ! MiniTest.runner is dead. No more manager objects. ! MiniTest::Unit#record is dead. Use a Reporter instance instead. ! MiniTest::Unit._run_* is dead. Runnable things are responsible for their own runs. ! MiniTest::Unit.output is dead. No more centralized IO. Major (oft incompatible) changes: ! Renamed MiniTest to Minitest. Your pinkies will thank me. ! Removed MiniTest::Unit entirely. No more manager objects. ! Added Minitest::Runnable. Everything minitest can run subclasses this. ! Renamed MiniTest::Unit::TestCase to Minitest::Test (subclassing Runnable). ! Added Minitest::Benchmark. ! Your benchmarks need to move to their own subclass. ! Benchmarks using the spec DSL have to have "Bench" somewhere in their describe. ! MiniTest::Unit.after_tests moved to Minitest.after_tests ! MiniTest::Unit.autorun is now Minitest.autorun. Just require minitest/autorun pls. ! Removed ParallelEach#grep since it isn't used anywhere. Minor moves: + Moved Assertions module to minitest/assertions.rb + Moved Expectations module to minitest/expectations.rb + Moved Test to minitest/test.rb + Moved everything else in minitest/unit.rb to minitest.rb + minitest/unit.rb is now just a small (user-test only) compatibility layer. Additions: + Added a plugin system that can extend command-line options. + Added Minitest.extensions. + Added Minitest.reporter (only available during startup). + Added Minitest.run(args). This is the very top of any Minitest run. + Added Minitest::Reporter. Everything minitest can report goes through here. + Minitest.reporter is a composite so you can add your own. + Added Minitest::CompositeReporter. Much easier to extend with your own reporters. + Added UnexpectedError, an Assertion subclass, to wrap up errors. + Minitest::Test#run is now freakin' beautiful. 47 -> 17 loc Other: + Removed Object.infect_with_assertions (it was already dead code). + Runnables are responsible for knowing their result_code (eg "." or "F"). [git-p4: depot-paths = "//src/minitest/dev/": change = 8451]
2013-04-25 01:38:14 +00:00
yield(reporter) if block_given?
@tus ||= [@tu]
@tus.each do |tu|
Minitest::Runnable.runnables.delete tu
Oh god... here we go. Minitest 5: Deaths in the family: ! MiniTest.runner is dead. No more manager objects. ! MiniTest::Unit#record is dead. Use a Reporter instance instead. ! MiniTest::Unit._run_* is dead. Runnable things are responsible for their own runs. ! MiniTest::Unit.output is dead. No more centralized IO. Major (oft incompatible) changes: ! Renamed MiniTest to Minitest. Your pinkies will thank me. ! Removed MiniTest::Unit entirely. No more manager objects. ! Added Minitest::Runnable. Everything minitest can run subclasses this. ! Renamed MiniTest::Unit::TestCase to Minitest::Test (subclassing Runnable). ! Added Minitest::Benchmark. ! Your benchmarks need to move to their own subclass. ! Benchmarks using the spec DSL have to have "Bench" somewhere in their describe. ! MiniTest::Unit.after_tests moved to Minitest.after_tests ! MiniTest::Unit.autorun is now Minitest.autorun. Just require minitest/autorun pls. ! Removed ParallelEach#grep since it isn't used anywhere. Minor moves: + Moved Assertions module to minitest/assertions.rb + Moved Expectations module to minitest/expectations.rb + Moved Test to minitest/test.rb + Moved everything else in minitest/unit.rb to minitest.rb + minitest/unit.rb is now just a small (user-test only) compatibility layer. Additions: + Added a plugin system that can extend command-line options. + Added Minitest.extensions. + Added Minitest.reporter (only available during startup). + Added Minitest.run(args). This is the very top of any Minitest run. + Added Minitest::Reporter. Everything minitest can report goes through here. + Minitest.reporter is a composite so you can add your own. + Added Minitest::CompositeReporter. Much easier to extend with your own reporters. + Added UnexpectedError, an Assertion subclass, to wrap up errors. + Minitest::Test#run is now freakin' beautiful. 47 -> 17 loc Other: + Removed Object.infect_with_assertions (it was already dead code). + Runnables are responsible for knowing their result_code (eg "." or "F"). [git-p4: depot-paths = "//src/minitest/dev/": change = 8451]
2013-04-25 01:38:14 +00:00
tu.run reporter, options
end
Oh god... here we go. Minitest 5: Deaths in the family: ! MiniTest.runner is dead. No more manager objects. ! MiniTest::Unit#record is dead. Use a Reporter instance instead. ! MiniTest::Unit._run_* is dead. Runnable things are responsible for their own runs. ! MiniTest::Unit.output is dead. No more centralized IO. Major (oft incompatible) changes: ! Renamed MiniTest to Minitest. Your pinkies will thank me. ! Removed MiniTest::Unit entirely. No more manager objects. ! Added Minitest::Runnable. Everything minitest can run subclasses this. ! Renamed MiniTest::Unit::TestCase to Minitest::Test (subclassing Runnable). ! Added Minitest::Benchmark. ! Your benchmarks need to move to their own subclass. ! Benchmarks using the spec DSL have to have "Bench" somewhere in their describe. ! MiniTest::Unit.after_tests moved to Minitest.after_tests ! MiniTest::Unit.autorun is now Minitest.autorun. Just require minitest/autorun pls. ! Removed ParallelEach#grep since it isn't used anywhere. Minor moves: + Moved Assertions module to minitest/assertions.rb + Moved Expectations module to minitest/expectations.rb + Moved Test to minitest/test.rb + Moved everything else in minitest/unit.rb to minitest.rb + minitest/unit.rb is now just a small (user-test only) compatibility layer. Additions: + Added a plugin system that can extend command-line options. + Added Minitest.extensions. + Added Minitest.reporter (only available during startup). + Added Minitest.run(args). This is the very top of any Minitest run. + Added Minitest::Reporter. Everything minitest can report goes through here. + Minitest.reporter is a composite so you can add your own. + Added Minitest::CompositeReporter. Much easier to extend with your own reporters. + Added UnexpectedError, an Assertion subclass, to wrap up errors. + Minitest::Test#run is now freakin' beautiful. 47 -> 17 loc Other: + Removed Object.infect_with_assertions (it was already dead code). + Runnables are responsible for knowing their result_code (eg "." or "F"). [git-p4: depot-paths = "//src/minitest/dev/": change = 8451]
2013-04-25 01:38:14 +00:00
reporter.report
end
Oh god... here we go. Minitest 5: Deaths in the family: ! MiniTest.runner is dead. No more manager objects. ! MiniTest::Unit#record is dead. Use a Reporter instance instead. ! MiniTest::Unit._run_* is dead. Runnable things are responsible for their own runs. ! MiniTest::Unit.output is dead. No more centralized IO. Major (oft incompatible) changes: ! Renamed MiniTest to Minitest. Your pinkies will thank me. ! Removed MiniTest::Unit entirely. No more manager objects. ! Added Minitest::Runnable. Everything minitest can run subclasses this. ! Renamed MiniTest::Unit::TestCase to Minitest::Test (subclassing Runnable). ! Added Minitest::Benchmark. ! Your benchmarks need to move to their own subclass. ! Benchmarks using the spec DSL have to have "Bench" somewhere in their describe. ! MiniTest::Unit.after_tests moved to Minitest.after_tests ! MiniTest::Unit.autorun is now Minitest.autorun. Just require minitest/autorun pls. ! Removed ParallelEach#grep since it isn't used anywhere. Minor moves: + Moved Assertions module to minitest/assertions.rb + Moved Expectations module to minitest/expectations.rb + Moved Test to minitest/test.rb + Moved everything else in minitest/unit.rb to minitest.rb + minitest/unit.rb is now just a small (user-test only) compatibility layer. Additions: + Added a plugin system that can extend command-line options. + Added Minitest.extensions. + Added Minitest.reporter (only available during startup). + Added Minitest.run(args). This is the very top of any Minitest run. + Added Minitest::Reporter. Everything minitest can report goes through here. + Minitest.reporter is a composite so you can add your own. + Added Minitest::CompositeReporter. Much easier to extend with your own reporters. + Added UnexpectedError, an Assertion subclass, to wrap up errors. + Minitest::Test#run is now freakin' beautiful. 47 -> 17 loc Other: + Removed Object.infect_with_assertions (it was already dead code). + Runnables are responsible for knowing their result_code (eg "." or "F"). [git-p4: depot-paths = "//src/minitest/dev/": change = 8451]
2013-04-25 01:38:14 +00:00
end
def first_reporter
reporter.reporters.first
end
def assert_report expected, flags = %w[--seed 42], &block
header = clean <<-EOM
Run options: #{flags.map { |s| s =~ /\|/ ? s.inspect : s }.join " "}
Oh god... here we go. Minitest 5: Deaths in the family: ! MiniTest.runner is dead. No more manager objects. ! MiniTest::Unit#record is dead. Use a Reporter instance instead. ! MiniTest::Unit._run_* is dead. Runnable things are responsible for their own runs. ! MiniTest::Unit.output is dead. No more centralized IO. Major (oft incompatible) changes: ! Renamed MiniTest to Minitest. Your pinkies will thank me. ! Removed MiniTest::Unit entirely. No more manager objects. ! Added Minitest::Runnable. Everything minitest can run subclasses this. ! Renamed MiniTest::Unit::TestCase to Minitest::Test (subclassing Runnable). ! Added Minitest::Benchmark. ! Your benchmarks need to move to their own subclass. ! Benchmarks using the spec DSL have to have "Bench" somewhere in their describe. ! MiniTest::Unit.after_tests moved to Minitest.after_tests ! MiniTest::Unit.autorun is now Minitest.autorun. Just require minitest/autorun pls. ! Removed ParallelEach#grep since it isn't used anywhere. Minor moves: + Moved Assertions module to minitest/assertions.rb + Moved Expectations module to minitest/expectations.rb + Moved Test to minitest/test.rb + Moved everything else in minitest/unit.rb to minitest.rb + minitest/unit.rb is now just a small (user-test only) compatibility layer. Additions: + Added a plugin system that can extend command-line options. + Added Minitest.extensions. + Added Minitest.reporter (only available during startup). + Added Minitest.run(args). This is the very top of any Minitest run. + Added Minitest::Reporter. Everything minitest can report goes through here. + Minitest.reporter is a composite so you can add your own. + Added Minitest::CompositeReporter. Much easier to extend with your own reporters. + Added UnexpectedError, an Assertion subclass, to wrap up errors. + Minitest::Test#run is now freakin' beautiful. 47 -> 17 loc Other: + Removed Object.infect_with_assertions (it was already dead code). + Runnables are responsible for knowing their result_code (eg "." or "F"). [git-p4: depot-paths = "//src/minitest/dev/": change = 8451]
2013-04-25 01:38:14 +00:00
# Running:
EOM
run_tu_with_fresh_reporter flags, &block
Oh god... here we go. Minitest 5: Deaths in the family: ! MiniTest.runner is dead. No more manager objects. ! MiniTest::Unit#record is dead. Use a Reporter instance instead. ! MiniTest::Unit._run_* is dead. Runnable things are responsible for their own runs. ! MiniTest::Unit.output is dead. No more centralized IO. Major (oft incompatible) changes: ! Renamed MiniTest to Minitest. Your pinkies will thank me. ! Removed MiniTest::Unit entirely. No more manager objects. ! Added Minitest::Runnable. Everything minitest can run subclasses this. ! Renamed MiniTest::Unit::TestCase to Minitest::Test (subclassing Runnable). ! Added Minitest::Benchmark. ! Your benchmarks need to move to their own subclass. ! Benchmarks using the spec DSL have to have "Bench" somewhere in their describe. ! MiniTest::Unit.after_tests moved to Minitest.after_tests ! MiniTest::Unit.autorun is now Minitest.autorun. Just require minitest/autorun pls. ! Removed ParallelEach#grep since it isn't used anywhere. Minor moves: + Moved Assertions module to minitest/assertions.rb + Moved Expectations module to minitest/expectations.rb + Moved Test to minitest/test.rb + Moved everything else in minitest/unit.rb to minitest.rb + minitest/unit.rb is now just a small (user-test only) compatibility layer. Additions: + Added a plugin system that can extend command-line options. + Added Minitest.extensions. + Added Minitest.reporter (only available during startup). + Added Minitest.run(args). This is the very top of any Minitest run. + Added Minitest::Reporter. Everything minitest can report goes through here. + Minitest.reporter is a composite so you can add your own. + Added Minitest::CompositeReporter. Much easier to extend with your own reporters. + Added UnexpectedError, an Assertion subclass, to wrap up errors. + Minitest::Test#run is now freakin' beautiful. 47 -> 17 loc Other: + Removed Object.infect_with_assertions (it was already dead code). + Runnables are responsible for knowing their result_code (eg "." or "F"). [git-p4: depot-paths = "//src/minitest/dev/": change = 8451]
2013-04-25 01:38:14 +00:00
output = normalize_output @output.string.dup
assert_equal header + expected, output
end
Oh god... here we go. Minitest 5: Deaths in the family: ! MiniTest.runner is dead. No more manager objects. ! MiniTest::Unit#record is dead. Use a Reporter instance instead. ! MiniTest::Unit._run_* is dead. Runnable things are responsible for their own runs. ! MiniTest::Unit.output is dead. No more centralized IO. Major (oft incompatible) changes: ! Renamed MiniTest to Minitest. Your pinkies will thank me. ! Removed MiniTest::Unit entirely. No more manager objects. ! Added Minitest::Runnable. Everything minitest can run subclasses this. ! Renamed MiniTest::Unit::TestCase to Minitest::Test (subclassing Runnable). ! Added Minitest::Benchmark. ! Your benchmarks need to move to their own subclass. ! Benchmarks using the spec DSL have to have "Bench" somewhere in their describe. ! MiniTest::Unit.after_tests moved to Minitest.after_tests ! MiniTest::Unit.autorun is now Minitest.autorun. Just require minitest/autorun pls. ! Removed ParallelEach#grep since it isn't used anywhere. Minor moves: + Moved Assertions module to minitest/assertions.rb + Moved Expectations module to minitest/expectations.rb + Moved Test to minitest/test.rb + Moved everything else in minitest/unit.rb to minitest.rb + minitest/unit.rb is now just a small (user-test only) compatibility layer. Additions: + Added a plugin system that can extend command-line options. + Added Minitest.extensions. + Added Minitest.reporter (only available during startup). + Added Minitest.run(args). This is the very top of any Minitest run. + Added Minitest::Reporter. Everything minitest can report goes through here. + Minitest.reporter is a composite so you can add your own. + Added Minitest::CompositeReporter. Much easier to extend with your own reporters. + Added UnexpectedError, an Assertion subclass, to wrap up errors. + Minitest::Test#run is now freakin' beautiful. 47 -> 17 loc Other: + Removed Object.infect_with_assertions (it was already dead code). + Runnables are responsible for knowing their result_code (eg "." or "F"). [git-p4: depot-paths = "//src/minitest/dev/": change = 8451]
2013-04-25 01:38:14 +00:00
def normalize_output output
output.sub!(/Finished in .*/, "Finished in 0.00")
output.sub!(/Loaded suite .*/, "Loaded suite blah")
output.gsub!(/FakeNamedTest\d+/, "FakeNamedTestXX")
output.gsub!(/ = \d+.\d\d s = /, " = 0.00 s = ")
output.gsub!(/0x[A-Fa-f0-9]+/, "0xXXX")
output.gsub!(/ +$/, "")
if windows? then
output.gsub!(/\[(?:[A-Za-z]:)?[^\]:]+:\d+\]/, "[FILE:LINE]")
output.gsub!(/^(\s+)(?:[A-Za-z]:)?[^:]+:\d+:in/, '\1FILE:LINE:in')
else
output.gsub!(/\[[^\]:]+:\d+\]/, "[FILE:LINE]")
output.gsub!(/^(\s+)[^:]+:\d+:in/, '\1FILE:LINE:in')
end
output.gsub!(/( at )[^:]+:\d+/, '\1[FILE:LINE]')
Oh god... here we go. Minitest 5: Deaths in the family: ! MiniTest.runner is dead. No more manager objects. ! MiniTest::Unit#record is dead. Use a Reporter instance instead. ! MiniTest::Unit._run_* is dead. Runnable things are responsible for their own runs. ! MiniTest::Unit.output is dead. No more centralized IO. Major (oft incompatible) changes: ! Renamed MiniTest to Minitest. Your pinkies will thank me. ! Removed MiniTest::Unit entirely. No more manager objects. ! Added Minitest::Runnable. Everything minitest can run subclasses this. ! Renamed MiniTest::Unit::TestCase to Minitest::Test (subclassing Runnable). ! Added Minitest::Benchmark. ! Your benchmarks need to move to their own subclass. ! Benchmarks using the spec DSL have to have "Bench" somewhere in their describe. ! MiniTest::Unit.after_tests moved to Minitest.after_tests ! MiniTest::Unit.autorun is now Minitest.autorun. Just require minitest/autorun pls. ! Removed ParallelEach#grep since it isn't used anywhere. Minor moves: + Moved Assertions module to minitest/assertions.rb + Moved Expectations module to minitest/expectations.rb + Moved Test to minitest/test.rb + Moved everything else in minitest/unit.rb to minitest.rb + minitest/unit.rb is now just a small (user-test only) compatibility layer. Additions: + Added a plugin system that can extend command-line options. + Added Minitest.extensions. + Added Minitest.reporter (only available during startup). + Added Minitest.run(args). This is the very top of any Minitest run. + Added Minitest::Reporter. Everything minitest can report goes through here. + Minitest.reporter is a composite so you can add your own. + Added Minitest::CompositeReporter. Much easier to extend with your own reporters. + Added UnexpectedError, an Assertion subclass, to wrap up errors. + Minitest::Test#run is now freakin' beautiful. 47 -> 17 loc Other: + Removed Object.infect_with_assertions (it was already dead code). + Runnables are responsible for knowing their result_code (eg "." or "F"). [git-p4: depot-paths = "//src/minitest/dev/": change = 8451]
2013-04-25 01:38:14 +00:00
output
end
def restore_env
old_value = ENV["MT_NO_SKIP_MSG"]
ENV.delete "MT_NO_SKIP_MSG"
yield
ensure
ENV["MT_NO_SKIP_MSG"] = old_value
end
def setup
super
Minitest.seed = 42
Oh god... here we go. Minitest 5: Deaths in the family: ! MiniTest.runner is dead. No more manager objects. ! MiniTest::Unit#record is dead. Use a Reporter instance instead. ! MiniTest::Unit._run_* is dead. Runnable things are responsible for their own runs. ! MiniTest::Unit.output is dead. No more centralized IO. Major (oft incompatible) changes: ! Renamed MiniTest to Minitest. Your pinkies will thank me. ! Removed MiniTest::Unit entirely. No more manager objects. ! Added Minitest::Runnable. Everything minitest can run subclasses this. ! Renamed MiniTest::Unit::TestCase to Minitest::Test (subclassing Runnable). ! Added Minitest::Benchmark. ! Your benchmarks need to move to their own subclass. ! Benchmarks using the spec DSL have to have "Bench" somewhere in their describe. ! MiniTest::Unit.after_tests moved to Minitest.after_tests ! MiniTest::Unit.autorun is now Minitest.autorun. Just require minitest/autorun pls. ! Removed ParallelEach#grep since it isn't used anywhere. Minor moves: + Moved Assertions module to minitest/assertions.rb + Moved Expectations module to minitest/expectations.rb + Moved Test to minitest/test.rb + Moved everything else in minitest/unit.rb to minitest.rb + minitest/unit.rb is now just a small (user-test only) compatibility layer. Additions: + Added a plugin system that can extend command-line options. + Added Minitest.extensions. + Added Minitest.reporter (only available during startup). + Added Minitest.run(args). This is the very top of any Minitest run. + Added Minitest::Reporter. Everything minitest can report goes through here. + Minitest.reporter is a composite so you can add your own. + Added Minitest::CompositeReporter. Much easier to extend with your own reporters. + Added UnexpectedError, an Assertion subclass, to wrap up errors. + Minitest::Test#run is now freakin' beautiful. 47 -> 17 loc Other: + Removed Object.infect_with_assertions (it was already dead code). + Runnables are responsible for knowing their result_code (eg "." or "F"). [git-p4: depot-paths = "//src/minitest/dev/": change = 8451]
2013-04-25 01:38:14 +00:00
Minitest::Test.reset
@tu = nil
end
end