Sha256: bf4eaad23a7a291762f32cb454e733d69859efb90561111ad51d13aa60f69431
Contents?: true
Size: 699 Bytes
Versions: 67
Compression:
Stored size: 699 Bytes
Contents
require 'time' class GigasecondCase < OpenStruct def name 'test_%s' % description.gsub(/[ :-]/, '_') end def description send(:'#') || input end def got "Time.utc(#{start_values.join(', ')})" end def want "Time.utc(#{stop_values.join(', ')})" end def start_values ts = Time.parse(input) [ts.year, ts.month, ts.day, ts.hour, ts.min, ts.sec] end def stop_values ts = Time.parse(expected) [ts.year, ts.month, ts.day, ts.hour, ts.min, ts.sec] end def skipped? index > 0 end end GigasecondCases = proc do |data| JSON.parse(data)['add']['cases'].map.with_index do |row, i| GigasecondCase.new(row.merge('index' => i)) end end
Version data entries
67 entries across 67 versions & 1 rubygems