Sha256: fd4e9f77a53256247e1943a706f09e63bb60c77649b461689718c2e5b33b11a8
Contents?: true
Size: 1.29 KB
Versions: 2
Compression:
Stored size: 1.29 KB
Contents
require 'spec_helper' describe Jasmine::AssetExpander do it "expands asset files" do bundled_asset = double(:bundled_asset, :to_a => ['asset1', 'asset2'], :pathname => double(:pathname, :to_s => '/some_src_dir/asset_file')) bundled_asset_getter = lambda do |filepath, ext| if filepath == 'asset_file' && ext == 'js' bundled_asset end end asset_path_getter = lambda do |asset| if asset == 'asset1' 'asset1_path' elsif asset == 'asset2' 'asset2_path' end end expander = Jasmine::AssetExpander.new(bundled_asset_getter, asset_path_getter) expanded_assets = expander.expand('/some_src_dir', 'asset_file') expanded_assets.should == ['/asset_file?body=true', '/asset1_path?body=true', '/asset2_path?body=true'] end it "return nil if no bundled asset is found" do bundled_asset = nil bundled_asset_getter = lambda do |filepath, ext| if filepath == 'asset_file' && ext == 'js' bundled_asset end end expander = Jasmine::AssetExpander.new(bundled_asset_getter, lambda {}) expanded_assets = expander.expand('/some_src_dir', 'asset_file') expanded_assets.should be_nil end end
Version data entries
2 entries across 2 versions & 2 rubygems
Version | Path |
---|---|
jasmine-multi_json-1.3.1.1 | spec/asset_expander_spec.rb |
jasmine-1.3.1 | spec/asset_expander_spec.rb |