title: Expected "execute[Enable RHEL rhel7-x86_x64-linux-custom]" with action :run to be in Chef run
body: <p>I have two Chef resource blocks that look like this within my recipe <code>install_packages</code>:</p>
  
  <pre><code>%w[rhel7-x86_x64-linux-custom rhel7-x86_x64-linux-latest].each do |repo|
    execute "Enable RHEL #{repo}" do
      command "yumtool -a #{repo}"
      not_if { :: File.file?("/etc/yum.repos.d/#{repo}.repo") }
    end
  end
  
  PACKAGES.each do |pkg_entry|
    parts = pkg_entry.split('@')
    pkg_name = parts[0]
    pkg_version = parts[1]
    yum_package pkg_entry do
      allow_downgrade true
      package_name pkg_name
      version pkg_version
      action: install
    end
  end
  </code></pre>
  
  <p>How would the corresponding spec unit test blocks look like? For the first block I've tried:</p>
  
  <pre><code>it 'executes command' do
    expect(chef_run).to run_execute('Enable RHEL rhel7-x86_x64-linux-custom')
    expect(chef_run).to run_execute('Enable RHEL rhel7-x86_x64-linux-latest')
  end  
  </code></pre>
  
  <p>but my Chef run fails with the error message:</p>
  
  <pre><code>expected "execute[Enable RHEL rhel7-x86_x64-linux-custom]" with action :run to be in Chef run. Other execute resources:
  
      execute[Enable RHEL rhel7-x86_x64-linux-custom]
      execute[Enable RHEL rhel7-x86_x64-linux-latest]
  </code></pre>
  
  <p>I'm unsure how to fix this, any ideas what the test blocks should look like?</p>