test_launcher 2.25.0 → 2.28.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d48dd23ffd366923066ff7af6bac9db3498da3452cae8947baaf4b115b740fb
4
- data.tar.gz: 8a3f716b8565ba819d1ba07b63c23fffaf9610238806f6aa53bb3f43f6a168fe
3
+ metadata.gz: d701813c0d24be54c1c0f223458a92aeeabde95cb3e16f5566e109c974c65d9b
4
+ data.tar.gz: 23d5de708bc2c0149a84717b3f7aa32bc21337de5caf43d2eb58247e0953bbd6
5
5
  SHA512:
6
- metadata.gz: 2f43dddddba62e2c0eafb256ad3774301e04fc7deb3459391bd89f80f39125ffa0d2dcbd45f751aba7fc154cc74ab3e352a02fb23812a7be81dee5aaa8ef353d
7
- data.tar.gz: c0d58207139463c19f4bb610a0a9bf8d86e762088e22fc84e3fca6ba5ea437c17cc21e4d3e60142867c304a57c5661ace04649157cb0b0287cc5c408c24a74d5
6
+ metadata.gz: b0d5ffa22d663d1cef852209b0be15e4c56d449723d1a70d9728b6156116cac589dbacae882eb149c867f053357d8b238f29e0a79be3f2abffa125d81f2f3ef8
7
+ data.tar.gz: cf11dce1e04306f1e9e81f9378450ea6956df294136dcb8b7b948da142c986feb7044559e51101b5e04b24913adaef4f1ae203fde9a913a57a18ae45963eed4a
@@ -1,20 +1,39 @@
1
1
  module TestLauncher
2
2
  module CLI
3
- class Options < Struct.new(
4
- :search_string,
5
- :frameworks,
6
- :rerun,
7
- :run_all,
8
- :disable_spring,
9
- :force_spring,
10
- :example_name,
11
- :shell,
12
- :searcher
13
- )
14
- def initialize(**args)
15
- raise ArgumentError.new("These keys are allowed and required: #{members}") unless args.keys.sort == members.sort
16
- args.each { |k, v| self[k] = v }
3
+ class Options
4
+ attr_reader(
5
+ :disable_spring,
6
+ :example_name,
7
+ :force_spring,
8
+ :frameworks,
9
+ :rerun,
10
+ :run_all,
11
+ :search_string,
12
+ :searcher,
13
+ :shell
14
+ )
15
+ def initialize(
16
+ disable_spring:,
17
+ example_name:,
18
+ force_spring:,
19
+ frameworks:,
20
+ rerun:,
21
+ run_all:,
22
+ search_string:,
23
+ searcher:,
24
+ shell:
25
+ )
26
+ @disable_spring = disable_spring
27
+ @example_name = example_name
28
+ @force_spring = force_spring
29
+ @frameworks = frameworks
30
+ @rerun = rerun
31
+ @run_all = run_all
32
+ @search_string = search_string
33
+ @searcher = searcher
34
+ @shell = shell
17
35
  end
36
+
18
37
  end
19
38
  end
20
39
  end
@@ -51,12 +51,12 @@ module TestLauncher
51
51
  framework.searcher(@searcher)
52
52
  end
53
53
 
54
- def runner(*a)
55
- framework.runner(*a)
54
+ def runner(*a, **o)
55
+ framework.runner(*a, **o)
56
56
  end
57
57
 
58
- def test_case(*a)
59
- framework.test_case(*a)
58
+ def test_case(*a, **o)
59
+ framework.test_case(*a, **o)
60
60
  end
61
61
 
62
62
  def shell
@@ -6,7 +6,12 @@ require "test_launcher/cli/request"
6
6
 
7
7
  module TestLauncher
8
8
  module CLI
9
- class MultiFrameworkQuery < Struct.new(:cli_options)
9
+ class MultiFrameworkQuery
10
+ attr_reader :cli_options
11
+ def initialize(cli_options)
12
+ @cli_options = cli_options
13
+ end
14
+
10
15
  def command
11
16
  command = nil
12
17
  command_finders.each do |command_finder|
@@ -3,7 +3,12 @@ require "test_launcher/frameworks/implementation/test_case"
3
3
  module TestLauncher
4
4
  module Frameworks
5
5
  module Base
6
- class Searcher < Struct.new(:raw_searcher)
6
+ class Searcher
7
+ attr_reader :raw_searcher
8
+ def initialize(raw_searcher, **)
9
+ @raw_searcher = raw_searcher
10
+ end
11
+
7
12
  def test_files(query)
8
13
  raw_searcher
9
14
  .find_files(query)
@@ -38,6 +43,10 @@ module TestLauncher
38
43
  end
39
44
 
40
45
  class Runner
46
+ def initialize(*, **)
47
+ super()
48
+ end
49
+
41
50
  def by_line_number(test_case)
42
51
  raise NotImplementedError
43
52
  end
@@ -9,16 +9,16 @@ module TestLauncher
9
9
  `git ls-files '*.exs'`.split("\n").any?
10
10
  end
11
11
 
12
- def self.test_case(*a)
13
- TestCase.new(*a)
12
+ def self.test_case(*a, **o)
13
+ TestCase.new(*a, **o)
14
14
  end
15
15
 
16
- def self.searcher(*a)
17
- Searcher.new(*a)
16
+ def self.searcher(*a, **o)
17
+ Searcher.new(*a, **o)
18
18
  end
19
19
 
20
- def self.runner(*a)
21
- Runner.new(*a)
20
+ def self.runner(*a, **o)
21
+ Runner.new(*a, **o)
22
22
  end
23
23
 
24
24
  class Searcher < Base::Searcher
@@ -10,16 +10,16 @@ module TestLauncher
10
10
  true
11
11
  end
12
12
 
13
- def self.test_case(*a)
14
- TestCase.new(*a)
13
+ def self.test_case(*a, **o)
14
+ TestCase.new(*a, **o)
15
15
  end
16
16
 
17
- def self.searcher(*a)
18
- Searcher.new(*a)
17
+ def self.searcher(*a, **o)
18
+ Searcher.new(*a, **o)
19
19
  end
20
20
 
21
- def self.runner(*a)
22
- Runner.new(*a)
21
+ def self.runner(*a, **o)
22
+ Runner.new(*a, **o)
23
23
  end
24
24
 
25
25
  class Searcher < Base::Searcher
@@ -10,16 +10,16 @@ module TestLauncher
10
10
  `git ls-files '*_test.rb'`.split("\n").any?
11
11
  end
12
12
 
13
- def self.test_case(*a)
14
- TestCase.new(*a)
13
+ def self.test_case(*a, **o)
14
+ TestCase.new(*a, **o)
15
15
  end
16
16
 
17
- def self.searcher(*a)
18
- Searcher.new(*a)
17
+ def self.searcher(*a, **o)
18
+ Searcher.new(*a, **o)
19
19
  end
20
20
 
21
- def self.runner(*a)
22
- Runner.new(*a)
21
+ def self.runner(*a, **o)
22
+ Runner.new(*a, **o)
23
23
  end
24
24
 
25
25
  class Searcher < Base::Searcher
@@ -84,14 +84,14 @@ module TestLauncher
84
84
  end
85
85
 
86
86
  def multiple_files_error
87
- MultipleByLineMatches.new(<<-MSG)
88
- It looks like you are running a line number in a test file.
87
+ MultipleByLineMatches.new(<<~MSG)
88
+ It looks like you are running a line number in a test file.
89
89
 
90
- Multiple files have been found that match your query.
90
+ Multiple files have been found that match your query.
91
91
 
92
- This case is not supported for Minitest.
92
+ This case is not supported for Minitest.
93
93
 
94
- Open an issue on https://github.com/petekinnecom/test_launcher if this is something you have run into at least 3 times. :)
94
+ Open an issue on https://github.com/petekinnecom/test_launcher if this is something you have run into at least 3 times. :)
95
95
  MSG
96
96
  end
97
97
 
@@ -9,16 +9,16 @@ module TestLauncher
9
9
  `git ls-files '*pec.js'`.split("\n").any?
10
10
  end
11
11
 
12
- def self.test_case(*a)
13
- TestCase.new(*a)
12
+ def self.test_case(*a, **o)
13
+ TestCase.new(*a, **o)
14
14
  end
15
15
 
16
- def self.searcher(*a)
17
- Searcher.new(*a)
16
+ def self.searcher(*a, **o)
17
+ Searcher.new(*a, **o)
18
18
  end
19
19
 
20
- def self.runner(*a)
21
- Runner.new(*a)
20
+ def self.runner(*a, **o)
21
+ Runner.new(*a, **o)
22
22
  end
23
23
 
24
24
  class Searcher < Base::Searcher
@@ -9,16 +9,16 @@ module TestLauncher
9
9
  `git ls-files '*_spec.rb'`.split("\n").any?
10
10
  end
11
11
 
12
- def self.test_case(*a)
13
- TestCase.new(*a)
12
+ def self.test_case(*a, **o)
13
+ TestCase.new(*a, **o)
14
14
  end
15
15
 
16
- def self.searcher(*a)
17
- Searcher.new(*a)
16
+ def self.searcher(*a, **o)
17
+ Searcher.new(*a, **o)
18
18
  end
19
19
 
20
- def self.runner(*a)
21
- Runner.new(*a)
20
+ def self.runner(*a, **o)
21
+ Runner.new(*a, **o)
22
22
  end
23
23
 
24
24
  class Searcher < Base::Searcher
@@ -0,0 +1,64 @@
1
+ require "test_launcher/shell/runner"
2
+ require "test_launcher/rubymine/launcher"
3
+ require "test_launcher/rubymine/request"
4
+
5
+ # To allow us to simply specify our run configuration as:
6
+ #
7
+ # -r test_launcher/rubymine
8
+ #
9
+ # we need to put the currently executing script in with the args.
10
+ #
11
+ # Consider the following examples:
12
+ #
13
+ # ruby -r test_launcher/rubymine /path/to/test.rb
14
+ #
15
+ # vs
16
+ #
17
+ # ruby -r test_launcher/rubymine spring testunit /path/to/test.rb
18
+ #
19
+ # In one case, our test to run is $0 and in another case it's an ARGV.
20
+ # So we throw them in the same bucket and let the launcher figure it
21
+ # out. It doesn't matter since we will `exec` a new command anyway.
22
+
23
+ module TestLauncher
24
+ module Rubymine
25
+ module Parser
26
+ def self.launch(
27
+ shell: TestLauncher::Shell::Runner.new(log_path: "/dev/null"),
28
+ argv: ARGV,
29
+ env: ENV
30
+ )
31
+ request = Request.new(
32
+ disable_spring: env["DISABLE_SPRING"]
33
+ )
34
+
35
+ args = [$0].concat(argv).map { |arg|
36
+ if (
37
+ arg.match("minitest_runner.rb") &&
38
+ env.key?("INTELLIJ_IDEA_RUN_CONF_TEST_FILE_PATH")
39
+ )
40
+ arg.sub(
41
+ %r{/.+/minitest_runner.rb['"]?},
42
+ env.fetch("INTELLIJ_IDEA_RUN_CONF_TEST_FILE_PATH")
43
+ )
44
+ elsif (
45
+ arg.match("tunit_or_minitest_in_folder_runner.rb") &&
46
+ env.key?("INTELLIJ_IDEA_RUN_CONF_FOLDER_PATH"))
47
+ arg.sub(
48
+ %r{/.+/tunit_or_minitest_in_folder_runner.rb['"]?},
49
+ File.join(env.fetch("INTELLIJ_IDEA_RUN_CONF_FOLDER_PATH"), "**/*.rb")
50
+ )
51
+ else
52
+ arg
53
+ end
54
+ }
55
+
56
+ Launcher.new(
57
+ args: args,
58
+ shell: shell,
59
+ request: request
60
+ ).launch
61
+ end
62
+ end
63
+ end
64
+ end
@@ -1,41 +1,3 @@
1
- require "test_launcher/shell/runner"
2
- require "test_launcher/rubymine/launcher"
3
- require "test_launcher/rubymine/request"
1
+ require "test_launcher/rubymine/parser"
4
2
 
5
- # To allow us to simply specify our run configuration as:
6
- #
7
- # -r test_launcher/rubymine
8
- #
9
- # we need to put the currently executing script in with the args.
10
- #
11
- # Consider the following examples:
12
- #
13
- # ruby -r test_launcher/rubymine /path/to/test.rb
14
- #
15
- # vs
16
- #
17
- # ruby -r test_launcher/rubymine spring testunit /path/to/test.rb
18
- #
19
- # In one case, our test to run is $0 and in another case it's an ARGV.
20
- # So we throw them in the same bucket and let the launcher figure it
21
- # out. It doesn't matter since we will `exec` a new command anyway.
22
-
23
- module TestLauncher
24
- module Rubymine
25
- def self.launch
26
- shell = TestLauncher::Shell::Runner.new(log_path: "/dev/null")
27
-
28
- request = Request.new(
29
- disable_spring: ENV["DISABLE_SPRING"]
30
- )
31
-
32
- Launcher.new(
33
- args: [$0].concat(ARGV),
34
- shell: shell,
35
- request: request
36
- ).launch
37
- end
38
- end
39
- end
40
-
41
- TestLauncher::Rubymine.launch
3
+ TestLauncher::Rubymine::Parser.launch
@@ -1,3 +1,3 @@
1
1
  module TestLauncher
2
- VERSION = "2.25.0"
2
+ VERSION = "2.28.0"
3
3
  end
@@ -18,6 +18,6 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_development_dependency "bundler", "~> 1.7"
22
- spec.add_development_dependency "rake", "~> 10.0"
21
+ spec.add_development_dependency "bundler", ">= 1.7"
22
+ spec.add_development_dependency "rake", ">= 12.3.3"
23
23
  end
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_launcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.25.0
4
+ version: 2.28.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Kinnecom
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-04 00:00:00.000000000 Z
11
+ date: 2022-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.7'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: 12.3.3
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: 12.3.3
41
41
  description: no really
42
42
  email:
43
43
  - pete.kinnecom@appfolio.com
@@ -64,6 +64,7 @@ files:
64
64
  - lib/test_launcher/queries.rb
65
65
  - lib/test_launcher/rubymine.rb
66
66
  - lib/test_launcher/rubymine/launcher.rb
67
+ - lib/test_launcher/rubymine/parser.rb
67
68
  - lib/test_launcher/rubymine/request.rb
68
69
  - lib/test_launcher/search.rb
69
70
  - lib/test_launcher/search/ag.rb
@@ -77,7 +78,7 @@ homepage: http://github.com/petekinnecom/test_launcher
77
78
  licenses:
78
79
  - MIT
79
80
  metadata: {}
80
- post_install_message:
81
+ post_install_message:
81
82
  rdoc_options: []
82
83
  require_paths:
83
84
  - lib
@@ -92,8 +93,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
93
  - !ruby/object:Gem::Version
93
94
  version: '0'
94
95
  requirements: []
95
- rubygems_version: 3.0.3
96
- signing_key:
96
+ rubygems_version: 3.1.4
97
+ signing_key:
97
98
  specification_version: 4
98
99
  summary: Easily run tests
99
100
  test_files: []