<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>yuichi_katahira</author_name>
  <author_url>https://blog.hatena.ne.jp/yuichi_katahira/</author_url>
  <blog_title>仙台 Ruby Vim JavaScript フリーランスプログラマ</blog_title>
  <blog_url>https://katahirado.hatenablog.com/</blog_url>
  <categories>
    <anon>Rails</anon>
    <anon>memo</anon>
  </categories>
  <description>Timecopを使いました。 describe &quot;2012年7月31日だった場合&quot; do before do Timecop.travel(Date.new(2012,7,31)) end it &quot;4月以降なので 2013を返すこと&quot; do helper.hogehoge.should == 2013 end after do Timecop.return end end お手軽。追記: @takaiさんから、Timecop.freezeは問題をおこすこともあるので、よほどの理由がない限りTimecop.travelを使ったほうがいいよ、と教えていただきましたので、コードを修正しました。ありが…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkatahirado.hatenablog.com%2Fentry%2F20120731%2F1343698696&quot; title=&quot;テスト時の日付を固定する - 仙台 Ruby Vim JavaScript フリーランスプログラマ&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>2012-07-31 10:38:16</published>
  <title>テスト時の日付を固定する</title>
  <type>rich</type>
  <url>https://katahirado.hatenablog.com/entry/20120731/1343698696</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
