-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #178 from gobuffalo/task-test-package
task: moving the tests to a _test package
- Loading branch information
Showing
34 changed files
with
440 additions
and
379 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
package plush | ||
package plush_test | ||
|
||
import ( | ||
"database/sql" | ||
|
||
"errors" | ||
"testing" | ||
|
||
"github.com/gobuffalo/plush/v4" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestErrorType(t *testing.T) { | ||
r := require.New(t) | ||
|
||
ctx := NewContext() | ||
ctx := plush.NewContext() | ||
ctx.Set("sqlError", func() error { | ||
return sql.ErrNoRows | ||
}) | ||
|
||
_, err := Render(`<%= sqlError() %>`, ctx) | ||
_, err := plush.Render(`<%= sqlError() %>`, ctx) | ||
r.True(errors.Is(err, sql.ErrNoRows)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.