Permalink
Browse files

implement new rspec test to check if css @font-face rules are correct…

…ly handled. And it seem to be OK ( fix #7 ref #13 )
  • Loading branch information...
1 parent 5ab3ff4 commit 40236fbe7a77a7e64228f128685bca44e9360513 @thomaspierson committed Feb 3, 2013
Showing with 36 additions and 0 deletions.
  1. +36 −0 spec/css2less_spec.rb
View
36 spec/css2less_spec.rb
@@ -92,5 +92,41 @@
converter.process_less
converter.get_less.should eq(less)
end
+
+ it "should correctly handle @font-face rules" do
+ css = <<EOF
+@font-face {
+ font-family: 'MyWebFont';
+ src: url('webfont.eot'); /* IE9 Compat Modes */
+ src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
+ url('webfont.woff') format('woff'), /* Modern Browsers */
+ url('webfont.ttf') format('truetype'), /* Safari, Android, iOS */
+ url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
+}
+
+#hello {
+ color: blue;
+}
+#hello #buddy {
+ background: red;
+}
+EOF
+ less = <<EOF
+@font-face {
+ font-family: 'MyWebFont';
+ src: url('webfont.eot');
+ src: url('webfont.eot?#iefix') format('embedded-opentype'), url('webfont.woff') format('woff'), url('webfont.ttf') format('truetype'), url('webfont.svg#svgFontName') format('svg');
+}
+#hello {
+ color: blue;
+ #buddy {
+ background: red;
+ }
+}
+EOF
+ converter = Css2Less::Converter.new(css)
+ converter.process_less
+ converter.get_less.should eq(less)
+ end
end

0 comments on commit 40236fb

Please sign in to comment.