Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
amatalai committed Jul 3, 2024
1 parent 6467c3e commit be784c1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.3.2 (2024-07-03)

- Added missing () to fix warnings

## 2.3.1 (2019-10-10)

- Fixed issue preventing module attributes to be used in assert_called macros [#34](https://github.com/appunite/mockery/pull/34)
Expand Down
4 changes: 2 additions & 2 deletions lib/mockery/proxy.ex
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ defmodule Mockery.Proxy do

Utils.push_call(mod, name, arity, args)

if {name, arity} in mod.module_info[:exports] do
if {name, arity} in mod.module_info()[:exports] do
case Utils.get_mock(mod, [{name, arity}]) || Utils.get_mock(mod, name) do
nil ->
fallback_to_global_mock(mod, name, args, arity, by)
Expand Down Expand Up @@ -51,7 +51,7 @@ defmodule Mockery.Proxy do
defp fallback_to_global_mock(mod, name, args, arity, global_mock) do
Utils.validate_global_mock!(mod, global_mock)

if {name, arity} in global_mock.module_info[:exports] do
if {name, arity} in global_mock.module_info()[:exports] do
apply(global_mock, name, args)
else
fallback_to_original(mod, name, args)
Expand Down
4 changes: 2 additions & 2 deletions lib/mockery/utils.ex
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ defmodule Mockery.Utils do
# Global mock cannot export function that the original module
# does not export
def validate_global_mock!(original, mock) do
original_exports = original.module_info[:exports]
mock_exports = mock.module_info[:exports] -- [__info__: 1]
original_exports = original.module_info()[:exports]
mock_exports = mock.module_info()[:exports] -- [__info__: 1]

case Enum.reject(mock_exports, &(&1 in original_exports)) do
[] ->
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Mockery.Mixfile do
use Mix.Project

@version "2.3.1"
@version "2.3.2"

def project do
[
Expand Down

0 comments on commit be784c1

Please sign in to comment.