Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

marshally
Copy link
Contributor

pass --order default args to internal rspec command so that documentation is generated in the same order as it comes in the spec files.

pass `--order default` args to internal rspec command so that documentation is generated in the same order as it comes in the spec files.
@marshally
Copy link
Contributor Author

Oh wait. After digging about in the code a bit, I found the config.keep_source_order flag. Nevermind.

@marshally marshally closed this Feb 6, 2014
@marshally marshally reopened this Feb 6, 2014
@marshally
Copy link
Contributor Author

Actually, config.keep_source_order doesn't work as I thought. Re-opening for discussion.

@oestrich
Copy link
Contributor

oestrich commented Feb 6, 2014

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.

@marshally
Copy link
Contributor Author

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?

@oestrich
Copy link
Contributor

oestrich commented Feb 6, 2014

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.

@marshally
Copy link
Contributor Author

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.

@oestrich
Copy link
Contributor

oestrich commented Feb 6, 2014

I can get behind a separate task. Everyone is happy then.

@curtisolson
Copy link

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?

@oestrich
Copy link
Contributor

oestrich commented Mar 4, 2014

That sounds right to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants