ruby-concurrency/concurrent-ruby — pull request #128 by jdantonio (2014-06-26 16:39:17+00:00)
Title: Upgrade to RSpec 3.0

## DO NOT MERGE

This branch represents my attempt to upgrade us to RSpec 3.0. We now have almost 30 failing tests.

I followed the [step-by-step Instructions](https://relishapp.com/rspec/docs/upgrade) verbatim and used the [transpec](https://github.com/yujinakayama/transpec) tool as directed. I ran everything under `ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]` on my MacBook Pro. The test suite was green at the start. Now I get numerous failed tests when running `bundle exec rspec -fd --color --seed 1`. None of our [intermittently failing specs](https://github.com/ruby-concurrency/concurrent-ruby/issues/117) are amongst the current set of failing tests. All the failing tests are in two files:

* spec/concurrent/obligation_spec.rb
* spec/concurrent/actress_spec.rb

I'll work on these specific tests later then report the issues to the RSpec team. The full output of the test run is below.

## RSpec Output

> Failures:
>
> 1) Concurrent::Obligation pending it should behave like incomplete #value should return immediately if timeout is zero
> Failure/Error: expect(obligation.send(method, 0)).to(method eq(:no_error!) ? eq(obligation) : be_nil)
> TypeError:
> #:0x007fcb5acebaf8 @mutex=#, @state=:pending>> is not a symbol
> Shared Example Group: "incomplete" called from ./spec/concurrent/obligation_spec.rb:67
> # ./spec/concurrent/obligation_spec.rb:39:in `method'
> # ./spec/concurrent/obligation_spec.rb:39:in `block (5 levels) in '
>
> 2) Concurrent::Obligation pending it should behave like incomplete #no_error! should return immediately if timeout is zero
> Failure/Error: expect(obligation.send(method, 0)).to(method eq(:no_error!) ? eq(obligation) : be_nil)
> TypeError:
> #:0x007fcb5ad13530 @mutex=#, @state=:pending>> is not a symbol
> Shared Example Group: "incomplete" called from ./spec/concurrent/obligation_spec.rb:67
> # ./spec/concurrent/obligation_spec.rb:39:in `method'
> # ./spec/concurrent/obligation_spec.rb:39:in `block (5 levels) in '
>
> 3) Concurrent::Obligation pending it should behave like incomplete #value! should return immediately if timeout is zero
> Failure/Error: expect(obligation.send(method, 0)).to(method eq(:no_error!) ? eq(obligation) : be_nil)
> TypeError:
> #:0x007fcb5ad3a720 @mutex=#, @state=:pending>> is not a symbol
> Shared Example Group: "incomplete" called from ./spec/concurrent/obligation_spec.rb:67
> # ./spec/concurrent/obligation_spec.rb:39:in `method'
> # ./spec/concurrent/obligation_spec.rb:39:in `block (5 levels) in '
>
> 4) Concurrent::Obligation unscheduled it should behave like incomplete #value should return immediately if timeout is zero
> Failure/Error: expect(obligation.send(method, 0)).to(method eq(:no_error!) ? eq(obligation) : be_nil)
> TypeError:
> #:0x007fcb5adc5e60 @mutex=#, @state=:unscheduled>> is not a symbol
> Shared Example Group: "incomplete" called from ./spec/concurrent/obligation_spec.rb:62
> # ./spec/concurrent/obligation_spec.rb:39:in `method'
> # ./spec/concurrent/obligation_spec.rb:39:in `block (5 levels) in '
>
> 5) Concurrent::Obligation unscheduled it should behave like incomplete #no_error! should return immediately if timeout is zero
> Failure/Error: expect(obligation.send(method, 0)).to(method eq(:no_error!) ? eq(obligation) : be_nil)
> TypeError:
> #:0x007fcb5ae262b0 @mutex=#, @state=:unscheduled>> is not a symbol
> Shared Example Group: "incomplete" called from ./spec/concurrent/obligation_spec.rb:62
> # ./spec/concurrent/obligation_spec.rb:39:in `method'
> # ./spec/concurrent/obligation_spec.rb:39:in `block (5 levels) in '
>
> 6) Concurrent::Obligation unscheduled it should behave like incomplete #value! should return immediately if timeout is zero
> Failure/Error: expect(obligation.send(method, 0)).to(method eq(:no_error!) ? eq(obligation) : be_nil)
> TypeError:
> #:0x007fcb5ae64448 @mutex=#, @state=:unscheduled>> is not a symbol
> Shared Example Group: "incomplete" called from ./spec/concurrent/obligation_spec.rb:62
> # ./spec/concurrent/obligation_spec.rb:39:in `method'
> # ./spec/concurrent/obligation_spec.rb:39:in `block (5 levels) in '
>
> 7) Concurrent::Actress spawning Actress#spawn context_spawn_by_hash #name should eq "ping"
> Failure/Error: actor.backdoor { terminate! }
> NoMethodError:
> undefined method `backdoor' for "ping":String
> # ./spec/concurrent/actress_spec.rb:23:in `block in terminate_actors'
> # ./spec/concurrent/actress_spec.rb:22:in `each'
> # ./spec/concurrent/actress_spec.rb:22:in `terminate_actors'
> # ./spec/concurrent/actress_spec.rb:106:in `block (6 levels) in '
>
> 8) Concurrent::Actress spawning Actress#spawn context_spawn_by_hash #path should eq "/ping"
> Failure/Error: actor.backdoor { terminate! }
> NoMethodError:
> undefined method `backdoor' for "/ping":String
> # ./spec/concurrent/actress_spec.rb:23:in `block in terminate_actors'
> # ./spec/concurrent/actress_spec.rb:22:in `each'
> # ./spec/concurrent/actress_spec.rb:22:in `terminate_actors'
> # ./spec/concurrent/actress_spec.rb:106:in `block (6 levels) in '
>
> 9) Concurrent::Actress spawning Actress#spawn spawn_by_hash executor should be global
> Failure/Error: it('executor should be global') { expect(subject.executor).to eq Concurrent.configuration.global_task_pool }
> NoMethodError:
> undefined method `executor' for nil:NilClass
> # ./spec/concurrent/actress_spec.rb:122:in `block (6 levels) in '
>
> 10) Concurrent::Actress spawning Actress#spawn spawn_by_hash returns arg
> Failure/Error: expect(subject.ask!(:anything)).to eq 'arg'
> NoMethodError:
> undefined method `ask!' for nil:NilClass
> # ./spec/concurrent/actress_spec.rb:129:in `block (6 levels) in '
>
> 11) Concurrent::Actress spawning Actress#spawn spawn_by_hash #reference
> Failure/Error: subject { super().reference }
> NoMethodError:
> undefined method `reference' for nil:NilClass
> # ./spec/concurrent/actress_spec.rb:125:in `block (7 levels) in '
> # ./spec/concurrent/actress_spec.rb:126:in `block (7 levels) in '
>
> 12) Concurrent::Actress spawning Actress#spawn spawn_by_hash #name
> Failure/Error: subject { super().name }
> NoMethodError:
> undefined method `name' for nil:NilClass
> # ./spec/concurrent/actress_spec.rb:119:in `block (7 levels) in '
> # ./spec/concurrent/actress_spec.rb:120:in `block (7 levels) in '
>
> 13) Concurrent::Actress spawning Actress#spawn spawn_by_hash #path
> Failure/Error: subject { super().path }
> NoMethodError:
> undefined method `path' for nil:NilClass
> # ./spec/concurrent/actress_spec.rb:109:in `block (7 levels) in '
> # ./spec/concurrent/actress_spec.rb:110:in `block (7 levels) in '
>
> 14) Concurrent::Actress spawning Actress#spawn spawn executor should be global
> Failure/Error: it('executor should be global') { expect(subject.executor).to eq Concurrent.configuration.global_task_pool }
> NoMethodError:
> undefined method `executor' for nil:NilClass
> # ./spec/concurrent/actress_spec.rb:122:in `block (6 levels) in '
>
> 15) Concurrent::Actress spawning Actress#spawn spawn returns arg
> Failure/Error: expect(subject.ask!(:anything)).to eq 'arg'
> NoMethodError:
> undefined method `ask!' for nil:NilClass
> # ./spec/concurrent/actress_spec.rb:129:in `block (6 levels) in '
>
> 16) Concurrent::Actress spawning Actress#spawn spawn #reference
> Failure/Error: subject { super().reference }
> NoMethodError:
> undefined method `reference' for nil:NilClass
> # ./spec/concurrent/actress_spec.rb:125:in `block (7 levels) in '
> # ./spec/concurrent/actress_spec.rb:126:in `block (7 levels) in '
>
> 17) Concurrent::Actress spawning Actress#spawn spawn #name
> Failure/Error: subject { super().name }
> NoMethodError:
> undefined method `name' for nil:NilClass
> # ./spec/concurrent/actress_spec.rb:119:in `block (7 levels) in '
> # ./spec/concurrent/actress_spec.rb:120:in `block (7 levels) in '
>
> 18) Concurrent::Actress spawning Actress#spawn spawn #path
> Failure/Error: subject { super().path }
> NoMethodError:
> undefined method `path' for nil:NilClass
> # ./spec/concurrent/actress_spec.rb:109:in `block (7 levels) in '
> # ./spec/concurrent/actress_spec.rb:110:in `block (7 levels) in '
>
> 19) Concurrent::Actress spawning Actress#spawn context_spawn executor should be global
> Failure/Error: it('executor should be global') { expect(subject.executor).to eq Concurrent.configuration.global_task_pool }
> NoMethodError:
> undefined method `executor' for nil:NilClass
> # ./spec/concurrent/actress_spec.rb:122:in `block (6 levels) in '
>
> 20) Concurrent::Actress spawning Actress#spawn context_spawn returns arg
> Failure/Error: expect(subject.ask!(:anything)).to eq 'arg'
> NoMethodError:
> undefined method `ask!' for nil:NilClass
> # ./spec/concurrent/actress_spec.rb:129:in `block (6 levels) in '
>
> 21) Concurrent::Actress spawning Actress#spawn context_spawn #reference
> Failure/Error: subject { super().reference }
> NoMethodError:
> undefined method `reference' for nil:NilClass
> # ./spec/concurrent/actress_spec.rb:125:in `block (7 levels) in '
> # ./spec/concurrent/actress_spec.rb:126:in `block (7 levels) in '
>
> 22) Concurrent::Actress spawning Actress#spawn context_spawn #name
> Failure/Error: subject { super().name }
> NoMethodError:
> undefined method `name' for nil:NilClass
> # ./spec/concurrent/actress_spec.rb:119:in `block (7 levels) in '
> # ./spec/concurrent/actress_spec.rb:120:in `block (7 levels) in '
>
> 23) Concurrent::Actress spawning Actress#spawn context_spawn #path
> Failure/Error: subject { super().path }
> NoMethodError:
> undefined method `path' for nil:NilClass
> # ./spec/concurrent/actress_spec.rb:109:in `block (7 levels) in '
> # ./spec/concurrent/actress_spec.rb:110:in `block (7 levels) in '
>
> 24) Concurrent::Actress envelope
> Failure/Error: envelope = subject.ask!('a')
> NoMethodError:
> undefined method `ask!' for nil:NilClass
> # ./spec/concurrent/actress_spec.rb:189:in `block (3 levels) in '
>
> 25) Concurrent::Actress stress test run 0
> Failure/Error: expect(Concurrent::Actress.root.send(:core).instance_variable_get(:@children)).to include(actor)
> expected # to include nil
> Diff:
> @@ -1,2 +1,2 @@
> -[nil]
> +[]
>
> # ./spec/concurrent/actress_spec.rb:70:in `block (7 levels) in '
> # ./spec/concurrent/actress_spec.rb:64:in `times'
> # ./spec/concurrent/actress_spec.rb:64:in `block (6 levels) in '
>
> 26) Concurrent::Actress children has children set after a child is created
> Failure/Error: child = parent.ask!(:child)
> NoMethodError:
> undefined method `ask!' for nil:NilClass
> # ./spec/concurrent/actress_spec.rb:178:in `block (3 levels) in '
>
> 27) Concurrent::Actress termination terminates with all its children
> Failure/Error: child = subject.ask! :child
> NoMethodError:
> undefined method `ask!' for nil:NilClass
> # ./spec/concurrent/actress_spec.rb:214:in `block (3 levels) in '
>
> Deprecation Warnings:
>
> RSpec::Core::Configuration#treat_symbols_as_metadata_keys_with_true_values= is deprecated, it is now set to true as default and setting it to false has no effect.
>
>
> If you need more of the backtrace for any of these deprecations to
> identify where to make the necessary changes, you can configure
> `config.raise_errors_for_deprecations!`, and it will turn the
> deprecation warnings into errors, giving you the full backtrace.
>
> 1 deprecation warning total
>
> Finished in 2 minutes 41.5 seconds (files took 0.49893 seconds to load)
> 1310 examples, 27 failures, 5 pending
>
> Failed examples:
>
> rspec ./spec/concurrent/obligation_spec.rb:38 # Concurrent::Obligation pending it should behave like incomplete #value should return immediately if timeout is zero
> rspec ./spec/concurrent/obligation_spec.rb:38 # Concurrent::Obligation pending it should behave like incomplete #no_error! should return immediately if timeout is zero
> rspec ./spec/concurrent/obligation_spec.rb:38 # Concurrent::Obligation pending it should behave like incomplete #value! should return immediately if timeout is zero
> rspec ./spec/concurrent/obligation_spec.rb:38 # Concurrent::Obligation unscheduled it should behave like incomplete #value should return immediately if timeout is zero
> rspec ./spec/concurrent/obligation_spec.rb:38 # Concurrent::Obligation unscheduled it should behave like incomplete #no_error! should return immediately if timeout is zero
> rspec ./spec/concurrent/obligation_spec.rb:38 # Concurrent::Obligation unscheduled it should behave like incomplete #value! should return immediately if timeout is zero
> rspec ./spec/concurrent/actress_spec.rb:120 # Concurrent::Actress spawning Actress#spawn context_spawn_by_hash #name should eq "ping"
> rspec ./spec/concurrent/actress_spec.rb:110 # Concurrent::Actress spawning Actress#spawn context_spawn_by_hash #path should eq "/ping"
> rspec ./spec/concurrent/actress_spec.rb:122 # Concurrent::Actress spawning Actress#spawn spawn_by_hash executor should be global
> rspec ./spec/concurrent/actress_spec.rb:128 # Concurrent::Actress spawning Actress#spawn spawn_by_hash returns arg
> rspec ./spec/concurrent/actress_spec.rb:126 # Concurrent::Actress spawning Actress#spawn spawn_by_hash #reference
> rspec ./spec/concurrent/actress_spec.rb:120 # Concurrent::Actress spawning Actress#spawn spawn_by_hash #name
> rspec ./spec/concurrent/actress_spec.rb:110 # Concurrent::Actress spawning Actress#spawn spawn_by_hash #path
> rspec ./spec/concurrent/actress_spec.rb:122 # Concurrent::Actress spawning Actress#spawn spawn executor should be global
> rspec ./spec/concurrent/actress_spec.rb:128 # Concurrent::Actress spawning Actress#spawn spawn returns arg
> rspec ./spec/concurrent/actress_spec.rb:126 # Concurrent::Actress spawning Actress#spawn spawn #reference
> rspec ./spec/concurrent/actress_spec.rb:120 # Concurrent::Actress spawning Actress#spawn spawn #name
> rspec ./spec/concurrent/actress_spec.rb:110 # Concurrent::Actress spawning Actress#spawn spawn #path
> rspec ./spec/concurrent/actress_spec.rb:122 # Concurrent::Actress spawning Actress#spawn context_spawn executor should be global
> rspec ./spec/concurrent/actress_spec.rb:128 # Concurrent::Actress spawning Actress#spawn context_spawn returns arg
> rspec ./spec/concurrent/actress_spec.rb:126 # Concurrent::Actress spawning Actress#spawn context_spawn #reference
> rspec ./spec/concurrent/actress_spec.rb:120 # Concurrent::Actress spawning Actress#spawn context_spawn #name
> rspec ./spec/concurrent/actress_spec.rb:110 # Concurrent::Actress spawning Actress#spawn context_spawn #path
> rspec ./spec/concurrent/actress_spec.rb:188 # Concurrent::Actress envelope
> rspec ./spec/concurrent/actress_spec.rb:60 # Concurrent::Actress stress test run 0
> rspec ./spec/concurrent/actress_spec.rb:177 # Concurrent::Actress children has children set after a child is created
> rspec ./spec/concurrent/actress_spec.rb:213 # Concurrent::Actress termination terminates with all its children
>
> Randomized with seed 1