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.

Was it helpful?

Solution

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

Fixtures in Ruby Unit Tests

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top