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

allow the default format to be configurable #69

Closed
wants to merge 1 commit into from
Closed

allow the default format to be configurable #69

wants to merge 1 commit into from

Conversation

DonSchado
Copy link
Contributor

While dealing with a legacy code base, I found this gem pretty handy. :)

This change pulls out the hard coded :txt default and makes it configurable,
so that you don’t have to explicitly tell #verify all the time which format to use,
while the old behavior will still be the fallback.

I'm looking forward to your feedback.
Let me know if there is anything I missed here.

This change pulls out the hard coded `:txt` default and makes it configurable,
so that you don’t have to explicitly tell `#verify` all the time which format to use,
while the old behavior will still be the fallback.
@@ -15,8 +15,7 @@ def configuration
class Configuration
include Singleton

attr_writer :approvals_path
attr_writer :excluded_json_keys
attr_writer :approvals_path, :excluded_json_keys, :default_format
Copy link
Contributor

Choose a reason for hiding this comment

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

I like this style less, because of risk of incidental change:
http://www.rubytapas.com/episodes/24-Incidental-Change?filter=free

@markijbema
Copy link
Contributor

I'm a bit confused; you can already configure this in rspec, see for instance:
https://github.com/Factlink/factlink-core/blob/57a7bdbceba9c5e5836ee46515ce9321710cb83e/spec/spec_helper.rb#L39

Isn't this exposed if you don't use RSpec?

@DonSchado
Copy link
Contributor Author

hey @markijbema. thanks for your feedback.

Cool, didn't know about this configuration through rspec.
I would recommend then to document this in the readme, instead of using this change here.

thx

@DonSchado DonSchado closed this Oct 26, 2015
@markijbema
Copy link
Contributor

Totally agree, I think the readme could use some work; if you would have time to make a PR that would be great!

@markijbema
Copy link
Contributor

Also, do I understand correctly (been a while since I used approvals) that there are two ways to configure Approvals? That is suboptimal at least imho.

@kytrinyx
Copy link
Contributor

There might be... I wrote this thing so long ago, and originally made it as an RSpec plugin, until I realized that this was a terrible idea and extracted the approvals part so it could stand alone (especially nice since I use minitest more than I do rspec).

It would be worth investigating and fixing, for sure. I'll open an issue.

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