Commit c8764da9 c8764da9946cc6fc3b88057e256380a3f432eb0f by Mickaël Andrieu

refs #602 Pass all travis tests

1 parent 33271089
...@@ -849,15 +849,15 @@ Tester.prototype.assertType = function assertType(subject, type, message) { ...@@ -849,15 +849,15 @@ Tester.prototype.assertType = function assertType(subject, type, message) {
849 */ 849 */
850 Tester.prototype.assertInstanceOf = function assertInstanceOf(subject, className, message) { 850 Tester.prototype.assertInstanceOf = function assertInstanceOf(subject, className, message) {
851 "use strict"; 851 "use strict";
852 if (utils.betterTypeOf(constructor) !== "function") { 852 if (utils.betterTypeOf(subject.constructor) !== "function") {
853 throw new CasperError('Subject is null or undefined.'); 853 throw new CasperError('Subject is null or undefined.');
854 } 854 }
855 return this.assert(utils.equals(subject.constructor.name, className), message, { 855 return this.assert(utils.equals(subject.constructor.name, className), message, {
856 type: "assertInstanceOf", 856 type: "assertInstanceOf",
857 standard: f('Subject is an instance of: "%s"', constructor.name), 857 standard: f('Subject is an instance of: "%s"', subject.constructor.name),
858 values: { 858 values: {
859 subject: subject, 859 subject: subject,
860 constructor: constructor.name, 860 className: className,
861 } 861 }
862 }); 862 });
863 }; 863 };
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
2 /*jshint strict:false, maxstatements:99*/ 2 /*jshint strict:false, maxstatements:99*/
3 var fs = require('fs'); 3 var fs = require('fs');
4 4
5 casper.test.begin('Common assertions tests', 50, function(test) { 5 casper.test.begin('Common assertions tests', 49, function(test) {
6 casper.start('tests/site/index.html', function() { 6 casper.start('tests/site/index.html', function() {
7 test.assertTextExists('form', 'Tester.assertTextExists() checks that page body contains text'); 7 test.assertTextExists('form', 'Tester.assertTextExists() checks that page body contains text');
8 test.assertTextExist('form', 'Tester.assertTextExist() checks that page body contains text [alias]'); 8 test.assertTextExist('form', 'Tester.assertTextExist() checks that page body contains text [alias]');
...@@ -60,15 +60,13 @@ casper.test.begin('Common assertions tests', 50, function(test) { ...@@ -60,15 +60,13 @@ casper.test.begin('Common assertions tests', 50, function(test) {
60 test.assertTitleMatch(/test index/, 'Tester.assertTitleMatch() works as expected'); 60 test.assertTitleMatch(/test index/, 'Tester.assertTitleMatch() works as expected');
61 test.assertTitleMatches(/test index/, 'Tester.assertTitleMatches() works as expected [alias]'); 61 test.assertTitleMatches(/test index/, 'Tester.assertTitleMatches() works as expected [alias]');
62 test.assertType("plop", "string", "Tester.assertType() works as expected"); 62 test.assertType("plop", "string", "Tester.assertType() works as expected");
63 // We need two objects to test inheritance case 63 // we need a class and an instance of this class
64 function Cow(){}; function SuperCow(){}; SuperCow.prototype = new Cow; 64 function Cow(){} var daisy = new Cow();
65 var daisy = new Cow(); var superCowie = new SuperCow();
66 test.assertInstanceOf(12, "Number", "Tester.assertInstanceOf() works as expected"); 65 test.assertInstanceOf(12, "Number", "Tester.assertInstanceOf() works as expected");
67 test.assertInstanceOf("Boo", "String", "Tester.assertInstanceOf() works as expected"); 66 test.assertInstanceOf("Boo", "String", "Tester.assertInstanceOf() works as expected");
68 test.assertInstanceOf(["moo", "bar"], "Array", "Tester.assertInstanceOf() works as expected") 67 test.assertInstanceOf(["moo", "bar"], "Array", "Tester.assertInstanceOf() works as expected")
69 test.assertInstanceOf(true, "Boolean", "Test.assertInstanceOf() works as expected"); 68 test.assertInstanceOf(true, "Boolean", "Test.assertInstanceOf() works as expected");
70 test.assertInstanceOf(daisy, "Cow", "Tester.assertInstanceOf() works as expected"); 69 test.assertInstanceOf(daisy, "Cow", "Tester.assertInstanceOf() works as expected");
71 test.assertInstanceOf(superCowie, "SuperCow", "Tester.assertInstanceOf() works as expected");
72 test.assertUrlMatch(/index\.html$/, "Tester.assertUrlMatch() works as expected"); 70 test.assertUrlMatch(/index\.html$/, "Tester.assertUrlMatch() works as expected");
73 test.assertUrlMatches(/index\.html$/, "Tester.assertUrlMatches() works as expected [alias]"); 71 test.assertUrlMatches(/index\.html$/, "Tester.assertUrlMatches() works as expected [alias]");
74 test.assertVisible('img', 'Tester.assertVisible() works as expected'); 72 test.assertVisible('img', 'Tester.assertVisible() works as expected');
......