Sha256: 8911864db71c73cfaf02fb305169b45a34b5a8e2e04de786ce1300dc48f6992c

Contents?: true

Size: 647 Bytes

Versions: 10

Compression:

Stored size: 647 Bytes

Contents

$VERBOSE = nil

ENV['RACK_ENV'] = 'test'
ENV['SECRET'] = 'secret'

require 'minitest/autorun'
require 'rack/test'
require 'mocha/setup'
require 'fakeweb'

FakeWeb.allow_net_connect = false

module Helpers
  include Rack::Test::Methods

  def load_fixture(name)
    File.read("./test/fixtures/#{name}")
  end

  def fake(url, options = {})
    method = options.delete(:method) || :get
    body = options.delete(:body) || '{}'
    format = options.delete(:format) || :json

    FakeWeb.register_uri(method, url, { body: body, status: 200, content_type: "application/#{format}" }.merge(options))
  end
end

class Minitest::Test
  include Helpers
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
shopify-sinatra-app-1.1.0 example/test/test_helper.rb
shopify-sinatra-app-1.0.1 example/test/test_helper.rb
shopify-sinatra-app-1.0.0 example/test/test_helper.rb
shopify-sinatra-app-0.12.0 example/test/test_helper.rb
shopify-sinatra-app-0.11.0 example/test/test_helper.rb
shopify-sinatra-app-0.10.0 example/test/test_helper.rb
shopify-sinatra-app-0.9.0 example/test/test_helper.rb
loopstak-shopify-sinatra-app-1.0.0 example/test/test_helper.rb
shopify-sinatra-app-0.8.0 example/test/test_helper.rb
shopify-sinatra-app-0.7.0 example/test/test_helper.rb