Sha256: bd975e72c691f595052374057c65c5998f14a8307c35498e1210b2e8614101fd

Contents?: true

Size: 650 Bytes

Versions: 4

Compression:

Stored size: 650 Bytes

Contents

$VERBOSE = nil

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

require 'minitest/autorun'
require 'rack/test'
require 'mocha/minitest'
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

4 entries across 4 versions & 2 rubygems

Version Path
shopify-sinatra-app-1.2.1 example/test/test_helper.rb
sinatra-embedded-shopify-app-0.5.16 example/test/test_helper.rb
shopify-sinatra-app-1.2.0 example/test/test_helper.rb
shopify-sinatra-app-1.1.1 example/test/test_helper.rb