-
Notifications
You must be signed in to change notification settings - Fork 103
Expand file tree
/
Copy pathaws_hosted_zones_test.rb
More file actions
61 lines (50 loc) · 1.33 KB
/
aws_hosted_zones_test.rb
File metadata and controls
61 lines (50 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
require 'helper'
require 'aws_hosted_zones'
require 'aws-sdk-core'
class AWSHostedZonesConstructorTest < Minitest::Test
def test_rejects_unrecognized_params
assert_raises(ArgumentError) { AWSHostedZones.new(unexpected: 9) }
end
end
class AWSHostedZonesSuccessPathTest < Minitest::Test
def setup
data = {}
data[:method] = :list_hosted_zones
mock_data = {}
mock_data[:marker] = 'test1'
mock_data[:is_truncated] = true
mock_data[:max_items] = 1
mock_data[:hosted_zones] = [
id: 'test1',
name: 'test1',
caller_reference: 'test1',
config: {},
resource_record_set_count: 10,
linked_service: {},
]
data[:data] = mock_data
data[:client] = Aws::Route53::Client
@resp = AWSHostedZones.new(client_args: { stub_responses: true }, stub_data: [data])
end
def test_hosted_zones_exist
assert @resp.exists?
end
def test_ids
assert_equal(@resp.ids, ['test1'])
end
def test_names
assert_equal(@resp.names, ['test1'])
end
def test_caller_references
assert_equal(@resp.caller_references, ['test1'])
end
def test_configs
assert_equal(@resp.configs, [{}])
end
def test_resource_record_set_counts
assert_equal(@resp.resource_record_set_counts, [10])
end
def test_linked_services
assert_equal(@resp.linked_services, [{}])
end
end