Module: Transpec::Syntax::Mixin::Examplish

Extended by:
ActiveSupport::Concern
Includes:
BlockOwner
Included in:
Example, Its
Defined in:
lib/transpec/syntax/mixin/examplish.rb

Instance Method Summary collapse

Methods included from BlockOwner

#block_base_indentation, #block_beginning_line, #block_body_line, #block_body_node, #block_body_range, #block_end_line, #block_has_body?, #convert_singleline_block_to_multiline!, #range_between_block_begin_and_body, #range_between_block_body_and_end

Instance Method Details

#block_nodeObject



13
14
15
# File 'lib/transpec/syntax/mixin/examplish.rb', line 13

def block_node
  parent_node.block_type? ? parent_node : nil
end

#insert_description!(description) ⇒ Object



17
18
19
20
# File 'lib/transpec/syntax/mixin/examplish.rb', line 17

def insert_description!(description)
  fail 'This example already has description' if description?
  insert_before(block_node.loc.begin, "'#{description}' ")
end