Skip to content

Commit f9d2f5b

Browse files
committed
Fix struct test and fix warnings
Also ensure compiler warnings happen on GA
1 parent f073afb commit f9d2f5b

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

.github/workflows/main.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ jobs:
1818
- name: Install dependencies
1919
run: mix deps.get
2020

21+
- name: Compile with --warnings-as-errors
22+
run: mix compile --warnings-as-errors
23+
2124
- name: Run "mix format"
2225
run: mix format --check-formatted
2326

2427
- name: Credo
2528
run: mix credo --strict
2629

27-
- name: Compile with --warnings-as-errors
28-
run: mix compile --warnings-as-errors
29-
3030
test:
3131
name: Test (Elixir ${{matrix.elixir}} | Erlang/OTP ${{matrix.otp}})
3232
runs-on: ubuntu-latest

lib/mimic/server.ex

+3-3
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ defmodule Mimic.Server do
288288
internal_functions = [__info__: 1, module_info: 0, module_info: 1]
289289

290290
stubs =
291-
module.module_info[:exports]
291+
module.module_info(:exports)
292292
|> Enum.filter(&(&1 not in internal_functions))
293293
|> Enum.reduce(state.stubs, fn {fn_name, arity}, stubs ->
294294
func = stub_function(module, fn_name, arity)
@@ -317,12 +317,12 @@ defmodule Mimic.Server do
317317
internal_functions = [__info__: 1, module_info: 0, module_info: 1]
318318

319319
mocked_public_functions =
320-
original_module.module_info[:exports]
320+
original_module.module_info(:exports)
321321
|> Enum.filter(&(&1 not in internal_functions))
322322
|> MapSet.new()
323323

324324
mocking_public_functions =
325-
mocking_module.module_info[:exports]
325+
mocking_module.module_info(:exports)
326326
|> Enum.filter(&(&1 not in internal_functions))
327327
|> MapSet.new()
328328

test/mimic_test.exs

+2
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,8 @@ defmodule Mimic.Test do
947947
end
948948

949949
describe "structs" do
950+
setup :set_mimic_private
951+
950952
test "copies struct fields" do
951953
struct_fields =
952954
Structs.__info__(:struct)

0 commit comments

Comments
 (0)