<commit_before># encoding: UTF-8

require_relative 'spec_helper'

# /etc/hostname

# no /etc/hostname used on bsd systems
unless os[:family] == ('freebsd' || 'darwin')
  describe file('/etc/hostname') do
    it { should be_file }
    it { should be_owned_by 'root' }
  end
end

describe file('/etc/localtime') do
  it { should be_owned_by 'root' }
end

# timezone checks
# /etc/timezone (debian family only)
if os[:family] == 'debian' || os[:family] == 'ubuntu'
  describe file('/etc/timezone') do
    it { should be_file }
    it { should be_owned_by 'root' }
  end

  describe file('/etc/timezone') do
    its(:content) { should contain 'Australia/Sydney' }
  end
else
  describe file('/etc/localtime') do
    it { should be_symlink }
  end

  describe command('ls -l /etc/localtime') do
    its(:stdout) {
      should contain('/usr/share/zoneinfo/Australia/Sydney').after('->')
    }
  end
end

# serverspec ping doesn't seem to work in freebsd
unless os[:family] == ('freebsd' || 'darwin')
  describe host('localhost') do
    it { should be_resolvable.by('localhost') }
    it { should be_reachable }
  end

  describe host('test.kitchen') do
    it { should be_resolvable.by('hosts') }
    it { should be_reachable }
  end
end
<commit_msg>C: Avoid using {...} for multi-line blocks.<commit_after># encoding: UTF-8

require_relative 'spec_helper'

# /etc/hostname

# no /etc/hostname used on bsd systems
unless os[:family] == ('freebsd' || 'darwin')
  describe file('/etc/hostname') do
    it { should be_file }
    it { should be_owned_by 'root' }
  end
end

describe file('/etc/localtime') do
  it { should be_owned_by 'root' }
end

# timezone checks
# /etc/timezone (debian family only)
if os[:family] == 'debian' || os[:family] == 'ubuntu'
  describe file('/etc/timezone') do
    it { should be_file }
    it { should be_owned_by 'root' }
  end

  describe file('/etc/timezone') do
    its(:content) { should contain 'Australia/Sydney' }
  end
else
  describe file('/etc/localtime') do
    it { should be_symlink }
  end

  describe command('ls -l /etc/localtime') do
    its(:stdout) do
      should contain('/usr/share/zoneinfo/Australia/Sydney').after('->')
    end
  end
end

# serverspec ping doesn't seem to work in freebsd
unless os[:family] == ('freebsd' || 'darwin')
  describe host('localhost') do
    it { should be_resolvable.by('localhost') }
    it { should be_reachable }
  end

  describe host('test.kitchen') do
    it { should be_resolvable.by('hosts') }
    it { should be_reachable }
  end
end

{'fraction_non_alphanumeric': 0.14110186286167262, 'fraction_numerical': 0.0007927070947284979, 'mean_word_length': 3.4593639575971733, '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': '6434373', 'n_tokens_mistral': 886, 'n_tokens_neox': 853, 'n_words': 241}