Sha256: 6819564181cec4e9382fda6a0e00b9268abedc9d79def6531b6ccddaa0c04988

Contents?: true

Size: 1021 Bytes

Versions: 6

Compression:

Stored size: 1021 Bytes

Contents

require 'test/unit'
require 'pathname'
require 'rubygems'

gem 'thoughtbot-shoulda', '>= 2.10.1'
gem 'jnunemaker-matchy', '0.4.0'
gem 'mocha', '0.9.4'
gem 'fakeweb', '>= 1.2.5'

require 'shoulda'
require 'matchy'
require 'mocha'
require 'fakeweb'


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

FakeWeb.allow_net_connect = false

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 github_url(url)
  url =~ /^http/ ? url : "http://github.com/api/v2/json#{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, github_url(url), options)
end

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
octopussy-0.1.4 test/helper.rb
octopussy-0.1.3 test/helper.rb
octopussy-0.1.2 test/helper.rb
octopussy-0.1.1 test/helper.rb
octopussy-0.1.0 test/helper.rb
octopussy-0.0.1 test/helper.rb