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

Add Sinatra::Runner For Managing Sinatra Servers #122

Merged
merged 8 commits into from Jul 21, 2016

Conversation

Projects
None yet
4 participants
@apotonick
Contributor

apotonick commented Feb 12, 2014

This is extremely useful e.g. if you wanna test your REST client against a real backend (with real network calls). Assuming the test backend is a sinatra app, this class helps you to start and stop the server in your test.

module Sinatra
class Runner
def app_file
File.expand_path("../server.rb", __FILE__)

This comment has been minimized.

@rkh

rkh Mar 7, 2014

Member

Shouldn't this be configurable?

@rkh

rkh Mar 7, 2014

Member

Shouldn't this be configurable?

This comment has been minimized.

@apotonick

apotonick Mar 8, 2014

Contributor

It is, by overriding this method.

@apotonick

apotonick Mar 8, 2014

Contributor

It is, by overriding this method.

attr_accessor :pipe
def start
IO.popen(command)

This comment has been minimized.

@rkh

rkh Mar 7, 2014

Member

Where did the JRuby implementation go?

@rkh

rkh Mar 7, 2014

Member

Where did the JRuby implementation go?

This comment has been minimized.

@apotonick
@apotonick

apotonick Mar 8, 2014

Contributor
@rkh

This comment has been minimized.

Show comment
Hide comment
@rkh

rkh Mar 7, 2014

Member

No tests. :(

Member

rkh commented Mar 7, 2014

No tests. :(

end
def run
#puts command

This comment has been minimized.

@vipulnsward

vipulnsward Apr 7, 2014

Contributor

we can remove the puts

@vipulnsward

vipulnsward Apr 7, 2014

Contributor

we can remove the puts

@apotonick apotonick referenced this pull request May 16, 2014

Closed

Add JRuby support #95

@zzak zzak added this to the 1.5 milestone Feb 6, 2015

@zzak zzak added the feature label Feb 6, 2015

@zzak

This comment has been minimized.

Show comment
Hide comment
@zzak

zzak Feb 6, 2015

Member

We'll look into this for Sinatra 1.5

Member

zzak commented Feb 6, 2015

We'll look into this for Sinatra 1.5

@zzak

This comment has been minimized.

Show comment
Hide comment
@zzak

zzak May 3, 2016

Member

@apotonick Find a way to make it configurable, remove the #puts statement, and add some tests and you're good

Member

zzak commented May 3, 2016

@apotonick Find a way to make it configurable, remove the #puts statement, and add some tests and you're good

@zzak

This comment has been minimized.

Show comment
Hide comment
@zzak

zzak Jul 21, 2016

Member

Ok, I'm going to merge this, even without the configure option (since there is a workaround) and tests.

It's a new feature, that I will mark as experimental, so I'm fine if we add them later.

Member

zzak commented Jul 21, 2016

Ok, I'm going to merge this, even without the configure option (since there is a workaround) and tests.

It's a new feature, that I will mark as experimental, so I'm fine if we add them later.

@zzak zzak merged commit 632945f into sinatra:master Jul 21, 2016

1 check passed

default The Travis CI build passed
Details

zzak added a commit to zzak/sinatra-contrib that referenced this pull request Jul 22, 2016

Merge pull request sinatra#122 from apotonick/runner
Add Sinatra::Runner For Managing Sinatra Servers

myabc added a commit to myabc/roar that referenced this pull request Dec 9, 2016

Switch to Sinatra::Runner on sinatra master
sinatra/sinatra-contrib#122 has been merged.

Closes trailblazer#195.

Signed-off-by: Alex Coles <alex@alexbcoles.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment