Skip to content

Commit

Permalink
twitter specs up and running
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermesilveira committed Aug 30, 2010
1 parent 5c8696b commit 490c6b5
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 13 deletions.
11 changes: 0 additions & 11 deletions spec/integration/twitter/spec_helper.rb

This file was deleted.

1 change: 1 addition & 0 deletions tests/Gemfile
Expand Up @@ -25,6 +25,7 @@ gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'restfulie', '1.0.0.beta.1'

group :test, :development do
gem "fakeweb"
gem "sinatra"
gem "rack-conneg"
gem "rspec-rails", ">= 2.0.0.beta.19"
Expand Down
2 changes: 2 additions & 0 deletions tests/Gemfile.lock
Expand Up @@ -34,6 +34,7 @@ GEM
diff-lcs (1.1.2)
erubis (2.6.6)
abstract (>= 1.0.0)
fakeweb (1.2.8)
i18n (0.4.1)
json_pure (1.4.6)
mail (2.2.5)
Expand Down Expand Up @@ -98,6 +99,7 @@ PLATFORMS
ruby

DEPENDENCIES
fakeweb
rack-conneg
rails (= 3.0.0)
restfulie (= 1.0.0.beta.1)
Expand Down
Expand Up @@ -6,7 +6,7 @@

before do
request.accept = "application/atom+xml"
response.stub (:content_type) { "application/atom+xml" }
response.stub(:content_type) { "application/atom+xml" }
end

it "renders view files with tokamak extension" do
Expand Down
6 changes: 6 additions & 0 deletions tests/spec/integration/spec_helper.rb
@@ -0,0 +1,6 @@
# $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))

require 'spec_helper'
require 'fakeweb'

require File.dirname(__FILE__) + '/twitter'
File renamed without changes.
Expand Up @@ -4,13 +4,20 @@

TWITTER_ENTRY_POINT = "http://twitter.com/statuses/public_timeline.xml"

before { FakeWeb.register_uri(:get, TWITTER_ENTRY_POINT, :response => Responses::Twitter.public_timeline) }
before do
FakeWeb.allow_net_connect = false
FakeWeb.register_uri(:get, TWITTER_ENTRY_POINT, :response => Responses::Twitter.public_timeline)
end

it "should work with twitter" do
statuses = Restfulie.at("http://twitter.com/statuses/public_timeline.xml").get
statuses.statuses.each do |status|
puts "#{status.user.screen_name}: #{status.text}, #{status.created_at}"
end
end

after do
FakeWeb.allow_net_connect = true
end

end

0 comments on commit 490c6b5

Please sign in to comment.