minitest-excludes-2.0.2/0000755000004100000410000000000014346410725015217 5ustar www-datawww-dataminitest-excludes-2.0.2/test/0000755000004100000410000000000014346410725016176 5ustar www-datawww-dataminitest-excludes-2.0.2/test/metametameta.rb0000444000004100000410000000351014346410725021164 0ustar www-datawww-datarequire '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.2/test/test_minitest_excludes.rb0000444000004100000410000000325014346410725023310 0ustar www-datawww-datarequire 'test/metametameta' require 'minitest/excludes' class TestMinitestExcludes < MetaMetaMetaTestCase def test_cls_excludes Minitest.seed = 42 if Minitest.respond_to?(:seed=) 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.write File.join(path, "ATestCase.rb"), s File.write File.join(path, "ATestCase/Nested.rb"), s 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_test1 test_test3), ATestCase.runnable_methods.sort assert_equal %w(test_test1 test_test3), ATestCase::Nested.runnable_methods.sort expected = <<-EOM.gsub(/^ {8}/, '') ATestCase#test_test3 = 0.00 s = . ATestCase#test_test1 = 0.00 s = . ATestCase::Nested#test_test3 = 0.00 s = . ATestCase::Nested#test_test1 = 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.2/data.tar.gz.sig0000444000004100000410000000040014346410724020027 0ustar www-datawww-datalȿ?&HZv\SCq Ɇ4Mj>!4)!o$ s KyǬ\CtyۘǔgUTĕ6xߤ]$H-\$*t<| ɚ^3ӌEHSOԉG?FsusSjv+~m܁֦j-+6 JLӟ/bNpJ-9B'"Q43LIFGminitest-excludes-2.0.2/metadata.gz.sig0000444000004100000410000000040014346410724020111 0ustar www-datawww-data XHP CekӾM<=cx>SܖVpcJ,K#,jC_quk{Q.#Ъ6Cug,Mn]Q6yt>yRO[XQߜbPaX=me &4qV_ gy'@V|=vR1I' ׶*"Q=Ӳ8ozJ"Б1zʈq<~.m]iminitest-excludes-2.0.2/checksums.yaml.gz.sig0000444000004100000410000000040014346410724021257 0ustar www-datawww-databM"k}BY+˰9Bͦ}( >$Sq*:]d'H$lynynxd*lA%'M{qUT@2UPm9*lAUsb(~شUw06m/a[ñOw iPjSHo;4=Wp1{30 i LYXY&`gQAzٻOm0Iminitest-excludes-2.0.2/History.txt0000444000004100000410000000161314346410725017420 0ustar www-datawww-data=== 2.0.2 / 2022-10-06 * 1 bug fix: * Updated minitest 4 references to minitest 5. === 2.0.1 / 2018-03-23 * 2 bug fixes: * Fixed OLD require paths * Updated deps for MT5. === 2.0.0 / 2015-02-02 * 1 major enhancement: * Updated for minitest 5. === 1.0.2 / 2013-04-22 * 1 bug fix: * Fixed dependency on minitest to the 4.x family. === 1.0.1 / 2012-02-22 * 2 bug fixes: * Fixed instance_eval for better error reporting. (headius) * Use undef_method to wipe tests brought in via modules. (headius) === 1.0.0 / 2011-12-20 * 1 major enhancement: * Split minitest/excludes.rb out to its own gem. (aka Birthday) * 3 minor enhancements: * Don't keep using the env var, since bad tests may modify ENV w/o restoring it. (headius) * Map X::Y to X/Y.rb for excludes to deal with nested test classes. * Remove method instead of generating a skip to avoid setup/teardown overhead. minitest-excludes-2.0.2/.autotest0000444000004100000410000000103014346410725017060 0ustar www-datawww-data# -*- ruby -*- require "autotest/restart" Autotest.add_hook :initialize do |at| at.testlib = "minitest/autorun" at.add_exception "tmp" # at.extra_files << "../some/external/dependency.rb" # # at.libs << ":../some/external" # # at.add_exception "vendor" # # at.add_mapping(/dependency.rb/) do |f, _| # at.files_matching(/test_.*rb$/) # end # # %w(TestA TestB).each do |klass| # at.extra_class_map[klass] = "test/test_misc.rb" # end end # Autotest.add_hook :run_command do |at| # system "rake build" # end minitest-excludes-2.0.2/README.txt0000444000004100000410000000356714346410725016726 0ustar www-datawww-data= minitest-excludes home :: https://github.com/seattlerb/minitest-excludes rdoc :: http://docs.seattlerb.org/minitest-excludes == DESCRIPTION: minitest/excludes.rb extends Minitest::Test 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::Test 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.2/Rakefile0000444000004100000410000000043414346410725016663 0ustar www-datawww-data# -*- 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", "~> 5.0" end # vim: syntax=ruby minitest-excludes-2.0.2/lib/0000755000004100000410000000000014346410725015765 5ustar www-datawww-dataminitest-excludes-2.0.2/lib/minitest/0000755000004100000410000000000014346410725017621 5ustar www-datawww-dataminitest-excludes-2.0.2/lib/minitest/excludes.rb0000444000004100000410000000346714346410725021772 0ustar www-datawww-datarequire 'minitest/test' module Minitest::Excludes # :nodoc: VERSION = "2.0.2" # :nodoc: end ## # minitest/excludes.rb extends Minitest::Test to provide a # clean API for excluding certain tests you don't want to run under # certain conditions. # # For example, in test/test_xyz.rb you have: # # class TestXYZ < Minitest::Test # 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? # # The file is instance_eval'd on TestXYZ so you can call the exclude # class method directly. Since it is ruby you can provide any sort # of conditions you want to figure out if your tests should be # excluded. # # TestCase.exclude removes test methods entirely so they don't run # setup/teardown at all. # # If you want to change where the exclude files are located, you can # set the EXCLUDE_DIR environment variable. class Minitest::Test EXCLUDE_DIR = ENV['EXCLUDE_DIR'] || "test/excludes" ## # Exclude a test from a testcase. This is intended to be used by # exclusion files. def self.exclude name, reason return warn "Method #{self}##{name} is not defined" unless method_defined? name undef_method name end ## # Loads the exclusion file for the class, if any. def self.load_excludes @__load_excludes__ ||= begin if name and not name.empty? then file = File.join EXCLUDE_DIR, "#{name.gsub(/::/, '/')}.rb" instance_eval File.read(file), file if File.exist? file end true end end class << self alias :old_runnable_methods :runnable_methods # :nodoc: def runnable_methods # :nodoc: load_excludes old_runnable_methods end end end minitest-excludes-2.0.2/minitest-excludes.gemspec0000644000004100000410000000633414346410725022240 0ustar www-datawww-data######################################################### # This file has been automatically generated by gem2tgz # ######################################################### # -*- encoding: utf-8 -*- # stub: minitest-excludes 2.0.2 ruby lib Gem::Specification.new do |s| s.name = "minitest-excludes".freeze s.version = "2.0.2" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.metadata = { "homepage_uri" => "https://github.com/seattlerb/minitest-excludes" } if s.respond_to? :metadata= s.require_paths = ["lib".freeze] s.authors = ["Ryan Davis".freeze] s.cert_chain = ["-----BEGIN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mxn4h9YO/pVdB962BdBNNDia0kgIjI3ENnkLq0dKpYU3+F3KhEuTksLO0L6X/V\nYsuyUzsMz6GQA4khyaMgKNSD\n-----END CERTIFICATE-----\n".freeze] s.date = "2022-10-06" s.description = "minitest/excludes.rb extends Minitest::Test to provide a\nclean API for excluding certain tests you don't want to run under\ncertain conditions.".freeze s.email = ["ryand-ruby@zenspider.com".freeze] s.extra_rdoc_files = ["History.txt".freeze, "Manifest.txt".freeze, "README.txt".freeze] s.files = [".autotest".freeze, "History.txt".freeze, "Manifest.txt".freeze, "README.txt".freeze, "Rakefile".freeze, "lib/minitest/excludes.rb".freeze, "test/metametameta.rb".freeze, "test/test_minitest_excludes.rb".freeze] s.homepage = "https://github.com/seattlerb/minitest-excludes".freeze s.licenses = ["MIT".freeze] s.rdoc_options = ["--main".freeze, "README.txt".freeze] s.rubygems_version = "3.2.5".freeze s.summary = "minitest/excludes.rb extends Minitest::Test to provide a clean API for excluding certain tests you don't want to run under certain conditions.".freeze if s.respond_to? :specification_version then s.specification_version = 4 end if s.respond_to? :add_runtime_dependency then s.add_development_dependency(%q.freeze, ["~> 3.25"]) s.add_runtime_dependency(%q.freeze, ["~> 5.0"]) s.add_development_dependency(%q.freeze, [">= 4.0", "< 7"]) else s.add_dependency(%q.freeze, ["~> 3.25"]) s.add_dependency(%q.freeze, ["~> 5.0"]) s.add_dependency(%q.freeze, [">= 4.0", "< 7"]) end end minitest-excludes-2.0.2/Manifest.txt0000444000004100000410000000020414346410725017520 0ustar www-datawww-data.autotest History.txt Manifest.txt README.txt Rakefile lib/minitest/excludes.rb test/metametameta.rb test/test_minitest_excludes.rb