Skip to content

henryleduc/testify-matchers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

testify-matchers

A set of argumentMatchers for testify's mock package

To be used in conjunction with testify: http://github.com/stretchr/testify

Usage

package main

import (
    matcher "github.com/henryleduc/testify-matchers"
    "github.com/stretchr/testify/mock"
    "time"
)

func main() {
    // TimeWithGracePeriod matcher
    mock.MatchedBy(matcher.TimeWithGracePeriod(10 * time.Second))
    
    // ContextWithValue matcher
    mock.MatchedBy(matcher.ContextWithValue("myBool", true))
}