@@ -200,6 +200,21 @@ describe('The flake8 provider for Linter', () => {
200200 ) ;
201201 } ) ;
202202
203+ it ( 'finds executable relative to projects' , ( ) => {
204+ const paths = [
205+ path . join ( '$project' , 'null' ) ,
206+ path . join ( '$pRoJeCt' , 'flake1' ) ,
207+ path . join ( '$PrOjEcT' , 'flake2' ) ,
208+ path . join ( '$PROJECT' , 'flake8' ) ,
209+ ] . join ( ';' ) ;
210+ atom . config . set ( 'linter-flake8.executablePath' , paths ) ;
211+ waitsForPromise ( ( ) =>
212+ lint ( editor ) . then ( ( ) =>
213+ expect ( execParams . pop ( ) [ 0 ] ) . toBe ( path . join ( fixturePath , 'flake8' ) ) ,
214+ ) ,
215+ ) ;
216+ } ) ;
217+
203218 it ( 'finds executable using project name' , ( ) => {
204219 atom . config . set ( 'linter-flake8.executablePath' ,
205220 path . join ( '$PROJECT_NAME' , 'flake8' ) ,
@@ -211,6 +226,27 @@ describe('The flake8 provider for Linter', () => {
211226 ) ;
212227 } ) ;
213228
229+ it ( 'finds executable using project names' , ( ) => {
230+ const paths = [
231+ path . join ( '$project_name' , 'null' ) ,
232+ path . join ( '$pRoJeCt_NaMe' , 'flake1' ) ,
233+ path . join ( '$PrOjEcT_nAmE' , 'flake2' ) ,
234+ path . join ( '$PROJECT_NAME' , 'flake8' ) ,
235+ ] . join ( ';' ) ;
236+ const correct = [
237+ path . join ( 'fixtures' , 'null' ) ,
238+ path . join ( 'fixtures' , 'flake1' ) ,
239+ path . join ( 'fixtures' , 'flake2' ) ,
240+ path . join ( 'fixtures' , 'flake8' ) ,
241+ ] . join ( ';' ) ;
242+ atom . config . set ( 'linter-flake8.executablePath' , paths ) ;
243+ waitsForPromise ( ( ) =>
244+ lint ( editor ) . then ( ( ) =>
245+ expect ( execParams . pop ( ) [ 0 ] ) . toBe ( correct ) ,
246+ ) ,
247+ ) ;
248+ } ) ;
249+
214250 it ( 'normalizes executable path' , ( ) => {
215251 atom . config . set ( 'linter-flake8.executablePath' ,
216252 path . join ( fixturePath , '..' , 'fixtures' , 'flake8' ) ,
0 commit comments