Class: Jbr::Mock::Jobs

Inherits:
Jobs show all
Defined in:
lib/jbr/mock/jobs.rb

Overview

The jobs an app under test asked Jbr.mock to answer with. Only the walk is mocked: narrowing a list, and reading it as records or as IDs, is the same code a real one runs.

Constant Summary

Constants inherited from Jobs

Jobs::FIELDS

Constants included from Listable

Listable::IDS_PAGE, Listable::PAGE

Instance Attribute Summary

Attributes inherited from Resource

#id

Instance Method Summary collapse

Methods included from Includable

#includes

Methods included from Listable

#each, #ids, #past, #upcoming

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Jbr::Resource

Instance Method Details

#find(id) ⇒ Mock::Job

The job filed under that ID where the app listed one, and otherwise the single job it named — which is every app that mocks a lookup without mocking a list.

Returns:



8
# File 'lib/jbr/mock/jobs.rb', line 8

def find(id) = Mock::Job.new node: listed(id) || Jbr.mock.job