Posted almost 5 years ago. Visible to the public. Deprecated.

Properly require your "spec_helper"

You can configure RSpec to automatically require spec_helper.

Always use simply

require 'spec_helper'

If you mix it up like

require 'spec_helper' require File.dirname(__FILE__) + '/../spec_helper' require File.dirname(__FILE__) + '/../../spec_helper' require File.expand_path('spec/spec_helper')

the file will be executed each time, since Ruby (at least 1.8) identifies it simply by the string you passed to "require".

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.

Author of this card:

Tobias Kraze
Last edit:
2 months ago
by Arne Hartherz
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Tobias Kraze to makandropedia