From 470582a84e62e74d8ab6c69d4fe02d893ebd558e Mon Sep 17 00:00:00 2001 From: Adam Leff Date: Tue, 12 Dec 2017 10:31:50 -0500 Subject: [PATCH] xml resource: update docs with alternate syntax for keys with periods (#2389) Signed-off-by: Adam Leff --- docs/resources/xml.md.erb | 4 ++++ lib/resources/xml.rb | 1 + 2 files changed, 5 insertions(+) diff --git a/docs/resources/xml.md.erb b/docs/resources/xml.md.erb index 3a1164d88..ddbf35353 100644 --- a/docs/resources/xml.md.erb +++ b/docs/resources/xml.md.erb @@ -38,6 +38,10 @@ where
+In the event the path contains an element which contains periods, the alternate syntax can be used: + + its(['root/name.with.a.period']) { should cmp 'so_many_dots' } + ## Examples The following examples show how to use this InSpec audit resource. diff --git a/lib/resources/xml.rb b/lib/resources/xml.rb index 7e3a5d985..e614e9db0 100644 --- a/lib/resources/xml.rb +++ b/lib/resources/xml.rb @@ -8,6 +8,7 @@ module Inspec::Resources example " describe xml('default.xml') do its('key/sub_key') { should eq(['value']) } + its(['root/name.with.a.period']) { should cmp 'so_many_dots' } end "