spec/unit/veritas/relation/operation/limit/methods/last_spec.rb in veritas-0.0.4 vs spec/unit/veritas/relation/operation/limit/methods/last_spec.rb in veritas-0.0.5
- old
+ new
@@ -3,16 +3,16 @@
require 'spec_helper'
describe Relation::Operation::Limit::Methods, '#last' do
let(:described_class) { Relation }
let(:relation) { described_class.new([ [ :id, Integer ] ], [ [ 1 ], [ 2 ], [ 3 ] ].each) }
- let(:object) { relation.order }
+ let(:object) { relation.sort_by { |r| r.id } }
context 'with no arguments' do
subject { object.last }
- it { should be_kind_of(Relation::Operation::Reverse) }
+ it { should be_instance_of(Relation::Operation::Reverse) }
it 'returns the expected tuples' do
should == [ [ 3 ] ]
end
@@ -24,10 +24,10 @@
context 'with a limit' do
subject { object.last(limit) }
let(:limit) { 2 }
- it { should be_kind_of(Relation::Operation::Reverse) }
+ it { should be_instance_of(Relation::Operation::Reverse) }
it 'returns the expected tuples' do
should == [ [ 2 ], [ 3 ] ]
end