Module: Adva::Testing::Engine

Included in:
Adva::Testing
Defined in:
lib/adva/testing/engine.rb

Instance Method Summary collapse

Instance Method Details

#load_all(search) ⇒ Object


30
31
32
33
34
# File 'lib/adva/testing/engine.rb', line 30

def load_all(search)
  Pathname.glob(root.join("#{search}{.rb,/*.rb}")).each do |file|
    require(file) if file.exist?
  end
end

#load_assertionsObject


13
14
15
# File 'lib/adva/testing/engine.rb', line 13

def load_assertions
  load_all('lib/testing/assertions')
end

#load_cucumber_supportObject


21
22
23
24
# File 'lib/adva/testing/engine.rb', line 21

def load_cucumber_support
  load_all('lib/testing/step_definitions')
  load_all('lib/testing/paths')
end

#load_factoriesObject


17
18
19
# File 'lib/adva/testing/engine.rb', line 17

def load_factories
  load_all('lib/testing/factories')
end

#load_helpersObject


26
27
28
# File 'lib/adva/testing/engine.rb', line 26

def load_helpers
  load_all('lib/testing/helpers')
end

#migrateObject


9
10
11
# File 'lib/adva/testing/engine.rb', line 9

def migrate
  ActiveRecord::Migrator.up(root.join('db/migrate'))
end

#setup_load_pathsObject


4
5
6
7
# File 'lib/adva/testing/engine.rb', line 4

def setup_load_paths
  paths.app.each { |path| $:.unshift(path) if File.directory?(path) }
  ActiveSupport::Dependencies.autoload_paths.unshift(*paths.app)
end