Moved the code to clear the cache into an ensure block
Moved the code to clear the cache into an ensure block

Removes the duplication

ruby-json-schema/json-schema,iainbeeston/json-schema,RST-J/json-schema,openc/json-schema,ganeshkumar/json-schema,openc/json-schema