Sha256: 1dbeca829118dd1d5e6c02b79fdcffb8663aa3dadbcc73b93942f525a8dc4744

Contents?: true

Size: 1.15 KB

Versions: 5

Compression:

Stored size: 1.15 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 CoverallsCoverageFile" do
      expect(fixtures_project.send(:coverage_file_class)).to eq(Slather::CoverallsCoverageFile)
    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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
slather-1.1.0 spec/slather/coverage_service/simple_output_spec.rb
slather-1.0.1 spec/slather/coverage_service/simple_output_spec.rb
slather-1.0.0 spec/slather/coverage_service/simple_output_spec.rb
slather-0.0.31 spec/slather/coverage_service/simple_output_spec.rb
slather-0.0.3 spec/slather/coverage_service/simple_output_spec.rb