Skip to content

Conversation

@z1lk
Copy link
Contributor

@z1lk z1lk commented Jun 7, 2025

phlex$ bundle exec qt
...
(./quickdraw/sgml/attributes.test.rb)
  ./quickdraw/sgml/attributes.test.rb:184
    _, Time
      ./quickdraw/sgml/attributes.test.rb:186

Expected HTML strings to be equal (compared with `actual == expected`):

Actual                                                Expected
1 <div attribute="2023-01-15T12:30:45-06:00"></div>   1 <div attribute="2023-01-15T12:30:45+00:00"></div>

Passed: 1630 | Failed: 1 | Errors: 0

The test asserts a zero offset, but Time.new defaults to the local timezone, which may be different.

https://docs.ruby-lang.org/en/3.4/Time.html#method-c-new

The test asserts a zero offset, but `Time.new` defaults to the local
timezone, which may be different.
@z1lk z1lk changed the title Give Time.new the zone the test expects Fix failure in quickdraw/sgml/attributes.test.rb when running locally Jun 7, 2025
@z1lk z1lk changed the title Fix failure in quickdraw/sgml/attributes.test.rb when running locally Fix failure in quickdraw/sgml/attributes.test.rb when running tests locally Jun 7, 2025
@joeldrapper
Copy link
Collaborator

That is such strange behaviour for the Time class. Also I’m not in a UTC timezone and this didn’t happen to me. It makes sense to hard-code this in the test.

@joeldrapper joeldrapper merged commit da754d1 into yippee-fun:main Jun 9, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants