Sha256: d556a51f31baa4802429a9af36dc733786bf3c1723b8e71b4174e679dfbc1a6e

Contents?: true

Size: 666 Bytes

Versions: 2

Compression:

Stored size: 666 Bytes

Contents

if defined? World
  # before hook for Cucumber
  before do
    ::PaperTrail.enabled = false
    ::PaperTrail.whodunnit = nil
    ::PaperTrail.controller_info = {} if defined? ::Rails
  end

  module PaperTrail
    module Cucumber
      module Extensions
        # :call-seq:
        # with_versioning
        #
        # enable versioning for specific blocks

        def with_versioning
          was_enabled = ::PaperTrail.enabled?
          ::PaperTrail.enabled = true
          begin
            yield
          ensure
            ::PaperTrail.enabled = was_enabled
          end
        end
      end
    end
  end

  World PaperTrail::Cucumber::Extensions
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
paper_trail_without_deprecated-3.0.0.beta1 lib/paper_trail/frameworks/cucumber.rb
paper_trail-3.0.0.beta1 lib/paper_trail/frameworks/cucumber.rb