-
Notifications
You must be signed in to change notification settings - Fork 28
/
env.rb
23 lines (18 loc) · 863 Bytes
/
env.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Sets up the Merb environment for Cucumber (thanks to krzys and roman)
require "rubygems"
# Add the local gems dir if found within the app root; any dependencies loaded
# hereafter will try to load from the local gems before loading system gems.
if (local_gem_dir = File.join(File.dirname(__FILE__), '..', 'gems')) && $BUNDLE.nil?
$BUNDLE = true; Gem.clear_paths; Gem.path.unshift(local_gem_dir)
end
require "merb-core"
require "spec"
require "merb_cucumber/world/<%= session_type %>"
<% if orm == :datamapper -%>
require "merb_cucumber/helpers/datamapper"
<% elsif orm == :activerecord -%>
require "merb_cucumber/helpers/activerecord"
<% end -%>
# Uncomment if you want transactional fixtures
# Merb::Test::World::Base.use_transactional_fixtures
Merb.start_environment(:testing => true, :adapter => 'runner', :environment => ENV['MERB_ENV'] || 'test')