Skip to content
Browse files

Merge branch 'add-str-support-to-respond_to' of https://github.com/ba…

…roquebobcat/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
  • Loading branch information...
2 parents 5bd6435 + f8ff1a7 commit 332ae8fc5800d43fd75f6ca8e678a9314dcb6508 @leehambley leehambley committed Mar 16, 2011
Showing with 8 additions and 2 deletions.
  1. +2 −2 lib/capistrano/configuration/variables.rb
  2. +6 −0 test/configuration/variables_test.rb
View
4 lib/capistrano/configuration/variables.rb
@@ -112,7 +112,7 @@ def protect(variable)
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 @@ def method_missing_with_variables(sym, *args, &block) #:nodoc:
end
end
end
-end
+end
View
6 test/configuration/variables_test.rb
@@ -54,6 +54,12 @@ def test_respond_to_should_look_for_variables
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

0 comments on commit 332ae8f

Please sign in to comment.
Something went wrong with that request. Please try again.