diff --git a/lib/inspec/objects/test.rb b/lib/inspec/objects/test.rb index 3022a7c12..cee792f5e 100644 --- a/lib/inspec/objects/test.rb +++ b/lib/inspec/objects/test.rb @@ -48,11 +48,13 @@ module Inspec if @qualifier.length > 1 last = @qualifier[-1] - # preventing its('to_i') as the value returned is always 0 - if last.length == 1 && last[0] !~ /^to_.$/ && !last[0].include?('[') - xres = last[0] - else - res += '.' + ruby_qualifier(last) + unless last.is_a?(Array) && last[0].to_s.empty? + if last.length == 1 && last[0] !~ /^to_.$/ && !last[0].include?('[') + # this will go in its() + xres = last[0] + else + res += '.' + ruby_qualifier(last) + end end end