+
Skip to content

Deleting existing function does not work #238

@Juliusan

Description

@Juliusan

It was possible to delete the function, that is implemented, using meck:delete in version 0.9.0, however in 0.9.1 this throws an error.

Reproduction Steps

  1. Implement a module with some exported function:
-module(some_module).
-export([some_function/2]).
some_function(SomeArg1, SomeArg2) ->
    {ok, SomeArg1, SomeArg2}.
  1. Delete the exported function using meck and check if it is still available to be called.

Expected behavior

This test should pass:

meck_delete_test() ->
    ok = meck:new(some_module, [passthrough]),
    ?assert(erlang:function_exported(some_module, some_function, 2)),
    ok = meck:delete(some_module, some_function, 2, true),
    ?assertNot(erlang:function_exported(some_module, some_function, 2)),
    ?assert(meck:validate([some_module])),
    ok = meck:unload([some_module]).

Observed behavior

The test fails, indicating that second call to function_exported is still true.

Versions

  • Meck version: 0.9.1 (the test passes in 0.9.0)
  • Erlang version: 24.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载