<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>nil0ka</author_name>
  <author_url>https://blog.hatena.ne.jp/nil0ka/</author_url>
  <blog_title>freee Developers Hub</blog_title>
  <blog_url>https://developers.freee.co.jp/</blog_url>
  <categories>
    <anon>技術</anon>
    <anon>Ruby</anon>
    <anon>ピックアップ</anon>
  </categories>
  <description>要約 時限爆弾的なテストとは、テスト内で扱う日時（レコードのregistered_atなどの属性値やスタブの値）にハードコードされた日時文字列（ '2024-07-15' など）を使うことで、時間経過により失敗するようになるテストのこと。 基本原則: ❌ '2024-07-15' のようなハードコードされた日時文字列を書かない（エッジケース除く） ✅ 通常のテスト: Time.current、1.week.ago など テスト実行時を基準とした相対日時 を使う ✅ 日時依存ロジック: travel_to で テスト実行時の「今日」を特定の日付に固定 し、テストデータの日時もTime.zone.…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fdevelopers.freee.co.jp%2Fentry%2Ftime-bomb-tests-best-practices&quot; title=&quot;ユニットテストに時限爆弾を作らないためのベストプラクティス - freee Developers Hub&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>https://cdn-ak.f.st-hatena.com/images/fotolife/n/nil0ka/20251119/20251119180529.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2025-11-20 08:00:00</published>
  <title>ユニットテストに時限爆弾を作らないためのベストプラクティス</title>
  <type>rich</type>
  <url>https://developers.freee.co.jp/entry/time-bomb-tests-best-practices</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
