vcloud-launcher 0.0.1 → 0.0.2

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.
data/bin/vcloud-launch CHANGED
@@ -5,15 +5,14 @@ require 'bundler/setup'
5
5
  require 'optparse'
6
6
  require 'methadone'
7
7
 
8
- require 'vcloud/launcher/launch'
8
+ require 'vcloud/launcher'
9
9
 
10
10
  class App
11
11
  include Methadone::Main
12
12
  include Methadone::CLILogging
13
- include Vcloud
14
13
 
15
14
  main do |org_config_file|
16
- Launch.new.run(org_config_file, options)
15
+ Vcloud::Launcher::Launch.new.run(org_config_file, options)
17
16
  end
18
17
 
19
18
  on("-x", "--dont-power-on", "Do not power on vApps (default is to power on)")
@@ -1,5 +1,5 @@
1
1
  module Vcloud
2
2
  module Launcher
3
- VERSION = '0.0.1'
3
+ VERSION = '0.0.2'
4
4
  end
5
5
  end
@@ -1,48 +1,48 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  module Vcloud
4
- # describe Launch do
5
- # before(:each) do
6
- # config_loader = double(:config_loader)
7
- # expect(Vcloud::Core::ConfigLoader).to receive(:new).and_return(config_loader)
8
- # @successful_app_1 = {
9
- # :name => "successful app 1",
10
- # :vdc_name => "Test Vdc",
11
- # :catalog => "default",
12
- # :catalog_item => "ubuntu-precise"
13
- # }
14
- # @fake_failing_app = {
15
- # :name => "fake failing app",
16
- # :vdc_name => "wrong vdc",
17
- # :catalog => "default",
18
- # :catalog_item => "ubuntu-precise"
19
- # }
20
- # @successful_app_2 = {
21
- # :name => "successful app 2",
22
- # :vdc_name => "Test Vdc",
23
- # :catalog => "default",
24
- # :catalog_item => "ubuntu-precise"
25
- # }
26
- # expect(config_loader).to receive(:load_config).
27
- # and_return({:vapps => [@successful_app_1, @fake_failing_app, @successful_app_2]})
28
- # end
29
- #
30
- # it "should stop on failure by default" do
31
- # expect(VappOrchestrator).to receive(:provision).with(@successful_app_1).and_return(double(:vapp, :power_on => true))
32
- # expect(VappOrchestrator).to receive(:provision).with(@fake_failing_app).and_raise(RuntimeError.new('failed to find vdc'))
33
- # expect(VappOrchestrator).not_to receive(:provision).with(@successful_app_2)
34
- #
35
- # cli_options = {}
36
- # Launch.new.run('input_config_yaml', cli_options)
37
- # end
38
- #
39
- # it "should continue on error if cli option continue-on-error is set" do
40
- # expect(VappOrchestrator).to receive(:provision).with(@successful_app_1).and_return(double(:vapp, :power_on => true))
41
- # expect(VappOrchestrator).to receive(:provision).with(@fake_failing_app).and_raise(RuntimeError.new('failed to find vdc'))
42
- # expect(VappOrchestrator).to receive(:provision).with(@successful_app_2).and_return(double(:vapp, :power_on => true))
43
- #
44
- # cli_options = {"continue-on-error" => true}
45
- # Launch.new.run('input_config_yaml', cli_options)
46
- # end
47
- # end
4
+ describe Launcher::Launch do
5
+ before(:each) do
6
+ config_loader = double(:config_loader)
7
+ expect(Vcloud::Core::ConfigLoader).to receive(:new).and_return(config_loader)
8
+ @successful_app_1 = {
9
+ :name => "successful app 1",
10
+ :vdc_name => "Test Vdc",
11
+ :catalog => "default",
12
+ :catalog_item => "ubuntu-precise"
13
+ }
14
+ @fake_failing_app = {
15
+ :name => "fake failing app",
16
+ :vdc_name => "wrong vdc",
17
+ :catalog => "default",
18
+ :catalog_item => "ubuntu-precise"
19
+ }
20
+ @successful_app_2 = {
21
+ :name => "successful app 2",
22
+ :vdc_name => "Test Vdc",
23
+ :catalog => "default",
24
+ :catalog_item => "ubuntu-precise"
25
+ }
26
+ expect(config_loader).to receive(:load_config).
27
+ and_return({:vapps => [@successful_app_1, @fake_failing_app, @successful_app_2]})
28
+ end
29
+
30
+ it "should stop on failure by default" do
31
+ expect(Vcloud::Launcher::VappOrchestrator).to receive(:provision).with(@successful_app_1).and_return(double(:vapp, :power_on => true))
32
+ expect(Vcloud::Launcher::VappOrchestrator).to receive(:provision).with(@fake_failing_app).and_raise(RuntimeError.new('failed to find vdc'))
33
+ expect(Vcloud::Launcher::VappOrchestrator).not_to receive(:provision).with(@successful_app_2)
34
+
35
+ cli_options = {}
36
+ Vcloud::Launcher::Launch.new.run('input_config_yaml', cli_options)
37
+ end
38
+
39
+ it "should continue on error if cli option continue-on-error is set" do
40
+ expect(Vcloud::Launcher::VappOrchestrator).to receive(:provision).with(@successful_app_1).and_return(double(:vapp, :power_on => true))
41
+ expect(Vcloud::Launcher::VappOrchestrator).to receive(:provision).with(@fake_failing_app).and_raise(RuntimeError.new('failed to find vdc'))
42
+ expect(Vcloud::Launcher::VappOrchestrator).to receive(:provision).with(@successful_app_2).and_return(double(:vapp, :power_on => true))
43
+
44
+ cli_options = {"continue-on-error" => true}
45
+ Vcloud::Launcher::Launch.new.run('input_config_yaml', cli_options)
46
+ end
47
+ end
48
48
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vcloud-launcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-04-02 00:00:00.000000000 Z
12
+ date: 2014-04-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: methadone
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
189
  version: '0'
190
190
  segments:
191
191
  - 0
192
- hash: -3942344739831315401
192
+ hash: -109681801331986801
193
193
  requirements: []
194
194
  rubyforge_project:
195
195
  rubygems_version: 1.8.23