Module: Adva::Testing::Engine

Defined in:
lib/adva/testing/engine.rb

Instance Method Summary collapse

Instance Method Details

#load_all(search) ⇒ Object



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

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
25
# File 'lib/adva/testing/engine.rb', line 21

def load_cucumber_support
  load_all('lib/testing/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



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

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