<commit_before>Then /^the file should be a symlink to "([^\"]*)"$/ do |target|
  fail unless @resource["ensure"] == target
end

Then /^the file should contain "([^\"]*)"$/ do |text|
  fail unless @resource["content"].include?(text)
end

Then /^the (file|script) should have standard permissions$/ do |type|
  if type == "file"
    mode = "0444"
  elsif type == "script"
    mode = "0555"
  end

  steps %Q{
    Then the file should have a "group" of "root"
    And the file should have a "mode" of "#{mode}"
    And the file should have an "owner" of "root"
  }
end

Then /^there should be a (file|script) "([^\"]*)"$/ do |type, name|
  steps %Q{
    Then there should be a resource "File[#{name}]"
    And the state should be "present"
    And the #{type} should have standard permissions
  }
end<commit_msg>add support for directories<commit_after>Then /^following directories should be created:$/ do |directories|
  directories.hashes.each do |dir|
    steps %Q{
      Then there should be a resource "File[#{dir['name']}]"
      And the state should be "directory"
      And the directory should have standard permissions
    }
  end
end

Then /^the file should be a symlink to "([^\"]*)"$/ do |target|
  fail unless @resource["ensure"] == target
end

Then /^the file should contain "([^\"]*)"$/ do |text|
  fail unless @resource["content"].include?(text)
end

Then /^the (directory|file|script) should have standard permissions$/ do |type|
  case type
  when "directory"
    mode = "0755"
  when "file"
    mode = "0444"
  when "script"
    mode = "0555"
  else
    fail
  end

  steps %Q{
    Then the file should have a "group" of "root"
    And the file should have a "mode" of "#{mode}"
    And the file should have an "owner" of "root"
  }
end

Then /^there should be a (file|script) "([^\"]*)"$/ do |type, name|
  steps %Q{
    Then there should be a resource "File[#{name}]"
    And the state should be "present"
    And the #{type} should have standard permissions
  }
end
{'fraction_non_alphanumeric': 0.14256926952141058, 'fraction_numerical': 0.010075566750629723, 'mean_word_length': 3.3173913043478263, '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': '5144847', 'n_tokens_mistral': 660, 'n_tokens_neox': 642, 'n_words': 259}