regtest 2.2.0 → 2.2.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: dade806646767b2c8b5deaca696d849a629add7c09bc27fbacb741c402c2ff51
4
- data.tar.gz: e869f521c91d7d8546ad1e48ac2df5804bad9635b64383a8f8ab27ea5688571c
3
+ metadata.gz: b91c5f1f5b30d309f77eaf7c3c218529bd82321a7af578b37c52a4bed09d53e4
4
+ data.tar.gz: f66632f3eb0f2844ab43068f83c30e62aca2805dad460543436b9df0620c3598
5
5
  SHA512:
6
- metadata.gz: 9d62e5e02737461d2a79b844935357ad71c7c744bee6992a470e67b743d1a8fb123c34c78318b19025e1581e3571d75687b76cb7d8d1ad120f5adac8926d1836
7
- data.tar.gz: 076042c8d2dd51711c2459b51b40bedde4d6b782fd53b15227103094fb560b50b5bbc00412ee7cb641053ec07cd5e714152726fa36e30cc6155c96faea1cfa0b
6
+ metadata.gz: 38257004b8aab5bbad388e430b85362e80b5759be4ca1729756ce0e2704a6cc85f12e3899c17b28df32afc1380251228321f750fb7f8bc4bd951a56e1ca27690
7
+ data.tar.gz: 2a2f5f808848caccb56db4a4d90a9e34babf70a79d30bf49182317c77081985bcae89289c77acab5ba4a029483330ba3533a37d91be6fbdfc7b63b3cfd397948
data/Changelog CHANGED
@@ -1,3 +1,8 @@
1
+ 2.2.1
2
+ Adapt git output to work with different git versions.
3
+ Simplify determination of filenames for outputs.
4
+ Add a test and Fix documentation.
5
+
1
6
  2.2.0
2
7
  Add a new method Regtest.log to allow the logging of temporary values which
3
8
  could be of interest for different reasons (i. e. debugging).
data/README.md CHANGED
@@ -153,7 +153,7 @@ if this assumption is true at another (mostly later) state of code. But often
153
153
  there are temporary or specific values which changes or could change at each
154
154
  run of regtest. This could be for example an id for a created record or the
155
155
  version of a used external service or some time-relevant values. Sometimes it
156
- is be useful, to know the actual value of one of these.
156
+ is useful, to know the actual value of one of these.
157
157
 
158
158
  In such cases the method ```Regtest.log``` could be handy. It writes a line of
159
159
  the given object to a log file which is named with the same name as the calling
data/lib/regtest.rb CHANGED
@@ -84,7 +84,7 @@ module Regtest
84
84
  when 'a', 'w'
85
85
  # ok
86
86
  else
87
- raise ArgumentError.new("Mode #{mode} is not allowed.")
87
+ raise ArgumentError.new(format('Mode %s is not allowed.', mode))
88
88
  end
89
89
  Regtest.log_filenames << log_filename
90
90
  File.open log_filename, mode do |f|
@@ -100,10 +100,7 @@ module Regtest
100
100
  # caller of the calling method
101
101
  # @param ext new extension (i.e. '.yml')
102
102
  def determine_filename_from_caller ext
103
- cls = caller_locations
104
- base_label = cls.first.base_label
105
- cls = cls.drop_while {|cl| cl.base_label == base_label}
106
- cls.first.path.sub(/\.rb$/, '') << ext.to_s
103
+ caller_locations(2, 1).first.path.sub(/\.rb$/, '') << ext.to_s
107
104
  end
108
105
 
109
106
  # Report some statistics, could be overwritten by plugins.
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Regtest
5
- VERSION = '2.2.0'
5
+ VERSION = '2.2.1'
6
6
  end
data/regtest.gemspec CHANGED
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: regtest 2.2.0 ruby lib
2
+ # stub: regtest 2.2.1 ruby lib
3
3
  #
4
4
  # This file is automatically generated by rim.
5
5
  # PLEASE DO NOT EDIT IT DIRECTLY!
@@ -7,33 +7,29 @@
7
7
 
8
8
  Gem::Specification.new do |s|
9
9
  s.name = "regtest"
10
- s.version = "2.2.0"
10
+ s.version = "2.2.1"
11
11
 
12
12
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
13
13
  s.require_paths = ["lib"]
14
14
  s.authors = ["Jan Friedrich"]
15
- s.date = "2019-12-20"
15
+ s.date = "2021-02-24"
16
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
17
  s.email = "janfri26@gmail.com"
18
18
  s.files = ["./.aspell.pws", "Changelog", "Gemfile", "LICENSE", "README.md", "Rakefile", "lib/regtest", "lib/regtest.rb", "lib/regtest/colorize.rb", "lib/regtest/colors.rb", "lib/regtest/git.rb", "lib/regtest/task.rb", "lib/regtest/version.rb", "regtest.gemspec", "regtest/combinations.rb", "regtest/combinations.yml", "regtest/examples.rb", "regtest/examples.yml", "regtest/filename with spaces.rb", "regtest/filename with spaces.yml", "regtest/log.log", "regtest/log.rb", "regtest/log.yml", "regtest/log_append.log", "regtest/log_append.rb", "regtest/log_append.yml", "regtest/log_rewrite.log", "regtest/log_rewrite.rb", "regtest/log_rewrite.yml", "regtest/metatest.rb", "regtest/metatest.yml", "regtest/metatest_git.rb", "regtest/metatest_git.yml", "regtest/no_samples.rb", "regtest/toplevel.log", "regtest/toplevel.rb", "regtest/toplevel.yml"]
19
19
  s.homepage = "https://github.com/janfri/regtest"
20
20
  s.licenses = ["Ruby"]
21
21
  s.required_ruby_version = Gem::Requirement.new(">= 2.1.0")
22
- s.rubygems_version = "3.0.3"
22
+ s.rubygems_version = "3.2.3"
23
23
  s.summary = "Simple regression testing with Ruby."
24
24
 
25
25
  if s.respond_to? :specification_version then
26
26
  s.specification_version = 4
27
+ end
27
28
 
28
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
29
- s.add_development_dependency(%q<rake>, [">= 0"])
30
- s.add_development_dependency(%q<rim>, ["~> 2.17"])
31
- s.add_development_dependency(%q<regtest>, ["~> 2"])
32
- else
33
- s.add_dependency(%q<rake>, [">= 0"])
34
- s.add_dependency(%q<rim>, ["~> 2.17"])
35
- s.add_dependency(%q<regtest>, ["~> 2"])
36
- end
29
+ if s.respond_to? :add_runtime_dependency then
30
+ s.add_development_dependency(%q<rake>, [">= 0"])
31
+ s.add_development_dependency(%q<rim>, ["~> 2.17"])
32
+ s.add_development_dependency(%q<regtest>, ["~> 2"])
37
33
  else
38
34
  s.add_dependency(%q<rake>, [">= 0"])
39
35
  s.add_dependency(%q<rim>, ["~> 2.17"])
data/regtest/log.log CHANGED
@@ -1,3 +1,3 @@
1
- 8657.59655
2
- 8657.596803
1
+ 2085.99375
2
+ 2085.994022
3
3
  Logging from outside of a sample works.
data/regtest/log.rb CHANGED
@@ -11,4 +11,8 @@ Regtest.sample 'test' do
11
11
  a < b
12
12
  end
13
13
 
14
+ Regtest.sample 'invalid mode' do
15
+ Regtest.log 'foo', mode: 'x'
16
+ end
17
+
14
18
  Regtest.log 'Logging from outside of a sample works.'
data/regtest/log.yml CHANGED
@@ -1,3 +1,6 @@
1
1
  ---
2
2
  sample: test
3
3
  result: true
4
+ ---
5
+ sample: invalid mode
6
+ exception: Mode x is not allowed.
data/regtest/metatest.yml CHANGED
@@ -9,7 +9,7 @@ result:
9
9
  filename with spaces.yml
10
10
  .
11
11
  log.yml
12
- .
12
+ ..
13
13
  log_append.yml
14
14
  ...
15
15
  log_rewrite.yml
@@ -17,7 +17,7 @@ result:
17
17
  toplevel.yml
18
18
  .....
19
19
 
20
- 22 samples executed in x.xx s (x samples/s)
20
+ 23 samples executed in x.xx s (x samples/s)
21
21
 
22
22
  Please check result files manually. Regtest isn't able to do that.
23
23
  stderr: ''
@@ -21,6 +21,7 @@ begin
21
21
  # Levelling out runtime specific differences.
22
22
  res['stdout'].gsub!(/\d+\.\d+/, 'x.xx')
23
23
  res['stdout'].gsub!(%r(\d+ samples/s), 'x samples/s')
24
+ res['stdout'].gsub!(/^\?\? filename with spaces.yml$/m, '?? "filename with spaces.yml"')
24
25
  res['exitstatus'] = ps.exitstatus
25
26
  res
26
27
  end
@@ -9,7 +9,7 @@ result:
9
9
  filename with spaces.yml
10
10
  .
11
11
  log.yml
12
- .
12
+ ..
13
13
  log_append.yml
14
14
  ...
15
15
  log_rewrite.yml
@@ -17,12 +17,12 @@ result:
17
17
  toplevel.yml
18
18
  .....
19
19
 
20
- 22 samples executed in x.xx s (x samples/s)
20
+ 23 samples executed in x.xx s (x samples/s)
21
21
 
22
22
  There is at least one new sample result file.
23
23
  ?? combinations.yml
24
24
  ?? examples.yml
25
- ?? filename with spaces.yml
25
+ ?? "filename with spaces.yml"
26
26
  ?? log.yml
27
27
  ?? log_append.yml
28
28
  ?? log_rewrite.yml
@@ -40,7 +40,7 @@ result:
40
40
  filename with spaces.yml
41
41
  .
42
42
  log.yml
43
- .
43
+ ..
44
44
  log_append.yml
45
45
  ...
46
46
  log_rewrite.yml
@@ -48,12 +48,12 @@ result:
48
48
  toplevel.yml
49
49
  .....
50
50
 
51
- 22 samples executed in x.xx s (x samples/s)
51
+ 23 samples executed in x.xx s (x samples/s)
52
52
 
53
53
  There is at least one new sample result file.
54
54
  A combinations.yml
55
55
  A examples.yml
56
- ?? filename with spaces.yml
56
+ ?? "filename with spaces.yml"
57
57
  ?? log.yml
58
58
  ?? log_append.yml
59
59
  ?? log_rewrite.yml
@@ -71,7 +71,7 @@ result:
71
71
  filename with spaces.yml
72
72
  .
73
73
  log.yml
74
- .
74
+ ..
75
75
  log_append.yml
76
76
  ...
77
77
  log_rewrite.yml
@@ -79,12 +79,12 @@ result:
79
79
  toplevel.yml
80
80
  .....
81
81
 
82
- 23 samples executed in x.xx s (x samples/s)
82
+ 24 samples executed in x.xx s (x samples/s)
83
83
 
84
84
  There are changes in your sample results!
85
85
  A combinations.yml
86
86
  AM examples.yml
87
- ?? filename with spaces.yml
87
+ ?? "filename with spaces.yml"
88
88
  ?? log.yml
89
89
  ?? log_append.yml
90
90
  ?? log_rewrite.yml
@@ -102,7 +102,7 @@ result:
102
102
  filename with spaces.yml
103
103
  .
104
104
  log.yml
105
- .
105
+ ..
106
106
  log_append.yml
107
107
  ...
108
108
  log_rewrite.yml
@@ -110,11 +110,11 @@ result:
110
110
  toplevel.yml
111
111
  .....
112
112
 
113
- 23 samples executed in x.xx s (x samples/s)
113
+ 24 samples executed in x.xx s (x samples/s)
114
114
 
115
115
  There are changes in your sample results!
116
116
  M examples.yml
117
- ?? filename with spaces.yml
117
+ ?? "filename with spaces.yml"
118
118
  ?? log.yml
119
119
  ?? log_append.yml
120
120
  ?? log_rewrite.yml
@@ -132,7 +132,7 @@ result:
132
132
  filename with spaces.yml
133
133
  .
134
134
  log.yml
135
- .
135
+ ..
136
136
  log_append.yml
137
137
  ...
138
138
  log_rewrite.yml
@@ -140,7 +140,7 @@ result:
140
140
  toplevel.yml
141
141
  .....
142
142
 
143
- 23 samples executed in x.xx s (x samples/s)
143
+ 24 samples executed in x.xx s (x samples/s)
144
144
 
145
145
  Looks good. :)
146
146
  M examples.yml
@@ -162,7 +162,7 @@ result:
162
162
  filename with spaces.yml
163
163
  .
164
164
  log.yml
165
- .
165
+ ..
166
166
  log_append.yml
167
167
  ...
168
168
  log_rewrite.yml
@@ -170,7 +170,7 @@ result:
170
170
  toplevel.yml
171
171
  .....
172
172
 
173
- 23 samples executed in x.xx s (x samples/s)
173
+ 24 samples executed in x.xx s (x samples/s)
174
174
 
175
175
  Looks good. :)
176
176
  stderr: ''
data/regtest/toplevel.log CHANGED
@@ -1 +1 @@
1
- 0.9128981855032113
1
+ 0.65204510187786
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: regtest
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Friedrich
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-20 00:00:00.000000000 Z
11
+ date: 2021-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -111,7 +111,7 @@ homepage: https://github.com/janfri/regtest
111
111
  licenses:
112
112
  - Ruby
113
113
  metadata: {}
114
- post_install_message:
114
+ post_install_message:
115
115
  rdoc_options: []
116
116
  require_paths:
117
117
  - lib
@@ -126,8 +126,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  - !ruby/object:Gem::Version
127
127
  version: '0'
128
128
  requirements: []
129
- rubygems_version: 3.0.3
130
- signing_key:
129
+ rubygems_version: 3.2.3
130
+ signing_key:
131
131
  specification_version: 4
132
132
  summary: Simple regression testing with Ruby.
133
133
  test_files: []