Sha256: 3290daa705b0ca080964fcbd655d7f405037aeb6244d06db4ec316b34101e891

Contents?: true

Size: 609 Bytes

Versions: 6

Compression:

Stored size: 609 Bytes

Contents

require_relative '../../spec_helper'
require 'sql/maker/condition'

describe SQL::Maker::Condition do
  it '[]' do
    w = SQL::Maker::Condition.new()
    w.add(:x => [])
    expect(w.as_sql).to be == '(0=1)'
    expect(w.bind.join(', ')).to be == ''
  end

  it 'in' do
    w = SQL::Maker::Condition.new()
    w.add(:x => { 'IN' => [] })
    expect(w.as_sql).to be == '(0=1)'
    expect(w.bind.join(', ')).to be == ''
  end

  it 'not in' do
    w2 = SQL::Maker::Condition.new()
    w2.add(:x => { 'NOT IN' => [] })
    expect(w2.as_sql).to be == '(1=1)'
    expect(w2.bind.join(', ')).to be == ''
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sql-maker-1.0.0 spec/maker/condition/empty_values_spec.rb
sql-maker-0.0.5 spec/maker/condition/empty_values_spec.rb
sql-maker-0.0.4 spec/maker/condition/empty_values_spec.rb
sql-maker-0.0.3 spec/maker/condition/empty_values_spec.rb
sql-maker-0.0.2 spec/maker/condition/empty_values_spec.rb
sql-maker-0.0.1 spec/maker/condition/empty_values_spec.rb