|
1 | | -;;; gh-orgs-tests.el --- tests for gh-orgs.el |
| 1 | +;;; gh-orgs-test.el --- test for gh-orgs.el |
2 | 2 |
|
3 | 3 | ;; Copyright (C) 2012 Yann Hodique |
4 | 4 |
|
|
26 | 26 |
|
27 | 27 | ;;; Code: |
28 | 28 |
|
29 | | -(require 'gh-tests) |
| 29 | +(require 'gh-test) |
30 | 30 | (require 'gh-orgs) |
31 | 31 |
|
32 | | -(defun gh-orgs-tests:test-regular-org-stub (org) |
| 32 | +(defun gh-orgs-test:test-regular-org-stub (org) |
33 | 33 | (should (equal (oref org :id) 1)) |
34 | 34 | (should (equal (oref org :login) "github")) |
35 | 35 | (should (equal "https://github.com/images/error/octocat_happy.gif" (oref org :avatar-url)))) |
36 | 36 |
|
37 | | -(defun gh-orgs-tests:test-regular-org (org) |
38 | | - (gh-orgs-tests:test-regular-org-stub org) |
| 37 | +(defun gh-orgs-test:test-regular-org (org) |
| 38 | + (gh-orgs-test:test-regular-org-stub org) |
39 | 39 | (should (equal (oref org :public-gists) 1)) |
40 | 40 | (should (equal (oref org :public-repos) 2))) |
41 | 41 |
|
42 | | -(ert-deftest gh-orgs-tests:regular-list () |
43 | | - (let* ((api (gh-tests-mock-api 'gh-orgs-api)) |
| 42 | +(ert-deftest gh-orgs-test:regular-list () |
| 43 | + (let* ((api (gh-test-mock-api 'gh-orgs-api)) |
44 | 44 | (orgs |
45 | | - (gh-tests-with-traces-buffers ((orgs-buf "list_orgs_sample.txt")) |
46 | | - (gh-tests-mock-url ((:record-cls mocker-stub-record |
| 45 | + (gh-test-with-traces-buffers ((orgs-buf "list_orgs_sample.txt")) |
| 46 | + (gh-test-mock-url ((:record-cls mocker-stub-record |
47 | 47 | :output orgs-buf)) |
48 | 48 | (oref (gh-orgs-list api "dummy") :data))))) |
49 | 49 | (should (equal (length orgs) 1)) |
50 | 50 | (let ((org (car orgs))) |
51 | 51 | (should (object-of-class-p org 'gh-orgs-org-stub)) |
52 | | - (gh-orgs-tests:test-regular-org-stub org)))) |
| 52 | + (gh-orgs-test:test-regular-org-stub org)))) |
53 | 53 |
|
54 | | -(ert-deftest gh-orgs-tests:regular-get () |
55 | | - (let* ((api (gh-tests-mock-api 'gh-orgs-api)) |
| 54 | +(ert-deftest gh-orgs-test:regular-get () |
| 55 | + (let* ((api (gh-test-mock-api 'gh-orgs-api)) |
56 | 56 | (org |
57 | | - (gh-tests-with-traces-buffers ((orgs-buf "get_org_sample.txt")) |
58 | | - (gh-tests-mock-url ((:record-cls mocker-stub-record |
| 57 | + (gh-test-with-traces-buffers ((orgs-buf "get_org_sample.txt")) |
| 58 | + (gh-test-mock-url ((:record-cls mocker-stub-record |
59 | 59 | :output orgs-buf)) |
60 | 60 | (oref (gh-orgs-get api "github") :data))))) |
61 | 61 | (should (object-of-class-p org 'gh-orgs-org)) |
62 | | - (gh-orgs-tests:test-regular-org org))) |
| 62 | + (gh-orgs-test:test-regular-org org))) |
63 | 63 |
|
64 | | -(ert-deftest gh-orgs-tests:regular-update () |
65 | | - (let* ((api (gh-tests-mock-api 'gh-orgs-api)) |
| 64 | +(ert-deftest gh-orgs-test:regular-update () |
| 65 | + (let* ((api (gh-test-mock-api 'gh-orgs-api)) |
66 | 66 | (org-stub |
67 | 67 | (make-instance 'gh-orgs-org |
68 | 68 | :login "github" |
69 | 69 | :id 1 |
70 | 70 | :url "https://api.github.com/orgs/1" |
71 | 71 | :avatar-url "https://github.com/images/error/octocat_happy.gif")) |
72 | 72 | (org |
73 | | - (gh-tests-with-traces-buffers ((orgs-buf "get_org_sample.txt")) |
74 | | - (gh-tests-mock-url ((:record-cls mocker-stub-record |
| 73 | + (gh-test-with-traces-buffers ((orgs-buf "get_org_sample.txt")) |
| 74 | + (gh-test-mock-url ((:record-cls mocker-stub-record |
75 | 75 | :output orgs-buf)) |
76 | 76 | (oref (gh-orgs-update api org-stub) :data))))) |
77 | 77 | (should (object-of-class-p org 'gh-orgs-org)) |
78 | | - (gh-orgs-tests:test-regular-org org))) |
| 78 | + (gh-orgs-test:test-regular-org org))) |
79 | 79 |
|
80 | | -(provide 'gh-orgs-tests) |
81 | | -;;; gh-orgs-tests.el ends here |
| 80 | +(provide 'gh-orgs-test) |
| 81 | +;;; gh-orgs-test.el ends here |
0 commit comments