Sha256: e898ca27288c19ecc4364240705ec0149ee04b63e5cc7337660ba8e093021ba2

Contents?: true

Size: 1.01 KB

Versions: 5

Compression:

Stored size: 1.01 KB

Contents

#enconding: utf-8
require 'spec_helper'
require 'strategies_helper'

describe SearchingStrategies::ContainsNotWithSubstringSearch do
  let(:data) { %w{ ab c e } }
  let(:exceptions) { %w{ a } }
  let(:keywords_overlap) { %w{ ab } }
  let(:keywords_no_overlap) { %w{ d } }

  it "is successfull when there's a no overlap" do
    sample = SampleDouble.new(data,keywords_no_overlap)
    comparator = SearchingStrategies::ContainsNotWithSubstringSearch.new(sample)
    expect(comparator.success?).to eq(true)
  end

  it "doesn't find something if there's an overlap" do
    sample = SampleDouble.new(data,keywords_overlap)
    comparator = SearchingStrategies::ContainsNotWithSubstringSearch.new(sample)
    expect(comparator.success?).to eq(false)
  end

  it "is successfull although there's an overlap, but an exception defined" do
    sample = SampleDouble.new(data,keywords_overlap, exceptions)
    comparator = SearchingStrategies::ContainsNotWithSubstringSearch.new(sample)
    expect(comparator.success?).to eq(true)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
the_array_comparator-0.5.0 spec/comparator/contains_not_with_substring_search_spec.rb
the_array_comparator-0.4.0 spec/comparator/contains_not_with_substring_search_spec.rb
the_array_comparator-0.3.4 spec/comparator/contains_not_with_substring_search_spec.rb
the_array_comparator-0.3.1 spec/comparator/contains_not_with_substring_search_spec.rb
the_array_comparator-0.3.0 spec/comparator/contains_not_with_substring_search_spec.rb