From f8ff1a758dec631e73f93e087d31e40a336b5420 Mon Sep 17 00:00:00 2001 From: Nick Howard Date: Thu, 24 Feb 2011 16:19:49 -0700 Subject: [PATCH] configuration respond_to? should take strings --- lib/capistrano/configuration/variables.rb | 4 ++-- test/configuration/variables_test.rb | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/capistrano/configuration/variables.rb b/lib/capistrano/configuration/variables.rb index 43bf18a7..9ab1ac30 100644 --- a/lib/capistrano/configuration/variables.rb +++ b/lib/capistrano/configuration/variables.rb @@ -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 \ No newline at end of file +end diff --git a/test/configuration/variables_test.rb b/test/configuration/variables_test.rb index 2c68b380..d5dd1fd9 100644 --- a/test/configuration/variables_test.rb +++ b/test/configuration/variables_test.rb @@ -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