Skip to content

Instantly share code, notes, and snippets.

View JLWalsh's full-sized avatar
🏎️
Zoom Zoom

James L. Walsh JLWalsh

🏎️
Zoom Zoom
View GitHub Profile
@JLWalsh
JLWalsh / launch_wsl.bat
Created September 16, 2020 19:31
Start WSL with preconfigured environment variables. Useful when embedding a WSL terminal in an editor, where you wouldn't want to use certain programs (ex: tmux, which is enabled by default in my case)
@SET USE_TMUX=false
@SET WSLENV=USE_TMUX/u
@wsl.exe
@JLWalsh
JLWalsh / ReflectedEqualityMatcher.kt
Last active August 20, 2020 17:46
Mockk equality matcher that uses reflection to verify equality of two objects. Useful when testing objects that don't offer an equals() method. Requires org.apache.commons
import io.mockk.Matcher
import io.mockk.MockKMatcherScope
import org.apache.commons.lang3.builder.EqualsBuilder
class ReflectedEqualityMatcher<T>(
private val expected: T
) : Matcher<T> {
override fun match(arg: T?): Boolean {
if (arg == null) {