2011-07-25 11:25:09 +04:00
|
|
|
describe("phantom global object", function() {
|
|
|
|
it("should exist", function() {
|
|
|
|
expect(typeof phantom).toEqual('object');
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should have args property", function() {
|
|
|
|
expect(phantom.hasOwnProperty('args')).toBeTruthy();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should have args as an array", function() {
|
|
|
|
expect(typeof phantom.args).toEqual('object');
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should have libraryPath property", function() {
|
|
|
|
expect(phantom.hasOwnProperty('libraryPath')).toBeTruthy();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should have libraryPath as a string", function() {
|
|
|
|
expect(typeof phantom.libraryPath).toEqual('string');
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should not have an empty libraryPath", function() {
|
|
|
|
expect(phantom.libraryPath.length).toNotEqual(0);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should have scriptName property", function() {
|
|
|
|
expect(phantom.hasOwnProperty('scriptName')).toBeTruthy();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should have scriptName as a string", function() {
|
|
|
|
expect(typeof phantom.scriptName).toEqual('string');
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should not have an empty scriptName", function() {
|
|
|
|
expect(phantom.scriptName.length).toNotEqual(0);
|
|
|
|
});
|
2011-08-21 09:53:22 +04:00
|
|
|
|
2011-08-21 09:56:08 +04:00
|
|
|
it("should have outputEncoding property", function() {
|
|
|
|
expect(phantom.hasOwnProperty('outputEncoding')).toBeTruthy();
|
|
|
|
});
|
|
|
|
|
2011-08-22 19:54:10 +04:00
|
|
|
it("should have the default outputEncoding of UTF-8", function() {
|
2011-08-25 03:48:42 +04:00
|
|
|
expect(phantom.outputEncoding.toLowerCase()).toEqual('utf-8');
|
2011-08-21 09:56:08 +04:00
|
|
|
});
|
|
|
|
|
2011-08-21 09:53:22 +04:00
|
|
|
it("should have version property", function() {
|
|
|
|
expect(phantom.hasOwnProperty('version')).toBeTruthy();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should return 1 as the major version", function() {
|
|
|
|
expect(phantom.version.major).toEqual(1);
|
|
|
|
});
|
|
|
|
|
2012-07-13 20:38:57 +04:00
|
|
|
it("should return 7 as the minor version", function() {
|
|
|
|
expect(phantom.version.minor).toEqual(7);
|
2011-08-21 09:53:22 +04:00
|
|
|
});
|
|
|
|
|
|
|
|
it("should return 0 as the patch version", function() {
|
|
|
|
expect(phantom.version.patch).toEqual(0);
|
|
|
|
});
|
2011-08-21 10:47:39 +04:00
|
|
|
|
|
|
|
it("should have 'injectJs' function", function() {
|
|
|
|
expect(typeof phantom.injectJs).toEqual("function");
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should have 'exit' function", function() {
|
|
|
|
expect(typeof phantom.exit).toEqual("function");
|
|
|
|
});
|
2012-07-04 14:59:24 +04:00
|
|
|
|
|
|
|
it("should have 'keys' property", function() {
|
|
|
|
expect(phantom.hasOwnProperty('keys')).toBeTruthy();
|
|
|
|
});
|
2011-07-25 11:25:09 +04:00
|
|
|
});
|