Sha256: 9e4f4e0a369e145299eeef9f86c8e125e36cb2d61eea5096f812b6ecc982b093
Contents?: true
Size: 1.47 KB
Versions: 3
Compression:
Stored size: 1.47 KB
Contents
# # testing Ruote # # since Mon Oct 9 22:19:44 JST 2006 # require 'ruote/storage/hash_storage' require 'ruote/storage/fs_storage' def locate_storage_impl (arg) pers = arg[2..-1] path = File.expand_path( File.join(File.dirname(__FILE__), %w[ .. .. .. ], "ruote-#{pers}")) (File.exist?(path) && File.directory?(path)) ? [ pers, path ] : nil end # # Returns the class of the engine to use, based on the ARGV # def determine_storage (opts) if ARGV.include?('--help') puts %{ ARGUMENTS for functional tests : --fs : uses Ruote::FsStorage else uses the in-memory Ruote::Engine (fastest, but no persistence at all) } exit 0 end ps = ARGV.select { |a| a.match(/^--/) } ps.delete('--split') persistent = opts.delete(:persistent) if ps.include?('--fs') begin require 'yajl' rescue LoadError require 'json' end Rufus::Json.detect_backend Ruote::FsStorage.new('work', opts) elsif not ps.empty? pers = nil ps.each do |a| pers = locate_storage_impl(a) break if pers end raise "no persistence found (#{ps.inspect})" unless pers lib, path = pers $:.unshift(File.join(path, 'lib')) load File.join(path, %w[ test integration_connection.rb ]) new_storage(opts) elsif persistent begin require 'yajl' rescue LoadError require 'json' end Rufus::Json.detect_backend Ruote::FsStorage.new('work', opts) else Ruote::HashStorage.new(opts) end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
ruote-2.1.9 | test/functional/storage_helper.rb |
ruote-2.1.8 | test/functional/storage_helper.rb |
ruote-2.1.7 | test/functional/storage_helper.rb |