aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Dupret <robin.dupret@gmail.com>2015-08-16 14:14:45 +0200
committerRobin Dupret <robin.dupret@gmail.com>2015-08-16 14:16:20 +0200
commitb803798b9d168b47a23343ee17d3ef01e986a399 (patch)
tree3a7822b0ee7dfc58ddda90c6f9814b46bf758d4c
parentfe19d07138fe69e05ce8b17534c3c548a0a92575 (diff)
downloadrails-b803798b9d168b47a23343ee17d3ef01e986a399.tar.gz
rails-b803798b9d168b47a23343ee17d3ef01e986a399.tar.bz2
rails-b803798b9d168b47a23343ee17d3ef01e986a399.zip
Tiny documentation fixes [ci skip]
* Add missing `def` and remove useless `do` keywords. * Move `:nodoc:` in front of the methods' definition so that methods under these ones are correctly visible on the API.
-rw-r--r--guides/source/testing.md4
-rw-r--r--railties/lib/rails/paths.rb6
2 files changed, 4 insertions, 6 deletions
diff --git a/guides/source/testing.md b/guides/source/testing.md
index 943074a3d4..0f24bd0311 100644
--- a/guides/source/testing.md
+++ b/guides/source/testing.md
@@ -530,7 +530,7 @@ Let me take you through one such test, `test_should_get_index` from the file `ar
```ruby
# articles_controller_test.rb
class ArticlesControllerTest < ActionController::TestCase
- test_should_get_index do
+ def test_should_get_index
get :index
assert_response :success
assert_includes @response.body, 'Articles'
@@ -572,7 +572,7 @@ NOTE: If you try running `test_should_create_article` test from `articles_contro
Let us modify `test_should_create_article` test in `articles_controller_test.rb` so that all our test pass:
```ruby
-test_should_create_article do
+def test_should_create_article
assert_difference('Article.count') do
post :create, params: { article: { title: 'Some title' } }
end
diff --git a/railties/lib/rails/paths.rb b/railties/lib/rails/paths.rb
index 8a7aa6f50a..e47616a87f 100644
--- a/railties/lib/rails/paths.rb
+++ b/railties/lib/rails/paths.rb
@@ -123,8 +123,7 @@ module Rails
options[:load_path] ? load_path! : skip_load_path!
end
- # :nodoc:
- def absolute_current
+ def absolute_current # :nodoc:
File.expand_path(@current, @root.path)
end
@@ -180,8 +179,7 @@ module Rails
@paths
end
- # :nodoc:
- def extensions
+ def extensions # :nodoc:
$1.split(',') if @glob =~ /\{([\S]+)\}/
end