Comments (13)
Same issue. I am using the obvious workaround of adding my rspec commands in the settings for minitest.
from atom-ruby-test.
@asusikov, @drogar: At the top of a typical spec file, do you include a spec helper, like this:
require 'spec_helper'
Or do you do something different to bootstrap RSpec?
from atom-ruby-test.
I do.
Usually
require ‘rails_helper’
or
require ‘spec_helper’
I noticed the issue on one of the files with require ‘rails helper’
On May 25, 2015, at 10:12 AM, Moxley Stratton [email protected] wrote:
@asusikov https://github.com/asusikov, @drogar https://github.com/drogar: At the top of a typical spec file, do you include a spec helper, like this:
require 'spec_helper'
Or do you do something different to bootstrap RSpec?—
Reply to this email directly or view it on GitHub #54 (comment).
from atom-ruby-test.
I do too.
from atom-ruby-test.
OK, give this fix a shot.
from atom-ruby-test.
Perfect. Works for me.
Thanks for such a quick turnaround!
On May 25, 2015, at 10:34 AM, Moxley Stratton [email protected] wrote:
OK, give this fix a shot.
—
Reply to this email directly or view it on GitHub #54 (comment).
from atom-ruby-test.
It works for me too.
Thank you for your quick fix!
from atom-ruby-test.
@drogar, @asusikov Thanks for the feedback!
from atom-ruby-test.
What about if you use a relative path:
require File.dirname(__FILE__) + '/../../spec_helper'
I do this for files where I want to run tests without rails environment (but with rspec). Just using require 'spec_helper'
doesn't work in this case.
Therefore the plugin is inconsistent with detecting rspec and sometimes (for the same file) it ends up running minitest instead.
What other alternatives to conventions for deteting rspec tests are? I would presume that you can look at the file name and it should end with _spec.rb
. Or at least it could give us the possiblity of choosing the default test command for a project.
from atom-ruby-test.
@zinkkrysty: Detecting spec framework is difficult and error-prone. ruby-test has a setting for choosing your preferred spec framework. Change it to rspec
if that is your preferred framework. If you use minitest on some projects and rspec on others, install the https://github.com/danielbrodin/atom-project-manager plugin, then configure each project with it to set the ruby-test preferred spec framework.
from atom-ruby-test.
Ok thanks for the info. I agree, it shouldn't hack its way into detecting the right framework, if there isn't an established convention.
I'll take your suggestion with the preferred framework and the project-manager plugin, I didn't know about that.
from atom-ruby-test.
Hm, detection seems to be failing on my project too.
I don't quite understand what's so hard about determining if it's an rspec project... If an .rspec
file exists in the project's root dir, or if spec/spec_helper.rb
includes RSpec.configure
, then it has to be rspec, no?
Would you accept a PR to improve this?
from atom-ruby-test.
@bronson: There is logic in https://github.com/moxley/atom-ruby-test/blob/master/lib/source-info.coffee#L124 that checks for an .rspec
file. Maybe you can identify the proper course of action to fix the problem.
Of course I accept PRs: https://github.com/moxley/atom-ruby-test#contributing
from atom-ruby-test.
Related Issues (20)
- Overwrites spec files white space if using Whitespace package HOT 1
- Atom 1.17 Docks support HOT 2
- Looking for maintainer HOT 4
- Toggle to the test panel to activate the package: cmd-ctrl-x does not work HOT 2
- Changes required due to TextBuffer.save becoming async in Atom 1.19 HOT 2
- Spring problem, terminal is reopening on each run
- Testing just opens a shell, but doesnt run the tests. HOT 1
- Not have option to zoom/alter the font, is very small. HOT 1
- Uncaught TypeError: Cannot read property 'nodeName' of undefined
- how to test gem
- platformio-ide-terminal no longer supported - how do I reconfigure to use terminus? HOT 3
- not working for win 7 HOT 1
- Closing the test pane leaves a blank bar HOT 2
- Using Atom 1.8.0, the Settings-->Packages widget cant find "Ruby Test" HOT 1
- Spec framework incorrectly identified as minitest when using require_relative spec_helper HOT 1
- Run tests for current code file HOT 2
- Suggestion: Command Prefix HOT 2
- Cancelling doesn't actually cancel. HOT 1
- Update Documentation for running single file test HOT 1
- Focus issue HOT 2
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 atom-ruby-test.