-
Notifications
You must be signed in to change notification settings - Fork 44
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
Conversation
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 |
There was a problem hiding this comment.
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
I'm a bit confused; you can already configure this in rspec, see for instance: Isn't this exposed if you don't use RSpec? |
hey @markijbema. thanks for your feedback. Cool, didn't know about this configuration through rspec. thx |
Totally agree, I think the readme could use some work; if you would have time to make a PR that would be great! |
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. |
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. |
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.