Class: Transpec::Syntax::CurrentExample::RecordBuilder
Constant Summary
Constants included
from RSpecDSL
RSpecDSL::EXAMPLE_GROUP_METHODS, RSpecDSL::EXAMPLE_METHODS, RSpecDSL::HELPER_METHODS, RSpecDSL::HOOK_METHODS
Instance Method Summary
collapse
build, #build, param_names
Instance Method Details
#base_dsl ⇒ Object
92
93
94
95
96
|
# File 'lib/transpec/syntax/current_example.rb', line 92
def base_dsl
dsl = "#{current_example.block_method_name}"
dsl << '(:name)' if HELPER_METHODS.include?(current_example.block_method_name)
dsl
end
|
#new_syntax ⇒ Object
84
85
86
87
88
89
90
|
# File 'lib/transpec/syntax/current_example.rb', line 84
def new_syntax
if current_example.block_node
"#{base_dsl} { |example| example }"
else
'def helper_method RSpec.current_example; end'
end
end
|
#old_syntax ⇒ Object
76
77
78
79
80
81
82
|
# File 'lib/transpec/syntax/current_example.rb', line 76
def old_syntax
if current_example.block_node
"#{base_dsl} { example }"
else
'def helper_method example; end'
end
end
|