testkit123 0.2.3 → 0.2.4

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: b0080e9b7a855daa8c8cc92c6eeac89d02003680fe353842f5719dba83e7d2d9
4
- data.tar.gz: 2c8e70d98c9aaab9261390e2933b3f026e3af1417b941e98ed705122903ec9dd
3
+ metadata.gz: f614e8e95327241b534bbf266dad46525c6cd71adbedf8ca8044527cc9882a62
4
+ data.tar.gz: 0777ac2e0d3c01b7d4a6238a428be34496f2cb3910f5bcb86075af1f37329325
5
5
  SHA512:
6
- metadata.gz: c9f17b05aa914b53b55ebf4a88079beb47245a0f55c1e5167e3fe016f99105622d5a35c48ffb2b59eb2f1b6846684e682951eb4d6591f873c3d256fb85d2fb74
7
- data.tar.gz: a2c06414eaa20598951a3f1efef279b941906e2b6ab6728eb4577c11c586fab0595c06460f4fdbc57110def3e04e213d0a3e7983f0f8473a02ecd4358c680f5f
6
+ metadata.gz: c36ff119e0864242544c179d34a2674524873b2458a65b43384018a46bff12ea9f9ed8579fa76b31a22e1723656a38d23ecea3bb001ccf160ec70b3191e1eb54
7
+ data.tar.gz: 5596f0154676cb0893ad1db11bf20a35430ec566e5abd4f77f6208cce7af4f7d3ded1cff57848e55469a3d033669a2f1a2870a2124fda5b8e3277380328b20bc
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/testkit123.rb CHANGED
@@ -20,6 +20,7 @@ class TestKit123
20
20
  debug: false, localpath: nil, datapath: nil,
21
21
  gemtest_url: nil, rubyver: 'ruby-2.5.1')
22
22
 
23
+ @debug = debug
23
24
  @h = templates
24
25
 
25
26
  @project_config = if project =~ /\.txt$/ then
@@ -27,8 +28,9 @@ class TestKit123
27
28
  elsif project
28
29
  File.join(localpath, project + '.txt')
29
30
  end
31
+ puts '@project_config: ' + @project_config.inspect if @debug
30
32
 
31
- @debug = debug
33
+
32
34
  @localpath, @datapath, @gemtest_url = localpath, datapath, gemtest_url
33
35
  @rubyver = rubyver
34
36
 
@@ -126,6 +128,7 @@ end
126
128
  config = SimpleConfig.new(@project_config).to_h
127
129
 
128
130
  proj = config[:project]
131
+ puts 'create_standalone: proj: ' + proj.inspect if @debug
129
132
  datafilepath = config[:data_path] + '/' + proj
130
133
  test_rbfile = File.join(datafilepath, "test_#{proj}.rb")
131
134
 
@@ -133,8 +136,10 @@ end
133
136
  testdata_file = File.join(datafilepath, "testdata_#{proj}.#{ext}")
134
137
  puts 'testdata_file: ' + testdata_file.inspect if @debug
135
138
 
136
- s = File.read test_rbfile
139
+ s = File.read(test_rbfile).gsub(/^( )?end/,'')
137
140
  require_gems = s.scan(/^require +['"]([^'"]+)/).map(&:first)
141
+
142
+ before_test = s[/(?<=def tests\(\)).*(?=\n test )/m].lstrip
138
143
 
139
144
  a = s.split(/(?= test )/)
140
145
  a.shift
@@ -166,7 +171,8 @@ end
166
171
  end.join
167
172
 
168
173
  args = testnode.xpath('records/input/summary/*').map do |input|
169
- "test_%s = '%s'" % [input.name, input.texts.join.gsub(/'/,"\'").strip]
174
+ "test_%s =<<EOF\n%s\nEOF\n" % [input.name,
175
+ input.texts.join.gsub(/'/,"\'").strip]
170
176
  end
171
177
 
172
178
  vars = testnode.xpath('records/input/summary/*').map(&:name)
@@ -181,10 +187,10 @@ end
181
187
 
182
188
  "# Test %d. Type: %s\n# Description: %s\n" \
183
189
  % [n, title, testnode.text('summary/type')] + \
184
- "# ----------------------\n\n" + \
190
+ "# --------------------------------------------\n\n" + \
185
191
  "require '#{proj}'\n" + require_gems.map {|x| "require '%s'" \
186
192
  % x}.join("\n") + "\n\n\n" \
187
- + args.join("\n") + testcode
193
+ + before_test.gsub(/^ /,'') + "\n" + args.join("\n") + testcode
188
194
 
189
195
  end
190
196
 
@@ -284,4 +290,3 @@ EOF
284
290
  end
285
291
 
286
292
  end
287
-
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testkit123
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -30,7 +30,7 @@ cert_chain:
30
30
  MBi32Noiyau3znLWYXucwnOR8dh4RhcwxaP82ZX6Up19+qVqJqravkDQ+OBff6o+
31
31
  m3U=
32
32
  -----END CERTIFICATE-----
33
- date: 2018-08-16 00:00:00.000000000 Z
33
+ date: 2018-08-19 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: rxfhelper
@@ -41,7 +41,7 @@ dependencies:
41
41
  version: '0.8'
42
42
  - - ">="
43
43
  - !ruby/object:Gem::Version
44
- version: 0.8.4
44
+ version: 0.8.5
45
45
  type: :runtime
46
46
  prerelease: false
47
47
  version_requirements: !ruby/object:Gem::Requirement
@@ -51,7 +51,7 @@ dependencies:
51
51
  version: '0.8'
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 0.8.4
54
+ version: 0.8.5
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: simple-config
57
57
  requirement: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
Binary file