konstantinvlasenko / PowerSlim

Fitnesse Slim implementation in PowerShell. PowerSlim makes it possible to use PowerShell in the acceptance testing
powerslim.org
GNU General Public License v3.0
48 stars 21 forks source link

Scopes in PowerSlim #48

Open akruglikov opened 11 years ago

akruglikov commented 11 years ago

All variables in PowerSlim is global. If I create $x variable in one scenario, I can use it in other, in general script, everywhere.

Now, to avoid problems with unexpected value in $x-variable in script I call Remove-variable x in last line of scenario. It's not comfortably.

konstantinvlasenko commented 11 years ago

BTW: It is better to use pattern "Good setup don't need clean up". So I suggest just to set a variable to $null at the first line of your scenario. Agree we should tackle with this issue. But the good thing is that we have the workaround (you mentioned).

akruglikov commented 11 years ago

if I use $x in the test, when I execute some scenario with "local" variable $x, then I can see that $x in test - not exist or $null.
The pattern is not related with local variables, because the scenario doesn't equal the test.