judges 0.31.0 → 0.31.1

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: ed0994ece15e58d311ac1b68885fef5fc5d85339ffa616cbc04696695d8843d3
4
- data.tar.gz: b45a821f87bab95a4d59936d0068689f953cb855be7df9876308aeb7f4ae8e7b
3
+ metadata.gz: e6c1e6bb3714ed3fef2f2c6878a76c2e1615bd3d2f98605f2f0934cac0c028e3
4
+ data.tar.gz: '0657900496811614deee1417336c59794256e6bc919f729fde247d6154ffc875'
5
5
  SHA512:
6
- metadata.gz: be8e7d97a80edb05765307afe7abe89b77e8a62692634e37ab5b8326d490bd9c0c30822913b744bdf456d8aad3b33354336ffe4b7daf6027b4955158fb77d90e
7
- data.tar.gz: 9ce22ed01f6752c55139c8b556492a960eb266a6bcbc934b96db0f4aab2489f7b1e24fbf10aa9ef39266788637d3736583da7ec030c35c2340f381233f8b9786
6
+ metadata.gz: 8be8150d01dbeff4f84bdbd1523d51180aa87410a6adc50979cdd3628b0b4dddf1ece276dd50c488919b1d9ab85027506658dbca90412badd913aa67151bbeff
7
+ data.tar.gz: bc497ed3851f00862eb18f365c9e5593137edc3fdd6b254fd9c8908b3eff7772950ed478051c54b1a2ff55e27ec91d5cb373c8b764df86b1c2abdc75e1f8f9da
@@ -34,6 +34,8 @@ jobs:
34
34
  bundler-cache: true
35
35
  - run: bundle install
36
36
  - run: bundle exec rake
37
- - uses: codecov/codecov-action@v4.0.0-beta.3
37
+ - uses: codecov/codecov-action@v5
38
38
  with:
39
39
  token: ${{ secrets.CODECOV_TOKEN }}
40
+ files: coverage/.resultset.json
41
+ fail_ci_if_error: true
@@ -19,7 +19,7 @@
19
19
  # SOFTWARE.
20
20
  ---
21
21
  name: pdd
22
- on:
22
+ 'on':
23
23
  push:
24
24
  branches:
25
25
  - master
@@ -19,7 +19,7 @@
19
19
  # SOFTWARE.
20
20
  ---
21
21
  name: rake
22
- on:
22
+ 'on':
23
23
  push:
24
24
  branches:
25
25
  - master
data/.gitignore CHANGED
@@ -6,4 +6,4 @@ coverage/
6
6
  rdoc/
7
7
  doc/
8
8
  .yardoc/
9
- temp/
9
+ temp/
data/.rubocop.yml CHANGED
@@ -27,7 +27,12 @@ AllCops:
27
27
  TargetRubyVersion: 3.2
28
28
  SuggestExtensions: false
29
29
  NewCops: enable
30
+ require:
31
+ - rubocop-minitest
32
+ - rubocop-performance
30
33
 
34
+ Minitest/EmptyLineBeforeAssertionMethods:
35
+ Enabled: false
31
36
  Metrics/ParameterLists:
32
37
  Enabled: false
33
38
  Style/GlobalVars:
data/Gemfile CHANGED
@@ -23,15 +23,16 @@
23
23
  source 'https://rubygems.org'
24
24
  gemspec
25
25
 
26
- gem 'cucumber', '9.2.0', require: false
26
+ gem 'cucumber', '9.2.1', require: false
27
27
  gem 'minitest', '5.25.4', require: false
28
28
  gem 'minitest-reporters', '1.7.1', require: false
29
29
  gem 'rake', '13.2.1', require: false
30
30
  gem 'random-port', '~>0.0', require: false
31
31
  gem 'rspec-rails', '7.1.0', require: false
32
- gem 'rubocop', '1.69.2', require: false
33
- gem 'rubocop-performance', '1.23.0', require: false
34
- gem 'rubocop-rspec', '3.3.0', require: false
32
+ gem 'rubocop', '1.71.0', require: false
33
+ gem 'rubocop-minitest', '0.36.0', require: false
34
+ gem 'rubocop-performance', '1.23.1', require: false
35
+ gem 'rubocop-rspec', '3.4.0', require: false
35
36
  gem 'simplecov', '0.22.0', require: false
36
37
  gem 'simplecov-cobertura', '2.1.0', require: false
37
38
  gem 'w3c_validators', '1.3.7', require: false
data/Gemfile.lock CHANGED
@@ -6,7 +6,7 @@ PATH
6
6
  baza.rb (~> 0)
7
7
  concurrent-ruby (~> 1.2)
8
8
  elapsed (~> 0)
9
- factbase (~> 0)
9
+ factbase (>= 0.5.0)
10
10
  gli (~> 2.21)
11
11
  iri (~> 0)
12
12
  loog (~> 0)
@@ -69,15 +69,15 @@ GEM
69
69
  tago (~> 0)
70
70
  typhoeus (~> 1.3)
71
71
  benchmark (0.4.0)
72
- bigdecimal (3.1.8)
72
+ bigdecimal (3.1.9)
73
73
  builder (3.3.0)
74
- concurrent-ruby (1.3.4)
75
- connection_pool (2.4.1)
74
+ concurrent-ruby (1.3.5)
75
+ connection_pool (2.5.0)
76
76
  crack (1.0.0)
77
77
  bigdecimal
78
78
  rexml
79
79
  crass (1.0.6)
80
- cucumber (9.2.0)
80
+ cucumber (9.2.1)
81
81
  builder (~> 3.2)
82
82
  cucumber-ci-environment (> 9, < 11)
83
83
  cucumber-core (> 13, < 14)
@@ -98,7 +98,7 @@ GEM
98
98
  bigdecimal
99
99
  cucumber-gherkin (27.0.0)
100
100
  cucumber-messages (>= 19.1.4, < 23)
101
- cucumber-html-formatter (21.7.0)
101
+ cucumber-html-formatter (21.8.0)
102
102
  cucumber-messages (> 19, < 27)
103
103
  cucumber-messages (22.0.0)
104
104
  cucumber-tag-expressions (6.1.1)
@@ -113,7 +113,7 @@ GEM
113
113
  erubi (1.13.1)
114
114
  ethon (0.16.0)
115
115
  ffi (>= 1.15.0)
116
- factbase (0.4.0)
116
+ factbase (0.5.0)
117
117
  backtrace (> 0)
118
118
  decoor (> 0)
119
119
  json (~> 2.7)
@@ -134,30 +134,33 @@ GEM
134
134
  net-http (>= 0.5.0)
135
135
  faraday-retry (2.2.1)
136
136
  faraday (~> 2.0)
137
- ffi (1.17.0-aarch64-linux-gnu)
138
- ffi (1.17.0-arm-linux-gnu)
139
- ffi (1.17.0-arm64-darwin)
140
- ffi (1.17.0-x64-mingw-ucrt)
141
- ffi (1.17.0-x86-linux-gnu)
142
- ffi (1.17.0-x86_64-darwin)
143
- ffi (1.17.0-x86_64-linux-gnu)
144
- gli (2.22.0)
137
+ ffi (1.17.1-aarch64-linux-gnu)
138
+ ffi (1.17.1-arm-linux-gnu)
139
+ ffi (1.17.1-arm64-darwin)
140
+ ffi (1.17.1-x64-mingw-ucrt)
141
+ ffi (1.17.1-x86-linux-gnu)
142
+ ffi (1.17.1-x86_64-darwin)
143
+ ffi (1.17.1-x86_64-linux-gnu)
144
+ gli (2.22.2)
145
+ ostruct
145
146
  hashdiff (1.1.2)
146
- i18n (1.14.6)
147
+ i18n (1.14.7)
147
148
  concurrent-ruby (~> 1.0)
148
149
  io-console (0.8.0)
149
- irb (1.14.3)
150
+ irb (1.15.1)
151
+ pp (>= 0.6.0)
150
152
  rdoc (>= 4.0.0)
151
153
  reline (>= 0.4.2)
152
154
  iri (0.8.0)
153
155
  json (2.9.1)
154
- language_server-protocol (3.17.0.3)
155
- logger (1.6.4)
156
- loofah (2.23.1)
156
+ language_server-protocol (3.17.0.4)
157
+ logger (1.6.5)
158
+ loofah (2.24.0)
157
159
  crass (~> 1.0.2)
158
160
  nokogiri (>= 1.12.0)
159
161
  loog (0.6.0)
160
162
  mini_mime (1.1.5)
163
+ mini_portile2 (2.8.8)
161
164
  minitest (5.25.4)
162
165
  minitest-reporters (1.7.1)
163
166
  ansi
@@ -169,32 +172,38 @@ GEM
169
172
  multipart-post (2.4.1)
170
173
  net-http (0.6.0)
171
174
  uri
172
- nokogiri (1.17.2-aarch64-linux)
175
+ nokogiri (1.18.2)
176
+ mini_portile2 (~> 2.8.2)
173
177
  racc (~> 1.4)
174
- nokogiri (1.17.2-arm-linux)
178
+ nokogiri (1.18.2-aarch64-linux-gnu)
175
179
  racc (~> 1.4)
176
- nokogiri (1.17.2-arm64-darwin)
180
+ nokogiri (1.18.2-arm-linux-gnu)
177
181
  racc (~> 1.4)
178
- nokogiri (1.17.2-x64-mingw-ucrt)
182
+ nokogiri (1.18.2-arm64-darwin)
179
183
  racc (~> 1.4)
180
- nokogiri (1.17.2-x86-linux)
184
+ nokogiri (1.18.2-x64-mingw-ucrt)
181
185
  racc (~> 1.4)
182
- nokogiri (1.17.2-x86_64-darwin)
186
+ nokogiri (1.18.2-x86_64-darwin)
183
187
  racc (~> 1.4)
184
- nokogiri (1.17.2-x86_64-linux)
188
+ nokogiri (1.18.2-x86_64-linux-gnu)
185
189
  racc (~> 1.4)
190
+ ostruct (0.6.1)
186
191
  others (0.0.3)
187
192
  parallel (1.26.3)
188
- parser (3.3.6.0)
193
+ parser (3.3.7.0)
189
194
  ast (~> 2.4.1)
190
195
  racc
191
- psych (5.2.2)
196
+ pp (0.6.2)
197
+ prettyprint
198
+ prettyprint (0.2.0)
199
+ psych (5.2.3)
192
200
  date
193
201
  stringio
194
202
  public_suffix (6.0.1)
195
203
  racc (1.8.1)
196
204
  rack (3.1.8)
197
- rack-session (2.0.0)
205
+ rack-session (2.1.0)
206
+ base64 (>= 0.1.0)
198
207
  rack (>= 3.0.0)
199
208
  rack-test (2.2.0)
200
209
  rack (>= 1.3)
@@ -217,11 +226,11 @@ GEM
217
226
  zeitwerk (~> 2.6)
218
227
  rainbow (3.1.1)
219
228
  rake (13.2.1)
220
- random-port (0.7.4)
229
+ random-port (0.7.5)
221
230
  tago (> 0)
222
- rdoc (6.10.0)
231
+ rdoc (6.11.0)
223
232
  psych (>= 4.0.0)
224
- regexp_parser (2.9.3)
233
+ regexp_parser (2.10.0)
225
234
  reline (0.6.0)
226
235
  io-console (~> 0.5)
227
236
  retries (0.0.5)
@@ -243,7 +252,7 @@ GEM
243
252
  rspec-mocks (~> 3.13)
244
253
  rspec-support (~> 3.13)
245
254
  rspec-support (3.13.2)
246
- rubocop (1.69.2)
255
+ rubocop (1.71.0)
247
256
  json (~> 2.3)
248
257
  language_server-protocol (>= 3.17.0)
249
258
  parallel (~> 1.10)
@@ -253,12 +262,15 @@ GEM
253
262
  rubocop-ast (>= 1.36.2, < 2.0)
254
263
  ruby-progressbar (~> 1.7)
255
264
  unicode-display_width (>= 2.4.0, < 4.0)
256
- rubocop-ast (1.37.0)
265
+ rubocop-ast (1.38.0)
257
266
  parser (>= 3.3.1.0)
258
- rubocop-performance (1.23.0)
267
+ rubocop-minitest (0.36.0)
268
+ rubocop (>= 1.61, < 2.0)
269
+ rubocop-ast (>= 1.31.1, < 2.0)
270
+ rubocop-performance (1.23.1)
259
271
  rubocop (>= 1.48.1, < 2.0)
260
272
  rubocop-ast (>= 1.31.1, < 2.0)
261
- rubocop-rspec (3.3.0)
273
+ rubocop-rspec (3.4.0)
262
274
  rubocop (~> 1.61)
263
275
  ruby-progressbar (1.13.0)
264
276
  securerandom (0.4.1)
@@ -281,7 +293,7 @@ GEM
281
293
  ethon (>= 0.9.0)
282
294
  tzinfo (2.0.6)
283
295
  concurrent-ruby (~> 1.0)
284
- unicode-display_width (3.1.2)
296
+ unicode-display_width (3.1.4)
285
297
  unicode-emoji (~> 4.0, >= 4.0.4)
286
298
  unicode-emoji (4.0.4)
287
299
  uri (1.0.2)
@@ -308,16 +320,17 @@ PLATFORMS
308
320
  x86_64-linux
309
321
 
310
322
  DEPENDENCIES
311
- cucumber (= 9.2.0)
323
+ cucumber (= 9.2.1)
312
324
  judges!
313
325
  minitest (= 5.25.4)
314
326
  minitest-reporters (= 1.7.1)
315
327
  rake (= 13.2.1)
316
328
  random-port (~> 0.0)
317
329
  rspec-rails (= 7.1.0)
318
- rubocop (= 1.69.2)
319
- rubocop-performance (= 1.23.0)
320
- rubocop-rspec (= 3.3.0)
330
+ rubocop (= 1.71.0)
331
+ rubocop-minitest (= 0.36.0)
332
+ rubocop-performance (= 1.23.1)
333
+ rubocop-rspec (= 3.4.0)
321
334
  simplecov (= 0.22.0)
322
335
  simplecov-cobertura (= 2.1.0)
323
336
  w3c_validators (= 1.3.7)
@@ -8,4 +8,3 @@ Feature: Inspect
8
8
  Then I run bin/judges with "inspect simple.fb"
9
9
  Then Stdout contains "Facts: 1"
10
10
  And Exit code is zero
11
-
@@ -7,4 +7,3 @@ Feature: Pull
7
7
  Then I run bin/judges with "--verbose pull --token 00000000-0000-0000-0000-000000000000 --wait=15 {FAKE-NAME} simple.fb"
8
8
  Then Stdout contains "doesn't exist at api.zerocracy.com"
9
9
  And Exit code is zero
10
-
data/judges.gemspec CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
26
26
  s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
27
27
  s.required_ruby_version = '>=3.2'
28
28
  s.name = 'judges'
29
- s.version = '0.31.0'
29
+ s.version = '0.31.1'
30
30
  s.license = 'MIT'
31
31
  s.summary = 'Command-Line Tool for a Factbase'
32
32
  s.description =
@@ -46,7 +46,7 @@ Gem::Specification.new do |s|
46
46
  s.add_dependency 'baza.rb', '~>0'
47
47
  s.add_dependency 'concurrent-ruby', '~>1.2'
48
48
  s.add_dependency 'elapsed', '~>0'
49
- s.add_dependency 'factbase', '~>0'
49
+ s.add_dependency 'factbase', '>=0.5.0'
50
50
  s.add_dependency 'gli', '~>2.21'
51
51
  s.add_dependency 'iri', '~>0'
52
52
  s.add_dependency 'loog', '~>0'
@@ -42,8 +42,8 @@ class Judges::Categories
42
42
  cats = [] if cats.nil?
43
43
  cats = [cats] unless cats.is_a?(Array)
44
44
  cats.each do |c|
45
- return false if @disable.any? { |d| d == c }
46
- return true if @enable.any? { |d| d == c }
45
+ return false if @disable.any?(c)
46
+ return true if @enable.any?(c)
47
47
  end
48
48
  return true if @enable.empty?
49
49
  false
@@ -52,7 +52,7 @@ class Judges::Import
52
52
  yaml.each do |i|
53
53
  f = fb.insert
54
54
  i.each do |p, v|
55
- f.send("#{p}=", v)
55
+ f.send(:"#{p}=", v)
56
56
  end
57
57
  end
58
58
  impex.export(fb)
@@ -134,10 +134,10 @@ class Judges::Test
134
134
  i.each do |k, vv|
135
135
  if vv.is_a?(Array)
136
136
  vv.each do |v|
137
- f.send("#{k}=", v)
137
+ f.send(:"#{k}=", v)
138
138
  end
139
139
  else
140
- f.send("#{k}=", vv)
140
+ f.send(:"#{k}=", vv)
141
141
  end
142
142
  end
143
143
  end
data/lib/judges.rb CHANGED
@@ -25,5 +25,5 @@
25
25
  # Copyright:: Copyright (c) 2024-2025 Yegor Bugayenko
26
26
  # License:: MIT
27
27
  module Judges
28
- VERSION = '0.31.0'
28
+ VERSION = '0.31.1'
29
29
  end
@@ -40,7 +40,7 @@ class TestEval < Minitest::Test
40
40
  fb = Factbase.new
41
41
  fb.import(File.binread(file))
42
42
  xml = Nokogiri::XML.parse(Factbase::ToXML.new(fb).xml)
43
- assert(!xml.xpath('/fb/f[foo="42"]').empty?, xml)
43
+ refute_empty(xml.xpath('/fb/f[foo="42"]'), xml)
44
44
  end
45
45
  end
46
46
  end
@@ -52,7 +52,7 @@ class TestImport < Minitest::Test
52
52
  fb = Factbase.new
53
53
  fb.import(File.binread(file))
54
54
  xml = Nokogiri::XML.parse(Factbase::ToXML.new(fb).xml)
55
- assert(!xml.xpath('/fb[count(f)=2]').empty?, xml)
55
+ refute_empty(xml.xpath('/fb[count(f)=2]'), xml)
56
56
  end
57
57
  end
58
58
  end
@@ -40,7 +40,7 @@ class TestInspect < Minitest::Test
40
40
  File.binwrite(f, fb.export)
41
41
  loog = Loog::Buffer.new
42
42
  Judges::Inspect.new(loog).run({}, [f])
43
- assert(loog.to_s.include?('Facts: 2'))
43
+ assert_includes(loog.to_s, 'Facts: 2')
44
44
  end
45
45
  end
46
46
  end
@@ -47,9 +47,9 @@ class TestJoin < Minitest::Test
47
47
  fb = Factbase.new
48
48
  fb.import(File.binread(master))
49
49
  xml = Nokogiri::XML.parse(Factbase::ToXML.new(fb).xml)
50
- assert(!xml.xpath('/fb/f[zz="5"]').empty?, xml)
51
- assert(!xml.xpath('/fb/f[foo_bar="42"]').empty?, xml)
52
- assert(loog.to_s.include?('Two factbases joined'), loog.to_s)
50
+ refute_empty(xml.xpath('/fb/f[zz="5"]'), xml)
51
+ refute_empty(xml.xpath('/fb/f[foo_bar="42"]'), xml)
52
+ assert_includes(loog.to_s, 'Two factbases joined', loog.to_s)
53
53
  end
54
54
  end
55
55
  end
@@ -45,7 +45,7 @@ class TestPrint < Minitest::Test
45
45
  File.binwrite(f, fb.export)
46
46
  Judges::Print.new(Loog::NULL).run({ 'format' => 'yaml', 'auto' => true }, [f])
47
47
  y = File.join(d, 'base.yaml')
48
- assert(File.exist?(y))
48
+ assert_path_exists(y)
49
49
  assert_equal(1, YAML.load_file(y).size)
50
50
  end
51
51
  end
@@ -83,11 +83,11 @@ class TestPrint < Minitest::Test
83
83
  rescue StandardError => e
84
84
  raise "#{doc}\n\n#{e}"
85
85
  end
86
- assert(xml.errors.empty?, xml)
87
- assert(!xml.xpath('/html').empty?, xml)
86
+ assert_empty(xml.errors, xml)
87
+ refute_empty(xml.xpath('/html'), xml)
88
88
  WebMock.enable_net_connect!
89
89
  v = W3CValidators::NuValidator.new.validate_file(html)
90
- assert(v.errors.empty?, "#{doc}\n\n#{v.errors.join('; ')}")
90
+ assert_empty(v.errors, "#{doc}\n\n#{v.errors.join('; ')}")
91
91
  end
92
92
 
93
93
  def test_print_all_formats
@@ -99,7 +99,7 @@ class TestPrint < Minitest::Test
99
99
  File.binwrite(f, fb.export)
100
100
  Judges::Print.new(Loog::NULL).run({ 'format' => fmt, 'auto' => true }, [f])
101
101
  y = File.join(d, "base.#{fmt}")
102
- assert(File.exist?(y))
102
+ assert_path_exists(y)
103
103
  end
104
104
  end
105
105
  end
@@ -112,7 +112,7 @@ class TestPrint < Minitest::Test
112
112
  File.binwrite(f, fb.export)
113
113
  Judges::Print.new(Loog::NULL).run({ 'format' => 'yaml', 'auto' => true }, [f])
114
114
  y = File.join(d, 'base.yaml')
115
- assert(File.exist?(y))
115
+ assert_path_exists(y)
116
116
  mtime = File.mtime(y)
117
117
  Judges::Print.new(Loog::NULL).run({ 'format' => 'yaml', 'auto' => true }, [f])
118
118
  assert_equal(mtime, File.mtime(y))
@@ -73,7 +73,7 @@ class TestPull < Minitest::Test
73
73
  Dir.mktmpdir do |d|
74
74
  file = File.join(d, 'base.fb')
75
75
  e =
76
- assert_raises do
76
+ assert_raises(StandardError) do
77
77
  Judges::Pull.new(Loog::NULL).run(
78
78
  {
79
79
  'token' => '000',
@@ -86,7 +86,7 @@ class TestPull < Minitest::Test
86
86
  ['foo', file]
87
87
  )
88
88
  end
89
- assert(e.message.include?('expire it'), e)
89
+ assert_includes(e.message, 'expire it', e)
90
90
  end
91
91
  end
92
92
  end
@@ -77,7 +77,7 @@ class TestPush < Minitest::Test
77
77
  fb = Factbase.new
78
78
  fb.insert.foo_bar = 42
79
79
  File.binwrite(file, fb.export)
80
- assert_raises do
80
+ assert_raises(StandardError) do
81
81
  Judges::Push.new(Loog::NULL).run(
82
82
  {
83
83
  'token' => '000',
@@ -65,7 +65,7 @@ class TestTest < Minitest::Test
65
65
  - /fb/f[bar/v='5']
66
66
  YAML
67
67
  )
68
- assert_raises do
68
+ assert_raises(StandardError) do
69
69
  Judges::Test.new(Loog::NULL).run({}, [d])
70
70
  end
71
71
  end
@@ -123,7 +123,7 @@ class TestTest < Minitest::Test
123
123
  - /fb[count(f)=1]
124
124
  YAML
125
125
  )
126
- assert_raises do
126
+ assert_raises(StandardError) do
127
127
  Judges::Test.new(Loog::NULL).run({ 'judge' => [File.basename(dir)] }, [d])
128
128
  end
129
129
  end
@@ -41,7 +41,7 @@ class TestUpdate < Minitest::Test
41
41
  fb = Factbase.new
42
42
  fb.import(File.binread(file))
43
43
  xml = Nokogiri::XML.parse(Factbase::ToXML.new(fb).xml)
44
- assert(!xml.xpath('/fb/f[zzz="43"]').empty?, xml)
44
+ refute_empty(xml.xpath('/fb/f[zzz="43"]'), xml)
45
45
  end
46
46
  end
47
47
 
@@ -53,7 +53,7 @@ class TestUpdate < Minitest::Test
53
53
  fb = Factbase.new
54
54
  fb.import(File.binread(file))
55
55
  xml = Nokogiri::XML.parse(Factbase::ToXML.new(fb).xml)
56
- assert(xml.xpath('/fb/f').empty?, xml)
56
+ assert_empty(xml.xpath('/fb/f'), xml)
57
57
  end
58
58
  end
59
59
 
@@ -68,8 +68,8 @@ class TestUpdate < Minitest::Test
68
68
  fb = Factbase.new
69
69
  fb.import(File.binread(file))
70
70
  xml = Nokogiri::XML.parse(Factbase::ToXML.new(fb).xml)
71
- assert(!xml.xpath('/fb/f[tt="4"]').empty?, xml)
72
- assert(!xml.xpath('/fb/f[foo_bar="42"]').empty?, xml)
71
+ refute_empty(xml.xpath('/fb/f[tt="4"]'), xml)
72
+ refute_empty(xml.xpath('/fb/f[foo_bar="42"]'), xml)
73
73
  end
74
74
  end
75
75
 
@@ -91,12 +91,12 @@ class TestUpdate < Minitest::Test
91
91
  fb = Factbase.new
92
92
  fb.import(File.binread(file))
93
93
  xml = Nokogiri::XML.parse(Factbase::ToXML.new(fb).xml)
94
- assert(!xml.xpath('/fb/f[foo="444"]').empty?, xml)
94
+ refute_empty(xml.xpath('/fb/f[foo="444"]'), xml)
95
95
  end
96
96
  end
97
97
 
98
98
  def test_update_with_error_no_quiet
99
- assert_raises do
99
+ assert_raises(StandardError) do
100
100
  Dir.mktmpdir do |d|
101
101
  save_it(File.join(d, 'foo/foo.rb'), 'a < 1')
102
102
  file = File.join(d, 'base.fb')
@@ -120,8 +120,8 @@ class TestUpdate < Minitest::Test
120
120
  sums = fb.query('(eq what "judges-summary")').each.to_a
121
121
  assert_equal(1, sums.size)
122
122
  sum = sums.first
123
- assert(sum.error.include?('unexpected global variable'), sum.error)
124
- assert(!sum.seconds.nil?)
123
+ assert_includes(sum.error, 'unexpected global variable', sum.error)
124
+ refute_nil(sum.seconds)
125
125
  end
126
126
  end
127
127
  end
data/test/test_bin.rb CHANGED
@@ -38,6 +38,6 @@ class TestBin < Minitest::Test
38
38
  ensure
39
39
  $stdout = before
40
40
  end
41
- assert(s.include?(Judges::VERSION), s)
41
+ assert_includes(s, Judges::VERSION, s)
42
42
  end
43
43
  end
@@ -33,10 +33,10 @@ class TestCategories < Minitest::Test
33
33
  cats = Judges::Categories.new(%w[foo bar], ['bad'])
34
34
  assert(cats.ok?(%w[foo other]))
35
35
  assert(cats.ok?(%w[other more bar]))
36
- assert(!cats.ok?(%w[bad other]))
37
- assert(!cats.ok?(['other']))
38
- assert(!cats.ok?('hey'))
39
- assert(!cats.ok?(nil))
36
+ refute(cats.ok?(%w[bad other]))
37
+ refute(cats.ok?(['other']))
38
+ refute(cats.ok?('hey'))
39
+ refute(cats.ok?(nil))
40
40
  end
41
41
 
42
42
  def test_all_enabled
@@ -45,6 +45,6 @@ class TestCategories < Minitest::Test
45
45
  assert(cats.ok?('hey'))
46
46
  assert(cats.ok?(%w[foo other]))
47
47
  assert(cats.ok?(%w[other more bar]))
48
- assert(!cats.ok?(%w[bad other]))
48
+ refute(cats.ok?(%w[bad other]))
49
49
  end
50
50
  end
data/test/test_judge.rb CHANGED
@@ -81,7 +81,7 @@ class TestJudge < Minitest::Test
81
81
  save_it(File.join(dir, "#{j}.rb"), '$loog.info("judge=" + $judge)')
82
82
  log = Loog::Buffer.new
83
83
  Judges::Judge.new(dir, nil, log).run(Factbase.new, {}, {}, {})
84
- assert(log.to_s.include?("judge=#{j}"))
84
+ assert_includes(log.to_s, "judge=#{j}")
85
85
  end
86
86
  end
87
87
 
@@ -93,12 +93,12 @@ class TestJudge < Minitest::Test
93
93
  log = Loog::Buffer.new
94
94
  time = Time.now
95
95
  Judges::Judge.new(dir, nil, log, start: time).run(Factbase.new, {}, {}, {})
96
- assert(log.to_s.include?("start=#{time}"))
96
+ assert_includes(log.to_s, "start=#{time}")
97
97
  end
98
98
  end
99
99
 
100
100
  def test_with_broken_ruby_syntax
101
- assert_raises do
101
+ assert_raises(StandardError) do
102
102
  Dir.mktmpdir do |d|
103
103
  dir = File.join(d, 'judges')
104
104
  save_it(File.join(dir, "#{File.basename(d)}.rb"), 'this$is$broken$syntax')
@@ -109,7 +109,7 @@ class TestJudge < Minitest::Test
109
109
  end
110
110
 
111
111
  def test_with_runtime_ruby_error
112
- assert_raises do
112
+ assert_raises(StandardError) do
113
113
  Dir.mktmpdir do |d|
114
114
  dir = File.join(d, 'judges')
115
115
  save_it(File.join(dir, "#{File.basename(d)}.rb"), 'a < 1')
@@ -120,7 +120,7 @@ class TestJudge < Minitest::Test
120
120
  end
121
121
 
122
122
  def test_with_standard_error
123
- assert_raises do
123
+ assert_raises(StandardError) do
124
124
  Dir.mktmpdir do |d|
125
125
  dir = File.join(d, 'judges')
126
126
  save_it(File.join(dir, "#{File.basename(d)}.rb"), 'raise "intentional"')
data/test/test_judges.rb CHANGED
@@ -73,7 +73,7 @@ class TestJudges < Minitest::Test
73
73
  save_it(File.join(d, 'another/wrong/wrong.rb'), '')
74
74
  save_it(File.join(d, 'bad/hello.rb'), '')
75
75
  list = Judges::Judges.new(d, nil, Loog::NULL).each.to_a
76
- assert(list.empty?)
76
+ assert_empty(list)
77
77
  end
78
78
  end
79
79
  end
data/test/test_options.rb CHANGED
@@ -48,20 +48,20 @@ class TestOptions < Minitest::Test
48
48
 
49
49
  def test_with_nil
50
50
  opts = Judges::Options.new(nil)
51
- assert(opts.foo.nil?)
52
- assert(opts.empty?)
51
+ assert_nil(opts.foo)
52
+ assert_empty(opts)
53
53
  end
54
54
 
55
55
  def test_with_empty_string
56
56
  opts = Judges::Options.new(' ')
57
- assert(opts.foo.nil?)
58
- assert(opts.empty?, opts)
57
+ assert_nil(opts.foo)
58
+ assert_empty(opts, opts)
59
59
  end
60
60
 
61
61
  def test_with_empty_strings
62
62
  opts = Judges::Options.new(['', nil])
63
- assert(opts.foo.nil?)
64
- assert(opts.empty?)
63
+ assert_nil(opts.foo)
64
+ assert_empty(opts)
65
65
  end
66
66
 
67
67
  def test_with_string
@@ -74,14 +74,14 @@ class TestOptions < Minitest::Test
74
74
  opts = Judges::Options.new('foo' => 42, 'bar' => 'hello')
75
75
  assert_equal(42, opts.foo)
76
76
  assert_equal('hello', opts.Bar)
77
- assert(opts.xxx.nil?)
77
+ assert_nil(opts.xxx)
78
78
  end
79
79
 
80
80
  def test_converts_to_string
81
81
  opts = Judges::Options.new('foo' => 44, 'bar' => 'long-string-maybe-secret')
82
82
  s = opts.to_s
83
- assert(s.include?('FOO → "44"'), s)
84
- assert(s.include?('"long****************cret"'), s)
83
+ assert_includes(s, 'FOO → "44"', s)
84
+ assert_includes(s, '"long****************cret"', s)
85
85
  end
86
86
 
87
87
  def test_merge
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: judges
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.31.0
4
+ version: 0.31.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-03 00:00:00.000000000 Z
11
+ date: 2025-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backtrace
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: factbase
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: 0.5.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: 0.5.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: gli
85
85
  requirement: !ruby/object:Gem::Requirement