Sha256: e108597703d0ce25ea9e356b79db17fbca9a01c771ece13ceef11ba85c48bccd

Contents?: true

Size: 467 Bytes

Versions: 8

Compression:

Stored size: 467 Bytes

Contents

require "spec_helper"

describe WildcardMatchers::Helpers::ForAll do
  [ [ %w[ a b c ], :for_all, String ],
    [ %w[ a b c ], :for_all, :is_a_string ],
    [ %w[ a b c ], :for_all, :is_a, String ],
  ].each do |actual, helper, matcher, *args|
    it_behaves_like "wildcard match with helper", actual, helper, matcher, *args
  end

  it "should match using lambda with helper" do
    expect([ 2, 4, 6]).to wildcard_match(for_all ->(item) { item % 2 == 0 })
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
wildcard_matchers-0.9.2 spec/wildcard_matchers/helpers/for_all_spec.rb
wildcard_matchers-0.9.1 spec/wildcard_matchers/helpers/for_all_spec.rb
wildcard_matchers-0.9.0 spec/wildcard_matchers/helpers/for_all_spec.rb
wildcard_matchers-0.4.0 spec/wildcard_matchers/helpers/for_all_spec.rb
wildcard_matchers-0.3.1 spec/wildcard_matchers/helpers/for_all_spec.rb
wildcard_matchers-0.3.0 spec/wildcard_matchers/helpers/for_all_spec.rb
wildcard_matchers-0.2.1 spec/wildcard_matchers/helpers/for_all_spec.rb
wildcard_matchers-0.2.0 spec/wildcard_matchers/helpers/for_all_spec.rb