From 7334e2f8368f2eae97fe4e3058ba3470768c4b69 Mon Sep 17 00:00:00 2001 From: naruse Date: Sun, 14 May 2017 11:36:01 +0000 Subject: [PATCH] Don't read non .rb file as a spec To avoid reading `core` file on reading core/ specs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- spec/mspec/lib/mspec/utils/script.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/mspec/lib/mspec/utils/script.rb b/spec/mspec/lib/mspec/utils/script.rb index 28be854a85..3e507d2b4a 100644 --- a/spec/mspec/lib/mspec/utils/script.rb +++ b/spec/mspec/lib/mspec/utils/script.rb @@ -185,7 +185,7 @@ class MSpecScript patterns.each do |pattern| expanded = File.expand_path(pattern) - if File.file?(expanded) + if File.file?(expanded) && expanded.end_with?('.rb') return [expanded] elsif File.directory?(expanded) return Dir["#{expanded}/**/*_spec.rb"].sort