Sha256: 864d6ade865aba20f39ae433257b048d7558e5417e89f89259034da6b9c39f70

Contents?: true

Size: 1.33 KB

Versions: 3

Compression:

Stored size: 1.33 KB

Contents

unless ENV['CI']
  require 'simplecov'
  SimpleCov.start do
    add_filter "/spec"
  end
end

require 'reshape'
require 'rspec'
require 'webmock/rspec'
require 'vcr'

VCR.configure do |c|
  c.cassette_library_dir = 'spec/fixtures/cassettes'
  c.hook_into :webmock
  c.ignore_localhost = true
  c.allow_http_connections_when_no_cassette = true
end

def a_get(url)
  a_request(:get, shapeways_url(url))
end

def a_post(url)
  a_request(:post, shapeways_url(url))
end

def a_put(url)
  a_request(:put, shapeways_url(url))
end

def a_delete(url)
  a_request(:delete, shapeways_url(url))
end

def stub_get(url)
  stub_request(:get, shapeways_url(url))
end

def stub_post(url)
  stub_request(:post, shapeways_url(url))
end

def stub_put(url)
  stub_request(:put, shapeways_url(url))
end

def stub_delete(url)
  stub_request(:delete, shapeways_url(url))
end

def fixture_path
  File.expand_path("../fixtures", __FILE__)
end

def fixture(file)
  File.new(fixture_path + '/' + file)
end

def shapeways_url(url)
  "http://api.shapeways.com/#{url}/#{@client.api_version}"
end

def shapeways_client
  Reshape::Client.new({
    consumer_token: ENV['SHAPEWAYS_CONSUMER_TOKEN'], 
    consumer_secret: ENV['SHAPEWAYS_CONSUMER_SECRET'], 
    oauth_token: ENV['SHAPEWAYS_OAUTH_TOKEN'], 
    oauth_secret: ENV['SHAPEWAYS_OAUTH_SECRET'], 
    proxy: 'http://localhost:8888'
  })
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
reshape-0.2 spec/spec_helper.rb
reshape-0.1.1 spec/spec_helper.rb
reshape-0.1 spec/spec_helper.rb