minitest-focus-1.4.0/0000755000004100000410000000000014574727553014540 5ustar www-datawww-dataminitest-focus-1.4.0/Manifest.txt0000444000004100000410000000020614574727553017043 0ustar www-datawww-data.autotest History.txt Manifest.txt README.txt Rakefile lib/minitest/focus.rb lib/minitest/focus_plugin.rb test/minitest/test_focus.rb minitest-focus-1.4.0/.autotest0000444000004100000410000000104014574727553016402 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-focus-1.4.0/README.txt0000444000004100000410000000452614574727553016243 0ustar www-datawww-data= minitest-focus home :: https://github.com/seattlerb/minitest-focus rdoc :: http://docs.seattlerb.org/minitest-focus == DESCRIPTION: Allows you to focus on a few tests with ease without having to use command-line arguments. Good for tools like guard that don't have enough brains to understand test output. Cf. minitest-autotest (an example of a test runner with strong testing logic). Inspired by https://github.com/seattlerb/minitest/issues/213 == FEATURES/PROBLEMS: * `focus` class method allows you to specify that the next test defined should be run. * Use --no-focus to temporarily disable or override with --name arguments. == SYNOPSIS: require "minitest/autorun" require "minitest/focus" class MyTest < Minitest::Test def test_unrelated; ...; end # will NOT run focus def test_method2; ...; end # will run (direct--preferred) focus def test_method; ...; end # will run (indirect) def test_method_edgecase; ...; end # will NOT run end # or, with spec-style: describe "MyTest2" do focus; it "does something" do pass end focus it("does something else") { pass } # block precedence needs {} end == REQUIREMENTS: * minitest 5+ == INSTALL: * sudo gem install minitest-focus == 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-focus-1.4.0/lib/0000755000004100000410000000000014574727553015306 5ustar www-datawww-dataminitest-focus-1.4.0/lib/minitest/0000755000004100000410000000000014574727553017142 5ustar www-datawww-dataminitest-focus-1.4.0/lib/minitest/focus.rb0000444000004100000410000000223014574727553020601 0ustar www-datawww-datarequire "minitest/test" class Minitest::Test # :nodoc: class Focus # :nodoc: VERSION = "1.4.0" # :nodoc: end @@filtered_names = [] # :nodoc: def self.add_to_filter name @@filtered_names << "#{self}##{name}" end def self.filtered_names @@filtered_names end ## # Focus on the next test defined. Cumulative. Equivalent to # running with command line arg: -n /test_name|.../ # # class MyTest < Minitest::Test # # # direct approach # focus def test_method1 # will run # ... # end # # # indirect approach # focus # def test_method2 # will run # ... # end # # def test_method3 # will NOT run # ... # end # end def self.focus name = nil if name then add_to_filter name else set_focus_trap end end ## # Sets a one-off method_added callback to set focus on the method # defined next. def self.set_focus_trap meta = class << self; self; end meta.send :define_method, :method_added do |name| add_to_filter name meta.send :remove_method, :method_added end end end minitest-focus-1.4.0/lib/minitest/focus_plugin.rb0000444000004100000410000000135714574727553022170 0ustar www-datawww-data# frozen_string_literal: true module Minitest def self.plugin_focus_options opts, options opts.on "--no-focus", "Disable `focus` calls in tests." do |n| @nofocus = true end end def self.plugin_focus_init options # :nodoc: return unless Minitest::Test.respond_to? :filtered_names return if Minitest::Test.filtered_names.empty? if options[:filter] then order = %w[ `focus` --name ] a, b = @nofocus ? order : order.reverse extra = " Use --no-focus to override." unless @nofocus warn "Ignoring #{a} filters in favor of #{b} filters.#{extra}" warn "" end return if @nofocus re = "/^(#{Regexp.union(Minitest::Test.filtered_names).source})$/" options[:filter] = re end end minitest-focus-1.4.0/test/0000755000004100000410000000000014574727553015517 5ustar www-datawww-dataminitest-focus-1.4.0/test/minitest/0000755000004100000410000000000014574727553017353 5ustar www-datawww-dataminitest-focus-1.4.0/test/minitest/test_focus.rb0000444000004100000410000000126314574727553022056 0ustar www-datawww-datarequire "minitest/autorun" require "minitest/focus" class MyTest1 < Minitest::Test def test_fail; flunk; end focus; def test_method; pass; end focus def test_method2; pass; end focus \ def test_method3; pass; end def test_method_edgecase; flunk; end end describe "MyTest2" do it "is ignored" do flunk end focus; it "does something" do pass end focus it("does something else") { pass } # stupid block precedence needs {} it "bombs" do flunk end focus; it "has non-word ['chars'" do pass end # Will raise invalid RegExp unless correctly escaped end minitest-focus-1.4.0/History.txt0000444000004100000410000000175714574727553016752 0ustar www-datawww-data=== 1.4.0 / 2023-07-11 * 1 minor enhancement: * Added --no-focus flag to disable focus and allow --name args to override. === 1.3.1 / 2021-05-26 * 1 bug fix: * Fixed missing require. (ryanseys) === 1.3.0 / 2021-05-22 * 1 major enhancement: * Removed minitest4 support. * 2 minor enhancements: * Added support for `focus def test_method`. * Improved documentation for both test- and spec-style. === 1.2.1 / 2020-06-14 * 1 bug fix: * Prevent a crash if the gem is installed but never required. (dazuma) === 1.2.0 / 2020-05-15 * 1 major enhancement: * Converted to a minitest plugin. (jbourassa) === 1.1.2 / 2015-07-25 * 1 bug fix: * Fixed focus handling when run under Rake's rake_test_loader.rb. === 1.1.1 / 2015-03-12 * 1 minor enhancement: * Escape method names in filter regexp. (ddiachkov) === 1.1.0 / 2013-11-07 * 1 major enhancement: * Minitest 5 compatibility. * Still works on minitest 4. === 1.0.0 / 2013-01-07 * 1 major enhancement * Birthday! minitest-focus-1.4.0/checksums.yaml.gz.sig0000444000004100000410000000040014574727553020601 0ustar www-datawww-data Sz3z_pA<~׽xMqgi 9v|n̮hj#ou-sxXeIؽaFZ 6>w_9 V|I436 @! ևx2AبK\pZl[Z@ /KJs,QtC >怺D,¥WGB=vY{|BPY&d)"d`Uminitest-focus-1.4.0/Rakefile0000444000004100000410000000046014574727553016203 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-focus" do developer "Ryan Davis", "ryand-ruby@zenspider.com" license "MIT" dependency "minitest", [">= 4", "< 6"] end # vim: syntax=ruby minitest-focus-1.4.0/data.tar.gz.sig0000444000004100000410000000040014574727553017351 0ustar www-datawww-dataj\iF(\S4 o]I&b-!֔rfW+1tyпp>Mgh%ȤQNbE:=p 6ĶqkڻJMG׊'!-6:}S* ߻2'Zpn05};˗j& l-sVy/@C5h98=3]1iA"4Jv]}qZMmN/P*du6nY= 0".freeze) if s.respond_to? :required_rubygems_version= s.metadata = { "homepage_uri" => "https://github.com/seattlerb/minitest-focus" } if s.respond_to? :metadata= s.require_paths = ["lib".freeze] s.authors = ["Ryan Davis".freeze] s.cert_chain = ["-----BEGIN CERTIFICATE-----\nMIIDPjCCAiagAwIBAgIBBzANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu\nZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB\nGRYDY29tMB4XDTIzMDEwMTA3NTExN1oXDTI0MDEwMTA3NTExN1owRTETMBEGA1UE\nAwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS\nJomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda\nb9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx\ntaCPaLmfYIaFcHHCSY4hYDJijRQkLxPeB3xbOfzfLoBDbjvx5JxgJxUjmGa7xhcT\noOvjtt5P8+GSK9zLzxQP0gVLS/D0FmoE44XuDr3iQkVS2ujU5zZL84mMNqNB1znh\nGiadM9GHRaDiaxuX0cIUBj19T01mVE2iymf9I6bEsiayK/n6QujtyCbTWsAS9Rqt\nqhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV\ngBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw\nHQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBCwUAA4IB\nAQAkg3y+PBnBAPWdxxITm5sPHqdWQgSyCpRA20o4LTuWr8BWhSXBkfQNa7cY6fOn\nxyM34VPzBFbExv6XOGDfOMFBVaYTHuN9peC/5/umL7kLl+nflXzL2QA7K6LYj5Bg\nsM574Onr0dZDM6Vn69bzQ7rBIFDfK/OhlPzqKZad4nsdcsVH8ODCiT+ATMIZyz5K\nWCnNtqlyiWXI8tdTpahDgcUwfcN/oN7v4K8iU5IbLJX6HQ5DKgmKjfb6XyMth16k\nROfWo9Uyp8ba/j9eVG14KkYRaLydAY1MNQk2yd3R5CGfeOpD1kttxjoypoUJ2dOG\nnsNBRuQJ1UfiCG97a6DNm+Fr\n-----END CERTIFICATE-----\n".freeze] s.date = "2023-07-12" s.description = "Allows you to focus on a few tests with ease without having to use\ncommand-line arguments. Good for tools like guard that don't have\nenough brains to understand test output. Cf. minitest-autotest (an\nexample of a test runner with strong testing logic).\n\nInspired by https://github.com/seattlerb/minitest/issues/213".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/focus.rb".freeze, "lib/minitest/focus_plugin.rb".freeze, "test/minitest/test_focus.rb".freeze] s.homepage = "https://github.com/seattlerb/minitest-focus".freeze s.licenses = ["MIT".freeze] s.rdoc_options = ["--main".freeze, "README.txt".freeze] s.rubygems_version = "3.3.15".freeze s.summary = "Allows you to focus on a few tests with ease without having to use command-line arguments".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.0"]) s.add_runtime_dependency(%q.freeze, [">= 4", "< 6"]) s.add_development_dependency(%q.freeze, [">= 4.0", "< 7"]) else s.add_dependency(%q.freeze, ["~> 4.0"]) s.add_dependency(%q.freeze, [">= 4", "< 6"]) s.add_dependency(%q.freeze, [">= 4.0", "< 7"]) end end minitest-focus-1.4.0/metadata.gz.sig0000444000004100000410000000040014574727553017433 0ustar www-datawww-datay}DmG/FϮ}z(ʥ#E 0BF;QzL`> vlCNA~Pip%45uN2Q%wADb [NGqtDk%U:'fP_Ɂscߝ