I developed a ruby wrapper for one HTTP REST API, using rspec with vcr for testing my requests. Project is loaded to travis-ci.org, which automatiacly runs tests all the time. I have a problem inside my test. VCR can't handle requests inside before and after hooks, implemented to prevent filling server with test data.
describe '.find' do
before :all do
@project = Project.new(name: "Project#{Time.now.to_i}").save
end
after :all do
@project.delete
end
#tests
end
I got a vcr error:
An error occurred in a before(:all) hook.
VCR::Errors::UnhandledHTTPRequestError:
Of course, I don't want to create and delete a remote entity in each test.