There are no test cases for the interface/implements mechanism, making
it hard to tell if it works as intended, and if there are regressions.
This commit adds shellspec test cases for the behavior of `interface()'
and `implements()'.
--- /dev/null
+#!/bin/bash
+
+__init() {
+ if ! implements "vehicle"; then
+ return 1
+ fi
+
+ if ! interface "get_name" "get_speed"; then
+ return 1
+ fi
+
+ return 0
+}
+
+car_get_name() {
+ echo "car"
+}
+
+car_get_speed() {
+ echo "30"
+}
--- /dev/null
+#!/bin/bash
+
+__init() {
+ if ! implements "missinginterface"; then
+ return 1
+ fi
+}
--- /dev/null
+#!/bin/bash
+
+__init() {
+ if ! implements "car"; then
+ return 1
+ fi
+
+ return 0
+}
+
+trabant_get_name() {
+ echo "trabant"
+}
--- /dev/null
+#!/bin/bash
+
+__init() {
+ if ! interface "get_name"; then
+ return 1
+ fi
+
+ return 0
+}