test/manager_test.rb in clockwork-1.1.0 vs test/manager_test.rb in clockwork-1.2.0

- old
+ new

@@ -1,13 +1,14 @@ require File.expand_path('../../lib/clockwork', __FILE__) require 'rubygems' -require 'contest' +require 'test/unit' require 'mocha/setup' require 'time' require 'active_support/time' +require 'active_support/test_case' -class ManagerTest < Test::Unit::TestCase +class ManagerTest < ActiveSupport::TestCase setup do @manager = Clockwork::Manager.new class << @manager def log(msg); end end @@ -152,9 +153,19 @@ test "configuration should have reasonable defaults" do assert_equal 1, @manager.config[:sleep_timeout] assert @manager.config[:logger].is_a?(Logger) assert_equal 10, @manager.config[:max_threads] assert_equal false, @manager.config[:thread] + end + + test "should accept unnamed job" do + event = @manager.every(1.minute) + assert_equal 'unnamed', event.job + end + + test "should accept options without job name" do + event = @manager.every(1.minute, {}) + assert_equal 'unnamed', event.job end describe ':at option' do test "once a day at 16:20" do @manager.every(1.day, 'myjob', :at => '16:20')