{"title":"Rails4 rspec\u306b\u3088\u308b\u4f8b\u5916\u306e\u30c6\u30b9\u30c8","description":"\u95a2\u6570\u306e\u30c6\u30b9\u30c8\u3092\u3059\u308b\u3068\u304d\u3001\u6b63\u5e38\u306b\u4f8b\u5916\u304c\u767a\u751f\u3059\u308b\u304b\u30c6\u30b9\u30c8\u3057\u305f\u304b\u3063\u305f\u3002\u4eee\u306b\u4e0b\u8a18\u306e\u3088\u3046\u306a\u95a2\u6570\u3092\u4f5c\u308b def get_name(number) case number when 1 \"\u540d\u524d\uff11\" when 2 \"\u540d\u524d\uff12\" else raise ArgumentError, \"\u5f15\u6570\u304c\u7bc4\u56f2\u5916\u3067\u3059\u3002number= #{number}\" end end spec\u306e\u30c6\u30b9\u30c8\u306b\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306b\u8a18\u8f09\u3059\u308b\u3002 describe \"get_name\" do context \"\u6b63\u5e38\u7cfb\" do it \"1\u306e\u3068\u304d\u3001\u540d\u524d\uff11\u3092\u8fd4\u3059\" do input = 1 result = \"\u540d\u524d\uff11\" expect(get_name(input)).t\u2026","provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/ayaketan/","author_name":"ayaketan","type":"rich","width":"100%","version":"1.0","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fayaketan.hatenablog.com%2Fentry%2F2013%2F10%2F03%2F115503\" title=\"Rails4 rspec\u306b\u3088\u308b\u4f8b\u5916\u306e\u30c6\u30b9\u30c8 - ayaketan\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u52c9\u5f37\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","height":"190","categories":["Ruby"],"published":"2013-10-03 11:55:03","url":"https://ayaketan.hatenablog.com/entry/2013/10/03/115503","blog_title":"ayaketan\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u52c9\u5f37\u65e5\u8a18","provider_name":"Hatena Blog","image_url":null,"blog_url":"https://ayaketan.hatenablog.com/"}