Class: Procrastinator::Test::MockTask

Inherits:
Object
  • Object
show all
Defined in:
lib/procrastinator/test/mocks.rb

Overview

Testing mock Task class

You can use this like:

require 'procrastinator/rspec/mocks'
# ...
Procrastinator.config do |c|
   c.define_queue :test_queue, Procrastinator::RSpec::MockTask
end

Direct Known Subclasses

MockDataTask

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#containerObject

Returns the value of attribute container.



24
25
26
# File 'lib/procrastinator/test/mocks.rb', line 24

def container
  @container
end

#loggerObject

Returns the value of attribute logger.



24
25
26
# File 'lib/procrastinator/test/mocks.rb', line 24

def logger
  @logger
end

#schedulerObject

Returns the value of attribute scheduler.



24
25
26
# File 'lib/procrastinator/test/mocks.rb', line 24

def scheduler
  @scheduler
end

Instance Method Details

#runObject

Records that the mock task was run.



27
28
29
# File 'lib/procrastinator/test/mocks.rb', line 27

def run
   @run = true
end

#run?Boolean



32
33
34
# File 'lib/procrastinator/test/mocks.rb', line 32

def run?
   @run
end