Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rkh/1318863 to your computer and use it in GitHub Desktop.
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
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