@@ -119,7 +119,7 @@ defmodule Mimic do
119
119
"""
120
120
@ spec stub ( module ( ) , atom ( ) , function ( ) ) :: module
121
121
def stub ( module , function_name , function ) do
122
- arity = :erlang . fun_info ( function ) [ :arity ]
122
+ arity = Function . info ( function ) [ :arity ]
123
123
raise_if_not_exported_function! ( module , function_name , arity )
124
124
125
125
module
@@ -228,7 +228,7 @@ defmodule Mimic do
228
228
def expect ( module , fn_name , num_calls , func )
229
229
when is_atom ( module ) and is_atom ( fn_name ) and is_integer ( num_calls ) and num_calls >= 1 and
230
230
is_function ( func ) do
231
- arity = :erlang . fun_info ( func ) [ :arity ]
231
+ arity = Function . info ( func ) [ :arity ]
232
232
raise_if_not_exported_function! ( module , fn_name , arity )
233
233
234
234
module
@@ -258,7 +258,7 @@ defmodule Mimic do
258
258
"""
259
259
@ spec reject ( function ) :: module
260
260
def reject ( function ) when is_function ( function ) do
261
- fun_info = :erlang . fun_info ( function )
261
+ fun_info = Function . info ( function )
262
262
arity = fun_info [ :arity ]
263
263
module = fun_info [ :module ]
264
264
fn_name = fun_info [ :name ]
@@ -294,7 +294,7 @@ defmodule Mimic do
294
294
@ spec reject ( module , atom , non_neg_integer ) :: module
295
295
def reject ( module , function_name , arity ) do
296
296
raise_if_not_exported_function! ( module , function_name , arity )
297
- func = :erlang . make_fun ( module , function_name , arity )
297
+ func = Function . capture ( module , function_name , arity )
298
298
299
299
module
300
300
|> Server . expect ( function_name , arity , 0 , func )
0 commit comments