Skip to content
This repository
Browse code

Remove default pwd from load path

Fixes #266
  • Loading branch information...
commit 669e261eb880c539ab7b4bcd2b1b0f3f2bbaca7c 1 parent c6e7cbb
Joshua Peek authored December 19, 2011
6  bin/sprockets
@@ -64,7 +64,11 @@ OptionParser.new do |opts|
64 64
   end
65 65
 end
66 66
 
67  
-environment.append_path(".")
  67
+if environment.paths.empty?
  68
+  warn "No load paths given"
  69
+  warn "Usage: sprockets -Ijavascripts/ filename"
  70
+  exit 1
  71
+end
68 72
 
69 73
 if manifest
70 74
   manifest.compile(filenames)
7  test/test_sprocketize.rb
@@ -33,8 +33,13 @@ def teardown
33 33
     assert_match "Usage: sprockets", output
34 34
   end
35 35
 
36  
-  test "compile simple file" do
  36
+  test "error if load path is missing" do
37 37
     output = sprockets fixture_path("default/gallery.js")
  38
+    assert_equal 1, $?.exitstatus
  39
+  end
  40
+
  41
+  test "compile simple file" do
  42
+    output = sprockets "-I", fixture_path("default"), fixture_path("default/gallery.js")
38 43
     assert_equal "var Gallery = {};\n", output
39 44
   end
40 45
 

0 notes on commit 669e261

Please sign in to comment.
Something went wrong with that request. Please try again.