Tiny local server. Useful to mock servers in integration tests.
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
.gitignore
Gemfile
LICENSE.txt
README.md
Rakefile
minion_server.gemspec

README.md

MinionServer

Tiny local server. Useful to mock servers in integration tests.

Installation

You can install (and be happy):

$ gem install minion_server

Or you can also use in your Gemfile:

gem 'minion_server'
# live on edge is also an option
gem 'minion_server', :git => 'git@github.com:rogerleite/minion_server.git'

Usage

    require 'minion_server'

    # build your integration app
    IntegrationApp = Rack::Builder.new do
      map "/" do
        run lambda { |env|
          [200, {"Content-Type" => "text/plain"}, ["Be happy!"]]
        }
      end
    end

    server = MinionServer.new(IntegrationApp)
    server.start("localhost", 1620)  # default: localhost, 4000

    # do your calls
    system "curl http://localhost:1620" # => "Be happy!"

    server.shutdown