Sha256: e68a694c9fdcbf8d19514a8dc4e0fbd43b425f45d0b05fe1ccdd9e2ad7eee5d5

Contents?: true

Size: 879 Bytes

Versions: 7

Compression:

Stored size: 879 Bytes

Contents

require 'rubygems'
require 'test/unit'
require 'shoulda'
require 'matchy'
require 'mocha'
require 'fakeweb'

FakeWeb.allow_net_connect = false

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

class Test::Unit::TestCase
end

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

def remix_url(url)
  url =~ /^http/ ? url : "http://api.remix.bestbuy.com:80/v1#{url}"
end

def stub_get(url, filename, status=nil)
  options = {:body => fixture_file(filename)}
  options.merge!({:status => status}) unless status.nil?
  
  FakeWeb.register_uri(:get, remix_url(url), options)
end

def stub_post(url, filename)
  FakeWeb.register_uri(:post, remix_url(url), :body => fixture_file(filename))
end

Version data entries

7 entries across 7 versions & 5 rubygems

Version Path
squeejee-remixr-0.1.0 test/test_helper.rb
remixr-prashanth-0.1.1 test/test_helper.rb
reenhanced-remixr-0.1.0 test/test_helper.rb
obitum-remixr-0.1.3 test/test_helper.rb
obitum-remixr-0.1.2 test/test_helper.rb
obitum-remixr-0.1.0 test/test_helper.rb
remixr-0.1.0 test/test_helper.rb