engineyard 3.1.2 → 3.1.3

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.
@@ -36,39 +36,39 @@ shared_examples_for "running ey ssh for select role" do
36
36
  login_scenario "one app, one environment"
37
37
  ey command_to_run(:ssh_command => "ls", :environment => 'giblets', :verbose => true)
38
38
  @hosts.each do |host|
39
- @raw_ssh_commands.select do |command|
39
+ expect(@raw_ssh_commands.select do |command|
40
40
  command =~ /^ssh turkey@#{host}.+ ls$/
41
- end.should_not be_empty
41
+ end).not_to be_empty
42
42
  end
43
- @raw_ssh_commands.select do |command|
43
+ expect(@raw_ssh_commands.select do |command|
44
44
  command =~ /^ssh turkey.+ ls$/
45
- end.count.should == @hosts.count
45
+ end.count).to eq(@hosts.count)
46
46
  end
47
47
 
48
48
  it "is quiet" do
49
49
  login_scenario "one app, one environment"
50
50
  ey command_to_run(:ssh_command => "ls", :environment => 'giblets', :quiet => true)
51
- @out.should =~ /ssh.*ls/
52
- @out.should_not =~ /Loading application data/
51
+ expect(@out).to match(/ssh.*ls/)
52
+ expect(@out).not_to match(/Loading application data/)
53
53
  end
54
54
 
55
55
  it "runs in bash by default" do
56
56
  login_scenario "one app, one environment"
57
57
  ey command_to_run(:ssh_command => "ls", :environment => 'giblets')
58
- @out.should =~ /ssh.*bash -lc ls/
58
+ expect(@out).to match(/ssh.*bash -lc ls/)
59
59
  end
60
60
 
61
61
  it "excludes shell with --no-shell" do
62
62
  login_scenario "one app, one environment"
63
63
  ey command_to_run(:ssh_command => "ls", :environment => 'giblets', :no_shell => true)
64
- @out.should_not =~ /bash/
65
- @out.should =~ /ssh.*ls/
64
+ expect(@out).not_to match(/bash/)
65
+ expect(@out).to match(/ssh.*ls/)
66
66
  end
67
67
 
68
68
  it "accepts an alternate shell" do
69
69
  login_scenario "one app, one environment"
70
70
  ey command_to_run(:ssh_command => "ls", :environment => 'giblets', :shell => 'zsh')
71
- @out.should =~ /ssh.*zsh -lc ls/
71
+ expect(@out).to match(/ssh.*zsh -lc ls/)
72
72
  end
73
73
 
74
74
  it "raises an error when there are no matching hosts" do
@@ -93,7 +93,7 @@ describe "ey ssh" do
93
93
 
94
94
  it "complains if it has no app master" do
95
95
  ey %w[ssh -e bakon], :expect_failure => true
96
- @err.should =~ /'bakon' does not have any matching instances/
96
+ expect(@err).to match(/'bakon' does not have any matching instances/)
97
97
  end
98
98
 
99
99
  end
@@ -116,7 +116,7 @@ describe "ey ssh without a command" do
116
116
 
117
117
  def verify_ran(scenario)
118
118
  ssh_target = scenario[:ssh_username] + '@' + scenario[:master_hostname]
119
- @raw_ssh_commands.should == ["ssh #{ssh_target}"]
119
+ expect(@raw_ssh_commands).to eq(["ssh #{ssh_target}"])
120
120
  end
121
121
 
122
122
  include_examples "it takes an environment name and an account name"
@@ -136,7 +136,7 @@ describe "ey ssh with a command" do
136
136
 
137
137
  def verify_ran(scenario)
138
138
  ssh_target = scenario[:ssh_username] + '@' + scenario[:master_hostname]
139
- @raw_ssh_commands.should == ["ssh #{ssh_target} 'bash -lc ls'"]
139
+ expect(@raw_ssh_commands).to eq(["ssh #{ssh_target} 'bash -lc ls'"])
140
140
  end
141
141
 
142
142
  include_examples "it takes an environment name and an account name"
@@ -179,7 +179,7 @@ describe "ey ssh with a multi-part command" do
179
179
 
180
180
  def verify_ran(scenario)
181
181
  ssh_target = scenario[:ssh_username] + '@' + scenario[:master_hostname]
182
- @raw_ssh_commands.should == ["ssh #{ssh_target} 'bash -lc '\\''echo \"echo\"'\\'"]
182
+ expect(@raw_ssh_commands).to eq(["ssh #{ssh_target} 'bash -lc '\\''echo \"echo\"'\\'"])
183
183
  end
184
184
 
185
185
  include_examples "it takes an environment name and an account name"
@@ -10,36 +10,36 @@ describe "ey environments" do
10
10
 
11
11
  it "tells you it's never been deployed" do
12
12
  fast_failing_ey %w[status -e giblets]
13
- @err.should =~ /Application rails232app has not been deployed on giblets./
13
+ expect(@err).to match(/Application rails232app has not been deployed on giblets./)
14
14
  end
15
15
 
16
16
  it "outputs the status of the deployment" do
17
17
  fast_ey %w[deploy -e giblets --ref HEAD --no-migrate]
18
18
  fast_ey %w[status -e giblets]
19
- @out.should =~ /Application:\s+rails232app/
20
- @out.should =~ /Environment:\s+giblets/
21
- @out.should =~ /Ref:\s+HEAD/
22
- @out.should =~ /Resolved Ref:\s+resolved-HEAD/
23
- @out.should =~ /Commit:\s+[a-f0-9]{40}/
24
- @out.should =~ /Migrate:\s+false/
25
- @out.should =~ /Deployed by:\s+One App Many Envs/
26
- @out.should =~ /Started at:/
27
- @out.should =~ /Finished at:/
28
- @out.should =~ /Deployment was successful/
19
+ expect(@out).to match(/Application:\s+rails232app/)
20
+ expect(@out).to match(/Environment:\s+giblets/)
21
+ expect(@out).to match(/Ref:\s+HEAD/)
22
+ expect(@out).to match(/Resolved Ref:\s+resolved-HEAD/)
23
+ expect(@out).to match(/Commit:\s+[a-f0-9]{40}/)
24
+ expect(@out).to match(/Migrate:\s+false/)
25
+ expect(@out).to match(/Deployed by:\s+One App Many Envs/)
26
+ expect(@out).to match(/Started at:/)
27
+ expect(@out).to match(/Finished at:/)
28
+ expect(@out).to match(/Deployment was successful/)
29
29
  end
30
30
 
31
31
  it "quiets almost all of the output with --quiet" do
32
32
  fast_ey %w[deploy -e giblets --ref HEAD --no-migrate]
33
33
  fast_ey %w[status -e giblets -q]
34
- @out.should_not =~ /Application:\s+rails232app/
35
- @out.should_not =~ /Environment:\s+giblets/
36
- @out.should_not =~ /Ref:\s+HEAD/
37
- @out.should_not =~ /Resolved Ref:\s+resolved-HEAD/
38
- @out.should_not =~ /Commit:\s+[a-f0-9]{40}/
39
- @out.should_not =~ /Migrate:\s+false/
40
- @out.should_not =~ /Deployed by:\s+One App Many Envs/
41
- @out.should_not =~ /Started at:/
42
- @out.should_not =~ /Finished at:/
43
- @out.should =~ /Deployment was successful/
34
+ expect(@out).not_to match(/Application:\s+rails232app/)
35
+ expect(@out).not_to match(/Environment:\s+giblets/)
36
+ expect(@out).not_to match(/Ref:\s+HEAD/)
37
+ expect(@out).not_to match(/Resolved Ref:\s+resolved-HEAD/)
38
+ expect(@out).not_to match(/Commit:\s+[a-f0-9]{40}/)
39
+ expect(@out).not_to match(/Migrate:\s+false/)
40
+ expect(@out).not_to match(/Deployed by:\s+One App Many Envs/)
41
+ expect(@out).not_to match(/Started at:/)
42
+ expect(@out).not_to match(/Finished at:/)
43
+ expect(@out).to match(/Deployment was successful/)
44
44
  end
45
45
  end
@@ -6,13 +6,13 @@ describe "ey timeout-deploy" do
6
6
  it "timeouts the last deployment" do
7
7
  login_scenario "Stuck Deployment"
8
8
  fast_ey %w[timeout-deploy]
9
- @out.should match(/Marking last deployment failed.../)
10
- @out.should match(/Finished at:\s+\w+/)
9
+ expect(@out).to match(/Marking last deployment failed.../)
10
+ expect(@out).to match(/Finished at:\s+\w+/)
11
11
  end
12
12
 
13
13
  it "complains when there is no stuck deployment" do
14
14
  login_scenario "one app, one environment"
15
15
  fast_failing_ey ["timeout-deploy"]
16
- @err.should include(%|No unfinished deployment was found for main / rails232app / giblets.|)
16
+ expect(@err).to include(%|No unfinished deployment was found for main / rails232app / giblets.|)
17
17
  end
18
18
  end
@@ -13,7 +13,7 @@ describe "ey web disable" do
13
13
  end
14
14
 
15
15
  def verify_ran(scenario)
16
- @ssh_commands.should have_command_like(/engineyard-serverside.*enable_maintenance.*--app #{scenario[:application]}/)
16
+ expect(@ssh_commands).to have_command_like(/engineyard-serverside.*enable_maintenance.*--app #{scenario[:application]}/)
17
17
  end
18
18
 
19
19
  include_examples "it takes an environment name and an app name and an account name"
@@ -13,7 +13,7 @@ describe "ey web enable" do
13
13
  end
14
14
 
15
15
  def verify_ran(scenario)
16
- @ssh_commands.should have_command_like(/engineyard-serverside.*disable_maintenance.*--app #{scenario[:application]}/)
16
+ expect(@ssh_commands).to have_command_like(/engineyard-serverside.*disable_maintenance.*--app #{scenario[:application]}/)
17
17
  end
18
18
 
19
19
  include_examples "it takes an environment name and an app name and an account name"
@@ -21,6 +21,6 @@ describe "ey web enable" do
21
21
 
22
22
  it "fails when given a bad option" do
23
23
  ey %w[web enable --lots --of --bogus --options], :expect_failure => true
24
- @err.should include("Unknown switches")
24
+ expect(@err).to include("Unknown switches")
25
25
  end
26
26
  end
@@ -13,7 +13,7 @@ describe "ey web restart" do
13
13
  end
14
14
 
15
15
  def verify_ran(scenario)
16
- @ssh_commands.should have_command_like(/engineyard-serverside.*restart.*--app #{scenario[:application]}/)
16
+ expect(@ssh_commands).to have_command_like(/engineyard-serverside.*restart.*--app #{scenario[:application]}/)
17
17
  end
18
18
 
19
19
  include_examples "it takes an environment name and an app name and an account name"
@@ -7,7 +7,7 @@ describe "ey whoami" do
7
7
  before { login_scenario 'empty' }
8
8
  it "outputs the currently logged in user" do
9
9
  ey %w[whoami]
10
- @out.should include("User Name (#{scenario_email})")
10
+ expect(@out).to include("User Name (#{scenario_email})")
11
11
  end
12
12
  end
13
13
 
@@ -20,11 +20,11 @@ describe "ey whoami" do
20
20
  input.puts(scenario_password)
21
21
  end
22
22
 
23
- @out.should include("We need to fetch your API token; please log in.")
24
- @out.should include("Email:")
25
- @out.should include("Password:")
23
+ expect(@out).to include("We need to fetch your API token; please log in.")
24
+ expect(@out).to include("Email:")
25
+ expect(@out).to include("Password:")
26
26
 
27
- @out.should include("User Name (#{scenario_email})")
27
+ expect(@out).to include("User Name (#{scenario_email})")
28
28
  end
29
29
  end
30
30
  end
@@ -13,9 +13,9 @@ shared_examples_for "it requires an unambiguous git repo" do
13
13
 
14
14
  it "lists disambiguating environments to choose from" do
15
15
  run_ey({}, {:expect_failure => true})
16
- @err.should include('Multiple environments possible, please be more specific')
17
- @err.should =~ /giblets/
18
- @err.should =~ /keycollector_production/
16
+ expect(@err).to include('Multiple environments possible, please be more specific')
17
+ expect(@err).to match(/giblets/)
18
+ expect(@err).to match(/keycollector_production/)
19
19
  end
20
20
  end
21
21
 
@@ -26,9 +26,9 @@ shared_examples_for "it takes an environment name and an app name and an account
26
26
  it "complains when you send --account without a value" do
27
27
  login_scenario "empty"
28
28
  fast_failing_ey command_to_run({}) << '--account'
29
- @err.should include("No value provided for option '--account'")
29
+ expect(@err).to include("No value provided for option '--account'")
30
30
  fast_failing_ey command_to_run({}) << '-c'
31
- @err.should include("No value provided for option '--account'")
31
+ expect(@err).to include("No value provided for option '--account'")
32
32
  end
33
33
 
34
34
  context "when multiple accounts with collaboration" do
@@ -39,11 +39,11 @@ shared_examples_for "it takes an environment name and an app name and an account
39
39
  it "fails when the app and environment are ambiguous across accounts" do
40
40
  run_ey({:environment => "giblets", :app => "rails232app", :ref => 'master'}, {:expect_failure => !@succeeds_on_multiple_matches})
41
41
  if @succeeds_on_multiple_matches
42
- @err.should_not match(/multiple/i)
42
+ expect(@err).not_to match(/multiple/i)
43
43
  else
44
- @err.should match(/Multiple application environments possible/i)
45
- @err.should match(/ey \S+ --account='account_2' --app='rails232app' --environment='giblets'/i)
46
- @err.should match(/ey \S+ --account='main' --app='rails232app' --environment='giblets'/i)
44
+ expect(@err).to match(/Multiple application environments possible/i)
45
+ expect(@err).to match(/ey \S+ --account='account_2' --app='rails232app' --environment='giblets'/i)
46
+ expect(@err).to match(/ey \S+ --account='main' --app='rails232app' --environment='giblets'/i)
47
47
  end
48
48
  end
49
49
 
@@ -65,9 +65,9 @@ shared_examples_for "it takes an environment name and an account name" do
65
65
  it "complains when you send --account without a value" do
66
66
  login_scenario "empty"
67
67
  fast_failing_ey command_to_run({}) << '--account'
68
- @err.should include("No value provided for option '--account'")
68
+ expect(@err).to include("No value provided for option '--account'")
69
69
  fast_failing_ey command_to_run({}) << '-c'
70
- @err.should include("No value provided for option '--account'")
70
+ expect(@err).to include("No value provided for option '--account'")
71
71
  end
72
72
 
73
73
  context "when multiple accounts with collaboration" do
@@ -77,9 +77,9 @@ shared_examples_for "it takes an environment name and an account name" do
77
77
 
78
78
  it "fails when the app and environment are ambiguous across accounts" do
79
79
  run_ey({:environment => "giblets"}, {:expect_failure => true})
80
- @err.should match(/multiple environments possible/i)
81
- @err.should match(/ey \S+ --environment='giblets' --account='account_2'/i)
82
- @err.should match(/ey \S+ --environment='giblets' --account='main'/i)
80
+ expect(@err).to match(/multiple environments possible/i)
81
+ expect(@err).to match(/ey \S+ --environment='giblets' --account='account_2'/i)
82
+ expect(@err).to match(/ey \S+ --environment='giblets' --account='main'/i)
83
83
  end
84
84
 
85
85
  it "runs when specifying the account disambiguates the app to deploy" do
@@ -96,12 +96,12 @@ shared_examples_for "it takes an environment name and an account name" do
96
96
  context "when the backend raises an error" do
97
97
  before do
98
98
  # FIXME, cloud-client needs to provide an API for making responses raise
99
- EY::CLI::API.stub(:new).and_raise(EY::CloudClient::RequestFailed.new("Error: Important infos"))
99
+ allow(EY::CLI::API).to receive(:new).and_raise(EY::CloudClient::RequestFailed.new("Error: Important infos"))
100
100
  end
101
101
 
102
102
  it "returns the error message to the user" do
103
103
  fast_failing_ey(command_to_run({:environment => "giblets", :account => "main"}))
104
- @err.should match(/Important infos/)
104
+ expect(@err).to match(/Important infos/)
105
105
  end
106
106
  end
107
107
 
@@ -125,15 +125,15 @@ shared_examples_for "it takes an environment name" do
125
125
  login_scenario "one app, one environment"
126
126
  # This test must shell out (not sure why, plz FIXME)
127
127
  ey command_to_run(:environment => 'typo-happens-here'), {:expect_failure => true}
128
- @err.should match(/No environment found matching .*typo-happens-here/i)
128
+ expect(@err).to match(/No environment found matching .*typo-happens-here/i)
129
129
  end
130
130
 
131
131
  it "complains when you send --environment without a value" do
132
132
  login_scenario "empty"
133
133
  fast_failing_ey command_to_run({}) << '--environment'
134
- @err.should include("No value provided for option '--environment'")
134
+ expect(@err).to include("No value provided for option '--environment'")
135
135
  fast_failing_ey command_to_run({}) << '-e'
136
- @err.should include("No value provided for option '--environment'")
136
+ expect(@err).to include("No value provided for option '--environment'")
137
137
  end
138
138
 
139
139
  context "outside a git repo" do
@@ -158,12 +158,12 @@ shared_examples_for "it takes an environment name" do
158
158
  run_ey({:environment => 'staging'}, {:expect_failure => !@succeeds_on_multiple_matches})
159
159
 
160
160
  if @succeeds_on_multiple_matches
161
- @err.should_not match(/multiple .* possible/i)
161
+ expect(@err).not_to match(/multiple .* possible/i)
162
162
  else
163
163
  if @takes_app_name
164
- @err.should match(/multiple application environments possible/i)
164
+ expect(@err).to match(/multiple application environments possible/i)
165
165
  else
166
- @err.should match(/multiple environments possible/i)
166
+ expect(@err).to match(/multiple environments possible/i)
167
167
  end
168
168
  end
169
169
  end
@@ -184,7 +184,7 @@ shared_examples_for "it takes an environment name" do
184
184
  it "complains when it can't guess the environment and its name isn't specified" do
185
185
  login_scenario "one app without environment"
186
186
  run_ey({:environment => nil}, {:expect_failure => true})
187
- @err.should match(/No environment found for applications matching remotes:/i)
187
+ expect(@err).to match(/No environment found for applications matching remotes:/i)
188
188
  end
189
189
  end
190
190
 
@@ -194,9 +194,9 @@ shared_examples_for "it takes an app name" do
194
194
  it "complains when you send --app without a value" do
195
195
  login_scenario "empty"
196
196
  fast_failing_ey command_to_run({}) << '--app'
197
- @err.should include("No value provided for option '--app'")
197
+ expect(@err).to include("No value provided for option '--app'")
198
198
  fast_failing_ey command_to_run({}) << '-a'
199
- @err.should include("No value provided for option '--app'")
199
+ expect(@err).to include("No value provided for option '--app'")
200
200
  end
201
201
 
202
202
  it "allows you to specify a valid app" do
@@ -229,7 +229,7 @@ shared_examples_for "it takes an app name" do
229
229
  login_scenario "one app, one environment"
230
230
  run_ey({:environment => 'giblets', :app => 'P-time-SAT-solver', :ref => 'master'},
231
231
  {:expect_failure => true})
232
- @err.should =~ /No app.*P-time-SAT-solver/i
232
+ expect(@err).to match(/No app.*P-time-SAT-solver/i)
233
233
  end
234
234
 
235
235
  end
@@ -242,7 +242,7 @@ shared_examples_for "it invokes engineyard-serverside" do
242
242
  end
243
243
 
244
244
  it "passes --verbose to engineyard-serverside" do
245
- @ssh_commands.should have_command_like(/engineyard-serverside.*--verbose/)
245
+ expect(@ssh_commands).to have_command_like(/engineyard-serverside.*--verbose/)
246
246
  end
247
247
 
248
248
  it "passes along instance information to engineyard-serverside" do
@@ -256,11 +256,11 @@ shared_examples_for "it invokes engineyard-serverside" do
256
256
 
257
257
  # apps + utilities are all mentioned
258
258
  instance_args.each do |i|
259
- @ssh_commands.last.should =~ /#{i}/
259
+ expect(@ssh_commands.last).to match(/#{i}/)
260
260
  end
261
261
 
262
262
  # but not database instances
263
- @ssh_commands.last.should_not =~ /#{db_instance}/
263
+ expect(@ssh_commands.last).not_to match(/#{db_instance}/)
264
264
  end
265
265
 
266
266
  end
@@ -272,7 +272,7 @@ shared_examples_for "it invokes engineyard-serverside" do
272
272
  end
273
273
 
274
274
  it "omits the --instance-names parameter" do
275
- @ssh_commands.last.should_not include("--instance-names")
275
+ expect(@ssh_commands.last).not_to include("--instance-names")
276
276
  end
277
277
  end
278
278
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: engineyard
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.2
4
+ version: 3.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Engine Yard Cloud Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-04 00:00:00.000000000 Z
11
+ date: 2015-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline
@@ -42,30 +42,30 @@ dependencies:
42
42
  name: engineyard-serverside-adapter
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '='
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 2.2.0
47
+ version: '2.2'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '='
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 2.2.0
54
+ version: '2.2'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: engineyard-cloud-client
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 2.1.1
61
+ version: '2.1'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 2.1.1
68
+ version: '2.1'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: net-ssh
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -367,7 +367,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
367
367
  version: '0'
368
368
  requirements: []
369
369
  rubyforge_project:
370
- rubygems_version: 2.2.2
370
+ rubygems_version: 2.4.5
371
371
  signing_key:
372
372
  specification_version: 4
373
373
  summary: Command-line deployment for the Engine Yard cloud