File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ apt_update_last_success : 1458162123
3
+ architecture : amd64
4
+ datacenter : xyz
5
+ fqdn : rspec-node.xyz.github.net
6
+ " _timestamp " : 2014-12-02 12:56:20.865795 -08:00
7
+ ec2_metadata :
8
+ ami-id : ami-deadbeef
9
+ ami-launch-index : " 0"
10
+ ami-manifest-path : " (unknown)"
11
+ block-device-mapping :
12
+ ami : /dev/sda1
13
+ ephemeral0 : sdb
14
+ ephemeral1 : sdc
15
+ root : /dev/sda1
Original file line number Diff line number Diff line change 37
37
expect ( result [ 'name' ] ) . to eq ( 'override.node' )
38
38
expect ( result [ 'values' ] [ 'fqdn' ] ) . to eq ( 'rspec-node.xyz.github.net' )
39
39
end
40
+
41
+ it 'should convert unstructured facts into structured facts' do
42
+ fact_file = OctocatalogDiff ::Spec . fixture_path ( 'facts/unstructured.yaml' )
43
+ options = {
44
+ fact_file_string : File . read ( fact_file )
45
+ }
46
+ result = OctocatalogDiff ::Facts ::Yaml . fact_retriever ( options , 'override.node' )
47
+ expect ( result ) . to be_a_kind_of ( Hash )
48
+ expect ( result [ 'name' ] ) . to eq ( 'override.node' )
49
+ expect ( result [ 'values' ] [ 'fqdn' ] ) . to eq ( 'rspec-node.xyz.github.net' )
50
+ expect ( result [ 'values' ] [ 'ec2_metadata' ] [ 'block-device-mapping' ] [ 'ephemeral0' ] ) . to eq ( 'sdb' )
51
+ end
40
52
end
41
53
end
You can’t perform that action at this time.
0 commit comments