All Projects → ndea → Regressor

ndea / Regressor

Licence: mit
Generate specs for your rails application the easy way. Regressor generates model and controller specs based on validations, associations, enums, database, routes, callbacks. Use regressor to capture your rails application behaviour.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Regressor

Tork
💞 Tests your Ruby code, in parallel, as you change it
Stars: ✭ 185 (-9.31%)
Mutual labels:  test-automation
Pydbgen
Random dataframe and database table generator
Stars: ✭ 191 (-6.37%)
Mutual labels:  generator
Laravel Tournaments
Laravel Package that allows you to generate customizable tournaments trees.
Stars: ✭ 196 (-3.92%)
Mutual labels:  generator
Revshellgen
Reverse shell generator written in Python 3.
Stars: ✭ 190 (-6.86%)
Mutual labels:  generator
Winappdriver
Windows Application Driver
Stars: ✭ 2,577 (+1163.24%)
Mutual labels:  test-automation
Sdk
Library for using Grafana' structures in Go programs and client for Grafana REST API.
Stars: ✭ 193 (-5.39%)
Mutual labels:  generator
Jpasskit
jPasskit is an Java™ implementation of the Apple™ PassKit Web Service.
Stars: ✭ 184 (-9.8%)
Mutual labels:  generator
Fantasy Map Generator
Web application generating interactive and highly customizable maps
Stars: ✭ 2,802 (+1273.53%)
Mutual labels:  generator
Typed Scss Modules
🎁 Generate type definitions (.d.ts) for CSS Modules using SCSS
Stars: ✭ 192 (-5.88%)
Mutual labels:  generator
Hermes
Golang package that generates clean, responsive HTML e-mails for sending transactional mail
Stars: ✭ 2,379 (+1066.18%)
Mutual labels:  generator
Cgx
💻🔥CLI to generate the recommended documentation/files to improve contribution (Github, Gitlab, CodeCommit and Bitbucket)
Stars: ✭ 190 (-6.86%)
Mutual labels:  generator
Qt4i
QTA driver for iOS app
Stars: ✭ 191 (-6.37%)
Mutual labels:  test-automation
Openqa
openQA web-frontend, scheduler and tools.
Stars: ✭ 194 (-4.9%)
Mutual labels:  test-automation
Hitchhiker
a Restful Api test tool
Stars: ✭ 2,175 (+966.18%)
Mutual labels:  test-automation
Apigcc
一个非侵入的api编译、收集、Rest文档生成工具。工具通过分析代码和注释,获取文档信息,生成RestDoc文档。
Stars: ✭ 198 (-2.94%)
Mutual labels:  generator
Factory trace
Simple tool to maintain factories and traits from FactoryBot
Stars: ✭ 184 (-9.8%)
Mutual labels:  rspec
Action Cable Testing
Action Cable testing utils
Stars: ✭ 192 (-5.88%)
Mutual labels:  rspec
Php Ulid
A PHP port of alizain/ulid with some minor improvements.
Stars: ✭ 203 (-0.49%)
Mutual labels:  generator
Blades
Blazing fast dead simple static site generator
Stars: ✭ 201 (-1.47%)
Mutual labels:  generator
Gpt Scrolls
A collaborative collection of open-source safe GPT-3 prompts that work well
Stars: ✭ 195 (-4.41%)
Mutual labels:  generator

Gem Version Code Climate Bitdeli Badge

Regressor

Regressor is a regression based testing tool. What is regression testing? see here. You can generate specs based on your ActiveRecord models.

Made with ♥ at Qurasoft

Get Regressor

Directly from GitHub
gem 'regressor', git: 'https://github.com/ndea/regressor.git', branch: 'master'

or

Rubygems
gem 'regressor', '~> 0.6.2'

Install

bundle install
rails g regressor:install

This will create an initializer in config/initializers. This initializers looks like this:

Initializer
# If the regressor gem is inside a group wrap your initializer in
# if defined?(Regressor) do .. end
Regressor.configure do |config|
  # Defines the path where the generated files for your models will be placed
  # config.regression_path = 'spec/models/regression'

  # Defines the path where the generated files for your controllers will be placed
  # config.regression_controller_path = 'spec/controllers/regression'

  # Exclude Models for regression spec generation.
  # Provide model names as String (e.g. 'User')
  # config.excluded_models = []

  # Exclude Controllers for regression generation.
  # Provide controller names as String (e.g. 'UsersController').
  # config.excluded_controllers = []

  # If you are using enums in Rails 4 enable this option to generate regression specs for enums.
  # If your Rails version is =< Rails 3 set this option to false.
  # Default this option is set to true.
  # config.include_enums = true
end

Then require the gem dependency 'shoulda-matchers' in your rails_helper (or spec_helper if you're using RSpec 2.x):

require 'shoulda/matchers'

If you are using mongoid please add mongoid-rspec.

Usage

Run the generator:

Be sure to run the generators in the test environment so that development-only gems are not being loaded, causing strange issues with controller filters and ActiveRecord callbacks.

ActiveRecord
RAILS_ENV=test rails generate regressor:model # Create Regression specs for your models
RAILS_ENV=test rails generate regressor:controller # Create Regression specs for your controllers
Mongoid
RAILS_ENV=test rails generate regressor:mongoid:model # Create regression specs for your mongoid models
Factories

You can even generate empty factories for your models simply by running

RAILS_ENV=test rails generate regressor:factory # Create empty factories based on your models
Supported Regressions
Factories

Empty factories can be created.

Models
ActiveRecord
  • Relations
    • belongs_to
    • has_many
    • has_one
  • Nested Attributes
  • Validations
    • Length
    • Presence
    • Numericality
  • Database
    • Columns
    • Indexes
  • Enums (Rails 4)
Mongoid
  • Relations
    • belongs_to
    • has_many
    • has_one
    • embeds_one
    • embeds_many
  • Database
    • Fields
  • Document
    • Includes
    • Versioning
Controllers
  • Routing
  • Callbacks
    • Before filter
    • After filter
    • Around filter

Also see

Airpair - Generate specs for your Rails application

Guard for regressor

Contributing

  1. Fork it ( https://github.com/ndea/regressor/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contribution topics wanted

  • Specs
  • Documentation
  • Bugfixes
  • Codestyle
  • Anything that improves this gem
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].