diff options
author | Jeremy Evans <[email protected]> | 2022-04-22 13:01:43 -0700 |
---|---|---|
committer | Jeremy Evans <[email protected]> | 2022-04-22 15:00:16 -0700 |
commit | ab3cb29bd9bff9c16cfb9d19cc02026998282c12 (patch) | |
tree | 6127856f758af8ff4b435f845c2777e0f478ca94 /test/optparse | |
parent | c2d38a0d2d78f749fba47073b33106fd2e57767a (diff) |
Avoid defining the same test class in multiple files
Should fix issues with parallel testing sometimes not running all
tests.
This should be viewed skipping whitespace changes.
Fixes [Bug #18731]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5839
Diffstat (limited to 'test/optparse')
-rw-r--r-- | test/optparse/test_acceptable.rb | 2 | ||||
-rw-r--r-- | test/optparse/test_autoconf.rb | 4 | ||||
-rw-r--r-- | test/optparse/test_bash_completion.rb | 4 | ||||
-rw-r--r-- | test/optparse/test_cclass.rb | 2 | ||||
-rw-r--r-- | test/optparse/test_did_you_mean.rb | 2 | ||||
-rw-r--r-- | test/optparse/test_getopts.rb | 4 | ||||
-rw-r--r-- | test/optparse/test_kwargs.rb | 4 | ||||
-rw-r--r-- | test/optparse/test_noarg.rb | 6 | ||||
-rw-r--r-- | test/optparse/test_optarg.rb | 2 | ||||
-rw-r--r-- | test/optparse/test_placearg.rb | 2 | ||||
-rw-r--r-- | test/optparse/test_reqarg.rb | 10 | ||||
-rw-r--r-- | test/optparse/test_summary.rb | 2 | ||||
-rw-r--r-- | test/optparse/test_zsh_completion.rb | 4 |
13 files changed, 19 insertions, 29 deletions
diff --git a/test/optparse/test_acceptable.rb b/test/optparse/test_acceptable.rb index 12f7886538..12f5322726 100644 --- a/test/optparse/test_acceptable.rb +++ b/test/optparse/test_acceptable.rb @@ -1,7 +1,7 @@ # frozen_string_literal: false require_relative 'test_optparse' -class TestOptionParser::Acceptable < TestOptionParser +class TestOptionParserAcceptable < TestOptionParser def setup super diff --git a/test/optparse/test_autoconf.rb b/test/optparse/test_autoconf.rb index 45f2ba09b2..ec87744633 100644 --- a/test/optparse/test_autoconf.rb +++ b/test/optparse/test_autoconf.rb @@ -2,9 +2,7 @@ require 'test/unit' require 'optparse/ac' -class TestOptionParser < Test::Unit::TestCase; end - -class TestOptionParser::AutoConf < Test::Unit::TestCase +class TestOptionParserAutoConf < Test::Unit::TestCase def setup @opt = OptionParser::AC.new @foo = @bar = self.class diff --git a/test/optparse/test_bash_completion.rb b/test/optparse/test_bash_completion.rb index 513e986f66..60c82f7136 100644 --- a/test/optparse/test_bash_completion.rb +++ b/test/optparse/test_bash_completion.rb @@ -2,9 +2,7 @@ require 'test/unit' require 'optparse' -class TestOptionParser < Test::Unit::TestCase -end -class TestOptionParser::BashCompletion < Test::Unit::TestCase +class TestOptionParserBashCompletion < Test::Unit::TestCase def setup @opt = OptionParser.new @opt.define("-z", "zzz") {} diff --git a/test/optparse/test_cclass.rb b/test/optparse/test_cclass.rb index ac46f46bb2..0ded61f60e 100644 --- a/test/optparse/test_cclass.rb +++ b/test/optparse/test_cclass.rb @@ -1,7 +1,7 @@ # frozen_string_literal: false require_relative 'test_optparse' -class TestOptionParser::CClass < TestOptionParser +class TestOptionParserCClass < TestOptionParser def test_no_argument flags = [] @opt.def_option("-[a-z]") {|x| flags << x} diff --git a/test/optparse/test_did_you_mean.rb b/test/optparse/test_did_you_mean.rb index 4c6da4f74e..3c923922ec 100644 --- a/test/optparse/test_did_you_mean.rb +++ b/test/optparse/test_did_you_mean.rb @@ -6,7 +6,7 @@ rescue LoadError return end -class TestOptionParser::DidYouMean < TestOptionParser +class TestOptionParserDidYouMean < TestOptionParser def setup super @opt.def_option("--foo", Integer) { |v| @foo = v } diff --git a/test/optparse/test_getopts.rb b/test/optparse/test_getopts.rb index 3711e6f269..7d9160f7af 100644 --- a/test/optparse/test_getopts.rb +++ b/test/optparse/test_getopts.rb @@ -2,9 +2,7 @@ require 'test/unit' require 'optparse' -class TestOptionParser < Test::Unit::TestCase -end -class TestOptionParser::Getopts < Test::Unit::TestCase +class TestOptionParserGetopts < Test::Unit::TestCase def setup @opt = OptionParser.new end diff --git a/test/optparse/test_kwargs.rb b/test/optparse/test_kwargs.rb index 78d7e2ee9c..2e826bfd12 100644 --- a/test/optparse/test_kwargs.rb +++ b/test/optparse/test_kwargs.rb @@ -3,9 +3,7 @@ require 'test/unit' require 'optparse' require 'optparse/kwargs' -class TestOptionParser < Test::Unit::TestCase -end -class TestOptionParser::KwArg < Test::Unit::TestCase +class TestOptionParserKwArg < Test::Unit::TestCase class K def initialize(host:, port: 8080) @host = host diff --git a/test/optparse/test_noarg.rb b/test/optparse/test_noarg.rb index 8f20519408..a53399afc2 100644 --- a/test/optparse/test_noarg.rb +++ b/test/optparse/test_noarg.rb @@ -1,7 +1,7 @@ # frozen_string_literal: false require_relative 'test_optparse' -module TestOptionParser::NoArg +module TestOptionParserNoArg def setup super @opt.def_option "--with_underscore" do |x| @flag = x end @@ -9,7 +9,7 @@ module TestOptionParser::NoArg end class Def1 < TestOptionParser - include NoArg + include TestOptionParserNoArg def setup super @opt.def_option("-x") {|x| @flag = x} @@ -17,7 +17,7 @@ module TestOptionParser::NoArg end end class Def2 < TestOptionParser - include NoArg + include TestOptionParserNoArg def setup super @opt.def_option("-x", "--option") {|x| @flag = x} diff --git a/test/optparse/test_optarg.rb b/test/optparse/test_optarg.rb index 14584f7e89..81127a8a37 100644 --- a/test/optparse/test_optarg.rb +++ b/test/optparse/test_optarg.rb @@ -1,7 +1,7 @@ # frozen_string_literal: false require_relative 'test_optparse' -class TestOptionParser::OptArg < TestOptionParser +class TestOptionParserOptArg < TestOptionParser def setup super @opt.def_option("-x[VAL]") {|x| @flag = x} diff --git a/test/optparse/test_placearg.rb b/test/optparse/test_placearg.rb index 8acfdb2161..94cfb0e819 100644 --- a/test/optparse/test_placearg.rb +++ b/test/optparse/test_placearg.rb @@ -1,7 +1,7 @@ # frozen_string_literal: false require_relative 'test_optparse' -class TestOptionParser::PlaceArg < TestOptionParser +class TestOptionParserPlaceArg < TestOptionParser def setup super @opt.def_option("-x [VAL]") {|x| @flag = x} diff --git a/test/optparse/test_reqarg.rb b/test/optparse/test_reqarg.rb index b2e4755f80..d5686d13aa 100644 --- a/test/optparse/test_reqarg.rb +++ b/test/optparse/test_reqarg.rb @@ -1,7 +1,7 @@ # frozen_string_literal: false require_relative 'test_optparse' -module TestOptionParser::ReqArg +module TestOptionParserReqArg def setup super @opt.def_option "--with_underscore=VAL" do |x| @flag = x end @@ -9,7 +9,7 @@ module TestOptionParser::ReqArg end class Def1 < TestOptionParser - include ReqArg + include TestOptionParserReqArg def setup super @opt.def_option("-xVAL") {|x| @flag = x} @@ -19,21 +19,21 @@ module TestOptionParser::ReqArg end end class Def2 < TestOptionParser - include ReqArg + include TestOptionParserReqArg def setup super @opt.def_option("-x", "--option=VAL") {|x| @flag = x} end end class Def3 < TestOptionParser - include ReqArg + include TestOptionParserReqArg def setup super @opt.def_option("--option=VAL", "-x") {|x| @flag = x} end end class Def4 < TestOptionParser - include ReqArg + include TestOptionParserReqArg def setup super @opt.def_option("-xVAL", "--option=VAL") {|x| @flag = x} diff --git a/test/optparse/test_summary.rb b/test/optparse/test_summary.rb index 67b05672d4..6b36ce3c76 100644 --- a/test/optparse/test_summary.rb +++ b/test/optparse/test_summary.rb @@ -1,7 +1,7 @@ # frozen_string_literal: false require_relative 'test_optparse' -class TestOptionParser::SummaryTest < TestOptionParser +class TestOptionParserSummaryTest < TestOptionParser def test_short_clash r = nil o = OptionParser.new do |opts| diff --git a/test/optparse/test_zsh_completion.rb b/test/optparse/test_zsh_completion.rb index c548d4af8a..76f0a73f32 100644 --- a/test/optparse/test_zsh_completion.rb +++ b/test/optparse/test_zsh_completion.rb @@ -2,9 +2,7 @@ require 'test/unit' require 'optparse' -class TestOptionParser < Test::Unit::TestCase -end -class TestOptionParser::ZshCompletion < Test::Unit::TestCase +class TestOptionParserZshCompletion < Test::Unit::TestCase def setup @opt = OptionParser.new @opt.define("-z", "zzz") {} |