Sha256: ea3cd62c8b099ef0b08db0cca0c73c6a076b1d0cc7932ca05454536561652d58

Contents?: true

Size: 1.09 KB

Versions: 3

Compression:

Stored size: 1.09 KB

Contents

require 'dm-visualizer/project'

require 'spec_helper'
require 'helpers/project'
require 'project_examples'

describe DataMapper::Visualizer::Project do
  include Helpers::Project

  context "library" do
    before(:all) do
      @dir = project_dir('library')
      @project = DataMapper::Visualizer::Project.new(
        :include => [File.join(@dir,'lib')],
        :require => ['blog']
      )
    end

    it_should_behave_like "a Ruby project"

    it "should require the specified paths" do
      @project.load!

      Object.const_defined?('Blog').should == true
    end
  end

  context "rails" do
    before(:all) do
      @dir = project_dir('rails')
      @project = DataMapper::Visualizer::Project.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
      @project.load!

      Object.const_defined?('User').should == true
      Object.const_defined?('Post').should == true
      Object.const_defined?('Comment').should == true
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dm-visualizer-0.2.1 spec/project_spec.rb
dm-visualizer-0.2.0 spec/project_spec.rb
dm-visualizer-0.1.0 spec/project_spec.rb