Sha256: 18f752dbd01fc6c71dde1dc9fa6033607e1632f88058d861b9d2f06c366af580

Contents?: true

Size: 1.15 KB

Versions: 11

Compression:

Stored size: 1.15 KB

Contents

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

module ScrewUnit
  describe JsFile do
    attr_reader :js_file, :dir

    before do
      @dir = File.expand_path(File.dirname(__FILE__))
      asset_manager = Configuration.new.asset_manager
      asset_manager.add_js_location("/implementations", "#{dir}/file_system_fixtures_for_asset_manager_specs/dir_3")
      @js_file = JsFile.new("#{dir}/file_system_fixtures_for_asset_manager_specs/dir_1/1.js", asset_manager)
    end

    describe "#require_declarations" do
      it "returns a relative or global RequireDeclaration for every Sprockets-style require declaration in the file" do
        require_declarations = js_file.require_declarations
        require_declarations.size.should == 3
        require_declarations[0].js_file.physical_path.should == "#{dir}/file_system_fixtures_for_asset_manager_specs/dir_1/subdir_1/4.js"
        require_declarations[1].js_file.physical_path.should == "#{dir}/file_system_fixtures_for_asset_manager_specs/dir_1/7.js"
        require_declarations[2].js_file.physical_path.should == "#{dir}/file_system_fixtures_for_asset_manager_specs/dir_3/3.js"
      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/js_file_spec.rb
coolerator.vision-0.2.9 spec/support/vendor/screw-unit/spec/screw_unit/js_file_spec.rb
coolerator.vision-0.2.8 spec/support/vendor/screw-unit/spec/screw_unit/js_file_spec.rb
coolerator.vision-0.2.7 spec/support/vendor/screw-unit/spec/screw_unit/js_file_spec.rb
coolerator.vision-0.2.6 spec/support/vendor/screw-unit/spec/screw_unit/js_file_spec.rb
coolerator.vision-0.2.5 spec/support/vendor/screw-unit/spec/screw_unit/js_file_spec.rb
coolerator.vision-0.2.4 spec/support/vendor/screw-unit/spec/screw_unit/js_file_spec.rb
coolerator.vision-0.2.3 spec/support/vendor/screw-unit/spec/screw_unit/js_file_spec.rb
coolerator.vision-0.2.2 spec/support/vendor/screw-unit/spec/screw_unit/js_file_spec.rb
coolerator.vision-0.2.1 spec/support/vendor/screw-unit/spec/screw_unit/js_file_spec.rb
coolerator.vision-0.2.0 spec/support/vendor/screw-unit/spec/screw_unit/js_file_spec.rb