rgot 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +3 -4
- data/Gemfile.lock +63 -27
- data/README.md +58 -0
- data/lib/rgot/cli.rb +7 -5
- data/lib/rgot/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 686cd0f1c902f09e4428320e9360e35de9e3b37c70998fd425918ec52706adcb
|
4
|
+
data.tar.gz: 8d8617f7f824809d8c65e886ef340d61cfc6d8ae6e8436d096880ec082429eb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5929385f2474fa9ffe0102051a107ebfc8944302afc2b76420a0cffd3601ff173120827c103a35863d305900e17fb1454c8d52ec7166073de51b749cf86cd96
|
7
|
+
data.tar.gz: 700205bc2e7d0815592904b1208d29ccbdc4adc21cf0d0cfb2e883f6b45a2d376d3615c80f327690b0c572cb6b923a503e8063743f4ef59f7f48b3e50c0595e9
|
data/.github/workflows/main.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,62 +1,98 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rgot (1.
|
4
|
+
rgot (1.5.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
activesupport (
|
10
|
-
|
9
|
+
activesupport (8.0.1)
|
10
|
+
base64
|
11
|
+
benchmark (>= 0.3)
|
12
|
+
bigdecimal
|
13
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
14
|
+
connection_pool (>= 2.2.5)
|
15
|
+
drb
|
11
16
|
i18n (>= 1.6, < 2)
|
17
|
+
logger (>= 1.4.2)
|
12
18
|
minitest (>= 5.1)
|
13
|
-
|
19
|
+
securerandom (>= 0.3)
|
20
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
21
|
+
uri (>= 0.13.1)
|
14
22
|
ast (2.4.2)
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
23
|
+
base64 (0.2.0)
|
24
|
+
benchmark (0.4.0)
|
25
|
+
bigdecimal (3.1.9)
|
26
|
+
concurrent-ruby (1.3.5)
|
27
|
+
connection_pool (2.5.0)
|
28
|
+
csv (3.3.2)
|
29
|
+
date (3.4.1)
|
30
|
+
debug (1.10.0)
|
31
|
+
irb (~> 1.10)
|
32
|
+
reline (>= 0.3.8)
|
33
|
+
drb (2.2.1)
|
34
|
+
ffi (1.17.1)
|
35
|
+
fileutils (1.7.3)
|
36
|
+
i18n (1.14.7)
|
21
37
|
concurrent-ruby (~> 1.0)
|
22
|
-
|
23
|
-
|
24
|
-
|
38
|
+
io-console (0.8.0)
|
39
|
+
irb (1.15.1)
|
40
|
+
pp (>= 0.6.0)
|
41
|
+
rdoc (>= 4.0.0)
|
42
|
+
reline (>= 0.4.2)
|
43
|
+
json (2.10.1)
|
44
|
+
language_server-protocol (3.17.0.4)
|
45
|
+
listen (3.9.0)
|
25
46
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
26
47
|
rb-inotify (~> 0.9, >= 0.9.10)
|
27
|
-
logger (1.
|
28
|
-
minitest (5.
|
29
|
-
|
30
|
-
parser (3.2.0.0)
|
48
|
+
logger (1.6.6)
|
49
|
+
minitest (5.25.4)
|
50
|
+
parser (3.3.7.1)
|
31
51
|
ast (~> 2.4.1)
|
52
|
+
racc
|
53
|
+
pp (0.6.2)
|
54
|
+
prettyprint
|
55
|
+
prettyprint (0.2.0)
|
56
|
+
psych (5.2.3)
|
57
|
+
date
|
58
|
+
stringio
|
59
|
+
racc (1.8.1)
|
32
60
|
rainbow (3.1.1)
|
33
|
-
rake (13.
|
61
|
+
rake (13.2.1)
|
34
62
|
rb-fsevent (0.11.2)
|
35
|
-
rb-inotify (0.
|
63
|
+
rb-inotify (0.11.1)
|
36
64
|
ffi (~> 1.0)
|
37
|
-
rbs (
|
38
|
-
|
39
|
-
|
65
|
+
rbs (3.8.1)
|
66
|
+
logger
|
67
|
+
rdoc (6.12.0)
|
68
|
+
psych (>= 4.0.0)
|
69
|
+
reline (0.6.0)
|
70
|
+
io-console (~> 0.5)
|
71
|
+
securerandom (0.4.1)
|
72
|
+
steep (1.9.4)
|
40
73
|
activesupport (>= 5.1)
|
74
|
+
concurrent-ruby (>= 1.1.10)
|
41
75
|
csv (>= 3.0.9)
|
42
76
|
fileutils (>= 1.1.0)
|
43
77
|
json (>= 2.1.0)
|
44
78
|
language_server-protocol (>= 3.15, < 4.0)
|
45
79
|
listen (~> 3.0)
|
46
80
|
logger (>= 1.3.0)
|
47
|
-
parallel (>= 1.0.0)
|
48
81
|
parser (>= 3.1)
|
49
82
|
rainbow (>= 2.2.2, < 4.0)
|
50
|
-
rbs (
|
83
|
+
rbs (~> 3.8)
|
51
84
|
securerandom (>= 0.1)
|
52
85
|
strscan (>= 1.0.0)
|
53
86
|
terminal-table (>= 2, < 4)
|
54
|
-
|
87
|
+
uri (>= 0.12.0)
|
88
|
+
stringio (3.1.5)
|
89
|
+
strscan (3.1.2)
|
55
90
|
terminal-table (3.0.2)
|
56
91
|
unicode-display_width (>= 1.1.1, < 3)
|
57
|
-
tzinfo (2.0.
|
92
|
+
tzinfo (2.0.6)
|
58
93
|
concurrent-ruby (~> 1.0)
|
59
|
-
unicode-display_width (2.
|
94
|
+
unicode-display_width (2.6.0)
|
95
|
+
uri (1.0.3)
|
60
96
|
|
61
97
|
PLATFORMS
|
62
98
|
ruby
|
data/README.md
CHANGED
@@ -343,6 +343,64 @@ You can set timeout sec for testing (default 0).
|
|
343
343
|
|
344
344
|
Fail testing and print raised exception message to STDERR if timeout.
|
345
345
|
|
346
|
+
# Recommendation
|
347
|
+
|
348
|
+
Set up Rakefile.
|
349
|
+
|
350
|
+
```rb
|
351
|
+
# Rakefile
|
352
|
+
require "rake/testtask"
|
353
|
+
Rake::TestTask.new do |task|
|
354
|
+
task.libs = %w[lib test]
|
355
|
+
task.test_files = FileList["lib/**/*_test.rb"]
|
356
|
+
end
|
357
|
+
```
|
358
|
+
|
359
|
+
Set `test/test_helper.rb`.
|
360
|
+
|
361
|
+
```rb
|
362
|
+
# test/test_helper.rb
|
363
|
+
require "rgot/cli"
|
364
|
+
|
365
|
+
unless $PROGRAM_NAME.end_with?("/rgot")
|
366
|
+
at_exit do
|
367
|
+
exit Rgot::Cli.new(["-v", *ARGV]).run
|
368
|
+
end
|
369
|
+
end
|
370
|
+
```
|
371
|
+
|
372
|
+
Place the test file in the same directory as the implementation file.
|
373
|
+
Just like in golang.
|
374
|
+
|
375
|
+
```console
|
376
|
+
$ ls lib
|
377
|
+
lib/foo.rb
|
378
|
+
lib/foo_test.rb
|
379
|
+
```
|
380
|
+
|
381
|
+
Write your testing code.
|
382
|
+
|
383
|
+
```rb
|
384
|
+
# lib/foo_test.rb
|
385
|
+
require 'test_helper'
|
386
|
+
|
387
|
+
module FooTest
|
388
|
+
def test_foo(t)
|
389
|
+
# ...
|
390
|
+
end
|
391
|
+
end
|
392
|
+
```
|
393
|
+
|
394
|
+
OK, You will be able to both run all tests with rake and specify one file to run.
|
395
|
+
|
396
|
+
```console
|
397
|
+
$ bundle exec rake test
|
398
|
+
```
|
399
|
+
|
400
|
+
```console
|
401
|
+
$ bundle exec rgot lib/foo_test.rb
|
402
|
+
```
|
403
|
+
|
346
404
|
# Methods
|
347
405
|
|
348
406
|
## Rgot
|
data/lib/rgot/cli.rb
CHANGED
@@ -107,7 +107,7 @@ module Rgot
|
|
107
107
|
require 'coverage'
|
108
108
|
Coverage.start(oneshot_lines: true)
|
109
109
|
end
|
110
|
-
|
110
|
+
require testing_file
|
111
111
|
|
112
112
|
test_module = Object.const_get(test_module_name)
|
113
113
|
tests = []
|
@@ -168,11 +168,13 @@ module Rgot
|
|
168
168
|
find_toplevel_name(namespace)
|
169
169
|
end
|
170
170
|
when :BLOCK
|
171
|
-
|
172
|
-
|
173
|
-
raise "no module found"
|
171
|
+
module_nodes = node.children.select do |c|
|
172
|
+
c.type == :MODULE && find_toplevel_name(c).end_with?("Test")
|
174
173
|
end
|
175
|
-
|
174
|
+
raise "no module found" if module_nodes.empty?
|
175
|
+
raise "*Test module should be one for each file" if 1 < module_nodes.length
|
176
|
+
|
177
|
+
find_toplevel_name(module_nodes.first)
|
176
178
|
else
|
177
179
|
raise node.type.to_s
|
178
180
|
end
|
data/lib/rgot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rgot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ksss
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-03-07 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: bundler
|
@@ -75,7 +74,6 @@ homepage: https://github.com/ksss/rgot
|
|
75
74
|
licenses:
|
76
75
|
- MIT
|
77
76
|
metadata: {}
|
78
|
-
post_install_message:
|
79
77
|
rdoc_options: []
|
80
78
|
require_paths:
|
81
79
|
- lib
|
@@ -90,8 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
88
|
- !ruby/object:Gem::Version
|
91
89
|
version: '0'
|
92
90
|
requirements: []
|
93
|
-
rubygems_version: 3.
|
94
|
-
signing_key:
|
91
|
+
rubygems_version: 3.6.2
|
95
92
|
specification_version: 4
|
96
93
|
summary: Ruby + Golang Testing = Rgot
|
97
94
|
test_files: []
|