@@ -103,6 +103,13 @@ describe('Platform', function() {
103103
104104 describe ( 'isVirtualizationEnabled' , function ( ) {
105105
106+ it ( 'should return promise resolved to true for unsupported platforms' , function ( ) {
107+ sandbox . stub ( Platform , 'getOS' ) . returns ( 'OS2' ) ;
108+ return Platform . isVirtualizationEnabled ( ) . then ( ( result ) => {
109+ expect ( result ) . to . be . true ;
110+ } ) ;
111+ } ) ;
112+
106113 describe ( 'on mac' , function ( ) {
107114
108115 beforeEach ( function ( ) {
@@ -202,11 +209,21 @@ describe('Platform', function() {
202209 describe ( 'isHypervisorEnabled' , function ( ) {
203210
204211 describe ( 'on mac' , function ( ) {
205- it ( 'should return true if hypervisor check shell script returns true' ) ;
212+ it ( 'should return false' , function ( ) {
213+ sandbox . stub ( Platform , 'getOS' ) . returns ( 'darwin' ) ;
214+ return Platform . isHypervisorEnabled ( ) . then ( ( result ) => {
215+ expect ( result ) . to . be . false ;
216+ } ) ;
217+ } ) ;
206218 } ) ;
207219
208220 describe ( 'on linux' , function ( ) {
209- it ( 'should return true if hypervisor check shell script returns true' ) ;
221+ it ( 'should return false' , function ( ) {
222+ sandbox . stub ( Platform , 'getOS' ) . returns ( 'linux' ) ;
223+ return Platform . isHypervisorEnabled ( ) . then ( ( result ) => {
224+ expect ( result ) . to . be . false ;
225+ } ) ;
226+ } ) ;
210227 } ) ;
211228
212229 describe ( 'on windows' , function ( ) {
@@ -454,4 +471,39 @@ describe('Platform', function() {
454471 } ) ;
455472 } ) ;
456473
474+ describe ( 'getUserHomePath' , function ( ) {
475+ describe ( 'on windows' , function ( ) {
476+ beforeEach ( function ( ) {
477+ sandbox . stub ( Platform , 'getOS' ) . returns ( 'win32' ) ;
478+ sandbox . stub ( Platform , 'getEnv' ) . returns ( { USERPROFILE : 'c:\\Users\\dev1' } ) ;
479+ } ) ;
480+ it ( 'returns USERPROFILE environment variable value' , function ( ) {
481+ return Platform . getUserHomePath ( ) . then ( ( result ) => {
482+ expect ( result ) . to . be . equal ( 'c:\\Users\\dev1' ) ;
483+ } ) ;
484+ } ) ;
485+ } ) ;
486+ describe ( 'on macos' , function ( ) {
487+ beforeEach ( function ( ) {
488+ sandbox . stub ( Platform , 'getOS' ) . returns ( 'darwin' ) ;
489+ sandbox . stub ( Platform , 'getEnv' ) . returns ( { HOME : 'c:\\Users\\dev1' } ) ;
490+ } ) ;
491+ it ( 'returns HOME environment variable value' , function ( ) {
492+ return Platform . getUserHomePath ( ) . then ( ( result ) => {
493+ expect ( result ) . to . be . equal ( 'c:\\Users\\dev1' ) ;
494+ } ) ;
495+ } ) ;
496+ } ) ;
497+ describe ( 'on linux' , function ( ) {
498+ beforeEach ( function ( ) {
499+ sandbox . stub ( Platform , 'getOS' ) . returns ( 'linux' ) ;
500+ sandbox . stub ( Platform , 'getEnv' ) . returns ( { HOME : 'c:\\Users\\dev1' } ) ;
501+ } ) ;
502+ it ( 'returns HOME environment variable value' , function ( ) {
503+ return Platform . getUserHomePath ( ) . then ( ( result ) => {
504+ expect ( result ) . to . be . equal ( 'c:\\Users\\dev1' ) ;
505+ } ) ;
506+ } ) ;
507+ } ) ;
508+ } ) ;
457509} ) ;
0 commit comments