Sha256: cdd5b69d3c498bbf5795f6f9e6a920c4d40653635ca60fb73dd51e7e542a176d
Contents?: true
Size: 1007 Bytes
Versions: 9
Compression:
Stored size: 1007 Bytes
Contents
require 'cucumber/messages' module Cucumber module Messages describe TimeConversion do include TimeConversion it 'converts to and from milliseconds since epoch' do time = Time.now timestamp = time_to_timestamp(time) time_again = timestamp_to_time(timestamp) expect(time_again).to eq(time) end it 'converts to and from seconds duration' do duration_in_seconds = 1234 duration = seconds_to_duration(duration_in_seconds) duration_in_seconds_again = duration_to_seconds(duration) expect(duration_in_seconds_again).to eq(duration_in_seconds) end it 'converts to and from seconds duration (with decimal places)' do duration_in_seconds = 3.000161 duration = seconds_to_duration(duration_in_seconds) duration_in_seconds_again = duration_to_seconds(duration) expect(duration_in_seconds_again).to be_within(0.000000001).of(duration_in_seconds) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems