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

Version Path
extralite-bundle-1.16 test/test_sequel.rb
extralite-1.16 test/test_sequel.rb
extralite-bundle-1.15 test/test_sequel.rb
extralite-1.15 test/test_sequel.rb
extralite-bundle-1.14 test/test_sequel.rb
extralite-1.14 test/test_sequel.rb
extralite-1.13.1 test/test_sequel.rb
extralite-1.13 test/test_sequel.rb
extralite-1.12 test/test_sequel.rb
extralite-1.11 test/test_sequel.rb
extralite-1.10 test/test_sequel.rb
extralite-1.9 test/test_sequel.rb
extralite-1.8.2 test/test_sequel.rb
extralite-1.8.1 test/test_sequel.rb
extralite-1.7 test/test_sequel.rb