class Jasmine::Configuration

Attributes

boot_dir[RW]
boot_files[W]
boot_path[RW]
chrome_binary[RW]
chrome_cli_options[RW]
chrome_startup_timeout[RW]
color[RW]
css_files[W]
formatters[RW]
helper_files[RW]
host[RW]
image_path[RW]
images_dir[RW]
jasmine_css_files[W]
jasmine_dir[RW]
jasmine_files[W]
jasmine_path[RW]
phantom_cli_options[RW]
phantom_config_script[RW]
prevent_phantom_js_auto_install[RW]
rack_apps[R]
rack_options[RW]
random[RW]
runner[RW]
runner_boot_dir[RW]
runner_boot_files[W]
runner_boot_path[RW]
runner_browser[RW]
show_console_log[RW]
show_full_stack_trace[RW]
spec_dir[RW]
spec_files[RW]
spec_format[RW]
spec_path[RW]
src_dir[RW]
src_files[W]
src_path[RW]
stop_on_spec_failure[RW]
stop_spec_on_expectation_failure[RW]

Public Class Methods

new() click to toggle source
# File lib/jasmine/configuration.rb, line 28
def initialize()
  @rack_paths = {}
  @rack_apps = []
  @path_mappers = []
  @jasmine_css_files = lambda { [] }
  @css_files = lambda { [] }
  @jasmine_files = lambda { [] }
  @boot_files = lambda { [] }
  @runner_boot_files = lambda { [] }
  @src_files = lambda { [] }
  @helper_files = lambda { [] }
  @spec_files = lambda { [] }
  @testing_files = lambda { helper_files.call + spec_files.call}
  @runner = lambda { |config| }
  @rack_options = {}
  @show_console_log = false
  @stop_spec_on_expectation_failure = false
  @stop_on_spec_failure = false
  @random = true
  @phantom_config_script = nil
  @phantom_cli_options = {}
  @chrome_cli_options = {"no-sandbox" => nil, "headless" => nil, "remote-debugging-port" => 9222}
  @chrome_startup_timeout = 3
  @chrome_binary = nil
  @runner_browser = :phantomjs

  @formatters = [Jasmine::Formatters::Console]
  @color = true

  @server_port = 8888
end

Public Instance Methods

add_path_mapper(mapper) click to toggle source
# File lib/jasmine/configuration.rb, line 89
def add_path_mapper(mapper)
  @path_mappers << mapper.call(self)
end
add_rack_app(app, *args, &block) click to toggle source
# File lib/jasmine/configuration.rb, line 81
def add_rack_app(app, *args, &block)
  @rack_apps << {
      :app => app,
      :args => args,
      :block => block
  }
end
add_rack_path(path, rack_app_lambda) click to toggle source
# File lib/jasmine/configuration.rb, line 77
def add_rack_path(path, rack_app_lambda)
  @rack_paths[path] = rack_app_lambda
end
ci_port=(port) click to toggle source
# File lib/jasmine/configuration.rb, line 97
def ci_port=(port)
  @ci_port = port
end
css_files() click to toggle source
# File lib/jasmine/configuration.rb, line 60
def css_files
  map(@jasmine_css_files, :jasmine) +
    map(@css_files, :src)
end
js_files() click to toggle source
# File lib/jasmine/configuration.rb, line 65
def js_files
  map(@jasmine_files, :jasmine) +
    map(@boot_files, :boot) +
    map(@runner_boot_files, :runner_boot) +
    map(@src_files, :src) +
    map(@testing_files, :spec)
end
port(server_type) click to toggle source
# File lib/jasmine/configuration.rb, line 101
def port(server_type)
  if server_type == :server
    @server_port
  else
    @ci_port ||= Jasmine.find_unused_port
  end
end
rack_path_map() click to toggle source
# File lib/jasmine/configuration.rb, line 73
def rack_path_map
  {}.merge(@rack_paths)
end
server_port=(port) click to toggle source
# File lib/jasmine/configuration.rb, line 93
def server_port=(port)
  @server_port = port
end

Private Instance Methods

map(path_procs, type) click to toggle source
# File lib/jasmine/configuration.rb, line 115
def map(path_procs, type)
  @path_mappers.inject(path_procs.call) do |paths, mapper|
    if mapper.respond_to?("map_#{type}_paths")
      mapper.send("map_#{type}_paths", paths)
    else
      paths
    end
  end
end