Sha256: 0ac73a37d3e4ba9b15eb01243ceb01c9f336ef69b5686d53df14412d801fea77

Contents?: true

Size: 535 Bytes

Versions: 2

Compression:

Stored size: 535 Bytes

Contents

require 'helper'
require 'jobs/hello_job'

class LockTest < ActiveSupport::TestCase

  test 'no lock by default' do
    assert_nil HelloJob.lock
  end

  test 'uses given lock' do
    begin
      HelloJob.lock_with 'Lock'
      assert_equal 'Lock', HelloJob.new.lock
    ensure
      HelloJob.lock_with nil
    end
  end

  test 'uses given lock block' do
    begin
      proc = Proc.new { |arg| arg }
      HelloJob.lock_with(&proc)
      assert_equal proc, HelloJob.new.lock
    ensure
      HelloJob.lock_with nil
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activejob-lock-0.0.2 test/cases/lock_test.rb
activejob-lock-0.0.1 test/cases/lock_test.rb