Question

I'm currently converting a whole bunch of acceptance tests from php into ruby and many of the tests use specific scenarios to test certain conditions. We use @dataProvider a lot and my google foo can't find any information if this functionality exists in the test-unit gem.

As a work around I'm manually calling a supporting method to give me the required values to test against and putting the test scenarios in var.each{} loops. It's not elegant but it works. I'd still prefer to use the dataProvider route if it's available though.

Était-ce utile?

La solution

Your Google foo is probably very good, however in Ruby something similar is called a fixture.

Fixtures in Ruby Unit Tests

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top