<commit_before>require 'spec_helper'

describe 'spinen-artifactory::default' do
  let(:chef_run) do
    ChefSpec::ServerRunner.new do |node|
      node.set['artifactory']['home'] = '/var/log/artifactory'
    end.converge(described_recipe)
  end

  it 'includes apt::default recipe' do
    expect(chef_run).to include_recipe('java::default')
  end

  it 'creates an artifactory user' do
    expect(chef_run).to create_user(node['artifactory']['user'])
  end

  %w(
    node['artifactory']['home']
    node['artifactory'][catalina_base]
    ::File.join(node['artifactory']['catalina_base'], 'work')
    ::File.join(node['artifactory']['catalina_base'], 'temp')
    node['artifactory']['log_dir']
  ).each do |delta|
    it 'does stuff' do
      expect(chef_run).to create_directory(delta).with(
        owner: node['artifactory']['user'],
        mode: 0755,
        recursive: true
      )
    end
  end
end<commit_msg>updated tests to reflect the recipe<commit_after>require 'spec_helper'

describe 'spinen-artifactory::default' do
  let(:chef_run) do
    ChefSpec::ServerRunner.new do |node|
      node.set['artifactory']['home'] = '/var/log/artifactory'
    end.converge(described_recipe)
  end

  it 'includes apt::default recipe' do
    expect(chef_run).to include_recipe('java::default')
  end

  it 'creates an artifactory user' do
    expect(chef_run).to create_user(node['artifactory']['user'])
  end

  %w(
    node['artifactory']['home']
    node['artifactory'][catalina_base]
    ::File.join(node['artifactory']['catalina_base'], 'work')
    ::File.join(node['artifactory']['catalina_base'], 'temp')
    node['artifactory']['log_dir']
  ).each do |delta|
    it 'does stuff' do
      expect(chef_run).to create_directory(delta).with(
        owner: node['artifactory']['user'],
        mode: 0777,
        recursive: true
      )
    end
  end
end
{'fraction_non_alphanumeric': 0.15823466092572658, 'fraction_numerical': 0.004305705059203444, 'mean_word_length': 4.079234972677596, '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': '1650541', 'n_tokens_mistral': 654, 'n_tokens_neox': 627, 'n_words': 118}