jejacks0n / teaspoon

Teaspoon: Javascript test runner for Rails. Use Selenium, BrowserStack, or PhantomJS.
1.43k stars 243 forks source link

Teaspoon::Suite#asset_from_file raises error when user's path contains regex special chars #125

Closed epylinkn closed 10 years ago

epylinkn commented 10 years ago

I use a $ in my workspace path and teaspoon is choking on it.

Teaspoon::AssetNotServable - /Users/person/$/haw/spec/javascripts/legacy/lib/deserialize_spec.js is not within an asset path:
  (gem) teaspoon-0.7.4/lib/teaspoon/suite.rb:122:in `asset_from_file'
  (gem) teaspoon-0.7.4/lib/teaspoon/suite.rb:61:in `block in spec_files'
  (gem) teaspoon-0.7.4/lib/teaspoon/suite.rb:61:in `map'
  (gem) teaspoon-0.7.4/lib/teaspoon/suite.rb:61:in `spec_files'

Also, it's pretty simple and doubt many people put regex special chars in their paths. I can PR this if a fix is welcomed.

jejacks0n commented 10 years ago

Interesting.. Yes, if you could provide a fix or point me to what the fix would be that would be great.

That gsub there on line 123 is for windows support I believe.. :-/