Catch Constant undefined when bundling without rspec

pull/2836/head
Jonas Heinrich 10 years ago
parent 8675fa26fd
commit a3153f0c80
  1. 6
      lib/tasks/testing.rake

@ -112,6 +112,8 @@ task spec: %w(spec:core spec:legacy)
namespace :spec do
desc 'Run the code examples in spec, excluding legacy'
begin
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(core: 'spec:prepare') do |t|
t.exclude_pattern = 'spec/legacy/**/*_spec.rb'
end
@ -126,6 +128,10 @@ namespace :spec do
end
end
end
rescue LoadError
# when you bundle without development and test (e.g. to create a deployment
# artefact) still all tasks get loaded. To avoid an error we rescue here.
end
end
%w(test spec).each do |type|

Loading…
Cancel
Save