Module: Adva::Testing::Engine
- Defined in:
- lib/adva/testing/engine.rb
Instance Method Summary collapse
- #load_all(search) ⇒ Object
- #load_assertions ⇒ Object
- #load_cucumber_support ⇒ Object
- #load_factories ⇒ Object
- #load_helpers ⇒ Object
- #migrate ⇒ Object
- #setup_load_paths ⇒ Object
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_assertions ⇒ Object
13 14 15 |
# File 'lib/adva/testing/engine.rb', line 13 def load_assertions load_all('lib/testing/assertions') end |
#load_cucumber_support ⇒ Object
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_factories ⇒ Object
17 18 19 |
# File 'lib/adva/testing/engine.rb', line 17 def load_factories load_all('lib/testing/factories') end |
#load_helpers ⇒ Object
27 28 29 |
# File 'lib/adva/testing/engine.rb', line 27 def load_helpers load_all('lib/testing/helpers') end |
#migrate ⇒ Object
9 10 11 |
# File 'lib/adva/testing/engine.rb', line 9 def migrate ActiveRecord::Migrator.up(root.join('db/migrate')) end |
#setup_load_paths ⇒ Object
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 |