<commit_before>require File.expand_path(File.dirname(__FILE__) + '/../../../../test_helper')

describe ::InchCI::Worker::Project::Build::GenerateBadge do
  fixtures :all

  let(:described_class) { ::InchCI::Worker::Project::Build::GenerateBadge }

  it "should only create code objects when they change" do
    project = Project.find_by_uid("github:rrrene/sparkr")
    branch = project.default_branch
    code_objects = branch.latest_revision.code_objects
    described_class.new(project, branch, code_objects)
    base = File.join(Rails.root, "tmp", "github", "rrrene", "sparkr")
    %w(png svg).each do |image_format|
      assert File.exist?(File.join(base, "master.#{image_format}"))
    end
  end
end<commit_msg>Consider image styles badge generation tests<commit_after>require File.expand_path(File.dirname(__FILE__) + '/../../../../test_helper')

describe ::InchCI::Worker::Project::Build::GenerateBadge do
  fixtures :all

  let(:described_class) { ::InchCI::Worker::Project::Build::GenerateBadge }

  it "should only create code objects when they change" do
    project = Project.find_by_uid("github:rrrene/sparkr")
    branch = project.default_branch
    code_objects = branch.latest_revision.code_objects
    described_class.new(project, branch, code_objects)
    base = File.join(Rails.root, "tmp", "github", "rrrene", "sparkr")
    %w(png svg).each do |image_format|
      %w(default flat).each do |style|
        file = File.join(base, "master.#{style}.#{image_format}")
        assert File.exist?(file)
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.14692556634304207, 'fraction_numerical': 0.0, 'mean_word_length': 4.443661971830986, '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': '3868694', 'n_tokens_mistral': 498, 'n_tokens_neox': 485, 'n_words': 101}