Sha256: 943ec7b9a59c839c0c06b379e2395f679bc9d553966ca7137a57e0e0ee30ecde

Contents?: true

Size: 1.07 KB

Versions: 49

Compression:

Stored size: 1.07 KB

Contents

module Sniff
  extend self

  def root 
    File.join(File.dirname(__FILE__), '..')
  end

  # Prepares the environment for running tests against Earth data and emitter 
  # gems.
  #
  # local_root: Root directory of the emitter gem to be tested (path to the repo)
  #
  # options: 
  # * :earth is the list of domains Earth.init should load (default: none)
  # * :load_data determines whether fixture data is loaded (default: true)
  # * :sqllogdev is a Logger log device used by ActiveRecord (default: nil)
  # * :fixtures_path is the path to your gem's fixtures (default: local_root/lib/db/fixtures)
  # * :logdev is a Logger log device used for general logging (default: nil)
  def init(local_root, options = {})
    options[:earth] ||= :none

    Sniff::Database.init local_root, options

    if options[:cucumber]
      cukes = Dir.glob File.join(File.dirname(__FILE__), 'test_support', 'cucumber', '**', '*.rb')
      cukes.each { |support_file| require support_file }
    end
  end
end

require 'earth'

$:.unshift File.dirname(__FILE__)
require 'sniff/database'
require 'sniff/emitter'

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
sniff-0.6.7 lib/sniff.rb
sniff-0.6.6 lib/sniff.rb
sniff-0.6.5 lib/sniff.rb
sniff-0.6.4 lib/sniff.rb
sniff-0.6.3 lib/sniff.rb
sniff-0.6.2 lib/sniff.rb
sniff-0.6.1 lib/sniff.rb
sniff-0.6.0 lib/sniff.rb
sniff-0.5.3 lib/sniff.rb
sniff-0.5.2 lib/sniff.rb
sniff-0.5.1 lib/sniff.rb
sniff-0.5.0 lib/sniff.rb
sniff-0.4.12 lib/sniff.rb
sniff-0.4.11 lib/sniff.rb
sniff-0.4.10 lib/sniff.rb
sniff-0.4.9 lib/sniff.rb
sniff-0.4.7 lib/sniff.rb
sniff-0.4.6 lib/sniff.rb
sniff-0.4.5 lib/sniff.rb
sniff-0.4.4 lib/sniff.rb