<commit_before>require 'test_helper'

class VariablesTest < MiniTest::Test

  def test_it_fetches_variables
    with_site(name: FIXTURES_DIR) do |site|

      site = Nanoc::Int::SiteLoader.new.new_from_cwd
      site.compile

      assert_equal NanocConrefFS::Variables.variables[:default].keys, ['site']
      assert_equal NanocConrefFS::Variables.variables[:default]['site']['data'].keys, %w(categories reusables variables)
    end
  end

  def test_it_fetches_datafiles
    with_site(name: FIXTURES_DIR) do |site|
      file = NanocConrefFS::Variables.fetch_data_file('reusables.intro', :default)
      assert_equal file['frontmatter_intro'], 'Here I am, in the front.'
    end
  end
end<commit_msg>Sort keys found for comparison.<commit_after>require 'test_helper'

class VariablesTest < MiniTest::Test

  def test_it_fetches_variables
    with_site(name: FIXTURES_DIR) do |site|

      site = Nanoc::Int::SiteLoader.new.new_from_cwd
      site.compile

      assert_equal NanocConrefFS::Variables.variables[:default].keys, ['site']
      assert_equal NanocConrefFS::Variables.variables[:default]['site']['data'].keys.sort, %w(categories reusables variables)
    end
  end

  def test_it_fetches_datafiles
    with_site(name: FIXTURES_DIR) do |site|
      file = NanocConrefFS::Variables.fetch_data_file('reusables.intro', :default)
      assert_equal file['frontmatter_intro'], 'Here I am, in the front.'
    end
  end
end
{'fraction_non_alphanumeric': 0.10932025227750526, 'fraction_numerical': 0.0, 'mean_word_length': 4.734939759036145, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2823434', 'n_tokens_mistral': 487, 'n_tokens_neox': 454, 'n_words': 91}