Sha256: 20d7342ff00e35fab0a4e98732d20ab8754ca0e40db127825e3ade8280be6797

Contents?: true

Size: 632 Bytes

Versions: 16

Compression:

Stored size: 632 Bytes

Contents

module PaperTrail
  module RSpec
    module Helpers
      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

      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

16 entries across 16 versions & 1 rubygems

Version Path
paper_trail-4.2.0 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-4.1.0 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-4.0.2 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-4.0.1 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-3.0.9 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-4.0.0 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-4.0.0.rc2 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-4.0.0.rc1 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-3.0.8 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-3.0.7 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-4.0.0.beta2 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-4.0.0.beta1 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-3.0.6 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-3.0.5 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-3.0.2 lib/paper_trail/frameworks/rspec/helpers.rb
paper_trail-3.0.1 lib/paper_trail/frameworks/rspec/helpers.rb