judges 0.33.0 → 0.34.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 988900140e36f573e7a9f04872cd372ec145a9bf77d567cde10ae307a51e0490
4
- data.tar.gz: 0c4abf1c34f895a214d3d9a8e9d7cf53be74887fb6842e37b545d32c332ce86c
3
+ metadata.gz: 0e26309233bda6e09c9673cc9b17b3a6309897e2e2a19505288889fe947af3d7
4
+ data.tar.gz: 895a20352dd34b430f3001de0ba8c5eb97e0f1fd2de77386ad63d9282831e021
5
5
  SHA512:
6
- metadata.gz: 7adc13f872f4b1de6421f855df6fe65f5e74c8e45007fa25e63144f4aebe15adf1e0f56ec42a9645fa7c6247a6beb97fc89274bbdc0d235d8a0de87d05647aae
7
- data.tar.gz: bc06cfbcfa67a52e897b499d17c07bbd27139cfc768369dc5d6a6b58021dfd360304156520a0e4f81f76beaad62aa259f0675862b4d928fdadbe5ca0cc3ba125
6
+ metadata.gz: 7bb06d82f69a67972774c2a7ef92bfc1655bcd30f4c162cae6d1669192725a3e7fc28efecaab9fda0bf3ac4a31b84725412248009ff22a7c77e289ae0699947c
7
+ data.tar.gz: 621ea22a9b604c2433e07ff6a5c241c86d8559de17b59def8d2878477fe5c4340a565090daa38770b054d81960ec45250db10282dd356b05367397fba066e65c
data/README.md CHANGED
@@ -40,6 +40,7 @@ before:
40
40
  category: slow
41
41
  runs: 1
42
42
  skip: false
43
+ repeat: 20
43
44
  input:
44
45
  -
45
46
  foo: 42
@@ -65,6 +66,9 @@ when the test is finished.
65
66
  The `category` (default: `[]`) may have one or an array of categories,
66
67
  which then may be turned on via the `--category` command line flag.
67
68
 
69
+ The `repeat` (default: `1`) makes `input` to be repeated multiple times
70
+ (mostly useful for speed measuring on big data inputs).
71
+
68
72
  The `runs` (default: `1`) is the number of times the `.rb` script should
69
73
  be executed. After each execution, all expected XPath expressions are validated.
70
74
 
@@ -7,7 +7,7 @@ Feature: Test
7
7
  Scenario: Simple test of a few judges
8
8
  Given I run bin/judges with "test ./fixtures"
9
9
  Then Stdout contains "👉 Testing"
10
- Then Stdout contains "All 2 judge(s) and 2 tests passed"
10
+ Then Stdout contains "All 3 judge(s) and 3 tests passed"
11
11
  And Exit code is zero
12
12
 
13
13
  Scenario: Simple test of just one judge
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
4
+ # SPDX-License-Identifier: MIT
5
+
6
+ # nothing to do here
@@ -0,0 +1,9 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
3
+ ---
4
+ repeat: 10
5
+ input:
6
+ -
7
+ foo: 1
8
+ expected:
9
+ - /fb[count(f)=10]
data/judges.gemspec CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
9
9
  s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
10
10
  s.required_ruby_version = '>=3.2'
11
11
  s.name = 'judges'
12
- s.version = '0.33.0'
12
+ s.version = '0.34.0'
13
13
  s.license = 'MIT'
14
14
  s.summary = 'Command-Line Tool for a Factbase'
15
15
  s.description =
@@ -126,15 +126,17 @@ class Judges::Test
126
126
 
127
127
  def prepare(fb, yaml)
128
128
  inputs = yaml['input']
129
- inputs&.each do |i|
130
- f = fb.insert
131
- i.each do |k, vv|
132
- if vv.is_a?(Array)
133
- vv.each do |v|
134
- f.send(:"#{k}=", v)
129
+ (yaml['repeat']&.to_i || 1).times do
130
+ inputs&.each do |i|
131
+ f = fb.insert
132
+ i.each do |k, vv|
133
+ if vv.is_a?(Array)
134
+ vv.each do |v|
135
+ f.send(:"#{k}=", v)
136
+ end
137
+ else
138
+ f.send(:"#{k}=", vv)
135
139
  end
136
- else
137
- f.send(:"#{k}=", vv)
138
140
  end
139
141
  end
140
142
  end
data/lib/judges.rb CHANGED
@@ -8,5 +8,5 @@
8
8
  # Copyright:: Copyright (c) 2024-2025 Yegor Bugayenko
9
9
  # License:: MIT
10
10
  module Judges
11
- VERSION = '0.33.0'
11
+ VERSION = '0.34.0'
12
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: judges
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.33.0
4
+ version: 0.34.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
@@ -272,6 +272,8 @@ files:
272
272
  - fixtures/guess/guess.rb
273
273
  - fixtures/guess/guess_made.yml
274
274
  - fixtures/guess/skipped.yml
275
+ - fixtures/repeat/repeat.rb
276
+ - fixtures/repeat/repeated.yml
275
277
  - fixtures/try/tried.yml
276
278
  - fixtures/try/try.rb
277
279
  - judges.gemspec