xmlblog (owner)

Revisions

gist: 160863 Download_button fork
public
Public Clone URL: git://gist.github.com/160863.git
Embed All Files: show embed
itinerary_test.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
class ItineraryTest < ActiveSupport::TestCase
  context "a 3-day Bahamas itinerary" do
    setup do
      @itinerary = Itinerary.define do
        depart 'MIA', 'Fri at 3pm'
        arrive 'NAS', 'Sat at 8am'
        depart 'NAS', 'Sat at 6pm'
        arrive 'NPI', 'Sun at 8am'
        depart 'NPI', 'Sun at 6pm'
        arrive 'MIA', 'Mon at 8am'
      end
    end
    
    subject { @itinerary }
    
    should "be 3 days long" do
      assert_equal 3, @itinerary.duration
    end
    
    should "have visited 2 ports" do
      assert_equal 2, @itinerary.visited_ports
    end
  end
end