From 29d1e81ea470c3ae3fa5bef1b2e651660da7c44a Mon Sep 17 00:00:00 2001 From: Kyle Fazzari Date: Thu, 1 Apr 2021 10:46:12 -0700 Subject: [PATCH] Make spec_dir globbing relative to Rails.root This makes it possible to use jasmine-rails from within another engine, where Rails.root is pointing at the dummy project, but the specs are in the engine. Signed-off-by: Kyle Fazzari --- lib/jasmine-rails.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jasmine-rails.rb b/lib/jasmine-rails.rb index e603653..a962b1b 100644 --- a/lib/jasmine-rails.rb +++ b/lib/jasmine-rails.rb @@ -23,7 +23,7 @@ def route_path def spec_dir paths = jasmine_config['spec_dir'] || 'spec/javascripts' - [paths].flatten.map { |path| Dir.glob path }.flatten.collect { |path| Rails.root.join(path) } + [paths].flatten.collect { |path| Pathname.glob Rails.root.join(path) }.flatten end def include_dir