BecaLParker / airport_challenge

Fly!
Other
0 stars 0 forks source link

Need to update unit tests for expected outputs in stormy conditions #12

Closed BecaLParker closed 3 years ago

BecaLParker commented 3 years ago

Unit tests I'd previously written in Rpsec for checks_weather, lands_planes, and take_off methods are not in fact properly testing for the expected output in stormy conditions:

describe ATC do
  describe 'checks the weather' do
    it { is_expected.to respond_to :check_weather }
    **# write a test here that checks if returns stormy when weather == stormy**
  end

  describe 'instructs planes to land' do
    it { is_expected.to respond_to :land_plane }
    **# write a test here that expects "Can't land - too stormy" when weather  == stormy**
  end

  describe 'instructs planes to takeoff' do
    it { is_expected.to respond_to :takeoff_plane }
    **# write a test here that expects "Can't takeoff - too stormy" when weather  == stormy**
  end
end
BecaLParker commented 3 years ago
BecaLParker commented 3 years ago

Replaced check_weather with an attr_reader :status in Weather class.

Used Boris Bikes step 15-17 to get spec behaving correctly and code that passes Rspec.

https://github.com/BecaLParker/airport_challenge/commit/01fbe850b0982487d7acef61035dff211fd35a8f