Skip to content

Instantly share code, notes, and snippets.

@olabini
Created February 15, 2009 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olabini/64738 to your computer and use it in GitHub Desktop.
Save olabini/64738 to your computer and use it in GitHub Desktop.
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 ..."
)
public interface SimpleInterface {
public String doSomething();
}// SimpleInterface
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