@@ -150,28 +150,22 @@ describe("VersionRange loading strategy", () => {
150
150
describe ( "when the version is not cached" , ( ) => {
151
151
beforeEach ( ( ) => {
152
152
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" ) ;
157
154
} ) ;
158
155
afterEach ( ( ) => {
159
156
unStub ( instance . cache ! , "has" ) ;
160
- unStub ( instance . cache ! , "add" ) ;
161
- unStub ( instance , "compilerFromString" ) ;
157
+ unStub ( instance , "getAndCacheSoljsonByUrl" ) ;
162
158
} ) ;
163
159
164
- it ( "eventually calls add and compilerFromString " , async ( ) => {
160
+ it ( "eventually calls .getAndCacheSoljsonByUrl " , async ( ) => {
165
161
await instance . getSolcFromCacheOrUrl ( "0.5.1" ) ;
166
162
// @ts -ignore
167
- assert . isTrue ( instance . cache . add . called ) ;
168
- // @ts -ignore
169
- assert . isTrue ( instance . compilerFromString . called ) ;
163
+ assert . isTrue ( instance . getAndCacheSoljsonByUrl . called ) ;
170
164
} ) . timeout ( 60000 ) ;
171
165
} ) ;
172
166
} ) ;
173
167
174
- describe ( ".getAndCacheSolcByUrl (fileName)" , ( ) => {
168
+ describe ( ".getAndCacheSoljsonByUrl (fileName)" , ( ) => {
175
169
beforeEach ( ( ) => {
176
170
fileName = "someSolcFile" ;
177
171
sinon
@@ -180,15 +174,10 @@ describe("VersionRange loading strategy", () => {
180
174
. returns ( Promise . resolve ( { data : "requestReturn" } ) ) ;
181
175
// @ts -ignore
182
176
sinon . stub ( instance . cache , "add" ) . withArgs ( "requestReturn" ) ;
183
- sinon
184
- . stub ( instance , "compilerFromString" )
185
- . withArgs ( "requestReturn" )
186
- . returns ( Promise . resolve ( "success" ) ) ;
187
177
} ) ;
188
178
afterEach ( ( ) => {
189
179
unStub ( axios , "get" ) ;
190
180
unStub ( instance . cache ! , "add" ) ;
191
- unStub ( instance , "compilerFromString" ) ;
192
181
} ) ;
193
182
194
183
it ( "calls add with the response and the file name" , async ( ) => {
@@ -197,7 +186,7 @@ describe("VersionRange loading strategy", () => {
197
186
// @ts -ignore
198
187
instance . cache . add . calledWith ( "requestReturn" , "someSolcFile" )
199
188
) ;
200
- assert . equal ( result , "success " ) ;
189
+ assert . equal ( result , "requestReturn " ) ;
201
190
} ) ;
202
191
} ) ;
203
192
0 commit comments