Undefined method 'scan' for nil:NilClass (NoMethodError)
<p>Stuck on this one, this layout is for a chef inspec test but leveraging ruby to grab the contents of a file. However with this test I'm not actually testing against a file, so I'm trying to understand how to account for that, heres the code:</p>

<pre><code>%w(/etc/bashrc /etc/profile).each do |path|
file(path).content.scan(/^\s*umask\s+(\d{3})\b/).flatten.each do |umask| 
 BASELINE = '0027'
 (1..3).each do |i| # leading char is '0' octal indicator
    describe umask[i].to_i do
        it { should be &lt;= BASELINE[i].to_i }
     end
    end
   end
  end
end
</code></pre>

<p>Here is the line giving me trouble</p>

<pre><code>file(path).content.scan(/^\s*umask\s+(\d{3})\b/).flatten.each do |umask|
</code></pre>