Sha256: 550e1ec488c4f2142d873cb8b27c9a9261dc0e659c3954ca7ae216be27612414

Contents?: true

Size: 1003 Bytes

Versions: 5

Compression:

Stored size: 1003 Bytes

Contents

require 'helpers/boot'

describe "Nested dependency" do
  before(:all) do
    Sprockets::Preload.precompiles += ["nested/nested.js"]
  end

  after(:all) do
    Sprockets::Preload.precompiles -= ["nested/nested.js"]
  end

  it "serves detached" do
    Sprockets::Preload.environment['sprockets/preload/assets'].source.should == "test2\n;\n\n"
  end

  context "inlined", inline: true do
    it "keeps inlines" do
      Sprockets::Preload.environment['nested/nested'].source.should include("test1", "test2")
      Sprockets::Preload.environment['nested/nested'].source.should include("SprocketsPreload.inline = true")
    end
  end

  context "detached", inline: false do
    it "keeps inlines" do
      Sprockets::Preload.environment['nested/nested'].source.should include("test1")
      Sprockets::Preload.environment['nested/nested'].source.should_not include("test2")
      Sprockets::Preload.environment['nested/nested'].source.should_not include("SprocketsPreload.inline = true")
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sprockets-preload-0.1.0 spec/integrational/nested_spec.rb
sprockets-preload-0.0.5 spec/integrational/nested_spec.rb
sprockets-preload-0.0.4 spec/integrational/nested_spec.rb
sprockets-preload-0.0.3 spec/integrational/nested_spec.rb
sprockets-preload-0.0.2 spec/integrational/nested_spec.rb