<commit_before>require "minitest_helper"

describe Konamio::Sequence::Requisition do
  before do
    @subject = Konamio::Sequence::Requisition
    @options = {
      input:    @input            = MiniTest::Mock.new,
      output:   @output           = MiniTest::Mock.new,
      prompt:   @prompt           = "Foo diddly doobardy party hardy",
      listener: @listener         = MiniTest::Mock.new,
      speaker:  @speaker          = MiniTest::Mock.new,
      sequence: @sequence         = ["a"],
      confirmation: @confirmation = "Good job, you."
    }

    @speaker_instance = MiniTest::Mock.new
    @speaker_result   = MiniTest::Mock.new
    @speaker_instance.expect(:execute!, @speaker_result)

    @listener_instance = MiniTest::Mock.new
    @listener_result   = MiniTest::Mock.new
    @listener_instance.expect(:execute!, @listener_result)

    @speaker.expect(:new,  @speaker_instance,  [{ prompt: @prompt, output: @output }])
    @listener.expect(:new, @listener_instance, [{ sequence: @sequence, input: @input }])
    @data_hash = MiniTest::Mock.new
    @listener_result.expect(:data, @data_hash)
    @data_hash.expect(:[], "", [:sequence])

    @speaker_confirmation_instance = MiniTest::Mock.new
    @speaker_confirmation_result = MiniTest::Mock.new
    @speaker.expect(:new, @speaker_confirmation_instance, [{ prompt: @confirmation, output: @output }])
    @speaker_confirmation_instance.expect(:execute!, @speaker_confirmation_result)
  end

  it "can be initialized" do
    @subject.must_respond_to :new
  end

  it "returns a result object" do
    @subject.new(@options).execute!
  end
end<commit_msg>More tests for Konamio::Sequence::Requisition object<commit_after>require "minitest_helper"

describe Konamio::Sequence::Requisition do
  before do
    @subject = Konamio::Sequence::Requisition
    @options = {
      input:    @input            = MiniTest::Mock.new,
      output:   @output           = MiniTest::Mock.new,
      prompt:   @prompt           = "Foo diddly doobardy party hardy",
      listener: @listener         = MiniTest::Mock.new,
      speaker:  @speaker          = MiniTest::Mock.new,
      sequence: @sequence         = ["a"],
      confirmation: @confirmation = "Good job, you."
    }

    @speaker_instance = MiniTest::Mock.new
    @speaker_result   = MiniTest::Mock.new
    @speaker_instance.expect(:execute!, @speaker_result)

    @listener_instance = MiniTest::Mock.new
    @listener_result   = MiniTest::Mock.new
    @listener_instance.expect(:execute!, @listener_result)

    @speaker.expect(:new,  @speaker_instance,  [{ prompt: @prompt, output: @output }])
    @listener.expect(:new, @listener_instance, [{ sequence: @sequence, input: @input }])
    @data_hash = MiniTest::Mock.new
    @listener_result.expect(:data, @data_hash)
    @data_hash.expect(:[], "", [:sequence])

    @speaker_confirmation_instance = MiniTest::Mock.new
    @speaker_confirmation_result = MiniTest::Mock.new
    @speaker.expect(:new, @speaker_confirmation_instance, [{ prompt: @confirmation, output: @output }])
    @speaker_confirmation_instance.expect(:execute!, @speaker_confirmation_result)
  end

  it "can be initialized" do
    @subject.must_respond_to :new
  end

  it "must execute" do
    @subject.new(@options).must_respond_to :execute!
  end

  it "must return a result object" do
    assert @subject.new(@options).execute!.successful?
  end
end
{'fraction_non_alphanumeric': 0.1306532663316583, 'fraction_numerical': 0.0, 'mean_word_length': 3.597826086956522, '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': '812061', 'n_tokens_mistral': 1073, 'n_tokens_neox': 1046, 'n_words': 206}