Permalink
Browse files

Moving the tests, and adding travisci file

  • Loading branch information...
1 parent 394663b commit 3ab463ab4b42302367ae4ea6afb0f3d13cbc03c5 @jonrohan jonrohan committed Dec 10, 2012
Showing with 56 additions and 0 deletions.
  1. +3 −0 .travis.yml
  2. +53 −0 tests/index.js
View
@@ -0,0 +1,3 @@
+language: node_js
+node_js:
+ - 0.8
View
@@ -0,0 +1,53 @@
+"use strict";
+
+var zeroClipboard = require("../ZeroClipboard")
+
+exports.client = {
+
+ "Clip is created properly": function (test) {
+ var clip = new zeroClipboard.Client()
+
+ // Test the client was created properly
+ test.equal(clip.id, 1);
+
+ test.done();
+ },
+
+ "Changing movie path works": function (test) {
+
+ // Test the client has default path
+ test.equal(zeroClipboard.moviePath, "ZeroClipboard.swf");
+
+ // change the path
+ zeroClipboard.setMoviePath("new/movie/path.swf");
+ test.equal(zeroClipboard.moviePath, "new/movie/path.swf");
+
+ test.done();
+ },
+
+ "Clip sets text properly": function (test) {
+ var clip = new zeroClipboard.Client()
+
+ // Test the client has no text
+ test.equal(clip.clipText, "");
+
+ clip.setText("Tambourine");
+
+ test.equal(clip.clipText, "Tambourine");
+
+ test.done();
+ },
+
+ "Clip sets title properly": function (test) {
+ var clip = new zeroClipboard.Client()
+
+ // Test the client has no text
+ test.equal(clip.title, "");
+
+ clip.setTitle("Click Me");
+
+ test.equal(clip.title, "Click Me");
+
+ test.done();
+ }
+};

0 comments on commit 3ab463a

Please sign in to comment.