Skip to content

Commit 8cc44a5

Browse files
committed
Update date test
- Fixes #21 - Fixes #26
1 parent e62d361 commit 8cc44a5

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

specs/Specs.bas

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,12 @@ Public Function Specs() As SpecSuite
218218
End With
219219

220220
With Specs.It("should convert dates to ISO 8601")
221-
JsonString = JsonConverter.ConvertToJson(Array(DateValue("Jan. 2, 2003") + TimeValue("4:05:06 PM")))
221+
JsonString = JsonConverter.ConvertToJson(DateSerial(2003, 1, 15) + TimeSerial(12, 5, 6))
222222

223-
' Don't test hour/minute due to UTC offset
224-
.Expect(JsonString).ToMatch "[""2003-01-02T"
225-
.Expect(JsonString).ToMatch ":06.000Z""]"
223+
' Due to UTC conversion, test shape and year, month, and seconds
224+
.Expect(JsonString).ToMatch "2003-01-"
225+
.Expect(JsonString).ToMatch "T"
226+
.Expect(JsonString).ToMatch ":06.000Z"
226227
End With
227228

228229
With Specs.It("should convert 2D arrays")

specs/VBA-JSON - Specs.xlsm

-3.73 KB
Binary file not shown.

0 commit comments

Comments
 (0)