Skip to content

james-w/specta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

specta

Documentation - GitHub

A Go testing library that emphasizes composition and reuse through matchers and test data factories.

Build reusable, composable test components instead of duplicating assertions. Matchers compose, factories generate test data, and error messages show exactly what failed.

// Define once
var IsActiveAdmin = specta.AllOf(
    UserMatches().Active(specta.IsTrue()).Matcher(),
    UserMatches().Role(specta.Equal("admin")).Matcher(),
)

// Reuse everywhere
specta.AssertThat(t, user, IsActiveAdmin)
specta.AssertThat(t, anotherUser, IsActiveAdmin)

Installation

go get github.com/james-w/specta

About

Go testing library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages