Class: RSpec::Bash::Mocks::Matchers::TestBy
- Inherits:
-
BaseMatcher
- Object
- BaseMatcher
- RSpec::Bash::Mocks::Matchers::TestBy
- Defined in:
- lib/rspec/bash/mocks/matchers/test_by.rb
Instance Attribute Summary
Attributes inherited from BaseMatcher
Instance Method Summary collapse
-
#initialize(expr) ⇒ TestBy
constructor
A new instance of TestBy.
- #with_args(args) ⇒ Object
Methods inherited from BaseMatcher
#and_always_return, #and_always_yield, #and_call_original, #and_return, #and_yield, #at_least, #at_most, #exactly, #matches?, #name, #never, #once, #setup_allowance, #thrice, #times, #twice
Constructor Details
#initialize(expr) ⇒ TestBy
Returns a new instance of TestBy.
10 11 12 13 14 15 |
# File 'lib/rspec/bash/mocks/matchers/test_by.rb', line 10 def initialize(expr) @double = Doubles::ConditionalDouble.new(expr) @display_name = "test_by" super() end |
Instance Method Details
#with_args(args) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/rspec/bash/mocks/matchers/test_by.rb', line 17 def with_args(args) tap { fullexpr = "#{@double.expr} #{args}" @double.expected_calls << fullexpr @double.behaviors << create_behavior(args: fullexpr) } end |