Sha256: 3dcabc798e2a4c15faba5999664bfd11d2234a84e2bff01e7d3d93aba365c4e9
Contents?: true
Size: 984 Bytes
Versions: 3
Compression:
Stored size: 984 Bytes
Contents
require 'helper' describe Plucky::Pagination::Collection do context "Object decorated with Collection with paginator set" do before do @object = [1, 2, 3, 4] @object_id = @object.object_id @paginator = Plucky::Pagination::Paginator.new(20, 2, 10) end subject { Plucky::Pagination::Collection.new(@object, @paginator) } it "knows paginator" do subject.paginator.should == @paginator end [:total_entries, :current_page, :per_page, :total_pages, :out_of_bounds?, :previous_page, :next_page, :skip, :limit, :offset].each do |method| it "delegates #{method} to paginator" do subject.send(method).should == @paginator.send(method) end end it "does not interfere with other methods on the object" do @object.object_id.should == @object_id @object.should == [1, 2, 3, 4] @object.size.should == 4 @object.select { |o| o > 2 }.should == [3, 4] end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
plucky-0.6.6 | spec/plucky/pagination/collection_spec.rb |
plucky-0.6.5 | spec/plucky/pagination/collection_spec.rb |
plucky-0.6.4 | spec/plucky/pagination/collection_spec.rb |