Module: Fakes::ArgumentMatching
- Extended by:
- ArgumentMatching
- Included in:
- ArgumentMatching
- Defined in:
- lib/fakes/arg_matching/argument_matching.rb
Instance Method Summary collapse
- #any ⇒ Object
- #condition(&conditional_block) ⇒ Object
- #greater_than(value) ⇒ Object
- #in_range(range) ⇒ Object
- #nil ⇒ Object
- #not_nil ⇒ Object
- #regex(pattern) ⇒ Object
Instance Method Details
#any ⇒ Object
13 14 15 |
# File 'lib/fakes/arg_matching/argument_matching.rb', line 13 def any condition { |ignored| true } end |
#condition(&conditional_block) ⇒ Object
30 31 32 |
# File 'lib/fakes/arg_matching/argument_matching.rb', line 30 def condition(&conditional_block) return BlockArgMatcher.new(conditional_block) end |
#greater_than(value) ⇒ Object
17 18 19 |
# File 'lib/fakes/arg_matching/argument_matching.rb', line 17 def greater_than(value) condition { |number| number > value } end |
#in_range(range) ⇒ Object
22 23 24 |
# File 'lib/fakes/arg_matching/argument_matching.rb', line 22 def in_range(range) condition { |item| range === item } end |
#nil ⇒ Object
9 10 11 |
# File 'lib/fakes/arg_matching/argument_matching.rb', line 9 def nil condition { |item| item == nil } end |
#not_nil ⇒ Object
5 6 7 |
# File 'lib/fakes/arg_matching/argument_matching.rb', line 5 def not_nil condition { |item| item != nil } end |
#regex(pattern) ⇒ Object
26 27 28 |
# File 'lib/fakes/arg_matching/argument_matching.rb', line 26 def regex(pattern) condition { |string_argument| pattern =~ string_argument } end |