} 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 - 構造的に記述できる - テストケースの多様性を 表現しやすい - 適切な情報量
birthday is 2000/11/23") { val birthday = newDate(2000, Calendar.NOVEMBER, 23) context("when format is yyyy/MM/dd") { val format = "yyyy/MM/dd" it("returns 2000/11/23") { val person = Person(birthday) person.birthdayAsString(format) shouldBe "2000/11/23" } } } } } 13 Kotestを使えば構造化されたテストを記述できるため、解決する