Class: Transpec::Syntax::Its::RecordBuilder

Inherits:
RecordBuilder show all
Defined in:
lib/transpec/syntax/its.rb

Instance Method Summary collapse

Methods inherited from RecordBuilder

build, #build, param_names

Instance Method Details

#new_syntaxObject



195
196
197
198
199
200
201
# File 'lib/transpec/syntax/its.rb', line 195

def new_syntax
  if its.attribute_expression.brackets?
    "describe '[:key]' do subject { super()[:key] }; it { } end"
  else
    "describe '#attr' do subject { super().attr }; it { } end"
  end
end

#old_syntaxObject



187
188
189
190
191
192
193
# File 'lib/transpec/syntax/its.rb', line 187

def old_syntax
  if its.attribute_expression.brackets?
    'its([:key]) { }'
  else
    'its(:attr) { }'
  end
end