Skip to content

Commit

Permalink
Specs to run are no longer hardcoded - using filesets instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Greenhall authored and Ryan Greenhall committed Jul 1, 2010
1 parent e5ba033 commit d139834
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
14 changes: 7 additions & 7 deletions build.xml
Expand Up @@ -6,24 +6,24 @@
<element name="fileset" type="fileset"/>
</scriptdef>

<macrodef name="execute.specs">
<macrodef name="run.specs">
<attribute name="src"/>
<sequential>
<exec executable="java" failonerror="true">
<apply executable="java" parallel="true">
<arg value="-jar"/>
<arg value="dependencies/jar/js.jar"/>
<arg value="-opt"/>
<arg value="-1"/>
<arg value="lib/jspec.runner.js"/>
<!--<fileset dir="@{src}">-->
<!--<include name="**/*spec.js"/>-->
<!--</fileset>-->
</exec>
<fileset dir="@{src}">
<include name="**/*spec.js"/>
</fileset>
</apply>
</sequential>
</macrodef>

<target name="examples" description="Executes the specs in the example directory.">
<execute.specs src="examples/spec"/>
<run.specs src="examples/spec"/>
</target>

<target name="run.examples" description="">
Expand Down
6 changes: 2 additions & 4 deletions lib/jspec.runner.js
Expand Up @@ -8,12 +8,10 @@ var runSpec = function(spec) {
JSpec.exec(spec);
};

// TODO a better solution would be to provide a src dir and find all specs and run. This may require using Ant's scriptlet feature ala RhinoUnit
var specs = ['greeter',
'jquery.test.drive'];
var specs = arguments;

jQuery.each(specs, function(index, spec) {
runSpec("examples/spec/" + spec + ".spec.js");
runSpec(spec);
});

JSpec
Expand Down

0 comments on commit d139834

Please sign in to comment.