fake_consul 0.0.6 → 0.0.7

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: 0f72ce9168131992209858aa64f9873753595c91
4
- data.tar.gz: 39d8ca4255dfb87a53d773b1785bd7540e3692ff
3
+ metadata.gz: 3dcc475538dbcc6244fd02c612b765ac0605fd6a
4
+ data.tar.gz: c33919db807d94272c6e2be527a862f6c3a98f0e
5
5
  SHA512:
6
- metadata.gz: a6ef6bf4018bde781c2a12d2a8b8d7bc1aca00031c1667ef7f1dc72c6762e209d52c240659bb613de64eeb8d791b39b1172aef35aa443f25f45a9b825d1cd4ef
7
- data.tar.gz: d52766d50bd428cd9dda12ec0522b4b7458209349a572a980ed285be78c41d68313f69352dd2a947859942eb3fad0f4378a9a05426e157ce41a4736b0b74ac42
6
+ metadata.gz: ce8158985026c4bc964a03537c114a5004bcc1cdbf29be0a913c368a574b327d3f69fd797deae7e22b96339b9cb755b4ae6bfd519bc3cd524150fa5fe7b9c425
7
+ data.tar.gz: 4b14bba4d679a215cb557d592ecdc28c6bacdcfd14f043030a9f13606857d33f4097034b480cd3801022972cfb96dc7a9a5b0b0ad8124af6fdd470ae6cef5db3
@@ -2,6 +2,9 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
+ ## [v0.0.7] - 2015-12-07
6
+ - Adds `delete` command
7
+
5
8
  ## [v0.0.6] - 2015-11-27
6
9
  - Add persistance to disk
7
10
 
@@ -22,7 +25,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
22
25
  - Adds simple consul client that fakes the consul server and provides state in an in-memory Hash.
23
26
  - Client API conforms to that of [Diplomat::Kv](http://www.rubydoc.info/github/WeAreFarmGeek/diplomat/Diplomat/Kv) (See source here: [Diplomat](https://github.com/WeAreFarmGeek/diplomat) )
24
27
 
25
- [unreleased]: https://github.com/redbooth/fake_consul/compare/v0.0.6...HEAD
28
+ [unreleased]: https://github.com/redbooth/fake_consul/compare/v0.0.7...HEAD
29
+ [v0.0.7]: https://github.com/redbooth/fake_consul/tree/v0.0.7
26
30
  [v0.0.6]: https://github.com/redbooth/fake_consul/tree/v0.0.6
27
31
  [v0.0.5]: https://github.com/redbooth/fake_consul/tree/v0.0.5
28
32
  [v0.0.4]: https://github.com/redbooth/fake_consul/tree/v0.0.4
@@ -42,6 +42,20 @@ module FakeConsul
42
42
  true
43
43
  end
44
44
 
45
+ # Fake delete
46
+ #
47
+ # Performs no http requests but deletes data from local hash
48
+ #
49
+ # @param key [String]
50
+ # @param options [Hash] unused/unimplemented
51
+ # @return [Boolean] true :trollface:
52
+ def delete(key, options = nil)
53
+ super(key)
54
+ compact
55
+ persist!
56
+ true
57
+ end
58
+
45
59
  # Clear current data
46
60
  # and delete backing marshalling file
47
61
  def clear
@@ -1,3 +1,3 @@
1
1
  module FakeConsul
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -21,6 +21,24 @@ describe FakeConsul::Server do
21
21
  end
22
22
  end
23
23
 
24
+ describe '#delete' do
25
+ before { subject.put('foo', 'bar') }
26
+
27
+ it 'delete key from Hash' do
28
+ subject.delete('foo')
29
+ subject.key?('foo').must_equal false
30
+ end
31
+
32
+ it 'returns true' do
33
+ subject.put('foo', 'bar').must_equal true
34
+ end
35
+
36
+ it 'compacts the hash to remove keys with nil values' do
37
+ subject.put('foo', nil)
38
+ subject.key?('foo').must_equal(false)
39
+ end
40
+ end
41
+
24
42
  describe '#get' do
25
43
  describe 'simple (no recursing)' do
26
44
  before { subject.put('foo', 'bar') }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fake_consul
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saimon Moore
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-27 00:00:00.000000000 Z
11
+ date: 2015-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport