crush 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/crush/sass.rb +1 -2
- data/lib/crush/version.rb +1 -1
- data/spec/crush/sass_spec.rb +6 -6
- metadata +1 -1
data/lib/crush/sass.rb
CHANGED
@@ -23,12 +23,11 @@ module Crush
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def prepare
|
26
|
-
@engine = ::Sass::Engine.new DEFAULT_OPTIONS.dup.merge(options)
|
27
26
|
@output = nil
|
28
27
|
end
|
29
28
|
|
30
29
|
def evaluate(scope, locals, &block)
|
31
|
-
@output ||=
|
30
|
+
@output ||= ::Sass::Engine.new(data, DEFAULT_OPTIONS.dup.merge(options)).render
|
32
31
|
end
|
33
32
|
end
|
34
33
|
end
|
data/lib/crush/version.rb
CHANGED
data/spec/crush/sass_spec.rb
CHANGED
@@ -5,22 +5,22 @@ describe Crush::Sass::Engine do
|
|
5
5
|
|
6
6
|
it "compresses using Sass::Engine" do
|
7
7
|
compressor = mock(:compressor)
|
8
|
-
::Sass::Engine.should_receive(:new).with(:style => :compressed, :syntax => :scss).and_return(compressor)
|
9
|
-
compressor.should_receive(:render).
|
8
|
+
::Sass::Engine.should_receive(:new).with("hello", :style => :compressed, :syntax => :scss).and_return(compressor)
|
9
|
+
compressor.should_receive(:render).and_return("world")
|
10
10
|
Crush::Sass::Engine.compress("hello").should == "world"
|
11
11
|
end
|
12
12
|
|
13
13
|
it "sends options to Sass::Engine" do
|
14
14
|
compressor = mock(:compressor)
|
15
|
-
::Sass::Engine.should_receive(:new).with(:style => :compressed, :syntax => :scss, :foo => "bar").and_return(compressor)
|
16
|
-
compressor.should_receive(:render).
|
15
|
+
::Sass::Engine.should_receive(:new).with("hello", :style => :compressed, :syntax => :scss, :foo => "bar").and_return(compressor)
|
16
|
+
compressor.should_receive(:render).and_return("world")
|
17
17
|
Crush::Sass::Engine.new(:foo => "bar").compress("hello")
|
18
18
|
end
|
19
19
|
|
20
20
|
it "is registered with Tilt" do
|
21
21
|
compressor = mock(:compressor)
|
22
|
-
::Sass::Engine.should_receive(:new).with(:style => :compressed, :syntax => :scss).and_return(compressor)
|
23
|
-
compressor.should_receive(:render).
|
22
|
+
::Sass::Engine.should_receive(:new).with("hello", :style => :compressed, :syntax => :scss).and_return(compressor)
|
23
|
+
compressor.should_receive(:render).and_return("world")
|
24
24
|
Tilt.register Crush::Sass::Engine, "css"
|
25
25
|
Tilt.new("application.css").compress("hello").should == "world"
|
26
26
|
end
|