Sha256: eb2e4591d087440ce97f9e880fc0d91ef175a552a1195079fc89133fc93b722e

Contents?: true

Size: 1.58 KB

Versions: 1

Compression:

Stored size: 1.58 KB

Contents

require 'spec_helper'

module MongoProfiler
  describe Caller do
    subject { described_class.new(_caller) }

    let(:_caller) {
      [
        "/Users/pablo/workspace/project/test.rb:7:in `new'",
        "/Users/pablo/.gem/ruby/2.0.0/gems/rspec-core-2.14.4/lib/rspec/core/memoized_helpers.rb:199:in `block (2 levels) in let'",
        "/Users/pablo/.gem/ruby/2.0.0/gems/rspec-core-2.14.4/lib/rspec/core/memoized_helpers.rb:199:in `fetch'",
        "/Users/pablo/.gem/ruby/2.0.0/gems/rspec-core-2.14.4/lib/rspec/core/memoized_helpers.rb:199:in `block in let'"
      ]
    }

    its(:file)    { should end_with('project/test.rb') }
    its(:line)    { should eq 7 }
    its(:method)  { should eq 'new' }
    its(:_caller) { should eq _caller }

    context 'when backtrace starts with bundle or gem' do
      let(:_caller) {
        [
          "/Users/pablo/.gem/ruby/2.0.0/gems/rspec-core-2.14.4/lib/rspec/core/memoized_helpers.rb:199:in `block (2 levels) in let'",
          "/Users/pablo/bundle/ruby/2.0.0/gems/rspec-core-2.14.4/lib/rspec/core/memoized_helpers.rb:199:in `block (2 levels) in let'",
          "/Users/pablo/workspace/project/test.rb:7:in `new'",
          "/Users/pablo/.gem/ruby/2.0.0/gems/rspec-core-2.14.4/lib/rspec/core/memoized_helpers.rb:199:in `fetch'",
          "/Users/pablo/.gem/ruby/2.0.0/gems/rspec-core-2.14.4/lib/rspec/core/memoized_helpers.rb:199:in `block in let'"
        ]
      }

      its(:file)    { should end_with('project/test.rb') }
      its(:line)    { should eq 7 }
      its(:method)  { should eq 'new' }
      its(:_caller) { should eq _caller }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mongo_profiler-0.0.2 spec/mongo_profiler/caller_spec.rb