Sha256: eeb5f6a2469e9dd58e57ba1ba9b4d4606f9b98084d29d698a0626181a6dfe91c

Contents?: true

Size: 442 Bytes

Versions: 1

Compression:

Stored size: 442 Bytes

Contents

require File.dirname(__FILE__) + '/../lib/stalker'
require 'contest'
require 'mocha'

module Stalker
	def log(msg)
	end
end

class StalkerTest < Test::Unit::TestCase
	setup do
		Stalker.clear!
		$result = -1
	end

	test "enqueue and work a job" do
		val = rand(999999)
		Stalker.job('my.job') { |args| $result = args['val'] }
		Stalker.enqueue('my.job', :val => val)
		Stalker.prep
		Stalker.work_one_job
		assert_equal val, $result
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stalker-0.4.0 test/stalker_test.rb