minitest-excludes-2.0.1/0000755000004100000410000000000013411314731015206 5ustar www-datawww-dataminitest-excludes-2.0.1/test/0000755000004100000410000000000013411314731016165 5ustar www-datawww-dataminitest-excludes-2.0.1/test/metametameta.rb0000444000004100000410000000351013411314731021153 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.1/test/test_minitest_excludes.rb0000444000004100000410000000325613411314731023305 0ustar www-datawww-datarequire '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.1/data.tar.gz.sig0000444000004100000410000000040013411314731020017 0ustar www-datawww-datad2$k5m> u8$h)&Y hZ aTOϛGV#d$->%'!]0?|hYؒq0a!=h5;NH_`V`>|N>?EmX:MW_S{k$@[7ѳOCgRҗebT{U.Q#=bZ%>hC'ԃlHҰ3#RYo#׊(' +A!ud_D|fminitest-excludes-2.0.1/metadata.gz.sig0000444000004100000410000000040013411314731020101 0ustar www-datawww-data6:Xihә,XKm mr#dgw# 2&'DJPklɮ\QK 5rceW7&@FU9v$ʗ>0O@;l ]3ݴd vQo/ŕ(S&B]mL! Q2 hcܚװa_KDY~j2lZૌ/  ͞L 5g劷bأAV+'}U=minitest-excludes-2.0.1/checksums.yaml.gz.sig0000444000004100000410000000040013411314731021247 0ustar www-datawww-data#'HNR8h@ʠ _zZB[ G5seF ,JK9(OHLbDL׻km#ͩͬivSN#[Nm]!L\>,b[.t{gQd,RroN}u2x #Kq+ i[0eP}0?agZ4O?)?D|wCZ DH ]minitest-excludes-2.0.1/History.txt0000444000004100000410000000146413411314731017413 0ustar www-datawww-data=== 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.1/.autotest0000444000004100000410000000103013411314731017047 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.1/README.txt0000444000004100000410000000361313411314731016705 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::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.1/Rakefile0000444000004100000410000000043413411314731016652 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.1/lib/0000755000004100000410000000000013411314731015754 5ustar www-datawww-dataminitest-excludes-2.0.1/lib/minitest/0000755000004100000410000000000013411314731017610 5ustar www-datawww-dataminitest-excludes-2.0.1/lib/minitest/excludes.rb0000444000004100000410000000351313411314731021751 0ustar www-datawww-datarequire 'minitest/test' module Minitest::Excludes # :nodoc: VERSION = "2.0.1" # :nodoc: end ## # 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. # # For example, in test/test_xyz.rb you have: # # 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? # # 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.1/minitest-excludes.gemspec0000644000004100000410000000647313411314731022233 0ustar www-datawww-data######################################################### # This file has been automatically generated by gem2tgz # ######################################################### # -*- encoding: utf-8 -*- # stub: minitest-excludes 2.0.1 ruby lib Gem::Specification.new do |s| s.name = "minitest-excludes".freeze s.version = "2.0.1" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.require_paths = ["lib".freeze] s.authors = ["Ryan Davis".freeze] s.cert_chain = ["-----BEGIN CERTIFICATE-----\nMIIDPjCCAiagAwIBAgIBAjANBgkqhkiG9w0BAQUFADBFMRMwEQYDVQQDDApyeWFu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CERTIFICATE-----\n".freeze] s.date = "2018-03-23" s.description = "minitest/excludes.rb extends MiniTest::Unit::TestCase 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 = "2.5.2.1".freeze s.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.".freeze if s.respond_to? :specification_version then s.specification_version = 4 if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then s.add_development_dependency(%q.freeze, ["~> 3.16"]) s.add_runtime_dependency(%q.freeze, ["~> 5.0"]) s.add_development_dependency(%q.freeze, ["~> 4.0"]) else s.add_dependency(%q.freeze, ["~> 3.16"]) s.add_dependency(%q.freeze, ["~> 5.0"]) s.add_dependency(%q.freeze, ["~> 4.0"]) end else s.add_dependency(%q.freeze, ["~> 3.16"]) s.add_dependency(%q.freeze, ["~> 5.0"]) s.add_dependency(%q.freeze, ["~> 4.0"]) end end minitest-excludes-2.0.1/Manifest.txt0000444000004100000410000000020413411314731017507 0ustar www-datawww-data.autotest History.txt Manifest.txt README.txt Rakefile lib/minitest/excludes.rb test/metametameta.rb test/test_minitest_excludes.rb