Sha256: ce7a5dee889926e61f00cf08c1485a25f8cba808e54ded21da1a0da4fec13c04

Contents?: true

Size: 911 Bytes

Versions: 4

Compression:

Stored size: 911 Bytes

Contents

require 'awestruct/config'
require 'spec_helper'
require 'awestruct/config'
require 'awestruct/cli/options'

describe Awestruct::Config do

  it "should accept a list of files in .awestruct_ignore to ignore on site generation" do
    site_dir = File.join(File.dirname(__FILE__), 'test-data')
    opts = Awestruct::CLI::Options.new
    opts.source_dir = site_dir

    config = Awestruct::Config.new(opts)
    config.ignore.should == ["Rakefile", "Gemfile"]
  end

  it "should handle an empty .awestruct_ignore file without barfing" do
    site_dir = File.join(File.dirname(__FILE__), 'test-data')
    config_file = File.join(site_dir, ".awestruct_ignore")
    opts = Awestruct::CLI::Options.new
    opts.source_dir = site_dir
    File.open(config_file, "w")
    config = Awestruct::Config.new(opts)
    config.ignore.should == []
    File.open(config_file, "w") { |f| f.write("Rakefile\nGemfile\n") }
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
awestruct-0.5.4.rc3 spec/config_spec.rb
awestruct-0.5.4.rc2 spec/config_spec.rb
awestruct-0.5.4.rc spec/config_spec.rb
awestruct-0.5.4.beta1 spec/config_spec.rb