<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 03/26/2012 01:48 PM, Ned Batchelder wrote:
<blockquote cite="mid:4F706583.6010908@nedbatchelder.com"
type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
On 3/26/2012 8:28 AM, Staple, Danny (BSKYB) wrote:
<blockquote
cite="mid:DAC86F5F3B84F14088F0DB16092558CA17EF87E972@UKMA1.UK.NDS.COM"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.hoenzb
        {mso-style-name:hoenzb;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hmm
– I am thinking that a python dsl similar to JS’s Jasmine
with matchers would be doable.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">with
describe(“foo”):<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">
It(“should throw bar”):<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">
expect( lambda : foo.doStuff()).toRaise(BarException);<o:p></o:p></span></p>
</div>
</blockquote>
I've never seen the value in ladling English all over my test
cases. How is your code better than what you can currently do
with unittest?:<br>
<br>
def test_should_throw_bar(self):<br>
"""foo should throw bar"""<br>
with self.assertRaises(BarException):<br>
foo.doStuff()<br>
<br>
Not to mention, the snippet you presented isn't valid Python, yet
involves a lambda...<br>
<br>
--Ned.<br>
</blockquote>
<br>
Agreed, in this way you throw away the help given from your editor
to check your syntax validity,<br>
writing the same code (if not harder).<br>
<br>
I like the idea of hierarchical context, but it also looks like that
every time you have to do that probably<br>
the code smells bad already..<br>
</body>
</html>