class Buildr::Scala::Specs2

Constants

VERSION

Public Class Methods

artifact() click to toggle source
# File lib/buildr/scala/bdd.rb, line 154
def artifact
  case
    when Buildr.settings.build['scala.specs2.artifact']
      Buildr.settings.build['scala.specs2.artifact']
    else
      "specs2_#{Buildr::Scala.version_without_build}"
  end
end
dependencies() click to toggle source
Calls superclass method
# File lib/buildr/scala/bdd.rb, line 179
def dependencies
  unless @dependencies
    super

    # Add utility classes (e.g. SpecsSingletonRunner) and other dependencies
    options = {
      :scopes => [nil, "compile", "runtime", "provided", "optional"],
      :optional => true
    }
    @dependencies |= [ File.join(File.dirname(__FILE__)) ] + Buildr.transitive(specs, options) +
                       scalaz_dependencies + Check.dependencies + JUnit.dependencies +
                       Scalac.dependencies
  end
  @dependencies
end
scalaz_dependencies() click to toggle source
# File lib/buildr/scala/bdd.rb, line 163
def scalaz_dependencies
  if Buildr::Scala.version?("2.8")
    []
  else
    default_version = "6.0.1"
    custom_version = Buildr.settings.build['scala.specs2-scalaz']
    version = (custom_version =~ /:/) ? Buildr.artifact(custom_version).version : default_version

    artifact = Buildr.settings.build['scala.specs2-scalaz.artifact'] || "specs2-scalaz-core_#{Buildr::Scala.version_without_build}"

    custom_spec = Buildr.settings.build['scala.specs2-scalaz']
    spec = [ (custom_spec =~ /:/) ? custom_spec : "org.specs2:#{artifact}:jar:#{version}" ]
    Buildr.transitive(spec, :scopes => [nil, "compile", "runtime", "provided", "optional"], :optional => true)
  end
end
specs() click to toggle source
# File lib/buildr/scala/bdd.rb, line 149
def specs
  custom = Buildr.settings.build['scala.specs2']
  [ (custom =~ /:/) ? custom : "org.specs2:#{artifact}:jar:#{version}" ]
end
version() click to toggle source
# File lib/buildr/scala/bdd.rb, line 144
def version
  custom = Buildr.settings.build['scala.specs2']
  (custom =~ /:/) ? Buildr.artifact(custom).version : VERSION
end

Public Instance Methods

tests(dependencies) click to toggle source
# File lib/buildr/scala/bdd.rb, line 223
def tests(dependencies)
  filter_classes(dependencies, :interfaces => ['org.specs2.Specification', 'org.specs2.mutable.Specification'])
end