<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>plarail_hangout</author_name>
  <author_url>https://blog.hatena.ne.jp/plarail_hangout/</author_url>
  <blog_title>Engineering Tech Dojo</blog_title>
  <blog_url>https://tech.fun-toy-life.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
    <anon>Rails</anon>
  </categories>
  <description>RSpecのletとlet!：遅延評価と即時評価の違いと使い分け はじめに RSpecで頻繁に使う let と let! は、どちらもテストデータを定義するためのヘルパーです。しかし評価のタイミングが異なり、使い方を間違えるとテストが意図通りに動かないことがあります。 この記事では let の遅延評価と let! の即時評価の違いを具体例を使って解説します。 let — 遅延評価 let で定義したブロックは、最初に呼ばれたときに初めて評価されます。テスト内で一度も使われなければ、ブロックは実行されません。 RSpec.describe User, type: :model do let(:u…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftech.fun-toy-life.com%2Fentry%2F2026%2F05%2F28%2F082555&quot; title=&quot;RSpecのletとlet!：遅延評価と即時評価の違いと使い分け - Engineering Tech Dojo&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>2026-05-28 08:25:55</published>
  <title>RSpecのletとlet!：遅延評価と即時評価の違いと使い分け</title>
  <type>rich</type>
  <url>https://tech.fun-toy-life.com/entry/2026/05/28/082555</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
