spec/twitter/client/user_spec.rb in twitter4r-0.5.2 vs spec/twitter/client/user_spec.rb in twitter4r-0.5.3

- old
+ new

@@ -1,6 +1,6 @@ -require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper') +require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')) describe Twitter::Client, "#user(id, :info)" do before(:each) do @twitter = client_context @id = 395783 @@ -13,11 +13,10 @@ @json = JSON.unparse(@user.to_hash) @response = mas_net_http_response(:success, @json) @connection = mas_net_http(@response) @uris = Twitter::Client.class_eval("@@USER_URIS") Twitter::User.stub!(:unmarshal).and_return(@user) - Net::HTTP.stub!(:new).and_return(@connection) end it "should create expected HTTP GET request when giving numeric user id" do @twitter.should_receive(:rest_oauth_connect).with(:get, @uris[:info], {:user_id => @id}).and_return(@response) @twitter.user(@id) @@ -58,11 +57,10 @@ @json = JSON.unparse(@user.to_hash) @response = mas_net_http_response(:success, @json) @connection = mas_net_http(@response) @uris = Twitter::Client.class_eval("@@USER_URIS") Twitter::User.stub!(:unmarshal).and_return(@user) - Net::HTTP.stub!(:new).and_return(@connection) end it "should create expected HTTP GET request when giving numeric user id" do @twitter.should_receive(:rest_oauth_connect).with(:get, @uris[:friends], {:user_id => @id}).and_return(@response) @twitter.user(@id, :friends) @@ -115,11 +113,10 @@ @json = JSON.unparse(@user.to_hash) @response = mas_net_http_response(:success, @json) @connection = mas_net_http(@response) @uris = Twitter::Client.class_eval("@@USER_URIS") @twitter.stub!(:rest_oauth_connect).and_return(@response) - Net::HTTP.stub!(:new).and_return(@connection) Twitter::User.stub!(:unmarshal).and_return(@user) end it "should create expected HTTP GET request" do @twitter.should_receive(:rest_oauth_connect).with(:get, @uris[:info], {:id => @screen_name}).and_return(@response) @@ -154,10 +151,9 @@ @json = JSON.unparse(@friends.collect {|f| f.to_hash }) @response = mas_net_http_response(:success, @json) @connection = mas_net_http(@response) @uris = Twitter::Client.class_eval("@@USER_URIS") Twitter::User.stub!(:unmarshal).and_return(@friends) - Net::HTTP.stub!(:new).and_return(@connection) end it "should create expected HTTP GET request" do @twitter.should_receive(:rest_oauth_connect).with(:get, @uris[:friends], {:id => @screen_name}).and_return(@response) @twitter.my(:friends)