Skip to content
This repository has been archived by the owner on Jan 16, 2022. It is now read-only.

Commit

Permalink
Merge branch 'brigade-path_mapper_fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregg Van Hove committed Jun 12, 2015
2 parents 2cd7c64 + 1920251 commit 869cae7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/jasmine/path_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def map(paths, remove_path, add_path)
if path[0..3] == 'http'
path
else
File.join(add_path, (path.gsub(remove_path, '')))
File.join(add_path, (path.sub(remove_path, '')))
end
end
end
Expand Down
5 changes: 5 additions & 0 deletions spec/path_mapper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,9 @@
mapper = Jasmine::PathMapper.new(config)
mapper.map_src_paths(['/src_dir/foo']).should == ['/src_dir/foo']
end
it 'handles edge case with multiple instances of src dir' do
config = double(:config, :src_dir => '/app', :src_path => '/')
mapper = Jasmine::PathMapper.new(config)
mapper.map_src_paths(['/app/assets/application.js']).should == ['/assets/application.js']
end
end

0 comments on commit 869cae7

Please sign in to comment.