Sha256: a607b4b0e58b2ce5523d7dd7f96cf395c16ae31c8973dbbb1ed1a1af58541182

Contents?: true

Size: 1.9 KB

Versions: 7

Compression:

Stored size: 1.9 KB

Contents

require 'allen/settings'

describe Allen::Settings do
  let(:pwd) { Dir.pwd }

  it "has good defaults" do
    settings = Allen::Settings.new
    settings.client.should            == "Client"
    settings.css_input.should         == "assets/stylesheets/app/application.less"
    settings.css_output.should        == "css/application.css"
    settings.css_preprocessor.should  == :banshee
    settings.js_input.should          == "assets/javascripts/app/application.coffee"
    settings.js_output.should         == "js/application.js"
    settings.js_preprocessor.should   == :banshee
    settings.root_dir.should          == pwd
    settings.src_dir.should           == "#{pwd}/src"
    settings.solution.should          == "#{pwd}/src/Client.sln"
    settings.targets.should           == [:clean, :build]
    settings.parameters.should        == ""
    settings.webroot.should           == "#{pwd}/src/Client.Umbraco"
  end

  it "allows the defaults to be overridden" do
    settings = Allen::Settings.new
    settings.configure do
      client "FlavaFlav"
      root_dir "~/Desktop"
    end

    settings.client.should == "FlavaFlav"
    settings.root_dir.should == "~/Desktop"
    settings.solution.should == "~/Desktop/src/FlavaFlav.sln"
  end

  it "can be copied and overriden" do
    global_settings = Allen::Settings.new
    global_settings.configure do
      client "PedoBear"
      webroot { "~/Desktop/#{client}/wwwroot" }
      cache false
    end

    local_settings = global_settings.clone
    local_settings.configure do
      client "GoodGuyGreg"
      webroot { "~/Desktop/#{client}/public" }
    end

    global_settings.client.should == "PedoBear"
    global_settings.webroot.should == "~/Desktop/PedoBear/wwwroot"
    global_settings.cache.should == false
    local_settings.client.should == "GoodGuyGreg"
    local_settings.webroot.should == "~/Desktop/GoodGuyGreg/public"
    local_settings.cache.should == false
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
allen-0.3.4 spec/lib/allen/settings_spec.rb
allen-0.3.3 spec/lib/allen/settings_spec.rb
allen-0.3.2 spec/lib/allen/settings_spec.rb
allen-0.3.1 spec/lib/allen/settings_spec.rb
allen-0.3.0 spec/lib/allen/settings_spec.rb
allen-0.2.0 spec/lib/allen/settings_spec.rb
allen-0.1.5 spec/lib/allen/settings_spec.rb