0.0
No commit activity in last 3 years
No release in over 3 years
A plugin mechanism for RSpec
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

rspec-plugins

A simple plugin mechanism for RSpec. Make your hooks reusable through a plugin module.

include 'rspec-plugins'

class SimpleCounter < RSpec::Plugins::Base
  attr_accessor :count

  def initialize
    super
    @counter = 0
  end

  def increment(value = 1)
    @count += value
  end
end

RSpec::Plugins::Core.debug = true

describe SimpleCounter do
  include RSpec::Plugins::Core
  plugins.enable :counter => SimpleCounter.new

  plugin :counter, :increment
  plugin :counter, :increment, 5
end

usage

Please please have a look at the specs for now (Counter Plugin Spec).

debugging

To enable debugging:

RSpec::Plugins::Core.debug = true