Giter Club home page Giter Club logo

rails-run-spec-vscode's Issues

Supporting Minitest?

I was looking for a plugin similar to RubyTest for Sublime Text or Atom RubyTest but to use within VSCode. Both of these seem to work fairly similarly but give some control over the type of test and commands being executed.

The biggest thing seems to be the fact that I don't use RSpec but instead the out of the box testing with Rails (ActiveSupport::TestCase, etc.)

Have you given any thought to supporting anything other than RSpec?

Automatically save file before running specs?

I often forget to save the current file (code or spec file) before using the keyboard shortcuts to run the spec(s) - would u consider a feature which first automatically saves the current file?

[Bug] Unable to run dir specs from contextual menu

An attempt to run specs for a dir from File Explorer (last item in the contextual menu)

Screenshot 2021-11-11 at 12 40 08

leads to the following error

[2021-11-11 12:35:38.376] [exthost] [error] TypeError: Cannot read property 'fsPath' of undefined
    at /Users/vittorius/.vscode/extensions/noku.rails-run-spec-vscode-0.1.4/out/src/extension.js:19:46
    at S._executeContributedCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:84:120585)
    at S.$executeContributedCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:84:121023)
    at c._doInvokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:88:12743)
    at c._invokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:88:12435)
    at c._receiveRequest (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:88:11097)
    at c._receiveOneMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:88:9900)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:88:8004
    at d.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:57:1726)
    at h.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65:15777)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:103:29836
    at d.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:57:1726)
    at h.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65:15777)
    at r._receiveMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65:21035)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65:17921
    at d.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:57:1726)
    at u.acceptChunk (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65:13138)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65:12486
    at Socket._ (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:103:13107)
    at Socket.emit (events.js:315:20)
    at addChunk (internal/streams/readable.js:309:12)
    at readableAddChunk (internal/streams/readable.js:284:9)
    at Socket.Readable.push (internal/streams/readable.js:223:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:188:23) extension.runSpecsFromMenu

Overwrites vscode commands by default

command-shift-t undoes the last closed tab, and this plugin overwrites it, with no way to undo the mapping except to manually fix the original mapping and remap a new key command

Console shows prompt directly after run

Hi,

first of all thanks for making this extension, it saved me a lot of time.

I have a problem with the tasks since I upgraded vscode to 1.23:

Right after I ran one of the tasks, the integrated console shows me my prompt at the top of the window, so I cannot see the results of the tests.

Could be that I have some misconfiguration here. I can provide my config if necessary.

Thanks for the help,

Nick

Path to spec file incorrect when using workspaces

Using the newly introduced VSCode workspaces, when using CMD+L, the terminal opens to the correct root directory, but the path to the spec also contains the root directory, so the spec file doesn't load.

For example, I have a workspace with two root folders:

  • Root1
  • Root2
    • spec
      • feature.spec.rb

If I have feature.spec.rb open, and go to run the specs, the terminal opens to ~/.../Root2/, and the path for the spec file will be Root2/spec/feature.spec.rb. Instead, it should be spec/feature.spec.rb.

referencing bin/rspec

I have tried to reference bin/rspec so spring is pre-loaded. However it does not evaluate this correctly and the command line results as $ [object Object] spec

  ruby.specCommand": {
        "type": "string",
        "default": "bin\/rspec",
        "description": "Defines a custom command to run for specs (i.e. 'spring rspec')"
    }

"Run line" uses backslashes in path on Windows

Using VS Code on Windows, with the development environment running in Docker.

User setting:

"ruby.specCommand": "docker-compose run -e 'RAILS_ENV=test' web rspec"

When running the "run line" command, I get:

An error occurred while loading ./spec\graphql\types\user_spec.rb.
Failure/Error: load file

LoadError:
  cannot load such file -- /oryxapi/spec\graphql\types\user_spec.rb

Note the mixed slashes there -- this should all be forward slashes, but since Windows uses backslash, those just get piped through and I believe they confuse the Docker instance trying to run the tests.

Is there a way to convert those backslashes to slashes?

Publish rails-run-spec-vscode to Open VSX

Dear extension author,
Please publish this extension to the Open VSX marketplace.

Context

Unfortunately, as Microsoft prohibits usages of the Microsoft marketplace by any other products or redistribution of .vsix files from it, in order to use VS Code extensions in non-Microsoft products, we kindly ask that you take ownership of the VS Code extension namespace in Open VSX and publish this extension on Open VSX.

What is Open VSX? Why does it exist?

Open VSX is a vendor neutral alternative to the MS marketplace used by most other derivatives of VS Code like VSCodium, Gitpod, OpenVSCode, Theia-based IDEs, and so on.

You can read on about Open VSX at the Eclipse Foundation's Open VSX FAQ.

How can you publish to Open VSX?

The docs to publish an extension can be found here. This process is straightforward and shouldn't take too long. Essentially, you need an authentication token and to execute the ovsx publish command to publish your extension. There's also a doc explaining the whole process with an example GitHub Action workflow.

Is it possible to get the test name?

If you need to run rake test instead of rails test or rspec, you need to pass the test name and it doesn't work with line numbers (which btw is not the best practice since you can move line numbers when writing tests).
Is there any trick that we can use when setting the property Ruby: spec command in the extension's options?

Stopped working for me after upgrade to vs code 1.51.0

After update to vs code 1.51.0 I observed the following:
cmd + l isn't doing anything
cmd + shift + t isn't doing anything
cmd + y still works

Thanks for your hard work, this extension has made my workflow so smooth. I don't have any experience developing vs code extensions. It could be user error, but I have tried modifying the key mappings and made sure there were no conflicting key mappings. Let me know if there are any trouble shooting steps I can try.

Cheers!

Run File Spec ignores/removes the lib directory

The command >Run file Spec has bit of a problem lib directories. It removes the word lib from the file path. The file that it is going to test is called lib/external/client.rb

What the command above gives me

$ bundle exec rspec spec/external/client_spec.rb

What the command should look like

$ bundle exec rspec spec/lib/external/client_spec.rb 

[Feature request] Open spec file, open implementation file

Hi ๐Ÿ‘‹, thanks for the gem I use it everyday and it's very convenient.

One thing I miss from Rubymine is being able to open the spec file if I am looking at the implementation and vice-versa.

For example:

  • I have my editor open for app/models/foo.rb
  • I press a shortcut and the editor opens a new tab spec/models/foo_spec.rb

The opposite should also work.

Thanks ๐Ÿ™‡

Issue on Windows with Keyboard Shortcuts

Hey, I love using this extension on my Mac for work! It's amazing!

But on my home PC I've starting developing as well... and let's just say using the 'Windows' key on a keyboard shortcut is not ideal.

Name Description Keyboard Shortcuts Menu Contexts
extension.runAllSpecFiles Run All Spec Files Windows+R ย 
extension.runFileSpecs Run File Specs Shift+Windows+T ย 
extension.runSpecsFromMenu Run Specs ย  explorer/context
extension.runSpecLine Run Spec Line Windows+L ย 
extension.runLastSpec Run Last Spec Windows+Y

'Windows' + L locks the device... 'Windows' + R opens 'run.exe'... 'Shift' + 'Windows' + T highlights the Windows button on the Taskbar.

Am I missing something for custom keybindings? I thought I looked through the settings fully.
If I didn't, any chance that can get added?

Thanks!

Running the contributed command:'extension.runFileSpecs' failed.

This started occurring after upgrading to VS Code 1.10.1 (Mac) when I execute the Run File Specs command. There is no output in Debug Console or Output -> Extensions. Having the terminal window open in advance doesn't help either.

I'm guessing this is related to terminal window changes in the latest release of VS Code.

Doesn't work for some flavor of tests?

I have a spec in this file: spec/features/some_spec/some_thing.rb

Header of the file:

require 'spec_helper'

feature 'some feature spec', type: :feature, js: true do

None of the runner commands work in this file. No errors. Just nothing happens.

Property 'onDidCloseTerminal' does not exist on type 'typeof window

errors after launch extension (debug)

file: 'file:///Users/another/opensource/rails-run-spec-vscode/src/terminal.ts'
severity: 'Error'
message: 'Property 'onDidCloseTerminal' does not exist on type 'typeof window'.'
at: '9,15'
source: 'ts'

i think, this error because of different versions vscode package
which version are you using?

[Feature request] Option to run specs by name, not line number

Rspec lets you run tests with rpec test/spec.rb -e 'name of test' where name of test is some subset of the test string. This can be very useful for when you're refactoring tests, and the line number moves around. Is this something you think would work in this project? I might try exploring a pull request if you approve it @noku

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.