Git Product home page Git Product logo

Comments (13)

drogar avatar drogar commented on August 21, 2024

Same issue. I am using the obvious workaround of adding my rspec commands in the settings for minitest.

from atom-ruby-test.

moxley avatar moxley commented on August 21, 2024

@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.

drogar avatar drogar commented on August 21, 2024

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.

asusikov avatar asusikov commented on August 21, 2024

I do too.

from atom-ruby-test.

moxley avatar moxley commented on August 21, 2024

OK, give this fix a shot.

from atom-ruby-test.

drogar avatar drogar commented on August 21, 2024

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.

asusikov avatar asusikov commented on August 21, 2024

It works for me too.
Thank you for your quick fix!

from atom-ruby-test.

moxley avatar moxley commented on August 21, 2024

@drogar, @asusikov Thanks for the feedback!

from atom-ruby-test.

zinkkrysty avatar zinkkrysty commented on August 21, 2024

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.

moxley avatar moxley commented on August 21, 2024

@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.

zinkkrysty avatar zinkkrysty commented on August 21, 2024

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.

bronson avatar bronson commented on August 21, 2024

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.

moxley avatar moxley commented on August 21, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.