diff --git a/gclc-test/pom.xml b/gclc-test/pom.xml
index f3870a3..4fbf936 100644
--- a/gclc-test/pom.xml
+++ b/gclc-test/pom.xml
@@ -51,6 +51,11 @@
gclc
2.0.12
+
+ junit
+ junit
+ 4.12
+
diff --git a/gclc-test/src/main/java/net/bigeon/gclc/test/InputContract.java b/gclc-test/src/main/java/net/bigeon/gclc/test/InputContract.java
new file mode 100644
index 0000000..a314f96
--- /dev/null
+++ b/gclc-test/src/main/java/net/bigeon/gclc/test/InputContract.java
@@ -0,0 +1,37 @@
+/**
+ *
+ */
+package net.bigeon.gclc.test;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.util.function.Supplier;
+
+import net.bigeon.gclc.manager.ConsoleInput;
+
+/**
+ * @author Emmanuel Bigeon
+ *
+ */
+public final class InputContract {
+
+ public void testInputContract(final Supplier inputs)
+ throws IOException {
+ // Test close contract
+ final ConsoleInput input = inputs.get();
+ assertFalse("An input should not initially be closed", input.isClosed());
+ input.close();
+ assertTrue("An input should close", input.isClosed());
+ input.close();
+ assertTrue("A closed input should stay closed", input.isClosed());
+ try {
+ input.prompt();
+ fail("Closed input prompting should fail");
+ } catch (final IOException e) {
+ // ok
+ }
+ }
+}