Sha256: 68ca6c2df6e225a2d1139d4eb2ffbb4ff8ec2c1a2aaa6994f0cc2b8ae11590cc

Contents?: true

Size: 988 Bytes

Versions: 2

Compression:

Stored size: 988 Bytes

Contents

require 'spec_helper'
require 'project_examples'

require 'dm-visualizer/project'

describe DataMapper::Visualizer::Project do
  context "library" do
    let(:dir) { project_dir('library') }

    subject do
      described_class.new(
        :include => [File.join(dir,'lib')],
        :require => ['blog']
      )
    end

    it_should_behave_like "a Ruby project"

    it "should require the specified paths" do
      subject.load!

      Object.should be_const_defined('Blog')
    end
  end

  context "rails" do
    let(:dir) { project_dir('rails') }

    subject do
      described_class.new(
        :include     => [dir],
        :require_all => ['app/models/*.rb']
      )
    end

    it_should_behave_like "a Ruby project"

    it "should require all paths that match the specified glob patterns" do
      subject.load!

      Object.should be_const_defined('User')
      Object.should be_const_defined('Post')
      Object.should be_const_defined('Comment')
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dm-visualizer-0.2.3 spec/project_spec.rb
dm-visualizer-0.2.2 spec/project_spec.rb