Sha256: f9c3f75f44de65600bcf568f9b168980e14e9ce80c7e97ea1dd9b3663fbc5628

Contents?: true

Size: 417 Bytes

Versions: 18

Compression:

Stored size: 417 Bytes

Contents

require 'rom/schema'

RSpec.describe ROM::Schema, '#project' do
  subject(:schema) do
    define_schema(:users, id: :Int, name: :String, age: :Int)
  end

  it 'projects provided attribute names' do
    expect(schema.project(:name, :age).map(&:name)).to eql(%i[name age])
  end

  it 'projects provided attributes' do
    expect(schema.project(schema[:name], schema[:age]).map(&:name)).to eql(%i[name age])
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
rom-3.3.3 spec/unit/rom/schema/project_spec.rb
rom-3.3.2 spec/unit/rom/schema/project_spec.rb
rom-3.3.1 spec/unit/rom/schema/project_spec.rb
rom-3.3.0 spec/unit/rom/schema/project_spec.rb
rom-3.2.3 spec/unit/rom/schema/project_spec.rb
rom-3.2.2 spec/unit/rom/schema/project_spec.rb
rom-3.2.1 spec/unit/rom/schema/project_spec.rb
rom-3.2.0 spec/unit/rom/schema/project_spec.rb
rom-3.1.0 spec/unit/rom/schema/project_spec.rb
rom-3.0.3 spec/unit/rom/schema/project_spec.rb
rom-3.0.2 spec/unit/rom/schema/project_spec.rb
rom-3.0.1 spec/unit/rom/schema/project_spec.rb
rom-3.0.0 spec/unit/rom/schema/project_spec.rb
rom-3.0.0.rc2 spec/unit/rom/schema/project_spec.rb
rom-3.0.0.rc1 spec/unit/rom/schema/project_spec.rb
rom-3.0.0.beta3 spec/unit/rom/schema/project_spec.rb
rom-3.0.0.beta2 spec/unit/rom/schema/project_spec.rb
rom-3.0.0.beta1 spec/unit/rom/schema/project_spec.rb