Sha256: e979654bde7f2e41672e8c298bd85169058d1e634a669ae6e37177cdb4de8935

Contents?: true

Size: 457 Bytes

Versions: 1

Compression:

Stored size: 457 Bytes

Contents

require 'spec_helper'
require 'parallel'

include ParallelHelper
describe ParallelHelper do
  let(:data) { (1..20).to_a }
  context "parallel map" do
    it "should return as a normal map" do
      p_map(data){|e| e**2 }.should == data.map{|e| e**2 }
    end
  end
  context "parallel map with index" do
    it "should return as a normal map with index" do
      p_map_with_index(data){|e,i| e*i }.should == data.map.with_index{|e,i| e*i }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
svm_helper-0.2.1 spec/svm_helper/parallel_helper_spec.rb