/
base_test.rb
37 lines (31 loc) · 1.2 KB
/
base_test.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
require File.dirname(__FILE__) + '/../test_helper'
class BaseTest < Test::Unit::TestCase
def setup
@t = Twitter::Base.new('email', 'password')
end
test 'default friends method generates request' do
@t.expects(:request).with('statuses/friends.xml', {:auth => true, :args => {}})
@t.expects(:users)
@t.friends
end
test 'friends method with lite value generates request' do
@t.expects(:request).with('statuses/friends.xml?lite=true', {:auth => true, :args => {:lite => true}})
@t.expects(:users)
@t.friends(true)
end
test 'friends method with options generates request' do
@t.expects(:request).with('statuses/friends.xml?lite=true', {:auth => true, :args => {:lite => true}})
@t.expects(:users)
@t.friends(:lite => true)
end
test 'friends by id method generates request' do
@t.expects(:request).with('statuses/friends.xml?id=1', {:auth => true, :args => {:id => 1}})
@t.expects(:users)
@t.friends_for(1)
end
test 'friends by id and options generates request' do
@t.expects(:request).with('statuses/friends.xml?id=1&lite=true', {:auth => true, :args => {:id => 1, :lite => true}})
@t.expects(:users)
@t.friends_for(1, :lite => true)
end
end