Sha256: f775347eeeb73bfb88301b57cac94f520e88927622419261f54f61e4b0bc4711

Contents?: true

Size: 987 Bytes

Versions: 7

Compression:

Stored size: 987 Bytes

Contents

#enconding: utf-8
require 'spec_helper'

describe "#generate_testdata" do

  it "spread the testdata when amount of data is lower than keywords" do
    data = generate_testdata(keywords: %w{a b c d}, raw_data: %w{data1 data2})
    expect(data[2]).to eq('a')
  end

  it "spread the testdata when amount of data is equal to the amount of the keywords" do
    data = generate_testdata(keywords: %w{a b c d}, raw_data: %w{data1 data2 data3 data4})
    expect(data[1]).to eq('a')
    expect(data[2]).to eq('data2')
  end

  it "spread the testdata when amount of data is larger than keywords" do
    data = generate_testdata(keywords: %w{a b c d}, raw_data: %w{data1 data2 data3 data4 data5})
    expect(data[1]).to eq('a')
  end

  it "spread the testdata when amount of data is not a multiply of keywords (it cares for the rest)" do
    data = generate_testdata(keywords: %w{a b c d}, raw_data: [ 'data' ] * 99 )
    expect(data[2]).to eq('data')
    expect(data[24]).to eq('a')
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
the_array_comparator-0.5.0 spec/testing_helper/testing_helper_spec.rb
the_array_comparator-0.4.0 spec/testing_helper/testing_helper_spec.rb
the_array_comparator-0.3.4 spec/testing_helper/testing_helper_spec.rb
the_array_comparator-0.3.1 spec/testing_helper/testing_helper_spec.rb
the_array_comparator-0.3.0 spec/testing_helper/testing_helper_spec.rb
the_array_comparator-0.2.0 spec/testing_helper/testing_helper_spec.rb
the_array_comparator-0.1.1 spec/testing_helper/testing_helper_spec.rb