README.md in smashing_docs-1.1.0 vs README.md in smashing_docs-1.2.0
- old
+ new
@@ -8,32 +8,36 @@
`gem 'smashing_docs', '~> 0.0.3'`
Installation differs for RSpec/Minitest, so scroll to the appropriate section for guidance.
-## Automatic Installation (RSpec only!)
+## Automatic Installation (RSpec or Minitest!)
After you bundle, run:
`rails generate smashing_documentation:install`
SmashingDocs will be configured to run on all your controller tests with the default
template.
+If you're using RSpec and you haven't required `rails_helper` in your tests, do that now.
+
+`require 'rails_helper'`
+
#### To generate your docs
-Run `rails g smashing_documentation:build_docs`, and your docs will be waiting for you
-in the `smashing_docs` folder.
+Run `rails g smashing_documentation:build_docs`, and your docs will be waiting for you in the `smashing_docs` folder.
## Manual RSpec Installation
Add this to your `rails_helper.rb` It should go outside of other blocks
(Do not place it inside the `RSpec.configure` block).
```ruby
SmashingDocs.config do |c|
c.template_file = 'smashing_docs/template.md'
c.output_file = 'smashing_docs/api_docs.md'
+ c.auto_push = false
c.run_all = true
end
```
Add the following content to `spec_helper.rb` inside the `RSpec.configure` block
@@ -55,10 +59,11 @@
Set the `c.run_all` line to `false` in `rails_helper.rb`
```ruby
SmashingDocs.config do |c|
c.template_file = 'smashing_docs/template.md'
c.output_file = 'smashing_docs/api_docs.md'
+ c.auto_push = false
c.run_all = false
end
```
Then just add `SmashingDocs.run!(request, response)` to the tests you want to run
@@ -77,10 +82,11 @@
class ActiveSupport::TestCase
# Already existing code
SmashingDocs.config do |c|
c.template_file = 'smashing_docs/template.md'
c.output_file = 'smashing_docs/api_docs.md'
+ c.auto_push = false
c.run_all = true
end
# More code
end
@@ -97,9 +103,10 @@
Set the `c.run_all` line to `false` in `test_helper.rb`
```ruby
SmashingDocs.config do |c|
c.template_file = 'smashing_docs/template.md'
c.output_file = 'smashing_docs/api_docs.md'
+ c.auto_push = false
c.run_all = false
end
```
Then just add `SmashingDocs.run!(request, response)` to specific tests