spec/rubytter_spec.rb in rubytter-0.6.4 vs spec/rubytter_spec.rb in rubytter-0.6.5
- old
+ new
@@ -176,21 +176,21 @@
1 => 'a',
/regex/ => 'regex',
nil => nil,
:c => {:a => 1, :b => 2},
:d => {:a => {:a => 1, :b => 2}, :b => 1},
- :e => [{:a => 1, :b => 2}, {:c => 3}]
+ :e => [{:a => 1, :b => 2}, {:c => '"<>&'}]
}
struct = Rubytter.json_to_struct(hash)
struct.a.should == 'a'
struct.b.should == 1
struct.c.a.should == 1
struct.c.b.should == 2
struct.d.a.a.should == 1
struct.e[0].a.should == 1
struct.e[0].b.should == 2
- struct.e[1].c.should == 3
+ struct.e[1].c.should == '"<>&'
lambda {struct.x}.should raise_error(NoMethodError)
lambda {struct.regex}.should raise_error(NoMethodError)
end
it 'should create same structs from same datas' do
@@ -216,14 +216,14 @@
'from_user_id' => '3748631',
'from_user' => 'jugyo',
'profile_image_url' => 'http://s3.amazonaws.com/twitter_production/profile_images/63467667/megane2_normal.png'
}
rubytter = Rubytter.new('test', 'teat')
- result = rubytter.search_result_to_struct(json_data)
+ result = Rubytter.search_result_to_hash(json_data)
result['id'].should == '123'
result['text'].should == 'foo foo bar bar'
result['created_at'].should == 'Sat, 21 Mar 2009 09:48:20 +0000'
- result['source'].should == "<a href=\"http:\\/\\/twitter.com\\/\">web<\\/a>"
+ result['source'].should == '<a href="http:\/\/twitter.com\/">web<\/a>'
result['in_reply_to_user_id'].should == '20660692'
result['in_reply_to_screen_name'].should == 'jugyo_test'
result['user']['id'].should == '3748631'
result['user']['screen_name'].should == 'jugyo'
result['user']['profile_image_url'].should == 'http://s3.amazonaws.com/twitter_production/profile_images/63467667/megane2_normal.png'