Setting Today in a Test

December 20th, 2006

Ruby is awesome…
1
2
3
4
5
6
7
8
  def test_on_weekday
    today_is "May 3, 2006" do
      calendar.add("a call").at(4.pm).on(:saturday)

      assert_equal(Time.local(2006, 5, 6, 16),
                 calendar.appointments.first.start)
    end
  end

...playing with code examples for our book.

Leave a Reply