ruby-lsp-rspec icon indicating copy to clipboard operation
ruby-lsp-rspec copied to clipboard

Using with docker

Open belarba opened this issue 1 year ago • 2 comments

Hello

is it possible to run in a project with docker?

In my case I'd need just to add this to the beginning of command:

dc-test run --rm api bin/rspec {spec_file.rb}

belarba avatar Apr 17 '24 11:04 belarba

FYI I opened https://github.com/st0012/ruby-lsp-rspec/pull/57 as one possible approach to handling this issue

westonkd avatar Jan 06 '25 23:01 westonkd

👋 FYI #57 was merged and helps with the Docker story in a few ways.

First, some clarification on the Ruby LSP supported container development setup (dev containers).

Running the Ruby LSP extension within the dev container will help with issues where the spec path given to rspec is the path on the host machine rather than within the container.

Second, this change adds support for customizing the rspec command.

If you have a unique setup where running Ruby LSP extension within the dev container is not enough, you can further customize.

For example, I have one project I work on where I need to do the following to make sure I'm using the right rspec executable within a container (it's a long story):

"rubyLsp.addonSettings": {
    "Ruby LSP RSpec": {
        "debug": true,
        "rspecCommand": "cd /usr/src/app && rspec"
    }
},

westonkd avatar Feb 04 '25 16:02 westonkd