Open kurko opened 6 years ago
erm, don't think the failure is related:
<--- Running rake spec:javascript
rake aborted!
NoMethodError: private method `include' called for ActionDispatch::Assertions:Module
/home/travis/.rvm/gems/ruby-2.0.0-p648/gems/turbolinks-5.1.0/lib/turbolinks.rb:25:in `block (2 levels) in <class:Engine>'
Context
I was able to get this gem to work with my engine by going inside the
test_app
dir and runningbundle exec rails spec:javascript
So far so good. The problem is that I don't want to have to run
cd spec/test_app
every time to run my Javascript tests. I want to run them from the engine's grandparent directory so I can include it in my Rakefile for the entire test suite. In other words, this is my dir tree:Rails.root
is always~/engine/spec/test_app/
, regardless of whether I'm in `~/engine/ or not.The problem
Look at this line:
Dir.glob path
, equivalent toDir.glob("spec/javascripts")
returnstrue
becauseDir.pwd
is~/engine/
, therefore~/engine/spec/javascripts
exists.However, the last
collect
hasRails.root.join("spec_javascript)
, which will map to~/engine/spec/test_app/spec/javascripts
, but there's nothing there (because my test files were configured to~/engine/spec/javascript
).To "fix that, I put
../javascripts
in my yml'sspec_dir
, but noDir.glob
just returns false because, in fact,~/engine/../javascripts
doesn't exist. So, the code is verifying one path and resolving to some other.The fix
This fix just makes it cohesive.
I suspect this is in a way connected with https://github.com/searls/jasmine-rails/issues/102 (to make it work with engines).