Comments (8)
Confirmed. For app/lib/foobar.rb
, what should the correct alternate file be – spec/app/lib/foobar_spec.rb
or spec/lib/foobar_spec.rb
?
from rspec.tmbundle.
I just tried this today and app/lib/foobar.rb correctly created the alternate file spec/lib/foobar_spec.rb. Seems good to me!
It definitely shouldn't contain /app/ otherwise we'd expect app/models/foobar.rb to map to no longer map to spec/models/foobar_spec.rb.
from rspec.tmbundle.
Did you try it inside a Rails app?
In Rails apps, lib/foobar.rb
is already mapped to spec/foobar_spec.rb
, so not sure if we should map app/lib/foobar.rb
also to spec/foobar_spec.rb
…
from rspec.tmbundle.
It just occured to me that app/lib/foobar.rb
should map to spec/models/lib/foobar.rb
. Would make sense, wouldn’t it?
from rspec.tmbundle.
Oh I see what you mean now. While I suppose that might be a matter of preference, I can't think of a better option. I also can't imagine a situation in which both app/lib/foobar.rb and app/models/lib/foobar.rb both exist at the same time, so I think your solution makes sense.
from rspec.tmbundle.
Ah, app/lib/foobar.rb
vs. app/models/lib/foobar.rb
was the case I didn’t think of – but as you say, I think we can ignore that :-)
from rspec.tmbundle.
Other projects like RubyMine simply search all folders for a filename matching the pattern which is super lazy, and doesn't try to create anything. We're already going above and beyond in helpfulness here. If someone has super strange structure they can complain to us, or just navigate back and forth themselves :)
from rspec.tmbundle.
You know that feeling when you look at something you wrote some hours ago and it just doesn’t make sense anymore? app/lib/foobar.rb
↔︎ spec/models/lib
doesn’t make sense. I think I’ll go with app/lib/foobar.rb
↔︎ spec/app/lib/foobar.rb
– this is at least guaranteed not to collide with anything else.
from rspec.tmbundle.
Related Issues (20)
- Cannot run specs when cursor is inside string interpolation HOT 5
- Problems running with binding.pry HOT 5
- Rails Engine support HOT 9
- Alternate File command broken when file creation required HOT 4
- rvm_wrapper error after Sierra upgrade HOT 4
- Console HTML output is escaped HOT 5
- I might be the last person on earth using Textmate, but I'd like to run tests via command+R. HOT 11
- Symbol list contains `context` + `it` + a combination of both on top with nested describe blocks HOT 3
- Replace “Save example file and remember” with real “Run Again” command? HOT 2
- Maintainer transition HOT 8
- Remove support for RSpec 1? HOT 5
- Rename the repo to rspec.tmbundle HOT 9
- “Run examples in selected files/directories” seems broken HOT 3
- run_focussed does not work with rspec 3 because --line option does not exist HOT 2
- Release a new version! HOT 12
- Add gutter marks for failures HOT 3
- undefined method `join' for nil:NilClass in snippet_extractor.rb HOT 3
- Pry / byebug / web-console support? HOT 4
- Backtrace broken with latest RSpec HOT 1
- rspec-core 3.3.2 - broken when displaying a failed example HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rspec.tmbundle.