Posted about 1 month 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:

Copy
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!:

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

By refactoring problematic code and creating automated tests, makandra can vastly improve the maintainability of your Rails application.

Owner of this card:

Avatar
Daniel Straßner
Last edit:
about 1 month 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