Class: Transpec::Syntax::Should::RecordBuilder
Instance Method Summary
collapse
build, #build, param_names
Instance Method Details
#new_syntax ⇒ Object
78
79
80
81
82
83
84
85
86
|
# File 'lib/transpec/syntax/should.rb', line 78
def new_syntax
syntax = if should.proc_subject?
'expect { }.'
else
'expect(obj).'
end
syntax << (should.positive? ? 'to' : negative_form_of_to)
end
|
#old_syntax ⇒ Object
67
68
69
70
71
72
73
74
75
76
|
# File 'lib/transpec/syntax/should.rb', line 67
def old_syntax
syntax = if should.proc_subject?
"#{should.name_of_subject_method_taking_block} { }.should"
else
'obj.should'
end
syntax << '_not' unless should.positive?
syntax
end
|