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

New configuration option to always record examples. #239

Merged
merged 1 commit into from
May 12, 2014
Merged

New configuration option to always record examples. #239

merged 1 commit into from
May 12, 2014

Conversation

arathunku
Copy link
Contributor

In current project I'm working on, I've stumbled into the problem not being able to start examples/params recording from spec_helper.rb. I want my examples to be always up-to-date without the burden of remembering to run tests with APIPIE_RECORD env.

This PR adds method Apipie.record which can be used in spec_helper.rb or test_helper.rb to start examples recording without using APIPIE_RECORD env.

initializer 'apipie.extractor' do |app|
ActiveSupport.on_load :action_controller do
before_filter do |controller|
Apipie::Extractor.call_recorder.analyse_controller(controller)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add

if Apipie.configuration.record

here as well, to avoid unnecessary calls when not needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, fixed.

I've update the branch, with push -f, hope you don't mind

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Np, thanks!

Method to start recording examples without ENV['APIPIE_RECORD'].
iNecas added a commit that referenced this pull request May 12, 2014
…es-from-tests

New configuration option to always record examples.
@iNecas iNecas merged commit b77e510 into Apipie:master May 12, 2014
@arathunku arathunku deleted the feature/start-recording-examples-from-tests branch May 12, 2014 08:02
@iNecas
Copy link
Member

iNecas commented May 12, 2014

apipie-rails 0.2.0 released

@arathunku
Copy link
Contributor Author

Great! Do you have any roadmap for changes in future versions?

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.

2 participants