cf 0.6.0.rc2 → 0.6.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
@@ -107,6 +107,8 @@ module CF
107
107
  err e.message
108
108
  rescue SystemExit
109
109
  raise
110
+ rescue UserFriendlyError => e
111
+ err e.message
110
112
  rescue CFoundry::Forbidden, CFoundry::InvalidAuthToken => e
111
113
  if !$cf_asked_auth
112
114
  $cf_asked_auth = true
@@ -30,8 +30,6 @@ module CF::Service
30
30
 
31
31
  if input[:version]
32
32
  offerings.reject! { |s| s.version != input[:version] }
33
- else
34
- offerings.reject!(&:deprecated?)
35
33
  end
36
34
 
37
35
  # filter the offerings based on a given plan value, which will be a
@@ -1,5 +1,5 @@
1
1
  module CF
2
- class UserError < RuntimeError
2
+ class UserFriendlyError < RuntimeError
3
3
  def initialize(msg)
4
4
  @message = msg
5
5
  end
@@ -9,6 +9,8 @@ module CF
9
9
  end
10
10
  end
11
11
 
12
+ class UserError < UserFriendlyError; end
13
+
12
14
  class NotAuthorized < UserError
13
15
  def initialize
14
16
  @message = "Not authorized."
@@ -1,3 +1,3 @@
1
1
  module CF
2
- VERSION = "0.6.0.rc2".freeze
2
+ VERSION = "0.6.0.rc3".freeze
3
3
  end
@@ -36,6 +36,13 @@ describe CF::CLI do
36
36
  end
37
37
  end
38
38
 
39
+ context "with a UserFriendlyError" do
40
+ let(:action) { proc { raise CF::UserFriendlyError.new("user friendly") } }
41
+
42
+ it_behaves_like "an error that's obvious to the user",
43
+ :with_message => "user friendly"
44
+ end
45
+
39
46
  context "with a SystemExit" do
40
47
  let(:action) { proc { exit 1 } }
41
48
 
@@ -39,13 +39,23 @@ if ENV['CF_V2_TEST_USER'] && ENV['CF_V2_TEST_PASSWORD'] && ENV['CF_V2_TEST_TARGE
39
39
  end
40
40
 
41
41
  run("#{cf_bin} login #{username} --password #{password}") do |runner|
42
- expect(runner).to say "Organization>"
43
- runner.send_keys "1"
44
- expect(runner).to say "Space>"
45
- runner.send_keys "1"
42
+ expect(runner).to say(
43
+ "Organization>" => proc {
44
+ runner.send_keys "pivotal-integration"
45
+ expect(runner).to say /Switching to organization .*\.\.\. OK/
46
+ },
47
+ "Switching to organization" => proc {}
48
+ )
49
+
50
+ expect(runner).to say(
51
+ "Space>" => proc {
52
+ runner.send_keys "1"
53
+ expect(runner).to say /Switching to space .*\.\.\. OK/
54
+ },
55
+ "Switching to space" => proc {}
56
+ )
46
57
  end
47
58
 
48
- puts "registering #{email}"
49
59
  run("#{cf_bin} register #{email} --password p") do |runner|
50
60
  expect(runner).to say "Confirm Password>"
51
61
  runner.send_keys 'p'
@@ -71,7 +81,6 @@ if ENV['CF_V2_TEST_USER'] && ENV['CF_V2_TEST_PASSWORD'] && ENV['CF_V2_TEST_TARGE
71
81
  # expect(runner).to say "Deleting #{email}... OK"
72
82
  # end
73
83
 
74
- puts "deleting #{email}"
75
84
  client.login(email, "p")
76
85
  user = client.current_user
77
86
  guid = user.guid
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cf
3
3
  version: !ruby/object:Gem::Version
4
- hash: -3773193672
4
+ hash: -3819338190
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
9
  - 0
10
10
  - rc
11
- - 2
12
- version: 0.6.0.rc2
11
+ - 3
12
+ version: 0.6.0.rc3
13
13
  platform: ruby
14
14
  authors:
15
15
  - Cloud Foundry Team
@@ -21,7 +21,9 @@ cert_chain: []
21
21
  date: 2013-03-19 00:00:00 Z
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
24
- version_requirements: &id001 !ruby/object:Gem::Requirement
24
+ name: json_pure
25
+ prerelease: false
26
+ requirement: &id001 !ruby/object:Gem::Requirement
25
27
  none: false
26
28
  requirements:
27
29
  - - ~>
@@ -31,12 +33,12 @@ dependencies:
31
33
  - 1
32
34
  - 6
33
35
  version: "1.6"
34
- prerelease: false
35
36
  type: :runtime
36
- name: json_pure
37
- requirement: *id001
37
+ version_requirements: *id001
38
38
  - !ruby/object:Gem::Dependency
39
- version_requirements: &id002 !ruby/object:Gem::Requirement
39
+ name: multi_json
40
+ prerelease: false
41
+ requirement: &id002 !ruby/object:Gem::Requirement
40
42
  none: false
41
43
  requirements:
42
44
  - - ~>
@@ -46,12 +48,12 @@ dependencies:
46
48
  - 1
47
49
  - 3
48
50
  version: "1.3"
49
- prerelease: false
50
51
  type: :runtime
51
- name: multi_json
52
- requirement: *id002
52
+ version_requirements: *id002
53
53
  - !ruby/object:Gem::Dependency
54
- version_requirements: &id003 !ruby/object:Gem::Requirement
54
+ name: interact
55
+ prerelease: false
56
+ requirement: &id003 !ruby/object:Gem::Requirement
55
57
  none: false
56
58
  requirements:
57
59
  - - ~>
@@ -61,17 +63,17 @@ dependencies:
61
63
  - 0
62
64
  - 5
63
65
  version: "0.5"
64
- prerelease: false
65
66
  type: :runtime
66
- name: interact
67
- requirement: *id003
67
+ version_requirements: *id003
68
68
  - !ruby/object:Gem::Dependency
69
- version_requirements: &id004 !ruby/object:Gem::Requirement
69
+ name: cfoundry
70
+ prerelease: false
71
+ requirement: &id004 !ruby/object:Gem::Requirement
70
72
  none: false
71
73
  requirements:
72
74
  - - ">="
73
75
  - !ruby/object:Gem::Version
74
- hash: -3773193672
76
+ hash: -3819338192
75
77
  segments:
76
78
  - 0
77
79
  - 6
@@ -86,12 +88,12 @@ dependencies:
86
88
  - 0
87
89
  - 7
88
90
  version: "0.7"
89
- prerelease: false
90
91
  type: :runtime
91
- name: cfoundry
92
- requirement: *id004
92
+ version_requirements: *id004
93
93
  - !ruby/object:Gem::Dependency
94
- version_requirements: &id005 !ruby/object:Gem::Requirement
94
+ name: clouseau
95
+ prerelease: false
96
+ requirement: &id005 !ruby/object:Gem::Requirement
95
97
  none: false
96
98
  requirements:
97
99
  - - ~>
@@ -101,12 +103,12 @@ dependencies:
101
103
  - 0
102
104
  - 0
103
105
  version: "0.0"
104
- prerelease: false
105
106
  type: :runtime
106
- name: clouseau
107
- requirement: *id005
107
+ version_requirements: *id005
108
108
  - !ruby/object:Gem::Dependency
109
- version_requirements: &id006 !ruby/object:Gem::Requirement
109
+ name: mothership
110
+ prerelease: false
111
+ requirement: &id006 !ruby/object:Gem::Requirement
110
112
  none: false
111
113
  requirements:
112
114
  - - ">="
@@ -124,24 +126,24 @@ dependencies:
124
126
  - 1
125
127
  - 0
126
128
  version: "1.0"
127
- prerelease: false
128
129
  type: :runtime
129
- name: mothership
130
- requirement: *id006
130
+ version_requirements: *id006
131
131
  - !ruby/object:Gem::Dependency
132
- version_requirements: &id007 !ruby/object:Gem::Requirement
132
+ name: manifests-cf-plugin
133
+ prerelease: false
134
+ requirement: &id007 !ruby/object:Gem::Requirement
133
135
  none: false
134
136
  requirements:
135
137
  - - ">="
136
138
  - !ruby/object:Gem::Version
137
- hash: -3773193682
139
+ hash: -3819338208
138
140
  segments:
139
141
  - 0
140
142
  - 7
141
143
  - 0
142
144
  - rc
143
- - 1
144
- version: 0.7.0.rc1
145
+ - 2
146
+ version: 0.7.0.rc2
145
147
  - - <
146
148
  - !ruby/object:Gem::Version
147
149
  hash: 27
@@ -149,24 +151,24 @@ dependencies:
149
151
  - 0
150
152
  - 8
151
153
  version: "0.8"
152
- prerelease: false
153
154
  type: :runtime
154
- name: manifests-cf-plugin
155
- requirement: *id007
155
+ version_requirements: *id007
156
156
  - !ruby/object:Gem::Dependency
157
- version_requirements: &id008 !ruby/object:Gem::Requirement
157
+ name: tunnel-cf-plugin
158
+ prerelease: false
159
+ requirement: &id008 !ruby/object:Gem::Requirement
158
160
  none: false
159
161
  requirements:
160
162
  - - ">="
161
163
  - !ruby/object:Gem::Version
162
- hash: -3773193618
164
+ hash: -3819338144
163
165
  segments:
164
166
  - 0
165
167
  - 3
166
168
  - 0
167
169
  - rc
168
- - 1
169
- version: 0.3.0.rc1
170
+ - 2
171
+ version: 0.3.0.rc2
170
172
  - - <
171
173
  - !ruby/object:Gem::Version
172
174
  hash: 3
@@ -174,12 +176,12 @@ dependencies:
174
176
  - 0
175
177
  - 4
176
178
  version: "0.4"
177
- prerelease: false
178
179
  type: :runtime
179
- name: tunnel-cf-plugin
180
- requirement: *id008
180
+ version_requirements: *id008
181
181
  - !ruby/object:Gem::Dependency
182
- version_requirements: &id009 !ruby/object:Gem::Requirement
182
+ name: rake
183
+ prerelease: false
184
+ requirement: &id009 !ruby/object:Gem::Requirement
183
185
  none: false
184
186
  requirements:
185
187
  - - ~>
@@ -189,12 +191,12 @@ dependencies:
189
191
  - 0
190
192
  - 9
191
193
  version: "0.9"
192
- prerelease: false
193
194
  type: :development
194
- name: rake
195
- requirement: *id009
195
+ version_requirements: *id009
196
196
  - !ruby/object:Gem::Dependency
197
- version_requirements: &id010 !ruby/object:Gem::Requirement
197
+ name: rspec
198
+ prerelease: false
199
+ requirement: &id010 !ruby/object:Gem::Requirement
198
200
  none: false
199
201
  requirements:
200
202
  - - ~>
@@ -204,12 +206,12 @@ dependencies:
204
206
  - 2
205
207
  - 11
206
208
  version: "2.11"
207
- prerelease: false
208
209
  type: :development
209
- name: rspec
210
- requirement: *id010
210
+ version_requirements: *id010
211
211
  - !ruby/object:Gem::Dependency
212
- version_requirements: &id011 !ruby/object:Gem::Requirement
212
+ name: webmock
213
+ prerelease: false
214
+ requirement: &id011 !ruby/object:Gem::Requirement
213
215
  none: false
214
216
  requirements:
215
217
  - - ~>
@@ -219,12 +221,12 @@ dependencies:
219
221
  - 1
220
222
  - 9
221
223
  version: "1.9"
222
- prerelease: false
223
224
  type: :development
224
- name: webmock
225
- requirement: *id011
225
+ version_requirements: *id011
226
226
  - !ruby/object:Gem::Dependency
227
- version_requirements: &id012 !ruby/object:Gem::Requirement
227
+ name: rr
228
+ prerelease: false
229
+ requirement: &id012 !ruby/object:Gem::Requirement
228
230
  none: false
229
231
  requirements:
230
232
  - - ~>
@@ -234,10 +236,8 @@ dependencies:
234
236
  - 1
235
237
  - 0
236
238
  version: "1.0"
237
- prerelease: false
238
239
  type: :development
239
- name: rr
240
- requirement: *id012
240
+ version_requirements: *id012
241
241
  description:
242
242
  email:
243
243
  - vcap-dev@googlegroups.com