1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00
capistrano/test/configuration_test.rb
Jamis Buck 8e33fdc46b getting started on cap 2.0
git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@6243 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-26 23:59:33 +00:00

35 lines
1,019 B
Ruby

$:.unshift File.dirname(__FILE__) + "/../lib"
require 'test/unit'
require 'capistrano/configuration'
class ConfigurationTest < Test::Unit::TestCase
def setup
@config = Capistrano::Configuration.new
end
def test_task_without_options
block = Proc.new { }
@config.task :hello, &block
assert_equal 1, @config.actor.tasks.length
assert_equal :hello, @config.actor.tasks[0][0]
assert_equal({}, @config.actor.tasks[0][1])
assert_equal block, @config.actor.tasks[0][2]
end
def test_task_with_options
block = Proc.new { }
@config.task :hello, :roles => :app, &block
assert_equal 1, @config.actor.tasks.length
assert_equal :hello, @config.actor.tasks[0][0]
assert_equal({:roles => :app}, @config.actor.tasks[0][1])
assert_equal block, @config.actor.tasks[0][2]
end
def test_task_description
block = Proc.new { }
@config.desc "A sample task"
@config.task :hello, &block
assert_equal "A sample task", @config.actor.tasks[0][1][:desc]
end
end