Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8104209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:46:13+00:00 2026-06-05T23:46:13+00:00

I just started using Scala and Spec2. However, I’m a little bit confusing of

  • 0

I just started using Scala and Spec2. However, I’m a little bit confusing of the acceptance style in spec2.

Could somebody explain it to me what’s the function of ! and ^ in this case. I have read at the documentation and I still don’t quite understand. I understand the unit testing pattern, but this part is really hard to understand for me.


  "this is my specification"                          ^
    "and example 1"                                   ! e1^
    "and example 2"                                   ! e2

  def e1 = success
  def e2 = success

This example I got it from http://etorreborre.github.com/specs2/guide/org.specs2.guide.Structure.html

Thank you very much.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T23:46:15+00:00Added an answer on June 5, 2026 at 11:46 pm

    It is quite simple. As written on the page ^ builds a list of fragments. Fragments can be either strings, descriptions with code blocks attached (“description” ! block) or control elements like p for a blank line. So your example can be read as:

    Description("this is my specification") and
      Description("and example 1").withBlock(e1) and
      Description("and example 2").withBlock(e2)
    

    This will be assigned as the body of the def is = at the top of your spec class. Internally this list will then be processed and for each description there will be a line printed to the console and depending on the result of the block (if it has one) it will be colored differently.

    So to sum it up, it build a list of items that will be processed by the test runner.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just getting started with the Play Framework 2.0 (using current trunk 2.1-SNAPSHOT, Scala)
I just started using nbandroid plugin with Netbeans 7.0.1 (and 7.1). I could compile
I just started playing with scala and have been using the Scala By Example
I have just started using Scala and wish to better understand the functional approach
I just started using Instruments, a nice little tool for testing memory allocations/ leaks
I just started using Twitter Bootstrap http://twitter.github.com/bootstrap/scaffolding.html and I'm looking for the grey/blue navbar
I just started using Eclipse but already I have a small problem. At first
I just started using rapidxml. I 1st create an xml file to read from.
I just started using/learning Python and have some questions. I have a text file
I just started using mysqli API for PHP. Apparently, every time an object of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.