@@ -5,46 +5,40 @@ describe("Pathspec", function() {
55 var Pathspec = NodeGit . Pathspec ;
66
77 it ( "can accept just about anything against a * pathspec" , function ( ) {
8- return Pathspec . create ( "*" )
9- . then ( function ( pathspec ) {
10- assert . equal ( pathspec . matchesPath ( 0 , "burritoooo" ) , 1 ) ;
11- assert . equal ( pathspec . matchesPath ( 0 , "bob/ted/yoghurt.mp3" ) , 1 ) ;
12- } ) ;
8+ var pathspec = Pathspec . create ( "*" ) ;
9+
10+ assert . equal ( pathspec . matchesPath ( 0 , "burritoooo" ) , 1 ) ;
11+ assert . equal ( pathspec . matchesPath ( 0 , "bob/ted/yoghurt.mp3" ) , 1 ) ;
1312 } ) ;
1413
1514 it ( "can take a * in an array" , function ( ) {
16- return Pathspec . create ( [ "*" ] )
17- . then ( function ( pathspec ) {
18- assert . equal ( pathspec . matchesPath ( 0 , "burritoooo" ) , 1 ) ;
19- assert . equal ( pathspec . matchesPath ( 0 , "bob/ted/yoghurt.mp3" ) , 1 ) ;
20- } ) ;
15+ var pathspec = Pathspec . create ( "*" ) ;
16+
17+ assert . equal ( pathspec . matchesPath ( 0 , "burritoooo" ) , 1 ) ;
18+ assert . equal ( pathspec . matchesPath ( 0 , "bob/ted/yoghurt.mp3" ) , 1 ) ;
2119 } ) ;
2220
2321 it ( "can take a single file" , function ( ) {
24- return Pathspec . create ( [ "myDir/burritoSupreme.mp4" ] )
25- . then ( function ( pathspec ) {
26- assert . equal ( pathspec . matchesPath ( 0 , "myDir/burritoSupreme.mp4" ) , 1 ) ;
27- assert . equal ( pathspec . matchesPath ( 0 , "bob/ted/yoghurt.mp3" ) , 0 ) ;
28- } ) ;
22+ var pathspec = Pathspec . create ( [ "myDir/burritoSupreme.mp4" ] ) ;
23+
24+ assert . equal ( pathspec . matchesPath ( 0 , "myDir/burritoSupreme.mp4" ) , 1 ) ;
25+ assert . equal ( pathspec . matchesPath ( 0 , "bob/ted/yoghurt.mp3" ) , 0 ) ;
2926 } ) ;
3027
3128 it ( "can take files in an array" , function ( ) {
32- return Pathspec . create ( [ "gwendoline.txt" , "sausolito.ogg" ] )
33- . then ( function ( pathspec ) {
34- assert . equal ( pathspec . matchesPath ( 0 , "gwendoline.txt" ) , 1 ) ;
35- assert . equal ( pathspec . matchesPath ( 0 , "sausolito.ogg" ) , 1 ) ;
36- assert . equal ( pathspec . matchesPath ( 0 , "sausolito.txt" ) , 0 ) ;
37- } ) ;
29+ var pathspec = Pathspec . create ( [ "gwendoline.txt" , "sausolito.ogg" ] ) ;
30+
31+ assert . equal ( pathspec . matchesPath ( 0 , "gwendoline.txt" ) , 1 ) ;
32+ assert . equal ( pathspec . matchesPath ( 0 , "sausolito.ogg" ) , 1 ) ;
33+ assert . equal ( pathspec . matchesPath ( 0 , "sausolito.txt" ) , 0 ) ;
3834 } ) ;
3935
4036 it ( "can handle dirs" , function ( ) {
41- return Pathspec . create ( [ "myDir/" , "bob.js" ] )
42- . then ( function ( pathspec ) {
43- assert . equal ( pathspec . matchesPath ( 0 , "bob.js" ) , 1 ) ;
44- assert . equal ( pathspec . matchesPath ( 0 , "myDir/bob2.js" ) , 1 ) ;
45- assert . equal ( pathspec . matchesPath ( 0 , "bob2.js" ) , 0 ) ;
46- assert . equal ( pathspec . matchesPath ( 0 , "herDir/bob.js" ) , 0 ) ;
47- } ) ;
48- } ) ;
37+ var pathspec = Pathspec . create ( [ "myDir/" , "bob.js" ] ) ;
4938
39+ assert . equal ( pathspec . matchesPath ( 0 , "bob.js" ) , 1 ) ;
40+ assert . equal ( pathspec . matchesPath ( 0 , "myDir/bob2.js" ) , 1 ) ;
41+ assert . equal ( pathspec . matchesPath ( 0 , "bob2.js" ) , 0 ) ;
42+ assert . equal ( pathspec . matchesPath ( 0 , "herDir/bob.js" ) , 0 ) ;
43+ } ) ;
5044} ) ;
0 commit comments