Skip to content

Latest commit

 

History

History

ruby

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Noisy Animals, Ruby Edition

Install noisy animals:

bundle install

Then see the tests demonstrate how noisy the animals are:

bundle exec rspec

The NoisyAnimal class has some poor code in it. Can you spot and fix some problems?

New requirements are so great!

When/If you're feeling comfortable with the code, try adding these animals:

  • A snake that makes the noise "hiss" when it is loud and "slither" when it is not loud
  • A mouse that is so silent that it outputs exactly one blank line, whether loud or quiet

Support the true or false values for the is_loud flag in both cases.

Don't forget the tests for your new requirements! Don't change the content of any existing tests, although you can reorganise the order and the context and describe blocks if it is helpful.