pact_broker-client 1.0.0 → 1.0.1

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
  SHA1:
3
- metadata.gz: 6a967616dbb7645aee64d92eb651df824eafc0c2
4
- data.tar.gz: a71df89ab5813ff99fe394b95132181e8411512f
3
+ metadata.gz: 0ca51a8c01825eeaadd3f7113105f8ccef5f6a5d
4
+ data.tar.gz: 22f5022a7b7e03f7a80c58ef994ffb95dec6545a
5
5
  SHA512:
6
- metadata.gz: 54a964cd4ee363a53da92ea018b94ea9fbc868c485a4351a7c69ba359d2cde0c013136298a1c736b54da8e767c243f8e548f5290e8c52f8dc7568dfb8fb4b987
7
- data.tar.gz: 965141aba58e46843f5f6defd961c3f5077086920bf7fe3e760c1c3b4925face6f4aeb3210c7bda523a06a0c37c7f226137463fc401ee44920dbb50ff97b2942
6
+ metadata.gz: 6f5269cbcb24c78f9033c79efd745f0edb2fd18afc17336f4c013dbb59f6f07c5c9f9ad7bb217b116b052b6584c0819de7293a38d22f3867e9814b0c416b06ce
7
+ data.tar.gz: b0d1ff3d2bf4c4fdaa72c37545e01ffc76f8c75ce2a7fe25a4412f6b5b14fd5267e206170db19f706c155add4b3cc299d16126993b1d4cdf32f81a9491cacdfc
data/.gitignore CHANGED
@@ -23,3 +23,4 @@ doc/
23
23
  # Editor files
24
24
  *.sublime*
25
25
  log
26
+ Gemfile.lock
data/.travis.yml ADDED
@@ -0,0 +1,8 @@
1
+ language: ruby
2
+ sudo: false
3
+ rvm:
4
+ - 2.0.0
5
+ - 2.1.8
6
+ - 2.2.4
7
+ - 2.3.0
8
+ - jruby-9.0.5.0
data/CHANGELOG.md CHANGED
@@ -1,6 +1,16 @@
1
1
  Do this to generate your change history
2
2
 
3
- $ git log --pretty=format:' * %h - %s (%an, %ad)'
3
+ $ git log --pretty=format:' * %h - %s (%an, %ad)' vX.Y.Z..HEAD
4
+
5
+ #### 1.0.1 (2016-04-29)
6
+
7
+ * 72c099b - Add release instructions (Sergei Matheson, Fri Apr 29 11:54:01 2016 +1000)
8
+ * 12f0054 - :headers is duplicated and overwritten (Taiki Ono, Tue Mar 15 21:46:23 2016 +0900)
9
+ * e9251f7 - Commit pact files (Taiki Ono, Tue Mar 15 21:30:15 2016 +0900)
10
+ * 0278731 - Loosen content type header expectation (Taiki Ono, Tue Mar 15 21:26:03 2016 +0900)
11
+ * fff1838 - Remove `Gemfile.lock` and do not check-in (Taiki Ono, Sun Mar 13 21:49:36 2016 +0900)
12
+ * 48c1434 - Add Travis CI setting not to test with ruby1.9 (Taiki Ono, Sun Mar 13 21:17:11 2016 +0900)
13
+ * 0365b94 - Updated to RSpec 3 syntax (Beth, Mon Oct 19 08:54:48 2015 +1100)
4
14
 
5
15
  #### 1.0.0 (2014-10-09)
6
16
 
data/RELEASING.md ADDED
@@ -0,0 +1,14 @@
1
+ # Releasing
2
+
3
+ 1. Increment the version in `lib/pact/support/version.rb`
4
+ 2. Update the `CHANGELOG.md` using:
5
+
6
+ $ git log --pretty=format:' * %h - %s (%an, %ad)' vX.Y.Z..HEAD
7
+
8
+ 3. Add files to git
9
+
10
+ $ git add CHANGELOG.md lib/pact_broker/client/version.rb
11
+
12
+ 3. Release:
13
+
14
+ $ bundle exec rake release
@@ -1,5 +1,5 @@
1
1
  module PactBroker
2
2
  module Client
3
- VERSION = '1.0.0'
3
+ VERSION = '1.0.1'
4
4
  end
5
- end
5
+ end
@@ -9,8 +9,9 @@ module PactBroker
9
9
 
10
10
  before do
11
11
  FakeFS.activate!
12
- pacts_client.stub(:publish).and_return(latest_pact_url)
13
- PactBroker::Client::PactBrokerClient.stub(:new).with(base_url: pact_broker_base_url, client_options: pact_broker_client_options).and_return(pact_broker_client)
12
+ allow(pacts_client).to receive(:publish).and_return(latest_pact_url)
13
+ allow(PactBroker::Client::PactBrokerClient).to receive(:new).with(base_url: pact_broker_base_url, client_options: pact_broker_client_options).and_return(pact_broker_client)
14
+ allow($stdout).to receive(:puts)
14
15
  end
15
16
 
16
17
  after do
@@ -38,13 +39,13 @@ module PactBroker
38
39
  before do
39
40
  FileUtils.mkdir_p "spec/pacts"
40
41
  File.open("spec/pacts/consumer-provider.json", "w") { |file| file << pact_hash.to_json }
41
- pact_broker_client.stub_chain(:pacticipants, :versions, :pacts).and_return(pacts_client)
42
+ allow(pact_broker_client).to receive_message_chain(:pacticipants, :versions, :pacts).and_return(pacts_client)
42
43
  end
43
44
 
44
45
  describe "call" do
45
46
 
46
47
  it "uses the pact_broker client to publish the given pact" do
47
- pacts_client.should_receive(:publish).with(pact_json: pact_hash.to_json, consumer_version: consumer_version)
48
+ expect(pacts_client).to receive(:publish).with(pact_json: pact_hash.to_json, consumer_version: consumer_version)
48
49
  subject.call
49
50
  end
50
51
 
@@ -64,16 +65,16 @@ module PactBroker
64
65
  let(:pact_files) { ['spec/pacts/doesnotexist.json','spec/pacts/consumer-provider.json']}
65
66
 
66
67
  before do
67
- $stderr.stub(:puts)
68
+ allow($stderr).to receive(:puts)
68
69
  end
69
70
 
70
71
  it "logs an message to stderr" do
71
- $stderr.should_receive(:puts).with(/Failed to publish pact/)
72
+ expect($stderr).to receive(:puts).with(/Failed to publish pact/)
72
73
  subject.call
73
74
  end
74
75
 
75
76
  it "continues publishing the rest" do
76
- pacts_client.should_receive(:publish).with(pact_json: pact_hash.to_json, consumer_version: consumer_version)
77
+ expect(pacts_client).to receive(:publish).with(pact_json: pact_hash.to_json, consumer_version: consumer_version)
77
78
  subject.call
78
79
  end
79
80
 
@@ -145,10 +146,8 @@ module PactBroker
145
146
  it "returns true" do
146
147
  expect(subject.call).to eq true
147
148
  end
148
-
149
149
  end
150
-
151
150
  end
152
151
  end
153
152
  end
154
- end
153
+ end
@@ -18,7 +18,17 @@
18
18
  "response": {
19
19
  "status": 200,
20
20
  "headers": {
21
- "Content-Type": "application/hal+json"
21
+ "Content-Type": {
22
+ "json_class": "Pact::Term",
23
+ "data": {
24
+ "generate": "application/hal+json",
25
+ "matcher": {
26
+ "json_class": "Regexp",
27
+ "o": 0,
28
+ "s": "application/hal\\+json"
29
+ }
30
+ }
31
+ }
22
32
  },
23
33
  "body": {
24
34
  "_links": {
@@ -78,7 +88,17 @@
78
88
  "response": {
79
89
  "status": 200,
80
90
  "headers": {
81
- "Content-Type": "application/hal+json"
91
+ "Content-Type": {
92
+ "json_class": "Pact::Term",
93
+ "data": {
94
+ "generate": "application/hal+json",
95
+ "matcher": {
96
+ "json_class": "Regexp",
97
+ "o": 0,
98
+ "s": "application/hal\\+json"
99
+ }
100
+ }
101
+ }
82
102
  },
83
103
  "body": {
84
104
  "_links": {
@@ -127,7 +147,17 @@
127
147
  "response": {
128
148
  "status": 200,
129
149
  "headers": {
130
- "Content-Type": "application/hal+json"
150
+ "Content-Type": {
151
+ "json_class": "Pact::Term",
152
+ "data": {
153
+ "generate": "application/hal+json",
154
+ "matcher": {
155
+ "json_class": "Regexp",
156
+ "o": 0,
157
+ "s": "application/hal\\+json"
158
+ }
159
+ }
160
+ }
131
161
  },
132
162
  "body": {
133
163
  "_links": {
@@ -297,7 +327,17 @@
297
327
  "response": {
298
328
  "status": 500,
299
329
  "headers": {
300
- "Content-Type": "application/json"
330
+ "Content-Type": {
331
+ "json_class": "Pact::Term",
332
+ "data": {
333
+ "generate": "application/json",
334
+ "matcher": {
335
+ "json_class": "Regexp",
336
+ "o": 0,
337
+ "s": "application/json"
338
+ }
339
+ }
340
+ }
301
341
  },
302
342
  "body": {
303
343
  "message": {
@@ -390,7 +430,17 @@
390
430
  "response": {
391
431
  "status": 200,
392
432
  "headers": {
393
- "Content-Type": "application/json",
433
+ "Content-Type": {
434
+ "json_class": "Pact::Term",
435
+ "data": {
436
+ "generate": "application/json",
437
+ "matcher": {
438
+ "json_class": "Regexp",
439
+ "o": 0,
440
+ "s": "application/json"
441
+ }
442
+ }
443
+ },
394
444
  "X-Pact-Consumer-Version": "1.3.0"
395
445
  },
396
446
  "body": {
@@ -33,7 +33,7 @@ module PactBroker::Client
33
33
  method: :get,
34
34
  path: '/pacts/latest',
35
35
  headers: {} ).
36
- will_respond_with( headers: {'Content-Type' => 'application/hal+json'},
36
+ will_respond_with( headers: {'Content-Type' => Pact.term(generate: 'application/hal+json', matcher: %r{application/hal\+json})},
37
37
  status: 200,
38
38
  body: response_body
39
39
  )
@@ -55,7 +55,7 @@ module PactBroker::Client
55
55
  method: :get,
56
56
  path: '/pacticipants',
57
57
  headers: {} ).
58
- will_respond_with( headers: {'Content-Type' => 'application/hal+json'},
58
+ will_respond_with( headers: {'Content-Type' => Pact.term(generate: 'application/hal+json', matcher: %r{application/hal\+json})},
59
59
  status: 200,
60
60
  body: response_body
61
61
  )
@@ -78,7 +78,7 @@ module PactBroker::Client
78
78
  method: :get,
79
79
  path: '/pacticipants/Pricing%20Service',
80
80
  headers: {} ).
81
- will_respond_with( headers: {'Content-Type' => 'application/hal+json'},
81
+ will_respond_with( headers: {'Content-Type' => Pact.term(generate: 'application/hal+json', matcher: %r{application/hal\+json})},
82
82
  status: 200,
83
83
  body: response_body
84
84
  )
@@ -105,4 +105,4 @@ module PactBroker::Client
105
105
  end
106
106
  end
107
107
  end
108
- end
108
+ end
@@ -101,7 +101,7 @@ module PactBroker::Client
101
101
  body: pact_hash ).
102
102
  will_respond_with(
103
103
  status: 500,
104
- headers: {'Content-Type' => 'application/json'},
104
+ headers: {'Content-Type' => Pact.term(generate: 'application/json', matcher: %r{application/json})},
105
105
  body: {
106
106
  message: Pact::Term.new(matcher: /.*/, generate: 'An error occurred')
107
107
  }
@@ -114,4 +114,4 @@ module PactBroker::Client
114
114
 
115
115
  end
116
116
  end
117
- end
117
+ end
@@ -31,7 +31,12 @@ module PactBroker::Client
31
31
  describe "finding the latest version" do
32
32
  context "when a pact is found" do
33
33
 
34
- let(:response_headers) { pact_broker_response_headers.merge({'Content-Type' => 'application/json', 'X-Pact-Consumer-Version' => consumer_version}) }
34
+ let(:response_headers) do
35
+ pact_broker_response_headers.merge(
36
+ 'Content-Type' => Pact.term(generate: 'application/json', matcher: %r{application/json}),
37
+ 'X-Pact-Consumer-Version' => consumer_version
38
+ )
39
+ end
35
40
  before do
36
41
  pact_broker.
37
42
  given("a pact between Condor and the Pricing Service exists").
@@ -88,7 +93,6 @@ module PactBroker::Client
88
93
  ).
89
94
  will_respond_with(
90
95
  status: 200,
91
- headers: {'Content-Type' => 'application/json', 'X-Pact-Consumer-Version' => consumer_version},
92
96
  body: pact_hash,
93
97
  headers: pact_broker_response_headers
94
98
  )
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pact_broker-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bethany Skurrie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-18 00:00:00.000000000 Z
11
+ date: 2016-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pact
@@ -117,10 +117,11 @@ extra_rdoc_files: []
117
117
  files:
118
118
  - ".gitignore"
119
119
  - ".rspec"
120
+ - ".travis.yml"
120
121
  - CHANGELOG.md
121
122
  - Gemfile
122
- - Gemfile.lock
123
123
  - README.md
124
+ - RELEASING.md
124
125
  - Rakefile
125
126
  - ci.sh
126
127
  - doc/markdown/Pact Broker Client - Pact Broker.md
data/Gemfile.lock DELETED
@@ -1,95 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- pact_broker-client (1.0.0)
5
- httparty
6
- json
7
- pact
8
-
9
- GEM
10
- remote: https://rubygems.org/
11
- specs:
12
- awesome_print (1.6.1)
13
- coderay (1.1.0)
14
- diff-lcs (1.2.5)
15
- fakefs (0.6.0)
16
- find_a_port (1.0.1)
17
- httparty (0.13.7)
18
- json (~> 1.8)
19
- multi_xml (>= 0.5.2)
20
- json (1.8.3)
21
- method_source (0.8.2)
22
- multi_xml (0.5.5)
23
- pact (1.9.0)
24
- awesome_print (~> 1.1)
25
- find_a_port (~> 1.0.1)
26
- json
27
- pact-mock_service (~> 0.7)
28
- pact-support (~> 0.5)
29
- rack-test (~> 0.6.2)
30
- randexp (~> 0.1.7)
31
- rspec (>= 2.14)
32
- term-ansicolor (~> 1.0)
33
- thor
34
- webrick
35
- pact-mock_service (0.7.2)
36
- find_a_port (~> 1.0.1)
37
- json
38
- pact-support (~> 0.5.3)
39
- rack
40
- rack-test (~> 0.6.2)
41
- rspec (>= 2.14)
42
- term-ansicolor (~> 1.0)
43
- thor
44
- webrick
45
- pact-support (0.5.3)
46
- awesome_print (~> 1.1)
47
- find_a_port (~> 1.0.1)
48
- json
49
- rack-test (~> 0.6.2)
50
- randexp (~> 0.1.7)
51
- rspec (>= 2.14)
52
- term-ansicolor (~> 1.0)
53
- thor
54
- pry (0.10.1)
55
- coderay (~> 1.1.0)
56
- method_source (~> 0.8.1)
57
- slop (~> 3.4)
58
- rack (1.6.4)
59
- rack-test (0.6.3)
60
- rack (>= 1.0)
61
- rake (10.0.4)
62
- randexp (0.1.7)
63
- rspec (3.1.0)
64
- rspec-core (~> 3.1.0)
65
- rspec-expectations (~> 3.1.0)
66
- rspec-mocks (~> 3.1.0)
67
- rspec-core (3.1.7)
68
- rspec-support (~> 3.1.0)
69
- rspec-expectations (3.1.2)
70
- diff-lcs (>= 1.2.0, < 2.0)
71
- rspec-support (~> 3.1.0)
72
- rspec-fire (1.3.0)
73
- rspec (>= 2.11, < 4)
74
- rspec-mocks (3.1.3)
75
- rspec-support (~> 3.1.0)
76
- rspec-support (3.1.2)
77
- slop (3.6.0)
78
- term-ansicolor (1.3.2)
79
- tins (~> 1.0)
80
- thor (0.19.1)
81
- tins (1.6.0)
82
- webrick (1.3.1)
83
-
84
- PLATFORMS
85
- ruby
86
-
87
- DEPENDENCIES
88
- fakefs (~> 0.4)
89
- pact_broker-client!
90
- pry
91
- rake (~> 10.0.3)
92
- rspec-fire
93
-
94
- BUNDLED WITH
95
- 1.10.6