spec/spec_helper.rb in dm-is-remixable-0.9.8 vs spec/spec_helper.rb in dm-is-remixable-0.9.9
- old
+ new
@@ -1,23 +1,27 @@
+require 'pathname'
require 'rubygems'
-gem 'rspec', '>=1.1.3'
+
+gem 'rspec', '~>1.1.11'
require 'spec'
-require 'pathname'
-require Pathname(__FILE__).dirname.expand_path.parent + 'lib/dm-is-remixable'
+ROOT = Pathname(__FILE__).dirname.parent.expand_path
+
+# use local dm-types if running from dm-more directly
+lib = ROOT.parent.join('dm-types', 'lib').expand_path
+$LOAD_PATH.unshift(lib) if lib.directory?
+
+require ROOT + 'lib/dm-is-remixable'
+
def load_driver(name, default_uri)
return false if ENV['ADAPTER'] != name.to_s
- lib = "do_#{name}"
-
begin
- gem lib, '~>0.9.7'
- require lib
DataMapper.setup(name, ENV["#{name.to_s.upcase}_SPEC_URI"] || default_uri)
DataMapper::Repository.adapters[:default] = DataMapper::Repository.adapters[name]
true
- rescue Gem::LoadError => e
- warn "Could not load #{lib}: #{e}"
+ rescue LoadError => e
+ warn "Could not load do_#{name}: #{e}"
false
end
end
ENV['ADAPTER'] ||= 'sqlite3'