cf 0.6.1.rc16 → 0.6.1.rc17

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,27 +2,20 @@ require "cf/cli/user/base"
2
2
 
3
3
  module CF::User
4
4
  class Passwd < Base
5
- desc "Update a user's password"
5
+ desc "Update the current user's password"
6
6
  group :admin, :user, :hidden => true
7
- input :user, :desc => "User to update", :argument => :optional,
8
- :default => proc { client.current_user },
9
- :from_given => proc { |email|
10
- if client.current_user.email != email
11
- fail "You can only change your own password."
12
- end
13
- }
14
7
  input :password, :desc => "Current password"
15
8
  input :new_password, :desc => "New password"
16
9
  input :verify, :desc => "Repeat new password"
10
+
17
11
  def passwd
18
- user = input[:user]
19
12
  password = input[:password]
20
13
  new_password = input[:new_password]
21
14
 
22
15
  validate_password! new_password
23
16
 
24
17
  with_progress("Changing password") do
25
- user.change_password!(new_password, password)
18
+ client.current_user.change_password!(new_password, password)
26
19
  end
27
20
  end
28
21
 
@@ -1,3 +1,3 @@
1
1
  module CF
2
- VERSION = "0.6.1.rc16".freeze
2
+ VERSION = "0.6.1.rc17".freeze
3
3
  end
@@ -67,7 +67,6 @@ class ManifestsPlugin < CF::App::Base
67
67
  app.memory = megabytes(input[:memory]) if input.has?(:memory)
68
68
  app.total_instances = input[:instances] if input.has?(:instances)
69
69
  app.command = input[:command] if input.has?(:command)
70
- app.production = input[:plan].upcase.start_with?("P") if input.has?(:plan)
71
70
  app.buildpack = input[:buildpack] if input.has?(:buildpack)
72
71
  end
73
72
 
@@ -6,18 +6,11 @@ describe CF::User::Passwd do
6
6
 
7
7
  describe 'command' do
8
8
  subject { command }
9
- its(:description) { should eq "Update a user's password" }
9
+ its(:description) { should eq "Update the current user's password" }
10
10
  it { expect(Mothership::Help.group(:admin, :user)).to include(subject) }
11
11
  end
12
12
 
13
13
  include_examples 'inputs must have descriptions'
14
-
15
- describe 'arguments' do
16
- subject { command.arguments }
17
- it 'have the correct commands (with inconsistent user instead of email)' do
18
- should eq [{:type => :optional, :value => nil, :name => :user}]
19
- end
20
- end
21
14
  end
22
15
 
23
16
  describe '#passwd' do
@@ -23,6 +23,7 @@ if ENV['CF_V2_RUN_INTEGRATION']
23
23
 
24
24
  after do
25
25
  `#{cf_bin} unbind-service -f --no-script #{service_name} #{app}`
26
+ `#{cf_bin} delete-service -f --no-script #{service_name}`
26
27
  `#{cf_bin} delete #{app} -f --routes --no-script`
27
28
  logout
28
29
  Interact::Progress::Dots.stop!
@@ -41,63 +41,76 @@ if ENV['CF_V2_RUN_INTEGRATION']
41
41
  end
42
42
  end
43
43
 
44
- it "can create, switch, rename, and delete spaces" do
45
- new_space = "test-space-#{rand(10000)}"
46
- new_space_two = "test-space-renamed-#{rand(10000)}"
47
- BlueShell::Runner.run("#{cf_bin} create-space #{new_space}") do |runner|
48
- expect(runner).to say("Creating space #{new_space}... OK")
44
+ describe "needs cleanup after specs" do
45
+ let(:run_id) { TRAVIS_BUILD_ID.to_s + Time.new.to_f.to_s.gsub(".", "_") }
46
+ let(:app) { "hello-sinatra-recursive-#{run_id}" }
47
+ let(:new_space) { "test-space-#{rand(10000)}" }
48
+ let(:new_space_two) { "test-space-renamed-#{rand(10000)}" }
49
+
50
+ after do
51
+ begin
52
+ BlueShell::Runner.run("#{cf_bin} delete-space #{new_space} -r -f")
53
+ rescue
54
+ end
55
+ begin
56
+ BlueShell::Runner.run("#{cf_bin} delete-space #{new_space_two} -r -f")
57
+ rescue
58
+ end
49
59
  end
50
60
 
51
- BlueShell::Runner.run("#{cf_bin} switch-space #{new_space}") do |runner|
52
- expect(runner).to say("Switching to space #{new_space}... OK")
53
- end
61
+ it "can create, switch, rename, and delete spaces" do
62
+ BlueShell::Runner.run("#{cf_bin} create-space #{new_space}") do |runner|
63
+ expect(runner).to say("Creating space #{new_space}... OK")
64
+ end
54
65
 
55
- BlueShell::Runner.run("#{cf_bin} rename-space #{new_space} #{new_space_two}") do |runner|
56
- expect(runner).to say("Renaming to #{new_space_two}... OK")
57
- end
66
+ BlueShell::Runner.run("#{cf_bin} switch-space #{new_space}") do |runner|
67
+ expect(runner).to say("Switching to space #{new_space}... OK")
68
+ end
58
69
 
59
- BlueShell::Runner.run("#{cf_bin} delete-space #{new_space_two}") do |runner|
60
- expect(runner).to say("Really delete")
61
- runner.send_keys "y"
70
+ BlueShell::Runner.run("#{cf_bin} rename-space #{new_space} #{new_space_two}") do |runner|
71
+ expect(runner).to say("Renaming to #{new_space_two}... OK")
72
+ end
62
73
 
63
- expect(runner).to say("Deleting space #{new_space_two}... OK")
64
- end
65
- end
74
+ BlueShell::Runner.run("#{cf_bin} delete-space #{new_space_two}") do |runner|
75
+ expect(runner).to say("Really delete")
76
+ runner.send_keys "y"
66
77
 
67
- it "shows all the spaces in the org" do
68
- BlueShell::Runner.run("#{cf_bin} spaces") do |runner|
69
- expect(runner).to say(space)
78
+ expect(runner).to say("Deleting space #{new_space_two}... OK")
79
+ end
70
80
  end
71
- end
72
81
 
73
- let(:run_id) { TRAVIS_BUILD_ID.to_s + Time.new.to_f.to_s.gsub(".", "_") }
74
- let(:app) { "hello-sinatra-recursive-#{run_id}" }
82
+ it "can create an app in a space, then delete it recursively" do
83
+ BlueShell::Runner.run("#{cf_bin} create-space #{new_space}") { |runner| runner.wait_for_exit(30) }
84
+ BlueShell::Runner.run("#{cf_bin} switch-space #{new_space}") { |runner| runner.wait_for_exit(30) }
75
85
 
76
- it "can create an app in a space, then delete it recursively" do
77
- new_space = "test-space-#{rand(10000)}"
78
- BlueShell::Runner.run("#{cf_bin} create-space #{new_space}") { |runner| runner.wait_for_exit(30) }
79
- BlueShell::Runner.run("#{cf_bin} switch-space #{new_space}") { |runner| runner.wait_for_exit(30) }
86
+ push_app("hello-sinatra", app)
80
87
 
81
- push_app("hello-sinatra", app)
88
+ BlueShell::Runner.run("#{cf_bin} delete-space #{new_space} --force") do |runner|
89
+ expect(runner).to say("If you want to delete the space along with all dependent objects, rerun the command with the '--recursive' flag.")
90
+ runner.wait_for_exit(30)
91
+ end.should_not be_successful
82
92
 
83
- BlueShell::Runner.run("#{cf_bin} delete-space #{new_space} --force") do |runner|
84
- expect(runner).to say("If you want to delete the space along with all dependent objects, rerun the command with the '--recursive' flag.")
85
- runner.wait_for_exit(30)
86
- end.should_not be_successful
93
+ BlueShell::Runner.run("#{cf_bin} spaces") do |runner|
94
+ expect(runner).to say(new_space)
95
+ expect(runner).to say(app)
96
+ end
87
97
 
88
- BlueShell::Runner.run("#{cf_bin} spaces") do |runner|
89
- expect(runner).to say(new_space)
90
- expect(runner).to say(app)
91
- end
98
+ BlueShell::Runner.run("#{cf_bin} delete-space #{new_space} --recursive --force") do |runner|
99
+ expect(runner).to say("Deleting space #{new_space}... OK")
100
+ end
92
101
 
93
- BlueShell::Runner.run("#{cf_bin} delete-space #{new_space} --recursive --force") do |runner|
94
- expect(runner).to say("Deleting space #{new_space}... OK")
102
+ BlueShell::Runner.run("#{cf_bin} spaces") do |runner|
103
+ expect(runner).to_not say(new_space)
104
+ expect(runner).to_not say(app)
105
+ end
95
106
  end
107
+ end
96
108
 
109
+ it "shows all the spaces in the org" do
97
110
  BlueShell::Runner.run("#{cf_bin} spaces") do |runner|
98
- expect(runner).to_not say(new_space)
99
- expect(runner).to_not say(app)
111
+ expect(runner).to say(space)
100
112
  end
101
113
  end
114
+
102
115
  end
103
116
  end
@@ -52,12 +52,12 @@ if ENV['CF_V2_RUN_INTEGRATION']
52
52
 
53
53
  BlueShell::Runner.run("#{cf_bin} target -s #{space}") do |runner|
54
54
  expect(runner).to say("Switching to space #{space}")
55
- runner.wait_for_exit
55
+ runner.wait_for_exit(15)
56
56
  end
57
57
 
58
58
  BlueShell::Runner.run("#{cf_bin} target -s #{space2}") do |runner|
59
59
  expect(runner).to say("Switching to space #{space2}")
60
- runner.wait_for_exit
60
+ runner.wait_for_exit(15)
61
61
  end
62
62
  end
63
63
  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.rc16
4
+ version: 0.6.1.rc17
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-04-23 00:00:00.000000000 Z
13
+ date: 2013-04-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: addressable
@@ -51,7 +51,7 @@ dependencies:
51
51
  requirements:
52
52
  - - ! '>='
53
53
  - !ruby/object:Gem::Version
54
- version: 0.7.0.rc8
54
+ version: 0.7.0.rc9
55
55
  - - <
56
56
  - !ruby/object:Gem::Version
57
57
  version: '0.8'
@@ -62,7 +62,7 @@ dependencies:
62
62
  requirements:
63
63
  - - ! '>='
64
64
  - !ruby/object:Gem::Version
65
- version: 0.7.0.rc8
65
+ version: 0.7.0.rc9
66
66
  - - <
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.8'
@@ -531,7 +531,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
531
531
  version: '0'
532
532
  segments:
533
533
  - 0
534
- hash: 3785386009027622899
534
+ hash: 1676711361169297204
535
535
  required_rubygems_version: !ruby/object:Gem::Requirement
536
536
  none: false
537
537
  requirements: