cfn-bridge 0.0.10 → 0.0.11

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: 937f3058f2f853584b9d5340292cc7a9d188dea8
4
- data.tar.gz: d5f84fe245dce34c6f46e095cb03a338c1d4c97c
3
+ metadata.gz: e4c7c626865fd91e5477155d3614ee18cef4c311
4
+ data.tar.gz: a806497942640ee7f42f322502d5776b69b5840d
5
5
  SHA512:
6
- metadata.gz: 4177d8b32ce517c52807ec0cff6d762a9ed4eb63ad327bd65779ece2d99af33d3fa04ac1741228b8fd8322bf371c915182c6359553cd0a9dae3313ad899adcd2
7
- data.tar.gz: 5d0caaf158b0175de5159055a25b8bde177eec8605d82da9dbd0d90077e2d60800b3dfcbe83f776efb76a1c132e821e684700713e321aac82932bf0116f6b6dc
6
+ metadata.gz: 805d85b4e1454a6bc94e1479e6263e47941407f80ca6f1f4b38604c8fad95f6554d39999d7cd55149ff5627a04048c8e3ded179f42ed95e5c1b488ded48e0a66
7
+ data.tar.gz: 866663db3614bb6d1a3512b519cc1977cd5bcf923542e2c169b7b9fe87792f0174d063c7cdb6a5f1fb601dc2281f2d51c1fc8f8945e28704c529571af0f68b33
@@ -44,6 +44,8 @@ module CloudFormation
44
44
  end
45
45
 
46
46
  request.succeed!(response)
47
+ elsif request.delete?
48
+ request.succeed!
47
49
  else
48
50
  request.fail!("Don't know what to do with resource #{request.resource_type}")
49
51
  end
@@ -73,7 +73,7 @@ module CloudFormation
73
73
  HttpBridge.put(request_url, response)
74
74
  end
75
75
 
76
- def succeed!(response)
76
+ def succeed!(response = {})
77
77
  actual_response = case response
78
78
  when Hash
79
79
  build_response(response)
@@ -1,5 +1,5 @@
1
1
  module CloudFormation
2
2
  module Bridge
3
- VERSION = "0.0.10"
3
+ VERSION = "0.0.11"
4
4
  end
5
5
  end
@@ -11,6 +11,7 @@ describe CloudFormation::Bridge::Executor do
11
11
  let(:url) { "http://example.com/request-id" }
12
12
  let(:custom_resource_name) { "sample-custom-resource" }
13
13
  let(:registry) { { custom_resource_name => custom_resource } }
14
+ let(:unknown_resource) { "unknown-resource" }
14
15
  let(:response) { { FIELDS::LOGICAL_RESOURCE_ID => "sample-resource" } }
15
16
 
16
17
  context 'when processing resources that are available' do
@@ -60,6 +61,22 @@ describe CloudFormation::Bridge::Executor do
60
61
  executor.execute(request)
61
62
  end
62
63
 
64
+
65
+ it 'deletes the resource even if there is no resource there' do
66
+ request = CloudFormation::Bridge::Request.new(
67
+ FIELDS::REQUEST_TYPE => TYPES::DELETE,
68
+ FIELDS::RESOURCE_TYPE => unknown_resource,
69
+ FIELDS::RESPONSE_URL => "http://localhost:3000/example",
70
+ )
71
+
72
+ expect(CloudFormation::Bridge::HttpBridge).to receive(:put) do |url,response|
73
+ expect(url).to eq("http://localhost:3000/example")
74
+ end
75
+
76
+ executor = CloudFormation::Bridge::Executor.new(registry)
77
+ executor.execute(request)
78
+ end
79
+
63
80
  end
64
81
 
65
82
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfn-bridge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maurício Linhares
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-16 00:00:00.000000000 Z
11
+ date: 2014-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler