Sha256: 7d45a325ad67eedb0ef620d38dfa006216f819715017d39c687229a4cecc5cd3

Contents?: true

Size: 1.22 KB

Versions: 3

Compression:

Stored size: 1.22 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/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

3 entries across 3 versions & 1 rubygems

Version Path
slather-1.6.0 spec/slather/coverage_service/simple_output_spec.rb
slather-1.5.5 spec/slather/coverage_service/simple_output_spec.rb
slather-1.5.4 spec/slather/coverage_service/simple_output_spec.rb