aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/testing
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2013-06-19 13:00:38 +0200
committerYves Senn <yves.senn@gmail.com>2013-06-19 13:00:38 +0200
commit615ad884579f416a7cfcd685a9aa9d124ab72a7a (patch)
treed778b0f5d20f249d197fc0178c5e969b3372ddf9 /activesupport/lib/active_support/testing
parentb8f6fccae3af30fa2ee612e8cff4c2243e95e24f (diff)
downloadrails-615ad884579f416a7cfcd685a9aa9d124ab72a7a.tar.gz
rails-615ad884579f416a7cfcd685a9aa9d124ab72a7a.tar.bz2
rails-615ad884579f416a7cfcd685a9aa9d124ab72a7a.zip
better documentation for `AS::Testing::Declarative#test`. [ci skip]
Diffstat (limited to 'activesupport/lib/active_support/testing')
-rw-r--r--activesupport/lib/active_support/testing/declarative.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/testing/declarative.rb b/activesupport/lib/active_support/testing/declarative.rb
index 508e37254a..1fa73caefa 100644
--- a/activesupport/lib/active_support/testing/declarative.rb
+++ b/activesupport/lib/active_support/testing/declarative.rb
@@ -19,9 +19,12 @@ module ActiveSupport
end
unless defined?(Spec)
- # test "verify something" do
- # ...
- # end
+ # Helper to define a test method using a String. Under the hood, it replaces
+ # spaces with underscores and defines the test method.
+ #
+ # test "verify something" do
+ # ...
+ # end
def test(name, &block)
test_name = "test_#{name.gsub(/\s+/,'_')}".to_sym
defined = instance_method(test_name) rescue false