Sha256: 9e7079aaa393b5325f83cba9f72c384639f4568cadddfc247bbf6543974798e3

Contents?: true

Size: 1.3 KB

Versions: 12

Compression:

Stored size: 1.3 KB

Contents

require 'echelon/ride'
require 'echelon/park'

describe Echelon::Ride do

  before do
    @datetime = DateTime.now
    @ride = Echelon::Ride.new(:name => 'Ride', :queue_time => 10, :active => 1, :updated_at => @datetime)
  end

  it "should return the name of the ride" do
    @ride.name.should eql('Ride')
  end

  it "should return the queue time" do
    @ride.queue_time.should eql(10)
  end

  it "should return the ride status" do
    @ride.active.should eql(1)
  end

  it "should return the ride updated at datetime" do
    @ride.updated_at.should eql(@datetime)
  end

end

describe Echelon::Park do

  before do
    @park = Echelon::Park.new
  end

  it "should provide a set of methods" do
    @park.should respond_to(:ride_list)
    @park.should respond_to(:rides)
    @park.should respond_to(:find_by_name)
    @park.should respond_to(:find_by_id)
  end

  it "should contain a blank ride list" do
    @park.ride_list.should eql({})
    @park.rides.should eql([])
  end

  describe 'find_by_name' do
    it "should raise if ride isn't available" do
      lambda { @park.find_by_name('Unknown Ride') }.should raise_error(ArgumentError)
    end
  end

  describe 'find_by_id' do
    it "should raise if ride isn't available" do
      lambda { @park.find_by_id(1) }.should raise_error(ArgumentError)
    end
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
echelon-1.1.2 spec/echelon_spec.rb
echelon-1.1.1 spec/echelon_spec.rb
echelon-1.1.0 spec/echelon_spec.rb
echelon-1.0.6 spec/echelon_spec.rb
echelon-1.0.5 spec/echelon_spec.rb
echelon-1.0.4 spec/echelon_spec.rb
echelon-1.0.3 spec/echelon_spec.rb
echelon-1.0.2 spec/echelon_spec.rb
echelon-1.0.1 spec/echelon_spec.rb
echelon-1.0.0 spec/echelon_spec.rb
echelon-0.0.5 spec/echelon_spec.rb
echelon-0.0.4 spec/echelon_spec.rb