Sha256: a27e5c762e6b22296cbc449f9abcf27a8668e513d8493d00f9f4694ed71d4c75

Contents?: true

Size: 1.79 KB

Versions: 11

Compression:

Stored size: 1.79 KB

Contents

require "#{File.dirname(__FILE__)}/../screw_unit_spec_helper"

module ScrewUnit

  describe ".configure" do
    it "instance evals the given block in an instance of Configuration" do
      block = lambda {}
      mock(Configuration.instance.instance_eval(&block))
      ScrewUnit.configure(&block)
    end
  end

  describe Configuration do
    attr_reader :configuration
    before do
      @configuration = Configuration.new
    end

    describe ".instance" do
      it "always returns the same instance of Configuration" do
        instance = Configuration.instance
        instance.class.should == Configuration
        instance.should == Configuration.instance
      end
    end

    describe "#load_screwrc" do
      it "loads .screwrc from the given base_path and assigns #path_containing_screwrc" do
        mock(configuration).load("/base/path/.screwrc")
        configuration.load_screwrc("/base/path")
        configuration.path_containing_screwrc.should == "/base/path"
      end
    end

    describe "#add_js_location" do
      it "proxies to #asset_manager after absolutizing the relative physical path from the path containing the .screwrc file" do
        stub(configuration).path_containing_screwrc { '/path_containing_screwrc' }
        mock(configuration.asset_manager).add_js_location('/foo', '/path_containing_screwrc/bar')
        configuration.add_js_location('/foo', 'bar')
      end
    end

    describe "#add_location" do
      it "proxies to #asset_manager after absolutizing the relative physical path from the path containing the .screwrc file" do
        stub(configuration).path_containing_screwrc { '/path_containing_screwrc' }
        mock(configuration.asset_manager).add_location('/foo', '/path_containing_screwrc/bar')
        configuration.add_location('/foo', 'bar')
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
coolerator.vision-0.2.10 spec/support/vendor/screw-unit/spec/screw_unit/configuration_spec.rb
coolerator.vision-0.2.9 spec/support/vendor/screw-unit/spec/screw_unit/configuration_spec.rb
coolerator.vision-0.2.8 spec/support/vendor/screw-unit/spec/screw_unit/configuration_spec.rb
coolerator.vision-0.2.7 spec/support/vendor/screw-unit/spec/screw_unit/configuration_spec.rb
coolerator.vision-0.2.6 spec/support/vendor/screw-unit/spec/screw_unit/configuration_spec.rb
coolerator.vision-0.2.5 spec/support/vendor/screw-unit/spec/screw_unit/configuration_spec.rb
coolerator.vision-0.2.4 spec/support/vendor/screw-unit/spec/screw_unit/configuration_spec.rb
coolerator.vision-0.2.3 spec/support/vendor/screw-unit/spec/screw_unit/configuration_spec.rb
coolerator.vision-0.2.2 spec/support/vendor/screw-unit/spec/screw_unit/configuration_spec.rb
coolerator.vision-0.2.1 spec/support/vendor/screw-unit/spec/screw_unit/configuration_spec.rb
coolerator.vision-0.2.0 spec/support/vendor/screw-unit/spec/screw_unit/configuration_spec.rb