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

Export TestDouble issue #35 #36

Merged
merged 15 commits into from
Apr 3, 2020
Merged

Export TestDouble issue #35 #36

merged 15 commits into from
Apr 3, 2020

Conversation

nelsonic
Copy link
Member

@nelsonic nelsonic commented Apr 2, 2020

As discussed in #35 I'm not a fan of having to duplicate Mock versions of the OAuth functions.
This PR introduces a transparent TestDouble which means the Auth App (and any other people) using this module no longer need to think about Mocking the requests.
I think this will greatly improve the UX and our maintainability.

@nelsonic nelsonic added the enhancement New feature or request label Apr 2, 2020
@nelsonic nelsonic self-assigned this Apr 2, 2020
@codecov
Copy link

codecov bot commented Apr 2, 2020

Codecov Report

Merging #36 into master will not change coverage by %.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #36   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           16        17    +1     
=========================================
+ Hits            16        17    +1     
Impacted Files Coverage Δ
lib/elixir_auth_google.ex 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6475166...2c653ee. Read the comment docs.

use Mix.Config

if Mix.env() == :test do
config :elixir_auth_google, httpoison: ElixirAuthGoogle.HTTPoison.InMemory
Copy link
Member Author

Choose a reason for hiding this comment

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

I've in-lined this in the lib/elixir_auth_google.ex @httpoison module attribute so we don't need the file. 👍 #35

@nelsonic nelsonic marked this pull request as ready for review April 2, 2020 19:22
@nelsonic nelsonic assigned SimonLab and unassigned nelsonic Apr 2, 2020
@nelsonic nelsonic requested a review from SimonLab April 2, 2020 19:23
@nelsonic
Copy link
Member Author

nelsonic commented Apr 2, 2020

@SimonLab this was easier than I thought.
Please review/merge when you can (tomorrow).
Thanks. 👍

@nelsonic
Copy link
Member Author

nelsonic commented Apr 2, 2020

No further changes required. Got it working in my Auth PR: dwyl/auth#43

Copy link
Member

@SimonLab SimonLab left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

@SimonLab SimonLab merged commit 1ea331e into master Apr 3, 2020
@SimonLab SimonLab deleted the export-testdouble-issue#35 branch April 3, 2020 07:46
@nelsonic nelsonic restored the export-testdouble-issue#35 branch April 21, 2020 07:09
@nelsonic nelsonic deleted the export-testdouble-issue#35 branch April 23, 2020 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants