Sha256: cc9e74ceb0e4ab6dfe126b80a82622a6a9a7f8cb154fb368126351c4435e7e76

Contents?: true

Size: 396 Bytes

Versions: 7

Compression:

Stored size: 396 Bytes

Contents

shared_examples_for 'an idempotent method' do
  it 'is idempotent' do
    first = subject
    error = 'RSpec not configured for threadsafety'
    fail error 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

7 entries across 7 versions & 1 rubygems

Version Path
devtools-0.1.26 shared/spec/shared/idempotent_method_behavior.rb
devtools-0.1.25 shared/spec/shared/idempotent_method_behavior.rb
devtools-0.1.24 shared/spec/shared/idempotent_method_behavior.rb
devtools-0.1.23 shared/spec/shared/idempotent_method_behavior.rb
devtools-0.1.22 shared/spec/shared/idempotent_method_behavior.rb
devtools-0.1.21 shared/spec/shared/idempotent_method_behavior.rb
devtools-0.1.20 shared/spec/shared/idempotent_method_behavior.rb