pact-mock_service 0.8.2 → 0.9.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: b2fe31dd5077800edd5307e100979a92d3056eb9
4
- data.tar.gz: cae8ad2a915922e11bab37deb7e38dbc6a467314
3
+ metadata.gz: f7b163125f31e90906834f1862b956cfb7da2304
4
+ data.tar.gz: e9161370ca1e3f29af3310ce4d30edd8e36482a4
5
5
  SHA512:
6
- metadata.gz: 8156beaceb8f03bc993d9510455fc194fe7dc60705521621cf016b660f73ef1a58cde961f322fcde32f76c02745800523a824b345a2e4ccda3f1dc90c564c7c6
7
- data.tar.gz: 50b3011a79bd77eb5f905433ec9e78b31450925acbb79da724e6630ae65da005920be792b90c4c243da26c07354f2055920bb2102d3c9542dadbf25772cf1d9f
6
+ metadata.gz: 7a2406a9a3ede444da95b63ed485b99cd372a41877996744f982bbee859f0621eb2d0e643b324aba9270a2e1d142d5a3ed4d852ac8330631d2d8db15ca68d67e
7
+ data.tar.gz: 944fb460336e8cccd99d979faac38dac84c4b65d70331a9aafafec2e244821b39439a4808ffe0579f1031eee43e2b2b87739b7941d70b6d91ca144620693cb04
data/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@ Do this to generate your change history
2
2
 
3
3
  git log --pretty=format:' * %h - %s (%an, %ad)' vX.Y.Z..HEAD
4
4
 
5
+ ### 0.9.0 (26 May 2016)
6
+ * 28ab905 - Merge pull request #46 from reevoo/order_interactions_by_provider_state (Sergei Matheson, Thu May 26 14:52:08 2016 +1000)
7
+ * d58507c - Add ability to record interactions in alphabetical order. Order key: description + response.status + provider_state Default order: chronological (as it was before) (Alex Malkov, Mon May 23 11:52:39 2016 +0100)
8
+ * 739d111 - Merge pull request #48 from mefellows/readline-fix (Sergei Matheson, Mon May 16 10:53:01 2016 +1000)
9
+ * fe5ea69 - Added -rreadline flag to ruby CLI execution wrapper (Matt Fellows, Sun May 15 13:31:45 2016 +1000)
10
+ * 0dfb431 - Sort by description, status and provider state (Alex Malkov, Wed May 4 00:00:21 2016 +0100)
11
+ * 9ff8337 - Order interactions within the contract by provider state. (Alex Malkov, Tue May 3 22:13:53 2016 +0100)
12
+ * 2f22f7e - Update to ruby 2.3.1 in travis (Sergei Matheson, Tue May 3 10:46:46 2016 +1000)
13
+
5
14
  ### 0.8.2 (19 April 2016)
6
15
  * e392333 - Merge pull request #45 from aaronrenner/ar-fix-almost-duplicate-error-web-response (Beth Skurrie, Tue Apr 19 09:53:01 2016 +1000)
7
16
  * 6fbcce2 - Fixed invalid Rack response on AlmostDuplicateInteractionError (Aaron Renner, Mon Apr 18 14:08:19 2016 -0600)
@@ -15,7 +15,7 @@ module Pact
15
15
  fix_all_the_things(
16
16
  consumer: consumer_contract.consumer.as_json,
17
17
  provider: consumer_contract.provider.as_json,
18
- interactions: consumer_contract.interactions.collect{ |i| InteractionDecorator.new(i, @decorator_options).as_json},
18
+ interactions: sorted_interactions.collect{ |i| InteractionDecorator.new(i, @decorator_options).as_json},
19
19
  metadata: {
20
20
  pactSpecificationVersion: pact_specification_version
21
21
  }
@@ -28,6 +28,19 @@ module Pact
28
28
 
29
29
  private
30
30
 
31
+ def sorted_interactions
32
+ # Default order: chronological
33
+ return consumer_contract.interactions if Pact.configuration.pactfile_write_order == :chronological
34
+ # We are supporting only chronological or alphabetical order
35
+ raise NotImplementedError if Pact.configuration.pactfile_write_order != :alphabetical
36
+
37
+ consumer_contract.interactions.sort{|a, b| sortable_id(a) <=> sortable_id(b)}
38
+ end
39
+
40
+ def sortable_id interaction
41
+ "#{interaction.description.downcase} #{interaction.response.status} #{(interaction.provider_state || '').downcase}"
42
+ end
43
+
31
44
  attr_reader :consumer_contract
32
45
 
33
46
  def pact_specification_version
@@ -1,5 +1,5 @@
1
1
  module Pact
2
2
  module MockService
3
- VERSION = "0.8.2"
3
+ VERSION = "0.9.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: 0.8.2
4
+ version: 0.9.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: 2016-04-19 00:00:00.000000000 Z
15
+ date: 2016-05-26 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rack
@@ -132,14 +132,14 @@ dependencies:
132
132
  requirements:
133
133
  - - "~>"
134
134
  - !ruby/object:Gem::Version
135
- version: 0.5.3
135
+ version: 0.5.8
136
136
  type: :runtime
137
137
  prerelease: false
138
138
  version_requirements: !ruby/object:Gem::Requirement
139
139
  requirements:
140
140
  - - "~>"
141
141
  - !ruby/object:Gem::Version
142
- version: 0.5.3
142
+ version: 0.5.8
143
143
  - !ruby/object:Gem::Dependency
144
144
  name: rake
145
145
  requirement: !ruby/object:Gem::Requirement
@@ -331,7 +331,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
331
331
  version: '0'
332
332
  requirements: []
333
333
  rubyforge_project:
334
- rubygems_version: 2.4.5
334
+ rubygems_version: 2.5.1
335
335
  signing_key:
336
336
  specification_version: 4
337
337
  summary: Provides a mock service for use with Pact