Sha256: 18da5bf4ca474d4bdbbec5745880fddabcafe4e01b8005d795279fef5c1f459c

Contents?: true

Size: 491 Bytes

Versions: 8

Compression:

Stored size: 491 Bytes

Contents

require 'spec_helper'

describe 'Inferring schema from database' do
  include_context 'database setup'

  context "when database schema exists" do
    it "infers the schema from the database relations" do
      expect(rom.relations.users.to_a)
        .to eql(rom.repositories[:default][:users].to_a)
    end
  end

  context "for empty database schemas" do
    it "returns an empty schema" do
      drop_tables

      expect { rom.not_here }.to raise_error(NoMethodError)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rom-sql-0.5.1 spec/unit/schema_spec.rb
rom-sql-0.5.0 spec/unit/schema_spec.rb
rom-sql-0.4.3 spec/unit/schema_spec.rb
rom-sql-0.4.1 spec/unit/schema_spec.rb
rom-sql-0.4.0 spec/unit/schema_spec.rb
rom-sql-0.4.0.rc1 spec/unit/schema_spec.rb
rom-sql-0.4.0.beta2 spec/unit/schema_spec.rb
rom-sql-0.4.0.beta1 spec/unit/schema_spec.rb