File: neovim_spec.rb

package info (click to toggle)
ruby-neovim 0.10.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 548 kB
  • sloc: ruby: 4,178; sh: 23; makefile: 4
file content (43 lines) | stat: -rw-r--r-- 994 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
require "helper"

RSpec.describe Neovim do
  let(:client) { Support.persistent_client }

  let(:stream) do
    case Support.backend_strategy
    when /^tcp/, /^unix/
      "socket"
    else
      "stdio"
    end
  end

  describe ".attach" do
    it "sets appropriate client info" do
      chan_info = client.evaluate("nvim_get_chan_info(#{client.channel_id})")

      expect(chan_info).to match(
        "client" => {
          "name" => "ruby-client",
          "version" => {
            "major" => duck_type(:to_int),
            "minor" => duck_type(:to_int),
            "patch" => duck_type(:to_int)
          },
          "type" => "remote",
          "methods" => {},
          "attributes" => duck_type(:to_hash)
        },
        "id" => duck_type(:to_int),
        "mode" => "rpc",
        "stream" => stream
      )
    end
  end

  describe ".executable" do
    it "returns the current executable" do
      expect(Neovim.executable).to be_a(Neovim::Executable)
    end
  end
end