I released new version of mock objects framework named Mocketry. It is renamed, cleanup and improved BehaviorMockup framework.
Short review: Mocketry is smalltalk mock object framework based on specifications. It support all kind specifications for object interactions:
Behavior specs build by pure message sends to mock objects and has full refactoring support. Mock objects implements some special proxy mechanizm for support development tools (debugging). Mocketry implements "scenario system" that allows transparent access to mock objects. If you need mock object just get it in scenario block argument: [:mockA :mockB | First block here is tested behavior. Second - expected message sends. Or you can create MockObject instance variable in setUp method: "some := MockObject new". And you get mock object named 'some' in your "scenario tests". Mocketry provide special SSpec-like extended DSL based on pragmas for all kind of specifications (state and behavior). 10 should be an instance of: SmallInteger See squeaksource wiki http://www.squeaksource.com/Mocketry.html |
"Denis Kudriashov" <[hidden email]> wrote in message
>I released new version of mock objects framework named Mocketry. This looks really nice! Can you give some pointers on where to read a bit more about the various kinds of specs provided (state, context, usage, ...), and how the <pragmas> are used? (I will browse the code too :-) Any pre-requisites? Use standard test runner? Thanks - Sophie |
2008/2/18, itsme213 <[hidden email]>:
"Denis Kudriashov" <[hidden email]> wrote in message I want create site about Mocketry in the next month. Now there is only "http://www.squeaksource.com/Mocketry" wiki. And you can browse Mocketry acceptance tests - subclasses of BehaviorSpecAcceptanceTestCase and SpecDSLAcceptanceTests. and how the <pragmas> are used? (I will browse the code too :-) Spec DSL clauses is expressions like: - 3 should be a kind of: SmallInteger First is used for immediately check variable for satisfying concrete spec (HierarchySpec here)- Kind of: SmallInteger Second is used in argument constraints (for example). It will check argument for satisfying same spec (HierarchySpec). Thus both expressions use HierarchySpec that actually know how tests object for classes relationship. Kind class is just DSL keyword. Kind class>>of: returns instance of concrete spec and describes "should expression" for it by pragma: Kind class>>of: aClass <syntax: #(be a kind of:)> ^HierarchySpec for: aClass Method can include many "syntax" pragmas ("syntax pathes"). Any pre-requisites? Use standard test runner? About test runner: With Mocketry use can use any Testing framework and TestRunner that you want. You doesn't need create special Base TestCase class that provide mock objects facilities. If you need mock object just get it from scenario block argument or testcase inst var (empty or initialized in setUp method (for example) by "instVar := MockObject new"). In test methods you don't worry about what is mock objects, you just write specification of objects interaction and test it. Scenario system transparently creates and controls mock objects by method context. |
Free forum by Nabble | Edit this page |