bldr-io / bldr

Awesome Task Runner
http://bldr.io
MIT License
219 stars 21 forks source link

Mockery error causing tests to fail #66

Closed mbfisher closed 10 years ago

mbfisher commented 10 years ago

Hi! I'm having trouble running the test suite on a fresh clone:

$> bash script/test
...
1) Bldr\Test\ApplicationTest::testFactory
BadMethodCallException: Method Mockery_0_Dflydev_EmbeddedComposer_Core_EmbeddedComposerInterface::findPackage() does not exist on this mock object

/Users/mif08/git-projects/bldr/src/Application.php:83
/Users/mif08/git-projects/bldr/src/Application.php:71
/Users/mif08/git-projects/bldr/tests/ApplicationTest.php:31

In ApplicationTest::testFactory:

$application = Application::create(\Mockery::mock('Dflydev\EmbeddedComposer\Core\EmbeddedComposerInterface'));

Mockery appears to be crapping out mocking the findPackage method. I have zero experience with it so not sure what's going on there!

Whilst looking for solutions I found this in Application::__construct:

$version = '@package_version@';
if ($version === '@'.'package_version@') {
    $version = $embeddedComposer->findPackage('bldr-io/bldr')->getPrettyVersion();

Am I missing a build stage? Should $version be set to something else?

M

cryptiklemur commented 10 years ago

Yeah, its failing due to embedded composer... I gotta fix those tests...

cryptiklemur commented 10 years ago

@mbfisher this should be fixed now, though the coverage is horrible. @cordoval is looking at writing the tests