Skip to content

Commit

Permalink
Rename isUri to isUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
petrnymsa committed Apr 11, 2024
1 parent fb07cd5 commit 7742163
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion glade_forms/lib/src/validator/string_validator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class StringValidator extends GladeValidator<String> {
///
/// [requiresScheme] - if true HTTP(S) is mandatory.
/// Default [key] is [ GladeErrorKeys.stringNotUrl].
void isUri({
void isUrl({
OnValidateError<String>? devError,
bool allowEmpty = false,
bool requiresScheme = false,
Expand Down
4 changes: 2 additions & 2 deletions glade_forms/test/string_validator_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void main() {

group('isUrl', () {
test('When value is empty, isUrl() fails', () {
final validator = (StringValidator()..isUri()).build();
final validator = (StringValidator()..isUrl()).build();

final result = validator.validate('');

Expand All @@ -75,7 +75,7 @@ void main() {
('noturl', false, false),
]) {
test('When URL is ${testCase.$1}, isUrl(http: ${testCase.$2}) ${testCase.$3 ? 'pass' : 'fails'}', () {
final validator = (StringValidator()..isUri(requiresScheme: testCase.$2)).build();
final validator = (StringValidator()..isUrl(requiresScheme: testCase.$2)).build();

final result = validator.validate(testCase.$1);

Expand Down

0 comments on commit 7742163

Please sign in to comment.