I am trying to learn Rspec. My ruby project in eclipse is as follows -
The code-
require 'rspec' require './RubyOffRailsTuts/classes/furlong' describe Furlong do end
The error-
/RubyOffRailsTuts/specs/furlong_spec.rb:6:in `<main>': undefined method `describe' for main:Object (NoMethodError)
Did not get any useful answers online. How do I fix this problem ?
Alternative to prefacing describe
as RSpec.describe
, you can add
config.expose_dsl_globally = true
to your spec_helper.rb
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With