sprockets-vendor_gems/spec/sprockets-vendor_gems_spec.rb
Tim Linquist 8bb51f0227 Use backwards compatible rubygems api
Following Bundler's lead, use loaded_specs api to look for possible
javascript / stylesheets to inform Sprockets of in
jasmine-headless-webkit.
2012-07-31 10:00:42 -07:00

43 lines
911 B
Ruby

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 }
Sprockets::GemEnvironment.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