From f28899c78cff014271b2fb03e9d304ae97078e96 Mon Sep 17 00:00:00 2001 From: Susan Potter Date: Sun, 8 Jul 2007 17:21:22 +0000 Subject: [PATCH] Added featured users API as an extra (#19) --- spec/spec_helper.rb | 1 + spec/twitter/client/base_spec.rb | 4 ++-- spec/twitter/model_spec.rb | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a3b9be3..ebf7d8b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,7 @@ require 'spec' require 'twitter' require 'twitter/console' +require 'twitter/extras' # Add helper methods here if relevant to multiple _spec.rb files diff --git a/spec/twitter/client/base_spec.rb b/spec/twitter/client/base_spec.rb index 4bb3b32..b2e2b10 100644 --- a/spec/twitter/client/base_spec.rb +++ b/spec/twitter/client/base_spec.rb @@ -35,6 +35,8 @@ describe Twitter::Client, "#http_header" do 'User-Agent' => "Twitter4R v#{Twitter::Version.to_version} [#{@user_agent}]", } @twitter = client_context + # resent @@http_header class variable in Twitter::Client class + Twitter::Client.class_eval("@@http_header = nil") end it "should always return expected HTTP headers" do @@ -53,8 +55,6 @@ describe Twitter::Client, "#http_header" do after(:each) do nilize(@user_agent, @application_name, @application_version, @application_url, @twitter, @expected_headers) - # resent @@http_header class variable in Twitter::Client class - Twitter::Client.class_eval("@@http_header = nil") end end diff --git a/spec/twitter/model_spec.rb b/spec/twitter/model_spec.rb index 2ee38f8..2a768ea 100644 --- a/spec/twitter/model_spec.rb +++ b/spec/twitter/model_spec.rb @@ -456,3 +456,18 @@ describe Twitter::User, "#defriend" do nilize(@twitter, @user, @friend) end end + +describe Twitter::User, ".featured" do + before(:each) do + @twitter = client_context + end + + it "should delegate #featured(:users) message to given client context" do + @twitter.should_receive(:featured).with(:users).and_return([]) + Twitter::User.featured(@twitter) + end + + after(:each) do + nilize(@twitter) + end +end -- 2.11.4.GIT