Sha256: 88c83da1efed0c55fb970ea2b9336260ee24842a70be822a4ebfb1ed2b42fc4c
Contents?: true
Size: 544 Bytes
Versions: 11
Compression:
Stored size: 544 Bytes
Contents
require "spec_helper" describe "Simple::SQL.ask into: :struct" do let!(:users) { 1.upto(USER_COUNT).map { create(:user) } } it "calls the database" do r = SQL.ask("SELECT COUNT(*) AS count FROM users", into: :struct) expect(r.count).to eq(2) expect(r.class.members).to eq([:count]) end it "reuses the struct" do r1 = SQL.ask("SELECT COUNT(*) AS count FROM users", into: :struct) r2 = SQL.ask("SELECT COUNT(*) AS count FROM users", into: :struct) expect(r1.class.object_id).to eq(r2.class.object_id) end end
Version data entries
11 entries across 11 versions & 1 rubygems