<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ayaketan</author_name>
  <author_url>https://blog.hatena.ne.jp/ayaketan/</author_url>
  <blog_title>ayaketanのプログラミング勉強日記</blog_title>
  <blog_url>https://ayaketan.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>関数のテストをするとき、正常に例外が発生するかテストしたかった。仮に下記のような関数を作る def get_name(number) case number when 1 &quot;名前１&quot; when 2 &quot;名前２&quot; else raise ArgumentError, &quot;引数が範囲外です。number= #{number}&quot; end end specのテストには下記のように記載する。 describe &quot;get_name&quot; do context &quot;正常系&quot; do it &quot;1のとき、名前１を返す&quot; do input = 1 result = &quot;名前１&quot; expect(get_name(input)).t…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fayaketan.hatenablog.com%2Fentry%2F2013%2F10%2F03%2F115503&quot; title=&quot;Rails4 rspecによる例外のテスト - ayaketanのプログラミング勉強日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2013-10-03 11:55:03</published>
  <title>Rails4 rspecによる例外のテスト</title>
  <type>rich</type>
  <url>https://ayaketan.hatenablog.com/entry/2013/10/03/115503</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
