ActiveRecord::Fixture::FormatError with YAML serialization

357 views
Skip to first unread message

Jason Ronallo

unread,
Mar 29, 2013, 11:50:02 AM3/29/13
to vcr-...@googlegroups.com
All my tests pass. Then I add VCR with serialization to YAML, and all my tests pass. Then I rerun my tests, I get a bunch of ActiveRecord::Fixture::FormatError. Serializing to JSON instead and all my tests pass on playback as they should. Any idea what's going on here? What information would I need to figure out why this is happening?

Jason

Myron Marston

unread,
Mar 29, 2013, 12:16:09 PM3/29/13
to VCR Rubygem
It sounds like you've run into this issue:

https://github.com/vcr/vcr/issues/9

As I understand it, ActiveRecord treats any YAML file in the fixtures
directory as an ActiveRecord fixture. Thus, if a VCR cassette saved
in YAML format is saved there, it will think it's a AR fixture and
complain that it's not.

The simple solution is to change the `cassette_library_dir` so that
your VCR cassettes are saved in a different directory.

HTH,
Myron

Jason Ronallo

unread,
Mar 29, 2013, 1:27:30 PM3/29/13
to vcr-...@googlegroups.com

Yes, placing the cassette directory outside of fixtures fixed the issue.  Thank you.

Jason

--
You received this message because you are subscribed to the Google Groups "VCR Rubygem" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vcr-ruby+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply all
Reply to author
Forward
0 new messages