Sha256: 0b1eb2e36557d27c4059b3fa703b1aa75798d2dc3d0c8907774d2d08822a726f
Contents?: true
Size: 1.18 KB
Versions: 2
Compression:
Stored size: 1.18 KB
Contents
require 'sprockets' require 'spec_helper' require 'sprockets/media_query_combiner/processor' module Sprockets::MediaQueryCombiner pretty_input_css = <<CSS h3 { color: orange } @media (max-width: 480px) { h1 { color: red } } @media (max-width: 980px) { h4 { color: black } } @media (max-width: 480px) { h2 { color: blue } } b { color: yellow } CSS pretty_target_css = <<CSS h3 { color: orange } b { color: yellow } @media (max-width: 480px) { h1 { color: red } h2 { color: blue } } @media (max-width: 980px) { h4 { color: black } } CSS ugly_input_css = "h3{color:orange}@media (max-width:480px){h1{color:red}}@media (max-width:980px){h4{color:black}}@media (max-width:480px){h2{color:blue}}\n" ugly_target_css = "h3{color:orange}@media (max-width:480px){h1{color:red}h2{color:blue}}@media (max-width:980px){h4{color:black}}\n" output = lambda { |input| Processor.call( { data: input } ) } describe Processor do it "should work with pretty css" do output[pretty_input_css].should == pretty_target_css end it "should work with ugly css" do output[ugly_input_css].should == ugly_target_css end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
sprockets-media_query_combiner-1.0.1 | spec/sprockets/media_query_combiner/processor_spec.rb |
sprockets-media_query_combiner-1.0.0 | spec/sprockets/media_query_combiner/processor_spec.rb |