Sha256: 4e7e2d9ef35e420301496b84536215beaa1d91a99eb2b6dba90eec3bfc0cd90e

Contents?: true

Size: 593 Bytes

Versions: 20

Compression:

Stored size: 593 Bytes

Contents

require 'spec_helper'
require 'tempfile'
require 'rollbar/item/backtrace'

describe Rollbar::Item::Backtrace do
  describe '#get_file_lines' do
    subject { described_class.new(exception) }

    let(:exception) { Exception.new }
    let(:file) { Tempfile.new('foo') }

    before do
      File.open(file.path, 'w') do |f|
        f << "foo\nbar"
      end
    end

    it 'returns the lines of the file' do
      lines = subject.get_file_lines(file.path)

      expect(lines.size).to be_eql(2)
      expect(lines[0]).to be_eql('foo')
      expect(lines[1]).to be_eql('bar')
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
rollbar-2.18.2 spec/rollbar/item/backtrace_spec.rb
rollbar-2.18.0 spec/rollbar/item/backtrace_spec.rb
rollbar-2.17.0 spec/rollbar/item/backtrace_spec.rb
rollbar-2.16.4 spec/rollbar/item/backtrace_spec.rb
rollbar-2.16.3 spec/rollbar/item/backtrace_spec.rb
rollbar-2.16.2 spec/rollbar/item/backtrace_spec.rb
rollbar-2.16.0 spec/rollbar/item/backtrace_spec.rb
rollbar-2.15.6 spec/rollbar/item/backtrace_spec.rb
rollbar-2.15.5 spec/rollbar/item/backtrace_spec.rb
rollbar-2.15.4 spec/rollbar/item/backtrace_spec.rb
rollbar-2.15.3 spec/rollbar/item/backtrace_spec.rb
rollbar-2.15.2 spec/rollbar/item/backtrace_spec.rb
rollbar-2.15.1 spec/rollbar/item/backtrace_spec.rb
rollbar-2.15.0 spec/rollbar/item/backtrace_spec.rb
rollbar-2.14.1 spec/rollbar/item/backtrace_spec.rb
rollbar-2.14.0 spec/rollbar/item/backtrace_spec.rb
rollbar-2.13.3 spec/rollbar/item/backtrace_spec.rb
rollbar-2.13.2 spec/rollbar/item/backtrace_spec.rb
rollbar-2.13.1 spec/rollbar/item/backtrace_spec.rb
rollbar-2.13.0 spec/rollbar/item/backtrace_spec.rb