Skip to content

Releases: VBA-tools/vba-test

vba-test v2.0.0-beta.2

28 Aug 14:56
Compare
Choose a tag to compare
  • Rename to vba-test
  • Add TestSuite and TestCase
  • Convert .Expect to assertions on TestCase (e.g. .Expect(A).ToEqual B to .IsEqual A, B

See #23 (comment) for an upgrade guide.

VBA-TDD v2.0.0-beta

31 Dec 04:24
Compare
Choose a tag to compare
VBA-TDD v2.0.0-beta Pre-release
Pre-release
  • Rename Excel-TDD to VBA-TDD to reflect more general VBA compatibility of v2.0.0
  • Add EnableRunMatcher compiler flag to disable Application.Run functionality on incompatible platforms/applications

VBA-TDD v2.0.0-alpha

19 Dec 15:22
Compare
Choose a tag to compare
VBA-TDD v2.0.0-alpha Pre-release
Pre-release
  • Add events to SpecSuite
  • Add evented ImmediateReporter
  • Add WorkbookReporter
  • Remove WBProxy, Scenario, and Excel-specific code

Excel-TDD v1.4.0

27 Oct 14:08
Compare
Choose a tag to compare
  • Update ToEqual and ToBeCloseTo
  • Remove explicit reference to Scripting.Dictionary

Excel-TDD v1.3.1

25 Oct 14:31
Compare
Choose a tag to compare
  • Don't clear errors in SpecExpectation

Excel-TDD v1.3.0

02 Oct 01:37
Compare
Choose a tag to compare
  • Add ToMatch, ToBeCloseTo, ToBeNothing, ToBeEmpty, ToBeNull, and ToBeMissing
  • Add RunMatcher
  • Change ToContains to check if an Array/Collection contains an item, deprecated checking if string contains substring for ToMatch
  • Improve Mac support

ToMatch

Check if substring matches (is contained in) actual string (RegEx to be added in the future)

.Expect("ABCD").ToContain "BC" ' -> Deprecated
.Expect("ABCD").ToMatch "BC" ' -> Pass
.Expect("ABCD").ToMatch "bc" ' -> Fail

ToBeCloseTo

Check if expected is close to actual for the given number of decimal places

.Expect(1.49).ToBeCloseTo 1.5, 1 ' -> Pass
.Expect(1.49).ToBeCloseTo 1.5, 2 ' -> Fail

RunMatcher

Run a custom matcher

Public Function ToBeWithin(Actual As Variant, Args As Variant) As Variant
    If UBound(Args) - LBound(Args) < 1 Then
        ' Return string for specific failure message
        ToBeWithin = "Need to pass in upper-bound to ToBeWithin"
    Else
        If Actual >= Args(0) And Actual <= Args(1) Then
            ' Return true for pass
            ToBeWithin = True
        Else
            ' Return false for fail or custom failure message
            ToBeWithin = False
        End If
    End If
End Function

.Expect(100).RunMatcher "ToBeWithin", "to be within", 90, 100 ' -> Pass
.Expect(100).RunMatcher "ToBeWithin", "to be within", 90, 95
' -> Fail: Expected 100 to be within 90 and 95
.Expect(100).RunMatcher "ToBeWithin", "to be within", 90
' -> Fail: Need to pass in upper-bound to ToBeWithin

Excel-TDD v1.2.3

30 Oct 21:03
Compare
Choose a tag to compare

Bugfixes

  • SpecSuite only passes BeforeEach callback arguments if they are defined
  • SpecExpectation handles objects better

Excel-TDD v1.2.2

24 Oct 00:02
Compare
Choose a tag to compare
  • DisplayRunner shows SpecSuite details
  • Add ToContain and ToNotContain expectations

Excel-TDD v1.2.1

22 Oct 21:05
Compare
Choose a tag to compare
  • Bugfixes

Excel-TDD v1.2.0

22 Oct 20:59
Compare
Choose a tag to compare
  • Add BeforeEach for handling workbook reloading
  • Simplify WBProxies and Scenarios
  • Extend inline and display runners
  • Update examples