<commit_before>require 'test_helper'

class GenerateTest < GeneratorTestCase
  def command
    Iridium::Commands::Generate
  end

  def test_generator_creates_an_index
    invoke "index"

    assert_file 'app/public/index.html.erb'
    index_path = destination_root.join('app', 'public', 'index.html.erb')
    content = read index_path

    assert_includes content, %Q{<script src="/application.js"></script>}
    assert_includes content, %Q{<link href="/application.css" rel="stylesheet">}
    assert_includes content, %Q{minispade.require("test_app/boot");}
  end

  def test_generator_creates_an_assetfile
    invoke "assetfile"

    assert_file 'Assetfile'
  end

  def test_generator_creates_conf_directories
    invoke "envs"

    assert_file 'config', 'development.rb'
    assert_file 'config', 'test.rb'
    assert_file 'config', 'production.rb'<commit_msg>Ensure generated assetfile matches stock<commit_after>require 'test_helper'

class GenerateTest < GeneratorTestCase
  def command
    Iridium::Commands::Generate
  end

  def test_generator_creates_an_index
    invoke "index"

    assert_file 'app/public/index.html.erb'
    index_path = destination_root.join('app', 'public', 'index.html.erb')
    content = read index_path

    assert_includes content, %Q{<script src="/application.js"></script>}
    assert_includes content, %Q{<link href="/application.css" rel="stylesheet">}
    assert_includes content, %Q{minispade.require("test_app/boot");}
  end

  def test_generator_creates_an_assetfile
    invoke "assetfile"

    assert_file 'Assetfile'

    content = read "Assetfile"

    stock_assetfile = File.expand_path "../../../lib/iridium/Assetfile", __FILE__

    assert_equal File.read(stock_assetfile), content
  end

  def test_generator_creates_conf_directories
    invoke "envs"

    assert_file 'config', 'development.rb'
    assert_file 'config', 'test.rb'
    assert_file 'config', 'production.rb'
{'fraction_non_alphanumeric': 0.11163032191069575, 'fraction_numerical': 0.0, 'mean_word_length': 4.521489971346705, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '4867987', 'n_tokens_mistral': 618, 'n_tokens_neox': 601, 'n_words': 123}