Permalink
Browse files

Update sprocketize in tests too

  • Loading branch information...
1 parent 897c497 commit 8620c88750b490554196c2626f665adda6543421 @josh josh committed Dec 16, 2011
Showing with 11 additions and 11 deletions.
  1. +11 −11 test/test_sprocketize.rb
View
22 test/test_sprocketize.rb
@@ -2,9 +2,9 @@
require 'shellwords'
require 'tmpdir'
-class TestSprocketize < Sprockets::TestCase
+class TestSprockets < Sprockets::TestCase
def setup
- @dir = File.join(Dir::tmpdir, 'sprocketize')
+ @dir = File.join(Dir::tmpdir, 'sprockets')
end
def teardown
@@ -15,38 +15,38 @@ def teardown
end
test "show version for -v flag" do
- output = sprocketize "-v"
+ output = sprockets "-v"
assert_equal "#{Sprockets::VERSION}\n", output
end
test "show help for -h flag" do
- output = sprocketize "-h"
- assert_match "Usage: sprocketize", output
+ output = sprockets "-h"
+ assert_match "Usage: sprockets", output
end
test "show help for no flags or inputs" do
- output = sprocketize
- assert_match "Usage: sprocketize", output
+ output = sprockets
+ assert_match "Usage: sprockets", output
end
test "compile simple file" do
- output = sprocketize fixture_path("default/gallery.js")
+ output = sprockets fixture_path("default/gallery.js")
assert_equal "var Gallery = {};\n", output
end
test "compile file with dependencies" do
- output = sprocketize "-I", fixture_path("asset"), fixture_path("asset/application.js")
+ output = sprockets "-I", fixture_path("asset"), fixture_path("asset/application.js")
assert_equal "var Project = {\n find: function(id) {\n }\n};\nvar Users = {\n find: function(id) {\n }\n};\n\n\n\ndocument.on('dom:loaded', function() {\n $('search').focus();\n});\n", output
end
test "compile asset to output directory" do
- output = sprocketize "-I", fixture_path("default"), "-o", @dir, fixture_path("default/gallery.js")
+ output = sprockets "-I", fixture_path("default"), "-o", @dir, fixture_path("default/gallery.js")
assert_equal "", output
assert File.exist?("#{@dir}/manifest.json")
assert File.exist?("#{@dir}/gallery-14c3b648520bac7a78379b54161c8a9e.js")
end
- def sprocketize(*args)
+ def sprockets(*args)
script = File.expand_path("../../bin/sprockets", __FILE__)
lib = File.expand_path("../../lib", __FILE__)
`ruby -I#{lib} #{script} #{Shellwords.join(args)}`

0 comments on commit 8620c88

Please sign in to comment.