<commit_before>require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')

describe Slather::CoverageService::SimpleOutput do

  let(:fixtures_project) do
    proj = Slather::Project.open(FIXTURES_PROJECT_PATH)
    proj.extend(Slather::CoverageService::SimpleOutput)
  end

  describe '#coverage_file_class' do
    it "should return CoverageFile" do
      expect(fixtures_project.send(:coverage_file_class)).to eq(Slather::CoverageFile)
    end
  end

  describe '#post' do
    it "should print out the coverage for each file, and then total coverage" do
      expect(fixtures_project).to receive(:puts).with("spec/fixtures/fixtures/fixtures.m: 2 of 4 lines (50.00%)")
      expect(fixtures_project).to receive(:puts).with("spec/fixtures/fixtures/more_files/peekaview.m: 0 of 6 lines (0.00%)")
      expect(fixtures_project).to receive(:puts).with("spec/fixtures/fixturesTests/fixturesTests.m: 7 of 7 lines (100.00%)")
      expect(fixtures_project).to receive(:puts).with("spec/fixtures/fixturesTests/peekaviewTests.m: 6 of 6 lines (100.00%)")
      expect(fixtures_project).to receive(:puts).with("Test Coverage: 65.22%")
      fixtures_project.post
    end
  end
end
<commit_msg>Fix simple output spec.<commit_after>require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')

describe Slather::CoverageService::SimpleOutput do

  let(:fixtures_project) do
    proj = Slather::Project.open(FIXTURES_PROJECT_PATH)
    proj.extend(Slather::CoverageService::SimpleOutput)
  end

  describe '#coverage_file_class' do
    it "should return CoverageFile" do
      expect(fixtures_project.send(:coverage_file_class)).to eq(Slather::CoverageFile)
    end
  end

  describe '#post' do
    it "should print out the coverage for each file, and then total coverage" do
      expect(fixtures_project).to receive(:puts).with("spec/fixtures/fixtures/fixtures.m: 2 of 4 lines (50.00%)")
      expect(fixtures_project).to receive(:puts).with("spec/fixtures/fixtures/more_files/peekaview.m: 0 of 6 lines (0.00%)")
      expect(fixtures_project).to receive(:puts).with("spec/fixtures/fixtures/more_files/Branches.m: 7 of 9 lines (77.78%)")
      expect(fixtures_project).to receive(:puts).with("spec/fixtures/fixturesTests/fixturesTests.m: 7 of 7 lines (100.00%)")
      expect(fixtures_project).to receive(:puts).with("spec/fixtures/fixturesTests/peekaviewTests.m: 6 of 6 lines (100.00%)")
      expect(fixtures_project).to receive(:puts).with("spec/fixtures/fixturesTests/BranchesTests.m: 10 of 10 lines (100.00%)")
      expect(fixtures_project).to receive(:puts).with("Test Coverage: 76.19%")
      fixtures_project.post
    end
  end
end

{'fraction_non_alphanumeric': 0.1368102796674225, 'fraction_numerical': 0.02758881330309902, 'mean_word_length': 4.8048245614035086, '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': '6340156', 'n_tokens_mistral': 943, 'n_tokens_neox': 871, 'n_words': 171}