Permalink
Browse files

Rest of the whitespace cleanup

  • Loading branch information...
1 parent fbd3abd commit baaae6de264193eb93ed04c89c506bd9f4e8b2e0 @seejohnrun committed Oct 31, 2012
Showing with 16 additions and 16 deletions.
  1. +1 −1 CHANGELOG
  2. +1 −1 lib/ice_cube/rule.rb
  3. +7 −7 spec/examples/active_support_spec.rb
  4. +1 −1 spec/examples/daily_rule_spec.rb
  5. +6 −6 spec/examples/rfc_spec.rb
View
@@ -6,7 +6,7 @@
0.6.1
* Lessen the amount of info we store in yaml on the time zone
-0.6.2
+0.6.2
* Patch release for to_yaml performance issue
0.6.3
@@ -113,7 +113,7 @@ def yearly(interval = 1)
end
end
-
+
end
end
@@ -13,19 +13,19 @@
dates = schedule.all_occurrences
dates.should == [start_date]
end
-
+
it 'works with a monthly recurrence rule in a TimeWithZone timezone' do
Time.zone = "Pacific Time (US & Canada)"
start_date = Time.zone.parse("2010-02-05 05:00:00")
schedule = IceCube::Schedule.new(start_date)
schedule.add_recurrence_rule IceCube::Rule.monthly
dates = schedule.first(10)
- dates.should == [Time.zone.parse("2010-02-05 05:00:00"), Time.zone.parse("2010-03-05 05:00:00"), Time.zone.parse("2010-04-05 05:00:00"),
+ dates.should == [Time.zone.parse("2010-02-05 05:00:00"), Time.zone.parse("2010-03-05 05:00:00"), Time.zone.parse("2010-04-05 05:00:00"),
Time.zone.parse("2010-05-05 05:00:00"), Time.zone.parse("2010-06-05 05:00:00"), Time.zone.parse("2010-07-05 05:00:00"),
- Time.zone.parse("2010-08-05 05:00:00"), Time.zone.parse("2010-09-05 05:00:00"), Time.zone.parse("2010-10-05 05:00:00"),
+ Time.zone.parse("2010-08-05 05:00:00"), Time.zone.parse("2010-09-05 05:00:00"), Time.zone.parse("2010-10-05 05:00:00"),
Time.zone.parse("2010-11-05 05:00:00")]
end
-
+
it 'works with a monthly schedule converting to UTC' do
Time.zone = "Eastern Time (US & Canada)"
start_date = Time.zone.parse("2009-10-28 19:30:00") #e9337
@@ -35,11 +35,11 @@
# get the utc dates
dates = dates.map { |d| d.getutc }
# check expectations
- dates.should == [Time.utc(2009, 10, 28, 23, 30, 0), Time.utc(2009, 11, 29, 0, 30, 0), Time.utc(2009, 12, 29, 0, 30, 0),
+ dates.should == [Time.utc(2009, 10, 28, 23, 30, 0), Time.utc(2009, 11, 29, 0, 30, 0), Time.utc(2009, 12, 29, 0, 30, 0),
Time.utc(2010, 1, 29, 0, 30, 0), Time.utc(2010, 3, 1, 0, 30, 0), Time.utc(2010, 3, 28, 23, 30, 0),
Time.utc(2010, 4, 28, 23, 30, 0)]
end
-
+
it 'can make a round trip to yaml with TimeWithZone' do
Time.zone = "Pacific Time (US & Canada)"
start_date = Time.zone.parse("2010-02-05 05:00:00")
@@ -68,6 +68,6 @@
schedule.add_recurrence_rule IceCube::Rule.daily
schedule.occurs_on?(Date.new(2009, 2, 7)).should be_true
end
-
+
end
@@ -26,7 +26,7 @@
start_date = Time.utc(2011, 12, 29)
schedule = IceCube::Schedule.new(start_date)
schedule.add_recurrence_rule IceCube::Rule.daily(2)
- #check assumption (3) -- (1) 2 (3) 4 (5) 6
+ #check assumption (3) -- (1) 2 (3) 4 (5) 6
dates = schedule.occurrences(start_date + 5 * IceCube::ONE_DAY)
dates.size.should == 3
dates.should == [start_date, start_date + 2 * IceCube::ONE_DAY, start_date + 4 * IceCube::ONE_DAY]
@@ -55,7 +55,7 @@
[1998, 1999, 2000].should include(date.year)
end
end
-
+
it 'should ~ weekly for 10 occurrences' do
schedule = IceCube::Schedule.new(Time.utc(1997, 9, 2))
schedule.add_recurrence_rule IceCube::Rule.weekly.count(10)
@@ -185,7 +185,7 @@
expectation = [Time.utc(1997, 9, 2), Time.utc(1997, 9, 15), Time.utc(1997, 10, 2), Time.utc(1997, 10, 15), Time.utc(1997, 11, 2), Time.utc(1997, 11, 15), Time.utc(1997, 12, 2), Time.utc(1997, 12, 15), Time.utc(1998, 1, 2), Time.utc(1998, 1, 15)]
dates.should == expectation
end
-
+
it 'should ~ monthly on the 1st and last days of the month for 10 occurrences' do
start_date = Time.utc(1997, 9, 30)
schedule = IceCube::Schedule.new(start_date)
@@ -293,15 +293,15 @@
expectation = [Time.utc(1996, 11, 5), Time.utc(2000, 11, 7), Time.utc(2004, 11, 2)]
dates.should == expectation
end
-
+
it 'should ~ every 3 hours from 9am to 5pm on a specific day' do
start_date = Time.utc(1997, 9, 2, 9, 0, 0)
schedule = IceCube::Schedule.new(start_date)
schedule.add_recurrence_rule IceCube::Rule.hourly(3).until(Time.utc(1997, 9, 2, 17, 0, 0))
dates = schedule.all_occurrences
dates.should == [Time.utc(1997, 9, 2, 9, 0, 0), Time.utc(1997, 9, 2, 12, 0, 0), Time.utc(1997, 9, 2, 15, 0, 0)]
end
-
+
it 'should ~ every 15 minutes for 6 occurrences' do
start_date = Time.utc(1997, 9, 2, 9, 0, 0)
schedule = IceCube::Schedule.new(start_date)
@@ -317,7 +317,7 @@
dates = schedule.all_occurrences
dates.should == [Time.utc(1997, 9, 2, 9, 0, 0), Time.utc(1997, 9, 2, 10, 30, 0), Time.utc(1997, 9, 2, 12, 0, 0), Time.utc(1997, 9, 2, 13, 30, 0)]
end
-
+
it 'should ~ every 20 minutes from 9am to 4:40pm every day (a)' do
start_date = Time.utc(1997, 9, 2, 8, 0, 0)
end_date = Time.utc(1997, 9, 2, 10, 20, 0)
@@ -327,7 +327,7 @@
expecation = [Time.utc(1997, 9, 2, 9), Time.utc(1997, 9, 2, 9, 20), Time.utc(1997, 9, 2, 9, 40), Time.utc(1997, 9, 2, 10, 0), Time.utc(1997, 9, 2, 10, 20)]
dates.should == expecation
end
-
+
end
def test_expectations(schedule, dates_array)

0 comments on commit baaae6d

Please sign in to comment.