Sha256: d5b867676f78c4fa625aa72d917a5249da937cbdad581beaa0a0f1c0ac7588e1

Contents?: true

Size: 620 Bytes

Versions: 25

Compression:

Stored size: 620 Bytes

Contents

RSpec.describe ROM::Relation, '#fetch' do
  subject(:relation) { container.relations.users }

  include_context 'users and tasks'

  with_adapters do
    describe '#fetch' do
      it 'returns a single tuple identified by the pk' do
        expect(relation.fetch(1)).to eql(id: 1, name: 'Jane')
      end

      it 'raises when tuple was not found' do
        expect { relation.fetch(535315412) }.to raise_error(ROM::TupleCountMismatchError)
      end

      it 'raises when more tuples were returned' do
        expect { relation.fetch([1, 2]) }.to raise_error(ROM::TupleCountMismatchError)
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
rom-sql-1.3.5 spec/unit/relation/fetch_spec.rb
rom-sql-1.3.4 spec/unit/relation/fetch_spec.rb
rom-sql-2.0.0.beta2 spec/unit/relation/fetch_spec.rb
rom-sql-2.0.0.beta1 spec/unit/relation/fetch_spec.rb
rom-sql-1.3.3 spec/unit/relation/fetch_spec.rb
rom-sql-1.3.2 spec/unit/relation/fetch_spec.rb
rom-sql-1.3.1 spec/unit/relation/fetch_spec.rb
rom-sql-1.3.0 spec/unit/relation/fetch_spec.rb
rom-sql-1.2.2 spec/unit/relation/fetch_spec.rb
rom-sql-1.2.1 spec/unit/relation/fetch_spec.rb
rom-sql-1.2.0 spec/unit/relation/fetch_spec.rb
rom-sql-1.1.2 spec/unit/relation/fetch_spec.rb
rom-sql-1.1.1 spec/unit/relation/fetch_spec.rb
rom-sql-1.1.0 spec/unit/relation/fetch_spec.rb
rom-sql-1.0.3 spec/unit/relation/fetch_spec.rb
rom-sql-1.0.2 spec/unit/relation/fetch_spec.rb
rom-sql-1.0.1 spec/unit/relation/fetch_spec.rb
rom-sql-1.0.0 spec/unit/relation/fetch_spec.rb
rom-sql-1.0.0.rc2 spec/unit/relation/fetch_spec.rb
rom-sql-1.0.0.rc1 spec/unit/relation/fetch_spec.rb