Skip to content
This repository was archived by the owner on Jan 5, 2022. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/fixture/fixture.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ defmodule ElixirTools.Fixture do
@doc """
Looks for a fixture without decoding
"""
@spec load!(String.t(), String.t()) :: String.t()
def load!(fixture, location \\ @fixture_location) do
file = location <> fixture <> ".json"
@spec load!(String.t(), String.t(), String.t()) :: String.t()
def load!(fixture, location \\ @fixture_location, file_extension \\ ".json") do
file = location <> fixture <> file_extension
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since load has nothing to do with json, I would prefer moving this to load_json! https://github.com/digitalorigin/pg-elixir-tools/pull/56/files#diff-0dbd60fba723e3e21c6dff1ddf34eeb4R11

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe for another PR @hylkealons ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since it's directly related, I'd do it here: but up to @fartek

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason why I would leave the default .json here is because maybe some modules in some projects are depending on this default functionality. This is a suggestion to break the current API, which I don't wanna do (in this PR).

file |> File.read!()
end
end