Move rspec rake stuff into loaderror begin-rescue so that we can deploy with --without test
This commit is contained in:
parent
847a66735a
commit
8af6fab0a4
1 changed files with 47 additions and 48 deletions
|
|
@ -5,30 +5,6 @@
|
|||
begin
|
||||
require 'rspec/core'
|
||||
require 'rspec/core/rake_task'
|
||||
rescue MissingSourceFile
|
||||
module RSpec
|
||||
module Core
|
||||
class RakeTask
|
||||
def initialize(name)
|
||||
task name do
|
||||
# if rspec-rails is a configured gem, this will output helpful material and exit ...
|
||||
require File.expand_path(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails)
|
||||
|
||||
# ... otherwise, do this:
|
||||
raise <<-MSG
|
||||
|
||||
#{"*" * 80}
|
||||
* You are trying to run an rspec rake task defined in
|
||||
* #{__FILE__},
|
||||
* but rspec can not be found in vendor/gems, vendor/plugins or system gems.
|
||||
#{"*" * 80}
|
||||
MSG
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
spec_prereq = Rails.root.join('config', 'database.yml').exist? ? "db:test:prepare" : :noop
|
||||
task :noop do
|
||||
|
|
@ -73,4 +49,27 @@ namespace :"spec --color" do
|
|||
end
|
||||
|
||||
end
|
||||
rescue MissingSourceFile
|
||||
module RSpec
|
||||
module Core
|
||||
class RakeTask
|
||||
def initialize(name)
|
||||
task name do
|
||||
# if rspec-rails is a configured gem, this will output helpful material and exit ...
|
||||
require File.expand_path(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails)
|
||||
|
||||
# ... otherwise, do this:
|
||||
raise <<-MSG
|
||||
|
||||
#{"*" * 80}
|
||||
* You are trying to run an rspec rake task defined in
|
||||
* #{__FILE__},
|
||||
* but rspec can not be found in vendor/gems, vendor/plugins or system gems.
|
||||
#{"*" * 80}
|
||||
MSG
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue