pax_global_header00006660000000000000000000000064147141674250014525gustar00rootroot0000000000000052 comment=fab6bc8841607a4327342830bdfd100b86326373 maxitest-5.8.0/000077500000000000000000000000001471416742500133755ustar00rootroot00000000000000maxitest-5.8.0/.github/000077500000000000000000000000001471416742500147355ustar00rootroot00000000000000maxitest-5.8.0/.github/PULL_REQUEST_TEMPLATE.md000066400000000000000000000003131471416742500205330ustar00rootroot00000000000000Thank you for your contribution! ## Checklist - [ ] Added tests - [ ] Updated README.md (if user facing behavior changed) - [ ] Added CHANGELOG.md entry under `# NEXT` (if user facing behavior changed) maxitest-5.8.0/.github/workflows/000077500000000000000000000000001471416742500167725ustar00rootroot00000000000000maxitest-5.8.0/.github/workflows/actions.yml000066400000000000000000000017161471416742500211620ustar00rootroot00000000000000name: CI on: push: branches: [master] pull_request: branches: [master] jobs: test: runs-on: ubuntu-latest strategy: fail-fast: false matrix: ruby: [ '3.0', '3.1', '3.2', '3.3' ] gemfile: [ '514', '515', '516', '517', '518', '519', '520', '523', '524', '525'] exclude: - ruby: '3.3' gemfile: '514' - ruby: '3.3' gemfile: '515' - ruby: '3.3' gemfile: '516' - ruby: '3.3' gemfile: '517' - ruby: '3.3' gemfile: '518' - ruby: '3.3' gemfile: '519' env: BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile steps: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true # runs 'bundle install' and caches installed gems automatically - run: bundle exec rake maxitest-5.8.0/.gitignore000066400000000000000000000000431471416742500153620ustar00rootroot00000000000000.ruby-version .tool-versions .idea maxitest-5.8.0/CHANGELOG.md000066400000000000000000000012141471416742500152040ustar00rootroot00000000000000# Next # v5.7.1 - support disabling interrupt handling to avoid minitest-reporters bug with MAXITEST_NO_INTERRUPT=true # v5.7.0 - support minitest 5.25 # v5.6.0 - support minitest 5.24 # v5.5.0 - support minitest 5.23 # v5.4.0 - support minitest 5.20 # v5.3.1 - remove MiniTest usage to make Zeitwerk happy # v5.3.0 - `pending "broken", if: ENV["CI"] do` - `with_env` - `capture_stderr` + `capture_stdout` - hide maxitest backtraces by default # v5.2.0 - support minitest 5.19 # v5.1.0 - support `before :all` - block invalid `after :all` and `around :all` # v5.0.0 - add minitest 5.14 support - drop EOL rubies (<=2.7) and minitest versions maxitest-5.8.0/Gemfile000066400000000000000000000000761471416742500146730ustar00rootroot00000000000000source "https://rubygems.org" gemspec gem "debug" gem "bump" maxitest-5.8.0/Gemfile.lock000066400000000000000000000017441471416742500156250ustar00rootroot00000000000000PATH remote: . specs: maxitest (5.8.0) minitest (>= 5.14.0, < 5.26.0) GEM remote: https://rubygems.org/ specs: bump (0.10.0) debug (1.9.2) irb (~> 1.10) reline (>= 0.3.8) diff-lcs (1.5.1) io-console (0.7.2) irb (1.13.1) rdoc (>= 4.0.0) reline (>= 0.4.2) minitest (5.22.3) psych (5.1.2) stringio rake (13.2.1) rdoc (6.7.0) psych (>= 4.0.0) reline (0.5.7) io-console (~> 0.5) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) rspec-core (3.13.0) rspec-support (~> 3.13.0) rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.1) stringio (3.1.0) PLATFORMS arm64-darwin-23 ruby DEPENDENCIES bump debug maxitest! rake rspec BUNDLED WITH 2.5.7 maxitest-5.8.0/MIT-LICENSE000066400000000000000000000020701471416742500150300ustar00rootroot00000000000000Copyright (C) 2013 Michael Grosser Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. maxitest-5.8.0/README.md000066400000000000000000000070451471416742500146620ustar00rootroot00000000000000Minitest + all the features you always wanted. [![CI](https://github.com/grosser/maxitest/actions/workflows/actions.yml/badge.svg?branch=master)](https://github.com/grosser/maxitest/actions/workflows/actions.yml?query=branch%3Amaster) [![Gem Version](https://badge.fury.io/rb/maxitest.svg)](https://badge.fury.io/rb/maxitest) ![Failure](assets/failure.png?raw=true) Features ======== - **Ctrl+c** stops tests and prints failures - **pastable rerun snippet** for failures (disabled/integrated on rails 5) - multiple before & after blocks - `before :all` blocks - **around** blocks `around { |t| Dir.chdir(...) { t.call } }` - **red-green** output (disabled/integrated on rails 5) - `mtest` executable to **run by line number** and by folder (disabled/integrated on rails 5) - full backtrace for errors and assertions with verbose (`-v`) - `let!` - `let_all` execute once for all tests in a class and it's subclasses - `order_dependent!` to make your tests run in given order - `Maxitest.static_class_order = true` no longer sort tests class/sub-classes in random order - `context` for more expression - `pending { assert false }` is skip when it fails, but fails when it passes - implicit subject via `require 'maxitest/implicit_subject'` - `xit` to skip test (also does not call setup or teardown) - `with_env` to change environment variables during test run - `capture_stdout` and `capture_stderr` to capture stdout or stderr but not both (like `capture_io` does) - `require 'maxitest/timeout'` to make hanging tests fail after `Maxitest.timeout` seconds - `require 'maxitest/threads'` fail tests that leave extra threads running - `require 'maxitest/global_must'` (before autorun) disable deprecation on global `must_*` or [global_expectations](https://github.com/jeremyevans/minitest-global_expectations) gem Install ======= ```Bash gem install maxitest ``` Usage ===== ```Ruby require "maxitest/autorun" # ... normal minitest tests ... describe MyClass do describe "#my_method" do it "passes" do _(MyClass.new.my_method).must_equal 1 end end end ``` ### pending - `pending "need to fix" do` to show why something is pending - `pending "need to fix", if: ENV["CI"] do` to only skip on CI (if something is supposed to work locally) ### with_env Use during test: `with_env FOO: "bar do ...` Use as `around` block: `with_env FOO: "bar"` ### context Use as alias for `describe` ```ruby describe "#my_method" do context "with bad state" do before { errors += 1 } it "fails" # ... end end ``` ### capture_stdout / capture_stderr ```ruby output = capture_stdout { puts 1 } _(output).must_equal "1\n" ``` ### minitest-reporters If [PR](https://github.com/minitest-reporters/minitest-reporters/pull/357) is not resolved, disable Interrupt handling with `ENV["MAXITEST_NO_INTERRUPT"] = "true"` to avoid "stack level too deep" errors. Development =========== - everything vendored into 1 gem to avoid dependency madness - tested via rspec to avoid messing up our own tests by accident - fixes should go back to the original libraries - restrictive minitest dependency so nothing breaks by accident - ruby >=3.0 - `rake bundle` to update all vendored gems Author ====== - running by line number from [minitest-line](https://github.com/judofyr/minitest-line) - around from [minitest-around](https://github.com/splattael/minitest-around) - mtest from [testrbl](https://github.com/grosser/testrbl) - red-green from [minitest-rg](https://github.com/blowmage/minitest-rg) [Michael Grosser](http://grosser.it)
michael@grosser.it
License: MIT maxitest-5.8.0/Rakefile000066400000000000000000000070601471416742500150450ustar00rootroot00000000000000require "bundler/setup" require "bundler/gem_tasks" require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec) begin require "bump/tasks" Bump.replace_in_default = Dir["gemfiles/**.lock"] rescue LoadError # not available in gemfiles/ end module VendorUpdate class << self def all require "open-uri" Dir["lib/maxitest/vendor/*"].each { |f| update_file f } end private def update_file(file) # a file has multiple parts, and each part starts with the url where it was copied from do_not_modify = "generated by rake update, do not modify" start = "# BEGIN #{do_not_modify}\n" finish = "# END #{do_not_modify}\n" urls = File.read(file).scan(/#{Regexp.escape start}# (\S+)\n.*?#{Regexp.escape(finish)}/m).flatten(1) urls.map! do |url| code = URI.open(url).read code = modify_code code, url "#{start}# #{url}\n#{code}\n#{finish}" end File.write(file, urls.reject(&:empty?).join("\n")) end def modify_code(code, url) code = code.dup code.gsub!(/require .*?\n/, "") # we inline everything code.strip! code = "=begin\n#{code}\n=end" if url.include?("LICENSE") if url.end_with?("/testrbl.rb") # nest under Maxitest to avoid collision, more modifications are done in bin/mtest code = "module Maxitest\n#{code.gsub(/^/, " ").gsub(/^\s+$/, "")}\nend" elsif url.end_with?("/line_plugin.rb") # add rails detector raise unless code.sub!(%{pwd = Pathname.new(Dir.pwd)}, %{pwd = Pathname.new(Dir.pwd)\n bin_rails = File.exist?("bin/rails")}) # replace ruby with `mtest` or `bin/rails test` # to work around https://github.com/minitest/minitest-rails/issues/256 raise unless code.sub!(%{output = "ruby \#{file} -l \#{line}"}, %{output = "\#{bin_rails ? "bin/rails test" : "mtest"} \#{file}:\#{line}"}) elsif url.end_with?('/around/spec.rb') # do not fail with resume for nil class when before was never called # for example when putting <% raise %> into a fixture file raise unless code.sub!(%{fib.resume unless fib == :failed}, %{fib.resume if fib && fib != :failed}) # make `after :all` blow up to avoid confusion raise unless code.sub!(%{fib = nil}, %{raise ArgumentError, "only :each or no argument is supported" if args != [] && args != [:each]\n fib = nil}) elsif url.end_with?('/rg_plugin.rb') # support disabling/enabling colors # https://github.com/blowmage/minitest-rg/pull/15 raise unless code.sub!( %(opts.on "--rg", "Add red/green to test output." do\n RG.rg!), %(opts.on "--[no-]rg", "Add red/green to test output." do |bool|\n RG.rg! bool), ) raise unless code.sub!( %( def self.rg!\n @rg = true), %( def self.rg!(bool = true)\n @rg = bool), ) raise unless code.sub!( "reporter.reporters.grep(Minitest::Reporter).each do |rep|\n rep.io = io if rep.io.tty?", "reporter.reporters.grep(Minitest::Reporter).each do |rep|\n rep.io = io" ) raise unless code.sub!( "MiniTest", "Minitest", ) end code end end end desc "Run all tests" task default: :spec desc "Update all dependencies" task :update do VendorUpdate.all end desc "bundle all gemfiles/ EXTRA=" task :bundle do extra = ENV["EXTRA"] Bundler.with_original_env do Dir["gemfiles/*.gemfile"].reverse.each { |gemfile| sh "BUNDLE_GEMFILE=#{gemfile} bundle #{extra}" } end end maxitest-5.8.0/assets/000077500000000000000000000000001471416742500146775ustar00rootroot00000000000000maxitest-5.8.0/assets/failure.png000066400000000000000000001253761471416742500170520ustar00rootroot00000000000000PNG  IHDR DiCCPICC ProfileH WwXSH! #({ނLBHA=J+X*XZEq[GQR*s>}~yι}w~=s4y@XŸg&`} c?˛N4mHţLQ0H@^ @kE w!+GHl%#96I to5@ !_"F~8"e" %q!<2?š]d >a< 5¤Eyʛg@RsԲ$tEyۘ;-,2!) n(;E(CH1T&a!="-N)i CYxj~ ?l8Z+EቈG,iD4]J%I#xc4e<[r) +PW f+we# /BH韰 2@{$) h,+#KL˒e_ZH'Q)΋x $ƞ.'Q<q#G0H38 B(f4i[OC!4ĨF*{dMRdȦhx\W %4u,eorD.1NZ*/himH?^"*](W)<:QdЭ!mj2GvG" &QlUeR%(8s8C*2UQ7?|鑂YӒ8H!N#DD#q8J!d?-A\Te\Qu71_,QN+)fKheQ#.ԚN)jw W Sj9SVKÏop/'eB^2hGR[h/LPL ~0 ` ʺ0@T X` l]#8'4\p Ϡ@?a q1C 1W ±X,K2lL)"6`[Z'0v;cX78 Mp|41x> R|1 _{z~w> GN7JD!'DQC%лJt={NrI>gL Br.@"V*%?4c#͗MH˦MѪh;hhзI{Cyt[69YM}fz;`28Q(cgag\at2ީiEUV;vEZzH}rM;L[?3\\<ż|a1AC1_c~4޳tXP$̺zfmAtv1{}}DsDyjN= 繦fR*̓4{ԵlBZskjhik/ޭ}NKc#YM#.rESN]nnnmz:zz)z3u /[;o/_W[Abr} > s W63"&M7ltʨg#7v0N0eqIIz&=< զL͸ffRf͞<:~+<\aռͼ"b>{LKo,Ֆ-VfVf[Yfnm-^k}M76 6]Ѷuwvvv5v/;jKqcHH5#o:J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X7pśZq"IENDB`maxitest-5.8.0/bin/000077500000000000000000000000001471416742500141455ustar00rootroot00000000000000maxitest-5.8.0/bin/mtest000077500000000000000000000014321471416742500152270ustar00rootroot00000000000000#!/usr/bin/env ruby # parse raw -v but not verbose if ARGV == ["-v"] || ARGV == ["--version"] puts Maxitest::VERSION exit 0 end # parse raw -h if ARGV == ["-h"] || ARGV == ["--help"] puts <<~EOF test given file, folder or file:line Usage: mtest foo_test.rb -v to run without bracktrace cleaner --changed to run all all tests in current `git diff` or `git show` EOF exit 0 end # send rest to testrbl to get --changed support, but do not guess at lines but just convert number to -l # so minitest-line picks it up require 'optparse' $LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib') require 'maxitest/vendor/testrbl' class << Maxitest::Testrbl def line_pattern_option(file, line) [file, "-l", line] end end Maxitest::Testrbl.run_from_cli(ARGV) maxitest-5.8.0/gemfiles/000077500000000000000000000000001471416742500151705ustar00rootroot00000000000000maxitest-5.8.0/gemfiles/514.gemfile000066400000000000000000000001161471416742500170310ustar00rootroot00000000000000source "https://rubygems.org" gemspec path: "../" gem "minitest", "~> 5.14.0" maxitest-5.8.0/gemfiles/514.gemfile.lock000066400000000000000000000012741471416742500177660ustar00rootroot00000000000000PATH remote: .. specs: maxitest (5.8.0) minitest (>= 5.14.0, < 5.26.0) GEM remote: https://rubygems.org/ specs: diff-lcs (1.5.1) minitest (5.14.4) rake (13.2.1) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) rspec-core (3.13.0) rspec-support (~> 3.13.0) rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.1) PLATFORMS arm64-darwin-23 ruby DEPENDENCIES maxitest! minitest (~> 5.14.0) rake rspec BUNDLED WITH 2.5.7 maxitest-5.8.0/gemfiles/515.gemfile000066400000000000000000000001161471416742500170320ustar00rootroot00000000000000source "https://rubygems.org" gemspec path: "../" gem "minitest", "~> 5.15.0" maxitest-5.8.0/gemfiles/515.gemfile.lock000066400000000000000000000012741471416742500177670ustar00rootroot00000000000000PATH remote: .. specs: maxitest (5.8.0) minitest (>= 5.14.0, < 5.26.0) GEM remote: https://rubygems.org/ specs: diff-lcs (1.5.1) minitest (5.15.0) rake (13.2.1) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) rspec-core (3.13.0) rspec-support (~> 3.13.0) rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.1) PLATFORMS arm64-darwin-23 ruby DEPENDENCIES maxitest! minitest (~> 5.15.0) rake rspec BUNDLED WITH 2.5.7 maxitest-5.8.0/gemfiles/516.gemfile000066400000000000000000000001161471416742500170330ustar00rootroot00000000000000source "https://rubygems.org" gemspec path: "../" gem "minitest", "~> 5.16.0" maxitest-5.8.0/gemfiles/516.gemfile.lock000066400000000000000000000012741471416742500177700ustar00rootroot00000000000000PATH remote: .. specs: maxitest (5.8.0) minitest (>= 5.14.0, < 5.26.0) GEM remote: https://rubygems.org/ specs: diff-lcs (1.5.1) minitest (5.16.3) rake (13.2.1) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) rspec-core (3.13.0) rspec-support (~> 3.13.0) rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.1) PLATFORMS arm64-darwin-23 ruby DEPENDENCIES maxitest! minitest (~> 5.16.0) rake rspec BUNDLED WITH 2.5.7 maxitest-5.8.0/gemfiles/517.gemfile000066400000000000000000000001161471416742500170340ustar00rootroot00000000000000source "https://rubygems.org" gemspec path: "../" gem "minitest", "~> 5.17.0" maxitest-5.8.0/gemfiles/517.gemfile.lock000066400000000000000000000012741471416742500177710ustar00rootroot00000000000000PATH remote: .. specs: maxitest (5.8.0) minitest (>= 5.14.0, < 5.26.0) GEM remote: https://rubygems.org/ specs: diff-lcs (1.5.1) minitest (5.17.0) rake (13.2.1) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) rspec-core (3.13.0) rspec-support (~> 3.13.0) rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.1) PLATFORMS arm64-darwin-23 ruby DEPENDENCIES maxitest! minitest (~> 5.17.0) rake rspec BUNDLED WITH 2.5.7 maxitest-5.8.0/gemfiles/518.gemfile000066400000000000000000000001161471416742500170350ustar00rootroot00000000000000source "https://rubygems.org" gemspec path: "../" gem "minitest", "~> 5.18.0" maxitest-5.8.0/gemfiles/518.gemfile.lock000066400000000000000000000012741471416742500177720ustar00rootroot00000000000000PATH remote: .. specs: maxitest (5.8.0) minitest (>= 5.14.0, < 5.26.0) GEM remote: https://rubygems.org/ specs: diff-lcs (1.5.1) minitest (5.18.1) rake (13.2.1) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) rspec-core (3.13.0) rspec-support (~> 3.13.0) rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.1) PLATFORMS arm64-darwin-23 ruby DEPENDENCIES maxitest! minitest (~> 5.18.0) rake rspec BUNDLED WITH 2.5.7 maxitest-5.8.0/gemfiles/519.gemfile000066400000000000000000000001161471416742500170360ustar00rootroot00000000000000source "https://rubygems.org" gemspec path: "../" gem "minitest", "~> 5.19.0" maxitest-5.8.0/gemfiles/519.gemfile.lock000066400000000000000000000012741471416742500177730ustar00rootroot00000000000000PATH remote: .. specs: maxitest (5.8.0) minitest (>= 5.14.0, < 5.26.0) GEM remote: https://rubygems.org/ specs: diff-lcs (1.5.1) minitest (5.19.0) rake (13.2.1) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) rspec-core (3.13.0) rspec-support (~> 3.13.0) rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.1) PLATFORMS arm64-darwin-23 ruby DEPENDENCIES maxitest! minitest (~> 5.19.0) rake rspec BUNDLED WITH 2.5.7 maxitest-5.8.0/gemfiles/520.gemfile000066400000000000000000000001161471416742500170260ustar00rootroot00000000000000source "https://rubygems.org" gemspec path: "../" gem "minitest", "~> 5.20.0" maxitest-5.8.0/gemfiles/520.gemfile.lock000066400000000000000000000012531471416742500177600ustar00rootroot00000000000000PATH remote: .. specs: maxitest (5.8.0) minitest (>= 5.14.0, < 5.26.0) GEM remote: https://rubygems.org/ specs: diff-lcs (1.5.0) minitest (5.20.0) rake (13.0.6) rspec (3.12.0) rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) rspec-mocks (~> 3.12.0) rspec-core (3.12.2) rspec-support (~> 3.12.0) rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) rspec-mocks (3.12.6) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) rspec-support (3.12.1) PLATFORMS ruby DEPENDENCIES maxitest! minitest (~> 5.20.0) rake rspec BUNDLED WITH 2.4.21 maxitest-5.8.0/gemfiles/521.gemfile000066400000000000000000000001161471416742500170270ustar00rootroot00000000000000source "https://rubygems.org" gemspec path: "../" gem "minitest", "~> 5.21.0" maxitest-5.8.0/gemfiles/521.gemfile.lock000066400000000000000000000012751471416742500177650ustar00rootroot00000000000000PATH remote: .. specs: maxitest (5.8.0) minitest (>= 5.14.0, < 5.26.0) GEM remote: https://rubygems.org/ specs: diff-lcs (1.5.1) minitest (5.21.2) rake (13.2.1) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) rspec-core (3.13.0) rspec-support (~> 3.13.0) rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.1) PLATFORMS arm64-darwin-23 ruby DEPENDENCIES maxitest! minitest (~> 5.21.0) rake rspec BUNDLED WITH 2.5.10 maxitest-5.8.0/gemfiles/522.gemfile000066400000000000000000000001161471416742500170300ustar00rootroot00000000000000source "https://rubygems.org" gemspec path: "../" gem "minitest", "~> 5.22.0" maxitest-5.8.0/gemfiles/522.gemfile.lock000066400000000000000000000012751471416742500177660ustar00rootroot00000000000000PATH remote: .. specs: maxitest (5.8.0) minitest (>= 5.14.0, < 5.26.0) GEM remote: https://rubygems.org/ specs: diff-lcs (1.5.1) minitest (5.22.3) rake (13.2.1) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) rspec-core (3.13.0) rspec-support (~> 3.13.0) rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.1) PLATFORMS arm64-darwin-23 ruby DEPENDENCIES maxitest! minitest (~> 5.22.0) rake rspec BUNDLED WITH 2.5.10 maxitest-5.8.0/gemfiles/523.gemfile000066400000000000000000000001161471416742500170310ustar00rootroot00000000000000source "https://rubygems.org" gemspec path: "../" gem "minitest", "~> 5.23.0" maxitest-5.8.0/gemfiles/523.gemfile.lock000066400000000000000000000012741471416742500177660ustar00rootroot00000000000000PATH remote: .. specs: maxitest (5.8.0) minitest (>= 5.14.0, < 5.26.0) GEM remote: https://rubygems.org/ specs: diff-lcs (1.5.1) minitest (5.23.1) rake (13.2.1) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) rspec-core (3.13.0) rspec-support (~> 3.13.0) rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.1) PLATFORMS arm64-darwin-23 ruby DEPENDENCIES maxitest! minitest (~> 5.23.0) rake rspec BUNDLED WITH 2.5.7 maxitest-5.8.0/gemfiles/524.gemfile000066400000000000000000000001161471416742500170320ustar00rootroot00000000000000source "https://rubygems.org" gemspec path: "../" gem "minitest", "~> 5.24.0" maxitest-5.8.0/gemfiles/524.gemfile.lock000066400000000000000000000012751471416742500177700ustar00rootroot00000000000000PATH remote: .. specs: maxitest (5.8.0) minitest (>= 5.14.0, < 5.26.0) GEM remote: https://rubygems.org/ specs: diff-lcs (1.5.1) minitest (5.24.1) rake (13.2.1) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) rspec-core (3.13.0) rspec-support (~> 3.13.0) rspec-expectations (3.13.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.1) PLATFORMS arm64-darwin-23 ruby DEPENDENCIES maxitest! minitest (~> 5.24.0) rake rspec BUNDLED WITH 2.5.13 maxitest-5.8.0/gemfiles/525.gemfile000066400000000000000000000001161471416742500170330ustar00rootroot00000000000000source "https://rubygems.org" gemspec path: "../" gem "minitest", "~> 5.25.0" maxitest-5.8.0/gemfiles/525.gemfile.lock000066400000000000000000000012751471416742500177710ustar00rootroot00000000000000PATH remote: .. specs: maxitest (5.8.0) minitest (>= 5.14.0, < 5.26.0) GEM remote: https://rubygems.org/ specs: diff-lcs (1.5.1) minitest (5.25.1) rake (13.2.1) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) rspec-core (3.13.1) rspec-support (~> 3.13.0) rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-mocks (3.13.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.1) PLATFORMS arm64-darwin-23 ruby DEPENDENCIES maxitest! minitest (~> 5.25.0) rake rspec BUNDLED WITH 2.5.18 maxitest-5.8.0/lib/000077500000000000000000000000001471416742500141435ustar00rootroot00000000000000maxitest-5.8.0/lib/maxitest.rb000066400000000000000000000000241471416742500163220ustar00rootroot00000000000000module Maxitest end maxitest-5.8.0/lib/maxitest/000077500000000000000000000000001471416742500160015ustar00rootroot00000000000000maxitest-5.8.0/lib/maxitest/autorun.rb000066400000000000000000000015711471416742500200270ustar00rootroot00000000000000require "minitest" require "minitest/autorun" require "maxitest/vendor/around" require "maxitest/interrupt" unless ENV["MAXITEST_NO_INTERRUPT"] require "maxitest/let_bang" require "maxitest/let_all" require "maxitest/hook_all" require "maxitest/pending" require "maxitest/helpers" require "maxitest/xit" require "maxitest/static_class_order" require "maxitest/shorted_backtrace" require "maxitest/vendor/line_describe" # not a plugin module Maxitest ENABLE_PLUGINS = true end Minitest::Spec::DSL.send(:alias_method, :context, :describe) class << Minitest::Test alias_method :order_dependent!, :i_suck_and_my_tests_are_order_dependent! end # do not show maxitest as causing errors, but the last line in the users code old = Minitest::BacktraceFilter::MT_RE Minitest::BacktraceFilter.send(:remove_const, :MT_RE) Minitest::BacktraceFilter::MT_RE = Regexp.union(old, %r%lib/maxitest%) maxitest-5.8.0/lib/maxitest/global_must.rb000066400000000000000000000010021471416742500206270ustar00rootroot00000000000000# Allow global must_* assertion style without deprecations # # Must be required before maxitest/autorun Module.prepend(Module.new do def infect_an_assertion(_, new_name, *) super # define with deprecation # remove old to avoid warnings from re-defining remove_method new_name # re-define without deprecation class_eval <<-EOM, __FILE__, __LINE__ + 1 def #{new_name} *args Minitest::Expectation.new(self, Minitest::Spec.current).#{new_name}(*args) end EOM end end) maxitest-5.8.0/lib/maxitest/helpers.rb000066400000000000000000000023511471416742500177710ustar00rootroot00000000000000module Maxitest module Helpers module InstanceMethods def with_env(env) _synchronize do old = ENV.to_h env.each { |k, v| ENV[k.to_s] = v } yield ensure ENV.replace old end end # stripped down version of capture_io def capture_stdout _synchronize do begin captured_stdout = StringIO.new orig_stdout = $stdout $stdout = captured_stdout yield return captured_stdout.string ensure $stdout = orig_stdout end end end # stripped down version of capture_io def capture_stderr _synchronize do begin captured_stderr = StringIO.new orig_stderr = $stderr $stderr = captured_stderr yield return captured_stderr.string ensure $stderr = orig_stderr end end end end module ClassMethods def with_env(env) around { |t| with_env(env, &t) } end end end end Minitest::Test.send(:include, Maxitest::Helpers::InstanceMethods) Minitest::Test.send(:extend, Maxitest::Helpers::ClassMethods) maxitest-5.8.0/lib/maxitest/hook_all.rb000066400000000000000000000014351471416742500201210ustar00rootroot00000000000000module Maxitest class << self attr_accessor :hook_all_counter end end Maxitest.hook_all_counter = 0 module Maxitest module HookAll [:before, :after].each do |hook| # minitest discards the type argument, so we are not sending it along define_method(hook) do |type = :each, &block| case type when :each then super(&block) when :all raise ArgumentError, ":all is not supported in after" if hook == :after c = (Maxitest.hook_all_counter += 1) callback = :"maxitest_hook_all_#{c}" let_all(callback, &block) super() { send callback } else raise ArgumentError, "only :each and :all are supported" end end end end end Minitest::Spec::DSL.prepend(Maxitest::HookAll) maxitest-5.8.0/lib/maxitest/implicit_subject.rb000066400000000000000000000007211471416742500216570ustar00rootroot00000000000000# this is a bit hacky / overwrites describe, so not included by default ... module Maxitest module ImplicitSubject def describe(*args, &block) klass = super if args.first.is_a?(Class) && !klass.instance_methods(false).include?(:subject) klass.let(:subject) { args.first.new } end klass end end end Object.send(:include, Maxitest::ImplicitSubject) # Minitest hacks Kernel -> we need to use alias method or go into Object maxitest-5.8.0/lib/maxitest/interrupt.rb000066400000000000000000000017701471416742500203670ustar00rootroot00000000000000# frozen_string_literal: true # - show current backtrace when interrupting a stuck test with Ctrl+c # - skip remaining tests module Maxitest Interrupted = Class.new(StandardError) class << self attr_accessor :interrupted end module InterruptHandler # capture interrupt and treat it as a regular error so we get a backtrace def capture_exceptions(&block) super(&block) rescue Interrupt => e Maxitest.interrupted = true failures << Minitest::UnexpectedError.new(e) end # skip remaining tests if we were interrupted def run if Maxitest.interrupted # produce a real error so we do not crash in -v mode failures << begin raise Minitest::Skip, 'Maxitest::Interrupted' rescue Minitest::Skip $! end result = Minitest::Result.from(self) result.time = 0 result else super() end end end end Minitest::Test.prepend(Maxitest::InterruptHandler) maxitest-5.8.0/lib/maxitest/let_all.rb000066400000000000000000000005251471416742500177440ustar00rootroot00000000000000module Maxitest module LetAll def let_all(name, &block) cache = [] define_method(name) do if cache.empty? cache << instance_eval(&block) end cache.first end end def self.included(base) base.extend(self) end end end Minitest::Spec::DSL.include(Maxitest::LetAll) maxitest-5.8.0/lib/maxitest/let_bang.rb000066400000000000000000000001651471416742500201030ustar00rootroot00000000000000Minitest::Spec::DSL.class_eval do def let!(name, &block) let(name, &block) before { send(name) } end end maxitest-5.8.0/lib/maxitest/pending.rb000066400000000000000000000012021471416742500177450ustar00rootroot00000000000000module Maxitest module Pending def pending(reason=nil, **kwargs) raise ArgumentError, "Need a block to execute" unless block_given? raise ArgumentError, "Only :if option is supported" if (kwargs.keys | [:if] != [:if]) return yield if kwargs.fetch(:if, true) == false # allow user to for example mark test only pending on CI with `if: ENV["CI"]` begin yield # execute test rescue StandardError, Minitest::Assertion skip reason # test failed as expected else flunk "Test is fixed, remove `pending`" end end end end Minitest::Test.send(:include, Maxitest::Pending) maxitest-5.8.0/lib/maxitest/shorted_backtrace.rb000066400000000000000000000003311471416742500217720ustar00rootroot00000000000000Minitest::BacktraceFilter.send(:prepend, Module.new do def filter(*) backtrace = super pwd = "#{Dir.pwd}/" section = pwd.size..-1 backtrace.map { |b| b.start_with?(pwd) ? b[section] : b } end end) maxitest-5.8.0/lib/maxitest/static_class_order.rb000066400000000000000000000012111471416742500221700ustar00rootroot00000000000000module Maxitest class << self attr_accessor :static_class_order end end class << Minitest::Runnable alias_method :runnables_without_static_order, :runnables def runnables return runnables_without_static_order unless Maxitest.static_class_order # Minitest.__run uses Runnable.runnables.shuffle -> hack it runnables = runnables_without_static_order def runnables.shuffle self end # ugly hack to fight minitest 5.10 https://github.com/seattlerb/minitest/commit/478e3f9cfeb0a2f8cc4b029bbcbe7bb16648dd96 def runnables.reject(*args, &block) reject!(*args, &block) end runnables end end maxitest-5.8.0/lib/maxitest/threads.rb000066400000000000000000000021071471416742500177600ustar00rootroot00000000000000# tests that leave extra threads running can break other tests in weird ways ... prevent that from happening module Maxitest module Threads def setup @maxitest_threads_before = Thread.list super end def teardown super found = maxitest_extra_threads raise "Test left #{found.size} extra threads (#{found})" if found.any? ensure maxitest_kill_extra_threads end # also a helper methods for users def maxitest_wait_for_extra_threads sleep 0.01 while maxitest_extra_threads.any? end # also a helper methods for users def maxitest_kill_extra_threads maxitest_extra_threads.map(&:kill).map(&:join) end # if setup crashes we do not return anything to make the initial error visible def maxitest_extra_threads @maxitest_threads_before ? Thread.list - @maxitest_threads_before : [] end end end # not using prepend since that would clash with webmock # include works because original setup lives in also included Minitest::LifecycleHooks Minitest::Test.send :include, Maxitest::Threads maxitest-5.8.0/lib/maxitest/timeout.rb000066400000000000000000000016321471416742500200160ustar00rootroot00000000000000# tests sometimes hang locally or on ci and with this we can actually debug the cause instead of just hanging forever require 'timeout' module Maxitest class << self attr_accessor :timeout end module Timeout class TestCaseTimeout < StandardError def message "Test took too long to finish, aborting. To use a debugger, def maxitest_timeout;false;end in the test file." end end def run(*, &block) # NOTE: having a default def maxitest_timeout would break using let(:maxitest_timeout) timeout = (defined?(maxitest_timeout) ? maxitest_timeout : Maxitest.timeout || 5) if timeout == false super else begin ::Timeout.timeout(timeout, TestCaseTimeout) { super } rescue TestCaseTimeout => e failures << UnexpectedError.new(e) end end end end end Minitest::Test.send :prepend, Maxitest::Timeout maxitest-5.8.0/lib/maxitest/vendor/000077500000000000000000000000001471416742500172765ustar00rootroot00000000000000maxitest-5.8.0/lib/maxitest/vendor/around.rb000066400000000000000000000061751471416742500211240ustar00rootroot00000000000000# BEGIN generated by rake update, do not modify # https://raw.githubusercontent.com/splattael/minitest-around/master/LICENSE =begin Copyright (c) 2012 Peter Suschlik Copyright (c) 2018 Peter Leitzen (Suschlik) MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. =end # END generated by rake update, do not modify # BEGIN generated by rake update, do not modify # https://raw.githubusercontent.com/splattael/minitest-around/master/lib/minitest/around/version.rb module MinitestAround VERSION = '0.5.0' end # END generated by rake update, do not modify # BEGIN generated by rake update, do not modify # https://raw.githubusercontent.com/splattael/minitest-around/master/lib/minitest/around/unit.rb Minitest::Test.class_eval do alias_method :run_without_around, :run def run(*args) if defined?(around) result = nil around { result = run_without_around(*args) } result else run_without_around(*args) end end end # END generated by rake update, do not modify # BEGIN generated by rake update, do not modify # https://raw.githubusercontent.com/splattael/minitest-around/master/lib/minitest/around/spec.rb Minitest::Spec::DSL.class_eval do # - resume to call first part # - execute test # - resume fiber to execute last part def around(*args, &block) raise ArgumentError, "only :each or no argument is supported" if args != [] && args != [:each] fib = nil before do fib = Fiber.new do |context, resume| begin context.instance_exec(resume, &block) rescue Object fib = :failed raise end end fib.resume(self, lambda { Fiber.yield }) end after { fib.resume if fib && fib != :failed } end # Minitest does not support multiple before/after blocks remove_method :before def before(type=nil, &block) include Module.new { define_method(:setup) { super(); instance_exec(&block) } } end remove_method :after def after(type=nil, &block) include(Module.new do define_method(:teardown) do begin instance_exec(&block) ensure super() end end end) end end # END generated by rake update, do not modify maxitest-5.8.0/lib/maxitest/vendor/line.rb000066400000000000000000000076531471416742500205650ustar00rootroot00000000000000# BEGIN generated by rake update, do not modify # https://raw.githubusercontent.com/judofyr/minitest-line/master/MIT-LICENSE.txt =begin Copyright (c) 2014 Magnus Holm Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. =end # END generated by rake update, do not modify # BEGIN generated by rake update, do not modify # https://raw.githubusercontent.com/judofyr/minitest-line/master/lib/minitest/line_plugin.rb module Minitest module Line class << self def tests_with_lines target_file = $0 methods_with_lines(target_file).concat describes_with_lines(target_file) end private def methods_with_lines(target_file) runnables.flat_map do |runnable| rname = runnable.name runnable.runnable_methods.map do |name| file, line = runnable.instance_method(name).source_location next unless file == target_file test_name = (rname ? "#{rname}##{name}" : name) [test_name, line] end end.uniq.compact end def describes_with_lines(target_file) runnables.map do |runnable| next unless caller = runnable.instance_variable_defined?(:@minitest_line_caller) && runnable.instance_variable_get(:@minitest_line_caller) next unless line = caller.detect { |l| l.include?(target_file) } ["/#{Regexp.escape(runnable.name)}/", line[/:(\d+):in/, 1].to_i] end.compact end def runnables Minitest::Runnable.runnables end end end def self.plugin_line_options(opts, options) opts.on '-l', '--line N', Integer, "Run test at line number" do |lineno| options[:line] = lineno end end def self.plugin_line_init(options) unless exp_line = options[:line] reporter.reporters << LineReporter.new return end tests = Minitest::Line.tests_with_lines filter, _ = tests.sort_by { |n, l| -l }.detect { |n, l| exp_line >= l } raise "Could not find test method before line #{exp_line}" unless filter options[:filter] = filter end class LineReporter < Reporter def initialize(*) super @failures = [] end def record(result) if !result.skipped? && !result.passed? @failures << result end end def report return unless @failures.any? io.puts io.puts "Focus on failing tests:" pwd = Pathname.new(Dir.pwd) bin_rails = File.exist?("bin/rails") @failures.each do |res| result = (res.respond_to?(:source_location) ? res : res.method(res.name)) file, line = result.source_location if file file = Pathname.new(file) file = file.relative_path_from(pwd) if file.absolute? output = "#{bin_rails ? "bin/rails test" : "mtest"} #{file}:#{line}" output = "\e[31m#{output}\e[0m" if $stdout.tty? io.puts output end end end end def self.plugin_line_inject_reporter end end # END generated by rake update, do not modify maxitest-5.8.0/lib/maxitest/vendor/line_describe.rb000066400000000000000000000007341471416742500224160ustar00rootroot00000000000000# BEGIN generated by rake update, do not modify # https://raw.githubusercontent.com/judofyr/minitest-line/master/lib/minitest/line/describe_track.rb module Minitest module Line module DescribeTrack def describe(*args, &block) klass = super klass.instance_variable_set(:@minitest_line_caller, caller(0..5)) klass end end end end Object.send(:include, Minitest::Line::DescribeTrack) # END generated by rake update, do not modify maxitest-5.8.0/lib/maxitest/vendor/rg.rb000066400000000000000000000051741471416742500202420ustar00rootroot00000000000000# BEGIN generated by rake update, do not modify # https://raw.githubusercontent.com/blowmage/minitest-rg/master/LICENSE =begin Copyright (c) 2012 Mike Moore Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. =end # END generated by rake update, do not modify # BEGIN generated by rake update, do not modify # https://raw.githubusercontent.com/blowmage/minitest-rg/master/lib/minitest/rg_plugin.rb module Minitest def self.plugin_rg_options opts, _options # :nodoc: opts.on "--[no-]rg", "Add red/green to test output." do |bool| RG.rg! bool end end def self.plugin_rg_init options # :nodoc: if RG.rg? io = RG.new options[:io] reporter.reporters.grep(Minitest::Reporter).each do |rep| rep.io = io end end end class RG VERSION = "5.2.0".freeze COLORS = { "." => "\e[32m.\e[0m", "E" => "\e[33mE\e[0m", "F" => "\e[31mF\e[0m", "S" => "\e[36mS\e[0m" }.freeze attr_reader :io, :colors def self.rg!(bool = true) @rg = bool end def self.rg? @rg ||= false end def initialize io, colors = COLORS @io = io @colors = colors end def print o io.print(colors[o] || o) end def puts o = nil return io.puts if o.nil? if o =~ /(\d+) failures, (\d+) errors/ if Regexp.last_match[1] != "0" || Regexp.last_match[2] != "0" io.puts "\e[31m#{o}\e[0m" else io.puts "\e[32m#{o}\e[0m" end else io.puts o end end def method_missing msg, *args return super unless io.respond_to? msg io.send(msg, *args) end end end # END generated by rake update, do not modify maxitest-5.8.0/lib/maxitest/vendor/testrbl.rb000066400000000000000000000144331471416742500213070ustar00rootroot00000000000000# BEGIN generated by rake update, do not modify # https://raw.githubusercontent.com/grosser/testrbl/master/lib/testrbl.rb module Maxitest module Testrbl PATTERNS = [ /^(\s+)(should|test|it)(\s+|\s*\(\s*)['"](.*)['"](\s*\))?\s+do\s*(?:#.*)?$/, /^(\s+)(context|describe)(\s+|\s*\(\s*)['"]?(.*?)['"]?(\s*\))?\s+do\s*(?:#.*)?$/, /^(\s+)def(\s+)(test_)([a-z_\d]+)\s*(?:#.*)?$/ ] OPTION_WITH_ARGUMENT = ["-I", "-r", "-n", "--name", "-e", "--exclude", "-s", "--seed"] INTERPOLATION = /\\\#\\\{.*?\\\}/ class << self def run_from_cli(argv) files, options = partition_argv(argv) files.concat(changed_files) if options.delete("--changed") files = ["test"] if files.empty? files = files.map { |f| localize(f) } load_options, options = partition_options(options) if files.size == 1 and files.first =~ /^(\S+):(\d+)$/ file = $1 line = $2 run(ruby + load_options + line_pattern_option(file, line) + options) else if files.size == 1 and File.file?(files.first) run(ruby + load_options + files + options) elsif options.none? { |arg| arg =~ /^-n/ } seed = if seed = options.index("--seed") ["--"] + options.slice!(seed, 2) else [] end files = files.map { |f| File.directory?(f) ? all_test_files_in(f) : f }.flatten run(ruby + load_options + files.map { |f| "-r#{f}" } + options + ["-e", ""] + seed) else # pass though # no bundle exec: projects with mini and unit-test do not run well via bundle exec testrb run ["testrb"] + argv end end end # overwritten by maxitest to just return line def line_pattern_option(file, line) [file, "-n", "/#{pattern_from_file(File.readlines(file), line)}/"] end # usable via external tools like zeus def pattern_from_file(lines, line) possible_lines = lines[0..(line.to_i-1)].reverse found = possible_lines.map { |line| test_pattern_from_line(line) || block_start_from_line(line) }.compact # pattern and the groups it is nested under (like describe - describe - it) last_spaces = " " * 100 patterns = found.select do |spaces, name| last_spaces = spaces if spaces.size < last_spaces.size end.map(&:last).compact return filter_duplicate_final(patterns).reverse.join(".*") if found.size > 0 raise "no test found before line #{line}" end # only keep 1 pattern that stops matching via $ def filter_duplicate_final(patterns) found_final = 0 patterns.reject { |p| p.end_with?("$") and (found_final += 1) > 1 } end private def all_test_files_in(folder) Dir[File.join(folder, "{**/,}*_{test,spec}.rb")].uniq end def partition_options(options) next_is_before = false options.partition do |option| if next_is_before next_is_before = false true else if option =~ /^-(r|I)/ next_is_before = (option.size == 2) true else false end end end end # fix 1.9 not being able to load local files def localize(file) file =~ /^[-a-z\d_]/ ? "./#{file}" : file end def partition_argv(argv) next_is_option = false argv.partition do |arg| if next_is_option next_is_option = false else if arg =~ /^-.$/ or arg =~ /^--/ # single letter option followed by argument like -I test or long options like --verbose next_is_option = true if OPTION_WITH_ARGUMENT.include?(arg) false elsif arg =~ /^-/ # multi letter option like -Itest false else true end end end end def changed_files changed_files = sh("git status -s").split("\n").map { |l| l.strip.split(/\s+/, 2)[1] } if changed_files.empty? # user wants to test last commit and not current diff changed_files = sh("git show --name-only").split("\n\n").last.split("\n") end # we only want test files that were added or changed (not deleted) changed_files.select { |f| f =~ /_(test|spec)\.rb$/ && File.exist?(f) } end def sh(command) result = `#{command}` raise "Failed: #{command} -> #{result}" unless $?.success? result end def ruby if File.file?("Gemfile") ["ruby", "-rbundler/setup"] # faster then bundle exec ruby else ["ruby"] end end def run(command) puts command.join(" ") STDOUT.flush # if exec fails horribly we at least see some output Kernel.exec *command end def block_start_from_line(line) if line =~ /^(\s*).* do( \|.*\|)?$/ [$1, nil] end end def test_pattern_from_line(line) PATTERNS.each do |r| next unless line =~ r whitespace, method, test_name = $1, $2, $4 return [whitespace, test_pattern_from_match(method, test_name)] end nil end def test_pattern_from_match(method, test_name) regex = Regexp.escape(test_name).gsub("\\ "," ").gsub(INTERPOLATION, ".*") regex = if method == "test" # test "xxx -_ yyy" # test-unit: "test: xxx -_ yyy" # activesupport: "test_xxx_-__yyy" "^test(: |_)#{regex.gsub(" ", ".")}$" elsif method == "describe" || (method == "context" && !via_shoulda?) "#{regex}(::)?" elsif method == "should" && via_shoulda? optional_test_name = "(?:\(.*\))?" "#{method} #{regex}\. #{optional_test_name}$" elsif ["it", "should"].include?(method) # minitest aliases for shoulda "#test_\\d+_#{regex}$" else regex end regex.gsub("'", ".") end def via_shoulda? return @via_shoulda if defined?(@via_shoulda) @via_shoulda = !File.exist?("Gemfile.lock") || File.read("Gemfile.lock").include?(" shoulda-context ") end end end end # END generated by rake update, do not modify maxitest-5.8.0/lib/maxitest/verbose_backtrace.rb000066400000000000000000000015641471416742500220000ustar00rootroot00000000000000module Maxitest module VerboseBacktrace class NullFilter def self.filter(backtrace) backtrace end end class << self attr_accessor :verbose end def plugin_maxitest_verbose_backtrace_init(options) return unless options[:verbose] Maxitest::VerboseBacktrace.verbose = true Minitest.backtrace_filter = Maxitest::VerboseBacktrace::NullFilter Rails.backtrace_cleaner.remove_silencers! if defined?(Rails) && Rails.respond_to?(:backtrace_cleaner) end end end Minitest.extensions << 'maxitest_verbose_backtrace' Minitest.extend Maxitest::VerboseBacktrace module Maxitest::VerboseAssertion def message if Maxitest::VerboseBacktrace.verbose "#{self.class}: #{super}\n #{backtrace.join "\n "}" else super end end end Minitest::Assertion.send(:include, Maxitest::VerboseAssertion) maxitest-5.8.0/lib/maxitest/version.rb000066400000000000000000000000501471416742500200060ustar00rootroot00000000000000module Maxitest VERSION = "5.8.0" end maxitest-5.8.0/lib/maxitest/xit.rb000066400000000000000000000005201471416742500171270ustar00rootroot00000000000000# frozen_string_literal: true module Maxitest module XitMethod def xit(*args) describe 'skip' do define_method(:setup) {} define_method(:teardown) {} it(*args) end end def self.included(base) base.extend(self) end end end Minitest::Spec::DSL.include(Maxitest::XitMethod) maxitest-5.8.0/lib/minitest/000077500000000000000000000000001471416742500157775ustar00rootroot00000000000000maxitest-5.8.0/lib/minitest/maxitest_plugin.rb000066400000000000000000000017151471416742500215440ustar00rootroot00000000000000# we are not enabling our extensions unless maxitest/autorun was loaded # minitest plugin system auto-loads all files in the load path and that would # always enable all our plugins even if they were not wanted if defined?(Maxitest::ENABLE_PLUGINS) && Maxitest::ENABLE_PLUGINS disabled_for_rails = begin require 'rails/version' Rails::VERSION::MAJOR >= 5 rescue LoadError false end # rails has --backtrace which disables rails own backtrace cleaner, but not minitests require "maxitest/verbose_backtrace" unless disabled_for_rails # rails 5 adds default red/green output require "maxitest/vendor/rg" Minitest.extensions << "rg" Minitest::RG.rg! $stdout.tty? end # rails 5.2+ has it's own line support # - it breaks `mtest file:line` format # - we still want our format with the nice summary at the end, even if the `bin/rails test` output is already inline require "maxitest/vendor/line" Minitest.extensions << "line" end maxitest-5.8.0/maxitest.gemspec000066400000000000000000000011541471416742500166010ustar00rootroot00000000000000require_relative "lib/maxitest/version" Gem::Specification.new "maxitest", Maxitest::VERSION do |s| s.summary = "Minitest + all the features you always wanted" s.authors = ["Michael Grosser"] s.email = "michael@grosser.it" s.homepage = "https://github.com/grosser/maxitest" s.files = Dir["{bin,lib}/**/*", "MIT-LICENSE", "README.md", "CHANGELOG.md"] s.license = "MIT" s.executables = ["mtest"] s.add_runtime_dependency "minitest", [">= 5.14.0", "< 5.26.0"] s.required_ruby_version = '>= 3', '< 4' # mirroring minitest s.add_development_dependency "rake" s.add_development_dependency "rspec" end maxitest-5.8.0/spec/000077500000000000000000000000001471416742500143275ustar00rootroot00000000000000maxitest-5.8.0/spec/cases/000077500000000000000000000000001471416742500154255ustar00rootroot00000000000000maxitest-5.8.0/spec/cases/around.rb000066400000000000000000000006751471416742500172520ustar00rootroot00000000000000require "./spec/cases/helper" describe "2" do let(:calls) { [] } before { calls << 1 } around((ENV["HOOK_TYPE"] || "each").to_sym) { |test| calls << 2; test.call } around { |test| calls << 3; test.call } after { calls.must_equal [1,2,3,4] } after { calls << 4 } it "is ordered" do calls.must_equal [1,2,3] end end class AroundTest < Minitest::Test def around yield end def test_things assert 1 end end maxitest-5.8.0/spec/cases/catch_interrupt.rb000066400000000000000000000002771471416742500211560ustar00rootroot00000000000000require "./spec/cases/helper" describe 2 do it "xx" do x = 2 begin raise Interrupt rescue Interrupt x = 1 else x = 3 end x.must_equal 1 end end maxitest-5.8.0/spec/cases/cltr_c.rb000066400000000000000000000006751471416742500172300ustar00rootroot00000000000000ENV["GLOBAL_MUST"] = "true" require "./spec/cases/helper" describe 2 do i_suck_and_my_tests_are_order_dependent! before { puts "BEFORE" } after { puts "AFTER" } it "is even" do false.must_equal true end it "is not odd" do puts "hit Cltr+c" sleep 10 end it "stops after" do puts "should not get here ..." sleep 10 end it "really does ..." do puts "should not get here ..." sleep 10 end end maxitest-5.8.0/spec/cases/context.rb000066400000000000000000000003061471416742500174350ustar00rootroot00000000000000require "./spec/cases/helper" describe 2 do context "methods" do it "is even" do 2.even?.must_equal true end it "is not odd" do 2.odd?.must_equal false end end end maxitest-5.8.0/spec/cases/error_and_failure.rb000066400000000000000000000001721471416742500214340ustar00rootroot00000000000000require "./spec/cases/helper" describe 2 do it 'errors' do raise end it 'fails' do assert false end end maxitest-5.8.0/spec/cases/global_must.rb000066400000000000000000000007341471416742500202660ustar00rootroot00000000000000ENV["GLOBAL_MUST"] = "true" require "./spec/cases/helper" describe "threads" do def assert_it 1.must_equal 1 end it "can assert normal" do assert_it end it "can assert in threads" do result = "not called" Thread.new do begin assert_it rescue NoMethodError, RuntimeError, NameError # different errors depending on minitest and ruby version result = "error" end end.join result.must_equal "error" end end maxitest-5.8.0/spec/cases/helper.rb000066400000000000000000000002761471416742500172360ustar00rootroot00000000000000require 'bundler/setup' $VERBOSE = true if ENV['SIMULATE_TTY'] def $stdout.tty? true end end if ENV['GLOBAL_MUST'] require 'maxitest/global_must' end require 'maxitest/autorun' maxitest-5.8.0/spec/cases/helpers.rb000066400000000000000000000020751471416742500174200ustar00rootroot00000000000000require "./spec/cases/helper" describe "helpers" do describe "#with_env" do it "changes env" do with_env A: "b" do _(ENV["A"]).must_equal "b" end end it "restores env" do ENV["A"] = "c" with_env A: "b" do ENV["B"] = "a" _(ENV["A"]).must_equal "b" end _(ENV["A"]).must_equal "c" _(ENV["B"]).must_be_nil end end describe ".with_env" do with_env A: "a" it "sets env" do _(ENV["A"]).must_equal "a" end end describe "#capture_stdout" do it "keeps stdout" do _(capture_stdout { puts "X" }).must_equal "X\n" end it "lets stderr through" do out, err = capture_io { capture_stdout { warn "X" } } _(out).must_equal "" _(err).must_equal "X\n" end end describe "#capture_stderr" do it "keeps stderr" do _(capture_stderr { warn "X" }).must_equal "X\n" end it "lets stdout through" do out, err = capture_io { capture_stderr { puts "X" } } _(out).must_equal "X\n" _(err).must_equal "" end end end maxitest-5.8.0/spec/cases/hook_all.rb000066400000000000000000000012701471416742500175420ustar00rootroot00000000000000require "./spec/cases/helper" hook_method = (ENV["HOOK_METHOD"] || "before").to_sym hook_type = (ENV["HOOK_TYPE"] || "all").to_sym # need this globally or classes don't sort r = Minitest::Runnable.runnables def r.shuffle self end # needed or minitest <=5.15 def r.reject replace super end describe 2 do order_dependent! send hook_method, hook_type do puts "ALL" end it "works" do puts "T1" end describe "subclass" do order_dependent! send hook_method, hook_type do puts "ALL-SUB" end it "still works" do puts "TS1" end it "yes it does" do puts "TS2" end end it "works after subclass" do puts "T2" end end maxitest-5.8.0/spec/cases/implicit_subject.rb000066400000000000000000000017001471416742500213010ustar00rootroot00000000000000require "./spec/cases/helper" require "maxitest/implicit_subject" class DoNotCallMe def initialize raise "WRONG" end end describe String do it "has implicit subject" do subject.must_equal "" end describe Array do def other_method true end it "has nested implicit subject" do subject.must_equal [] other_method.must_equal true end end describe Hash do it "has other nested implicit subject" do subject.must_equal({}) end describe "strings" do it "does not overwrite subject" do subject.must_equal({}) end end describe :symbols do it "does not overwrite subject" do subject.must_equal({}) end end end describe DoNotCallMe do let(:subject) { 1 } it "can overwrite" do subject.must_equal 1 end end end describe "without" do it "raises as expected" do assert_raises(NameError) { subject } end end maxitest-5.8.0/spec/cases/let_all.rb000066400000000000000000000020321471416742500173630ustar00rootroot00000000000000require "./spec/cases/helper" # executing sub-classes first makes the tests fail Maxitest.static_class_order = true describe "A" do order_dependent! let(:calls) { [] } let_all(:foo) { calls << 1; nil } describe "subclass gets randomly executed first" do it "is called when used" do calls.must_equal [] foo.must_equal nil calls.must_equal [1] end end describe "then another subclass" do it "is not called multiple times" do calls.must_equal [] foo.must_equal nil calls.must_equal [] end end describe "overwrite" do let_all(:foo) { calls << 2; true } it "can overwrite" do calls.must_equal [] foo.must_equal true calls.must_equal [2] end end describe "nested" do it "is not called multiple times from child classes" do calls.must_equal [] foo.must_equal nil calls.must_equal [] end end end describe "B" do let_all(:foo) { :foo } it "does not go across class boundaries" do foo.must_equal :foo end end maxitest-5.8.0/spec/cases/let_bang.rb000066400000000000000000000002711471416742500175250ustar00rootroot00000000000000require "./spec/cases/helper" describe 2 do let(:calls) { [] } let!(:foo) { calls << 1 } before { calls << 2 } it "is called before" do calls.must_equal [1, 2] end end maxitest-5.8.0/spec/cases/line.rb000066400000000000000000000004641471416742500167050ustar00rootroot00000000000000require "./spec/cases/helper" describe 2 do it "is even" do 2.even?.must_equal true end it "is not odd" do 2.odd?.must_equal true end describe "block" do it "is even" do 2.even?.must_equal true end it "is still even" do 2.even?.must_equal true end end end maxitest-5.8.0/spec/cases/mtest/000077500000000000000000000000001471416742500165615ustar00rootroot00000000000000maxitest-5.8.0/spec/cases/mtest/a_test.rb000066400000000000000000000001451471416742500203650ustar00rootroot00000000000000require "./spec/cases/helper" describe 1 do it "is even" do 2.even?.must_equal true end end maxitest-5.8.0/spec/cases/mtest/b_test.rb000066400000000000000000000001451471416742500203660ustar00rootroot00000000000000require "./spec/cases/helper" describe 2 do it "is even" do 2.even?.must_equal true end end maxitest-5.8.0/spec/cases/mtest/c.rb000066400000000000000000000001451471416742500173300ustar00rootroot00000000000000require "./spec/cases/helper" describe 3 do it "is even" do 2.even?.must_equal true end end maxitest-5.8.0/spec/cases/order_dependent.rb000066400000000000000000000005001471416742500211060ustar00rootroot00000000000000require "./spec/cases/helper" $ordered_calls = [] describe 2 do order_dependent! it "a" do $ordered_calls << 1 end it "c" do $ordered_calls << 2 end it "b" do $ordered_calls << 3 end it "d" do $ordered_calls << 4 end it "z" do $ordered_calls.must_equal [1,2,3,4] end end maxitest-5.8.0/spec/cases/parallel.rb000066400000000000000000000004221471416742500175440ustar00rootroot00000000000000ENV["N"] = ENV["MT_CPU"] = "3" # make this test hardware independent, need N for old minitest versions require "./spec/cases/helper" describe String do parallelize_me! it "1" do sleep 0.1 end it "2" do sleep 0.1 end it "3" do sleep 0.1 end end maxitest-5.8.0/spec/cases/pending.rb000066400000000000000000000026251471416742500174030ustar00rootroot00000000000000require "./spec/cases/helper" describe 2 do it "runs regular tests" do _(2.even?).must_equal true end it "fails when pending is fixed" do e = assert_raises Minitest::Assertion do pending "fail" do _(2).must_equal 2 end end _(e.message).must_include "fixed" end it "skips when pending still needed" do e = assert_raises Minitest::Skip do pending "Skipping with reason" do _(2).must_equal 3, "This should not fail" end end _(e.message).must_equal "Skipping with reason" end it "skips exceptions" do e = assert_raises Minitest::Skip do pending "Skipping with exception" do raise "Oh noes" end end _(e.message).must_equal "Skipping with exception" end it "skips without reason" do pending do _(2).must_equal 3 end end it "fails without block" do e = assert_raises(ArgumentError) do pending "success" end _(e.message).must_equal "Need a block to execute" end it "can disable pending" do pending "Not skipping", if: false do _(2).must_equal 2 end end it "can enable pending" do pending "skipping conditionally", if: true do raise "Oh noes" end end it "fails when given unknown kwargs" do assert_raises(ArgumentError) do pending "skipping conditionally", unless: true do raise "Oh noes" end end end end maxitest-5.8.0/spec/cases/plain.rb000066400000000000000000000002351471416742500170550ustar00rootroot00000000000000require "./spec/cases/helper" describe 2 do it "is even" do 2.even?.must_equal true end it "is not odd" do 2.odd?.must_equal false end end maxitest-5.8.0/spec/cases/raise.rb000066400000000000000000000002771471416742500170630ustar00rootroot00000000000000require "./spec/cases/helper" # cause a raise in a required file module Maxitest class Timeout end end describe "explode" do it "explodes" do require 'maxitest/timeout' end end maxitest-5.8.0/spec/cases/raise_interrupt.rb000066400000000000000000000002521471416742500211700ustar00rootroot00000000000000require "./spec/cases/helper" describe 2 do i_suck_and_my_tests_are_order_dependent! it "xx" do raise Interrupt end it "yyy" do assert false end end maxitest-5.8.0/spec/cases/static_class_order.rb000066400000000000000000000003111471416742500216140ustar00rootroot00000000000000require "./spec/cases/helper" Maxitest.static_class_order = true $calls = [] 5.times do |i| describe rand do it { puts "#{i}" } describe rand do it { puts "#{i}n" } end end end maxitest-5.8.0/spec/cases/threads.rb000066400000000000000000000014071471416742500174060ustar00rootroot00000000000000ENV["MT_CPU"] = "2" # so we get 3 threads total and not variation based on machines cpus require "maxitest/global_must" require "./spec/cases/helper" require "maxitest/threads" describe "threads" do order_dependent! def assert_correct_threads Thread.list.count.must_equal 3, Thread.list end def create_thread Thread.new { sleep 0.1 } end it "is fine without extra threads" do assert_correct_threads end it "fails on extra threads" do assert_correct_threads create_thread Thread.list.must_equal 4 end it "can kill extra threads" do assert_correct_threads create_thread maxitest_kill_extra_threads end it "can wait for extra threads" do assert_correct_threads maxitest_wait_for_extra_threads end end maxitest-5.8.0/spec/cases/timeout.rb000066400000000000000000000007461471416742500174470ustar00rootroot00000000000000require "./spec/cases/helper" require "maxitest/timeout" Maxitest.timeout = (ENV['DISABLE'] || ENV['CUSTOM'] ? false : 0.1) describe 2 do if ENV['CUSTOM'] let(:maxitest_timeout) { 0.1 } end it "x" do 1 end it "times out" do sleep 1 puts "DID NOT TIME OUT" end it "y" do 1 end describe "sum" do before { sleep 0.04 } after do sleep 0.04 puts "DID NOT TIME OUT" end it "fails" do sleep 0.04 end end end maxitest-5.8.0/spec/cases/xit.rb000066400000000000000000000007051471416742500165600ustar00rootroot00000000000000require "./spec/cases/helper" describe 2 do it 'should include the xit module' do assert_includes Minitest::Spec::DSL.included_modules, Maxitest::XitMethod end xit "is even" do 2.even?.must_equal true end it "is odd" do 2.odd?.must_equal false end describe "with evil setup/teardown" do before { raise "called before" } after { raise "called after" } xit "should not be called" do raise end end end maxitest-5.8.0/spec/maxitest_spec.rb000066400000000000000000000276251471416742500175400ustar00rootroot00000000000000require "spec_helper" require 'open3' describe Maxitest do it "has a VERSION" do Maxitest::VERSION.should =~ /^[\.\da-z]+$/ end it "does not add extra output" do result = with_global_must do run_cmd("ruby spec/cases/plain.rb") end result.sub!(/seed \d+/, 'seed X') result.gsub!(/\d+\.\d+/, 'X') result.should == "Run options: --seed X\n\n# Running:\n\n..\n\nFinished in Xs, X runs/s, X assertions/s.\n\n2 runs, 2 assertions, 0 failures, 0 errors, 0 skips" end it "runs via ruby" do run_cmd("ruby spec/cases/plain.rb").should include "\n2 runs, 2 assertions" end it "supports context" do run_cmd("ruby spec/cases/context.rb").should include "\n2 runs, 2 assertions" end it "supports let!" do run_cmd("ruby spec/cases/let_bang.rb").should include "\n1 runs, 1 assertions" end it "supports let_all" do run_cmd("ruby spec/cases/let_all.rb") end it "can use static_class_order" do run_cmd("ruby spec/cases/static_class_order.rb").should include("\n0\n.0n\n.1\n.1n\n.2\n.2n\n.3\n.3n\n.4\n.4n\n.\n") end it "supports order_dependent" do run_cmd("ruby spec/cases/order_dependent.rb").should include "5 runs, 1 assertions, 0 failures, 0 errors, 0 skips" end it "has pending" do run_cmd("ruby spec/cases/pending.rb") end it "does not call xit specs" do result = run_cmd("ruby spec/cases/xit.rb -v") result.should include "(no tests defined)" result.should include "4 runs, 3 assertions, 0 failures, 0 errors, 2 skips" end it "shows short backtraces" do out = run_cmd("ruby spec/cases/raise.rb", fail: true) # Ruby 3.2 has a different backtrace it add 2 lines between the lib/maxitest/timeout.rb # and the spec/cases/raise.rb out.gsub!(/\n.*previous definition of Timeout.*/, "") # unify backtraces between ruby versions output_in = out.gsub!(/:in .*/, "") output_in.should include "TypeError: Timeout is not a module" output_in.should include 'spec/cases/raise.rb:11' # Minitest 5.21.0+ backtrace is more verbose and the short backtrace feature seems to be gone # re-test by running spec/cases/raise.rb and only loading minitest/autorun and not maxitest if Minitest::VERSION <= "5.21.0" output_in.should_not include 'lib/maxitest' end end it "has helpers" do run_cmd("ruby spec/cases/helpers.rb") end it "does not use old MiniTest constant" do Dir["lib/**/*.rb"].each do |p| File.read(p).should_not include "MiniTest" end end describe "before/after/around" do it "works" do out = run_cmd("ruby spec/cases/hook_all.rb") out.should include "Running:\n\nALL\nT1\n.T2\n.ALL-SUB\nTS1\n.TS2\n.\n\nFinished" end it "fails when using unsupported type" do with_env HOOK_TYPE: "foo" do out = run_cmd("ruby spec/cases/hook_all.rb", fail: true) out.should include "only :each and :all are supported (ArgumentError)" end end it "informs user about missing after :all" do with_env HOOK_METHOD: "after" do out = run_cmd("ruby spec/cases/hook_all.rb --seed 123", fail: true) out.should include ":all is not supported in after (ArgumentError)" end end it "supports around" do run_cmd("ruby spec/cases/around.rb").should include "\n2 runs, 3 assertions" end it "informs user about missing around :all" do with_env HOOK_TYPE: "all" do out = run_cmd("ruby spec/cases/around.rb", fail: true) out.should include "only :each or no argument is supported (ArgumentError)" end end end describe "color" do it "is color-less without tty" do run_cmd("ruby spec/cases/plain.rb").should include "\n2 runs, 2 assertions" end it "is colorful on tty" do simulate_tty do run_cmd("ruby spec/cases/plain.rb").should include "\n\e[32m2 runs, 2 assertions" end end it "is colorful without tty but --rg" do run_cmd("ruby spec/cases/plain.rb --rg").should include "\n\e[32m2 runs, 2 assertions" end it "is color-less with --no-rg and tty" do simulate_tty do run_cmd("ruby spec/cases/plain.rb --no-rg").should include "\n2 runs, 2 assertions" end end end describe "timeout" do it "times out long running tests" do result = run_cmd("ruby spec/cases/timeout.rb -v", fail: true) # 1 test takes too long and fails with a nice error message result.should include "Maxitest::Timeout::TestCaseTimeout: Test took too long to finish, aborting" # results look normal result.should include ", 2 errors," end it "times out after custom interval" do result = run_cmd("CUSTOM=1 ruby spec/cases/timeout.rb -v", fail: true) # 1 test takes too long and fails with a nice error message result.should include "Maxitest::Timeout::TestCaseTimeout: Test took too long to finish, aborting" # results look normal result.should include ", 2 errors," end it "does not time out when disabled" do result = run_cmd("DISABLE=1 ruby spec/cases/timeout.rb -v") # 1 test takes too long and fails with a nice error message result.should include "DID NOT TIME OUT" # results look normal result.should include "4 runs" end end describe "global_must" do let(:deprecated) { "DEPRECATED" } it "complain when not used" do run_cmd("ruby spec/cases/plain.rb").should include deprecated end it "does not complain when used" do with_global_must do run_cmd("ruby spec/cases/plain.rb").should_not include deprecated end end it "fails when used in threads" do with_global_must do run_cmd("ruby spec/cases/global_must.rb") end end end describe "extra threads" do it "fails on extra and passes on regular" do result = with_global_must do run_cmd("ruby spec/cases/threads.rb -v", fail: true) end result.gsub(/\d\.\d+/, "0.0").should include <<-OUT.gsub(/^\s+/, "") threads#test_0001_is fine without extra threads = 0.0 s = . threads#test_0002_fails on extra threads = 0.0 s = F threads#test_0003_can kill extra threads = 0.0 s = . threads#test_0004_can wait for extra threads = 0.0 s = . OUT end end describe "line" do let(:focus) { "Focus on failing tests:" } let(:expected_command) { "mtest spec/cases/line.rb:8" } it "prints line numbers on failed" do run_cmd("ruby spec/cases/line.rb", fail: true).should include "#{focus}\n#{expected_command}" end it "can run with line numbers" do result = run_cmd(expected_command, fail: true) result.should include("1 runs, 1 assertions, 1 failures, 0 errors, 0 skips") result.should_not include(focus) # ran 1 line, no need to reprint end it "can describe with line numbers" do result = run_cmd("mtest spec/cases/line.rb:12") result.should include("2 runs, 2 assertions, 0 failures, 0 errors, 0 skips") end it "can run with -l line numbers" do result = run_cmd("ruby spec/cases/line.rb -l 8", fail: true) result.should include("1 runs, 1 assertions, 1 failures, 0 errors, 0 skips") result.should_not include(focus) # ran 1 line, no need to reprint end it "uses colors on tty" do simulate_tty do run_cmd("ruby spec/cases/line.rb", fail: true).should include "\e[31m#{expected_command}\e[0m" end end end describe "Interrupts" do it "stops on ctrl+c and prints errors" do t = Thread.new { run_cmd("ruby spec/cases/cltr_c.rb", fail: true) } sleep 1 # let thread start kill_process_with_name("spec/cases/cltr_c.rb") output = t.value output.should include "4 runs, 1 assertions, 1 failures, 1 errors, 2 skips" # failed, error from interrupt (so you see a backtrace), rest skipped output.gsub(/:\d+:in/, ":D:in").should include "cltr_c.rb:D:in `sleep'" # let you know where it happened output.should include "Interrupt:" # let you know what happened output.should include "Expected: true\n Actual: false" # not hide other errors output.scan(/BEFORE/).size.should == 2 # before calls avoided when skipping output.scan(/AFTER/).size.should == 2 # after calls avoided when skipping end it "allows Interrupts to be caught normally" do output = run_cmd("ruby spec/cases/catch_interrupt.rb") output.should include "1 runs, 1 assertions, 0 failures, 0 errors, 0 skips" end it "catches directly raised Interrupt" do output = run_cmd("ruby spec/cases/raise_interrupt.rb", fail: true) output.should include "runs, " output.should include "Interrupt: Interrupt" end it "shows backtraces when in verbose mode" do t = Thread.new { run_cmd("ruby spec/cases/cltr_c.rb -v", fail: true) } sleep 1 # let thread start kill_process_with_name("spec/cases/cltr_c.rb") output = t.value output.gsub(/:\d+:in/, ":D:in").should include "cltr_c.rb:D:in `sleep'" # let you know where it happened end end describe "mtest" do it "shows version" do run_cmd("mtest -v").should == Maxitest::VERSION run_cmd("mtest --version").should == Maxitest::VERSION end it "shows help" do run_cmd("mtest -h").should include "Usage:" run_cmd("mtest --help").should include "Usage:" end it "runs a single file" do run_cmd("mtest spec/cases/mtest/a_test.rb").should include "1 runs, 1 assertions, 0 failures, 0 errors, 0 skips" end it "runs a folder" do run_cmd("mtest spec/cases/mtest").should include "2 runs, 2 assertions, 0 failures, 0 errors, 0 skips" end it "runs multiple files" do run_cmd("mtest spec/cases/mtest/a_test.rb spec/cases/mtest/c.rb").should include "2 runs, 2 assertions, 0 failures, 0 errors, 0 skips" end end describe "backtraces" do it "shows no backtrace without verbose" do result = run_cmd("ruby spec/cases/error_and_failure.rb", fail: true) result.should include "error_and_failure.rb:5" result.should include "error_and_failure.rb:9" result.should_not include "minitest.rb" end it "shows backtrace for errors with verbose" do result = run_cmd("ruby spec/cases/error_and_failure.rb -n '/errors/' -v", fail: true) result.should include "1 run" result.should include "error_and_failure.rb:5" result.should include "minitest.rb" end it "shows backtrace for failures with verbose" do result = run_cmd("ruby spec/cases/error_and_failure.rb -n '/fails/' -v", fail: true) result.should include "1 run" result.should include "error_and_failure.rb:9" result.should include "minitest.rb" end end describe "parallel" do it "can run in parallel" do result = run_cmd("MT_CPU=3 ruby spec/cases/parallel.rb -v") result.should include "\n3 runs" result.should include "Finished in 0.1" end end private def simulate_tty(&block) with_env SIMULATE_TTY: 'true', &block end def with_global_must(&block) with_env GLOBAL_MUST: 'true', &block end def with_env(h) old = ENV.to_h h.each { |k, v| ENV[k.to_s] = v} yield ensure ENV.replace old end def run_cmd(command, options = {}) stdout, stderr, status = Open3.capture3(command) unless options[:keep_output] stdout += "\n" + stderr end raise "#{options[:fail] ? "SUCCESS" : "FAIL"} #{command}\n#{stdout}" if status.success? == !!options[:fail] stdout.strip end # copied from https://github.com/grosser/parallel/blob/master/spec/parallel_spec.rb#L10-L15 def kill_process_with_name(file, signal='INT') running_processes = `ps -f`.split("\n").map{ |line| line.split(/\s+/) } pid_index = running_processes.detect { |p| p.include?("UID") }.index("UID") + 1 parent = running_processes.detect { |p| p.include?(file) and not p.include?("sh") } raise "Unable to find parent in #{running_processes} with #{file}" unless parent `kill -s #{signal} #{parent.fetch(pid_index)}` end end maxitest-5.8.0/spec/spec_helper.rb000066400000000000000000000003201471416742500171400ustar00rootroot00000000000000require "maxitest/version" require "maxitest" require "minitest" RSpec.configure do |config| config.expect_with(:rspec) { |c| c.syntax = :should } config.mock_with(:rspec) { |c| c.syntax = :should } end