parroty / exvcr

HTTP request/response recording library for elixir, inspired by VCR.
MIT License
720 stars 131 forks source link

Fix CurrentRecorder initial state #163

Closed surik closed 3 years ago

surik commented 3 years ago

The initial state should be nil to properly bypass mock when no cassette is used.

See https://github.com/parroty/exvcr/issues/159#issuecomment-726233421

coveralls commented 3 years ago

Coverage Status

Coverage increased (+0.2%) to 92.491% when pulling cf9585aaac7ecb48834bab0223c2ea3293bbb46d on surik:fix-ccurrent-recorder-initial-state into d757ad434aa877deeb3868bc2efd4e7bb372cb93 on parroty:master.

coveralls commented 3 years ago

Coverage Status

Coverage remained the same at 92.308% when pulling cf9585aaac7ecb48834bab0223c2ea3293bbb46d on surik:fix-ccurrent-recorder-initial-state into d757ad434aa877deeb3868bc2efd4e7bb372cb93 on parroty:master.

parroty commented 3 years ago

Thanks!

parroty commented 3 years ago

@surik Just one thing that following warning seems emitted during the build (though the code itself does not appear multiple times). Does it make sense to change _arg to _?

$ mix test
warning: the underscored variable "_arg" appears more than once in a match. This means the pattern will only match if all "_arg" bind to the same value. If this is the intended behaviour, please remove the leading underscore from the variable name, otherwise give the variables different names
  lib/exvcr/actor.ex:58: ExVCR.Actor.CurrentRecorder.start_link/1

warning: the underscored variable "_arg" is used after being set. A leading underscore indicates that the value of the variable should be ignored. If this is intended please rename the variable to remove the underscore
  lib/exvcr/actor.ex:58: ExVCR.Actor.CurrentRecorder.start_link/1

$ elixir -v
Erlang/OTP 23 [erts-11.0.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe] [dtrace]

Elixir 1.11.2 (compiled with Erlang/OTP 23)
surik commented 3 years ago

@parroty ah yes, this would make sense.

parroty commented 3 years ago

Thanks.