Sha256: 9c6aa449bbc016fc92756a618b0151bba660f391a20f7ac8107cede4df7b10e5

Contents?: true

Size: 610 Bytes

Versions: 45

Compression:

Stored size: 610 Bytes

Contents

require_relative "spec_helper"

describe "error_sql extension" do
  before do
    @db = Sequel.mock(:fetch=>proc{|sql| @db.log_connection_yield(sql, nil){raise StandardError}}).extension(:error_sql)
  end

  it "should have Sequel::DatabaseError#sql give the SQL causing the error" do
    @db["SELECT"].all rescue (e = $!)
    e.sql.must_equal "SELECT"
  end

  it "should have Sequel::DatabaseError#sql give the SQL causing the error when using a logger" do
    l = Object.new
    def l.method_missing(*) end
    @db.loggers = [l]
    @db["SELECT"].all rescue (e = $!)
    e.sql.must_equal "SELECT"
  end
end

Version data entries

45 entries across 41 versions & 2 rubygems

Version Path
tdiary-5.1.2 vendor/bundle/ruby/2.6.0/gems/sequel-5.26.0/spec/extensions/error_sql_spec.rb
tdiary-5.1.1 vendor/bundle/ruby/2.7.0/gems/sequel-5.29.0/spec/extensions/error_sql_spec.rb
tdiary-5.1.1 vendor/bundle/ruby/2.6.0/gems/sequel-5.26.0/spec/extensions/error_sql_spec.rb
sequel-5.29.0 spec/extensions/error_sql_spec.rb
sequel-5.28.0 spec/extensions/error_sql_spec.rb
sequel-5.27.0 spec/extensions/error_sql_spec.rb
tdiary-5.1.0 vendor/bundle/gems/sequel-5.26.0/spec/extensions/error_sql_spec.rb
sequel-5.26.0 spec/extensions/error_sql_spec.rb
sequel-5.25.0 spec/extensions/error_sql_spec.rb
sequel-5.24.0 spec/extensions/error_sql_spec.rb
sequel-5.23.0 spec/extensions/error_sql_spec.rb
sequel-5.22.0 spec/extensions/error_sql_spec.rb
sequel-5.21.0 spec/extensions/error_sql_spec.rb
sequel-5.20.0 spec/extensions/error_sql_spec.rb
tdiary-5.0.13 vendor/bundle/gems/sequel-5.18.0/spec/extensions/error_sql_spec.rb
sequel-5.19.0 spec/extensions/error_sql_spec.rb
tdiary-5.0.12.1 vendor/bundle/gems/sequel-5.18.0/spec/extensions/error_sql_spec.rb
sequel-5.18.0 spec/extensions/error_sql_spec.rb
sequel-5.17.0 spec/extensions/error_sql_spec.rb
sequel-5.16.0 spec/extensions/error_sql_spec.rb