spec/crush/jsmin_spec.rb in crush-0.2.0 vs spec/crush/jsmin_spec.rb in crush-0.3.0

- old
+ new

@@ -1,15 +1,16 @@ require "spec_helper" -require "jsmin" describe Crush::JSMin do - specify { Crush::JSMin.engine_name.should == "jsmin" } + specify { Crush::JSMin.default_mime_type.should == "application/javascript" } - it "is registered for '.js' files" do - Crush.mappings["js"].should include(Crush::JSMin) + it "minifies using JSMin" do + ::JSMin.should_receive(:minify).with("hello").and_return("world") + Crush::JSMin.compress("hello").should == "world" end - it "minifies using JSMin" do + it "is registered with Tilt" do ::JSMin.should_receive(:minify).with("hello").and_return("world") - Crush::JSMin.new.compress("hello").should == "world" + Tilt.register Crush::JSMin, "js" + Tilt.new("application.js").compress("hello").should == "world" end end