From 8105b2120b0b772f619fb7cd682718ea9ccc1b16 Mon Sep 17 00:00:00 2001 From: jmsmith1018 Date: Wed, 16 Nov 2022 08:44:59 -0700 Subject: [PATCH 1/2] Provide instructions to install and use RSpec globally --- README.md | 10 +++++----- ruby_basics/README.md | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6fc8528bee..fa03b5a950 100644 --- a/README.md +++ b/README.md @@ -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! diff --git a/ruby_basics/README.md b/ruby_basics/README.md index 9896d50579..031dd539d2 100644 --- a/ruby_basics/README.md +++ b/ruby_basics/README.md @@ -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 From 2e4a020eb90c298616a4e88a7ae16a0c57fc6f10 Mon Sep 17 00:00:00 2001 From: jmsmith1018 Date: Thu, 17 Nov 2022 23:04:04 -0700 Subject: [PATCH 2/2] remove the now-unnecessary Gemfile and `.ruby-version` file --- .ruby-version | 1 - Gemfile | 3 --- Gemfile.lock | 26 -------------------------- 3 files changed, 30 deletions(-) delete mode 100644 .ruby-version delete mode 100644 Gemfile delete mode 100644 Gemfile.lock diff --git a/.ruby-version b/.ruby-version deleted file mode 100644 index ef538c2810..0000000000 --- a/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -3.1.2 diff --git a/Gemfile b/Gemfile deleted file mode 100644 index bc63d8fb1f..0000000000 --- a/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source 'https://rubygems.org' - -gem 'rspec', '~>3.9' \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index cfacf03362..0000000000 --- a/Gemfile.lock +++ /dev/null @@ -1,26 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - diff-lcs (1.5.0) - rspec (3.11.0) - rspec-core (~> 3.11.0) - rspec-expectations (~> 3.11.0) - rspec-mocks (~> 3.11.0) - rspec-core (3.11.0) - rspec-support (~> 3.11.0) - rspec-expectations (3.11.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-mocks (3.11.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-support (3.11.0) - -PLATFORMS - ruby - -DEPENDENCIES - rspec (~> 3.9) - -BUNDLED WITH - 2.3.14