<commit_before>require 'spec_helper'

describe Decision do
  let(:input) { double('input').as_null_object }
  let(:output) { double('output').as_null_object }
  let(:decision) { Decision.new(input, output) }
  let(:question) { 'What?' }

  before(:each) do
    decision.question = question
  end

  describe '#ask' do
    it 'outputs the question' do
      output.should_receive(:puts).with(question)
      decision.ask!
    end

    it 'prompts for the answer' do
      input.should_receive(:gets)
      decision.ask!
    end

    it 'repeats the answer to the user' do
      input.stub(:gets) { "bananas!\r\n" }
      output.should_receive(:puts).with('What?')
      output.should_receive(:puts).with('The answer was: bananas!')
      decision.ask!
    end
  end
end<commit_msg>Better test title<commit_after>require 'spec_helper'

describe Decision do
  let(:input) { double('input').as_null_object }
  let(:output) { double('output').as_null_object }
  let(:decision) { Decision.new(input, output) }
  let(:question) { 'What?' }

  before(:each) do
    decision.question = question
  end

  describe '#ask!' do
    it 'outputs the question' do
      output.should_receive(:puts).with(question)
      decision.ask!
    end

    it 'prompts for the answer' do
      input.should_receive(:gets)
      decision.ask!
    end

    it 'strips the carriage return and repeats the answer to the user' do
      input.stub(:gets) { "bananas!\r\n" }
      output.should_receive(:puts).with('What?')
      output.should_receive(:puts).with('The answer was: bananas!')
      decision.ask!
    end
  end
end
{'fraction_non_alphanumeric': 0.13220551378446116, 'fraction_numerical': 0.0, 'mean_word_length': 3.293010752688172, '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': '2859888', 'n_tokens_mistral': 533, 'n_tokens_neox': 508, 'n_words': 122}