spec/twitter/client/user_spec.rb in twitter4r-0.2.1 vs spec/twitter/client/user_spec.rb in twitter4r-0.2.2

- old
+ new

@@ -1,7 +1,24 @@ require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper') +describe Twitter::Client, "#user(id, :followers)" do + before(:each) do + @twitter = client_context + @id = 395783 + end + + it "should raise ArgumentError" do + lambda { + @twitter.user(@id, :followers) + }.should raise_error(ArgumentError) + end + + after(:each) do + nilize(@twitter, @id) + end +end + describe Twitter::Client, "#user(id, :info)" do before(:each) do @twitter = client_context @id = 395783 @screen_name = 'boris_johnson_is_funny_as_hell' @@ -135,7 +152,23 @@ friends.should eql(@friends) end after(:each) do nilize(@request, @response, @connection, @twitter, @friends, @screen_name) + end +end + +describe Twitter::Client, "#my(:invalid_action)" do + before(:each) do + @twitter = client_context + end + + it "should raise ArgumentError for invalid user action" do + lambda { + @twitter.my(:crap) + }.should raise_error(ArgumentError) + end + + after(:each) do + nilize(@twitter) end end