<commit_before>describe 'elasticsearch installation' do
  describe package('elasticsearch') do
    it { should be_installed }
  end

  describe 'elasticsearch start', sudo: true do
    before :all do
      system('sudo service elasticsearch start')
      system('sleep 5')
      system('curl -X GET http://localhost:9200/')
      system('sleep 8')
      system('curl -XPUT \'http://localhost:9200/twitter/user/kimchy\' -d \'{ "name" : "<NAME>" }\'')
      system('curl -XPUT \'http://localhost:9200/twitter/tweet/1\' -d \' { "user": "kimchy", "postDate": "2009-11-15T13:12:00", "message": "Trying out Elasticsearch" }\'')
      system('sleep 8')
    end

    describe command('curl -XGET \'http://localhost:9200/twitter/tweet/1?pretty=true\'') do
      its(:stdout) { should include('Trying out Elasticsearch') }
    end

    describe command('curl -XGET \'http://localhost:9200/twitter/tweet/_search?q=message:Trying&pretty=true\'') do
      its(:stdout) { should include('"total" : 1', '"user": "kimchy"', '"message": "Trying out Elasticsearch"') }
    end
  end
end
<commit_msg>Touching up the elasticsearch specs to cut down on noise<commit_after>describe 'elasticsearch installation' do
  before :all do
    system('sudo service elasticsearch start')
    sleep 5
    system(
      'curl -X GET http://localhost:9200/',
      [:out, :err] => '/dev/null'
    )
    sleep 8
    system(
      'curl -X PUT \'http://localhost:9200/twitter/user/kimchy\' ' \
      '-d \'{ "name" : "<NAME>" }\'',
      [:out, :err] => '/dev/null'
    )
    system(
      'curl -X PUT \'http://localhost:9200/twitter/tweet/1\' ' \
      '-d \' { "user": "kimchy", "postDate": "2009-11-15T13:12:00", ' \
      '"message": "Trying out Elasticsearch" }\'',
      [:out, :err] => '/dev/null'
    )
    sleep 8
  end

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

  describe 'elasticsearch start', sudo: true do
    describe command('curl -XGET \'http://localhost:9200/twitter/tweet/1?pretty=true\'') do
      its(:stdout) { should include('Trying out Elasticsearch') }
    end

    describe command('curl -XGET \'http://localhost:9200/twitter/tweet/_search?q=message:Trying&pretty=true\'') do
      its(:stdout) { should include('"total" : 1', '"user": "kimchy"', '"message": "Trying out Elasticsearch"') }
    end
  end
end

{'fraction_non_alphanumeric': 0.17873981997428204, 'fraction_numerical': 0.03429061294470639, 'mean_word_length': 3.190305206463196, 'pattern_counts': {'":': 10, '<': 5, '<?xml version=': 0, '>': 8, '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': '3223287', 'n_tokens_mistral': 839, 'n_tokens_neox': 757, 'n_words': 187}