Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 53 lines (40 sloc) 1.86 kb
b8ff815 @sigma a very basic test for the new gh-issues lib
authored
1 ;;; gh-issues-tests.el --- tests fir gh-issues.el
2
3 ;; Copyright (C) 2012 Yann Hodique
4
5 ;; Author: Yann Hodique <yann.hodique@gmail.com>
6 ;; Keywords:
7
8 ;; This file is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation; either version 2, or (at your option)
11 ;; any later version.
12
13 ;; This file is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
17
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with GNU Emacs; see the file COPYING. If not, write to
20 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 ;; Boston, MA 02111-1307, USA.
22
23 ;;; Commentary:
24
25 ;;
26
27 ;;; Code:
28
29 (require 'gh-tests)
30 (require 'gh-issues)
31
32 (defun gh-issues-tests:test-regular-issue (issue)
33 (should (equal (oref issue :number) 1347))
34 (should (equal (oref issue :state) "open")))
35
36 (ert-deftest gh-issues-tests:regular-list ()
c46a30d @sigma mock authentication
authored
37 (let* ((api (gh-tests-mock-api 'gh-issues-api))
38 (issues
39 (gh-tests-with-traces-buffers ((gists-buf "list_issues_sample.txt"))
40 (gh-tests-mock-url ((:record-cls mocker-stub-record
41 :output gists-buf))
42 (oref
43 (gh-issues-issue-list api "octocat"
44 "Hello-World")
45 :data)))))
b8ff815 @sigma a very basic test for the new gh-issues lib
authored
46 (should (equal (length issues) 1))
47 (let ((issue (car issues)))
48 (should (object-of-class-p issue 'gh-issues-issue))
49 (gh-issues-tests:test-regular-issue issue))))
50
51 (provide 'gh-issues-tests)
52 ;;; gh-issues-tests.el ends here
Something went wrong with that request. Please try again.