Class: MinitestToRspec::Input::Subprocessors::Klass
- Defined in:
- lib/minitest_to_rspec/input/subprocessors/klass.rb
Overview
Processes ‘s(:class, ..)` expressions.
Instance Method Summary collapse
-
#initialize(sexp, rails, mocha) ⇒ Klass
constructor
Takes ‘sexp`, a `:class` s-expression, and `rails`, a boolean indicating that `rspec-rails` conventions (like `:type` metadata) should be used.
- #process ⇒ Object
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
#initialize(sexp, rails, mocha) ⇒ Klass
Takes ‘sexp`, a `:class` s-expression, and `rails`, a boolean indicating that `rspec-rails` conventions (like `:type` metadata) should be used.
15 16 17 18 19 |
# File 'lib/minitest_to_rspec/input/subprocessors/klass.rb', line 15 def initialize(sexp, rails, mocha) super(rails, mocha) @exp = Model::Klass.new(sexp) sexp.clear end |
Instance Method Details
#process ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/minitest_to_rspec/input/subprocessors/klass.rb', line 21 def process sexp = head ebk = @exp.block if ebk.length > 1 sexp << block elsif ebk.length == 1 sexp << full_process(ebk[0]) end sexp end |