mirror of
https://github.com/puppetlabs/vmpooler-provider-gce.git
synced 2026-01-26 03:18:41 -05:00
adding spec tests
This commit is contained in:
parent
b631570871
commit
2a0e9f5bdc
9 changed files with 1278 additions and 41 deletions
37
spec/spec_helper.rb
Normal file
37
spec/spec_helper.rb
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue