Sha256: 2328d325709bd3c30082339a8bb28837949b044c8df56a9bcf5a8ac3a3aa67c0

Contents?: true

Size: 1.39 KB

Versions: 1

Compression:

Stored size: 1.39 KB

Contents

require "fileutils"

begin
  require 'spec'
rescue LoadError
  require 'rubygems'
  gem 'rspec'
  require 'spec'
end

if RUBY_PLATFORM =~ /java/
  if ENV['CELERITY_JAR'] == '1'
    require Dir["pkg/celerity-complete-*.jar"].first
    require "celerity"
  else
    $:.unshift File.expand_path("#{File.dirname(__FILE__)}/../lib")
    require 'celerity'
  end

  include Celerity
  include Celerity::Exception
  java.lang.System.setProperty("java.awt.headless", "true")
else
  puts "Not using JRuby - trying to run specs on Watir…"
  require 'watir'
  include Watir
  include Watir::Exception
end

# ============
# = Debugger =
# ============

# if ENV['DEBUGGER'] || $DEBUG
#   require "ruby-debug"
#   Debugger.start
#   Debugger.settings[:autoeval] = true
#   Debugger.settings[:autolist] = 1
# end

# ===========
# = WEBrick =
# ===========

if RUBY_PLATFORM =~ /java/ || ENV['WATIR_SPEC']
  unless defined? WEBRICK_SERVER
    require File.dirname(__FILE__) + "/../support/spec_server"
    s = Celerity::SpecServer.new
    begin
      s.run
    rescue Errno::EADDRINUSE
    end
    TEST_HOST = s.host
  end
else
  puts "Remember to run \"rake specserver\" before running these tests!"
  TEST_HOST = "http://localhost:2000"
end

HTML_DIR = "file://#{File.expand_path(File.dirname(__FILE__))}/html"
BROWSER_OPTIONS = {
  :log_level => $DEBUG ? :all : :off,
  # :browser   => :firefox
}

Thread.abort_on_exception = true

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
caius-celerity-0.0.6.11 spec/spec_helper.rb