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

36 lines
1,019 B
Ruby
Raw Normal View History

$:.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