Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove default pwd from load path

Fixes #266
  • Loading branch information...
commit 669e261eb880c539ab7b4bcd2b1b0f3f2bbaca7c 1 parent c6e7cbb
@josh josh authored
Showing with 11 additions and 2 deletions.
  1. +5 −1 bin/sprockets
  2. +6 −1 test/test_sprocketize.rb
View
6 bin/sprockets
@@ -64,7 +64,11 @@ OptionParser.new do |opts|
end
end
-environment.append_path(".")
+if environment.paths.empty?
+ warn "No load paths given"
+ warn "Usage: sprockets -Ijavascripts/ filename"
+ exit 1
+end
if manifest
manifest.compile(filenames)
View
7 test/test_sprocketize.rb
@@ -33,8 +33,13 @@ def teardown
assert_match "Usage: sprockets", output
end
- test "compile simple file" do
+ test "error if load path is missing" do
output = sprockets fixture_path("default/gallery.js")
+ assert_equal 1, $?.exitstatus
+ end
+
+ test "compile simple file" do
+ output = sprockets "-I", fixture_path("default"), fixture_path("default/gallery.js")
assert_equal "var Gallery = {};\n", output
end
Please sign in to comment.
Something went wrong with that request. Please try again.