Sha256: 7f352cadfd411901052040b522b193f7f90ef0e06af31b5bae4f5f3abd91336e

Contents?: true

Size: 698 Bytes

Versions: 2

Compression:

Stored size: 698 Bytes

Contents

Mocktra
====

A webmock DSL using sinatra.

Installation
----

    $ gem install mocktra

Examples
----

    require 'mocktra'

    # define stub
    Mocktra('www.example.com') do
      get '/foo' do
        'FOO!!'
      end

      post '/foo' do
        params.inspect
      end
    end

    # test it
    require 'httpclient'
    client = HTTPClient.new

    res = client.get("http://www.example.com/foo")
    p res.body
    #=> "FOO!!"

    res = client.post("http://www.example.com/foo", 'bar' => 'baz')
    p res.body
    #=> "{\"bar\"=>\"baz\"}"

Notice
----

Mocktra calls `WebMock.allow_net_connect!` when loading.

Copyright
----

Copyright (c) 2012 jugyo, released under the MIT license.

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mocktra-1.0.2 README.md
mocktra-1.0.1 README.md