11/* eslint-env mocha */
22'use strict' ;
33var path = require ( 'path' ) ;
4- var File = require ( 'gulp-util' ) . File ;
4+ var Vinyl = require ( 'vinyl' ) ;
55require ( 'should' ) ;
66var getFilepath = require ( './' ) ;
77
88describe ( 'getFilepath' , function ( ) {
99 describe ( '(relative=false)' , function ( ) {
1010 it ( 'returns the path relative to the source file\'s cwd' , function ( ) {
11- var source = new File ( {
11+ var source = new Vinyl ( {
1212 cwd : __dirname ,
1313 path : path . join ( __dirname , 'dir' , 'file.js' ) ,
1414 base : path . join ( __dirname , 'dir' )
@@ -19,7 +19,7 @@ describe('getFilepath', function () {
1919 } ) ;
2020
2121 it ( 'returns the unixified path relative to the source file\'s cwd' , function ( ) {
22- var source = new File ( {
22+ var source = new Vinyl ( {
2323 cwd : 'C:\\a\\folder' ,
2424 path : 'C:\\a\\folder\\dir\\file.js' ,
2525 base : 'C:\\a\\folder\\dir'
@@ -32,12 +32,12 @@ describe('getFilepath', function () {
3232
3333 describe ( '(relative=true)' , function ( ) {
3434 it ( 'returns the path relative to the target file\'s directory' , function ( ) {
35- var target = new File ( {
35+ var target = new Vinyl ( {
3636 cwd : __dirname ,
3737 path : path . join ( __dirname , 'dir1' , 'index.html' ) ,
3838 base : path . join ( __dirname , 'dir1' )
3939 } ) ;
40- var source = new File ( {
40+ var source = new Vinyl ( {
4141 cwd : __dirname ,
4242 path : path . join ( __dirname , 'dir2' , 'file.js' ) ,
4343 base : path . join ( __dirname , 'dir2' )
@@ -48,12 +48,12 @@ describe('getFilepath', function () {
4848 } ) ;
4949
5050 it ( 'returns the unixified path relative to the source file\'s cwd' , function ( ) {
51- var target = new File ( {
51+ var target = new Vinyl ( {
5252 cwd : 'C:\\a\\folder' ,
5353 path : 'C:\\a\\folder\\dir1\\index.html' ,
5454 base : 'C:\\a\\folder\\dir1'
5555 } ) ;
56- var source = new File ( {
56+ var source = new Vinyl ( {
5757 cwd : 'C:\\a\\folder' ,
5858 path : 'C:\\a\\folder\\dir2\\file.js' ,
5959 base : 'C:\\a\\folder\\dir2'
@@ -66,7 +66,7 @@ describe('getFilepath', function () {
6666
6767 describe ( '(ignorePath)' , function ( ) {
6868 it ( 'removes the provided `ignorePath` from the beginning of the path' , function ( ) {
69- var source = new File ( {
69+ var source = new Vinyl ( {
7070 cwd : __dirname ,
7171 path : path . join ( __dirname , 'dir' , 'file.js' ) ,
7272 base : path . join ( __dirname , 'dir' )
@@ -77,7 +77,7 @@ describe('getFilepath', function () {
7777 } ) ;
7878
7979 it ( 'removes the provided `ignorePath` even if it both begins and ends in a `/` from the beginning of the path' , function ( ) {
80- var source = new File ( {
80+ var source = new Vinyl ( {
8181 cwd : __dirname ,
8282 path : path . join ( __dirname , 'dir' , 'file.js' ) ,
8383 base : path . join ( __dirname , 'dir' )
@@ -88,7 +88,7 @@ describe('getFilepath', function () {
8888 } ) ;
8989
9090 it ( 'removes the provided `ignorePath`s from the beginning of the path' , function ( ) {
91- var source = new File ( {
91+ var source = new Vinyl ( {
9292 cwd : __dirname ,
9393 path : path . join ( __dirname , 'dir' , 'file.js' ) ,
9494 base : path . join ( __dirname , 'dir' )
@@ -99,7 +99,7 @@ describe('getFilepath', function () {
9999 } ) ;
100100
101101 it ( 'removes the provided `ignorePath` unixified from the beginning of the path' , function ( ) {
102- var source = new File ( {
102+ var source = new Vinyl ( {
103103 cwd : __dirname ,
104104 path : path . join ( __dirname , 'dir' , 'deep' , 'file.js' ) ,
105105 base : path . join ( __dirname , 'dir' , 'deep' )
@@ -110,7 +110,7 @@ describe('getFilepath', function () {
110110 } ) ;
111111
112112 it ( 'removes the provided `ignorePath` unixified from the beginning of a unixified path' , function ( ) {
113- var source = new File ( {
113+ var source = new Vinyl ( {
114114 cwd : 'C:\\a\\folder' ,
115115 path : 'C:\\a\\folder\\dir\\deep\\file.js' ,
116116 base : 'C:\\a\\folder\\dir\\deep'
@@ -121,7 +121,7 @@ describe('getFilepath', function () {
121121 } ) ;
122122
123123 it ( 'removes the provided `ignorePath` from the beginning of a unixified path' , function ( ) {
124- var source = new File ( {
124+ var source = new Vinyl ( {
125125 cwd : 'C:\\a\\folder' ,
126126 path : 'C:\\a\\folder\\dir\\deep\\file.js' ,
127127 base : 'C:\\a\\folder\\dir\\deep'
@@ -134,7 +134,7 @@ describe('getFilepath', function () {
134134
135135 describe ( '(addRootSlash=true)' , function ( ) {
136136 it ( 'prepends the path with a `/`' , function ( ) {
137- var source = new File ( {
137+ var source = new Vinyl ( {
138138 cwd : __dirname ,
139139 path : path . join ( __dirname , 'dir' , 'file.js' ) ,
140140 base : path . join ( __dirname , 'dir' )
@@ -147,7 +147,7 @@ describe('getFilepath', function () {
147147
148148 describe ( '(addPrefix)' , function ( ) {
149149 it ( 'prepends the prefix and a `/` to the path' , function ( ) {
150- var source = new File ( {
150+ var source = new Vinyl ( {
151151 cwd : __dirname ,
152152 path : path . join ( __dirname , 'dir' , 'file.js' ) ,
153153 base : path . join ( __dirname , 'dir' )
@@ -158,7 +158,7 @@ describe('getFilepath', function () {
158158 } ) ;
159159
160160 it ( 'keeps any leading `/` from the prefix' , function ( ) {
161- var source = new File ( {
161+ var source = new Vinyl ( {
162162 cwd : __dirname ,
163163 path : path . join ( __dirname , 'dir' , 'file.js' ) ,
164164 base : path . join ( __dirname , 'dir' )
@@ -171,7 +171,7 @@ describe('getFilepath', function () {
171171
172172 describe ( '(addSuffix)' , function ( ) {
173173 it ( 'appends the suffix to the path' , function ( ) {
174- var source = new File ( {
174+ var source = new Vinyl ( {
175175 cwd : __dirname ,
176176 path : path . join ( __dirname , 'dir' , 'file.js' ) ,
177177 base : path . join ( __dirname , 'dir' )
0 commit comments