No release in over a year
Danger plugin to validate files (or directories) naming.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0
~> 2.14
= 3.0.7
~> 0.14.0
~> 10.0
~> 3.4
~> 1.12.0
~> 0.9.26

Runtime

 Project Readme

danger-spec_postfix

Danger plugin to validate files (or directories) naming.

Installation

$ gem install danger-spec_postfix

Example of usage

1. Add lint to your Dangerfile (specifying what you want to check and how)

For example in order to make sure that all tests in your 'spec/' folder have required postfix '_spec' (this is the purpose plugin was initially built for) add:

```
options = {
  message: 'Tests should have `_spec` postfix',
  include_path: %r{spec/},
  match: %r{_spec.rb$}
}
spec_postfix.lint(options)
```

You can also pass `exclude_path` param in order to skip irrelevant files or directories:

```
options = {
  message: 'Tests should have `_spec` postfix',
  include_path: %r{spec/},
  match: %r{_spec.rb$}
  exclude_path: Regexp.union(%r{rails_helper.rb}, %r{rails_helper.rb}, %{spec/factories/}, %r{spec/support/})
}
spec_postfix.lint(options)
```

2. Get warnings:

```
"Tests should have `_spec` postfix: spec/models/test_without_postfix.rb"
```

Development

  1. Clone this repo
  2. Run bundle install to setup dependencies.
  3. Run bundle exec rake spec to run the tests.
  4. Use bundle exec guard to automatically have tests run as you make changes.
  5. Make your changes.