Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

airport challenge #2506

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
# Your name

Please write your full name here to make it easier to find your pull request.
Hibaq Obsiye

# User stories

Please list which user stories you've implemented (delete the ones that don't apply).

- [ ] User story 1: "I want to instruct a plane to land at an airport"
- [ ] User story 2: "I want to instruct a plane to take off from an airport and confirm that it is no longer in the airport"
- [ ] User story 3: "I want to prevent landing when the airport is full"
- [ ] User story 4: "I would like a default airport capacity that can be overridden as appropriate"
- [ ] User story 5: "I want to prevent takeoff when weather is stormy"
- [ ] User story 6: "I want to prevent landing when weather is stormy"


# README checklist

Expand Down
5 changes: 5 additions & 0 deletions lib/airplane.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Airplane



end
17 changes: 17 additions & 0 deletions lib/airport.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
require_relative 'airplane'

class Airport
def initialize
@garage = []
end
def land_plane(airplane)
@garage << airplane
end

def take_off(airplane)
@garage.delete(airplane)

end


end
7 changes: 7 additions & 0 deletions spec/airplane_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require './lib/airplane'

describe "taken_off" do
it " responds to "


end
32 changes: 32 additions & 0 deletions spec/airport_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
require './lib/airport'
describe Airport do

# I want it to respond to my method land plane
it 'responds to land plane ' do
airport= Airport.new
expect(airport).to respond_to(:land_plane)
end

#I want land_plane to respond to 1 argument
it { is_expected.to respond_to(:land_plane).with(1).argument }

# I want it to land a plane
it "lands a plane" do
airplane = Airplane.new
expect(airport.land_plane(airplane)).to eq(airplane)
end

# I want it to respond to my take_off method:
it 'responds to take off ' do
airport = Airport.new
expect(airport).to respond_to(:take_off)

end
# I want take_off to respond to 1 argument
it { is_expected.to respond_to(:take_off).with(1).argument }





end