Create a program that creates a network of docking stations and bikes that anyone can do.
CHALLENGES
- Setting up a project
- Create a directory from the command line
- Initialise a git repository within that directory
- Create a README.md file from the command line
- Write a clear README
- Add the README.md to the staging area
- Commit your changes with a clear message
- Push the project to Github.
DONE#
- From user stories to a domain model
- Write down all the nouns in the User Stories
- Write down all the verbs in the User Stories
- Draw a table like the one above
- Organise the nouns and verbs into Objects and Messages within the table
- Draw a diagram that shows how your Objects will use Messages to communicate with one another
DONE#
- From a Domain Model to a Feature Test
- Start irb (or any other REPL) from the Command Line
- Set a variable docking_station equal to a new DockingStation object
- Explain to your pair partner what the resulting error means.
- error message essentially said that the constant did not exist and could not be found in the ruby language, the irb or any gems.
DONE#
- Errors are good
- Write down the type of error
- uninitalized constant
- Write down the file path where the error happened
- /Users/jackmccarthy/.rvm/rubies/ruby-2.7.2/bin/irb:23:in
- Write down the line number of the error
- Line 1 (in IRB)
- Use the Ruby Documentation to find out what the error means
- the Constant has not been defined
- Suggest one way of solving the error.
- Create a constant !
DONE#
- From Feature Test to unit Test
- Initialise RSpec within your project
- Create a new spec file for your DockingStation object
- Set up the spec file to describe a DockingStation
- Run RSpec from the Command Line
- Explain to your pair partner the difference between this error and the error you saw before.
- No method created to release the bike
DONE#
- Passing your first Unit Test
- Create a new file for a Docking Station class, inside the /lib directory
- Define a DockingStation class
- Use require to include this file inside your spec file
- Run RSpec from the Command Line
- Explain to your pair partner the difference between what you see, and the error you saw before.
DONE#
- Back to the feature
- Start irb (or any other REPL) from the Command Line
- Use require to include the file that contains the DockingStation class definition
- Set a variable docking_station equal to a new DockingStation object
- Explain to your pair partner why you do not see an error now, when you did before
- Ask the docking_station instance to release_bike
- Explain to your pair partner what the resulting error means.
DONE#
- Back to the Unit
-
Add a test to your spec file that expects DockingStation instances to respond_to the method release_bike
-
Rewrite this test using RSpec's one-liner syntax
-
Run RSpec from the Command Line
-
Explain the error to your pair partner
- no method release_bike, so cannot find it
-
Add a method release_bike to the DockingStation class
-
Run RSpec from the Command Line
-
Explain to your pair partner the difference between what you see, and the error you saw before.
- we now have a method so it finds it and can run the test
- Building a bike
-
Start irb (or another REPL such as 💊 Pry)
-
Instantiate a DockingStation as docking_station
-
Ask docking_station to release a bike, and save the response to a variable bike
-
Ask the bike if it is working?
-
Explain the error to your pair partner
- unable to find method .working?, no Bike class
-
Create a new spec file for a Bike class
-
Set up the spec file to describe the Bike class
-
Run RSpec from the Command Line
-
Fix the error you see, similarly to how you fixed the same error for DockingStation
-
Add a test to your bike_spec.rb file that expects Bike instances to respond_to the method working?
-
Make this test pass.