lib/qunited/runner.rb in qunited-0.4.0 vs lib/qunited/runner.rb in qunited-0.4.1
- old
+ new
@@ -9,10 +9,12 @@
def initialize(js_source_files, js_test_files, options={})
@js_source_files, @js_test_files, @options = js_source_files, js_test_files, options
end
def run
+ [js_source_files, js_test_files].each { |files| confirm_existence_of_files files }
+
driver_class, formatter_class = resolve_driver_class, resolve_formatter_class
driver = driver_class.new(js_source_files, js_test_files)
driver.formatter = formatter_class.new({:driver_name => driver.name})
results = driver.run
@@ -66,8 +68,12 @@
end
end
def best_available_driver
DRIVERS_PRIORITY.map { |driver| get_driver(driver) }.find { |driver| driver.available? }
+ end
+
+ def confirm_existence_of_files(files_array)
+ files_array.each { |f| raise UsageError, "File not found: #{f}" unless File.exist? f }
end
end
end