lib/guard/jasmine.rb in guard-jasmine-0.8.3 vs lib/guard/jasmine.rb in guard-jasmine-0.8.4
- old
+ new
@@ -18,10 +18,11 @@
attr_accessor :last_run_failed, :last_failed_paths
DEFAULT_OPTIONS = {
:server => :auto,
+ :server_env => 'test',
:port => 8888,
:jasmine_url => 'http://localhost:8888/jasmine',
:timeout => 10000,
:notification => true,
:hide_success => false,
@@ -37,10 +38,11 @@
# Initialize Guard::Jasmine.
#
# @param [Array<Guard::Watcher>] watchers the watchers in the Guard block
# @param [Hash] options the options for the Guard
# @option options [String] :server the server to use, either :rails or :jasmine
+ # @option options [String] :server_env the server environment to use, for example :development, :test
# @option options [String] :port the port for the Jasmine test server
# @option options [String] :jasmine_url the url of the Jasmine test runner
# @option options [String] :phantomjs_bin the location of the PhantomJS binary
# @option options [Integer] :timeout the maximum time in milliseconds to wait for the spec runner to finish
# @option options [Boolean] :notification show notifications
@@ -71,10 +73,10 @@
# @raise [:task_has_failed] when run_on_change has failed
#
def start
if phantomjs_bin_valid?(options[:phantomjs_bin])
- Server.start(options[:server], options[:port]) unless options[:server] == :none
+ Server.start(options[:server], options[:port], options[:server_env]) unless options[:server] == :none
if jasmine_runner_available?(options[:jasmine_url])
run_all if options[:all_on_start]
end
else