Including Examples from another specification in the current

6 views
Skip to first unread message

Edmondo Porcu

unread,
May 17, 2013, 11:27:34 AM5/17/13
to specs2...@googlegroups.com

Dear all,

 

I am trying to do the following with a mutable spec:


“My Test” should {

   “verify that” in {

   etc

   }

   includeExamplesFrom(new MyOtherSpecification)

}

 

The above code does not compile, I would like the examples to appear in the same hierarchy of verify that, i.e. siblings to the verify that example and children of My Test, because they logically belong to the same family and different initialization requirements forced me to put them in two different specs

Is it possible?

 

 

Best Regards

 

Edmondo

Edmondo Porcu

 

 


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________

etorreborre

unread,
May 17, 2013, 6:47:05 PM5/17/13
to specs2...@googlegroups.com
Hi,

You can include the examples just after the should block and the output should be the same:

“My Test” should {

   “verify that” in {

   etc

   }

}

include(new MyOtherSpecification)

However it might be interesting to work on a solution for your initialisation requirements so that you can effectively keep all your examples in the same specification. Can you please describe that in more details?

E.

Edmondo Porcu

unread,
May 20, 2013, 5:00:46 AM5/20/13
to specs2...@googlegroups.com

That’s what I did. I create some kind of context and I solved the issue. Thank you for your help

--
You received this message because you are subscribed to the Google Groups "specs2-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to specs2-users...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


 
 

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________

Reply all
Reply to author
Forward
0 new messages