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

Separate the fetching and loading of rates #15

Merged
merged 11 commits into from Sep 21, 2020

Conversation

jonallured
Copy link
Collaborator

This PR does a little bit of refactoring so that I could more cleanly fetch remote rates and then load and get them. I renamed the OpenExchangeRatesLoader to OpenExchangeRatesFetcher to sync up with this change. I also removed it from the Money namespace because it's sorta unrelated - it's just a class that can compute URLs and make http requests.

Another side effect of this work was a cleaner surface to add unit tests for this fetcher! I added a file for it and then wrote up the three tests that seemed most obvious to me. Then I went to the existing test file and made that one more of an integration test.

I found that the fixture data checked into the repo was from 2011-10-18 by doing this:

# found this timestamp in the json file:
Time.at(1318931535)
# => 2011-10-18 04:52:15 -0500

So then I just moved the file into a fixtures folder and renamed it to be more clear about what it is and it's purpose.

Note: this diff is big because I did the work on top of #14. Once that PR is merged, then I'll come back to this one and rebase and then it'll be much more sensible! Then I'll take off the WIP from the title and it can be merged.

@jonallured jonallured self-assigned this Sep 14, 2020
@jonallured jonallured changed the title WIP: Refactor a bit Separate the fetching and loading of rates Sep 18, 2020
@jonallured jonallured assigned atwam and unassigned jonallured Sep 18, 2020
@jonallured
Copy link
Collaborator Author

Update: ok this was rebased and is good for review and merge! 👍

@atwam atwam merged commit 6427bd9 into atwam:master Sep 21, 2020
@jonallured jonallured deleted the refactor-a-bit branch September 21, 2020 17:36
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.

None yet

2 participants