require 'spec_helper'

describe RSpec::Puppet::Support do
  subject do
    klass = Class.new do
      include RSpec::Puppet::Support
    end
    klass.new
  end

  describe '#setup_puppet' do
    it 'sets Puppet[:parser] to "current" by default' do
      subject.setup_puppet
      expect(Puppet[:parser]).to eq("current")
    end
    it 'reads the :parser setting' do
      allow(subject).to receive(:parser).and_return("future")
      subject.setup_puppet
      expect(Puppet[:parser]).to eq("future")
    end
  end
end

Add spec coverage of parser configuration
Add spec coverage of parser configuration

Without this patch we don't have any spec coverage of the :parser
configuration addition in the previous patch.  This patch adds two tests
that makes sure the setup_puppet method configures Puppet with the
:parser setting.  We don't actually test to make sure the configuration
is read from Rspec, but the majority of the behavior in the method is
covered with respect to the parser setting.
