Class: MinitestToRspec::Input::Subprocessors::Call
- Defined in:
- lib/minitest_to_rspec/input/subprocessors/call.rb
Overview
Processes ‘s(:call, ..)` expressions.
Constant Summary collapse
- MOCHA_METHODS =
Mocha methods will only be processed if ‘–mocha` flag was given, i.e. `mocha` argument in constructor is true.
%i[ expects once returns stub stubs stub_everything twice ].freeze
Instance Method Summary collapse
-
#initialize(sexp, rails, mocha) ⇒ Call
constructor
A new instance of Call.
-
#process ⇒ Object
Given a ‘Model::Call`, returns a `Sexp`.
- #process? ⇒ Boolean
Methods inherited from Base
#allow_to, #expect, #expect_to, #expect_to_not, #expectation_target, #expectation_target_eager, #expectation_target_lazy, #full_process, #matcher
Methods included from SexpAssertions
#assert_sexp_type, #assert_sexp_type_array, #sexp_type?
Constructor Details
Instance Method Details
#process ⇒ Object
Given a ‘Model::Call`, returns a `Sexp`
35 36 37 38 39 40 41 |
# File 'lib/minitest_to_rspec/input/subprocessors/call.rb', line 35 def process if process? send(name_of_processing_method) else @exp.original end end |
#process? ⇒ Boolean
43 44 45 46 |
# File 'lib/minitest_to_rspec/input/subprocessors/call.rb', line 43 def process? respond_to?(name_of_processing_method, true) && (@mocha || !MOCHA_METHODS.include?(@exp.method_name)) end |