Skip to content

Instantly share code, notes, and snippets.

@leshill
Created October 23, 2011 05:46
Show Gist options
  • Save leshill/1306925 to your computer and use it in GitHub Desktop.
Save leshill/1306925 to your computer and use it in GitHub Desktop.
For more detail, look at http://github.com/leshill/fast_specs
# Fast specs
#
# To run from the command line for my_model in your app:
#
# rspec -Ifast_specs fast_specs/models/my_model
#
require 'rspec'
RSpec.configure do |config|
config.mock_with :rspec
end
# Load required files from the app
#
# app_require 'app/model/profile'
#
def app_require(file)
require File.expand_path(file)
end
# Load required support files
#
# support_require 'database'
# support_require 'database_cleaner'
#
def support_require(file)
require "support/#{file}"
end
@bryanl
Copy link

bryanl commented Oct 23, 2011

File.join(File.dirname(__FILE__), "fast_support/**/*.rb")

why?

"#{File.dirname(__FILE__)}/fast_support/**/*.rb"

@leshill
Copy link
Author

leshill commented Oct 23, 2011

Habit. Thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment