require 'spec_helper'

describe 'hadoop::zookeeper' do
  context 'on Centos 6.4 x86_64' do
    let(:chef_run) do
      ChefSpec::Runner.new(platform: 'centos', version: 6.4) do |node|
        node.automatic['domain'] = 'example.com'
        stub_command('update-alternatives --display hadoop-conf | grep best | awk \'{print $5}\' | grep /etc/hadoop/conf.chef').and_return(false)
      end.converge(described_recipe)
    end

    it 'install zookeeper package' do
      expect(chef_run).to install_package('zookeeper')
    end

    it 'creates zookeeper group' do
      expect(chef_run).to create_group('zookeeper')
    end
  end
end

require 'spec_helper'

describe 'hadoop::zookeeper' do
  context 'on Centos 6.4 x86_64' do
    let(:chef_run) do
      ChefSpec::Runner.new(platform: 'centos', version: 6.4) do |node|
        node.automatic['domain'] = 'example.com'
        stub_command('update-alternatives --display hadoop-conf | grep best | awk \'{print $5}\' | grep /etc/hadoop/conf.chef').and_return(false)
      end.converge(described_recipe)
    end

    it 'install zookeeper package' do
      expect(chef_run).to install_package('zookeeper')
    end

    it 'creates zookeeper group' do
      expect(chef_run).to create_group('zookeeper')
    end

    it 'creates zookeeper user' do
      expect(chef_run).to create_user('zookeeper')
    end
  end
end

Add test for zookeeper user
Add test for zookeeper user
