myabc / merb_global

Localization (L10n) and Internationalization (i18n) support for the Merb MVC Framework

fbettag (author)
Tue Sep 01 05:33:09 -0700 2009
myabc (committer)
Tue Sep 01 05:33:09 -0700 2009
commit  6e58d387d700322de45dd5fff3f63cd446793c53
tree    33fc4fe028e981f9384dcbbdfc0fa75f4d9dc62a
parent  1ffc3f880a9c3a3edd3d3a57a97f23a1425b4771
merb_global / spec / spec_helper.rb
100644 37 lines (28 sloc) 0.874 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
require 'rubygems'
 
# Providers
def load_provider_lib(*libs)
  begin
    libs.each {|lib| require lib}
    true
  rescue Gem::LoadError => e
    warn "Could not load #{lib}: #{e}"
    false
  end
end
 
HAS_AR = load_provider_lib 'activerecord'
HAS_DM = load_provider_lib 'dm-core', 'dm-validations', 'dm-aggregates'
HAS_GETTEXT = load_provider_lib 'gettext'
HAS_SEQUEL = load_provider_lib 'sequel'
 
require 'merb-core'
 
Merb::Plugins.config[:merb_global] = {
  :provider => 'mock',
  :localedir => File.join('spec', 'locale')
}
 
require 'pathname'
require Pathname(__FILE__).dirname.parent.expand_path.to_s + '/lib/merb_global'
 
Merb.start_environment(:testing => true, :adapter => 'runner', :environment => ENV['MERB_ENV'] || 'test')
 
require 'spec'
 
Spec::Runner.configure do |config|
  config.include(Merb::Test::ControllerHelper)
  config.mock_with :mocha
end