Rspec =begin =end

9 views
Skip to first unread message

Ralph Shnelvar

unread,
Jul 10, 2017, 4:59:11 PM7/10/17
to Ruby on Rails: Talk
I don't know if this is a Rails, Ruby, or Rspec question.

In a file named spec/spec_helper.rb I have
RSpec.configure do |config|
# The settings below are suggested to provide a good initial experience
# with RSpec, but feel free to customize to your heart's content.
=begin
 # These two settings work together to allow you to limit a spec run
 # to individual examples or groups you care about by tagging them with
 # `:focus` metadata. When nothing is tagged with `:focus`, all examples
 # get run.
 config.filter_run :focus
 config.run_all_when_everything_filtered = true
. . .
 # See https://stackoverflow.com/questions/38421853/why-is-my-rspec-not-loading-devisetestcontrollerhelpers
 config.include Devise::Test::ControllerHelpers, :type => :controller
=end

What does the =begin and =end do?  Is this new Ruby syntax?  Rails preprocessing?  Rspec preprocessing?

Mugurel Chirica

unread,
Jul 10, 2017, 5:02:18 PM7/10/17
to rubyonra...@googlegroups.com
That is a multi line ruby comment, but it's not that popular, you are better off using multiple single line comments #comment.
The reason is there is so you can remove them and that block will have the comments and the config.filter_run :focus (...) lines working properly.
Reply all
Reply to author
Forward
0 new messages