2012-03-15 10:17:03 +04:00
|
|
|
describe("System object", function() {
|
|
|
|
var system = require('system');
|
|
|
|
|
|
|
|
it("should exist", function() {
|
|
|
|
expect(typeof system).toEqual('object');
|
|
|
|
expect(system).toNotEqual(null);
|
|
|
|
});
|
|
|
|
|
2012-11-06 21:39:45 +04:00
|
|
|
it("should have pid property", function() {
|
|
|
|
expect(system.hasOwnProperty('pid')).toBeTruthy();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should have pid as a number", function() {
|
|
|
|
expect(typeof system.pid).toEqual('number');
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should have pid that is an integer", function() {
|
|
|
|
expect(system.pid).toMatch(/^\d+$/);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should have pid greater than 0", function() {
|
|
|
|
expect(system.pid).toBeGreaterThan(0);
|
|
|
|
});
|
|
|
|
|
2012-03-15 10:17:03 +04:00
|
|
|
it("should have platform as string", function() {
|
|
|
|
expect(typeof system.platform).toEqual('string');
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should have platform set to 'phantomjs'", function() {
|
|
|
|
expect(system.platform).toEqual('phantomjs');
|
|
|
|
});
|
2012-03-15 11:40:49 +04:00
|
|
|
|
|
|
|
it("should have args as array", function() {
|
|
|
|
expect(system.args instanceof Array).toBeTruthy();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should have args with at least one item", function() {
|
|
|
|
expect(system.args.length >= 1).toBeTruthy();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should have args[0] as the this test runner", function() {
|
2012-03-23 14:56:25 +04:00
|
|
|
expect(system.args[0]).toMatch(/run-tests.js$/);
|
2012-03-15 11:40:49 +04:00
|
|
|
});
|
|
|
|
|
2012-03-15 12:19:23 +04:00
|
|
|
it("should have env as object", function() {
|
|
|
|
expect(typeof system.env).toEqual('object');
|
|
|
|
});
|
|
|
|
|
2012-05-18 17:19:27 +04:00
|
|
|
it("should have os as object", function() {
|
|
|
|
expect(typeof system.os).toEqual('object');
|
|
|
|
});
|
|
|
|
|
2012-09-03 17:50:34 +04:00
|
|
|
it("should have isSSLSupported as boolean", function() {
|
|
|
|
expect(typeof system.isSSLSupported).toEqual('boolean');
|
|
|
|
});
|
|
|
|
|
2012-12-15 15:01:36 +04:00
|
|
|
it("should have stdout as object", function() {
|
|
|
|
expect(typeof system.stdout).toEqual('object');
|
|
|
|
expect(null == system.stdout).toBeFalsy();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should have stderr as object", function() {
|
|
|
|
expect(typeof system.stderr).toEqual('object');
|
|
|
|
expect(null == system.stderr).toBeFalsy();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should have stdin as object", function() {
|
|
|
|
expect(typeof system.stdin).toEqual('object');
|
|
|
|
expect(null == system.stdin).toBeFalsy();
|
|
|
|
});
|
|
|
|
|
2012-03-15 10:17:03 +04:00
|
|
|
});
|