capistrano 3.2.1 → 3.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +5 -3
  3. data/CHANGELOG.md +92 -2
  4. data/Gemfile +1 -5
  5. data/README.md +84 -3
  6. data/Rakefile +5 -1
  7. data/capistrano.gemspec +5 -1
  8. data/features/configuration.feature +9 -7
  9. data/features/deploy.feature +9 -8
  10. data/features/step_definitions/assertions.rb +15 -17
  11. data/features/step_definitions/cap_commands.rb +1 -1
  12. data/features/step_definitions/setup.rb +11 -7
  13. data/features/support/env.rb +8 -9
  14. data/features/support/remote_command_helpers.rb +2 -3
  15. data/features/support/vagrant_helpers.rb +35 -0
  16. data/lib/capistrano/all.rb +2 -1
  17. data/lib/capistrano/application.rb +52 -7
  18. data/lib/capistrano/configuration.rb +39 -10
  19. data/lib/capistrano/configuration/filter.rb +56 -0
  20. data/lib/capistrano/configuration/question.rb +23 -11
  21. data/lib/capistrano/configuration/server.rb +14 -5
  22. data/lib/capistrano/configuration/servers.rb +12 -29
  23. data/lib/capistrano/defaults.rb +11 -9
  24. data/lib/capistrano/deploy.rb +1 -0
  25. data/lib/capistrano/dsl.rb +13 -2
  26. data/lib/capistrano/dsl/env.rb +6 -2
  27. data/lib/capistrano/dsl/task_enhancements.rb +5 -3
  28. data/lib/capistrano/git.rb +8 -2
  29. data/lib/capistrano/hg.rb +7 -1
  30. data/lib/capistrano/svn.rb +2 -2
  31. data/lib/capistrano/tasks/deploy.rake +12 -10
  32. data/lib/capistrano/tasks/git.rake +1 -1
  33. data/lib/capistrano/tasks/install.rake +17 -14
  34. data/lib/capistrano/templates/Capfile +6 -4
  35. data/lib/capistrano/templates/deploy.rb.erb +5 -15
  36. data/lib/capistrano/upload_task.rb +9 -0
  37. data/lib/capistrano/version.rb +1 -1
  38. data/spec/integration/dsl_spec.rb +129 -10
  39. data/spec/lib/capistrano/application_spec.rb +24 -6
  40. data/spec/lib/capistrano/configuration/filter_spec.rb +105 -0
  41. data/spec/lib/capistrano/configuration/question_spec.rb +18 -12
  42. data/spec/lib/capistrano/configuration/server_spec.rb +19 -19
  43. data/spec/lib/capistrano/configuration/servers_spec.rb +101 -20
  44. data/spec/lib/capistrano/configuration_spec.rb +24 -3
  45. data/spec/lib/capistrano/dsl/task_enhancements_spec.rb +88 -0
  46. data/spec/lib/capistrano/dsl_spec.rb +2 -13
  47. data/spec/lib/capistrano/git_spec.rb +15 -4
  48. data/spec/lib/capistrano/hg_spec.rb +13 -2
  49. data/spec/lib/capistrano/scm_spec.rb +3 -3
  50. data/spec/lib/capistrano/svn_spec.rb +11 -1
  51. data/spec/lib/capistrano/upload_task_spec.rb +19 -0
  52. data/spec/lib/capistrano/version_validator_spec.rb +4 -4
  53. data/spec/spec_helper.rb +2 -1
  54. data/spec/support/Vagrantfile +1 -1
  55. data/spec/support/test_app.rb +2 -0
  56. metadata +45 -26
  57. data/lib/capistrano/configuration/servers/host_filter.rb +0 -82
  58. data/lib/capistrano/configuration/servers/role_filter.rb +0 -86
  59. data/spec/lib/capistrano/configuration/servers/host_filter_spec.rb +0 -84
  60. data/spec/lib/capistrano/configuration/servers/role_filter_spec.rb +0 -140
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89a96214d20583f07f6f4094f94235893bec7ee1
4
- data.tar.gz: 5744a684bea5aa5d11a400fb90159495e685c28f
3
+ metadata.gz: f5fec938fed98daad8d2ce764486a4b059095a1a
4
+ data.tar.gz: 5c46c098df29b9ea0f08a07db3270d83dcc598a3
5
5
  SHA512:
6
- metadata.gz: e23596ce8fd844d9292f92a4fc7c6a97feceb85ecdfce82eb6462822ffe456929a693b4fdfeb2261258a7b8dffd65960c69e3688e4a433021e5db4e1062588a2
7
- data.tar.gz: efc1d484e301975405fd1f7c3081ba0d2850e2dd8a64bcfbfc10b9f0b1dcbf1fea1e6e2e1cb07905327f984647c12ba798ad821198344fe9d30f8d1c291eeada
6
+ metadata.gz: ddfb0bdd5ea6266b25c6f96c02d466238f450ead5b4c47d13140c40db509ef92718dda37fefae01a364a812144d6cee16682be6ebfaa2274f1bdb558f218ff8f
7
+ data.tar.gz: f4e4fe76dacb08739437eaf3c83397f9119d8858ae23dff58b75c3325c380d0ca51cb995ebb26f00389aee9309a1eacad774bbf8c3da777c35640395715097b2
@@ -3,8 +3,10 @@ rvm:
3
3
  - 2.1.0
4
4
  - 2.0.0
5
5
  - 1.9.3
6
- - 1.9.2
7
- - rbx
6
+ - rbx-2
8
7
  script: bundle exec rake spec
8
+ install: bundle install --jobs=1
9
9
  cache: bundler
10
- bundler_args: --without cucumber
10
+ branches:
11
+ except:
12
+ - legacy-v2
@@ -4,10 +4,98 @@ Reverse Chronological Order:
4
4
 
5
5
  ## master
6
6
 
7
- https://github.com/capistrano/capistrano/compare/v3.2.0...HEAD
7
+ https://github.com/capistrano/capistrano/compare/v3.2.1...v3.3.0
8
+
9
+ ## `3.3.3`
10
+
11
+ https://github.com/capistrano/capistrano/compare/v3.2.1...v3.3.0
12
+
13
+ * Enhancement (@townsen)
14
+ * Added the variable `:repo_tree` which allows the specification of a sub-tree that
15
+ will be extracted from the repository. This is useful when deploying a project
16
+ that lives in a subdirectory of a larger repository.
17
+ Implemented only for git and hg.
18
+ If not defined then the behaviour is as previously and the whole repository is
19
+ extracted (subject to git-archive `.gitattributes` of course).
20
+
21
+ * Enhancement (@townsen): Remove unnecessary entries from default backtrace
22
+
23
+ When the `--backtrace` (or `--trace`) command line option is not supplied
24
+ Rake lowers the noise level in exception backtraces by building
25
+ a regular expression containing all the system library paths and
26
+ using it to exclude backtrace entries that match.
27
+
28
+ This does not always go far enough, particularly in RVM environments when
29
+ many gem paths are added. This commit reverses that approach and _only_
30
+ include backtrace entries that fall within the Capfile and list of tasks
31
+ imported thereafter. This makes reading exceptions much easier on the eye.
32
+
33
+ If the full unexpurgated backtrace is required then the --backtrace
34
+ and --trace options supply it as before.
35
+
36
+ * Disable loading stages configs on `cap -T`
37
+ * Track (anonymous) statistics, see https://github.com/capistrano/stats
38
+
39
+ * Enhancements (@townsen)
40
+ * Fix matching on hosts with custom ports or users set
41
+ * Previously filtering would affect any generated configuration files so that
42
+ files newly deployed would not be the same as those on the hosts previously
43
+ deployed (and now excluded by filters). This is almost certainly not what is
44
+ wanted: the filters should apply only to the on() method and thus any
45
+ configuration files deployed will be identical across the set of servers
46
+ making up the stage.
47
+ * Host and Role filtering now affects only `on()` commands
48
+ and not the `roles()`, `release_roles()` and `primary()` methods.
49
+ * This applies to filters defined via the command line, the environment
50
+ and the :filter variable.
51
+ * Filtering now supports Regular expressions
52
+ * This change _could_ cause existing scripts that use filtering and depend on
53
+ the old behaviour to fail, though it is unlikely. Users who rely on
54
+ filtering should check that generated configuration files are correct, and
55
+ where not introduce server properties to do the filtering. For example, if a
56
+ filter was used to specify an active subset of servers (by hostname), it should
57
+ be removed and replaced with an 'active' property (set to true or false) on the
58
+ server definitions. This keeps the stage file as the canonical model of the
59
+ deployment environment.
60
+
61
+ * See the documentation in the README.md file
62
+
63
+ * Enhancements (@townsen)
64
+ * Added set_if_empty method to DSL to allow conditional setting
65
+ * Altered standard Capistrano defaults so that they are not set
66
+ at the start of a stage if they have been previously set. This
67
+ allows variables like :default_env to be set in deploy.rb.
68
+ * Deep copy properties added using the 'roles' keyword
69
+ * If a property exists on a server when another definition is
70
+ encountered and is an Array, Set or Hash then add the new values
71
+
72
+ This allows roles to specify properties common to all servers and
73
+ then for individual servers to modify them, keeping things DRY
74
+
75
+ Breaking Changes:
76
+ * By using Ruby's noecho method introduced in Ruby version 1.9.3, we dropped support for Ruby versions prior to 1.9.3. See [issue #878](https://github.com/capistrano/capistrano/issues/878) and [PR #1112](https://github.com/capistrano/capistrano/pull/1112) for more information. (@kaikuchn)
77
+
78
+ * Bug Fixes:
79
+ * Fixed compatibility with FreeBSD tar (@robbertkl)
80
+ * remote_file can be used inside a namespace (@mikz)
81
+
82
+ * Minor Changes
83
+ * Remove -v flag from mkdir call. (@caligo-mentis)
84
+ * Capistrano now allows to customize `local_user` for revision log. (@sauliusgrigaitis)
85
+ * Added tests for after/before hooks features (@juanibiapina, @miry)
86
+ * Added `--force` flag to `svn export` command to fix errors when the release directory already exists.
87
+ * Improved the output of `cap --help`. (@mbrictson)
88
+ * Cucumber suite now runs on the latest version of Vagrant (@tpett)
89
+ * The `ask` method now supports the `echo: false` option. (@mbrictson, @kaikuchn)
90
+ * Cucumber scenario improvements (@bruno-)
91
+ * Added suggestion to Capfile to use 'capistrano-passenger' gem, replacing suggestion in config/deploy.rb to re-implement 'deploy:restart' (@betesh)
92
+ * Updated svn fetch_revision method to use `svnversion`
93
+ * `cap install` no longer overwrites existing files. (@dmarkow)
8
94
 
9
95
  ## `3.2.1`
10
96
 
97
+ https://github.com/capistrano/capistrano/compare/v3.2.0...v3.2.1
98
+
11
99
  * Bug Fixes:
12
100
  * 3.2.0 introduced some behaviour to modify the way before/after hooks were called, to allow the optional
13
101
  preservation of arguments to be passed to tasks. This release reverts that commit in order to restore
@@ -19,6 +107,7 @@ https://github.com/capistrano/capistrano/compare/v3.2.0...HEAD
19
107
  * Changed asking question to more standard format (like common unix commandline tools) (@sponomarev)
20
108
  * Fixed typos in the README. (@sponomarev)
21
109
  * Added `keys` method to Configuration to allow introspection of configuration options. (@juanibiapina)
110
+ * Improve error message when git:check fails (raise instead of silently `exit 1`) (@mbrictson)
22
111
 
23
112
  ## `3.2.0`
24
113
 
@@ -40,7 +129,8 @@ https://github.com/capistrano/capistrano/compare/v3.0.1...v3.1.0
40
129
  Breaking changes:
41
130
 
42
131
  * `deploy:restart` task **is no longer run by default**.
43
- From this version, developers who restart the app on each deploy need to declare it in their deploy flow (eg `after 'deploy:publishing', 'deploy:restart'`).
132
+ From this version, developers who restart the app on each deploy need to declare it in their deploy flow (eg `after 'deploy:publishing', 'deploy:restart'`)
133
+ or, for passenger applications, use the capistrano-passenger gem.
44
134
 
45
135
  Please, check https://github.com/capistrano/capistrano/commit/4e6523e1f50707499cf75eb53dce37a89528a9b0 for more information. (@kirs)
46
136
 
data/Gemfile CHANGED
@@ -4,10 +4,6 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  group :cucumber do
7
- gem 'kuroko'
8
7
  gem 'cucumber'
9
- end
10
-
11
- platforms :rbx do
12
- gem 'rubysl', '~> 2.0'
8
+ gem 'rspec', '~> 3.0.0'
13
9
  end
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # Capistrano [![Build Status](https://travis-ci.org/capistrano/capistrano.png?branch=v3)](https://travis-ci.org/capistrano/capistrano) [![Code Climate](https://codeclimate.com/github/capistrano/capistrano.png)](https://codeclimate.com/github/capistrano/capistrano) <a href="http://codersclan.net/?repo_id=325&source=small"><img src="http://www.codersclan.net/gs_button/?repo_id=325&size=small" width="69"></a>
1
+ # Capistrano [![Build Status](https://travis-ci.org/capistrano/capistrano.svg?branch=master)](https://travis-ci.org/capistrano/capistrano) [![Code Climate](http://img.shields.io/codeclimate/github/capistrano/capistrano.svg)](https://codeclimate.com/github/capistrano/capistrano) <a href="http://codersclan.net/?repo_id=325&source=small"><img src="http://img.shields.io/badge/get-support-blue.svg"></a>
2
2
 
3
3
  ## Requirements
4
4
 
5
- * Ruby >= 1.9 (JRuby and C-Ruby/YARV are supported)
5
+ * Ruby >= 1.9.3 (JRuby and C-Ruby/YARV are supported)
6
6
 
7
7
  ## Support
8
8
 
@@ -55,7 +55,7 @@ $ bundle exec cap install STAGES=local,sandbox,qa,production
55
55
  ## Usage
56
56
 
57
57
  ``` sh
58
- $ bundle exec cap -vT
58
+ $ bundle exec cap -T
59
59
 
60
60
  $ bundle exec cap staging deploy
61
61
  $ bundle exec cap production deploy
@@ -153,6 +153,11 @@ end
153
153
 
154
154
  Perfect, who needs telephones.
155
155
 
156
+ When using `ask` to get user input, you can pass `echo: false` to prevent the input from being displayed:
157
+
158
+ ```ruby
159
+ ask(:database_password, "default", echo: false)
160
+ ```
156
161
 
157
162
  ## Using password authentication
158
163
 
@@ -224,6 +229,13 @@ DEBUG [9ce34809] leehambley pts/0 2013-06-13 17:11 (port-11262.pppoe.wtn
224
229
  INFO [9ce34809] Finished in 0.420 seconds command successful.
225
230
  ```
226
231
 
232
+ ## VCS Requirements
233
+
234
+ Capistano requires modern versions of Git, Mercurial and Subversion
235
+ respectively (if you are using that particular VCS). Git Git requirement is at
236
+ least version 1.8.x. Mercurial and Subversion, any modern version should
237
+ suffice.
238
+
227
239
  ## A word about PTYs
228
240
 
229
241
  There is a configuration option which asks the backend driver to ask the remote host
@@ -252,6 +264,7 @@ The following variables are settable:
252
264
  | Variable Name | Description | Notes |
253
265
  |:---------------------:|----------------------------------------------------------------------|-----------------------------------------------------------------|
254
266
  | `:repo_url` | The URL of your scm repository (git, hg, svn) | file://, https://, ssh://, or svn+ssh:// are all supported |
267
+ | `:repo_tree` | The subtree of the scm repository to deploy (git, hg) | Only implemented for git and hg repos. Extract just this tree |
255
268
  | `:branch` | The branch you wish to deploy | This only has meaning for git and hg repos, to specify the branch of an svn repo, set `:repo_url` to the branch location. |
256
269
  | `:scm` | The source control system used | `:git`, `:hg`, `:svn` are currently supported |
257
270
  | `:tmp_dir` | The (optional) temp directory that will be used (default: /tmp) | if you have a shared web host, this setting may need to be set (i.e. /home/user/tmp/capistrano). |
@@ -262,6 +275,53 @@ __Support removed__ for following variables:
262
275
  |:---------------------:|---------------------------------------------------------------------|-----------------------------------------------------------------|
263
276
  | `:copy_exclude` | The (optional) array of files and/or folders excluded from deploy | Replaced by Git's native `.gitattributes`, see [#515](https://github.com/capistrano/capistrano/issues/515) for more info. |
264
277
 
278
+ ## Host and Role Filtering
279
+
280
+ Capistrano enables the declaration of servers and roles, each of which may have properties
281
+ associated with them. Tasks are then able to use these definitions in two distinct ways:
282
+
283
+ * To determine _configurations_: typically by using the `roles()`, `release_roles()` and
284
+ `primary()` methods. Typically these are used outside the scope of the `on()` method.
285
+
286
+ * To _interact_ with remote hosts using the `on()` method
287
+
288
+ An example of the two would be to create a `/etc/krb5.conf` file containing the list of
289
+ available KDC's by using the list of servers returned by `roles(:kdc)` and then uploading
290
+ it to all client machines using `on(roles(:all)) do upload!(file) end`
291
+
292
+ A problem with this arises when _filters_ are used. Filters are designed to limit the
293
+ actual set of hosts that are used to a subset of those in the overall stage, but how
294
+ should that apply in the above case?
295
+
296
+ If the filter applies to both the _interaction_ and _configuration_ aspects, any configuration
297
+ files deployed will not be the same as those on the hosts excluded by the filters. This is
298
+ almost certainly not what is wanted, the filters should apply only to the _interactions_
299
+ ensuring that any configuration files deployed will be identical across the stage.
300
+
301
+ Another type of filtering is done by defining properties on servers and selecting on that
302
+ basis. An example of that is the 'no_release' property and it's use in the
303
+ `release_roles()` method. To distinguish these two types of filtering we name them:
304
+
305
+ * On-Filtering
306
+ Specified in the following ways:
307
+ * Via environment variables HOSTS and ROLES
308
+ * Via command line options `--hosts` and `--roles`
309
+ * Via the `:filter` variable set in a stage file
310
+ * Property-Filtering
311
+ These are specified by options passed to the `roles()` method (and implicitly in methods
312
+ like `release_roles()` and `primary()`)
313
+
314
+ To increase the utility of On-Filters they can use regular expressions:
315
+ * If the host name in a filter doesn't match `/^[-A-Za-z0-9.]+$/` (the set of valid characters
316
+ for a DNS name) then it's assumed to be a regular expression.
317
+ * Since role names are Ruby symbols they can legitimately contain any characters. To allow multiple
318
+ of them to be specified on one line we use the comma. To use a regexp for a role filter begin
319
+ and end the string with '/'. These may not contain a comma.
320
+
321
+ When filters are specified using comma separated lists, the final filter is the _union_ of
322
+ all of the components. However when multiple filters are declared the result is the
323
+ _intersection_.
324
+
265
325
  ## SSHKit
266
326
 
267
327
  [SSHKit](https://github.com/leehambley/sshkit) is the driver for SSH
@@ -269,6 +329,27 @@ connections behind the scenes in Capistrano. Depending on how deep you dig, you
269
329
  might run into interfaces that come directly from SSHKit (the configuration is
270
330
  a good example).
271
331
 
332
+ ## Testing
333
+
334
+ Capistrano has two test suites: an RSpec suite and a Cucumber suite. The
335
+ RSpec suite handles quick feedback unit specs. The Cucumber features are
336
+ an integration suite that uses Vagrant to deploy to a real virtual
337
+ server. In order to run the Cucumber suite you will need to install
338
+ [Vagrant](http://www.vagrantup.com/) and Vagrant supported
339
+ virtualization software like
340
+ [VirtualBox](https://www.virtualbox.org/wiki/Downloads).
341
+
342
+ ```
343
+ # To run the RSpec suite
344
+ $ rake spec
345
+
346
+ # To run the Cucumber suite
347
+ $ rake features
348
+
349
+ # To run the Cucumber suite and leave the VM running (faster for subsequent runs)
350
+ $ rake features KEEP_RUNNING=1
351
+ ```
352
+
272
353
  ## License
273
354
 
274
355
  MIT License (MIT)
data/Rakefile CHANGED
@@ -1,5 +1,9 @@
1
1
  require "bundler/gem_tasks"
2
+ require "cucumber/rake/task"
3
+ require "rspec/core/rake_task"
2
4
 
3
5
  task :default => :spec
4
- require 'rspec/core/rake_task'
5
6
  RSpec::Core::RakeTask.new
7
+
8
+ Cucumber::Rake::Task.new(:features)
9
+
@@ -20,12 +20,16 @@ Gem::Specification.new do |gem|
20
20
  gem.licenses = ['MIT']
21
21
 
22
22
  gem.post_install_message = <<eos
23
- Capistrano 3.1 has some breaking changes, like `deploy:restart` callback should be added manually to your deploy.rb. Please, check the CHANGELOG: http://goo.gl/SxB0lr
23
+ Capistrano 3.1 has some breaking changes. Please check the CHANGELOG: http://goo.gl/SxB0lr
24
24
 
25
25
  If you're upgrading Capistrano from 2.x, we recommend to read the upgrade guide: http://goo.gl/4536kB
26
+
27
+ The `deploy:restart` hook for passenger applications is now in a separate gem called capistrano-passenger. Just add it to your Gemfile and require it in your Capfile.
26
28
  eos
27
29
 
30
+ gem.required_ruby_version = '>= 1.9.3'
28
31
  gem.add_dependency 'sshkit', '~> 1.3'
32
+ gem.add_dependency 'capistrano-stats', '~> 1.0.3'
29
33
  gem.add_dependency 'rake', '>= 10.0.0'
30
34
  gem.add_dependency 'i18n'
31
35
 
@@ -19,10 +19,12 @@ Feature: The path to the configuration can be changed, removing the need to
19
19
  Then the task is successful
20
20
  And contains "install" in the output
21
21
 
22
- Scenario: Show install task with configuration in a custom location
23
- And config stage file has line "desc 'Special Task'"
24
- And config stage file has line "task :special_stage_task"
25
- But the configuration is in a custom location
26
- When I run "cap -T"
27
- Then the task is successful
28
- And contains "special_stage_task" in the output
22
+ # Feature disabled because this is not how it works, we don't load
23
+ # tasks from stage files, as we expect them to be defined in ./lib/tasks
24
+ # Scenario: Show install task with configuration in a custom location
25
+ # And config stage file has line "desc 'Special Task'"
26
+ # And config stage file has line "task :special_stage_task"
27
+ # But the configuration is in a custom location
28
+ # When I run "cap -T"
29
+ # Then the task is successful
30
+ # And contains "special_stage_task" in the output
@@ -6,7 +6,8 @@ Feature: Deploy
6
6
 
7
7
  Scenario: Creating the repo
8
8
  When I run cap "git:check"
9
- Then references in the remote repo are listed
9
+ Then the task is successful
10
+ And references in the remote repo are listed
10
11
 
11
12
  Scenario: Creating the directory structure
12
13
  When I run cap "deploy:check:directories"
@@ -22,16 +23,16 @@ Feature: Deploy
22
23
  Then directories referenced in :linked_files are created in shared
23
24
 
24
25
  Scenario: Checking linked files - missing file
25
- Given a required file
26
- But the file does not exist
26
+ Given a linked file "missing_file.txt"
27
+ But file "missing_file.txt" does not exist in shared path
27
28
  When I run cap "deploy:check:linked_files"
28
- Then the task will exit
29
+ Then the task fails
29
30
 
30
31
  Scenario: Checking linked files - file exists
31
- Given a required file
32
- And that file exists
32
+ Given a linked file "existing_file.txt"
33
+ And file "existing_file.txt" exists in shared path
33
34
  When I run cap "deploy:check:linked_files"
34
- Then the task will be successful
35
+ Then the task is successful
35
36
 
36
37
  Scenario: Creating a release
37
38
  Given I run cap "deploy:check:directories"
@@ -40,7 +41,7 @@ Feature: Deploy
40
41
  And the release is created
41
42
 
42
43
  Scenario: Symlink linked files
43
- When I run cap "deploy:symlink:linked_files" as part of a release
44
+ When I run cap "deploy:symlink:linked_files deploy:symlink:release" as part of a release
44
45
  Then file symlinks are created in the new release
45
46
 
46
47
  Scenario: Symlink linked dirs
@@ -1,4 +1,5 @@
1
1
  Then(/^references in the remote repo are listed$/) do
2
+ expect(@output).to include('refs/heads/master')
2
3
  end
3
4
 
4
5
  Then(/^the shared path is created$/) do
@@ -22,13 +23,6 @@ Then(/^directories referenced in :linked_files are created in shared$/) do
22
23
  end
23
24
  end
24
25
 
25
- Then(/^the task will be successful$/) do
26
- end
27
-
28
-
29
- Then(/^the task will exit$/) do
30
- end
31
-
32
26
  Then(/^the repo is cloned$/) do
33
27
  run_vagrant_command(test_dir_exists(TestApp.repo_path))
34
28
  end
@@ -38,9 +32,8 @@ Then(/^the release is created$/) do
38
32
  end
39
33
 
40
34
  Then(/^file symlinks are created in the new release$/) do
41
- pending
42
35
  TestApp.linked_files.each do |file|
43
- run_vagrant_command(test_symlink_exists(TestApp.release_path.join(file)))
36
+ run_vagrant_command(test_symlink_exists(TestApp.current_path.join(file)))
44
37
  end
45
38
  end
46
39
 
@@ -57,26 +50,26 @@ end
57
50
 
58
51
  Then(/^the deploy\.rb file is created$/) do
59
52
  file = TestApp.test_app_path.join('config/deploy.rb')
60
- expect(File.exists?(file)).to be_true
53
+ expect(File.exists?(file)).to be true
61
54
  end
62
55
 
63
56
  Then(/^the default stage files are created$/) do
64
57
  staging = TestApp.test_app_path.join('config/deploy/staging.rb')
65
58
  production = TestApp.test_app_path.join('config/deploy/production.rb')
66
- expect(File.exists?(staging)).to be_true
67
- expect(File.exists?(production)).to be_true
59
+ expect(File.exists?(staging)).to be true
60
+ expect(File.exists?(production)).to be true
68
61
  end
69
62
 
70
63
  Then(/^the tasks folder is created$/) do
71
64
  path = TestApp.test_app_path.join('lib/capistrano/tasks')
72
- expect(Dir.exists?(path)).to be_true
65
+ expect(Dir.exists?(path)).to be true
73
66
  end
74
67
 
75
68
  Then(/^the specified stage files are created$/) do
76
69
  qa = TestApp.test_app_path.join('config/deploy/qa.rb')
77
70
  production = TestApp.test_app_path.join('config/deploy/production.rb')
78
- expect(File.exists?(qa)).to be_true
79
- expect(File.exists?(production)).to be_true
71
+ expect(File.exists?(qa)).to be true
72
+ expect(File.exists?(production)).to be true
80
73
  end
81
74
 
82
75
  Then(/^it creates the file with the remote_task prerequisite$/) do
@@ -90,7 +83,11 @@ Then(/^it will not recreate the file$/) do
90
83
  end
91
84
 
92
85
  Then(/^the task is successful$/) do
93
- expect(@success).to be_true
86
+ expect(@success).to be true
87
+ end
88
+
89
+ Then(/^the task fails$/) do
90
+ expect(@success).to be_falsey
94
91
  end
95
92
 
96
93
  Then(/^the failure task will run$/) do
@@ -100,7 +97,8 @@ end
100
97
 
101
98
  Then(/^the failure task will not run$/) do
102
99
  failed = TestApp.shared_path.join('failed')
103
- !run_vagrant_command(test_file_exists(failed))
100
+ expect { run_vagrant_command(test_file_exists(failed)) }
101
+ .to raise_error(VagrantHelpers::VagrantSSHCommandError)
104
102
  end
105
103
 
106
104
  When(/^an error is raised$/) do