Skip to content

Commit

Permalink
Merge pull request #5 from derekkraan/set_integration_mode
Browse files Browse the repository at this point in the history
Set integration mode (fix set_mode/1)
  • Loading branch information
derekkraan committed Mar 27, 2019
2 parents 65525b4 + 3378561 commit c0016a8
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/walkman.ex
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,13 @@ defmodule Walkman do
@doc """
Set Walkman's mode. The default is `:normal`.
Walkman has three modes:
Walkman has two modes:
- `:normal` - if a tape is found, then the tape is replayed. If there is no tape, then a new one is made. This is the closest to how Ruby's VCR works.
- `:replay` - only replay, and raise an exception if no pre-recorded tape is found. This should be used when running the tests on the CI.
- `:record` - all calls are passed through to the implementation and record new tapes. This can be used to re-record tapes.
- `:integration` - calls are passed through to the implementation but no new tapes are made. Useful for running integration tests on the CI.
"""
@spec set_mode(mode :: :normal | :replay | :record) :: :ok
def set_mode(mode) when mode in [:normal, :replay, :record] do
@spec set_mode(mode :: :normal | :integration) :: :ok
def set_mode(mode) when mode in [:normal, :integration] do
:ok = GenServer.call(__MODULE__, {:set_mode, mode})
end

Expand Down

0 comments on commit c0016a8

Please sign in to comment.