Sha256: 90e6f7a28f944272b7549601a0fd3bc9a045f94af1cc68514227d15870182eb0

Contents?: true

Size: 720 Bytes

Versions: 13

Compression:

Stored size: 720 Bytes

Contents

require 'spec_helper'

describe Locomotive::Steam::TemplateError do

  let(:message)   { 'Wrong syntax' }
  let(:file)      { 'template.liquid.haml' }
  let(:source)    { %w(a b c d e f g h i j k l m n o p q r s t u v w y z).join("\n") }
  let(:line)      { 10 }
  let(:backtrace) { 'Backtrace' }
  let(:error)     { described_class.new(message, file, source, line, backtrace) }

  describe '#code_lines' do

    subject { error.code_lines }

    it { is_expected.to eq [[5, 'e'], [6, 'f'], [7, 'g'], [8, 'h'], [9, 'i'], [10, 'j'], [11, 'k'], [12, 'l'], [13, 'm'], [14, 'n'], [15, 'o']] }

  end

  describe '#backtrace' do

    subject { error.original_backtrace }

    it { is_expected.to eq 'Backtrace' }

  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
locomotivecms_steam-1.8.0.alpha2 spec/unit/errors_spec.rb
locomotivecms_steam-1.8.0.alpha1 spec/unit/errors_spec.rb
locomotivecms_steam-1.7.1 spec/unit/errors_spec.rb
locomotivecms_steam-1.7.0 spec/unit/errors_spec.rb
locomotivecms_steam-1.6.1 spec/unit/errors_spec.rb
locomotivecms_steam-1.6.0 spec/unit/errors_spec.rb
locomotivecms_steam-1.6.0.rc1 spec/unit/errors_spec.rb
locomotivecms_steam-1.6.0.beta1 spec/unit/errors_spec.rb
locomotivecms_steam-1.5.3 spec/unit/errors_spec.rb
locomotivecms_steam-1.5.2 spec/unit/errors_spec.rb
locomotivecms_steam-1.5.1 spec/unit/errors_spec.rb
locomotivecms_steam-1.5.0 spec/unit/errors_spec.rb
locomotivecms_steam-1.5.0.rc1 spec/unit/errors_spec.rb