Sha256: fed1000c373af0b61b266c6ef25460b85a14a7790237abacb74ae735c4e9616c

Contents?: true

Size: 1.19 KB

Versions: 2

Compression:

Stored size: 1.19 KB

Contents

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

describe Strategies::IsNotEqual do
  let(:data) { %w{ a } }
  let(:keywords_overlap) { %w{ a } }
  let(:keywords_no_overlap) { %w{ d } }

  it "is successfull if keywords are empty" do
    sample = SampleDouble.new(data,[])
    comparator = Strategies::IsNotEqual.new(sample)
    expect(comparator.success?).to eq(true)
  end

  it "is successfull if data is empty" do
    sample = SampleDouble.new([],keywords_no_overlap)
    comparator = Strategies::IsNotEqual.new(sample)
    expect(comparator.success?).to eq(true)
  end

  it "fails if both keywords and data are empty" do
    sample = SampleDouble.new([],[])
    comparator = Strategies::IsNotEqual.new(sample)
    expect(comparator.success?).to eq(false)
  end

  it "fails if data and keywords are equal" do
    sample = SampleDouble.new(data,keywords_overlap)
    comparator = Strategies::IsNotEqual.new(sample)
    expect(comparator.success?).to eq(false)
  end

  it "is successfull if data and keywords are different" do
    sample = SampleDouble.new(data,keywords_no_overlap)
    comparator = Strategies::IsNotEqual.new(sample)
    expect(comparator.success?).to eq(true)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
the_array_comparator-0.2.0 spec/comparator/is_not_equal_spec.rb
the_array_comparator-0.1.1 spec/comparator/is_not_equal_spec.rb