foneandrew / ruby-spec-runner

Run specific rspec & minitest tests from within vscode
MIT License
9 stars 3 forks source link

Rerun specs on save #7

Closed louim closed 5 months ago

louim commented 1 year ago

Hello! Thanks for this extension. Would it be feasible to have an option to allow rerunning (all / failed / last ran) specs automatically when the file is saved?

foneandrew commented 1 year ago

Hmm not sure? I don't have a lot of time to look into this now sorry (will add it to my todo list), but in the meantime would it work to configure the save shortcut to also trigger a test run? On a mac I can do this by adding the following to my keybindings.json:

    {
        "key": "cmd+s",
        "command": "ruby-spec-runner.runRspecOrMinitestFile",
        "when": "editorLangId == ruby"
    }

Although that will mean you run tests for non spec files though 🤔 . Maybe there is a way to make the "when" more specific to spec files?