Sha256: 8e66d69ac733b29cf73cfa934721872558bd49b3c469f881dc0eefbc7fd9092b

Contents?: true

Size: 1.09 KB

Versions: 3

Compression:

Stored size: 1.09 KB

Contents

require File.dirname(__FILE__) + '/spec_helper'

describe Blueprints::Configuration do
  before do
    @config = Blueprints::Configuration.new
  end

  it "should have filename with default value" do
    @config.filename.should == %w{blueprint.rb blueprint/*.rb spec/blueprint.rb spec/blueprint/*.rb test/blueprint.rb test/blueprint/*.rb}.collect do |f|
      Pathname.new(f)
    end
  end

  it "should have correct attribute values" do\
    @config.prebuild.should == []
    @config.transactions.should be_true
    @config.root.should == Pathname.pwd
  end

  it "should use Rails root for root if it's defined" do
    module Rails
      def self.root
        Pathname.new('rails/root')
      end
    end
    Blueprints::Configuration.new.root.should == Pathname.new('rails/root')
    Object.send(:remove_const, :Rails)
  end

  it "should set root to pathname" do
    @config.root = "root"
    @config.root.should == Pathname.new("root")
  end

  it "should automatically set filename to array of path names" do
    @config.filename = "my_file.rb"
    @config.filename.should == [Pathname.new("my_file.rb")]
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
blueprints-0.8.2 spec/unit/configuration_spec.rb
blueprints-0.8.1 spec/unit/configuration_spec.rb
blueprints-0.8.0 spec/unit/configuration_spec.rb