Sha256: 6cc7c092a63b72a34f06e118733ee7885b36ee635ad6584b89ca217f63735cc1

Contents?: true

Size: 367 Bytes

Versions: 2

Compression:

Stored size: 367 Bytes

Contents

require 'singleton'

RSpec.configure do |config|
  config.around(:each, :singletons => lambda { |v| !!v }) do |example|
    options             = example.metadata[:singletons]
    singletons_to_reset = options.respond_to?(:each) ? options : [options]

    example.run

    singletons_to_reset.each do |singleton|
      Singleton.__init__(singleton)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rspectacular-0.12.0 lib/rspectacular/plugins/singleton.rb
rspectacular-0.11.1 lib/rspectacular/plugins/singleton.rb