File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 3
3
class Sprockets ::SassCompressor
4
4
def call ( *args )
5
5
input = if defined? ( data )
6
- data
6
+ data # sprockets 2.x
7
7
else
8
- args [ 0 ] [ :data ]
8
+ args [ 0 ] [ :data ] #sprockets 3.x
9
9
end
10
10
11
11
SassC ::Engine . new (
@@ -15,5 +15,7 @@ def call(*args)
15
15
}
16
16
) . render
17
17
end
18
+
19
+ # sprockets 2.x
18
20
alias :evaluate :call
19
21
end
Original file line number Diff line number Diff line change @@ -204,6 +204,23 @@ def test_compression_works
204
204
CSS
205
205
end
206
206
207
+ def test_compression_works
208
+ initialize_prod!
209
+
210
+ asset = render_asset ( "application.scss" )
211
+ assert_equal <<-CSS , asset
212
+ .hello{color:#FFF}
213
+ CSS
214
+ end
215
+
216
+ def test_sassc_compression_is_used
217
+ initialize_prod!
218
+
219
+ engine = stub ( render : "" )
220
+ SassC ::Engine . expects ( :new ) . returns ( engine )
221
+ SassC ::Engine . expects ( :new ) . with ( "" , { style : :compressed } ) . returns ( engine )
222
+ render_asset ( "application.scss" )
223
+ end
207
224
#test 'sprockets require works correctly' do
208
225
# skip
209
226
You can’t perform that action at this time.
0 commit comments