spec/rtesseract_spec.rb in rtesseract-1.0.2 vs spec/rtesseract_spec.rb in rtesseract-1.0.3
- old
+ new
@@ -18,10 +18,12 @@
RTesseract.new(@image_tiff).to_s_without_spaces.should eql("43ZZ")
RTesseract.new(@path.join("images","test1.tif").to_s).to_s_without_spaces.should eql("V2V4")
RTesseract.new(@path.join("images","test with spaces.tif").to_s).to_s_without_spaces.should eql("V2V4")
end
+
+
it " translate images .png, .jpg, .bmp" do
RTesseract.new(@path.join("images","test.png").to_s).to_s_without_spaces.should eql("HW9W")
RTesseract.new(@path.join("images","test.jpg").to_s).to_s_without_spaces.should eql("3R8Z")
RTesseract.new(@path.join("images","test.bmp").to_s).to_s_without_spaces.should eql("ZLA6")
end
@@ -73,9 +75,13 @@
blob = image.quantize(256,Magick::GRAYColorspace).to_blob
test = RTesseract.new("", {:psm => 7})
test.from_blob(blob)
test.to_s_without_spaces.should eql("HW9W")
+ end
+
+ it " use a instance" do
+ RTesseract.new(Magick::Image.read(@image_tiff.to_s).first).to_s_without_spaces.should eql("43ZZ")
end
it " change image in a block" do
test = RTesseract.read(@path.join("images","test.png").to_s) do |image|
image = image.white_threshold(245)