Module: Sniff

Extended by:
Sniff
Included in:
Sniff
Defined in:
lib/sniff.rb,
lib/sniff/emitter.rb,
lib/sniff/database.rb

Defined Under Namespace

Modules: Emitter Classes: Database

Instance Method Summary collapse

Instance Method Details

#init(local_root, options = {}) ⇒ Object

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)



19
20
21
22
23
24
25
26
27
28
# File 'lib/sniff.rb', line 19

def init(local_root, options = {})
  options[:earth] ||= :none

  Sniff::Database.init local_root, options

  if defined?(Cucumber)
    step_definitions = Dir.glob File.join(File.dirname(__FILE__), 'test_support', 'step_definitions', '**', '*.rb')
    step_definitions.each { |definition| require definition }
  end
end

#rootObject



4
5
6
# File 'lib/sniff.rb', line 4

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