Sha256: 9991e72aeab5add4832983f9eb0c12ba2c7fb94d14dd3217bb138c5490b198cd
Contents?: true
Size: 1.69 KB
Versions: 37
Compression:
Stored size: 1.69 KB
Contents
require File.dirname(__FILE__) + '/spec_helper.rb' describe Twitter::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> <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 = Twitter::Status.new_from_xml(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.favorited.should == false s.user.id.should == '4243' s.user.name.should == 'John Nunemaker' end end
Version data entries
37 entries across 37 versions & 14 rubygems