sprockets-vendor_gems/spec/sprockets-vendor_gems_spec.rb

43 lines
904 B
Ruby
Raw Normal View History

2012-02-08 14:00:33 +00:00
require 'spec_helper'
describe Sprockets do
include FakeFS::SpecHelpers
describe '.find_gem_vendor_paths' do
let(:gem_dir) { "dir" }
let(:gemspec) { stub(:gem_dir => gem_dir) }
let(:paths) do
%w{vendor lib app}.collect do |dir|
File.join(gem_dir, dir, 'assets/javascripts')
File.join(gem_dir, dir, 'assets/stylesheets')
end
end
before do
paths.each { |path| FileUtils.mkdir_p path }
Gem::Specification.stubs(:each).yields(gemspec)
end
subject { described_class.find_gem_vendor_paths }
it { should =~ paths }
end
end
describe Sprockets::EnvironmentWithVendoredGems do
let(:env) { described_class.new }
let(:path) { 'path' }
before do
Sprockets.expects(:find_gem_vendor_paths).returns([ path ])
described_class.any_instance.expects(:append_path).with(path)
end
it 'should work' do
env
end
end