Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion translation #3

Open
alganet opened this issue Mar 21, 2012 · 2 comments
Open

Assertion translation #3

alganet opened this issue Mar 21, 2012 · 2 comments

Comments

@alganet
Copy link
Member

alganet commented Mar 21, 2012

When importing a unit test body, we should translate the assertions to human-readable code. For example:

<?php
function testAsExampleForSumMethod() 
{
    $math = new Math;
    $balance = 12.30;
    $deposit = 1.70;
    $total = $math->sum($balance, $deposit);
    $this->assertEquals(14, $total);
}

Generated documentation should look like this: https://gist.github.com/2146828

We should cover all assertions we could, but we can start with the simple ones.

@augustohp
Copy link
Member

Talked about it with @henriquemoody yesterday. This looks like awesome, but i would rather translate the message to something other than human readable strings; code for instance!

Look into the gist again ;)

@augustohp
Copy link
Member

I've put little more thought to it. For simple messages, changing the code like i did in (https://gist.github.com/2149449) looks good. But when we have little more complex assertions like assertContains() we are going to have some trouble.

+1 to Human Readable assertions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants