diff options
| author | Vladimir Kochnev <[email protected]> | 2019-03-09 19:49:27 +0300 |
|---|---|---|
| committer | Vladimir Kochnev <[email protected]> | 2019-10-02 18:06:39 +0300 |
| commit | 09469669ccadf8580643eae8352372e92e1ddbb0 (patch) | |
| tree | 35514f7979ee3abcbadbb416710c0577b47c924a /test/rels | |
| parent | 913003eaf0456e4645cad91f2622354deae10841 (diff) | |
| download | caxlsx-09469669ccadf8580643eae8352372e92e1ddbb0.tar.gz caxlsx-09469669ccadf8580643eae8352372e92e1ddbb0.zip | |
Cache relationship in Hash rather than in Array.
Also cacle only ids, not entire instances.
Diffstat (limited to 'test/rels')
| -rw-r--r-- | test/rels/tc_relationship.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/rels/tc_relationship.rb b/test/rels/tc_relationship.rb index 845f789e..f47b6a4d 100644 --- a/test/rels/tc_relationship.rb +++ b/test/rels/tc_relationship.rb @@ -14,10 +14,10 @@ class TestRelationships < Test::Unit::TestCase assert_equal instance.Id, Axlsx::Relationship.new(source_obj, Axlsx::WORKSHEET_R, 'target').Id end - def test_instances_cache_is_thread_safe + def test_ids_cache_is_thread_safe cache1, cache2 = nil - t1 = Thread.new { cache1 = Axlsx::Relationship.instances } - t2 = Thread.new { cache2 = Axlsx::Relationship.instances } + t1 = Thread.new { cache1 = Axlsx::Relationship.ids_cache } + t2 = Thread.new { cache2 = Axlsx::Relationship.ids_cache } [t1, t2].each(&:join) assert_not_same(cache1, cache2) end |
