adding spec tests

This commit is contained in:
Samuel Beaulieu 2021-12-06 11:11:13 -06:00
parent b631570871
commit 2a0e9f5bdc
No known key found for this signature in database
GPG key ID: 12030F74136D0F34
9 changed files with 1278 additions and 41 deletions

37
spec/spec_helper.rb Normal file
View file

@ -0,0 +1,37 @@
=begin
require 'simplecov'
SimpleCov.start do
add_filter '/spec/'
end
=end
require 'helpers'
require 'rspec'
require 'vmpooler'
require 'redis'
require 'vmpooler/metrics'
require 'computeservice_helper'
def project_root_dir
File.dirname(File.dirname(__FILE__))
end
def fixtures_dir
File.join(project_root_dir, 'spec', 'fixtures')
end
def create_google_client_error(status_code, message, reason="notFound")
Google::Apis::ClientError.new(Google::Apis::ClientError, status_code:status_code, body:'{
"error": {
"code": '+status_code.to_s+',
"message": "'+message+'",
"errors": [
{
"message": "'+message+'",
"domain": "global",
"reason": "'+reason+'"
}
]
}
}
')
end