<commit_before>Feature: incremental rebuilding

  I want to rebuild just the outputs whose inputs have changed
  So that I can bring the project up-to-date efficiently

Scenario: alter an input, and the output changes

  Given input file "page.html.haml" contains "Old content"
  And the site is up-to-date

  When I change input file "page.html.haml" to contain "New content"
  And I rebuild the site

  Then output file "page.html" should be re-generated
  And output file "page.html" should contain "New content"

Scenario: don't alter an input, and the output is untouched

  Given input file "page.html.haml" contains "Content"
  And the site is up-to-date

  When I rebuild the site

  Then output file "page.html" should not be re-generated

Scenario: alter a dependency

  Given input file "page.html.haml" contains "= include('_partials/foo.haml')"
  And input file "_partials/foo.haml" contains "bananas"
  And the site is up-to-date

  When I change input file "_partials/foo.haml" to contain "New content"
  And I rebuild the site

  Then output file "page.html" should be re-generated
  And output file "page.html" should contain "New content"

Scenario: delete a dependency

  Given input file "fruits.html.haml" contains
    """
    - project.inputs.map(&:path).map(&:to_s).grep(/^_fruit/).each do |input_name|
      %p= include(input_name)
    """

  And input file "_fruit/a.html.haml" contains
    """
    apple
    """

  And input file "_fruit/b.html.haml" contains
    """
    banana
    """

  And the site is up-to-date

  Then output file "fruits.html" should contain
    """<commit_msg>Sort input names, for consistency on 1.8.7.<commit_after>Feature: incremental rebuilding

  I want to rebuild just the outputs whose inputs have changed
  So that I can bring the project up-to-date efficiently

Scenario: alter an input, and the output changes

  Given input file "page.html.haml" contains "Old content"
  And the site is up-to-date

  When I change input file "page.html.haml" to contain "New content"
  And I rebuild the site

  Then output file "page.html" should be re-generated
  And output file "page.html" should contain "New content"

Scenario: don't alter an input, and the output is untouched

  Given input file "page.html.haml" contains "Content"
  And the site is up-to-date

  When I rebuild the site

  Then output file "page.html" should not be re-generated

Scenario: alter a dependency

  Given input file "page.html.haml" contains "= include('_partials/foo.haml')"
  And input file "_partials/foo.haml" contains "bananas"
  And the site is up-to-date

  When I change input file "_partials/foo.haml" to contain "New content"
  And I rebuild the site

  Then output file "page.html" should be re-generated
  And output file "page.html" should contain "New content"

Scenario: delete a dependency

  Given input file "fruits.html.haml" contains
    """
    - project.inputs.map(&:path).map(&:to_s).grep(/^_fruit/).sort.each do |input_name|
      %p= include(input_name)
    """

  And input file "_fruit/a.html.haml" contains
    """
    apple
    """

  And input file "_fruit/b.html.haml" contains
    """
    banana
    """

  And the site is up-to-date

  Then output file "fruits.html" should contain
    """
{'fraction_non_alphanumeric': 0.09303039607000307, 'fraction_numerical': 0.00092109303039607, 'mean_word_length': 3.396761133603239, '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': '3206551', 'n_tokens_mistral': 1045, 'n_tokens_neox': 989, 'n_words': 396}