Sha256: 98552eaf2152c09f4eba305eddfb04cbf50f95b3aed39f237ba328dd2e92a660

Contents?: true

Size: 653 Bytes

Versions: 5

Compression:

Stored size: 653 Bytes

Contents

# @!method include_regexp(regexp)
#   This matchers checks if items of an <array> matches regexp
#
#   @param [Regexp] regexp
#     The regular expression to use
#
#   @return [TrueClass, FalseClass] The result
#
#     false:
#     * if regexp does not match
#     true:
#     * if regexp matches
#
#   @example Use matcher
#
#     RSpec.describe do
#       it { expect(%w(asdf qwert)).to include_regexp(/asdf/) }
#     end
RSpec::Matchers.define :include_regexp do |expected|
  match do |actual|
    Aruba::Platform.deprecated('The use of "include_regexp"-matchers is deprecated. It will be removed soon.')

    !actual.grep(expected).empty?
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
aruba-0.8.1 lib/aruba/matchers/rspec_matcher_include_regexp.rb
aruba-0.8.0 lib/aruba/matchers/rspec_matcher_include_regexp.rb
aruba-0.8.0.pre3 lib/aruba/matchers/rspec_matcher_include_regexp.rb
aruba-0.8.0.pre2 lib/aruba/matchers/rspec_matcher_include_regexp.rb
aruba-0.8.0.pre lib/aruba/matchers/rspec_matcher_include_regexp.rb