Slide 12
Slide 12 text
RSpec
RSpec.describe Person do
describe '#birthday_as_string' do
let(:person) { Person.new(birthday) }
context 'when birthday is 2000/11/23' do
let(:birthday) { Date.new(2000, 11, 23) }
context 'when format is %Y/%m/%d' do
let(:format) { '%Y/%m/%d' }
it do
expect(person.birthday_as_string(format)).
to eq('2000/11/23')
end
end
end
end
end
12
- 構造的に記述できる
- テストケースの多様性を
表現しやすい
- 適切な情報量