mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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.
This commit is contained in:
parent
fe19d07138
commit
b803798b9d
2 changed files with 4 additions and 6 deletions
|
@ -530,7 +530,7 @@ Let me take you through one such test, `test_should_get_index` from the file `ar
|
||||||
```ruby
|
```ruby
|
||||||
# articles_controller_test.rb
|
# articles_controller_test.rb
|
||||||
class ArticlesControllerTest < ActionController::TestCase
|
class ArticlesControllerTest < ActionController::TestCase
|
||||||
test_should_get_index do
|
def test_should_get_index
|
||||||
get :index
|
get :index
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_includes @response.body, 'Articles'
|
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:
|
Let us modify `test_should_create_article` test in `articles_controller_test.rb` so that all our test pass:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
test_should_create_article do
|
def test_should_create_article
|
||||||
assert_difference('Article.count') do
|
assert_difference('Article.count') do
|
||||||
post :create, params: { article: { title: 'Some title' } }
|
post :create, params: { article: { title: 'Some title' } }
|
||||||
end
|
end
|
||||||
|
|
|
@ -123,8 +123,7 @@ module Rails
|
||||||
options[:load_path] ? load_path! : skip_load_path!
|
options[:load_path] ? load_path! : skip_load_path!
|
||||||
end
|
end
|
||||||
|
|
||||||
# :nodoc:
|
def absolute_current # :nodoc:
|
||||||
def absolute_current
|
|
||||||
File.expand_path(@current, @root.path)
|
File.expand_path(@current, @root.path)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -180,8 +179,7 @@ module Rails
|
||||||
@paths
|
@paths
|
||||||
end
|
end
|
||||||
|
|
||||||
# :nodoc:
|
def extensions # :nodoc:
|
||||||
def extensions
|
|
||||||
$1.split(',') if @glob =~ /\{([\S]+)\}/
|
$1.split(',') if @glob =~ /\{([\S]+)\}/
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue