Created
November 19, 2013 00:11
-
-
Save Tasha25/7537730 to your computer and use it in GitHub Desktop.
Rspec and Guard in order to run rspec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Go into the folder you want rspec to run in | |
$ rspec --init | |
Go into folder | |
$cd spec/ | |
Create your files that will end with the '_spec.rb' | |
ex: "school_spec.rb" | |
We will | |
$cd .. | |
We will create lib folder | |
$mkdir lib | |
We will cd into lib | |
$cd lib | |
We will create the rb files that we will need in the lib file | |
We will set up the environment with guard | |
$bundle init | |
Go to the gemfile that was created because your ran bundle init and place the following: | |
gem 'rspec' | |
gem 'guard-rspec' | |
$bundle install | |
$guard init rspec | |
$guard #this will start up and kick into pry | |
We are going to write the specifications for a file | |
We will go into 'file_spec.rb' | |
We will type the following on top: | |
require_relative 'spec_helper' | |
require_relative '../lib/file2' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Gemfile is in top level.. not in the lib folder.