tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/366-unit-test-help-on-new-robotlegs-bookRobotlegs: Discussion 2011-09-04T17:27:46Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/97336082011-09-03T23:36:23Z2011-09-03T23:36:24ZUnit Test help on new Robotlegs book<div><p>Hello,</p>
<p>I wanted to run the unit tests included in the new Robotlegs
book by Stray and Joel, but am having difficulties. I am using
FlashBuilder 4.5 and when I try to run the FlexUnit tests on the
PersonalKanBan app - the compiler starts to complain about
textDecoration on Labels all of a sudden. If I remove the libraries
that are included (automatically) when you try to run unit tests -
then the compiler error goes away.</p>
<p>Can anyone give me any pointers?</p>
<p>Thanks</p></div>Uno Dostag:robotlegs.tenderapp.com,2009-10-18:Comment/97336082011-09-04T04:02:01Z2011-09-04T04:02:01ZUnit Test help on new Robotlegs book<div><p>So it works if you remove the included libs? I never ran the
tests in Flash Builder, which is an oversight on my part. I used
IntelliJ</p></div>Joel Hookstag:robotlegs.tenderapp.com,2009-10-18:Comment/97336082011-09-04T07:34:30Z2011-09-04T07:34:31ZUnit Test help on new Robotlegs book<div><p>Sorry for not clarifying: no, I could not get the tests to run.
When the libs are included it results in a compiler error. It would
be really helpful for me (and I'm sure others) if you could
document the steps required to get FlexUnit4 tests running in your
project and AsUnit tests running in Stray's project. Even if it's
from the command line. For those unfamiliar with testing, I don't
know where to start tinkering.</p>
<p>Thank you</p></div>Uno Dostag:robotlegs.tenderapp.com,2009-10-18:Comment/97336082011-09-04T08:30:59Z2011-09-04T08:31:56ZUnit Test help on new Robotlegs book<div><p>Hi Uno Dos,</p>
<p>Sorry about that! I use project sprouts and the command line, so
IDE compiling is all a bit of a mystery to me. Thanks for pointing
it out.</p>
<p>Here's the mxmlc command to run the mosaic project tests (from
the project folder):</p>
<pre>
<code>>> mxmlc -debug -default-background-color=#222222 -default-frame-rate=24 -default-size 900 550 -library-path+=lib/FlashComps.swc -library-path+=lib/flashComponents.swc -library-path+=lib/asx.swc -library-path+=lib/hamcrest.swc -library-path+=lib/FLoxy.swc -output=bin/mosaictoolRunner.swf -source-path+=src -source-path+=assets -source-path+=lib/robotlegs -source-path+=test -source-path+=support -source-path+=lib/mockolate -source-path+=lib/asunit3 -verbose-stacktraces=true -warnings=true src/mosaictoolRunner.as</code>
</pre>
<p>Outputs:</p>
<pre>
<code>>> Some/path/to/mosaictoolRunner.swf</code>
</pre>
<p>Then, to debug in command line:</p>
<pre>
<code>>> fdb
>> run Some/path/to/mosaictoolRunner.swf
>> continue</code>
</pre>
<p>That should run the tests, and in my suite all 574 tests are
passing.</p>
<p>I actually run the tests from a project sprouts rake file - the
version of project sprouts I use is 0.7 - it's quite a detailed
process to get it up and running, but if you want to take that
route then I'm happy to send my sprouts files (you'd need to
install manually I think).</p>
<p>Meanwhile - Joel could you create some Ant build files?</p>
<p>Stray</p></div>Straytag:robotlegs.tenderapp.com,2009-10-18:Comment/97336082011-09-04T17:27:46Z2011-09-04T17:27:46ZUnit Test help on new Robotlegs book<div><p>The problem with the FlexUnit integration is that there appears
to be some dependency on MX components in the FlexUnit libs that
Adobe supplies.</p>
<p>File>Properties>Flex Build Path>MX + Spark</p></div>Joel Hooks