Sha256: 5f0e2f04a0eea70f7f96200a0f640aafa2e02fedfe16b11bc3b8d3096c71a733
Contents?: true
Size: 970 Bytes
Versions: 1
Compression:
Stored size: 970 Bytes
Contents
require 'test/unit' require 'pathname' 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_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, github_url(url), options) end def stub_get(*args); stub_request(:get, *args) end def stub_post(*args); stub_request(:post, *args) end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
octopussy-0.3.1 | test/helper.rb |