pact-mock_service 2.9.8 → 2.10.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
  SHA256:
3
- metadata.gz: 0ef699a1acd0281dbff4a1aea2cc7410ccd74255cd6ee2fd1bddd9b75f4ca446
4
- data.tar.gz: b6a3d4981061358f1d1822511d25d34065cacca786dd8fbfe55aa8feab656f3c
3
+ metadata.gz: 57000d6eb45cb2bdbcc12574580ed0b3e8d31d6672f36d7cde35e8046f11e8b3
4
+ data.tar.gz: bad5df5331628319986fa2ce5f6af4a01cf923301c3cd4bb4c1e201d683c8dee
5
5
  SHA512:
6
- metadata.gz: a3b9f6bb39910a4530cfd07ac4f5aeb2c6952eb4c4fd1baed82da64e503b5a0e7fdfe07f803b03f227721ffb0a20710264708333be154be902bc1223de68b9f7
7
- data.tar.gz: 5c1ea2f62ba55dde377650a986779ea925cd5c82cdb1aa136e6dea99cc6e26bcb80ab6c787c86975fcf488d3458b347a8c1f990c1cbf92cc043df47b9b4f2a9b
6
+ metadata.gz: d1da9592af74aa18e461ce0fb9a13946a0c93cce203d546fef866c6ead81944682c870aa0d296d0196ade06b4d6c682fb4e72641e2d8ea9cff56f75a375b86f3
7
+ data.tar.gz: 5920dcc583bb909a120eb00ab761205a7a3539922a426257692ccecec00d594bdb2d451ff49f1452598108761b399ab4d2d1a391da85b4e707eede912837589e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ <a name="v2.10.0"></a>
2
+ ### v2.10.0 (2018-08-07)
3
+
4
+
5
+ #### Features
6
+
7
+ * use Pact::Error subclass instead of RuntimeErrors ([a15dd3e](/../../commit/a15dd3e))
8
+
9
+
1
10
  <a name="v2.9.8"></a>
2
11
  ### v2.9.8 (2018-07-23)
3
12
 
@@ -1,8 +1,14 @@
1
1
  require 'net/http'
2
2
  require 'pact/mock_service/interaction_decorator'
3
+ require 'pact/errors'
3
4
 
4
5
  module Pact
5
6
  module MockService
7
+
8
+ class VerificationFailedError < Pact::Error; end
9
+ class AddInteractionError < Pact::Error; end
10
+ class WritePactError < Pact::Error; end
11
+
6
12
  class Client
7
13
 
8
14
  MOCK_SERVICE_ADMINISTRATON_HEADERS = {'X-Pact-Mock-Service' => 'true'}
@@ -13,7 +19,7 @@ module Pact
13
19
 
14
20
  def verify example_description
15
21
  response = http.request_get("/interactions/verification?example_description=#{CGI.escape(example_description)}", MOCK_SERVICE_ADMINISTRATON_HEADERS)
16
- raise "\e[31m#{response.body}\e[m" unless response.is_a? Net::HTTPSuccess
22
+ raise VerificationFailedError.new("\e[31m#{response.body}\e[m") unless response.is_a? Net::HTTPSuccess
17
23
  end
18
24
 
19
25
  def log msg
@@ -37,7 +43,7 @@ module Pact
37
43
  interaction_json(interaction),
38
44
  MOCK_SERVICE_ADMINISTRATON_HEADERS.merge("Content-Type" => "application/json")
39
45
  )
40
- raise "\e[31m#{response.body}\e[m" unless response.is_a? Net::HTTPSuccess
46
+ raise AddInteractionError.new("\e[31m#{response.body}\e[m") unless response.is_a? Net::HTTPSuccess
41
47
  end
42
48
 
43
49
  def self.clear_interactions port, example_description
@@ -46,7 +52,7 @@ module Pact
46
52
 
47
53
  def write_pact pacticipant_details
48
54
  response = http.request_post("/pact", pacticipant_details.to_json, MOCK_SERVICE_ADMINISTRATON_HEADERS.merge("Content-Type" => "application/json"))
49
- raise "\e[31m#{response.body}\e[m" unless response.is_a? Net::HTTPSuccess
55
+ raise WritePactError.new("\e[31m#{response.body}\e[m") unless response.is_a? Net::HTTPSuccess
50
56
  response.body
51
57
  end
52
58
 
@@ -67,7 +73,6 @@ module Pact
67
73
  def interaction_json interaction
68
74
  Pact::MockService::InteractionDecorator.new(interaction).to_json
69
75
  end
70
-
71
76
  end
72
77
  end
73
- end
78
+ end
@@ -1,5 +1,5 @@
1
1
  module Pact
2
2
  module MockService
3
- VERSION = "2.9.8"
3
+ VERSION = "2.10.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pact-mock_service
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.8
4
+ version: 2.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Fraser
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2018-07-23 00:00:00.000000000 Z
15
+ date: 2018-08-06 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rack