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

- old
+ new

@@ -30,10 +30,16 @@ it "should bless the Array returned from Twitter for :sent case" do @twitter.should_receive(:bless_models).with(@messages).and_return(@messages) @twitter.messages(:sent) end + it "should raise an ArgumentError when giving an invalid messaging action" do + lambda { + @twitter.messages(:crap) + }.should raise_error(ArgumentError) + end + after(:each) do nilize(@twitter, @uris, @request, @response, @connection, @messages) end end @@ -84,9 +90,15 @@ end it "should invoke #to_i on message object passed in for :delete case" do @message.should_receive(:to_i).and_return(@message.id) @twitter.message(:delete, @message) + end + + it "should raise an ArgumentError when giving an invalid messaging action" do + lambda { + @twitter.message(:crap, @message) + }.should raise_error(ArgumentError) end after(:each) do nilize(@twitter, @uris, @request, @response, @connection, @sender, @recipient, @message, @attributes) end