Posted 4 months ago. Visible to the public.

Rspec 3: what to do when `describe` is undefined

In Rspec 3 the DSL like describe is exposed globally by default. Therefore it is not necessary to write Rspec.describe.

However, there is a config option to disable this beavior, which also disables the old should-syntax:

RSpec.configure do |config| config.disable_monkey_patching! end

In order to still use describe without Rspec, you can set expose_dsl_globally = true after disable_monkey_patching!:

RSpec.configure do |config| config.disable_monkey_patching! config.expose_dsl_globally = true end

makandra has been working exclusively with Ruby on Rails since 2007. Our laser focus on a single technology has made us a leader in this space.

Owner of this card:

Daniel Straßner
Last edit:
4 months ago
by Daniel Straßner
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Daniel Straßner to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more