moxley / atom-ruby-test

Run Ruby tests, Rspec examples, and Cucumber features from Atom
MIT License
43 stars 36 forks source link

Minitest spec file not recognized as minitest when file contains `def` #57

Closed moxley closed 9 years ago

moxley commented 9 years ago

I have a minitest spec file that contains a method definition. ruby-test now thinks the file is an rspec file, and tries to run the rspec test run command.

moxley commented 9 years ago
require 'helper'

describe Object do
  it "quacks" do
    def Object.quack
      "quack"
    end
  end
end
moxley commented 9 years ago

cc @roychoo

roychoo commented 9 years ago

noted on this, this is an edge case, i wonder to make things simple, would it be better if we could use project configuration to specify if the project is using rspec or minitest, like how you suggested initially? instead of trying to find out what kind of test framework it is?

moxley commented 9 years ago

Yes, since Minitest specs and RSpec are so similar to each other, it's probably best to have a project setting to detect the framework.

moxley commented 9 years ago

Fixed in #67: Use the new "Spec Framework" and "Test Framework" settings to choose your preferred framework for the active *_spec.rb or *_test.rb file.