spec/rubytter_spec.rb in rubytter-0.6.5 vs spec/rubytter_spec.rb in rubytter-0.7.0

- old
+ new

@@ -187,12 +187,12 @@ 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 == '"<>&' - lambda {struct.x}.should raise_error(NoMethodError) - lambda {struct.regex}.should raise_error(NoMethodError) + struct.x.should == nil + struct.regex.should == nil end it 'should create same structs from same datas' do Rubytter.json_to_struct({:a => 'a'}).should == Rubytter.json_to_struct({:a => 'a'}) Rubytter.json_to_struct({:a => 'a', :b => {:c => 'c'}}).should == @@ -245,8 +245,29 @@ status.in_reply_to_screen_name.should == nil status.in_reply_to_status_id.should == nil status.user.id.should == 74941 status.user.screen_name.should == "jugyo" status.user.profile_image_url.should == "http://s3.amazonaws.com/twitter_production/profile_images/63467667/megane2_normal.png" + end + + it 'should post using access_token' do + access_token = Object.new + rubytter = OAuthRubytter.new(access_token) + access_token.should_receive(:post).with('/statuses/update.json', {:status => 'test'}, {"User-Agent"=>"Rubytter/0.6.6 (http://github.com/jugyo/rubytter)"}) + rubytter.update('test') + end + + it 'should get using access_token' do + access_token = Object.new + rubytter = OAuthRubytter.new(access_token) + access_token.should_receive(:get).with('/statuses/friends_timeline.json', {}, {"User-Agent"=>"Rubytter/0.6.6 (http://github.com/jugyo/rubytter)"}) + rubytter.friends_timeline + end + + it 'should get with params using access_token' do + access_token = Object.new + rubytter = OAuthRubytter.new(access_token) + access_token.should_receive(:get).with('/statuses/friends_timeline.json', {:page => 2}, {"User-Agent"=>"Rubytter/0.6.6 (http://github.com/jugyo/rubytter)"}) + rubytter.friends_timeline(:page => 2) end end end