Sha256: 5e97a64f02b4ac161b90d0c75082cbf61c1fcb98194327edc3d3f2f6f1964f3f

Contents?: true

Size: 779 Bytes

Versions: 5

Compression:

Stored size: 779 Bytes

Contents

require 'spec_helper'

describe Rubydora::ProfileParser do
  describe ".canonicalize_date_string" do
    it "should correctly trim trailing zeroes in w3c date lexical representations" do
      test_cases = {
        "2014-02-13T19:44:30.630Z" => "2014-02-13T19:44:30.63Z",
        "2014-02-13T19:44:30.600Z" => "2014-02-13T19:44:30.6Z",
        "2014-02-13T19:44:30.000Z" => "2014-02-13T19:44:30Z",
        "2014-02-13T19:44:30.01Z" => "2014-02-13T19:44:30.01Z",
        "2014-02-13T19:44:30.001Z" => "2014-02-13T19:44:30.001Z",
        "2014-02-13T20:40:43.470Z" => "2014-02-13T20:40:43.47Z"
      }
      test_cases.each do |input, expected|
        actual = Rubydora::ProfileParser.canonicalize_date_string( input)
        actual.should == expected
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rubydora-1.8.1 spec/lib/profile_parser_spec.rb
rubydora-1.8.0 spec/lib/profile_parser_spec.rb
rubydora-1.7.5 spec/lib/profile_parser_spec.rb
rubydora-1.7.4 spec/lib/profile_parser_spec.rb
rubydora-1.7.3 spec/lib/profile_parser_spec.rb