test/models/extface/driver/datecs/fp550_test.rb in extface-0.6.0 vs test/models/extface/driver/datecs/fp550_test.rb in extface-0.6.1

- old
+ new

@@ -57,9 +57,18 @@ simulate_device_pull(job) @driver.handle("\x01\x38\x21\x30\x30\x30\x30\x30\x35\x30\x2C\x30\x30\x30\x30\x34\x39\x04\x80\x80\x88\x80\x80\xB8\x05\x30\x36\x35\x30\x03".b) job_thread.join assert @driver.errors.empty? end + + test "build_sale_data encoding" do + sale_data = @driver.build_sale_data OpenStruct.new(text1: "012345678901234567890123АБВГДЕ", price: 1) + packet = @driver.build_packet 0x00, sale_data + assert_equal 39, packet[1].ord - 0x20 + sale_data = @driver.build_sale_data OpenStruct.new(text1: "012345678901234567890123АБВГДЕЖЗИ", price: 1) + packet = @driver.build_packet 0x00, sale_data + assert_equal 39, packet[1].ord - 0x20 + end end end =begin 1432096828.834384 "del" "extface:d29183a38460cc33dfdfc2a38c20eb7d" \ No newline at end of file