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.26 test/test_sequel.rb
extralite-1.26 test/test_sequel.rb
extralite-bundle-1.25 test/test_sequel.rb
extralite-1.25 test/test_sequel.rb
extralite-bundle-1.24 test/test_sequel.rb
extralite-1.24 test/test_sequel.rb
extralite-bundle-1.23 test/test_sequel.rb
extralite-1.23 test/test_sequel.rb
extralite-bundle-1.22 test/test_sequel.rb
extralite-1.22 test/test_sequel.rb
extralite-bundle-1.21 test/test_sequel.rb
extralite-1.21 test/test_sequel.rb
extralite-bundle-1.20 test/test_sequel.rb
extralite-1.20 test/test_sequel.rb
extralite-bundle-1.19 test/test_sequel.rb
extralite-1.19 test/test_sequel.rb
extralite-bundle-1.18 test/test_sequel.rb
extralite-1.18 test/test_sequel.rb
extralite-bundle-1.17 test/test_sequel.rb
extralite-1.17 test/test_sequel.rb