ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

RSpec Buddy

A RSpec buddy for Sublime Text.

Details

  • 0.0.16
  • packagecontrol.​io
  • 10 months ago
  • 15 minutes ago
  • 1 year ago

Installs

  • Total 379
  • Win 59
  • OS X 221
  • Linux 99
Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12 Jun 11 Jun 10 Jun 9 Jun 8 Jun 7 Jun 6 Jun 5 Jun 4 Jun 3 Jun 2 Jun 1 May 31 May 30 May 29 May 28 May 27 May 26 May 25 May 24 May 23 May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3
Windows 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 1 1 0 0 0 0 1 0 0 0
OS X 1 0 0 0 0 0 1 0 1 0 1 1 0 1 1 0 0 1 0 0 0 1 0 1 0 0 0 1 2 0 0 0 0 1 1 0 0 0 0 0 1 0 0 1 0 1
Linux 0 0 0 2 1 0 1 0 0 0 0 2 2 1 1 0 0 0 1 0 0 1 0 0 0 0 0 0 2 0 0 1 1 0 0 0 0 1 1 1 0 0 0 0 0 1

Readme

Source
raw.​githubusercontent.​com

RSpec Buddy

RSpec syntax highlighting, implementation/spec toggling command, snippets and support for config file.

A modified fork of https://github.com/fnando/better-rspec-for-sublime-text.

What is different?

  • it reads an optional .rspec-buddy file so you can customize the path to ignore when looking for spec and implementation files
  • it infers the class/module name from the implementation file path to put at RSpec.describe
  • it creates describe blocks for each method from the implementation file
  • it does not add require 'spec_helper'/require 'rails_helper' to spec files because I put one of them in the .rspec file
  • it does not have snippets (create the ones you want)
  • some handy little tweaks

Toggling between implementation/spec

alt tag

The default binding is super+..

{
  "keys": ["super+."],
  "command": "rspec_toggle"
}

You can change it to whatever you by adding the following snippet to your Keybindings file.

{
  "keys": ["ctrl+alt+down"],
  "command": "rspec_toggle"
}

Syntax Detection

The best way of setting the syntax automatically is using the ApplySyntax package. Just install it and you're done!

.rspec-buddy file (optional)

Suppose you have the following structure:

project/
  lib/
    whatever/
      file.rb

By invoking the rspec_toggle command, this plugin will look for the spec file at project/spec/whatever/file_spec.rb.

But you can create a project/.rspec-buddy file with the content lib/whatever/ for instance, then, the plugin will look for the spec file at project/spec/file_spec.rb (ignoring lib/whatever/).

This file is optional, by default lib/ will be ignored.

License

The MIT License (MIT)

Copyright © 2018 Glauco Custódio

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.