#!/usr/bin/env ruby require 'qunited' if ARGV.empty? || ARGV.include?('-h') || ARGV.include?('--help') puts <<-HELP_TEXT Usage: qunited [OPTIONS] [JS_SOURCE_FILES...] -- [JS_TEST_FILES..] Runs JavaScript unit tests with QUnit. JS_SOURCE_FILES are the JavaScript files that you want to test. They will all be loaded for running each test. JS_TEST_FILES are files that contain the QUnit tests to run. and (optional) NAME Options: -h, --help Show this message HELP_TEXT exit end js_source_files, js_test_files = ARGV.join(' ').split('--').map { |file_list| file_list.split(' ') } exit QUnited::Runner.run(js_source_files, js_test_files)