Getting started
editThis assumes that the system being worked on is Linux or Unix-based with the Ruby programming language already installed. For Windows, a virtual machine environment such as the Oracle VM VirtualBox can be used to run a version of Linux. On a Unix-like Operating System, the system's package manager is the easiest way to get started with Ruby. A better alternative to using the system Ruby is to install Ruby with the Ruby Version Manager (RVM). RVM is a tool for installing different versions of Ruby and has several advantages.
Installation steps
edit- Install Rspec by running the following command: This command gives a permission error if an attempt is made to make changes to the system Ruby.
$gem install rspec >Done installing documentation for rspec-support, rspec-core, diff-lcs, rspec-expectations, rspec-mocks, rspec after 8 seconds 6 gems installed
- Prepare the directory structure using the following command:
$mkdir lib
- Run Rspec
rspec --init
- Rspecs can now be run on the empty
specs
directory.This verifies that the gem has been installed.$rspec spec >No examples found. Finished in 0.00045 seconds (files took 0.11565 seconds to load) 0 examples, 0 failures