<commit_before>require 'spec_helper'

for pkg in ["apache2","libapache2-mod-php5","rrdtool","gmetad"]
  describe package(pkg) do
    it { should be_installed }
  end
end

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

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

describe port(80) do 
  it { should be_listening.with('tcp') }
end

for nofile in ["/etc/apache2/sites-enabled/15-default.conf","/etc/apache2/sites-enabled/000-default"]
  describe file(nofile) do
    it { should_not be_file }
  end
end

for dir in ["/var/lib/ganglia-web/dwoo/compiled","/var/lib/ganglia-web/dwoo/cache"]
  describe file(dir) do
    it { should be_directory }
  end
end

describe file('/etc/ganglia/gmetad.conf') do
  it { should be_file }
end<commit_msg>changing from "for" to "each" syntax<commit_after>require 'spec_helper'

pkg = ["apache2","libapache2-mod-php5","rrdtool","gmetad"]
pkg.each do |packages|
  describe package(packages) do
    it { should be_installed }
  end
end

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

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

describe port(80) do 
  it { should be_listening.with('tcp') }
end

nofile = ["/etc/apache2/sites-enabled/15-default.conf","/etc/apache2/sites-enabled/000-default"]
nofile.each do |notfile|
  describe file(notfile) do
    it { should_not be_file }
  end
end

dir = ["/var/lib/ganglia-web/dwoo/compiled","/var/lib/ganglia-web/dwoo/cache"]
dir.each do |directory|
  describe file(directory) do
    it { should be_directory }
  end
end

describe file('/etc/ganglia/gmetad.conf') do
  it { should be_file }
end
{'fraction_non_alphanumeric': 0.13513513513513514, 'fraction_numerical': 0.01597051597051597, 'mean_word_length': 4.138801261829653, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4651323', 'n_tokens_mistral': 619, 'n_tokens_neox': 591, 'n_words': 139}