Sha256: a0c080482d51ae9b5416e31697206851aa47862495ccc34bd3b3a858eb5a9daa
Contents?: true
Size: 1.34 KB
Versions: 53
Compression:
Stored size: 1.34 KB
Contents
require 'spec_helper' describe Krikri::Enrichments::ParseDate do it_behaves_like 'a field enrichment' values = [{ :string => 'parses calendar to ruby Date', :start => 'May 15, 2014', :end => Date.parse('2014-05-15') }, { :string => 'parses ISO to ruby Date', :start => '2014-05-15', :end => Date.parse('2014-05-15') }, { :string => 'parses slash to ruby Date', :start => '5/7/2012', :end => Date.parse('2012-05-07') }, { :string => 'parses dot to ruby Date', :start => '5.7.2012', :end => Date.parse('2012-05-07') }, { :string => 'parses Month, Year to ruby Date', :start => 'July, 2015', :end => Date.parse('2015-07-01') }, { :string => 'parses M-D-Y to ruby Date', :start => '12-19-2010', :end => Date.parse('2010-12-19') }, { :string => 'parses uncertain to EDTF', :start => '2015?', :end => Date.edtf('2015?') }, { :string => 'leaves other fields unaltered', :start => "moominpapa", :end => "moominpapa" }] it_behaves_like 'a string enrichment', values end
Version data entries
53 entries across 53 versions & 1 rubygems