Sha256: 68489ef3b818f5cf08f6c393c7ead88941898818d8713555834f4e7fb92f8996

Contents?: true

Size: 840 Bytes

Versions: 6

Compression:

Stored size: 840 Bytes

Contents

require 'hovercraft/caller'

describe Hovercraft::Caller do
  describe '#directory' do
    before { subject.stub(caller_file: '/gems/futurama/parallel_universe_box.rb:10 in `universe`') }

    it 'returns the directory of the file at the top of the execution stack' do
      subject.directory.should == '/gems/futurama'
    end
  end

  describe '#cleaned_caller_files' do
    let(:files) do
      [
        '/gems/futurama/parallel_universe_box.rb:10 in `universe`',
        '/gems/futurama/parallel_universe_box.rb:3 in `initialize`',
        '<internal: (irb)'
      ]
    end

    before { subject.stub(caller: files) }

    it 'returns a cleaned list of files on the execution stack' do
      subject.cleaned_caller_files.should_not include('<internal: (irb)')
      subject.cleaned_caller_files.should have(2).files
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
hovercraft-0.2.1 spec/hovercraft/caller_spec.rb
hovercraft-0.2.0 spec/hovercraft/caller_spec.rb
hovercraft-0.1.1 spec/hovercraft/caller_spec.rb
hovercraft-0.1.0 spec/hovercraft/caller_spec.rb
hovercraft-0.0.2 spec/hovercraft/caller_spec.rb
hovercraft-0.0.1 spec/hovercraft/caller_spec.rb