Sha256: 9ce27ed94bd9b023f54221e12d5fbdd524501a06f836a86b167a409aa019e99c
Contents?: true
Size: 1.17 KB
Versions: 4
Compression:
Stored size: 1.17 KB
Contents
require 'rubygems' unless Object.const_defined?('Sequel') $:.unshift(File.join(File.dirname(__FILE__), "../../lib/")) require 'sequel' end begin require File.join(File.dirname(__FILE__), '../spec_config.rb') rescue LoadError end $sqls = [] def clear_sqls $sqls.clear end if defined?(INTEGRATION_DB) || defined?(INTEGRATION_URL) || ENV['SEQUEL_INTEGRATION_URL'] unless defined?(INTEGRATION_DB) url = defined?(INTEGRATION_URL) ? INTEGRATION_URL : ENV['SEQUEL_INTEGRATION_URL'] INTEGRATION_DB = Sequel.connect(url) end class Spec::Example::ExampleGroup def sqls_should_be(*args) end end else sql_logger = Object.new def sql_logger.info(str) $sqls << str end INTEGRATION_DB = Sequel.sqlite('', :loggers=>[sql_logger], :quote_identifiers=>false) class Spec::Example::ExampleGroup def sqls_should_be(*sqls) sqls.zip($sqls).each do |should_be, is| case should_be when String is.should == should_be when Regexp is.should =~ should_be else raise ArgumentError, "need String or RegExp" end end $sqls.length.should == sqls.length clear_sqls end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
sequel-2.8.0 | spec/integration/spec_helper.rb |
sequel-2.7.0 | spec/integration/spec_helper.rb |
sequel-2.7.1 | spec/integration/spec_helper.rb |
sequel-2.9.0 | spec/integration/spec_helper.rb |