Properly require your "spec_helper"

Posted Almost 12 years ago. Visible to the public. Deprecated.

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

Tobias Kraze
Last edit
Over 7 years ago
Arne Hartherz
License
Source code in this card is licensed under the MIT License.
Posted by Tobias Kraze to makandra dev (2012-06-22 11:44)