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

RSpec Buddy

A RSpec buddy for Sublime Text.

Details

  • 0.0.10
  • github.​com
  • 1 month ago
  • 2 hours ago
  • 3 months ago

Installs

  • Total 92
  • Win 12
  • OS X 60
  • Linux 20
Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 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
Windows 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0
OS X 0 0 1 0 0 0 0 0 0 1 0 0 1 1 3 0 3 0 0 2 0 0 3 0 0 1 1 1 0 1 0 0 0 2 1 0 1 2 0 0 0 0 0 1 0
Linux 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 2 0 0 0 0 0 0 1 0 0 1 0

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 has less snippets (just the ones I use often)
  • it does not add require 'spec_helper'/require 'rails_helper' to spec files because I put one of them in the .rspec file
  • 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.