Skip to content

Commit aa64e2c

Browse files
committedAug 1, 2022
string assertion renamings
1 parent e4d93d0 commit aa64e2c

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed
 

‎assertjson/assertjson_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -892,8 +892,8 @@ func TestHas(t *testing.T) {
892892
WithLengthGreaterThanOrEqual(0).
893893
WithLengthLessThan(0).
894894
WithLengthLessThanOrEqual(0).
895-
IsEmail().
896-
IsHTML5Email().
895+
WithEmail().
896+
WithHTML5Email().
897897
That(func(s string) error { return nil }).
898898
Assert(func(tb testing.TB, value string) { tb.Helper() })
899899
},

‎assertjson/web.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ import (
1414
// with an "@" symbol in, and a "." in the second host part of the email address.
1515
func (node *AssertNode) IsEmail(msgAndArgs ...interface{}) {
1616
node.t.Helper()
17-
node.IsString().IsEmail(msgAndArgs...)
17+
node.IsString().WithEmail(msgAndArgs...)
1818
}
1919

20-
// IsEmail asserts that the JSON node has a string value with email.
20+
// WithEmail asserts that the JSON node has a string value with email.
2121
// Validation is based on simplified pattern. It allows all values
2222
// with an "@" symbol in, and a "." in the second host part of the email address.
23-
func (a *StringAssertion) IsEmail(msgAndArgs ...interface{}) *StringAssertion {
23+
func (a *StringAssertion) WithEmail(msgAndArgs ...interface{}) *StringAssertion {
2424
if a == nil {
2525
return nil
2626
}
@@ -44,12 +44,12 @@ func (a *StringAssertion) IsEmail(msgAndArgs ...interface{}) *StringAssertion {
4444
// pattern for HTML5 (see https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address).
4545
func (node *AssertNode) IsHTML5Email(msgAndArgs ...interface{}) {
4646
node.t.Helper()
47-
node.IsString().IsHTML5Email(msgAndArgs...)
47+
node.IsString().WithHTML5Email(msgAndArgs...)
4848
}
4949

50-
// IsHTML5Email asserts that the JSON node has a string value with email. Validation is based on
50+
// WithHTML5Email asserts that the JSON node has a string value with email. Validation is based on
5151
// pattern for HTML5 (see https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address).
52-
func (a *StringAssertion) IsHTML5Email(msgAndArgs ...interface{}) *StringAssertion {
52+
func (a *StringAssertion) WithHTML5Email(msgAndArgs ...interface{}) *StringAssertion {
5353
if a == nil {
5454
return nil
5555
}
@@ -72,11 +72,11 @@ func (a *StringAssertion) IsHTML5Email(msgAndArgs ...interface{}) *StringAsserti
7272
// IsURL asserts that the JSON node has a string value with URL.
7373
func (node *AssertNode) IsURL(msgAndArgs ...interface{}) *URLAssertion {
7474
node.t.Helper()
75-
return node.IsString().IsURL(msgAndArgs...)
75+
return node.IsString().WithURL(msgAndArgs...)
7676
}
7777

78-
// IsURL asserts that the JSON node has a string value with URL.
79-
func (a *StringAssertion) IsURL(msgAndArgs ...interface{}) *URLAssertion {
78+
// WithURL asserts that the JSON node has a string value with URL.
79+
func (a *StringAssertion) WithURL(msgAndArgs ...interface{}) *URLAssertion {
8080
if a == nil {
8181
return nil
8282
}

0 commit comments

Comments
 (0)
Please sign in to comment.