Releases: VBA-tools/vba-test
Releases · VBA-tools/vba-test
vba-test v2.0.0-beta.2
- Rename to vba-test
- Add
TestSuite
andTestCase
- Convert
.Expect
to assertions onTestCase
(e.g..Expect(A).ToEqual B
to.IsEqual A, B
See #23 (comment) for an upgrade guide.
VBA-TDD v2.0.0-beta
- Rename Excel-TDD to VBA-TDD to reflect more general VBA compatibility of v2.0.0
- Add
EnableRunMatcher
compiler flag to disableApplication.Run
functionality on incompatible platforms/applications
VBA-TDD v2.0.0-alpha
- Add events to
SpecSuite
- Add evented
ImmediateReporter
- Add
WorkbookReporter
- Remove
WBProxy
,Scenario
, and Excel-specific code
Excel-TDD v1.4.0
- Update
ToEqual
andToBeCloseTo
- Remove explicit reference to
Scripting.Dictionary
Excel-TDD v1.3.1
- Don't clear errors in
SpecExpectation
Excel-TDD v1.3.0
- Add
ToMatch
,ToBeCloseTo
,ToBeNothing
,ToBeEmpty
,ToBeNull
, andToBeMissing
- Add
RunMatcher
- Change
ToContains
to check if an Array/Collection contains an item, deprecated checking if string contains substring forToMatch
- 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
Bugfixes
- SpecSuite only passes
BeforeEach
callback arguments if they are defined - SpecExpectation handles objects better
Excel-TDD v1.2.2
- DisplayRunner shows SpecSuite details
- Add
ToContain
andToNotContain
expectations
Excel-TDD v1.2.1
- Bugfixes
Excel-TDD v1.2.0
- Add
BeforeEach
for handling workbook reloading - Simplify WBProxies and Scenarios
- Extend inline and display runners
- Update examples