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

consider pulling in some stub enhancements/simplications al la https://github.com/jclem/so_stub_very_test #433

Open
geemus opened this issue Oct 20, 2014 · 3 comments
Labels

Comments

@geemus
Copy link
Contributor

geemus commented Oct 20, 2014

/cc @jclem

Not sure what all we could borrow, but allowing strings instead of regexes seems like it could be super handy.

@jclem
Copy link

jclem commented Oct 20, 2014

Using so_stub_very_test cut a huge chunk out of the time it took us to write API stubs in the old Heroku Dashboard. I'd love to see something like it just built into Excon. Once we replaced all of the Excon stubs with so_stub_very_test stubs, we also had a much easier time identifying and preventing test cross-pollution (since Excon stubs stick around forever, it was easy to forget to clear stubs specific to individual specs/groups).

Summary of what's most useful:

  1. Stubs via strings with naïve placeholders (e.g. stub_get "/apps/:app_identifier")
  2. Default stubs that aren't cleared by default (e.g. SoStubVeryTest.defaults do #etc)
  3. Easy clearing of non-default stubs (e.g. SoStubVeryTest.clear_custom_stubs)

It's especially useful in cases where I'm testing something that makes lots of API calls, but only care about stubbing one of those endpoints. I'd just like the other endpoints to respond by default with an empty array or some default hash I've defined.

@geemus
Copy link
Contributor Author

geemus commented Oct 20, 2014

Thanks for the overview. I've known for a while that we should probably try to further improve this stuff but hadn't made much progress more recently. One idea was to have namespaced stubs, so that you could add/remove/clear based on a name, which might support the default/non-default (though the idea was never wholly fleshed out). I'll definitely keep these things in mind though, we got kind of an MVP going here and just haven't taken the time to flesh it out. Better understanding the pain points from actual usage should definitely help with that though. Thanks!

@stale
Copy link

stale bot commented Jul 30, 2018

This issue has been automatically marked stale due to inactivity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 30, 2018
@geemus geemus added pinned and removed wontfix labels Jul 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants