Skip to content
This repository was archived by the owner on Dec 6, 2022. It is now read-only.

Commit 9105d5b

Browse files
author
Isaac Hollander McCreery
committedJun 8, 2015
[shindo-minitest] convert TargetHttpProxies tests to minitest, including a few bug fixes in the implementation of TargetHttpProxies
1 parent c5ec693 commit 9105d5b

File tree

4 files changed

+37
-3
lines changed

4 files changed

+37
-3
lines changed
 

‎lib/fog/google/models/compute/target_http_proxies.rb

+5-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ def all(filters={})
1313
end
1414

1515
def get(identity)
16-
response = service.get_target_http_proxy(identity)
17-
new(response.body) unless response.nil?
16+
if target_http_proxy = service.get_target_http_proxy(identity).body
17+
new(target_http_proxy)
18+
end
19+
rescue Fog::Errors::NotFound
20+
nil
1821
end
1922
end
2023
end

‎lib/fog/google/models/compute/target_http_proxy.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class TargetHttpProxy < Fog::Model
1111
attribute :id, :aliases => 'id'
1212
attribute :creation_timestamp, :aliases => 'creationTimestamp'
1313
attribute :description, :aliases => 'description'
14-
attribute :urlMap, :aliases => "urlMap"
14+
attribute :urlMap, :aliases => ["urlMap", :url_map]
1515

1616
def save
1717
requires :name
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
require "factories/collection_factory"
2+
require "factories/url_maps_factory"
3+
4+
class TargetHttpProxiesFactory < CollectionFactory
5+
def initialize(example)
6+
@url_maps = UrlMapsFactory.new(example)
7+
super(Fog::Compute[:google].target_http_proxies, example)
8+
end
9+
10+
def cleanup
11+
super
12+
@url_maps.cleanup
13+
end
14+
15+
def params
16+
params = {:name => resource_name,
17+
:url_map => @url_maps.create.self_link}
18+
end
19+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
require "minitest_helper"
2+
require "helpers/test_collection"
3+
require "factories/target_http_proxies_factory"
4+
5+
class TestTargetHttpProxies < FogIntegrationTest
6+
include TestCollection
7+
8+
def setup
9+
@subject = Fog::Compute[:google].target_http_proxies
10+
@factory = TargetHttpProxiesFactory.new(namespaced_name)
11+
end
12+
end

0 commit comments

Comments
 (0)
This repository has been archived.