From 615ad884579f416a7cfcd685a9aa9d124ab72a7a Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Wed, 19 Jun 2013 13:00:38 +0200 Subject: better documentation for `AS::Testing::Declarative#test`. [ci skip] --- activesupport/lib/active_support/testing/declarative.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'activesupport/lib/active_support/testing') 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 -- cgit v1.2.3