Sha256: d3ef9f8bc5e66aacb5cd9c5d5b972cc32478c2b83f6f619c62c10bbaa21f7ed8

Contents?: true

Size: 469 Bytes

Versions: 1

Compression:

Stored size: 469 Bytes

Contents

require "sinatra/base"
Dir[File.join(__dir__, '/routes', '*.rb')].each { |file| require file }

module FakeShopify
  class StubApp < Sinatra::Base
    def fixture(api_version, file_name)
      file_path = File.join(FakeShopify.fixture_path, api_version.to_s, "#{file_name}.json")
      File.open(file_path, "rb").read
    end

    def json_response(response_code, response_body)
      content_type :json
      status response_code
      response_body
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fake_shopify-0.2.0 lib/fake_shopify/stub_app.rb