Module: RSpec::Matchers
- Defined in:
- lib/rspec/change_to_now/detect.rb,
lib/rspec/change_to_now/negate.rb,
lib/rspec/change_to_now.rb
Defined Under Namespace
Instance Method Summary collapse
-
#detect(*expected, &block) ⇒ Object
If given a block, passes if the block returns a truthy value for any of the actual items or for the key-value pair is the actual item list is a hash.
-
#negate(matcher) ⇒ Object
Passes if provided
matcher
fails and vice-versa.
Instance Method Details
#detect(*expected, &block) ⇒ Object
If given a block, passes if the block returns a truthy value for any of the actual items or for the key-value pair is the actual item list is a hash. Without a block, it behaves identically to include
. expected
must be empty if a block is provided.
84 85 86 87 88 |
# File 'lib/rspec/change_to_now/detect.rb', line 84 def detect(*expected, &block) AliasedMatcher.new(Detect.new(*expected, &block), lambda do |old_desc| old_desc.gsub(Pretty.split_words('include'), Pretty.split_words('detect')) end) end |