How to use system - 10 common examples

To help you get started, we’ve selected a few system examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ringo / ringojs / test / integration-tests / all.js View on Github external
processIn
            .writeLine(test.in)
            .flush();
        // ignore terminal ESC and clear characters as well as newline at end
        // as long as what we want is printed at start of the line.
        assert.equal(processOut.readLine().indexOf(test.out), 0, 'testInOut ' + idx + ' should match');
    });
    process.kill();
};

exports.testRequireMain = require("./require-index/main").testCalculator;
exports.testHttpJsgiBinding = require("./http-jsgi-binding/simple").testHttpJsgiBinding;

// start the test runner if we're called directly from command line
if (require.main === module) {
    system.exit(require('test').run(exports));
}
github openstax / css-coverage.js / phantom-coverage.js View on Github external
count += matches.length;
              } catch (e) {
                // If we cannot select it then we cannot cover it
                console.warn('Skipping selector that could not be matched using SizzleJS: ' + selector)
              }
            });
          }
          console.log(JSON.stringify([count, selectors]));
        });
      }, cssJSON);
      phantom.exit();
    });
  } else {
    console.error('PhantomJS Open Status: ' + status);
    phantom.exit();
    system.exit(1);
  }
});
github ringo / ringojs / modules / ringo / httpserver / index.js View on Github external
exports.init = function(path) {
    // parse command line options
    options = {};
    const args = system.args.slice(1);
    try {
        // remove command from command line arguments
        options = utils.parseOptions(args, options);
    } catch (error) {
        log.error("Error parsing options:", error);
        system.exit(1);
    }

    options.path = path;
    if (options.path === undefined) {
        if (args[0]) {
            // take app module from command line
            options.path = fs.resolve(fs.workingDirectory(), args[0]);
        } else {
            options.path = fs.workingDirectory();
        }
    }
    // if argument is a directory assume app in main.js
    if (fs.isDirectory(options.path)) {
        options.path = fs.join(options.path, "main");
    }
github grob / ringo-sqlstore / test / runner.js View on Github external
const setDatabase = exports.setDatabase = function(args) {
    const parser = new Parser();
    parser.addOption("t", "type", "type", "The database type to connect to");
    const opts = parser.parse(args);
    if (opts.type) {
        if (config[opts.type] == undefined) {
            console.error("Database connection '" + opts.type +
                    "' is not defined in config.js");
            system.exit(-1);
        }
        set(opts.type);
    }
    return args;
};
github ringo / ringojs / test / integration-tests / require-index / main.js View on Github external
var assert = require("assert");

var calc = require("./calculator");

exports.testCalculator = function() {
    assert.equal(calc.add(3,5), 8);
    assert.equal(calc.substract(5,3), 2);
};

if (require.main === module) {
    require('system').exit(require("test").run(module.id));
}
github ringo / ringojs / test / binary / all.js View on Github external
exports.testBytearray = require('./bytearray-tests');
exports.testBytearrayEncodings = require('./bytearray-encodings-tests');
exports.testBytestring = require('./bytestring-tests');
exports.testBytestringEncodings = require('./bytestring-encodings-tests');
exports.testBytearraySlice = require('./bytearray-slice');

if (require.main === module) {
    require('system').exit(require('test').run(module.id));
}
github ringo / ringojs / test / file / test-fs-isAbsolute.js View on Github external
var assert = require("assert");
var fs = require('fs');

exports.testIsAbsolute = function () {
    assert.isTrue(fs.isAbsolute(java.lang.System.getProperty("java.home")));
    assert.isTrue(fs.isAbsolute(fs.absolute(module.path)));
    assert.isTrue(fs.isRelative("./"));
};

if (require.main === module) {
    require('system').exit(require("test").run(module.id));
}
github ringo / ringojs / test / ringo / jsgi / all.js View on Github external
exports.testAsyncResponse  = require('./asyncresponse_test');
exports.testResponse       = require('./response_test');
exports.testResponseRange       = require('./response_range_test');

if (require.main === module) {
    require("system").exit(require("test").run(exports));
}
github ringo / ringojs / test / singletons / all.js View on Github external
exports.testBasics  = require("./test-singleton-basics");
exports.testWorkers = require("./test-singleton-multiple-workers");
exports.testComplexObject = require("./test-singleton-complex-object");

if (require.main === module) {
    require("system").exit(require("test").run(exports));
}
github grob / rp / test / all.js View on Github external
var system = require("system");

exports.testDescriptors = require("./descriptors_test");
exports.testPackages = require("./packages_test");
exports.testRegistry = require("./registry_test");
exports.testResolver = require("./resolver_test");
exports.testCache = require("./cache_test");
exports.testCompress = require("./compress_test");

if (require.main == module.id) {
    system.exit(require('test').run(exports));
}

system

Flexible module and resource system

BSD-3-Clause
Latest version published 7 years ago

Package Health Score

51 / 100
Full package analysis

Popular system functions