Sha256: bf66ed3b2d7ba761f2b52b15107961a220ac56829f9bf5a8ab8902ccedb382ff

Contents?: true

Size: 490 Bytes

Versions: 4

Compression:

Stored size: 490 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Relation, '#restrict' do
  include_context 'Relation'

  share_examples_for 'restricted relation' do
    specify do
      should eq([jane])
    end
  end

  context 'with condition hash' do
    subject { relation.restrict(name: 'Jane').to_a }

    it_behaves_like 'restricted relation'
  end

  context 'with a block' do
    subject { relation.restrict { |r| r.name.eq('Jane') }.to_a }

    it_behaves_like 'restricted relation'
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
rom-0.2.0 spec/unit/rom/relation/restrict_spec.rb
rom-relation-0.1.2 spec/unit/rom/relation/restrict_spec.rb
rom-relation-0.1.1 spec/unit/rom/relation/restrict_spec.rb
rom-relation-0.1.0 spec/unit/rom/relation/restrict_spec.rb