Skip to content

Commit

Permalink
Don't talk to the bustracker service during tests, fake out the conne…
Browse files Browse the repository at this point in the history
…ction with a cached xml sample.
  • Loading branch information
mconnell committed Jul 1, 2010
1 parent 90168a5 commit 38c6284
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/test_helper.rb
@@ -1,8 +1,15 @@
require 'rubygems'
require 'test/unit'
require 'active_support'
require 'fakeweb'
FakeWeb.allow_net_connect = false

require 'nokogiri'
require 'bus_tracker'
require 'bus_tracker/service'
require 'bus_tracker/bus_stop'

# Fake out the fetching of data for a bus service
FakeWeb.register_uri :get,
'http://mybustracker.co.uk/getServicePoints.php?serviceMnemo=30',
:body => File.open('/Users/mark/workspaces/ruby/bustracker/test/fake_service_number_response.xml', 'rb').read

0 comments on commit 38c6284

Please sign in to comment.