spec/acfs/global_spec.rb in acfs-0.43.2 vs spec/acfs/global_spec.rb in acfs-0.44.0

- old
+ new

@@ -70,6 +70,24 @@ expect(u2).to be_loaded end Acfs.run end end + + describe '#runner' do + it 'returns per-thread runner' do + runner1 = Thread.new { acfs.runner } .value + runner2 = Thread.new { acfs.runner } .value + + expect(runner1).to_not equal runner2 + end + + it 'uses configurated adapter' do + adapter = double :adapter + expect(Acfs::Configuration.current).to receive(:adapter).and_return(-> { adapter }) + + runner = Thread.new { acfs.runner }.value + + expect(runner.adapter).to equal adapter + end + end end