Skip to content

A plugin mechanism for RSpec. Make your hooks reusable in your own plugin.

License

Notifications You must be signed in to change notification settings

Drachenfels-GmbH/rspec-plugins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A plugin mechanism for RSpec. Make your hooks reusable in your own plugin.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages