Closed timhall closed 6 years ago
Ok, this is ready to merge, here is a short upgrade guide:
Dim Specs As New SpecSuite
to Dim Tests As New TestSuite
Specs.It("...")
to Tests.Test("...")
.Expect(A).ToEqual B
to .IsEqual A, B
.Expect(A).ToNotEqual B
to .NotEqual A, B
.Expect(A).ToBeUndefined
to .IsUndefined A
.Expect(A).ToNotBeUndefined
to .NotUndefined A
.Expect(A).ToBeNothing
to .IsOk A Is Nothing
.Expect(A).ToNotBeNothing
to .NotOk A Is Nothing
.Expect(A).ToBeEmpty
to .IsOk IsEmpty(A)
.Expect(A).ToNotBeEmpty
to .NotOk IsEmpty(A)
.Expect(A).ToBeNull
to .IsOk IsNull(A)
.Expect(A).ToNotBeNull
to .NotOk IsNull(A)
.Expect(A).ToBeMissing
to .IsOk IsMissing(A)
.Expect(A).ToNotBeMissing
to .NotOk IsMissing(A)
.Expect(A).ToBeLT B
to .IsOk A < B
.Expect(A).ToBeLTE B
to .IsOk A <= B
.Expect(A).ToBeGT B
to .IsOk A > B
.Expect(A).ToBeGTE B
to .IsOk A >= B
.Expect(A).ToBeCloseTo B, C
to .IsApproximate A, B, C
.Expect(A).ToNotBeCloseTo B, C
to .NotApproximate A, B, C
.Expect(A).ToContain B
to .Includes A, B
.Expect(A).ToNotContain B
to .NotIncludes A, B
.Expect(A).ToMatch B
to .IsOk InStr(B, A)
.Expect(A).ToNotMatch B
to .NotOk InStr(B, A)
Some of the previous matchers will most likely be added back at some point in the future, but for now I'm happy with the simplified API.
vba-test is a new approach to VBA-TDD that simplifies the API and allows for future work on more powerful assertion messages and integration with vba-blocks.
You can view a mockup of the new API here: vba-test/readme
The underlying changes are a complete rename and refactor, although the approach is generally already in use in v2.0.0-beta (with an evented suite). It may be a burdensome upgrade to map
.Expect(A).ToEqual B
to.IsEqual A, B
, but I think it will be a welcome simplification and opens up new avenues in the future.Closes #11 Closes #12 Closes #13 Closes #16 Closes #17 Closes #22