From 97da614fb56af6ffd6e755957527703d5d6bdb94 Mon Sep 17 00:00:00 2001 From: Chris Zetter <253059100+zetter-rpf@users.noreply.github.com> Date: Mon, 27 Apr 2026 15:30:57 +0100 Subject: [PATCH] Setup tasks for rspec Note that you will need to have asdf on your non-interactive shell path for this to work. If you see a bunder not installed message this is likely the cause. You can fix this by making sure asdf is added to your path in your zprofile instead of your zshrc. I've added the rspec bin stub as part of this as it's quicker than typing bundle exec and simpler than using it in the tasks.json --- .vscode/tasks.json | 41 +++++++++++++++++++++++++++++++++++++++++ bin/rspec | 16 ++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 .vscode/tasks.json create mode 100755 bin/rspec diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 000000000..1dc16663e --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,41 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Run test file (RSpec)", + "type": "shell", + "command": "./bin/rspec", + "args": [ + "${file}" + ], + "options": { + "cwd": "${workspaceFolder}" + }, + "group": "test", + "presentation": { + "reveal": "always", + "panel": "dedicated", + "clear": true + }, + "problemMatcher": [] + }, + { + "label": "Run test at current line (RSpec)", + "type": "shell", + "command": "./bin/rspec", + "args": [ + "${file}:${lineNumber}" + ], + "options": { + "cwd": "${workspaceFolder}" + }, + "group": "test", + "presentation": { + "reveal": "always", + "panel": "dedicated", + "clear": true + }, + "problemMatcher": [] + } + ] +} diff --git a/bin/rspec b/bin/rspec new file mode 100755 index 000000000..93e191c2f --- /dev/null +++ b/bin/rspec @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'rspec' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rspec-core", "rspec")