minitest-excludes-2.0.3/0000755000004100000410000000000014735061017015216 5ustar www-datawww-dataminitest-excludes-2.0.3/Manifest.txt0000444000004100000410000000020414735061017017517 0ustar www-datawww-data.autotest History.txt Manifest.txt README.txt Rakefile lib/minitest/excludes.rb test/metametameta.rb test/test_minitest_excludes.rb minitest-excludes-2.0.3/.autotest0000444000004100000410000000103014735061017017057 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.3/README.txt0000444000004100000410000000356714735061017016725 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.3/minitest-excludes.gemspec0000644000004100000410000000633314735061017022236 0ustar www-datawww-data######################################################### # This file has been automatically generated by gem2tgz # ######################################################### # -*- encoding: utf-8 -*- # stub: minitest-excludes 2.0.3 ruby lib Gem::Specification.new do |s| s.name = "minitest-excludes".freeze s.version = "2.0.3" 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 CERTIFICATE-----\nMIIDPjCCAiagAwIBAgIBCDANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu\nZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB\nGRYDY29tMB4XDTI0MDEwMjIxMjEyM1oXDTI1MDEwMTIxMjEyM1owRTETMBEGA1UE\nAwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS\nJomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda\nb9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx\ntaCPaLmfYIaFcHHCSY4hYDJijRQkLxPeB3xbOfzfLoBDbjvx5JxgJxUjmGa7xhcT\noOvjtt5P8+GSK9zLzxQP0gVLS/D0FmoE44XuDr3iQkVS2ujU5zZL84mMNqNB1znh\nGiadM9GHRaDiaxuX0cIUBj19T01mVE2iymf9I6bEsiayK/n6QujtyCbTWsAS9Rqt\nqhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV\ngBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw\nHQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBCwUAA4IB\nAQCygvpmncmkiSs9r/Kceo4bBPDszhTv6iBi4LwMReqnFrpNLMOWJw7xi8x+3eL2\nXS09ZPNOt2zm70KmFouBMgOysnDY4k2dE8uF6B8JbZOO8QfalW+CoNBliefOTcn2\nbg5IOP7UoGM5lC174/cbDJrJnRG9bzig5FAP0mvsgA8zgTRXQzIUAZEo92D5K7p4\nB4/O998ho6BSOgYBI9Yk1ttdCtti6Y+8N9+fZESsjtWMykA+WXWeGUScHqiU+gH8\nS7043fq9EbQdBr2AXdj92+CDwuTfHI6/Hj5FVBDULufrJaan4xUgL70Hvc6pTTeW\ndeKfBjgVAq7EYHu1AczzlUly\n-----END CERTIFICATE-----\n".freeze] s.date = "2024-07-23" 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.3.15".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, ["~> 4.2"]) s.add_runtime_dependency(%q.freeze, ["~> 5.0"]) s.add_development_dependency(%q.freeze, [">= 4.0", "< 7"]) else s.add_dependency(%q.freeze, ["~> 4.2"]) s.add_dependency(%q.freeze, ["~> 5.0"]) s.add_dependency(%q.freeze, [">= 4.0", "< 7"]) end end minitest-excludes-2.0.3/lib/0000755000004100000410000000000014735061017015764 5ustar www-datawww-dataminitest-excludes-2.0.3/lib/minitest/0000755000004100000410000000000014735061017017620 5ustar www-datawww-dataminitest-excludes-2.0.3/lib/minitest/excludes.rb0000444000004100000410000000347014735061017021763 0ustar www-datawww-datarequire 'minitest/test' module Minitest::Excludes # :nodoc: VERSION = "2.0.3" # :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.3/test/0000755000004100000410000000000014735061017016175 5ustar www-datawww-dataminitest-excludes-2.0.3/test/test_minitest_excludes.rb0000444000004100000410000000325014735061017023307 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.3/test/metametameta.rb0000444000004100000410000000351114735061017021164 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.3/History.txt0000444000004100000410000000175214735061017017423 0ustar www-datawww-data=== 2.0.3 / 2024-07-23 * 1 bug fix: * Fix errors created when string literals are frozen. === 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.3/checksums.yaml.gz.sig0000444000004100000410000000040014735061017021257 0ustar www-datawww-data ٛ1  'Vw4Ĺ.;5o[sAq6̭(p֋J*j<[޽G|c4x)z41.n2Iő| 2minitest-excludes-2.0.3/Rakefile0000444000004100000410000000045514735061017016665 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" license "MIT" end # vim: syntax=ruby minitest-excludes-2.0.3/data.tar.gz.sig0000444000004100000410000000040014735061017020027 0ustar www-datawww-data=<&T9<7ԷeӯJ㭉C%Ţ" Q7<5PTSԵaS5WYrHAGQWC2P3b@^gAw&;/zm"+H ?>YʎӮRhONVV%d|y2o/^. z8R8{Vv{u3 opgHdV'bNcs#1~ͷΐŗ$pzj4u3QSJ_aminitest-excludes-2.0.3/metadata.gz.sig0000444000004100000410000000040014735061017020111 0ustar www-datawww-datat%9PQ$T.+5[}qN2YD; i:x:9y"_(Xv?/=~,{vj2f kᅟ,A)PH,C%IWbɛXӻoʹ%98EpZb+{}vR;~V2SKjʷG}RAդBdǞKJj !qg"'gKMާYx`,0.{s6JRL