aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnson Denen <johnson.denen@gmail.com>2017-04-22 22:33:58 -0400
committerJohnson Denen <johnson.denen@gmail.com>2017-04-23 11:09:06 -0400
commit949912d793cc8b80e6acb0978268405dc21a13e9 (patch)
tree4d07b4a0fb767810d35fbcdd83076c1e117794f8
parente9dd14192f0e9f1e2367b378b937c2b2f042ffa1 (diff)
Use Cask to run tests in TravisCI
-rw-r--r--.gitignore2
-rw-r--r--.travis.yml12
-rw-r--r--Cask9
-rw-r--r--fixture/client.plstore (renamed from test/fixture/client.plstore)0
-rw-r--r--fixture/empty.plstore (renamed from test/fixture/empty.plstore)0
-rw-r--r--lisp/mastodon.el2
-rw-r--r--test/ert-helper.el6
-rw-r--r--test/mastodon-auth-tests.el4
-rw-r--r--test/mastodon-client-tests.el1
-rw-r--r--test/mastodon-http-tests.el2
-rw-r--r--test/mastodon-tl-tests.el1
-rw-r--r--test/mastodon-toot-tests.el1
12 files changed, 30 insertions, 10 deletions
diff --git a/.gitignore b/.gitignore
index 45b434e..d72aa13 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,5 @@
# Other
.DS_Store
stubfile.plstore
+*~
+dist/
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..0948dbd
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,12 @@
+language: emacs-lisp
+sudo: false
+before_install:
+ - curl -fsSkL https://gist.github.com/rejeep/ebcd57c3af83b049833b/raw > x.sh && source ./x.sh
+ - evm install $EVM_EMACS --use --skip
+ - cask install
+env:
+ - EVM_EMACS=emacs-24.5-travis
+ - EVM_EMACS=emacs-25.1-travis
+script:
+ - emacs --version
+ - cask exec ert-runner -l test/ert-helper.el test/*-tests.el
diff --git a/Cask b/Cask
new file mode 100644
index 0000000..82380d2
--- /dev/null
+++ b/Cask
@@ -0,0 +1,9 @@
+(source gnu)
+(source melpa)
+
+(package "mastodon" "0.4.2" "Emacs client for Mastodon")
+(files "lisp/*.el")
+
+(development
+ (depends-on "ert-runner")
+ (depends-on "el-mock"))
diff --git a/test/fixture/client.plstore b/fixture/client.plstore
index 3514ed9..3514ed9 100644
--- a/test/fixture/client.plstore
+++ b/fixture/client.plstore
diff --git a/test/fixture/empty.plstore b/fixture/empty.plstore
index 4685e78..4685e78 100644
--- a/test/fixture/empty.plstore
+++ b/fixture/empty.plstore
diff --git a/lisp/mastodon.el b/lisp/mastodon.el
index 1332c7b..a2006f8 100644
--- a/lisp/mastodon.el
+++ b/lisp/mastodon.el
@@ -1,4 +1,4 @@
-;;; mastodon.el -- Mastodon client for Emacs
+;;; mastodon.el --- Mastodon client for Emacs
;; Copyright (C) 2017 Johnson Denen
;; Author: Johnson Denen <johnson.denen@gmail.com>
diff --git a/test/ert-helper.el b/test/ert-helper.el
new file mode 100644
index 0000000..53111d7
--- /dev/null
+++ b/test/ert-helper.el
@@ -0,0 +1,6 @@
+(load-file "lisp/mastodon-http.el")
+(load-file "lisp/mastodon-client.el")
+(load-file "lisp/mastodon-auth.el")
+(load-file "lisp/mastodon-toot.el")
+(load-file "lisp/mastodon-tl.el")
+
diff --git a/test/mastodon-auth-tests.el b/test/mastodon-auth-tests.el
index 1bbc46b..b3edea8 100644
--- a/test/mastodon-auth-tests.el
+++ b/test/mastodon-auth-tests.el
@@ -1,9 +1,5 @@
(require 'el-mock)
-(load-file "../lisp/mastodon.el")
-(load-file "../lisp/mastodon-http.el")
-(load-file "../lisp/mastodon-auth.el")
-
(ert-deftest mastodon-auth:token-file ()
"Should return `mastodon-token-file' value."
(should (string= (mastodon-auth--token-file) "~/.emacs.d/mastodon.plstore")))
diff --git a/test/mastodon-client-tests.el b/test/mastodon-client-tests.el
index 2a58b84..73a3d7e 100644
--- a/test/mastodon-client-tests.el
+++ b/test/mastodon-client-tests.el
@@ -1,5 +1,4 @@
(require 'el-mock)
-(load-file "../lisp/mastodon-client.el")
(ert-deftest register ()
"Should POST to /apps."
diff --git a/test/mastodon-http-tests.el b/test/mastodon-http-tests.el
index 55f6bf3..06b92d5 100644
--- a/test/mastodon-http-tests.el
+++ b/test/mastodon-http-tests.el
@@ -1,7 +1,5 @@
(require 'el-mock)
-(load-file "../lisp/mastodon-http.el")
-
(ert-deftest mastodon-http:get:retrieves-endpoint ()
"Should make a `url-retrieve' of the given URL."
(let ((callback-double (lambda () "double")))
diff --git a/test/mastodon-tl-tests.el b/test/mastodon-tl-tests.el
index 5571e70..19d7e55 100644
--- a/test/mastodon-tl-tests.el
+++ b/test/mastodon-tl-tests.el
@@ -1,5 +1,4 @@
(require 'el-mock)
-(load-file "../lisp/mastodon-tl.el")
(ert-deftest mastodon-tl:from-toot ()
"Should return the value for KEY in a list."
diff --git a/test/mastodon-toot-tests.el b/test/mastodon-toot-tests.el
index cdd3bb9..eae9e89 100644
--- a/test/mastodon-toot-tests.el
+++ b/test/mastodon-toot-tests.el
@@ -1,5 +1,4 @@
(require 'el-mock)
-(load-file "../lisp/mastodon-toot.el")
(ert-deftest mastodon-toot:cancel ()
(with-mock