Sha256: 114c0d7ff27f363e0115f4bbe57b85440249fa3a91181fefef0e4003e8284ec2

Contents?: true

Size: 483 Bytes

Versions: 11

Compression:

Stored size: 483 Bytes

Contents

require "spec_helper"

describe "Simple::SQL.all into: argument" do
  let!(:users) { 1.upto(USER_COUNT).map { create(:user) } }

  it "calls the database" do
    r = SQL.all("SELECT * FROM users", into: Hash)
    expect(r).to be_a(Array)
    expect(r.length).to eq(USER_COUNT)
    expect(r.map(&:class).uniq).to eq([Hash])
  end

  it "returns an empty array when there is no match" do
    r = SQL.all("SELECT * FROM users WHERE FALSE", into: Hash)
    expect(r).to eq([])
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
simple-sql-0.4.9 spec/simple/sql_all_into_spec.rb
simple-sql-0.4.8 spec/simple/sql_all_into_spec.rb
simple-sql-0.4.7 spec/simple/sql_all_into_spec.rb
simple-sql-0.4.5 spec/simple/sql_all_into_spec.rb
simple-sql-0.4.4 spec/simple/sql_all_into_spec.rb
simple-sql-0.4.3 spec/simple/sql_all_into_spec.rb
simple-sql-0.4.2 spec/simple/sql_all_into_spec.rb
simple-sql-0.4.1 spec/simple/sql_all_into_spec.rb
simple-sql-0.4.0 spec/simple/sql_all_into_spec.rb
simple-sql-0.3.7 spec/simple/sql_all_into_spec.rb
simple-sql-0.3.6 spec/simple/sql_all_into_spec.rb