Я написал простой метод класса Buy.get_days (string)
и пытаюсь протестировать его с различными входными текстовыми строками. Однако я считаю, что это очень многословно.
subject
для методов , в который я могу просто передавать
различные параметры и проверять результаты? it
? спасибо
describe Buy do
describe '.get_days' do
it 'should get days' do
Buy.get_days('Includes a 1-weeknight stay for up to 4 people')
.should == 1
end
it 'should get days' do
Buy.get_days('Includes a 1-night stay in a King Studio Room with stone fireplace')
.should == 1
end
it 'should get days' do
Buy.get_days('Includes 4 nights/5 days at the Finisterra Hotel for up to two adults and two children (staying in the same room)')
.should == 4
end
end
end