vmc 0.5.1.rc5 → 0.5.1.rc6

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.
@@ -29,6 +29,9 @@ module VMC
29
29
  option :proxy, :desc => "Run this command as another user (admin)", :alias => "-u",
30
30
  :value => :email
31
31
 
32
+ option :http_proxy, :desc => "Connect though an http proxy server", :alias => "--http-proxy",
33
+ :value => :http_proxy
34
+
32
35
  option :version, :desc => "Print version number", :alias => "-v",
33
36
  :default => false
34
37
 
@@ -409,6 +412,7 @@ module VMC
409
412
  end
410
413
 
411
414
  @@client.proxy = input[:proxy]
415
+ @@client.http_proxy = input[:http_proxy] || ENV['HTTP_PROXY'] || ENV['http_proxy'] || nil
412
416
  @@client.trace = input[:trace]
413
417
 
414
418
  uri = URI.parse(target)
@@ -1,3 +1,3 @@
1
1
  module VMC
2
- VERSION = "0.5.1.rc5".freeze
2
+ VERSION = "0.5.1.rc6".freeze
3
3
  end
@@ -1,14 +1,14 @@
1
1
  require "spec_helper"
2
2
  require "webmock/rspec"
3
3
 
4
- if ENV['VMC_V2_TEST_USER'] && ENV['VMC_V2_TEST_PASSWORD'] && ENV['VMC_V2_TEST_TARGET']
5
- describe 'A new user tries to use VMC against v2', :ruby19 => true do
4
+ if ENV['VMC_TEST_USER'] && ENV['VMC_TEST_PASSWORD'] && ENV['VMC_TEST_TARGET']
5
+ describe 'A new user tries to use VMC against v1', :ruby19 => true do
6
6
  include ConsoleAppSpeckerMatchers
7
7
  include VMC::Interactive
8
8
 
9
- let(:target) { ENV['VMC_V2_TEST_TARGET'] }
10
- let(:username) { ENV['VMC_V2_TEST_USER'] }
11
- let(:password) { ENV['VMC_V2_TEST_PASSWORD'] }
9
+ let(:target) { ENV['VMC_TEST_TARGET'] }
10
+ let(:username) { ENV['VMC_TEST_USER'] }
11
+ let(:password) { ENV['VMC_TEST_PASSWORD'] }
12
12
 
13
13
  let(:app) do
14
14
  fuzz = TRAVIS_BUILD_ID.to_s + Time.new.to_f.to_s.gsub(".", "_")
@@ -22,7 +22,7 @@ if ENV['VMC_V2_TEST_USER'] && ENV['VMC_V2_TEST_PASSWORD'] && ENV['VMC_V2_TEST_TA
22
22
  end
23
23
 
24
24
  after do
25
- vmc %W(delete #{app} -f --no-script)
25
+ `#{vmc_bin} delete #{app} -f --no-script`
26
26
  Interact::Progress::Dots.stop!
27
27
  end
28
28
 
@@ -41,22 +41,6 @@ if ENV['VMC_V2_TEST_USER'] && ENV['VMC_V2_TEST_PASSWORD'] && ENV['VMC_V2_TEST_TA
41
41
  runner.send_keys password
42
42
 
43
43
  expect(runner).to say "Authenticating... OK"
44
-
45
- expect(runner).to say(
46
- "Organization>" => proc {
47
- runner.send_keys "1"
48
- expect(runner).to say /Switching to organization .*\.\.\. OK/
49
- },
50
- "Switching to organization" => proc {}
51
- )
52
-
53
- expect(runner).to say(
54
- "Space>" => proc {
55
- runner.send_keys "1"
56
- expect(runner).to say /Switching to space .*\.\.\. OK/
57
- },
58
- "Switching to space" => proc {}
59
- )
60
44
  end
61
45
 
62
46
  run("#{vmc_bin} app #{app}") do |runner|
@@ -71,42 +55,31 @@ if ENV['VMC_V2_TEST_USER'] && ENV['VMC_V2_TEST_PASSWORD'] && ENV['VMC_V2_TEST_TA
71
55
  expect(runner).to say "Instances> 1"
72
56
  runner.send_keys ""
73
57
 
74
- expect(runner).to say "Custom startup command> "
75
- runner.send_keys "bundle exec ruby main.rb -p $PORT"
58
+ expect(runner).to say "Framework> sinatra"
59
+ runner.send_keys ""
60
+
61
+ expect(runner).to say "Runtime>"
62
+ runner.send_keys "1"
76
63
 
77
64
  expect(runner).to say "Memory Limit>"
78
65
  runner.send_keys "64M"
79
66
 
80
67
  expect(runner).to say "Creating #{app}... OK"
81
68
 
82
- expect(runner).to say "Subdomain> #{app}"
83
- runner.send_keys ""
84
-
85
- expect(runner).to say "1:"
86
- expect(runner).to say "Domain>"
69
+ expect(runner).to say "Domain> #{app}"
87
70
  runner.send_keys "1"
88
71
 
89
- expect(runner).to say(/Creating route #{app}\..*\.\.\. OK/)
90
- expect(runner).to say(/Binding #{app}\..* to #{app}\.\.\. OK/)
72
+ expect(runner).to say "Updating #{app}... OK"
91
73
 
92
74
  expect(runner).to say "Create services for application?> n"
93
75
  runner.send_keys ""
94
76
 
95
- # skip this
96
- if runner.expect "Bind other services to application?> n", 1
97
- runner.send_keys ""
98
- end
99
-
100
77
  expect(runner).to say "Save configuration?> n"
101
78
  runner.send_keys ""
102
79
 
103
80
  expect(runner).to say "Uploading #{app}... OK"
104
81
  expect(runner).to say "Starting #{app}... OK"
105
-
106
- expect(runner).to say /(Using|Installing) Ruby/i, 10
107
- expect(runner).to say "Your bundle is complete!", 30
108
-
109
- expect(runner).to say "Checking #{app}..."
82
+ expect(runner).to say "Checking #{app}...", 180
110
83
  expect(runner).to say "1/1 instances"
111
84
  expect(runner).to say "OK", 30
112
85
  end
@@ -121,5 +94,5 @@ if ENV['VMC_V2_TEST_USER'] && ENV['VMC_V2_TEST_PASSWORD'] && ENV['VMC_V2_TEST_TA
121
94
  end
122
95
  end
123
96
  else
124
- $stderr.puts 'Skipping v2 integration specs; please provide $VMC_V2_TEST_TARGET, $VMC_V2_TEST_USER, and $VMC_V2_TEST_PASSWORD'
97
+ $stderr.puts 'Skipping v1 integration specs; please provide $VMC_TEST_TARGET, $VMC_TEST_USER, and $VMC_TEST_PASSWORD'
125
98
  end
@@ -431,6 +431,37 @@ describe VMC::CLI do
431
431
  expect(context.client.proxy).to eq('foo@example.com')
432
432
  end
433
433
  end
434
+
435
+ context "when ENV['http_proxy'] is set" do
436
+ before { ENV['http_proxy'] = "http://lower.example.com:80" }
437
+ after { ENV.delete('http_proxy') }
438
+
439
+ it "uses the http proxy URI on the enviroenment" do
440
+ expect(context.client.http_proxy).to eq('http://lower.example.com:80')
441
+ end
442
+ end
443
+
444
+ context "when ENV['HTTP_PROXY'] is set" do
445
+ before { ENV['HTTP_PROXY'] = "http://upper.example.com:80" }
446
+ after { ENV.delete('HTTP_PROXY') }
447
+
448
+ it "uses the http proxy URI on the environement" do
449
+ expect(context.client.http_proxy).to eq('http://upper.example.com:80')
450
+ end
451
+ end
452
+
453
+ context "with a http proxy URI" do
454
+ before do
455
+ ENV['HTTP_PROXY'] = "http://should.be.overwritten.example.com:80"
456
+ stub(context).input { {:http_proxy => 'http://arg.example.com:80'} }
457
+ end
458
+ after { ENV.delete('HTTP_PROXY') }
459
+
460
+ it "uses the provided http proxy URI" do
461
+ expect(context.client.http_proxy).to eq('http://arg.example.com:80')
462
+ end
463
+ end
464
+
434
465
  end
435
466
 
436
467
  context "with a v2 cloud controller" do
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vmc
3
3
  version: !ruby/object:Gem::Version
4
- hash: -1558593090
4
+ hash: 2937694537
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
9
  - 1
10
10
  - rc
11
- - 5
12
- version: 0.5.1.rc5
11
+ - 6
12
+ version: 0.5.1.rc6
13
13
  platform: ruby
14
14
  authors:
15
15
  - Cloud Foundry Team
@@ -18,7 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2013-03-21 00:00:00 Z
21
+ date: 2013-04-09 00:00:00 Z
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
24
24
  name: json_pure
@@ -73,14 +73,14 @@ dependencies:
73
73
  requirements:
74
74
  - - ">="
75
75
  - !ruby/object:Gem::Version
76
- hash: -1558593112
76
+ hash: 2937694555
77
77
  segments:
78
78
  - 0
79
79
  - 5
80
80
  - 3
81
81
  - rc
82
- - 6
83
- version: 0.5.3.rc6
82
+ - 7
83
+ version: 0.5.3.rc7
84
84
  - - <
85
85
  - !ruby/object:Gem::Version
86
86
  hash: 7
@@ -136,7 +136,7 @@ dependencies:
136
136
  requirements:
137
137
  - - ">="
138
138
  - !ruby/object:Gem::Version
139
- hash: -1558593136
139
+ hash: 2937694561
140
140
  segments:
141
141
  - 0
142
142
  - 6
@@ -317,7 +317,6 @@ files:
317
317
  - lib/vmc/test_support.rb
318
318
  - lib/vmc/version.rb
319
319
  - lib/vmc.rb
320
- - spec/assets/hello-sinatra/config.ru
321
320
  - spec/assets/hello-sinatra/fat-cat-makes-app-larger.png
322
321
  - spec/assets/hello-sinatra/Gemfile
323
322
  - spec/assets/hello-sinatra/Gemfile.lock
@@ -327,9 +326,9 @@ files:
327
326
  - spec/console_app_specker/console_app_specker_matchers_spec.rb
328
327
  - spec/console_app_specker/specker_runner_spec.rb
329
328
  - spec/features/v1/new_user_flow_spec.rb
329
+ - spec/features/v1/push_flow_spec.rb
330
330
  - spec/features/v2/account_lifecycle_spec.rb
331
331
  - spec/features/v2/login_spec.rb
332
- - spec/features/v2/push_flow_spec.rb
333
332
  - spec/features/v2/switching_targets_spec.rb
334
333
  - spec/spec_helper.rb
335
334
  - spec/support/command_helper.rb
@@ -412,7 +411,6 @@ signing_key:
412
411
  specification_version: 3
413
412
  summary: Friendly command-line interface for Cloud Foundry.
414
413
  test_files:
415
- - spec/assets/hello-sinatra/config.ru
416
414
  - spec/assets/hello-sinatra/fat-cat-makes-app-larger.png
417
415
  - spec/assets/hello-sinatra/Gemfile
418
416
  - spec/assets/hello-sinatra/Gemfile.lock
@@ -422,9 +420,9 @@ test_files:
422
420
  - spec/console_app_specker/console_app_specker_matchers_spec.rb
423
421
  - spec/console_app_specker/specker_runner_spec.rb
424
422
  - spec/features/v1/new_user_flow_spec.rb
423
+ - spec/features/v1/push_flow_spec.rb
425
424
  - spec/features/v2/account_lifecycle_spec.rb
426
425
  - spec/features/v2/login_spec.rb
427
- - spec/features/v2/push_flow_spec.rb
428
426
  - spec/features/v2/switching_targets_spec.rb
429
427
  - spec/spec_helper.rb
430
428
  - spec/support/command_helper.rb
@@ -1,3 +0,0 @@
1
- require './main'
2
-
3
- run Main.new