Sha256: b4abcad849d36a7449d214ffe30044b744f71302046c801b33005e89b20dbecc

Contents?: true

Size: 786 Bytes

Versions: 1

Compression:

Stored size: 786 Bytes

Contents

require 'grape'
require 'spec_helper'

describe Grape::Reload::DependencyMap do
  let!(:file_class_map) {
    {
        'file1' => {
            declared: ['::Class1'],
            used: [],
        },
        'file2' => {
            declared: ['::Class2'],
            used: ['::Class1','::Class3'],
        },
        'file3' => {
            declared: ['::Class3'],
            used: ['::Class2'],
        },
    }
  }
  let!(:dm) { Grape::Reload::DependencyMap.new([]) }

  it 'resolves dependent classes properly' do
    allow(dm).to receive(:map).and_return(file_class_map)
    # map = instance_double(Grape::Reload::DependencyMap)
    # allow(map).to receive(:map).and_return(file_class_map)

    expect(dm.dependent_classes('file1')).to include('::Class2','::Class3')
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
grape-reload-0.0.2 spec/grape/reload/dependency_map_spec.rb