ciscoheat / buddy

Your friendly BDD testing library for Haxe!
MIT License
96 stars 24 forks source link

Compilation error if haxelib dev buddy ... #15

Closed andyli closed 10 years ago

andyli commented 10 years ago

I'm trying to hack buddy, so I manually cloned it and haxelib dev buddy path/to/buddy. Try it with the following:

import buddy.*;
using buddy.Should;

class Test extends BuddySuite implements Buddy {
    public function new():Void {

    }
}

compilation error:

/Users/andy/Documents/workspace/buddy/src/buddy/tests/AllTests.hx:383: characters 4-17 : Unknown identifier : Assert
/Users/andy/Documents/workspace/buddy/src/buddy/tests/AllTests.hx:384: characters 4-15 : Unknown identifier : Assert
/Users/andy/Documents/workspace/buddy/src/buddy/tests/AllTests.hx:389: characters 4-17 : Unknown identifier : Assert
/Users/andy/Documents/workspace/buddy/src/buddy/tests/AllTests.hx:395: characters 5-17 : Unknown identifier : Assert

The interesting thing is if I disable the dev version, and use version 0.11.1 instead, it compiles fine. Any idea?

ciscoheat commented 10 years ago

Hello, it could be that you don't have utest available for the project, I think those Assert calls are from the utest-testing. I should mention that in some docs. So what are you hacking up? :)

andyli commented 10 years ago

utest is not available for the project, but that should be the same when I use buddy 0.11.1, which compiled fine. Moreover it shouldn't try to load buddy's own test (buddy/tests/AllTests.hx), right?

I am trying to see if it is possible to auto call done() when the async test exit. Also looking into removing the need of creating a main class, such that the main file will look more like a script. Not sure if those are good idea - just trying at the moment. :)

ciscoheat commented 10 years ago

I remember now, I'm excluding haxelibs from auto-inclusion, so when you use buddy outside haxelib like you do, it will include its own tests automatically. That could be related to your utest problem too, but fortunately there are some useful options for preventing those kind of problems: https://github.com/ciscoheat/buddy#can-i-include-only-specific-packages and the section after that one too.

Auto-call done() sounds like a holy grail. :) How to know when all the async stuff are finished? Hooking into a promise-library could be one way, but except for that...? I'm curious what are your ideas!