Module: Sniff
- Extended by:
- Sniff
- Included in:
- Sniff
- Defined in:
- lib/sniff.rb,
lib/sniff/emitter.rb,
lib/sniff/database.rb,
lib/sniff/rake_tasks.rb
Defined Under Namespace
Modules: Emitter Classes: Database, RakeTasks
Instance Method Summary collapse
-
#init(local_root, options = {}) ⇒ Object
Prepares the environment for running tests against Earth data and emitter gems.
- #root ⇒ Object
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, = {}) [:earth] ||= :none Sniff::Database.init local_root, if [:cucumber] cukes = Dir.glob File.join(File.dirname(__FILE__), 'test_support', 'cucumber', '**', '*.rb') cukes.each { |support_file| require support_file } end end |
#root ⇒ Object
4 5 6 |
# File 'lib/sniff.rb', line 4 def root File.join(File.dirname(__FILE__), '..') end |