Allow a Pathname to be passed as a Response body #331

Merged
merged 3 commits into from Nov 13, 2013

Conversation

Projects
None yet
2 participants
Contributor

benpickles commented Nov 11, 2013

This lets me use Rails.root.join like so:

stub_request(:get, /example.com/).to_return(
  body: Rails.root.join('test/fixtures/foo.txt')
)

I didn't bother allowing a Pathname to be passed as a raw response as I've never used that functionality but I'm happy to also add that if you would like.

Owner

bblimke commented Nov 13, 2013

Cheers Ben!
Nice refactoring File.new.read to File.read

bblimke merged commit f740217 into bblimke:master Nov 13, 2013

1 check passed

default The Travis CI build passed
Details
Owner

bblimke commented Nov 17, 2013

Released in 1.16.0. Cheers!

benpickles deleted the benpickles:body-as-pathname branch Nov 18, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment