2008/2/18, itsme213 <<a href="mailto:itsme213@hotmail.com">itsme213@hotmail.com</a>>:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
"Denis Kudriashov" <<a href="mailto:dionisiydk@gmail.com">dionisiydk@gmail.com</a>> wrote in message<br><br>>I released new version of mock objects framework named Mocketry.<br><br>This looks really nice! Can you give some pointers on where to read a bit<br>
more about the various kinds of specs provided (state, context, usage, ...),</blockquote><div><br>I want create site about Mocketry in the next month.<br>Now there is only "<a href="http://www.squeaksource.com/Mocketry">http://www.squeaksource.com/Mocketry</a>" wiki.<br>
And you can browse Mocketry acceptance tests - subclasses of BehaviorSpecAcceptanceTestCase and SpecDSLAcceptanceTests.<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
and how the <pragmas> are used? (I will browse the code too :-)</blockquote><div><br> Spec DSL clauses is expressions like:<br><div style="margin-left: 40px;">- 3 should be a kind of: SmallInteger<br>- Kind of: SmallInteger<br>
</div>First is used for immediately check variable for satisfying concrete spec (HierarchySpec here)<br>Second is used in argument constraints (for example). It will check argument for satisfying same spec (HierarchySpec).<br>
Thus both expressions use HierarchySpec that actually know how tests object for classes relationship.<br>Kind class is just DSL keyword.<br>Kind class>>of: returns instance of concrete spec and describes "should expression" for it by pragma:<br>
<br><div style="margin-left: 40px;">Kind class>>of: aClass <br> <syntax: #(be a kind of:)><br> ^HierarchySpec for: aClass<br></div></div><br>Method can include many "syntax" pragmas ("syntax pathes").<br>
<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Any pre-requisites? Use standard test runner?</blockquote><div><br></div></div>Only pre-requisite is SMock package for Mocketry tests. Maybe Mocketry should have two different packages: for tests and for base code. Then base code doesn't need any pre-requisites.<br>
<br>About test runner:<br><br>With Mocketry use can use any Testing framework and TestRunner that you want. <br>You doesn't need create special Base TestCase class that provide mock objects facilities. <br>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"). <br>
In test methods you don't worry about what is mock objects, you just write specification of objects interaction and test it.<br>Scenario system transparently creates and controls mock objects by method context.<br>