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.

Constant Summary

Constants inherited from Jobs

Jobs::FIELDS

Instance Attribute Summary

Attributes inherited from Resource

#id

Instance Method Summary collapse

Methods included from Includable

#includes

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Jbr::Resource

Instance Method Details

#eachEnumerator<Mock::Job>

Returns every job the app named.

Returns:

  • (Enumerator<Mock::Job>)

    every job the app named.



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

def each(&) = mocked(Jbr.mock.jobs).each(&)

#find(_) ⇒ Mock::Job

Returns the one job the app named, whatever ID is asked for.

Returns:

  • (Mock::Job)

    the one job the app named, whatever ID is asked for.



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

def find(_) = Mock::Job.new node: Jbr.mock.job

#pastEnumerator<Mock::Job>

Returns those it dated before now.

Returns:

  • (Enumerator<Mock::Job>)

    those it dated before now.



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

def past = mocked Jbr.mock.jobs.select { |job| started? job }

#upcomingEnumerator<Mock::Job>

Returns those it dated from now on, and any it left undated.

Returns:

  • (Enumerator<Mock::Job>)

    those it dated from now on, and any it left undated.



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

def upcoming = mocked Jbr.mock.jobs.reject { |job| started? job }