Sha256: a645c8f98d9c7dc519f6fbaec9b4a982d58d011fc7ea3b457e1dbbeea6bb667b

Contents?: true

Size: 992 Bytes

Versions: 9

Compression:

Stored size: 992 Bytes

Contents

require File.expand_path('../../lib/clockwork', __FILE__)
require 'contest'

class EventTest < Test::Unit::TestCase
  describe "#thread?" do
    setup do
      @manager = mock
    end

    describe "manager config thread option set to true" do
      setup do
        @manager.stubs(:config).returns({ :thread => true })
      end

      test "is true" do
        event = Clockwork::Event.new(@manager, nil, nil, nil)
        assert_equal true, event.thread?
      end

      test "is false when event thread option set" do
        event = Clockwork::Event.new(@manager, nil, nil, nil, :thread => false)
        assert_equal false, event.thread?
      end
    end

    describe "manager config thread option not set" do
      setup do
        @manager.stubs(:config).returns({})
      end

      test "is true if event thread option is true" do
        event = Clockwork::Event.new(@manager, nil, nil, nil, :thread => true)
        assert_equal true, event.thread?
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
clockwork-1.1.0 test/event_test.rb
clockwork-1.0.2 test/event_test.rb
clockwork-1.0.0 test/event_test.rb
clockwork-0.7.7 test/event_test.rb
clockwork-0.7.5 test/event_test.rb
clockwork-0.7.4 test/event_test.rb
clockwork-0.7.3 test/event_test.rb
clockwork-0.7.2 test/event_test.rb
clockwork-0.7.1 test/event_test.rb