Sha256: 3f3dff1303dc2e720dd7d6315e05ad2dc187a366ed32891f81608f0fb67a9491

Contents?: true

Size: 575 Bytes

Versions: 17

Compression:

Stored size: 575 Bytes

Contents

require 'spec_helper'

describe Riddle::Query::Delete do
  it 'handles a single id' do
    query = Riddle::Query::Delete.new 'foo_core', 5
    query.to_sql.should == 'DELETE FROM foo_core WHERE id = 5'
  end
  
  it 'handles multiple ids' do
    query = Riddle::Query::Delete.new 'foo_core', 5, 6, 7
    query.to_sql.should == 'DELETE FROM foo_core WHERE id IN (5, 6, 7)'
  end
  
  it 'handles multiple ids in an explicit array' do
    query = Riddle::Query::Delete.new 'foo_core', [5, 6, 7]
    query.to_sql.should == 'DELETE FROM foo_core WHERE id IN (5, 6, 7)'
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
riddle-2.1.0 spec/riddle/query/delete_spec.rb
riddle-2.0.0 spec/riddle/query/delete_spec.rb
riddle-1.5.12 spec/riddle/query/delete_spec.rb
riddle-1.5.11 spec/riddle/query/delete_spec.rb
riddle-1.5.10 spec/riddle/query/delete_spec.rb
riddle-1.5.9 spec/riddle/query/delete_spec.rb
riddle-1.5.8 spec/riddle/query/delete_spec.rb
riddle-1.5.7 spec/riddle/query/delete_spec.rb
riddle-1.5.6 spec/riddle/query/delete_spec.rb
riddle-1.5.5 spec/riddle/query/delete_spec.rb
riddle-1.5.4 spec/riddle/query/delete_spec.rb
riddle-1.5.3 spec/riddle/query/delete_spec.rb
riddle-1.5.2 spec/riddle/query/delete_spec.rb
riddle-1.5.1 spec/riddle/query/delete_spec.rb
riddle-1.5.0 spec/riddle/query/delete_spec.rb
riddle-1.4.0 spec/riddle/query/delete_spec.rb
riddle-1.3.3 spec/riddle/query/delete_spec.rb