forked from cloudfoundry-attic/cf-release
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manifest_generation_spec.rb
38 lines (31 loc) · 1.12 KB
/
manifest_generation_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
require 'support/yaml_eq'
require 'support/lamb-properties'
require 'yaml'
require 'tempfile'
require 'erb'
describe "Manifest Generation" do
shared_examples "generating manifests" do |infrastructure|
it "builds the correct manifest for #{infrastructure}" do
example_manifest = Tempfile.new("example-manifest.yml")
`./generate_deployment_manifest #{infrastructure} spec/fixtures/#{infrastructure}/cf-stub.yml > #{example_manifest.path}`
expect($?.exitstatus).to eq(0)
expected = File.read("spec/fixtures/#{infrastructure}/cf-manifest.yml.erb")
lamb_properties = LambProperties.new(infrastructure)
expected = ERB.new(expected).result(lamb_properties.get_binding)
actual = File.read(example_manifest.path)
expect(actual).to yaml_eq(expected)
end
end
context "aws" do
it_behaves_like "generating manifests", "aws"
end
context "warden" do
it_behaves_like "generating manifests", "warden"
end
context "openstack" do
it_behaves_like "generating manifests", "openstack"
end
context "vsphere" do
it_behaves_like "generating manifests", "vsphere"
end
end