Giter VIP home page Giter VIP logo

neotest-rspec's Introduction

neotest-rspec

Tests

This plugin provides an RSpec adapter for the Neotest framework.

Neotest and RSPec

๐Ÿ“ฆ Installation

Install the plugin using packer:

use({
  'nvim-neotest/neotest',
  requires = {
    ...,
    'olimorris/neotest-rspec',
  },
  config = function()
    require('neotest').setup({
      ...,
      adapters = {
        require('neotest-rspec'),
      }
    })
  end
})

๐Ÿ”ง Configuration

The plugin may be configured as below:

adapters = {
  require('neotest-rspec')({
    rspec_cmd = function()
      return vim.tbl_flatten({
        "bundle",
        "exec",
        "rspec",
      })
    end
  }),
}

Running tests in a docker container

This is not yet directly support by neotest, but you can accomplish this using a shell script as your rspec command. See this comment for an example.

๐Ÿš€ Usage

NOTE: All usages of require('neotest').run.run can be mapped to a command in your config (this is not included and should be done by yourself).

Test single function

To test a single test, hover over the test and run require('neotest').run.run()

Test file

To test a file run require('neotest').run.run(vim.fn.expand('%'))

Test directory

To test a directory run require('neotest').run.run("path/to/directory")

Test suite

To test the full test suite run require('neotest').run.run("path/to/root_project") e.g. require('neotest').run.run(vim.fn.getcwd()), presuming that vim's directory is the same as the project root.

๐ŸŽ Contributing

This project is maintained by the Neovim Ruby community. Please raise a PR if you are interested in adding new functionality or fixing any bugs. When submitting a bug, please include an example spec that can be tested.

To trigger the tests for the adapter, run:

./scripts/test

๐Ÿ‘ Thanks

A special thanks to the following contributers:

neotest-rspec's People

Contributors

aldhsu avatar alxekb avatar benlubas avatar compactcode avatar danilojns avatar mmirus avatar neanias avatar olimorris avatar rcarriga avatar zidhuss avatar

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.