pact-support 0.5.3 → 0.5.4

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: 2282f09de813944168d8ff5f28aa154553519c88
4
- data.tar.gz: f0e9d05cb208511af75e64af45dedd3e69a945ae
3
+ metadata.gz: 65b471492f7129b35b4d6c22ea34734b4236a064
4
+ data.tar.gz: 731b9b98c849c17d19fae3efd98eec69bc953a0d
5
5
  SHA512:
6
- metadata.gz: b1832013c2276159f94c7a0f57b5a8f5ed6f9562a7c0d54bd054517301f5672cc299adb129092970529ae50958984f9867bda6e8ef019a64be7fca10b8783fc6
7
- data.tar.gz: 750cecfbee168962f8b2099a484ec947c485560f735ccb81ea8bc70a35a906d1d18d00bd7807d46e77ba11ac19c68a9b514326bec8828f88a80e71b608768884
6
+ metadata.gz: 1a12e8a8345b77b732d66b356ff84d3ccb459011d40dbea405783b0c8aded30757615db3259fa97c226e44e58ce4a5402df8529d02abbbf92cae647b575bbd58
7
+ data.tar.gz: a92b1568e2e590d163967b103617483d7510ec4cab06c033aa79ec5694bb906cca02441ed71d68b877bf28aea76a7d9e0a9a627f7916f630dd249d1eb704b0af
@@ -2,6 +2,10 @@ Do this to generate your change history
2
2
 
3
3
  git log --pretty=format:' * %h - %s (%an, %ad)'
4
4
 
5
+ ### 0.5.4 (4 November 2015)
6
+
7
+ * 2791b72 - [+AM] Add like_datetime_with_milisecods helper method (David Sevcik, Wed Nov 4 17:40:53 2015 +0100)
8
+
5
9
  ### 0.5.3 (8 September 2015)
6
10
 
7
11
  * c7b1454 - Apply reification to ArrayLike flexible matcher. (Matt Fellows, Tue Sep 8 11:35:32 2015 +1000)
@@ -37,6 +37,10 @@ module Pact
37
37
  Pact::Term.new(generate: datetime, matcher: /^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)$/)
38
38
  end
39
39
 
40
+ def like_datetime_with_miliseconds datetime
41
+ Pact::Term.new(generate: datetime, matcher: /^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d{3}([+-][0-2]\d:[0-5]\d|Z)$/)
42
+ end
43
+
40
44
  def like_date date
41
45
  Pact::Term.new(generate: date, matcher: /^\d{4}-[01]\d-[0-3]\d$/)
42
46
  end
@@ -8,7 +8,7 @@ module Pact
8
8
  def self.from_term(term)
9
9
  case term
10
10
  when Pact::Term, Regexp, Pact::SomethingLike, Pact::ArrayLike
11
- term.generate
11
+ term.generate
12
12
  when Hash
13
13
  term.inject({}) do |mem, (key,term)|
14
14
  mem[key] = from_term(term)
@@ -1,5 +1,5 @@
1
1
  module Pact
2
2
  module Support
3
- VERSION = "0.5.3"
3
+ VERSION = "0.5.4"
4
4
  end
5
5
  end
@@ -67,6 +67,17 @@ module Pact
67
67
  end
68
68
  end
69
69
 
70
+ describe "#like_datetime_with_miliseconds" do
71
+ let(:datetime) { '2015-08-06T16:53:10.123+01:00' }
72
+
73
+ it "creates a Pact::Term with UUID matcher" do
74
+ expect(like_datetime_with_miliseconds(datetime)).to eq Pact::Term.new(
75
+ generate: datetime,
76
+ matcher: /^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d{3}([+-][0-2]\d:[0-5]\d|Z)$/
77
+ )
78
+ end
79
+ end
80
+
70
81
  describe "#like_date" do
71
82
  let(:date) { '2015-08-06' }
72
83
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pact-support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
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: 2015-09-08 00:00:00.000000000 Z
15
+ date: 2015-11-09 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: randexp