(Possibly uninteresting ramblings)

I'm currently doing some stuff with Angular.js which is using Jasmine for
test cases by default.

Jasmine is using interesting "friendly" terminology for unit testing
concepts.

setup is "beforeEach", teardown is "afterEach".

Test cases and suites are declared with "describe", and "it"; have to say
it looks great in coffeescript:

http://coffeescriptcookbook.com/chapters/testing/testing_with_jasmine

describe 'Calculator', -> it 'can add two positive numbers', -> calculator
= new Calculator() result = calculator.add 2, 3 expect(result).toBe 5 it 'can
handle negative number addition', -> calculator = new Calculator() result =
calculator.add -10, 5 expect(result).toBe -5






On Thu, Apr 4, 2013 at 6:33 PM, Edward K. Ream <[email protected]> wrote:

> As of rev 5650, Leo contains support for @testsetup nodes.  At present, I
> am pretty sure they work only when running unit tests locally.
>
> In effect, @testsetup nodes provide common setup code for all following
> @test and @suite nodes.  Such common setup code is the real reason for
> having custom subclasses of unittest.TestCase.  This is a superb Leonine
> solution.  It is much than either
>
> a) @testclass nodes (which I never use) or
> b) "injecting" common test code using exec(g.findTestScript(c,'@common
> name-of-common-test-code'))
>
> Leo's test-execution code prepends the body text of an @testsetup node to
> all following @test and @suite nodes.  Multiple @testsetup nodes may appear
> in an outline--the range of an @testsetup node extends over all following
> @test and @suite nodes until the next @testsetup node is seen (in outline
> order).
>
> This pattern is a direct result of the problems I have been having in the
> static type checking project.  The simplification of test code that has
> resulted is truly remarkable.  A single @testsetup node replaces <<setup>>
> sections that had to be present in every single test.  Hurray!
>
> Edward
>
>  --
> You received this message because you are subscribed to the Google Groups
> "leo-editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/leo-editor?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to