Tutorial by Examples

The most common way to install the RSpec gem is using Bundler. Add this line to your application's Gemfile: gem 'rspec' And then execute bundle to install the dependencies: $ bundle Alternatively, you can install the gem manually: $ gem install rspec After installing the gem, run the fol...
In greeter.rb (wherever that goes in your project): class Greeter def greet "Hello, world!" end end In spec/greeter_spec.rb: require_relative '../greeter.rb' RSpec.describe Greeter do describe '#greet' do it "says hello" do expect(Greeter.new.gr...

Page 1 of 1