Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: call t.Error() from test spec #2

Merged
merged 1 commit into from
Aug 8, 2023
Merged

fix: call t.Error() from test spec #2

merged 1 commit into from
Aug 8, 2023

Conversation

jaypipes
Copy link
Member

@jaypipes jaypipes commented Aug 8, 2023

Brings in gdt@v1.1.1 and ensures that the test units/specs call testing.T.Error() instead of relying on the Scenario.Run() to do that.

Also adds a custom YAML unmarshaler for the Expect struct and adds better parse-time errors for the matches field as requested in Issue 8.

Addresses Issue gdt-dev/gdt#8

Brings in gdt@v1.1.1 and ensures that the test units/specs call
`testing.T.Error()` instead of relying on the `Scenario.Run()` to do
that.

Also adds a custom YAML unmarshaler for the `Expect` struct and adds
better parse-time errors for the `matches` field as requested in Issue
8.

Addresses Issue gdt-dev/gdt#8

Signed-off-by: Jay Pipes <jaypipes@gmail.com>
}
e.Matches = v
} else if valNode.Kind == yaml.ScalarNode {
if valNode.Tag == "!!null" {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note to @a-hilaly this is actually the only way to tell that someone put the following in their YAML:

some:
  nested:
    mapfield:

where some.nested.mapfield has a nil value (it's actually valid YAML...)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting node tag name ...

@jaypipes jaypipes requested a review from a-hilaly August 8, 2023 15:18
Copy link
Member

@a-hilaly a-hilaly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@a-hilaly a-hilaly merged commit 35a5d58 into main Aug 8, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants