Skip to content

Commit

Permalink
Add test to ensure no traversal
Browse files Browse the repository at this point in the history
  • Loading branch information
bkeepers committed Jul 10, 2016
1 parent 7faa098 commit 39f708c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion spec/scss_converter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ def converter(overrides = {})
"sass" => {
"load_paths" => [
"bower_components/*",
Dir.tmpdir
Dir.tmpdir,
"../.."
]
}
}))
Expand All @@ -264,6 +265,13 @@ def converter(overrides = {})
it "ignores external load paths" do
expect(converter.sass_load_paths).not_to include(Dir.tmpdir)
end

it "does not allow traversing outside source directory" do
converter.sass_load_paths.each do |path|
expect(path).to include(source_dir)
expect(path).not_to include('..')
end
end
end
end
end

0 comments on commit 39f708c

Please sign in to comment.