lib/submodules/ably-ruby/spec/unit/models/stat_spec.rb in ably-rest-0.7.3 vs lib/submodules/ably-ruby/spec/unit/models/stat_spec.rb in ably-rest-0.7.5
- old
+ new
@@ -62,25 +62,25 @@
end
end
describe '#from_interval_id' do
it 'converts a month interval_id 2014-02 into a Time object in UTC 0' do
- expect(subject.from_interval_id('2014-02')).to eql(Time.new(2014, 2))
+ expect(subject.from_interval_id('2014-02')).to eql(Time.gm(2014, 2))
expect(subject.from_interval_id('2014-02').utc_offset).to eql(0)
end
it 'converts a day interval_id 2014-02-03 into a Time object in UTC 0' do
- expect(subject.from_interval_id('2014-02-03')).to eql(Time.new(2014, 2, 3))
+ expect(subject.from_interval_id('2014-02-03')).to eql(Time.gm(2014, 2, 3))
expect(subject.from_interval_id('2014-02-03').utc_offset).to eql(0)
end
it 'converts an hour interval_id 2014-02-03:05 into a Time object in UTC 0' do
- expect(subject.from_interval_id('2014-02-03:05')).to eql(Time.new(2014, 2, 3, 5))
+ expect(subject.from_interval_id('2014-02-03:05')).to eql(Time.gm(2014, 2, 3, 5))
expect(subject.from_interval_id('2014-02-03:05').utc_offset).to eql(0)
end
it 'converts a minute interval_id 2014-02-03:05:06 into a Time object in UTC 0' do
- expect(subject.from_interval_id('2014-02-03:05:06')).to eql(Time.new(2014, 2, 3, 5, 6))
+ expect(subject.from_interval_id('2014-02-03:05:06')).to eql(Time.gm(2014, 2, 3, 5, 6))
expect(subject.from_interval_id('2014-02-03:05:06').utc_offset).to eql(0)
end
it 'fails with an invalid interval_id 14-20' do
expect { subject.from_interval_id('14-20') }.to raise_error ArgumentError