Skip to content

Instantly share code, notes, and snippets.

@teohm
Created December 10, 2013 09:41
Show Gist options
  • Save teohm/7888109 to your computer and use it in GitHub Desktop.
Save teohm/7888109 to your computer and use it in GitHub Desktop.
rspec
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'rspec'
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
module FixtureSupport
def fixture_path
RSpec.configuration.fixture_path
end
end
RSpec.configure do |config|
config.add_setting :fixture_path
config.fixture_path = File.join(File.dirname(__FILE__), 'fixtures')
config.include FixtureSupport
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment