Sha256: 6be260cdc2be2897a2cc58767152e479f2fcbe91f11ec00e3a6efa8ef54e10bb

Contents?: true

Size: 378 Bytes

Versions: 18

Compression:

Stored size: 378 Bytes

Contents

shared_examples_for 'an idempotent method' do
  it 'is idempotent' do
    first = subject
    fail 'RSpec not configured for threadsafety' unless RSpec.configuration.threadsafe?
    mutex = __memoized.instance_variable_get(:@mutex)
    memoized = __memoized.instance_variable_get(:@memoized)
    mutex.synchronize { memoized.delete(:subject) }
    should equal(first)
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
devtools-0.1.19 shared/spec/shared/idempotent_method_behavior.rb
devtools-0.1.18 shared/spec/shared/idempotent_method_behavior.rb
devtools-0.1.16 shared/spec/shared/idempotent_method_behavior.rb
devtools-0.1.15 shared/spec/shared/idempotent_method_behavior.rb
devtools-0.1.14 shared/spec/shared/idempotent_method_behavior.rb
devtools-0.1.13 shared/spec/shared/idempotent_method_behavior.rb
devtools-0.1.12 shared/spec/shared/idempotent_method_behavior.rb
devtools-0.1.11 shared/spec/shared/idempotent_method_behavior.rb
devtools-0.1.10 shared/spec/shared/idempotent_method_behavior.rb
devtools-0.1.9 shared/spec/shared/idempotent_method_behavior.rb
devtools-0.1.8 shared/spec/shared/idempotent_method_behavior.rb
devtools-0.1.7 shared/spec/shared/idempotent_method_behavior.rb
devtools-0.1.6 shared/spec/shared/idempotent_method_behavior.rb
central-devtools-0.8.4 shared/spec/shared/idempotent_method_behavior.rb
central-devtools-0.8.3 shared/spec/shared/idempotent_method_behavior.rb
devtools-0.1.5 shared/spec/shared/idempotent_method_behavior.rb
devtools-0.1.4 shared/spec/shared/idempotent_method_behavior.rb
devtools-0.1.3 shared/spec/shared/idempotent_method_behavior.rb