Created
February 15, 2009 15:46
-
-
Save olabini/64738 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it("should be possible to create a simple implementation of a simple interface", | |
OneObject = integrate(ioke:lang:test:SimpleInterface) | |
OneObject doSomething = method("called from a simple integration") | |
OtherObject = OneObject mimic | |
OtherObject doSomething = method("called from another simple integration") | |
otherObject = OtherObject new | |
otherObject doSomething = method("called from a single instance ...") | |
ioke:lang:test:SimpleInterfaceUser useObject(OneObject new) asText should == "called from a simple integration" | |
ioke:lang:test:SimpleInterfaceUser useObject(OtherObject new) asText should == "called from another simple integration" | |
ioke:lang:test:SimpleInterfaceUser useObject(otherObject) asText should == "called from a single instance ..." | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface SimpleInterface { | |
public String doSomething(); | |
}// SimpleInterface |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SimpleInterfaceUser { | |
public static String useObject(SimpleInterface si) { | |
return si.doSomething(); | |
} | |
}// SimpleInterfaceUser |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment