<commit_before>require 'spec_helper'

describe 'hadoop::_system_tuning' do
  context 'on Centos 6.6' do
    let(:chef_run) do
      ChefSpec::SoloRunner.new(platform: 'centos', version: 6.6) do
        stub_command(%r{/sys/kernel/mm/(.*)transparent_hugepage/defrag}).and_return(false)
      end.converge(described_recipe)
    end

    it 'disables swap' do
      expect(chef_run).to apply_sysctl_param('vm.swappiness')
    end

    it 'disables transparent hugepage compaction' do
      expect(chef_run).to run_execute('disable-transparent-hugepage-compaction')
    end
  end

  context 'on Ubuntu 12.04' do
    let(:chef_run) do
      ChefSpec::SoloRunner.new(platform: 'ubuntu', version: 12.04) do
        stub_command(%r{/sys/kernel/mm/(.*)transparent_hugepage/defrag}).and_return(false)
      end.converge(described_recipe)
    end

    it 'disables transparent hugepage compaction' do
      expect(chef_run).to run_execute('disable-transparent-hugepage-compaction')
    end
  end
end<commit_msg>stub ruby call to retain thp chefspec tests<commit_after>require 'spec_helper'

describe 'hadoop::_system_tuning' do
  context 'on Centos 6.6' do
    let(:chef_run) do
      ChefSpec::SoloRunner.new(platform: 'centos', version: 6.6) do
        allow(::File).to receive_messages(:file? => true)
        stub_command(%r{/sys/kernel/mm/(.*)transparent_hugepage/defrag}).and_return(false)
      end.converge(described_recipe)
    end

    it 'disables swap' do
      expect(chef_run).to apply_sysctl_param('vm.swappiness')
    end

    it 'disables transparent hugepage compaction' do
      expect(chef_run).to run_execute('disable-transparent-hugepage-compaction')
    end
  end

  context 'on Ubuntu 12.04' do
    let(:chef_run) do
      ChefSpec::SoloRunner.new(platform: 'ubuntu', version: 12.04) do
        allow(::File).to receive_messages(:file? => true)
        stub_command(%r{/sys/kernel/mm/(.*)transparent_hugepage/defrag}).and_return(false)
      end.converge(described_recipe)
    end

    it 'disables transparent hugepage compaction' do
      expect(chef_run).to run_execute('disable-transparent-hugepage-compaction')
    end
  end
end
{'fraction_non_alphanumeric': 0.11929170549860205, 'fraction_numerical': 0.011183597390493943, 'mean_word_length': 3.8355855855855854, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1179074', 'n_tokens_mistral': 772, 'n_tokens_neox': 736, 'n_words': 138}