Skip to content
Merged
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
1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

3 changes: 0 additions & 3 deletions Gemfile

This file was deleted.

26 changes: 0 additions & 26 deletions Gemfile.lock

This file was deleted.

10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ CD into that folder:

cd ruby-exercises

Then run the following command:
Now before beginning work on the exercises, you'll want to install a gem called RSpec. RSpec is a popular Ruby testing framework that is used in this repository to provide you with tests that check your solutions.

bundle install
To install RSpec, run the following command in your terminal:

This folder contains a Gemfile, which tells bundle which gems to install locally and makes them available for use in that directory. In this case, we are installing RSpec, which is a popular Ruby testing framework.
gem install rspec

Verify that the installation was successful by simply running the following command:
You should see a message saying "5 gems installed" in your terminal. Verify that the installation was successful by simply running the following command:

bundle exec rspec
rspec

Which should print a few lines about not finding any examples. This is ok and means it's working!

Expand Down
6 changes: 3 additions & 3 deletions ruby_basics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ These exercises are designed to complement the [Ruby Basic lessons](https://www.
### Usage

1. First change directory into the lesson directory, for example `cd 1_data_types`.
2. Run the tests for an exercise file, for example `bundle exec rspec spec/numbers_exercises_spec.rb`. The first test will fail and the rest will be skipped.
2. Run the tests for an exercise file, for example `rspec spec/numbers_exercises_spec.rb`. The first test will fail and the rest will be skipped.
3. Open that corresponding exercise file in your text editor, in this case the `exercises/numbers_exercises.rb` file.
4. Write the code to get the failing test to pass in the exercise file and run the tests again to verify it passes.
5. Each `exercises` folder has a corresponding `spec` folder with matching test files. For instance, you can find the tests for `exercises/numbers_exercises.rb` in `spec/numbers_exercises_spec.rb`. Find and open the matching spec file.
6. Unskip the next test by removing the `x` from `xit`.
7. Run your tests again `bundle exec rspec spec/numbers_exercises_spec.rb` the second test should now be failing.
7. Run your tests again `rspec spec/numbers_exercises_spec.rb` the second test should now be failing.
8. Repeat the steps from step 2 until no more tests are skipped and all are passing.

**TIP**: When there is only one exercise file in a directory (such as in `6_arrays`) you can omit the path to the file and just enter `bundle exec rspec` to run the tests in that file.
**TIP**: When there is only one exercise file in a directory (such as in `6_arrays`) you can omit the path to the file and just enter `rspec` to run the tests in that file.

### Contents

Expand Down