minitest-excludes-2.0.0/0000755000175000017500000000000012545557362014523 5ustar miguelmiguelminitest-excludes-2.0.0/metadata.gz.sig0000444000175000017500000000040012545557362017416 0ustar miguelmiguelkEm']pYށd2nA5 ,<d:ud~S&֒]QUbR;!z Llw}oq+{7r[= ||B\D{ $2V``Hk  !3Qv 룬}QVi|,B_UY]vM4L #aadD9p)YXb)V_m ĤzP!vuminitest-excludes-2.0.0/Rakefile0000444000175000017500000000043412545557362016167 0ustar miguelmiguel# -*- ruby -*- require "rubygems" require "hoe" Hoe.plugin :isolate Hoe.plugin :seattlerb Hoe.add_include_dirs "../../minitest/dev/lib" Hoe.spec "minitest-excludes" do developer "Ryan Davis", "ryand-ruby@zenspider.com" dependency "minitest", "~> 4.0" end # vim: syntax=ruby minitest-excludes-2.0.0/README.txt0000444000175000017500000000361312545557362016222 0ustar miguelmiguel= minitest-excludes home :: https://github.com/seattlerb/minitest-excludes rdoc :: http://docs.seattlerb.org/minitest-excludes == DESCRIPTION: minitest/excludes.rb extends MiniTest::Unit::TestCase to provide a clean API for excluding certain tests you don't want to run under certain conditions. == FEATURES/PROBLEMS: * Simple API to conditionally remove tests you don't want to run. * Uses plain ruby so you can use conditional logic if need be. == SYNOPSIS: class TestXYZ < MiniTest::Unit::TestCase def test_good test that passes end def test_bad test that fails only on jruby end end For jruby runs, you can add test/excludes/TestXYZ.rb with: exclude :test_bad, "Uses ObjectSpace" if jruby? == REQUIREMENTS: * minitest == INSTALL: * sudo gem install minitest-excludes == LICENSE: (The MIT License) Copyright (c) Ryan Davis, seattle.rb 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. minitest-excludes-2.0.0/test/0000755000175000017500000000000012545557362015502 5ustar miguelmiguelminitest-excludes-2.0.0/test/metametameta.rb0000444000175000017500000000351012545557362020470 0ustar miguelmiguelrequire 'tempfile' require 'stringio' require 'minitest/autorun' class Minitest::Test def clean s s.gsub(/^ {6}/, '') end end class MetaMetaMetaTestCase < Minitest::Test attr_accessor :reporter, :output, :tu def run_tu_with_fresh_reporter flags = %w[--seed 42] options = Minitest.process_args flags @output = StringIO.new("") self.reporter = Minitest::CompositeReporter.new reporter << Minitest::SummaryReporter.new(@output, options) reporter << Minitest::ProgressReporter.new(@output, options) reporter.start yield(reporter) if block_given? @tus ||= [@tu] @tus.each do |tu| Minitest::Runnable.runnables.delete tu tu.run reporter, options end reporter.report 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 " "} # Running: EOM run_tu_with_fresh_reporter flags, &block output = normalize_output @output.string.dup assert_equal header + expected, output end def normalize_output output output.sub!(/Finished in .*/, "Finished in 0.00") output.sub!(/Loaded suite .*/, 'Loaded suite blah') output.gsub!(/ = \d+.\d\d s = /, ' = 0.00 s = ') output.gsub!(/0x[A-Fa-f0-9]+/, '0xXXX') 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 end def setup super srand 42 Minitest::Test.reset @tu = nil end def teardown super Object.send :remove_const, :ATestCase if defined? ATestCase end end minitest-excludes-2.0.0/test/test_minitest_excludes.rb0000444000175000017500000000325612545557362022622 0ustar miguelmiguelrequire 'test/metametameta' require 'minitest/excludes' class TestMinitestExcludes < MetaMetaMetaTestCase def test_cls_excludes srand 42 old_exclude_base = Minitest::Test::EXCLUDE_DIR @assertion_count = 0 Dir.mktmpdir do |path| Minitest::Test::EXCLUDE_DIR.replace(path) Dir.mkdir File.join path, "ATestCase" s = 'exclude :test_test2, "because it is borked"' File.open File.join(path, "ATestCase.rb"), "w" do |f| f.puts s end File.open File.join(path, "ATestCase/Nested.rb"), "w" do |f| f.puts s end tc1 = tc2 = nil tc1 = Class.new(Minitest::Test) do def test_test1; assert true end def test_test2; assert false end # oh noes! def test_test3; assert true end tc2 = Class.new(Minitest::Test) do def test_test1; assert true end def test_test2; assert false end # oh noes! def test_test3; assert true end end end Object.const_set(:ATestCase, tc1) ATestCase.const_set(:Nested, tc2) @tus = [tc1, tc2] assert_equal %w(test_test3 test_test1), ATestCase.runnable_methods assert_equal %w(test_test1 test_test3), ATestCase::Nested.runnable_methods expected = <<-EOM.gsub(/^ {8}/, '') ATestCase#test_test1 = 0.00 s = . ATestCase#test_test3 = 0.00 s = . ATestCase::Nested#test_test1 = 0.00 s = . ATestCase::Nested#test_test3 = 0.00 s = . Finished in 0.00 4 runs, 4 assertions, 0 failures, 0 errors, 0 skips EOM assert_report expected, %w[--seed 42 --verbose] end ensure Minitest::Test::EXCLUDE_DIR.replace(old_exclude_base) end end minitest-excludes-2.0.0/checksums.yaml.gz.sig0000444000175000017500000000040012545557362020564 0ustar miguelmiguel)ԯK) w_fBSu?գw,*$67ںch4k:fD" 6\}{G1"e+Ep4=( - !ruby/object:Gem::Version version: '4.0' type: :runtime prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - ~> - !ruby/object:Gem::Version version: '4.0' - !ruby/object:Gem::Dependency name: rdoc requirement: !ruby/object:Gem::Requirement requirements: - - ~> - !ruby/object:Gem::Version version: '4.0' type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - ~> - !ruby/object:Gem::Version version: '4.0' - !ruby/object:Gem::Dependency name: hoe requirement: !ruby/object:Gem::Requirement requirements: - - ~> - !ruby/object:Gem::Version version: '3.13' type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - ~> - !ruby/object:Gem::Version version: '3.13' description: |- minitest/excludes.rb extends MiniTest::Unit::TestCase to provide a clean API for excluding certain tests you don't want to run under certain conditions. email: - ryand-ruby@zenspider.com executables: [] extensions: [] extra_rdoc_files: - History.txt - Manifest.txt - README.txt files: - .autotest - .gemtest - History.txt - Manifest.txt - README.txt - Rakefile - lib/minitest/excludes.rb - test/metametameta.rb - test/test_minitest_excludes.rb homepage: https://github.com/seattlerb/minitest-excludes licenses: - MIT metadata: {} post_install_message: rdoc_options: - --main - README.txt require_paths: - lib required_ruby_version: !ruby/object:Gem::Requirement requirements: - - '>=' - !ruby/object:Gem::Version version: '0' required_rubygems_version: !ruby/object:Gem::Requirement requirements: - - '>=' - !ruby/object:Gem::Version version: '0' requirements: [] rubyforge_project: rubygems_version: 2.4.5 signing_key: specification_version: 4 summary: minitest/excludes.rb extends MiniTest::Unit::TestCase to provide a clean API for excluding certain tests you don't want to run under certain conditions. test_files: - test/test_minitest_excludes.rb minitest-excludes-2.0.0/Manifest.txt0000444000175000017500000000020412545557362017024 0ustar miguelmiguel.autotest History.txt Manifest.txt README.txt Rakefile lib/minitest/excludes.rb test/metametameta.rb test/test_minitest_excludes.rb minitest-excludes-2.0.0/data.tar.gz.sig0000444000175000017500000000040012545557362017334 0ustar miguelmiguel$qKe/ߛ˂SJ2q^\<ՊHX闲k߶}JC *̫Rťp@ ls%DF̣o҉!wΰ9YoGS/_*D-E똷Ϳhy9SV޹؆C'AXQuB ꫖c"\Pى'Ώ»GەX=U"9GN/c150#+&h5q