require 'serverspec'

# Required by serverspec
set :backend, :exec

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

  it 'is listening on port 5222 (client-to-server)' do
    expect(port(5222)).to be_listening
  end

  it 'is listening on port 5269 (server-to-server)' do
    expect(port(5269)).to be_listening
  end

  it 'runs the ejabberd service' do
    expect(service('ejabberd')).to be_running
    expect(service('ejabberd')).to be_enabled
  end
end
