diff --git a/lib/jasmine/asset_expander.rb b/lib/jasmine/asset_expander.rb index 484ea30d..7f0f287b 100644 --- a/lib/jasmine/asset_expander.rb +++ b/lib/jasmine/asset_expander.rb @@ -10,9 +10,8 @@ def expand(src_dir, src_path) bundled_asset = @bundled_asset_factory.call(pathname, 'js') return nil unless bundled_asset - base_asset = "#{bundled_asset.pathname.to_s.gsub(/#{src_dir}/, '')}?body=true" - bundled_asset.to_a.inject([base_asset]) do |assets, asset| - assets << "/#{@asset_path_for.call(asset).gsub(/^\//, '')}?body=true" + bundled_asset.to_a.map do |asset| + "/#{@asset_path_for.call(asset).gsub(/^\//, '')}?body=true" end.flatten end end diff --git a/spec/asset_expander_spec.rb b/spec/asset_expander_spec.rb index d47d9eec..b14fc027 100644 --- a/spec/asset_expander_spec.rb +++ b/spec/asset_expander_spec.rb @@ -22,8 +22,7 @@ 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', + expanded_assets.should == ['/asset1_path?body=true', '/asset2_path?body=true'] end