Sha256: 2d5fc913d1913014414d35a81066f31d1b53f4ba7b5ccd28c1ba1d58ea3eca86

Contents?: true

Size: 1.52 KB

Versions: 14

Compression:

Stored size: 1.52 KB

Contents

require 'lib/fossil'
require 'spec'
require 'rr'
require 'pp'

unless defined?(DB_DEMO)
  DB_DEMO = Sequel.odbc('demodata')#, :loggers=>[Logger.new($stdout)])
  DB_DEMO.extend(Sequel::Pervasive::DatabaseMethods)
                                                  
  DB_FOS = Sequel.odbc('fos')#, :loggers=>[Logger.new($stdout)])
  DB_FOS.extend(Sequel::Pervasive::DatabaseMethods)
end

require File.dirname(__FILE__) + "/helper_methods"
require File.dirname(__FILE__) + "/helper_classes"
##### custom matchers #####
require File.dirname(__FILE__) + "/be_model_with_values_matcher"

Spec::Runner.configure do |config|
  config.include(HelperMethods)
  config.mock_with :rr
  config.include(BeModelWithValuesMatcher)
end

# These are special modifictations for testing with mysql db instead of pervasive
# if its not windows or linux where pervasive db is running ) .. modify the
# pervasive adapter to act more like mysql, so that the tests can still run.
# This is not ideal, but it works
unless RUBY_PLATFORM =~ /mswin32|linux/

  module Sequel::Pervasive::DatabaseMethods
    def auto_increment_sql; "AUTO_INCREMENT" end
    def begin_transaction_sql; "BEGIN" end
    def commit_transaction_sql; "COMMIT" end
    def rollback_transaction_sql; "ROLLBACK" end
  end

  module Sequel::Pervasive::DatasetMethods
    def quoted_identifier(name, convert=true)
      convert ? "`#{convert_aliased_col_to_real_col(name)}`" : "`#{name}`"
    end

    def select_clause_methods
      super
    end

    def select_limit_sql(sql)
      super(sql)
    end
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
fossil-0.3.44 spec/spec_helper.rb
fossil-0.3.43 spec/spec_helper.rb
fossil-0.3.42 spec/spec_helper.rb
fossil-0.3.41 spec/spec_helper.rb
fossil-0.3.40 spec/spec_helper.rb
fossil-0.3.39 spec/spec_helper.rb
fossil-0.3.38 spec/spec_helper.rb
fossil-0.3.37 spec/spec_helper.rb
fossil-0.3.36 spec/spec_helper.rb
fossil-0.3.35 spec/spec_helper.rb
fossil-0.3.34 spec/spec_helper.rb
fossil-0.3.33 spec/spec_helper.rb
fossil-0.3.26 spec/spec_helper.rb
fossil-0.3.25 spec/spec_helper.rb