Sha256: ddb36d0e682f6bd03bd782134ca6622dda107b2e0e853db52104f6d953706bb2

Contents?: true

Size: 1.43 KB

Versions: 6

Compression:

Stored size: 1.43 KB

Contents

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
      ["spec/fixtures/fixtures/fixtures.m: 2 of 4 lines (50.00%)",
      "spec/fixtures/fixtures/more_files/peekaview.m: 0 of 6 lines (0.00%)",
      "spec/fixtures/fixtures/fixtures_cpp.cpp: 0 of 0 lines (100.00%)",
      "spec/fixtures/fixtures/fixtures_mm.mm: 0 of 0 lines (100.00%)",
      "spec/fixtures/fixtures/fixtures_m.m: 0 of 0 lines (100.00%)",
      "spec/fixtures/fixtures/more_files/Branches.m: 10 of 20 lines (50.00%)",
      "spec/fixtures/fixtures/more_files/Empty.m: 0 of 0 lines (100.00%)",
      "spec/fixtures/fixturesTests/fixturesTests.m: 7 of 7 lines (100.00%)",
      "spec/fixtures/fixturesTests/peekaviewTests.m: 6 of 6 lines (100.00%)",
      "spec/fixtures/fixturesTests/BranchesTests.m: 10 of 10 lines (100.00%)",
      "Test Coverage: 66.04%"].each do |line|
        expect(fixtures_project).to receive(:puts).with(line)
      end

      fixtures_project.post
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
slather-1.8.3 spec/slather/coverage_service/simple_output_spec.rb
ashtonw-slather-1.8.2 spec/slather/coverage_service/simple_output_spec.rb
slather-1.8.1 spec/slather/coverage_service/simple_output_spec.rb
slather-1.8 spec/slather/coverage_service/simple_output_spec.rb
slather-1.7.1 spec/slather/coverage_service/simple_output_spec.rb
slather-1.7.0 spec/slather/coverage_service/simple_output_spec.rb