{"width":"100%","blog_title":"\u30d6\u30ed\u30b0","blog_url":"https://gouf.hatenablog.com/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fgouf.hatenablog.com%2Fentry%2F2020%2F08%2F10%2F163912\" title=\"Q. RSpec \u3067\u5b9a\u6570\u5b9a\u7fa9\u306e\u6709\u7121\u3092\u78ba\u8a8d\u3057\u305f\u3044 - \u30d6\u30ed\u30b0\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","title":"Q. RSpec \u3067\u5b9a\u6570\u5b9a\u7fa9\u306e\u6709\u7121\u3092\u78ba\u8a8d\u3057\u305f\u3044","provider_url":"https://hatena.blog","description":"A. (subject \u3092\u5b9a\u7fa9\u3057\u3066) it { is_expected.to be_const_defined :FOO } \u3068\u8a18\u8ff0\u3059\u308b \u56de\u7b54\u306e\u4f8b \u306b\u3042\u308b\u3088\u3046\u306b\u3001be_ \u3084 have_ \u3067\u67d4\u8edf\u306a\u30c6\u30b9\u30c8\u304c\u53ef\u80fd\u306b\u306a\u3063\u3066\u3044\u308b The reason is that Rspec has \"magic\" matchers for methods starting with be_ and have_. For example, it { should have_green_pants } would assert that the has_green_pants? method on the subjec\u2026","image_url":null,"author_name":"innocent-zero","height":"190","type":"rich","published":"2020-08-10 16:39:12","version":"1.0","url":"https://gouf.hatenablog.com/entry/2020/08/10/163912","provider_name":"Hatena Blog","author_url":"https://blog.hatena.ne.jp/innocent-zero/","categories":["Q&A","Ruby","RSpec"]}