test(port-out-pin): mismatched pins returns error

Phillip Davis created

Change summary

test/property/test_port_out_pin.rb | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)

Detailed changes

test/property/test_port_out_pin.rb 🔗

@@ -124,4 +124,24 @@ class PortOutPinPropertyTest < Minitest::Test
 		}
 	end
 	em :test_complete_nil_pin_returns_error
+
+	def test_complete_mismatched_pins_returns_error
+		property_of {
+			PortOutPinCompleteCmd
+				.new(REDIS)
+				.confirm_pin { |_pin|
+					sized(range(4, 10)) { string(:alnum) } + "X"
+				}
+				.generate
+		}.check { |_metadata, example|
+			process_stanza(example['stanza'])
+
+			assert_equal 1, written.length
+			reply = written.shift
+			assert_kind_of Blather::StanzaError, reply
+			assert_equal :modify, reply.type
+			assert_equal :bad_request, reply.name
+		}
+	end
+	em :test_complete_mismatched_pins_returns_error
 end