Class: Quo::Testing::CollectionBackedFake
- Inherits:
-
Object
- Object
- Quo::Testing::CollectionBackedFake
- Defined in:
- lib/quo/testing/collection_backed_fake.rb,
sig/generated/quo/testing/collection_backed_fake.rbs
Overview
Test helper for creating fake collection-backed queries with predefined results
Instance Method Summary collapse
Instance Method Details
#collection ⇒ Object
12 13 14 |
# File 'lib/quo/testing/collection_backed_fake.rb', line 12 def collection @results end |
#page_count ⇒ Object
25 26 27 |
# File 'lib/quo/testing/collection_backed_fake.rb', line 25 def page_count @page_count || validated_query.size end |
#results ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/quo/testing/collection_backed_fake.rb', line 16 def results klass = Class.new(CollectionResults) do def page_count @query.page_count end end klass.new(self) end |