Sha256: 89fdcf021127b03e43d96820e0bf9d6e56c3672caabce94a2c7898289ff56799

Contents?: true

Size: 311 Bytes

Versions: 2

Compression:

Stored size: 311 Bytes

Contents

require 'spec_helper'

describe 'threading behaviour' do
  it 'is threadsafe' do
    threads = []
    10.times do
      threads << Thread.new do
        Gon.clear
        Gon.a ||= 1
        Gon.a += 1
        expect(Gon.a).to eq 2
      end
    end
    threads.each(&:join)
    expect(Gon.a).to eq 2
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gon-5.0.1 spec/gon/thread_spec.rb
gon-5.0.0 spec/gon/thread_spec.rb