erb => true on a per tag basis

26 views
Skip to first unread message

Jake Mallory

unread,
Aug 24, 2010, 3:36:16 PM8/24/10
to VCR Rubygem
Is it possible to turn :erb on for certain tags when using the
VCR.cucumber_tags config? I have VCR working quite well with capybara
and culerity but had to switch erb on because a few cassettes needed
dynamic dates. The slowed my suite down from 5 min to 11 min. I
understand that the erb parsing will have this effect so I'm trying to
find bring the suite time back down. Any suggestions would be awesome,
even if it is not vcr settings.

Myron Marston

unread,
Aug 24, 2010, 4:01:34 PM8/24/10
to VCR Rubygem
> Is it possible to turn :erb on for certain tags when using the
> VCR.cucumber_tags config?

Yes:

VCR.cucumber_tags do |t|
t.tags '@my_tag', :erb => true
t.tags '@some', '@other', '@tags'
end

With this code, the my_tag cassette will be eval'd as ERB, and the
other three (some, other and tags) will use the default cassette
options you set in the VCR.config block. You can set whatever
cassette options you want with the last argument to #tags. The README
mentions this in the last sentence of the "Usage with Cucumber"
section. Got any suggestions for ways I can improve the documentation
to make this clearer?

> The slowed my suite down from 5 min to 11 min. I
> understand that the erb parsing will have this effect so I'm trying to
> find bring the suite time back down.

Wow. You're correct that the ERB evaluation should slow stuff down,
but I'm _shocked_ that it slowed down your cucumber suite by a factor
of 2. Were there any other changes that may have contributed to the
slower test time? Is your cucumber suite accessible on github (or
anywhere else)? That'd help me troubleshoot this and hopefully
improve VCR's performance.

Myron
Reply all
Reply to author
Forward
0 new messages