-
Notifications
You must be signed in to change notification settings - Fork 619
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
Set Money.default_currency to nil. #868
Set Money.default_currency to nil. #868
Conversation
39c3bba
to
bfc017e
Compare
15b015e
to
633f0b1
Compare
633f0b1
to
bd2b050
Compare
spec/money_spec.rb
Outdated
@@ -181,29 +181,35 @@ | |||
end | |||
|
|||
it "accepts an optional currency" do |
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.
You should probably split these tests into context — with a default_currency
set and with it being nil, because the behaviour is different. From what I can tell right now a case when a default_currency
is nil
and you initialize it without a currency is untested.
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.
You should probably split these tests into context — with a
default_currency
set and with it being nil, because the behaviour is different. From what I can tell right now a case when adefault_currency
isnil
and you initialize it without a currency is untested.
these tests being, for Money.from_amount
or for others such as Money#amount
etc? 🤓
I have added two more contexts in .from_amount
's block.
@thealiilman thanks for looking at this! I've left some comments |
d859bdd
to
3530762
Compare
Thanks for the feedback @antstorm! I've pushed the changes based on your comments, also left a question regarding splitting the tests into contexts. 🙂 |
3530762
to
757249b
Compare
Looks great, thank you! 👍 |
This PR closes #855.