Skip to content

Instantly share code, notes, and snippets.

@Tasha25
Created November 19, 2013 00:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Tasha25/7537730 to your computer and use it in GitHub Desktop.
Save Tasha25/7537730 to your computer and use it in GitHub Desktop.
Rspec and Guard in order to run rspec
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'
@Tasha25
Copy link
Author

Tasha25 commented Nov 19, 2013

Gemfile is in top level.. not in the lib folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment