Class: JsTestDriverRunner
- Inherits:
-
Object
- Object
- JsTestDriverRunner
- Defined in:
- lib/tasks/js_test_driver/js_test_driver_runner.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(dir, jar, filter, server) ⇒ JsTestDriverRunner
constructor
A new instance of JsTestDriverRunner.
- #is_configured?(all_files) ⇒ Boolean
- #name ⇒ Object
- #should_run?(modified_files) ⇒ Boolean
Constructor Details
#initialize(dir, jar, filter, server) ⇒ JsTestDriverRunner
Returns a new instance of JsTestDriverRunner.
3 4 5 6 7 8 9 |
# File 'lib/tasks/js_test_driver/js_test_driver_runner.rb', line 3 def initialize(dir, jar, filter, server) @config = dir + '/jsTestDriver.conf' @dir = dir @jar = jar @filter = filter @server = server end |
Instance Method Details
#execute ⇒ Object
15 16 17 18 |
# File 'lib/tasks/js_test_driver/js_test_driver_runner.rb', line 15 def execute @server.start_if_required return `java -jar "#{@jar}" --config "#{@config}" --captureConsole --reset --tests all 2>&1` end |
#is_configured?(all_files) ⇒ Boolean
20 21 22 |
# File 'lib/tasks/js_test_driver/js_test_driver_runner.rb', line 20 def is_configured?(all_files) return all_files.include?(@dir + '/jsTestDriver.conf') end |
#name ⇒ Object
11 12 13 |
# File 'lib/tasks/js_test_driver/js_test_driver_runner.rb', line 11 def name return 'JS Test Driver' end |
#should_run?(modified_files) ⇒ Boolean
24 25 26 |
# File 'lib/tasks/js_test_driver/js_test_driver_runner.rb', line 24 def should_run?(modified_files) return !(modified_files.detect { |file| @filter.filter(file) }).nil? || modified_files.include?(@config) end |