Skip to content

Commit

Permalink
ZOMG! So much whitespace!
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Jan 11, 2011
1 parent c1c8ea1 commit 63979a8
Show file tree
Hide file tree
Showing 7 changed files with 153 additions and 153 deletions.
4 changes: 2 additions & 2 deletions lib/twitter/client/user.rb
Expand Up @@ -21,7 +21,7 @@ def user(*args)
user = args.first || get_screen_name
merge_user_into_options!(user, options)
response = get('users/show', options)
format.to_s.downcase == 'xml' ? response['user'] : response
format.to_s.downcase == 'xml' ? response['user'] : response
end

# Returns extended information for up to 100 users
Expand Down Expand Up @@ -101,7 +101,7 @@ def suggestions(*args)
# @param options [Hash] A customizable set of options.
# @option options [String] :size ('normal') Specifies the size of image to fetch. Valid options include: 'bigger' (73px by 73px), 'normal' (48px by 48px), and 'mini' (24px by 24px).
# @example Return the URL for the 24px by 24px version of @sferik's profile image
# Twitter.profile_image("sferik", :size => 'mini')
# Twitter.profile_image("sferik", :size => 'mini')
# @format :json, :xml
# @authenticated false
# @rate_limited false
Expand Down
2 changes: 1 addition & 1 deletion spec/faraday/response_spec.rb
Expand Up @@ -5,7 +5,7 @@
@client = Twitter::Client.new
end

{
{
400 => Twitter::BadRequest,
401 => Twitter::Unauthorized,
403 => Twitter::Forbidden,
Expand Down
78 changes: 39 additions & 39 deletions spec/twitter/client/list_members_spec.rb
Expand Up @@ -8,30 +8,30 @@
end

describe ".list_members" do

context "with screen name" do

before do
stub_get("sferik/presidents/members.#{format}").
with(:query => {:cursor => "-1"}).
to_return(:body => fixture("users_list.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
end

it "should get the correct resource" do
@client.list_members("sferik", "presidents")
a_get("sferik/presidents/members.#{format}").
with(:query => {:cursor => "-1"}).
should have_been_made
end

it "should return the members of the specified list" do
users_list = @client.list_members("sferik", "presidents")
users_list.users.should be_an Array
users_list.users.first.name.should == "Erik Michaels-Ober"
end

end

context "without screen name" do

before do
Expand All @@ -40,42 +40,42 @@
with(:query => {:cursor => "-1"}).
to_return(:body => fixture("users_list.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
end

it "should get the correct resource" do
@client.list_members("presidents")
a_get("sferik/presidents/members.#{format}").
with(:query => {:cursor => "-1"}).
should have_been_made
end

end

end

describe ".list_add_member" do

context "with screen name passed" do

before do
stub_post("sferik/presidents/members.#{format}").
with(:body => {:id => "813286"}).
to_return(:body => fixture("list.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
end

it "should get the correct resource" do
@client.list_add_member("sferik", "presidents", 813286)
a_post("sferik/presidents/members.#{format}").
with(:body => {:id => "813286"}).
should have_been_made
end

it "should return the list" do
list = @client.list_add_member("sferik", "presidents", 813286)
list.name.should == "presidents"
end

end

context "without screen name passed" do

before do
Expand All @@ -84,42 +84,42 @@
with(:body => {:id => "813286"}).
to_return(:body => fixture("list.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
end

it "should get the correct resource" do
@client.list_add_member("presidents", 813286)
a_post("sferik/presidents/members.#{format}").
with(:body => {:id => "813286"}).
should have_been_made
end

end

end

describe ".list_add_members" do

context "with screen name passed" do

before do
stub_post("sferik/presidents/create_all.#{format}").
with(:body => {:user_id => "813286,18755393"}).
to_return(:body => fixture("list.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
end

it "should get the correct resource" do
@client.list_add_members("sferik", "presidents", [813286, 18755393])
a_post("sferik/presidents/create_all.#{format}").
with(:body => {:user_id => "813286,18755393"}).
should have_been_made
end

it "should return the list" do
list = @client.list_add_members("sferik", "presidents", [813286, 18755393])
list.name.should == "presidents"
end

end

context "without screen name passed" do

before do
Expand All @@ -128,64 +128,64 @@
with(:body => {:user_id => "813286,18755393"}).
to_return(:body => fixture("list.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
end

it "should get the correct resource" do
@client.list_add_members("presidents", [813286, 18755393])
a_post("sferik/presidents/create_all.#{format}").
with(:body => {:user_id => "813286,18755393"}).
should have_been_made
end

end

end

describe ".list_remove_member" do

context "with screen name passed" do

before do
stub_delete("sferik/presidents/members.#{format}").
with(:query => {:id => "813286"}).
to_return(:body => fixture("list.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
end

it "should get the correct resource" do
@client.list_remove_member("sferik", "presidents", 813286)
a_delete("sferik/presidents/members.#{format}").
with(:query => {:id => "813286"}).
should have_been_made
end

it "should return the list" do
list = @client.list_remove_member("sferik", "presidents", 813286)
list.name.should == "presidents"
end

end

context "without screen name passed" do

before do
@client.stub!(:get_screen_name).and_return('sferik')
stub_delete("sferik/presidents/members.#{format}").
with(:query => {:id => "813286"}).
to_return(:body => fixture("list.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
end

it "should get the correct resource" do
@client.list_remove_member("presidents", 813286)
a_delete("sferik/presidents/members.#{format}").
with(:query => {:id => "813286"}).
should have_been_made
end

end

end

describe ".is_list_member?" do

context "with screen name passed" do

before do
Expand All @@ -194,25 +194,25 @@
stub_get("sferik/presidents/members/65493023.#{format}").
to_return(:body => fixture("not_found.#{format}"), :status => 404, :headers => {:content_type => "application/#{format}; charset=utf-8"})
end

it "should get the correct resource" do
@client.is_list_member?("sferik", "presidents", 813286)
a_get("sferik/presidents/members/813286.#{format}").
should have_been_made
end

it "should return true if user is a list member" do
is_list_member = @client.is_list_member?("sferik", "presidents", 813286)
is_list_member.should be_true
end

it "should return false if user is not a list member" do
is_list_member = @client.is_list_member?("sferik", "presidents", 65493023)
is_list_member.should be_false
end

end

context "without screen name passed" do

before do
Expand All @@ -222,15 +222,15 @@
stub_get("sferik/presidents/members/65493023.#{format}").
to_return(:body => fixture("not_found.#{format}"), :status => 404, :headers => {:content_type => "application/#{format}; charset=utf-8"})
end

it "should get the correct resource" do
@client.is_list_member?("presidents", 813286)
a_get("sferik/presidents/members/813286.#{format}").
should have_been_made
end

end

end
end
end
Expand Down

0 comments on commit 63979a8

Please sign in to comment.