timecop
timecop copied to clipboard
Proposal: Usage with RSpec metadata
The VCR uses a API that is possible move the block syntax to a RSpec metadata.
This
it 'my spec' do
VCR.use_cassette('synopsis') do
# code here
end
end
became
it 'my spec', vcr: { cassette_name: 'synopsis' } do
# code here
end
I guess it is possible make this on timecop, sorry never worked on this codebase.
We can have something like:
it 'my spec', timecop: { mode: :freeze, time: Time.local(1990) } do
# code here
end
And on the mode we can pass :freeze
, :travel
and :scale
.
Do you guys think that makes sense?
I make a PR #119 showing my idea. I hope you guys like