ZIm/extensions
Vitaly Slobodin 99570f9361
ruby: Add support for running tests (#12052)
Hello, this pull request adds two things related to each other. I hope
it's fine to submit both in the same pull request but I am totally fine
with submitting them in separate pull requests, just let me know. This
is an initial version for both features. Thanks!

## Symbols outline support for testing frameworks: minitest and RSPec

Symbols outline support in
[Minitest](https://github.com/minitest/minitest) (the testing framework
that comes with Ruby on Rails out of the box) and RSpec (another testing
framework that is popular in Ruby and Ruby on Rails world). Here are
some screenshots:

### Minitest

Given this Ruby code:

```ruby
require "test_helper"

class CategoryTest < ActiveSupport::TestCase
  context "validations" do
    subject { build(:category) }

    should validate_presence_of(:title)
    should validate_length_of(:title).is_at_most(255)
    should validate_uniqueness_of(:title)
  end
end

class TestNamesWithMiniTest < ActiveSupport::TestCase
  def test_foo_1; assert true; end
  def test_foo_2; assert true; end
  def test_bar_1; assert true; end
  def test_bar_2; assert true; end
end
```

We have this symbols outline:

![CleanShot 2024-05-20 at 12 35
46@2x](https://github.com/zed-industries/zed/assets/1894248/c63a61d8-38cc-4969-a49b-dd9ce6920a0e)

### RSpec

I used `mastodon` application for testing because it's written in Ruby.
Given the following file
https://github.com/mastodon/mastodon/blob/main/spec/models/account_spec.rb
We have the following symbols outline:

![CleanShot 2024-05-20 at 12 44
42@2x](https://github.com/zed-industries/zed/assets/1894248/a754cf4c-f9cc-43f3-b365-1ce0ff942941)



## Running Ruby tests

### Minitest

Given the same file as above, we have the following workflow:



https://github.com/zed-industries/zed/assets/1894248/dc335495-3460-4a6d-95c4-e4cbc87a1ea0



### RSpec

Given the following file
`https://github.com/mastodon/mastodon/blob/main/spec/models/account_spec.rb`
We have the following workflow:



https://github.com/zed-industries/zed/assets/1894248/a17067ea-73b6-4229-8f1b-1b88dde63401

<hr />

Release Notes: Added Ruby test runnables support
2024-05-21 22:07:44 +03:00
..
astro astro: Bump to v0.0.2 (#11834) 2024-05-14 19:12:43 -04:00
clojure Clean up whitespace (#10755) 2024-04-23 13:31:21 -04:00
csharp csharp: Bump to v0.0.2 (#10651) 2024-04-16 15:49:16 -04:00
dart dart: Bump to v0.0.2 (#10940) 2024-04-24 13:03:56 -04:00
deno Extract Deno extension (#10912) 2024-04-23 20:44:11 -04:00
elixir elixir: Bump to v0.0.4 (#11446) 2024-05-06 12:41:50 -04:00
elm Extract Elm language into an extension (#10432) 2024-04-11 10:23:49 -07:00
emmet emmet: release 0.0.3 (#11873) 2024-05-15 21:27:37 +02:00
erlang Extract Erlang support into an extension (#9974) 2024-03-29 18:03:38 -04:00
gleam gleam: Bump to v0.1.3 (#12000) 2024-05-17 16:31:01 -04:00
glsl glsl: Bump to v0.1.0 (#10734) 2024-04-18 11:57:21 -04:00
haskell haskell: Bump to v0.1.0 (#10378) 2024-04-10 15:42:46 -04:00
html html: Bump to 0.1.1 (#12093) 2024-05-21 18:36:47 +02:00
lua Clean up whitespace (#10755) 2024-04-23 13:31:21 -04:00
ocaml Add xtask for finding crates with missing licenses (#11776) 2024-05-13 18:52:12 -04:00
php php: Bump to v0.0.3 (#11832) 2024-05-14 19:02:39 -04:00
prisma prisma: Bump to v0.0.2 (#10689) 2024-04-17 12:40:01 -04:00
purescript Fix typo in PureScript extension's struct name (#9831) 2024-03-26 16:29:55 -04:00
racket Clean up whitespace (#10755) 2024-04-23 13:31:21 -04:00
ruby ruby: Add support for running tests (#12052) 2024-05-21 22:07:44 +03:00
scheme Clean up whitespace (#10755) 2024-04-23 13:31:21 -04:00
svelte Use v0.0.6 of the zed_extension_api for extensions that need it (#10324) 2024-04-09 10:57:26 -04:00
terraform terraform: Sync Cargo.toml version with extension.toml version (#10937) 2024-04-24 11:42:18 -04:00
toml toml: Bump to v0.1.1 (#11359) 2024-05-03 11:29:53 -04:00
uiua Update extension descriptions (#9939) 2024-03-28 17:14:55 -04:00
vue vue: Bump to v0.0.2 (#11747) 2024-05-13 08:49:40 -04:00
zig zig: Bump to v0.1.2 (#11447) 2024-05-06 12:47:16 -04:00
.gitignore Provide wasm extensions with APIs needed for using pre-installed LSP binaries (#9085) 2024-03-08 17:18:06 -05:00