@@ -18,6 +18,13 @@ var NODE = which.sync('node');
1818debug ( 'path to m bin is %s' , M ) ;
1919debug ( 'path to node bin is %s' , NODE ) ;
2020
21+ var skipIfNotLinux = function ( runner ) {
22+ if ( process . platform !== 'linux' ) {
23+ runner . skip ( ) ;
24+ return ;
25+ }
26+ } ;
27+
2128var run = function ( command , done ) {
2229 /* eslint no-sync:0 no-console:0 */
2330 if ( typeof command === 'function' ) {
@@ -266,26 +273,28 @@ describe('mongodb-version-manager', function() {
266273 } ) ;
267274 describe ( 'linux' , function ( ) {
268275 it ( 'should install 2.6.11 #slow' , function ( done ) {
276+ skipIfNotLinux ( this ) ;
269277 this . slow ( 25000 ) ;
270278 use ( '2.6.11' , 'linux' , done ) ;
271279 } ) ;
272280 it ( 'should have current symlink in $PATH' , function ( ) {
281+ skipIfNotLinux ( this ) ;
273282 inPATH ( 'current' , 'linux' ) ;
274283 } ) ;
275284 it ( 'should symlink 2.6.11 as current' , function ( done ) {
276- if ( process . platform !== 'linux' ) {
277- this . skip ( ) ;
278- return ;
279- }
285+ skipIfNotLinux ( this ) ;
280286 shouldHaveCurrent ( '2.6.11' , 'linux' , done ) ;
281287 } ) ;
282288 it ( 'should have an executable shell binary' , function ( done ) {
289+ skipIfNotLinux ( this ) ;
283290 shouldHaveExecutable ( 'mongo' , '2.6.11' , 'linux' , done ) ;
284291 } ) ;
285292 it ( 'should have an executable store binary' , function ( done ) {
293+ skipIfNotLinux ( this ) ;
286294 shouldHaveExecutable ( 'mongod' , '2.6.11' , 'linux' , done ) ;
287295 } ) ;
288296 it ( 'should have an executable router binary' , function ( done ) {
297+ skipIfNotLinux ( this ) ;
289298 shouldHaveExecutable ( 'mongos' , '2.6.11' , 'linux' , done ) ;
290299 } ) ;
291300 } ) ;
0 commit comments