File: test_query.rb

package info (click to toggle)
mikutter 3.8.6%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 10,544 kB
  • sloc: ruby: 20,548; sh: 99; makefile: 19
file content (27 lines) | stat: -rw-r--r-- 645 bytes parent folder | download | duplicates (5)
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
# -*- coding: utf-8 -*-
require "#{File.dirname(__FILE__)}/extension"

require 'test/unit'
require 'mocha/setup'
require 'webmock'

require 'utils'
miquire :lib, 'mikutwitter/query', 'test_unit_extensions'

class Plugin
  def self.call(*args); end end

class TC_mikutwitter_query < Test::Unit::TestCase

  def setup
    @m = MikuTwitter.new
  end

  must "auto oauth query test" do
    WebMock.stub_request(:get, "#{@m.base_path}/application/rate_limit_status.json").to_return(:body => '"ok"', :status => 200)
    res = @m.query!('application/rate_limit_status')
    assert_equal("200", res.code)
    assert_equal("\"ok\"", res.body)
  end

end