@@ -11,7 +11,7 @@ describe('validation library', function() {
11
11
it ( 'normal case' , function ( ) { assert . equal ( true , lib . email ( 'a@b.c' ) ) ; } ) ;
12
12
it ( 'requires @' , function ( ) { assert . equal ( false , lib . email ( 'ab.c' ) ) ; } ) ;
13
13
it ( 'requires .' , function ( ) { assert . equal ( false , lib . email ( 'a@bc' ) ) ; } ) ;
14
- it ( 'trims ' , function ( ) { assert . equal ( true , lib . email ( ' a@b.c ' ) ) ; } ) ;
14
+ it ( 'does not trim ' , function ( ) { assert . equal ( false , lib . email ( ' a@b.c ' ) ) ; } ) ;
15
15
it ( 'spaces' , function ( ) { assert . equal ( false , lib . email ( 'a @b.c' ) ) ; } ) ;
16
16
it ( 'multiple dots' , function ( ) { assert . equal ( true , lib . email ( 'a@b..c' ) ) ; } ) ;
17
17
it ( 'multiple @s' , function ( ) { assert . equal ( true , lib . email ( 'a@b@c.d' ) ) ; } ) ;
@@ -49,7 +49,7 @@ describe('validation library', function() {
49
49
it ( '+4' , function ( ) { assert . equal ( false , lib . integer ( '+4' ) ) ; } ) ;
50
50
it ( '--4' , function ( ) { assert . equal ( false , lib . integer ( '--4' ) ) ; } ) ;
51
51
it ( '1.3' , function ( ) { assert . equal ( false , lib . integer ( '1.3' ) ) ; } ) ;
52
- it ( ' 4 ' , function ( ) { assert . equal ( true , lib . integer ( ' 4 ' ) ) ; } ) ;
52
+ it ( ' 4 ' , function ( ) { assert . equal ( false , lib . integer ( ' 4 ' ) ) ; } ) ;
53
53
it ( ' 4 6 ' , function ( ) { assert . equal ( false , lib . integer ( ' 4 6 ' ) ) ; } ) ;
54
54
it ( 'null' , function ( ) { assert . equal ( false , lib . integer ( null ) ) ; } ) ;
55
55
it ( 'boolean' , function ( ) { assert . equal ( false , lib . integer ( true ) ) ; } ) ;
@@ -65,7 +65,7 @@ describe('validation library', function() {
65
65
it ( 'arraylt' , function ( ) { assert . equal ( false , lib . length ( [ 1 , 2 ] , 3 ) ) ; } ) ;
66
66
it ( 'arrayeq' , function ( ) { assert . equal ( true , lib . length ( [ 1 , 2 ] , 2 ) ) ; } ) ;
67
67
it ( 'arraygt' , function ( ) { assert . equal ( false , lib . length ( [ 1 , 2 ] , 1 ) ) ; } ) ;
68
- it ( 'trims ' , function ( ) { assert . equal ( true , lib . length ( ' hello ' , 5 ) ) ; } ) ;
68
+ it ( 'does not trim ' , function ( ) { assert . equal ( false , lib . length ( ' hello ' , 5 ) ) ; } ) ;
69
69
} ) ;
70
70
describe ( 'lessThan' , function ( ) {
71
71
it ( 'lt' , function ( ) { assert . equal ( true , lib . lessThan ( '5' , 6 ) ) ; } ) ;
@@ -98,7 +98,7 @@ describe('validation library', function() {
98
98
it ( 'arraylt' , function ( ) { assert . equal ( true , lib . maxLength ( [ 1 , 2 ] , 3 ) ) ; } ) ;
99
99
it ( 'arrayeq' , function ( ) { assert . equal ( true , lib . maxLength ( [ 1 , 2 ] , 2 ) ) ; } ) ;
100
100
it ( 'arraygt' , function ( ) { assert . equal ( false , lib . maxLength ( [ 1 , 2 ] , 1 ) ) ; } ) ;
101
- it ( 'trims ' , function ( ) { assert . equal ( true , lib . maxLength ( ' hello ' , 6 ) ) ; } ) ;
101
+ it ( 'does not trim ' , function ( ) { assert . equal ( false , lib . maxLength ( ' hello ' , 6 ) ) ; } ) ;
102
102
} ) ;
103
103
describe ( 'min' , function ( ) {
104
104
it ( 'lt' , function ( ) { assert . equal ( false , lib . min ( '5' , 6 ) ) ; } ) ;
@@ -120,7 +120,7 @@ describe('validation library', function() {
120
120
it ( 'arraylt' , function ( ) { assert . equal ( false , lib . minLength ( [ 1 , 2 ] , 3 ) ) ; } ) ;
121
121
it ( 'arrayeq' , function ( ) { assert . equal ( true , lib . minLength ( [ 1 , 2 ] , 2 ) ) ; } ) ;
122
122
it ( 'arraygt' , function ( ) { assert . equal ( true , lib . minLength ( [ 1 , 2 ] , 1 ) ) ; } ) ;
123
- it ( 'trims ' , function ( ) { assert . equal ( false , lib . minLength ( ' hello ' , 6 ) ) ; } ) ;
123
+ it ( 'does not trim ' , function ( ) { assert . equal ( true , lib . minLength ( ' hello ' , 6 ) ) ; } ) ;
124
124
} ) ;
125
125
describe ( 'number' , function ( ) {
126
126
it ( '01234567899876543210' , function ( ) {
@@ -145,7 +145,7 @@ describe('validation library', function() {
145
145
it ( '+4' , function ( ) { assert . equal ( false , lib . numeric ( '+4' ) ) ; } ) ;
146
146
it ( '--4' , function ( ) { assert . equal ( false , lib . numeric ( '--4' ) ) ; } ) ;
147
147
it ( '1.3' , function ( ) { assert . equal ( false , lib . numeric ( '1.3' ) ) ; } ) ;
148
- it ( ' 4 ' , function ( ) { assert . equal ( true , lib . numeric ( ' 4 ' ) ) ; } ) ;
148
+ it ( ' 4 ' , function ( ) { assert . equal ( false , lib . numeric ( ' 4 ' ) ) ; } ) ;
149
149
it ( ' 4 6 ' , function ( ) { assert . equal ( false , lib . numeric ( ' 4 6 ' ) ) ; } ) ;
150
150
it ( 'null' , function ( ) { assert . equal ( false , lib . numeric ( null ) ) ; } ) ;
151
151
it ( 'boolean' , function ( ) { assert . equal ( false , lib . numeric ( true ) ) ; } ) ;
@@ -167,9 +167,9 @@ describe('validation library', function() {
167
167
it ( 'null' , function ( ) { assert . equal ( false , lib . startsWith ( null ) ) ; } ) ;
168
168
it ( 'null searchString' , function ( ) { assert . equal ( false , lib . startsWith ( 'kilgore trout' , null ) ) ; } ) ;
169
169
it ( 'non-string searchString' , function ( ) { assert . equal ( false , lib . startsWith ( 'kilgore trout' , 3 ) ) ; } ) ;
170
- it ( 'trims value ' , function ( ) { assert . equal ( true , lib . startsWith ( ' kilgore trout' , 'kilg' ) ) ; } ) ;
170
+ it ( 'does not trim ' , function ( ) { assert . equal ( false , lib . startsWith ( ' kilgore trout' , 'kilg' ) ) ; } ) ;
171
171
it ( 'does not trim searchString' , function ( ) { assert . equal ( false , lib . startsWith ( 'kilgore trout' , ' kilg' ) ) ; } ) ;
172
- it ( 'does not trim searchString2' , function ( ) { assert . equal ( false , lib . startsWith ( ' kilgore trout' , ' kilg' ) ) ; } ) ;
172
+ it ( 'does not trim searchString2' , function ( ) { assert . equal ( true , lib . startsWith ( ' kilgore trout' , ' kilg' ) ) ; } ) ;
173
173
it ( 'empty string' , function ( ) { assert . equal ( false , lib . startsWith ( '' , 'kilgore ' ) ) ; } ) ;
174
174
} ) ;
175
175
describe ( 'url' , function ( ) {
0 commit comments