cf 0.6.1.rc2 → 0.6.1.rc3

Sign up to get free protection for your applications and to get access to all the features.
@@ -60,6 +60,8 @@ module CF::Start
60
60
  end
61
61
  end
62
62
 
63
+ return if failed
64
+
63
65
  info.merge!(auth_token.to_hash)
64
66
  save_target_info(info)
65
67
  invalidate_client
data/lib/cf/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module CF
2
- VERSION = "0.6.1.rc2".freeze
2
+ VERSION = "0.6.1.rc3".freeze
3
3
  end
@@ -61,6 +61,20 @@ command CF::Start::Login do
61
61
  expect(tokens_yaml["https://api.some-domain.com"][:refresh_token]).to eq("some-new-refresh-token")
62
62
  end
63
63
 
64
+ context "when the user logs in with invalid credentials" do
65
+ before do
66
+ stub_ask("Username", {}) { "my-username" }
67
+ stub_ask("8-digit PIN", {:echo => "*", :forget => true}) { "my-password" }
68
+
69
+ stub(client).login("my-username", "my-password") { raise CFoundry::Denied }
70
+ end
71
+
72
+ it "informs the user gracefully" do
73
+ subject
74
+ expect(output).to say("Authenticating... FAILED")
75
+ end
76
+ end
77
+
64
78
  context "with space and org in the token file" do
65
79
  before do
66
80
  write_token_file(:space => "space-id-1", :organization => "organization-id-1")
@@ -99,7 +113,7 @@ command CF::Start::Login do
99
113
 
100
114
  context "with one organization" do
101
115
  let(:organizations) {
102
- [ organization ]
116
+ [organization]
103
117
  }
104
118
 
105
119
  it "does not prompt for an organization" do
@@ -112,7 +126,7 @@ command CF::Start::Login do
112
126
 
113
127
  context "with multiple organizations" do
114
128
  let(:organizations) {
115
- [ organization, OpenStruct.new(:name => 'My Org 2', :guid => 'organization-id-2') ]
129
+ [organization, OpenStruct.new(:name => 'My Org 2', :guid => 'organization-id-2')]
116
130
  }
117
131
 
118
132
  before do
@@ -90,6 +90,14 @@ if ENV['CF_V2_TEST_USER'] && ENV['CF_V2_TEST_PASSWORD'] && ENV['CF_V2_TEST_TARGE
90
90
 
91
91
  run("#{cf_bin} login #{email} --password p") do |runner|
92
92
  expect(runner).to say "Authenticating... FAILED"
93
+
94
+ expect(runner).to say "Password>"
95
+ runner.send_keys "another_password"
96
+ expect(runner).to say "Password>"
97
+ runner.send_keys "passwords_for_everyone"
98
+ expect(runner).to say "FAILED"
99
+ runner.output.should_not =~ /CFoundry::/
100
+ runner.output.should_not =~ %r{~/\.cf/crash}
93
101
  end
94
102
  end
95
103
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1.rc2
4
+ version: 0.6.1.rc3
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -67,7 +67,7 @@ dependencies:
67
67
  requirements:
68
68
  - - ! '>='
69
69
  - !ruby/object:Gem::Version
70
- version: 0.6.1.rc2
70
+ version: 0.6.1.rc3
71
71
  - - <
72
72
  - !ruby/object:Gem::Version
73
73
  version: '0.7'
@@ -78,7 +78,7 @@ dependencies:
78
78
  requirements:
79
79
  - - ! '>='
80
80
  - !ruby/object:Gem::Version
81
- version: 0.6.1.rc2
81
+ version: 0.6.1.rc3
82
82
  - - <
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0.7'
@@ -354,7 +354,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
354
354
  version: '0'
355
355
  segments:
356
356
  - 0
357
- hash: 3541781099873169759
357
+ hash: 1521493965711051536
358
358
  required_rubygems_version: !ruby/object:Gem::Requirement
359
359
  none: false
360
360
  requirements:
@@ -363,7 +363,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
363
363
  version: 1.3.1
364
364
  requirements: []
365
365
  rubyforge_project: cf
366
- rubygems_version: 1.8.25
366
+ rubygems_version: 1.8.24
367
367
  signing_key:
368
368
  specification_version: 3
369
369
  summary: Friendly command-line interface for Cloud Foundry.