Sha256: ddb4def079ee9d6aa25254bdbca1f945f8c4dbf920bed8983ff0bb31f77922b3

Contents?: true

Size: 915 Bytes

Versions: 4

Compression:

Stored size: 915 Bytes

Contents

require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
require 'json'

describe Slather::CoverageService::GutterJsonOutput do

  let(:fixtures_project) do
    proj = Slather::Project.open(FIXTURES_PROJECT_PATH)
    proj.extend(Slather::CoverageService::GutterJsonOutput)
  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
      fixtures_project.post

      fixture_json = JSON.parse(File.read(FIXTURES_JSON_PATH))
      fixture_json['meta']['timestamp'] = ''

      current_json = JSON.parse(File.read('.gutter.json'))
      current_json['meta']['timestamp'] = ''

      expect(current_json).to eq(fixture_json)
      File.unlink('.gutter.json')
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
slather-1.5.1 spec/slather/coverage_service/gutter_json_spec.rb
slather-1.5.0 spec/slather/coverage_service/gutter_json_spec.rb
slather-1.4.0 spec/slather/coverage_service/gutter_json_spec.rb
slather-1.3.0 spec/slather/coverage_service/gutter_json_spec.rb