Sha256: e605718b3a39107a767ec9687dd738fcfadaa788034f06d7c39415c2f0b7d1bb
Contents?: true
Size: 1.44 KB
Versions: 1
Compression:
Stored size: 1.44 KB
Contents
# frozen_string_literal: true # This file is part of Alexandria. # # See the file README.md for authorship and licensing information. require_relative "../../spec_helper" describe Alexandria::Scanners::CueCat do let(:cuecat) { described_class.new } let(:partials) do [".", ".C3nZC3nZC3n2ChnWENz7DxnY", ".C3nZC3nZC3n2ChnWENz7DxnY.", ".C3nZC3nZC3n2ChnWENz7DxnY.cGen", ".C3nZC3nZC3n2ChnWENz7DxnY.cGen.", ".C3nZC3nZC3n2ChnWENz7DxnY.cGen.ENr7C3z0CNj3Dhj1EW"] end let(:scans) do { isbn: ".C3nZC3nZC3n2ChnWENz7DxnY.cGen.ENr7C3z0CNj3Dhj1EW.", ib5: ".C3nZC3nZC3n2ChnWENz7DxnY.cGf2.ENr7C3z0DNn0ENnWE3nZDhP6." } end it "is called CueCat" do expect(cuecat.name).to match(/CueCat/i) end it "refuses to detect incomplete scans" do aggregate_failures do partials.each { |scan| expect(cuecat.match?(scan)).to be false } end end it "detects complete scans" do aggregate_failures do expect(cuecat.match?(scans[:isbn])).to be true expect(cuecat.match?(scans[:ib5])).to be true end end it "decodes ISBN barcodes" do expect(cuecat.decode(scans[:isbn])).to eq("9780571147168") end it "decodes ISBN+5 barcodes" do expect(cuecat.decode(scans[:ib5])).to eq("9780575079038") # 00799 # TODO are we supposed to keep the +5 bit? end it "decodes ISSN barcodes" do skip "Test scan ISSN" end it "decodes UPC barcodes" do skip "Test scan UPC" end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
alexandria-book-collection-manager-0.7.10 | spec/alexandria/scanners/cue_cat_spec.rb |