-
-
Save rkh/1318863 to your computer and use it in GitHub Desktop.
Get access to the Sinatra application instance that ran the current test in Rack::Test. Created by @bsiggelkow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe LeadService do | |
LeadService.configure(:test) do | |
before { settings.set(:instance, self) } | |
end | |
# Required for Rack::Test | |
# | |
def app | |
LeadService | |
end | |
it '...' do | |
get '/' | |
app.instance.stub(...) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment