Sha256: 0004dceb9a5282000781e79024edf949bd2a6598f0609af61d5a445bf45cd43a
Contents?: true
Size: 1.78 KB
Versions: 10
Compression:
Stored size: 1.78 KB
Contents
require File.dirname(__FILE__) + '/spec_helper.rb' describe Tweetsy::Status do it "should create new status from xml doc" do xml = <<EOF <status> <created_at>Sun May 04 21:59:52 +0000 2008</created_at> <id>803435310</id> <text>Writing tests (rspec) for the twitter gem that all can run. Wish I would have done this when I wrote it years back.</text> <source><a href="http://iconfactory.com/software/twitterrific">twitterrific</a></source> <truncated>false</truncated> <in_reply_to_status_id></in_reply_to_status_id> <in_reply_to_user_id></in_reply_to_user_id> <in_reply_to_screen_name>blah</in_reply_to_screen_name> <favorited>false</favorited> <user> <id>4243</id> <name>John Nunemaker</name> <screen_name>jnunemaker</screen_name> <location>Indiana</location> <description>Loves his wife, ruby, notre dame football and iu basketball</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/52619256/ruby_enterprise_shirt_normal.jpg</profile_image_url> <url>http://addictedtonew.com</url> <protected>false</protected> <followers_count>363</followers_count> </user> </status> EOF s = Tweetsy::Status.new(Hpricot.XML(xml)) s.id.should == '803435310' s.created_at.should == 'Sun May 04 21:59:52 +0000 2008' s.text.should == 'Writing tests (rspec) for the twitter gem that all can run. Wish I would have done this when I wrote it years back.' s.source.should == '<a href="http://iconfactory.com/software/twitterrific">twitterrific</a>' s.truncated.should == "false" s.in_reply_to_status_id.should == '' s.in_reply_to_user_id.should == '' s.in_reply_to_screen_name.should == 'blah' s.favorited.should == "false" s.user.id.should == '4243' s.user.name.should == 'John Nunemaker' end end
Version data entries
10 entries across 10 versions & 1 rubygems