No release in over a year
A tiny custom cop to detect empty example.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

EmptyExampleCop

EmptyExampleCop is a tiny custom cop to detect empty examples which don't include any expectations.

  # bad
  describe Bacon do
    let(:bacon)      { Bacon.new(chunkiness) }
    let(:chunkiness) { true }

    it 'is chunky' do
      bacon.chunky?
    end
  end

  # good
  describe Bacon do
    let(:bacon)      { Bacon.new(chunkiness) }
    let(:chunkiness) { true }

    it 'is chunky' do
      expect(bacon.chunky?).to be_truthy
    end
  end

Installation

Add this line to your application's Gemfile:

gem 'empty_example_cop', require: false

Usage

Add empty_example_cop to your .rubocop.yml:

require:
  - rubocop-rspec
  - empty_example_cop
bundle exec rubocop <options>

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/makicamel/empty_example_cop. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the EmptyExampleCop project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.