Class: Spanner::Translator::Rules::Translation::AddTestCase
- Inherits:
-
BaseRule
- Object
- Parser::AST::Processor
- BaseRule
- Spanner::Translator::Rules::Translation::AddTestCase
- Defined in:
- lib/spanner/translator/rules/translation/add_test_case.rb
Overview
replace ApplicationRecord with the configured class during translation of models
Constant Summary
Constants inherited from BaseRule
Instance Attribute Summary
Attributes inherited from BaseRule
Instance Method Summary collapse
Methods inherited from BaseRule
#any_index?, #capture_column_nullity, #capture_primary_key_argument, #capture_table_name, #conditionally_propagate_argument, #create_range, #initialize, #unless_seen
Constructor Details
This class inherits a constructor from Spanner::Translator::Rules::BaseRule
Instance Method Details
#on_block(node) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/spanner/translator/rules/translation/add_test_case.rb', line 15 def on_block(node) main_describe?(node) do # only rewrite the first time RSpec.describe is seen unless_seen(:insert_test_case) do if [:test_case] @rewriter.insert_before(node.loc.end, [:test_case]) else @rewriter.insert_before(node.loc.end, ' # i am here\n') end end end end |