             it ("can calculate the beginning of an hour for date at the beginning of the hour") {
                 let beginningOf7AM = dateFormatter.dateFromString("2015-09-08 7:00:00")!
                 expect(TimeUnit().beginningOfHour(beginningOf7AM)).to(equal(beginningOf7AM))
+                expect(TimeUnit.beginningOfHour(beginningOf7AM)).to(equal(beginningOf7AM))
             }
             
             it ("can calculate the beginning of an hour for date in the middle of the hour") {
                 let beginningOf7AM = dateFormatter.dateFromString("2015-09-08 7:00:00")!
                 let middleOf7AM = dateFormatter.dateFromString("2015-09-08 7:30:00")!
                 expect(TimeUnit().beginningOfHour(middleOf7AM)).to(equal(beginningOf7AM))
+                expect(TimeUnit.beginningOfHour(middleOf7AM)).to(equal(beginningOf7AM))
             }
             
             it ("can calculate the beginning of an hour for random date within the hour") {
                 let beginningOf7AM = dateFormatter.dateFromString("2015-09-08 7:00:00")!
                 let randomTimeIn7AM = dateFormatter.dateFromString("2015-09-08 7:17:52")!
                 expect(TimeUnit().beginningOfHour(randomTimeIn7AM)).to(equal(beginningOf7AM))
+                expect(TimeUnit.beginningOfHour(randomTimeIn7AM)).to(equal(beginningOf7AM))
             }
             
             it ("can calculate the beginning of a day for date at the beginning of the day") {
                 let beginningOfSeptember8_2015 = dateFormatter.dateFromString("2015-09-08 00:00:00")!
                 expect(TimeUnit().beginningOfDay(beginningOfSeptember8_2015)).to(equal(beginningOfSeptember8_2015))
+                expect(TimeUnit.beginningOfDay(beginningOfSeptember8_2015)).to(equal(beginningOfSeptember8_2015))
             }
             
             it ("can calculate the beginning of a day for date in the middle of the day") {
                 let beginningOfSeptember8_2015 = dateFormatter.dateFromString("2015-09-08 00:00:00")!
                 let middleOfSeptember8_2015 = dateFormatter.dateFromString("2015-09-08 12:00:00")!
                 expect(TimeUnit().beginningOfDay(middleOfSeptember8_2015)).to(equal(beginningOfSeptember8_2015))
+                expect(TimeUnit.beginningOfDay(middleOfSeptember8_2015)).to(equal(beginningOfSeptember8_2015))
             }
             
             it ("can calculate the beginning of a day for a random date within the day") {
                 let beginningOfSeptember8_2015 = dateFormatter.dateFromString("2015-09-08 00:00:00")!
                 let randomTimeInSeptember8_2015 = dateFormatter.dateFromString("2015-09-08 17:30:27")!
                 expect(TimeUnit().beginningOfDay(randomTimeInSeptember8_2015)).to(equal(beginningOfSeptember8_2015))
+                expect(TimeUnit.beginningOfDay(randomTimeInSeptember8_2015)).to(equal(beginningOfSeptember8_2015))
             }
             
             it ("can calculate the beginning of a month for date at the beginning of the month") {
                 let beginningOfSeptember_2015 = dateFormatter.dateFromString("2015-09-01 00:00:00")!
                 expect(TimeUnit().beginningOfMonth(beginningOfSeptember_2015)).to(equal(beginningOfSeptember_2015))
+                expect(TimeUnit.beginningOfMonth(beginningOfSeptember_2015)).to(equal(beginningOfSeptember_2015))
             }
             
             it ("can calculate the beginning of a month for date in the middle of the month") {
                 let beginningOfSeptember_2015 = dateFormatter.dateFromString("2015-09-01 00:00:00")!
                 let middleOfSeptember_2015 = dateFormatter.dateFromString("2015-09-15 12:00:00")!
                 expect(TimeUnit().beginningOfMonth(middleOfSeptember_2015)).to(equal(beginningOfSeptember_2015))
+                expect(TimeUnit.beginningOfMonth(middleOfSeptember_2015)).to(equal(beginningOfSeptember_2015))
             }
             
             it ("can calculate the beginning of a month for random date within the month") {
                 let beginningOfSeptember_2015 = dateFormatter.dateFromString("2015-09-01 00:00:00")!
                 let randomDateInSeptember_2015 = dateFormatter.dateFromString("2015-09-08 17:34:49")!
                 expect(TimeUnit().beginningOfMonth(randomDateInSeptember_2015)).to(equal(beginningOfSeptember_2015))
+                expect(TimeUnit.beginningOfMonth(randomDateInSeptember_2015)).to(equal(beginningOfSeptember_2015))
             }
             
             it ("can calculate the beginning of a year for date at the beginning of the year") {
                 let beginningOf2015 = dateFormatter.dateFromString("2015-01-01 00:00:00")!
                 expect(TimeUnit().beginningOfYear(beginningOf2015)).to(equal(beginningOf2015))
+                expect(TimeUnit.beginningOfYear(beginningOf2015)).to(equal(beginningOf2015))
             }
             
             it ("can calculate the beginning of a year for date in the middle of the year") {
                 let beginningOf2015 = dateFormatter.dateFromString("2015-01-01 00:00:00")!
                 let middleOf2015 = dateFormatter.dateFromString("2015-07-01 00:00:00")!
                 expect(TimeUnit().beginningOfYear(middleOf2015)).to(equal(beginningOf2015))
+                expect(TimeUnit.beginningOfYear(middleOf2015)).to(equal(beginningOf2015))
             }
             
             it ("can calculate the beginning of a year from a random date within the year") {
                 let beginningOf2015 = dateFormatter.dateFromString("2015-01-01 00:00:00")!
                 let randomDateIn2015 = dateFormatter.dateFromString("2015-09-08 17:38:12")!
                 expect(TimeUnit().beginningOfYear(randomDateIn2015)).to(equal(beginningOf2015))
+                expect(TimeUnit.beginningOfYear(randomDateIn2015)).to(equal(beginningOf2015))
             }
         }
         

            it("returns true for first second of year") {
                let _2015 = dateFormatter.dateFromString("2015-01-01 00:00:00")! // beginning of 2015
                expect(TimeUnit().yearContainsDate(_2015, year:_2015)).to(beTrue())
            }
            
            it("returns true for last second of year") {
                let _2015 = dateFormatter.dateFromString("2015-01-01 00:00:00")! // beginning of 2015
                let endOf2015 = dateFormatter.dateFromString("2015-12-31 23:59:59")!
                expect(TimeUnit().yearContainsDate(endOf2015, year: _2015)).to(beTrue())
            }
            
            it("returns true for date in the middle of year") {
                let _2015 = dateFormatter.dateFromString("2015-01-01 00:00:00")! // beginning of 2015
                let middleOf2015 = dateFormatter.dateFromString("2015-07-01 00:00:00")!
                expect(TimeUnit().yearContainsDate(middleOf2015, year: _2015)).to(beTrue())
            }
            
            it ("returns true when month date is not beginning of year") {
                let middle_2015 = dateFormatter.dateFromString("2015-07-01 00:00:00")! // middle of 2015
                let endOf2015 = dateFormatter.dateFromString("2015-12-31 23:59:59")!
                expect(TimeUnit().yearContainsDate(endOf2015, year: middle_2015)).to(beTrue())
            }
            
            it("returns false for date in next year") {
                let middle_2015 = dateFormatter.dateFromString("2015-07-01 00:00:00")! // middle of 2015
                let beginningOf2016 = dateFormatter.dateFromString("2016-01-01 00:00:00")!
                expect(TimeUnit().yearContainsDate(beginningOf2016, year: middle_2015)).to(beFalse())
            }
            
            it("returns false for date in previous year") {
                let middle_2015 = dateFormatter.dateFromString("2015-07-01 00:00:00")! // middle of 2015
                let endOf2014 = dateFormatter.dateFromString("2014-12-31 23:59:59")!
                expect(TimeUnit().yearContainsDate(endOf2014, year: middle_2015)).to(beFalse())
                
            }
        }
    }

            it("returns true for first second of day") {
                let september13_2015 = dateFormatter.dateFromString("2015-09-13 00:00:00")! // beginning of September 13
                expect(TimeUnit().dayContainsDate(september13_2015, day:september13_2015)).to(beTrue())
                expect(TimeUnit.dayContainsDate(september13_2015, day:september13_2015)).to(beTrue())
            }
            
            it("returns true for last second of day") {
                let september13_2015 = dateFormatter.dateFromString("2015-09-13 00:00:00")! // beginning of September 13
                let endOfSeptember13_2015 = dateFormatter.dateFromString("2015-09-13 23:59:59")!
                expect(TimeUnit().dayContainsDate(endOfSeptember13_2015, day: september13_2015)).to(beTrue())
                expect(TimeUnit.dayContainsDate(endOfSeptember13_2015, day: september13_2015)).to(beTrue())
            }
            
            it("returns true for date in the middle of day") {
                let september13_2015 = dateFormatter.dateFromString("2015-09-13 00:00:00")! // beginning of September 13
                let middleOfSeptember13_2015 = dateFormatter.dateFromString("2015-09-13 12:00:00")!
                expect(TimeUnit().dayContainsDate(middleOfSeptember13_2015, day: september13_2015)).to(beTrue())
                expect(TimeUnit.dayContainsDate(middleOfSeptember13_2015, day: september13_2015)).to(beTrue())
            }
            
            it ("returns true when month date is not beginning of day") {
                let september13_2015 = dateFormatter.dateFromString("2015-09-13 12:00:00")! // middle of September 13
                let endOfSeptember13_2015 = dateFormatter.dateFromString("2015-09-13 23:59:59")!
                expect(TimeUnit().dayContainsDate(endOfSeptember13_2015, day: september13_2015)).to(beTrue())
                expect(TimeUnit.dayContainsDate(endOfSeptember13_2015, day: september13_2015)).to(beTrue())
            }
            
            it("returns false for date in next day") {
                let september13_2015 = dateFormatter.dateFromString("2015-09-13 12:00:00")! // middle of September 13
                let beginningOfSeptember13_2015 = dateFormatter.dateFromString("2015-09-14 00:00:00")!
                expect(TimeUnit().dayContainsDate(beginningOfSeptember13_2015, day: september13_2015)).to(beFalse())
                expect(TimeUnit.dayContainsDate(beginningOfSeptember13_2015, day: september13_2015)).to(beFalse())
            }
            
            it("returns false for date in previous day") {
                let september13_2015 = dateFormatter.dateFromString("2015-09-13 12:00:00")! // middle of September 13
                let endOfSeptember13_2015 = dateFormatter.dateFromString("2015-09-12 23:59:59")!
                expect(TimeUnit().dayContainsDate(endOfSeptember13_2015, day: september13_2015)).to(beFalse())
                expect(TimeUnit.dayContainsDate(endOfSeptember13_2015, day: september13_2015)).to(beFalse())
            }
            
// MARK: monthContainsDate
            it("returns true for first second of month") {
                let september_2015 = dateFormatter.dateFromString("2015-09-01 00:00:00")! // beginning of September
                expect(TimeUnit().monthContainsDate(september_2015, month:september_2015)).to(beTrue())
                expect(TimeUnit.monthContainsDate(september_2015, month:september_2015)).to(beTrue())
            }
            
            it("returns true for last second of month") {
                let september_2015 = dateFormatter.dateFromString("2015-09-01 00:00:00")! // beginning of September
                let endOfSeptember_2015 = dateFormatter.dateFromString("2015-09-30 23:59:59")!
                expect(TimeUnit().monthContainsDate(endOfSeptember_2015, month: september_2015)).to(beTrue())
                expect(TimeUnit.monthContainsDate(endOfSeptember_2015, month: september_2015)).to(beTrue())
            }
            
            it("returns true for date in the middle of month") {
                let september_2015 = dateFormatter.dateFromString("2015-09-01 00:00:00")! // beginning of September
                let middleOfSeptember_2015 = dateFormatter.dateFromString("2015-09-15 00:00:00")!
                expect(TimeUnit().monthContainsDate(middleOfSeptember_2015, month: september_2015)).to(beTrue())
                expect(TimeUnit.monthContainsDate(middleOfSeptember_2015, month: september_2015)).to(beTrue())
            }
            
            it ("returns true when month date is not beginning of month") {
                let september_2015 = dateFormatter.dateFromString("2015-09-15 00:00:00")! // middle of September
                let endOfSeptember_2015 = dateFormatter.dateFromString("2015-09-30 23:59:59")!
                expect(TimeUnit().monthContainsDate(endOfSeptember_2015, month: september_2015)).to(beTrue())
                expect(TimeUnit.monthContainsDate(endOfSeptember_2015, month: september_2015)).to(beTrue())
            }
            
            it("returns false for date in next month") {
                let september_2015 = dateFormatter.dateFromString("2015-09-15 00:00:00")! // middle of September
                let beginningOfOctober_2015 = dateFormatter.dateFromString("2015-10-01 00:00:00")!
                expect(TimeUnit().monthContainsDate(beginningOfOctober_2015, month: september_2015)).to(beFalse())
                expect(TimeUnit.monthContainsDate(beginningOfOctober_2015, month: september_2015)).to(beFalse())
            }
            
            it("returns false for date in previous month") {
                let september_2015 = dateFormatter.dateFromString("2015-09-15 00:00:00")! // middle of September
                let endOfAugust_2015 = dateFormatter.dateFromString("2015-08-31 23:59:59")!
                expect(TimeUnit().monthContainsDate(endOfAugust_2015, month: september_2015)).to(beFalse())
                expect(TimeUnit.monthContainsDate(endOfAugust_2015, month: september_2015)).to(beFalse())
                
            }
            
