Skip to content

rubymonstas-zurich/object-state

Repository files navigation

Object State Exercise

How to solve this Exercise

Start with object_state01.rb:

$ ruby object_state01.rb

This will return:

Run options: --seed 12567

# Running:

E

Finished in 0.000453s, 2206.6093 runs/s, 0.0000 assertions/s.

  1) Error:
ObjectStateTest#test_01:
NameError: uninitialized constant ObjectStateTest::Character
    object_state01.rb:19:in `test_01'

1 runs, 0 assertions, 0 failures, 1 errors, 0 skips

So now make this test pass by implementing a Character class above the test. Only write the code that is necessary to make the test pass, nothing more!

After that, continue with number 02, 03 and so on.

$ ruby object_state02.rb
$ ruby object_state03.rb
$ ruby object_state04.rb
$ ruby object_state05.rb

After each exercise, you may check the solutions (in the solutions folder) and compare.

Try not to just jump into the solutions, really think about the solutions and also ask your coaches questions.

Ask the coaches if you have any questions.

About

OO Exercise for Object State

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages