Sha256: 4efd19b9f6a5550be2cf12bcc6c0da6021301a8ad513e36fece3b9622e9f0a76

Contents?: true

Size: 686 Bytes

Versions: 1

Compression:

Stored size: 686 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Relation::Operation::Limit::Methods, '#take' do
  subject { object.take(limit) }

  let(:described_class) { Relation                                                         }
  let(:limit)           { 1                                                                }
  let(:relation)        { described_class.new([ [ :id, Integer ] ], [ [ 1 ], [ 2 ] ].each) }
  let(:object)          { relation.order                                                   }

  it { should be_kind_of(Relation::Operation::Limit) }

  its(:limit) { should == limit }

  it 'behaves the same as Array#take' do
    should == object.to_a.take(limit)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
veritas-0.0.4 spec/unit/veritas/relation/operation/limit/methods/take_spec.rb