mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
configuration respond_to? should take strings
This commit is contained in:
parent
fec72c8aa3
commit
f8ff1a758d
2 changed files with 8 additions and 2 deletions
|
@ -112,7 +112,7 @@ module Capistrano
|
|||
private :protect
|
||||
|
||||
def respond_to_with_variables?(sym, include_priv=false) #:nodoc:
|
||||
@variables.has_key?(sym) || respond_to_without_variables?(sym, include_priv)
|
||||
@variables.has_key?(sym.to_sym) || respond_to_without_variables?(sym, include_priv)
|
||||
end
|
||||
|
||||
def method_missing_with_variables(sym, *args, &block) #:nodoc:
|
||||
|
@ -124,4 +124,4 @@ module Capistrano
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -54,6 +54,12 @@ class ConfigurationVariablesTest < Test::Unit::TestCase
|
|||
assert @config.respond_to?(:sample)
|
||||
end
|
||||
|
||||
def test_respond_to_should_be_true_when_passed_a_string
|
||||
assert !@config.respond_to?('sample')
|
||||
@config[:sample] = :value
|
||||
assert @config.respond_to?('sample')
|
||||
end
|
||||
|
||||
def test_respond_to_with_include_priv_paramter
|
||||
assert !@config.respond_to?(:sample, true)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue