Sha256: 9ad48b6e802da1b479924a37dd12a0ae4e134e6019c9eeb473f21097abd025c5
Contents?: true
Size: 568 Bytes
Versions: 35
Compression:
Stored size: 568 Bytes
Contents
# frozen_string_literal: true require_relative 'helper' require 'sequel' class SequelExtraliteTest < MiniTest::Test def test_sequel db = Sequel.connect('extralite::memory:') db.create_table :items do primary_key :id String :name, unique: true, null: false Float :price, null: false end items = db[:items] items.insert(name: 'abc', price: 123) items.insert(name: 'def', price: 456) items.insert(name: 'ghi', price: 789) assert_equal 3, items.count assert_equal (123+456+789) / 3, items.avg(:price) end end
Version data entries
35 entries across 35 versions & 2 rubygems