Sha256: 09ab0a1d662acf3f477483fced829582cd7f8073584c53a71f616550945ac894

Contents?: true

Size: 978 Bytes

Versions: 3

Compression:

Stored size: 978 Bytes

Contents

$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))

require 'rubygems'
require 'ticketmaster'
require 'active_support/core_ext/string'
require 'rspec'
require 'ticketmaster-github'
require 'fakeweb'

RSpec.configure do |config|
  config.color_enabled = true
end

FakeWeb.allow_net_connect = false

def fixture_file(filename)
  return '' if filename == ''
  file_path = File.expand_path(File.dirname(__FILE__) + '/fixtures/' + filename)
  File.read(file_path)
end


def stub_request(method, url, filename, status=nil)
  options = {:body => ""}
  options.merge!({:body => fixture_file(filename)}) if filename
  options.merge!({:body => status.last}) if status
  options.merge!({:status => status}) if status

  FakeWeb.register_uri(method, url, options) 
end

def stub_get(*args); stub_request(:get, *args) end
def stub_post(*args); stub_request(:post, *args) end
def stub_delete(*args); stub_request(:delete, *args) end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ticketmaster-github-0.9.0 spec/spec_helper.rb
ticketmaster-github-0.8.1 spec/spec_helper.rb
ticketmaster-github-0.8.0 spec/spec_helper.rb