Sha256: 6befe5f46651cab98f7771bdeccd3c86b4020c4eda192adc722bdbcca36acd70

Contents?: true

Size: 1.16 KB

Versions: 1

Compression:

Stored size: 1.16 KB

Contents

require 'spec_helper'

describe BlueprintsBoy::Configuration do
  it "should have filename with default value" do
    subject.filenames.should == %w{blueprints.rb blueprints/*.rb spec/blueprints.rb spec/blueprints/*.rb test/blueprints.rb test/blueprints/*.rb}.collect do |f|
      Pathname.new(f)
    end
  end

  it "should have correct attribute values" do
    subject.prebuild.should == []
    subject.transactions.should be_truthy
    subject.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
    subject.root.should == Pathname.new('rails/root')
    Object.send(:remove_const, :Rails)
  end

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

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

  it "should set global to array of global blueprints" do
    subject.global.should == []
    subject.global = :cherry
    subject.global.should == [:cherry]
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
blueprints_boy-1.0.0 spec/unit/configuration_spec.rb