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.4.3 lib/sniff.rb
sniff-0.4.2 lib/sniff.rb
sniff-0.4.1 lib/sniff.rb
sniff-0.4.0 lib/sniff.rb
sniff-0.3.1 lib/sniff.rb
sniff-0.3.0 lib/sniff.rb
sniff-0.2.8 lib/sniff.rb
sniff-0.2.7 lib/sniff.rb
sniff-0.2.6 lib/sniff.rb
sniff-0.2.5 lib/sniff.rb
sniff-0.2.3 lib/sniff.rb
sniff-0.2.1 lib/sniff.rb
sniff-0.2.0 lib/sniff.rb
sniff-0.1.17 lib/sniff.rb
sniff-0.1.16 lib/sniff.rb
sniff-0.1.15 lib/sniff.rb
sniff-0.1.14 lib/sniff.rb
sniff-0.1.13 lib/sniff.rb
sniff-0.1.12 lib/sniff.rb
sniff-0.1.10 lib/sniff.rb