fitting 1.2.0 → 1.3.0

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
  SHA1:
3
- metadata.gz: fdb557f593641ef3769db74073ce39029981fd16
4
- data.tar.gz: 18155ebc235d3c992c2ce2f16cef2ac3ab9f7614
3
+ metadata.gz: f3fce709e59f37b6aea1b418aee6c4af7443933f
4
+ data.tar.gz: 53cdf8fb2af8136b22e1980ca8f4d6f341d8136e
5
5
  SHA512:
6
- metadata.gz: 102887cabc4a1b99e2214017b5e4023162a60f1e6a68ecb39c522f91b406572cc03d3217b30b26c172189d80dfb32d88b6046d8af23a106027b5e9f32512abf6
7
- data.tar.gz: 1cf4d5d1dac4bd4c758cacfe35f12df107514b9f6cde8db62ad09a15df7519ecf562706cc83078872b5b857331c8703f4b65b19fb0ab32b3a332f8de13ddf750
6
+ metadata.gz: fffad7b8527302929b86f2a40c8244fca7e00895a7651aa7a94950a23523619cd1c91ba618371ef065c27ab0617ff0166af75f5172750082feeb69e4a11105cf
7
+ data.tar.gz: 558112161639ca609b416654cbe03ecf97d39b12c68da883e0db283ba28aaec674248a7bd4abfae1319cc826ab81480f14654b9acf4f7c52aedbf5621d375ed5
data/README.md CHANGED
@@ -57,9 +57,9 @@ end
57
57
 
58
58
  ## Config
59
59
 
60
- ### crash_not_implemented_response
60
+ ### necessary_fully_implementation_of_responses
61
61
 
62
- Default true.
62
+ Default `true`. It returns `exit 1` if not implemented all(with tests expect match response) the responses.
63
63
 
64
64
  ## Report
65
65
 
@@ -1,10 +1,10 @@
1
1
  module Fitting
2
2
  class Configuration
3
3
  attr_accessor :tomogram,
4
- :crash_not_implemented_response
4
+ :necessary_fully_implementation_of_responses
5
5
 
6
6
  def initialize
7
- @crash_not_implemented_response = true
7
+ @necessary_fully_implementation_of_responses = true
8
8
  end
9
9
  end
10
10
  end
@@ -1,3 +1,3 @@
1
1
  module Fitting
2
- VERSION = '1.2.0'.freeze
2
+ VERSION = '1.3.0'.freeze
3
3
  end
data/lib/fitting.rb CHANGED
@@ -7,6 +7,8 @@ require 'fitting/storage/documentation'
7
7
  require 'fitting/storage/skip'
8
8
  require 'fitting/matchers/response_matcher'
9
9
 
10
+ ERROR_EXIT_CODE = 1
11
+
10
12
  module Fitting
11
13
  class << self
12
14
  def configure
@@ -26,9 +28,9 @@ module RSpec
26
28
  alias origin_run_specs run_specs
27
29
 
28
30
  def run_specs(example_groups)
29
- origin_run_specs(example_groups)
31
+ returned_exit_code = origin_run_specs(example_groups)
30
32
 
31
- return if Fitting::Storage::Skip.get
33
+ return returned_exit_code if Fitting::Storage::Skip.get
32
34
 
33
35
  response_routes = Fitting::Documentation::Response::Route.new(
34
36
  Fitting::Storage::Documentation.hash,
@@ -40,7 +42,12 @@ module RSpec
40
42
  request_routes.statistics
41
43
  response_routes.statistics
42
44
 
43
- exit if response_routes.not_coverage.present? && Fitting.configuration.crash_not_implemented_response
45
+ if Fitting.configuration.necessary_fully_implementation_of_responses &&
46
+ returned_exit_code == 0 &&
47
+ response_routes.not_coverage.present?
48
+ return ERROR_EXIT_CODE
49
+ end
50
+ returned_exit_code
44
51
  end
45
52
  end
46
53
  end
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: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - d.efimov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-02 00:00:00.000000000 Z
11
+ date: 2017-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json-schema