Skip to content

Commit

Permalink
Remove unnecessary require 'spec_helper'
Browse files Browse the repository at this point in the history
  • Loading branch information
rranelli committed Feb 23, 2015
1 parent 6a5d9bc commit 3f71c7e
Show file tree
Hide file tree
Showing 66 changed files with 60 additions and 161 deletions.
2 changes: 2 additions & 0 deletions .rspec
@@ -0,0 +1,2 @@
--require spec_helper
--format progress
1 change: 0 additions & 1 deletion spec/concurrent/actor_spec.rb
@@ -1,4 +1,3 @@
require 'spec_helper'
require 'concurrent/actor'

module Concurrent
Expand Down
1 change: 0 additions & 1 deletion spec/concurrent/agent_spec.rb
@@ -1,4 +1,3 @@
require 'spec_helper'
require_relative 'dereferenceable_shared'
require_relative 'observable_shared'

Expand Down
2 changes: 0 additions & 2 deletions spec/concurrent/async_spec.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

module Concurrent

describe Async do
Expand Down
2 changes: 0 additions & 2 deletions spec/concurrent/atomic/atomic_boolean_spec.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

shared_examples :atomic_boolean do

describe 'construction' do
Expand Down
2 changes: 0 additions & 2 deletions spec/concurrent/atomic/atomic_fixnum_spec.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

shared_examples :atomic_fixnum do

context 'construction' do
Expand Down
2 changes: 0 additions & 2 deletions spec/concurrent/atomic/condition_spec.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

module Concurrent

describe Condition do
Expand Down
3 changes: 1 addition & 2 deletions spec/concurrent/atomic/copy_on_notify_observer_set_spec.rb
@@ -1,4 +1,3 @@
require 'spec_helper'
require_relative 'observer_set_shared'

module Concurrent
Expand All @@ -7,4 +6,4 @@ module Concurrent
it_behaves_like 'an observer set'
end

end
end
3 changes: 1 addition & 2 deletions spec/concurrent/atomic/copy_on_write_observer_set_spec.rb
@@ -1,4 +1,3 @@
require 'spec_helper'
require_relative 'observer_set_shared'

module Concurrent
Expand All @@ -7,4 +6,4 @@ module Concurrent
it_behaves_like 'an observer set'
end

end
end
2 changes: 0 additions & 2 deletions spec/concurrent/atomic/count_down_latch_spec.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

shared_examples :count_down_latch do

let(:latch) { described_class.new(3) }
Expand Down
2 changes: 0 additions & 2 deletions spec/concurrent/atomic/cyclic_barrier_spec.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

module Concurrent

describe CyclicBarrier do
Expand Down
2 changes: 0 additions & 2 deletions spec/concurrent/atomic/event_spec.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

module Concurrent

describe Event do
Expand Down
2 changes: 0 additions & 2 deletions spec/concurrent/atomic/observer_set_shared.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

shared_examples "an observer set" do

let (:observer_set) { described_class.new }
Expand Down
2 changes: 0 additions & 2 deletions spec/concurrent/atomic/semaphore_spec.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

shared_examples :semaphore do
let(:semaphore) { described_class.new(3) }

Expand Down
1 change: 0 additions & 1 deletion spec/concurrent/atomic/thread_local_var_spec.rb
@@ -1,4 +1,3 @@
require 'spec_helper'
require 'rbconfig'

module Concurrent
Expand Down
2 changes: 0 additions & 2 deletions spec/concurrent/atomic_spec.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

shared_examples :atomic do

specify :test_construct do
Expand Down
2 changes: 0 additions & 2 deletions spec/concurrent/channel/buffered_channel_spec.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

module Concurrent

describe BufferedChannel do
Expand Down
2 changes: 0 additions & 2 deletions spec/concurrent/channel/channel_spec.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

module Concurrent

describe Channel do
Expand Down
5 changes: 2 additions & 3 deletions spec/concurrent/channel/probe_spec.rb
@@ -1,4 +1,3 @@
require 'spec_helper'
require_relative '../observable_shared'

module Concurrent
Expand All @@ -11,9 +10,9 @@ module Concurrent
describe 'behavior' do

# observable

subject{ Channel::Probe.new }

def trigger_observable(observable)
observable.set('value')
end
Expand Down
2 changes: 0 additions & 2 deletions spec/concurrent/channel/unbuffered_channel_spec.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

module Concurrent

describe UnbufferedChannel do
Expand Down
2 changes: 0 additions & 2 deletions spec/concurrent/collection/blocking_ring_buffer_spec.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

module Concurrent

describe BlockingRingBuffer do
Expand Down
2 changes: 0 additions & 2 deletions spec/concurrent/collection/priority_queue_spec.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

shared_examples :priority_queue do

subject{ described_class.new }
Expand Down
2 changes: 0 additions & 2 deletions spec/concurrent/collection/ring_buffer_spec.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

module Concurrent

describe RingBuffer do
Expand Down
2 changes: 0 additions & 2 deletions spec/concurrent/configuration_spec.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

module Concurrent

describe Configuration do
Expand Down
4 changes: 1 addition & 3 deletions spec/concurrent/dataflow_spec.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

module Concurrent

describe 'dataflow' do
Expand Down Expand Up @@ -233,7 +231,7 @@ def fib_with_dot(n)
sleep(0.1)
expect(expected.value).to eq 13
end

end
end
end
1 change: 0 additions & 1 deletion spec/concurrent/delay_spec.rb
@@ -1,4 +1,3 @@
require 'spec_helper'
require_relative 'dereferenceable_shared'
require_relative 'obligation_shared'

Expand Down
2 changes: 0 additions & 2 deletions spec/concurrent/dereferenceable_shared.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

shared_examples :dereferenceable do

it 'defaults :dup_on_deref to false' do
Expand Down
2 changes: 0 additions & 2 deletions spec/concurrent/exchanger_spec.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

module Concurrent

describe Exchanger do
Expand Down
1 change: 0 additions & 1 deletion spec/concurrent/executor/cached_thread_pool_shared.rb
@@ -1,4 +1,3 @@
require 'spec_helper'
require_relative 'thread_pool_shared'

shared_examples :cached_thread_pool do
Expand Down
1 change: 0 additions & 1 deletion spec/concurrent/executor/executor_service_shared.rb
@@ -1,4 +1,3 @@
require 'spec_helper'
require_relative 'global_thread_pool_shared'

shared_examples :executor_service do
Expand Down
1 change: 0 additions & 1 deletion spec/concurrent/executor/fixed_thread_pool_shared.rb
@@ -1,4 +1,3 @@
require 'spec_helper'
require_relative 'thread_pool_shared'
require 'thread'

Expand Down
2 changes: 0 additions & 2 deletions spec/concurrent/executor/global_thread_pool_shared.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

shared_examples :global_thread_pool do

context '#post' do
Expand Down
1 change: 0 additions & 1 deletion spec/concurrent/executor/immediate_executor_spec.rb
@@ -1,4 +1,3 @@
require 'spec_helper'
require_relative 'executor_service_shared'

module Concurrent
Expand Down
@@ -1,4 +1,3 @@
require 'spec_helper'
require_relative 'executor_service_shared'

module Concurrent
Expand Down
2 changes: 0 additions & 2 deletions spec/concurrent/executor/java_cached_thread_pool_spec.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

if Concurrent::TestHelpers.jruby?

require_relative 'cached_thread_pool_shared'
Expand Down
2 changes: 0 additions & 2 deletions spec/concurrent/executor/java_fixed_thread_pool_spec.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

if Concurrent::TestHelpers.jruby?

require_relative 'fixed_thread_pool_shared'
Expand Down
2 changes: 0 additions & 2 deletions spec/concurrent/executor/java_single_thread_executor_spec.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

if Concurrent::TestHelpers.jruby?

require_relative 'executor_service_shared'
Expand Down
2 changes: 0 additions & 2 deletions spec/concurrent/executor/java_thread_pool_executor_spec.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

if Concurrent::TestHelpers.jruby?

require_relative 'thread_pool_executor_shared'
Expand Down
1 change: 0 additions & 1 deletion spec/concurrent/executor/per_thread_executor_spec.rb
@@ -1,4 +1,3 @@
require 'spec_helper'
require_relative 'executor_service_shared'

module Concurrent
Expand Down
1 change: 0 additions & 1 deletion spec/concurrent/executor/ruby_cached_thread_pool_spec.rb
@@ -1,4 +1,3 @@
require 'spec_helper'
require_relative 'cached_thread_pool_shared'

module Concurrent
Expand Down
1 change: 0 additions & 1 deletion spec/concurrent/executor/ruby_fixed_thread_pool_spec.rb
@@ -1,4 +1,3 @@
require 'spec_helper'
require_relative 'fixed_thread_pool_shared'

module Concurrent
Expand Down
@@ -1,4 +1,3 @@
require 'spec_helper'
require_relative 'executor_service_shared'

module Concurrent
Expand Down
1 change: 0 additions & 1 deletion spec/concurrent/executor/ruby_thread_pool_executor_spec.rb
@@ -1,4 +1,3 @@
require 'spec_helper'
require_relative 'thread_pool_executor_shared'

module Concurrent
Expand Down
2 changes: 0 additions & 2 deletions spec/concurrent/executor/safe_task_executor_spec.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

module Concurrent

describe SafeTaskExecutor do
Expand Down
1 change: 0 additions & 1 deletion spec/concurrent/executor/serialized_execution_spec.rb
@@ -1,4 +1,3 @@
require 'spec_helper'
require_relative 'executor_service_shared'

module Concurrent
Expand Down
2 changes: 0 additions & 2 deletions spec/concurrent/executor/thread_pool_class_cast_spec.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

module Concurrent

describe SingleThreadExecutor do
Expand Down
23 changes: 11 additions & 12 deletions spec/concurrent/executor/thread_pool_executor_shared.rb
@@ -1,4 +1,3 @@
require 'spec_helper'
require_relative 'thread_pool_shared'

shared_examples :thread_pool_executor do
Expand Down Expand Up @@ -174,7 +173,7 @@
expect(subject.remaining_capacity).to eq expected_max
end
end

context '#fallback_policy' do

let!(:min_threads){ 1 }
Expand Down Expand Up @@ -230,7 +229,7 @@
all_tasks_posted = Concurrent::Event.new

latch = Concurrent::CountDownLatch.new(max_threads)

initial_executed = Concurrent::AtomicFixnum.new(0)
subsequent_executed = Concurrent::AtomicFixnum.new(0)

Expand All @@ -243,7 +242,7 @@
# Wait for all those tasks to be taken off the queue onto a
# worker thread and start executing
latch.wait

# Fill up the queue (with a task that won't complete until
# all tasks are posted)
max_queue.times do
Expand Down Expand Up @@ -277,7 +276,7 @@
all_tasks_posted = Concurrent::Event.new

latch = Concurrent::CountDownLatch.new(max_threads)

initial_executed = Concurrent::AtomicFixnum.new(0)
subsequent_executed = Concurrent::AtomicFixnum.new(0)

Expand All @@ -290,7 +289,7 @@
# Wait for all those tasks to be taken off the queue onto a
# worker thread and start executing
latch.wait

# Fill up the queue (with a task that won't complete until
# all tasks are posted)
max_queue.times do
Expand Down Expand Up @@ -320,7 +319,7 @@
expect(subsequent_executed.value).to be 0
end
end

context ':discard' do

subject do
Expand All @@ -337,7 +336,7 @@
all_tasks_posted = Concurrent::Event.new

latch = Concurrent::CountDownLatch.new(max_threads)

initial_executed = Concurrent::AtomicFixnum.new(0)
subsequent_executed = Concurrent::AtomicFixnum.new(0)

Expand All @@ -350,7 +349,7 @@
# Wait for all those tasks to be taken off the queue onto a
# worker thread and start executing
latch.wait

# Fill up the queue (with a task that won't complete until
# all tasks are posted)
max_queue.times do
Expand Down Expand Up @@ -382,7 +381,7 @@
all_tasks_posted = Concurrent::Event.new

latch = Concurrent::CountDownLatch.new(max_threads)

initial_executed = Concurrent::AtomicFixnum.new(0)
subsequent_executed = Concurrent::AtomicFixnum.new(0)

Expand All @@ -395,7 +394,7 @@
# Wait for all those tasks to be taken off the queue onto a
# worker thread and start executing
latch.wait

# Fill up the queue (with a task that won't complete until
# all tasks are posted)
max_queue.times do
Expand Down Expand Up @@ -475,7 +474,7 @@
Thread.new do
5.times{ subject.post{ trigger.wait } }
end

expect(Thread.list.length).to be < initial + 1 + 5

# Let the executor tasks complete.
Expand Down
1 change: 0 additions & 1 deletion spec/concurrent/executor/thread_pool_shared.rb
@@ -1,4 +1,3 @@
require 'spec_helper'
require_relative 'executor_service_shared'

shared_examples :thread_pool do
Expand Down

0 comments on commit 3f71c7e

Please sign in to comment.