Sha256: c92751c16b66a29f4ac4c243bc224eee88e63ade86d36345a479efb0bb967249

Contents?: true

Size: 766 Bytes

Versions: 1

Compression:

Stored size: 766 Bytes

Contents

require 'spec_helper'

describe EngineAssets::PublicLocator do
  attr_reader :base_path, :find_path, :miss_path

  before do
    @base_path = File.join(basedir, 'spec', 'support', 'fixtures', 'public')
    @find_path = '/javascripts/dual.js'
    @miss_path = '/javascripts/miss.js'

    EngineAssets::PublicLocator.paths << base_path
  end

  describe "#locate" do
    context "when the requested sub-path is located" do
      it "returns the full path to the file" do
        EngineAssets::PublicLocator.locate(find_path).should == File.join(base_path, find_path)
      end
    end

    context "when the requested sub-path is not located" do
      it "returns nil" do
        EngineAssets::PublicLocator.locate(miss_path).should be_nil
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
engine-assets-0.3.0 spec/lib/engine_assets/public_locator_spec.rb