Bug 19176: Compare the number of seconds when comparing dates in tests
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 25 Aug 2017 20:56:52 +0000 (17:56 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 30 Oct 2017 17:55:18 +0000 (14:55 -0300)
commitdfcb2b8071582a55e35c47926d4b5c1b8b2a9a59
treeeff01063d266bc6c3a42ffe3a9205d1694b549c9
parent790150b31277e6ded86823add0385c5960a4876e
Bug 19176: Compare the number of seconds when comparing dates in tests

  #   Failed test 'borrowers.updated_on should have been set to now on creating'
  #   at t/db_dependent/Patrons.t line 74.
  #          got: '2017-08-10T20:53:03'
  #     expected: '2017-08-10T20:53:04'
  # Looks like you failed 1 test of 17.
  [20:53:15] t/db_dependent/Patrons.t .....................................

The plan here is to compare the number of seconds between two dates.
If < 60 the dates are consired as identicals.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
t/Test/Dates.t [new file with mode: 0644]
t/db_dependent/Patrons.t
t/db_dependent/Virtualshelves.t
t/lib/Dates.pm [new file with mode: 0644]