From c6ed9ff47cabe882a6b4a903e7b0274235f34ebd Mon Sep 17 00:00:00 2001 From: Mark Villacampa Date: Mon, 12 May 2014 19:25:01 +0200 Subject: [PATCH] Fail fast and show an error if no spec files are found --- lib/motion/project/config.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/motion/project/config.rb b/lib/motion/project/config.rb index 9f78240f..0f564f29 100644 --- a/lib/motion/project/config.rb +++ b/lib/motion/project/config.rb @@ -278,6 +278,9 @@ def spec_files files_filter.map! { |x| File.exist?(x) ? File.expand_path(x) : x } specs.delete_if { |x| [File.expand_path(x), File.basename(x, '.rb'), File.basename(x, '_spec.rb')].none? { |p| files_filter.include?(p) } } end + + App.fail "There are no spec files to run. Place your spec files in your project under the `spec` directory." if specs.empty? + spec_core_files + helpers + specs end end