Re: Reset program/class/object for next test

6 views
Skip to first unread message
Message has been deleted

etorreborre

unread,
Oct 17, 2011, 6:30:43 PM10/17/11
to specs...@googlegroups.com
Hi,

Are you using specs or specs2? I'm asking, because you mention the "Scope" trait which is a specs2 trait (and you are on the specs mailing-list, the specs2 mailing list being here).

If you are using specs, you can use vals like this:


  "serverButton" should { 
    val gui = new MainGuitTrait {}
    "say Start Server" in  { 
      gui.gridPanel.buttonServer.text mustEqual ("Start Server"); 
    } 
    "not say Stop Server" in { 
      gui.gridPanel.buttonServer.text mustNotEqual ("Stop Server"); 
    } 

In the specification above the gui variable will be reinitialized for each example.

Eric.

Reply all
Reply to author
Forward
0 new messages