Specs is a Scala based BDD framework. To use in your project:
test.using :specs
This framework will search in your project for:
src/spec/scala /*.scala
# File lib/buildr/scala/bdd.rb, line 49 def artifact Buildr.settings.build['scala.specs.artifact'] || "specs_#{Buildr::Scala.version_without_build}" end
# File lib/buildr/scala/bdd.rb, line 53 def dependencies unless @dependencies super # Add utility classes (e.g. SpecsSingletonRunner) and other dependencies @dependencies |= [ File.join(File.dirname(__FILE__)) ] + specs + Check.dependencies + JUnit.dependencies + Scalac.dependencies end @dependencies end
# File lib/buildr/scala/bdd.rb, line 44 def specs custom = Buildr.settings.build['scala.specs'] [ (custom =~ /:/) ? custom : "org.scala-tools.testing:#{artifact}:jar:#{version}" ] end
# File lib/buildr/scala/bdd.rb, line 39 def version custom = Buildr.settings.build['scala.specs'] (custom =~ /:/) ? Buildr.artifact(custom).version : VERSION end
# File lib/buildr/scala/bdd.rb, line 97 def tests(dependencies) candidates = filter_classes(dependencies, :interfaces => ['org.specs.Specification']) Java.load # Java is already loaded, but just in case filter = Java.org.apache.buildr.JavaTestFilter.new(dependencies.to_java(Java.java.lang.String)) filter.add_fields ['MODULE$'].to_java(Java.java.lang.String) filter.filter(candidates.to_java(Java.java.lang.String)).map { |s| s[0..(s.size - 2)] } end