Sha256: 575f4f55e87d7b4a50d51eb43f99023218ad99e4f695a46170dfd8b0ed808b31

Contents?: true

Size: 664 Bytes

Versions: 5

Compression:

Stored size: 664 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'simplecov'
SimpleCov.command_name 'Unit Tests'
SimpleCov.start

require 'minitest'
require 'minitest/autorun'
require 'minitest/spec'
require 'minitest/mock'
require 'webmock/minitest'
require 'hashie/mash'

require 'pmp'

# helper method to create mashified test docs, that look like what comes out of the faraday middleware
def mashify(body)
  case body
  when Hash
    ::Hashie::Mash.new(body)
  when Array
    body.map { |item| parse(item) }
  else
    body
  end
end

def json_fixture(name)
  mashify(JSON.parse(json_file(name)))
end

def json_file(name)
  File.read( File.dirname(__FILE__) + "/fixtures/#{name}.json")
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pmp-0.2.0 spec/spec_helper.rb
pmp-0.1.3 spec/spec_helper.rb
pmp-0.1.2 spec/spec_helper.rb
pmp-0.1.1 spec/spec_helper.rb
pmp-0.1.0 spec/spec_helper.rb