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



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

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



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

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