Skip to content

Commit

Permalink
Make schedules easier to set up
Browse files Browse the repository at this point in the history
Fixes #146
  • Loading branch information
avit committed Feb 12, 2013
1 parent 9b7977d commit 8da16ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/ice_cube/schedule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def initialize(start_time = nil, options = {})
self.end_time = options[:end_time] if options[:end_time]
@all_recurrence_rules = []
@all_exception_rules = []
yield self if block_given?
end

# Set start_time
Expand Down
8 changes: 8 additions & 0 deletions spec/examples/schedule_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@

include IceCube

it 'yields itself for configuration' do
t1 = Time.utc(2013, 2, 12, 12, 34 ,56)
schedule = IceCube::Schedule.new do |s|
s.start_time = t1
end
schedule.start_time.should == t1
end

describe :duration do

it 'should be based on end_time' do
Expand Down

0 comments on commit 8da16ad

Please sign in to comment.