Sha256: 38a5f9c756514b5e8a46c6ae507ae5110af9518e0124cdb408d4e3a7e43918ad

Contents?: true

Size: 869 Bytes

Versions: 1

Compression:

Stored size: 869 Bytes

Contents

require File.dirname(__FILE__) + '/test_helper.rb'

class TestTw < Test::Unit::TestCase

  def setup
    @client = Tw::Client.new
    @client.auth
  end

  def response?(arr)
    return false unless arr.kind_of? Array
    arr.each do |i|
      return false if !(i[:id].class == Fixnum and
                        i[:user] =~ /^[a-zA-Z0-9_]+$/ and
                        i[:text].kind_of? String and
                        i[:time].kind_of? Time)
    end
    return true
  end
  
  def test_mentions
    assert response? @client.mentions
  end

  def test_home_timeline
    assert response? @client.home_timeline
  end

  def test_search
    assert response? @client.search('ruby')
  end

  def test_user_timeline
    assert response? @client.user_timeline 'shokai'
  end

  def test_list_timeline
    assert response? @client.list_timeline('shokai', 'arr')
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tw-0.0.3 test/test_tw.rb