Sha256: 46387460fe15a7d8af46ad498832a395ca6459dcaeecf1903c57726ce5a16ad9

Contents?: true

Size: 798 Bytes

Versions: 27

Compression:

Stored size: 798 Bytes

Contents

# frozen_string_literal: true

module PaperTrail
  module RSpec
    module Helpers
      # Included in the RSpec configuration in `frameworks/rspec.rb`
      module InstanceMethods
        # enable versioning for specific blocks (at instance-level)
        def with_versioning
          was_enabled = ::PaperTrail.enabled?
          ::PaperTrail.enabled = true
          yield
        ensure
          ::PaperTrail.enabled = was_enabled
        end
      end

      # Extended by the RSpec configuration in `frameworks/rspec.rb`
      module ClassMethods
        # enable versioning for specific blocks (at class-level)
        def with_versioning(&block)
          context "with versioning", versioning: true do
            class_exec(&block)
          end
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 3 rubygems

Version Path
paper_trail-16.0.0 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-15.2.0 lib/paper_trail/frameworks/rspec/helpers.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/paper_trail-12.3.0/lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-15.1.0 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-15.0.0 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-14.0.0 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-13.0.0 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-12.3.0 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-12.2.0 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-12.1.0 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-12.0.0 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-11.1.0 lib/paper_trail/frameworks/rspec/helpers.rb
mongo_trails-10.3.1 lib/mongo_trails/frameworks/rspec/helpers.rb
paper_trail-11.0.0 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-10.3.1 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-10.3.0 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-10.2.1 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-10.2.0 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-10.1.0 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-10.0.1 lib/paper_trail/frameworks/rspec/helpers.rb