1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00

Merge branch 'add-str-support-to-respond_to' of https://github.com/baroquebobcat/capistrano into baroquebobcat-add-str-support-to-respond_to

* 'add-str-support-to-respond_to' of https://github.com/baroquebobcat/capistrano:
  configuration respond_to? should take strings
This commit is contained in:
Lee Hambley 2011-03-16 20:39:52 +01:00
commit 332ae8fc58
2 changed files with 8 additions and 2 deletions

View file

@ -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:

View file

@ -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