lib/guard/jasmine.rb in guard-jasmine-2.0.6 vs lib/guard/jasmine.rb in guard-jasmine-2.1.0
- old
+ new
@@ -20,11 +20,11 @@
DEFAULT_OPTIONS = {
server: :auto,
server_env: ENV['RAILS_ENV'] || 'development',
server_timeout: 60,
- server_mount: '/jasmine', # set here for documentation purposes; actually determiend at runtime by presence (or lack thereof) of the JasmineRails constant
+ server_mount: '/jasmine', # set here for documentation purposes; actually determiend at runtime by presence (or lack thereof) of the JasmineRails constant
port: nil,
rackup_config: nil,
jasmine_url: nil,
timeout: 60,
spec_dir: nil,
@@ -45,15 +45,13 @@
coverage_summary: false,
statements_threshold: 0,
functions_threshold: 0,
branches_threshold: 0,
lines_threshold: 0,
- junit: false,
- junit_consolidate: true,
- junit_save_path: '',
+ reporters: nil,
debug: false
- }
+ }.freeze
# Initialize Guard::Jasmine.
#
# @param [Hash] options the options for the Guard
# @option options [String] :server the server to use, either :auto, :none, :webrick, :mongrel, :thin, :jasmine_gem, or a custom rake task
@@ -91,13 +89,13 @@
options = DEFAULT_OPTIONS.merge(options)
options[:spec_dir] ||= File.exist?(File.join('spec', 'javascripts')) ? File.join('spec', 'javascripts') : 'spec'
options[:server] ||= :auto
- options[:server] = ::Guard::Jasmine::Server.detect_server(options[:spec_dir]) if options[:server] == :auto
+ options[:server] = ::Guard::Jasmine::Server.detect_server(options[:spec_dir]) if options[:server] == :auto
options[:port] ||= ::Guard::Jasmine::Server.choose_server_port(options)
- options[:jasmine_url] = "http://localhost:#{ options[:port] }#{ options[:server] == :jasmine_gem ? '/' : options[:server_mount] }" unless options[:jasmine_url]
+ options[:jasmine_url] = "http://localhost:#{options[:port]}#{options[:server] == :jasmine_gem ? '/' : options[:server_mount]}" unless options[:jasmine_url]
options[:specdoc] = :failure unless [:always, :never, :failure].include? options[:specdoc]
options[:phantomjs_bin] = Jasmine.which('phantomjs') unless options[:phantomjs_bin]
self.run_all_options = options.delete(:run_all) || {}
@@ -150,9 +148,10 @@
self.last_failed_paths = results.keys
self.last_run_failed = !results.empty?
throw :task_has_failed if last_run_failed
end
+
# Gets called when watched paths and files have changes.
#
# @param [Array<String>] paths the changed paths and files
# @raise [:task_has_failed] when run_on_modifications has failed
#