regtest 2.4.1 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog +4 -0
- data/README.md +203 -95
- data/lib/regtest/version.rb +1 -1
- metadata +5 -8
- data/.aspell.pws +0 -38
- data/Gemfile +0 -3
- data/Rakefile +0 -53
- data/regtest.gemspec +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 187d2488712423e101a963409b2765cbb4a3d1b9c8a0da0a08fa80dd5737ff32
|
4
|
+
data.tar.gz: 653bcfb237f6f075dd95eaaa8f60b119206cb22543d4ec402fba51bb929b26d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81a5a53f3ce35af1fbbef97a6fb02d8dc5a9d5318754926a9617d95262d4c84f7b037639481f4d225491aa13d3af1039f758946f87182e7c8b488bf13d8a239a
|
7
|
+
data.tar.gz: 9f32c01f32d675a86ace1ffea8758a716418b7a80fe5d68eeae48a3a9f6ba4021f6e152582ad88a3fd2ab74b7dcc0b48bd5a27eb6f5934ed426a199305d72a9b
|
data/Changelog
CHANGED
data/README.md
CHANGED
@@ -3,20 +3,23 @@
|
|
3
3
|
## Description
|
4
4
|
|
5
5
|
This library supports a very simple way to do regression testing with Ruby. It
|
6
|
-
is not limited to Ruby projects you can use it also in other contexts where
|
7
|
-
can extract data with Ruby.
|
6
|
+
is not limited to Ruby projects; you can use it also in other contexts where
|
7
|
+
you can extract data with Ruby.
|
8
|
+
|
9
|
+
The core idea is to test results against the results of an earlier run of the
|
10
|
+
tests, not against defined results of a specification.
|
8
11
|
|
9
12
|
You write Ruby scripts with samples. Run these and get the sample results as
|
10
|
-
|
11
|
-
|
12
|
-
later (or even previous) version of your code a simple diff show you if
|
13
|
-
the changes in your code or environment impact the results of your
|
13
|
+
result files beside your scripts. Check both the scripts and the result files
|
14
|
+
in your Source Code Management System (SCM). When you run the scripts on a
|
15
|
+
later (or even previous) version of your code, a simple diff will show you if
|
16
|
+
and how the changes in your code or environment impact the results of your
|
17
|
+
samples.
|
14
18
|
|
15
19
|
This is not a replacement for unit testing but a complement: You can produce a
|
16
|
-
lot of samples with a small amount of Ruby code (e.g
|
20
|
+
lot of samples with a small amount of Ruby code (e.g., a large number of
|
17
21
|
combinations of data).
|
18
22
|
|
19
|
-
|
20
23
|
## Installation
|
21
24
|
|
22
25
|
Installing the gem on the command line with
|
@@ -38,16 +41,19 @@ to your Gemfile.
|
|
38
41
|
The idea behind regtest is the following workflow:
|
39
42
|
1. Writing samples
|
40
43
|
2. Running samples
|
41
|
-
3.
|
42
|
-
4.
|
43
|
-
5.
|
44
|
-
6.
|
45
|
-
a regtest plugin like regtest/git)
|
44
|
+
3. Committing samples and result files to SCM
|
45
|
+
4. Changing code and/or external environment
|
46
|
+
5. Rerunning the samples
|
47
|
+
6. Checking sample results for changes (this is normally automatically done with
|
48
|
+
a regtest plugin like regtest/git)
|
49
|
+
7. If there are changed that are indented (new samples, corrected behavior)
|
50
|
+
committing the files to the SCM - if there are unintended changes, fix the
|
51
|
+
causes
|
46
52
|
|
47
53
|
|
48
54
|
### Writing Samples
|
49
55
|
|
50
|
-
A samples file is a simple Ruby script with one
|
56
|
+
A samples file is a simple Ruby script with one or more samples. Let's see an example
|
51
57
|
|
52
58
|
```ruby
|
53
59
|
require 'regtest'
|
@@ -69,11 +75,11 @@ end
|
|
69
75
|
The name of the sample (parameter of the `Regtest.sample` method) and the
|
70
76
|
results of the samples (return value of the block) are stored in YAML format.
|
71
77
|
So it should be a YAML-friendly value as `String`, `Number`, `Boolean value`,
|
72
|
-
`Symbol`.
|
78
|
+
`Symbol`. Also `arrays` and `hashes` are commonly used.
|
73
79
|
|
74
|
-
In
|
80
|
+
In some cases you want to generate a lot of combinations of input data in your
|
75
81
|
sample code. For this there is a method `Regtest.combinations` to generate a
|
76
|
-
lot of combinations
|
82
|
+
lot of combinations in an easy way. An example:
|
77
83
|
|
78
84
|
```ruby
|
79
85
|
require 'ostruct'
|
@@ -85,12 +91,13 @@ o.b = [:x, :y]
|
|
85
91
|
Regtest.combinations(o)
|
86
92
|
# => [#<OpenStruct a=1, b=:x>, #<OpenStruct a=1, b=:y>,
|
87
93
|
# #<OpenStruct a=2, b=:x>, #<OpenStruct a=2, b=:y>,
|
88
|
-
# #<OpenStruct a=3, b=:x>, #<OpenStruct a=3, b=:y>]
|
94
|
+
# #<OpenStruct a=3, b=:x>, #<OpenStruct a=3, b=:y>]
|
89
95
|
```
|
90
96
|
|
91
|
-
See also the combinations
|
97
|
+
See also the example `combinations` in directory `regtest` of this repository.
|
92
98
|
|
93
|
-
By convention
|
99
|
+
By convention samples files are stored in a directory names `regtest` in your
|
100
|
+
Ruby application.
|
94
101
|
|
95
102
|
|
96
103
|
### Running Samples
|
@@ -101,13 +108,13 @@ Whether you run your examples manually
|
|
101
108
|
ruby -I lib regtest/*.rb
|
102
109
|
```
|
103
110
|
|
104
|
-
or using the Rake task of regtest
|
111
|
+
or using the Rake task of regtest by adding
|
105
112
|
|
106
113
|
```ruby
|
107
114
|
require 'regtest/task'
|
108
115
|
```
|
109
116
|
|
110
|
-
to your `Rakefile
|
117
|
+
to your `Rakefile`. Then you can run your samples with `rake regtest`.
|
111
118
|
|
112
119
|
|
113
120
|
### Checking Results
|
@@ -128,7 +135,7 @@ regtest/foo.yml
|
|
128
135
|
regtest/bar.yml
|
129
136
|
```
|
130
137
|
|
131
|
-
So the content of the results file of the example above is
|
138
|
+
So the content of the results file of the first example above is
|
132
139
|
|
133
140
|
```yaml
|
134
141
|
---
|
@@ -139,30 +146,31 @@ sample: Division by zero
|
|
139
146
|
exception: divided by 0
|
140
147
|
```
|
141
148
|
|
142
|
-
Each time you run one
|
143
|
-
be overwritten (or generated if not yet
|
144
|
-
of your samples. The determination of changes between the
|
145
|
-
older runs of the samples is done by your SCM.
|
146
|
-
corresponding results files should be taken under
|
149
|
+
Each time you run one or more samples files, the corresponding results files
|
150
|
+
will be overwritten (or generated if they do not yet exist) with the actual
|
151
|
+
results values of your samples. The determination of changes between the
|
152
|
+
results of actual and older runs of the samples is done by your SCM. Therefore
|
153
|
+
the sample files and their corresponding results files should be taken under
|
154
|
+
version control.
|
147
155
|
|
148
156
|
|
149
157
|
## Logging
|
150
158
|
|
151
159
|
The key idea behind regtest is to produce values that are invariant and check
|
152
160
|
if this assumption is true at another (mostly later) state of code. But often
|
153
|
-
there are temporary or specific values which
|
154
|
-
run of regtest. This could be for example an id of a created record or the
|
161
|
+
there are temporary or specific values which change or could change at each
|
162
|
+
run of regtest. This could be, for example, an id of a created record or the
|
155
163
|
version of a used external service or some time-relevant values. Sometimes it
|
156
|
-
is useful, to know the actual
|
164
|
+
is useful, to know the actual values of some of these.
|
157
165
|
|
158
|
-
In such cases the method
|
159
|
-
|
160
|
-
Ruby script but has
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
+
In such cases the method `Regtest.log` could be handy. It writes a line of the
|
167
|
+
given object to a log file which is named with the same name as the calling
|
168
|
+
Ruby script but has the extension `.log`. It could be called inside as well as
|
169
|
+
outside of a regtest sample. As default this file is overwritten by the first
|
170
|
+
call of `Regtest.log` of each run of regtest and per file. And each further
|
171
|
+
call of `Regtest.log` appends then to the file. So you get a complete log for
|
172
|
+
each run. This behavior could be changed with the `mode` keyword argument of
|
173
|
+
the method. Let's see an example:
|
166
174
|
|
167
175
|
```ruby
|
168
176
|
Regtest.log RUBY_VERSION
|
@@ -191,7 +199,7 @@ end
|
|
191
199
|
```
|
192
200
|
|
193
201
|
If you want to have a log that is not truncated at each run of regtest, you can
|
194
|
-
use
|
202
|
+
use `mode: 'a'` at the first call of `Regtest.log` in the corresponding
|
195
203
|
ruby script.
|
196
204
|
|
197
205
|
```ruby
|
@@ -200,8 +208,8 @@ ruby script.
|
|
200
208
|
Regtest.log Time.now, mode: 'a'
|
201
209
|
```
|
202
210
|
|
203
|
-
On the other hand, you can use
|
204
|
-
|
211
|
+
On the other hand, you can use `mode: 'w'` to truncate the log file even at a
|
212
|
+
later call of `Regtest.log`.
|
205
213
|
|
206
214
|
```ruby
|
207
215
|
max_time = 0
|
@@ -215,91 +223,105 @@ ary.each do |e|
|
|
215
223
|
end
|
216
224
|
```
|
217
225
|
|
218
|
-
Because the log files
|
219
|
-
checked
|
226
|
+
Because the log files contain only temporary information, they should normally
|
227
|
+
not be checked into the SCM.
|
220
228
|
|
221
229
|
|
222
|
-
##
|
230
|
+
## Configuration and Plugins
|
223
231
|
|
224
|
-
|
225
|
-
|
226
|
-
|
232
|
+
You can adapt the behavior of regtest with plugins. To configure this and maybe
|
233
|
+
other things regtest supports a simple rc file mechanism. While loading regtest
|
234
|
+
via `require 'regtest'` it looks for a file `.regtestrc` first in your home
|
235
|
+
directory and then in the local directory. So you can do global configurations
|
236
|
+
in the first one and project-specific configurations in the latter.
|
227
237
|
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
238
|
+
Normally, the check of changes in results is done automatically by a regtest
|
239
|
+
plugin like regtest/git (see below). In this case, the report will show you if
|
240
|
+
there are changes or not, and the exit code of the script is accordingly set.
|
241
|
+
The standard values are: `0` for success, `1` for an unknown result (normally a
|
242
|
+
new results file), and `2` for failure. If you use plain regtest without a SCM
|
243
|
+
plugin, the exit code is `1` (= unknown result).
|
232
244
|
|
233
|
-
You can
|
234
|
-
|
235
|
-
backtrace is written to STDERR.
|
245
|
+
You can change the exit codes for the states with `Regtest.exit_codes`. The
|
246
|
+
following example changes the behavior to the same as in regtest version 1.x.
|
236
247
|
|
248
|
+
```ruby
|
249
|
+
Regtest.exit_codes[:unknown_result] = 0
|
250
|
+
Regtest.exit_codes[:fail] = 0
|
251
|
+
```
|
237
252
|
|
238
|
-
|
253
|
+
This should be done in a `.regtestrc` file and not in sample files.
|
239
254
|
|
240
|
-
|
241
|
-
|
242
|
-
regtest via `require 'regtest'` it looks for a file `.regtestrc` first in your
|
243
|
-
home directory and then in the local directory. So you can do global
|
244
|
-
configurations in the first one and project specific configurations in the
|
245
|
-
latter.
|
255
|
+
Because in a `.regtestrc` file are individual configuration aspects of your
|
256
|
+
workflow and environment, it should not be checked into your SCM.
|
246
257
|
|
247
|
-
For example the following is a good default when you want colorized output and
|
248
|
-
use git as your SCM:
|
249
258
|
|
250
|
-
|
251
|
-
require 'regtest/colors'
|
252
|
-
# adapt some colorizing if wanted
|
253
|
-
Regtest::Colors.mapping[:filename] = :cyan
|
254
|
-
Regtest::Colors.mapping[:statistics] = %i(blue italic)
|
259
|
+
### Plugin regtest/colors
|
255
260
|
|
256
|
-
require 'regtest/
|
257
|
-
|
261
|
+
When using the regtest/colors plugin (`require 'regtest/colors'`) it is
|
262
|
+
possible to adapt the colors of the output of different types of messages. The
|
263
|
+
following mappings are possible:
|
258
264
|
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
plain regtest without a SCM plugin the exit code is 1 (= unknown result).
|
265
|
+
* `:filename`
|
266
|
+
* `:statistics`
|
267
|
+
* `:success`
|
268
|
+
* `:unknown_result`
|
269
|
+
* `:fail`
|
265
270
|
|
266
|
-
|
267
|
-
following example changes the behaviour to the same as in regtest version 1.x.
|
271
|
+
The configuration is done as the following example shows:
|
268
272
|
|
269
273
|
```ruby
|
270
|
-
|
271
|
-
|
274
|
+
require 'regtest/colors'
|
275
|
+
# adapt some colorizing if wanted
|
276
|
+
Regtest::Colors.mapping[:filename] = :cyan
|
277
|
+
Regtest::Colors.mapping[:statistics] = %i(blue italic)
|
278
|
+
Regtest::Colors.mapping[:fail] = %i(white @red)
|
272
279
|
```
|
273
280
|
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
workflow and environment it should not be checked into your SCM.
|
281
|
+
As you can see there are colors and modifiers (such as `[:blue, :italic]`)
|
282
|
+
possible. Color codes with prefix `@` are background colors. Run
|
283
|
+
`Regtest::Colors.codes` to get a list of possible color codes.
|
278
284
|
|
279
285
|
|
280
|
-
|
286
|
+
### Plugin regtest/git
|
281
287
|
|
282
|
-
If you use the git plugin (`require 'regtest/git'`) there
|
283
|
-
|
288
|
+
If you use the git plugin (`require 'regtest/git'`), there are the following
|
289
|
+
options available:
|
284
290
|
|
285
291
|
* `Regtest::Git.C`
|
286
292
|
* `Regtest::Git.git_dir`
|
287
293
|
* `Regtest::Git.work_tree`
|
288
294
|
|
289
295
|
which corresponds to the git parameters `-C`, `--git-dir` and `--work-tree`.
|
290
|
-
|
296
|
+
These could be helpful if you run `regtest` from inside some other git
|
291
297
|
repository than your regtest files. Have a look at the git documentation for
|
292
298
|
more details.
|
293
299
|
|
300
|
+
Be aware when using these options. It is possible to get unwanted results.
|
301
|
+
|
294
302
|
As said above: this should also be done in a local `.regtestrc` file.
|
295
303
|
|
296
304
|
|
305
|
+
### Example of a .regtestrc file
|
306
|
+
|
307
|
+
The following is a good default when you want colorized output and
|
308
|
+
use git as your SCM:
|
309
|
+
|
310
|
+
```ruby
|
311
|
+
require 'regtest/colors'
|
312
|
+
require 'regtest/git'
|
313
|
+
```
|
314
|
+
|
315
|
+
See above for more information about the plugins `regtest/colors` and
|
316
|
+
`regtest/git`.
|
317
|
+
|
318
|
+
|
297
319
|
## Rake task
|
298
320
|
|
299
|
-
Regtest includes a Rake task `regtest`.
|
321
|
+
Regtest includes a Rake task `regtest`. By default it runs any `.rb` files
|
300
322
|
under the `regtest` directory and includes all files under the `regtest`
|
301
|
-
directory to the files packaged with gem.
|
302
|
-
|
323
|
+
directory to the files packaged with gem. You can change these defaults like
|
324
|
+
this:
|
303
325
|
|
304
326
|
```ruby
|
305
327
|
require 'regtest/task'
|
@@ -308,14 +330,100 @@ REGTEST_FILES_RB.clear << 'my_regtest_file.rb'
|
|
308
330
|
REGTEST_FILES.clear << 'my_regtest_file.rb' << 'my_regtest_file.yml' << 'other_file'
|
309
331
|
```
|
310
332
|
|
311
|
-
It's a little bit old school like `CLEAN` and `CLOBBER` but I
|
312
|
-
approach to use constants.
|
333
|
+
It's a little bit old school like `CLEAN` and `CLOBBER` in `rake/clean` but I
|
334
|
+
like the simple approach to use constants.
|
335
|
+
|
336
|
+
|
337
|
+
## Best practise
|
338
|
+
|
339
|
+
### Use Ruby
|
340
|
+
|
341
|
+
As said above, the sample files are plain Ruby scripts. Yes, Ruby is a
|
342
|
+
scripting language. So use the power of Ruby to get the things done you need.
|
343
|
+
Some food for thought:
|
344
|
+
|
345
|
+
* Generate samples inside of loops.
|
346
|
+
* Use `String#gsub` to level out runtime specific values. For example, if you
|
347
|
+
get a response of a web service "Record 4711 created" and do a
|
348
|
+
`sub(/\d+/, '#')` the `4711` is eliminated and the string is invariant between
|
349
|
+
different runs of regtest.
|
350
|
+
* Use compare operators to get invariant values for sample results.
|
351
|
+
|
352
|
+
|
353
|
+
### Know your SCM
|
354
|
+
|
355
|
+
I use git as SCM for my work. Here are some hints how I check changes in the
|
356
|
+
results files:
|
357
|
+
|
358
|
+
```shell
|
359
|
+
git diff --ignore-all-space -- regtest/*.yml
|
360
|
+
git diff --color-words --ignore-all-space -- regtest/*.yml
|
361
|
+
git diff --color-words=. --ignore-all-space
|
362
|
+
git diff --color-words=\\w+ --ignore-all-space
|
363
|
+
git diff --color-moved
|
364
|
+
```
|
365
|
+
|
366
|
+
|
367
|
+
### Unexpected exceptions
|
368
|
+
|
369
|
+
If there is an exception raised inside a regtest sample its message is a part
|
370
|
+
of the result of the sample. This is intentional because exceptions are
|
371
|
+
possible results you want to check.
|
372
|
+
|
373
|
+
But sometimes an exception occur inside of a sample that was not the intention
|
374
|
+
of the sample code. In such situation it would be helpful to have the full
|
375
|
+
exception message with the backtrace, to find the code location where the error
|
376
|
+
occurred.
|
377
|
+
|
378
|
+
You can do this with setting `Regtest.show_exceptions = true` Then the
|
379
|
+
exception and backtrace is written to STDERR.
|
380
|
+
|
381
|
+
Example
|
382
|
+
|
383
|
+
```Ruby
|
384
|
+
Regtest.sample 'something' do
|
385
|
+
# ...
|
386
|
+
end
|
387
|
+
|
388
|
+
Regtest.sample 'something goes wrong' do
|
389
|
+
Regtest.show_exceptions = true
|
390
|
+
# the code that causes the problem
|
391
|
+
Regtest.show_exceptions = false
|
392
|
+
end
|
393
|
+
|
394
|
+
Regtest.sample 'another thing' do
|
395
|
+
# ...
|
396
|
+
end
|
397
|
+
```
|
398
|
+
|
399
|
+
Alternatively the use of the Ruby debugger (`require 'debug'`) could be helpful (Know Ruby):
|
400
|
+
|
401
|
+
```ruby
|
402
|
+
Regtest.sample 'something' do
|
403
|
+
# ...
|
404
|
+
end
|
405
|
+
|
406
|
+
Regtest.sample 'something goes wrong' do
|
407
|
+
IRB.debugger
|
408
|
+
# the code that causes the problem
|
409
|
+
end
|
410
|
+
|
411
|
+
Regtest.sample 'another thing' do
|
412
|
+
# ...
|
413
|
+
end
|
414
|
+
```
|
415
|
+
|
416
|
+
|
417
|
+
### Regtest is not thread safe
|
418
|
+
|
419
|
+
The methods `Regtest.sample` and `Regtest.log` are not thread safe. So you have
|
420
|
+
to ensure they are executed in a sequential order to avoid unexpected results.
|
313
421
|
|
314
422
|
|
315
423
|
## Further information
|
316
424
|
|
317
425
|
I use `regtest` in my project [scripref](https://github.com/janfri/scripref) to
|
318
|
-
generate a lot of malformed input data to check regressions in the
|
426
|
+
generate a lot of malformed input data to check regressions in the behavior of
|
319
427
|
the parser and text processor.
|
320
428
|
|
321
429
|
A little different is the usage in my projects
|
data/lib/regtest/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: regtest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.0
|
5
5
|
platform: ruby
|
6
|
+
original_platform: ''
|
6
7
|
authors:
|
7
8
|
- Jan Friedrich
|
8
9
|
bindir: bin
|
9
10
|
cert_chain: []
|
10
|
-
date: 2024-
|
11
|
+
date: 2024-11-23 00:00:00.000000000 Z
|
11
12
|
dependencies:
|
12
13
|
- !ruby/object:Gem::Dependency
|
13
14
|
name: rake
|
@@ -29,14 +30,14 @@ dependencies:
|
|
29
30
|
requirements:
|
30
31
|
- - "~>"
|
31
32
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
33
|
+
version: '3.0'
|
33
34
|
type: :development
|
34
35
|
prerelease: false
|
35
36
|
version_requirements: !ruby/object:Gem::Requirement
|
36
37
|
requirements:
|
37
38
|
- - "~>"
|
38
39
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
40
|
+
version: '3.0'
|
40
41
|
description: |
|
41
42
|
This library supports a very simple way to do regression testing with Ruby. It
|
42
43
|
is not limited to Ruby projects you can use it also in other contexts where you
|
@@ -56,18 +57,14 @@ executables: []
|
|
56
57
|
extensions: []
|
57
58
|
extra_rdoc_files: []
|
58
59
|
files:
|
59
|
-
- "./.aspell.pws"
|
60
60
|
- Changelog
|
61
|
-
- Gemfile
|
62
61
|
- LICENSE
|
63
62
|
- README.md
|
64
|
-
- Rakefile
|
65
63
|
- lib/regtest.rb
|
66
64
|
- lib/regtest/colors.rb
|
67
65
|
- lib/regtest/git.rb
|
68
66
|
- lib/regtest/task.rb
|
69
67
|
- lib/regtest/version.rb
|
70
|
-
- regtest.gemspec
|
71
68
|
homepage: https://github.com/janfri/regtest
|
72
69
|
licenses:
|
73
70
|
- Ruby
|
data/.aspell.pws
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
personal_ws-1.1 en 37
|
2
|
-
Bugfix
|
3
|
-
ENV
|
4
|
-
Friedrich
|
5
|
-
Gemfile
|
6
|
-
Matz
|
7
|
-
NOREGTESTRC
|
8
|
-
OpenStruct
|
9
|
-
README
|
10
|
-
Rakefile
|
11
|
-
Regtest
|
12
|
-
SCM
|
13
|
-
STDERR
|
14
|
-
SemVer
|
15
|
-
SemVerTag
|
16
|
-
YAML
|
17
|
-
arg
|
18
|
-
ary
|
19
|
-
backtrace
|
20
|
-
backtraces
|
21
|
-
basename
|
22
|
-
bitbucket
|
23
|
-
catched
|
24
|
-
dir
|
25
|
-
exiftool
|
26
|
-
gettime
|
27
|
-
github
|
28
|
-
md
|
29
|
-
metatest
|
30
|
-
metatests
|
31
|
-
ostruct
|
32
|
-
rb
|
33
|
-
rc
|
34
|
-
regtest
|
35
|
-
regtestrc
|
36
|
-
scripref
|
37
|
-
yaml
|
38
|
-
yml
|
data/Gemfile
DELETED
data/Rakefile
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
$:.unshift 'lib'
|
5
|
-
|
6
|
-
require 'rim/tire'
|
7
|
-
require 'rim/version'
|
8
|
-
|
9
|
-
require 'regtest/task'
|
10
|
-
require 'regtest/version'
|
11
|
-
|
12
|
-
Rim.setup do |p|
|
13
|
-
p.name = 'regtest'
|
14
|
-
p.version = Regtest::VERSION
|
15
|
-
p.authors = 'Jan Friedrich'
|
16
|
-
p.email = 'janfri26@gmail.com'
|
17
|
-
p.summary = 'Simple regression testing with Ruby.'
|
18
|
-
p.license = 'Ruby'
|
19
|
-
p.description = <<-END.gsub(/^ +/, '')
|
20
|
-
This library supports a very simple way to do regression testing with Ruby. It
|
21
|
-
is not limited to Ruby projects you can use it also in other contexts where you
|
22
|
-
can extract data with Ruby.
|
23
|
-
|
24
|
-
You write Ruby scripts with samples. Run these and get the sample results as
|
25
|
-
results files besides your scripts. Check both the scripts and the results
|
26
|
-
files in you Source Code Management System (SCM). When you run the scrips on a
|
27
|
-
later (or even previous) version of your code a simple diff show you if and how
|
28
|
-
the changes in your code or environment impact the results of your samples.
|
29
|
-
|
30
|
-
This is not a replacement for unit testing but a complement: You can produce a
|
31
|
-
lot of samples with a small amount of Ruby code (e.g. a large number of
|
32
|
-
combinations of data).
|
33
|
-
END
|
34
|
-
p.homepage = 'https://github.com/janfri/regtest'
|
35
|
-
p.ruby_version = '>=2.1.0'
|
36
|
-
end
|
37
|
-
|
38
|
-
# JRuby does not support escaping of filenames with spaces in Open3.capture3
|
39
|
-
# therefore ignore metatest files when running on JRuby
|
40
|
-
if RUBY_ENGINE == 'jruby'
|
41
|
-
REGTEST_FILES_RB.reject! {|fn| fn =~ /metatest/}
|
42
|
-
end
|
43
|
-
|
44
|
-
task :before_regtest do
|
45
|
-
verbose false do
|
46
|
-
rm_rf 'regtest/*.log'
|
47
|
-
rm_rf 'regtest/*.yml'
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
task :regtest => :before_regtest
|
52
|
-
task :test => :regtest
|
53
|
-
task :default => :test
|
data/regtest.gemspec
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: regtest 2.4.1 ruby lib
|
3
|
-
#
|
4
|
-
# This file is automatically generated by rim.
|
5
|
-
# PLEASE DO NOT EDIT IT DIRECTLY!
|
6
|
-
# Change the values in Rim.setup in Rakefile instead.
|
7
|
-
|
8
|
-
Gem::Specification.new do |s|
|
9
|
-
s.name = "regtest"
|
10
|
-
s.version = "2.4.1"
|
11
|
-
|
12
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
13
|
-
s.require_paths = ["lib"]
|
14
|
-
s.authors = ["Jan Friedrich"]
|
15
|
-
s.date = "2024-09-14"
|
16
|
-
s.description = "This library supports a very simple way to do regression testing with Ruby. It\nis not limited to Ruby projects you can use it also in other contexts where you\ncan extract data with Ruby.\n\nYou write Ruby scripts with samples. Run these and get the sample results as\nresults files besides your scripts. Check both the scripts and the results\nfiles in you Source Code Management System (SCM). When you run the scrips on a\nlater (or even previous) version of your code a simple diff show you if and how\nthe changes in your code or environment impact the results of your samples.\n\nThis is not a replacement for unit testing but a complement: You can produce a\nlot of samples with a small amount of Ruby code (e.g. a large number of\ncombinations of data).\n"
|
17
|
-
s.email = "janfri26@gmail.com"
|
18
|
-
s.files = ["./.aspell.pws", "Changelog", "Gemfile", "LICENSE", "README.md", "Rakefile", "lib/regtest", "lib/regtest.rb", "lib/regtest/colors.rb", "lib/regtest/git.rb", "lib/regtest/task.rb", "lib/regtest/version.rb", "regtest.gemspec"]
|
19
|
-
s.homepage = "https://github.com/janfri/regtest"
|
20
|
-
s.licenses = ["Ruby"]
|
21
|
-
s.required_ruby_version = Gem::Requirement.new(">= 2.1.0")
|
22
|
-
s.rubygems_version = "3.6.0.dev"
|
23
|
-
s.summary = "Simple regression testing with Ruby."
|
24
|
-
|
25
|
-
s.specification_version = 4
|
26
|
-
|
27
|
-
s.add_development_dependency(%q<rake>, [">= 0"])
|
28
|
-
s.add_development_dependency(%q<rim>, ["~> 2.17"])
|
29
|
-
end
|