fix rspec ruby 1.8.7 compatibility

Add ()s with usage of #eq matcher and arrays to resolve this warning:

     Failure/Error: expect(cores).to eq (0 .. 15).to_a
     NoMethodError:
       undefined method `matches?' for [#<RSpec::Matchers::BuiltIn::Eq:0x2aaaace056b0 @expected=0..15>]:Array
remove some intermediate variable assignments from rspec

To improve clarity and code compactness.