{"author_name":"torihazi","blog_url":"https://torihazi.hateblo.jp/","type":"rich","url":"https://torihazi.hateblo.jp/entry/2026/02/16/170440","published":"2026-02-16 17:04:40","version":"1.0","image_url":null,"author_url":"https://blog.hatena.ne.jp/torihazi/","description":"be_xxx \u2014 predicate matcher \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e xxx? \u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3057\u3066\u3001\u305d\u306e\u623b\u308a\u5024\u304c truthy \u304b\u3092\u691c\u8a3c # user.general_role? \u3092\u547c\u3073\u51fa\u3059 expect(user).to be_general_role user.valid? \u3092\u547c\u3073\u51fa\u3059 expect(user).to be_valid user.persisted? \u3092\u547c\u3073\u51fa\u3059 expect(user).to be_persisted be_ \u306e\u5f8c\u306e\u90e8\u5206\u306b ? \u3092\u4ed8\u3051\u305f\u30e1\u30bd\u30c3\u30c9\u304c\u81ea\u52d5\u7684\u306b\u547c\u3070\u308c\u308b\u4ed5\u7d44\u307f be \u5358\u4f53 \u2014 truthy/falsy \u5224\u5b9a expect(value).to be\u2026","height":"190","title":"rails \u306e rspec be matcher\u306b\u3064\u3044\u3066","width":"100%","categories":[],"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftorihazi.hateblo.jp%2Fentry%2F2026%2F02%2F16%2F170440\" title=\"rails \u306e rspec be matcher\u306b\u3064\u3044\u3066 - Torihaji&#39;s Growth Diary\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","provider_name":"Hatena Blog","blog_title":"Torihaji's Growth Diary","provider_url":"https://hatena.blog"}