fitting 4.0.0 → 4.0.2

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: acf56757fc3fe3dca52c0ffc19624debab877fd8f9ea71ffa891ab19674c1a65
4
- data.tar.gz: c2238a9ad8374f72075aa07b48323910bfb670ab57f95dfff6ca12dace14faaf
3
+ metadata.gz: e88ddb2b0aba7b858d42c2deb0b0f99534efe8b6fa182585c6a77bd5a3de4e31
4
+ data.tar.gz: 27e3d3f54a808a0818fcd0cd991aea1e1f7c8084983f134716d4d26829c5d76a
5
5
  SHA512:
6
- metadata.gz: 3e2a972498110e3c2b8ea625d0b7e73f5a127209b94e3f4373cf49a3cd38eb5c04483e876dc07bcb9b71ee3c90c7b5900e8fe31fc73ce39aec597bf70fad7e88
7
- data.tar.gz: debb064c3590bc59c5a783d3546d4de6f75727ab4aa354d3e40f6548f7b72cc8ae9b05a1d009dab55aa0eba900a0e783979265c38dfda89b483f64c3e0f2d6ee
6
+ metadata.gz: 73da9d87c292f0a996311722b80b5d3cf488250980ede0aff735669fe256db057d555b5b7f90da1f0be226e9de9d68f4d139c5fea5eeb6868491f7fc81fe4484
7
+ data.tar.gz: 30af36305effe12e47c63491bd2be33c3e810e302a982388d2aa4ca1802734514d5492cc4f7043f9a867e954a83aa39d6addd404b30e1f777b46e9c42b487263
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Change log
2
2
 
3
+ ### 4.0.2 - 2023-02-17
4
+
5
+ * patch
6
+ * skip error if not request in request test
7
+
8
+ ### 4.0.1 - 2023-02-16
9
+
10
+ * patch
11
+ * fix more info error if not found nocov
12
+ * fix deep nocov
13
+ * fix deep check result coverage for console
14
+
3
15
  ### 4.0.0 - 2023-02-03
4
16
 
5
17
  * features
data/README.md CHANGED
@@ -312,7 +312,7 @@ APIs:
312
312
  It is not necessary to immediately describe each host in detail, you can only specify its name and skip it until you are ready to documented it
313
313
 
314
314
  ```yaml
315
- SkipAPIs:
315
+ SkipValidation:
316
316
  - host: api.cluster.dyte.in
317
317
  ```
318
318
 
@@ -321,7 +321,7 @@ SkipAPIs:
321
321
  If you want to skip a specific prefix in the host
322
322
 
323
323
  ```yaml
324
- SkipAPIs:
324
+ SkipValidation:
325
325
  - host: api.cluster.dyte.in
326
326
  prefix: /admin/api
327
327
  ```
@@ -331,7 +331,7 @@ SkipAPIs:
331
331
  If you want to skip a specific request in the host
332
332
 
333
333
  ```yaml
334
- SkipAPIs:
334
+ SkipValidation:
335
335
  - host: api.cluster.dyte.in
336
336
  method: GET
337
337
  path: /api/v1/cars
@@ -341,6 +341,20 @@ SkipAPIs:
341
341
 
342
342
  It is not necessary to immediately test each doc in detail, you can only specify its name and skip it until you are ready to test it
343
343
 
344
+ #### host
345
+ ```yaml
346
+ NoCov:
347
+ - host: sso.test
348
+ ```
349
+
350
+ #### method
351
+ ```yaml
352
+ NoCov:
353
+ - host: sso.test
354
+ method: GET
355
+ ```
356
+
357
+ #### path
344
358
  ```yaml
345
359
  NoCov:
346
360
  - host: sso.test
@@ -348,6 +362,48 @@ NoCov:
348
362
  path: /users/{userId}
349
363
  ```
350
364
 
365
+ #### code
366
+ ```yaml
367
+ NoCov:
368
+ - host: sso.test
369
+ method: GET
370
+ path: /users/{userId}
371
+ code: 200
372
+ ```
373
+
374
+ #### content-type
375
+ ```yaml
376
+ NoCov:
377
+ - host: sso.test
378
+ method: GET
379
+ path: /users/{userId}
380
+ code: 200
381
+ content-type: application/json
382
+ ```
383
+
384
+ #### combination
385
+ ```yaml
386
+ NoCov:
387
+ - host: sso.test
388
+ method: GET
389
+ path: /users/{userId}
390
+ code: 200
391
+ content-type: application/json
392
+ combination: oneOf.0
393
+ ```
394
+
395
+ #### combination_next
396
+ ```yaml
397
+ NoCov:
398
+ - host: sso.test
399
+ method: GET
400
+ path: /users/{userId}
401
+ code: 200
402
+ content-type: application/json
403
+ combination: oneOf.0
404
+ combination_next: oneOf.0.required.users
405
+ ```
406
+
351
407
  ### Debug
352
408
 
353
409
  If you find bug, you can debug it or create task in this github project with new file `coverage/fitting.debug.yml`
@@ -79,10 +79,6 @@ module Fitting
79
79
  end_index
80
80
  end
81
81
 
82
- def nocover!
83
- @step_cover_size = nil
84
- end
85
-
86
82
  def to_hash
87
83
  @step_key
88
84
  end
data/lib/fitting/doc.rb CHANGED
@@ -80,16 +80,16 @@ module Fitting
80
80
  raise NotFound
81
81
  end
82
82
 
83
- def self.report(docs)
83
+ def self.report(actions)
84
84
  all = 0
85
85
  cov = 0
86
- docs.each do |provid|
87
- provid.to_hash.values.first.each do |prov|
88
- if prov == nil
89
- break
90
- elsif prov == 0
86
+ actions.each do |action|
87
+ action.to_hash.values.first.each do |cover_line|
88
+ if cover_line == nil
89
+ next
90
+ elsif cover_line == 0
91
91
  all += 1
92
- elsif prov > 0
92
+ elsif cover_line > 0
93
93
  all += 1
94
94
  cov += 1
95
95
  end
data/lib/fitting/nocov.rb CHANGED
@@ -29,6 +29,10 @@ module Fitting
29
29
  raise NotFound.new("host: #{@host}, method: #{@method}, path: #{@path}")
30
30
  end
31
31
 
32
+ if res == nil
33
+ raise NotFound.new("host: #{@host}, method: #{@method}, path: #{@path}")
34
+ end
35
+
32
36
  res_code = res.responses.find { |response| response.step_key == @code.to_s }
33
37
 
34
38
  if @content_type == nil
@@ -1,3 +1,3 @@
1
1
  module Fitting
2
- VERSION = '4.0.0'.freeze
2
+ VERSION = '4.0.2'.freeze
3
3
  end
data/lib/fitting.rb CHANGED
@@ -29,13 +29,19 @@ module Fitting
29
29
  end
30
30
 
31
31
  config.after(:each, type: :request) do |example|
32
- request = Fitting::Records::Tested::Request.new(response, example)
33
- responses += "FITTING incoming request #{request.to_spherical.to_json}\n"
32
+ begin
33
+ request = Fitting::Records::Tested::Request.new(response, example)
34
+ responses += "FITTING incoming request #{request.to_spherical.to_json}\n"
35
+ rescue NoMethodError
36
+ end
34
37
  end
35
38
 
36
39
  config.after(:each, type: :controller) do |example|
37
- request = Fitting::Records::Tested::Request.new(response, example)
38
- responses += "FITTING incoming request #{request.to_spherical.to_json}\n"
40
+ begin
41
+ request = Fitting::Records::Tested::Request.new(response, example)
42
+ responses += "FITTING incoming request #{request.to_spherical.to_json}\n"
43
+ rescue NoMethodError
44
+ end
39
45
  end
40
46
 
41
47
  config.after(:each) do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fitting
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - d.efimov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-02-03 00:00:00.000000000 Z
11
+ date: 2023-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json-schema