title: Undefined local variable or Method - Testing Puppet Modules using Beaker
body: <p>I'm quite new to all of this. I am trying to test out a puppet module using Beaker. I keep getting this:</p>
  
  <pre><code> NoMethodError: undefined method `describe' for 
   #Beaker::TestCase:0x007fd6f95e6460
   /Users/user1/beaker/Puppet/puppet-files/spec/classes/unit_spec.rb:3  
   /Users/user1/.rvm/gems/ruby-2.2.7/gems/beaker-3.24.0/bin/beaker:9  
   /Users/user1/.rvm/gems/ruby-2.2.7/bin/ruby_executable_hooks:15  
   /Users/user1/.rvm/gems/ruby-2.2.7/bin/ruby_executable_hooks:15.
   This is the command that I'm running - "beaker --hosts myhost.yaml --pre-suite spec".
  </code></pre>
  
  <p>My unit_spec.rb contains this:</p>
  
  <pre><code>  require 'puppetlabs_spec_helper/rake_tasks'
  
    describe 'application' do
    context 'applied to supported operating system' do
    on_supported_os.each do |os, facts|
    context "#{os}" do
     let(:facts) do
       facts
     end
  
     context "without any parameters" do
       let(:params) {{ }}
  
       it { is_expected.to compile.with_all_deps }
       it { is_expected.to contain_class('files') }
       end
      end
     end
    end
  
  
      context 'applied to unsupported operating system' do
      describe 'ubuntu-14-x86_64' do
      let(:facts) {{
       :osfamily        =&gt; 'Debian',
       :operatingsystem =&gt; 'Ubuntu'
        }}
  
      it { is_expected.to raise_error(Puppet::Error, /Ubuntu not supported/) }
      end
     end
    end
  </code></pre>
  
  <p>Any help would be much appreciated! Btw, I am using 'puppetlabs_spec_helper/rake_tasks' due to the fact that when I just used 'spec_helper' it gave me an error that it could not "load such file" even though it was there.</p>
  
  <p>Also, I have tried doing </p>
  
  <pre><code>RSpec.Describe
  </code></pre>
  
  <p>That did not fix the issue either. I get the following error - </p>
  
  <pre><code> NameError: undefined local variable or method `on_supported_os' for #Class:0x007f92a61d5e58
  </code></pre>
  
  <p>I realise that this might be an RSpec Puppet issue, as this module was previously tested through puppet RSpec, however now I am trying to test using Beaker and not quite sure how to fully achieve that!</p>