Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor into vba-test #23

Merged
merged 10 commits into from
Aug 28, 2018
Merged

Refactor into vba-test #23

merged 10 commits into from
Aug 28, 2018

Conversation

timhall
Copy link
Member

@timhall timhall commented Aug 27, 2018

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

@timhall
Copy link
Member Author

timhall commented Aug 28, 2018

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.

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.

None yet

1 participant