@@ -37,6 +37,7 @@ describe('Virtualbox installer', function() {
3737 installerDataSvc . tempDir . returns ( 'tempDirectory' ) ;
3838 installerDataSvc . installDir . returns ( 'installationFolder' ) ;
3939 installerDataSvc . virtualBoxDir . returns ( 'installationFolder/virtualbox' ) ;
40+ installerDataSvc . localAppData . restore ( ) ;
4041
4142 let fakeProgress ;
4243
@@ -90,7 +91,7 @@ describe('Virtualbox installer', function() {
9091
9192 it ( 'should download virtualbox installer to temporary folder with name configured file name' , function ( ) {
9293 expect ( new VirtualBoxInstall ( installerDataSvc , 'virtualbox' , 'url' , 'virtualbox.exe' , 'sha' , 'ver' , 'rev' ) . downloadedFile ) . to . equal (
93- path . join ( installerDataSvc . tempDir ( ) , 'virtualbox.exe' ) ) ;
94+ path . join ( installerDataSvc . localAppData ( ) , 'cache' , 'virtualbox.exe' ) ) ;
9495 } ) ;
9596
9697 describe ( 'installer download' , function ( ) {
@@ -113,7 +114,7 @@ describe('Virtualbox installer', function() {
113114 installer . downloadInstaller ( fakeProgress , success , failure ) ;
114115
115116 expect ( spy ) . to . have . been . calledOnce ;
116- expect ( spy ) . to . have . been . calledWith ( path . join ( 'tempDirectory ', 'virtualbox.exe' ) ) ;
117+ expect ( spy ) . to . have . been . calledWith ( path . join ( installerDataSvc . localAppData ( ) , 'cache ', 'virtualbox.exe' ) ) ;
117118 } ) ;
118119
119120 it ( 'should call downloader#download with the specified parameters once' , function ( ) {
@@ -133,13 +134,14 @@ describe('Virtualbox installer', function() {
133134 } ) ;
134135
135136 describe ( 'installation' , function ( ) {
136- let downloadedFile = path . join ( 'tempDirectory' , 'virtualbox.exe' ) ;
137+ let downloadedFile ;
137138 let helper ;
138139
139140 describe ( 'on macos' , function ( ) {
140141 beforeEach ( function ( ) {
141142 helper = new Installer ( 'virtualbox' , fakeProgress ) ;
142143 sandbox . stub ( Platform , 'getOS' ) . returns ( 'macOS' ) ;
144+ downloadedFile = path . join ( installerDataSvc . localAppData ( ) , 'cache' , 'virtualbox.exe' ) ;
143145 installer = new VirtualBoxInstallDarwin ( installerDataSvc , 'virtualbox' , downloadUrl , 'virtualbox.exe' , 'sha' , version , revision ) ;
144146 installer . ipcRenderer = { on : function ( ) { } } ;
145147 } ) ;
@@ -155,6 +157,7 @@ describe('Virtualbox installer', function() {
155157 beforeEach ( function ( ) {
156158 helper = new Installer ( 'virtualbox' , fakeProgress ) ;
157159 sandbox . stub ( Platform , 'getOS' ) . returns ( 'win32' ) ;
160+ downloadedFile = path . join ( installerDataSvc . localAppData ( ) , 'cache' , 'virtualbox.exe' ) ;
158161 installer = new VirtualBoxInstallWindows ( installerDataSvc , 'virtualbox' , downloadUrl , 'virtualbox.exe' , 'sha' , version , revision ) ;
159162 installer . ipcRenderer = { on : function ( ) { } } ;
160163 } ) ;
0 commit comments