Release 2.7.0
A fairly substantial release. There are fixes so that current_release
works
during dry-runs, (although, apparently still not with bundler.)
The test-suite was also modified to work with Ruby 1.9.2, except in one
case
where Ruby 1.9.x calls `to_ary` and `to_a` on mocks, which still makes
an
error. 1.9.x has always been supported, but due to lack of maintenance
on my
part the tests didn't ever pass.
The `start`, `stop` and `restart` tasks have been reduced to mere hooks
into
which extensions can define their own functionality.
The `readme` was also slightly improved, simply tweaks to express how
best to
run the test suite.
* Ensure dry-run works with `:current_release` variable (Carol Nichols)
* Added a new variable `:git_submodules_recursive`, setting the value to
* false
will ensure Git doesn't recursively initialize and checkout submodules.
(Konstantin Kudryashov)
* Added an additional task option, `:on_no_matching_servers`, setting
* the
value to `:continue` will ensure tasks with no matched servers continue
without error, instead of raising `Capistrano::NoMatchingServersError`
as was
the previous behaviour. (Chris Griego)
A huge thanks to all contributors, as always!
Remember: @capistranorb on twitter for news.
2011-08-03 02:11:19 +02:00
|
|
|
require 'rubygems'
|
|
|
|
require 'bundler/setup'
|
2006-01-28 15:58:04 +00:00
|
|
|
|
2008-04-25 09:21:12 -06:00
|
|
|
require 'test/unit'
|
|
|
|
require 'mocha'
|
Release 2.7.0
A fairly substantial release. There are fixes so that current_release
works
during dry-runs, (although, apparently still not with bundler.)
The test-suite was also modified to work with Ruby 1.9.2, except in one
case
where Ruby 1.9.x calls `to_ary` and `to_a` on mocks, which still makes
an
error. 1.9.x has always been supported, but due to lack of maintenance
on my
part the tests didn't ever pass.
The `start`, `stop` and `restart` tasks have been reduced to mere hooks
into
which extensions can define their own functionality.
The `readme` was also slightly improved, simply tweaks to express how
best to
run the test suite.
* Ensure dry-run works with `:current_release` variable (Carol Nichols)
* Added a new variable `:git_submodules_recursive`, setting the value to
* false
will ensure Git doesn't recursively initialize and checkout submodules.
(Konstantin Kudryashov)
* Added an additional task option, `:on_no_matching_servers`, setting
* the
value to `:continue` will ensure tasks with no matched servers continue
without error, instead of raising `Capistrano::NoMatchingServersError`
as was
the previous behaviour. (Chris Griego)
A huge thanks to all contributors, as always!
Remember: @capistranorb on twitter for news.
2011-08-03 02:11:19 +02:00
|
|
|
|
2008-04-25 09:21:12 -06:00
|
|
|
require 'capistrano/server_definition'
|
2013-04-25 14:03:44 +05:30
|
|
|
require 'pry'
|
2007-04-01 04:20:33 +00:00
|
|
|
|
2008-04-25 09:21:12 -06:00
|
|
|
module TestExtensions
|
|
|
|
def server(host, options={})
|
|
|
|
Capistrano::ServerDefinition.new(host, options)
|
|
|
|
end
|
2007-04-01 04:20:33 +00:00
|
|
|
|
2008-04-25 09:21:12 -06:00
|
|
|
def namespace(fqn=nil)
|
|
|
|
space = stub(:roles => {}, :fully_qualified_name => fqn, :default_task => nil)
|
|
|
|
yield(space) if block_given?
|
|
|
|
space
|
|
|
|
end
|
2007-04-01 04:20:33 +00:00
|
|
|
|
2008-04-25 09:21:12 -06:00
|
|
|
def role(space, name, *args)
|
|
|
|
opts = args.last.is_a?(Hash) ? args.pop : {}
|
|
|
|
space.roles[name] ||= []
|
|
|
|
space.roles[name].concat(args.map { |h| Capistrano::ServerDefinition.new(h, opts) })
|
2006-01-28 15:58:04 +00:00
|
|
|
end
|
|
|
|
|
2008-04-25 09:21:12 -06:00
|
|
|
def new_task(name, namespace=@namespace, options={}, &block)
|
|
|
|
block ||= Proc.new {}
|
|
|
|
task = Capistrano::TaskDefinition.new(name, namespace, options, &block)
|
|
|
|
assert_equal block, task.body
|
|
|
|
return task
|
2005-08-13 18:36:02 +00:00
|
|
|
end
|
2007-04-11 19:12:11 +00:00
|
|
|
end
|
2008-04-25 09:21:12 -06:00
|
|
|
|
|
|
|
class Test::Unit::TestCase
|
|
|
|
include TestExtensions
|
|
|
|
end
|