Permalink
Browse files

Added test for `sprite-replace-text`. I've never programmed in ruby b…

…efore, so it probably doesn't actually work! Please fix if you know how :)
  • Loading branch information...
1 parent 7f89d66 commit b9bd7c4b71b8f7eb56f4a252ca34fdc3b194bf4d @ultimatedelman committed Sep 26, 2011
Showing with 32 additions and 0 deletions.
  1. +32 −0 test/integrations/sprites_test.rb
View
32 test/integrations/sprites_test.rb
@@ -604,4 +604,36 @@ def render(scss)
CSS
end
+ it "should replace text with images and dimensions using sprites"
+ css = render <<-SCSS
+ @import "imgs/*.png";
+ $sprite: sprite-map("imgs/*.png");
+ .myImg {
+ @include sprite-replace-text($sprite, myImg);
+ }
+ .yourImg {
+ @include sprite-replace-text($sprite, yourImg);
+ }
+ SCSS
+ assert_correct css, <<-CSS
+ .myImg {
+ text-indent: -119988px;
+ overflow: hidden;
+ text-align: left;
+ background: url('imgs/imgs-s3020e82f52.png') 0 0 no-repeat;
+ display: block;
+ width: 26px; //whatever the dimensions are
+ height: 26px;
+ }
+ .yourImg {
+ text-indent: -119988px;
+ overflow: hidden;
+ text-align: left;
+ background: url('imgs/imgs-s3020e82f52.png') 0 -26px no-repeat; //shifted
+ display: block;
+ width: 26px; //whatever the dimensions are
+ height: 26px;
+ }
+ CSS
+ end
end

0 comments on commit b9bd7c4

Please sign in to comment.