Comments (3)
Thanks for the comment. As you indicated, it's downcased and hasn't provided the way to maintain the original case.
https://github.com/parroty/exvcr/blob/v0.8.1/lib/exvcr/mock.ex#L116
If it doesn't break existing tests, it may be an option to provide some way (like providing a optional setting) to maintain the case.
from exvcr.
@parroty the motivation behind this is that it's easy to run into problems with case sensitive / case insensitive file systems. I, for one, just did and lost a few hours yesterday debugging the issue with travis build.
Per travis docs:
The HFS+ file system on our OS X workers is case-insensitive (which is the default for OS X), and the files in a directory are returned sorted. On Linux, the file system is case-sensitive, and returns directory entries in the order they appear in the directory internally.
I ran exactly into this problem.
I got used to naming my cassette folders after test modules, e.g. Stripe.PlanTest/
, MyLib.MyModuleTest/
, etc. Now, given the FS differences and the fact that ExVCR downcases paths on the fly, I experienced the following:
- OS X:
MyLib.MyModuleTest/my_cassette.json == mylib.mymoduletest/my_cassette.json
, thus the cassettes are found and everything works, - Linux:
MyLib.MyModuleTest/my_cassette.json != mylib.mymoduletest/my_cassette.json
, ExVCR doesn't find the cassette folder, and performs actual requests.
I think the best way to solve this would be to not downcase at all. However, making this optional is a good way resolve this in a short term (with default to perform downcase, e.g. no behaviour change). Yet in the long term I think a few additional things should happen:
- remove downcasing logic entirely in future release (after all, since the cassette names in tests are written manually by a human, most will expect that ExVCR resolves the exact file path specified in the
use_cassette
), - in case of
perform_downcase: true
(or whatever this option would be called), add a warning that this flag will be removed in future release and the behaviour will change to always match the path.
Let me know if this makes sense.
from exvcr.
Thanks for the explanation and sorry being late to respond.
The explanation makes sense. In the short term, I prefer the option like perform_downcase: true
though it maybe good to change at some point. I try to update the code, but pull request would great too :-)
from exvcr.
Related Issues (20)
- Request was made? HOT 1
- ExVCR.IEx not working with adapter: ExVCR.Adapter.Hackney HOT 2
- disable global mock HOT 14
- Global Mock does not use cassettes with HTTPoison HOT 2
- How to use ExVCR with Finch? HOT 3
- Filter sensitive data after all request made HOT 1
- Support `mix vcr.check --include mytag` ?
- Can't match json response bodies for removing sensitive data? HOT 1
- Cassettes are not injected after test cases! HOT 1
- ** (ArgumentError) argument error
- Support for Finch 0.9.x? HOT 1
- Feature request: `start_cassette` and `stop_cassette`
- Same as vcr request: save response json body with more formatting HOT 1
- Generated custom_cassettes with patchfile HOT 1
- Wrong responses when HTTPoison is used from async Task HOT 4
- Async tests using Bypass interfere with ExVcr tests HOT 3
- support httpoison 2.0 HOT 1
- Version `0.14.0` cannot be compiled in projects not using `Finch`
- Unable to record when specifying a receive_timeout option
- Long list of warnings on Elixir 1.16 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from exvcr.