Skip to content

Commit

Permalink
refactor test
Browse files Browse the repository at this point in the history
  • Loading branch information
samanhappy committed Aug 23, 2024
1 parent 2fe3fc5 commit 752154a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions monkey/monkey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ func (s *MyStruct) Method() string {

func TestPatch(t *testing.T) {
original := func() string { return "original" }
replacement := func() string { return "replacement" }
assert.Equal(t, "original", original())

Patch(original, replacement)
Patch(original, func() string { return "replacement" })
assert.Equal(t, "replacement", original())

Unpatch(original)
Expand Down

0 comments on commit 752154a

Please sign in to comment.