Skip to content

Leigan0/airport_challenge

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Airport Challenge

Build Status Coverage Status

This code has been created to complete a challenge to create an airport system to meet the user stories given.

As user story requires weather to be considered prior to land/take off, I have added weather as an default parameter within Airport initialisation for ease of use. This has been tested within feature tests to ensure isolation of unit tests.

Edge cases considered - decision taken to implement planes to initialize flying - to allow to test that only flying planes can land, and non flying planes can take off.

I have aimed to solve this challenge using the BDD cycle, with a test driven approach.

I have included feature tests within the file - whilst I am aware these repeat some code, I have added individual tests for clarity at this stage in my progression. Also as unit tests isolated, similar feature tests implemented to confirm expected integration behaviour between classes.

Getting started

Usage

Instructions run within IRB

  • require './lib/airport.rb'
  • To create an airport = Airport.new
  • To create a plane = Plane.new
  • To land a plane - airport.land(plane)
  • To take off a plane - airport.take_off(plane)
  • To check airport capacity - airport.capacity
  • To set capacity airport.capacity = 20
  • Note that weather conditions are checked at land and take off - if weather stormy - plane will not land/take off

Running tests

RSpec

Technologies used

  • Ruby
  • RSpec

User Stories

As an air traffic controller So I can get passengers to a destination I want to instruct a plane to land at an airport

As an air traffic controller So I can get passengers on the way to their destination I want to instruct a plane to take off from an airport and confirm that it is no longer in the airport

As an air traffic controller To ensure safety I want to prevent takeoff when weather is stormy

As an air traffic controller To ensure safety I want to prevent landing when weather is stormy

As an air traffic controller To ensure safety I want to prevent landing when the airport is full

As the system designer So that the software can be used for many different airports I would like a default airport capacity that can be overridden as appropriate

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%