You could just reformat your test code like so:
[
['foo', 'bar', true ],
['foo', 'baz', true ],
['invalid', 'bar', false],
# …
].each do |v1, v2, expected|
test "expecting #{expected} with #{v1} and #{v2}" do
assert_equal(expected, SomeObject.some_method(v1, v2))
end
end
However, with Rails I find a combination of RSpec, FactoryGirl and Faker/ffaker easier to use. I also don't create a “data provider” and test against this matrix, but specify the behaviour (whether it is Test::Unit or RSpec), like so:
test "expecting positive result" do
assert SomeObject.some_method('foo', 'bar')
assert SomeObject.some_method('foo', 'baz')
# …
end
test "expecting negative result" do
assert_false SomeObject.some_method('invalid', 'baz')
# …
end
or (RSpec):
require 'spec_helper'
describe SomeObject do
describe '#some_method' do
specify "positive result" do
expect(SomeObject.some_method 'foo', 'bar').to be true
expect(SomeObject.some_method 'foo', 'baz').to be true
# …
end
specify "negative result" do
expect(SomeObject.some_method 'invalid', 'bar').to be false
# …
end
end
end