Sha256: 3eb8936795e34719e16bc88c9badf9b0a39e91369af53ac478db20f716987fcc

Contents?: true

Size: 648 Bytes

Versions: 1

Compression:

Stored size: 648 Bytes

Contents

RSpec.describe Pluginscan::FileScanner do
  describe "#scan" do
    subject(:scanner) { Pluginscan::FileScanner.new(double) }
    let(:results) { scanner.scan(file_contents) }

    context 'with a file which is invalid utf-8' do
      let(:file_contents) { "\xc2" }
      it "finds one result" do
        expect(results.count).to eq 1
      end
      it "finds a result of invalid UTF-8" do
        expect(results.first.check.name).to eq 'Encoding'
        expect(results.first.check.message).to eq 'invalid UTF-8'
      end
      it "finds a result with no findings" do
        expect(results.first.findings).to eq []
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pluginscan-0.9.0 spec/pluginscan/issues_scanner_spec.rb