Sha256: d58fc2e87f6dce32956d0d642a07a3475ca1b116b6aeb5c3761a1127e1b68357

Contents?: true

Size: 976 Bytes

Versions: 1

Compression:

Stored size: 976 Bytes

Contents

require 'echelon/park'
require 'echelon/parks/thorpe_park'

# Mosts of the test here are pretty generic, although you can test for specific
# cases, such as the active states may differ between parks, and queue times may
# not exceed a certain value etc etc.

describe Echelon::ThorpePark do
  
  before do
    @park = Echelon::ThorpePark.new()
  end

  it "should inherit from Park" do
    @park.should be_kind_of(Echelon::ThorpePark)
  end

  it "should have some rides" do
    @park.ride_list.count.should satisfy { |v| v > 1 && v < 30 }
  end

  it "should return ride objects" do
    @park.find_by_name("Stealth").should be_kind_of(Echelon::Ride)
    @park.find_by_id(3).should be_kind_of(Echelon::Ride)
  end

  it "should return ride object values correctly" do
    stealth = @park.find_by_id(3)
    stealth.name.should eql("Stealth")
    stealth.queue_time.should satisfy { |v| v >= 0 && v < 1000 }
    stealth.active.should satisfy { |v| v == 0 || v == 1 }
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
echelon-0.0.3 spec/thorpe_park_spec.rb