require 'spec_helper_acceptance'

describe 'puppetserver' do

  context 'with defaults' do
    it 'should idempotently run' do
      pp = <<-EOS
        class { 'puppetserver': }
      EOS

      apply_manifest(pp, :catch_failures => true)
      apply_manifest(pp, :catch_changes => true)
    end

    describe package('puppetserver') do
      it { should be_installed }
    end

    describe service('puppetserver') do
      it { should be_enabled }
      it { should be_running }
    end

    describe port(8140) do
      it 'should listen on port 8140' do
        pending 'Need to wait for puppetserver to start'
        should be_listening
      end
    end
  end
end

require 'spec_helper_acceptance'

describe 'puppetserver' do

  context 'with defaults' do
    it 'should idempotently run' do
      pp = <<-EOS
        class { 'puppetserver': }
      EOS

      apply_manifest(pp, :catch_failures => true)
      apply_manifest(pp, :catch_changes => true)
    end

    describe package('puppetserver') do
      it { should be_installed }
    end

    describe service('puppetserver') do
      it { should be_enabled }
      it { should be_running }
    end

    describe port(8140) do
      it 'should listen on port 8140' do
        sleep 60
        should be_listening
      end
    end
  end
end

Add sleep in acceptance tests to give a change to puppetserver to be up before testing port listening
Add sleep in acceptance tests to give a change to puppetserver to be up before testing port listening
