Skip to content

Commit

Permalink
Add test for content of generated files
Browse files Browse the repository at this point in the history
  • Loading branch information
rekby committed May 13, 2019
1 parent 9aa01d2 commit 78f2d60
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@ install:
go install ./cmd/minimock

clean:
[ -e ./tests/formatter_mock.go.test_origin ] && mv -f ./tests/formatter_mock.go.test_origin ./tests/formatter_mock.go
[ -e ./tests/tester_mock_test.go.test_origin ] && mv -f ./tests/tester_mock_test.go.test_origin ./tests/tester_mock_test.go
rm -Rf bin/ dist/

test: generate
test_save_origin:
[ -e ./tests/formatter_mock.go.test_origin ] || cp ./tests/formatter_mock.go ./tests/formatter_mock.go.test_origin
[ -e ./tests/tester_mock_test.go.test_origin ] || cp ./tests/tester_mock_test.go ./tests/tester_mock_test.go.test_origin

test: test_save_origin generate
diff ./tests/formatter_mock.go ./tests/formatter_mock.go.test_origin
diff ./tests/tester_mock_test.go ./tests/tester_mock_test.go.test_origin
go test -race ./...
2 changes: 1 addition & 1 deletion tests/formatter_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 20 additions & 4 deletions tests/tester_mock_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 78f2d60

Please sign in to comment.