@@ -150,28 +150,22 @@ describe("VersionRange loading strategy", () => {
150150 describe ( "when the version is not cached" , ( ) => {
151151 beforeEach ( ( ) => {
152152 sinon . stub ( instance . cache ! , "has" ) . returns ( false ) ;
153- sinon . stub ( instance . cache ! , "add" ) ;
154- sinon
155- . stub ( instance , "compilerFromString" )
156- . returns ( Promise . resolve ( "compiler" ) ) ;
153+ sinon . stub ( instance , "getAndCacheSoljsonByUrl" ) ;
157154 } ) ;
158155 afterEach ( ( ) => {
159156 unStub ( instance . cache ! , "has" ) ;
160- unStub ( instance . cache ! , "add" ) ;
161- unStub ( instance , "compilerFromString" ) ;
157+ unStub ( instance , "getAndCacheSoljsonByUrl" ) ;
162158 } ) ;
163159
164- it ( "eventually calls add and compilerFromString " , async ( ) => {
160+ it ( "eventually calls .getAndCacheSoljsonByUrl " , async ( ) => {
165161 await instance . getSolcFromCacheOrUrl ( "0.5.1" ) ;
166162 // @ts -ignore
167- assert . isTrue ( instance . cache . add . called ) ;
168- // @ts -ignore
169- assert . isTrue ( instance . compilerFromString . called ) ;
163+ assert . isTrue ( instance . getAndCacheSoljsonByUrl . called ) ;
170164 } ) . timeout ( 60000 ) ;
171165 } ) ;
172166 } ) ;
173167
174- describe ( ".getAndCacheSolcByUrl (fileName)" , ( ) => {
168+ describe ( ".getAndCacheSoljsonByUrl (fileName)" , ( ) => {
175169 beforeEach ( ( ) => {
176170 fileName = "someSolcFile" ;
177171 sinon
@@ -180,15 +174,10 @@ describe("VersionRange loading strategy", () => {
180174 . returns ( Promise . resolve ( { data : "requestReturn" } ) ) ;
181175 // @ts -ignore
182176 sinon . stub ( instance . cache , "add" ) . withArgs ( "requestReturn" ) ;
183- sinon
184- . stub ( instance , "compilerFromString" )
185- . withArgs ( "requestReturn" )
186- . returns ( Promise . resolve ( "success" ) ) ;
187177 } ) ;
188178 afterEach ( ( ) => {
189179 unStub ( axios , "get" ) ;
190180 unStub ( instance . cache ! , "add" ) ;
191- unStub ( instance , "compilerFromString" ) ;
192181 } ) ;
193182
194183 it ( "calls add with the response and the file name" , async ( ) => {
@@ -197,7 +186,7 @@ describe("VersionRange loading strategy", () => {
197186 // @ts -ignore
198187 instance . cache . add . calledWith ( "requestReturn" , "someSolcFile" )
199188 ) ;
200- assert . equal ( result , "success " ) ;
189+ assert . equal ( result , "requestReturn " ) ;
201190 } ) ;
202191 } ) ;
203192
0 commit comments