Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.
/ see_double Public archive

A small tool CLI, for Rspec Lover, to monitoring your FEATURE specs and check your duplication. SeeDouble go through all your specs and count the number of occurence of your «expect» and «result».

License

Notifications You must be signed in to change notification settings

morissetcl/see_double

Repository files navigation

Build Status Gem Version

SeeDouble

A small tool CLI, for Rspec Lover, to monitoring your FEATURE specs and check your duplication. SeeDouble go through all your specs and count the number of occurence of your 'expect' and 'result'.

alt-text

Installation

Add this line to your application's Gemfile:

gem 'see_double'

And then execute:

$ bundle

Or install it yourself as:

$ gem install see_double

Get started

Just open you terminal, go in your project and type:

see_double expect or see_double result. (if you are facing somme issue try to prepend bundle exec before the commands above)

An example is better than 1000 words so.. imagine you have written the following and beautiful test:

describe 'Car - Edit', type: :feature do
  let!(:user) { create :user, email: '[email protected]' }
  let!(:car) { create :car, brand: 'CoolCar', user: user }

  scenario 'Edit a car' do
    visit edit_car_path car
    expect do
      fill_in :car_brand, with: 'CoolCar XP'
      click_on 'Update'
    end.to_not change { Car.count }
    expect(car.brand).to eq 'CoolCar'
    expect(car.user.email).to eq '[email protected]'
    expect(page).to have_content 'CoolCar'
    expect(page).to have_content '[email protected]'
  end
end

Expect

In your cli just type see_double expect and you will see something like that..

----- Analyze of your expect from each features specs -----

./spec/features/cars/edit_spec.rb:
you use 2 times page as expect
you use 1 times car.brand as expect
you use 1 times car.user.email as expect

SeeDouble count the number of occurence of your 'expect'. Your result is sorted by file.

Result

In your cli just type see_double result and you will see something like that..

----- Analyze of your result from each features specs -----

./spec/features/cars/edit_spec.rb:
you use 2 times 'CoolCar' as result
you use 2 times '[email protected]' as result

SeeDouble count the number of occurence of your 'result'. Your result is sorted by file.

Contributing

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

License

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

About

A small tool CLI, for Rspec Lover, to monitoring your FEATURE specs and check your duplication. SeeDouble go through all your specs and count the number of occurence of your «expect» and «result».

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published