Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Check for file before running spec.

  • Loading branch information...
commit 3e5f63bcf90e38fed04b68a860c33c87e96040dd 1 parent 81ebefe
@jacius jacius authored
Showing with 10 additions and 3 deletions.
  1. +10 −3 Rakefile
View
13 Rakefile
@@ -458,18 +458,25 @@ begin
end
- rule(/spec:.+/) do |t|
- name = t.name.gsub("spec:","")
+rule(/spec:.+/) do |t|
+ name = t.name.gsub("spec:","")
+ path = File.join( File.dirname(__FILE__),'spec','%s_spec.rb'%name )
+
+ if File.exist? path
Spec::Rake::SpecTask.new(name) do |t|
- t.spec_files = ['spec/%s_spec.rb'%name]
+ t.spec_files = [path]
end
puts "\nRunning spec/%s_spec.rb"%name
Rake::Task[name].invoke
+ else
+ puts "File does not exist: %s"%path
end
+end
+
rescue LoadError
error = "ERROR: RSpec is not installed?"
Please sign in to comment.
Something went wrong with that request. Please try again.