<commit_before>require 'spec_helper'

describe "Churn command" do
  it "prints churn metrics as text by default" do
    output = %x[ cd spec/samplerepo & churn ]
    expect(output).to match /^Commits:\s*\d*\sTotal Churn:\s*\d*\sLines added:\s*\d*\sLines deleted:\s*\d*\s$/
  end
  it "prints churn metrics as json" do
    output = %x[ churn --json]
    expect(output).to match /^{\"Commits\":\d*,\"Total Churn\":\d*,\"Lines added\":\d*,\"Lines deleted\":\d*}\n$/
  end<commit_msg>Change directory when testing default `churn` command<commit_after>require 'spec_helper'

describe "Churn command" do
  it "prints churn metrics as text by default" do
    output = %x[ churn ]
    expect(output).to match /^Commits:\s*\d*\sTotal Churn:\s*\d*\sLines added:\s*\d*\sLines deleted:\s*\d*\s$/
  end
  it "prints churn metrics as json" do
    output = %x[ churn --json]
    expect(output).to match /^{\"Commits\":\d*,\"Total Churn\":\d*,\"Lines added\":\d*,\"Lines deleted\":\d*}\n$/
  end
{'fraction_non_alphanumeric': 0.1940755873340143, 'fraction_numerical': 0.0, 'mean_word_length': 3.5161290322580645, 'pattern_counts': {'":': 8, '<': 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': '3790834', 'n_tokens_mistral': 350, 'n_tokens_neox': 339, 'n_words': 93}