Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 332ae8fc5800d43fd75f6ca8e678a9314dcb6508 2 parents 5bd6435 + f8ff1a7
@leehambley leehambley authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.