forked from technoweenie/model_stubbing
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I don't think this is the time, nor the place
- Loading branch information
1 parent
83c168a
commit 90e93a5
Showing
1 changed file
with
2 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,20 @@ | ||
namespace :stubs do | ||
|
||
desc "Load a ModelStubbing definition into the database. Specify Stub file with STUBS= and Definition with DEF=" | ||
task :load do | ||
root = File.dirname(__FILE__) + '/../../../../' | ||
require File.expand_path(root + "config/environment") | ||
|
||
begin | ||
require 'spec' | ||
rescue | ||
require 'rubygems' | ||
require 'spec' | ||
end | ||
require 'model_stubbing' | ||
|
||
# note to Rick: I've taken to using 'stubs.rb' instead of 'model_stubs.rb' | ||
# because 'model_stubs' has a tab-completion collision with 'spec/models' and | ||
# that drives me batty. Change the default to 'spec/model_stubs' if you want, | ||
# you won't hurt my feelings. | ||
|
||
require root + (ENV['STUBS'] || 'spec/stubs') | ||
|
||
defn = (ENV['DEF'] || 'default').intern | ||
ModelStubbing.definitions[defn].insert! | ||
end | ||
|
||
end |