westfieldlabs/datetime_helper

Add rSpec matcher that fails if a DateTime does not have zone="+00:00" or Time is not in UTC+0

Closed this issue · 0 comments

As a developer trying to unit test an Model (which subclasses ActiveModel::Base)
I'd like to be able to test the following

expect(updated_at).to be_zulu_time

where updated_at could be

  • a String (i.e. it's a Zulu Time formatted string), or a
  • DateTime (ie `.zone == "+00:00"), or a
  • Time (i.e. .utc? == true)

Currently the be_zulu_time matcher is only useful for Strings.