Fixed spec test for key rotate with minor code structure cleanup
Fixed spec test for key rotate with minor code structure cleanup

GoogleCloudPlatform/ruby-docs-samples,GoogleCloudPlatform/ruby-docs-samples,GoogleCloudPlatform/ruby-docs-samples,GoogleCloudPlatform/ruby-docs-samples