mgivney / easyb

Automatically exported from code.google.com/p/easyb
0 stars 0 forks source link

Execution order messed up #238

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
We are currently evaluating easyb for our acceptance tests. I used the 
following story after i faced some problems with after to find the problem.

def beforeEachCounter = 0
def afterEachCounter = 0

before "",{ println "before"}

before_each "",{
    println "before_each execution: "+beforeEachCounter
    beforeEachCounter += 1
}

after_each "",{
    println "after_each execution: "+afterEachCounter
    afterEachCounter+= 1
}

scenario "",{
    given "",{ println "Scenario 1"}
    when "", {  }
    then "", {  }
}

scenario "",{
    given "",{ println "Scenario 2"    }
    when "", {   }    
    then "", {    }
}

scenario "",{
    given "",{ println "Scenario 3"   }   
    when "", {   }   
    then "", {   }
}

after "",{ println "after"  }

Althought the order of the keyword matters, it worked with version 0.9. The 
output was:

before
before_each execution: 0
Scenario 1
after_each execution: 0
before_each execution: 1
Scenario 2
after_each execution: 1
before_each execution: 2
Scenario 3
after_each execution: 2
after

After using the newest version 1.5 of the library with the same story the 
output was:

before
before_each execution: 0
after_each execution: 0
after
Scenario 1
Scenario 2
Scenario 3

I tried moving before_each, after_each and after around but had always the same 
result. In this state it is impossible to make an appropriate setup for tests. 
A similar problem with before_each and after_each was already reported in issue 
233. Are there any plans to fix this or is there a workaround ?

Original issue reported on code.google.com by xhsat...@gmail.com on 13 Nov 2012 at 2:09

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Well, even after asking (for pointers where to look and possibly fix it) 
explicitly in the list, I never got an response. Seems like this is a 
complicated one. Possibly broken during introduction of parallel executions ... 
and now everybody is scared to touch that again :-(

Original comment by justbee...@googlemail.com on 14 Jan 2013 at 3:41