spec/timeliness/format_set_spec.rb in timeliness-0.3.2 vs spec/timeliness/format_set_spec.rb in timeliness-0.3.3
- old
+ new
@@ -86,9 +86,14 @@
it 'should only use specific format string for match if provided' do
set.match('2000-01-02', 'yyyy-mm-dd').should be_kind_of(Array)
set.match('2000-01-02', 'dd/mm/yyyy').should be_nil
end
+
+ it 'should compile unknown format for one off match' do
+ set.match('20001011').should be_nil
+ set.match('20001011', 'yyyymmdd').should be_kind_of(Array)
+ end
end
def compile_regexp(format)
Timeliness::FormatSet.compile([format]).regexp
end