xmlblog (owner)

Revisions

gist: 160857 Download_button fork
public
Public Clone URL: git://gist.github.com/160857.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
class ItineraryTest < ActiveSupport::TestCase
  context "a 3-day Bahamas itinerary" do
    setup do
      @itinerary = Itinerary.new
      @itinerary.depart 'MIA', 'Fri at 3pm'
      @itinerary.arrive 'NAS', 'Sat at 8am'
      @itinerary.depart 'NAS', 'Sat at 6pm'
      @itinerary.arrive 'NPI', 'Sun at 8am'
      @itinerary.depart 'NPI', 'Sun at 6pm'
      @itinerary.arrive 'MIA', 'Mon at 8am'
    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