-
Notifications
You must be signed in to change notification settings - Fork 365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rake docs:generate should generate order docs #113
Conversation
pass `--order default` args to internal rspec command so that documentation is generated in the same order as it comes in the spec files.
Oh wait. After digging about in the code a bit, I found the |
Actually, |
I'm not entirely sure I like this change. You're more than welcome to create your own task that does this, but I don't think out of the box we should ignore the random order rspec gives you. |
That's an interesting perspective that I hadn't expected. Why would you want your documentation generated in random order? |
The documentation can be presented in whatever order we want, but these are also tests. And as tests we want to make sure they are separate and not required to run in the order we write them in. |
would you be interested in incorporating an additional Raketask like desc 'Generate API request documentation from API specs'
RSpec::Core::RakeTask.new('docs:generate:ordered') do |t|
t.pattern = 'spec/acceptance/**/*_spec.rb'
t.rspec_opts = ["--format RspecApiDocumentation::ApiFormatter", "--order default"]
end It think this would be useful to other people who want more control over the look and feel of their documentation. If this isn't interesting to you, I can just stick it in my own Rakefile. But I suspect there are other folks who would like it. |
I can get behind a separate task. Everyone is happy then. |
I like the idea of being able to control the order of the docs, but I also like the idea of writing tests that don't rely on the order. Seems like this accomplishes both if I'm not mistaken. Running all rspec tests will run API tests in random order, but running rake db:generate:ordered will create docs in order. Do I have that right? |
That sounds right to me. |
pass
--order default
args to internal rspec command so that documentation is generated in the same order as it comes in the spec files.