All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.specs2.specification.FormSpecificationStringContext.scala Maven / Gradle / Ivy

package org.specs2
package specification

import form._
import main._

/**
 * Allow to use forms inside interpolated strings starting with s2 in order to build the specification content
 */
trait FormSpecificationStringContext extends SpecificationStringContext { this: FormFragmentsBuilder with ArgumentsArgs with FormattingTags =>
  implicit def formIsSpecPart(f: =>Form): SpecPart = new SpecPart {
    def append(fs: Fragments, text: String, expression: String = "") = fs.append(createTextFragment(text)).append(formsAreExamples(f.executeForm))
  }

  implicit def toFormIsSpecPart(f: { def form: Form}): SpecPart = formIsSpecPart(f.form)
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy