Skip to content

Instantly share code, notes, and snippets.

@leshill
Created October 23, 2011 05:46
Show Gist options
  • Select an option

  • Save leshill/1306925 to your computer and use it in GitHub Desktop.

Select an option

Save leshill/1306925 to your computer and use it in GitHub Desktop.
# 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

bryanl commented Oct 23, 2011

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

why?

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

@leshill

leshill commented Oct 23, 2011

Copy link
Copy Markdown
Author

Habit. Thx.

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