This repository has been archived on 2023-10-25. You can view files and clone it, but cannot push or open issues or pull requests.
coverage-check-action/spec/report_adapter_spec.rb
2019-11-01 22:23:15 +01:00

31 lines
645 B
Ruby

# frozen_string_literal: true
require './spec/spec_helper'
describe ReportAdapter do
let(:brakeman_report) do
JSON(File.read('./spec/fixtures/report.json'))
end
let(:spec_annotations) do
JSON(File.read('./spec/fixtures/annotations.json'))
end
let(:adapter) { ReportAdapter }
it '.conslusion' do
result = adapter.conslusion(brakeman_report)
expect(result).to eq('failure')
end
it '.summary' do
result = adapter.summary(brakeman_report)
expect(result).to be_a(String)
end
it '.annotations' do
result = adapter.annotations(brakeman_report)
expect(result).to eq(spec_annotations)
end
end