Project

fsr

0.0
The project is in a healthy, maintained state
Run RSpec fast by avoiding full app boot
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
 Project Readme

fsr - fast spec runner

fsr listens for file change events and runs RSpecs automatically in rails console avoiding the rails boot process and provides instant feedback which is crucial for Test Driven Development (TDD).

Installation

  1. Add fsr to your app’s Gemfile in test:

    group :test do
      gem 'fsr'
    end
  2. Then, in your project directory:

    $ bundle install

Usage

Open rails console in test environment.

 RAILS_ENV=test bundle exec rails c

All following examples should be run in this console.

listener = Fsr.listen(['spec/models/user_spec.rb'])
listener.start

This will listen to any file change events, automatically load the changed file and run the given spec.

To stop the listener,

listener.stop

By default, it listens for file change events on app/, lib/, spec/ directories. This can be overriden with listen option.

Fsr.listen(['spec/models/user_spec.rb'], listen: ['dir/'])

You can pass any RSpec command line arguments. For example, to run based on line number.

Fsr.listen(['spec/models/user_spec.rb:12'])

To run based on line number.

Fsr.listen(['spec/models/user_spec.rb', 'spec/models/admin_spec.rb'])

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/elamaranae/fsr. 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 Fsr project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.