Posted over 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

Copy
require 'spec_helper'

If you mix it up like

Copy
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".

Once an application no longer requires constant development, it needs periodic maintenance for stable and secure operation. makandra offers monthly maintenance contracts that let you focus on your business while we make sure the lights stay on.

Author of this card:

Avatar
Tobias Kraze
Last edit:
10 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